/*
 * yakguk.manuz.com — 휴일·심야 약국. 컨셉: 약국 간판.
 * 흰 간판 바탕 + 초록 십자, 굵은 고딕 간판 글씨, 아래 초록 띠. 영업 중은 초록 불 켜진 배지, 종료는 꺼진 회색.
 * 밤에 여는 곳(심야)은 남색 야간 간판. 글꼴은 시스템 고딕만(웹폰트 0). 다크모드 없음.
 * 모바일 우선: 390px, 터치 44px, 가로 넘침 0.
 */
:root {
  --bg: #f3f6f4; --board: #fff; --ink: #18211c; --ink-2: #45524a; --muted: #6b776f;
  --green: #00a651; --green-d: #00783a; --green-soft: #e3f5ea; --lit: #19c25e;
  --navy: #17245a; --navy-2: #2c3d85; --moon: #ffe27a; --red: #d8322b;
  --line: #d5ddd8; --off: #8a948e; --off-bg: #eceeed;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --wrap: 920px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg); word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
main a { color: var(--green-d); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--navy-2); outline-offset: 2px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: 16px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 9; background: var(--ink); color: #fff; padding: 10px 14px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .875rem; color: var(--ink-2); }
h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin: 36px 0 12px; }

/* 간판 머리: 흰 판 + 초록 십자 + 아래 초록 띠 */
.mast { background: var(--board); border-bottom: 6px solid var(--green); box-shadow: 0 1px 0 var(--line); }
.mast-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-block: 10px; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.cross { width: 30px; height: 30px; fill: var(--green); flex: none; }
.wm-text { font-size: 1.45rem; font-weight: 900; letter-spacing: -.04em; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.nav a { padding: 10px 11px; min-height: 44px; display: flex; align-items: center; text-decoration: none; font-weight: 700; color: var(--ink-2); white-space: nowrap; border-radius: 6px; }
.nav a[aria-current] { color: var(--green-d); background: var(--green-soft); }

.main { flex: 1; padding-top: 18px; padding-bottom: 40px; }
.hero { background: var(--board); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 4px; padding: 18px 18px 14px; }
.hero.night { background: var(--navy); color: #fff; border-color: var(--navy); border-top-color: var(--moon); }
.hero.night .eyebrow, .hero.night .lead { color: #d6dcf5; }
.eyebrow { margin: 0 0 4px; font-size: .9rem; font-weight: 700; color: var(--green-d); }
.h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 900; line-height: 1.25; letter-spacing: -.04em; }
.lead { margin: 0; color: var(--ink-2); }

/* 검색 */
.search { display: flex; gap: 8px; margin: 16px 0; }
.search input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; font: inherit; border: 2px solid var(--line); border-radius: 6px; background: #fff; }
.search input:focus { border-color: var(--green); outline: none; }
.search button { min-height: 48px; padding: 0 18px; font: inherit; font-weight: 800; color: #fff; background: var(--green); border: 0; border-radius: 6px; cursor: pointer; }

/* 특별 목록 단추 */
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 16px 0; }
.kind { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px; text-align: center; font-weight: 800; text-decoration: none; color: var(--green-d) !important; background: var(--board); border: 2px solid var(--green); border-radius: 6px; }
.kind.k-2 { color: #fff !important; background: var(--navy); border-color: var(--navy); }
.kind.feast { color: var(--red) !important; border-color: #f0c3c0; }

/* 숫자 칸 */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: block; padding: 12px 14px; background: var(--board); border: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink) !important; }
.kpi.night { background: var(--navy); color: #fff !important; border-color: var(--navy); }
.k-lbl { margin: 0; font-size: .85rem; font-weight: 700; color: inherit; opacity: .75; }
.k-val { margin: 2px 0 0; font-size: 1.7rem; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.k-val small { font-size: .9rem; font-weight: 700; margin-left: 2px; }

/* 지역 고르기 칸 */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.grid a { display: flex; flex-direction: column; min-height: 56px; padding: 10px 12px; background: var(--board); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 4px; text-decoration: none; color: var(--ink) !important; }
.grid b { font-size: 1.05rem; }
.grid span { font-size: .85rem; color: var(--muted); }

/* 지금 시각 띠 */
.nowbar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 14px 0 8px; padding: 6px 12px; background: var(--ink); color: #fff; border-radius: 4px; }
.clock { margin: 0; font-size: .9rem; }
.clock b { color: var(--lit); font-size: 1.05rem; }
.only { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.only input { width: 22px; height: 22px; accent-color: var(--lit); }
.only-open .ph:not(.on) { display: none; }

/* 약국 목록: 작은 간판 카드 */
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ph { position: relative; display: grid; gap: 2px; padding: 12px 14px; background: var(--board); border: 1px solid var(--line); border-left: 6px solid var(--off-bg); border-radius: 4px; }
.ph.on { border-left-color: var(--lit); }
.ph.late { background: linear-gradient(90deg, #f3f5fc, #fff 40%); }
.st { justify-self: start; display: inline-block; padding: 3px 10px; font-size: .85rem; font-weight: 800; color: var(--off); background: var(--off-bg); border-radius: 999px; }
.on > .st, .st.on { color: #fff; background: var(--green); box-shadow: 0 0 0 3px #c9f0d8; }
.ph-name { font-size: 1.15rem; font-weight: 800; color: var(--ink) !important; text-decoration: none; min-height: 32px; display: flex; align-items: center; }
.ph-name::after { content: ""; position: absolute; inset: 0; }
.ph-addr { font-size: .875rem; color: var(--muted); }
.ph-addr b { color: var(--ink-2); }
.ph-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .875rem; }
.ph-time { font-weight: 700; margin-right: 4px; }
.tel { position: relative; z-index: 1; margin-left: auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-weight: 800; color: var(--green-d) !important; border: 1.5px solid var(--green); border-radius: 6px; text-decoration: none; }
.tg { font-style: normal; display: inline-block; padding: 1px 7px; font-size: .78rem; font-weight: 700; color: var(--green-d); background: var(--green-soft); border-radius: 3px; }
.tg.night { color: var(--moon); background: var(--navy); }
.tg.night::before { content: "☾ "; }
.tg.red { color: #fff; background: var(--red); }
.empty-note { padding: 14px; background: var(--board); border: 1px dashed var(--line); }

/* 약국 한 곳: 큰 간판 */
.sign { text-align: center; background: var(--board); border: 1px solid var(--line); border-top: 10px solid var(--green); border-radius: 4px; padding: 18px 16px; }
.sign.late { background: var(--navy); color: #fff; border-color: var(--navy); border-top-color: var(--green); }
.sign.late .sign-where, .sign.late .warn { color: #c9d1f0; }
.sign-where { margin: 0; font-weight: 700; color: var(--muted); }
.sign-name { margin: 4px 0 12px; font-size: clamp(1.8rem, 8vw, 2.6rem); font-weight: 900; letter-spacing: -.05em; line-height: 1.2; }
.big-st { display: inline-block; margin: 0 0 10px; padding: 10px 22px; font-size: 1.25rem; font-weight: 900; color: var(--off); background: var(--off-bg); border-radius: 999px; }
.big-st.on { color: #fff; background: var(--green); box-shadow: 0 0 0 5px #c9f0d8, 0 0 24px #19c25e88; }
.sign-tags { margin: 0 0 10px; }
.call { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; font-weight: 800; text-decoration: none; color: #fff !important; background: var(--green); border-radius: 6px; }
.btn.ghost { color: var(--green-d) !important; background: #fff; border: 2px solid var(--green); }
.warn { margin: 0; font-size: .85rem; color: var(--red); font-weight: 700; }
.hours { width: 100%; border-collapse: collapse; background: var(--board); border: 1px solid var(--line); }
.hours th, .hours td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.hours th { width: 30%; font-weight: 800; }
.hours .we th { color: var(--red); }
.hours tr.today { background: var(--green-soft); }
.hours tr.today td { font-weight: 800; }
.hours small { color: var(--green-d); font-weight: 800; }
.addr { font-weight: 700; }
.xlink { padding: 12px 14px; background: var(--board); border: 1px solid var(--line); border-radius: 4px; }

/* 표 */
.table-wrap { overflow-x: auto; margin: 16px 0 6px; background: var(--board); border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl thead th { font-size: .8rem; color: var(--muted); text-align: left; background: #fafcfb; }
.tbl tbody th { text-align: left; }
.tbl tbody th a { display: inline-block; min-height: 28px; font-weight: 800; }
.tbl .r { text-align: right; }
.tbl td.on { color: var(--green-d); font-weight: 900; }

/* 명절 */
.steps { margin: 16px 0; padding: 14px 14px 14px 36px; background: var(--board); border: 1px solid var(--line); border-top: 4px solid var(--red); }
.steps li { margin: 6px 0; }
.feast-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.feast-box a { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; background: var(--board); border: 2px solid #f0c3c0; border-radius: 6px; text-decoration: none; color: var(--ink) !important; }
.feast-box b { color: var(--red); }

/* 칩·해설·공용 조각 */
.chips { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips a, .chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; background: var(--board); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink) !important; font-size: .9rem; }
.chips span { color: var(--muted) !important; }
.notes { margin: 20px 0; padding: 4px 16px; background: var(--board); border-left: 4px solid var(--green); }
.notes h2 { font-size: 1.05rem; margin: 12px 0 4px; }
.crumbs ol { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { display: inline-block; padding: 8px 0; }
.faq details { background: var(--board); border: 1px solid var(--line); border-radius: 4px; margin: 6px 0; }
.faq summary { min-height: 44px; padding: 10px 14px; font-weight: 800; cursor: pointer; }
.faq-a { padding: 0 14px 12px; color: var(--ink-2); }
.src-block { margin-top: 30px; padding: 4px 16px 10px; background: #fafcfb; border: 1px solid var(--line); font-size: .9rem; }
.src-block h2 { font-size: 1rem; }
.src { padding-left: 18px; }
.ad { margin: 22px 0; }
.toc { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 14px 0; }
.toc a { display: inline-block; padding: 10px 0; }
.changelog { padding-left: 18px; }

.foot { background: #1f2a24; color: #c7d1cb; font-size: .875rem; }
.foot-in { padding-block: 24px; }
.foot-brand { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.1rem; font-weight: 900; color: #fff; }
.foot-brand .cross { width: 22px; height: 22px; }
.foot a { color: #fff; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 10px 0; }
.foot-links a { display: inline-block; padding: 10px 0; }
.foot-copy { margin: 0; color: #8d9a92; }

/* 내 위치 근처 */
.nearme { margin: 16px 0; padding: 4px 14px 14px; background: var(--board); border: 2px solid var(--green); border-radius: 6px; }
.nearme h2 { margin: 10px 0 8px; }
.near-btn { width: 100%; border: 0; font: inherit; font-weight: 800; cursor: pointer; }
.near-msg { margin: 8px 0; }
.clock-in { margin: 4px 0 8px; font-weight: 700; }
.clock-in b { color: var(--green-d); }
