/* Aiglith (design shared with Orivara) — light and dark themes share one set of tokens. */
:root, [data-theme="light"] {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --border: #E2E5EA;
  --border-strong: #D0D5DD;
  --text: #18202B;
  --muted: #5A6472;
  --accent: #0B6E6B;
  --accent-hover: #095A57;
  --accent-text: #FFFFFF;
  --accent-soft: #E9F3F2;
  --accent-ink: #0B6E6B;
  --nav-bg: #13233F;
  --nav-text: #C9D2E0;
  --nav-active: rgba(255, 255, 255, 0.12);
  --sel-row: #EEF6F5;
  --bar-track: #E8EBEF;
  --warn-text: #9A3E0B;
  --danger: #B42318;
  --b-requested-bg: #EEF0F3; --b-requested-fg: #3E4753;
  --b-received-bg: #E6F0FB;  --b-received-fg: #1D4E89;
  --b-approved-bg: #E5F4EC;  --b-approved-fg: #1E6B40;
  --b-question-bg: #EFEAFB;  --b-question-fg: #5B3EA0;
  --b-overdue-bg: #FDEBDD;   --b-overdue-fg: #9A3E0B;
  --flash-ok-bg: #E5F4EC; --flash-ok-fg: #1E5A38; --flash-ok-bd: #B9DEC8;
  --flash-warn-bg: #FDEBDD; --flash-warn-fg: #7C3209; --flash-warn-bd: #F5C9A8;
  --bubble-staff: #F1F3F6;
  --bubble-client: #E9F3F2;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0E141C;
  --surface: #151D28;
  --surface-2: #1B2532;
  --border: #263243;
  --border-strong: #34425A;
  --text: #E6EAF0;
  --muted: #9AA6B5;
  --accent: #2BB3AB;
  --accent-hover: #3CC6BE;
  --accent-text: #05211F;
  --accent-soft: #12302F;
  --accent-ink: #5FD0C8;
  --nav-bg: #0A111C;
  --nav-text: #A9B5C6;
  --nav-active: rgba(255, 255, 255, 0.09);
  --sel-row: #17302F;
  --bar-track: #263243;
  --warn-text: #F4A26B;
  --danger: #F97066;
  --b-requested-bg: #252F3D; --b-requested-fg: #C3CCD8;
  --b-received-bg: #172C47;  --b-received-fg: #8DBDF2;
  --b-approved-bg: #143222;  --b-approved-fg: #7DD3A0;
  --b-question-bg: #2A2145;  --b-question-fg: #C2AEF5;
  --b-overdue-bg: #3A2213;   --b-overdue-fg: #F4A26B;
  --flash-ok-bg: #143222; --flash-ok-fg: #A6E3BF; --flash-ok-bd: #1F4D33;
  --flash-warn-bg: #3A2213; --flash-warn-fg: #F7C29A; --flash-warn-bd: #5C3519;
  --bubble-staff: #1F2A38;
  --bubble-client: #13302E;
  --shadow: none;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg: #0E141C;
    --surface: #151D28;
    --surface-2: #1B2532;
    --border: #263243;
    --border-strong: #34425A;
    --text: #E6EAF0;
    --muted: #9AA6B5;
    --accent: #2BB3AB;
    --accent-hover: #3CC6BE;
    --accent-text: #05211F;
    --accent-soft: #12302F;
    --accent-ink: #5FD0C8;
    --nav-bg: #0A111C;
    --nav-text: #A9B5C6;
    --nav-active: rgba(255, 255, 255, 0.09);
    --sel-row: #17302F;
    --bar-track: #263243;
    --warn-text: #F4A26B;
    --danger: #F97066;
    --b-requested-bg: #252F3D; --b-requested-fg: #C3CCD8;
    --b-received-bg: #172C47;  --b-received-fg: #8DBDF2;
    --b-approved-bg: #143222;  --b-approved-fg: #7DD3A0;
    --b-question-bg: #2A2145;  --b-question-fg: #C2AEF5;
    --b-overdue-bg: #3A2213;   --b-overdue-fg: #F4A26B;
    --flash-ok-bg: #143222; --flash-ok-fg: #A6E3BF; --flash-ok-bd: #1F4D33;
    --flash-warn-bg: #3A2213; --flash-warn-fg: #F7C29A; --flash-warn-bd: #5C3519;
    --bubble-staff: #1F2A38;
    --bubble-client: #13302E;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); }
a:hover { color: var(--accent-hover); }
h1 { font-size: 24px; font-weight: 600; margin: 0; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }
code { font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.muted, .sub { color: var(--muted); }
.sub { font-size: 12px; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.right { float: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.accent-text { color: var(--accent-ink); font-weight: 500; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; min-height: 44px; }
.btn.on-dark { background: transparent; border-color: rgba(255,255,255,.3); color: #FFFFFF; }
.btn.on-dark:hover { background: rgba(255,255,255,.1); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
form.inline { display: inline; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.top-gap { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
label { display: block; font-weight: 500; font-size: 13px; }
label > input, label > select, label > textarea { display: block; margin-top: 6px; }
label > small { display: block; margin-top: 4px; font-weight: 400; }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=number], input[type=search], input:not([type]), select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 12px; min-height: 40px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Theme switch */
.theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; padding: 2px; background: var(--surface-2); }
.theme-switch .seg {
  width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer;
}
.theme-switch .seg:hover { color: var(--text); }
.theme-switch .seg.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.client-top .theme-switch { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.client-top .theme-switch .seg { color: #C9D2E0; }
.client-top .theme-switch .seg.on { background: rgba(255,255,255,.18); color: #FFFFFF; }

/* Staff shell */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 236px; flex-shrink: 0; background: var(--nav-bg); color: #FFFFFF;
  display: flex; flex-direction: column; gap: 28px; padding: 22px 14px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent;
}
.side::-webkit-scrollbar { width: 8px; }
.side::-webkit-scrollbar-track { background: transparent; }
.side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 8px; }
.side::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.36); }
.side > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 12px 8px; color: #FFFFFF; text-decoration: none; font-size: 18px; font-weight: 700; }
.brand:hover { color: #FFFFFF; }
.brand svg { color: #FFFFFF; }
.brand.dark { color: var(--text); }
.brand.dark svg { color: var(--text); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: var(--nav-text); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: #FFFFFF; background: rgba(255,255,255,.06); }
.nav a.on { background: var(--nav-active); color: #FFFFFF; font-weight: 600; }
.firm-chip { margin-top: auto; padding: 12px; border-radius: 8px; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 600; color: #FFFFFF; }
.firm-chip small { display: block; font-weight: 400; color: var(--nav-text); font-size: 12px; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  min-height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 28px; flex-wrap: wrap;
}
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); flex-wrap: wrap; min-width: 0; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .here { color: var(--text); font-weight: 500; }
.top-right { display: flex; align-items: center; gap: 12px; }
.me { display: flex; align-items: center; gap: 10px; }
.me-text { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }
.me-text small { color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-text);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.avatar.sm.client-av { background: var(--b-received-bg); color: var(--b-received-fg); }
.content { padding: 28px; display: flex; flex-direction: column; gap: 22px; max-width: 1500px; width: 100%; }

/* Layout pieces */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head.tight { align-items: flex-start; }
.page-head p { margin: 6px 0 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cols.wide-side { grid-template-columns: minmax(0, 1fr) 400px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi-label { color: var(--muted); font-weight: 500; font-size: 13px; }
.kpi-value { font-size: 30px; font-weight: 600; line-height: 1.2; }
.kpi-value.warn { color: var(--warn-text); }
.kpi-value.good { color: var(--accent-ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 16px; border: 1px solid var(--border-strong); color: var(--text); text-decoration: none; font-size: 13px; }
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.on, .chip.on:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.empty { color: var(--muted); padding: 20px; margin: 0; }
.card:not(.flush) > .empty, .empty.sm { padding: 4px 0 8px; }

/* Tables */
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px 14px; background: var(--surface-2); }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table td { padding: 13px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tr.sel td { background: var(--sel-row); }
.table.selectable tbody tr:hover td { background: var(--surface-2); }
.table.selectable tbody tr.sel:hover td { background: var(--sel-row); }
.strong-link { color: var(--text); font-weight: 600; text-decoration: none; }
.strong-link:hover { color: var(--accent-ink); text-decoration: underline; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-requested { background: var(--b-requested-bg); color: var(--b-requested-fg); }
.b-received { background: var(--b-received-bg); color: var(--b-received-fg); }
.b-approved { background: var(--b-approved-bg); color: var(--b-approved-fg); }
.b-question { background: var(--b-question-bg); color: var(--b-question-fg); }
.b-overdue { background: var(--b-overdue-bg); color: var(--b-overdue-fg); }

/* Progress bars (widths in 5% steps so no inline styles are needed) */
.progress { display: flex; align-items: center; gap: 10px; }
.ptext { font-size: 13px; color: var(--muted); white-space: nowrap; }
.bar { width: 90px; height: 6px; border-radius: 3px; background: var(--bar-track); overflow: hidden; flex-shrink: 0; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.big { width: 100%; height: 8px; margin-top: 8px; }
.bar.hero { width: 100%; height: 8px; background: rgba(255,255,255,.18); margin-top: 10px; }
.bar.hero span { background: #7FD1C9; }
.w0 { width: 0; } .w5 { width: 5%; } .w10 { width: 10%; } .w15 { width: 15%; } .w20 { width: 20%; }
.w25 { width: 25%; } .w30 { width: 30%; } .w35 { width: 35%; } .w40 { width: 40%; } .w45 { width: 45%; }
.w50 { width: 50%; } .w55 { width: 55%; } .w60 { width: 60%; } .w65 { width: 65%; } .w70 { width: 70%; }
.w75 { width: 75%; } .w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; } .w95 { width: 95%; } .w100 { width: 100%; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 10px; border: 1px solid; font-weight: 500; }
.flash.ok { background: var(--flash-ok-bg); color: var(--flash-ok-fg); border-color: var(--flash-ok-bd); }
.flash.warn { background: var(--flash-warn-bg); color: var(--flash-warn-fg); border-color: var(--flash-warn-bd); }
.invite-box { display: flex; flex-direction: column; gap: 8px; font-weight: 400; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* Activity & people */
.activity, .people, .files, .sent-list, .thread { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.45; }
.activity li:first-child { border-top: 0; }
.people li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.people li:first-child { border-top: 0; }

/* Audit page */
.audit-head { display: flex; flex-direction: column; gap: 18px; }
.facts { display: flex; gap: 32px; flex-wrap: wrap; font-size: 13px; }
.facts > div { display: flex; flex-direction: column; gap: 3px; }
.grow-fact { flex: 1; min-width: 220px; }
.panel { padding: 0; position: sticky; top: 16px; }
.panel-sec { padding: 18px 20px; border-top: 1px solid var(--border); }
.panel-sec:first-child { border-top: 0; }
.panel h2 { margin: 0 0 8px; font-size: 17px; }
.meta-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.files li { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.file-ico { color: var(--muted); display: inline-flex; }
.fname { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.files.mini li { border: 0; padding: 4px 0; margin: 0; gap: 8px; font-size: 13px; }
.upload-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.file-pick {
  display: flex; flex-direction: row; align-items: center; gap: 8px; flex: 1; min-width: 180px; cursor: pointer;
  border: 1px dashed var(--border-strong); border-radius: 8px; padding: 8px 12px; font-weight: 500; color: var(--muted); min-height: 40px; position: relative;
}
.file-pick:hover, .file-pick:focus-within { border-color: var(--accent); color: var(--text); }
.file-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-pick.big { min-height: 56px; justify-content: center; font-size: 15px; background: var(--surface-2); }
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.thread li { display: flex; flex-direction: column; gap: 4px; }
.bubble { background: var(--bubble-staff); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.from-client .bubble { background: var(--bubble-client); }
.thread.compact { margin: 12px 0 0; }
details.add-req { border-top: 1px solid var(--border); padding: 14px 20px; }
details summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); min-height: 32px; display: flex; align-items: center; }
details[open] summary { margin-bottom: 12px; }

/* Public pages (login, setup, invite) */
.public-wrap { max-width: 440px; margin: 0 auto; padding: 40px 16px; }
.public-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.public-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.public-card h1 { font-size: 22px; }
.public-card p { margin: 0; }
.demo-box { font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.demo-box ul { margin: 6px 0 0; padding-left: 18px; }

/* Client portal */
.client-top { background: var(--nav-bg); color: #FFFFFF; }
.client-top-inner { max-width: 1680px; margin: 0 auto; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.firm-brand { display: flex; align-items: center; gap: 10px; color: #FFFFFF; text-decoration: none; font-weight: 600; font-size: 15px; }
.firm-brand:hover { color: #FFFFFF; }
.firm-mark { width: 34px; height: 34px; border-radius: 8px; background: #FFFFFF; color: #13233F; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.client-main { max-width: 1680px; margin: 0 auto; padding: 0 16px 32px; display: flex; flex-direction: column; gap: 14px; }
.client-main > .flash:first-child { margin-top: 16px; }
.client-h1 { margin-top: 24px; }
.client-hero { background: var(--nav-bg); color: #FFFFFF; margin: 0 -16px; padding: 4px 16px 24px; }
.client-hero h1 { font-size: 21px; margin: 4px 0 16px; }
.sub.on-dark { color: var(--nav-text); font-size: 13px; }
.hero-progress { background: rgba(255,255,255,.08); border-radius: 12px; padding: 14px 16px; }
.hero-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.section-title { font-size: 16px; margin: 10px 0 0; }
.req-card { display: flex; flex-direction: column; gap: 6px; }
.req-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.req-top h3 { font-size: 15px; margin: 0; line-height: 1.35; }
.upload-block { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
details.reply { margin-top: 4px; }
details.reply summary { font-size: 14px; }
.sent-list > li { padding: 14px 18px; border-top: 1px solid var(--border); }
.sent-list > li:first-child { border-top: 0; }
.audit-card { display: flex; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--text); align-items: center; flex-wrap: wrap; }
.audit-card:hover { border-color: var(--accent); color: var(--text); }
.client-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 32px; }

/* Responsive */
@media (max-width: 1100px) {
  .cols, .cols.wide-side { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; overflow-x: auto; }
  .nav { flex-direction: row; }
  .firm-chip { display: none; }
  .topbar { padding: 10px 16px; }
  .me-text { display: none; }
  .content { padding: 16px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .kpi-value { font-size: 24px; }
}

/* Branding, settings and account */
a.me { text-decoration: none; color: var(--text); border-radius: 10px; padding: 2px 6px 2px 2px; }
a.me:hover { background: var(--surface-2); color: var(--text); }
.firm-logo { display: inline-flex; align-items: center; justify-content: center; background: #FFFFFF; border-radius: 8px; height: 34px; padding: 3px 6px; }
.firm-logo img { max-height: 28px; max-width: 120px; display: block; }
.chip-logo { margin-bottom: 8px; height: 40px; }
.chip-logo img { max-height: 34px; max-width: 170px; }
.logo-preview { display: inline-flex; background: #FFFFFF; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.logo-preview img { max-height: 64px; max-width: 260px; display: block; }
.brand-sample { display: flex; align-items: center; gap: 10px; background: var(--nav-bg); color: #FFFFFF; border-radius: 10px; padding: 14px 16px; font-weight: 600; margin-bottom: 12px; }
.brand-sample img { max-height: 28px; max-width: 120px; background: #FFFFFF; border-radius: 6px; padding: 3px 6px; }
.top-gap-sm { margin-top: 12px; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.client-pad { padding-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.edit-req { margin-top: 12px; }
@media (max-width: 760px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }
details.roll { border-top: 1px solid var(--border); padding-top: 12px; }
.roll-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 900px) { .roll-form { grid-template-columns: minmax(0, 1fr); } }
.firm-brand { min-width: 0; }
@media (max-width: 360px) { .client-top-inner { flex-wrap: wrap; } }
.client-top .top-right { gap: 8px; }
@media (max-width: 560px) {
  .firm-name.has-logo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .client-top .btn.sm { padding: 0 10px; }
}

/* Wordmark */

/* ---- Client portal: navigation, timeline, guidance, assignment, camera ---- */
.b-rejected { background: var(--b-overdue-bg); color: var(--b-overdue-fg); }
.b-na { background: var(--b-question-bg); color: var(--b-question-fg); }
.client-nav { max-width: 1680px; margin: 0 auto; padding: 0 8px; display: flex; gap: 2px; overflow-x: auto; }
.client-nav a { color: var(--nav-text); text-decoration: none; padding: 10px 10px 11px; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; min-height: 44px; display: inline-flex; align-items: center; }
.client-nav a:hover { color: #FFFFFF; }
.client-nav a.on { color: #FFFFFF; border-bottom-color: #E8A33D; font-weight: 600; }
.timeline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tl-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; text-decoration: none; font-size: 13px; font-weight: 500; }
.tl-chip b { font-size: 15px; }
.tl-chip:hover { filter: brightness(0.96); }
.chips.mine { margin-top: 2px; }
.section-title .count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--bar-track); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; vertical-align: 2px; margin-left: 4px; }
.client-main section { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 12px; }
.client-main .section-title { scroll-margin-top: 12px; }
.req-card.attention { border-color: var(--b-question-fg); }
.guidance { margin: 6px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: 13px; }
.callout { margin: 6px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--b-question-bg); color: var(--text); font-size: 13px; }
.callout.warn { background: var(--flash-warn-bg); color: var(--flash-warn-fg); border: 1px solid var(--flash-warn-bd); }
.panel .guidance, .panel .callout { margin: 0 0 12px; }
.req-actions { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.req-actions details.reply summary { color: var(--accent-ink); }
.assign { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.assign label { flex-direction: row; font-size: 13px; color: var(--muted); font-weight: 500; }
.assign select { width: auto; flex: 1; min-width: 150px; min-height: 36px; padding: 5px 10px; }
.js [data-hide-with-js] { display: none; }
.file-pick.dragging { border-color: var(--accent); border-style: solid; background: var(--accent-soft); color: var(--text); }
.file-pick.camera { display: none; justify-content: center; min-height: 48px; }
@media (max-width: 760px) { .file-pick.camera { display: flex; } }
.files.shared li:last-child { margin-bottom: 0; }
.files.shared .fname { text-decoration: none; }
.files.shared a.fname:hover { text-decoration: underline; }
.files.shared + .upload-inline { margin-top: 12px; }
.thread-title { font-size: 15px; margin: 0; line-height: 1.35; }
.thread-title a { color: var(--text); text-decoration: none; }
.thread-title a:hover { color: var(--accent-ink); text-decoration: underline; }
.client-main .files.mini { margin-top: 6px; }
@media (max-width: 480px) {
  .client-nav { padding: 0 6px; }
  .client-nav a { font-size: 13px; padding-left: 7px; padding-right: 7px; }
}

/* Removing files */
.link-btn { background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 13px; font-weight: 500; color: var(--accent-ink); cursor: pointer; text-decoration: underline; min-height: 32px; }
.link-btn.danger { color: var(--danger); }
.files.mini li form { margin-left: auto; }
.files.mini li a { overflow-wrap: anywhere; }
.clear-files { align-self: flex-start; }

/* ---- Client portal: request list and detail panel ---- */
.portal { display: flex; flex-direction: column; gap: 14px; }
.portal-cols { display: grid; grid-template-columns: clamp(340px, 32%, 500px) minmax(0, 1fr); gap: 24px; align-items: start; }
.portal-list { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.req-list { list-style: none; margin: 0; padding: 0; }
.req-list li + li { border-top: 1px solid var(--border); }
.req-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; min-height: 58px; text-decoration: none; color: var(--text); }
.req-row:hover { background: var(--surface-2); color: var(--text); }
.req-row.sel, .req-row.sel:hover { background: var(--sel-row); box-shadow: inset 3px 0 0 var(--accent); }
.req-row .grow { display: flex; flex-direction: column; gap: 2px; }
.rname { font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
.portal-detail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 24px; }
.client-main section.portal-detail { gap: 8px; }
.portal-detail h2 { font-size: 19px; margin: 0; line-height: 1.3; }
.portal-detail .upload-block { margin-top: 8px; }
.back-link { display: none; }
.callout.ok { background: var(--b-approved-bg); color: var(--b-approved-fg); }
@media (min-width: 901px) {
  .client.wide .client-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: center; padding: 14px 24px 22px; margin: 0; border-radius: 0 0 14px 14px; }
  .client.wide .client-hero h1 { margin-bottom: 0; }
}
@media (max-width: 900px) {
  .portal-cols { grid-template-columns: minmax(0, 1fr); }
  .portal-detail { display: none; position: static; max-height: none; overflow: visible; padding: 16px 18px 18px; }
  .portal.has-sel .portal-list, .portal.has-sel .client-hero, .portal.has-sel .timeline,
  .portal.has-sel .chips.mine, .portal.has-sel .portal-note { display: none; }
  .client-main section.portal-detail { display: none; }
  .client-main .portal.has-sel section.portal-detail { display: flex; margin-top: 14px; }
  .portal:not(.has-sel) .req-row.sel { background: none; box-shadow: none; }
  .back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; font-weight: 600; text-decoration: none; align-self: flex-start; }
}

/* Client pages use the width of the screen (up to a limit); reading pages keep a comfortable column. */
.narrow { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 760px; }
.thread .bubble { max-width: 760px; }
.thread li { align-items: flex-start; }
.thread .bubble { align-self: stretch; }
@media (min-width: 901px) {
  .client-top-inner, .client-main { padding-left: 28px; padding-right: 28px; }
  .client-nav { padding-left: 18px; padding-right: 18px; }
  .client-foot { text-align: left; max-width: 1680px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
}

/* Removing access, archiving and deleting */
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions.start { justify-content: flex-start; }
.flash form.inline { margin-left: 8px; }
.btn.danger { border-color: var(--danger); }
.people li { flex-wrap: wrap; }
.people .grow b, .people .grow .sub { overflow-wrap: anywhere; }
.people .row-actions { width: 100%; justify-content: flex-start; padding-left: 44px; }
.people .row-actions:empty { display: none; }

/* "Powered by Orivara" on the client portal: the firm's brand leads, the product is credited. */
.powered { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: var(--nav-text); }
.powered svg { width: 20px; height: 20px; color: #FFFFFF; flex-shrink: 0; }
.powered .wordmark { font-size: 16px; color: #FFFFFF; }
.powered.in-header { margin-right: 6px; }
.client-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: center; }
.client-foot .powered { color: var(--muted); }
.client-foot .powered svg, .client-foot .powered .wordmark { color: var(--text); }
@media (min-width: 901px) { .client-foot { justify-content: flex-start; } }
@media (max-width: 760px) { .powered.in-header { display: none; } }

/* Team pages and invitations */
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.invite-row { display: flex; flex-direction: column; gap: 4px; }
.invite-email { font-weight: 600; font-size: 13px; }
.plain-list { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }
.client-nav .short { display: none; }
@media (max-width: 480px) { .client-nav .long { display: none; } .client-nav .short { display: inline; } }
.team-list { list-style: none; margin: 0; padding: 0; }
.team-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.team-list li:first-child { border-top: 0; padding-top: 0; }
.team-list .row-actions { width: 100%; justify-content: flex-start; padding-left: 44px; }
.team-list .row-actions:empty { display: none; }
details.forgot summary { font-size: 13px; font-weight: 500; }
details.forgot p { margin: 0; }

/* Switching between years (audits) on the client portal */
.year-switch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ys-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-right: 4px; }
.ys { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.ys:hover { background: var(--surface-2); color: var(--text); }
.ys.on, .ys.on:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.ys-closed { font-size: 11px; font-weight: 500; opacity: .75; }

/* Group clients: choose the entity, then the year */
.entity-switch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entity-switch label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.entity-switch select { width: auto; flex: 1; min-width: 200px; max-width: 420px; min-height: 42px; font-weight: 600; }
.hero-entity { font-size: 15px; font-weight: 600; margin-top: 2px; opacity: .92; }
.entity-actions details { flex: 1; min-width: 0; }
.people .entity-actions { padding-left: 0; }

/* Sortable headings and list search */
.th-sort { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: inherit; text-decoration: none; }
.th-sort:hover { color: var(--text); }
.th-sort .arrow { font-size: 10px; opacity: .45; }
.th-sort.on { color: var(--text); }
.th-sort.on .arrow { opacity: 1; color: var(--accent); }
.search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.search input { flex: 1; min-width: 0; max-width: 420px; min-height: 38px; }

/* Confirmations float at the bottom of the screen (when scripts run) instead of pushing the page down */
.js .flash.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: min(92vw, 460px); box-shadow: 0 8px 28px rgba(0, 0, 0, .28); cursor: pointer; transition: opacity .35s, transform .35s; margin: 0; }
.js .flash.toast.leaving { opacity: 0; transform: translate(-50%, 12px); }
@media (prefers-reduced-motion: reduce) { .js .flash.toast { transition: none; } }

.file-pick.busy { opacity: .7; pointer-events: none; }

.chosen-files { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.chosen-files li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.chosen-files li span { overflow-wrap: anywhere; }

/* Dashboard numbers are links to the matching audits */
a.kpi { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--accent); transform: translateY(-1px); color: inherit; }
a.kpi.on { border-color: var(--accent); }
#h-active { scroll-margin-top: 90px; }

/* Teams, review chain, internal notes */
.muted-tag { background: var(--surface-2); color: var(--muted); }
.lock-tag { background: var(--flash-warn-bg); color: var(--flash-warn-fg); margin-left: 6px; }
.chips.scope { margin: 0 0 16px; }
.top-space { margin-top: 20px; }
.team-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.team-box > summary, .review-box + .btn-row { cursor: pointer; }
.team-box > summary { font-weight: 600; }
.team-people { margin-top: 8px; }
.team-people li { flex-wrap: nowrap; }
.team-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.team-add label { font-size: 13px; color: var(--muted); }
.team-add select { width: auto; flex: 1; min-width: 220px; max-width: 380px; }
.review-box { margin: 14px 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.review-steps { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; padding: 0; }
.review-steps li { flex: 1; min-width: 120px; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 2px; }
.review-steps li.done { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.review-form textarea { min-height: 56px; }
.badge.b-prepared { background: var(--accent-soft); color: var(--accent-ink); }
.badge.b-reviewed { background: var(--flash-ok-bg); color: var(--flash-ok-fg); }
.internal { border-left: 3px solid var(--flash-warn-bd); }
.internal h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.thread.notes .bubble { background: var(--flash-warn-bg); color: var(--text); }
.level-form { display: flex; gap: 6px; align-items: center; }
.level-form select { width: auto; min-height: 34px; padding: 4px 8px; }
label.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
label.radio input { margin-top: 3px; width: auto; }

/* Inbox, tabs, section sign-off */
.nav-count { display: inline-block; margin-left: 8px; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--amber, #E8A33D); color: #13233F; font-size: 11px; font-weight: 700; text-align: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber, #E8A33D); margin-right: 8px; vertical-align: 1px; }
.inbox li.unread { background: var(--accent-soft); }
.inbox li { padding-left: 20px; padding-right: 20px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 16px -20px -20px; padding: 0 12px; border-top: 1px solid var(--border); }
.tab { padding: 12px 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.narrow-card { max-width: 860px; }
.section-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; }
.section-form > div { flex: 1; min-width: 220px; }
.section-form select { width: auto; min-width: 200px; }
fieldset.checks { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 0; display: grid; gap: 8px; }
fieldset.checks legend { font-size: 13px; font-weight: 500; padding: 0 6px; }

/* Administrator screens */
.seat-box { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 14px; }
.table.rights th { white-space: normal; min-width: 84px; font-size: 10px; vertical-align: bottom; }
.table.rights td.tick { text-align: center; }
.table.rights td.tick input { width: 18px; height: 18px; }
.table.rights td input[type=text], .table.rights td input:not([type]) { min-width: 180px; min-height: 36px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); }
.rights-help { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 14px; }
.rights-help dt { font-weight: 600; }
.rights-help dd { margin: 0; color: var(--muted); }
.warn-card { border-color: var(--flash-warn-bd); }
.plain-list.todo li { margin-bottom: 8px; font-weight: 400; }

.card-note { padding: 0 20px 16px; margin: 0; }
.empty.pad { padding: 16px 20px; }

.kpi-value.small-value { font-size: 22px; }
.fy-row { display: flex; gap: 8px; margin-top: 6px; }
.fy-row select { margin-top: 0; }

/* Administrator: getting started */
.setup { border-color: var(--accent); margin-bottom: 20px; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.setup-head h2 { margin: 0 0 2px; }
.setup-steps { list-style: none; margin: 14px 0 0; padding: 0; }
.setup-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.setup-steps li.done { opacity: .7; }
.step-mark { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; border: 1px solid var(--border-strong); color: var(--muted); }
.setup-steps li.done .step-mark { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.setup-show { margin-bottom: 14px; }

/* Phones and small tablets: the main menu folds into a Menu button (when scripts run) */
.menu-btn { display: none; }
@media (max-width: 760px) {
  .js .side { flex-wrap: wrap; overflow: visible; justify-content: space-between; position: relative; }
  .js .menu-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #FFFFFF; font: inherit; font-weight: 600; cursor: pointer; }
  .js .menu-btn[aria-expanded="true"] { background: var(--nav-active); }
  .menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; content: ''; }
  .menu-bars { position: relative; }
  .menu-bars::before { position: absolute; top: -6px; }
  .menu-bars::after { position: absolute; top: 6px; }
  .js .side .nav { display: none; }
  .js .side.open .nav { display: flex; flex-direction: column; gap: 2px; flex-basis: 100%; padding: 8px 0 4px; }
  .js .side.open .nav a { padding: 14px 12px; font-size: 16px; }
  .topbar .crumbs { min-width: 0; overflow-wrap: anywhere; }
}

/* Two-step login */
.steps { margin: 0; padding-left: 22px; display: grid; gap: 18px; }
.qr { margin: 12px 0; }
.qr svg { display: block; max-width: 100%; height: auto; border: 1px solid var(--line, #d9dee5); border-radius: 8px; }
.setup-key { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; letter-spacing: .06em; word-break: break-all; }
.code-input { font-size: 1.4rem; letter-spacing: .3em; max-width: 12ch; font-variant-numeric: tabular-nums; }
.code-form { margin-top: 10px; }

/* A person's own picture */
.avatar.has-photo { background: none; overflow: hidden; }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.photo-row p { margin: 0; }

/* The request list: filters, ticking and changing several at once */
.list-tools { display: flex; flex-direction: column; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-tools .search select { width: auto; max-width: 200px; min-height: 38px; }
th.tick, td.tick { width: 36px; padding-right: 0; }
td.tick input, th.tick input { width: 18px; height: 18px; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.bulk-title { flex-basis: 100%; font-size: 13px; }
.bulk-group { display: flex; gap: 6px; align-items: center; }
.bulk-group input, .bulk-group select { width: auto; min-height: 34px; max-width: 180px; }
.js .bulk-bar:not(.active) .bulk-group { opacity: .5; }

/* Reminders and the printable outstanding list */
.chase-all { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chase-all input { flex: 1; min-width: 180px; min-height: 36px; }
.print-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.sheet { background: #fff; color: #111; border: 1px solid var(--border); border-radius: 10px; padding: 36px 40px; max-width: 900px; }
.sheet h1 { font-size: 24px; margin: 4px 0 6px; color: #111; }
.sheet-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid #111; padding-bottom: 14px; margin-bottom: 8px; }
.sheet-sub { margin: 0; font-size: 14px; color: #333; }
.sheet-meta { text-align: right; font-size: 13px; color: #333; line-height: 1.7; white-space: nowrap; }
.sheet-sec h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; margin: 22px 0 6px; color: #333; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #555; border-bottom: 1px solid #999; padding: 6px 8px; }
.sheet-table td { border-bottom: 1px solid #ddd; padding: 8px; vertical-align: top; color: #111; }
.sheet-table .tickbox { width: 26px; }
.sheet-table td.tickbox span { display: block; width: 14px; height: 14px; border: 1.5px solid #555; border-radius: 2px; margin-top: 2px; }
.late-text { color: #b42318; font-weight: 600; }
.sheet-foot { margin-top: 26px; font-size: 12px; color: #444; }
@media (max-width: 700px) { .sheet { padding: 20px 16px; } .sheet-head { flex-direction: column; } .sheet-meta { text-align: left; } }
@media print {
  .side, .topbar, .no-print, .toast, .skip { display: none !important; }
  body, .shell, .main-col, .content { background: #fff !important; display: block !important; margin: 0 !important; padding: 0 !important; }
  .sheet { border: 0; padding: 0; max-width: none; }
  .sheet-sec { break-inside: avoid; }
  .sheet-table tr { break-inside: avoid; }
}
.sheet-table { table-layout: fixed; }
.sheet-table th:nth-child(2) { width: 32%; } .sheet-table th:nth-child(3) { width: 17%; } .sheet-table th:nth-child(4) { width: 14%; }

/* Deadlines: totals, the weeks ahead, readiness */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--accent); color: var(--text); }
.tile-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tile-num { font-size: 32px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 13px; color: var(--muted); }
.tile.bad { border-color: var(--danger); }
.tile.bad .tile-num { color: var(--danger); }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chart-wrap { overflow-x: auto; }
.chart { display: block; width: 100%; min-width: 560px; height: auto; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-base { stroke: var(--border-strong, var(--border)); stroke-width: 1; }
.chart-tick, .chart-lab { fill: var(--muted); font-size: 11px; }
.chart-val { fill: var(--text); font-size: 12px; font-weight: 600; }
.chart-audit { fill: var(--text); font-size: 11px; font-weight: 600; }
.chart-bar { fill: var(--accent); }
.chart-hit { fill: transparent; }
.chart-week:hover .chart-hit { fill: var(--surface-2); }
.chart-week.now .chart-lab { font-weight: 700; fill: var(--text); }
.bar span.warn { background: var(--danger); }
.pad { padding: 0 20px 14px; }

.table th.num, .table td.num { text-align: right; }
.table { }
.due-list { table-layout: fixed; }
.due-list th:nth-child(1) { width: 46%; } .due-list th:nth-child(2) { width: 34%; }
@media (max-width: 700px) { .due-list { table-layout: auto; } }

/* Workload: one bar per person, three steps */
:root, [data-theme="light"] { --seg-prepare: #2a78d6; --seg-review: #eb6834; --seg-complete: #1baf7a; }
[data-theme="dark"] { --seg-prepare: #3987e5; --seg-review: #d95926; --seg-complete: #199e70; }
@media (prefers-color-scheme: dark) { [data-theme="system"] { --seg-prepare: #3987e5; --seg-review: #d95926; --seg-complete: #199e70; } }
.seg-prepare { fill: var(--seg-prepare); background: var(--seg-prepare); }
.seg-review { fill: var(--seg-review); background: var(--seg-review); }
.seg-complete { fill: var(--seg-complete); background: var(--seg-complete); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: baseline; }
.load { display: inline-flex; align-items: center; gap: 10px; }
.load-bar { display: block; flex-shrink: 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.step-tag { white-space: nowrap; font-size: 13px; }
.card-head.sub-head { border-top: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; }
div.tile:hover { border-color: var(--border); }
.insight li { margin-bottom: 6px; }

.lead-note { margin: 14px 0 0; }
.table.room { table-layout: fixed; }
.table.room th:nth-child(1) { width: 28%; } .table.room th:nth-child(2) { width: 20%; } .table.room th:last-child { width: 12%; }
@media (max-width: 800px) { .table.room { table-layout: auto; } }

/* Levels that fold away */
.fold-tools { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
html:not(.js) [data-show-with-js] { display: none; }
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 14px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary:hover { background: var(--surface-2); }
details.fold:not([open]) > summary { border-bottom: 0; }
.fold-note { flex: 1; color: var(--muted); font-size: 13px; }
.fold-arrow { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 6px 4px 0; }
details.fold:not([open]) .fold-arrow { transform: rotate(-45deg); margin-bottom: 0; }
details.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.clients-list th:first-child, .clients-list td:first-child { min-width: 260px; }

/* A group client in the Clients list: a label that opens into its companies */
.group-fold { margin-top: 4px; font-size: 13px; }
.group-fold > summary { cursor: pointer; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; }
.group-fold > summary::-webkit-details-marker { display: none; }
.group-fold > summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); margin-left: 2px; }
.group-fold[open] > summary::after { transform: rotate(45deg); margin-bottom: 3px; }
.group-fold > summary:hover { color: var(--text); }
.group-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.group-fold ul { margin: 6px 0 2px; padding-left: 18px; color: var(--text); }
.group-fold li { padding: 2px 0; }

/* Rows that open a page */
.js tr.row-open { cursor: pointer; }
tr.row-open:hover td { background: var(--surface-2); }
tr.row-open:hover .strong-link { color: var(--accent-ink); text-decoration: underline; }
.group-fold li a { color: var(--text); }
.group-fold li a:hover { color: var(--accent-ink); }
.people li.picked { background: var(--sel-row); border-radius: 8px; }

/* A client's profile */
.profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 28px; margin: 4px 0 12px; }
.profile-grid dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 3px; }
.profile-grid dd { margin: 0; overflow-wrap: anywhere; }
.profile-grid > div:last-child { grid-column: span 1; }
.pre { white-space: pre-line; }
.profile-notes { margin: 0 0 12px; font-size: 14px; }
@media (max-width: 1100px) { .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }

/* Anything marked hidden stays hidden, whatever its usual layout */
[hidden] { display: none !important; }

/* Figures that also narrow a list */
.tiles-5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.filter-note { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* The Audits page: filters in one row, pages, and the new-audit form on demand */
.audit-tools { gap: 12px; flex-wrap: wrap; }
.audit-tools .search { flex-wrap: wrap; }
.audit-tools .search select { width: auto; max-width: 210px; min-height: 38px; }
.audit-tools .search input[type="search"] { min-width: 220px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.btn.off { opacity: .4; pointer-events: none; }
.new-audit { max-width: 720px; }

.who { display: flex; align-items: center; gap: 12px; }
.who .sub a { color: inherit; }

/* The inbox in the top corner */
.mailbox { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }
.mailbox:hover, .mailbox.on { color: var(--text); background: var(--surface-2); border-color: var(--border-strong, var(--border)); }
.mail-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--amber, #E8A33D); color: #13233F; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }

/* Show or hide a password */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.pw-eye:hover { color: var(--text); background: var(--surface-2); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Client portal: the conversation lives in the request itself */
.req-talk { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.req-talk h3 { margin: 0 0 10px; font-size: 15px; }
.req-talk textarea { min-height: 64px; }
.msg-new { color: var(--accent-ink); font-weight: 600; }

.mailbox.on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.mailbox.on-dark:hover, .mailbox.on-dark.on { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.5); }
.mailbox.on-dark .mail-count { box-shadow: none; }

/* Messages drop-down under the mailbox */
.mailmenu { position: relative; }
.mailmenu > summary { list-style: none; cursor: pointer; }
.mailmenu > summary::-webkit-details-marker { display: none; }
.mailmenu[open] > summary { background: rgba(255,255,255,.12); }
.mail-drop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.mail-drop-head { margin: 0; padding: 12px 14px; font-weight: 700; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mail-drop-n { font-weight: 600; font-size: 12px; color: var(--muted); }
.mail-drop ul { list-style: none; margin: 0; padding: 0; }
.mail-drop li a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; color: inherit; text-decoration: none; }
.mail-drop li a:hover { background: var(--surface-2); }
.mail-drop li a.new { border-left-color: var(--amber, #E8A33D); background: color-mix(in srgb, var(--amber, #E8A33D) 12%, var(--surface)); }
.mail-drop-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.mail-drop li a:not(.new) strong { font-weight: 500; }
.mail-drop .when { flex: none; font-size: 12px; color: var(--muted); }
.mail-drop-body { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.mail-drop-flag { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; }
.mail-drop-empty { margin: 0; padding: 16px 14px; color: var(--muted); }
.mail-drop-all { display: block; padding: 10px 14px; text-align: center; font-weight: 600; font-size: 13px; }
@media (max-width: 520px) { .mailmenu { position: static; } .client-top { position: relative; } .mail-drop { right: 12px; left: 12px; width: auto; top: 64px; } }

/* Testing strip (Trial firm on the demo site only) */
.tester-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 12px; background: #3b2a00; color: #ffe9b0; font-size: 13px; position: relative; z-index: 60; }
.tester-bar-label { font-weight: 700; margin-right: 4px; }
.tester-bar button { font: inherit; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255,233,176,.45); background: transparent; color: inherit; cursor: pointer; }
.tester-bar button:hover { background: rgba(255,233,176,.15); }
.tester-bar button.on { background: #ffe9b0; color: #3b2a00; font-weight: 700; border-color: #ffe9b0; }
@media print { .tester-bar { display: none; } }

/* The client's own name in the top bar */
.who.on-dark { color: #fff; text-decoration: none; gap: 10px; padding: 2px 6px; border-radius: 10px; }
.who.on-dark:hover { background: rgba(255,255,255,.1); }
.who.on-dark .who-text { display: flex; flex-direction: column; line-height: 1.2; font-size: 14px; }
.who.on-dark .sub { font-size: 12px; color: rgba(255,255,255,.7); }
@media (max-width: 900px) { .who.on-dark .who-text { display: none; } }
@media (max-width: 520px) { .client-top .powered.in-header { display: none; } }
@media (max-width: 520px) { .who.on-dark { display: none; } }

/* The client's company, centred in the top bar */
.client-top-inner { position: relative; }
.client-company { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 32%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .01em; pointer-events: none; }
@media (max-width: 1300px) { .client-company { display: none; } }
@media (min-width: 1301px) { .who.on-dark .sub { display: none; } }

/* Group: the company name in the top bar opens a list of the group's companies */
.client-company.pick { pointer-events: auto; overflow: visible; max-width: 34%; }
.client-company.pick > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); }
.client-company.pick > summary::-webkit-details-marker { display: none; }
.client-company.pick > summary:hover, .client-company.pick[open] > summary { background: rgba(255,255,255,.12); }
.cc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-caret { font-size: 12px; opacity: .8; }
.cc-drop { position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 8px); z-index: 50; min-width: 280px; max-height: 60vh; overflow: auto; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); font-weight: 400; font-size: 14px; white-space: normal; }
.cc-head { margin: 0; padding: 10px 14px; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em; }
.cc-drop ul { list-style: none; margin: 0; padding: 6px; }
.cc-drop a { display: block; padding: 9px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.cc-drop a:hover { background: var(--surface-2); }
.cc-drop a.on { font-weight: 700; background: var(--surface-2); }
.client-company.pick > summary { color: #fff; }
.client-company.pick > summary .cc-name { color: #fff; }

/* One company switch per screen: the top-bar button on wide screens, the picker on the page on narrower ones. Larger top-bar name. */
@media (min-width: 1301px) { .entity-switch { display: none; } }
.client-company { font-size: 20px; }
.client-company.pick { max-width: 38%; }
.client-company.pick > summary { padding: 9px 16px; gap: 10px; border-radius: 12px; }
.client-company.pick .cc-caret { font-size: 14px; }
.cc-drop { font-size: 15px; min-width: 320px; }
.cc-drop a { padding: 11px 12px; }

/* Client footer: the sentence sits on its own line under "Powered by" */
.client-foot { flex-direction: column; gap: 8px; align-items: center; }
@media (min-width: 901px) { .client-foot { align-items: flex-start; } }
@media (min-width: 901px) { .client-foot { align-items: center; justify-content: center; text-align: center; } }

/* Client pages use the whole window: full width (up to very large screens), and the footer rests at the bottom of the screen. */
.client-top-inner, .client-main, .client-nav { max-width: 2400px; }
body.client { min-height: 100vh; display: flex; flex-direction: column; }
body.client > .client-main { flex: 1 0 auto; width: 100%; box-sizing: border-box; }
body.client > .client-foot { width: 100%; max-width: none; box-sizing: border-box; margin: 0; padding-top: 8px; }

/* The Aiglith logo: a capital A inside a faceted hexagon, copper and ink. It draws itself each time a page opens:
   the hexagon, then (on the login pages) the inner hexagon and the facets, then the A, then two glints, then the name.
   When something is waiting in the inbox, the glints shine twice. */
:root, [data-theme="light"] { --logo-copper: #B5703F; }
[data-theme="dark"] { --logo-copper: #D4956E; }
@media (prefers-color-scheme: dark) { [data-theme="system"] { --logo-copper: #D4956E; } }
.side { --logo-copper: #D4956E; }
.logo-mark { overflow: visible; flex: none; }
.logo-mark .lm-cu { stroke: var(--logo-copper); }
.logo-mark .lm-cu-fill { fill: var(--logo-copper); }
.logo-mark path { stroke-dasharray: 100; stroke-dashoffset: 0; }
.wordmark { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 25px; line-height: 1; letter-spacing: -0.005em; }
/* "© year CyRaSri. All rights reserved." at the foot of every page, in the CyRaSri house font. */
.maker-foot { font-family: 'Fraunces', Georgia, serif; font-size: 14px; color: var(--muted); text-align: center; padding: 18px 16px 24px; margin-top: auto; }
.maker-foot .cy { font-weight: 600; }
.maker-foot .ra { color: #9A5426; }
[data-theme="dark"] .maker-foot .ra { color: #D9935F; }
@media (prefers-color-scheme: dark) { [data-theme="system"] .maker-foot .ra { color: #D9935F; } }
@media print { .maker-foot { display: none; } }
.wordmark .wm-i { color: var(--logo-copper); }
.public-top .wordmark { font-size: 32px; }
/* The name with its symbol: the A (real Fraunces, same size as the rest) inside the copper jewel, then "iglith".
   The jewel is drawn to the letter's size (1 unit of its drawing = 0.018em). In the menu it is the jewel with its two dots;
   on the login pages it also has the inner outline and the facets, like the full emblem. */
.wm-mark { position: relative; display: inline-block; width: 1.51em; text-align: center; margin-right: .02em; }
.wm-frame { position: absolute; left: 0; top: -.42em; width: 1.51em; height: 1.73em; overflow: visible; }
.wm-frame path { fill: none; stroke: var(--logo-copper); stroke-width: 2.2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
.wm-frame .wm-inner, .wm-frame .wm-facet { display: none; }
.public-top .wm-frame .wm-inner, .public-top .wm-frame .wm-facet { display: inline; stroke-width: 1.2px; }
.public-top .wm-frame .wm-edge { stroke-width: 1.8px; }
.wm-frame .wm-dot { fill: var(--logo-copper); }
.wm-first { position: relative; }
.wm-rest { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  /* In the menu: jewel 0–0.8s, A at 0.6s, letters from 1.0s, the copper i glints last. */
  .wm-frame .wm-edge { animation: lm-draw .9s cubic-bezier(.45, 0, .2, 1) both; }
  .wm-frame .wm-inner { animation: lm-draw .9s cubic-bezier(.45, 0, .2, 1) .2s both; }
  .wm-frame .wm-facet { animation: lm-draw .5s cubic-bezier(.45, 0, .2, 1) .7s both; }
  .wm-frame .wm-dot { transform-box: fill-box; transform-origin: center; animation: lm-pop .45s cubic-bezier(.2, .7, .2, 1.6) .75s both; }
  .wm-frame .wm-dot2 { animation-delay: .85s; }
  .wm-first { display: inline-block; animation: lm-letter .7s cubic-bezier(.2, .7, .2, 1) .8s both; }
  .wordmark .wm-l { display: inline-block; animation: lm-letter .9s cubic-bezier(.2, .7, .2, 1) both; }
  .wordmark .wm-l:nth-child(1) { animation-delay: 1.20s; } .wordmark .wm-l:nth-child(2) { animation-delay: 1.30s; }
  .wordmark .wm-l:nth-child(3) { animation-delay: 1.40s; } .wordmark .wm-l:nth-child(4) { animation-delay: 1.50s; }
  .wordmark .wm-l:nth-child(5) { animation-delay: 1.60s; } .wordmark .wm-l:nth-child(6) { animation-delay: 1.70s; }
  .wordmark .wm-l.wm-i { animation-name: lm-letter, lm-i-glint; animation-duration: .9s, 1.4s; animation-delay: 1.50s, 2.4s; }
  /* On the login pages: the same, slower, to catch the eye. */
  .public-top .wm-frame .wm-edge { animation-duration: 1.3s; }
  .public-top .wm-frame .wm-inner { animation-duration: 1.3s; animation-delay: .3s; }
  .public-top .wm-frame .wm-facet { animation-duration: .6s; animation-delay: 1.1s; }
  .public-top .wm-frame .wm-dot { animation-delay: 1.4s; } .public-top .wm-frame .wm-dot2 { animation-delay: 1.52s; }
  .public-top .wm-first { animation-duration: 1s; animation-delay: 1.6s; }
  .public-top .wordmark .wm-l { animation-duration: 1.3s; }
  .public-top .wordmark .wm-l:nth-child(1) { animation-delay: 2.4s; } .public-top .wordmark .wm-l:nth-child(2) { animation-delay: 2.6s; }
  .public-top .wordmark .wm-l:nth-child(3) { animation-delay: 2.8s; } .public-top .wordmark .wm-l:nth-child(4) { animation-delay: 3.0s; }
  .public-top .wordmark .wm-l:nth-child(5) { animation-delay: 3.2s; } .public-top .wordmark .wm-l:nth-child(6) { animation-delay: 3.4s; }
  .public-top .wordmark .wm-l.wm-i { animation-duration: 1.3s, 1.8s; animation-delay: 3.0s, 4.8s; }
  /* Something waiting: the jewel glows twice and the i glints three times. */
  .has-news .wm-frame { animation: lm-glow 1.1s ease-in-out 2s 2; }
  .has-news .wordmark .wm-l.wm-i { animation-iteration-count: 1, 3; }
}
@keyframes lm-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes lm-pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }
@keyframes lm-glow { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 4px #F1C9A8); } }
@keyframes lm-letter { from { opacity: 0; transform: translateY(6px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes lm-i-glint { 0%, 100% { text-shadow: none; } 40% { text-shadow: 0 0 12px rgba(230, 160, 110, .95), 0 0 2px rgba(255, 220, 190, .9); } }

/* ---------- Jewelbill: stock screens ---------- */
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot th { border-top: 2px solid var(--border-strong); background: var(--surface-2); }
.tile-num.sm { font-size: 24px; line-height: 1.5; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.row3 .span2 { grid-column: span 2; }
.piece-form h2 { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.piece-form h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.piece-form { max-width: 920px; }
.filters .filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .filter-row select { width: auto; min-height: 38px; max-width: 220px; }
.filters .search input { max-width: none; }
.filter-note { white-space: normal; margin: 0; padding: 10px 20px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); }
.piece-cell { display: flex; gap: 10px; align-items: center; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); flex: none; background: var(--surface-2); }
.piece-photo { display: block; width: 100%; max-height: 340px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.spec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.spec > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spec dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.spec dd { margin: 0; overflow-wrap: anywhere; }
.rate-list { margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.rate-list > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.rate-list dt { font-weight: 600; }
.rate-list dd { margin: 0; font-variant-numeric: tabular-nums; }
.bulk-bar select { width: auto; min-height: 34px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; border-top: 1px solid var(--border); }
.level-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.level-form select { width: auto; min-height: 34px; }
@media (max-width: 760px) {
  .row3, .spec { grid-template-columns: minmax(0, 1fr); }
  .row3 .span2 { grid-column: auto; }
}
@media print {
  .side, .topbar, .actions, .warn-card, .flash { display: none !important; }
  .shell { display: block; }
}

.table.compact { min-width: 0; width: 100%; }
.tile { min-width: 0; }
.tile-num { overflow-wrap: anywhere; }
.activity li { justify-content: space-between; }
@media (max-width: 760px) { .tile-num.sm { font-size: 18px; line-height: 1.6; } }

/* ---------- Counter (POS) and bills ---------- */
.scan-card { display: flex; flex-direction: column; gap: 8px; }
.scan-label { font-weight: 600; font-size: 15px; }
.scan-row { display: flex; gap: 10px; }
.scan-input { flex: 1; min-height: 52px; font-size: 20px; font-weight: 600; letter-spacing: .5px; }
.mini-input { width: 96px; min-height: 34px; text-align: right; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.pick-list { list-style: none; margin: 10px 0 0; padding: 0; }
.pick-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.totals { margin: 0; display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.totals > div { display: flex; justify-content: space-between; gap: 16px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; }
.totals .grand { padding-top: 8px; border-top: 1px solid var(--border-strong); font-weight: 700; font-size: 18px; }
.totals .grand dt { color: var(--text); }
.totals .grand.due { color: var(--warn-text); border-top: 0; padding-top: 0; font-size: 16px; }
.place-pick { display: flex; gap: 6px; align-items: center; }
.place-pick select, .place-pick input { width: auto; min-height: 38px; }
.inline-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inline-label input { width: auto; min-height: 38px; }
.filters .filter-row input[type=search] { width: auto; flex: 1; min-width: 180px; min-height: 38px; }
.bill { max-width: 920px; }
.bill-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--text); }
.bill-firm { display: flex; gap: 14px; align-items: flex-start; }
.bill-logo { max-height: 56px; max-width: 160px; }
.bill-name { font-size: 20px; }
.bill-meta { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.bill-title { font-size: 18px; text-transform: uppercase; letter-spacing: .08em; }
.bill-to { padding: 14px 0; }
.bill-table { min-width: 0; margin: 0 0 6px; }
.bill-table th:first-child, .bill-table td:first-child { padding-left: 0; }
.bill-table th:last-child, .bill-table td:last-child { padding-right: 0; }
.bill-sub { margin: 18px 0 4px; font-size: 14px; }
.bill-foot { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; padding-top: 14px; border-top: 1px solid var(--border-strong); }
.bill-pays { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.bill-note { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); text-align: center; }
@media (max-width: 760px) {
  .bill-head, .bill-foot { display: flex; flex-direction: column; }
  .bill-meta { text-align: left; }
  .scan-row { flex-direction: column; }
}
@media print {
  .no-print { display: none !important; }
  body, .content, .main-col { background: #fff !important; }
  .content { padding: 0 !important; }
  .bill { border: 0 !important; box-shadow: none !important; padding: 0 !important; max-width: none; }
  .bill .flash { display: block !important; }
}

.inline-form { flex-wrap: nowrap; white-space: nowrap; }
.inline-form .btn { flex: none; }
.bill-lines td:nth-child(2) { min-width: 200px; }

.mini-input { flex: none; width: 92px; }
.bill-lines td:nth-child(2) { min-width: 0; }
.tiles-5 .tile-num.sm { font-size: 21px; }
.table td .inline-form input.mini-input { width: 92px; min-width: 0; max-width: 92px; flex: none; }
.table td .inline-form input.qty-input { width: 56px; max-width: 56px; }

/* The switch for the place a login is working at */
.place-switch { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.place-switch .place-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.place-switch select { width: auto; min-height: 32px; padding: 2px 8px; font-weight: 600; border: 0; background: transparent; }
@media (max-width: 760px) { .place-switch .place-label { display: none; } }

.place-ticks { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.place-ticks legend { font-weight: 500; font-size: 14px; margin-bottom: 4px; padding: 0; }
.table.rights th { white-space: normal; min-width: 76px; }
.rights-help { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.rights-help dt { font-weight: 600; } .rights-help dd { margin: 0; color: var(--muted); }
.pay-lines { display: flex; flex-direction: column; gap: 10px; }
.pay-line { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.pay-line:last-child { border-bottom: 0; padding-bottom: 0; }
.pay-line select, .pay-line input { min-height: 38px; width: 100%; min-width: 0; }
.totals .fx { font-size: 13px; }
.waiting-card { border-color: var(--accent); }
form.inline { display: inline; }
.tick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; }
.section-title { font-size: 18px; margin: 0 0 12px; }
.narrow-form { max-width: 640px; }
.page-head h1 .badge { vertical-align: middle; margin-left: 6px; font-family: inherit; }
.filters .filter-row input[type=date] { width: auto; min-height: 38px; max-width: 170px; }
.filters .filter-row .date-label { font-size: 13px; color: var(--muted); }
.inbox-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.inbox-link:hover, .inbox-link.on { border-color: var(--accent); color: var(--accent-ink); }
.inbox-link .count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #c2410c; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.message-list { list-style: none; margin: 0; padding: 0; }
.message-list li { padding: 14px 20px; border-top: 1px solid var(--border); }
.message-list li:first-child { border-top: 0; }
.message-list li.unread { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.message-list p { margin: 6px 0 4px; }
.message-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ask-form { display: flex; gap: 6px; align-items: center; }
.ask-form input[name=qty] { width: 56px; min-height: 34px; text-align: right; }
.ask-form input[name=note] { width: 160px; min-height: 34px; }
.table tr.here td { background: var(--surface-2); }
details.decline summary { font-size: 13px; color: var(--danger, #b91c1c); min-height: 30px; }
details.decline form { min-width: 220px; }
.problem-note { margin-top: 10px; }
.problem-note textarea { min-height: 60px; }
@media (max-width: 760px) { .ask-form { flex-wrap: wrap; } .ask-form input[name=note] { width: 100%; } }
@media (max-width: 760px) { .top-right { flex-wrap: wrap; gap: 8px; } .inbox-link { width: 36px; height: 36px; } }
/* The business's name at the top of every page, before where the person is. */
.top-left { display: flex; align-items: center; gap: 16px; min-width: 0; flex-wrap: wrap; }
.top-firm { display: flex; align-items: center; gap: 10px; font-family: 'Josefin Sans', 'IBM Plex Sans', system-ui, sans-serif; font-weight: 600; font-size: 17px; letter-spacing: .04em; color: var(--text); white-space: nowrap; padding-right: 16px; border-right: 1px solid var(--border); }
.top-firm .firm-logo { height: 32px; }
.top-firm .firm-logo img { max-height: 26px; }
@media (max-width: 760px) { .top-firm { border-right: 0; padding-right: 0; font-size: 16px; } .top-left { gap: 4px 12px; } }
.page-back { align-self: flex-start; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: -10px; }
.page-back:hover { color: var(--accent-ink); }
.top-firm { border-right: 0; padding-right: 0; }
/* The list under the counter's scan box. */
.scan-card { position: relative; }
.pick-list { position: absolute; left: 20px; right: 20px; top: calc(100% - 14px); z-index: 30; max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .28); padding: 6px; }
.pick-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.pick-row:hover, .pick-row.on { background: var(--accent-soft); }
.pick-row b { font-variant-numeric: tabular-nums; }
.pick-what { display: flex; flex-direction: column; min-width: 0; }
.pick-what span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-what small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-qty { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pick-price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; min-width: 110px; }
.pick-empty, .pick-more { padding: 12px; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .pick-list { left: 10px; right: 10px; }
  .pick-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .pick-row b { grid-column: 1; } .pick-what { grid-column: 1 / -1; grid-row: 2; } .pick-qty { grid-column: 2; grid-row: 1; } .pick-price { grid-column: 2; grid-row: 3; min-width: 0; }
}
.pick-ask { display: inline-block; margin: 0 12px 10px; font-weight: 600; color: var(--accent-ink); }
.trial-bar { border: 1px solid var(--logo-copper); background: color-mix(in srgb, var(--logo-copper) 12%, var(--surface)); color: var(--text); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.login-details { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0 6px; } .login-details dt { color: var(--muted); } .login-details dd { margin: 0; font-family: ui-monospace, monospace; }
/* The owner of the software, shown quietly at the foot of the menu and of the login pages. */
.side-owner { margin-top: auto; padding: 10px 12px 2px; font-size: 11px; color: var(--nav-text); opacity: .7; }
.public-owner { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
@media (max-width: 760px) { .side-owner { display: none; } .js .side.open .side-owner { display: block; } }
/* Drop-down lists under the search boxes. */
.suggest-holder { position: relative; flex: 1; min-width: 180px; display: flex; }
.suggest-holder > input { width: 100%; max-width: none; }
.suggest-list { left: 0; right: 0; top: calc(100% + 4px); min-width: 320px; }
.suggest-row { grid-template-columns: minmax(90px, max-content) minmax(0, 1fr) auto; }
.suggest-row b { white-space: nowrap; }
/* Sortable headings. */
.table th.sortable, .table th .sort-link { cursor: pointer; user-select: none; white-space: nowrap; }
.table th .sort-link { color: inherit; text-decoration: none; }
.table th.sortable:hover, .table th .sort-link:hover, .table th.on, .table th .sort-link.on { color: var(--text); }
.table th .sort-mark { display: inline-block; margin-left: 4px; font-size: 10px; opacity: .45; }
.table th.on .sort-mark, .table th .sort-link.on .sort-mark { opacity: 1; color: var(--accent-ink); }
@media (max-width: 760px) { .suggest-list { min-width: 0; } .suggest-row { grid-template-columns: minmax(0, 1fr) auto; } .suggest-row .pick-what { grid-column: 1 / -1; grid-row: 2; } }
.filter-row .suggest-holder { flex: 1 1 200px; min-width: 160px; }
.filter-row .suggest-list { left: auto; right: 0; width: max(100%, 460px); max-width: calc(100vw - 32px); }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-head { justify-content: flex-start; align-items: center; gap: 16px; }
.details-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.details-list dt { color: var(--muted); } .details-list dd { margin: 0; white-space: pre-line; }
.logo-field { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.logo-field .logo-preview { flex: none; min-width: 140px; min-height: 64px; display: flex; align-items: center; justify-content: center; }
.logo-preview.empty { border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--muted); font-size: 13px; padding: 0 16px; }
.logo-field .stack-sm { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.summary-grid td.here-col { background: var(--accent-soft); }
.summary-grid td a { font-weight: 600; font-variant-numeric: tabular-nums; }
.filter-note { padding: 10px 20px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--border); }
.extend-form { display: inline-flex; gap: 6px; align-items: center; }
.extend-form select { min-height: 30px; padding: 2px 26px 2px 8px; font-size: 13px; width: auto; }
.extend-form .link-btn { white-space: nowrap; }
/* Reports */
.report-tabs { margin: -6px 0 2px; flex-wrap: wrap; }
.report-filters .filter-row { flex-wrap: wrap; }
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.quick-dates .chip { font-size: 13px; padding: 4px 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 1500px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .chart-bar { fill: var(--accent); opacity: .85; }
.chart .chart-bar:hover { opacity: 1; fill: var(--logo-copper); }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart figcaption { margin-top: 6px; }
.kpi-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Menu pictures, and folding the side menu down to them */
.nav a { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.nav-ico { display: inline-flex; flex-shrink: 0; opacity: .85; }
.nav a.on .nav-ico, .nav a:hover .nav-ico { opacity: 1; }
.fold-btn { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--nav-text); font: inherit; font-weight: 500; cursor: pointer; text-align: left; white-space: nowrap; }
.fold-btn:hover { color: #FFFFFF; background: rgba(255,255,255,.06); }
.fold-btn:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
.fold-btn svg { flex-shrink: 0; transition: transform .2s; }
.fold-btn + .side-owner { margin-top: 0; }
@media (min-width: 761px) {
  .side { transition: width .2s ease, padding .2s ease; }
  .side-folded .side { width: 68px; padding: 22px 10px; gap: 22px; }
  .side-folded .side .wm-rest, .side-folded .side .nav-label, .side-folded .side .side-owner { display: none; }
  .side-folded .side .brand { justify-content: center; padding: 0; }
  .side-folded .side .nav a, .side-folded .side .fold-btn { justify-content: center; padding: 11px 0; }
  .side-folded .side .fold-btn svg { transform: scaleX(-1); }
}
@media (max-width: 760px) { .fold-btn { display: none; } .js .side.open .nav a { gap: 12px; } }
@media (prefers-reduced-motion: reduce) { .side, .fold-btn svg { transition: none; } }

/* Boxes that fold shut from their heading */
.fold-toggle { display: inline-flex; align-items: center; gap: 8px; margin: -4px -6px; padding: 4px 6px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.fold-toggle:hover { background: var(--hover, rgba(127,127,127,.1)); }
.fold-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold-chev { flex-shrink: 0; color: var(--muted); transition: transform .2s ease; }
.fold-box.is-folded .fold-chev { transform: rotate(-90deg); }
.fold-box.is-folded .fold-body { display: none; }
.fold-box.is-folded .card-head { border-bottom: 0; }
.fold-pad { padding: 16px 20px 20px; }
@media (prefers-reduced-motion: reduce) { .fold-chev { transition: none; } }

/* Calendar of bills: one square per day, shaded by how much was sold */
.cal-wrap { padding: 14px 20px 20px; }
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-title { display: flex; flex-direction: column; min-width: 150px; text-align: center; line-height: 1.3; }
.btn.disabled { opacity: .35; pointer-events: none; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: center; padding-bottom: 2px; }
.cal-day { display: flex; flex-direction: column; gap: 1px; min-height: 66px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; background: var(--surface); min-width: 0; }
a.cal-day:hover { border-color: var(--accent); }
a.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-num { font-weight: 600; font-size: 13px; }
.cal-n { font-size: 12px; color: var(--muted); }
.cal-amt { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-none { font-size: 12px; color: var(--muted); }
.cal-day.heat-1 { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.cal-day.heat-2 { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.cal-day.heat-3 { background: color-mix(in srgb, var(--accent) 26%, var(--surface)); }
.cal-day.heat-4 { background: color-mix(in srgb, var(--accent) 38%, var(--surface)); }
.cal-day.today .cal-num { color: var(--accent); }
.cal-day.today { border-color: var(--accent); }
.cal-day.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-day.in-range { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.cal-day.future { opacity: .45; }
@media (max-width: 640px) {
  .cal-wrap { padding: 12px; }
  .cal { gap: 4px; }
  .cal-day { min-height: 46px; padding: 4px; align-items: center; }
  .cal-amt, .cal-none { display: none; }
  .cal-n { font-size: 11px; }
}

/* Billing: storage space meter */
.space-figure { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.space-used { font-size: 30px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.space-meter { display: grid; grid-template-columns: repeat(50, 1fr); gap: 2px; height: 14px; }
.space-meter span { border-radius: 2px; background: var(--bar-track); }
.space-meter span.on { background: var(--accent); }
.space-meter.level-high span.on { background: var(--warn-text); }
.space-meter.level-full span.on { background: var(--danger); }
.space-bar-cell { width: 40%; }
.space-bar { display: block; height: 8px; border-radius: 4px; background: var(--accent); opacity: .75; min-width: 2px; }
.space-bar.w0 { width: 0%; }
.space-bar.w1 { width: 5%; }
.space-bar.w2 { width: 10%; }
.space-bar.w3 { width: 15%; }
.space-bar.w4 { width: 20%; }
.space-bar.w5 { width: 25%; }
.space-bar.w6 { width: 30%; }
.space-bar.w7 { width: 35%; }
.space-bar.w8 { width: 40%; }
.space-bar.w9 { width: 45%; }
.space-bar.w10 { width: 50%; }
.space-bar.w11 { width: 55%; }
.space-bar.w12 { width: 60%; }
.space-bar.w13 { width: 65%; }
.space-bar.w14 { width: 70%; }
.space-bar.w15 { width: 75%; }
.space-bar.w16 { width: 80%; }
.space-bar.w17 { width: 85%; }
.space-bar.w18 { width: 90%; }
.space-bar.w19 { width: 95%; }
.space-bar.w20 { width: 100%; }
@media (max-width: 640px) { .hide-sm { display: none; } }

/* Billing: invoices */
.pay-inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pay-inline input { width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.pay-inline input[name="paid_note"] { width: 150px; }
.danger-text { color: var(--danger); }
.invoice-sheet { max-width: 760px; }
.invoice-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.invoice-from { font-size: 20px; letter-spacing: .02em; }
.invoice-meta { text-align: right; }
.invoice-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.invoice-to { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.invoice-totals { max-width: 340px; margin-left: auto; margin-top: 14px; }
.aig-unlock { font-size: 13px; color: var(--muted); }
.aig-unlock summary { cursor: pointer; width: max-content; }
.aig-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; max-width: 420px; }
.aig-form input { flex: 1; min-width: 180px; }
.aig-form p { flex-basis: 100%; margin: 0; }

/* The business's standing with Aiglith: trial days left, or look only */
.plan-bar { margin-bottom: 16px; padding: 10px 14px; border-radius: 10px; font-size: 14px; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.plan-bar.stop { background: var(--flash-warn-bg); color: var(--flash-warn-fg); border-color: var(--flash-warn-bd); }
@media print { .plan-bar { display: none; } }

/* The Aiglith owner's screens */
body.owner { min-height: 100vh; background: var(--bg); }
.owner-top { background: var(--nav-bg); color: #fff; }
.owner-top-inner { max-width: 1400px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.owner-top .brand { color: #fff; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; padding: 0; }
.owner-top .brand svg { color: #fff; }
.owner-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: #D4956E; color: #1A1208; padding: 3px 8px; border-radius: 6px; }
.owner-nav { display: flex; gap: 4px; flex: 1; }
.owner-nav a { color: rgba(255,255,255,.8); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.owner-nav a:hover, .owner-nav a.on { color: #fff; background: rgba(255,255,255,.12); }
.owner-top .theme-switch { margin-left: auto; }
.owner-top .theme-switch .seg { color: #C9D2E0; }
.owner-top .theme-switch .seg.on { background: rgba(255,255,255,.18); color: #FFFFFF; }
.owner-main { max-width: 1400px; margin: 0 auto; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 18px; }
.owner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 18px; align-items: start; }
.owner-main .card form.stack { gap: 12px; }
.owner-note { font-size: 13px; color: var(--muted); }
.owner-auth { max-width: 460px; }
.owner-main > .owner-auth { align-self: center; width: 100%; margin-top: 24px; }
.owner-main > form.owner-auth { align-self: flex-start; margin-top: 0; }
.owner-narrow { align-self: center; width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 18px; }
.owner-main .plain-list li + li { margin-top: 12px; }
.owner-main input[type="number"] { width: 100%; }
.owner-main .crumbs { font-size: 14px; }
@media (max-width: 640px) { .owner-top .theme-switch { margin-left: 0; } .owner-nav { flex-basis: 100%; order: 3; } }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.invoice-form { padding: 16px 20px 20px; border-top: 1px solid var(--border); }
.invoice-form h3 { margin: 0; font-size: 16px; }
.disk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.disk-head h2 { margin: 0; }
.disk-warn { color: var(--danger); font-weight: 600; }
.meter { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 12px 0 6px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.meter.warn > span { background: var(--danger); }
.email-draft label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; margin-top: 12px; }
.copy-area { align-items: flex-start; }
.copy-area textarea { flex: 1; font: inherit; font-weight: 400; line-height: 1.5; resize: vertical; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.email-draft .copy-row input { font-family: inherit; font-size: 14px; flex: 1; }
.invoice-pay { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.meter > span.w0 { width: 0%; }
.meter > span.w5 { width: 5%; }
.meter > span.w10 { width: 10%; }
.meter > span.w15 { width: 15%; }
.meter > span.w20 { width: 20%; }
.meter > span.w25 { width: 25%; }
.meter > span.w30 { width: 30%; }
.meter > span.w35 { width: 35%; }
.meter > span.w40 { width: 40%; }
.meter > span.w45 { width: 45%; }
.meter > span.w50 { width: 50%; }
.meter > span.w55 { width: 55%; }
.meter > span.w60 { width: 60%; }
.meter > span.w65 { width: 65%; }
.meter > span.w70 { width: 70%; }
.meter > span.w75 { width: 75%; }
.meter > span.w80 { width: 80%; }
.meter > span.w85 { width: 85%; }
.meter > span.w90 { width: 90%; }
.meter > span.w95 { width: 95%; }
.meter > span.w100 { width: 100%; }
.owner-top .theme-switch { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.owner-top .wordmark { color: #FFFFFF; }
