/* Dokyara — 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=password], input[type=date], 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;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 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; }
.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; }
}

/* Dokyara wordmark */
.wordmark { font-family: 'Sora', 'IBM Plex Sans', system-ui, sans-serif; font-weight: 600; letter-spacing: -0.5px; font-size: 21px; }

/* ---- 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 Dokyara" 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: 14px; letter-spacing: .2em; color: #FFFFFF; }
.powered.in-header { margin: 0 6px 0 18px; }
.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 Dokyara logo: a capital D on a sheet of paper with a folded corner, amber and ink (the same family as the
   other CyRaSri products). It draws itself each time a page opens: the sheet, then (on the login pages) the inner
   sheet, the fold, then the D, then two glints, then the name one letter at a time.
   When something is waiting in the inbox, the glints shine twice and the amber Y glints. */
:root, [data-theme="light"] { --logo-amber: #C98A2B; }
[data-theme="dark"] { --logo-amber: #E8A33D; }
@media (prefers-color-scheme: dark) { [data-theme="system"] { --logo-amber: #E8A33D; } }
.brand:not(.dark), .owner-top, .client-top, .powered.in-header { --logo-amber: #E8A33D; }
.logo-mark { overflow: visible; flex: none; }
.logo-mark .lm-au { stroke: var(--logo-amber); }
.logo-mark .lm-au-fill { fill: var(--logo-amber); }
.logo-mark path { stroke-dasharray: 100; stroke-dashoffset: 0; }
.wordmark { font-family: 'Josefin Sans', 'Sora', system-ui, sans-serif; font-weight: 600; font-size: 17px; letter-spacing: .3em; padding-top: 3px; }
.wordmark .wm-y { color: var(--logo-amber); }
.public-top .wordmark { font-weight: 400; font-size: 20px; letter-spacing: .34em; }
@media (prefers-reduced-motion: no-preference) {
  .logo-mark .lm-frame { animation: lm-draw .9s cubic-bezier(.45, 0, .2, 1) both; }
  .logo-mark .lm-inner { animation: lm-draw .9s cubic-bezier(.45, 0, .2, 1) .25s both; }
  .logo-mark .lm-fold { animation: lm-draw .35s cubic-bezier(.45, 0, .2, 1) .8s both; }
  .logo-mark.full .lm-fold { animation-delay: 1s; }
  .logo-mark .lm-d { animation: lm-draw .7s cubic-bezier(.45, 0, .2, 1) .45s both; }
  .logo-mark.full .lm-d { animation-delay: 1.2s; }
  .logo-mark .lm-dot { transform-box: fill-box; transform-origin: center; animation: lm-pop .5s cubic-bezier(.2, .7, .2, 1.6) 1.2s both; }
  .logo-mark .lm-dot2 { animation-delay: 1.32s; }
  .logo-mark.full .lm-dot { animation-delay: 2s; }
  .logo-mark.full .lm-dot2 { animation-delay: 2.12s; }
  .has-news .logo-mark .lm-dot { animation: lm-pop .5s cubic-bezier(.2, .7, .2, 1.6) 1.2s both, lm-glow 1.1s ease-in-out 1.9s 2; }
  /* The name appears one letter at a time, each rising softly out of a blur; the amber Y comes last, with a glint.
     Slow on the login pages, to catch the eye; quicker in the menu, where it plays on every page. */
  .wordmark .wm-l { display: inline-block; animation: lm-letter 1.1s cubic-bezier(.2, .7, .2, 1) both; }
  .public-top .wordmark .wm-l { animation-duration: 1.6s; }
  .wordmark .wm-l:nth-child(1) { animation-delay: 1.00s; } .public-top .wordmark .wm-l:nth-child(1) { animation-delay: 2.10s; }
  .wordmark .wm-l:nth-child(2) { animation-delay: 1.12s; } .public-top .wordmark .wm-l:nth-child(2) { animation-delay: 2.38s; }
  .wordmark .wm-l:nth-child(3) { animation-delay: 1.24s; } .public-top .wordmark .wm-l:nth-child(3) { animation-delay: 2.66s; }
  .wordmark .wm-l:nth-child(5) { animation-delay: 1.36s; } .public-top .wordmark .wm-l:nth-child(5) { animation-delay: 2.94s; }
  .wordmark .wm-l:nth-child(6) { animation-delay: 1.48s; } .public-top .wordmark .wm-l:nth-child(6) { animation-delay: 3.22s; }
  .wordmark .wm-l:nth-child(7) { animation-delay: 1.60s; } .public-top .wordmark .wm-l:nth-child(7) { animation-delay: 3.50s; }
  .wordmark .wm-l.wm-y { animation-name: lm-letter, lm-y-glint; animation-duration: 1.1s, 1.4s; animation-delay: 1.72s, 2.5s; }
  .public-top .wordmark .wm-l.wm-y { animation-duration: 1.6s, 1.8s; animation-delay: 3.78s, 5s; }
  .has-news .wordmark .wm-l.wm-y { animation-name: lm-letter, lm-y-glint; animation-duration: 1.1s, 1.1s; animation-delay: 1.72s, 2.5s; animation-iteration-count: 1, 3; }
  .client-foot .logo-mark *, .client-foot .wordmark .wm-l { animation: none; }
}
@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 #F5CF8F); } }
@keyframes lm-letter { from { opacity: 0; transform: translateY(6px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes lm-y-glint { 0%, 100% { text-shadow: none; } 40% { text-shadow: 0 0 12px rgba(232, 163, 61, .95), 0 0 2px rgba(255, 230, 190, .9); } }

/* Trial notice and read-only notice at the top of a firm's pages */
.plan-banner { padding: 8px 16px; background: #E8F1FB; color: #0F3A66; font-size: 14px; text-align: center; border-bottom: 1px solid #C9DDF3; }
.plan-banner.stop { background: #FDECE3; color: #7A2E0B; border-bottom-color: #F5C9B2; }
:root[data-theme="dark"] .plan-banner { background: #10263F; color: #CFE3F8; border-bottom-color: #1D3A5C; }
:root[data-theme="dark"] .plan-banner.stop { background: #3A1C10; color: #F8D7C6; border-bottom-color: #5A2C17; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .plan-banner { background: #10263F; color: #CFE3F8; border-bottom-color: #1D3A5C; }
  :root[data-theme="system"] .plan-banner.stop { background: #3A1C10; color: #F8D7C6; border-bottom-color: #5A2C17; }
}
@media print { .plan-banner { display: none; } }

/* The owner's screens */
body.owner { min-height: 100vh; background: var(--bg); }
.owner-top { background: #13233F; 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: 8px; text-decoration: none; }
.owner-top .brand svg { color: #fff; }
.owner-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: #E8A33D; color: #13233F; 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-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(340px, 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; }
@media (max-width: 640px) { .owner-top .theme-switch { margin-left: 0; } .owner-nav { flex-basis: 100%; order: 3; } }
.inline-form { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.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; }
.owner-main .plain-list li + li { margin-top: 12px; }
.owner-main input[type="number"] { width: 100%; }
/* Owner set-up, login and two-step boxes sit in the middle of the screen */
.owner-main > .owner-auth { align-self: center; width: 100%; margin-top: 24px; }
.owner-main > form.owner-auth { align-self: flex-start; margin-top: 0; }
.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; }
.meter.warn > span { background: var(--danger); }
.owner-narrow { align-self: center; width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 18px; }
.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; }
/* With the company name centred, the product credit in the header needs room; below 1500px it shows only in the footer. */
@media (max-width: 1500px) { .client-top .powered.in-header { display: none; } }
