/* TieBond Admin — iOS 27 (Liquid Glass) on the phone, macOS 27 Golden Gate on desktop.
   Colours: Apple's system colours (macOS 27.2 values measured on this Mac; iOS 27 uses the same set). */

/* ---------- tokens: iOS (phone) ---------- */
:root {
  --bg: #f2f2f7; --card: #ffffff; --sheet: #f2f2f7; --sheet-card: #ffffff;
  --text: #000000; --text2: rgba(60, 60, 67, 0.6); --text3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.29); --fill: rgba(120, 120, 128, 0.16); --fill2: rgba(120, 120, 128, 0.12);
  --accent: #0088ff; --accent-soft: rgba(0, 136, 255, 0.14);
  --red: #ff383c; --green: #34c759; --green-text: #248a3d; --orange: #ff8d28; --orange-text: #c55300;
  --glass: rgba(255, 255, 255, 0.62); --glass-edge: rgba(255, 255, 255, 0.75); --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  --scrim: rgba(0, 0, 0, 0.32);
  --radius: 26px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1c1c1e; --sheet: #1c1c1e; --sheet-card: #2c2c2e;
    --text: #ffffff; --text2: rgba(235, 235, 245, 0.6); --text3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.65); --fill: rgba(118, 118, 128, 0.24); --fill2: rgba(118, 118, 128, 0.18);
    --accent: #0091ff; --accent-soft: rgba(0, 145, 255, 0.2);
    --red: #ff4245; --green: #30d158; --green-text: #30d158; --orange: #ff9230; --orange-text: #ff9230;
    --glass: rgba(44, 44, 46, 0.58); --glass-edge: rgba(255, 255, 255, 0.16); --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
    --scrim: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
/* ---------- tokens: macOS (desktop) ---------- */
html.mac {
  --bg: #ffffff; --card: #f7f7f7; --sheet: #ffffff; --sheet-card: #f7f7f7; --sidebar: #ececec; --sidebar-edge: #d4d4d4; --select: #d4d4d5;
  --text: rgba(0, 0, 0, 0.847); --text2: rgba(0, 0, 0, 0.498); --text3: rgba(0, 0, 0, 0.259);
  --sep: #e5e5e5; --card-edge: rgba(0, 0, 0, 0.07); --fill: rgba(0, 0, 0, 0.06); --fill2: rgba(0, 0, 0, 0.04); --alt: #f4f5f5;
  --accent: #007aff; --accent-soft: rgba(0, 122, 255, 0.12);
  --red: #ff383c; --green: #34c759; --green-text: #1f8a3a; --orange: #ff8d28; --orange-text: #c55300;
  --glass: rgba(246, 246, 246, 0.8); --glass-edge: rgba(255, 255, 255, 0.7); --glass-shadow: 0 10px 34px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.18);
  --scrim: rgba(0, 0, 0, 0.12);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  html.mac:not([data-theme="light"]) {
    --bg: #1e1e1e; --card: #252525; --sheet: #2a2a2a; --sheet-card: #323232; --sidebar: #272727; --sidebar-edge: #414141; --select: #464646;
    --text: rgba(255, 255, 255, 0.847); --text2: rgba(255, 255, 255, 0.549); --text3: rgba(255, 255, 255, 0.247);
    --sep: #2f2f2f; --card-edge: rgba(255, 255, 255, 0.06); --fill: rgba(255, 255, 255, 0.08); --fill2: rgba(255, 255, 255, 0.05); --alt: rgba(255, 255, 255, 0.047);
    --accent: #007aff; --accent-soft: rgba(0, 122, 255, 0.22);
    --red: #ff4245; --green: #30d158; --green-text: #30d158; --orange: #ff9230; --orange-text: #ff9230;
    --glass: rgba(40, 40, 40, 0.82); --glass-edge: rgba(255, 255, 255, 0.12); --glass-shadow: 0 12px 38px rgba(0, 0, 0, 0.55), 0 0 0 0.5px rgba(0, 0, 0, 0.6);
    --scrim: rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 17px/1.3 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.012em; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
html.mac body { font-size: 13px; line-height: 16px; letter-spacing: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--green-text); } .neg { color: var(--red); } .warn { color: var(--orange-text); } .muted { color: var(--text2); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
svg { display: block; }

/* ---------- Liquid Glass (controls and navigation only — never content) ---------- */
.gbtn, .tabbar, .alert, .as-group, .as-cancel, .cmenu {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(190%); backdrop-filter: blur(16px) saturate(190%);
  box-shadow: var(--glass-shadow), inset 0 0.5px 0 var(--glass-edge), inset 0 0 0 0.5px var(--glass-edge);
}
@media (prefers-reduced-transparency: reduce) {
  .gbtn, .tabbar, .alert, .as-group, .as-cancel, .cmenu { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* glass button (iOS nav bar / sheet bar) */
.gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; min-width: 44px; padding: 0 16px; border: 0; border-radius: 999px;
  color: var(--text); font-size: 17px; font-weight: 500; white-space: nowrap; transition: transform .2s, background .2s;
}
.gbtn.round { width: 44px; padding: 0; }
.gbtn svg { width: 21px; height: 21px; stroke-width: 2.1; }
.gbtn:active { transform: scale(1.08); }
.gbtn.prominent { background: var(--accent); color: #fff; }
.gbtn:disabled { color: var(--text3); }

/* pop-up / pull-down button around a real <select> */
.popup { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.popup select { -webkit-appearance: none; appearance: none; border: 0; background: none; padding: 0 20px 0 0; outline: none; cursor: pointer; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.popup .pop-ic { position: absolute; right: 0; width: 15px; height: 15px; pointer-events: none; stroke-width: 2.2; opacity: 0.7; }
.popup.gbtn { padding: 0 14px 0 16px; }
.popup.gbtn select { font-size: 15px; font-weight: 500; height: 44px; padding-right: 22px; }
.popup.gbtn .pop-ic { right: 12px; }

/* ---------- iOS shell ---------- */
html.ios .main { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.navbar { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); }
.navbar::before { /* scroll edge effect: soft blur that fades out downward */
  content: ""; position: absolute; inset: 0 0 -18px; opacity: 0; transition: opacity .2s; pointer-events: none;
  background: linear-gradient(var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 60%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent);
}
.navbar.scrolled::before { opacity: 1; }
.nb-in { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 56px; padding: 0 16px; }
.nb-lead { display: flex; justify-content: flex-start; }
.nb-trail { display: flex; justify-content: flex-end; gap: 8px; min-width: 0; }
.nb-title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 200px); opacity: 0; transition: opacity .18s; pointer-events: none; }
.navbar:not(.inline) .nb-title { visibility: hidden; }
.navbar.inline .nb-title { opacity: 1; }
.page-head { padding: 0 16px; }
h1.large { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.01em; margin: 2px 0 10px; }
.searchbar { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; margin: 0 0 6px; border-radius: 999px; background: var(--fill); color: var(--text2); }
.searchbar svg { width: 17px; height: 17px; flex: none; }
.searchbar input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; color: var(--text); }
.searchbar input::-webkit-search-decoration { -webkit-appearance: none; }
html.ios .page { padding: 0 16px; }


/* ---------- macOS Golden Gate shell ---------- */
/* window, sidebar, panes: the kit's mac-shell.css (sidebar | content, each pane scrolls under its own glass toolbar) */
.sb-brand { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px; margin-bottom: 6px; font-weight: 700; font-size: 13px; }
.sb-brand img { width: 22px; height: 22px; border-radius: 5px; }
.sb-sec + .sb-sec { margin-top: 12px; }
.sb-h { font-size: 11px; font-weight: 700; color: var(--text2); padding: 2px 8px 4px; }
.sb-link { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 8px; border-radius: 6px; color: var(--text); font-size: 13px; }
.sb-link svg { width: 16px; height: 16px; color: var(--accent); stroke-width: 1.9; flex: none; }
.sb-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-link.on { background: var(--select); }
.toolbar {
  display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 14px 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--sep);
}
.toolbar .spacer { flex: 1; }
.tb-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.tb-items { display: flex; align-items: center; gap: 6px; }
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 30px; height: 30px; padding: 0 7px; border: 0; border-radius: 999px;
  background: none; color: var(--text2); font-size: 13px; font-weight: 500; }
.tb-btn svg { width: 17px; height: 17px; stroke-width: 1.9; }
.tb-btn:hover { background: var(--fill); color: var(--text); }
.tb-btn.text { padding: 0 12px; color: var(--text); background: var(--fill2); }
.tb-btn.prominent { background: var(--accent); color: #fff; padding: 0 10px; }
.tb-btn.prominent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: #fff; }
.tb-pop { height: 30px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--fill2); }
.tb-pop:hover { background: var(--fill); }
.tb-pop select { font-size: 13px; height: 30px; padding-right: 18px; }
.tb-pop .pop-ic { right: 9px; width: 12px; height: 12px; }
.tb-search { display: flex; align-items: center; gap: 5px; width: 210px; height: 30px; padding: 0 10px; margin-left: 4px; border-radius: 999px; background: var(--fill2); color: var(--text2); }
.tb-search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.tb-search svg { width: 14px; height: 14px; flex: none; }
.tb-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 13px; color: var(--text); }
html.mac .page { max-width: 1040px; margin: 0 auto; padding: 8px 28px 0; }

