/* LexForm Desk: design system and layout. System fonts only; no external assets. */

:root {
  --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #F0F2F5; --surface-3: #E8EBF0;
  --border: #D9DDE4; --border-strong: #C9CDD5;
  --text: #0F1B33; --text-2: #4B5565; --text-3: #596273;
  --navy: #0A1F44; --navy-hover: #14305F; --navy-tint: #EAF0FA;
  --crimson: #B21E2E; --crimson-hover: #971828; --crimson-tint: #FBE9EB;
  /* A solid crimson to put white text on, and a crimson for text on the tint (both at least 4.5:1 in either theme). */
  --crimson-solid: #B21E2E; --crimson-text: #B21E2E;
  --focus: 0 0 0 3px rgba(30, 79, 191, .40);
  --sidebar: #0A1F44; --sidebar-text: #FFFFFF; --sidebar-muted: #A9B4C8; --sidebar-active: rgba(255, 255, 255, .08);
  --st-ns-fg: #4B5565; --st-ns-bg: #EEF0F3;
  --st-ip-fg: #1E4FBF; --st-ip-bg: #E6EEFB;
  --st-wt-fg: #8A5A00; --st-wt-bg: #FFF4DB;
  --st-rv-fg: #5B3BB5; --st-rv-bg: #EFEAFB;
  --st-dn-fg: #1B6B3A; --st-dn-bg: #E3F3E9;
  --st-od-fg: #B21E2E; --st-od-bg: #FBE9EB;
  --pr-urgent: #B21E2E; --pr-high: #B7791F; --pr-low: #9AA3B2;
  --shadow-sm: 0 1px 2px rgba(10, 31, 68, .06);
  --shadow-md: 0 4px 12px rgba(10, 31, 68, .08);
  --shadow-lg: 0 12px 32px rgba(10, 31, 68, .16);
  --r-ctl: 6px; --r-card: 10px; --r-drawer: 14px;
  --font-sans: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0B1220; --surface: #111A2E; --surface-2: #172239; --surface-3: #1D2A45;
  --border: #263350; --border-strong: #33425F;
  --text: #E6EAF2; --text-2: #A5AFC2; --text-3: #929DB6;
  --navy: #8FB0F0; --navy-hover: #A9C3F5; --navy-tint: #16264D;
  --crimson: #E04A5A; --crimson-hover: #F0616F; --crimson-tint: #45151B;
  --crimson-solid: #B21E2E; --crimson-text: #FF8A94;
  --focus: 0 0 0 3px rgba(143, 176, 240, .50);
  --sidebar: #0A1428; --sidebar-muted: #8C98B2;
  --st-ns-fg: #B8C0D0; --st-ns-bg: #1C2740;
  --st-ip-fg: #9DBBFF; --st-ip-bg: #14264D;
  --st-wt-fg: #F5C86B; --st-wt-bg: #3A2A0A;
  --st-rv-fg: #C9B8FF; --st-rv-bg: #2A1F52;
  --st-dn-fg: #7ED4A0; --st-dn-bg: #0F3322;
  --st-od-fg: #FF8A94; --st-od-bg: #45151B;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow-md: 0 4px 12px rgba(0, 0, 0, .35); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220; --surface: #111A2E; --surface-2: #172239; --surface-3: #1D2A45;
    --border: #263350; --border-strong: #33425F;
    --text: #E6EAF2; --text-2: #A5AFC2; --text-3: #929DB6;
    --navy: #8FB0F0; --navy-hover: #A9C3F5; --navy-tint: #16264D;
    --crimson: #E04A5A; --crimson-hover: #F0616F; --crimson-tint: #45151B;
    --crimson-solid: #B21E2E; --crimson-text: #FF8A94;
    --focus: 0 0 0 3px rgba(143, 176, 240, .50);
    --sidebar: #0A1428; --sidebar-muted: #8C98B2;
    --st-ns-fg: #B8C0D0; --st-ns-bg: #1C2740; --st-ip-fg: #9DBBFF; --st-ip-bg: #14264D;
    --st-wt-fg: #F5C86B; --st-wt-bg: #3A2A0A; --st-rv-fg: #C9B8FF; --st-rv-bg: #2A1F52;
    --st-dn-fg: #7ED4A0; --st-dn-bg: #0F3322; --st-od-fg: #FF8A94; --st-od-bg: #45151B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow-md: 0 4px 12px rgba(0, 0, 0, .35); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* One plain sans (Source Sans 3) for the whole interface: text, headings,
   controls, numbers and refs. No serif and no monospace anywhere in the UI;
   digits stay steady with tabular-nums. Documents rendered from the firm's
   templates (invoices, registers, letters) carry their own fonts. */
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font-sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: 400 14px/20px var(--font-sans); color: inherit; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-ctl); }
label { font-family: var(--font-sans); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }
.num, .tab { font-variant-numeric: tabular-nums; font-family: var(--font-sans); }
.mono { font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-size: 12px; letter-spacing: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); font-size: 12px; line-height: 16px; font-family: var(--font-sans); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }

