/* ==========================================================================
   Vetdoxio — shared design system
   Edit the tokens in :root to re-theme the whole prototype.
   ========================================================================== */

:root {
  /* ---------- Core brand palette ---------- */
  --teal: #0A4650;          /* Forest Teal: brand, headings, primary buttons */
  --teal-dark: #104A50;     /* Deep Teal: dark emphasis, pressed states */
  --teal-800: #073740;
  --teal-600: #135C68;      /* primary button hover */
  --lime: #9ED763;          /* Lime Green: key CTAs, positive highlights */
  --lime-600: #6FA83A;
  --lime-50: #F1F9E8;
  --warm-cream: #FDFCF7;    /* Warm Cream */
  --white: #FFFFFF;
  --charcoal: #1E2A2F;      /* Charcoal: body text */
  --gray-green: #71817B;    /* Gray-Green: icons, placeholders, subtle lines */
  --light-border: #F0EDE0;  /* Light Border */
  --on-brand: #FFFFFF;      /* text on Forest Teal surfaces */

  /* Text. Secondary text uses a deeper gray-green than #71817B so small text keeps >= 4.5:1 contrast. */
  --ink: var(--charcoal);
  --ink-2: #4A585E;
  --ink-3: #5A676D;
  --heading: var(--teal);
  --placeholder: #8A969B;

  /* Status tints (bg / text) */
  --ok-bg: #E7F5DB;   --ok: #2E6A12;
  --warn-bg: #FCF2CC; --warn: #765600;
  --bad-bg: #FDE1DD;  --bad: #A2271C;  --bad-strong: #7E1F16;
  --mute-bg: #EEF0EE; --mute: #4E5B5D;
  --info-bg: #E5F0F2; --info: #0A4650;
  --focus: #0A4650;

  /* Type */
  --font-head: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-logo: "Fredoka", "Montserrat", system-ui, sans-serif;

  /* Shape */
  --r-card: 10px;
  --r-input: 8px;
  --r-pill: 999px;
  --r-ctl: 8px;             /* buttons, chips, segmented controls */

  /* Space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  --shadow-lift: 0 4px 12px rgba(16, 38, 43, 0.07);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 180ms;
}

/* ---------- Surfaces and lines (one professional theme) ---------- */
:root {
  --bg: #F5F6F7;                /* app background: cool light gray */
  --surface: #FFFFFF;           /* cards, forms, modals */
  --surface-2: #F8F9FA;         /* inset panels (vitals, table heads) */
  --cream: var(--surface-2);    /* legacy alias */
  --accent: #9FB4B7;            /* hover borders */
  --soft: #EDF2F3;              /* icon tiles, tab counts */
  --hover: #F2F5F6;
  --btn2-bg: #FFFFFF; --btn2-fg: #0A4650; --btn2-border: #CBD3D7; --btn2-hover: #F2F5F6;
  --nav-sel-bg: #E7EFF0; --nav-sel-fg: #0A4650;
  --border: #E3E7EA; --border-strong: #CDD4D8;
  --track-off: #C3CCD0;
  --ring: rgba(10, 70, 80, .16);
  --topbar-bg: rgba(255, 255, 255, .96);
  --teal-50: var(--soft);
}

@media (prefers-reduced-motion: reduce) {
  :root { --t: 0ms; }
  *, *::before, *::after { animation-duration: 0ms !important; transition-duration: 0ms !important; scroll-behavior: auto !important; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; color: #10333A; margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(26px, 3vw, 32px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; font-weight: 700; }
h4 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--teal); }
a:hover { color: var(--teal-600); }
img, svg { display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; box-shadow: 0 0 0 6px var(--ring); }
.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; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.label { font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--teal); }
.logo-mark { width: 36px; height: 36px; flex: none; }
.logo-word { font-family: var(--font-logo); font-weight: 600; font-size: 26px; letter-spacing: -0.01em; line-height: 1; }
.logo.on-dark { color: var(--on-brand); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 20px;
  border-radius: var(--r-ctl); border: 1px solid transparent;
  font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: var(--on-brand); }
