/* 영어 화면(web/en/) 전용 보정. web/style.css 뒤에 불러온다. 색·글꼴·카드 모양은 style.css 것을 그대로 쓴다. */
body[data-page^="en"] .site-nav { flex-wrap: wrap; row-gap: 0; } /* 넘침 막이(평소엔 한 줄 — 12/01 5차에 메뉴 글을 Card·60 Pillars·Chart로 줄임) */
@media (max-width: 389px) { body[data-page^="en"] .site-nav { flex-basis: 100%; justify-content: flex-start; } } /* 390px 미만: 로고 한 줄, 메뉴는 그 아래 한 줄(메뉴가 두 줄로 꺾여 로고가 어중간하게 뜨지 않게) */
body[data-page^="en:"] .site-head { min-height: 0; } /* web/en/ 쪽은 글자 크기·밝기 단추(한글 단추)를 붙이지 않아 둘째 줄 자리가 필요 없다. en.html(data-page="en")은 단추가 붙으므로 그대로 둔다 */
.site-foot { max-width: 560px; margin: 0 auto; padding: 0 16px 24px; } /* en.html 꼬리: 본문과 같은 폭·옆 여백 */
.date-row label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 14px; color: var(--muted); } /* Year·Month·Day 는 글자가 길어 칸 위에 올린다 */
#step-card > h2:focus { outline: none; }
#breakdown { margin: 4px 0 0; }
ul.plain { margin: 8px 0 0; padding-left: 20px; }
ul.plain li { margin: 6px 0; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; margin-top: 20px; font-size: 14px; }
.pager a { display: inline-block; padding: 12px 0; }
@media (max-width: 520px) { .pager a:nth-child(2) { order: 3; flex-basis: 100%; text-align: center; } } /* 좁은 화면: 이전·다음을 한 줄에, 목차는 아랫줄 가운데 */
/* gunghap */
#g-title:focus { outline: none; }
.g-person { margin: 0 0 16px; min-inline-size: 0; }
.g-person select { max-width: 100%; }
#g-form .g-person .row > label:has(select) { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.g-pair { display: grid; gap: 16px; }
.g-pair .card > p.hint:first-child { margin: 0 0 8px; }
/* manse + how */
#ms-title:focus { outline: none; }
.ms-scroll { overflow-x: auto; max-width: 100%; }
.ms-abroad { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.ms-abroad label, #p-form .row > label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
#p-form select, #p-form input[type="time"], .ms-abroad input, #ms-hourpick select { max-width: 100%; }
.ms-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 320px; }
.ms-table caption { caption-side: bottom; text-align: left; padding-top: 6px; }
.ms-table th, .ms-table td { text-align: center; padding: 6px 2px; overflow-wrap: anywhere; }
.ms-table tbody th { font-size: 12.5px; font-weight: 400; color: var(--muted); width: 64px; text-align: left; }
.ms-table tr.sip td { font-size: 13px; color: var(--muted); }
.ms-table tr.glyphs td { font-size: 34px; font-weight: 700; line-height: 1.2; }
.ms-table tr.glyphs td small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.ms-table tr.hidden-row td, .ms-table tr.stage-row td, .ms-table tr.sinsal-row td { font-size: 12.5px; vertical-align: top; }
.ms-table .hid, .sinsal-row .tag { display: block; }
.ms-table td[data-el="wood"], .bar[data-el="wood"] { color: #2F7D57; fill: #2F7D57; }
.ms-table td[data-el="fire"], .bar[data-el="fire"] { color: #C0392B; fill: #C0392B; }
.ms-table td[data-el="earth"], .bar[data-el="earth"] { color: #A87A12; fill: #A87A12; }
.ms-table td[data-el="metal"], .bar[data-el="metal"] { color: #7A7A7A; fill: #7A7A7A; }
.ms-table td[data-el="water"], .bar[data-el="water"] { color: #1F2A44; fill: #1F2A44; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ms-table td[data-el="wood"], :root:not([data-theme="light"]) .bar[data-el="wood"] { color: #6FCF97; fill: #6FCF97; }
  :root:not([data-theme="light"]) .ms-table td[data-el="fire"], :root:not([data-theme="light"]) .bar[data-el="fire"] { color: #FF8A7A; fill: #FF8A7A; }
  :root:not([data-theme="light"]) .ms-table td[data-el="earth"], :root:not([data-theme="light"]) .bar[data-el="earth"] { color: #F2C94C; fill: #F2C94C; }
  :root:not([data-theme="light"]) .ms-table td[data-el="metal"], :root:not([data-theme="light"]) .bar[data-el="metal"] { color: #E0E0E0; fill: #E0E0E0; }
  :root:not([data-theme="light"]) .ms-table td[data-el="water"], :root:not([data-theme="light"]) .bar[data-el="water"] { color: #8FB3FF; fill: #8FB3FF; }
  :root:not([data-theme="light"]) .bar.hid { fill-opacity: .45; }
}
:root[data-theme="dark"] .ms-table td[data-el="wood"], :root[data-theme="dark"] .bar[data-el="wood"] { color: #6FCF97; fill: #6FCF97; }
:root[data-theme="dark"] .ms-table td[data-el="fire"], :root[data-theme="dark"] .bar[data-el="fire"] { color: #FF8A7A; fill: #FF8A7A; }
:root[data-theme="dark"] .ms-table td[data-el="earth"], :root[data-theme="dark"] .bar[data-el="earth"] { color: #F2C94C; fill: #F2C94C; }
:root[data-theme="dark"] .ms-table td[data-el="metal"], :root[data-theme="dark"] .bar[data-el="metal"] { color: #E0E0E0; fill: #E0E0E0; }
:root[data-theme="dark"] .ms-table td[data-el="water"], :root[data-theme="dark"] .bar[data-el="water"] { color: #8FB3FF; fill: #8FB3FF; }
:root[data-theme="dark"] .bar.hid { fill-opacity: .45; }
.bar.hid { fill-opacity: .35; }
.ms-bars { display: block; width: 100%; max-width: 420px; height: auto; }
.ms-bars text { fill: var(--ink); font-size: 13px; }
.ms-bars text.num { font-weight: 700; }
.ms-bars text.sub { fill: var(--muted); font-size: 11px; font-weight: 400; }
.ms-daeun, .ms-cycle { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 13px; }
.ms-daeun th, .ms-daeun td, .ms-cycle th, .ms-cycle td { padding: 6px 4px; text-align: left; vertical-align: top; border-top: 1px solid var(--line, rgba(127,127,127,.25)); }
.ms-daeun tr.now, .ms-cycle tr.now { background: var(--warn-bg); }
.ms-daeun .badge, .ms-cycle .badge { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 8px; border: 1px solid currentColor; }
.swatch[data-el="wood"] { background: #2F7D57; }
.swatch[data-el="fire"] { background: #C0392B; }
.swatch[data-el="earth"] { background: #D4A017; }
.swatch[data-el="metal"] { background: #F4F1EA; }
.swatch[data-el="water"] { background: #1F2A44; }
.sil[data-el="wood"]::after { background: #2F7D57; }
.sil[data-el="fire"]::after { background: #C0392B; }
.sil[data-el="earth"]::after { background: #B8860B; }
.sil[data-el="metal"]::after { background: #7D786E; }
.sil[data-el="water"]::after { background: #1F2A44; }

/* First card ribbon: top-ranked item of the 60 Day Pillars (same rules as web/hook.css .rank-top) */
.rank-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; margin: 0 0 12px; padding: 8px 14px; border-radius: 14px; background: var(--accent); color: var(--on-accent); text-decoration: none; line-height: 1.3; }
.rank-top[hidden] { display: none; }
.rank-top b { font-size: 18px; }
.rank-top span { flex: none; font-size: 13.5px; }

/* EN compatibility reading, timing table at phone width: inside the scroll box the Signals column was
   squeezed to one word per line. Keep the four short columns in one row and give Signals a full row below. */
@media (max-width: 540px) {
  #result .cb table.years { display: block; overflow: visible; }
  #result .cb table.years thead, #result .cb table.years tbody { display: block; }
  #result .cb table.years tr { display: grid; grid-template-columns: 3.4em 1.4fr 1fr 1fr; border-bottom: 1px solid var(--line); }
  #result .cb table.years thead tr { border-bottom-color: var(--gold); }
  #result .cb table.years th, #result .cb table.years td { min-width: 0; border-bottom: 0; padding: 6px; }
  #result .cb table.years th:nth-child(5) { display: none; }
  #result .cb table.years td:nth-child(5) { grid-column: 1 / -1; padding-top: 0; color: var(--mut); }
  #result .cb table.years td:nth-child(5)::before { content: "Signals: "; font-weight: 700; }
  /* The two-charts pillar tables scrolled sideways by a few px: fit the five columns to the box width. */
  #result .cb table.pillars { display: table; width: 100%; table-layout: fixed; }
  #result .cb table.pillars th, #result .cb table.pillars td { min-width: 0; padding: 7px 4px; }
}
/* EN compatibility summary card: the grid gap already spaces the lines, so drop the default paragraph margins
   (gap + both margins left more than two blank lines between one-line paragraphs). */
#result .glance > p { margin: 0; }