/* Aviva competitor ads: one stylesheet.
   Look = Ava's own site (avivamedicalspa.com): Gill Sans everywhere, her logo serif for
   clinic names, taupe headings, blush header, mist page, rose pill buttons.
   Tokens are the only place
   raw colours, sizes and radii live. */

@font-face { font-family: "Gill"; src: url("../fonts/gill.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gill"; src: local("Gill Sans SemiBold"), local("GillSans-SemiBold"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Luxia"; src: url("../fonts/luxia.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  /* neutrals, tinted from her palette */
  --bg: #f8f8f8;          /* her mist sections */
  --surface: #ffffff;
  --blush: #f1ecec;       /* her header */
  --blush-2: #ebe4e3;     /* media wells, pressed */
  --line: #e7e0de;
  --line-strong: #9c8a85; /* inputs, outlined buttons: 3.3:1 on white */
  --ink: #3b3232;         /* numbers, names */
  --text: #4a3f3f;
  --muted: #6e6060;       /* 5.1:1 on white */
  --taupe: #807070;       /* her headings (large only) */
  /* colours with a job */
  --rose: #af8983;        /* her rose: rules, focus, selected borders */
  --rose-deep: #8f6b65;   /* primary fill (white text 4.7:1) */
  --rose-ink: #7c5b56;    /* links and selected text */
  --pos: #3e7458;         /* active */
  --warn: #9a6416;        /* stale */
  --neg: #a2443c;         /* failed */
  --scrim: rgba(40, 30, 30, 0.55); /* ok: only behind sheets */
  /* chart tones (destination mix on Advanced), all from her palette */
  --mix-booking: #5f4541; --mix-form: #807070; --mix-landing: #af8983; --mix-chat: #c9a59e; --mix-site: #d8c8c1; --mix-other: #b3aaa7; /* neutral grey: unclassified, must not read as empty */
  --warn-bg: #f7efe2;
  --row-open: #f7f2f1;

  --font: "Gill", "Gill Sans", "Gill Sans MT", "Helvetica Neue", Arial, sans-serif;
  --serif: "Luxia", "Didot", "Bodoni 72", Georgia, serif;

  /* type scale (7) */
  --t-12: 12px; --t-13: 13px; --t-15: 15px; --t-16: 16px; --t-20: 20px; --t-28: 28px; --t-36: 36px;
  /* radii (3 + pill) */
  --r-ctl: 8px; --r-card: 12px; --r-sheet: 16px; --r-pill: 999px;
  --sh-float: 0 18px 48px rgba(59, 50, 50, 0.16), 0 2px 8px rgba(59, 50, 50, 0.08);
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 var(--t-15) / 1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  font-synthesis: none; /* real semibold Gill where the device has it, never a smeared fake */
}
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--rose-ink); text-underline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { text-wrap: pretty; margin: 0; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
:root { accent-color: var(--rose-deep); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico.fill { fill: currentColor; stroke: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink);
  font-size: var(--t-15); font-weight: 400; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}
.btn:hover { background: var(--blush); }
.btn.primary { background: var(--rose-deep); border-color: var(--rose-deep); color: #fff; font-weight: 600; letter-spacing: 0.01em; }
.btn.primary:hover { background: var(--rose-ink); border-color: var(--rose-ink); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: var(--t-13); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--rose-ink); }
.btn.quiet:hover { background: var(--blush); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn .ico { width: 16px; height: 16px; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background-color 120ms ease-out;
}
.icon-btn:hover { background: var(--blush); }

/* ---------- header ---------- */
.top { background: var(--blush); border-bottom: 1px solid var(--line); position: relative; z-index: 30; }
.top-in { display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 var(--gutter); }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 92px; height: auto; }
.brand span { font-size: var(--t-15); color: var(--muted); border-left: 1px solid var(--line-strong); padding-left: 14px; white-space: nowrap; }
.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tabs a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill);
  color: var(--text); text-decoration: none; font-size: var(--t-15); transition: background-color 120ms ease-out;
}
.tabs a:hover { background: var(--blush-2); }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.top.owner .signout-txt { display: none; }
.top .btn.signout { min-width: 44px; padding: 0 10px; }
.who { font-size: var(--t-13); color: var(--muted); }