.btn-primary:hover { background: var(--teal-600); color: var(--on-brand); }
.btn-primary:active { background: var(--teal-dark); }
.btn-lime { background: var(--lime); color: var(--teal); }
.btn-lime:hover { background: var(--teal); color: var(--on-brand); }
.btn-secondary { background: var(--btn2-bg); color: var(--btn2-fg); border-color: var(--btn2-border); }
.btn-secondary:hover { background: var(--btn2-hover); color: var(--btn2-fg); border-color: var(--btn2-hover); }
.btn-ghost { background: transparent; color: var(--teal); }
.btn-ghost:hover { background: var(--hover); color: var(--teal); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: var(--on-brand); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn-xs { min-height: 28px; padding: 0 11px; font-size: 12px; gap: 6px; }
.btn-icon { width: 38px; min-height: 38px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; filter: grayscale(.6); pointer-events: none; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s5); box-shadow: 0 1px 2px rgba(16, 38, 43, .04); }
.card-tight { padding: var(--s4) var(--s5); }
.card-lift { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease); }
.card-lift:hover { box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
a.card, button.card { display: block; text-decoration: none; color: inherit; text-align: left; cursor: pointer; width: 100%; font: inherit; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-ctl); font-family: var(--font-head); font-weight: 700; font-size: 11.5px; letter-spacing: .02em; white-space: nowrap; line-height: 1.5; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-mute { background: var(--mute-bg); color: var(--mute); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-lime { background: var(--lime); color: var(--teal); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .field-label { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--teal); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .req { color: var(--bad); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border-strong); border-radius: var(--r-input);
  font: inherit; font-size: 15px;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230A4650' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--accent); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--ring); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap .input-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 8px; border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.input-wrap .input-btn:hover { background: var(--hover); color: var(--teal); }
.search { position: relative; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 42px; border-radius: var(--r-ctl); }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.grid-form .span-2 { grid-column: 1 / -1; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

/* Segmented control / role pick */
.segment { display: inline-flex; padding: 4px; background: var(--teal-50); border-radius: var(--r-ctl); gap: 4px; }
.segment button, .segment label { border: 0; background: transparent; padding: 8px 16px; border-radius: var(--r-ctl); font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--teal); cursor: pointer; transition: background var(--t), color var(--t); display: inline-flex; align-items: center; gap: 6px; }
.segment button:hover, .segment label:hover { background: rgba(255,255,255,.7); }
.segment .is-active, .segment input:checked + span { background: var(--surface); color: var(--teal); box-shadow: inset 0 0 0 1.5px var(--teal); }
.segment label { padding: 0; }
.segment label span { padding: 8px 16px; border-radius: var(--r-ctl); display: inline-flex; align-items: center; gap: 6px; transition: background var(--t), color var(--t); }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment input:focus-visible + span { outline: 3px solid var(--lime); }

/* Toggle switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; cursor: pointer; }
.switch + .switch { border-top: 1px solid var(--border); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 46px; height: 26px; border-radius: var(--r-pill); background: var(--track-off); position: relative; flex: none; transition: background var(--t) var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--t) var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.switch input:checked + .track { background: var(--teal); }
.switch input:checked + .track::after { transform: translateX(20px); background: var(--lime); }
.switch input:focus-visible + .track { outline: 3px solid var(--lime); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }

/* Chips (choice) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--teal); padding: 8px 14px; border-radius: var(--r-ctl); font-family: var(--font-head); font-weight: 700; font-size: 13px; cursor: pointer; transition: all var(--t) var(--ease); display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--teal); }
.chip.is-active { background: var(--nav-sel-bg); border-color: var(--teal); color: var(--nav-sel-fg); box-shadow: inset 0 0 0 1px var(--teal); }
.chip.is-active .ico { color: var(--teal); }
.chip[disabled] { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: var(--s5); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 12px 14px; font-family: var(--font-head); font-weight: 700; font-size: 13.5px; color: var(--ink-3); cursor: pointer; position: relative; white-space: nowrap; transition: color var(--t); display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--teal); }
.tab.is-active { color: var(--teal); }
.tab.is-active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--teal); }
.tab.is-active { background: var(--hover); border-radius: 8px 12px 0 0; }
.tab .count { background: var(--teal-50); color: var(--teal); border-radius: var(--r-ctl); padding: 0 7px; font-size: 11px; }
.tab-panel { animation: fadeIn var(--t) var(--ease); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--s6)); padding: 0 var(--s6); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--font-head); font-weight: 700; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t); }
.table tbody tr.row-link { cursor: pointer; }
.table tbody tr.row-link:hover { background: var(--hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 500; color: var(--ink); }
.cell-sub { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: var(--s3); padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { font-size: 13px; color: var(--ink-3); }
button.list-item, a.list-item { background: none; border: 0; border-bottom: 1px solid var(--border); width: 100%; text-align: left; cursor: pointer; text-decoration: none; color: inherit; border-radius: 0; }
button.list-item:hover .title, a.list-item:hover .title { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }

.time-pill { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--teal); background: var(--teal-50); border-radius: 8px; padding: 6px 10px; min-width: 62px; text-align: center; flex: none; }
.date-block { width: 52px; text-align: center; border-radius: 10px; background: var(--teal-50); padding: 6px 0; flex: none; }
.date-block .d { font-family: var(--font-head); font-weight: 800; font-size: 18px; color: var(--teal); line-height: 1.1; }
.date-block .m { font-family: var(--font-head); font-weight: 700; font-size: 11px; text-transform: uppercase; color: var(--ink-2); }

/* Avatars (species) */
.avatar { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--teal-50); color: var(--teal); font-family: var(--font-head); font-weight: 800; font-size: 15px; }
.avatar.lg { width: 64px; height: 64px; border-radius: 10px; font-size: 22px; }
.avatar.sp-dog { background: var(--lime-50); color: #2E5A12; }
.avatar.sp-cat { background: var(--soft); color: var(--teal); }
.avatar.sp-rabbit { background: var(--surface-2); color: var(--teal); box-shadow: inset 0 0 0 1px var(--border-strong); }
.avatar.sp-bird { background: var(--info-bg); color: var(--teal); }
.avatar.sp-other { background: var(--mute-bg); color: var(--mute); }

/* Alert strip */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.alert .ico { margin-top: 2px; }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }

/* Empty state */
.empty { text-align: center; padding: var(--s10) var(--s4); color: var(--ink-2); }
.empty .ico { width: 36px; height: 36px; margin: 0 auto var(--s3); color: var(--teal); opacity: .55; stroke-width: 1.6; }
.empty h4 { margin-bottom: 4px; }
.empty .btn { margin-top: var(--s4); }

/* Timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: var(--s5); }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -28px; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--teal); display: grid; place-items: center; }
.tl-dot .ico { width: 11px; height: 11px; stroke-width: 2.6; }
.tl-item.k-vaccine .tl-dot, .tl-item.k-deworming .tl-dot { border-color: var(--lime-600); color: var(--ok); }
.tl-item.k-lab .tl-dot { border-color: var(--teal-600); color: var(--teal-600); }
.tl-item.k-procedure .tl-dot { border-color: var(--gray-green); color: var(--ink-2); }
.tl-item.k-upload .tl-dot { border-color: var(--gray-green); color: var(--mute); border-style: dashed; }
.tl-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tl-title { font-weight: 500; color: var(--ink); }
.tl-meta { font-size: 12.5px; color: var(--ink-3); }
.tl-body { margin-top: 4px; font-size: 14px; color: var(--ink-2); }

/* Key-value */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; }
.vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.vital { background: var(--cream); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.vital .v { font-family: var(--font-head); font-weight: 800; font-size: 17px; color: var(--teal); }
.vital .k { font-size: 12px; color: var(--ink-3); }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat .stat-ico { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); }
.stat .stat-value { font-family: var(--font-head); font-weight: 800; font-size: 30px; color: var(--teal); line-height: 1.1; }
.stat .stat-label { font-size: 13.5px; color: var(--ink-2); }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(7, 34, 39, .45); display: flex; align-items: center; justify-content: center; padding: var(--s4); z-index: 100; opacity: 0; transition: opacity var(--t) var(--ease); }
.overlay.is-open { opacity: 1; }
.modal { background: var(--surface); border-radius: var(--r-card); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; transform: translateY(12px) scale(.98); transition: transform var(--t) var(--ease); border: 1px solid var(--border); }
.modal.lg { width: min(820px, 100%); }
.modal.sm { width: min(420px, 100%); }
.overlay.is-open .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: var(--s6) var(--s6) var(--s4); }
.modal-head p { margin-top: 4px; }
.modal-body { padding: 0 var(--s6) var(--s4); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s4) var(--s6) var(--s6); border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: var(--s5); bottom: var(--s5); z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--teal); color: var(--on-brand); padding: 14px 16px; border-radius: 10px; font-size: 14px; animation: toastIn 240ms var(--ease); box-shadow: 0 10px 30px rgba(7, 34, 39, .18); }
.toast .ico { color: var(--lime); margin-top: 1px; }
.toast.error { background: var(--bad-strong); }
.toast.error .ico { color: #FFD3CE; }
.toast strong { font-family: var(--font-head); font-weight: 700; display: block; }
.toast.out { animation: toastOut 200ms var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Dropdown menu */
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; min-width: 200px; z-index: 60; box-shadow: var(--shadow-lift); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--ease); }
.menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: 8px; text-align: left; cursor: pointer; font-size: 14px; color: var(--ink); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--hover); color: var(--teal); }
.menu .danger { color: var(--bad); }
.menu .danger:hover { background: var(--bad-bg); color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 6px; }

/* Utility layout */
.row { display: flex; align-items: center; gap: var(--s3); }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--s6); }
.grow { flex: 1; min-width: 0; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--teal); color: var(--on-brand); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: var(--s5) var(--s4); gap: var(--s4); overflow-y: auto; z-index: 40; }
.sidebar .logo { padding: 4px 8px 8px; }
.side-clinic { background: rgba(255,255,255,.07); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.side-clinic strong { display: block; font-family: var(--font-head); font-weight: 700; font-size: 14px; color: #fff; }
.side-clinic span { color: rgba(255,255,255,.72); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.5); padding: 10px 12px 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: rgba(255,255,255,.82); text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 14px; position: relative; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.is-active { background: var(--nav-sel-bg); color: var(--nav-sel-fg); }
.nav a.is-active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav a.is-active .ico { color: var(--teal); }
.nav .nav-count { margin-left: auto; background: var(--lime); color: var(--teal); border-radius: var(--r-ctl); font-size: 11px; padding: 1px 8px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.07); border: 0; width: 100%; color: #fff; text-align: left; cursor: pointer; transition: background var(--t); }
.side-user:hover { background: rgba(255,255,255,.12); }
.side-user .avatar { background: var(--lime); color: var(--teal); width: 36px; height: 36px; border-radius: 8px; font-size: 13px; }
.side-user .nm { font-family: var(--font-head); font-weight: 700; font-size: 13.5px; }
.side-user .rl { font-size: 12px; color: rgba(255,255,255,.7); }

/* Owner sidebar variant (lighter) */
.app.owner .sidebar { background: var(--surface); color: var(--ink); border-right: 1px solid var(--border); }
.app.owner .nav a { color: var(--ink-2); }
.app.owner .nav a:hover { background: var(--hover); color: var(--teal); }
.app.owner .nav a.is-active { background: var(--nav-sel-bg); color: var(--nav-sel-fg); }
.app.owner .nav a.is-active::before { left: 0; top: 10px; bottom: 10px; border-radius: 4px; background: var(--teal); }
.app.owner .nav-label { color: var(--ink-3); }
.app.owner .side-user { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
.app.owner .side-user:hover { background: var(--hover); }
.app.owner .side-user .rl { color: var(--ink-3); }
.app.owner .side-clinic { background: var(--soft); color: var(--ink); }
.app.owner .side-clinic strong { color: var(--teal); }
.app.owner .side-clinic span { color: var(--ink-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.scrim { display: none; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s3); padding: 14px var(--s8); background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar .menu-btn { display: none; }
.topbar .top-search { flex: 1; max-width: 440px; position: relative; }
.topbar .spacer { flex: 1; }
.demo-switch { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: var(--r-ctl); background: var(--soft); border: 1px solid var(--accent); }
.demo-switch .label { color: var(--teal); }
.bell { position: relative; }
.bell .pip { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-family: var(--font-head); font-weight: 700; display: grid; place-items: center; border: 2px solid var(--cream); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: var(--shadow-lift); z-index: 50; max-height: 360px; overflow-y: auto; }
.search-results button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.search-results button:hover, .search-results button.is-hl { background: var(--hover); }
.search-results .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }

.page { padding: var(--s6) var(--s8); max-width: 1320px; width: 100%; margin: 0 auto; animation: fadeIn 220ms var(--ease); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); flex-wrap: wrap; }
.page-head .sub { color: var(--ink-2); margin-top: 6px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--teal); text-decoration: underline; }
.toolbar { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); }
.toolbar .search { flex: 1; min-width: 220px; max-width: 420px; }
.toolbar .select { width: auto; min-width: 150px; border-radius: var(--r-ctl); min-height: 42px; }

.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
.cols-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.quick { display: flex; gap: var(--s3); flex-wrap: wrap; }

.prototype-note { margin: auto var(--s8) var(--s6); padding: 10px 14px; border-radius: 8px; font-size: 12.5px; color: var(--ink-3); border: 1px dashed var(--border-strong); display: flex; gap: 8px; align-items: center; }

/* Patient header */
.pet-head { display: flex; gap: var(--s5); align-items: flex-start; flex-wrap: wrap; }
.pet-head .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.pet-head .meta span { display: inline-flex; align-items: center; gap: 6px; }
.pet-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* Steps (wizard) */
.steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: var(--s5); scrollbar-width: thin; }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--border); font-family: var(--font-head); font-weight: 700; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; cursor: pointer; transition: all var(--t); }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--mute-bg); color: var(--ink-2); font-size: 12px; }
.step.is-done { color: var(--teal); }
.step.is-done .n { background: var(--lime); color: var(--teal); }
.step.is-active { background: var(--teal); color: var(--on-brand); border-color: var(--teal); }
.step.is-active .n { background: var(--lime); color: var(--teal); }
.step[disabled] { cursor: not-allowed; opacity: .7; }