/* ------------------------------------------------------------ shell */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.app.rail { grid-template-columns: 64px 1fr; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 20; font-family: var(--font-sans); }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 22px; }
.brand img { width: 30px; height: 30px; border-radius: 4px; flex: none; }
.brand .wm { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.brand .wm small { display: block; font-size: 11px; font-weight: 500; color: var(--sidebar-muted); letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.nav .sec { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--sidebar-muted); padding: 16px 10px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: 8px; color: var(--sidebar-text); font-size: 14px; opacity: .88; text-decoration: none; transition: background .15s var(--ease); }
.nav a:hover { background: var(--sidebar-active); opacity: 1; }
.nav a.active { background: var(--sidebar-active); opacity: 1; font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #E04A5A; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: rgba(255, 255, 255, .12); }
.nav .count.alert { background: var(--crimson-solid); color: #fff; }
.side-foot { margin-top: auto; padding: 14px 18px; font-size: 12px; color: var(--sidebar-muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-foot button { background: none; border: 0; color: var(--sidebar-muted); cursor: pointer; width: 40px; height: 40px; padding: 0; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.side-foot button:hover { color: #fff; background: var(--sidebar-active); }
.app.rail .brand .wm, .app.rail .nav .label, .app.rail .nav .sec, .app.rail .nav .count, .app.rail .side-foot .ver { display: none; }
.app.rail .brand { justify-content: center; padding: 18px 0 22px; }
.app.rail .nav a { justify-content: center; padding: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 24px; font-family: var(--font-sans); }
/* The title never shrinks or truncates: it is the one thing on this bar the
   person came to read. Everything else (the search box especially) gives up
   its room first (see .search below), so "Action Register" etc. always
   shows in full, even next to a wide clock widget (clock button + a timer
   chip) at laptop widths like 1366/1280/1024. */
.topbar h1 { flex: none; font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; min-width: 0; }
.search { position: relative; width: 360px; max-width: 34vw; flex: 0 1 360px; min-width: 0; }
.search input { width: 100%; min-width: 0; height: 36px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 0 64px 0 36px; }
.search input:focus { background: var(--surface); }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--text-3); }
.search kbd { position: absolute; right: 8px; top: 8px; font: 500 11px var(--font-sans); color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--surface); }
.iconbtn { position: relative; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--text-2); }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--crimson-solid); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--navy-tint); color: var(--navy); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; letter-spacing: .02em; }
.avatar.s24 { width: 24px; height: 24px; font-size: 10px; }
.avatar.s18 { width: 18px; height: 18px; font-size: 8px; }
/* An external assigner's avatar: a rounded square (not a circle), so it never
   looks like a person's. A logo sits on its own white tile, object-fit
   contain, so a wide or non-square logo still fits without distortion. No
   logo set: the same neutral initials tile a person's avatar() uses. */
.avatar.logo { border-radius: 7px; overflow: hidden; }
.avatar.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 2px; box-sizing: border-box; }
.content { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 2px; font-size: 15px; }
.page-head .input { width: auto; min-width: 180px; }
.page-head h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.wrap-any { overflow-wrap: anywhere; min-width: 0; }
select.input { max-width: 100%; }
.page-head > * { max-width: 100%; min-width: 0; }
.page-head select.input { min-width: 0; }

