/* 문연약국 — 절제된 앱 화면: 회색 바탕, 흰 면, 얇은 선, 초록 점 하나로 "지금 열림" */
:root {
  --bg: #f3f4f6; --surface: #fff; --fill: #f2f4f6; --line: #e8ebee;
  --ink: #191f28; --sub: #4e5968; --mute: #6b7684;
  --brand: #1b64da; --brand-ink: #1550b8; --brand-wash: #ebf2fe;
  --open: #0a8f55; --open-wash: #e6f5ee;
  --r: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6; word-break: keep-all; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1; width: 100%; }
::selection { background: var(--brand-wash); }
a { color: var(--brand); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

/* 상단 */
header.top { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 0 var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 10px; height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.5px; }
.mark { width: 26px; height: 26px; }
.mark rect { fill: var(--brand); } .mark path { fill: #fff; }
.tag { font-size: 13px; color: var(--mute); }
.clock { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--sub); white-space: nowrap; background: var(--fill); border-radius: 99px; padding: 4px 11px; }
.clock:empty { display: none; }

.crumbs { font-size: 13px; color: var(--mute); margin: 22px 0 0; }
.crumbs a { color: var(--mute); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
h1 { font-size: 28px; font-weight: 800; line-height: 1.32; letter-spacing: -.9px; margin: 6px 0 8px; text-wrap: balance; }
.home-h { margin-top: 40px; font-size: 32px; }
h2 { font-size: 20px; font-weight: 700; margin: 48px 0 14px; letter-spacing: -.5px; }
.lead { color: var(--sub); font-size: 16px; }
.lead b { color: var(--ink); font-weight: 700; }

/* 종류: 세그먼트 */
.kinds { display: flex; gap: 2px; margin-top: 22px; background: #e9ebee; border-radius: 14px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.kinds a { flex: 1 0 auto; text-align: center; padding: 9px 12px; border-radius: 10px; font-size: 14.5px; font-weight: 600; text-decoration: none; color: var(--sub); white-space: nowrap; }
.kinds a.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.kinds a:not(.on):hover { color: var(--ink); }

/* 토글 */
.toolbar { display: flex; gap: 8px 20px; align-items: center; flex-wrap: wrap; margin-top: 16px; font-size: 15px; }
.chk { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 600; color: var(--sub); min-height: 44px; }
.chk input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 99px; background: #d1d6db; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.chk input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.chk input:checked { background: var(--brand); }
.chk input:checked::before { transform: translateX(16px); }
.chk:has(input:checked) { color: var(--ink); }

.caution { font-size: 13px; color: var(--mute); margin-top: 10px; line-height: 1.65; }
.caution b { color: var(--sub); font-weight: 700; }
.caution a { color: var(--sub); }

/* 약국 목록: 한 장의 흰 면 + 얇은 구분선 */
.list { margin-top: 14px; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.ph { padding: 22px 20px 18px; }
.ph + .ph, .ph[hidden] + .ph { border-top: 1px solid var(--line); }
.ph-head { display: flex; align-items: flex-start; gap: 12px; }
.ph h3 { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; line-height: 1.35; letter-spacing: -.4px; }
.addr { font-size: 14px; color: var(--mute); margin-top: 3px; }
.now { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-top: 1px; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--mute); background: var(--fill); white-space: nowrap; }
.now:empty { display: none; }
.now.on { color: var(--open); background: var(--open-wash); }
.now.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(10,143,85,.18); }
.today { margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--ink); }
.ph:not(.is-open) .today { color: var(--sub); }
.focus { margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--sub); }
.focus b { color: var(--brand); margin-right: 4px; }
.memo { margin-top: 8px; font-size: 13.5px; color: var(--mute); white-space: pre-line; background: var(--fill); border-radius: 10px; padding: 8px 12px; }

.act { display: flex; gap: 8px; margin-top: 16px; }
.act a, .act span { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 12px; border-radius: 12px;
  font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; background: var(--fill); color: var(--ink); transition: background .15s, transform .1s; }
