:root {
  color-scheme: light;
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  color: #182d4e;
  background: #fdf7f2;
  line-height: 1.6;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.site-header {
  min-height: 88px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 8px max(20px, calc((100vw - 920px) / 2));
  background: #fffefa;
  border-bottom: 1px solid #eeded1;
}
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.brand img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.brand strong { display: block; font-size: clamp(1.05rem, 3vw, 1.45rem); overflow-wrap: anywhere; }
.brand small { color: #5c6780; font-size: .875rem; }
.contact-nav { white-space: nowrap; color: #1c5b8b; font-weight: 650; text-underline-offset: 4px; }
main { max-width: 760px; margin: 0 auto; padding: clamp(26px, 6vw, 60px) 18px 34px; }
.headline { text-align: center; margin-bottom: 18px; }
h1 { margin: 0; font-size: clamp(1.8rem, 5.5vw, 3rem); line-height: 1.3; letter-spacing: -.025em; }
.clinic-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: .6rem;
  padding: .2rem .8rem;
  border-radius: 999px;
  font-weight: 700;
  color: #214d3c;
  background: #e0f2df;
}
.clinic-status::before { content: ""; width: .5rem; height: .5rem; border-radius: 100%; background: currentColor; }
.clinic-status[data-state="closed"] { color: #723719; background: #ffeadb; }
.clinic-hours {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: .65rem 0 0;
  color: #52617a;
  font-weight: 550;
}
.count-card {
  --category-bg: #fbfaf8;
  --category-divider: #e2d9d0;
  background: #f6f2ee;
  border: 1px solid #e8ded5;
  border-radius: 26px;
  padding: clamp(18px, 5vw, 34px);
  box-shadow: 0 12px 28px #6a39130a;
  text-align: center;
  color: #344254;
}
.count-card[data-wait="short"] {
  --category-bg: #f3faf6;
  --category-divider: #b4d4c3;
  --wait-dot: #21754b;
  background: #ddf0e4;
  border-color: #aed4bc;
  color: #214b34;
}
.count-card[data-wait="moderate"] {
  --category-bg: #fffbeb;
  --category-divider: #e0c78b;
  --wait-dot: #975c08;
  background: #fff0c6;
  border-color: #e6c56e;
  color: #634816;
}
.count-card[data-wait="long"] {
  --category-bg: #fff5f3;
  --category-divider: #ecc3ba;
  --wait-dot: #aa3d31;
  background: #fbe3df;
  border-color: #e7b1a8;
  color: #742d26;
}
.wait-estimate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin: 8px 0 4px;
  font-weight: 750;
}
.wait-estimate::before {
  content: "";
  width: .65rem;
  height: .65rem;
  flex: none;
  border-radius: 50%;
  background: var(--wait-dot);
}
.count-card h2 { font-size: clamp(1.2rem, 3.8vw, 1.75rem); margin: 0; }
.total { display: flex; gap: .65rem; align-items: baseline; justify-content: center; margin: 0; font-size: 1.25rem; font-weight: 680; }
.total strong { font-size: clamp(4.1rem, 13vw, 7rem); line-height: 1.13; font-variant-numeric: tabular-nums; }
.categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px auto 0;
  max-width: 460px;
  padding: 8px 0;
  border-radius: 15px;
  background: var(--category-bg);
}
.categories > div { display: flex; justify-content: center; flex-wrap: wrap; align-items: baseline; column-gap: .45rem; padding: 2px 8px; }
.categories > div + div { border-left: 1px solid var(--category-divider); }
.categories dt { font-weight: 600; }
.categories dd { margin: 0; }
.categories strong { font-variant-numeric: tabular-nums; }
.sync { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; margin-top: 12px; text-align: center; }
.sync p { margin: 0; font-weight: 650; }
.sync p[data-state="fresh"] { color: #2c664e; }
.sync p[data-state="stale"], .sync p[data-state="error"] { color: #924229; }
.sync button {
  min-height: 44px;
  padding: 5px 16px;
  border: 1px solid #cfdcec;
  border-radius: 12px;
  background: #fff;
  color: #215680;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.sync button:disabled { opacity: .65; cursor: wait; }
.last-update { text-align: center; color: #52617a; font-size: .92rem; margin: 4px 0 0; }
.contact { display: flex; gap: 9px; margin-top: 18px; }
.contact a {
  flex: 1;
  min-height: 46px;
  text-align: center;
  border: 1px solid #7e9fc4;
  border-radius: 12px;
  background: #fff;
  padding: 9px;
  font-weight: 650;
  color: #214e77;
  text-decoration: none;
}
.contact a.call { background: #2775a8; border-color: #2775a8; color: white; }
button:focus-visible, a:focus-visible { outline: 3px solid #225882; outline-offset: 3px; }
@media (max-width: 370px) {
  .brand img { width: 57px; height: 57px; }
  .site-header { min-height: 72px; padding-inline: 14px; }
  .contact-nav { font-size: .85rem; }
}

.lookup-card {
  margin-top: 20px;
  padding: clamp(16px, 4vw, 26px);
  border: 1px solid #eadcd2;
  border-radius: 22px;
  background: #fffefa;
  text-align: center;
}
.lookup-card h2 { margin: 0; font-size: clamp(1.2rem, 4vw, 1.55rem); }
.lookup-description { margin: .15rem 0 .8rem; color: #52617a; }
.lookup-card label { display: block; margin-bottom: .35rem; font-size: .95rem; font-weight: 650; text-align: left; }
.lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.lookup-card input, .lookup-card button {
  min-width: 0;
  min-height: 52px;
  padding: 8px 14px;
  border: 1px solid #decec3;
  border-radius: 13px;
  font: inherit;
}
.lookup-card input { width: 100%; background: #fff; color: #182d4e; }
.lookup-card .lookup-digits { text-align: center; letter-spacing: .32em; font-weight: 700; font-variant-numeric: tabular-nums; }
.lookup-card button { border-color: #cbdfeb; background: #dcecf7; color: #173e60; font-weight: 700; cursor: pointer; }
.lookup-card button:disabled { opacity: .65; cursor: wait; }
.lookup-result { margin: .8rem 0 0; padding: .65rem .8rem; color: #214b34; background: #e8f4eb; border-radius: 12px; font-weight: 650; }
.lookup-result[data-state="notice"] { color: #634816; background: #fff2d3; }
.lookup-result[data-state="called"] { color: #1d4f7a; background: #e2eef8; }

.appointment-lookup-card { text-align: left; }
.appointment-lookup-card summary { font-size: clamp(1.2rem, 4vw, 1.55rem); font-weight: 750; cursor: pointer; }
.appointment-lookup-card:not([open]) summary { padding-block: 2px; }
.appointment-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.appointment-lookup-card button { width: 100%; margin-top: 12px; }
.appointment-results { display: grid; gap: 9px; margin: 12px 0 0; padding: 0; list-style: none; }
.appointment-results li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  padding: 12px;
  border: 1px solid #cddfd4;
  background: #edf6ee;
  border-radius: 12px;
}
.appointment-kind { padding: 3px 9px; background: #dcecf7; color: #17446b; border-radius: 7px; }
.appointment-results time { font-weight: 700; }
@media (max-width: 480px) {
  .appointment-fields { grid-template-columns: minmax(0, 1fr); }
  .appointment-results li span { flex-basis: 100%; }
}
