/*
 * Public pages: landing + clinic directory (/), clinic page (/c/<slug>) incl. the «🔔 Сануулга авах» card, signup,
 * invite, privacy, desktop app downloads (/download).
 * Builds on the shared tokens and components in style.css (no colors outside the tokens).
 */

/* ---------- utilities ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .5em .9em; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 10px; }
.site main { display: block; min-height: 50vh; }
.site a:focus-visible, .site button:focus-visible, .site summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.eyebrow {
  margin: 0 0 .5em; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary);
}
.nowrap { white-space: nowrap; }
.pre-line { white-space: pre-line; }
.site main [id] { scroll-margin-top: 80px; }
.break { overflow-wrap: anywhere; }
.container.narrow { max-width: 760px; }

/* ---------- header ---------- */
.site-header .brand { min-width: 0; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { flex: 0 0 auto; }
.nav { flex: 0 0 auto; }
.nav .btn.ghost { color: var(--text); }
.lbl-short { display: none; }
@media (max-width: 760px) {
  .nav { gap: 8px; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
}
@media (max-width: 400px) {
  .site-header .brand { font-size: 1.05rem; }
}
/* The landing header (/) carries three or four text links (Эмнэлэг хайх, Эмнэлгүүдэд, Үнэ, and «Програм татах» when
   DESKTOP_* is set) besides its two buttons. style.css hides text links only up to 760 px; on tablets (761–1000 px) they
   would squeeze the brand name out or scroll the page sideways, so here they go earlier. Every target is also on the
   page itself (the sections, the desktop band) and the download link is in the footer. */
@media (max-width: 1000px) { .landing-nav a:not(.btn) { display: none; } }

/* ---------- alerts (extends style.css) ---------- */
.alert.info { background: var(--info-soft); color: var(--info); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert a { color: inherit; font-weight: 600; }
.alert ul { margin: .3em 0 0; padding-left: 1.2em; }
.alert > :last-child { margin-bottom: 0; }

/* ---------- forms ---------- */
fieldset.plain { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.plain > legend { padding: 0; font-size: .875rem; font-weight: 600; margin-bottom: .3em; }
.hint { display: block; margin-top: .3em; font-size: .82rem; color: var(--muted); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.check {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px;
  font-size: .92rem; font-weight: 400; line-height: 1.45; cursor: pointer;
}
.check input[type="checkbox"], .check input[type="radio"] {
  flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; padding: 0; accent-color: var(--primary);
}
.check.invalid { color: var(--danger); }
.check .opt { color: var(--muted); }
.consent-box {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  padding: 14px 14px 4px; margin: 4px 0 16px;
}
/* informational link to the pet owners' section of the terms (/terms#s-13); not part of any consent */
.consent-box .consent-terms { margin: 0 0 10px; color: var(--muted); }
.btn .spinner {
  width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spinner { animation-duration: 2s; } html { scroll-behavior: auto; } }

/* ---------- page states (loading / not found / error) ---------- */
.state { display: grid; place-items: center; text-align: center; padding: 72px 16px; min-height: 55vh; }
.state-inner { max-width: 480px; }
.state-icon { font-size: 3.4rem; line-height: 1; margin-bottom: 14px; }
.state h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
.state p { color: var(--muted); }
.state .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.loading-dots::after { content: "…"; }

/* ---------- landing (/) ---------- */
.landing-hero .hero-art { font-size: clamp(4rem, 12vw, 7.5rem); gap: 4px; }
.hero-art-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; line-height: 1.1; }
.dir-search { display: flex; gap: 10px; max-width: 560px; margin: 0 auto 10px; }
.dir-search input { flex: 1 1 auto; min-width: 0; }
.dir-count { text-align: center; margin: 0 0 18px; min-height: 1.5em; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.dir-card { position: relative; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; }
.dir-card:hover { border-color: var(--primary); }
.dir-card:focus-within { border-color: var(--primary); }
.dir-card-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.dir-avatar {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 800;
}
.dir-card h3 { font-size: 1.08rem; margin: 0; overflow-wrap: anywhere; }
.dir-card h3 a { color: var(--text); text-decoration: none; }
.dir-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.dir-card h3 a:focus-visible { outline: none; }
.dir-card h3 a:focus-visible::after { outline: 2px solid var(--primary); outline-offset: 2px; }
.dir-meta { margin: 2px 0 0; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.dir-desc {
  margin: 0; color: var(--muted); font-size: .92rem; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.dir-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.dir-cta { color: var(--primary); font-weight: 700; }
.dir-empty { grid-column: 1 / -1; text-align: center; padding: 28px 12px; color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.feature .f-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem;
  background: var(--primary-soft); margin-bottom: 10px;
}
.feature h3 { font-size: 1.05rem; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: .93rem; }
.steps { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; counter-reset: step; }
.steps li { position: relative; padding: 18px 18px 18px 64px; border: 1px dashed var(--border); border-radius: var(--radius); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; background: var(--primary); color: var(--surface);
}
.steps b { display: block; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: .92rem; }
.cta-band {
  margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface) 70%);
}
.cta-band h3 { margin: 0 0 4px; font-size: 1.25rem; }
.cta-band p { margin: 0; color: var(--muted); max-width: 40em; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* «Үнэ» (#pricing): both plans in one card, the WeSend SMS card beside it (below it on phones, never hidden).
   The plan cards go side by side only from ~430 px: narrower, «159,000₮/сар» would wrap in one card but not the other. */
.pricing { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 860px) { .pricing { grid-template-columns: minmax(0, 1fr); } }
.plans { display: flex; flex-direction: column; gap: 14px; }
.plan-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px; }
.plan { min-width: 0; padding: 14px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.plan h3 { font-size: 1.05rem; margin: 0 0 6px; }
.plan-price { margin: 0; color: var(--primary); line-height: 1.2; }
.plan-price b { font-size: clamp(1.3rem, 4.6vw, 1.9rem); font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.plan-price .per { color: var(--muted); font-size: .9rem; font-weight: 600; margin-left: 2px; white-space: nowrap; }
.plan-limit { margin: 6px 0 0; font-weight: 600; }
.plan-includes-title { margin: 0; font-weight: 700; }
.plan-includes {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 6px 16px;
}
.plan-includes li { position: relative; padding-left: 1.5em; }
.plan-includes li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.sms-card {
  display: flex; flex-direction: column; gap: 8px;
  border: 2px solid var(--primary); background: linear-gradient(160deg, var(--primary-soft), var(--surface) 75%);
}
.sms-card h3 { font-size: 1.15rem; margin: 0; }
.sms-card p { margin: 0; }
.sms-price { font-size: 1.05rem; }
.sms-price b:first-child { color: var(--primary); font-size: 1.35rem; white-space: nowrap; }
.sms-more { margin-top: auto; padding-top: 4px; font-weight: 700; align-self: flex-start; }

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 8px 18px; flex-wrap: wrap; }

/* ---------- clinic page (/c/<slug>) ---------- */
.emergency-bar { background: var(--danger-soft); color: var(--danger); border-bottom: 1px solid var(--border); }
.emergency-bar .container { display: flex; gap: 10px; align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.emergency-bar .em-icon { font-size: 1.2rem; line-height: 1.3; }
.emergency-bar p { margin: 0; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.emergency-bar a { color: inherit; }

.clinic-hero { padding: 56px 0 44px; }
.clinic-hero h1 { overflow-wrap: anywhere; }
.clinic-hero .lead { white-space: pre-line; overflow-wrap: anywhere; }
.hero-contacts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 6px; }
.hero-contacts li { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; min-width: 0; }
.hero-contacts .ic { flex: 0 0 auto; }
.hero-facts b { font-variant-numeric: tabular-nums; }
.today-open { color: var(--ok); }
.today-closed { color: var(--danger); }
.clinic-hero .hero-art { font-size: clamp(4.5rem, 13vw, 8rem); }

.service .book-link, .vet .book-link { margin-top: 10px; align-self: flex-start; }
.vet { display: flex; flex-direction: column; align-items: center; }
.vet .book-link { align-self: center; }
.vet p { white-space: pre-line; }
/* weekly pattern "Да–Ба 09:00–18:00 · Бя 10:00–14:00": lines break after a "·" or between intervals, never inside one */
.vet-week {
  display: flex; gap: 6px; align-items: baseline; max-width: 100%; margin-top: 10px; padding: 6px 10px;
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
  font-size: .85rem; line-height: 1.45; font-variant-numeric: tabular-nums; text-align: left;
}
.vet-week .vw-icon { flex: 0 0 auto; }
.vet-week .vw-text { min-width: 0; }
.vet-week .vw-group b, .vet-week .vw-range, .vet-week-inline b, .vet-week-inline .vw-range { white-space: nowrap; }
.vet-week .vw-group b { color: var(--primary); font-weight: 700; }
.vet-week-inline b { font-weight: 600; }
.vet-week .vw-sep { color: var(--muted); }
.empty-note { text-align: center; color: var(--muted); padding: 12px 0; grid-column: 1 / -1; }

.booking-wrap > * { min-width: 0; }
.booking-closed { text-align: center; }
.booking-closed .state-icon { font-size: 2.6rem; margin-bottom: 8px; }
.slot-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.slots[aria-busy="true"] { opacity: .6; }
.slot[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot[aria-pressed="true"] { color: var(--on-primary); }
.slots-empty { grid-column: 1 / -1; }
.slots-empty .link { display: inline; margin-left: 4px; }
.empty-day .empty-title { margin: 0 0 8px; color: var(--text); font-weight: 600; }
.next-free { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; min-height: 2em; }
.next-free .link { margin-left: 0; }
.next-free .next-slot { display: inline-block; white-space: normal; text-align: left; max-width: 100%; }
.next-free a { font-weight: 600; }
.slots.invalid { outline: 2px solid var(--danger); outline-offset: 4px; border-radius: var(--radius-sm); }
.slot-summary { margin: 8px 0 0; font-size: .9rem; color: var(--ok); font-weight: 600; min-height: 1.4em; }
.slot-summary.error { color: var(--danger); }
.form-actions { margin-top: 6px; }

.success-panel { text-align: center; }
.success-panel:focus { outline: none; }
.success-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.success-panel h3 { font-size: 1.35rem; }
.code-label { margin: 18px 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.booking-code {
  display: inline-block; max-width: 100%; padding: .25em .55em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: clamp(1.7rem, 8vw, 2.5rem); font-weight: 800; letter-spacing: .14em; line-height: 1.2;
  color: var(--primary); background: var(--primary-soft);
  border: 2px dashed var(--primary); border-radius: var(--radius-sm); overflow-wrap: anywhere;
  user-select: all;
}
.code-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.success-panel .alert { text-align: left; }
.success-panel dl.kv { text-align: left; margin: 0 auto 16px; max-width: 420px; }
.assigned-vet {
  display: inline-block; max-width: 100%; margin: 0 0 14px; padding: .4em .9em; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); font-weight: 600; overflow-wrap: anywhere;
}
.manage-box { text-align: left; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px; }
.manage-url { display: block; margin: 4px 0 8px; font-weight: 600; overflow-wrap: anywhere; }
.success-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

.contact-card h3 { margin-bottom: 8px; }
.contact-card h4 { margin: 18px 0 6px; font-size: .95rem; }
.info-list li > div { min-width: 0; overflow-wrap: anywhere; }
.hours-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.hours-table th, .hours-table td {
  padding: 6px 0; background: none; border-bottom: 1px dashed var(--border);
  text-transform: none; letter-spacing: 0; font-size: .93rem; color: var(--text); font-weight: 500;
}
.hours-table td { text-align: right; font-variant-numeric: tabular-nums; }
.hours-table tr:last-child th, .hours-table tr:last-child td { border-bottom: 0; }
.hours-table tbody tr:hover { background: none; }
.hours-table tr.is-today th, .hours-table tr.is-today td { color: var(--primary); font-weight: 700; }
.hours-table .closed { color: var(--muted); }
.hours-table td.hours-empty { text-align: left; color: var(--muted); }
.hours-table tr.is-today .closed { color: var(--danger); }
.today-tag {
  display: inline-block; margin-left: 6px; padding: 0 .5em; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary); vertical-align: middle;
}
.closure-list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.closure-list li { padding: 4px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.closure-list .muted { overflow-wrap: anywhere; }

.lookup-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lookup-card { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.lookup-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lookup-card-head b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; }
.lookup-card dl.kv { margin-bottom: 12px; }
.confirm-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); }
.confirm-row span { flex: 1 1 200px; font-weight: 600; }

/* «🔔 Сануулга авах» (web push reminders) — success panel and «Миний захиалга» */
.remind-mount:empty { display: none; }
.remind-card {
  text-align: left; margin: 0 0 16px; padding: 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
}
#lookup-push .remind-card { margin: 16px 0 0; }
.remind-title { display: flex; gap: 8px; align-items: center; margin: 0 0 4px; font-size: 1.05rem; }
.remind-intro { margin: 0 0 8px; }
.remind-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.remind-list li { display: flex; gap: 8px; align-items: baseline; }
.remind-list li > span:first-child { flex: 0 0 auto; }
.remind-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.remind-consent { margin: 0; line-height: 1.5; }
.remind-consent a { font-weight: 600; }
.remind-state { margin: 0 0 10px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.remind-state.on { color: var(--ok); }
.remind-state:focus { outline: none; }
.remind-state .spinner {
  width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; display: inline-block;
}
.remind-other { margin: 0 0 10px; color: var(--muted); }
.remind-scope { margin: -4px 0 10px; line-height: 1.5; }
.remind-ios ol { margin: .4em 0 0; padding-left: 1.3em; }
.remind-ios li { margin-bottom: .25em; }
.remind-ios p { margin: 0; }
.remind-card .alert { margin-bottom: 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; letter-spacing: .06em; }

/* installed web app: the clinic opened last (start_url is "/") */
.home-clinic { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.home-clinic p { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* landing: desktop app band */
.desktop-band {
  margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
}
.desktop-band h3 { margin: 0 0 4px; font-size: 1.1rem; }
.desktop-band p { margin: 0; color: var(--muted); max-width: 44em; }

/* ---------- desktop app downloads (/download) ---------- */
.dl-main { padding-top: 32px; padding-bottom: 56px; }
.dl-hero { text-align: center; max-width: 760px; margin: 0 auto 24px; }
.dl-hero h1 { font-size: clamp(1.6rem, 4.2vw, 2.4rem); letter-spacing: -.01em; }
.dl-hero .lead { color: var(--muted); font-size: 1.05rem; margin: 0 auto; max-width: 40em; }
.dl-detected { text-align: center; margin: 0 auto 22px; max-width: 640px; }
.dl-detected .btn { font-size: 1.05rem; padding: .75em 1.4em; }
.dl-detected p { margin: 8px 0 0; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 16px; }
.dl-card { display: flex; flex-direction: column; gap: 8px; position: relative; }
.dl-card.recommended { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow); }
.dl-card .dl-icon { font-size: 2rem; line-height: 1; }
.dl-card h2 { font-size: 1.12rem; margin: 0; }
.dl-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.dl-card .btn { margin-top: auto; align-self: stretch; }
.dl-card .dl-file { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.dl-tag {
  position: absolute; top: -11px; right: 14px; padding: .1em .65em; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--primary); color: #fff;
}
.dl-tag { color: var(--on-primary); }
.dl-soon { font-weight: 600; color: var(--muted); text-align: center; padding: .55em; border: 1px dashed var(--border); border-radius: var(--radius-sm); margin-top: auto; }
.dl-more { text-align: center; margin: 14px 0 0; }
.dl-section { margin-top: 36px; }
.dl-section > h2 { font-size: 1.25rem; margin-bottom: 12px; }
.dl-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.dl-steps h3 { font-size: 1.02rem; margin: 0 0 8px; }
.dl-steps ol { margin: 0; padding-left: 1.3em; }
.dl-steps li { margin-bottom: .45em; font-size: .94rem; }
.dl-steps code { font-size: .82rem; overflow-wrap: anywhere; background: var(--surface-2); padding: .05em .35em; border-radius: 5px; }
.dl-req { width: 100%; border-collapse: collapse; font-size: .93rem; }
.dl-req th, .dl-req td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dl-req th { color: var(--muted); font-weight: 600; background: none; text-transform: none; letter-spacing: 0; font-size: .93rem; }
.dl-req-wrap { overflow-x: auto; }
.dl-notes { margin: 14px 0 0; padding-left: 1.2em; }
.dl-notes li { margin-bottom: .4em; }
.dl-web { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.dl-web p { margin: 0; color: var(--muted); max-width: 44em; }
.dl-web h2 { margin: 0 0 4px; font-size: 1.15rem; }

/* ---------- auth-style pages (signup, invite) ---------- */
.auth-main { max-width: 680px; padding-top: 32px; padding-bottom: 56px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.auth-head p { margin: 0; }
.auth-foot { text-align: center; margin-top: 18px; }
.stepper { list-style: none; display: flex; gap: 8px; margin: 0 0 16px; padding: 0; }
.stepper li {
  flex: 1 1 0; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-weight: 600; font-size: .92rem;
}
.stepper li span:first-child {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); font-size: .85rem;
}
.stepper li[aria-current="step"] { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.stepper li[aria-current="step"] span:first-child { background: var(--primary); color: var(--surface); }
.stepper li.done span:first-child { background: var(--ok-soft); color: var(--ok); }
.step-title { font-size: 1.15rem !important; font-weight: 800 !important; margin-bottom: 14px !important; }
.step-actions { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.step-actions .btn { flex: 1 1 160px; }
.slug-status { display: block; margin-top: .35em; font-size: .85rem; font-weight: 600; min-height: 1.3em; }
.slug-status.ok { color: var(--ok); }
.slug-status.bad { color: var(--danger); }
.slug-status.wait { color: var(--muted); }
.slug-status .link { font-size: inherit; }
.slug-preview { display: block; margin-top: .2em; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.slug-preview b { color: var(--text); }
.signed-in { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.login-panel { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; background: var(--surface-2); }
.login-panel p { margin-top: 0; }
details.terms { margin: -4px 0 14px 28px; font-size: .9rem; }
details.terms summary { cursor: pointer; color: var(--primary); font-weight: 600; }
details.terms ul { margin: 8px 0 0; padding-left: 1.2em; color: var(--muted); }
details.terms li { margin-bottom: 4px; }
.pending-note { display: flex; gap: 10px; align-items: flex-start; }
.pending-note .ic { font-size: 1.2rem; line-height: 1.4; }

.invite-hero { text-align: center; margin-bottom: 16px; }
.invite-hero .state-icon { font-size: 2.8rem; margin-bottom: 8px; }
.invite-hero h1 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin-bottom: .3em; overflow-wrap: anywhere; }
.invite-hero p { margin: .2em 0; }
.role-pill { display: inline-block; padding: .1em .7em; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.seg label {
  margin: 0; display: flex; align-items: center; justify-content: center; text-align: center; gap: 6px;
  padding: .55em .5em; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: .92rem;
}
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }
.pw-toggle { margin-top: -4px; }

/* ---------- privacy (/privacy) ---------- */
.prose-main { padding-top: 32px; padding-bottom: 56px; }
.prose { font-size: 1rem; }
.prose h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.prose h2 { font-size: 1.2rem; margin: 1.8em 0 .5em; scroll-margin-top: 80px; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 1.3em; }
.prose ul.info-list { padding-left: 0; }
.prose li { margin-bottom: .35em; }
.prose .muted { color: var(--muted); }
.doc-meta { display: flex; gap: 6px 18px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.controller-card { margin: 18px 0 8px; }
.controller-card h2 { margin-top: 0; }
.controller-card .info-list li { padding: 6px 0; }
.toc { margin: 18px 0 0; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.toc ol { margin: 6px 0 0; padding-left: 1.3em; columns: 2 220px; column-gap: 24px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.toc-part { margin: 12px 0 0; font-weight: 700; font-size: .92rem; }
.toc-part a { color: var(--text); }
/* the two parts of the notice: pet owners (§1–§13), clinics and staff (§14–§25) */
.prose .part-title {
  margin-top: 2.4em; padding-top: .8em; border-top: 2px solid var(--primary); color: var(--primary); font-size: 1.3rem;
}
.prose .part-title + h2 { margin-top: .7em; }
/* sub-sections: directly in the article (/terms, /security) or in a part of the notice (/privacy: section.doc-part) */
.prose > h3, .prose > .doc-part > h3 { font-size: 1.02rem; margin: 1.4em 0 .4em; scroll-margin-top: 80px; }
.prose [data-legal] { overflow-wrap: anywhere; }
.roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; margin: 12px 0; }
.roles-grid .card { padding: 16px; box-shadow: none; }
.roles-grid h3 { font-size: 1rem; margin: 0 0 4px; }
.roles-grid p { margin: 0; font-size: .93rem; color: var(--muted); }

@media print {
  .site-header, .site-footer, .skip-link, .toc { display: none; }
  .card { box-shadow: none; }
}

/* ---------- phone / e-mail verification (docs/billing-sms-spec.md §7) ---------- */
/* /signup step 3 «Утсаа баталгаажуулах» */
.stepper.has-3 li { padding: 9px 10px; font-size: .88rem; }
@media (max-width: 520px) {
  .stepper.has-3 { gap: 6px; }
  .stepper.has-3 li { flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px; font-size: .8rem; line-height: 1.25; }
}
.verify-step p { margin: 0 0 12px; }
.verify-step .step-actions { margin-top: 14px; }
.verify-box:empty { display: none; }
.verify-box { margin: 4px 0 8px; }
.verify-later { margin: 12px 0 0 !important; text-align: center; }
.verify-done { text-align: center; padding: 8px 0 4px; }
.verify-done-ic {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok); font-size: 1.6rem; font-weight: 800;
}
#verify-go { margin-top: 8px; }

/* /verify-email: the link's outcome */
.verify-email .state-inner { max-width: 520px; }
.verify-email .state p.small { color: var(--muted); }
/* landing «Үнэ»: an announced WeSend SMS price change */
.sms-next { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--info); font-size: .92rem; }
/* headings focused by the script (the new state is announced) are not controls: no focus ring */
.verify-email .state h1[tabindex="-1"]:focus, .verify-step .step-title[tabindex="-1"]:focus { outline: none; }