/* Rx rows */
.rx-row { border: 1px solid var(--border); border-radius: 10px; padding: var(--s4); background: var(--cream); position: relative; }
.rx-row + .rx-row { margin-top: var(--s3); }
.rx-row .rx-num { font-family: var(--font-head); font-weight: 800; color: var(--teal); font-size: 13px; }
.rx-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s3); margin-top: 10px; }
.rx-grid .span-all { grid-column: 1 / -1; }
.rx-print { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.rx-print .rx-line { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.rx-print .rx-line:last-child { border-bottom: 0; }

/* Slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slots .chip { justify-content: center; }
.day-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day-chip { flex: none; width: 70px; padding: 10px 0; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); text-align: center; cursor: pointer; transition: all var(--t); }
.day-chip:hover { border-color: var(--teal); }
.day-chip .dw { font-size: 12px; color: var(--ink-3); font-family: var(--font-head); font-weight: 700; text-transform: uppercase; }
.day-chip .dd { font-family: var(--font-head); font-weight: 800; font-size: 20px; color: var(--teal); }
.day-chip.is-active { background: var(--nav-sel-bg); border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.day-chip.is-active .dw, .day-chip.is-active .dd { color: var(--teal); }
.day-chip[disabled] { opacity: .4; cursor: not-allowed; }

/* Owner: pet switcher */
.pet-switch { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.pet-switch::-webkit-scrollbar { display: none; }
.pet-tab { display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: var(--r-ctl); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; flex: none; transition: all var(--t) var(--ease); font-family: var(--font-head); font-weight: 700; color: var(--teal); font-size: 14px; }
.pet-tab .avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 13px; }
.pet-tab:hover { border-color: var(--teal); }
.pet-tab.is-active { background: var(--nav-sel-bg); color: var(--nav-sel-fg); border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.pet-tab.is-active .avatar { background: var(--lime); color: var(--teal); }
.pet-tab .chk { display: none; color: var(--teal); }
.pet-tab.is-active .chk { display: inline-block; }
.pet-tab.add { border-style: dashed; color: var(--ink-2); padding: 6px 16px; }

.hello { background: var(--teal); color: var(--on-brand); border-radius: var(--r-card); padding: var(--s6); display: flex; gap: var(--s5); align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; }
.hello h1 { color: var(--on-brand); }
.hello p { color: rgba(255,255,255,.82); margin-top: 6px; }
.hello .deco { position: absolute; right: -30px; bottom: -40px; width: 180px; height: 180px; color: rgba(158,215,99,.18); pointer-events: none; }
.hello .deco .ico { width: 100%; height: 100%; stroke-width: 1.4; }

.source-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-family: var(--font-head); font-weight: 700; padding: 3px 9px; border-radius: var(--r-ctl); }
.source-tag.clinic { background: var(--ok-bg); color: var(--ok); }
.source-tag.owner { background: var(--mute-bg); color: var(--mute); border: 1px dashed var(--gray-green); }

.notif { display: flex; gap: 12px; padding: 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); transition: background var(--t); }
.notif + .notif { margin-top: 8px; }
.notif.unread { background: var(--soft); border-color: var(--accent); }
.notif .n-ico { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal); flex: none; }
.notif .n-title { font-weight: 500; color: var(--ink); }
.notif .n-actions { display: flex; gap: 4px; align-items: flex-start; flex: none; }

.bottom-nav { display: none; }

.dropzone { border: 2px dashed var(--border-strong); border-radius: 10px; padding: var(--s6); text-align: center; background: var(--cream); cursor: pointer; transition: border-color var(--t), background var(--t); }
.dropzone:hover, .dropzone.is-over { border-color: var(--teal); background: var(--hover); }
.dropzone .ico { margin: 0 auto 8px; width: 28px; height: 28px; color: var(--teal); }

.progress { height: 8px; border-radius: 8px; background: var(--teal-50); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--teal); border-radius: 8px; }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: var(--s8); color: var(--ink-2); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--teal-50); border-top-color: var(--teal); animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.future { position: relative; }
.future-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-ctl); background: var(--mute-bg); color: var(--mute); font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: .03em; text-transform: uppercase; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-list .bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform 240ms var(--ease); }
  .app.nav-open .sidebar { box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .app.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(7,34,39,.4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity var(--t); }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 12px var(--s4); }
  .topbar .menu-btn { display: inline-flex; }
  .page { padding: var(--s5) var(--s4); }
  .prototype-note { margin: auto var(--s4) var(--s4); }
  .cols-2 { grid-template-columns: 1fr; }
  .table-wrap { margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4); }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .grid-form, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .rx-grid { grid-template-columns: 1fr 1fr; }
  .rx-grid > :first-child { grid-column: 1 / -1; }
  .card { padding: var(--s5) var(--s4); }
  .table-wrap { margin: 0 calc(-1 * var(--s4)); }
  .stats { gap: 10px; }
  .stat .stat-value { font-size: 24px; }
  .demo-switch .label { display: none; }
  .topbar .top-search { display: none; }
  .topbar .hide-sm { display: none; }
  .pet-head .actions { margin-left: 0; width: 100%; }
  .modal { max-height: calc(100vh - 16px); }
  .overlay { padding: 8px; align-items: flex-end; }
  .modal-head { padding: var(--s5) var(--s4) var(--s3); }
  .modal-body { padding: 0 var(--s4) var(--s4); }
  .modal-foot { padding: var(--s3) var(--s4) var(--s4); }
  .toasts { left: 16px; right: 16px; bottom: 84px; max-width: none; }
  /* responsive tables → cards */
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .table.stack-sm td { padding: 0; border: 0; }
  .table.stack-sm td.hide-sm { display: none; }
  .table.stack-sm td.full { grid-column: 1 / -1; }
  /* owner bottom nav */
  .app.owner .sidebar { display: none; }
  .app.owner .menu-btn { display: none; }
  .app.owner .main { padding-bottom: 76px; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; text-decoration: none; color: var(--ink-3); font-family: var(--font-head); font-weight: 700; font-size: 11px; border: 0; background: none; border-radius: 8px; cursor: pointer; position: relative; }
  .bottom-nav .is-active { color: var(--teal); }
  .bottom-nav .is-active .ico { color: var(--teal); }
  .bottom-nav .is-active::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--lime); }
  .bottom-nav .pip { position: absolute; top: 2px; right: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
}

