/* StableView. Nexvora family look (navy + teal, Inter, left sidebar), light first. */
:root {
  --bg: #f3f6fa; --side: #ffffff; --surface: #ffffff; --surface-2: #f8fafc; --sunk: #eef2f7; --line: #dde4ec; --line-2: #e9eef4;
  --ink: #102030; --muted: #5a6b7d; --navy: #00203f;
  --accent: #0b8f86; --accent-ink: #087068; --accent-soft: rgba(11, 143, 134, .1); --on-accent: #fff;
  --ok: #15803d; --ok-soft: rgba(21, 128, 61, .1); --warn: #b45309; --warn-soft: rgba(180, 83, 9, .1);
  --crit: #c2331f; --crit-soft: rgba(194, 51, 31, .09); --blue: #1d6fd1; --blue-soft: rgba(29, 111, 209, .1); --idle: #6d28d9; --idle-soft: rgba(109, 40, 217, .1);
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --f-brand: "Montserrat", "Inter", sans-serif;
  --r: 12px; --shadow: 0 1px 2px rgba(16, 32, 48, .04), 0 4px 16px rgba(16, 32, 48, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 14px/1.5 var(--f-body); font-feature-settings: "cv11"; background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1rem; font-weight: 600; }
h3 { font-size: .9rem; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.i { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }

/* Shell */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 18px 12px; background: var(--side); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: grid; gap: 4px; padding: 0 8px 6px; text-decoration: none; color: inherit; }
.svlock { display: flex; align-items: center; gap: 10px; }
.svmark { width: 42px; height: 42px; flex: none; border-radius: 10px; }
.svby { display: block; width: 78px; margin-top: 3px; }
.product { font-family: var(--f-brand); font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; color: var(--navy); }
.product span { color: var(--accent); }
.bizname { margin: 0 4px; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; gap: 10px; align-items: center; min-width: 0; }
.bizname img, .bizname .ini { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; background: var(--accent-soft); display: grid; place-items: center; font-weight: 700; color: var(--accent); font-size: .8rem; }
.bizname b { display: block; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bizname small { color: var(--muted); font-size: .72rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.navgroup { font: 600 .66rem/1.4 var(--f-body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 12px 10px 4px; }
.tab { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; cursor: pointer; text-align: left; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--ink); background: var(--sunk); }
.tab[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }
.tab .count { margin-left: auto; font-size: .7rem; padding: 0 7px; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 600; }
.sitecard { margin-top: auto; padding: 14px; border-radius: 12px; background: linear-gradient(160deg, rgba(11, 143, 134, .12), rgba(29, 111, 209, .06)); border: 1px solid rgba(11, 143, 134, .25); display: grid; gap: 8px; font-size: .8rem; }
.sitecard b { font-size: .88rem; }
.sitecard .url { font-family: ui-monospace, Consolas, monospace; font-size: .72rem; word-break: break-all; color: var(--accent-ink); }
.side-foot { font-size: .72rem; color: var(--muted); padding: 0 8px; display: flex; justify-content: space-between; }
.side-foot button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; font-size: .72rem; }
.side-foot button:hover { color: var(--ink); text-decoration: underline; }

.main { min-width: 0; padding: 20px 28px 56px; display: flex; flex-direction: column; gap: 18px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 40px; }
.top h1 { font-size: 1.4rem; font-weight: 650; letter-spacing: -.02em; }
.top .sub { color: var(--muted); font-size: .85rem; margin: 2px 0 0; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (max-width: 900px) {
  .app { display: block; }
  .side { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .brand { padding: 0; flex: none; } .brand .svby { display: none; } .brand .svmark { width: 32px; height: 32px; border-radius: 8px; }
  .bizname, .navgroup, .sitecard, .side-foot { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .tab span.lbl { display: none; } .tab { padding: 8px 10px; }
  .tab[aria-current="page"] span.lbl { display: inline; }
  .main { padding: 16px 14px 48px; }
}

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .85rem; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--surface-2); border-color: #c9d3de; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--crit); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 2px; }
.seg button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 6px; cursor: pointer; font-weight: 500; color: var(--muted); font-size: .84rem; }
.seg button[aria-pressed="true"] { background: var(--sunk); color: var(--ink); font-weight: 600; }
input.in, select.in, textarea.in { height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
textarea.in { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; }
.search { position: relative; } .search svg { position: absolute; left: 10px; top: 10px; color: var(--muted); } .search input { padding-left: 32px; width: 240px; }

.field { display: grid; gap: 5px; align-content: start; }
.field > label, .field > .lbl { font-size: .8rem; font-weight: 600; }
.field .hint { font-size: .76rem; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: #cbd5e1; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card .pad { padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; display: grid; gap: 4px; justify-items: center; text-align: center; }
.kpi b { font-size: 1.55rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: .78rem; }
@media (max-width: 900px) { .kpis { grid-template-columns: 1fr 1fr; } }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 16px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.chip.confirmed { background: var(--blue-soft); color: var(--blue); }
.chip.completed, .chip.paid, .chip.in { background: var(--ok-soft); color: var(--ok); }
.chip.no_show { background: var(--warn-soft); color: var(--warn); }
.chip.cancelled { background: var(--crit-soft); color: var(--crit); }
.chip.unpaid { background: var(--sunk); color: var(--muted); }
.chip.web { background: var(--accent-soft); color: var(--accent-ink); }
.chip.acct { background: var(--blue-soft); color: var(--blue); }

/* Today timeline */
.timeline { display: grid; }
.trow { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--surface-2); }
.trow.past { opacity: .6; }
.trow.now { box-shadow: inset 3px 0 0 var(--accent); background: rgba(11, 143, 134, .04); }
.trow time { font-weight: 650; font-variant-numeric: tabular-nums; font-size: .95rem; }
.trow time small { display: block; color: var(--muted); font-weight: 500; font-size: .72rem; }
.trow .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .who span { color: var(--muted); font-size: .82rem; }
.trow .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .trow { grid-template-columns: 56px 1fr; } .trow .acts { grid-column: 1 / -1; justify-content: flex-start; } }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }

/* Tables */
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--surface-2); }
table.t td.r, table.t th.r { text-align: right; }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(10, 20, 35, .35); z-index: 40; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--surface); z-index: 41; display: flex; flex-direction: column; box-shadow: -20px 0 60px rgba(16, 32, 48, .18); animation: slide .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer > header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer > header h2 { flex: 1; font-size: 1.05rem; }
.drawer .body { padding: 18px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.drawer > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.iconbtn { width: 34px; height: 34px; border-radius: 8px; border: 0; background: var(--sunk); display: grid; place-items: center; cursor: pointer; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: .88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.err { color: var(--crit); background: var(--crit-soft); padding: 9px 12px; border-radius: 8px; font-size: .85rem; }
.note { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; font-size: .84rem; color: var(--muted); }
.note b { color: var(--ink); }
.soon { display: inline-flex; padding: 1px 7px; border-radius: 99px; font-size: .66rem; font-weight: 700; background: var(--idle-soft); color: var(--idle); text-transform: uppercase; letter-spacing: .05em; vertical-align: 1px; }
.slotpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.slotpick button { height: 34px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .8rem; font-variant-numeric: tabular-nums; }
.slotpick button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .86rem; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: fade .15s; }
.loading { padding: 48px; text-align: center; color: var(--muted); }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .art { background: radial-gradient(1200px 600px at 20% 10%, rgba(34, 179, 169, .35), transparent 60%), linear-gradient(160deg, #00203f, #013a4a); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .art h1 { font-size: 2.2rem; line-height: 1.15; max-width: 14ch; letter-spacing: -.02em; }
.auth .art p { opacity: .8; max-width: 40ch; }
.auth .art ul { padding: 0; list-style: none; display: grid; gap: 10px; opacity: .92; }
.auth .art li { display: flex; gap: 10px; align-items: center; }
.auth .form { display: grid; place-items: center; padding: 32px 20px; }
.auth form { width: min(380px, 100%); display: grid; gap: 14px; }
.auth form h2 { font-size: 1.4rem; }
.auth .btn { height: 42px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth .art { display: none; } }

.dropzone { border: 2px dashed var(--line); border-radius: 10px; display: grid; place-items: center; text-align: center; padding: 18px; color: var(--muted); cursor: pointer; min-height: 160px; gap: 6px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.connect { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.connect .logo { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.connect div { flex: 1; } .connect small { color: var(--muted); display: block; font-size: .78rem; }
.drawer.wide { width: min(640px, 100%); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }
.chip.pending { background: var(--warn-soft); color: var(--warn); }
.connect input[type="radio"] { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

/* ---------- StableView ---------- */
.chip.in, .chip.done, .chip.approved, .chip.paid { background: var(--ok-soft); color: var(--ok); }
.chip.away, .chip.scheduled, .chip.planned { background: var(--blue-soft); color: var(--blue); }
.chip.expected, .chip.open, .chip.due { background: var(--warn-soft); color: var(--warn); }
.chip.left, .chip.cancelled, .chip.withdrawn { background: var(--sunk); color: var(--muted); }
.chip.declined, .chip.overdue, .chip.failed, .chip.owes { background: var(--crit-soft); color: var(--crit); }
.chip.quarantine { background: var(--idle-soft); color: var(--idle); }
.tab .count.warn { background: var(--warn); }

.list { display: grid; }
.lrow { display: flex; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.lrow:last-child { border-bottom: 0; }
.lrow.click { cursor: pointer; } .lrow.click:hover { background: var(--surface-2); }
.lrow .grow { flex: 1; min-width: 0; }
.lrow .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.lrow .grow span { color: var(--muted); font-size: .82rem; display: block; overflow-wrap: anywhere; }
.lrow .when { flex: none; width: 84px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .82rem; white-space: nowrap; }
.lrow > .chip, .lrow > .money, .lrow > .btn { flex: none; }
.lrow .when small { display: block; color: var(--muted); font-weight: 500; }
.card .empty { padding: 22px 16px; }

.av { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; object-fit: cover; flex: none; font-size: .85rem; }
.av.lg { width: 96px; height: 96px; border-radius: 16px; font-size: 1.6rem; }

.horsegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.hcard { display: flex; gap: 12px; padding: 12px; cursor: pointer; align-items: center; min-width: 0; text-decoration: none; color: inherit; }
.hcard:hover { border-color: #c4ced9; }
.hcard .av { width: 56px; height: 56px; }
.hcard b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hcard small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hcard .meta { min-width: 0; flex: 1; display: grid; gap: 3px; }

.hero { display: flex; gap: 18px; align-items: center; padding: 16px; flex-wrap: wrap; }
.hero h1 { font-size: 1.5rem; letter-spacing: -.02em; }
.hero .facts { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.hero .facts b { color: var(--ink); font-weight: 600; }
.hero .grow { flex: 1; min-width: 220px; }
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subtabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs button[aria-pressed="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
.kv.wide { grid-template-columns: 150px 1fr; }
.kv dd.mono, .mono { font-family: ui-monospace, Consolas, monospace; font-size: .84rem; letter-spacing: .02em; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: .85rem; background: var(--warn-soft); color: #7c3d06; }
.alert.crit { background: var(--crit-soft); color: var(--crit); }
.alert.info { background: var(--blue-soft); color: #164e94; }

/* Passport scan */
.scanbox { display: grid; gap: 12px; }
.scanbox .shot { width: 100%; max-height: 260px; object-fit: contain; background: var(--sunk); border-radius: 10px; border: 1px solid var(--line); }
.cmp { width: 100%; border-collapse: collapse; font-size: .84rem; }
.cmp th { text-align: left; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 6px 6px; border-bottom: 1px solid var(--line); }
.cmp td { padding: 7px 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.cmp td:first-child { width: 26px; }
.cmp td.lbl { color: var(--muted); width: 110px; }
.cmp td.old { color: var(--muted); text-decoration: line-through; }
.cmp tr.same td { opacity: .55; }
.cmp input[type=text] { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; background: var(--surface); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Stall map */
.blocks { display: grid; gap: 16px; }
.stalls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 14px; }
.stall { border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 76px; display: grid; gap: 2px; align-content: start; background: var(--surface); }
.stall.free { background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 6px, var(--surface) 6px, var(--surface) 12px); color: var(--muted); }
.stall.busy { cursor: pointer; border-left: 3px solid var(--accent); } .stall.busy:hover { background: var(--surface-2); }
.stall.iso { border-left-color: var(--idle); }
.stall small { color: var(--muted); font-size: .72rem; }
.stall b { font-size: .86rem; }

/* Feed sheet */
.sheet td { vertical-align: top; }
.sheet .feedline { display: block; white-space: nowrap; font-size: .82rem; }
.sheet .feedline em { font-style: normal; color: var(--warn); font-weight: 600; }
.bar { height: 6px; border-radius: 99px; background: var(--sunk); overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--ok); }
.bar.low i { background: var(--crit); } .bar.mid i { background: var(--warn); }
.feedrow { display: grid; grid-template-columns: 1fr 86px 76px 34px 34px; gap: 6px; align-items: center; }
.feedrow .in { height: 32px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.neg { color: var(--ok); } .money.pos { color: var(--crit); }

@media print {
  .side, .tools, .noprint, .toast { display: none !important; }
  .app { display: block; } .main { padding: 0; } .card { box-shadow: none; border: 0; }
  body, html { background: #fff; }
  table.t td, table.t th { padding: 6px 8px; }
}

/* Settings: categories on the left, one at a time on the right */
.setlayout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.setnav { display: grid; gap: 2px; position: sticky; top: 16px; }
.setnav a { position: relative; display: grid; gap: 1px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.setnav a span { font-size: .76rem; color: var(--muted); }
.setnav a:hover { background: var(--sunk); }
.setnav a[aria-current="page"] { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.setnav a[aria-current="page"] b { color: var(--accent-ink); }
.setnav .dot { position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--crit); }
.setbody { display: grid; gap: 16px; max-width: 760px; }
@media (max-width: 900px) {
  .setlayout { grid-template-columns: 1fr; }
  .setnav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .setnav a { flex: none; padding: 7px 12px; border-color: var(--line); background: var(--surface); }
  .setnav a span { display: none; }
}

/* Plan page + Nexvora console */
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.meter { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 14px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); }
.meter small { color: var(--muted); font-size: .78rem; font-weight: 600; }
.meter b { font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.meter span { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.meter .bar { width: 100%; margin-top: 6px; } .meter .bar.unl i { background: var(--accent-soft); }
@media (max-width: 640px) { .meters { grid-template-columns: 1fr; } }
.featlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.featlist li { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; }
.featlist li svg { color: var(--ok); margin-top: 1px; } .featlist li.no { color: var(--muted); } .featlist li.no svg { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plangrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; padding: 16px; }
.plancard { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px; cursor: pointer; display: grid; gap: 6px; align-content: start; font: inherit; color: inherit; }
.plancard:hover { border-color: #c4ced9; } .plancard[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plancard .price { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; } .plancard .price small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.plancard ul { margin: 0; padding-left: 18px; font-size: .84rem; color: var(--muted); }
table.planed { table-layout: fixed; min-width: 860px; }
table.planed td { padding: 10px 12px; vertical-align: middle; }
table.planed th.c, table.planed td.c { text-align: center; }
table.planed input.in { height: 34px; width: 100%; min-width: 0; }
table.planed input.num, .rmin input { text-align: right; font-variant-numeric: tabular-nums; }
table.planed .switch { display: inline-block; vertical-align: middle; }
table.planed tr.changed td { background: var(--accent-soft); }
.plancell { display: flex; align-items: center; gap: 8px; }
.plancell input { flex: 1; }
.plancell code { flex: none; font-size: .7rem; color: var(--muted); background: var(--sunk); border-radius: 6px; padding: 2px 6px; }
.rmin { position: relative; display: block; }
.rmin span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: .78rem; color: var(--muted); pointer-events: none; }
.rmin input { padding-left: 34px; }
#planbar:empty { display: none; }

.yearcalc { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.yearcalc input { width: 52px; height: 30px; text-align: center; }
.freeon { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.packin { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.packin input { width: 90px; height: 30px; }

/* Notifications bell */
.bell { position: relative; width: 38px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.bell:hover { background: var(--surface-2); }
.bell span { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--crit); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; }
.lrow.unread { background: var(--accent-soft); }
/* Events month calendar */
.calm { padding: 8px 12px 14px; }
.calm-h, .calm-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calm-h span { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; padding: 4px 0 6px; }
.calm-g { gap: 4px; }
.calm-d { min-height: 92px; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; background: var(--surface); }
.calm-d > b { font-size: .76rem; font-weight: 600; color: var(--muted); text-align: right; }
.calm-d.out { background: var(--surface-2); } .calm-d.out > b { opacity: .5; }
.calm-d.today { border-color: var(--accent); } .calm-d.today > b { color: var(--accent-ink); }
.calm-e { border: 0; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--ink); text-align: left; font: inherit; font-size: .72rem; line-height: 1.25; padding: 2px 5px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calm-e i { font-style: normal; font-weight: 600; margin-right: 4px; }
.calm-e.k-show { border-color: #c2410c; background: rgba(194, 65, 12, .1); } .calm-e.k-clinic, .calm-e.k-training { border-color: var(--blue); background: var(--blue-soft); }
.calm-e.k-social { border-color: var(--idle); background: var(--idle-soft); } .calm-e.x { text-decoration: line-through; opacity: .55; }
@media (max-width: 700px) { .calm-d { min-height: 64px; } .calm-e i { display: none; } }

/* Event posters */
.evimgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.evimgs figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; }
.evimgs img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: var(--sunk); }
.evimgs figcaption { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 6px; }
.evadd { min-height: 0; aspect-ratio: 3 / 4; }
.evthumb { width: 40px; height: 52px; object-fit: cover; border-radius: 6px; flex: none; border: 1px solid var(--line); }

/* Phone pop-ups row + pictures in the bell */
.pushrow { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); margin-bottom: 6px; }
.pushrow > div { display: grid; gap: 2px; } .pushrow span { font-size: .8rem; color: var(--muted); } .pushrow .btn { flex: none; }
.nimg { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; flex: none; border: 1px solid var(--line); }

/* Full-screen photo viewer (viewer.js) */
.viewer { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 56px 12px 40px; background: rgba(8, 12, 18, .92); }
.viewer img { max-width: calc(100vw - 24px); max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.viewer button { position: absolute; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .16); line-height: 1; }
.viewer button:hover, .viewer button:focus-visible { background: rgba(255, 255, 255, .3); }
.vw-x { top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; font-size: 30px; }
.vw-step { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 32px; }
.vw-prev { left: 10px; } .vw-next { right: 10px; }
.vw-step[hidden] { display: none; }
.vw-count { position: absolute; bottom: calc(12px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #fff; font-size: .85rem; opacity: .8; }

/* "New version" pop-up (update.js) */
.updbar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); padding: 10px 10px 10px 16px; border-radius: 12px; background: #00203f; color: #fff; font-weight: 600; font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.updbar span { flex: 1; }
.updx { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; opacity: .8; }
.updx:hover { opacity: 1; background: rgba(255, 255, 255, .12); }

/* Settings → Online payment: provider sign-up links */
.paysign { display: grid; gap: 10px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); font-size: .88rem; }
.paylinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.paylink { display: grid; gap: 4px; justify-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; text-decoration: none; }
.paylink:hover { border-color: var(--accent); }
.paylink span:not(.chip) { color: var(--muted); font-size: .8rem; }

/* Today management dashboard. All selectors are scoped; shared cards/KPIs stay intact. */
.td-dashboard { display:grid; gap:18px; min-width:0; }
.td-dashboard .top { padding:4px 0 2px; }
.td-dashboard .top h1 { font-size:1.7rem; }
.td-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px 18px; padding:14px 16px; background:var(--surface); border:1px solid var(--line); border-radius:14px; }
.td-toolbar .seg { background:var(--surface-2); }
.td-toolbar .seg button[aria-pressed=true] { background:var(--navy); color:white; }
.td-date-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.td-anchor { display:flex; gap:8px; align-items:center; font-size:.8rem; color:var(--muted); }
.td-toolbar p { margin:0 0 0 auto; font-size:.82rem; font-weight:600; text-align:right; }
.td-toolbar p span { display:block; font-size:.69rem; font-weight:400; color:var(--muted); margin-top:3px; }
.td-section-label { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px; }
.td-section-label>span { font-size:.76rem; font-weight:700; text-transform:uppercase; letter-spacing:.09em; color:var(--navy); }
.td-section-label small { color:var(--muted); font-size:.74rem; }
.td-stats,.td-live-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.td-stat { display:grid; align-content:start; justify-items:center; text-align:center; gap:8px; padding:20px 14px; border:1px solid var(--line); border-radius:14px; color:inherit; text-decoration:none; background:var(--surface); box-shadow:var(--shadow); }
.td-stat:hover { border-color:var(--accent); }
.td-stat-icon { display:grid; place-items:center; width:32px; height:32px; background:var(--accent-soft); color:var(--accent-ink); border-radius:10px; }
.td-stat>span:not(.td-stat-icon) { font-size:.8rem; font-weight:500; }
.td-stat>b { font-size:clamp(1.15rem,1.7vw,1.9rem); line-height:1.3; letter-spacing:-.035em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.td-stat>small { font-size:.7rem; color:var(--muted); }
.td-stat.td-featured { color:white; background:linear-gradient(125deg,#00203f,#074f62); border-color:var(--navy); }
.td-featured .td-stat-icon { background:#ffffff1c; color:#9aeee3; }
.td-featured>small { color:#c0d9e3; }
.td-main-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr); gap:16px; align-items:start; }
.td-main-grid>* { min-width:0; }
.td-panel { border:1px solid var(--line); border-radius:14px; background:var(--surface); box-shadow:var(--shadow); overflow:hidden; }
.td-panel>header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 20px; border-bottom:1px solid var(--line-2); }
.td-panel>header h2 { font-size:.95rem; }
.td-panel>header p { font-size:.72rem; color:var(--muted); margin:4px 0 0; }
.td-chart-summary { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:20px 20px 14px; }
.td-chart-summary>div { display:grid; gap:4px; }
.td-chart-summary small { color:var(--muted); font-size:.74rem; }
.td-chart-summary strong { font-size:1.4rem; letter-spacing:-.03em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.td-chart-summary span { font-size:.7rem; color:var(--muted); }
.td-legend { display:flex; flex-wrap:wrap; gap:10px 16px; padding:0 20px; color:var(--muted); font-size:.68rem; }
.td-legend span { display:flex; gap:5px; align-items:center; }
.td-legend i { width:8px; height:8px; border-radius:2px; }
.td-key-sales,.td-sales-bar { background:var(--accent); }
.td-key-paid,.td-paid-bar { background:var(--navy); }
.td-key-estimate,.td-estimate-bar { background:repeating-linear-gradient(135deg,#92d7cf,#92d7cf 3px,#d7efeb 3px,#d7efeb 6px); }
.td-key-credit,.td-sales-bar.td-negative { background:var(--crit); }
.td-chart { display:flex; height:210px; align-items:stretch; gap:8px; padding:18px 20px 12px; overflow-x:auto; }
.td-chart-column { flex:1; min-width:14px; max-width:75px; display:flex; flex-direction:column; justify-content:flex-end; text-align:center; }
.td-bars { display:flex; align-items:flex-end; justify-content:center; gap:3px; height:155px; border-bottom:1px solid var(--line); background:repeating-linear-gradient(to top,transparent,transparent 37px,var(--line-2) 38px,transparent 39px); }
.td-sale-stack { display:flex; flex-direction:column; width:42%; min-width:4px; overflow:hidden; border-radius:3px 3px 0 0; }
.td-sales-bar,.td-estimate-bar { display:block; min-height:0; }
.td-paid-bar { display:block; width:30%; min-width:3px; border-radius:3px 3px 0 0; }
.td-chart-column>small { margin-top:8px; color:var(--muted); font-size:.65rem; }
.td-details { border-top:1px solid var(--line-2); font-size:.76rem; }
.td-details>summary { cursor:pointer; padding:12px 20px; color:var(--accent-ink); font-weight:500; }
.td-details>p { margin:0; padding:0 20px 12px; line-height:1.7; color:var(--muted); }
.td-breakdown { padding:20px; display:grid; gap:20px; }
.td-category>div { display:flex; justify-content:space-between; gap:10px; font-size:.8rem; margin-bottom:7px; }
.td-category b { font-variant-numeric:tabular-nums; }
.td-category meter { display:block; width:100%; height:8px; border:0; background:var(--sunk); border-radius:10px; }
.td-category meter::-webkit-meter-bar { background:var(--sunk); border:0; border-radius:10px; }
.td-category meter::-webkit-meter-optimum-value { background:var(--accent); border-radius:10px; }
.td-category meter::-moz-meter-bar { background:var(--accent); border-radius:10px; }
.td-live { display:grid; justify-items:center; text-align:center; gap:8px; border:1px solid var(--line); background:var(--surface); padding:16px 12px; border-radius:12px; color:inherit; text-decoration:none; }
.td-live:hover { border-color:var(--accent); }
.td-live>span { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:.76rem; }
.td-live>b { font-size:1.35rem; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.td-live em { font-size:1rem; color:var(--muted); font-weight:400; font-style:normal; }
.td-live>small { color:var(--muted); font-size:.68rem; }
.td-stack { display:grid; gap:16px; min-width:0; }
.td-list { max-height:460px; overflow-y:auto; }
.td-row { display:flex; align-items:center; gap:10px; padding:13px 20px; color:inherit; text-decoration:none; border-bottom:1px solid var(--line-2); }
.td-row:last-child { border-bottom:0; }
a.td-row:hover { background:var(--surface-2); }
.td-row-main { flex:1; min-width:0; display:grid; gap:3px; }
.td-row-main b { font-size:.81rem; font-weight:600; overflow-wrap:anywhere; }
.td-row-main small { font-size:.72rem; color:var(--muted); overflow-wrap:anywhere; }
.td-row-main>a { color:inherit; text-decoration:none; }
.td-row-main>a:hover { color:var(--accent-ink); }
.td-badge { padding:3px 8px; border-radius:6px; background:var(--sunk); color:var(--muted); font-size:.65rem; font-weight:600; white-space:nowrap; }
.td-badge.td-danger { color:var(--crit); background:var(--crit-soft); }
.td-badge.td-warn { color:var(--warn); background:var(--warn-soft); }
.td-badge.td-ok { color:var(--ok); background:var(--ok-soft); }
.td-move-totals { display:grid; grid-template-columns:1fr 1fr; background:var(--surface-2); border-bottom:1px solid var(--line-2); padding:14px 20px; gap:16px; }
.td-move-totals>div { display:grid; gap:3px; }
.td-move-totals small { font-size:.72rem; color:var(--muted); }
.td-move-totals strong { font-size:1.25rem; }
.td-move-totals strong span { font-size:.72rem; font-weight:400; color:var(--muted); }
.td-direction { width:30px; height:30px; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent-ink); border-radius:9px; flex:none; }
.td-direction.td-out { color:var(--blue); background:var(--blue-soft); }
.td-empty { padding:28px 20px; text-align:center; color:var(--muted); font-size:.8rem; }
.td-footnote { font-size:.71rem; color:var(--muted); margin:0; line-height:1.6; }
.td-panel>.td-footnote { padding:10px 20px; border-top:1px solid var(--line-2); }
.td-dashboard[aria-busy=true] { opacity:.7; }
@media(max-width:1200px) { .td-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } .td-stat>b { font-size:1.55rem; } .td-main-grid { grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr); } .td-toolbar p { margin-left:0; text-align:left; width:100%; } }
@media(max-width:760px) { .td-main-grid { grid-template-columns:1fr; } .td-live-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .td-row { padding:12px 14px; flex-wrap:wrap; } .td-panel>header { padding:15px 14px; } .td-toolbar { padding:12px; } .td-toolbar .seg { width:100%; } .td-toolbar .seg button { flex:1; padding:0 10px; } .td-date-controls { gap:6px; } .td-anchor { gap:5px; } .td-anchor input { max-width:146px; } .td-chart-summary { padding:16px 14px; } .td-chart-summary strong { font-size:1.15rem; } .td-section-label small { font-size:.68rem; } }
@media(prefers-reduced-motion:reduce) { .td-dashboard * { scroll-behavior:auto !important; } }

/* Today: equal-height sales cards, balanced card columns, foldable cards */
.td-equal { align-items:stretch; }
.td-equal>*, .td-equal #td-forecast>.td-panel { height:100%; }
.td-equal.td-one { grid-template-columns:1fr; }
.td-cards { columns:2 380px; column-gap:16px; }
.td-cards>.td-panel { break-inside:avoid; display:block; width:100%; margin:0 0 16px; }
.td-head-tools { display:flex; align-items:center; gap:8px; flex:none; }
.td-fold { width:32px; height:32px; display:grid; place-items:center; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--muted); cursor:pointer; }
.td-fold:hover { color:var(--ink); border-color:var(--accent); }
.td-fold .i { transition:transform .15s; }
.td-folded .td-fold .i { transform:rotate(-90deg); }
.td-folded>.td-body { display:none; }
.td-folded>header { border-bottom:0; }
.td-body>.td-footnote { padding:10px 20px; border-top:1px solid var(--line-2); }
@media(max-width:760px) { .td-cards { columns:1; } }


/* Staff navigation stays available on every phone page. */
.sv-mobile-nav { display:none; }
.sv-menu-account { display:grid; gap:3px; padding-bottom:12px; border-bottom:1px solid var(--line); }
.sv-menu-account span { color:var(--muted); font-size:.76rem; }
.sv-menu-group h3 { color:var(--muted); font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; margin-bottom:8px; }
.sv-menu-group>div { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.sv-menu-group a { display:flex; align-items:center; gap:9px; min-height:48px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; color:var(--ink); text-decoration:none; font-size:.8rem; }
.sv-menu-group a[aria-current="page"] { color:var(--accent-ink); background:var(--accent-soft); border-color:var(--accent); }
.sv-menu-group a small { margin-left:auto; color:var(--warn); }
.sv-more-drawer .body { display:flex; flex-direction:column; gap:18px; }
@media(max-width:760px) {
  .app .side { padding:10px 16px; min-height:56px; }
  .app .side .nav { display:none; }
  .app .side .svby { display:block; }
  .app .side .brand { flex:1; }
  .app .main { padding-bottom:calc(100px + env(safe-area-inset-bottom, 0px)); }
  .td-dashboard { gap:14px; }
  .td-dashboard .top { align-items:center; gap:8px; }
  .td-dashboard .top h1 { font-size:1.4rem; }
  .td-dashboard .top .sub { font-size:.75rem; }
  .td-dashboard .top .tools { gap:6px; }
  .td-dashboard .top [data-scan] { font-size:0; width:36px; padding:0; }
  .td-dashboard .top [data-scan] svg { width:18px; height:18px; }
  .td-toolbar { gap:10px; background:var(--surface); border-radius:16px; box-shadow:var(--shadow); }
  .td-toolbar .seg { border:0; padding:4px; border-radius:10px; }
  .td-toolbar .seg button { min-height:36px; border-radius:8px; }
  .td-date-controls { width:100%; display:grid; grid-template-columns:36px minmax(0,1fr) 36px auto; }
  .td-date-controls>.btn { min-height:38px; padding:0 10px; }
  .td-anchor { font-size:0; min-width:0; }
  .td-anchor input { width:100%; max-width:none; font-size:.8rem; height:38px; }
  .td-toolbar p { font-size:.78rem; }
  .td-toolbar p span { font-size:.65rem; }
  .td-stats { gap:10px; }
  .td-stat { border-radius:16px; padding:14px 10px; gap:6px; }
  .td-stat-icon { width:28px; height:28px; border-radius:9px; }
  .td-stat>b { font-size:1.28rem; }
  .td-stat>span:not(.td-stat-icon) { font-size:.73rem; }
  .td-stat>small { font-size:.65rem; line-height:1.45; }
  .td-live-grid { gap:10px; }
  .td-live { border-radius:14px; gap:6px; padding:14px 10px; }
  .td-live>b { font-size:1.25rem; }

  .td-dashboard .td-panel { border-radius:16px; }
  .td-dashboard .td-panel>header { gap:8px; }
  .td-dashboard .td-panel>header .btn { font-size:.71rem; min-height:36px; padding:0 9px; }
  .td-dashboard .td-row { min-height:65px; }
  .td-dashboard .td-row>.btn { min-height:40px; }
  .sv-mobile-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); position:fixed; z-index:35; left:0; right:0; bottom:0; padding:8px 6px calc(8px + env(safe-area-inset-bottom, 0px)); background:var(--surface); border-top:1px solid var(--line); box-shadow:0 -5px 25px #00203f12; }
  .sv-mobile-nav>a,.sv-mobile-nav>button { display:grid; justify-items:center; align-content:center; gap:3px; min-height:52px; background:none; color:var(--muted); border:0; border-radius:14px; cursor:pointer; padding:4px 0; text-decoration:none; -webkit-tap-highlight-color:transparent; }
  .sv-mobile-nav>a>span,.sv-mobile-nav>button>span { position:relative; display:grid; place-items:center; width:44px; height:27px; border-radius:10px; }
  .sv-mobile-nav svg { width:20px; height:20px; }
  .sv-mobile-nav small { font-size:.65rem; font-weight:500; }
  .sv-mobile-nav [aria-current="page"],.sv-mobile-nav [data-current="true"] { color:var(--accent-ink); }
  .sv-mobile-nav [aria-current="page"]>span,.sv-mobile-nav [data-current="true"]>span { background:var(--accent-soft); }
  .sv-mobile-nav [aria-current="page"] small,.sv-mobile-nav [data-current="true"] small { font-weight:700; }
  .sv-mobile-nav i { position:absolute; top:-4px; right:-1px; min-width:16px; height:16px; padding:0 3px; border-radius:20px; background:var(--crit); color:white; font:600 .6rem/16px var(--f-body); font-style:normal; }
  .sv-more-drawer { top:auto; left:0; right:0; bottom:0; width:100%; max-height:90dvh; border-radius:22px 22px 0 0; padding-bottom:env(safe-area-inset-bottom, 0px); }
  body:has(.sv-mobile-nav)>.toast { bottom:calc(88px + env(safe-area-inset-bottom, 0px)); }
}
@media print { .sv-mobile-nav { display:none !important; } }

/* Menu icons a touch larger than inline icons */
.nav .tab svg.i { width: 19px; height: 19px; }

/* Dashboard on phones: one tidy header row, a compact period/date bar */
@media(max-width:760px) {
  .td-dashboard .top { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px 10px; }
  .td-dashboard .top .sub { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .td-dashboard .top .tools { flex-wrap:nowrap; gap:6px; }
  .td-dashboard .top .tools .btn { width:36px; height:36px; padding:0; }
  .td-dashboard .top .tools .td-txt { display:none; }
  .td-dashboard .top .tools .btn svg.i { width:18px; height:18px; }
  .td-dashboard .top .bell { width:36px; height:36px; }
  .td-toolbar { padding:8px; gap:8px; border-radius:14px; }
  .td-toolbar .seg { padding:3px; }
  .td-toolbar .seg button { min-height:30px; font-size:.8rem; }
  .td-date-controls { grid-template-columns:32px minmax(0,1fr) 32px auto; gap:6px; }
  .td-date-controls>.btn { min-height:32px; height:32px; padding:0 10px; font-size:.78rem; }
  .td-anchor input { height:32px; font-size:.78rem; padding:0 8px; }
  .td-toolbar p { font-size:.72rem; font-weight:600; color:var(--muted); padding:0 2px; }
  .td-toolbar p span { display:none; }
}

/* StableView time picker (timepicker.js), computers only; phones keep their own wheel */
@media (pointer: fine) {
  input[type="time"] { cursor: pointer; }
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
}
.tp { position: fixed; z-index: 1100; width: 264px; padding: 14px; display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 32, 63, .18); font-family: var(--f-body); animation: tp-in .12s ease-out; }
@keyframes tp-in { from { opacity: 0; transform: translateY(-4px); } }
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.tp-big { font-size: 1.15rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.tp-ap { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--sunk); }
.tp-ap button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font: 600 .75rem var(--f-body); color: var(--muted); cursor: pointer; }
.tp-ap button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.tp-lbl { font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.tp-grid button { height: 32px; border: 1px solid transparent; border-radius: 8px; background: var(--surface-2); font: 500 .82rem var(--f-body); color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.tp-grid button:hover { border-color: var(--accent); color: var(--accent-ink); }
.tp-grid button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.tp-foot { display: flex; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line-2); }
.tp-foot button { border: 0; background: none; font: 600 .8rem var(--f-body); color: var(--accent-ink); cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.tp-foot button:hover { background: var(--accent-soft); }
.tp-foot .tp-done { margin-left: auto; background: var(--accent); color: var(--on-accent); padding: 6px 14px; }
.tp-foot .tp-done:hover { background: var(--accent-ink); }

/* Page header: Scan passport and the bell (.quick) sit with the page buttons; on phones they move to the top right */
.quick { display: contents; }

/* Phones: every module compact and lined up like the Dashboard */
@media (max-width: 760px) {
  .main { gap: 14px; padding-left: 12px; padding-right: 12px; }
  .stack { gap: 12px; }
  /* Header: title + Scan/bell on one row, page buttons underneath */
  .top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; min-height: 0; position: relative; }
  .top > :first-child { min-width: 0; }
  .top:has(.quick) > :first-child { padding-right: 84px; }
  .top > .tools { grid-column: 1 / -1; gap: 6px; }
  .top > .tools:not(:has(> :not(.quick))) { display: contents; }
  .top .quick { display: flex; gap: 6px; position: absolute; top: 0; right: 0; }
  .top h1 { font-size: 1.25rem; }
  .top .sub { font-size: .76rem; }
  .top .tools .btn { height: 34px; padding: 0 11px; font-size: .8rem; }
  .top .tools .search { flex: 1 1 100%; } .top .tools .search input { width: 100%; }
  .top .tools .seg { max-width: 100%; overflow-x: auto; }
  .top .quick [data-scan] { font-size: 0; width: 36px; height: 36px; padding: 0; gap: 0; }
  .top .quick [data-scan] svg { width: 18px; height: 18px; }
  .top .quick .bell { width: 36px; height: 36px; }
  .td-dashboard .top > :first-child { padding-right: 0; }
  .td-dashboard .top > .tools { grid-column: auto; }
  .td-dashboard .top .quick { position: static; }

  .card > header { padding: 11px 14px; flex-wrap: wrap; }
  .card > header h2 { font-size: .98rem; }
  .card .pad { padding: 14px; }
  .kpis { gap: 10px; }
  .kpi { padding: 12px 10px; gap: 2px; }
  .kpi b { font-size: 1.22rem; }
  .kpi small, .kpi span { font-size: .72rem; }
  .alert { flex-wrap: wrap; font-size: .8rem; }

  /* List rows: date on the left, text beside it, chips and buttons wrap underneath the text */
  .lrow { flex-wrap: wrap; gap: 6px 10px; padding: 10px 14px; align-items: flex-start; }
  .lrow .grow { flex: 1 1 170px; }
  .lrow .grow b { white-space: normal; }
  .lrow .grow span { font-size: .78rem; }
  .lrow:has(> .when) { padding-left: 92px; }
  .lrow > .when { width: 68px; margin-left: -78px; font-size: .78rem; }
  .lrow > .chip, .lrow > .money, .lrow > .btn, .lrow > .muted { align-self: center; }
  .lrow > .money { margin-left: auto; font-weight: 600; }

  /* Tables: each row = title + amount, then the other columns on one line */
  .tablewrap:has(table.t:not(.sheet):not(.planed)) { overflow: visible; }
  table.t:not(.sheet):not(.planed) { display: block; font-size: .8rem; }
  table.t:not(.sheet):not(.planed) thead { display: none; }
  table.t:not(.sheet):not(.planed) tbody { display: block; }
  table.t:not(.sheet):not(.planed) tr { display: flex; flex-wrap: wrap; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
  table.t:not(.sheet):not(.planed) tr:last-child { border-bottom: 0; }
  table.t:not(.sheet):not(.planed) tr::after { content: ""; order: 2; flex-basis: 100%; height: 3px; }
  table.t:not(.sheet):not(.planed) td { display: block; padding: 0; border: 0; order: 3; color: var(--muted); text-align: left; }
  table.t:not(.sheet):not(.planed) td:first-child { order: 0; flex: 1 1 0; min-width: 55%; color: var(--ink); font-weight: 600; font-size: .86rem; }
  table.t:not(.sheet):not(.planed) td.ph-m { order: 1; margin-left: 12px; color: var(--ink); font-weight: 600; font-size: .86rem; white-space: nowrap; }
  table.t:not(.sheet):not(.planed) td.ph-x { display: none; }
  table.t:not(.sheet):not(.planed) td.ph-s::after { content: "·"; margin: 0 6px; color: var(--line); font-weight: 700; }
  table.t:not(.sheet):not(.planed) td[data-lbl]::before { content: attr(data-lbl) " "; font-size: .72rem; }
  table.t:not(.sheet):not(.planed) td .chip { margin: 1px 2px 1px 0; }
  table.t:not(.sheet):not(.planed) td .btn.sm { height: 28px; margin-top: 4px; }
  table.t:not(.sheet):not(.planed) tr.ph-one td { order: 0; flex: 1 1 100%; }
}
@media (max-width: 760px) {
  table.t:not(.sheet):not(.planed) td.ph-a { order: 4; margin-left: auto; padding-left: 8px; display: flex; gap: 6px; }
  table.t:not(.sheet):not(.planed) td.ph-a .btn.sm { margin-top: 0; height: 26px; }
}
@media (max-width: 760px) {
  table.t:not(.sheet):not(.planed) td:has(> .bar) { display: inline-flex; align-items: center; gap: 6px; }
  table.t:not(.sheet):not(.planed) td > .bar { width: 54px; margin: 0; }
  table.t:not(.sheet):not(.planed) td.ph-s::after { color: var(--muted); opacity: .6; }
}
@media (max-width: 760px) { .top > .btn:first-child { justify-self: start; padding-left: 4px; } }

/* Phones with a notch (iPhone app): keep the top bar and drawers below the status bar. */
@media (max-width: 900px) {
  .side, .app .side { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
}
.drawer { padding-top: env(safe-area-inset-top, 0px); }

/* Stable Occupancy + Horse Registry: toolbar, stall cards, horse cards */
.sttools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; }
.sttools .search input { width: 260px; }
.sttools select.in { width: auto; min-width: 170px; max-width: 260px; }
.sttools #st-count, .sttools #h-count { margin-left: auto; font-size: .82rem; }
.st-meter { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.st-meter i { display: block; width: 90px; height: 6px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.st-meter em { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.stgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; padding: 14px; }
.st { position: relative; display: flex; flex-direction: column; gap: 3px; min-height: 108px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.st.busy { border-top: 3px solid var(--accent); }
.st.busy.away { border-top-color: var(--blue, #3b82f6); }
.st.iso { border-top-color: var(--idle, #b7791f); }
.st.free { border-style: dashed; background: var(--surface-2); }
.st-top { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.st-no { font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); background: var(--sunk); border-radius: 6px; padding: 2px 7px; }
.st-kind { font-size: .68rem; color: var(--muted); }
.st-acts { margin-left: auto; display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.st:hover .st-acts, .st:focus-within .st-acts { opacity: 1; }
.st-acts .iconbtn { width: 26px; height: 26px; }
.st-acts .iconbtn svg { width: 15px; height: 15px; }
.st-horse { font-weight: 650; font-size: .9rem; line-height: 1.25; color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.st-horse:hover { color: var(--accent); }
.st-owner { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 4px; }
.st-tags .chip { width: auto; }
.st-free { margin: auto 0; text-align: center; color: var(--muted); font-size: .84rem; }
.hcard .hc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hcard .hc-top b { flex: 1; min-width: 0; }
.hc-stall { flex: none; font-size: .7rem; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; }
.hcard small.hc-barn { color: var(--ink); font-style: italic; }
.hcard small.hc-owner { display: flex; align-items: center; gap: 5px; }
.hc-owner svg { width: 13px; height: 13px; flex: none; }
.hc-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
@media (max-width: 760px) {
  .sttools { padding: 10px; } .sttools .search, .sttools .search input, .sttools select.in { width: 100%; max-width: none; flex: 1 1 100%; }
  .sttools #st-count, .sttools #h-count { margin-left: 0; }
  .stgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .st-acts { opacity: 1; }
  .st-meter i { width: 60px; }
}

/* Show / hide password (pwtoggle.js) */
.pwwrap { position: relative; display: block; }
.pwwrap > input.in { width: 100%; padding-right: 42px; }
.pweye { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 34px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.pweye:hover, .pweye[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }

/* Account box button, staff logins */
button.bizname { font: inherit; color: inherit; cursor: pointer; text-align: left; width: auto; }
button.bizname:hover { border-color: var(--accent); }
button.sv-menu-account { font: inherit; color: inherit; border: 0; background: none; text-align: left; cursor: pointer; width: 100%; }
.warnx { color: var(--warn); font-weight: 600; }

/* Yard jobs */
.ctoolsrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 14px; }
.ctoolsrow .field { margin: 0; }
.joblist { display: grid; }
.jobrow { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.joblist .jobrow:first-child { border-top: 0; }
.jobtick { flex: none; width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: #fff; padding: 0; }
.jobtick svg { width: 20px; height: 20px; }
.jobtick:hover:not(:disabled) { border-color: var(--ok); }
.jobtick[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.jobtick:disabled { cursor: default; opacity: .55; }
.jobmain { flex: 1; min-width: 0; display: grid; gap: 4px; }
.jobtitle { display: flex; gap: 8px; align-items: baseline; font-weight: 600; }
.jobat { font-variant-numeric: tabular-nums; color: var(--accent); }
.jobrow.done .jobtitle span { color: var(--muted); text-decoration: line-through; }
.jobmeta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--muted); font-size: .8rem; }
.jobdone { color: var(--ok); font-size: .8rem; font-weight: 600; }
.jobfeed summary { cursor: pointer; color: var(--accent); font-size: .82rem; font-weight: 600; }
.jobfeed table { margin-top: 6px; }
@media (max-width: 640px) { .jobrow { padding: 12px; } .jobtick { width: 40px; height: 40px; } }

/* Import pop-up: the check-before-import list */
.impsum { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 14px; }
.impsum div { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.impsum b { font-size: 1.15rem; } .impsum small { color: var(--muted); font-size: .72rem; }
.imptable td { padding: 8px 10px; font-size: .82rem; }
.imptable th { padding: 8px 10px; position: sticky; top: 0; z-index: 1; }
.imptable td:last-child { min-width: 260px; white-space: normal; }
.imptable td:last-child .chip { margin-right: 4px; }

/* Small photo thumbnails (owner updates sent) */
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }

/* ================= Subscription status page (same layout in every Nexvora app) ================= */
.sub-page { display: grid; gap: 18px; min-width: 0; }
.sub-page > * { min-width: 0; }
.sub-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sub-title h2 { margin: 0; font-size: 1.45rem; font-weight: 700; color: var(--ink); }
.sub-title p { margin: 0; color: var(--muted); font-size: .92rem; }
.sub-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sub-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 12px); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sub-card > h3, .sub-sec { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink); }
.sub-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sub-card-head h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink); }
.sub-planname { font-size: 1.35rem; font-weight: 700; line-height: 1.25; color: var(--ink); }
.sub-meta { margin: 0; color: var(--muted); font-size: .88rem; }
.sub-meta b { color: var(--ink); font-weight: 600; }
.sub-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 10px; }
.sub-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px; padding: 10px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.sub-tile small { font-size: .76rem; color: var(--muted); line-height: 1.25; }
.sub-tile b { font-size: 1.3rem; line-height: 1.35; color: var(--ink); font-weight: 700; }
.sub-tile.full b { color: var(--crit); }
.sub-amount { font-size: 1.9rem; font-weight: 700; line-height: 1.25; color: var(--ink); }
.sub-amount small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.sub-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .88rem; color: var(--ink); }
.sub-lines li { display: flex; justify-content: space-between; gap: 12px; }
.sub-lines li span:last-child { white-space: nowrap; color: var(--muted); }
.sub-foot { margin-top: auto; padding-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.sub-tabs button { background: none; border: 0; border-radius: 8px 8px 0 0; padding: 10px 16px; font: inherit; font-weight: 600; font-size: .92rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.sub-tabs button:hover { color: var(--ink); }
.sub-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.sub-tabpane { display: grid; gap: 16px; min-width: 0; }
.sub-tabpane[hidden] { display: none; }
.sub-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sub-toolbar .hint { margin: 0; }
.sub-cycle { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.sub-cycle button { background: none; border: 0; border-radius: 8px; padding: 7px 14px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.sub-cycle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.sub-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 0 14px; }
.sub-plan { display: grid; grid-row: span var(--rows, 6); grid-template-rows: subgrid; row-gap: 12px; margin-bottom: 14px; padding: 0 16px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 12px); overflow: hidden; min-width: 0; }
@supports not (grid-template-rows: subgrid) { .sub-plan { display: flex; flex-direction: column; grid-row: auto; } }
.sub-plan.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sub-ribbon { margin: 0 -16px; min-height: 24px; padding: 3px 8px; font-size: .76rem; font-weight: 700; text-align: center; line-height: 18px; }
.sub-plan.current .sub-ribbon { background: var(--accent-soft); color: var(--accent); }
.sub-plan.best .sub-ribbon { background: var(--warn-soft, rgba(180, 83, 9, .12)); color: var(--warn); }
.sub-plan h3 { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.sub-price { font-size: 1.75rem; font-weight: 700; line-height: 1.2; color: var(--accent); }
.sub-price small { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); margin-top: 2px; }
.sub-pnote { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.sub-cta { display: grid; gap: 8px; justify-items: center; align-content: start; }
.sub-cta .btn { width: 100%; justify-content: center; }
.sub-cta .btn[disabled] { opacity: .55; cursor: not-allowed; }
.sub-link { background: none; border: 0; padding: 0; font: inherit; font-size: .84rem; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.sub-outgrown { width: 100%; padding: 6px 8px; font-size: .78rem; line-height: 1.35; border-radius: 8px; background: var(--warn-soft, rgba(180, 83, 9, .12)); color: var(--warn); text-align: center; }
.sub-limits { display: grid; gap: 6px; align-content: start; border-top: 1px solid var(--line); padding-top: 12px; font-size: .86rem; color: var(--ink); }
.sub-limits div { display: flex; justify-content: space-between; gap: 10px; }
.sub-limits b { font-weight: 700; text-align: right; }
.sub-limits p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.sub-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; align-content: start; font-size: .85rem; color: var(--ink); }
.sub-feats li { display: flex; justify-content: space-between; gap: 10px; }
.sub-feats li::after { content: "✓"; flex: none; color: var(--accent); font-weight: 700; }
.sub-feats li.off { color: var(--muted); opacity: .65; }
.sub-feats li.off::after { content: "–"; color: var(--muted); }
.sub-plan .featList li { justify-content: space-between; }
.sub-plan .featList li::before { content: none; }
.sub-plan .featList li::after { content: "✓"; flex: none; color: var(--accent); font-weight: 700; }
.sub-plan .featList li.off::after { content: "–"; color: var(--muted); font-weight: 600; }
.sub-plan .featList li.grp::after, .sub-plan .featList li.none::after { content: none; }
.sub-plan .addonLine { align-self: end; }
.sub-strip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 12px); padding: 16px 20px; text-align: center; }
.sub-strip h3 { margin: 0 0 10px; font-size: 1rem; font-weight: 700; color: var(--ink); }
.sub-strip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: .86rem; color: var(--ink); }
.sub-strip li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 6px; }
.sub-more { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: center; background: linear-gradient(120deg, var(--accent-soft), transparent 70%), var(--surface); border: 1px solid var(--line); border-radius: var(--r, 12px); padding: 24px 26px; }
.sub-more h3 { margin: 0 0 6px; font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.sub-more p { margin: 0 0 14px; color: var(--ink); font-size: .92rem; line-height: 1.5; }
.sub-more ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sub-more li { padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: .86rem; font-weight: 600; color: var(--ink); }
.sub-info { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: .9rem; }
.sub-info dt { color: var(--muted); }
.sub-info dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.sub-links { display: flex; gap: 16px; flex-wrap: wrap; }
.sub-tablewrap { overflow-x: auto; }
.sub-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.sub-table th { text-align: left; font-size: .76rem; font-weight: 700; color: var(--muted); padding: 6px 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sub-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.sub-table tr:last-child td { border-bottom: 0; }
.sub-table .n { text-align: right; white-space: nowrap; }
.sub-table .sub-for { display: block; color: var(--muted); font-size: .8rem; }
.sub-empty { margin: 0; color: var(--muted); font-size: .88rem; }
.sub-alert { padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--line); font-size: .9rem; color: var(--ink); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sub-howto summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: .95rem; }
@media (max-width: 760px) {
  .sub-top, .sub-more { grid-template-columns: minmax(0, 1fr); }
  .sub-plans { grid-template-columns: minmax(0, 1fr); }
  .sub-ribbon:empty { min-height: 0; padding: 0; }
  .sub-info { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .sub-info dd { margin-bottom: 8px; }
}

/* One plan: a club linked with HRView or BookView, or on a lump sum */
.sub-plans.one { grid-template-columns: minmax(0, 560px); justify-content: center; }
.sub-plans.one .sub-plan { grid-template-rows: auto; grid-row: auto; }
.sub-plan .sub-lines s { margin-right: 4px; }

/* Calendar panel (datepicker.js) */
@media (pointer: fine) {
  input[type="date"] { cursor: pointer; padding-right: 34px; 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='%23667788' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
  input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
}
.dp { position: fixed; z-index: 1100; width: 304px; max-width: calc(100vw - 16px); padding: 14px; display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 32, 63, .18); font-family: var(--f-body); animation: tp-in .12s ease-out; }
.dp button { font-family: var(--f-body); cursor: pointer; }
.dp-head { display: flex; align-items: center; gap: 6px; }
.dp-nav { width: 34px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 1.1rem; line-height: 1; }
.dp-nav:hover { border-color: var(--accent); color: var(--accent-ink); }
.dp-title { flex: 1; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--navy); font-size: .95rem; font-weight: 700; }
button.dp-title:hover { background: var(--accent-soft); color: var(--accent-ink); }
.dp-heads, .dp-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-heads span { text-align: center; font-size: .68rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); padding: 2px 0; }
.dp-days { display: grid; gap: 2px; }
.dp-row { border-radius: 9px; }
.dp-row button { height: 36px; border: 0; border-radius: 9px; background: none; color: var(--ink); font-size: .85rem; font-variant-numeric: tabular-nums; }
.dp-row button:hover { background: var(--accent-soft); color: var(--accent-ink); }
.dp-row button.out { color: var(--muted); opacity: .6; }
.dp-row button.now, .dp-grid button.now { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-row button.on, .dp-grid button.on { background: var(--accent); color: var(--on-accent); font-weight: 700; opacity: 1; }
.dp-week .dp-row:hover { background: var(--accent-soft); }
.dp-week .dp-row:hover button { background: none; color: var(--accent-ink); }
.dp-week .dp-row.on, .dp-week .dp-row.on:hover { background: var(--navy); }
.dp-week .dp-row.on button, .dp-week .dp-row.on:hover button { color: #fff; font-weight: 600; background: none; }
.dp-week .dp-row.on button.out { color: #fff; opacity: .65; }
.dp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dp-grid button { height: 46px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface-2); color: var(--ink); font-size: .88rem; font-weight: 500; }
.dp-grid button:hover { border-color: var(--accent); color: var(--accent-ink); }
.dp button:disabled { opacity: .3; cursor: not-allowed; background: none; color: var(--muted); box-shadow: none; }
.dp-foot { display: flex; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--line-2); }
.dp-foot button { border: 0; background: none; font-size: .8rem; font-weight: 600; color: var(--accent-ink); padding: 6px 8px; border-radius: 6px; }
.dp-foot button:hover { background: var(--accent-soft); }
.dp-trigger { display: inline-flex; align-items: center; gap: 8px; height: 36px; min-width: 186px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: 600 .84rem var(--f-body); cursor: pointer; white-space: nowrap; }
.dp-trigger svg { width: 16px; height: 16px; flex: none; color: var(--accent-ink); }
.dp-trigger:hover { border-color: var(--accent); }
.dp-trigger:disabled { opacity: .6; cursor: progress; }
@media (max-width: 760px) { .dp-trigger { width: 100%; min-width: 0; height: 36px; justify-content: center; padding: 0 6px; font-size: .8rem; overflow: hidden; } .dp-trigger span { overflow: hidden; text-overflow: ellipsis; } }
.td-toolbar p .td-where { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.td-where .flag { width: 18px; height: 12px; }
@media (max-width: 1200px) { .td-toolbar p .td-where { justify-content: flex-start; } }

/* Country flags (flagselect.js) */
.flag { display: inline-block; width: 24px; height: 16px; flex: none; border-radius: 3px; object-fit: fill; vertical-align: -3px; box-shadow: 0 0 0 1px rgba(0, 32, 63, .14); }
.fsel { position: relative; }
.fsel select[hidden] { display: none; }
.fsel-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; }
.fsel-btn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsel-btn i { width: 8px; height: 8px; margin: -3px 3px 0 0; flex: none; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.fsel-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto; margin: 0; padding: 5px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 14px 40px rgba(0, 32, 63, .18); }
.fsel-list[hidden] { display: none; }
.fsel-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: .9rem; color: var(--ink); cursor: pointer; }
.fsel-list li.active { background: var(--accent-soft); color: var(--accent-ink); }
.fsel-list li[aria-selected="true"] { font-weight: 600; }
.setcountry { display: flex; align-items: center; gap: 10px; background: var(--surface-2); }

/* The club's own logo and name (plans with "branded") */
.clubbrand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.clubbrand > span:not(.clublogo) { min-width: 0; display: grid; gap: 2px; }
.clubbrand small { font-size: .68rem; color: var(--muted); }
.clubname { font-family: var(--f-brand); font-weight: 800; font-size: 1rem; line-height: 1.2; letter-spacing: -.01em; color: var(--navy); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.clublogo { width: 42px; height: 42px; flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line-2); }
.clublogo.ini { display: grid; place-items: center; background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 700; font-size: .9rem; }
.clublogo.lg { width: 76px; height: 76px; border-radius: 14px; }
.clublogo.lg.ini { font-size: 1.4rem; }
.logoset { display: flex; align-items: center; gap: 14px; }
.sv-menu-by { margin: 0; text-align: center; font-size: .72rem; color: var(--muted); }
.po-by { font-size: .7rem; color: var(--muted); }
@media (max-width: 760px) {
  .brand.clubbrand .clublogo { width: 32px; height: 32px; border-radius: 8px; }
  .brand.clubbrand .clublogo.ini { font-size: .72rem; }
  .brand.clubbrand .clubname { font-size: .92rem; -webkit-line-clamp: 1; }
}
.fsel-btn, .setcountry { min-height: 36px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.setcountry { background: var(--surface-2); }
.fsel-btn:hover { border-color: var(--accent); }
.po-brand.clubbrand { margin-bottom: 16px; }