/* ------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--border); background: var(--surface); color: var(--navy); font-weight: 600; font-size: 14px; font-family: var(--font-sans); cursor: pointer; white-space: nowrap; transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn.primary { background: #B21E2E; border-color: #B21E2E; color: #fff; }
.btn.primary:hover { background: #971828; border-color: #971828; }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .btn.navy { color: #0B1220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.navy { color: #0B1220; } }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 999px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-2); font-family: var(--font-sans); }
.field .hint { font-size: 12px; color: var(--text-3); font-family: var(--font-sans); }
.field .field-err { font-size: 12px; color: var(--crimson); font-family: var(--font-sans); }
.input, select.input, textarea.input { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); padding: 0 10px; transition: border-color .15s var(--ease); }
textarea.input { height: auto; min-height: 88px; padding: 8px 10px; line-height: 20px; resize: vertical; }
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: #1E4FBF; box-shadow: var(--focus); }
.input[readonly] { background: var(--surface-2); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--surface-2); }
.seg button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; flex: none; accent-color: var(--crimson); }

/* ------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-h h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.card-b { padding: 16px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpis.five, .kpis.kpis-5 { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 16px; display: flex; flex-direction: column; gap: 6px; text-decoration: none !important; color: inherit; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
/* The card's own box-shadow (.card, above) sits later in this file than the
   global :focus-visible rule and wins on equal specificity, so a plain
   :focus-visible never actually shows a ring on a card. Restate it here,
   scoped to .kpi, so the now-clickable Dashboard cards get a real one. */