/* ---------- grouped lists (iOS inset grouped / macOS grouped form) ---------- */
.section-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 24px 16px 7px; font-size: 13px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.02em; }
.section-h > span:empty { display: none; }
.section-h a { text-transform: none; font-size: 15px; letter-spacing: 0; }
.section-h > :last-child:not(:first-child) { text-transform: none; letter-spacing: 0; }
.section-f { font-size: 13px; color: var(--text2); margin: 7px 16px 0; }
.section-f:empty { display: none; }
.group { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.group:empty { display: none; }
.group > * { position: relative; }
.group > * + *::before { content: ""; position: absolute; z-index: 2; top: 0; left: 16px; right: 20px; border-top: 0.5px solid var(--sep); pointer-events: none; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 16px; border: 0; background: var(--card); color: var(--text); text-align: left; }
a.row, button.row { cursor: pointer; }
a.row:active, button.row:active { background: color-mix(in srgb, var(--card) 80%, var(--text3)); }
.row .grow { flex: 1; min-width: 0; }
.row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 15px; color: var(--text2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { flex: none; text-align: right; max-width: 55%; }
.row .end > .num:first-child { color: var(--text2); }
.row .end b, .row .end .pos, .row .end .neg, .row .end .warn { font-weight: 600; }
.row .chev { width: 8px; height: 13px; color: var(--text3); flex: none; margin-left: -2px; }
.row.note { justify-content: center; color: var(--text2); font-size: 15px; }
.row.action { color: var(--accent); gap: 10px; }
.row.action.destructive { color: var(--red); }
.row .ar-ic { width: 21px; height: 21px; }
.row.add-row { color: var(--accent); gap: 12px; }
.add-ic { width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; }
.add-ic svg { width: 14px; height: 14px; stroke-width: 3; }
.icon-dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 700; font-size: 14px; }
.icon-dot svg { width: 18px; height: 18px; }
.c-red { background: #ff383c; } .c-blue { background: #0088ff; } .c-gray { background: #8e8e93; } .c-green { background: #34c759; }
.c-orange { background: #ff8d28; } .c-purple { background: #cb30e0; } .c-teal { background: #0093a0; }

/* separators start after a leading icon (iOS) */
.group > * + .row:has(> .icon-dot)::before, .group > * + .sw:has(.icon-dot)::before { left: 60px; }
html.ios .row:has(> .icon-dot) { min-height: 58px; }
html.ios .row.add-row, html.ios .row.action { min-height: 52px; }

/* ---------- swipe actions (iOS) ---------- */
.sw { overflow: hidden; }
.sw > .row { position: relative; z-index: 1; touch-action: pan-y; transition: transform .3s cubic-bezier(.32,.72,0,1); }
.sw-acts { position: absolute; inset: 0 0 0 auto; display: flex; opacity: 0; }
.sw-btn { border: 0; min-width: 88px; padding: 0 16px; color: #fff; font-size: 15px; font-weight: 600; background: var(--text2); }
.sw-btn.red { background: var(--red); }

/* ---------- empty state (ContentUnavailableView) ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 24px 40px; color: var(--text2); }
.empty-state > svg { width: 52px; height: 52px; stroke-width: 1.4; margin-bottom: 14px; }
.es-title { font-size: 22px; font-weight: 700; color: var(--text); }
.es-msg { font-size: 15px; margin-top: 6px; max-width: 320px; }
.empty-state .btn-tinted { margin-top: 18px; }
.btn-tinted { display: inline-flex; align-items: center; height: 36px; padding: 0 18px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 600; border: 0; }
.btn-prominent { display: inline-flex; align-items: center; justify-content: center; height: 52px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; }
.btn-prominent.block { width: 100%; }
.btn-prominent:disabled { opacity: 0.5; }
.loading { padding: 70px 0; display: grid; place-items: center; }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--fill); border-top-color: var(--text2); border-radius: 50%; display: inline-block; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- forms (inside sheets) ---------- */
.field { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; background: var(--card); }
.field > .flabel { flex: none; width: 40%; max-width: 190px; }
.field > input, .field > textarea, .field .f-pop select {
  flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 13px 0; text-align: right; font-size: 17px; color: var(--text);
}
.field .f-pop { flex: 1; justify-content: flex-end; color: var(--text2); }
.field .f-pop select { text-align: right; text-align-last: right; color: var(--text2); padding-right: 22px; }
.field > input[type="date"] { color: var(--accent); }
.field > input[type="date"]::-webkit-date-and-time-value { text-align: right; }
.field .unit { color: var(--text2); flex: none; }
.field.stack { flex-direction: column; align-items: stretch; padding-top: 4px; }
.field.stack textarea { text-align: left; resize: vertical; min-height: 66px; padding: 10px 0; }
input::placeholder, textarea::placeholder { color: var(--text3); }
.switch { position: relative; display: inline-block; width: 63px; height: 28px; margin-left: auto; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--fill); transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 37px; height: 24px; border-radius: 999px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s cubic-bezier(.32,.72,0,1); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(22px); }

.seg-wrap { margin: 4px 0 12px; }
.seg { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--fill); }
.seg button { flex: 1; height: 32px; border: 0; border-radius: 999px; background: none; font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--text); }
.seg button.on { background: var(--card); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 0 0 0.5px rgba(0,0,0,.04); }

/* line editor (items in a sale, materials in a batch / recipe) */
.line { padding: 10px 16px 12px; background: var(--card); }
.line-top { display: flex; align-items: center; gap: 8px; }
.line-pop { flex: 1; color: var(--text); }
.line-pop select { width: 100%; font-size: 17px; font-weight: 600; padding: 4px 22px 4px 0; }
.rm { flex: none; display: grid; place-items: center; padding: 4px; border: 0; background: none; color: var(--red); }
.rm svg { width: 22px; height: 22px; }
.line-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.line-grid.two { grid-template-columns: 1fr 1fr; }
.mini { display: flex; flex-direction: column; min-width: 0; padding: 6px 10px; border-radius: 12px; background: var(--fill2); }
.mini span { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini input { width: 100%; min-width: 0; border: 0; background: none; outline: none; padding: 1px 0; font-size: 17px; }
.mini b { padding: 1px 0; font-size: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-note { margin-top: 6px; font-size: 13px; color: var(--text2); }

/* ---------- home ---------- */
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 6px; }
.quick a { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 20px; background: var(--card); color: var(--text); font-size: 15px; font-weight: 600; }
.quick a:active { background: color-mix(in srgb, var(--card) 80%, var(--text3)); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { min-width: 0; padding: 12px 14px; border-radius: 20px; background: var(--card); }
.kpi .k { font-size: 13px; font-weight: 600; color: var(--text2); }
.kpi .v { margin-top: 4px; font-size: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { margin-top: 2px; font-size: 13px; color: var(--text2); }
.kpis.two { margin-top: 6px; }
.bar-row { padding: 10px 16px; background: var(--card); }
.bar-row .lbl { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.bar-row .lbl span:last-child { white-space: nowrap; }
.bar { height: 6px; margin-top: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

/* ---------- detail screens ---------- */
.hero { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 6px 0 18px; text-align: center; }
.hero .big { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.hero .cap { font-size: 15px; color: var(--text2); }
.doc-table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); }
.doc-table th { padding: 10px 16px 6px; text-align: left; font-size: 13px; font-weight: 500; color: var(--text2); }
.doc-table td { padding: 9px 16px; border-top: 0.5px solid var(--sep); vertical-align: top; }
.doc-table .r { text-align: right; white-space: nowrap; }
.doc-table tfoot td { font-weight: 600; }
.doc-table + .doc-table { border-top: 8px solid var(--bg); }
.print-only { display: none; }
.contact-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4px 0 16px; text-align: center; }
.avatar { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; margin-bottom: 6px;
  background: linear-gradient(#a5abb8, #858994); color: #fff; font-size: 34px; font-weight: 600; letter-spacing: 0.02em; }
.ch-name { font-size: 28px; font-weight: 700; }
.ch-sub { font-size: 15px; color: var(--text2); }
.contact-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-bottom: 16px; }
.ca { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border-radius: 16px; background: var(--card); color: var(--accent); font-size: 12px; font-weight: 500; }
.ca svg { width: 22px; height: 22px; }
.ca:active { background: color-mix(in srgb, var(--card) 80%, var(--text3)); }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 100; background: transparent; transition: background .3s; }
.scrim.in { background: var(--scrim); }
html.ios .sheet {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(env(safe-area-inset-top) + 10px); display: flex; flex-direction: column;
  background: var(--sheet); border-radius: 38px 38px 0 0; transform: translateY(105%); transition: transform .42s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -2px 30px rgba(0,0,0,.18);
}
html.ios .scrim.in .sheet { transform: none; }
.sheet .group, .sheet .row, .sheet .field, .sheet .line, .sheet .doc-table { background: var(--sheet-card); }
.sheet .seg button.on { background: var(--sheet-card); }
html.ios .sheet-head { position: relative; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; padding: 14px 16px 10px; touch-action: none; }
.sheet-title { text-align: center; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ios .sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 16px calc(40px + env(safe-area-inset-bottom)); }
html.ios .sheet-body > div > .group:first-child, html.ios .sheet-body > div > .seg-wrap:first-child { margin-top: 8px; }

html.mac .sheet-scrim { display: flex; justify-content: center; align-items: flex-start; padding: 60px 20px 20px 252px; }
html.mac .sheet {
  width: 100%; max-width: 560px; max-height: calc(100vh - 90px); display: flex; flex-direction: column; border-radius: 16px; background: var(--sheet);
  box-shadow: 0 22px 70px rgba(0,0,0,.35), 0 0 0 0.5px rgba(0,0,0,.25); opacity: 0; transform: translateY(-14px) scale(.98); transition: opacity .2s, transform .22s cubic-bezier(.32,.72,0,1);
}
html.mac .scrim.in .sheet { opacity: 1; transform: none; }
html.mac .sheet-head { padding: 16px 20px 4px; }
html.mac .sheet-title { text-align: left; font-size: 15px; font-weight: 700; }
html.mac .sheet-body { overflow-y: auto; padding: 4px 20px 16px; }
html.mac .sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--sep); }
.mbtn { height: 28px; min-width: 76px; padding: 0 14px; border-radius: 999px; border: 0; font-size: 13px; font-weight: 500;
  background: var(--sheet-card); color: var(--text); box-shadow: 0 0.5px 1.5px rgba(0,0,0,.25), inset 0 0 0 0.5px var(--card-edge); }
.mbtn.default { background: var(--accent); color: #fff; box-shadow: 0 0.5px 1.5px rgba(0,0,0,.25); }
.mbtn:disabled { opacity: 0.5; }


/* ---------- Mac context menu ---------- */
.cmenu { position: fixed; z-index: 300; min-width: 180px; padding: 5px; border-radius: 10px; }
.cm-item { display: block; width: 100%; height: 24px; padding: 0 10px; border: 0; border-radius: 5px; background: none; color: var(--text); text-align: left; font-size: 13px; }
.cm-item:hover, .cm-item:focus-visible { background: var(--accent); color: #fff; outline: none; }
.cm-item.destructive { color: var(--red); }
.cm-item.destructive:hover { color: #fff; background: var(--red); }
.cm-sep { height: 1px; margin: 5px 10px; background: var(--sep); }

/* ---------- Mac tables ---------- */
.tbl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 18px 2px 8px; color: var(--text2); }
.tbl-head .tbl-h { color: var(--text); font-weight: 700; }
.tbl-wrap { border-radius: 8px; overflow: hidden; border: 1px solid var(--sep); background: var(--bg); }
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.tbl th { position: relative; height: 26px; padding: 0 8px; text-align: left; font-size: 11px; font-weight: 500; color: var(--text2); border-bottom: 1px solid var(--sep); background: var(--bg); cursor: default; user-select: none; white-space: nowrap; }
.tbl th > span { vertical-align: middle; }
.tbl th + th::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; border-left: 1px solid var(--sep); }
.tbl th:hover { color: var(--text); background: var(--fill2); }
.tbl th.sorted { color: var(--text); font-weight: 700; }
.tbl th.r { text-align: right; }
.tbl .sort-ic { display: inline-block; width: 11px; height: 11px; margin-left: 3px; vertical-align: middle; stroke-width: 2.6; }
.tbl td { height: 28px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl td.r { text-align: right; }
.tbl td.strong { font-weight: 600; }
.tbl tbody tr:nth-child(even) { background: var(--alt); }
.tbl tbody tr.open { cursor: default; }
.tbl tbody tr:focus-visible { outline: none; background: var(--accent); color: #fff; }
.tbl tbody tr:focus-visible * { color: #fff !important; }
.tbl tbody tr:active { background: var(--select); }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--sep); }

/* ---------- Mac sizes (13 pt body) ---------- */
html.mac .section-h { margin: 22px 2px 7px; font-size: 13px; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; }
html.mac .section-h a { font-size: 13px; font-weight: 400; }
html.mac .section-f { margin: 6px 2px 0; font-size: 11px; line-height: 14px; }
html.mac .group { border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-edge); }
html.mac .group > * + *::before { left: 12px; right: 12px; border-top: 1px solid var(--sep); }
html.mac .group > * + .row:has(> .icon-dot)::before { left: 44px; }
html.mac .row { min-height: 38px; padding: 7px 12px; gap: 10px; background: transparent; }
html.mac .row .sub { font-size: 11px; line-height: 14px; }
html.mac a.row:hover, html.mac button.row:hover { background: var(--fill2); }
html.mac .row .chev { width: 6px; height: 10px; }
html.mac .row.note { font-size: 13px; }
html.mac .row .ar-ic { width: 16px; height: 16px; }
html.mac .icon-dot { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
html.mac .icon-dot svg { width: 14px; height: 14px; }
html.mac .add-ic { width: 16px; height: 16px; }
html.mac .add-ic svg { width: 11px; height: 11px; }
html.mac .field { min-height: 38px; padding: 0 12px; background: transparent; }
html.mac .field > input, html.mac .field > textarea, html.mac .field .f-pop select { font-size: 13px; padding: 10px 0; }
html.mac .field .f-pop select { padding-right: 20px; }
html.mac .field .f-pop .pop-ic { width: 12px; height: 12px; }
html.mac .field .f-pop select { color: var(--text); }
html.mac .field .f-pop { color: var(--text); }
html.mac .field > input:focus, html.mac .field.stack textarea:focus { box-shadow: none; }
html.mac .field:focus-within { background: color-mix(in srgb, var(--accent) 6%, transparent); }
html.mac .field.stack textarea { min-height: 52px; }
html.mac .switch { width: 38px; height: 22px; }
html.mac .switch i::after { width: 20px; height: 18px; top: 2px; left: 2px; }
html.mac .switch input:checked + i { background: var(--accent); }
html.mac .switch input:checked + i::after { transform: translateX(14px); }
html.mac .seg { max-width: 360px; }
html.mac .seg button { height: 24px; font-size: 13px; }
html.mac .seg-wrap { margin: 14px 0 6px; }
html.mac .line { padding: 8px 12px 10px; background: transparent; }
html.mac .line-pop select { font-size: 13px; }
html.mac .rm svg { width: 17px; height: 17px; }
html.mac .mini { border-radius: 7px; padding: 4px 8px; }
html.mac .mini span { font-size: 11px; }
html.mac .mini input, html.mac .mini b { font-size: 13px; }
html.mac .line-note { font-size: 11px; }
html.mac .quick { grid-template-columns: repeat(4, 1fr); margin-top: 14px; }
html.mac .quick a { flex-direction: row; align-items: center; border-radius: 10px; font-size: 13px; box-shadow: inset 0 0 0 1px var(--card-edge); }
html.mac .quick a:hover { background: color-mix(in srgb, var(--card) 85%, var(--text3)); }
html.mac .kpis { grid-template-columns: repeat(4, 1fr); }
html.mac .kpi { border-radius: 10px; box-shadow: inset 0 0 0 1px var(--card-edge); }
html.mac .kpi .k { font-size: 11px; }
html.mac .kpi .v { font-size: 22px; line-height: 26px; }
.kpi { container-type: inline-size; }
@container (max-width: 210px) { html .kpi .v, html.mac .kpi .v, html.ios .kpi .v { font-size: clamp(13px, 10.5cqw, 22px); } }
html.mac .kpi .s { font-size: 11px; }
html.mac .kpis.two { grid-template-columns: repeat(4, 1fr); margin-top: 14px; }
html.mac .cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0 22px; align-items: start; }
html.mac .bar-row { padding: 8px 12px; background: transparent; }
html.mac .bar-row .lbl { font-size: 13px; }
html.mac .hero { margin: 18px 0 16px; }
html.mac .hero .big { font-size: 26px; line-height: 32px; }
html.mac .hero .cap { font-size: 13px; }
html.mac .doc-table { font-size: 13px; background: transparent; }
html.mac .doc-table th { padding: 8px 12px 4px; font-size: 11px; }
html.mac .doc-table td { padding: 6px 12px; border-top: 1px solid var(--sep); }
html.mac .doc-table + .doc-table { border-top: 8px solid var(--bg); }
html.mac .contact-head { margin-top: 18px; }
html.mac .avatar { width: 64px; height: 64px; font-size: 26px; }
html.mac .ch-name { font-size: 22px; line-height: 26px; }
html.mac .ch-sub { font-size: 13px; }
html.mac .contact-actions { max-width: 420px; margin: 0 auto 16px; }
html.mac .ca { border-radius: 10px; font-size: 11px; box-shadow: inset 0 0 0 1px var(--card-edge); }
html.mac .ca:hover { background: color-mix(in srgb, var(--card) 85%, var(--text3)); }
html.mac .ca svg { width: 18px; height: 18px; }
html.mac .empty-state { padding: 80px 24px; }
html.mac .empty-state > svg { width: 44px; height: 44px; }
html.mac .es-title { font-size: 17px; line-height: 22px; }
html.mac .es-msg { font-size: 13px; }
html.mac .btn-tinted { height: 28px; font-size: 13px; padding: 0 14px; }
html.mac .tbl-wrap + .section-f { margin-top: 8px; }

/* ---------- login ---------- */
.login { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; }
.login-box { width: 100%; max-width: 380px; text-align: center; }
.login-box img { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.login-box h1 { margin: 16px 0 4px; font-size: 28px; }
.login-box p { margin: 0 0 24px; color: var(--text2); }
.login-box .group { margin-bottom: 14px; text-align: left; }
.login-box .field input { text-align: left; flex: 1; border: 0; background: none; outline: none; padding: 14px 0; font-size: 17px; }
.err { min-height: 1em; margin: 0 4px 12px; font-size: 15px; color: var(--red); }
html.mac .login-box { max-width: 300px; }
html.mac .login-box img { width: 72px; height: 72px; border-radius: 16px; }
html.mac .login-box h1 { font-size: 22px; }
html.mac .login-box .field input { font-size: 13px; padding: 9px 0; }
html.mac .login-box .btn-prominent { height: 32px; font-size: 13px; }
html.mac .err { font-size: 13px; }

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

/* ---------- print (invoice) ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .sidebar, .tabbar, .navbar, .toolbar, .no-print, .scrim { display: none !important; }
  .mac-window, .content, .split, .pane, .scroller { display: block !important; height: auto !important; overflow: visible !important; padding-top: 0 !important; }
  .list-col { display: none !important; }
  html.mac body { overflow: visible; }
  .print-only { display: block; margin-bottom: 12pt; }
  .group, .hero { background: #fff !important; box-shadow: none !important; border: 1px solid #ccc; }
  .page { max-width: none !important; padding: 0 !important; }
}

/* ================= v3 additions ================= */
/* Mac sidebar: titled sections that fold like Mail's mailboxes; chevron appears on hover */
.sb-h { display: flex; align-items: center; width: 100%; height: 26px; border: 0; background: none; text-align: left; border-radius: 6px; cursor: default; }
.sb-h span { flex: 1; }
.sb-chev { width: 12px; height: 12px; stroke-width: 2.4; color: var(--text2); opacity: 0; transform: rotate(90deg); transition: transform .2s, opacity .15s; }
.sb-h:hover .sb-chev, .sb-h:focus-visible .sb-chev, .sb-sec.folded .sb-chev { opacity: 1; }
.sb-sec.folded .sb-chev { transform: none; }
.sb-sec + .sb-sec { margin-top: 10px; }
.mac-window { transition: grid-template-columns .25s cubic-bezier(.32,.72,0,1); }
.mac-window.sb-hidden .sidebar { border: 0; }
html.mac .mac-window.sb-hidden ~ .sheet-scrim, html.mac body:has(.sb-hidden) .sheet-scrim { padding-left: 20px; }

/* icon button over a native <select> (filter button, toolbar pop-up) */
.sel-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.sel-btn select.sel-cover { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; font-size: 16px; }
.sel-btn.gbtn svg { width: 21px; height: 21px; stroke-width: 2.1; }

/* menus: headers, icons, the "+" pull-down */
.cm-head { padding: 4px 10px 2px; font-size: 11px; font-weight: 600; color: var(--text2); }
.cm-item { display: flex; align-items: center; gap: 8px; }
.cm-ic { width: 15px; height: 15px; flex: none; }
.cm-item:disabled { color: var(--text3); background: none; }
.cmenu.pull { transform-origin: top right; animation: menu-in .2s cubic-bezier(.32,.72,0,1); }
@keyframes menu-in { from { opacity: 0; transform: scale(.85); } }

/* library lists (iPhone tabs, like Mail's mailboxes) */
.lib-ic { display: grid; place-items: center; width: 28px; color: var(--accent); flex: none; }
.lib-ic svg { width: 24px; height: 24px; stroke-width: 1.8; }
.group > * + .row.lib::before { left: 56px; }
.row.lib .end .num { color: var(--text2); font-weight: 400; }
.gap { height: 22px; }
html.mac .gap { height: 16px; }

/* Home cards */
a.kpi { display: block; color: var(--text); }
a.kpi:active { background: color-mix(in srgb, var(--card) 80%, var(--text3)); }
html.mac a.kpi:hover { background: color-mix(in srgb, var(--card) 85%, var(--text3)); }
.kpi .s.neg { color: var(--red); } .kpi .s.warn { color: var(--orange-text); }

/* rows */
.row.info { min-height: 44px; }
.row.info .grow { color: var(--text); }
.row.info .end { color: var(--text2); max-width: 62%; overflow-wrap: anywhere; }
.row.info .end.neg { color: var(--red); }
.row.notes { white-space: pre-wrap; align-items: flex-start; }
.row.dim .title, .row.dim .end { color: var(--text2); }
.row.big-row .title { font-weight: 600; }
.row .end .strong { font-weight: 700; color: var(--text); }
.row.profile { min-height: 76px; }
.set-logo { width: 56px; height: 56px; border-radius: 13px; box-shadow: 0 0 0 0.5px var(--sep); flex: none; }
html.mac .set-logo { width: 40px; height: 40px; border-radius: 9px; }
html.mac .row.profile { min-height: 58px; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--fill); color: var(--text2); vertical-align: 1px; }
.badge.red { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.ch-badges { margin-top: 4px; }
.avatar.small { width: 34px; height: 34px; margin: 0; font-size: 14px; flex: none; }
html.mac .avatar.small { width: 26px; height: 26px; font-size: 11px; }
.ca.off { opacity: 0.4; pointer-events: none; }
.list-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.list-foot .section-f { flex: 1; }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 15px; padding: 8px 16px 0; }
html.mac .link-btn { font-size: 13px; padding: 6px 2px 0; }

/* forms */
.field > .flabel.grow { flex: 1; width: auto; max-width: none; }
.flabel .sub { display: block; font-size: 13px; color: var(--text2); }
.num-field { gap: 8px; min-height: 58px; }
.num-field input { border: 0; outline: none; padding: 8px 10px; border-radius: 10px; background: var(--fill2); font-size: 17px; color: var(--text); text-align: right; }
.num-field .pfx { width: 86px; } .num-field .nxt { width: 72px; }
html.mac .num-field { min-height: 44px; }
html.mac .num-field input { font-size: 13px; padding: 4px 8px; border-radius: 6px; }
html.mac .num-field .pfx { width: 70px; } html.mac .num-field .nxt { width: 60px; }
html.mac .flabel .sub { font-size: 11px; }
.sheet-lead { margin: 10px 4px 0; font-size: 15px; color: var(--text2); text-align: center; }
html.mac .sheet-lead { text-align: left; font-size: 13px; margin: 4px 2px 0; }
.del-group { margin-top: 28px; }
.del-group .row.action { justify-content: center; }
html.mac .del-group .row.action { justify-content: flex-start; }
.company-logo { width: 150px; height: 150px; object-fit: contain; border-radius: 22px; background: #fff; box-shadow: 0 0 0 0.5px var(--sep); }
html.mac .company-logo { width: 110px; height: 110px; border-radius: 16px; }

/* sign in */
.login-logo { width: 150px !important; height: 150px !important; object-fit: contain; background: #fff; }
html.mac .login-logo { width: 120px !important; height: 120px !important; }
.row .end > .num.strong { color: var(--text); font-weight: 700; }
.group + .seg-wrap { margin-top: 18px; }
.group + .group, .section-f + .group, .group + .list-foot + .group { margin-top: 22px; }
html.mac .group + .group, html.mac .section-f + .group { margin-top: 16px; }
.group + .del-group { margin-top: 32px; }
/* iOS Safari: keep the sheet solid behind Safari's floating bars and the keyboard bar */
html.ios .sheet::after { content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 1px); height: 100vh; background: var(--sheet); pointer-events: none; }
/* compact date button (iOS / macOS date picker, compact style) */
.dp { position: relative; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.dp-text { padding: 6px 12px; border-radius: 10px; background: var(--fill2); color: var(--text); font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dp.empty .dp-text { color: var(--text2); }
.dp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; cursor: pointer; font-size: 16px; }
.dp-input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.dp:has(.dp-input:focus-visible) .dp-text { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.dp-clear { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--fill); color: var(--text2); }
.dp-clear svg { width: 12px; height: 12px; stroke-width: 2.6; }
.dp.empty .dp-clear { display: none; }
.field .dp { margin: 7px 0 7px auto; }
html.mac .dp-text { padding: 3px 9px; border-radius: 6px; font-size: 13px; }
html.mac .field .dp { margin: 5px 0 5px auto; }
html.mac .dp-clear { width: 16px; height: 16px; } html.mac .dp-clear svg { width: 9px; height: 9px; }

/* ================= macOS 27 Golden Gate — measured 22 Nov 2026 from Finder, System Settings and a native SwiftUI
   NavigationSplitView + Table + Form rendered on this Mac (light + dark). Sizes in pt = CSS px. ================= */
html.mac {
  --bg: #ffffff; --sidebar: #ededed; --sidebar-edge: #d4d4d4; --select: #d7d7d7; --alt: #f4f5f5; --band: #ffffff;
  --card: #f7f7f7; --sheet-card: #f7f7f7; --sep: #ebebeb; --tbl-line: #e5e5e5; --card-edge: transparent;
  --gbtn: #f9f9f9; --gbtn-shadow: 0 1px 4px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.1);
}
@media (prefers-color-scheme: dark) {
  html.mac:not([data-theme="light"]) {
    --bg: #1e1e1e; --sidebar: #262626; --sidebar-edge: #424242; --select: #434343; --alt: #292929; --band: #252525;
    --card: #252525; --sheet-card: #323232; --sep: #2f2f2f; --tbl-line: #3f3f3f;
    --gbtn: #424242; --gbtn-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
  }
}
/* window: sidebar built into the window edge to edge */
.sidebar { padding: 0; background: var(--sidebar); border-right: 1px solid var(--sidebar-edge); }
.sb-top { display: flex; justify-content: flex-end; align-items: center; height: 52px; margin: 0; padding: 0 8px; background: var(--sidebar); }
.sb-sec + .sb-sec { margin-top: 14px; }
.sb-h { height: 24px; padding: 0 4px; font-size: 11px; font-weight: 600; color: var(--text2); }
.sb-link { height: 32px; padding: 0 8px; gap: 8px; border-radius: 8px; font-size: 13px; }
.sb-link svg { width: 18px; height: 18px; stroke-width: 1.7; }
.sb-link.on { background: var(--select); font-weight: 600; }
.mac-window.sb-hidden .sb-show { display: inline-flex; }
.sb-show { display: none; }

/* toolbar: no bar of its own; round Liquid Glass buttons float over the content (52 pt tall) */
.toolbar { height: 52px; gap: 8px; padding: 0 8px; background: transparent; border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.toolbar::before { content: ""; position: absolute; inset: 0 0 -14px; z-index: -1; opacity: 0; pointer-events: none; transition: opacity .2s;
  background: linear-gradient(var(--bg) 55%, color-mix(in srgb, var(--bg) 0%, transparent));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.toolbar.scrolled::before { opacity: 1; }
.toolbar.band, .toolbar.band::before { background: var(--band); }
.toolbar.band::before { inset: 0; -webkit-mask-image: none; mask-image: none; opacity: 1; }
.tb-titles { min-width: 0; padding-left: 6px; }
.tb-title { font-size: 15px; line-height: 18px; font-weight: 700; padding: 0; }
.tb-sub { font-size: 11px; line-height: 13px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-sub:empty { display: none; }
.tb-items { gap: 8px; }
.tb-btn, .tb-pop, .tb-search {
  background: var(--gbtn); box-shadow: var(--gbtn-shadow);
  -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
}
.tb-btn { min-width: 36px; width: 36px; height: 36px; padding: 0; border-radius: 50%; color: var(--text); }
.tb-btn svg { width: 18px; height: 18px; stroke-width: 1.8; }
.tb-btn:hover { background: color-mix(in srgb, var(--gbtn) 88%, var(--text)); color: var(--text); }
.tb-btn.text { width: auto; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--gbtn); }
.tb-btn.prominent { width: 36px; padding: 0; background: var(--accent); color: #fff; box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.tb-btn.prominent svg { stroke-width: 2.2; }
.tb-btn.prominent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.tb-pop { height: 36px; padding: 0 12px 0 14px; border-radius: 999px; }
.tb-pop select { height: 36px; font-size: 13px; }
.tb-search { width: 240px; height: 36px; margin-left: 0; padding: 0 12px; gap: 6px; border-radius: 999px; color: var(--text2); }
.tb-search svg { width: 15px; height: 15px; }
.tb-search input { font-size: 13px; }
@media (prefers-reduced-transparency: reduce) { .tb-btn, .tb-pop, .tb-search { -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* content: cards 20 pt in from the edges, full width like Apple's grouped forms */
html.mac .page { max-width: none; margin: 0; padding: 4px 20px 0; }
html.mac .section-h { margin: 20px 10px 8px; font-size: 13px; font-weight: 700; }
html.mac .section-f { margin: 6px 10px 0; }
html.mac .group { border-radius: 10px; box-shadow: none; background: var(--card); }
html.mac .group > * + *::before { left: 10px; right: 10px; border-top: 1px solid var(--sep); }
html.mac .group > * + .row:has(> .icon-dot)::before { left: 42px; }
html.mac .row, html.mac .field { min-height: 40px; padding: 6px 10px; }
html.mac .field { padding-top: 0; padding-bottom: 0; }
html.mac .group + .group, html.mac .section-f + .group { margin-top: 20px; }
html.mac .kpi, html.mac .quick a, html.mac .ca { box-shadow: none; background: var(--card); }
html.mac .gap { height: 20px; }

/* tables: edge to edge under the toolbar, header without fill, 24 pt rows, inset rounded stripes */
html.mac .page.table-page { padding: 0 10px; }
.tbl-wrap { border: 0; border-radius: 0; overflow: visible; background: transparent; }
.tbl { border-collapse: separate; border-spacing: 0; }
.tbl th { position: sticky; top: 52px; z-index: 3; height: 28px; padding: 0 8px; background: var(--band); border-bottom: 1px solid var(--tbl-line); font-size: 12px; font-weight: 400; color: var(--text2); }
.page:not(.table-page) .tbl th { position: static; background: transparent; }
.table-page .tbl th:first-child { box-shadow: -10px 0 0 var(--band); } .table-page .tbl th:last-child { box-shadow: 10px 0 0 var(--band); }
.tbl th + th::before { top: 7px; bottom: 7px; border-left: 1px solid var(--tbl-line); }
.tbl th:hover { background: var(--band); color: var(--text); }
.page:not(.table-page) .tbl th:hover { background: transparent; }
.tbl th.sorted { color: var(--text); font-weight: 700; }
.tbl td { height: 24px; padding: 0 8px; }
.tbl tbody tr:nth-child(even) { background: none; }
.tbl tbody tr:nth-child(even) td { background: var(--alt); }
.tbl tbody tr td:first-child { border-radius: 6px 0 0 6px; } .tbl tbody tr td:last-child { border-radius: 0 6px 6px 0; }
.tbl tbody tr:first-child td { padding-top: 0; }
.tbl tbody tr.filler { pointer-events: none; }
.tbl tbody tr:focus-visible td { background: var(--accent); color: #fff; }
.tbl tbody tr:focus-visible { background: none; outline: none; }
.tbl tbody tr.open:active td { background: var(--select); }
.page:not(.table-page) .tbl-wrap { margin: 0; }
.table-page > div > .empty-state, .table-page > .empty-state { padding-top: 120px; }
.table-page .list-foot { padding: 0 10px; }
html.mac .sheet-scrim { padding-left: 240px; }
/* iOS 27.3 Settings (measured in the Simulator): 36 pt between cards; the top account card has a bigger bold title */
html.ios .gap { height: 34px; }
html.ios .group + .group { margin-top: 34px; }
html.ios .row.profile { min-height: 96px; gap: 14px; }
html.ios .row.profile .title { font-size: 20px; font-weight: 600; }
html.ios .row.profile .set-logo { width: 64px; height: 64px; border-radius: 15px; }

/* ===== macOS 27 Liquid Glass controls — the GHL Boys Club recipe (measured from Finder 27.2 / 27.3):
   translucent body, bright rim on top, softer rim below, inner lens shading, dark outline and a soft drop shadow ===== */
html.mac {
  --gbtn: rgba(255, 255, 255, 0.45); --gbtn-hover: rgba(255, 255, 255, 0.65); --gblur: blur(8px) saturate(190%);
  --gbtn-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(255, 255, 255, 0.8), inset 0 9px 12px -9px rgba(255, 255, 255, 0.9), inset 0 -9px 12px -9px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.10), 0 3px 10px rgba(0, 0, 0, 0.07);
}
@media (prefers-color-scheme: dark) {
  html.mac:not([data-theme="light"]) {
    --gbtn: rgba(255, 255, 255, 0.13); --gbtn-hover: rgba(255, 255, 255, 0.19); --gblur: blur(8px) saturate(190%) brightness(1.1);
    --gbtn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), inset 0 -1px 0 rgba(255, 255, 255, 0.10), inset 0 9px 12px -9px rgba(255, 255, 255, 0.16), inset 0 -9px 12px -9px rgba(0, 0, 0, 0.22),
      inset 0 0 0 0.5px rgba(255, 255, 255, 0.10), 0 0 0 1px rgba(0, 0, 0, 0.30), 0 3px 10px rgba(0, 0, 0, 0.22);
  }
}
.tb-btn, .tb-pop, .tb-search, .nav-cap, .sbs-field { background: var(--gbtn); box-shadow: var(--gbtn-shadow); -webkit-backdrop-filter: var(--gblur); backdrop-filter: var(--gblur); }
.tb-btn:hover, .tb-pop:hover { background: var(--gbtn-hover); }
.tb-btn.text { background: var(--gbtn); }
.tb-btn.text:hover { background: var(--gbtn-hover); }
.tb-btn.prominent { background: var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -9px 12px -9px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.12), 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
/* glass.interactive(): a press swells and brightens */
.tb-btn, .nav-cap button, .tb-pop { transition: transform .32s cubic-bezier(.34, 1.56, .64, 1), filter .2s ease, background-color .15s; }
.tb-btn:active, .tb-pop:active { transform: scale(1.06); filter: brightness(1.14); transition-duration: .12s; }

/* back / forward capsule (Finder, System Settings) */
.nav-cap { display: inline-flex; align-items: center; height: 36px; border-radius: 999px; flex: none; }
.nav-cap button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; background: none; color: var(--text); border-radius: 999px; }
.nav-cap button svg { width: 18px; height: 18px; stroke-width: 1.9; }
.nav-cap button + button { position: relative; }
.nav-cap button + button::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; border-left: 1px solid var(--sep); opacity: .9; }
.nav-cap button:disabled { color: var(--text3); cursor: default; }
.nav-cap button:not(:disabled):active { transform: scale(1.12); }
.tb-titles { padding-left: 8px; }

/* toolbar: transparent; once content scrolls under it, a frosted band with a hairline (System Settings) */
.toolbar::before { display: none; }
.toolbar { transition: background-color .2s, box-shadow .2s; }
.toolbar.scrolled { background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: 0 1px 0 var(--tbl-line); }
.toolbar.band, .toolbar.band.scrolled { background: var(--band); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }

/* sidebar top row: glass search field beside the sidebar button; the list slides under it */
.sb-top { justify-content: space-between; gap: 8px; padding: 0 10px; background: transparent; }
.sb-search { position: relative; flex: 1; min-width: 0; }
.sbs-field { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px; color: var(--text2); cursor: text; }
.sbs-field:focus-within { box-shadow: var(--gbtn-shadow), 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent); }
.sbs-ic { width: 16px; height: 16px; flex: none; color: var(--text); stroke-width: 1.9; }
.sbs-field input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 13px; color: var(--text); }
.sbs-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sbs-pop { display: none; position: fixed; left: 10px; top: 50px; width: 300px; max-height: 70vh; overflow-y: auto; padding: 6px; border-radius: 14px; z-index: 50;
  background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%); box-shadow: var(--glass-shadow), inset 0 0.5px 0 var(--glass-edge);
  transform-origin: top left; animation: menu-in .16s cubic-bezier(.2, .9, .3, 1); }
.sb-search.open .sbs-pop { display: block; }
.sbs-h { padding: 8px 8px 4px; font-size: 11px; font-weight: 600; color: var(--text2); }
.sbs-row { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 13px; cursor: default; }
.sbs-row.sel { background: var(--accent); color: #fff; }
.sbs-i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; flex: none; background: var(--fill); color: var(--accent); }
.sbs-i svg { width: 14px; height: 14px; }
.sbs-row.sel .sbs-i { background: rgba(255, 255, 255, 0.2); color: #fff; }
.sbs-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbs-s { margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.sbs-row.sel .sbs-s { color: rgba(255, 255, 255, 0.8); }
.sbs-none { padding: 14px; text-align: center; color: var(--text2); font-size: 13px; }
@media (prefers-reduced-transparency: reduce) {
  .tb-btn, .tb-pop, .tb-search, .nav-cap, .sbs-field, .sbs-pop, .toolbar.scrolled { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* sidebar: the selected row is accent blue while you use the sidebar, grey once you work in the content (macOS focus) */
.sidebar.focus .sb-link.on { background: var(--accent); color: #fff; }
.sidebar.focus .sb-link.on svg { color: #fff; }
.sb-top .tb-btn svg { width: 19px; height: 19px; stroke-width: 1.7; }

/* table rows: a click selects (grey, accent while the table has focus), double-click or Return opens */
.tbl tbody tr.sel td { background: var(--select); }
/* every selected row is accent while the table has focus (several rows can be selected, Finder) */
.tbl:focus-within tbody tr.sel td { background: var(--accent); color: #fff; }
.tbl:focus-within tbody tr.sel td * { color: #fff !important; }
.tbl tbody tr.open:active td { background: inherit; }
.tbl tbody tr.sel:focus { outline: none; }

/* toolbar fits the window (Finder): search → round button, then pop-ups → symbol only, then the subtitle goes */
.pop-sym { display: none; }
.toolbar.compact:not(.search-open) .tb-search { width: 36px; padding: 0; justify-content: center; cursor: default; }
.toolbar.compact:not(.search-open) .tb-search input { position: absolute; width: 1px; opacity: 0; }
.toolbar.compact:not(.search-open) .tb-search svg { width: 18px; height: 18px; color: var(--text); }
.tb-search { position: relative; transition: width .25s ease; }
.toolbar.tight .tb-pop { width: 36px; padding: 0; justify-content: center; }
.toolbar.tight .tb-pop .pop-sym { display: block; width: 18px; height: 18px; color: var(--text); }
.toolbar.tight .tb-pop select { position: absolute; inset: 0; width: 100% !important; opacity: 0; padding: 0; }
.toolbar.tight .tb-pop .pop-ic { display: none; }
.toolbar.tighter .tb-sub { display: none; }
.tb-titles { flex: 0 1 auto; overflow: hidden; }
.tb-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar .spacer { min-width: 0; }
.tb-btn.spinning svg { animation: sp .8s linear infinite; }

/* Finder search: token, clear button, suggestions, scope bar */
.tb-search { gap: 6px; cursor: text; }
.tb-token { flex: none; padding: 1px 7px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 500; }
.tb-clear { display: grid; place-items: center; flex: none; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: var(--text3); color: var(--bg); cursor: default; }
.tb-clear svg { width: 9px; height: 9px; stroke-width: 3; }
.toolbar.compact:not(.search-open) .tb-search :is(.tb-token, .tb-clear) { display: none; }
.tb-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sugg-pop { position: fixed; z-index: 300; padding: 6px; border-radius: 12px; background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
  box-shadow: var(--glass-shadow), inset 0 0.5px 0 var(--glass-edge); transform-origin: top center; animation: menu-in .16s cubic-bezier(.2, .9, .3, 1); }
.sugg-h { padding: 6px 8px 2px; font-size: 11px; font-weight: 600; color: var(--text2); }
.sugg-h:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--sep); padding-top: 8px; }
.sugg-row { padding: 0 8px; height: 26px; line-height: 26px; border-radius: 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.sugg-row.sel { background: var(--accent); color: #fff; }
.scope-bar { position: sticky; top: 52px; z-index: 19; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 20px; background: var(--band); font-size: 13px; }
.scope-bar[hidden] { display: none; }
.scope-bar > span { font-weight: 600; color: var(--text2); margin-right: 4px; }
.scope-bar button { height: 24px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 13px; font-weight: 500; cursor: default; }
.scope-bar button:hover { background: var(--fill2); }
.scope-bar button.on { background: var(--select); font-weight: 600; }
.toolbar.searching { background: var(--band); }
.pane:has(> .toolbar.searching) .page .tbl th { top: 88px; }
.page.search-all > :not(.global-results) { display: none !important; }
.tb-clear[hidden], .tb-token[hidden] { display: none; }

/* ===== Frosted toolbar band (Finder): the toolbar + column headers are translucent glass; rows blur through as they scroll under ===== */
html.mac { --band-glass: color-mix(in srgb, var(--band) 72%, transparent); --band-blur: blur(22px) saturate(180%); }
.toolbar.band, .toolbar.band.scrolled, .toolbar.searching { background: var(--band-glass); -webkit-backdrop-filter: var(--band-blur); backdrop-filter: var(--band-blur); }
.table-page .tbl th { background: var(--band-glass); -webkit-backdrop-filter: var(--band-blur); backdrop-filter: var(--band-blur); }
.table-page .tbl th:hover { background: var(--band-glass); }
.table-page .tbl th:first-child, .table-page .tbl th:last-child { box-shadow: none; }
.scope-bar { background: var(--band-glass); -webkit-backdrop-filter: var(--band-blur); backdrop-filter: var(--band-blur); }
html.mac .page.table-page { padding-top: 0; }
@media (prefers-reduced-transparency: reduce) {
  .toolbar.band, .toolbar.band.scrolled, .toolbar.searching, .table-page .tbl th, .scope-bar { background: var(--band); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ===== Menus (macOS 27): checkmark column, submenu arrow ===== */
html.mac .cmenu { min-width: 200px; padding: 5px; border-radius: 12px; }
html.mac .cm-item { height: 24px; padding: 0 10px; gap: 6px; border-radius: 6px; }
.cm-label { flex: 1; text-align: left; white-space: nowrap; }
.cm-check { display: grid; place-items: center; width: 12px; flex: none; }
.cm-check svg { width: 12px; height: 12px; stroke-width: 2.6; }
.cm-more { width: 10px; height: 10px; stroke-width: 2.4; flex: none; opacity: .8; }
.cm-item.has-sub:hover, .cm-item.has-sub:focus { background: var(--accent); color: #fff; }
.cmenu.sub { z-index: 301; animation: none; }
.tb-btn[aria-label="More"] svg { width: 20px; height: 20px; stroke-width: 3.4; }
/* sidebar search results: on the window, shown while attached (System Settings) */
.sbs-pop { display: block; }
.sbs-row { height: 36px; gap: 10px; }
.sbs-i { width: 26px; height: 26px; border-radius: 7px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.sbs-i svg { width: 16px; height: 16px; }

/* ================= A–Z audit vs native macOS 27 (tools/apple-controls.swift, 22 Nov 2026) ================= */
/* accent as macOS renders controls */
html.mac { --accent: #3478f6; --accent-soft: rgba(52, 120, 246, 0.14); --btn: #ececec; --seg-bg: #ececec; --field-bg: #ffffff; --field-edge: rgba(0, 0, 0, 0.13);
  --sheet: #ffffff; --sheet-card: #f7f7f7; --foot-line: #e6e6e6; --sw-off: #dddddd; --scrim: rgba(0, 0, 0, 0.2);
  --menu-glass: rgba(246, 246, 246, 0.62); --menu-edge: inset 0 0.5px 0 rgba(255, 255, 255, 0.9), 0 0 0 0.5px rgba(0, 0, 0, 0.16), 0 10px 32px rgba(0, 0, 0, 0.18); }
@media (prefers-color-scheme: dark) {
  html.mac:not([data-theme="light"]) { --accent: #397af5; --accent-soft: rgba(57, 122, 245, 0.22); --btn: #2f2f2f; --seg-bg: #2f2f2f; --field-bg: #171717; --field-edge: rgba(255, 255, 255, 0.12);
    --sheet: #1d1d1d; --sheet-card: #242424; --foot-line: #323233; --sw-off: #393939; --scrim: rgba(0, 0, 0, 0.2);
    --menu-glass: rgba(44, 44, 46, 0.52); --menu-edge: inset 0 0.5px 0 rgba(255, 255, 255, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.6), 0 10px 32px rgba(0, 0, 0, 0.4); }
}

/* menus + popovers: translucent Liquid Glass, the content shows through blurred (Finder / System Settings) */
html.mac .cmenu, .sbs-pop, .sugg-pop {
  background: var(--menu-glass); -webkit-backdrop-filter: blur(24px) saturate(190%) brightness(1.04); backdrop-filter: blur(24px) saturate(190%) brightness(1.04); box-shadow: var(--menu-edge); }
html.mac .cmenu { border-radius: 12px; }
.sbs-pop, .sugg-pop { border-radius: 14px; }
@media (prefers-reduced-transparency: reduce) { html.mac .cmenu, .sbs-pop, .sugg-pop { background: var(--sheet); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* one continuous frosted band behind the toolbar and the column headers, full width (no seam, no side gaps) */
.toolbar.band, .toolbar.band.scrolled, .toolbar.band.searching { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.toolbar.band::after { content: ""; display: none; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 81px; pointer-events: none;
  background: var(--band-glass); -webkit-backdrop-filter: var(--band-blur); backdrop-filter: var(--band-blur); border-bottom: 1px solid var(--tbl-line); }
.pane:has(.table-page .tbl) > .toolbar.band::after { display: block; }
.pane:has(.table-page.search-all .global-results .tbl) > .toolbar.band::after { display: block; }
.toolbar.band.searching::after { height: 117px; }
.pane:has(> .toolbar.band:not(.searching)) .scope-bar { display: none; }
.pane:has(> .toolbar.band) .scope-bar { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; z-index: 21; }
.table-page .tbl th { background: transparent !important; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 0; z-index: 25; }
@media (prefers-reduced-transparency: reduce) { .toolbar.band::after { background: var(--band); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* segmented control: the selected segment is the accent colour (macOS), 24 pt, radius 8 */
html.mac .seg { height: 24px; padding: 0; gap: 0; border-radius: 8px; background: var(--seg-bg); max-width: 360px; }
html.mac .seg button { height: 24px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text); }
html.mac .seg button.on { background: var(--accent); color: #fff; box-shadow: none; }

/* push buttons: rounded rectangles 24 pt, radius 8 (not capsules) */
.mbtn { height: 24px; min-width: 66px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 400; background: var(--btn); color: var(--text); box-shadow: none; }
.mbtn.default { background: var(--accent); color: #fff; }

/* switches in forms: small (36 × 16 pt), off track grey, on = accent */
html.mac .switch { width: 36px; height: 18px; }
html.mac .switch i { background: var(--sw-off); }
html.mac .switch i::after { top: 2px; left: 2px; width: 22px; height: 14px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
html.mac .switch input:checked + i { background: var(--accent); }
html.mac .switch input:checked + i::after { transform: translateX(10px); }

/* date field: bordered “22/11/2026” (macOS compact date picker) */
html.mac .dp-text { padding: 2px 7px; border-radius: 6px; background: var(--field-bg); box-shadow: 0 0 0 1px var(--field-edge); font-size: 13px; }

/* sheets: radius 20, form cards on the sheet, divider above Cancel / Add, window dimmed 20% */
html.mac .sheet { border-radius: 20px; background: var(--sheet); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.3); }
html.mac .sheet .group, html.mac .sheet .row, html.mac .sheet .field { background: var(--sheet-card); }
html.mac .sheet .group .row, html.mac .sheet .group .field { background: transparent; }
html.mac .sheet-foot { border-top: 1px solid var(--foot-line); padding: 18px 20px; gap: 8px; }
html.mac .sheet-body { padding: 4px 20px 20px; }
html.mac .scrim.in { background: var(--scrim); }
/* alerts: no focus ring on the button that only has programmatic focus; rows show faintly through the band (Finder) */
html.mac { --band-blur: blur(9px) saturate(180%); --band-glass: color-mix(in srgb, var(--band) 80%, transparent); }
html.mac { --band-glass: color-mix(in srgb, var(--band) 66%, transparent); }
html.mac { --band-blur: blur(3px) saturate(170%); --band-glass: color-mix(in srgb, var(--band) 72%, transparent); }

/* ===== Native menu glass (measured from the real macOS 27 pop-up menu: #3d3d3d over #292929, bright rim #585958;
   the row under the pointer gets a soft white highlight, not blue) ===== */
html.mac { --menu-glass: rgba(250, 250, 250, 0.74); --menu-hover: rgba(0, 0, 0, 0.07);
  --menu-edge: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 0.5px rgba(255, 255, 255, 0.5), 0 0 0 0.5px rgba(0, 0, 0, 0.16), 0 12px 34px rgba(0, 0, 0, 0.18); }
@media (prefers-color-scheme: dark) {
  html.mac:not([data-theme="light"]) { --menu-glass: rgba(70, 70, 70, 0.74); --menu-hover: rgba(255, 255, 255, 0.13);
    --menu-edge: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.7), 0 12px 34px rgba(0, 0, 0, 0.45); }
}
html.mac .cmenu, .sbs-pop, .sugg-pop { -webkit-backdrop-filter: blur(28px) saturate(200%); backdrop-filter: blur(28px) saturate(200%); }
html.mac .cm-item:hover, html.mac .cm-item:focus-visible, html.mac .cm-item.has-sub:hover, html.mac .cm-item.has-sub:focus { background: var(--menu-hover); color: var(--text); outline: none; }
html.mac .cm-item.destructive:hover { background: var(--menu-hover); color: var(--red); }
html.mac .cm-item { height: 26px; border-radius: 8px; }
html.mac .cmenu { padding: 6px; border-radius: 14px; }
.sbs-row.sel, .sugg-row.sel { background: var(--menu-hover); color: var(--text); }
.sbs-row.sel .sbs-i { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--accent); }
.sbs-row.sel .sbs-s { color: var(--text2); }
.cmenu.up { transform-origin: bottom left; }

/* ===== Soft scroll edge (macOS 27): no line under the toolbar — the content blurs and fades out beneath it ===== */
.toolbar.scrolled:not(.band) { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.toolbar:not(.band)::before { content: ""; display: block; position: absolute; z-index: -1; inset: 0 0 -26px; opacity: 0; pointer-events: none; transition: opacity .2s;
  background: linear-gradient(var(--bg) 35%, color-mix(in srgb, var(--bg) 55%, transparent) 70%, color-mix(in srgb, var(--bg) 0%, transparent));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.toolbar.scrolled:not(.band)::before { opacity: 1; }

/* sidebar: the list fades out under the Search field, and under the account card at the bottom */
.sb-top::before { content: ""; position: absolute; z-index: -1; inset: 0 0 -18px; pointer-events: none;
  background: linear-gradient(var(--sidebar) 40%, color-mix(in srgb, var(--sidebar) 0%, transparent));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.sb-top { isolation: auto; }
.sidebar { display: flex; flex-direction: column; padding-bottom: 0; }
.sb-scroll > .sb-sec:last-of-type { margin-bottom: 12px; }
.sb-user { position: relative; flex: none; z-index: 3; display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 18px 16px; border: 0; background: none; text-align: left; color: var(--text); cursor: default; }
.sb-user::before { content: ""; position: absolute; z-index: -1; inset: -22px 0 0; pointer-events: none;
  background: linear-gradient(color-mix(in srgb, var(--sidebar) 0%, transparent), var(--sidebar) 45%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(transparent, #000 40%); mask-image: linear-gradient(transparent, #000 40%); }
.sb-user::after { content: ""; position: absolute; z-index: -1; inset: 6px 8px 8px; border-radius: 9px; transition: background .12s; }
.sb-user:hover::after { background: var(--fill2); }
.sb-user .avatar.small { width: 28px; height: 28px; font-size: 12px; }
.sbu-t { min-width: 0; }
.sbu-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbu-sub { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Menu / popover glass = GHL Boys Club's final values (v373), matched to native macOS 27 menus:
   the page behind stays visible, only lightly blurred and brightened; bright top line, inner glow, dark outline ===== */
html.mac { --menu-glass: rgba(246, 246, 246, 0.42); --menu-blur: blur(8px) saturate(180%) brightness(1.04);
  --menu-edge: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(255, 255, 255, 0.55), inset 0 0 14px rgba(255, 255, 255, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.16), 0 14px 44px rgba(0, 0, 0, 0.20); }
@media (prefers-color-scheme: dark) {
  html.mac:not([data-theme="light"]) { --menu-glass: rgba(255, 255, 255, 0.03); --menu-blur: blur(7px) saturate(170%) brightness(1.3);
    --menu-edge: inset 0 1px 0 rgba(255, 255, 255, 0.30), inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 0 14px rgba(255, 255, 255, 0.075), 0 0 0 0.5px rgba(0, 0, 0, 0.85), 0 16px 48px rgba(0, 0, 0, 0.45); }
}
html.mac .cmenu, .sbs-pop, .sugg-pop { background: var(--menu-glass); -webkit-backdrop-filter: var(--menu-blur); backdrop-filter: var(--menu-blur); box-shadow: var(--menu-edge); border-radius: 16px; }
@media (prefers-reduced-transparency: reduce) { html.mac .cmenu, .sbs-pop, .sugg-pop { background: var(--sheet); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* toolbar band: same see-through glass as GHL's toolbar — rows stay visible behind it, lightly blurred */
html.mac { --band-glass: color-mix(in srgb, var(--band) 55%, transparent); --band-blur: blur(6px) saturate(180%) brightness(1.05); }
/* sidebar top row keeps its 52 pt height, so Search + sidebar button line up with the toolbar controls */
.sb-top { flex: none; height: 52px; min-height: 52px; }
.sidebar > .sb-sec { flex: none; }
/* Finder: the first row starts 6 pt below the column-header line, so a selected row never touches it */
.tbl tbody::before { content: ""; display: table-row; height: 6px; }

/* app icon (vector TieBond mark) in Apple's icon shape: continuous-corner square, hairline edge, soft shadow */
.app-icon { display: block; border-radius: 22.5%; background: #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 4px 14px rgba(0, 0, 0, 0.14); }
.login-box .login-icon { width: 76px; height: 76px; margin: 0 auto; border-radius: 22.5%; }
html.mac .login-box .login-icon { width: 64px; height: 64px; }
.company-icon { width: 72px; height: 72px; margin-bottom: 8px; }
html.mac .company-icon { width: 56px; height: 56px; }
.hero .ch-name { font-size: 22px; font-weight: 700; }
html.mac .hero .ch-name { font-size: 17px; }

/* ===== Sidebar edges = GHL Boys Club (#ggUserGlass / toolbar scroll edge): the list stays visible, sliding under a frosted
   glass (30 % tint, blur 14 px) that softens away from the edge — top under Search, mirrored behind the account card ===== */
.sb-top::before { inset: 0 0 -14px; background: color-mix(in srgb, var(--sidebar) 30%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); }
.sb-user::before { inset: -20px 0 0; background: color-mix(in srgb, var(--sidebar) 30%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  -webkit-mask-image: linear-gradient(to top, #000 62%, transparent); mask-image: linear-gradient(to top, #000 62%, transparent); }
.sb-user { padding: 12px 18px 14px; }
.sb-user:hover::after { background: color-mix(in srgb, var(--text) 7%, transparent); }
@media (prefers-reduced-transparency: reduce) { .sb-top::before, .sb-user::before { background: var(--sidebar); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* ===== Notifications bell (GHL Boys Club style): glass button + red count badge; glass panel listing what needs attention ===== */
.tb-btn.bell, .gbtn.bell { position: relative; }
.tb-btn.bell svg { width: 19px; height: 19px; }
.bell-badge { position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
html.ios .tb-btn.bell { width: 44px; height: 44px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--text);
  background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(190%); backdrop-filter: blur(16px) saturate(190%); box-shadow: var(--glass-shadow), inset 0 0 0 0.5px var(--glass-edge); }
html.ios .tb-btn.bell svg { width: 21px; height: 21px; }
.notif-pop { position: fixed; z-index: 300; width: 340px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto; padding: 6px; border-radius: 16px;
  background: var(--menu-glass, var(--glass)); -webkit-backdrop-filter: var(--menu-blur, blur(30px) saturate(180%)); backdrop-filter: var(--menu-blur, blur(30px) saturate(180%));
  box-shadow: var(--menu-edge, var(--glass-shadow)); animation: menu-in .16s cubic-bezier(.2, .9, .3, 1); transform-origin: top right; }
html.ios .notif-pop { background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border-radius: 24px; box-shadow: var(--glass-shadow); }
.np-head { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px 6px; font-size: 13px; font-weight: 700; }
.np-count { font-size: 11px; font-weight: 400; color: var(--text2); }
.np-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.np-row:hover { background: var(--menu-hover, var(--fill2)); }
.np-row .icon-dot { width: 26px; height: 26px; border-radius: 7px; }
.np-row .icon-dot svg { width: 15px; height: 15px; }
.np-t { flex: 1; min-width: 0; }
.np-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { font-size: 11px; color: var(--text2); }
.np-end { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.np-none { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; text-align: center; font-size: 13px; font-weight: 600; }
.np-none svg { width: 30px; height: 30px; color: var(--green); margin-bottom: 4px; }
html.ios .np-title { font-size: 16px; } html.ios .np-sub { font-size: 13px; } html.ios .np-end { font-size: 15px; }

/* ===== Sidebar edges, exactly as System Settings / GHL: no band at the top — the list scrolls up under the Search field and the
   sidebar button, and only those glass controls blur it. Bottom: GHL's #ggUserGlass (86 pt, 30 % tint, blur 14, fading upwards) ===== */
.sb-top::before { display: none; }
.sb-top { background: transparent; pointer-events: none; }
.sb-top > * { pointer-events: auto; }
.sbs-field, .sb-top .tb-btn { -webkit-backdrop-filter: blur(6px) saturate(180%) brightness(1.08); backdrop-filter: blur(6px) saturate(180%) brightness(1.08); }
.sidebar > .sb-sec:first-of-type { margin-top: 0; }
.sb-user::before { inset: -30px 0 0; }
.sidebar > .sb-sec:first-of-type { margin-top: 14px; }

/* macOS overlay scroll bars (Mac only): the system bars are hidden; .ov-thumb appears while scrolling and fades out */
html.mac, html.mac .sidebar { scrollbar-width: none; }
html.mac::-webkit-scrollbar, html.mac .sidebar::-webkit-scrollbar { display: none; }
.ov-thumb { position: fixed; z-index: 250; display: none; width: 7px; border-radius: 4px; background: rgba(0, 0, 0, 0.42); opacity: 0; transition: opacity .35s ease, width .15s ease; cursor: default; }
.ov-thumb.on { opacity: 1; transition-duration: .1s; }
.ov-thumb:hover, .ov-thumb.drag { width: 9px; margin-left: -2px; opacity: 1; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .ov-thumb { background: rgba(255, 255, 255, 0.42); } }
html.ios .ov-thumb { display: none !important; }
/* a faded overlay thumb is gone for the pointer too (it must not re-appear when the pointer crosses the edge) */
.ov-thumb:not(.on) { pointer-events: none; }

/* ---------- Stage 2: documents ---------- */
/* status: a coloured dot + label, like Finder tags / Reminders */
.state { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text2); white-space: nowrap; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--s, #8e8e93); flex: none; }
.state.s-blue { --s: var(--accent); } .state.s-green { --s: var(--green); } .state.s-orange { --s: var(--orange); } .state.s-gray { --s: #8e8e93; }
.state.s-red { --s: var(--red); color: var(--red); }
.hero .cap .state { margin-left: 6px; vertical-align: 1px; }
html.mac .state { font-size: 12px; }
html.mac .tbl .state { font-size: 13px; }
.strike { text-decoration: line-through; }
.row .end .sub.num .state, .row .end .state { font-weight: 500; }
.row.total-row .title, .row .end .strong, .row .strong { font-weight: 600; }
.row.total-row .end .num { font-size: 17px; }
html.mac .row.total-row .end .num { font-size: 13px; }
.row.dim .title, .row.dim .num { color: var(--text2); }
.row.more-row .title { color: var(--accent); }

/* line editor in document sheets */
.group.lines .line + .line { border-top: 0.5px solid var(--sep); }
.group.lines .line + .add-row { border-top: 0.5px solid var(--sep); }
.line-top .rm { margin-left: -4px; }
.line-amt { flex: none; font-size: 17px; font-weight: 600; }
html.mac .line-amt { font-size: 13px; }
.line-grid.one { grid-template-columns: 1fr; }
.line-note.warn { color: var(--orange-text); }
.line-note[hidden] { display: none; }

/* payments: tick the invoices a payment settles (Reminders-style circle) */
.field.alloc { gap: 12px; min-height: 56px; }
.field.alloc .grow { flex: 1; min-width: 0; }
.field.alloc .sub { font-size: 13px; color: var(--text2); }
.field.alloc .sub.neg { color: var(--red); }
.alloc-amt { flex: none; width: 34%; max-width: 140px; display: flex; align-items: center; }
.alloc-amt input { width: 100%; text-align: right; font-size: 17px; border: 0; background: var(--fill2); border-radius: 8px; padding: 6px 8px; outline: none; color: var(--text); }
.field.alloc.auto .alloc-amt input { background: none; color: var(--text2); }
html.mac .field.alloc { min-height: 44px; }
html.mac .field.alloc .sub { font-size: 11px; }
html.mac .alloc-amt input { font-size: 13px; padding: 3px 6px; border-radius: 5px; }
.tick { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border-radius: 50%; border: 1.5px solid var(--text3); background: transparent; display: grid; place-items: center; }
.tick:checked { border-color: var(--accent); background: var(--accent); }
.tick:checked::after { content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.tick:disabled { opacity: 1; }

html.mac .tick { width: 16px; height: 16px; border-width: 1px; }
html.mac .tick:checked::after { width: 4px; height: 8px; }
.section-f.neg { color: var(--red); }
.field.alloc > input.tick, html.mac .field.alloc > input.tick { flex: none; padding: 0; text-align: initial; }

/* Stage 3: journal entry lines (contact for receivable / payable, description), sheet lead subtitle */
.line-contact { margin-top: 6px; padding: 2px 0; }
.line-contact[hidden], .mini[hidden] { display: none; }
.line-contact .line-pop select { font-size: 15px; font-weight: 400; color: var(--text2); }
.line-desc { margin-top: 8px; }
.line-desc input { width: 100%; border: 0; border-radius: 12px; background: var(--fill2); padding: 8px 10px; font-size: 17px; color: var(--text); outline: none; }
html.mac .line-contact .line-pop select { font-size: 12px; }
html.mac .line-desc input { font-size: 13px; border-radius: 7px; padding: 4px 8px; }
.sheet-lead .sub { margin-top: 2px; font-size: 13px; color: var(--text2); }
html.mac .sheet-lead .sub { font-size: 11px; }

/* ================= Stage 4: Home & Reports ================= */
/* more of Apple's system colours (iOS 27 / macOS 27), for charts and symbols */
:root { --purple: #cb30e0; --teal: #00c3d0; --yellow: #ffcc00; --indigo: #6155f5; --chart-cmp: rgba(120, 120, 128, 0.42); --chart-grid: rgba(60, 60, 67, 0.18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --purple: #db34f2; --teal: #00d2e0; --yellow: #ffd600; --indigo: #6d7cff; --chart-cmp: rgba(160, 160, 170, 0.45); --chart-grid: rgba(235, 235, 245, 0.16); } }
.c-yellow { background: #ffcc00; } .c-indigo { background: #6155f5; }
.c-text-blue { color: var(--accent); } .c-text-green { color: var(--green-text); } .c-text-orange { color: var(--orange-text); } .c-text-purple { color: var(--purple); }
.c-text-teal { color: light-dark(#00838f, #00d2e0); } .c-text-indigo { color: var(--indigo); } .c-text-red { color: var(--red); }

/* charts (Swift Charts look) */
.chart { position: relative; width: 100%; }
.ch-box { position: relative; width: 100%; touch-action: pan-y; }
.ch-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ch-grid { stroke: var(--chart-grid); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.ch-zero { stroke: var(--chart-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ch-dot { vector-effect: non-scaling-stroke; }
.ch-ylabels span { position: absolute; right: 0; transform: translateY(-50%); font-size: 11px; color: var(--text2); font-variant-numeric: tabular-nums; }
.ch-xlabels { position: absolute; bottom: 0; height: 16px; }
.ch-xlabels span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--text2); white-space: nowrap; }
.ch-rule { position: absolute; top: 0; bottom: 20px; width: 0; border-left: 1px solid var(--text3); pointer-events: none; }
.ch-tip { position: absolute; top: -6px; transform: translateY(-100%); z-index: 3; min-width: 120px; padding: 7px 10px; border-radius: 10px; background: var(--card); box-shadow: 0 4px 18px rgba(0,0,0,.16), 0 0 0 .5px var(--sep); pointer-events: none; font-size: 13px; }
.ch-tip-h { font-weight: 600; margin-bottom: 2px; color: var(--text2); font-size: 12px; }
.ch-tip-r { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.ch-tip-r i, .ch-legend i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.ch-tip-r b { margin-left: auto; padding-left: 10px; font-weight: 600; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--text2); }
.ch-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart.tap .ch-box { cursor: pointer; }
.chart-empty { padding: 36px 0; text-align: center; color: var(--text2); font-size: 15px; }
.hbar { display: grid; gap: 9px; }
.hb-row { display: grid; grid-template-columns: minmax(70px, 32%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hb-row.tap { cursor: pointer; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.hb-bars { display: grid; gap: 3px; }
.hb-track { height: 12px; border-radius: 4px; overflow: hidden; display: flex; }
.hb-track.thin { height: 7px; }
.hb-track i { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.hb-track.stack i { border-radius: 0; } .hb-track.stack i:first-child { border-radius: 4px 0 0 4px; } .hb-track.stack i:last-child { border-radius: 0 4px 4px 0; }
.hb-val { text-align: right; color: var(--text2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.spark { width: 84px; height: 28px; flex: none; overflow: visible; }
.pbar { height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; margin: 8px 0 6px; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: var(--orange); transition: width .5s; }
.pbar.done i { background: var(--green); }

/* Home: Where You Stand */
.kpi .s + .s { margin-top: 0; }
.stand { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.stand-card { display: block; padding: 12px 14px; border-radius: 20px; background: var(--card); color: var(--text); }
.stand-card .k { font-size: 13px; font-weight: 600; color: var(--text2); }
.stand-card .v { margin-top: 4px; font-size: 22px; font-weight: 700; }
.stand-card .s { margin-top: 2px; font-size: 13px; color: var(--text2); }
.stand-card .s.pos { color: var(--green-text); } .stand-card .s.neg { color: var(--red); }
.stand-card:active { background: color-mix(in srgb, var(--card) 80%, var(--text3)); }
html.mac .stand { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
html.mac .stand-card { border-radius: 10px; }
html.mac .stand-card:hover { background: color-mix(in srgb, var(--card) 85%, var(--text3)); }
html.mac .stand-card .k, html.mac .stand-card .s { font-size: 11px; }
html.mac .stand-card .v { font-size: 22px; line-height: 26px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 17px; text-transform: none; letter-spacing: 0; cursor: pointer; }
html.mac .link-btn { font-size: 13px; }
.section-h .link-btn, .section-h .sh-tools { text-transform: none; letter-spacing: 0; }
html.mac .section-h .sh-tools > span { font-weight: 400; color: var(--text2); }

/* Home: pinned figures (Health's pinned cards) */
.pins { display: grid; grid-template-columns: 1fr; gap: 10px; }
.pin { display: block; padding: 12px 14px; border-radius: 20px; background: var(--card); color: var(--text); }
.pin:active { background: color-mix(in srgb, var(--card) 80%, var(--text3)); }
.pin-h { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.pin-h svg { width: 17px; height: 17px; }
.pin-b { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 8px; }
.pin-v { font-size: 26px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.pin-s { margin-top: 3px; font-size: 13px; color: var(--text2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pin-cmp { margin-top: 6px; font-size: 12px; color: var(--text2); }
.chg { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.chg.up { color: var(--green-text); } .chg.down { color: var(--red); } .chg.flat { color: var(--text2); }
.sh-tools { display: inline-flex; align-items: center; gap: 14px; }
.sh-pop { position: relative; display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-size: 15px; }
.sh-pop svg { width: 13px; height: 13px; stroke-width: 2.4; }
.sh-pop select.sel-cover { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; }
html.mac .pins { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { html.mac .pins { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
html.mac .pin { border-radius: 10px; padding: 10px 12px; }
html.mac .pin:hover { background: color-mix(in srgb, var(--card) 85%, var(--text3)); }
html.mac .pin-h { font-size: 12px; } html.mac .pin-h svg { width: 14px; height: 14px; }
html.mac .pin-v { font-size: 22px; } html.mac .pin-s, html.mac .chg { font-size: 11px; } html.mac .pin-cmp { font-size: 11px; }

/* Home: highlights and trends */
.hl-row .title { white-space: normal; line-height: 1.3; }
html.ios .hl-row { align-items: center; }
.trends { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tcard { padding: 12px 14px 14px; border-radius: 20px; background: var(--card); min-width: 0; }
.tc-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); margin-bottom: 12px; }
.tc-t { font-size: 17px; font-weight: 600; }
.tc-s { font-size: 13px; color: var(--text2); }
.tc-h .chev { width: 8px; height: 13px; color: var(--text3); flex: none; }
html.mac .trends { grid-template-columns: repeat(2, 1fr); gap: 14px; }
html.mac .tcard { border-radius: 10px; padding: 12px 14px; }
html.mac .tc-t { font-size: 13px; } html.mac .tc-s { font-size: 11px; }
html.mac .tc-h:hover .tc-t { color: var(--accent); }
.home-foot { display: flex; justify-content: center; margin: 26px 0 8px; }
.ptr { height: 0; overflow: hidden; display: grid; place-items: center; transition: height .2s; }
.ptr .spin { opacity: .3; } .ptr.ready .spin, .ptr.on .spin { opacity: 1; }

/* Edit Home: rows with a grip to drag */
.reorder .ro-row { gap: 12px; touch-action: none; }
.grip { display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -10px -8px 0; color: var(--text3); cursor: grab; flex: none; touch-action: none; }
.grip svg { width: 20px; height: 20px; }
.ro-row.dragging { background: var(--fill2); box-shadow: 0 6px 20px rgba(0,0,0,.18); z-index: 5; }
.ro-row.dragging::before { display: none; }

/* Reports: the library strip (Mac) and the report page */
.kpis.strip { margin: 6px 0 4px; }
html.ios .kpis.strip { margin-top: 12px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 10px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--card); color: var(--text); font-size: 15px; font-weight: 500; white-space: nowrap; }
.chip svg { width: 15px; height: 15px; color: var(--accent); }
.chip .chip-dn { width: 11px; height: 11px; stroke-width: 2.6; color: var(--text2); }
.chip select.sel-cover { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; -webkit-appearance: none; appearance: none; font-size: 16px; }
.chart-card { padding: 14px 14px 12px; border-radius: 20px; background: var(--card); margin-bottom: 14px; }
html.mac .chart-card { border-radius: 10px; padding: 14px 16px 12px; margin: 8px 0 16px; }
.report-notes { margin: 10px 16px 24px; font-size: 13px; color: var(--text2); }
.report-notes p { margin: 0 0 4px; }
html.mac .report-notes { margin: 10px 2px 24px; font-size: 11px; }
.print-head { display: none; }
.rlist .row.k-total .title, .rlist .row.k-total .end .num, .rlist .row.k-subtotal .title { font-weight: 600; }
.rlist .row.k-total .end .num:first-child, .rlist .row.k-subtotal .end .num:first-child { color: var(--text); }
.rlist .row .sub { white-space: normal; }
.rlist .group + .section-h { margin-top: 22px; }
.rlist > .group:first-child { margin-top: 4px; }

/* Mac report table: like a Numbers table (header, sections, subtotals, totals; click a row for the entries behind it) */
.rtbl-wrap { margin: 0 -2px; }
.rtbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.rtbl th { height: 26px; padding: 0 10px; text-align: left; font-size: 11px; font-weight: 500; color: var(--text2); border-bottom: 1px solid var(--sep); white-space: nowrap; position: sticky; top: 52px; background: var(--bg); z-index: 1; }
.rtbl th.r { text-align: right; }
.rtbl th.sortable { cursor: default; } .rtbl th.sortable:hover { color: var(--text); }
.rtbl th.sorted { color: var(--text); font-weight: 700; }
.rtbl th .sort-ic { display: inline-block; width: 9px; height: 9px; margin-left: 3px; vertical-align: middle; }
.rtbl td { height: 26px; padding: 0 10px; white-space: nowrap; border-bottom: 1px solid color-mix(in srgb, var(--sep) 55%, transparent); max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.rtbl td.r { text-align: right; font-variant-numeric: tabular-nums; }
.rtbl tr.ind > td:first-child { padding-left: 26px; }
.rtbl tr.k-section td { height: 30px; padding-top: 10px; font-weight: 700; border-bottom: 1px solid var(--sep); }
.rtbl tr.k-subtotal td { font-weight: 600; }
.rtbl tr.k-total td { font-weight: 700; border-top: 1px solid var(--text3); border-bottom: 3px double var(--text3); }
.rtbl tr.go { cursor: default; }
.rtbl tr.go:hover td { background: var(--fill2); }
.rtbl tr.go:hover td.mc, .rtbl tr.go:focus td.mc { color: var(--accent); }
.rtbl tr.go:focus { outline: none; } .rtbl tr.go:focus td { background: var(--accent-soft); }
.rtbl td.mc { font-weight: 600; }
.rtbl tr.k-row td.mc { font-weight: 500; }
.rtbl td.neg-soft { color: var(--red); }
.rtbl tr.warn-row td.mc { color: var(--orange-text); }
.rtbl td.pos { color: var(--green-text); } .rtbl td.neg { color: var(--red); }

@media print {
  html, body { background: #fff !important; }
  .chips, .ptr, .home-foot, .bell, .notif-pop, .ov-thumb { display: none !important; }
  .print-head { display: flex !important; align-items: center; gap: 12pt; margin: 0 0 14pt; padding-bottom: 8pt; border-bottom: 1px solid #999; }
  .print-head img { width: 54pt; height: auto; }
  .ph-co { font-size: 11pt; color: #555; } .ph-title { font-size: 17pt; font-weight: 700; color: #000; } .ph-sub { font-size: 10pt; color: #555; }
  .chart-card { break-inside: avoid; border: 1px solid #ccc; background: #fff !important; }
  .rtbl th { position: static; background: #fff; color: #333; }
  .rtbl td, .rtbl th { color: #000 !important; font-size: 9pt; height: auto; padding: 2pt 5pt; }
  .rtbl tr { break-inside: avoid; }
  .rlist .group { border: 0 !important; }
  .report-notes { color: #444; }
}
.kpi .kk { display: flex; justify-content: space-between; gap: 6px; }
.pl-tag { font-weight: 700; }
.pl-tag.pos { color: var(--green-text); } .pl-tag.neg { color: var(--red); }

/* ================= Stage 5: sharing, attachments, setup assistant ================= */
/* attachments: thumbnails like Notes / Files, under a document or a contact */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; padding: 14px 16px 10px; }
html.mac .att-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); padding: 12px; gap: 10px; }
.att { display: flex; flex-direction: column; align-items: stretch; gap: 5px; border: 0; padding: 0; background: none; color: inherit; cursor: default; min-width: 0; }
.att img, .att-doc { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--fill2); box-shadow: 0 0 0 0.5px var(--sep); }
html.mac .att img, html.mac .att-doc { border-radius: 6px; }
.att-doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--red); font-size: 12px; font-weight: 700; }
.att-doc svg { width: 34px; height: 34px; }
.att-name { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.att:focus-visible img { outline: 3px solid var(--accent); outline-offset: 2px; }
.att-group .add-row { border-top: 0; }

/* Quick Look: the photo or PDF over a dark backdrop */
.quicklook { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, 0.88); display: flex; flex-direction: column; color: #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.ql-bar { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; }
.ql-bar .gbtn, .ql-bar .tb-btn { color: #fff; }
.ql-title { flex: 1; text-align: center; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.mac .ql-title { font-size: 13px; }
.ql-media { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 8px 8px calc(env(safe-area-inset-bottom) + 12px); }
.ql-media img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.ql-media iframe { width: min(900px, 100%); height: 100%; border: 0; border-radius: 6px; background: #fff; }

/* history: comments read as notes */
.row.comment-row .title { white-space: normal; }

/* a scheme in the invoice line note */
.scheme-note { color: var(--green-text); }
.line-note .scheme-note { font-weight: 500; }

/* keyboard shortcuts (Mac) */
kbd { font: 12px/1 -apple-system, BlinkMacSystemFont, sans-serif; padding: 3px 7px; border-radius: 5px; background: var(--fill); color: var(--text2); box-shadow: inset 0 -0.5px 0 var(--sep); }
.set-logo.small { width: 30px; height: 30px; border-radius: 7px; }
.btn-tinted.small { height: 30px; padding: 0 14px; font-size: 15px; }
html.mac .btn-tinted.small { height: 22px; font-size: 12px; padding: 0 10px; }
.mbtn.small { height: 22px; min-width: 0; padding: 0 10px; font-size: 12px; background: var(--fill); color: var(--text); }
.import-preview .row .sub, .import-preview .row .grow > div + div { white-space: normal; }

/* Setup Assistant: like setting up a new iPhone (full screen) or Mac (a centred window) */
html.setup-open, html.setup-open body { overflow: hidden; }
.setup { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; align-items: stretch; justify-content: center; }
html.mac .setup { background: rgba(0, 0, 0, 0.25); align-items: center; -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%); }
.setup-panel { width: 100%; max-width: 560px; display: flex; flex-direction: column; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 8px) 20px calc(env(safe-area-inset-bottom) + 16px); background: var(--bg); }
html.mac .setup-panel { width: 620px; max-width: calc(100vw - 40px); height: min(680px, calc(100vh - 40px)); border-radius: 16px; padding: 18px 40px 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.25); }
.setup-top { min-height: 36px; display: flex; align-items: center; }
.setup-top .link-btn { display: inline-flex; align-items: center; gap: 2px; padding: 0; }
.setup-top .link-btn svg { width: 18px; height: 18px; }
.setup-head { text-align: center; margin: 8px 0 18px; }
.setup-ic { width: 64px; height: 64px; margin: 0 auto 12px; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.setup-ic svg { width: 58px; height: 58px; stroke-width: 1.4; }
.setup-logo { width: 96px; height: 96px; border-radius: 22px; margin: 18px auto 14px; display: block; box-shadow: 0 0 0 0.5px var(--sep), 0 6px 20px rgba(0, 0, 0, 0.1); }
.setup-head h1 { font-size: 30px; font-weight: 700; margin: 0 0 8px; letter-spacing: 0.01em; }
html.mac .setup-head h1 { font-size: 24px; }
.setup-head p { margin: 0 auto; max-width: 420px; color: var(--text2); font-size: 17px; line-height: 1.35; }
html.mac .setup-head p { font-size: 13px; }
.setup-body { flex: 1; }
.setup-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 16px; }
.setup-foot .btn-prominent { width: 100%; max-width: 360px; }
html.mac .setup-foot { flex-direction: row-reverse; justify-content: space-between; }
html.mac .setup-foot .btn-prominent { width: auto; min-width: 110px; }
.setup-foot .link-btn { padding: 10px 16px; }
.setup-dots { display: flex; justify-content: center; gap: 7px; padding-top: 12px; }
.setup-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); }
.setup-dots i.on { background: var(--text); }
.setup-stock input { max-width: 92px; text-align: right; }
.setup-stock input + input { margin-left: 8px; }

/* printing one document (⌘P / Print… from Share): only the document, as on paper */
#print-doc { display: none; }
@media print {
  html.printing-doc body > *:not(#print-doc) { display: none !important; }
  html.printing-doc #print-doc { display: block; }
  html.printing-doc, html.printing-doc body { background: #fff !important; }
  #print-doc .tbdoc { max-width: none; padding: 0; }
}

/* anything hidden stays hidden, whatever its display style */
[hidden] { display: none !important; }
html.mac .setup-foot .btn-prominent { height: 28px; min-width: 96px; padding: 0 16px; font-size: 13px; font-weight: 500; border-radius: 999px; }

/* ===== 24 Nov (user, with GHL + Finder screenshots) =====
   1. Toolbar scroll edge = GHL Boys Club's #ggGlass: content passing under the toolbar is frosted (blur 14 px, saturate 170 %),
      tinted 30 % with the page colour, and fades out just below the bar — not readable text under a thin fade. */
html.mac .toolbar:not(.band)::before { inset: 0 0 -32px;
  background: color-mix(in srgb, var(--bg) 30%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent); }
/* table pages (Finder list view): the same frosting behind the toolbar + column headers */
html.mac { --band-glass: color-mix(in srgb, var(--band) 55%, transparent); --band-blur: blur(14px) saturate(170%); }
/* sidebar top and bottom edges: the list frosts under the Search field and the account card the same way */
.sb-top::before, .sb-user::before { -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%); }
@media (prefers-reduced-transparency: reduce) { html.mac .toolbar:not(.band)::before { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* 2. the sidebar keeps its own scrolling (no chaining to the page) */
.sidebar { overscroll-behavior: contain; }

/* 3. Width, as Apple does it on a wide window:
   - forms and detail pages (System Settings, Contacts, Mail's message, an invoice) keep a readable width, centred;
   - tables (Finder list, Numbers) and reports use the whole width;
   - Home (a dashboard, like Health / Fitness on iPad and Mac) uses the width with more columns, not longer rows. */
html.mac .page:not(.table-page):not(.report-page):not(.home-page) { max-width: 820px; margin: 0 auto; }
html.mac .page.home-page { max-width: 1480px; margin: 0 auto; }
.home-grid { display: block; }
html.mac .home-grid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 28px; align-items: start; }
@media (min-width: 1180px) { html.mac .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
html.mac .home-grid > .hsec.span { grid-column: 1 / -1; }
html.mac .home-grid > .hsec { min-width: 0; }
html.mac .home-grid { grid-auto-flow: row dense; }

/* ===== 24 Nov audit ===== */
/* money fields: "Rs 1,200" like every amount in the app (the Rs sits just before the number, both on the right) */
.field.money > .unit.pre { margin-left: auto; color: var(--text2); flex: none; }
.field.money > input { flex: 0 1 auto; width: 9ch; min-width: 3ch; field-sizing: content; }
.field.money > input:placeholder-shown { width: 3ch; }
html .field.money > input, html.mac .field.money > input { flex: 0 1 auto; width: 10ch; min-width: 2ch; field-sizing: content; padding-left: 0; }
html .field.money > .unit.pre { margin-right: -6px; }
html .field.money > input, html.mac .field.money > input { width: 3ch; field-sizing: fixed; max-width: 60%; font-variant-numeric: tabular-nums; }
/* who a sheet is about (Promise, Instalment Plan, Write-off…): a clear heading with room before the first card */
.sheet-lead { margin: 6px 4px 18px; font-size: 17px; font-weight: 600; color: var(--text); text-align: center; }
html.mac .sheet-lead { margin: 2px 2px 14px; font-size: 13px; text-align: left; }
.sheet-lead .sub { font-weight: 400; }
/* menus: separators are a visible hairline (macOS 27 menus), and an empty symbol slot keeps labels aligned */
span.cm-ic { display: inline-block; }
html.mac .cmenu .cm-sep { height: 1px; margin: 5px 12px; background: rgba(0, 0, 0, 0.12); }
@media (prefers-color-scheme: dark) { html.mac:not([data-theme="light"]) .cmenu .cm-sep { background: rgba(255, 255, 255, 0.16); } }

/* ================= Mac redesign (24 Nov 2026): kit window, panes, split view (Mail / Contacts), document page (Pages / Preview) ================= */
html.mac .content { overflow: hidden; }
.pane { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.pane > .scroller { padding-bottom: 40px; }
.pane > .with-inspector, .pane > .doc-canvas, .pane > .detail-empty { flex: 1; min-height: 0; }
.tb-titles.hidden-title { visibility: hidden; }
.toolbar .sb-top, .sb-top .tb-btn { flex: none; }
/* list column (kit .list-col): no page padding of its own; its toolbar keeps the title and the buttons in 320 pt */
.list-col .page { padding: 0 !important; max-width: none !important; margin: 0 !important; }
.list-col .toolbar { padding: 0 12px 0 16px; }
.list-col .toolbar .tb-items { gap: 6px; }
.list-col .toolbar .tb-titles { padding-left: 0; }
.list-col .scroller { padding-bottom: 16px; }
.lc-row .lead { flex: none; }
.lc-row .icon-dot { width: 32px; height: 32px; border-radius: 8px; font-size: 13px; }
.lc-row .icon-dot svg { width: 18px; height: 18px; }
.lc-row.mail .lc-line { color: var(--text); }
.list-col .lc-sec { font-size: 13px; }
/* detail pane: the record keeps the readable column (Contacts, System Settings) */
.detail .scroller { padding-left: 0; padding-right: 0; }
.detail .ccard.in-page { margin-top: calc(-1 * var(--toolbar-h)); }
.detail-pane .toolbar { padding-left: 12px; }
/* document page: the A4 page as it prints, scaled to fit (Preview); the inspector on the right (Pages) */
.paper-html .tbdoc { max-width: none; padding: 0; font-size: 15px; }
.doc-paper { box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 6px 24px rgba(0,0,0,.08); border-radius: 2px; }
.with-inspector { grid-template-columns: minmax(0, 1fr) 280px; }
.inspector a { color: var(--accent); text-decoration: none; }
.inspector .insp-row > :last-child { min-width: 0; overflow-wrap: anywhere; }
.insp-btn { display: inline-flex; align-items: center; margin-top: 8px; }
.insp-note { white-space: pre-wrap; color: var(--text); }
.insp-groups .section-h { margin: 0 0 8px !important; font-size: var(--fs-head, 13px); }
.insp-groups .group { background: transparent !important; }
.insp-groups .group > * + *::before { left: 0 !important; right: 0 !important; }
.insp-groups .row, .insp-groups .field { padding-left: 0 !important; padding-right: 0 !important; min-height: 32px !important; }
.insp-groups .row:hover { background: transparent !important; }
.insp-groups .row.add-row, .insp-groups .row.action { color: var(--accent); }
.insp-groups .section-f { margin: 4px 0 0 !important; }
.insp-groups .att-grid { grid-template-columns: repeat(3, 1fr); }
.insp-sec .insp-groups > .section-h:not(:first-child) { margin-top: 18px !important; }
@media print { .doc-canvas { padding: 0 !important; background: #fff !important; } .doc-paper { zoom: 1 !important; box-shadow: none; width: auto !important; } .inspector, .toolbar { display: none !important; } .with-inspector { display: block !important; } }
.tb-group .tb-pop { width: 34px; height: 36px; padding: 0; justify-content: center; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; position: relative; }
.tb-group .tb-pop:hover { background: var(--fill); border-radius: 999px; }
.tb-group > * + *::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; border-left: 1px solid var(--fill); }
html.mac .lc-row .avatar { width: 32px; height: 32px; font-size: 13px; flex: none; }
/* Contacts card in the detail pane: the poster runs edge to edge (macOS 27 Contacts), the sections below keep the readable column */
.detail .scroller { container-type: inline-size; }
.detail .page.poster-page { --gut: max(20px, calc(50cqw - 390px)); max-width: none !important; margin: 0 !important; padding: 0 var(--gut) 40px !important; }
.detail .poster-page > .ccard.in-page { margin: calc(-1 * var(--toolbar-h)) calc(-1 * var(--gut)) 18px; border-radius: 0; padding-top: calc(var(--toolbar-h) + 8px); }

/* Mac panes scroll inside .scroller (padding-top = the glass toolbar), so sticky headers sit at 0 */
html.mac .tbl th, html.mac .rtbl th, html.mac .scope-bar { top: 0; }
/* macOS tab view: the segmented control is centred over its content */
html.mac .seg-wrap { display: flex; justify-content: center; }

/* Money bar above a Finder table: the band covers only the toolbar; the column headers get their own glass once they stick under it */
.pane:has(.table-page .money-bar) > .toolbar.band::after { height: var(--toolbar-h); }
.table-page:has(.money-bar) .tbl th { background: var(--band-glass) !important; -webkit-backdrop-filter: var(--band-blur); backdrop-filter: var(--band-blur); border-bottom: 1px solid var(--tbl-line); }
.table-page:has(.money-bar) .tbl th:first-child { box-shadow: -10px 0 0 var(--band-glass); } .table-page:has(.money-bar) .tbl th:last-child { box-shadow: 10px 0 0 var(--band-glass); }
html.mac .table-page .money-bar { padding: 16px 10px 18px; }
/* Mac customer / supplier ▸ Transactions: filter pop-ups above a Finder table */
.tx-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.tx-bar .spacer { flex: 1; }
.tx-tab .tbl-wrap { margin: 0; }
/* Finder: a coloured tag dot in a selected (accent) row keeps a white ring so it stays visible */
html.mac .tbl:focus-within tbody tr.sel .state::before { box-shadow: 0 0 0 1.5px #fff; }

/* ---------- Reconcile (QuickBooks / Xero reconcile; tick column like Music's checkbox column, ticks like Reminders) ---------- */
.pane:has(.table-page .rc-head) > .toolbar.band::after { height: var(--toolbar-h); }
.table-page:has(.rc-head) .tbl th { background: var(--band-glass) !important; -webkit-backdrop-filter: var(--band-blur); backdrop-filter: var(--band-blur); border-bottom: 1px solid var(--tbl-line); }
.table-page:has(.rc-head) .tbl th:first-child { box-shadow: -10px 0 0 var(--band-glass); } .table-page:has(.rc-head) .tbl th:last-child { box-shadow: 10px 0 0 var(--band-glass); }
html.mac .table-page .rc-head { padding: 14px 10px 16px; margin-bottom: 0; border-bottom: 0; }
html.mac .table-page .rc-head .rh-stats { margin: 0; }
.rc-warn { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: 12px; line-height: 16px; color: var(--orange-text); }
.rc-warn svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.tbl td.rc-col { padding-left: 4px; padding-right: 0; text-align: center; }
.rc-tick { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; background: none; color: var(--text3); cursor: default; }
.rc-tick svg { width: 17px; height: 17px; }
.rc-tick.on { color: var(--accent); }
html.mac .tbl:focus-within tbody tr.sel .rc-tick.on svg { color: #fff; }
.rc-mark { display: inline-flex; color: var(--text3); } .rc-mark svg { width: 14px; height: 14px; }
.rc-ic { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; color: var(--text3); }
/* iPhone: a whole row toggles, the round tick leads (Reminders) */
.row.rc-row { font: inherit; }
.row.rc-row .rc-tick { width: 26px; height: 26px; flex: none; } .row.rc-row .rc-tick svg { width: 24px; height: 24px; }
.hero .big.pos { color: var(--green-text); }
/* a prominent text button in the toolbar (Finish): a capsule; greyed while it can't be used (macOS 27) */
.tb-btn.text.prominent { width: auto; padding: 0 14px; }
.tb-btn.prominent:disabled, .tb-btn.prominent:disabled:hover { background: var(--gbtn); color: var(--text3); box-shadow: none; }
html.ios .gbtn.prominent:disabled, .gbtn.prominent:disabled { background: var(--gbtn, var(--fill)); color: var(--text3); box-shadow: none; }

/* ===== 24 Nov (late): record pages + reports gallery ===== */
html.mac .page.record-page { max-width: 1180px !important; }
html.mac .record-page .section-h { margin: 22px 0 8px; }
html.mac .record-page > .section-f, html.mac .record-page .section-f { margin-left: 0; margin-right: 0; }
.rec-empty { padding: 4px 0 8px; color: var(--text2); }
.rec-note { white-space: pre-wrap; max-width: 720px; }
.rh-sub a { color: var(--accent); text-decoration: none; }
html.mac .with-inspector > .scroller > .record-page { padding-left: 24px; padding-right: 24px; }
.inspector .att-grid { grid-template-columns: repeat(3, 1fr); }
/* Reports on a wide Mac window: two columns of reports per group (Shortcuts gallery / QuickBooks Standard reports) */
html.mac .page.gallery-page { max-width: 1180px !important; }
@media (min-width: 1100px) {
  html.mac .gallery-page .group:not(:only-child) { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  html.mac .gallery-page .group > .row::before { display: none; }
}
html.mac .gallery-page .group { background: transparent; box-shadow: none; }
html.mac .gallery-page .group > .row { border-radius: 10px; }
html.mac .gallery-page .group > .row:hover { background: var(--fill); }
.sb-link { scroll-margin-block: 30px 56px; }   /* clear of the fade above the account button */
.tx-bar { flex-wrap: wrap; }

/* ===== 24 Nov (native 27.3 pass): customer pages, inspector, full-width records ===== */
html.mac .page.record-page { max-width: none !important; padding-left: 20px !important; padding-right: 20px !important; }
.detail .page.poster-page.record-page { --gut: 20px; }
.insp-off { grid-template-columns: minmax(0, 1fr) !important; }
.insp-off > .inspector { display: none; }
.with-inspector > .inspector { padding-top: calc(var(--toolbar-h) + 4px); }
html.mac .mac-pop { height: 24px; border-radius: 8px; background: var(--btn); padding: 0 8px 0 10px; }
html.mac .mac-pop select { height: 24px; font-size: 13px; padding-right: 18px; }
html.mac .mac-pop:hover { background: color-mix(in srgb, var(--btn), var(--text) 9%); }
html.mac .tb-btn:active, html.mac .tb-pop:active { filter: brightness(1.15); }
html.mac .rec-head { padding-bottom: 16px; margin-bottom: 14px; }
html.mac .rec-head .rh-avatar { width: 64px; height: 64px; font-size: 24px; }
html.mac .rec-head .rh-tile svg { width: 32px; height: 32px; }
.inspector .att-grid { margin-bottom: 8px; }
/* no room beside a record: the inspector goes under it */
@container pane (max-width: 860px) {
  .rec-insp { display: block; overflow-y: auto; height: 100%; }
  .rec-insp > .scroller { overflow: visible; }
  .rec-insp > .inspector { overflow: visible; padding: 4px 10px 24px; box-shadow: none; }
}
html.ios .kpis.two + .group { margin-top: 20px; }
html.mac .pane .record-page > .seg-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.tab-tools { display: flex; gap: 8px; }

.round-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 10px 12px; }
.pane:has(.round-bar) > .toolbar.band::after { height: var(--toolbar-h); }
.table-page:has(.round-bar) .tbl th { background: var(--band-glass) !important; -webkit-backdrop-filter: var(--band-blur); backdrop-filter: var(--band-blur); border-bottom: 1px solid var(--tbl-line); }
.col-name { display: flex; flex-direction: column; } .col-name small { font-size: 11px; color: var(--text2); }
.pick-row { gap: 10px; }
.gap-top { margin-top: 20px; }
html.mac .table-page .gap-top { margin-top: 0; }
.alert .a-msg { white-space: pre-line; }
.tax-wait { display: flex; gap: 6px; align-items: flex-start; color: var(--orange-text, #c55300); }
.tax-wait svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
