/* CA Firm OS demo. System fonts only; brand colours are set live from the Brand settings. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e2e7ee;
  --line-2: #edf1f5;
  --line-strong: #cfd6df;
  --ink: #0f1a2a;
  --ink-2: #334155;
  --muted: #586579;
  --brand: #0e6b5c;
  --brand-ink: #ffffff;
  --brand-text: #0e6b5c;
  --brand-soft: #e7f0ef;
  --brand-soft-2: #c8dcd8;
  --brand-deep: #094238;
  --brand-night: #071f1b;
  --late: #b42318;
  --late-bg: #fef3f2;
  --late-line: #fecdca;
  --warn: #a14708;
  --warn-bg: #fffaeb;
  --warn-line: #fedf89;
  --good: #067647;
  --good-bg: #ecfdf3;
  --good-line: #abefc6;
  --info: #175cd3;
  --info-bg: #eff8ff;
  --info-line: #b2ddff;
  --violet: #6941c6;
  --violet-bg: #f4f3ff;
  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-2: 0 14px 34px -10px rgba(16, 24, 40, 0.2), 0 4px 10px -4px rgba(16, 24, 40, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --demobar-h: 40px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
body.has-layer { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: var(--brand-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
[data-font="serif"] .h1, [data-font="serif"] .h2, [data-font="serif"] .side__name, [data-font="serif"] .signin__firm,
[data-font="serif"] .signin__claim, [data-font="serif"] .chead__name, [data-font="serif"] .paper__fname,
[data-font="serif"] .hello__t, [data-font="serif"] .panel__title, [data-font="serif"] .brandprev__name { font-family: var(--serif); letter-spacing: 0; }
.serif-sample { font-family: var(--serif); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 300; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.txt-late { color: var(--late); font-weight: 600; }
.txt-warn { color: var(--warn); font-weight: 600; }
.plain { list-style: none; margin: 0; padding: 0; }
.nowrap { white-space: nowrap; }
.i { width: 18px; height: 18px; flex: none; }
.i--xs { width: 14px; height: 14px; vertical-align: -2px; }
.boot, .noscript { padding: 48px 16px; text-align: center; color: var(--muted); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--line-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- demo bar (always visible) ---------- */
.demobar { position: sticky; top: 0; z-index: 150; height: var(--demobar-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: #0b1220; color: #e6eaf0; font-size: 13px; }
.demobar__id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #fde68a; color: #3d1f02; font-weight: 750; font-size: 12px; white-space: nowrap; }
.demo-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: #b45309; }
.demobar__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demobar__by { color: #a9b4c4; }
.demobar__controls { display: flex; align-items: center; gap: 6px; }
.demobar__date { display: inline-flex; align-items: center; gap: 6px; color: #c3cbd8; margin-right: 6px; white-space: nowrap; }
.demobar__date .i { width: 15px; height: 15px; }
.dbtn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; color: #eef1f6; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dbtn:hover { background: rgba(255, 255, 255, 0.09); }
.dbtn .i { width: 15px; height: 15px; }
.dbtn:focus-visible { outline-color: #fde68a; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - var(--demobar-h)); }
.side { position: sticky; top: var(--demobar-h); height: calc(100vh - var(--demobar-h)); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; overflow-y: auto; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; color: var(--ink); text-decoration: none; }
.side__firm { display: flex; flex-direction: column; min-width: 0; }
.side__name { font-weight: 720; font-size: 14px; line-height: 1.25; }
.side__tag { font-size: 12px; color: var(--muted); }
.logo { display: inline-grid; place-items: center; flex: none; background: var(--brand); color: var(--brand-ink); font-weight: 800; letter-spacing: -0.02em; border-radius: 10px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14); }
.logo--sm { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
.logo--md { width: 38px; height: 38px; font-size: 14px; }
.logo--lg { width: 46px; height: 46px; font-size: 17px; border-radius: 12px; }
.logo--xl { width: 60px; height: 60px; font-size: 22px; border-radius: 15px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 550; }
.nav__item .i { color: #64748b; }
.nav__item:hover { background: var(--surface-2); }
.nav__item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-text); font-weight: 680; }
.nav__item[aria-current="page"] .i { color: var(--brand-text); }
.nav__label { flex: 1; }
.nav__badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.nav__badge--late { background: var(--late-bg); color: var(--late); }
.side__foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.userchip { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 0; background: transparent; text-align: left; }
.userchip:hover { background: var(--surface-2); }
.userchip__txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.userchip__name { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip__role { font-size: 12px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: var(--demobar-h); z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(243, 245, 248, 0.9); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line-2); }
.topbar__brand, .topbar__user { display: none; }
.topbar__title { flex: 1; min-width: 0; }
.h1 { font-size: 20px; font-weight: 720; letter-spacing: -0.015em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { display: flex; align-items: center; gap: 8px; width: 300px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); text-align: left; }
.search:hover { border-color: var(--line-strong); }
.search__txt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface-2); }
.content { padding: 20px 28px 56px; outline: none; }
.content > #view { max-width: 1360px; }
.tabbar { display: none; }

/* ---------- generic components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 18px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card__head--pad { padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--line-2); }
.h2 { font-size: 15px; font-weight: 680; display: flex; align-items: center; gap: 8px; letter-spacing: -0.005em; }
.h3 { font-size: 14px; font-weight: 680; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stackcol { display: flex; flex-direction: column; gap: 16px; }
.link { color: var(--brand-text); font-weight: 650; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .i { width: 15px; height: 15px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand-text); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; display: inline-flex; align-items: center; gap: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: 13px; margin-bottom: 10px; }
.back:hover { color: var(--ink); }
.back .i { width: 16px; height: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 650; font-size: 13.5px; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); }
.btn:hover { background: var(--surface-2); }
.btn .i { width: 16px; height: 16px; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand); filter: brightness(0.93); }
.btn--danger { background: var(--late); border-color: var(--late); color: #fff; }
.btn--danger:hover { background: var(--late); filter: brightness(0.93); }
.btn--ghost-danger { color: var(--late); }
.btn--sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn--lg { height: 46px; font-size: 15px; border-radius: 11px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); }
.iconbtn:hover { background: var(--line-2); }
.iconbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.iconbtn--xs { width: 24px; height: 24px; border-radius: 6px; }
.iconbtn--xs .i { width: 14px; height: 14px; }

.input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink); font-size: 14px; }
.input:hover { border-color: #b8c1cc; }
.input:focus { outline: none; border-color: var(--brand-text); box-shadow: 0 0 0 3px var(--brand-soft-2); }
textarea.input { height: auto; padding: 8px 11px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23586579' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.input--sm { height: 32px; font-size: 13px; padding: 0 9px; border-radius: 8px; }
select.input--sm { padding-right: 28px; }
.input--xs { height: 28px; font-size: 12px; padding: 0 22px 0 6px; width: auto; max-width: 118px; border-radius: 7px; background-position: right 6px center; }
.input[type="file"] { height: auto; padding: 7px; }
.input.num { text-align: right; }
.input.mono { font-size: 13.5px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0; border: 0; padding: 0; }
.field__label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); padding: 0; }
.field--inline { max-width: 360px; }
.field__err { color: var(--late); font-size: 12.5px; margin-top: -6px; }
.field__err:empty { display: none; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.formstack { display: flex; flex-direction: column; gap: 14px; }
.fset { border: 1px solid var(--line); border-radius: 11px; padding: 10px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fset legend { font-weight: 680; font-size: 13px; padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 9px 20px; }
.checks--col { flex-direction: column; gap: 9px; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.actions--stack { flex-direction: column; }
.actions--stack .btn { width: 100%; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--info-line); background: var(--info-bg); font-size: 13px; margin: 0 0 16px; }
.notice > .i { color: var(--info); margin-top: 1px; }
.notice a { font-weight: 650; }
.notice--ok { background: var(--good-bg); border-color: var(--good-line); }
.notice--ok > .i { color: var(--good); }
.notice--ext { background: var(--warn-bg); border-color: var(--warn-line); }
.notice--ext > .i { color: var(--warn); }
.notice ul { margin-top: 4px; }
.notice li + li { margin-top: 4px; }
.stalebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; margin: 0 0 16px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 12px; font-size: 13.5px; }
.stalebar > .i { color: var(--warn); flex: none; }
.stalebar p { flex: 1 1 320px; margin: 0; min-width: 0; }
.stalebar__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.idnote { display: inline-flex; align-items: center; font-size: 12px; color: var(--muted); }
.duenote { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.duenote .i { margin-top: 2px; }

.pill { --st: #475467; --st-bg: #f2f4f7; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--st-bg); color: var(--st); }
.pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--waiting { --st: #a14708; --st-bg: #fffaeb; }
.pill--progress { --st: #175cd3; --st-bg: #eff8ff; }
.pill--review { --st: #6941c6; --st-bg: #f4f3ff; }
.pill--done { --st: #067647; --st-bg: #ecfdf3; }
.pill--late { box-shadow: inset 0 0 0 1.5px var(--late); color: var(--late); background: var(--late-bg); }
.pill--planned { --st: #586579; --st-bg: #fff; box-shadow: inset 0 0 0 1px #cfd6df; }
.law { --l: #475467; --l-bg: #f2f4f7; --l-line: #e4e7ec; display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 720; letter-spacing: 0.01em; background: var(--l-bg); color: var(--l); border: 1px solid var(--l-line); white-space: nowrap; }
.law--gst, .cchip--gst, .lawtog--gst { --l: #1849a9; --l-bg: #eef4ff; --l-line: #c7d7fe; }
.law--tds, .cchip--tds, .lawtog--tds { --l: #93370d; --l-bg: #fef6ee; --l-line: #f9dbaf; }
.law--it, .cchip--it, .lawtog--it { --l: #5925dc; --l-bg: #f4f3ff; --l-line: #d9d6fe; }
.law--roc, .cchip--roc, .lawtog--roc { --l: #a11043; --l-bg: #fff1f3; --l-line: #fecdd6; }
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 720; padding: 1px 6px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag--ext { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.tag--test { background: #fef0c7; color: #7a2e0e; }
.av { --av: #475467; display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--av); color: #fff; font-weight: 720; letter-spacing: 0.01em; }
.av--xs { width: 20px; height: 20px; font-size: 8.5px; }
.av--sm { width: 26px; height: 26px; font-size: 10px; }
.av--md { width: 32px; height: 32px; font-size: 12px; }
.av--lg { width: 44px; height: 44px; font-size: 15px; }
.av--none { background: var(--line); color: var(--muted); }
.person { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.person__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.avs { display: inline-flex; }
.avs .av + .av, .agenda__people .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.due { display: flex; flex-direction: column; line-height: 1.25; text-align: right; white-space: nowrap; }
.due__date { font-weight: 650; font-size: 13px; }
.due__rel { font-size: 12px; color: var(--muted); }
.due--late .due__rel { color: var(--late); font-weight: 650; }
.due--done .due__rel { color: var(--good); }
.meter { display: block; height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; flex: 1; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width 0.25s; }
.meter--sm { max-width: 48px; min-width: 32px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 16px; color: var(--muted); }
.empty__i { width: 30px; height: 30px; margin-bottom: 8px; color: #98a2b3; }
.empty__t { font-weight: 650; color: var(--ink-2); }
.empty__p { font-size: 13px; margin-top: 2px; }
.mini li + li { border-top: 1px solid var(--line-2); }
.mini--pad { padding: 6px 10px; }
.dl { margin: 0 0 10px; display: grid; gap: 6px; }
.dl div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- home ---------- */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.hello__t { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.kpis--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { --tone: #cfd6df; position: relative; display: flex; flex-direction: column; gap: 1px; padding: 14px 16px 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); text-decoration: none; color: inherit; overflow: hidden; min-width: 0; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); }
a.kpi:hover { box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.kpi--late { --tone: var(--late); }
.kpi--warn { --tone: #f79009; }
.kpi--good { --tone: #17b26a; }
.kpi--info { --tone: #2e90fa; }
.kpi--plain { --tone: var(--brand); }
.kpi__label { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.kpi__value { font-size: 27px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi--late .kpi__value { color: var(--late); }
.kpi__sub { font-size: 12px; color: var(--muted); }
.agenda { display: flex; flex-direction: column; gap: 8px; }
.agenda__sep { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 720; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 6px 0 8px; }
.agenda__sep--late { color: var(--late); }
.agenda__sep .i { width: 15px; height: 15px; }
.agenda .agenda + .agenda__sep { margin-top: 14px; }
.agenda__item { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); transition: box-shadow 0.15s; }
.agenda__item[open] { box-shadow: var(--shadow-2); }
.agenda__item--late { border-color: var(--late-line); }
.agenda__item summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; border-radius: 11px; }
.agenda__item summary::-webkit-details-marker { display: none; }
.agenda__item summary:hover { background: var(--surface-2); }
.agenda__main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.agenda__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agenda__meta { font-size: 12.5px; color: var(--muted); }
.agenda__people { display: inline-flex; }
.agenda__chev { color: var(--muted); transition: transform 0.15s; }
.agenda__item[open] .agenda__chev { transform: rotate(180deg); }
.agenda__list { list-style: none; margin: 0; padding: 4px 8px 8px; border-top: 1px solid var(--line-2); }
.datebadge { display: grid; place-items: center; align-content: center; width: 44px; height: 46px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); line-height: 1.05; flex: none; }
.datebadge b { font-size: 17px; }
.datebadge span { font-size: 10.5px; text-transform: uppercase; color: var(--muted); font-weight: 650; letter-spacing: 0.04em; }
.datebadge--late { background: var(--late-bg); border-color: var(--late-line); color: var(--late); }
.datebadge--late span { color: var(--late); }
.datebadge--soon { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand-text); }
.datebadge--soon span { color: var(--brand-text); }
.ring { --p: 0; width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(#17b26a calc(var(--p) * 1%), var(--line-2) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 10.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.rowbtn { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px; border: 0; background: transparent; border-radius: 8px; text-align: left; color: inherit; }
.rowbtn:hover { background: var(--surface-2); }
.rowbtn__name { font-weight: 600; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .rowbtn { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.wl { padding: 9px 0; border-top: 1px solid var(--line-2); }
.wl:first-of-type { border-top: 0; }
.wl__head { display: flex; align-items: center; gap: 8px; }
.wl__name { flex: 1; font-weight: 650; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl__num { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wl__track { height: 8px; border-radius: 999px; background: var(--line-2); margin: 7px 0 4px; overflow: hidden; }
.wl__fill { display: block; height: 100%; border-radius: inherit; background: #17b26a; }
.wl__fill--high { background: #f79009; }
.wl__fill--over { background: var(--late); }
.wl__meta { font-size: 12px; color: var(--muted); }
.wl--compact { border-top: 0; padding-top: 2px; }
.wl__head--compact { justify-content: space-between; }
.waitrow a { display: flex; flex-direction: column; padding: 9px 0; border-top: 1px solid var(--line-2); color: inherit; text-decoration: none; }
.waitrow:first-child a { border-top: 0; padding-top: 0; }
.waitrow a:hover b { text-decoration: underline; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.feed li { display: flex; gap: 10px; font-size: 13px; align-items: flex-start; }
.feed li .av { margin-top: 2px; }
.feed__at { display: block; font-size: 11.5px; color: var(--muted); }

/* ---------- work ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.toolbar__new { margin-left: auto; }
.toolbar__note { margin-left: auto; }
.tsearch { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 320px; }
.tsearch .i { position: absolute; left: 9px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.tsearch .input { padding-left: 31px; }
.fsel .input { width: auto; }
.segbtns { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.segbtn { border: 0; background: transparent; height: 32px; padding: 0 12px; font-size: 13px; font-weight: 650; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.segbtn + .segbtn { border-left: 1px solid var(--line); }
.segbtn .i { width: 16px; height: 16px; }
.segbtn[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-text); }
.filterchip { display: inline-flex; gap: 8px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); font-size: 13px; margin: 0 0 12px; }
.tgroup { margin-bottom: 18px; }
.tgroup__h { font-size: 13px; font-weight: 720; color: var(--ink-2); margin: 0 0 8px; display: flex; gap: 6px; }
.tlist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-1); }
.tlist li + li { border-top: 1px solid var(--line-2); }
.trow { width: 100%; display: grid; grid-template-columns: 116px minmax(0, 2.4fr) 92px minmax(0, 1.25fr) 112px 96px 92px; align-items: center; gap: 12px; padding: 10px 14px; border: 0; background: transparent; text-align: left; color: inherit; }
.trow:hover { background: var(--surface-2); }
.trow--late { box-shadow: inset 3px 0 0 var(--late); }
.trow__main { display: flex; flex-direction: column; min-width: 0; }
.trow__title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow__client { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow__who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.trow__whoname { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow__prog { display: flex; align-items: center; gap: 6px; }
.trow__docs { display: flex; align-items: center; gap: 4px; justify-content: flex-end; color: var(--muted); }
.trow__docs .i { width: 15px; height: 15px; }
.board__hint { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(196px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #eceff3; border-radius: 12px; padding: 10px; min-height: 220px; border: 1px solid var(--line-2); transition: background 0.12s; }
.col--over { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft); }
.col__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; font-size: 13px; font-weight: 650; }
.col__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.col__empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.col__more { margin-top: 8px; text-align: center; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-1); }
.kcard:hover { border-color: var(--line-strong); }
.kcard--late { box-shadow: inset 3px 0 0 var(--late), var(--shadow-1); }
.kcard--drag { opacity: 0.45; }
.kcard__btn { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 12px; border: 0; background: transparent; text-align: left; color: inherit; cursor: grab; }
.kcard__top { display: flex; gap: 6px; align-items: center; margin-bottom: 2px; }
.kcard__title { font-size: 13px; font-weight: 680; }
.kcard__client { font-size: 12px; color: var(--muted); }
.kcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.kcard__foot .due { text-align: left; }
.kcard__prog { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; }

/* ---------- task panel ---------- */
.tk { display: flex; flex-direction: column; gap: 16px; }
.tk__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tk__due { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.tk__due--late { border-color: var(--late-line); background: var(--late-bg); }
.tk__due--done { border-color: var(--good-line); background: var(--good-bg); }
.tk__duemain { display: flex; align-items: center; gap: 10px; }
.tk__duemain > .i { width: 22px; height: 22px; color: var(--muted); }
.tk__due--late .tk__duemain > .i { color: var(--late); }
.tk__duemain > div { flex: 1; min-width: 0; }
.tk__date { font-weight: 720; font-size: 15px; }
.tk__rel { font-size: 12.5px; color: var(--muted); }
.tk__due--late .tk__rel { color: var(--late); font-weight: 650; }
.tk__ext { margin-top: 8px; font-size: 12.5px; }
.tk__rule { margin: 10px 0 0; display: grid; gap: 4px; font-size: 12.5px; }
.tk__rule div { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 8px; }
.tk__rule dt { color: var(--muted); }
.tk__rule dd { margin: 0; }
.tk__rule a { font-weight: 650; text-decoration: none; }
.tk__rule a:hover { text-decoration: underline; }
.tk__note { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg legend { padding: 0; margin-bottom: 6px; }
.seg__opts { display: flex; border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; gap: 2px; background: var(--surface-2); }
.seg__opt { flex: 1; position: relative; min-width: 0; }
.seg__opt input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.seg__opt span { display: block; text-align: center; padding: 6px 4px; border-radius: 7px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg__opt input:checked + span { background: var(--surface); box-shadow: var(--shadow-1); color: var(--brand-text); }
.seg__opt input:focus-visible + span { outline: 2px solid var(--brand-text); outline-offset: 1px; }
.seg:disabled .seg__opt input { cursor: not-allowed; }
.seg:disabled .seg__opt input:not(:checked) + span { opacity: 0.55; }
select.input:disabled { background-color: var(--surface-2); cursor: not-allowed; }
.tk__sec { border-top: 1px solid var(--line-2); padding-top: 14px; }
.tk__sechead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tk__sec .meter { margin-top: 8px; }
.checklist { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.comments { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comments li { display: flex; gap: 10px; font-size: 13.5px; }
.comments__by { display: flex; gap: 8px; align-items: baseline; }
.commentform { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.commentform textarea { flex: 1; }
.tk__actions { position: sticky; bottom: -18px; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 0 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; margin-bottom: -18px; }
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist__row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; }
.doclist__row + .doclist__row { border-top: 1px solid var(--line-2); }
.doclist__row--wide { grid-template-columns: 20px minmax(0, 1fr) auto auto; }
.doclist__row > .i { color: #7a8597; }
.doclist__name { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.doclist__name b { font-weight: 620; }
.doclist__act { display: flex; justify-content: flex-end; min-width: 120px; }
.dstat { font-size: 11.5px; font-weight: 720; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: #f2f4f7; color: #475467; }
.dstat--requested { background: var(--warn-bg); color: var(--warn); }
.dstat--received { background: var(--info-bg); color: var(--info); }
.dstat--verified, .dstat--sent { background: var(--good-bg); color: var(--good); }
.dstat--old { background: var(--late-bg); color: var(--late); }

/* ---------- calendar ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs.more-r, .toolbar .segbtns.more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.tabs.more-l, .toolbar .segbtns.more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
.tabs.more-l.more-r, .toolbar .segbtns.more-l.more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
.tabbtn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border: 0; background: transparent; font-weight: 650; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabbtn .i { width: 16px; height: 16px; }
.tabbtn:hover { color: var(--ink); }
.tabbtn[aria-selected="true"] { color: var(--brand-text); border-bottom-color: var(--brand); }
.calbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.calnav { display: flex; align-items: center; gap: 4px; }
.calnav__m { font-size: 17px; font-weight: 720; min-width: 150px; text-align: center; }
.lawfilter { display: flex; gap: 6px; flex-wrap: wrap; }
.lawtog { border: 1px solid var(--l-line); background: var(--l-bg); color: var(--l); height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 720; display: inline-flex; align-items: center; gap: 6px; }
.lawtog::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--l); }
.lawtog[aria-pressed="false"] { background: #fff; color: var(--muted); border-color: var(--line); }
.lawtog[aria-pressed="false"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px #98a2b3; }
.calbar__sum { margin-left: auto; }
.calwrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.calwrap__agenda { display: none; }
.calwrap__panel { position: sticky; top: calc(var(--demobar-h) + 78px); max-height: calc(100vh - var(--demobar-h) - 96px); overflow: auto; }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-1); }
.cal__head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal__head span { padding: 8px 10px; font-size: 12px; font-weight: 720; color: var(--muted); }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal__cell { min-height: 108px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal__cell:nth-child(7n) { border-right: 0; }
.cal__cell--pad { background: #fafbfc; }
.cal__cell--sel { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.cal__day { width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; font-size: 12.5px; font-weight: 720; color: var(--ink-2); display: grid; place-items: center; }
.cal__day:hover { background: var(--line-2); }
.cal__cell--today .cal__day { background: var(--brand); color: var(--brand-ink); }
.cal__items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cchip { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; height: 21px; padding: 0 6px; border-radius: 5px; border: 0; background: var(--l-bg); color: var(--l); font-size: 11px; font-weight: 720; min-width: 0; box-shadow: inset 0 0 0 1px var(--l-line); }
.cchip__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cchip__n { font-variant-numeric: tabular-nums; opacity: 0.9; flex: none; }
.cchip--done { background: #fff; }
.cchip--late { box-shadow: inset 0 0 0 1.5px var(--late); color: var(--late); background: var(--late-bg); }
.cal__more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.dgroup { padding: 12px 0; border-top: 1px solid var(--line-2); }
.dgroup:first-of-type { margin-top: 10px; }
.dgroup__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.dgroup__count { white-space: nowrap; }
.dlist { list-style: none; margin: 8px 0 0; padding: 0; }
.dlist__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; padding: 7px 8px; border: 0; background: transparent; border-radius: 8px; text-align: left; color: inherit; }
button.dlist__row:hover { background: var(--surface-2); }
.dlist__row--planned { padding: 7px 8px; }
.dlist .person__name { display: none; }
.dlist__name { font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mag { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.mag:first-child { border-top: 0; }
.mag--past { opacity: 0.75; }
.mag__date { margin: 0; }
.mag__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mag__row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-align: left; color: inherit; }
.mag__t { flex: 1; font-size: 13px; font-weight: 650; min-width: 0; }
.mag__n { font-size: 12.5px; font-weight: 720; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }
.tracker { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.tracker th, .tracker td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: center; white-space: nowrap; }
.tracker thead th { background: var(--surface-2); font-size: 12px; color: var(--ink-2); font-weight: 680; vertical-align: bottom; }
.tracker thead th span { display: block; }
.tracker .tr__client { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 210px; box-shadow: 1px 0 0 var(--line-2); }
.tracker thead .tr__client { background: var(--surface-2); }
.tracker .tr__client a { color: var(--ink); text-decoration: none; font-weight: 620; }
.tracker .tr__client a:hover { text-decoration: underline; }
.tr__due { font-weight: 500; color: var(--muted); font-size: 11px; }
.tracker .tr__sum th { background: #fff; font-size: 12px; color: var(--muted); }
.tr__pct { font-variant-numeric: tabular-nums; }
.tr__na { color: #c1c8d2; }
.tcell { --st: #475467; --st-bg: #f2f4f7; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 0; font-size: 12px; font-weight: 800; background: var(--st-bg); color: var(--st); line-height: 1; vertical-align: middle; }
button.tcell:hover { filter: brightness(0.95); box-shadow: 0 0 0 2px var(--line-strong); }
.tcell--done { --st: #fff; --st-bg: #079455; }
.tcell--late { --st: #fff; --st-bg: var(--late); }
.tcell--progress { --st: #175cd3; --st-bg: #d1e9ff; }
.tcell--waiting { --st: #93370d; --st-bg: #fef0c7; }
.tcell--review { --st: #5925dc; --st-bg: #ebe9fe; }
.tcell--todo { --st-bg: #fff; box-shadow: inset 0 0 0 1.5px #cfd6df; }
.tcell--planned { --st: #586579; --st-bg: transparent; box-shadow: inset 0 0 0 1px #cfd6df; border-style: dashed; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; list-style: none; padding: 0; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .tcell, .legend .heat { width: 20px; height: 20px; min-width: 20px; padding: 0; font-size: 10px; }
.legend--pad { padding: 0 18px 16px; }
.rulecard { margin-bottom: 14px; }
.rules { width: 100%; border-collapse: collapse; font-size: 13px; }
.rules th { text-align: left; font-size: 12px; font-weight: 680; color: var(--muted); padding: 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.rules td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.rules tr:last-child td { border-bottom: 0; }
.rules td > span.muted { display: block; }
.rules td a { font-weight: 650; text-decoration: none; }
.rules td a:hover { text-decoration: underline; }

/* ---------- tables, clients ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 680; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.num { text-align: right; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: var(--surface-2); }
.cname { display: flex; align-items: center; gap: 10px; }
.cname > span:not(.logo):not(.av):not(.cav) { display: flex; flex-direction: column; min-width: 0; }
.cname__a { color: var(--ink); font-weight: 680; text-decoration: none; }
.cname__a:hover { text-decoration: underline; }
.cav { display: inline-grid; place-items: center; flex: none; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); font-weight: 760; }
.cav--md { width: 36px; height: 36px; font-size: 13px; }
.cav--lg { width: 58px; height: 58px; font-size: 20px; border-radius: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; margin-bottom: 14px; }
.chead__main { display: flex; gap: 14px; align-items: center; min-width: 0; }
.chead__main .chips { margin-top: 6px; }
.chead__name { font-size: 21px; font-weight: 740; letter-spacing: -0.015em; }
.chead__ids { display: flex; flex-wrap: wrap; gap: 8px; grid-column: 1 / -1; }
.idchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 3px 2px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.idchip__l { font-weight: 720; color: var(--muted); font-size: 11px; }
.chead__team { display: flex; gap: 16px; flex-wrap: wrap; }
.teamchip { display: flex; align-items: center; gap: 8px; }
.teamchip > span:not(.logo):not(.av):not(.cav) { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }
.chead__acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-self: start; grid-row: 1; grid-column: 2; }
.chead__stats { display: flex; gap: 18px; font-size: 13px; color: var(--muted); align-items: center; justify-content: flex-end; }
.chead__stats b { color: var(--ink); }
.chead__stats .txt-late b { color: var(--late); }
.rulelist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); }
.rulelist li:first-child { border-top: 0; }
.rulelist__name { display: flex; flex-direction: column; min-width: 0; }
.rulelist__next { text-align: right; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.timeline li:first-child { border-top: 0; }
.preview-box { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.preview { margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.preview li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.preview li span:nth-child(2) { flex: 1; }

/* ---------- documents ---------- */
.docgroup { margin-bottom: 14px; }
.docclient { padding: 10px 18px 12px; border-top: 1px solid var(--line-2); }
.card__head--pad + .docclient { border-top: 0; }
.docclient__h { font-size: 13.5px; margin: 0 0 4px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.docclient__h a { color: var(--ink); font-weight: 720; text-decoration: none; }
.docclient__h a:hover { text-decoration: underline; }

/* ---------- invoices ---------- */
.ipill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #f2f4f7; color: #475467; }
.ipill--sent { background: var(--info-bg); color: var(--info); }
.ipill--part { background: var(--violet-bg); color: var(--violet); }
.ipill--overdue { background: var(--late-bg); color: var(--late); }
.ipill--paid { background: var(--good-bg); color: var(--good); }
.unbilled { margin-bottom: 14px; border-color: var(--warn-line); background: linear-gradient(180deg, var(--warn-bg), #fff 70%); }
.unbilled .h2 .i { color: var(--warn); }
.unbilled__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.unbilled__row > span:not(.logo):not(.av):not(.cav) { display: flex; flex-direction: column; min-width: 0; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.editor > .card { display: flex; flex-direction: column; gap: 14px; }
.totals { position: sticky; top: calc(var(--demobar-h) + 80px); }
.items { width: 100%; border-collapse: collapse; }
.items th { font-size: 12px; font-weight: 680; color: var(--muted); text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }
.items th.num { text-align: right; }
.items td { padding: 8px 6px; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.items td:first-child { min-width: 260px; }
.items td:first-child select { margin-bottom: 6px; }
.items td .input.num { max-width: 110px; margin-left: auto; display: block; }
.items td:nth-child(2) .input { width: 92px; }
.items td:nth-child(3) .input { width: 68px; }
.items td:nth-child(4) .input { width: 112px; max-width: none; }
.items td.num { padding-top: 14px; font-weight: 650; white-space: nowrap; }
.tot { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.tot div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.tot dt { color: var(--ink-2); }
.tot dd { margin: 0; font-variant-numeric: tabular-nums; }
.tot__grand { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 760; font-size: 16px; }
.tot__grand dt { color: var(--ink); }
.invbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.invbar__id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.invbar__no { font-size: 17px; font-weight: 720; }
.invbar__acts { display: flex; gap: 6px; flex-wrap: wrap; }
.invlayout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.paperwrap { overflow-x: auto; padding: 2px 2px 8px; }
.invside { position: sticky; top: calc(var(--demobar-h) + 80px); display: flex; flex-direction: column; gap: 10px; }
.pays li { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.paper { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-2); padding: 36px 40px; min-width: 660px; max-width: 880px; margin: 0 auto; color: #101828; font-size: 12.5px; line-height: 1.45; }
.paper p { margin: 0 0 2px; }
.paper__wm { position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center; pointer-events: none; user-select: none; border-radius: inherit; }
.paper__wm span { font-size: 130px; font-weight: 850; color: rgba(16, 24, 40, 0.045); transform: rotate(-24deg); letter-spacing: 0.12em; }
.paper__scroll { overflow-x: auto; position: relative; }
.paper__head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid var(--brand); }
.paper__firm { display: flex; gap: 12px; }
.paper__fname { font-size: 17px; font-weight: 760; }
.paper__ftag { color: var(--muted); }
.paper__meta { min-width: 230px; }
.paper__title { margin: 0 0 8px; font-size: 19px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-text); text-align: right; }
.paper__meta dl { margin: 0; display: grid; gap: 2px; }
.paper__meta dl div { display: flex; justify-content: space-between; gap: 16px; }
.paper__meta dt { color: var(--muted); }
.paper__meta dd { margin: 0; font-weight: 600; }
.paper__bill { padding: 14px 0 6px; }
.paper__lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 720; margin: 10px 0 2px !important; }
.paper__bill .paper__lbl:first-child, .paper__words .paper__lbl:first-child { margin-top: 0 !important; }
.paper__items { width: 100%; border-collapse: collapse; margin-top: 8px; }
.paper__items td.num, .paper__taxsum td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.paper__items th { background: var(--brand-soft); color: var(--ink); text-align: left; font-size: 11.5px; padding: 8px; }
.paper__items th.num { text-align: right; }
.paper__items td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.paper__sum { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; margin-top: 14px; }
.paper__tot { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.paper__tot div { display: flex; justify-content: space-between; gap: 12px; }
.paper__tot dd { margin: 0; font-variant-numeric: tabular-nums; }
.paper__grand { border-top: 2px solid var(--ink); padding-top: 6px; font-size: 15px; font-weight: 800; }
.paper__taxsum { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 11.5px; }
.paper__taxsum caption { text-align: left; font-weight: 720; padding-bottom: 4px; }
.paper__taxsum th, .paper__taxsum td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.paper__taxsum .num { text-align: right; }
.paper__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 28px; }
.paper__fine { color: var(--muted); max-width: 340px; font-size: 11px; }
.paper__sign { text-align: right; }
.paper__sigline { height: 38px; border-bottom: 1px solid var(--ink-2); width: 190px; margin: 0 0 4px auto; }
.testbanner { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #fffaeb; border: 1px solid #fec84b; color: #6b2a0c; font-size: 13px; }
.testbanner .i { color: #b54708; margin-top: 1px; }
.payamt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px; background: var(--surface-2); border-radius: 10px; }
.payamt b { font-size: 28px; letter-spacing: -0.02em; }
.paydone { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 0 4px; }
.paydone__i { width: 52px; height: 52px; color: var(--good); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- team ---------- */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; margin: 12px 0 16px; }
.member--over { border-color: var(--late-line); }
.member__head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.member__stats { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.member__stats b { color: var(--ink); }
.member__stats .txt-late b { color: var(--late); }
.member__tasks .tag { justify-self: end; }
.member__tasks li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.member__task { display: flex; flex-direction: column; border: 0; background: none; padding: 0; text-align: left; min-width: 0; color: inherit; }
.member__tt { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member__task:hover .member__tt { text-decoration: underline; }
.member__task .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heatmap th, .heatmap td { text-align: left; }
.heat { display: inline-grid; place-items: center; min-width: 58px; padding: 4px 8px; border-radius: 7px; font-weight: 720; font-size: 12.5px; background: #f2f4f7; color: var(--muted); font-variant-numeric: tabular-nums; }
.heat--1 { background: #ecfdf3; color: #067647; }
.heat--2 { background: #d1fadf; color: #05603a; }
.heat--3 { background: #fef0c7; color: #93370d; }
.heat--4 { background: #fee4e2; color: #b42318; }

/* ---------- settings ---------- */
.settings { display: flex; flex-direction: column; gap: 16px; max-width: 940px; }
.swatches { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; background: var(--sw); box-shadow: 0 0 0 1px var(--line-strong); padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch--custom { position: relative; overflow: hidden; background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #3b82f6, #a855f7, #ef4444); cursor: pointer; }
.swatch--custom input { position: absolute; inset: -10px; width: 52px; height: 52px; opacity: 0; cursor: pointer; }
.swatch--custom:focus-within { box-shadow: 0 0 0 2px var(--brand-text); }
.brandprev { display: grid; grid-template-columns: 190px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 112px; }
.brandprev__side { display: flex; gap: 8px; padding: 12px; background: var(--surface-2); border-right: 1px solid var(--line); align-items: flex-start; }
.brandprev__side > span:not(.logo):not(.av):not(.cav) { display: flex; flex-direction: column; min-width: 0; }
.brandprev__name { font-weight: 720; font-size: 12px; line-height: 1.25; }
.brandprev__tag { font-size: 11px; color: var(--muted); }
.brandprev__body { padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.brandprev__h { font-weight: 720; }
.brandprev__btn { background: var(--brand); color: var(--brand-ink); padding: 5px 11px; border-radius: 7px; font-size: 12px; font-weight: 650; }
.brandprev__chip { background: var(--brand-soft); color: var(--brand-text); padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 720; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; position: relative; }
.switch input { position: absolute; left: 0; top: 0; opacity: 0; width: 36px; height: 20px; margin: 0; cursor: pointer; }
.switch__ui { width: 36px; height: 20px; border-radius: 999px; background: #cfd6df; position: relative; flex: none; transition: background 0.15s; }
.switch__ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform 0.15s; }
.switch input:checked + .switch__ui { background: var(--brand); }
.switch input:checked + .switch__ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.switch input:disabled + .switch__ui { opacity: 0.5; }
.switch--row { align-items: flex-start; }
.switch--row > span:last-child { display: flex; flex-direction: column; }
.perms { margin-top: 14px; }
.perms td .i { color: var(--good); }
.adduser { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.adduser .row3 { width: 100%; }
.statlist { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 16px; }
.prose { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.prose h3 { font-size: 14px; margin-top: 6px; }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- layers ---------- */
.layer { position: fixed; left: 0; right: 0; bottom: 0; top: var(--demobar-h); z-index: 100; display: flex; }
.layer__scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); opacity: 0; transition: opacity 0.18s; }
.layer--in .layer__scrim { opacity: 1; }
.layer--out .layer__scrim, .layer--out .panel { opacity: 0 !important; }
.layer--dialog { align-items: center; justify-content: center; padding: 16px; }
.panel { position: relative; background: var(--surface); box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.35); display: flex; flex-direction: column; outline: none; }
.panel--dialog { border-radius: 14px; width: 100%; max-height: calc(100vh - var(--demobar-h) - 32px); transform: translateY(8px) scale(0.985); opacity: 0; transition: transform 0.18s, opacity 0.18s; }
.layer--in .panel--dialog { transform: none; opacity: 1; }
.panel--sm { max-width: 440px; }
.panel--md { max-width: 580px; }
.panel--lg { max-width: 780px; }
.layer--drawer { justify-content: flex-end; }
.panel--drawer { height: 100%; width: min(580px, 100vw); max-width: none; border-radius: 14px 0 0 14px; transform: translateX(28px); opacity: 0; transition: transform 0.2s, opacity 0.2s; }
.panel--drawer.panel--lg { width: min(640px, 100vw); }
.layer--in .panel--drawer { transform: none; opacity: 1; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel__title { font-size: 16px; font-weight: 720; min-width: 0; overflow-wrap: anywhere; }
.panel__body { padding: 18px; overflow: auto; flex: 1; overscroll-behavior: contain; }
.menu { position: fixed; z-index: 160; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; max-width: calc(100vw - 16px); }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; font-size: 13.5px; color: var(--ink); text-align: left; white-space: nowrap; }
.menu__item .i { color: var(--muted); }
.menu__item:hover, .menu__item:focus-visible { background: var(--brand-soft); outline: none; }
.menu__hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.menu__sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu__head { padding: 8px 10px; display: flex; flex-direction: column; font-size: 13px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu__head span { color: var(--muted); font-size: 12px; }
.searchbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; color: var(--muted); }
.searchbox input { border: 0; outline: none; height: 44px; flex: 1; font-size: 15px; background: transparent; color: var(--ink); min-width: 0; }
.searchbox:focus-within { border-color: var(--brand-text); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.results { list-style: none; margin: 10px 0 0; padding: 0; max-height: 52vh; overflow: auto; }
.result { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.result[aria-selected="true"], .result:hover { background: var(--brand-soft); }
.result__kind { font-size: 11px; font-weight: 720; color: var(--muted); width: 54px; flex: none; text-transform: uppercase; letter-spacing: 0.04em; }
.result__txt { display: flex; flex-direction: column; min-width: 0; }
.result__txt span { color: var(--muted); font-size: 12.5px; }
.results__hint { color: var(--muted); padding: 10px; font-size: 13px; }
.pickers { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.picker { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: left; }
.picker > span:not(.logo):not(.av):not(.cav) { display: flex; flex-direction: column; }
.picker:hover { background: var(--surface-2); }
.picker[aria-current="true"] { border-color: var(--brand); background: var(--brand-soft); }
.toasts { position: fixed; z-index: 220; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { display: flex; align-items: center; gap: 8px; background: #0b1220; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-2); animation: toastIn 0.2s ease; transition: opacity 0.3s, transform 0.3s; }
.toast .i { color: #6ce9a6; }
.toast--warn .i { color: #fec84b; }
.toast--info .i { color: #84caff; }
.toast--out { opacity: 0; transform: translateY(6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- sign-in ---------- */
.signin { outline: none; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: calc(100vh - var(--demobar-h)); }
.signin__brand { position: relative; overflow: hidden; display: flex; align-items: center; padding: 56px; color: #fff; background: radial-gradient(640px 420px at 100% 100%, var(--brand) 0%, transparent 70%), radial-gradient(520px 360px at 0% 0%, rgba(255, 255, 255, 0.07), transparent 70%), var(--brand-night); }
.signin__brand::after { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.03), 0 0 0 120px rgba(255, 255, 255, 0.025); }
.signin__brandin { position: relative; z-index: 1; max-width: 540px; width: 100%; }
.signin__logo { display: flex; gap: 14px; align-items: center; }
.signin__firm { font-size: 21px; font-weight: 760; color: #fff; letter-spacing: -0.01em; }
.signin__tag { color: rgba(255, 255, 255, 0.82); font-size: 13.5px; }
.signin__claim { font-size: 32px; line-height: 1.2; font-weight: 760; letter-spacing: -0.02em; margin: 40px 0 30px; color: #fff; text-wrap: balance; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack__card { background: rgba(255, 255, 255, 0.97); color: var(--ink); border-radius: 14px; padding: 14px 16px; box-shadow: 0 22px 44px -18px rgba(0, 0, 0, 0.5); display: grid; gap: 6px; max-width: 420px; transform: translateX(calc(var(--i) * 22px)); }
.stack__card .law { justify-self: start; }
.stack__meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.stack__meta .i { width: 15px; height: 15px; }
.stack__bar { display: block; height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.stack__bar span { display: block; height: 100%; background: #17b26a; }
.signin__side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.signin__card { width: 100%; max-width: 410px; display: flex; flex-direction: column; gap: 14px; }
.signin__card .h1 { font-size: 26px; white-space: normal; }
.signin__mobilelogo { display: none; }
.signin__mobilelogo > span:not(.logo):not(.av):not(.cav) { display: flex; flex-direction: column; line-height: 1.25; }
.signin__foot { text-align: center; }
.creds { border: 1px dashed var(--brand-text); background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.creds__t { display: flex; align-items: center; gap: 6px; font-weight: 720; color: var(--brand-text); }
.creds__t .i { width: 16px; height: 16px; }
.creds__row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.creds code { background: #fff; border: 1px solid var(--brand-soft-2); }
.creds__note { font-size: 12px; color: var(--ink-2); }
.rolepick { display: flex; flex-direction: column; gap: 8px; }
.rolepick legend { margin-bottom: 6px; }
.rolecard { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.rolecard:has(input:checked) { border-color: var(--brand-text); background: var(--brand-soft); }
.rolecard__in { display: flex; flex-direction: column; font-size: 13.5px; }
.rolecard__in span { font-size: 12.5px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trow { grid-template-columns: 112px minmax(0, 2fr) 88px minmax(0, 1.1fr) 108px 84px; }
  .trow__docs { display: none; }
  .calwrap { grid-template-columns: minmax(0, 1fr) 310px; }
  .search { width: 240px; }
}
@media (max-width: 1080px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .trow__prog { display: none; }
  .trow { grid-template-columns: 112px minmax(0, 2fr) 88px minmax(0, 1fr) 108px; }
  .editor, .invlayout { grid-template-columns: minmax(0, 1fr); }
  .totals, .invside { position: static; }
}
@media (max-width: 900px) {
  :root { --demobar-h: 44px; }
  body { font-size: 15px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { padding: 10px 16px; gap: 8px; }
  .topbar__brand { display: inline-flex; text-decoration: none; }
  .topbar__user { display: inline-grid; }
  .h1 { font-size: 18px; }
  .search { width: 38px; padding: 0; justify-content: center; }
  .search__txt, .search kbd { display: none; }
  .btn--new { width: 38px; padding: 0; }
  .btn--new span { display: none; }
  .content { padding: 14px 16px 104px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: none; font-size: 11px; font-weight: 650; color: var(--muted); text-decoration: none; position: relative; min-width: 0; }
  .tab .i { width: 23px; height: 23px; }
  .tab[aria-current="page"] { color: var(--brand-text); }
  .tab__badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 999px; background: var(--late); color: #fff; font-size: 10px; font-weight: 750; display: grid; place-items: center; padding: 0 4px; }
  .toasts { bottom: 86px; }
  .demobar { padding: 0 10px; gap: 8px; }
  .demobar__name, .demobar__date { display: none; }
  .dbtn span { display: none; }
  .dbtn { width: 34px; height: 32px; padding: 0; justify-content: center; }
  .dbtn .i { width: 17px; height: 17px; }
  .kpis, .kpis--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi { padding: 12px 12px 12px 15px; }
  .kpi__value { font-size: 23px; }
  .hello__t { font-size: 20px; }
  .card { padding: 14px; }
  .card__head--pad { padding: 12px 14px; }
  .agenda__item summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 9px 10px; }
  .agenda__people, .agenda__chev { display: none; }
  .rowbtn { grid-template-columns: minmax(0, 1fr) auto; }
  .rowbtn > .person, .rowbtn > .due { display: none; }
  .toolbar .tsearch { max-width: none; flex: 1 1 100%; order: -1; }
  .toolbar .segbtns { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .toolbar__new { margin-left: 0; }
  .toolbar__note { margin-left: 0; width: 100%; }
  .fsel { flex: 1 1 calc(50% - 8px); }
  .fsel .input { width: 100%; }
  .trow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main due" "status who"; gap: 6px 10px; padding: 11px 14px; }
  .trow__main { grid-area: main; }
  .trow__due { grid-area: due; }
  .trow__status { grid-area: status; }
  .trow__who { grid-area: who; justify-self: end; }
  .trow__law, .trow__prog, .trow__docs { display: none; }
  .board { grid-template-columns: repeat(5, 264px); }
  .calwrap { grid-template-columns: minmax(0, 1fr); }
  .cal { display: none; }
  .calwrap__agenda { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
  .calwrap__panel { position: static; max-height: none; }
  .calbar__sum { margin-left: 0; width: 100%; }
  .calnav__m { min-width: 128px; font-size: 16px; }
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .chead { grid-template-columns: minmax(0, 1fr); }
  .chead__acts { grid-row: auto; grid-column: auto; justify-content: flex-start; }
  .chead__stats { justify-content: flex-start; }
  .chead__name { font-size: 19px; }
  .cav--lg { width: 48px; height: 48px; font-size: 17px; }
  .rulelist li { grid-template-columns: auto minmax(0, 1fr); }
  .rulelist__next { grid-column: 2; text-align: left; }
  .table.clients thead, .invtable thead, .rules thead, .table.perms thead { display: none; }
  .table.clients tr, .invtable tr, .rules tr, .table.perms tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .table.clients td, .invtable td, .rules td, .table.perms td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .table.clients td::before, .invtable td::before, .rules td::before, .table.perms td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 650; text-align: left; flex: none; }
  .table.clients td:first-child, .invtable td:first-child, .rules td:first-child, .table.perms td:first-child { display: block; text-align: left; padding-bottom: 6px; }
  .table.clients td:first-child::before, .invtable td:first-child::before, .rules td:first-child::before, .table.perms td:first-child::before { display: none; }
  .rules td { display: block; text-align: left; }
  .rules td::before { display: block; margin-bottom: 2px; }
  .table td.num { text-align: right; }
  .items thead { display: none; }
  .items tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .items td { padding: 0; border: 0; display: flex; flex-direction: column; gap: 3px; }
  .items td::before { content: attr(data-label); font-size: 12px; font-weight: 650; color: var(--muted); }
  .items td:first-child { grid-column: 1 / -1; min-width: 0; }
  .items td .input.num, .items td:nth-child(2) .input, .items td:nth-child(3) .input { max-width: none; width: 100%; margin: 0; }
  .items td.num { padding-top: 0; text-align: left; }
  .items td:last-child { justify-content: flex-end; flex-direction: row; }
  .paper { min-width: 0; padding: 20px 16px; font-size: 11.5px; }
  .paper__taxsum { font-size: 10.5px; }
  .paper__taxsum th, .paper__taxsum td { padding: 4px 5px; }
  .toolbar .segbtn { padding: 0 9px; flex: 1 0 auto; justify-content: center; }
  .paper__head { flex-direction: column; gap: 14px; }
  .paper__title { text-align: left; }
  .paper__sum { grid-template-columns: minmax(0, 1fr); }
  .paper__wm span { font-size: 64px; }
  .paper__foot { flex-direction: column; align-items: stretch; }
  .paper__items th, .paper__items td { padding: 6px 4px; }
  .paper__items td.num { font-size: 11px; }
  .stalebar__acts { width: 100%; }
  .tabbtn { padding: 9px 8px; gap: 5px; }
  /* Return tracker: client names wrap in a narrower sticky column so two or three periods show. */
  .tracker th, .tracker td { padding: 8px 6px; }
  .tracker .tr__client { min-width: 0; width: 138px; max-width: 138px; white-space: normal; font-size: 12.5px; line-height: 1.3; }
  .members { grid-template-columns: minmax(0, 1fr); }
  .member__tasks li { grid-template-columns: minmax(0, 1fr) auto; }
  .member__tasks li .due { display: none; }
  .doclist__row--wide { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .doclist__row--wide .doclist__act { grid-column: 2 / -1; justify-content: flex-start; min-width: 0; }
  .docclient { padding: 10px 14px 12px; }
  .unbilled__row { flex-direction: column; align-items: stretch; }
  .signin { grid-template-columns: minmax(0, 1fr); }
  .signin__brand { display: none; }
  .signin__mobilelogo { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
  .signin__side { padding: 22px 16px 40px; align-items: flex-start; }
  .layer--dialog { align-items: flex-end; padding: 0; }
  .panel--dialog { border-radius: 16px 16px 0 0; max-width: none !important; max-height: calc(100vh - var(--demobar-h) - 20px); }
  .panel--drawer, .panel--drawer.panel--lg { width: 100vw; border-radius: 0; }
  .seg__opt span { font-size: 11.5px; padding: 6px 2px; }
  .brandprev { grid-template-columns: minmax(0, 1fr); }
  .brandprev__side { border-right: 0; border-bottom: 1px solid var(--line); }
  .heat { min-width: 44px; }
  .commentform { flex-direction: column; align-items: stretch; }
}
@media (max-width: 520px) {
  /* Phone view of the invoice: the line number, the unit rate (qty × rate = taxable value) and the
     per-SAC taxable value (already in the lines and totals) give way so amounts never clip. Print keeps them. */
  .paper__items .pi-n, .paper__items .pi-rate, .paper__taxsum .ts-taxable { display: none; }
}
@media (max-width: 380px) {
  .paper__taxsum th, .paper__taxsum td { padding: 3px; }
  .demo-pill { padding: 3px 8px; font-size: 11.5px; }
  .dbtn { width: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .paper, .paper * { visibility: visible; }
  .paper { position: absolute; left: 0; top: 0; width: 100%; min-width: 0; max-width: none; border: 0; box-shadow: none; padding: 0; }
  .paper__scroll { overflow: visible; }
  .paper__items .pi-n, .paper__items .pi-rate, .paper__taxsum .ts-taxable { display: table-cell; }
  .layer, .toasts, .demobar { display: none; }
}
