/* Minimal, Nepali-first. One typeface (Mukta, self-hosted), soft coffee-and-milk palette, one latte accent. */
@font-face { font-family: Mukta; src: url("/static/fonts/Mukta-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Mukta; src: url("/static/fonts/Mukta-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: Mukta; src: url("/static/fonts/Mukta-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --ink: #3E2A1E;
  --ink-2: #5C4332;
  --muted: #7A6555;
  --line: #E8DDD0;
  --soft: #F2EADF;
  --bg: #FBF7F1;
  --marigold: #D6B08A;
  --star: #8E5F24;
  --danger: #C4281C;
  --danger-soft: #FBEDEB;
  --ok: #1F7A4D;
  --ok-soft: #E6F3EC;
  --warn-soft: #FFF5DC;
  --r: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Mukta, "Noto Sans Devanagari", system-ui, sans-serif; font-size: 18px; line-height: 1.55; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.error { color: var(--danger); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 5; background: rgba(251,247,241,.96); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; white-space: nowrap; }
.brand-dot { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, var(--bg) 0 30%, var(--marigold) 31%); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.link-btn { background: none; border: none; padding: 8px 10px; color: var(--ink-2); min-height: 44px; }
.pill-btn { background: var(--ink); color: #fff; border: none; border-radius: 999px; padding: 6px 18px; min-height: 40px; font-weight: 700; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--soft); font-weight: 800; }

main { max-width: 640px; margin: 0 auto; padding: 0 16px 48px; outline: none; }
main.wide { max-width: 1120px; }

/* ---------- buttons and fields ---------- */
.primary-btn { background: var(--ink); color: #fff; border: none; border-radius: var(--r); padding: 12px 20px; font-weight: 700; min-height: 52px; }
.secondary-btn { background: var(--bg); color: var(--ink); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 10px 18px; font-weight: 700; min-height: 52px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.text-btn { background: none; border: none; color: var(--ink-2); padding: 10px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.wide { width: 100%; }
.input { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--bg); min-height: 52px; }
.input:focus { border-color: var(--ink-2); outline: none; }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.field-label { display: block; font-weight: 700; margin: 12px 0 6px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- home: help block ---------- */
.help { text-align: center; padding: 36px 0 32px; border-bottom: 1px solid var(--line); }
.help h1 { font-size: clamp(26px, 6.5vw, 34px); line-height: 1.2; margin: 0 0 8px; font-weight: 800; }
.help p { margin: 0 auto 24px; max-width: 34ch; color: var(--muted); }
.mic { width: 132px; height: 132px; border-radius: 50%; border: none; background: var(--marigold); color: var(--ink);
  display: grid; place-items: center; margin: 0 auto; position: relative; }
.mic svg { width: 56px; height: 56px; }
.mic:active { transform: scale(.97); }
.mic.rec { background: var(--danger); color: #fff; }
.mic.rec::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--danger); animation: ring 1.4s ease-out infinite; }
@keyframes ring { from { transform: scale(.92); opacity: .9; } to { transform: scale(1.22); opacity: 0; } }
.mic-label { margin-top: 14px; font-weight: 700; }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- directory ---------- */
.row-name { font-weight: 700; font-size: 19px; line-height: 1.3; }
.row-sub { color: var(--muted); font-size: 15px; grid-column: 1; }
.row-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 15px; align-items: center; }
.stars { color: var(--star); font-weight: 700; white-space: nowrap; }
.tag { font-size: 14px; color: var(--ok); }
.tag.grey { color: var(--muted); }
.empty { padding: 32px 0; text-align: center; color: var(--muted); }

/* ---------- hospital page ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; margin: 14px 0 4px; color: var(--ink-2); text-decoration: none; min-height: 44px; }
.h-title { font-size: clamp(24px, 6vw, 30px); line-height: 1.2; margin: 4px 0 2px; font-weight: 800; }
.h-sub { color: var(--muted); margin: 0 0 10px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.actions .primary-btn, .actions .secondary-btn { text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 8px; text-align: center; }
.map-box { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--soft); }
.map-box iframe { display: block; width: 100%; height: 260px; border: 0; }
.seg { display: flex; border-bottom: 1px solid var(--line); }
.seg button { flex: 1; background: none; border: none; padding: 10px; min-height: 44px; color: var(--muted); }
.seg button[aria-pressed="true"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 -3px 0 var(--ink); }
section.block { padding: 18px 0; border-bottom: 1px solid var(--line); }
section.block:last-child { border-bottom: none; }
section.block h2 { font-size: 21px; margin: 0 0 8px; font-weight: 800; }
section.block h3 { font-size: 18px; margin: 14px 0 6px; }
ol.steps { margin: 0; padding-left: 24px; }
ol.steps li { margin-bottom: 6px; padding-left: 4px; }
ul.plain { margin: 0; padding-left: 22px; }
ul.plain li { margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--soft); border-radius: 999px; padding: 2px 12px; font-size: 16px; }
.note { font-size: 15px; color: var(--muted); margin: 8px 0 0; }

/* reviews */
.rating-big { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.rating-big b { font-size: 34px; line-height: 1; }
.review { padding: 12px 0; border-top: 1px solid var(--line); }
.review-head { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.review p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.star-pick { display: flex; gap: 4px; margin: 4px 0 10px; }
.star-pick button { width: 48px; height: 48px; border: none; background: none; font-size: 34px; line-height: 1; color: var(--line); padding: 0; }
.star-pick button.on { color: var(--star); }
.review-form { background: var(--soft); border-radius: var(--r); padding: 14px; margin-top: 10px; }
.review-form .row-end { margin-top: 10px; }

/* ---------- help flow ---------- */
.flow { padding-top: 12px; }
.place-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 14px; min-height: 40px; font-size: 16px; }
.place-chip.set { border-color: var(--ink-2); }
.place-chip svg { width: 16px; height: 16px; }
.center { text-align: center; }
.progress { list-style: none; padding: 0; margin: 28px auto; max-width: 320px; }
.progress li { padding: 8px 0 8px 34px; position: relative; color: var(--muted); }
.progress li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); }
.progress li.now { color: var(--ink); font-weight: 700; }
.progress li.now::before { border-color: var(--marigold); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.progress li.done { color: var(--ink); }
.progress li.done::before { background: var(--ok); border-color: var(--ok); }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--ink); animation: spin 0.9s linear infinite; }

.alarm { background: var(--danger); color: #fff; border-radius: var(--r); padding: 14px 16px; margin: 14px 0; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.alarm strong { display: block; font-size: 19px; }
.alarm span { font-size: 15px; }
.alarm a { background: #fff; color: var(--danger); font-weight: 800; text-decoration: none; border-radius: 999px; padding: 10px 18px; white-space: nowrap; }

/* ---------- report ---------- */
.r-urgency { border-left: 6px solid var(--u); background: var(--u-soft); border-radius: 0 var(--r) var(--r) 0; padding: 12px 16px; margin: 16px 0; }
.r-urgency b { color: var(--u); font-size: 20px; display: block; }
.u-emergency { --u: var(--danger); --u-soft: var(--danger-soft); }
.u-urgent { --u: #B5480F; --u-soft: #FDF0E7; }
.u-soon { --u: #8A6400; --u-soft: var(--warn-soft); }
.u-routine { --u: var(--ok); --u-soft: var(--ok-soft); }
.r-title { font-size: clamp(24px, 6vw, 30px); line-height: 1.25; margin: 8px 0 0; font-weight: 800; }
.dept-box { border: 1.5px solid var(--ink); border-radius: var(--r); padding: 12px 16px; }
.dept-box b { font-size: 20px; }
.dept-box p { margin: 4px 0 0; }
.pick { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.pick-body { padding: 14px 16px; }
.pick-name { font-size: 20px; font-weight: 800; line-height: 1.3; }
.pick .actions { margin: 12px 0 0; }
.other { padding: 12px 0; border-top: 1px solid var(--line); }
.other:first-of-type { border-top: none; }
.other-head { display: flex; justify-content: space-between; gap: 8px; }
.listen-row { margin: 0 0 18px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.listen-row .listen { width: 100%; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 0 max(12px, env(safe-area-inset-bottom)); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 16px; }
.said { font-style: normal; color: var(--ink-2); background: var(--soft); border-radius: var(--r); padding: 12px 14px; margin: 0; }
.disclaimer { font-size: 14px; color: var(--muted); text-align: center; margin-top: 18px; }

/* ---------- sheets ---------- */
.sheet { border: none; border-radius: 18px; padding: 0; width: min(440px, calc(100% - 24px)); color: var(--ink); }
.sheet::backdrop { background: rgba(62,42,30,.5); }
.sheet-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.sheet h2 { margin: 0; font-size: 22px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1.5px solid var(--line); background: var(--bg); border-radius: var(--r); min-height: 54px; font-weight: 700; }
.google-btn svg { width: 22px; height: 22px; }

.toast { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 20; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 16px; max-width: calc(100% - 32px); text-align: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- ranking (home) ---------- */
.rk-hero { padding: 36px 0 24px; }
.rk-eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--star); }
.rk-hero h1 { margin: 0; font-size: clamp(30px, 6vw, 46px); line-height: 1.12; font-weight: 800; max-width: 22ch; }
.rk-sub { margin: 14px 0 0; max-width: 60ch; color: var(--muted); font-size: 18px; }
.rk-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 28px; }
@media (min-width: 640px) { .rk-stats { grid-template-columns: repeat(4, 1fr); } }
.rk-stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.rk-stat b { display: block; font-size: 32px; line-height: 1.1; font-weight: 800; }
.rk-stat span { color: var(--muted); font-size: 15px; }

.rk-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--soft); border-radius: 20px; padding: 16px 20px; margin: 8px 0 28px; }
.rk-cta > div { flex: 1; min-width: 200px; }
.rk-cta b { font-size: 19px; }
.rk-cta p { margin: 2px 0 0; color: var(--muted); font-size: 16px; }
.mic.mic-sm { width: 56px; height: 56px; flex: none; }
.mic.mic-sm svg { width: 26px; height: 26px; }

.rk-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.rk-controls .input { width: auto; min-height: 44px; padding: 6px 12px; border-radius: 999px; flex: 1 1 150px; min-width: 0; }
.rk-controls .rk-search { flex: 2 1 220px; }
.rk-check { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; padding: 0 6px; min-height: 44px; white-space: nowrap; }
.rk-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.rk-count { color: var(--muted); font-size: 15px; margin: 14px 2px 8px; }

.rk-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 700px) { .rk-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .rk-cards { grid-template-columns: 1fr 1fr 1fr; } }
.rk-cards .empty { grid-column: 1 / -1; }
.rk-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.rk-card-link { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px 18px 14px; text-decoration: none; color: inherit; border-radius: inherit; }
.rk-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 2px; }
.rk-rank { display: inline-flex; align-items: baseline; gap: 1px; min-width: 52px; justify-content: center; padding: 4px 12px; border-radius: 12px;
  background: var(--soft); font-weight: 800; font-size: 24px; line-height: 1.2; }
.rk-rank small { font-size: 14px; color: var(--muted); }
.rk-overall { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.rk-overall b { font-size: 28px; font-weight: 800; }
.rk-overall small { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.rk-name { font-weight: 800; font-size: 18px; line-height: 1.3; }
.rk-place { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; }
.rk-place svg { width: 15px; height: 15px; }
.rk-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rk-tags .chip { font-size: 13px; padding: 1px 10px; }
.stars.small { font-size: 14px; }
.rk-inds { display: grid; gap: 6px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rk-ind { display: grid; grid-template-columns: 9em 1fr; align-items: center; gap: 8px; font-size: 14px; }
.rk-ind-label { color: var(--muted); }
.rk-score { display: flex; align-items: center; gap: 8px; }
.rk-score b { font-size: 14px; min-width: 26px; text-align: right; }
.rk-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; min-width: 40px; }
.rk-bar i { display: block; height: 100%; border-radius: inherit; background: var(--marigold); }
.rk-pending { justify-self: start; font-size: 13px; font-style: italic; color: var(--muted); border: 1px dashed var(--line); border-radius: 999px; padding: 0 10px; }
.rk-go { align-self: flex-end; margin-top: auto; font-weight: 800; color: var(--ink-2); }

.rk-method { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.rk-method h2 { font-size: 24px; margin: 0 0 6px; }
.rk-weights { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .rk-weights { grid-template-columns: 1fr 1fr; } }
.rk-weights li { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.rk-weights p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.rk-w { flex: none; min-width: 56px; text-align: center; font-weight: 800; font-size: 18px; background: var(--soft); border-radius: 10px; padding: 6px 8px; }