/* ==========================================================================
   Landing page
   ========================================================================== */
.site-head { position: sticky; top: 0; z-index: 50; background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--s6); }
.site-head .wrap { display: flex; align-items: center; gap: var(--s6); min-height: 72px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { padding: 8px 12px; border-radius: var(--r-ctl); font-family: var(--font-head); font-weight: 700; font-size: 14px; text-decoration: none; color: var(--ink-2); transition: background var(--t), color var(--t); }
.site-nav a:hover { background: var(--teal-50); color: var(--teal); }
.site-cta { display: flex; gap: 8px; }
.site-menu-btn { display: none; margin-left: auto; }
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: var(--r-ctl); background: var(--soft); border: 1px solid var(--accent); font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--teal); }
.eyebrow .badge { padding: 2px 8px; }
.hero h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1.06; margin: 20px 0 18px; letter-spacing: -0.025em; }
.hero h1 em { font-style: normal; }
.hero .lead { font-size: 18px; color: var(--ink-2); max-width: 540px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero .ctas .btn { min-height: 50px; padding: 0 26px; font-size: 15px; }
.hero .assure { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; font-size: 13.5px; color: var(--ink-2); }
.hero .assure span { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--border-strong); }

.preview { position: relative; }
.preview .pv-clinic { background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: 20px; box-shadow: 0 30px 60px -30px rgba(10,70,80,.25); }
.pv-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.pv-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.pv-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.pv-row:last-child { border-bottom: 0; }
.pv-owner { position: absolute; right: -14px; bottom: -36px; width: 220px; background: var(--teal); color: var(--on-brand); border-radius: 30px; padding: 16px; border: 6px solid var(--bg); }
.pv-owner .label { color: var(--lime); }
.pv-owner .pv-note { background: rgba(255,255,255,.1); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.pv-sync { position: absolute; left: -18px; top: -18px; background: var(--lime); color: var(--teal); border-radius: var(--r-ctl); padding: 8px 14px; font-family: var(--font-head); font-weight: 800; font-size: 12.5px; display: flex; gap: 6px; align-items: center; }

.section { padding: 80px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.02em; margin: 10px 0 12px; }
.section-head p { color: var(--ink-2); font-size: 17px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.feature .f-ico { width: 46px; height: 46px; border-radius: 8px; background: var(--teal-50); color: var(--teal); display: grid; place-items: center; margin-bottom: 16px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 14.5px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split .card { padding: 32px; }
.split .card.dark { background: var(--teal); color: #fff; border-color: var(--teal); }
.split .card.dark h3, .split .card.dark .label { color: #fff; }
.split .card.dark .label { color: var(--lime); }
.ticks { list-style: none; padding: 0; margin: 18px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; }
.ticks .ico { color: var(--lime-600); margin-top: 2px; }
.dark .ticks .ico { color: var(--lime); }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; counter-reset: flow; }
.flow .card { position: relative; }
.flow .n { width: 34px; height: 34px; border-radius: 50%; background: var(--lime); color: var(--teal); font-family: var(--font-head); font-weight: 800; display: grid; place-items: center; margin-bottom: 14px; }
.flow h4 { margin-bottom: 6px; }
.flow p { font-size: 14px; color: var(--ink-2); }
.benefits { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.benefit { display: flex; gap: 16px; }
.benefit .f-ico { flex: none; width: 46px; height: 46px; border-radius: 8px; background: var(--soft); color: var(--teal); display: grid; place-items: center; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-top: 28px; }
.plans .card h3 { margin: 8px 0 6px; }
.faq { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 22px; transition: border-color var(--t); }
.faq details[open] { border-color: var(--border-strong); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 0; font-family: var(--font-head); font-weight: 700; color: var(--teal); display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { transition: transform var(--t) var(--ease); flex: none; }
.faq details[open] summary .ico { transform: rotate(180deg); }
.faq details p { padding: 0 0 18px; color: var(--ink-2); }
.cta-band { background: var(--teal); color: #fff; border-radius: 32px; padding: 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; font-size: clamp(24px, 3vw, 34px); }
.cta-band p { color: rgba(255,255,255,.8); margin-top: 8px; }
.site-foot { padding: 56px 0 32px; border-top: 1px solid var(--border); }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.foot-grid h4 { margin-bottom: 12px; font-size: 14px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-grid a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.foot-grid a:hover { color: var(--teal); text-decoration: underline; }
.foot-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }

@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 64px; }
  .feature-grid, .plans { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr 1fr; }
  .split, .benefits { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .site-nav { display: none; }
  .site-nav.is-open { display: flex; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px; }
  .site-menu-btn { display: inline-flex; }
  .site-cta .btn-ghost { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 var(--s4); }
  .hero { padding: 40px 0 56px; }
  .feature-grid, .plans, .flow, .foot-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .cta-band { padding: 32px 24px; }
  .pv-owner { position: relative; right: auto; bottom: auto; width: auto; margin: -20px 12px 0; }
  .pv-sync { left: 8px; bottom: auto; top: -16px; }
  .site-cta .btn-secondary { display: none; }
}

/* ==========================================================================
   Auth
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--teal); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; gap: 24px; position: relative; overflow: hidden; }
.auth-side h2 { color: #fff; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; margin-top: auto; }
.auth-side p { color: rgba(255,255,255,.8); }
.auth-side .ticks .ico { color: var(--lime); }
.auth-side .deco { position: absolute; right: -60px; top: 80px; width: 280px; height: 280px; color: rgba(158,215,99,.12); }
.auth-side .deco .ico { width: 100%; height: 100%; stroke-width: 1.2; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: min(460px, 100%); }
.auth-card h1 { font-size: 28px; }
.demo-box { background: var(--soft); border: 1px solid var(--accent); border-radius: 10px; padding: 18px; }
.demo-box .row .btn { flex: 1; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-card { position: relative; }
.role-card input { position: absolute; opacity: 0; }
.role-card span { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; transition: all var(--t); background: var(--surface); height: 100%; }
.role-card span strong { font-family: var(--font-head); color: var(--teal); font-size: 14px; }
.role-card span small { color: var(--ink-3); font-size: 12.5px; }
.role-card input:checked + span { border-color: var(--teal); background: var(--nav-sel-bg); box-shadow: inset 0 0 0 1px var(--teal); }
.role-card input:focus-visible + span { outline: 3px solid var(--lime); }
.strength { display: flex; gap: 4px; margin-top: 2px; }
.strength i { flex: 1; height: 4px; border-radius: 4px; background: var(--border-strong); transition: background var(--t); }
.strength.s1 i:nth-child(1) { background: var(--bad); }
.strength.s2 i:nth-child(-n+2) { background: var(--warn); }
.strength.s3 i { background: var(--lime-600); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* Keep wide children (tabs, chip rows, tables) from stretching grid columns */
.cols-main > *, .cols-2 > *, .stack > *, .grid-3 > *, .grid-form > * { min-width: 0; }

@media (max-width: 720px) {
  .appt-row { flex-wrap: wrap; row-gap: 8px; }
  .appt-row > .avatar { display: none; }
  .appt-row > .grow { flex-basis: calc(100% - 100px); }
  .appt-row > .badge { margin-left: auto; }
  .list-item .title { white-space: normal; }
}

/* Temperament + custom history */
.temper-current { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid transparent; }
.temper-current .temper-ico { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.7); flex: none; }
.temper-current .temper-value { font-family: var(--font-head); font-weight: 800; font-size: 17px; }
.temper-ok { background: var(--ok-bg); color: var(--ok); }
.temper-warn { background: var(--warn-bg); color: var(--warn); border-color: currentColor; border-style: dashed; }
.temper-bad { background: var(--bad-bg); color: var(--bad); border-color: currentColor; }
.temper-mute { background: var(--mute-bg); color: var(--mute); }
.tl-item.k-history .tl-dot { border-color: var(--teal); color: var(--teal); background: var(--teal-50); }
.hist-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }

/* ==========================================================================
   Review mode (review.js) — comment / edit-text on any section
   ========================================================================== */
:root { --rv-h: 48px; }
.rv-bar { position: sticky; top: 0; z-index: 150; height: var(--rv-h); display: flex; align-items: center; gap: 8px; padding: 0 max(16px, env(safe-area-inset-left, 0px)); background: var(--ink); color: #fff; font-family: var(--font-body); font-size: 13.5px; }
.rv-bar[hidden], .rv-fab[hidden], .rv-panel[hidden] { display: none !important; }
.rv-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.rv-title b { font-family: var(--font-head); color: var(--lime); letter-spacing: .02em; }
.rv-hint { color: rgba(255,255,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-spacer { flex: 1; }
.rv-ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rv-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,.28); background: transparent; color: inherit; font-family: var(--font-head); font-weight: 700; font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: background var(--t), color var(--t), border-color var(--t); }
.rv-btn:hover { border-color: var(--lime); color: var(--lime); }
.rv-btn:disabled { opacity: .45; cursor: not-allowed; }
.rv-btn.rv-primary { background: var(--lime); color: var(--teal); border-color: var(--lime); }
.rv-btn.rv-primary:hover { background: #fff; border-color: #fff; color: var(--teal); }
.rv-btn.rv-primary[aria-pressed="true"] { background: #fff; border-color: #fff; box-shadow: 0 0 0 3px rgba(158,215,99,.55); }
.rv-btn.rv-icon { width: 34px; padding: 0; justify-content: center; }
.rv-btn.rv-sm { min-height: 30px; padding: 0 11px; font-size: 12px; }
.rv-count { background: var(--lime); color: var(--teal); border-radius: 6px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.rv-count[hidden] { display: none; }
.rv-fab { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 150; display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 6px; border: 0; background: var(--ink); color: var(--lime); font-family: var(--font-head); font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: 0 8px 24px rgba(7,34,39,.25); }
.rv-fab:hover { background: var(--teal); }

/* keep sticky app chrome below the bar */
html.rv-on .topbar, html.rv-on .site-head { top: var(--rv-h); }
html.rv-on .sidebar { top: var(--rv-h); height: calc(100vh - var(--rv-h)); }
html.rv-on .auth { min-height: calc(100vh - var(--rv-h)); }

/* picking */
html.rv-picking body *:not([data-review-ui]):not([data-review-ui] *) { cursor: crosshair !important; }
.rv-box { position: fixed; z-index: 140; pointer-events: none; display: none; border-radius: 10px; }
.rv-hover { outline: 2px dashed var(--lime-600); background: rgba(158,215,99,.12); }
.rv-chosen { outline: 3px solid var(--lime); box-shadow: 0 0 0 9999px rgba(7,34,39,.18); }
.rv-box::after { content: attr(data-label); position: absolute; left: 0; top: -24px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--ink); color: #fff; font: 700 11.5px/22px var(--font-head); padding: 0 8px; border-radius: 6px; }

/* panel */
.rv-panel { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 160; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - var(--rv-h) - 40px); overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 10px; padding: 16px; box-shadow: 0 18px 50px rgba(7,34,39,.25); font-size: 14px; animation: fadeIn var(--t) var(--ease); }
.rv-panel .rv-btn { color: var(--teal); border-color: var(--border-strong); }
.rv-panel .rv-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--hover); }
.rv-panel .rv-btn.rv-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.rv-panel .rv-btn.rv-primary:hover { background: var(--lime); color: var(--teal); border-color: var(--lime); }
.rv-p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.rv-p-head b { font-family: var(--font-head); color: var(--teal); font-size: 15px; }
.rv-kicker { font-size: 12px; color: var(--ink-3); }
.rv-row, .rv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rv-actions { margin-top: 12px; }
.rv-quote { margin-top: 10px; padding: 8px 12px; border-left: 3px solid var(--lime); background: var(--cream); border-radius: 0 10px 10px 0; font-size: 13px; color: var(--ink-2); }
.rv-tabs { display: flex; gap: 4px; padding: 4px; background: var(--teal-50); border-radius: 6px; margin: 12px 0 10px; }
.rv-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; font: 700 12.5px var(--font-head); color: var(--teal); cursor: pointer; }
.rv-tabs button.on { background: var(--teal); color: #fff; }
.rv-tabs button:disabled { opacity: .45; cursor: not-allowed; }
.rv-lbl { display: block; font: 700 12.5px var(--font-head); color: var(--teal); margin: 8px 0 4px; }
.rv-panel textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; font: 14px/1.5 var(--font-body); color: var(--ink); background: var(--surface); resize: vertical; }
.rv-panel textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--ring); }
.rv-err { color: var(--bad); font-size: 12.5px; min-height: 0; margin-top: 6px; }
.rv-err:empty { display: none; }
.rv-foot { font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.rv-notes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rv-notes li { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.rv-nbody { white-space: pre-wrap; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.rv-copybox { margin-top: 10px; font-size: 12px !important; }
.rv-steps { padding-left: 20px; margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; }
.rv-toast { position: fixed; left: 50%; top: calc(var(--rv-h) + 12px); transform: translate(-50%, -8px); z-index: 170; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13.5px; max-width: min(460px, calc(100vw - 32px)); opacity: 0; pointer-events: none; transition: opacity var(--t), transform var(--t); }
.rv-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) {
  .rv-hint, #rvNotes > span:first-of-type, #rvPick > span { display: none; }
  #rvPick[aria-pressed="true"] > span { display: inline; }
  .rv-panel { left: 8px; right: 8px; width: auto; bottom: 8px; }
  html.rv-on .app.owner .rv-fab { bottom: 88px; }
}

/* Demo video */
.demo-video { margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; max-width: 960px; }
.demo-video.has-chapters { grid-template-columns: minmax(0, 1fr) 260px; max-width: none; }
.dv-frame { position: relative; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--border); background: var(--teal); aspect-ratio: 16 / 9; max-width: 100%; }
.dv-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.dv-missing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; text-align: center; padding: 16px; }
.dv-missing[hidden] { display: none; }
.dv-missing .ico { width: 40px; height: 40px; color: var(--lime); }
.dv-missing code { background: rgba(255,255,255,.12); padding: 2px 6px; border-radius: 6px; }
.demo-video figcaption { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; }
.dv-chapters { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 2px; }
.dv-chapters button { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: 500 14px var(--font-body); color: var(--ink); transition: background var(--t); }
.dv-chapters button:hover { background: var(--hover); }
.dv-chapters button .mono { font-family: var(--font-head); font-weight: 700; font-size: 12px; color: var(--teal); background: var(--teal-50); border-radius: 8px; padding: 2px 7px; min-width: 44px; text-align: center; }
.dv-chapters button.is-now { background: var(--soft); }
.dv-chapters button.is-now .mono { background: var(--lime); }
.modal .demo-video { grid-template-columns: 1fr; }
.modal .dv-chapters { flex-direction: row; flex-wrap: wrap; }
.modal .dv-chapters button { width: auto; border: 1px solid var(--border); }
.watch-link { margin-top: 14px; padding-left: 8px; }
@media (max-width: 900px) { .demo-video { grid-template-columns: 1fr; } .dv-chapters { flex-direction: row; flex-wrap: wrap; } .dv-chapters button { width: auto; border: 1px solid var(--border); } }

/* Benefit points: short lead-in + plain sentence, separated by hairlines (no tick icons) */
.points { margin: 18px 0 24px; }
.points p { padding: 12px 0; border-top: 1px solid var(--border); color: var(--ink-2); font-size: 15px; }
.points p:last-child { border-bottom: 1px solid var(--border); }
.points b { color: var(--teal); font-weight: 700; }
.dark .points p, .auth-side .points p { border-color: rgba(255,255,255,.16); color: rgba(255,255,255,.8); }
.dark .points b, .auth-side .points b { color: #fff; }

/* Medical / error status: outlined, with icon + label */
.badge-bad { box-shadow: inset 0 0 0 1px rgba(162, 39, 28, .35); }
.alert-bad { box-shadow: inset 0 0 0 1px rgba(162, 39, 28, .3); }

/* Landing: clinics / owners audience cards */
.split { align-items: stretch; }
.split .card { padding: 36px; display: flex; flex-direction: column; }
.split .card.soft { background: var(--soft); border-color: var(--border-strong); }
.aud-title { font-size: clamp(22px, 2.4vw, 28px); margin-top: 8px; }
.aud-lead { margin-top: 8px; color: var(--ink-2); max-width: 46ch; }
.split .card.dark .aud-lead { color: rgba(255,255,255,.78); }
.aud-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0 28px; }
.aud-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.aud-tile h4 { font-size: 14.5px; color: var(--teal); }
.aud-tile p { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.aud-ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--soft); color: var(--teal); margin-bottom: 4px; }
.split .card.dark .aud-tile { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.split .card.dark .aud-tile h4 { color: var(--on-brand); }
.split .card.dark .aud-tile p { color: rgba(255,255,255,.75); }
.split .card.dark .aud-ico { background: var(--lime); color: var(--teal); }
.aud-cta { margin-top: auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.aud-link { font-family: var(--font-head); font-weight: 700; font-size: 13.5px; color: var(--teal); text-underline-offset: 3px; }
.split .card.dark .aud-link { color: var(--on-brand); }
@media (max-width: 600px) { .split .card { padding: 24px 20px; } .aud-grid { grid-template-columns: 1fr; gap: 8px; } .aud-tile { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; row-gap: 2px; padding: 12px 14px; } .aud-ico { grid-row: span 2; margin: 0; } }

/* Landing header (small screens) */
@media (max-width: 960px) { .site-head .site-cta { margin-left: auto; } .site-head .site-menu-btn { margin-left: 0; } }
@media (max-width: 600px) { .site-head .wrap { gap: 10px; } .site-cta .btn { padding: 0 14px; } .site-head .logo-word { font-size: 22px; } }

/* Connectivity: sharing rows, pet code, SMS preview, audit trail, Rx reminders */
.share-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.share-row:first-of-type { border-top: 0; }
.share-row.is-req { background: var(--soft); border-radius: 8px; padding: 14px; border: 1px solid var(--accent); }
.share-row .title { font-size: 14.5px; color: var(--ink); }
.pet-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 8px; border: 1px dashed var(--teal); background: var(--surface-2); }
.pet-code .mono { font-family: var(--font-head); font-weight: 800; font-size: 20px; letter-spacing: .08em; color: var(--teal); }
.sms-list { display: flex; flex-direction: column; gap: 8px; }
.sms { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px 14px 14px 4px; padding: 10px 12px; font-size: 13.5px; }
.audit { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.audit li { border-left: 3px solid var(--accent); padding: 4px 0 4px 10px; font-size: 13.5px; }
.rx-rem { border-top: 1px dashed var(--border-strong); margin-top: 12px; }

/* Top bar: demo view switch (Clinic | Pet owner) */
.view-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--border-strong); }
.vs-label { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 0 8px 0 10px; }
.vs-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--teal); font-family: var(--font-head); font-weight: 700; font-size: 13px; cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.vs-opt:hover { background: var(--hover); }
.vs-opt.is-on { background: var(--teal); color: var(--on-brand); cursor: default; }
.vs-opt.is-on .ico { color: var(--lime); }
@media (max-width: 720px) { .vs-label { display: none; } .vs-opt { padding: 0 10px; font-size: 12px; } }
@media (max-width: 380px) { .vs-opt span { display: none; } }

