/* Approved midnight / icy white / sky blue presentation. Bundled OFL fonts;
   nothing in this stylesheet contacts an external service. */
@font-face { font-family:Inter; src:url('fonts/inter.ttf') format('truetype'); font-style:normal; font-weight:100 900; font-display:swap; }
@font-face { font-family:'IBM Plex Sans'; src:url('fonts/ibm-plex-sans.ttf') format('truetype'); font-style:normal; font-weight:100 700; font-display:swap; }
:root {
  color-scheme:light;
  --brand:#08689c; --brand-800:#07547e; --brand-900:#064768; --brand-tint:#e6f2fa; --brand-ink:#fff;
  --bg:#f0f6fa; --panel:#fff; --panel-2:#f5f8fb; --ink:#152d40; --muted:#496579; --muted-2:#496579;
  --line:#d8e5ec; --line-2:#e7eff4; --chip:#f1f5f9;
  --ok:#166534; --ok-bg:#f0fdf4; --ok-line:#b8d9c4;
  --warn-ink:#854d0e; --warn-bg:#fefce8; --warn-line:#d9c88b;
  --danger:#b42318; --danger-bg:#fef3f2; --danger-line:#e8b3af;
  --next:#08689c; --next-bg:#e6f2fa; --next-line:#bddeed;
  --amber-solid:#854d0e; --red-solid:#b42318; --green-solid:#166534; --blue-solid:#08689c;
  --pending:#64748b; --done:#64748b; --accent:var(--brand);
  --font:Inter,system-ui,sans-serif; --font-heading:'IBM Plex Sans',Inter,system-ui,sans-serif;
  --font-fact:Inter,system-ui,sans-serif;
  --focus-ring:0 0 0 3px #08689c; --shadow:0 1px 2px rgb(21 45 64 / 3%);
  --fg:var(--ink); --card:var(--panel); --border:var(--line); --err:var(--danger);
}
* { box-sizing:border-box; }
body { font-family:var(--font); font-size:17px; line-height:1.55; background:var(--bg); color:var(--ink); height:100dvh; }
h1,h2,h3,h4,.brand .title { font-family:var(--font-heading); }
input,select,textarea,button { font-family:var(--font); }
button,input,select,textarea { min-width:0; }
button { touch-action:manipulation; }
a,button,input,select,textarea { scroll-margin-block:20px; }
:focus-visible { outline:2px solid var(--brand); outline-offset:3px; box-shadow:none; }
.skip-link { position:absolute; top:-90px; left:12px; z-index:100; padding:12px; background:var(--panel); color:var(--brand); }
.skip-link:focus { top:8px; }
.topbar { height:auto; min-height:78px; padding:16px 24px; background:var(--panel); gap:24px; }
.brand { flex:0 1 245px; }
.brand .title { font-size:20px; font-weight:600; line-height:1.2; overflow-wrap:anywhere; }
.brand .firm { font-size:14px; margin-top:4px; color:var(--muted); }
.brand .mark { display:none; }
.searchbar { flex:1 1 320px; max-width:600px; height:44px; min-width:0; margin:0; padding:10px 14px; font-size:14px; background:var(--bg); }
.searchbar-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.health { flex:none; }
.corpus { font-size:14px; padding:9px 12px; }
.corpus .sd { background:var(--brand); box-shadow:none; }
.tb-btn { width:44px; height:44px; }
.corpus-pop { top:calc(100% - 5px); font-size:14px; }
.corpus-pop h4 { font-size:16px; text-transform:none; }
.layout { grid-template-columns:240px minmax(0,1fr); min-width:0; }
.layout:has(.rail:not(:empty)) { grid-template-columns:240px minmax(0,1fr) 190px; }
.sidebar { background:#152d40; color:#ddeaf3; border:none; padding-top:20px; }
.nav { margin:0; padding:0 12px; }
.nav-item { color:#ddeaf3; font-size:16px; padding:11px 14px; min-height:46px; border-radius:8px; }
.nav-item:hover { color:#fff; background:#20384d; }
.nav-item.is-active { background:var(--brand-tint); color:var(--brand); font-weight:650; }
.nav-icon { opacity:1; }
.nav-count { color:inherit; font-size:14px; }
.nav-badge { background:#e6f2fa; color:#08689c; }
.nav-divider { border-color:#385365; margin:20px 16px; }
.nav-eyebrow { color:#ddeaf3; font-size:14px; text-transform:none; letter-spacing:0; }
.sidebar .matter-list .pet { font-size:16px; }
.sidebar .matter-list .m-next { color:#ddeaf3; font-size:14px; white-space:normal; }
.sidebar .matter-list li { padding:10px; }
.sidebar .matter-list li:hover,.sidebar .matter-list li.active { background:#20384d; border-color:#385365; }
.sidebar .matter-list .sd { background:#ddeaf3; }
.sidebar .matter-list .sd.over { background:#fda29b; }
.sidebar .matter-list .sd.warn { background:#fde68a; }
.sidebar .matter-list .sd.ok { background:#86efac; }
.sidebar .hint,.rail-footer { color:#ddeaf3; font-size:14px; }
.sidebar .m-count { background:#20384d; color:#ddeaf3; border-color:#385365; }
.rail-footer { margin:12px 16px 20px; }
.main { padding:28px 32px 64px; min-width:0; }
.main > * { max-width:1440px; }
.rail { padding:20px 10px; font-size:14px; }
.rail:empty { display:none; }
.rail h4 { text-transform:none; font-size:16px; letter-spacing:0; }
.rail a { font-size:14px; min-height:42px; }
.rail a.on { color:var(--brand); }
.hint,.sub,.lede,.kind,.disclaimer,.team-help,.team-sub,.profile-card p { font-size:14px; color:var(--muted); }
.home { max-width:1440px; }
.home-head { align-items:flex-start; gap:20px; flex-wrap:wrap; margin-bottom:20px; }
.home-head h2,.mhead h1 { font-size:32px; line-height:1.2; font-weight:600; margin:0; }
.home-head .hint { margin-top:8px; }
.seg { flex-wrap:wrap; height:auto; }
.seg-btn { font-size:14px; min-height:38px; padding:8px 12px; }
.seg-btn.is-active { color:var(--brand); }
.card { border-radius:12px; padding:20px; min-width:0; }
.card > h3 { font-size:24px; line-height:1.25; font-weight:600; }
.card > h3 .h-note,.card > h3 .h-right { font-size:14px; }
.btn,.btn.secondary,.ghost { font-size:16px; min-height:42px; }
.btn { background:var(--brand); color:var(--brand-ink); }
.btn:hover { background:var(--brand-800); }
.btn.secondary:hover { background:var(--bg); }
.tag,.badge,.pill,.due,.count .n { font-size:14px; }
.tag.done,.step.done .tag { background:#f1f5f9; color:#475569; border-color:#cbd5e1; }
.step.done .dot { background:#64748b; }
.anchors label,.facts label,.eyebrow,.need-label,.blocks-label { font-size:14px; text-transform:none; letter-spacing:0; }
.anchors input,.facts input,.facts select,.team-form input,.team-form select { font-size:17px; min-height:42px; width:100%; }
.anchor-source,.anchor-missing,.anchor-blocking,.field-src,.chain,.chain-note { font-size:14px; }
.anchor-source { color:var(--muted); }
.chain { padding:10px 12px; background:var(--panel-2); border-radius:8px; line-height:1.65; }
.chain-rule,.chain-result { color:var(--ink); }
.count { flex-shrink:0; }
.count .rel { font-size:14px; }
.count.past .n { color:var(--danger); }
.count.soon .n { color:var(--warn-ink); }
.deadline { gap:14px; min-width:0; }
.deadline.is-overdue .d-step,.deadline.is-overdue .n,.deadline.is-urgent .d-step { font-weight:750; }
.next-step { border-color:var(--next-line); background:var(--panel); }
.produces li { font-size:17px; }
.timeline .name { font-size:17px; }
.step .basis { font-size:14px; }
.guard-ok,.guard-item,.guard .g2 { font-size:14px; }
.guard-ok { background:#e6f2fa; color:var(--ink); border-color:var(--line); }
.tcard { border-radius:12px; }
.tcard-name,.tcard-body,.stream-body { font-size:17px; }
.tcard-meta,.stream-track,.blocks-list,.legend-item,.legend-note { font-size:14px; }
.board-col-title { font-size:18px; }
.board-col-count { font-size:14px; }
.tcard.blocked { border-left-color:#64748b; }
.badge-blocked,.blocks-label,.blocks-list,.review-note { color:#475569; }
.badge-blocked,.blocks-panel { background:#f1f5f9; border-color:#cbd5e1; }
.tcard.over .tcard-name,.tcard.over .tcard-body { font-weight:750; }
.tcard.warn { border-left-color:var(--warn-ink); }
.draftflow { min-width:0; }
.draftflow > * { min-width:0; }
.step-title,.doc-pick-row { font-size:16px; }
.doc-pick-tag,.doc-pick-group,.needed { font-size:14px; text-transform:none; letter-spacing:0; }
.facts { gap:16px; }
.facts > * { min-width:0; }
.team-table,.sync-table,.inv-table,.claims-table,.wf-table { font-size:16px; }
th { font-size:14px!important; text-transform:none!important; letter-spacing:0!important; }
table { max-width:100%; }
.inv-wrap,.claims-wrap,.wf-wrap { max-width:100%; overflow-x:auto; }
.inv-table input,.claims-table input,.wf-table input,.inv-table select,.claims-table select { font-size:16px; min-width:65px; max-width:100%; }
.ui-welcome { display:flex; align-items:center; justify-content:space-between; gap:24px; background:#edf5fa; border:1px solid var(--line); padding:22px; border-radius:12px; margin-bottom:20px; }
.ui-welcome h3 { margin:0 0 8px; font-size:24px; font-weight:600; }
.ui-welcome p { margin:0; font-size:14px; color:var(--muted); }
.ui-first-steps { margin-top:12px; font-size:14px; color:var(--brand); font-weight:600; }
.ui-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:22px; }
.ui-stat { display:flex; align-items:center; gap:14px; padding:18px; background:var(--panel); border:1px solid var(--line); border-radius:12px; }
.ui-stat strong { font-size:32px; font-family:var(--font-heading); }
.ui-stat span { font-size:14px; }
.ui-home-columns { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:20px; align-items:start; }
.ui-queue,.ui-next,.ui-matters { background:var(--panel); border:1px solid var(--line); border-radius:12px; min-width:0; }
.ui-queue-head { padding:20px; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--line); }
.ui-queue-head h3,.ui-next h3 { font-size:24px; margin:0; font-weight:600; }
.ui-filter { border:1px solid #9aafbf; border-radius:8px; padding:8px 10px; font-size:14px; background:var(--panel); color:var(--ink); min-height:42px; }
.ui-task-row { display:grid; grid-template-columns:minmax(0,1fr) 180px 130px; gap:16px; align-items:center; padding:18px 20px; border-bottom:1px solid var(--line); }
.ui-task-row:last-child { border-bottom:0; }
.ui-task-row.is-overdue { background:var(--danger-bg); border-left:3px solid var(--danger); padding-left:17px; }
.ui-task-row.is-urgent { border-left:3px solid var(--danger); padding-left:17px; }
.ui-task-name { border:0; background:none; padding:0; color:var(--ink); font-size:17px; font-weight:600; text-align:left; }
.ui-task-row.is-overdue .ui-task-name,.ui-task-row.is-urgent .ui-task-name,.ui-task-row.is-overdue time,.ui-task-row.is-urgent time { font-weight:750; }
.ui-task-description,.ui-task-meta { font-size:14px; color:var(--muted); margin-top:6px; overflow-wrap:anywhere; }
.ui-task-time { display:flex; flex-direction:column; gap:6px; align-items:flex-start; }
.ui-task-time time { font-size:14px; color:var(--ink); }
.ui-status { display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border-radius:7px; font-size:14px; line-height:1.4; font-weight:650; }
.ui-status.over,.ui-status.today { color:var(--danger); background:var(--danger-bg); }
.ui-status.soon { color:var(--warn-ink); background:var(--warn-bg); }
.ui-status.later { color:var(--ok); background:var(--ok-bg); }
.ui-status.neutral { color:#475569; background:#f1f5f9; }
.ui-status .status-glyph { font-weight:750; }
.review-note { display:inline-block; font-size:14px; background:#f1f5f9; padding:4px 8px; border-radius:6px; margin-top:6px; }
.ui-task-row details { font-size:14px; margin-top:8px; }
.ui-task-row summary { color:var(--brand); cursor:pointer; }
.ui-next { padding:20px; }
.ui-next-label { color:var(--brand); font-size:14px; font-weight:650; margin-bottom:8px; }
.ui-next p { font-size:14px; color:var(--muted); }
.ui-next .btn { width:100%; justify-content:center; white-space:normal; }
.ui-next small { display:block; font-size:14px; color:var(--muted); margin-top:12px; }
.ui-list-empty { padding:24px; font-size:17px; color:var(--muted); }
.ui-matter-row { display:grid; grid-template-columns:minmax(0,1fr) 180px 130px; gap:16px; align-items:center; padding:18px 20px; border-bottom:1px solid var(--line); }
.ui-matter-row:last-child { border-bottom:0; }
.ui-matter-search { width:min(100%,420px); min-height:44px; padding:10px 12px; border:1px solid #9aafbf; border-radius:8px; font-size:17px; }
.ui-matters-note { margin-top:16px; font-size:14px; color:var(--muted); }
.cal-num,.cal-ev-meta { font-size:14px; }
.cal-ev-title { font-size:16px; }
.cal-day { min-width:0; min-height:120px; }
.cal-ev { min-width:0; width:100%; text-align:left; padding:8px; overflow-wrap:anywhere; }
.cal-ev.over,.cal-ev.today { background:var(--danger-bg); border-left-color:var(--danger); }
.cal-ev.soon { background:var(--warn-bg); border-left-color:var(--warn-ink); }
.cal-ev.later { background:var(--ok-bg); border-left-color:var(--ok); }
.cal-ev.done,.cal-ev.neutral { background:#f1f5f9; border-left-color:#64748b; }
.cal-ev .ui-status { margin-top:5px; font-size:14px; }
.calendar-list { display:grid; gap:12px; }
.calendar-list .cal-ev { max-width:100%; min-height:70px; }
.cal-ev.over .cal-ev-title,.cal-ev.today .cal-ev-title { font-weight:750; }
.src-rec,.drawer-body { font-size:17px; }
.drawer { width:min(600px,100vw); }
.palette { width:min(650px,calc(100vw - 28px)); }
.palette-row,.palette-input { font-size:17px; }
.palette-foot,.palette-group,.palette-row .p-meta { font-size:14px; }
.account-page { height:auto; min-height:100dvh; padding:24px 16px; font:17px/1.55 var(--font);
  display:flex; flex-direction:column; align-items:center; }
.account-page > .card { margin-block: auto; }
.account-page .card { width:min(100%,460px); padding:30px; box-shadow:var(--shadow); }
.account-page .brand { display:block; margin-bottom:8px; }
.account-page h1 { font-family:var(--font-heading); font-size:32px; line-height:1.2; }
.account-page .firm,.account-page label,.account-page .hint,.account-page .note,.account-page .err,.account-page .sub { font-size:14px; }
.account-page input { background:var(--panel); font-size:17px; min-height:46px; }
.account-page button { font-family:var(--font); font-size:17px; background:var(--brand); min-height:46px; }
.account-page .note { text-align:left; }
.account-page a { color: var(--brand); font-weight: 600; }
.account-page .links { text-align: left; }
.legal-page .card { width: min(100%, 720px); }
.legal-page .draft { background: #fff6df; color: #6a4b00; border-radius: 8px; padding: 10px 12px; font-weight: 700; }
.account-page .mark { display:none; }
@media (max-width:1300px) {
  .ui-home-columns { grid-template-columns:minmax(0,1fr); }
  .ui-next { order:-1; display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:20px; }
  .ui-next .btn { grid-column:2; grid-row:2; align-self:center; }
  .ui-next p,.ui-next small { grid-column:1; }
  .layout:has(.rail:not(:empty)) { grid-template-columns:240px minmax(0,1fr); }
  .rail { display:none; }
}
@media (max-width:900px) {
  body { height:100dvh; }
  .topbar { padding:12px 16px; gap:12px; min-height:72px; flex-wrap:wrap; }
  .brand { flex:1 1 180px; }
  .brand .title { font-size:18px; }
  .searchbar { flex:0 0 44px; height:44px; padding:10px; }
  .searchbar-text,.searchbar .kbd { display:none; }
  .health { gap:6px; }
  .corpus { max-width:150px; overflow:hidden; }
  .corpus .sep,.corpus .n,.corpus .current { display:none; }
  .layout,.layout:has(.rail:not(:empty)) { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); }
  .sidebar { display:flex; padding:8px; min-width:0; }
  .sidebar .nav { display:flex; flex-direction:row; width:100%; gap:5px; overflow-x:auto; padding:0; margin:0; }
  .sidebar .nav li { flex:none; }
  .nav-item { white-space:nowrap; font-size:14px; padding:9px 12px; }
  .sidebar .nav-divider,.sidebar .nav-eyebrow,.sidebar .matter-list,.sidebar #mattersHint,.sidebar .rail-footer { display:none; }
  .main { padding:22px 16px 48px; }
  .grid2 { grid-template-columns:minmax(0,1fr); }
  .ui-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .draftflow { grid-template-columns:minmax(0,1fr); }
  .ui-welcome { align-items:flex-start; flex-direction:column; gap:14px; }
  .home-head h2,.mhead h1 { font-size:32px; }
  .ui-task-row,.ui-matter-row { grid-template-columns:minmax(0,1fr) 165px; }
  .ui-task-row > .btn,.ui-matter-row > .btn { grid-column:1 / -1; justify-self:start; }
  table { display:block; width:100%; overflow-x:auto; }
  .cal-grid { display:none; }
  .calendar-list { display:grid; }
}
@media (min-width:901px) { .calendar-list { display:none; } }
@media (max-width:540px) {
  .health .corpus { display:none; }
  .brand { flex-basis:calc(100% - 60px); }
  .health { width:100%; justify-content:flex-end; }
  .health:empty { display:none; }
  .topbar { gap:8px; }
  .ui-stat { flex-direction:column; align-items:flex-start; gap:4px; padding:14px; }
  .ui-stat strong { font-size:28px; }
  .ui-task-row,.ui-matter-row { grid-template-columns:minmax(0,1fr); }
  .ui-next { display:block; }
  .ui-next .btn { margin-top:10px; }
  .ui-first-steps { line-height:1.8; }
  .home-head { gap:12px; }
  .ui-welcome,.card,.ui-next,.ui-queue-head { padding:16px; }
  .deadline { flex-direction:column; align-items:flex-start; }
  .count { text-align:left; }
  .anchors,.facts,.team-form,.team-profile,.profile-fields { display:grid; grid-template-columns:minmax(0,1fr); }
  .anchors label { min-width:0; }
  .mhead,.actions,.card-actions { gap:10px; }
  .btn { white-space:normal; }
  .card > h3 { font-size:24px; }
  .board { grid-template-columns:minmax(0,1fr); }
  .stream-item { grid-template-columns:minmax(0,1fr); }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; } }

/* Long document names remain inside their field on narrow screens. */
.main select { max-width:100%; }

.ui-create-matter { width:calc(100% - 24px); min-height:44px; justify-content:center; gap:10px; margin:0 12px 16px; border:1px solid #66b7e3; }
.ui-create-matter.is-active { background:var(--accent-hover); }
.ui-availability p { color:var(--muted); max-width:65ch; }
.ui-availability .tag { margin:8px 0; }
@media(max-width:900px) {
  .sidebar { flex-direction:row; align-items:center; gap:8px; }
  .ui-create-matter { width:auto; flex:none; margin:0; font-size:14px; padding:9px 12px; white-space:nowrap; }
  .sidebar .nav { min-width:0; }
}

/* Product and firm identities remain distinct; original provisional vector mark. */
.pe-product-brand { display:flex; align-items:center; gap:12px; min-width:0; }
.pe-logo { width:44px; height:44px; flex:none; }
.pe-product-name { font-family:"IBM Plex Sans",Inter,sans-serif; font-size:23px; font-weight:650; line-height:1.15; letter-spacing:-.025em; overflow-wrap:anywhere; }
.pe-firm-name { color:var(--muted); font-size:14px; line-height:1.4; margin-top:4px; }
.pe-account-heading { margin:24px 0 16px; }
.account-page .pe-product-brand { margin-bottom:12px; }
.pe-intake-progress { border:1px solid var(--line); border-radius:10px; background:var(--bg); padding:18px; margin:16px 0; }
.pe-intake-progress ul { padding-left:22px; margin:12px 0; }
.pe-intake-progress li { margin:6px 0; }
.pe-progress-counts { display:flex; flex-wrap:wrap; gap:10px 20px; margin:10px 0; }
@media(max-width:540px) { .pe-logo { width:36px; height:36px; } .pe-product-name { font-size:21px; } .pe-firm-name { font-size:12px; } }