/* ---------- page ---------- */
.page { padding: 20px var(--gutter) 64px; }
.h-page { font-family: var(--serif); font-weight: 400; font-size: var(--t-28); line-height: 1.15; color: var(--taupe); letter-spacing: 0.01em; }
.h-sec { font-size: var(--t-20); font-weight: 600; color: var(--taupe); line-height: 1.2; }
.lead { color: var(--muted); font-size: var(--t-15); margin-top: 6px; max-width: 70ch; }

/* ---------- Aviva strip ---------- */
.strip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 0; }
.strip-head h2 { font-size: var(--t-16); font-weight: 600; color: var(--taupe); }
.fresh { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-13); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dot.pos { background: var(--pos); }
.dot.warn { background: var(--warn); }
.dot.neg { background: var(--neg); }
.figs { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 4px 0 6px; }
.fig { padding: 10px 16px 12px; border-top: 1px solid var(--line); min-width: 0; }
.fig:nth-child(odd) { border-right: 1px solid var(--line); }
.fig dt { font-size: var(--t-13); color: var(--muted); }
.fig dd { margin: 4px 0 0; font-family: var(--serif); font-size: var(--t-28); font-weight: 400; color: var(--ink); line-height: 1.1; font-variant-numeric: lining-nums; }
.fig .sub { display: block; margin-top: 2px; font-size: var(--t-13); color: var(--muted); }
.fig dd.none { font-family: var(--font); font-size: var(--t-16); color: var(--muted); padding-top: 8px; }
.fig:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: 0; }
.strip-note { padding: 0 16px 14px; font-size: var(--t-13); color: var(--muted); }

/* ---------- competitors head + controls ---------- */
.comp-head { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; }
.controls { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; flex: 1 1 100%;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--muted);
}
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: var(--t-16); color: var(--ink); }
.search:focus-within { border-color: var(--rose); }
.seg { display: inline-flex; padding: 3px; background: var(--blush); border-radius: var(--r-pill); }
.seg button {
  min-height: 38px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent;
  font-size: var(--t-15); color: var(--text); cursor: pointer; transition: background-color 120ms ease-out;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--rose-ink); box-shadow: inset 0 0 0 1px var(--rose); }
.pick { position: relative; display: inline-flex; align-items: center; }
.pick select {
  appearance: none; -webkit-appearance: none; min-height: 44px; padding: 0 34px 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface);
  font-size: var(--t-15); color: var(--ink); cursor: pointer; max-width: 210px; text-overflow: ellipsis;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
.pick select:hover { background: var(--blush); }
.pick.set select { border-color: var(--rose); background: var(--blush); color: var(--rose-ink); }
.pick .ico { position: absolute; right: 12px; width: 14px; height: 14px; pointer-events: none; color: var(--muted); }
.filters-desk, .sort-pick { display: none; }
.result-line[hidden] { display: none; }
.result-line { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 44px; font-size: var(--t-15); color: var(--muted); }
.pick select { field-sizing: content; }
.result-line strong { color: var(--ink); font-weight: 600; }

/* ---------- clinic rows ---------- */
.clinic { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.clinic:first-of-type { border-top: 0; padding-top: 4px; }
.clinic-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; }
.clinic-name { font-family: var(--serif); font-weight: 400; font-size: var(--t-28); line-height: 1.1; color: var(--taupe); letter-spacing: 0.01em; }
.clinic-meta { margin-top: 6px; color: var(--muted); font-size: var(--t-15); }
.clinic-links { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
  color: var(--text); font-size: var(--t-13); text-decoration: none; transition: background-color 120ms ease-out;
}
.chip-link:hover { background: var(--blush); }
.chip-link .ico { width: 14px; height: 14px; color: var(--muted); }
.link-none { display: inline-flex; align-items: center; min-height: 36px; font-size: var(--t-13); color: var(--muted); padding: 0 4px; }
.rail-wrap { position: relative; margin: 16px calc(-1 * var(--gutter)) 0; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 244px; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px var(--gutter) 10px; scrollbar-width: thin;
  scroll-padding-left: var(--gutter);
}
.rail > * { scroll-snap-align: start; }
.rail-more { display: flex; align-items: center; justify-content: center; min-height: 120px; }
.rail-btn { display: none; }