/* Clinic top bar: longer patient search */
.topbar .top-search { flex: 1 1 520px; min-width: 300px; max-width: 640px; }
.topbar .top-search + .spacer { flex: 0 1 24px; }
.topbar .top-search .input { min-height: 44px; }
@media (max-width: 1200px) { .topbar [data-act="demoVideo"] span { display: none; } .topbar [data-act="demoVideo"] { padding: 0 10px; } }
.view-switch, .vs-label, .vs-opt { white-space: nowrap; flex: none; }
@media (max-width: 1360px) { .vs-label { display: none; } }

/* ==========================================================================
   Landing nav: plain text links in one row with the logo and the sign-in buttons (desktop)
   ========================================================================== */
@media (min-width: 961px) {
  .site-nav { margin: 0 auto; gap: 2px; }
  .site-nav a { padding: 8px 10px; white-space: nowrap; }
  .site-nav a:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
}
@media (min-width: 961px) and (max-width: 1180px) { .site-nav a { font-size: 13px; padding: 8px 7px; } }
.site-nav.is-open a { padding: 12px 16px; }

/* Next-due shortcuts */
.due-chip { padding: 5px 12px; font-size: 12px; }

/* Prescription photo attachments */
.rx-files { border: 1px dashed var(--border-strong); border-radius: var(--r-md, 14px); padding: 14px; background: var(--hover); }
.rx-files-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rx-attach { cursor: pointer; position: relative; }
.rx-attach:focus-within { outline: 3px solid var(--lime); outline-offset: 2px; }
.rx-file-list { display: grid; gap: 8px; }
.rx-file-list:not(:empty) { margin-top: 12px; }
.rx-file { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.rx-file-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-thumb { width: 56px; height: 56px; flex: none; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); padding: 0; background: var(--soft); display: grid; place-items: center; cursor: zoom-in; color: var(--teal); }
.rx-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rx-thumb-doc { cursor: default; }
.rx-lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(6, 30, 34, .82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; cursor: zoom-out; }
.rx-lightbox img { max-width: min(92vw, 900px); max-height: 80vh; border-radius: 8px; background: #fff; }

/* Owner "Add a pet": estimated age or custom date */
.age-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-ctl); border: 1px solid var(--border-strong); background: var(--surface); }
.age-opt { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 14px; border-radius: var(--r-ctl); font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.age-opt:hover { color: var(--teal); background: var(--hover); }
.age-opt.is-on { background: var(--teal); color: var(--on-brand); }
.age-opt.is-on .ico { color: var(--on-brand); }
.age-field .field-label { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--teal); }
.age-est { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.age-est > .field, [data-age-pane="dob"] > .field { min-width: 0; }
[data-age-pane="dob"] { margin-top: 8px; }
html { scroll-padding-top: 140px; } @media (max-width: 960px) { html { scroll-padding-top: 84px; } }

/* ==========================================================================
   Phone app (installable PWA) and phone layout polish
   ========================================================================== */
html { -webkit-tap-highlight-color: transparent; }
.nav-install { display: flex; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 10px 12px; border-radius: 8px; border: 1px dashed rgba(255,255,255,.28); background: transparent; color: inherit; font: 700 13px var(--font-head); cursor: pointer; text-align: left; }
.app.owner .nav-install { border-color: var(--border-strong); color: var(--teal); }
.nav-install:hover { background: rgba(255,255,255,.08); }
.nav-install[hidden] { display: none; }
[data-install][hidden] { display: none !important; }

@media (max-width: 720px) {
  /* inputs at 16px so iPhone doesn't zoom in when a field is tapped */
  .input, .select, .textarea { font-size: 16px; }
  /* clinic gets the same bottom tab bar as the owner app */
  .app.clinic .main { padding-bottom: 80px; }
  .app.clinic .menu-btn { display: none; }
  .bottom-nav .bn-main { color: var(--teal); }
  .bottom-nav .bn-plus { width: 44px; height: 44px; margin-top: -20px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--on-brand); box-shadow: 0 6px 16px rgba(10,70,80,.3); border: 3px solid var(--surface); }
  .bottom-nav .bn-plus .ico { color: var(--on-brand); }
  .bottom-nav .pip { pointer-events: none; }
  html.rv-on .app.clinic .rv-fab, html .app ~ .rv-fab { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  /* bottom sheets: modals slide up from the bottom edge, with a grab handle */
  .overlay { padding: 0; }
  .modal, .modal.sm, .modal.lg { width: 100%; border-radius: 10px 22px 0 0; max-height: calc(100dvh - 24px); border-bottom: 0; }
  .modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
  .modal-foot { padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 auto; }
  /* list rows: let the trailing badge/button drop under the text instead of squeezing it */
  .list-item { flex-wrap: wrap; }
  .list-item > .grow { min-width: 0; flex: 1 1 160px; }
  /* bigger tap targets */
  .btn-sm { min-height: 40px; }
  .chip { min-height: 38px; }
  .toasts { bottom: calc(92px + env(safe-area-inset-bottom)); }
  /* wizard step bar scrolls sideways without a visible scrollbar */
  .steps { scrollbar-width: none; scroll-snap-type: x proximity; }
  .steps::-webkit-scrollbar { display: none; }
  .steps .step { scroll-snap-align: start; }
}

/* Installed app (opened from the home-screen icon) */
html.is-standalone body { overscroll-behavior-y: none; }
html.is-standalone .topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
html.is-standalone .sidebar { padding-top: env(safe-area-inset-top); }
html.is-standalone .prototype-note { display: none; }
html.is-standalone .auth-back, html.is-standalone a[href="index.html"].back-link { display: none; }
@media (max-width: 720px) { html.is-standalone .topbar { position: sticky; top: 0; z-index: 30; } }

/* Install banner, sheet and note (from pwa.js) */
.pwa-banner { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 12px 32px rgba(7,34,39,.18); animation: pwaUp .25s var(--ease); }
.pwa-banner img { border-radius: 10px; flex: none; }
.pwa-bt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pwa-bt b { font-family: var(--font-head); color: var(--teal); font-size: 14px; }
.pwa-bt span { font-size: 12.5px; color: var(--ink-3); }
.pwa-bi { border: 0; border-radius: 6px; background: var(--teal); color: var(--on-brand); font: 700 13px var(--font-head); padding: 10px 16px; min-height: 40px; cursor: pointer; }
.pwa-bx { border: 0; background: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); cursor: pointer; }
.pwa-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pwa-sheet-wrap { position: fixed; inset: 0; z-index: 300; background: rgba(7,34,39,.45); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 721px) { .pwa-sheet-wrap { align-items: center; } .pwa-sheet { border-radius: 10px !important; } }
.pwa-sheet { width: min(480px, 100%); background: var(--surface); color: var(--ink); border-radius: 10px 22px 0 0; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); animation: pwaUp .25s var(--ease); font-family: var(--font-body, Roboto, sans-serif); }
.pwa-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto 10px; }
.pwa-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pwa-head h2 { font-size: 19px; color: var(--teal); margin: 0; }
.pwa-x { border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); cursor: pointer; }
.pwa-p { color: var(--ink-2); margin: 8px 0 0; font-size: 14.5px; }
.pwa-small { font-size: 13px; color: var(--ink-3); }
.pwa-steps { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.pwa-steps li { display: flex; gap: 12px; align-items: flex-start; }
.pwa-n { width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--teal); font: 800 13px var(--font-head); display: grid; place-items: center; flex: none; }
.pwa-step { display: flex; gap: 8px; align-items: flex-start; padding-top: 3px; font-size: 14.5px; color: var(--ink-2); }
.pwa-step .pwa-ico { color: var(--teal); margin-top: -1px; }
.pwa-done { margin-top: 18px; width: 100%; min-height: 46px; border: 0; border-radius: 6px; background: var(--teal); color: var(--on-brand); font: 700 15px var(--font-head); cursor: pointer; }
.pwa-done:focus-visible, .pwa-bi:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.pwa-note { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 310; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; display: flex; flex-direction: column; font-size: 14px; }
@keyframes pwaUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pwa-banner, .pwa-sheet { animation: none; } }