.act a:active { transform: scale(.98); }
.act svg { width: 16px; height: 16px; fill: currentColor; flex: none; opacity: .9; }
.act a.call { background: var(--brand-wash); color: var(--brand-ink); }
.act a.call:hover { background: #dce8fd; }
.act a.map:hover { background: #e7eaee; }
.act .off { color: var(--mute); }

.ph details { margin-top: 10px; }
.ph summary { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--mute); cursor: pointer; padding: 6px 0; list-style: none; min-height: 32px; }
.ph summary::-webkit-details-marker { display: none; }
.ph summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 4px; transition: transform .2s; }
.ph details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.ph summary:hover { color: var(--ink); }
table.week { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 4px; }
.week th, .week td { padding: 7px 0; text-align: left; border-top: 1px solid var(--line); }
.week th { width: 64px; font-weight: 500; color: var(--mute); }
.week td { color: var(--ink); }
.week td.x { color: var(--mute); }
.week tr.is-today th, .week tr.is-today td { color: var(--brand); font-weight: 700; }

.empty { margin-top: 14px; color: var(--mute); text-align: center; padding: 32px 0; }

/* 지역 링크 */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.links a { display: flex; align-items: center; min-height: 48px; padding: 10px 16px; background: var(--surface); border-radius: 14px; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--ink); transition: background .15s; }
.links a:hover { background: #fafbfc; color: var(--brand); }
.links.big { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.links.big a { justify-content: center; font-size: 16px; font-weight: 700; min-height: 56px; }
.scroll { overflow-x: auto; background: var(--surface); border-radius: var(--r); }
table.areas { width: 100%; border-collapse: collapse; font-size: 15px; }
table.areas th, table.areas td { padding: 13px 16px; border-top: 1px solid var(--line); text-align: right; }
table.areas tr:first-child th { border-top: 0; }
table.areas th { color: var(--mute); font-weight: 600; font-size: 13px; }
table.areas th:first-child, table.areas td:first-child { text-align: left; }
table.areas td:first-child a { font-weight: 700; color: var(--ink); text-decoration: none; }
table.areas td:first-child a:hover { color: var(--brand); }

/* 홈 검색 */
.search { margin-top: 24px; background: var(--surface); border-radius: 22px; padding: 20px; box-shadow: 0 8px 28px -18px rgba(25,31,40,.25); }
.search label { display: block; font-size: 14px; font-weight: 600; color: var(--sub); margin-bottom: 10px; }
.search input { width: 100%; height: 56px; border: 0; border-radius: 14px; padding: 0 18px; font: inherit; font-size: 17px; color: var(--ink); background: var(--fill); transition: box-shadow .15s, background .15s; }
.search input::placeholder { color: #8b95a1; }
.search input:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--brand); }
.hits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hits:empty { display: none; }
.hits a { background: var(--brand-wash); color: var(--brand-ink); border-radius: 99px; padding: 7px 14px; font-size: 14.5px; text-decoration: none; font-weight: 600; }
.hits span { color: var(--mute); font-size: 14px; }

details.faq { background: var(--surface); border-radius: 14px; padding: 16px 18px; margin-top: 8px; }
details.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid var(--mute); border-bottom: 1.5px solid var(--mute); transform: rotate(45deg); transition: transform .2s; }
details.faq[open] summary::after { transform: rotate(-135deg); }
details.faq p { margin-top: 8px; font-size: 15px; color: var(--sub); }
main > p:not([class]) { margin-top: 10px; max-width: 68ch; color: var(--sub); }
.ad { margin: 28px 0; }
[hidden] { display: none !important; }
footer { margin-top: 72px; padding: 28px 0 48px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mute); line-height: 1.8; }
footer a { color: var(--sub); margin-right: 14px; text-decoration: none; }
footer a:hover { text-decoration: underline; }
@media (max-width: 560px) { h1 { font-size: 25px; } .home-h { font-size: 28px; margin-top: 32px; } .tag { display: none; } .ph { padding: 20px 18px 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; } }
