@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); }

/* White cards on a pale green-grey ground. One green for actions; red, blue and amber
   are kept for late, waiting for a decision, and coming soon. */
:root {
  --ground: #F4F6F5; --surface: #FFFFFF; --surface-2: #F8FAF9; --ink: #14201B; --ink-2: #344039;
  --muted: #4A5751; --faint: #5B6862; --line: #DDE3E0; --line-2: #EAEFEC; --line-strong: #D0D8D4;
  --accent: #1B8354; --accent-btn: #1B8354; --accent-hover: #156B44; --accent-ink: #0F5132; --accent-soft: #E7F4EE; --accent-tint: #F3FAF6;
  --bad: #B42318; --bad-soft: #FEF3F2; --bad-dot: #D92D20;
  --warn: #B54708; --warn-soft: #FFFAEB; --warn-dot: #DC6803;
  --info: #175CD3; --info-soft: #EFF8FF; --info-dot: #1570EF;
  --ok: #067647; --ok-soft: #ECFDF3;
  --grey-soft: #F1F4F2;
  --mark: #F7E27A; --mark-ink: #1B1A10;
  --paper: #FFFFFF; --paper-ink: #1A1F1C; --seal: #B0322A;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 10px 28px rgba(16, 24, 20, .10);
  --ui: "IBM Plex Sans Arabic", system-ui, "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  --doc: "Amiri", "Traditional Arabic", "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0F1512; --surface: #161E1A; --surface-2: #1A231F; --ink: #E6EDE9; --ink-2: #C8D3CD;
    --muted: #A2AFA8; --faint: #93A099; --line: #2A3530; --line-2: #222C27; --line-strong: #3A4741;
    --accent: #5BD197; --accent-btn: #1E8A58; --accent-hover: #23A066; --accent-ink: #A7E8C5; --accent-soft: #143526; --accent-tint: #12241C;
    --bad: #F97066; --bad-soft: #3A1614; --bad-dot: #F04438;
    --warn: #FDB022; --warn-soft: #33240C; --warn-dot: #F79009;
    --info: #84CAFF; --info-soft: #102A45; --info-dot: #2E90FA;
    --ok: #75E0A7; --ok-soft: #10301F;
    --grey-soft: #202A25;
    --mark: #6A5912; --mark-ink: #FFF5C8;
    --paper: #1B2420; --paper-ink: #E4EBE7; --seal: #F0877A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; }

/* ---------- top bar ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: 68px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: stretch; gap: 24px; padding-inline: 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); flex: none; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-btn); color: #fff; display: grid; place-items: center; }
.brand .words { display: grid; line-height: 1.3; }
.brand b { font-size: 15px; text-align: right; }
.brand small { font-size: 12px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; align-items: stretch; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 6px; padding-inline: 11px; font-size: 15px; font-weight: 500; color: var(--ink-2); border-top: 3px solid transparent; border-bottom: 3px solid transparent; white-space: nowrap; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.count { font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 6px; background: var(--grey-soft); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.count.bad { background: var(--bad-soft); color: var(--bad); }
.top .grow { flex: 1; }
.actions { display: flex; align-items: center; gap: 10px; }
.anchor { position: relative; display: flex; align-items: center; }
.key-state { border: 0; font-size: 13px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 4px 12px; border-radius: 999px; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:hover { border-color: var(--ink-2); }
.badge-dot { position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--bad-dot); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; font-variant-numeric: tabular-nums; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; border: 0; flex: none; }
.menu-btn { display: none; }
.pop { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 250px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 40; display: grid; }
.pop.wide { width: 380px; }
.pop.start { inset-inline-end: auto; inset-inline-start: 0; }
.pop a, .pop button { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border-radius: 8px; color: var(--ink); border: 0; background: none; text-align: start; font-size: 15px; width: 100%; }
.pop a:hover, .pop button:hover { background: var(--grey-soft); text-decoration: none; }
.pop hr { border: 0; border-top: 1px solid var(--line-2); margin: 6px 0; width: 100%; }
.pop .danger { color: var(--bad); }
.pop .head { padding: 8px 12px 6px; font-size: 13px; color: var(--muted); display: grid; }
.pop .head b { color: var(--ink); font-size: 14px; }
.pop .two { display: grid; gap: 0; line-height: 1.45; }
.pop .two small { font-size: 13px; color: var(--muted); }
.pop .empty-line { padding: 10px 12px; font-size: 14px; color: var(--muted); }
.tabbar { display: none; }

/* ---------- page scaffolding ---------- */
.main { padding-block: 28px 96px; padding-inline: 28px; min-width: 0; }
.wrap { max-width: 1320px; margin-inline: auto; }
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.page.narrow { max-width: 920px; }
.page h1, .center-col h1, .auth-card h1 { font-size: 28px; font-weight: 700; line-height: 1.3; }
.page h2 { font-size: 18px; font-weight: 600; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.page-head > div:first-child { display: grid; gap: 2px; }
.sub { color: var(--muted); font-size: 15px; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); flex-wrap: wrap; margin-bottom: -8px; }
.crumbs a { color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.stack { display: grid; gap: 24px; align-content: start; min-width: 0; }
.center-col { max-width: 760px; margin-inline: auto; display: grid; gap: 20px; }
.center-col.wide-col { max-width: 920px; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 62ch; }
.fine { font-size: 13.5px; color: var(--muted); }
.block { display: grid; gap: 12px; }
.eyebrow { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.eyebrow a { color: var(--muted); }

/* ---------- buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-2); text-decoration: none; }
.btn.primary { background: var(--accent-btn); border-color: var(--accent-btn); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-tint); }
.btn.link { border: 0; background: none; padding: 0; height: auto; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
[aria-busy="true"] { opacity: .6; cursor: progress; }
.field { display: grid; gap: 6px; font-size: 14px; }
.field > span { font-weight: 600; }
.field small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); outline-offset: 0; border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; align-items: center; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; align-self: end; padding-bottom: 10px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--bad); }
.search { width: 100%; max-width: 420px; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.bad { background: var(--bad-dot); } .dot.info { background: var(--info-dot); } .dot.warn { background: var(--warn-dot); } .dot.none { background: var(--line-strong); }
.seg { display: inline-flex; gap: 2px; background: var(--grey-soft); padding: 4px; border-radius: 10px; }
.seg .btn { height: 34px; border-color: transparent; background: transparent; color: var(--ink-2); font-weight: 500; }
.seg .btn.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 20, .08); }

/* ---------- cards, rows, pills ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.open { overflow: visible; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h2 { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-head .sub { font-size: 14px; }
.card-body { padding: 16px 24px; }
.n-badge { background: var(--grey-soft); border-radius: 6px; padding: 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line-2); }
.item:last-child { border-bottom: 0; }
.item.bare { grid-template-columns: minmax(0, 1fr) auto; }
.item .t { font-weight: 600; }
.item .m { font-size: 14px; color: var(--muted); }
.item .act { display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.item label.task-check { display: flex; gap: 12px; align-items: flex-start; }
.item label.task-check input { width: 18px; height: 18px; margin-top: 5px; accent-color: var(--accent-btn); flex: none; }
.empty-note { padding: 20px 24px; color: var(--muted); font-size: 15px; }
.ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--grey-soft); color: var(--ink-2); }
.ico svg { width: 20px; height: 20px; }
.ico.bad { background: var(--bad-soft); color: var(--bad); } .ico.info { background: var(--info-soft); color: var(--info); }
.ico.warn { background: var(--warn-soft); color: var(--warn); } .ico.ok { background: var(--accent-soft); color: var(--accent-ink); }
.badge, .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); border: 0; line-height: 1.5; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.none { background: var(--grey-soft); color: var(--ink-2); }
.chip.client { background: var(--accent-soft); color: var(--accent-ink); }
.badge-link, a.chip { text-decoration: none; }
a.chip:hover, .badge-link:hover .badge { text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill-role { font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.card.flush .table-wrap { border: 0; border-radius: 0; }
table.list-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.list-table th { text-align: start; font-weight: 600; font-size: 13px; color: var(--muted); padding: 11px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.list-table td { text-align: start; padding: 13px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.list-table tr:last-child td { border-bottom: 0; }
.list-table tr[data-go] { cursor: pointer; }
.list-table tr[data-go]:hover td { background: var(--accent-tint); }
.list-table td .t { font-weight: 600; }
.list-table td .m, .list-table td .fine { font-size: 13px; color: var(--muted); }
.list-table select, .list-table input { min-height: 36px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.notice { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--warn-soft); font-size: 14px; }
.notice.bad { background: var(--bad-soft); }
.notice.info { background: var(--info-soft); }
.notice .i { font-weight: 700; color: var(--warn); }
.notice.bad .i { color: var(--bad); }
.notice.info .i { color: var(--info); }
.notice code, .key-box code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 0 5px; border-radius: 4px; direction: ltr; unicode-bidi: isolate; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--bad-soft); padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.empty { text-align: center; padding: 48px 20px; display: grid; gap: 12px; justify-items: center; }
.empty h2 { font-size: 22px; font-weight: 700; }
.empty p { color: var(--muted); max-width: 52ch; }

/* ---------- today ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { padding: 16px 24px; border-inline-start: 1px solid var(--line-2); display: grid; color: var(--ink); }
.stat:first-child { border-inline-start: 0; }
a.stat:hover { background: var(--accent-tint); text-decoration: none; }
.stat b { font-size: 26px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat b.bad { color: var(--bad); }
.stat span { font-size: 14px; color: var(--muted); }
.meters { display: grid; gap: 14px; padding: 16px 24px 20px; border-top: 1px solid var(--line-2); }
.meter-row { display: grid; gap: 6px; }
.meter-row .l { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.meter { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.warn span { background: var(--warn-dot); } .meter.bad span { background: var(--bad-dot); }
.wk { display: grid; grid-template-columns: repeat(var(--days, 5), minmax(0, 1fr)); }
.wk-day { padding: 14px 14px 18px; border-inline-start: 1px solid var(--line-2); border-top: 3px solid transparent; display: flex; flex-direction: column; gap: 10px; min-height: 200px; min-width: 0; }
.wk-day:first-child { border-inline-start: 0; }
.wk-day.today { background: var(--accent-tint); border-top-color: var(--accent); }
.wk-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.wk-h .dn { display: grid; line-height: 1.3; }
.wk-h .dn span, .wk-h .dn small { font-size: 13px; color: var(--muted); }
.wk-h .dn small { font-size: 12px; }
.wk-h b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.today-tag { font-size: 12px; font-weight: 600; background: var(--accent-btn); color: #fff; border-radius: 999px; padding: 1px 10px; }
.ev { display: grid; gap: 1px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); }
.ev:hover { text-decoration: none; outline: 1px solid var(--accent); }
.ev .w { font-size: 13px; font-weight: 700; }
.ev .c { font-size: 14px; font-weight: 600; color: var(--ink); }
.ev .p { font-size: 12px; color: var(--muted); }
.ev.dl { background: var(--warn-soft); color: var(--warn); }
.ev.dl:hover { outline-color: var(--warn); }
.wk-empty { font-size: 14px; color: var(--faint); }
.setup { display: grid; gap: 12px; }
.setup h2 { font-size: 18px; font-weight: 600; }
.setup ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.setup li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 15px; }
.setup li .mark { width: 22px; height: 22px; border-radius: 99px; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.setup li.done { color: var(--muted); }
.setup li.done .mark { background: var(--accent-btn); border-color: var(--accent-btn); color: #fff; }
.setup li .act { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- the case ---------- */
.case-head { padding: 22px 24px 18px; display: grid; gap: 16px; }
.case-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.case-top > div:first-child { display: grid; gap: 8px; min-width: 0; }
.case-top h1 { font-size: 26px; font-weight: 700; line-height: 1.35; }
.facts { display: grid; grid-template-columns: repeat(var(--facts, 4), minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: 10px; }
.fact { padding: 12px 16px; border-inline-start: 1px solid var(--line-2); display: grid; gap: 2px; align-content: start; min-width: 0; }
.fact:first-child { border-inline-start: 0; }
.fact > span { font-size: 13px; color: var(--muted); }
.fact b { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.fact small { font-size: 13px; color: var(--muted); }
.fact .badge { justify-self: start; margin-top: 4px; }
.fact .btn { justify-self: start; margin-top: 6px; }
.tabs { display: flex; gap: 2px; border-top: 1px solid var(--line-2); padding-inline: 12px; overflow-x: auto; scrollbar-width: none; }
.tab { display: flex; align-items: center; gap: 6px; padding: 13px 12px 11px; border-bottom: 3px solid transparent; color: var(--ink-2); font-weight: 500; font-size: 15px; white-space: nowrap; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.case-view { display: grid; gap: 16px; }
.case-view .panel { padding-top: 8px; }
.edit-case { margin-top: 16px; }

/* progress */
.job { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.job .msg { font-weight: 600; }
.job .elapsed { font-size: 13px; color: var(--muted); }
.bar { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }

/* documents */
.drop { border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface); padding: 26px 20px; display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer; }
.drop:hover { border-color: var(--accent); }
.drop.over { border-color: var(--accent); background: var(--accent-tint); }
.drop .t { font-size: 17px; font-weight: 700; }
.drop .s { font-size: 14px; color: var(--muted); }
.drop .up { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.allowance { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.allowance b { color: var(--ink); }
.docs { list-style: none; margin: 18px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.card .docs { margin: 0; border: 0; border-radius: 0; border-top: 1px solid var(--line-2); }
.docs-body { display: grid; gap: 14px; }
.docs-body .job { margin: 0; }
.doc { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 20px; }
.doc + .doc { border-top: 1px solid var(--line-2); }
.doc .ic { width: 44px; height: 44px; border-radius: 10px; background: var(--grey-soft); display: grid; place-items: center; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.doc .n { font-weight: 600; }
.doc .m { font-size: 13.5px; color: var(--muted); }
.doc .st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; margin-top: 6px; }
.doc .st.ok { color: var(--ok); background: var(--ok-soft); }
.doc .st.wait { color: var(--info); background: var(--info-soft); }
.doc .st.err { color: var(--bad); background: var(--bad-soft); white-space: normal; }
.doc .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.doc .edit { grid-column: 2 / -1; display: grid; gap: 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 14px; }
.doc .reading { display: grid; gap: 6px; margin-top: 6px; max-width: 360px; }
.doc .reading .st { margin-top: 0; }
.docs-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; background: var(--accent-tint); border: 1px solid var(--accent-soft); border-radius: 12px; padding: 16px 20px; }
.docs-foot p { font-weight: 600; }
.docs-foot p small { display: block; font-weight: 400; color: var(--ink-2); font-size: 14px; }

/* sources */
.src { display: inline-flex; align-items: center; gap: 4px; vertical-align: 1px; font-family: var(--ui); font-size: 12px; font-weight: 600; line-height: 1.7; padding: 0 9px; border-radius: 999px; border: 1px solid transparent; margin-inline: 2px; white-space: nowrap; background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; }
.src:hover { border-color: var(--accent); }
.src.active { background: var(--mark); color: var(--mark-ink); }
.src.missing { background: var(--bad-soft); color: var(--bad); }
.nosrc { display: inline-block; font-size: 12px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 0 8px; border-radius: 999px; margin-inline-start: 4px; }

/* brief */
.ai-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 13.5px; color: var(--muted); margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.ai-note .tag { color: var(--accent); font-weight: 600; }
.summary { font-size: 18px; line-height: 1.95; max-width: 72ch; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; }
.summary p + p { margin-top: 8px; }
.sec { padding-block: 24px 0; margin-top: 8px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-h h2 { font-size: 18px; font-weight: 700; }
.sec-h .aside { font-size: 13.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.rows { list-style: none; margin: 0; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: 12px; border-bottom: 1px solid var(--line-2); }
.rows li:last-child { border-bottom: 0; }
.rows li .amt { font-weight: 700; white-space: nowrap; }
.parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.party { display: grid; gap: 2px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.party .r { font-size: 13px; color: var(--muted); font-weight: 600; }
.party .n { font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.def-item { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.def-item h3 { font-size: 16px; font-weight: 700; }
.def-item p { color: var(--ink-2); font-size: 15px; }
.contra { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.contra-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.contra-row + .contra-row { border-top: 1px solid var(--line-2); }
.contra-row > div { padding: 16px 18px; display: grid; gap: 6px; align-content: start; }
.contra-row > div + div { border-inline-start: 1px solid var(--line-2); }
.contra .who { font-size: 13px; font-weight: 700; color: var(--muted); }
.contra .who.fact { color: var(--ok); }
.contra .say { font-family: var(--doc); font-size: 17.5px; line-height: 1.85; }
.gap { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--warn-soft); }
.gap .i { font-weight: 700; color: var(--warn); }
.gap h3 { font-size: 15px; font-weight: 700; }
.gap p { font-size: 14px; color: var(--ink-2); }
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; background: var(--accent-tint); border: 1px solid var(--accent-soft); border-radius: 12px; padding: 18px 20px; margin-top: 28px; }
.cta p { font-weight: 600; max-width: 60ch; }
.cta p small { display: block; font-weight: 400; color: var(--ink-2); font-size: 14px; }

/* timeline */
.tl { list-style: none; margin: 0; padding: 8px 24px; max-width: 920px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tl li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 0 24px; }
.tl .when { padding-block: 14px; text-align: end; display: grid; align-content: start; }
.tl .when b { font-size: 15px; }
.tl .when span { font-size: 13px; color: var(--muted); }
.tl .what { position: relative; padding-block: 14px; padding-inline-start: 24px; border-inline-start: 2px solid var(--line-2); display: grid; gap: 4px; }
.tl .what::before { content: ""; position: absolute; inset-inline-start: -7px; top: 22px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl .what h3 { font-size: 16px; font-weight: 600; }
.tl .what p { font-size: 14.5px; color: var(--ink-2); }
.tl li.future .what { border-inline-start-style: dashed; }
.tl li.future .what::before { background: var(--accent); }
.tl li.today .when, .tl li.today .what { color: var(--accent); font-weight: 700; font-size: 13px; padding-block: 6px; }
.tl li.today .what::before { display: none; }
.tl li.today .what span { border-top: 1px solid var(--accent); display: block; padding-top: 4px; }

/* memo */
.memo-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.memo-tabs a { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 6px 14px; display: grid; line-height: 1.45; color: var(--ink); }
.memo-tabs a:hover { border-color: var(--ink-2); text-decoration: none; }
.memo-tabs a[aria-current="true"] { border-color: var(--accent); background: var(--accent-tint); }
.memo-tabs b { font-size: 14.5px; font-weight: 600; }
.memo-tabs small { font-size: 12.5px; color: var(--muted); }
.memo-new { display: grid; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--line-2); }
.memo-new-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; align-items: start; }
.memo-new h3 { font-size: 14px; font-weight: 700; }
.grp { display: grid; gap: 8px; align-content: start; }
.choice { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; font-size: 14.5px; cursor: pointer; }
.choice input { accent-color: var(--accent-btn); margin-top: 5px; }
.choice small { display: block; color: var(--muted); font-size: 13px; }
.abilities { display: grid; gap: 12px; margin: 12px 0; }
.abilities.read { list-style: none; padding: 0; gap: 8px; font-size: 14.5px; }
.abilities .badge { vertical-align: 1px; }
.memo-new .seg { width: fit-content; }
.memo-new .seg button { background: transparent; border: 0; border-radius: 8px; padding: 5px 14px; font-size: 13.5px; color: var(--ink-2); }
.memo-new .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 20, .08); }
.memo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; padding: 24px; background: var(--surface-2); border-radius: 0 0 12px 12px; }
.memo-side { position: sticky; top: 88px; display: grid; gap: 16px; }
.memo-side .card { padding: 16px 18px; }
.memo-side h2 { font-size: 16px; font-weight: 700; }
.memo-actions { display: grid; gap: 10px; }
.save-state { font-size: 13px; color: var(--muted); }
.paper-wrap { position: relative; max-width: 820px; }
.seal { position: absolute; bottom: 92px; left: 26px; width: 120px; height: 120px; border-radius: 50%; border: 3px double var(--seal); color: var(--seal); display: grid; place-items: center; text-align: center; transform: rotate(-12deg); opacity: .9; pointer-events: none; }
.seal .w { font-family: "Aref Ruqaa", var(--doc); font-size: 26px; font-weight: 700; line-height: 1.1; display: block; }
.seal small { display: block; font-family: var(--ui); font-size: 10.5px; font-weight: 600; line-height: 1.4; }
.seal.stamp { animation: stamp .45s cubic-bezier(.2, 1.6, .5, 1) both; }
@keyframes stamp { from { transform: rotate(-12deg) scale(1.9); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: .9; } }
.paper { background: var(--paper); color: var(--paper-ink); box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: 4px; padding: 56px 64px 64px; font-family: var(--doc); font-size: 19px; line-height: 2.1; max-width: 820px; min-height: 480px; }
.paper:focus { outline: none; }
.paper:focus-visible { outline: 2px dashed var(--accent); outline-offset: 6px; }
.paper p { text-align: justify; margin-block: 0 10px; }
.paper .center { text-align: center; }
.paper h3 { font-size: 20px; font-weight: 700; margin-block: 22px 8px; }
.paper h4 { font-size: 19px; font-weight: 700; margin-block: 16px 4px; }
.paper ol, .paper ul { margin-block: 0 10px; padding-inline-start: 26px; }
.paper ol { list-style-type: arabic-indic; }
.paper li { margin-bottom: 4px; }
.paper .ph { background: var(--mark); color: var(--mark-ink); border-radius: 3px; padding-inline: 2px; }
.paper .sign { display: grid; justify-items: end; margin-top: 22px; font-weight: 700; }
.paper .sign p { margin: 0; }
.paper .empty h2 { font-family: var(--ui); }
.attachments { max-width: 820px; margin-top: 14px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.attachments b { display: block; margin-bottom: 4px; }
.attachments ol { margin: 0; padding-inline-start: 22px; }
.review-card { display: grid; gap: 10px; }
.review-card.ok { border-color: var(--ok); box-shadow: inset 0 3px 0 var(--ok); }
.review-card.warn { box-shadow: inset 0 3px 0 var(--warn-dot); }
.review-card.bad { box-shadow: inset 0 3px 0 var(--bad-dot); }
.review-card p { margin: 0; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks > li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: 14.5px; }
.checks > li .i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.checks > li.block .i { color: var(--bad); background: var(--bad-soft); }
.checks > li.warn .i { color: var(--warn); background: var(--warn-soft); }
.checks ul { margin: 4px 0 0; padding-inline-start: 18px; color: var(--ink-2); font-size: 14px; }
.checks ul.inline { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.checks ul.inline li { background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 0 10px; font-weight: 600; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(10, 16, 14, .32); z-index: 50; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(560px, 100vw); background: var(--surface); z-index: 55; box-shadow: var(--shadow); display: flex; flex-direction: column; transform: translateX(-102%); transition: transform .25s ease; }
.drawer.open { transform: none; }
.dr-head { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.dr-head .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.dr-head h2 { font-size: 18px; font-weight: 700; }
.dr-head .m { font-size: 13.5px; color: var(--muted); grid-column: 1 / -1; }
.dr-body { padding: 16px 20px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; background: var(--surface-2); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.page-img { width: 100%; border: 1px solid var(--line); border-radius: 4px; background: #fff; display: block; }
.page-text { background: var(--paper); color: var(--paper-ink); border: 1px solid var(--line); border-radius: 4px; padding: 18px 20px; font-family: var(--doc); font-size: 17px; line-height: 1.95; }
.page-text p { margin-block: 0 10px; white-space: pre-wrap; }
.page-text p.hit { background: var(--mark); color: var(--mark-ink); border-radius: 4px; padding: 2px 6px; margin-inline: -6px; }
.page-text .muted { color: var(--muted); font-family: var(--ui); font-size: 14px; }
.toggle { display: flex; gap: 6px; }
.toggle .btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.dr-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; font-size: 13.5px; color: var(--muted); }

/* settings */
.key-box { font-size: 14px; border-radius: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; gap: 4px; }
.key-box.ok b { color: var(--ok); }
.key-box.missing b { color: var(--warn); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: var(--ground); padding: 11px 18px; border-radius: 10px; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 70; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- sign-in and the first office ---------- */
body.signed-out .nav, body.signed-out .actions, body.signed-out .tabbar { display: none !important; }
.auth-card { max-width: 460px; margin: 40px auto 0; display: grid; gap: 16px; }
.auth-card .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.auth-card .or::before, .auth-card .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.google svg { width: 18px; height: 18px; }
.code-input { letter-spacing: .4em; text-align: center; font-size: 22px; direction: ltr; font-variant-numeric: tabular-nums; }

/* ---------- team, fees, updates, imports ---------- */
.load-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.load { display: grid; gap: 2px; padding: 16px 18px; }
.load ul { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 2px; font-weight: 700; font-variant-numeric: tabular-nums; }
.load li span { font-weight: 400; color: var(--muted); font-size: 13.5px; }
.load li.late { color: var(--bad); }
.fee-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.fee-sum > div { padding: 16px 24px; display: grid; border-inline-start: 1px solid var(--line-2); }
.fee-sum > div:first-child { border-inline-start: 0; }
.fee-sum span { font-size: 14px; color: var(--muted); }
.fee-sum b { font-size: 24px; font-variant-numeric: tabular-nums; }
.fee-sum .due b, td.due { color: var(--bad); font-weight: 700; }
.update-panel { display: grid; gap: 12px; }
.update-panel textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); line-height: 1.8; font-size: 15px; }
.update-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.update-history li { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px; }
.update-history p { margin: 2px 0 0; font-size: 14px; }
.mapped { margin: 0; padding-inline-start: 18px; display: grid; gap: 2px; font-size: 14.5px; }
.import-table tr.off td { color: var(--muted); background: var(--surface-2); }
.import-table .badge { margin: 1px 0; }

/* ---------- clients and the conflict check ---------- */
.alerts { display: grid; gap: 8px; }
.alerts h2 { font-size: 16px; }
.alerts ul, .case-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alerts li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.case-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.case-link { font-weight: 600; }
.hits { margin: 6px 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.scope { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); max-width: 46ch; white-space: pre-wrap; }
.conflict-box { grid-column: 1 / -1; }
#activity-case { min-height: 44px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); max-width: 280px; }

/* ---------- hearings, deadlines, tasks and the agenda ---------- */
.sched { display: grid; gap: 28px; }
.sub-h { font-size: 14px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.sched-list, .agenda-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sched-item { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 8px 16px; align-items: start; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.sched-item:last-child { border-bottom: 0; }
.sched-item > form { grid-column: 1 / -1; }
.sched-item .when { display: grid; line-height: 1.5; }
.sched-item .what { display: grid; gap: 4px; justify-items: start; }
.sched-item .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sched-item.past { background: var(--surface-2); }
.sched-item.done .what b { text-decoration: line-through; color: var(--muted); }
.sched-item .check { padding-top: 2px; }
.sched-item .check input { width: 20px; height: 20px; accent-color: var(--accent-btn); }
.sched-item:has(.check) { grid-template-columns: 28px minmax(0, 1fr) auto; }
.task .acts select { min-height: 36px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 13.5px; }
.outcome { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px; font-size: 14.5px; }
.calc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calc-row input { width: auto; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.calc-row input[type="number"] { width: 120px; }
.card .agenda-list, .card .sched-list { border: 0; border-radius: 0; background: transparent; }
.card .agenda-list li, .card .sched-item { padding-inline: 0; }
.agenda-list li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.agenda-list li:last-child { border-bottom: 0; }
.agenda-list li p { margin: 2px 0 0; }
.agenda-list .t { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.day-row { padding: 9px 24px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); border-top: 1px solid var(--line-2); font-weight: 600; font-size: 14.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head + .day-row { border-top: 0; }
.day-row small { font-weight: 400; color: var(--muted); font-size: 13px; }
.item.timed { grid-template-columns: 64px minmax(0, 1fr) auto; }
.when-tile { width: 64px; display: grid; line-height: 1.25; text-align: center; padding: 7px 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.when-tile b { font-size: 15px; font-variant-numeric: tabular-nums; }
.when-tile small { font-size: 11.5px; }
.when-tile.dl { background: var(--warn-soft); color: var(--warn); }
.when-tile.past { background: var(--grey-soft); color: var(--ink-2); }
label.btn input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-btn); margin: 0; }
.day h2 { font-size: 16px; font-weight: 700; }
.day h2 .fine { font-weight: 400; }
.card.late { border-color: var(--bad-soft); box-shadow: inset 0 3px 0 var(--bad-dot); }
.feed-url { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.feed-url input { flex: 1 1 320px; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); font-size: 13px; }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
.task-item .task-check > span { display: grid; gap: 2px; }
.task-item.done .t { text-decoration: line-through; color: var(--muted); }
.task-acts { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-inline-start: 30px; }
.task-acts select { min-height: 36px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 13.5px; }
.task-item .confirm { grid-column: 1 / -1; }

/* ---------- people ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.person { display: grid; gap: 12px; align-content: start; padding: 16px 18px; color: var(--ink); }
.person:hover { border-color: var(--accent); text-decoration: none; }
.person .top-row { display: flex; gap: 12px; align-items: center; }
.person .nm { font-weight: 700; }
.person .rl { font-size: 13px; color: var(--muted); }
.load-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 10px; }
.load-row b { display: block; font-size: 20px; color: var(--ink); }
.load-row .late b { color: var(--bad); }
.page-head > div.profile, .profile { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; padding: 16px 24px; font-size: 15px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the assistants ---------- */
.chat { display: grid; gap: 16px; }
.q { justify-self: start; max-width: 85%; background: var(--accent-btn); color: #fff; border-radius: 14px 14px 14px 4px; padding: 10px 16px; white-space: pre-wrap; }
.a { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 14px; }
.ans-p { display: grid; gap: 6px; }
.ans-p p, .ans-p li { font-size: 16.5px; line-height: 1.95; max-width: 75ch; }
.ans-p ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.ans-cites { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ans-cites .src { margin: 0; }
.ans-sources { display: grid; gap: 6px; border-top: 1px solid var(--line-2); padding-top: 12px; font-size: 14px; }
.ans-source { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; text-align: start; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 8px; padding: 8px 12px; font-size: 14px; color: var(--ink); }
.ans-source:hover { border-color: var(--accent); }
.ans-actions { display: grid; gap: 10px; }
.confirm-card { display: grid; gap: 6px; border: 1px solid var(--accent); background: var(--accent-tint); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.confirm-card.done { border-color: var(--line-2); background: var(--surface-2); }
.confirm-card.dismissed { border-color: var(--line-2); background: var(--surface); opacity: .8; }
.ans-cites a.src { text-decoration: none; }
.src.mail { max-width: 100%; }
.src.mail bdi { overflow: hidden; text-overflow: ellipsis; }
.src .i { width: 13px; height: 13px; flex: none; }
.ask { display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 8px; }
.ask textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: vertical; min-height: 48px; padding: 8px 10px; font-size: 16px; line-height: 1.7; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { font-size: 14px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 14px; color: var(--ink-2); text-align: start; }
.suggest button:hover { border-color: var(--accent); color: var(--ink); }

/* ---------- connections and AI Steps services ---------- */
.logo { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 11.5px; color: #fff; overflow: hidden; }
.feed-body { display: grid; gap: 8px; margin-top: 10px; }
.feed-body .row-end { justify-content: flex-start; }
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.offer { display: grid; gap: 10px; align-content: start; }
.offer h3 { font-size: 17px; font-weight: 700; }
.offer .fine { font-size: 14px; }
.request-answer { grid-column: 1 / -1; display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.request-answer select, .request-answer textarea { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 14px; }

/* ---------- more (phone) ---------- */
.more-list .item { grid-template-columns: 44px minmax(0, 1fr); color: var(--ink); }
.more-list a.item:hover { background: var(--accent-tint); text-decoration: none; }
.more-list button.item { width: 100%; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: start; font: inherit; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
}
@media (max-width: 1080px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .memo-grid { grid-template-columns: minmax(0, 1fr); }
  .memo-side { position: static; }
}
@media (max-width: 900px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(odd) { border-inline-start: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .wk { grid-template-columns: minmax(0, 1fr); }
  .wk-day { min-height: 0; border-inline-start: 0; border-top: 1px solid var(--line-2); }
  .wk-day:first-child { border-top: 0; }
  .wk-day.today { border-top: 3px solid var(--accent); }
}
@media (max-width: 760px) {
  .top { padding-inline: 16px; gap: 10px; height: 60px; }
  .brand .words, .menu-btn, .new-label, .hide-sm { display: none !important; }
  .actions { gap: 8px; }
  .main { padding-inline: 16px; padding-block: 18px 110px; }
  .page, .stack, .split { gap: 18px; }
  .page h1, .center-col h1, .auth-card h1 { font-size: 23px; }
  .case-top h1 { font-size: 21px; }
  .card { padding: 16px; }
  .card-head, .card-body, .item, .case-head, .stat, .meters, .empty-note { padding-inline: 16px; }
  .item { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .item.bare { grid-template-columns: minmax(0, 1fr); }
  .item .act { grid-column: 1 / -1; justify-content: space-between; }
  .item.bare .act { grid-column: auto; justify-content: flex-start; }
  .ico { width: 40px; height: 40px; }
  .filters.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .list-table th, .list-table td { padding-inline: 14px; }
  .fee-sum { grid-template-columns: minmax(0, 1fr); }
  .fee-sum > div { border-inline-start: 0; border-top: 1px solid var(--line-2); }
  .fee-sum > div:first-child { border-top: 0; }
  .contra-row { grid-template-columns: minmax(0, 1fr); }
  .contra-row > div + div { border-inline-start: 0; border-top: 1px dashed var(--line-2); }
  .tl { padding-inline: 16px; }
  .tl li { grid-template-columns: minmax(0, 1fr); }
  .tl .when { text-align: start; padding-inline-start: 24px; border-inline-start: 2px solid var(--line-2); padding-block: 12px 0; }
  .paper { padding: 28px 20px 36px; font-size: 17px; }
  .memo-grid, .memo-new { padding: 16px; }
  .memo-new-grid { grid-template-columns: minmax(0, 1fr); }
  .seal { width: 92px; height: 92px; left: 30px; } .seal .w { font-size: 20px; }
  .doc { grid-template-columns: 40px minmax(0, 1fr); padding-inline: 16px; }
  .doc .ic { width: 40px; height: 40px; }
  .doc .acts { grid-column: 2; justify-content: flex-start; }
  .sched-item, .sched-item:has(.check) { grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
  .sched-item .acts { justify-content: flex-start; }
  .agenda-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-inline: 16px; }
  .item.timed { grid-template-columns: 58px minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; padding-inline: 16px; }
  .request-answer { grid-template-columns: minmax(0, 1fr); }
  .logo { width: 40px; height: 40px; }
  .kv dd { margin-bottom: 8px; }
  .when-tile { width: 58px; }
  .day-row { padding-inline: 16px; }
  .setup li { grid-template-columns: 24px minmax(0, 1fr); }
  .setup li .act { grid-column: 2; }
  .pop.wide { width: min(380px, calc(100vw - 24px)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 30; }
  .tabbar a { display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 11.5px; color: var(--muted); min-height: 48px; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
  .tabbar svg { width: 21px; height: 21px; }
  .toast { bottom: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.hj-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; min-height: 1em; }
.letterhead-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.letterhead-logo img { max-height: 64px; max-width: 220px; object-fit: contain; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px; background: #fff; }
.review-issue { display: grid; gap: 10px; }
.ri-head { display: flex; align-items: center; gap: 10px; }
.ri-head h3 { font-size: 16px; margin: 0; }
blockquote.clause { margin: 0; padding: 10px 14px; border-inline-start: 3px solid var(--line-strong); background: var(--surface-2); border-radius: 0 8px 8px 0; font-family: var(--doc); font-size: 17px; line-height: 1.8; }
.suggestion { border: 1px solid var(--accent-soft); background: var(--accent-tint); border-radius: 10px; padding: 10px 14px; }
.sg-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sg-text { margin: 6px 0 0; font-family: var(--doc); font-size: 17px; line-height: 1.8; white-space: pre-wrap; }