/* Landing: phone app section */
.phone-sec { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.phone-sec h2 { margin: 8px 0 12px; }
.lead-sm { font-size: 17px; color: var(--ink-2); max-width: 560px; }
.phone-ways { display: grid; gap: 0; margin: 20px 0 4px; max-width: 560px; }
.phone-ways .pw { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 15px; color: var(--ink-2); }
.phone-ways .pw:last-child { border-bottom: 1px solid var(--border); }
.phone-ways .pw > b { font-family: var(--font-head); color: var(--teal); }
.phone-pair { display: flex; justify-content: center; align-items: center; min-height: 460px; }
.phone-frame { width: 210px; aspect-ratio: 390 / 844; border-radius: 34px; padding: 8px; background: #0B2F35; box-shadow: 0 24px 48px rgba(7,34,39,.22); flex: none; }
.phone-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 27px; display: block; background: var(--surface); }
.phone-frame.tilt-l { transform: rotate(-4deg) translateX(14px); z-index: 1; }
.phone-frame.tilt-r { transform: rotate(4deg) translate(-14px, 28px); z-index: 2; }
@media (max-width: 960px) { .phone-sec { grid-template-columns: 1fr; } .phone-pair { min-height: 0; padding: 16px 0 32px; } }
@media (max-width: 600px) { .phone-frame { width: 150px; border-radius: 26px; padding: 6px; } .phone-frame img { border-radius: 10px; } .phone-ways .pw { grid-template-columns: 1fr; gap: 2px; } }
.top-logo { display: none; align-items: center; gap: 8px; text-decoration: none; font-family: var(--font-logo); color: var(--teal); font-size: 21px; }
.top-logo .logo-mark { width: 30px; height: 30px; }
@media (max-width: 720px) {
  .top-logo { display: inline-flex; }
  .list-item > .grow { flex-basis: 200px; }
  .rv-fab { padding: 0; width: 44px; height: 44px; justify-content: center; font-size: 0; gap: 0; opacity: .92; }
  .rv-fab .rv-ico { width: 20px; height: 20px; }
}
@media (max-width: 400px) { .top-logo span { display: none; } }

/* Professional finish: quieter headings on cards, table head band, calmer hero */
.table th { background: var(--surface-2); }
.table thead th:first-child { border-top-left-radius: 6px; } .table thead th:last-child { border-top-right-radius: 6px; }
.card h3 { font-size: 16px; }
.hero h1 { font-weight: 800; color: var(--teal); }

.rv-fab { border-radius: 8px; }

/* Billing › Vaccine stock */
.bill-views .tabs { margin-bottom: 0; }
.stock-search { flex: 1 1 420px; max-width: 560px; }
.stock-block { border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s4); background: var(--surface); }
.stock-block + .stock-block { margin-top: var(--s4); }
.stock-block h3 { display: flex; align-items: center; gap: 8px; }
.stock-head { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; padding-bottom: var(--s3); border-bottom: 1px solid var(--border); }
.stock-now { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.stock-n { font-family: var(--font-head); font-weight: 800; font-size: 30px; color: var(--teal); line-height: 1; }
.stock-chg { font-weight: 700; }
.stock-chg.is-out { color: var(--bad); }
.stock-chg.is-in { color: var(--ok); }
.stock-evt td { background: var(--surface-2); }
.pet-link { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
button.pet-link:hover .cell-main { text-decoration: underline; color: var(--teal); }
.chip input[type=checkbox] { accent-color: var(--teal); }
@media (max-width: 720px) { .stock-n { font-size: 26px; } .stock-head > .row { width: 100%; } .stock-head > .row .btn { flex: 1; } }
/* the .stack-sm spacing utility must not turn data tables into flex boxes on wide screens */
@media (min-width: 721px) { table.table.stack-sm { display: table; } }
@media (max-width: 720px) {
  .stock-head > .grow { flex: 1 1 100%; }
  .stock-table.stack-sm tr { grid-template-columns: 1fr auto; grid-template-areas: "date chg" "pet pet" "what what" "after inv"; gap: 6px 10px; }
  .stock-table.stack-sm td:nth-child(1) { grid-area: date; font-weight: 500; }
  .stock-table.stack-sm td:nth-child(2) { grid-area: pet; }
  .stock-table.stack-sm td:nth-child(3) { grid-area: what; }
  .stock-table.stack-sm td:nth-child(4) { grid-area: chg; text-align: right; }
  .stock-table.stack-sm td:nth-child(5) { grid-area: after; text-align: left; }
  .stock-table.stack-sm td:nth-child(6) { grid-area: inv; text-align: right; }
  .stock-table.stack-sm tr.stock-evt td:nth-child(2) { display: none; }
  .stock-evt td { background: none; }
}

/* Landing hero: plain frames (white, rounded, light stroke) instead of coloured boxes */
.eyebrow { background: var(--surface); border-color: var(--border-strong); }
.eyebrow .badge { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 1px var(--border-strong); }
.preview .pv-clinic { border-radius: 14px; border-color: var(--border-strong); box-shadow: none; }
.pv-owner { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 0 0 6px var(--bg); }
.pv-owner .label { color: var(--ink-3); }
.pv-owner .pv-note { background: transparent; border: 1px solid var(--border); color: var(--ink); }
.pv-owner .pv-note strong { color: var(--teal); }
.pv-sync { background: var(--surface); color: var(--teal); border: 1px solid var(--border-strong); font-weight: 700; box-shadow: 0 0 0 4px var(--bg); }
.code-req { border-color: var(--teal); box-shadow: inset 3px 0 0 var(--teal); }
.code-wait h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; }

/* ---------- Connected mode (Vetdoxio server) ---------- */
.is-api .only-offline { display: none !important; }
html:not(.is-api) .only-api { display: none !important; }
.sync-state { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.sync-state.is-warn { background: var(--warn-bg); color: var(--warn); }
.sync-state.is-info { background: var(--info-bg); color: var(--info); }
#app[aria-busy="true"] { cursor: progress; }

/* ---------- Design fixes (Nov 2026) ---------- */
/* Rows that scroll sideways (tabs, wizard steps, pet chips) fade at the edge that has more,
   so it's obvious they scroll. app.js toggles .more-l / .more-r. */
.tabs.more-r, .steps.more-r, .pet-switch.more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.tabs.more-l, .steps.more-l, .pet-switch.more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px); mask-image: linear-gradient(90deg, transparent, #000 48px); }
.tabs.more-l.more-r, .steps.more-l.more-r, .pet-switch.more-l.more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }

/* Consultation wizard: all 8 steps fit on wide screens; a progress line replaces them on phones */
@media (min-width: 1100px) {
  .steps { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); overflow: visible; }
  .steps .step { min-width: 0; padding-left: 8px; padding-right: 8px; font-size: 12.5px; }
  .steps .step > :not(.n) { overflow: hidden; text-overflow: ellipsis; }
  .steps .step { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.steps-compact { display: none; }
.steps-bar { height: 6px; border-radius: 99px; background: var(--soft); margin-top: 8px; overflow: hidden; }
.steps-bar i { display: block; height: 100%; background: var(--teal); border-radius: inherit; transition: width var(--t) var(--ease); }
@media (max-width: 720px) {
  .steps-compact { display: block; font-size: 13.5px; margin-bottom: var(--s4); }
  .steps-compact .muted { font-size: 12.5px; }
  .steps { display: none; }
}

/* Clinic dashboard on phones: one row of actions, stats as a swipeable strip, the day's list sooner */
@media (max-width: 720px) {
  .dash .page-head > .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .dash .page-head > .row .btn-primary { grid-column: 1 / -1; }
  .dash .page-head > .row .btn { justify-content: center; padding-left: 8px; padding-right: 8px; font-size: 13px; width: 100%; }
  .dash .stats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .dash .stats::-webkit-scrollbar { display: none; }
  .dash .stats > .stat { flex: 0 0 42%; scroll-snap-align: start; padding: 12px; }
  .dash .stats .stat-label { font-size: 12.5px; line-height: 1.35; }
  .dash .stats .stat-value { font-size: 22px; }
  .dash .stats .stat-ico { width: 30px; height: 30px; }
}

/* Pet photos */
.avatar-photo { padding: 0; overflow: hidden; background: var(--soft); }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.avatar-xl { width: 72px; height: 72px; font-size: 26px; border-radius: 18px; flex: 0 0 auto; }
.photo-field { display: flex; align-items: center; gap: 16px; }
.photo-field label.btn { cursor: pointer; }

/* ---------- Vaccines & deworming multi-select ---------- */
.cpick { position: relative; }
.cpick .field { position: relative; }
.cpick-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 6px 44px 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-input); background: var(--surface); cursor: text; position: relative; transition: border-color var(--t), box-shadow var(--t); }
.cpick-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(10, 70, 80, .12); }
.cpick .has-error .cpick-box { border-color: var(--bad); }
.cpick-chips { display: contents; }
.cpick-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; background: var(--info-bg); color: var(--teal); border: 1px solid #cfe0e3; }
.cpick-chip.deworming { background: var(--lime-50); border-color: #d6ecc0; color: var(--ok); }
.cpick-chip button { border: 0; background: none; color: inherit; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.cpick-chip button:hover { background: rgba(10, 70, 80, .1); }
.cpick-input { flex: 1 1 160px; min-width: 120px; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; padding: 6px 4px; color: var(--ink); }
.cpick-caret { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); cursor: pointer; }
.cpick-caret:hover { background: var(--soft); }
.cpick-menu { position: absolute; z-index: 70; left: 0; right: 0; top: calc(100% - 18px); max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 28px rgba(16, 38, 43, .14); padding: 6px; }
.cpick-group { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 4px; }
.cpick-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); font: inherit; }
.cpick-opt:hover:not([disabled]), .cpick-opt.is-hl { background: var(--soft); }
.cpick-opt.is-on .cpick-name { color: var(--teal); font-weight: 700; }
.cpick-opt[disabled] { opacity: .5; cursor: not-allowed; }
.cpick-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; color: #fff; }
.cpick-opt.is-on .cpick-check { background: var(--teal); border-color: var(--teal); }
.cpick-opt[data-cpick-new] .cpick-check { border-style: dashed; color: var(--teal); }
.cpick-name { display: block; font-size: 14px; }
.cpick-sub { display: block; font-size: 12px; color: var(--ink-3); }
.cpick-empty { padding: 12px; color: var(--ink-3); font-size: 13px; }
.cpick-rows { display: grid; gap: 10px; margin-top: 12px; }
.cpick-row { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-card); padding: 12px 14px; }
.cpick-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cpick-row-x { margin-left: auto; }
@media (max-width: 720px) { .cpick-menu { max-height: 50vh; } }
.cpick-input:focus, .cpick-input:focus-visible { outline: 0; box-shadow: none; background: none; border: 0; }