.kpi:focus-visible { outline: none; box-shadow: var(--focus); }
.kpi .k { font-size: 12px; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 8px; font-family: var(--font-sans); }
.kpi .v { font-size: 28px; line-height: 32px; font-weight: 600; font-variant-numeric: tabular-nums; font-family: var(--font-sans); }
.kpi.alert .v { color: var(--crimson); }
.kpi .bar { height: 3px; border-radius: 3px; background: var(--surface-3); margin-top: 6px; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.dash > * { min-width: 0; }
.mobile-only { display: none !important; }

/* Text people type (reasons, notes, titles, URLs) wraps instead of pushing the page wider. */
.card, .card-b, .list-item .grow, .list-item .t1, .list-item .t2, .feed li > div, .callout, .tbl td, .tcard .ttl, .event .body, .preview-text, .page-head .sub, .modal-b, .drawer-b { overflow-wrap: anywhere; }
.list-item .t2 { min-width: 0; }
.main, .content { min-width: 0; }

/* ------------------------------------------------------------ pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; font-family: var(--font-sans); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pill.s-not-started { color: var(--st-ns-fg); background: var(--st-ns-bg); }
.pill.s-in-progress { color: var(--st-ip-fg); background: var(--st-ip-bg); }
.pill.s-waiting { color: var(--st-wt-fg); background: var(--st-wt-bg); }
.pill.s-in-review { color: var(--st-rv-fg); background: var(--st-rv-bg); }
.pill.s-done { color: var(--st-dn-fg); background: var(--st-dn-bg); }
.pill.overdue { color: var(--st-od-fg); background: var(--st-od-bg); }
.pill.plain::before { display: none; }
.pill.draft { color: var(--st-wt-fg); background: var(--st-wt-bg); }
.pill.approved { color: var(--st-dn-fg); background: var(--st-dn-bg); }
.pill.archived { color: var(--st-ns-fg); background: var(--st-ns-bg); }
.prio { width: 8px; height: 8px; border-radius: 999px; flex: none; display: inline-block; }
.prio.Urgent { background: var(--pr-urgent); } .prio.High { background: var(--pr-high); } .prio.Low { background: var(--pr-low); } .prio.Normal { background: transparent; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-sans); }
.chip.due-over { background: var(--crimson-tint); color: var(--crimson-text); }
.chip.due-soon { background: var(--st-wt-bg); color: var(--st-wt-fg); }

/* ------------------------------------------------------------ lists / tables */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { position: sticky; top: 56px; background: var(--surface-2); text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; font-family: var(--font-sans); }
.tbl th:first-child { border-top-left-radius: var(--r-card); } .tbl th:last-child { border-top-right-radius: var(--r-card); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 18px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .12s var(--ease); }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .title-cell { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.tbl .title-cell .t { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tbl .ref { color: var(--text-3); font-family: var(--font-sans); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input { width: auto; min-width: 150px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s var(--ease); color: inherit; text-decoration: none !important; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t1 { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .t2 { font-size: 12px; color: var(--text-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; font-family: var(--font-sans); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 18px; }
.feed li:last-child { border-bottom: 0; }
.feed .when { color: var(--text-3); font-size: 12px; white-space: nowrap; font-family: var(--font-sans); }

/* ------------------------------------------------------------ documents tab */
.doc-card .card-h { padding: 10px 16px; }
.doc-version { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.doc-version:last-child { border-bottom: 0; }
.doc-version .t2 { flex: 1; min-width: 0; margin-top: 0; font-size: 12px; color: var(--text-2); font-family: var(--font-sans); }
/* Line 1: "Version 2 · Shawal Atta · 28 September 2026, 10:01" plus the
   Latest / Partner / Associate tags. The separator glues the middle dot to
   the word before it with a non-breaking space, so a wrap (the whole point
   here is to fit the tags on one line where there is room, and to drop
   cleanly to a new line where there is not) can only ever break after a
   "· ", never before it: a line never starts with a stray "·". */
.doc-version-line1 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.doc-version-note { margin-top: 3px; overflow-wrap: anywhere; }
.doc-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; font-family: var(--font-sans); }
.doc-tag.partner { color: var(--navy); background: var(--navy-tint); }
.doc-tag.associate { color: var(--crimson-text); background: var(--crimson-tint); }

/* ------------------------------------------------------------ board */
.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-card); display: flex; flex-direction: column; min-height: 200px; max-height: calc(100vh - 170px); }
.col-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px; }
.col-h .n { font-size: 12px; color: var(--text-2); font-weight: 600; font-family: var(--font-sans); }
.col-b { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 12px; overflow-y: auto; flex: 1; }
.col.drop { outline: 2px dashed var(--navy); outline-offset: -4px; }
.col.locked { background: var(--surface-3); border-style: dashed; }
.col.locked .col-b .tcard { cursor: default; }
.col.locked .col-h::after { content: "Partner only"; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease); }
.tcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.tcard.dragging { opacity: .5; transform: rotate(1deg); }
.tcard .top { display: flex; align-items: center; gap: 6px; }
.tcard .ttl { font-size: 14px; line-height: 20px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tcard .foot > .avatar { margin-left: auto; }
.ghost-card { border: 2px dashed var(--border-strong); border-radius: 8px; height: 64px; }

/* ------------------------------------------------------------ drawer / modal */
.scrim { position: fixed; inset: 0; background: rgba(10, 18, 36, .38); z-index: 40; opacity: 0; transition: opacity .2s var(--ease); }
.scrim.on { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100vw; background: var(--surface); z-index: 41; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .24s var(--ease); border-radius: var(--r-drawer) 0 0 var(--r-drawer); }
.drawer.on { transform: none; }
.drawer-h { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; gap: 12px; }
.drawer-h .grow { flex: 1; min-width: 0; }
.drawer-b { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-f { border-top: 1px solid var(--border); padding: 12px 20px; }
.ttl-edit { display: block; font: 600 20px/28px var(--font-sans); border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin: 2px 0 0; width: 100%; background: none; }
textarea.ttl-edit { resize: none; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.ttl-edit:hover { border-color: var(--border); }
.ttl-edit:focus { border-color: #1E4FBF; box-shadow: var(--focus); outline: none; }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-bottom: 20px; }
.meta .field.wide { grid-column: 1 / -1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 12px; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--crimson); }
/* Invoices status tabs: seven tabs are wider than a phone, so the row scrolls inside its own box and the page itself never scrolls sideways. */
.tabs.inv-tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tabs.inv-tabs button { flex: none; white-space: nowrap; }
.kpi .v .v-line + .v-line { font-size: 18px; line-height: 24px; }
.inv-hours-flag { margin-left: 6px; white-space: normal; }
.inv-more { margin-top: 8px; }
.event { display: flex; gap: 10px; padding: 8px 0; font-size: 13px; line-height: 18px; }
.event .body { flex: 1; min-width: 0; }
.event .note { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.event .diff { color: var(--text-2); overflow-wrap: anywhere; }
.event .diff s { color: var(--text-3); }
.saved { font-size: 12px; color: var(--st-dn-fg); display: inline-flex; align-items: center; gap: 4px; opacity: 0; transition: opacity .2s; }
.saved.on { opacity: 1; }
.modal { position: fixed; z-index: 42; left: 50%; top: 10vh; transform: translate(-50%, 8px); width: 620px; max-width: calc(100vw - 32px); max-height: 80vh; background: var(--surface); border-radius: var(--r-drawer); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; opacity: 0; transition: opacity .18s var(--ease), transform .18s var(--ease); }
.modal.on { opacity: 1; transform: translate(-50%, 0); }
.modal.wide { width: 900px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-b { padding: 20px; overflow-y: auto; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: none; }
.modal-msg { flex: 1 1 100%; color: var(--crimson); font-size: 14px; line-height: 20px; font-weight: 600; font-family: var(--font-sans); overflow-wrap: anywhere; }
.input.invalid, select.input.invalid { border-color: var(--crimson); box-shadow: 0 0 0 3px var(--crimson-tint); }
.quick { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 6px 6px 12px; }
.quick input { border: 0; background: none; flex: 1; height: 34px; outline: none; font-size: 15px; }
.ai-note { font-size: 12px; color: var(--text-2); display: flex; gap: 6px; align-items: center; margin-top: 8px; font-family: var(--font-sans); }
.ai-note .i { color: var(--navy); }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--navy); background: var(--navy-tint); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.callout.warn { border-left-color: #B7791F; background: var(--st-wt-bg); color: var(--text); }
.callout.bad { border-left-color: var(--crimson); background: var(--crimson-tint); }
.callout.ok { border-left-color: #1B6B3A; background: var(--st-dn-bg); }

/* ------------------------------------------------------------ toast */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; background: #0F1B33; color: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; max-width: 440px; font-size: 14px; font-family: var(--font-sans); transform: translateY(12px); opacity: 0; transition: all .2s var(--ease); }
.toast.on { transform: none; opacity: 1; }
body:has(.drawer.on) .toast { right: 584px; max-width: min(440px, calc(100vw - 850px)); }
@media (max-width: 1179px) and (min-width: 768px) {
  body:has(.drawer.on) .toast { right: 16px; bottom: auto; top: 64px; max-width: min(440px, calc(100vw - 32px)); }
}
.toast.bad { background: #7A1420; }
.toast button { background: none; border: 0; color: #9DBBFF; font-weight: 700; cursor: pointer; }

/* ------------------------------------------------------------ empty / skeleton */
.empty { text-align: center; padding: 48px 24px; }
.empty .ic { width: 48px; height: 48px; border-radius: 999px; background: var(--navy-tint); color: var(--navy); display: inline-grid; place-items: center; margin-bottom: 12px; }
.empty h4 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.empty p { margin: 0 0 16px; color: var(--text-2); }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 6px; height: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------------ leave calendar */
.leave-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.leave-cal .dow { font-size: 11px; font-weight: 600; color: var(--text-3); text-align: center; padding-bottom: 4px; }
.leave-cal .day { min-height: 64px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 6px; font-size: 11px; background: var(--surface); }
.leave-cal .day.out { background: var(--surface-2); }
.leave-cal .day.adj { background: var(--surface-3); }
.leave-cal .day.adj .n { color: var(--text-2); }
.leave-cal .day.today { border-color: var(--navy); }
.leave-cal .day .n { font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.leave-cal .day .who { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
@media (max-width: 767px) {
  .leave-cal { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .leave-cal .day { min-height: 44px; padding: 3px 4px; font-size: 9.5px; }
}

/* ------------------------------------------------------------ popover */
.pop { position: absolute; right: 0; top: 44px; width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-lg); z-index: 30; overflow: hidden; }
.pop .list-item .t1 { white-space: normal; font-weight: 500; }
.pop .unread .t1 { font-weight: 700; }
.pop .unread::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--crimson); flex: none; }
.menu { position: absolute; right: 0; top: 44px; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-lg); z-index: 30; padding: 6px; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text); font-size: 14px; text-decoration: none !important; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }

/* ------------------------------------------------------------ documents */
.review { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.review .side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 16px; }
.rule { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.rule:last-child { border-bottom: 0; }
.rule .mk { width: 18px; height: 18px; border-radius: 999px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; margin-top: 1px; }
.rule .mk.ok { background: #1B6B3A; } .rule .mk.bad { background: var(--crimson); } .rule .mk.warn { background: #B7791F; }
.rule .hit { font-size: 12px; color: var(--text-2); margin-top: 3px; overflow-wrap: anywhere; }
.pages { display: flex; flex-wrap: wrap; gap: 6px; }
.pages span { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); cursor: pointer; }
.pages span.seen { background: var(--st-dn-bg); color: var(--st-dn-fg); border-color: transparent; }
.pages span.cur { box-shadow: 0 0 0 2px var(--navy); }
.viewer { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 20px; min-height: 60vh; }
.viewer canvas { background: #fff; box-shadow: var(--shadow-md); max-width: 100%; height: auto !important; }
.viewer .pg { position: relative; }
.viewer .pg .lab { position: absolute; top: -18px; left: 0; font-size: 11px; color: var(--text-3); }
.viewer-bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.editor { font-family: var(--font-sans); font-size: 14px; line-height: 20px; min-height: 320px; }
.ai-problems { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ai-problems label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
mark.flag { background: var(--st-wt-bg); color: var(--st-wt-fg); border-radius: 3px; padding: 0 2px; }
.preview-text { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; max-height: 260px; overflow: auto; font-size: 13px; line-height: 20px; }

/* ------------------------------------------------------------ invoices */
.inv-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 46%); gap: 24px; align-items: start; }
.inv-editor > * { min-width: 0; }
.inv-preview { position: sticky; top: 76px; }
.inv-preview { overflow: hidden; padding: 0; }
.inv-hist { padding: 8px 16px 12px; }
.inv-hist .row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.inv-hist .row:last-child { border-bottom: 0; }
.inv-hist .when { color: var(--text-3); font-family: var(--font-sans); font-size: 13px; }
@media (max-width: 760px) { .inv-hist .row { grid-template-columns: 1fr; gap: 2px; } }
.inv-preview-scroll { height: 78vh; min-height: 520px; overflow-y: auto; overflow-x: hidden; background: #e6e8ec; border-radius: 8px; }
.inv-preview-sizer { position: relative; overflow: hidden; }
.inv-preview iframe { position: absolute; top: 0; left: 0; width: 816px; height: 2400px; border: 0; background: #e6e8ec; transform-origin: 0 0; }
.inv-lines { display: flex; flex-direction: column; gap: 8px; }
.inv-line-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 100px 110px 32px; gap: 8px; align-items: center; }
.inv-line-row .amt { font-size: 13px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-sans); }
.inv-line-row .inv-line-detail { grid-column: 1 / -1; resize: vertical; min-height: 34px; font-size: 12.5px; }
.inv-line-head { display: grid; grid-template-columns: minmax(0, 1fr) 64px 100px 110px 32px; gap: 8px; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 0 2px; }
.inv-adj-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 140px 32px; gap: 8px; align-items: center; }
.inv-rowbtn { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.inv-rowbtn:hover { background: var(--surface-2); }
@media (pointer: coarse) { .inv-rowbtn { width: 40px; height: 40px; } }
.inv-accts { display: flex; flex-direction: column; gap: 6px; }
.inv-accts label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.inv-totalline { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.inv-totalline.b { font-weight: 700; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
/* One cost in the Expenses box on an invoice: the text wraps, and the status and the buttons stay inside the card. */
.list-item.cost-row { min-width: 0; }
.list-item.cost-row .grow { min-width: 0; }
.list-item.cost-row .t1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; white-space: normal; overflow: visible; text-overflow: clip; min-width: 0; }
.list-item.cost-row .cost-main { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.list-item.cost-row .t1 .pill { flex: none; max-width: 100%; }
.list-item.cost-row .t2 { overflow-wrap: anywhere; word-break: break-word; }
.list-item.cost-row .cost-acts { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.entity-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.entity-card:last-child { border-bottom: 0; }
.pay-acct { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.pay-acct-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 8px; margin-top: 6px; }

/* ------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .art { background: var(--sidebar); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border: 60px solid rgba(178, 30, 46, .35); transform: rotate(45deg); }
.login .art h2 { font-size: 32px; line-height: 40px; margin: 0 0 12px; font-weight: 600; max-width: 420px; }
.login .art p { color: var(--sidebar-muted); max-width: 400px; margin: 0; }
.login .form { display: grid; place-items: center; padding: 32px; }
.login form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login h1 { margin: 0; font-size: 24px; font-weight: 600; }
.login .err { color: var(--crimson); font-size: 13px; min-height: 18px; }

/* ------------------------------------------------------------ mobile */
.bottomnav { display: none; }
@media (max-width: 1023px) {
  .app { grid-template-columns: 64px 1fr; }
  .app .brand .wm, .app .nav .label, .app .nav .sec, .app .nav .count, .app .side-foot .ver { display: none; }
  .app .brand { justify-content: center; padding: 18px 0 22px; }
  .app .nav a { justify-content: center; padding: 0; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .review { grid-template-columns: 1fr; }
  .review .side { position: static; }
}
/* Above 1300, the search box shrinks (see the flex on .search) as the clock
   widget and other topbar controls need room, rather than forcing the page
   title to truncate. At or below 1300 the sidebar is at its widest relative
   to the content (it only narrows to a rail at 1023 and below) and there is
   not enough width left for a usable search box next to it either way, so
   it is hidden outright there ("/" still focuses it; it is off-screen, not
   removed, same as the existing mobile behaviour below 768). */
@media (max-width: 1300px) {
  .search { display: none; }
}
@media (max-width: 767px) {
  body { font-size: 15px; }
  .app, .app.rail { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 0 12px; gap: 8px; }
  /* On a phone the title may shrink (with an ellipsis) so a long one, such as "Payments awaiting approval", never pushes the account avatar off the screen. */
  .topbar h1 { font-size: 17px; flex: 0 1 auto; min-width: 0; }
  .search, .topbar .btn.primary { display: none; }
  .content { padding: 16px 12px 96px; }
  .kpis, .kpis.five, .kpis.kpis-5 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid2, .grid3, .meta, .inv-editor { grid-template-columns: 1fr; }
  .inv-preview { position: static; }
  .inv-line-row, .inv-line-head, .inv-adj-row { grid-template-columns: 1fr; }
  .input, select.input, textarea.input { font-size: 16px; }
  .drawer { width: 100vw; border-radius: 0; }
  /* 100vh is the tallest the screen gets, with the browser's address and tool bars hidden; on a phone that
     pushes the pinned footer (the Create button) under the bottom bar. 100dvh follows what is actually visible. */
  .modal { top: 0; left: 0; transform: none; width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .modal-f { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal.on { transform: none; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border-bottom: 1px solid var(--border); padding: 10px 12px; }
  .tbl td { border: 0; padding: 2px 0; }
  .tbl td.hide-m { display: none; }
  .tbl td[data-label]:not(:empty)::before { content: attr(data-label) ": "; color: var(--text-3); font-size: 12px; }
  .board { grid-template-columns: repeat(5, 85vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .login { grid-template-columns: 1fr; }
  .login .art { display: none; }
  .pop { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; }
  .mobile-only { display: inline-flex !important; }
  .list-item { flex-wrap: wrap; row-gap: 6px; }
  .list-item .grow { flex-basis: calc(100% - 40px); }
  .toast, body:has(.drawer.on) .toast { left: 12px; right: 12px; max-width: none; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .bottomnav { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--surface); border-top: 1px solid var(--border); z-index: 25; padding-bottom: env(safe-area-inset-bottom); font-family: var(--font-sans); }
  .bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--text-2); background: none; border: 0; text-decoration: none !important; }
  .bottomnav a.active, .bottomnav button.more-btn[aria-expanded="true"] { color: var(--crimson-text); }
  .bottomnav .more-btn { cursor: pointer; font-family: inherit; }
  .bottomnav .fab { width: 48px; height: 48px; border-radius: 999px; background: #B21E2E; color: #fff; display: grid; place-items: center; margin-top: -18px; box-shadow: var(--shadow-md); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .bottomnav { display: none !important; }
  .app { display: block; }
}

.inv-fbtag { margin-left: 4px; font-size: 11px; white-space: nowrap; }
.client-contact .row .lbl { min-width: 80px; }

/* Invoice documents: the in-app PDF viewer on the invoice page. */
.inv-docs .viewer { max-height: 78vh; overflow: auto; min-height: 320px; padding-top: 28px; }
.inv-docs .inv-doctabs { margin: 0; }
.inv-docs .inv-docbar { margin-bottom: 0; }
.inv-docnote:empty { display: none; }
.inv-pdfcell { text-align: right; white-space: nowrap; width: 1%; }
.inv-pdfcell .btn, .inv-docs a.btn { text-decoration: none; }
@media (max-width: 760px) {
  .inv-docs .viewer { padding: 28px 6px 8px; max-height: 70vh; }
  .inv-docs .inv-docbar .row { width: 100%; }
}

/* ------------------------------------------------------------ phone "More" sheet */
.more-sheet { position: fixed; left: 8px; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 140px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-drawer); box-shadow: var(--shadow-lg); z-index: 45; padding: 8px; font-family: var(--font-sans); }
.more-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.more-h h3 { margin: 0; font-size: 16px; font-weight: 600; }
.more-h .iconbtn { font-size: 24px; line-height: 1; width: 40px; height: 40px; }
.more-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.more-list .sec { grid-column: 1 / -1; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 10px 8px 2px; }
.more-list a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--text); font-size: 15px; text-decoration: none; }
.more-list a:hover, .more-list a:focus-visible { background: var(--surface-2); }
.more-list a.active { background: var(--navy-tint); font-weight: 600; }
@media (min-width: 768px) { .more-btn, .more-sheet { display: none !important; } }
/* The owner's pending Assistant requests: a count on the bottom bar's More button, and the same count beside Assistant inside the More sheet. */
.bottomnav .more-btn { position: relative; }
.more-btn .count { position: absolute; top: 6px; left: calc(50% + 4px); }
.more-btn .count, .more-list .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; display: inline-grid; place-items: center; background: var(--crimson-solid); color: #fff; font-family: var(--font-sans); }
.more-list a .count { margin-left: auto; }
@media (max-width: 767px) {
  /* Phone: the controls in dialogs are the 44px touch minimum. */
  .modal-f .btn, .modal-f .btn.sm { min-height: 44px; }
  .modal .input, .modal select.input { min-height: 44px; }
}

/* ------------------------------------------------------------ touch targets */
@media (pointer: coarse), (max-width: 767px) {
  .btn { min-height: 40px; }
  .btn.sm { height: auto; min-height: 40px; padding: 0 12px; }
  .iconbtn { width: 40px; height: 40px; }
  .seg button, .tabs button { min-height: 40px; }
  .card-h a, .page-head a.faint { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
  .check { min-height: 40px; }
  .menu button, .menu a { min-height: 40px; }
  .pages span { width: 40px; height: 40px; }
  .input, select.input { min-height: 40px; }
  textarea.input { min-height: 88px; }
  .topbar .clock-btn { min-height: 40px; }
  a.faint { display: inline-flex; align-items: center; min-height: 40px; }
  .quick input { height: 40px; }
}
.date-long { font-size: 12px; line-height: 16px; color: var(--text-2); min-height: 0; }
.date-long:empty { display: none; }

/* ------------------------------------------------------------ app switcher (2.21.2) */
.brand-btn { width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; position: relative; }
.brand-btn:hover { background: var(--sidebar-active); }
.brand-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.brand-btn .brand-chev { margin-left: auto; color: var(--sidebar-muted); display: inline-flex; }
.brand-btn[aria-expanded="true"] .brand-chev svg { transform: rotate(180deg); }
.app.rail .brand-btn .brand-chev { display: none; }
.launcher { position: fixed; width: 280px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-lg); z-index: 50; padding: 6px; font-family: var(--font-sans); color: var(--text); }
.launcher-h { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 6px; }
.launcher-tile { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 8px; cursor: pointer; color: var(--text); font: inherit; text-decoration: none !important; }
.launcher-tile:hover, .launcher-tile:focus-visible { background: var(--surface-2); }
.launcher-tile.current { background: var(--navy-tint); }
.launcher-ic { width: 36px; height: 36px; border-radius: 8px; display: inline-grid; place-items: center; background: var(--surface-2); color: var(--navy); flex: none; }
.launcher-tile.current .launcher-ic { background: var(--surface); }
.launcher-tx { display: flex; flex-direction: column; min-width: 0; }
.launcher-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.launcher-cur { font-size: 11px; font-weight: 600; color: var(--text-2); }
.launcher-desc { font-size: 12px; line-height: 16px; color: var(--text-2); }
.launcher-more { grid-column: 1 / -1; display: grid; gap: 4px; }
@media (max-width: 767px) { .launcher-tile { min-height: 56px; } }
@media (max-width: 1023px) { .app .brand-btn .brand-chev { display: none; } }
.more-list a.launcher-tile, .more-list .launcher-tile { padding: 10px; min-height: 56px; font-size: 14px; align-items: flex-start; gap: 12px; }