/* ---------- ad card ---------- */
.ad { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; min-width: 0; }
.ad-media { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0; background: var(--blush-2); cursor: pointer; overflow: hidden; }
.ad-media img, .ad-media video { width: 100%; height: 100%; object-fit: cover; }
.ad-media .empty-media { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; justify-items: center; color: var(--muted); font-size: var(--t-13); }
.state-chip {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; background: var(--surface); border-radius: 6px; font-size: var(--t-12); color: var(--ink);
}
.fmt-chip { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; background: var(--surface); border-radius: 6px; font-size: var(--t-12); color: var(--ink); }
.fmt-chip .ico { width: 14px; height: 14px; }
.play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); color: var(--ink); border: 0; cursor: pointer;
}
.play .ico { width: 22px; height: 22px; margin-left: 3px; }
.ad-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.ad-clinic { font-size: var(--t-13); color: var(--rose-ink); }
.ad-offer { font-size: var(--t-16); font-weight: 600; color: var(--ink); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* even card heights only where cards sit side by side */
.rail .ad-offer { min-height: 2.6em; }
.rail .ad-text { min-height: 2.9em; }
@media (min-width: 560px) { .grid .ad-offer { min-height: 2.6em; } .grid .ad-text { min-height: 2.9em; } }
.ad-offer.none { font-weight: 400; color: var(--muted); font-size: var(--t-13); }
.ad-text { font-size: var(--t-13); color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-facts { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: var(--t-13); color: var(--text); }
.ad-facts .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.ad-facts .k { color: var(--muted); }
.places { display: inline-flex; gap: 6px; color: var(--muted); }
.places .ico { width: 15px; height: 15px; }
.ad-open { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.ad-open:hover .ad-offer { color: var(--rose-ink); }
.ad-owner { padding: 0 14px 14px; }

/* ---------- grid (all ads) ---------- */
.grid { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); gap: 14px; }
.more { margin-top: 24px; display: flex; justify-content: center; }

/* ---------- empty / unknown ---------- */
.empty { margin-top: 24px; padding: 40px 16px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.empty p { color: var(--muted); }
.empty .btn { margin-top: 14px; }
.unknown { color: var(--muted); }

/* ---------- sheet (ad detail, mobile filters) ---------- */
.sheet { position: fixed; inset: 0; z-index: 100; visibility: hidden; }
.sheet.on { visibility: visible; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 200ms ease-out; }
.sheet.on .sheet-scrim { opacity: 1; }
.sheet-panel {
  position: absolute; inset: 0; background: var(--surface); display: flex; flex-direction: column;
  transform: translateY(12px); opacity: 0; transition: transform 220ms var(--ease), opacity 220ms ease-out;
}
.sheet.on .sheet-panel { transform: none; opacity: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sheet-head h2 { font-family: var(--serif); font-weight: 400; font-size: var(--t-20); color: var(--taupe); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot .btn { width: 100%; }
.fsheet .sheet-body { padding: 8px 16px 16px; }
.fsheet .field { margin-top: 16px; }

/* ---------- ad detail ---------- */
.detail { display: grid; }
.d-media { background: var(--blush-2); display: flex; align-items: center; justify-content: center; }
.d-media img, .d-media video { width: 100%; max-height: 70vh; object-fit: contain; }
.d-media { position: relative; }
.d-carousel { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px; width: 100%; scrollbar-width: none; }
.d-carousel::-webkit-scrollbar { display: none; }
.d-nav { display: none; }
.d-count { position: absolute; left: 12px; top: 12px; padding: 4px 9px; border-radius: 6px; background: var(--surface); font-size: var(--t-12); color: var(--ink); }
.d-carousel > * { scroll-snap-align: center; }
.d-info { padding: 16px 16px 32px; }
.d-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: var(--t-15); color: var(--text); }
.d-status .state { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.d-sec { margin-top: 22px; }
.d-sec h3 { font-size: var(--t-13); font-weight: 600; color: var(--taupe); margin-bottom: 8px; }
.d-offer { font-size: var(--t-20); font-weight: 600; color: var(--ink); line-height: 1.3; }
.d-offer.none { font-size: var(--t-16); font-weight: 400; color: var(--muted); }
.flags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.flag { padding: 4px 10px; border-radius: 6px; background: var(--blush); font-size: var(--t-13); color: var(--text); }
.copy { white-space: pre-line; font-size: var(--t-15); color: var(--text); line-height: 1.55; max-width: 62ch; }
.kv { display: grid; grid-template-columns: 132px 1fr; gap: 8px 16px; margin: 0; font-size: var(--t-15); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.shot { display: block; width: 168px; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; cursor: zoom-in; background: var(--blush-2); padding: 0; }
.shot img { width: 100%; aspect-ratio: 375 / 812; object-fit: cover; object-position: top; }
.owner-box { margin-top: 26px; padding: 16px; border-radius: var(--r-card); background: var(--blush); }
.owner-box h3 { color: var(--rose-ink); }
.owner-box p { font-size: var(--t-15); }
.owner-box .btn { margin-top: 12px; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: var(--scrim); display: grid; place-items: center; padding: 24px; }
.lightbox img { max-height: 92vh; width: auto; border-radius: var(--r-ctl); background: var(--surface); }

/* ---------- tables (advanced) ---------- */
.tbl-wrap { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-13); }
.tbl th { text-align: left; font-weight: 600; color: var(--taupe); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .cname { font-weight: 600; color: var(--ink); font-size: var(--t-15); }
.tbl .csub { color: var(--muted); }
table.tbl.fixed { table-layout: fixed; }
.tbl.fixed td { overflow: hidden; }
.tbl .mixcell { align-items: flex-start; }
.tbl .mixlbl { white-space: normal; min-width: 0; }
.tbl .mix { margin-top: 5px; }
.tbl.fixed .cname, .tbl.fixed .csub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offers { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.offers li { display: grid; gap: 2px; }
.o-text { color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.o-meta { font-size: var(--t-13); color: var(--muted); }
.ids summary { cursor: pointer; color: var(--rose-ink); font-size: var(--t-13); min-height: 32px; display: flex; align-items: center; }
.ids .id { display: inline-block; white-space: nowrap; margin: 0 10px 4px 0; font-size: var(--t-12); color: var(--text); }
.tbl tr.row { cursor: pointer; }
.tbl tr.row:hover td { background: var(--row-open); }
.tbl tr.open td, .xpand td { background: var(--row-open); }
.tbl tr.open td { border-bottom-color: transparent; }
.mixcell { display: flex; align-items: center; gap: 10px; }
.mix { display: flex; flex: none; height: 10px; width: 120px; border-radius: 5px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.mix span { display: block; height: 100%; }
.mix span + span { box-shadow: inset 1px 0 0 var(--surface); }
.mixlbl { color: var(--text); white-space: nowrap; }
.xpand td { padding: 14px 14px 20px; }
.chev { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; color: var(--muted); transition: transform 150ms ease-out; }
tr[aria-expanded="true"] .chev, .alist [aria-expanded="true"] .chev { transform: rotate(90deg); }
.xgrid { display: grid; gap: 20px; }
.xgrid h4 { margin: 0 0 6px; font-size: var(--t-13); color: var(--taupe); }
.xgrid ul { margin: 0; padding-left: 18px; }
.note-line { margin-top: 10px; font-size: var(--t-13); color: var(--muted); }
/* Advanced on phones: two-line rows */
.tbl-wrap { display: none; }
.alist { list-style: none; margin: 16px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.alist > li + li { border-top: 1px solid var(--line); }
.adetail .x-mix, .adetail .x-hooks { display: none; }
.x-hooks { margin-bottom: 14px; }
.arow { display: grid; gap: 6px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.arow[aria-expanded="true"] { background: var(--row-open); }
.arow-1 { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.arow-1 .cname { font-weight: 600; color: var(--ink); font-size: var(--t-15); }
.arow-1 .num { font-size: var(--t-13); color: var(--muted); white-space: nowrap; }
.arow-2 .mixcell { flex-wrap: wrap; gap: 6px 10px; }
.arow-2 .mix { width: 100%; }
.arow-2 .mixlbl { font-size: var(--t-13); white-space: normal; }
.adetail { padding: 4px 14px 18px; background: var(--row-open); font-size: var(--t-13); }
.adetail .kv { grid-template-columns: 120px 1fr; font-size: var(--t-13); }
.adetail .xgrid { margin-top: 16px; }

/* ---------- recreate ---------- */
.rc { display: grid; gap: 24px; margin-top: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.panel h2 { font-size: var(--t-16); font-weight: 600; color: var(--ink); }
.ref { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; margin-top: 12px; }
.ref-img { padding: 0; border: 0; background: var(--blush-2); border-radius: var(--r-ctl); overflow: hidden; cursor: zoom-in; }
.ref-img img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.ref-caption { font-size: var(--t-15); color: var(--text); display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.ref-offer { margin-top: 8px; font-size: var(--t-13); color: var(--ink); }
.ref-offer.unknown { color: var(--muted); }
.field { display: grid; gap: 6px; margin-top: 14px; max-width: 640px; }
.field label, .field .lbl { font-size: var(--t-13); color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 44px; padding: 10px 12px; font-size: var(--t-16); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(175, 137, 131, 0.22); }
.count { font-size: var(--t-12); color: var(--muted); justify-self: end; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radio { position: relative; }
.radio input { position: absolute; opacity: 0; }
.radio span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); cursor: pointer; font-size: var(--t-15); }
.radio input:checked + span { border-color: var(--rose); background: var(--blush); color: var(--rose-ink); }
.radio input:focus-visible + span { outline: 2px solid var(--rose); outline-offset: 2px; }
.job { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: var(--t-15); color: var(--text); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--rose-deep); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.budget { margin-top: 10px; font-size: var(--t-13); color: var(--muted); }
.err { margin-top: 10px; font-size: var(--t-15); color: var(--neg); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Meta feed preview (mirrors how the ad will look) */
.fb { max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.fb-head { display: flex; align-items: center; gap: 10px; padding: 12px; }
.fb-av { width: 40px; height: 40px; border-radius: 50%; background: var(--blush); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.fb-av img { width: 32px; }
.fb-name { font-size: var(--t-15); font-weight: 600; color: var(--ink); line-height: 1.2; }
.fb-sp { font-size: var(--t-12); color: var(--muted); }
.fb-text { padding: 0 12px 10px; font-size: var(--t-15); white-space: pre-line; color: var(--ink); }
.fb-img { aspect-ratio: 1 / 1; background: var(--blush-2); display: grid; place-items: center; color: var(--muted); font-size: var(--t-13); text-align: center; padding: 0; }
.fb-img img { width: 100%; height: 100%; object-fit: cover; }
.fb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--bg); border-top: 1px solid var(--line); }
.fb-url { font-size: var(--t-12); color: var(--muted); text-transform: lowercase; }
.fb-hl { font-size: var(--t-15); font-weight: 600; color: var(--ink); line-height: 1.25; }
.fb-desc { font-size: var(--t-13); color: var(--muted); }
.fb-cta { flex: none; padding: 8px 14px; border-radius: 6px; background: var(--blush-2); font-size: var(--t-13); font-weight: 600; color: var(--ink); }
.confirm-list { margin: 12px 0 0; }
.confirm-list .kv { grid-template-columns: 148px 1fr; }
.callout { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--warn-bg); font-size: var(--t-15); color: var(--text); }
.steps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: var(--t-13); color: var(--muted); }
.steps .on { color: var(--ink); font-weight: 600; }
.steps .done { color: var(--pos); }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100svh; display: grid; background: var(--surface); }
.login-photo { position: relative; height: 200px; background: var(--blush-2); overflow: hidden; }
.login-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.login-main { display: grid; align-content: start; justify-items: center; padding: 32px 16px 48px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .logo { width: 132px; height: auto; }
.login-card h1 { margin-top: 28px; font-family: var(--serif); font-weight: 400; font-size: var(--t-28); color: var(--taupe); }
.login-card .lead { margin-top: 6px; }
.login-card form { margin-top: 22px; }
.login-card .field input { max-width: none; }
.login-card .btn.primary { width: 100%; margin-top: 22px; }
.login-foot { margin-top: 28px; font-size: var(--t-13); color: var(--muted); }

/* ---------- loading skeleton (keeps the layout) ---------- */
.skel { background: var(--blush); border-radius: 6px; }
.skel-row { display: grid; grid-auto-flow: column; grid-auto-columns: 244px; gap: 14px; margin-top: 16px; overflow: hidden; }
.skel-card { aspect-ratio: 4 / 6.4; border-radius: var(--r-card); background: var(--blush); }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  :root { --gutter: 32px; }
  .top-in { height: 72px; }
  .signout-txt, .top.owner .signout-txt { display: inline; }
  .top .btn.signout { padding: 0 14px; }
  .brand img { width: 108px; }
  .page { padding-top: 28px; }
  .h-page { font-size: var(--t-36); }
  .figs { grid-template-columns: repeat(var(--n, 5), 1fr); }
  .fig { border-top: 0; border-right: 1px solid var(--line); padding: 8px 20px 14px; }
  .fig:nth-child(odd) { border-right: 1px solid var(--line); }
  .fig:last-child, .fig:last-child:nth-child(odd) { border-right: 0; grid-column: auto; }
  .fig dd { font-size: var(--t-36); }
  .strip-head { padding: 16px 20px 6px; }
  .strip-note { padding: 0 20px 16px; }
  .search { flex: 0 1 300px; }
  .filters-desk { display: contents; }
  .sort-pick { display: inline-flex; margin-left: auto; }
  .result-line { margin-top: 10px; }
  .filters-phone { display: none; }
  .clinic-name { font-size: var(--t-36); }
  .rail { grid-auto-columns: 252px; gap: 16px; }
  .rail-wrap:hover .rail-btn { opacity: 1; }
  .rail-btn {
    display: grid; place-items: center; position: absolute; top: calc(50% - 30px); z-index: 2; width: 44px; height: 44px;
    border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh-float);
    cursor: pointer; opacity: 0; transition: opacity 150ms ease-out; color: var(--ink);
  }
  .rail-btn.prev { left: 12px; }
  .rail-btn.next { right: 12px; }
  .rail-btn[hidden] { display: none; }
  .sheet-panel {
    inset: 0 0 0 auto; width: min(960px, 92vw); transform: translateX(16px); border-radius: var(--r-sheet) 0 0 var(--r-sheet); box-shadow: var(--sh-float);
  }
  .sheet.on .sheet-panel { transform: none; }
  .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100%; }
  .d-media { position: sticky; top: 0; align-self: start; height: calc(100vh - 61px); }
  .d-media img, .d-media video { max-height: none; height: 100%; }
  .d-carousel { grid-auto-columns: 100%; height: 100%; padding: 0; }
  .d-nav { display: grid; position: absolute; top: 50%; translate: 0 -50%; z-index: 2; box-shadow: var(--sh-float); }
  .d-nav.prev { left: 12px; } .d-nav.next { right: 12px; }
  .d-nav[disabled] { opacity: 0; pointer-events: none; }
  .d-info { padding: 24px 28px 40px; }
  .fsheet .sheet-panel { width: 420px; }
  .xgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .x-offers { grid-column: 1 / -1; }
  .x-offers .offers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 32px; }
  .rc { grid-template-columns: minmax(0, 680px) 440px; justify-content: start; column-gap: 48px; align-items: start; }

  .rc-preview { position: sticky; top: 24px; }
  .ref { grid-template-columns: 200px 1fr; }
  .login { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .login-photo { height: auto; min-height: 100vh; }
  .login-main { align-content: center; padding: 48px; }
}
@media (min-width: 1100px) {
  .clinic { display: grid; grid-template-columns: 260px minmax(0, 1fr); column-gap: 32px; align-items: start; }
  .clinic-head { flex-direction: column; align-items: flex-start; gap: 14px; position: sticky; top: 16px; }
  .clinic-name { font-size: var(--t-28); }
  .rail-wrap { margin: 0 calc(-1 * var(--gutter)) 0 0; }
  .rail { padding-left: 0; scroll-padding-left: 0; }
  .rail-btn.prev { left: -22px; }
  .tbl-wrap { display: block; overflow: clip; }
  .alist { display: none; }
}
@media (max-width: 899px) {
  .chip-link, .btn.small { min-height: 44px; }
  /* Recreate on phones: the made image shows right under the image step */
  .rc { display: flex; flex-direction: column; gap: 16px; }
  .rc-main { display: contents; }
  .rc-main > .panel { margin-top: 0 !important; }
  .fb-img:not(:has(img)) { aspect-ratio: auto; height: 88px; }
  .p-ref { order: 1; } .p-img { order: 2; } .rc-preview { order: 3; } .p-words { order: 4; } .p-where { order: 5; } .p-step { order: 4; }
}
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }
}
@media (hover: none) {
  .btn:hover, .icon-btn:hover, .chip-link:hover, .pick select:hover, .tabs a:hover { background: inherit; }
  .btn.primary:hover { background: var(--rose-deep); }
}
@media (prefers-reduced-motion: reduce) {
  .spin { display: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