/* ---------- Searchable dropdown with "add your own" (UI.comboize) ---------- */
select.combo-native { display: none !important; }
.combo { position: relative; }
.combo-box { position: relative; }
.combo-input { width: 100%; height: 46px; padding: 0 44px 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-input); background: var(--surface); font: inherit; font-size: 16px; color: var(--ink); cursor: pointer; transition: border-color var(--t), box-shadow var(--t); }
.combo-input::placeholder { color: var(--placeholder); }
.combo-input:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(10, 70, 80, .12); cursor: text; }
.has-error .combo-input { border-color: var(--bad); }
.combo-caret { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); cursor: pointer; transition: transform var(--t); }
.combo.is-open .combo-caret { transform: translateY(-50%) rotate(180deg); }
.combo-menu { position: absolute; z-index: 80; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 28px rgba(16, 38, 43, .14); padding: 6px; }
.combo-group { font-family: var(--font-head); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 4px; }
.combo-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); font: inherit; font-size: 14px; }
.combo-opt:hover:not([disabled]), .combo-opt.is-hl { background: var(--soft); }
.combo-opt.is-on { color: var(--teal); font-weight: 600; }
.combo-opt[disabled] { opacity: .5; cursor: not-allowed; }
.combo-add { color: var(--teal); font-weight: 600; border-top: 1px dashed var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; }
.combo-empty { padding: 12px; color: var(--ink-3); font-size: 13px; }
.modal-body .combo-menu { max-height: 260px; }
@media (max-width: 720px) { .combo-menu { max-height: 45vh; } }
