:root {
  --pine-950: #063d2f;
  --pine-900: #07533f;
  --pine-800: #0b6a50;
  --pine-100: #e6f0e9;
  --pine-050: #f1f7f2;
  --ink: #17332a;
  --muted: #64736d;
  --line: #aebeb5;
  --ivory: #fbfaf6;
  --paper: #fffefa;
  --amber: #e89b00;
  --amber-bg: #fff6d9;
  --pink: #e34b91;
  --shadow: 0 18px 45px rgba(6, 61, 47, .08);
  --radius: 18px;
  --font: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(227, 75, 145, .04), transparent 24rem),
    radial-gradient(circle at 88% 20%, rgba(7, 83, 63, .06), transparent 26rem),
    var(--ivory);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: .02em;
}

button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
a { color: inherit; }
.icon { display: inline-block; width: 1.2rem; height: 1.2rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }

.skip-link {
  position: fixed;
  z-index: 30;
  top: .75rem;
  left: .75rem;
  padding: .65rem 1rem;
  color: #fff;
  background: var(--pine-950);
  border-radius: 8px;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: rgba(251, 250, 246, .94);
  border-bottom: 1px solid rgba(7, 83, 63, .18);
  backdrop-filter: blur(15px);
}

.header-inner, main, footer {
  width: min(100% - 2rem, 1180px);
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-button {
  display: inline-flex;
  min-width: 0;
  min-height: 60px;
  align-items: center;
  gap: .75rem;
  padding: .25rem 0;
  color: var(--pine-950);
  text-align: left;
  background: none;
  border: 0;
}
.brand-button img { width: 52px; height: 52px; object-fit: contain; border-radius: 50%; }
.brand-button span { display: grid; min-width: 0; gap: .02rem; }
.brand-button strong { display: block; font-size: 1.08rem; line-height: 1.25; letter-spacing: .04em; }
.brand-button small { color: var(--muted); font-size: .72rem; letter-spacing: .05em; }
.service-label { color: var(--muted); font-size: .78rem; letter-spacing: .08em; }

main { padding: 0 0 3.5rem; }
.view { animation: view-in .3s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.home-view { padding: clamp(2.3rem, 6vw, 5.5rem) 0 4rem; }
.home-layout { display: grid; gap: 2rem; }
.hero-copy { position: relative; padding: .4rem 0 0; }
.eyebrow { margin: 0 0 1rem; color: var(--pink); font-size: .7rem; font-weight: 800; letter-spacing: .18em; }
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: none;
  margin-bottom: 1rem;
  color: var(--pine-950);
  font-size: clamp(2.65rem, 9vw, 5.5rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: .04em;
}
h1 em { color: var(--pine-800); font-style: normal; }
.hero-copy > p:not(.eyebrow) { max-width: 34rem; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }

.search-panel { padding: 1.25rem; background: rgba(255, 254, 250, .88); border: 1px solid rgba(7, 83, 63, .22); border-radius: var(--radius); box-shadow: var(--shadow); }
.notice { display: flex; align-items: center; gap: .75rem; color: #805400; background: var(--amber-bg); border: 1px solid var(--amber); border-radius: 13px; }
.notice svg { flex: 0 0 auto; width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.75; }
.notice p { display: grid; gap: .05rem; margin: 0; font-size: .9rem; line-height: 1.45; }
.notice strong { font-size: .92rem; }
.notice-amber { padding: .8rem 1rem; }
.notice.compact { max-width: 680px; margin: 0 auto 1.1rem; padding: .7rem 1rem; justify-content: center; }
.notice.compact p { display: block; font-weight: 700; text-align: center; }

form { margin-top: 1.35rem; }
.form-section { min-width: 0; margin: 0 0 1.2rem; padding: 0; border: 0; }
.form-section legend, .field-label { display: block; margin-bottom: .48rem; color: var(--pine-900); font-size: 1.02rem; font-weight: 800; letter-spacing: .08em; }
.field-hint { margin: .4rem 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1.5px solid var(--pine-900); border-radius: 13px; overflow: hidden; }
.segmented label { position: relative; display: flex; min-width: 0; }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented label span { display: flex; width: 100%; min-height: 54px; height: 100%; flex: 1 1 auto; align-items: center; justify-content: center; gap: .45rem; padding: .5rem .55rem; color: var(--ink); font-weight: 700; text-align: center; border-right: 1px solid var(--pine-900); transition: background .2s, color .2s; }
.segmented label:last-child span { border-right: 0; }
.segmented input:checked + span { color: #fff; background: var(--pine-900); }
.segmented input:focus-visible + span { outline: 3px solid rgba(227, 75, 145, .38); outline-offset: -3px; }
.segmented svg, .input-wrap svg, .primary-button svg, .outline-button svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.select-wrap, .input-wrap { position: relative; display: flex; align-items: center; }
.select-wrap select, .input-wrap input { width: 100%; min-height: 54px; color: var(--ink); background: var(--paper); border: 1.5px solid var(--pine-900); border-radius: 13px; outline: none; }
.select-wrap select { appearance: none; padding: .7rem 2.8rem .7rem 1rem; }
.select-wrap svg { position: absolute; right: .9rem; width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; pointer-events: none; }
.input-wrap svg { position: absolute; left: 1rem; color: var(--muted); pointer-events: none; }
.input-wrap input { padding: .7rem 1rem .7rem 3.05rem; }
.select-wrap select:focus, .input-wrap input:focus { box-shadow: 0 0 0 4px rgba(7, 83, 63, .13); }
.primary-button, .outline-button, .icon-button, .text-button { min-height: 50px; border-radius: 13px; font-weight: 800; letter-spacing: .05em; }
.primary-button { display: flex; width: 100%; align-items: center; justify-content: center; gap: .6rem; padding: .8rem 1rem; color: #fff; background: var(--pine-900); border: 1px solid var(--pine-900); box-shadow: 0 8px 20px rgba(7, 83, 63, .16); }
.primary-button:hover, .primary-button:focus-visible { background: var(--pine-950); }
.product-note { margin: .75rem 0 0; padding: .55rem .75rem; color: var(--pine-900); font-weight: 700; text-align: center; background: var(--pine-050); border-radius: 10px; }

.view-toolbar { display: grid; grid-template-columns: 50px 1fr 50px; min-height: 82px; align-items: center; border-bottom: 1px solid rgba(7, 83, 63, .18); }
.view-toolbar h2 { margin: 0; color: var(--pine-950); font-size: clamp(1.5rem, 5vw, 2.2rem); text-align: center; letter-spacing: .08em; }
.icon-button { display: inline-grid; width: 50px; place-items: center; color: var(--pine-900); background: transparent; border: 0; }
.icon-button svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon-button:hover, .icon-button:focus-visible { background: var(--pine-050); }
.results-view, .detail-view { padding-bottom: 4rem; }
.refine-form { display: grid; grid-template-columns: 1fr auto; gap: .65rem; margin: 1rem 0 .8rem; }
.outline-button { display: inline-flex; min-width: 116px; align-items: center; justify-content: center; gap: .45rem; padding: .65rem .85rem; color: var(--pine-900); background: var(--paper); border: 1.5px solid var(--pine-900); }
.outline-button:hover, .outline-button:focus-visible { color: #fff; background: var(--pine-900); }
.text-button { padding: .4rem .5rem; color: var(--pine-900); background: transparent; border: 0; text-decoration: underline; text-underline-offset: 4px; }
.result-controls { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 1px solid rgba(7, 83, 63, .18); }
.active-filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.filter-tag { display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .6rem; color: var(--pine-900); background: var(--pine-050); border-radius: 999px; font-size: .8rem; font-weight: 700; }
.filter-tag svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.results-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.2rem 0 .8rem; }
.results-summary p { margin: 0; }
#resultCount { color: var(--pine-950); font-size: 1.12rem; font-weight: 800; }
#dataUpdatedAt { color: var(--muted); font-size: .78rem; }
.result-grid { display: grid; gap: 1rem; }
.facility-card { padding: 1.05rem; background: rgba(255, 254, 250, .92); border: 1.5px solid rgba(7, 83, 63, .78); border-radius: 17px; box-shadow: 0 10px 26px rgba(7, 83, 63, .05); }
.card-top, .detail-tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem; }
.tag-group { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { display: inline-flex; align-items: center; gap: .3rem; min-height: 31px; padding: .25rem .6rem; color: var(--pine-900); background: var(--pine-050); border: 1px solid rgba(7, 83, 63, .55); border-radius: 8px; font-size: .8rem; font-weight: 800; }
.tag.primary { color: #fff; background: var(--pine-900); border-color: var(--pine-900); }
.tag svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.facility-card h3 { margin: .75rem 0 .55rem; color: var(--pine-950); font-size: 1.35rem; line-height: 1.35; }
.facility-facts { display: grid; gap: .32rem; margin-bottom: .85rem; color: var(--ink); }
.fact { display: grid; grid-template-columns: 1.45rem 1fr; align-items: start; gap: .45rem; }
.fact svg { width: 1.2rem; height: 1.2rem; margin-top: .17rem; fill: none; stroke: var(--pine-900); stroke-width: 1.8; }
.fact span { overflow-wrap: anywhere; }
.hours-text { white-space: pre-line; }
.card-actions, .detail-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; padding-top: .85rem; border-top: 1px solid rgba(7, 83, 63, .32); }
.card-actions a, .card-actions button, .detail-actions a, .detail-actions button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: .35rem; color: var(--pine-900); background: var(--paper); border: 1.5px solid var(--pine-900); border-radius: 11px; font-weight: 800; text-decoration: none; }
.card-actions a:hover, .card-actions button:hover, .detail-actions a:hover, .detail-actions button:hover { color: #fff; background: var(--pine-900); }
.card-actions svg, .detail-actions svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.state-panel { display: grid; min-height: 180px; place-items: center; align-content: center; gap: .45rem; padding: 2rem 1rem; color: var(--muted); text-align: center; }
.state-panel h3, .state-panel p { margin: 0; }
.state-panel h3 { color: var(--pine-900); }
.state-panel svg { width: 2.4rem; height: 2.4rem; fill: none; stroke: var(--pine-900); stroke-width: 1.6; }
.error-state { color: #8a4e00; }
.error-state h3 { color: #8a4e00; }
.spinner { width: 2rem; height: 2rem; border: 3px solid var(--pine-100); border-top-color: var(--pine-900); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.detail-view article { padding: 1.15rem 0 0; }
.detail-tags { justify-content: flex-start; margin-bottom: .9rem; }
.detail-heading { display: flex; width: 100%; max-width: none; align-items: center; gap: .8rem; margin: 0 0 1rem; color: var(--pine-950); font-size: clamp(1.75rem, 7vw, 3rem); line-height: 1.25; }
.detail-heading .heading-icon { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; fill: none; stroke: var(--pine-900); stroke-width: 1.5; }
.detail-heading-text { min-width: 0; flex: 1 1 auto; word-break: keep-all; overflow-wrap: normal; }
.detail-actions { grid-template-columns: repeat(2, 1fr); padding: 0 0 1.25rem; border-top: 0; border-bottom: 1px solid rgba(7, 83, 63, .3); }
.detail-actions .primary-action { color: #fff; background: var(--pine-900); }
.detail-section { padding: 1.15rem 0; border-bottom: 1px solid rgba(7, 83, 63, .25); }
.detail-section h3 { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; color: var(--pine-900); font-size: 1.05rem; }
.detail-section h3 svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.detail-section p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.detail-bottom-actions { padding-top: 1.15rem; }
.detail-bottom-actions .outline-button { width: 100%; }
.copy-row { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: .75rem; }
.copy-button { min-height: 44px; padding: .5rem .75rem; color: var(--pine-900); background: var(--paper); border: 1.5px solid var(--pine-900); border-radius: 10px; font-weight: 800; }
.fee-table { width: 100%; border-collapse: collapse; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.fee-table th, .fee-table td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line); }
.fee-table tr:last-child th, .fee-table tr:last-child td { border-bottom: 0; }
.fee-table th { width: 70%; font-weight: 600; background: var(--pine-050); }
.fee-table td { text-align: right; }
.fee-subtitle { margin: .95rem 0 .5rem; color: var(--pine-900); font-size: .95rem; }
.fee-other { margin: 0; padding: .7rem .8rem; color: var(--pine-900); background: var(--pine-050); border: 1px solid var(--line); border-radius: 9px; }
.detail-note { color: #8a4e00; background: var(--amber-bg); border: 1px solid var(--amber); border-radius: 12px; }
.detail-note p { padding: .72rem .9rem; }
.detail-note p svg { vertical-align: -.2rem; margin-right: .35rem; }

footer { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.5rem 0 2.5rem; color: var(--muted); border-top: 1px solid rgba(7, 83, 63, .18); font-size: .78rem; }
footer strong { color: var(--pine-900); font-size: .9rem; }
footer p { margin: .25rem 0 0; }
.toast { position: fixed; z-index: 20; right: 1rem; bottom: 1rem; max-width: min(360px, calc(100% - 2rem)); padding: .75rem 1rem; color: #fff; background: var(--pine-950); border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(227, 75, 145, .55); outline-offset: 3px; }

@media (min-width: 760px) {
  .header-inner, main, footer { width: min(100% - 4rem, 1180px); }
  .home-layout { grid-template-columns: minmax(0, .95fr) minmax(420px, .9fr); align-items: center; gap: clamp(3rem, 8vw, 8rem); }
  .home-view { min-height: calc(100vh - 78px); display: grid; align-items: center; }
  .search-panel { padding: 1.6rem; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-view, .results-view { padding-top: 1.4rem; }
  .detail-view article { max-width: 860px; margin: 0 auto; }
}

@media (min-width: 1080px) {
  .home-layout { grid-template-columns: 1.05fr .95fr; }
  .hero-copy { padding-left: 2rem; }
  .home-view h1 { max-width: 100%; font-size: clamp(3.4rem, 6vw, 4.5rem); word-break: keep-all; overflow-wrap: normal; }
  .result-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .header-inner, main, footer { width: min(100% - 1.5rem, 1180px); }
  .header-inner { min-height: 64px; }
  .brand-button { min-height: 50px; gap: .55rem; }
  .brand-button img { width: 42px; height: 42px; }
  .brand-button strong { font-size: .88rem; letter-spacing: .02em; }
  .brand-button small { font-size: .64rem; }
  .service-label { display: none; }
  .home-view { padding: .65rem 0 1rem; }
  .eyebrow { margin-bottom: .45rem; font-size: .62rem; }
  h1 { margin-bottom: .55rem; font-size: clamp(2.15rem, 9vw, 2.7rem); line-height: 1.08; }
  .hero-copy > p:not(.eyebrow) { font-size: .9rem; line-height: 1.45; }
  .search-panel { padding: .6rem; }
  .notice-amber { padding: .45rem .6rem; }
  .notice { gap: .5rem; }
  .notice svg { width: 23px; height: 23px; }
  .notice p { font-size: .74rem; line-height: 1.3; }
  .notice strong { font-size: .78rem; }
  form { margin-top: .5rem; }
  .form-section { margin-bottom: .45rem; }
  .form-section legend, .field-label { margin-bottom: .2rem; font-size: .85rem; }
  .segmented label span { min-height: 40px; gap: .2rem; padding: .25rem .3rem; font-size: .8rem; }
  .segmented svg, .input-wrap svg, .primary-button svg, .outline-button svg { width: 1.1rem; height: 1.1rem; }
  .audience-segmented { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
  .audience-segmented[data-audience-group="flu"] { grid-template-columns: repeat(3, 1fr); }
  .audience-segmented[data-audience-group="covid"] label:last-child span { border-right: 0; }
  .audience-segmented[data-audience-group="covid"] label:nth-child(n + 3) span,
  .audience-segmented[data-audience-group="flu"] label:nth-child(n + 4) span { border-top: 1px solid var(--pine-900); }
  .select-wrap select, .input-wrap input { min-height: 40px; padding-top: .35rem; padding-bottom: .35rem; }
  .select-wrap select { padding-left: .75rem; }
  .input-wrap input { padding-left: 2.5rem; }
  .field-hint { margin-top: .25rem; font-size: .68rem; line-height: 1.35; }
  .primary-button { min-height: 42px; padding: .5rem .7rem; font-size: .85rem; }
  .product-note { margin-top: .4rem; padding: .4rem .55rem; font-size: .78rem; }
  .refine-form { grid-template-columns: 1fr; }
  .refine-form .outline-button { width: 100%; }
  .result-controls, .results-summary { align-items: flex-start; flex-direction: column; }
  .result-controls { padding: .5rem 0; }
  .results-summary { gap: .15rem; }
  .card-actions { grid-template-columns: repeat(3, 1fr); }
  .card-actions a, .card-actions button { padding: .35rem .2rem; font-size: .8rem; }
  .card-actions svg { width: 1rem; height: 1rem; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
