@font-face { font-family: "Crimson Pro"; src: url("fonts/crimson-pro-latin.woff2") format("woff2"); font-weight: 200 900; font-display: block; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin-latin.woff2") format("woff2"); font-weight: 100 900; font-display: block; }

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --navy: #14254a;
  --navy-2: #1f3566;
  --navy-bg: #e8ecf5;
  --ink: #151b2b;
  --ink-2: #4a5268;
  --ink-3: #8a90a0;
  --line: #e7e4dc;
  --line-2: #d8d4ca;
  --gold: #b8955a;
  --green: #2f7a55; --green-bg: #e5f2ea;
  --amber: #a8641b; --amber-bg: #fbefdc;
  --red: #b23b3b; --red-bg: #f8e4e2;
  --serif: "Crimson Pro", Georgia, serif;
  --sans: "Libre Franklin", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 13.5px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; }
button { cursor: pointer; }
img { display: block; }
svg { flex: none; }
.tnum { font-variant-numeric: tabular-nums; }

.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }

/* sidebar */
.side { background: var(--navy); color: #c9d1e4; display: flex; flex-direction: column; padding: 22px 14px 18px; }
.firm { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; margin-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.seal { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold); color: #e9d9b8; display: grid; place-items: center; font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.seal i { font-style: italic; font-weight: 400; color: var(--gold); margin: 0 1px; }
.firm b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 600; color: #fff; letter-spacing: -.005em; line-height: 1.1; }
.firm small { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #8e9ab8; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 10px; border-radius: 8px; font-weight: 500; color: #b4bfd8; }
.side nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side nav a.on { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.badge { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--gold); color: var(--navy); border-radius: 9px; min-width: 20px; height: 18px; display: grid; place-items: center; padding: 0 6px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.me img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }
.me b { display: block; color: #fff; font-weight: 600; font-size: 13px; }
.me small { font-size: 12px; color: #8e9ab8; }

/* topbar */
.work { min-width: 0; display: flex; flex-direction: column; }
.top { height: 64px; display: flex; align-items: center; gap: 20px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-weight: 500; }
.crumbs svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.crumbs b { color: var(--ink); font-weight: 600; }
.search { margin-left: auto; width: 340px; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; outline: none; }
.search input::placeholder { color: var(--ink-3); }
kbd { font-family: var(--sans); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; background: var(--surface); }
.date { color: var(--ink-2); font-family: var(--serif); font-size: 16px; font-style: italic; }

.cols { flex: 1; display: grid; grid-template-columns: 452px 1fr; gap: 20px; padding: 20px 24px 24px; }

/* intake */
.intake { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px 20px; box-shadow: 0 1px 2px rgba(20,37,74,.04), 0 12px 32px -20px rgba(20,37,74,.18); display: flex; flex-direction: column; gap: 16px; }
.in-h { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.in-h h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -.01em; line-height: 1.05; color: var(--navy); margin-top: 4px; }
.steps { display: flex; gap: 4px; margin-bottom: 6px; }
.steps span { width: 22px; height: 4px; border-radius: 2px; background: var(--line); }
.steps .done { background: var(--navy); }
.steps .cur { background: var(--gold); }
.fld { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-size: 11.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; display: flex; justify-content: space-between; }
.lbl em { font-style: normal; color: var(--ink-3); font-weight: 500; }
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); }
.seg button { flex: 1; height: 30px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(20,37,74,.3); }
.sel { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px; font-weight: 500; }
.sel svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-3); stroke-width: 2; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.party { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fcfbf8; min-width: 0; }
.party .role { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-2); }
.party.adv .role { color: var(--red); }
.party b { display: block; font-weight: 600; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party small { display: block; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conflict { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--green-bg); }
.conflict .ok { width: 30px; height: 30px; border-radius: 50%; background: var(--green); display: grid; place-items: center; }
.conflict .ok svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.conflict b { display: block; color: #1e5a3c; font-weight: 700; }
.conflict small { color: #4a7a60; font-size: 12px; }
.conflict a { margin-left: auto; font-weight: 600; color: #1e5a3c; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(30,90,60,.35); }
.docs { list-style: none; border: 1px solid var(--line); border-radius: 10px; }
.docs li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; }
.docs li + li { border-top: 1px solid var(--line); }
.ft { width: 34px; height: 40px; border-radius: 5px; display: grid; place-items: end center; padding-bottom: 5px; font-size: 9px; font-weight: 800; letter-spacing: .04em; color: #fff; position: relative; clip-path: polygon(0 0, 72% 0, 100% 24%, 100% 100%, 0 100%); }
.ft.pdf { background: #c0473f; } .ft.xls { background: #2f7a55; }
.docs b { display: block; font-weight: 600; font-size: 13px; }
.docs small { color: var(--ink-3); font-size: 12px; }
.chk { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--navy-bg); display: grid; place-items: center; }
.chk svg { width: 12px; height: 12px; fill: none; stroke: var(--navy); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > div { display: flex; flex-direction: column; gap: 8px; }
.atty, .fee { height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; }
.atty img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.atty b, .fee b { font-weight: 600; }
.fee { color: var(--ink-2); }
.in-f { margin-top: auto; display: flex; gap: 10px; justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }
.ghost { height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line-2); font-weight: 600; color: var(--ink-2); }
.primary { height: 40px; padding: 0 16px 0 18px; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 6px 16px -8px rgba(20,37,74,.6); }
.primary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary.done { background: var(--green); }

/* tracker */
.tracker { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.kpis > div { padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.kpis > div + div { border-left: 1px solid var(--line); }
.kpis .k { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.kpis .v { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--navy); line-height: 1.1; letter-spacing: -.01em; }
.kpis .d { font-size: 11.5px; color: var(--ink-3); }
.kpis .d.up { color: var(--green); font-weight: 600; }
.kpis .d.warn { color: var(--red); font-weight: 600; }
.tbl-card { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.tbl-h { display: flex; align-items: center; gap: 16px; padding: 14px 18px; }
.tbl-h h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--navy); }
.tabs { display: flex; gap: 2px; }
.tabs button { height: 30px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.tabs button span { color: var(--ink-3); margin-left: 3px; }
.tabs button.on { background: var(--navy-bg); color: var(--navy); font-weight: 600; }
.tabs button.on span { color: var(--navy-2); }
.fbtn { margin-left: auto; height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; font-weight: 500; font-size: 12.5px; }
.fbtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; background: #faf9f6; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
th:nth-child(1) { width: auto; padding-left: 18px; } th:nth-child(2) { width: 50px; } th:nth-child(3) { width: 100px; } th:nth-child(4) { width: 148px; } th:nth-child(5) { width: 62px; } th:nth-child(6) { width: 124px; padding-right: 18px; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
td:first-child { padding-left: 18px; }
td:last-child { padding-right: 18px; }
td b { display: block; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td small { display: block; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.num { text-align: right; }
td.num { font-weight: 600; color: var(--ink); }
b.red { color: var(--red); }
tr.newrow td { background: #fbf8f0; }
tbody tr:hover td { background: #f9f8f4; }
tr.hide { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.risk { background: var(--amber-bg); color: var(--amber); }
.pill.over { background: var(--red-bg); color: var(--red); }
.pill.new { background: #f5ecd9; color: #8a6a2e; }
.pill.wait { background: #eeeef2; color: #5f6578; }
.pill.filed { background: var(--navy-bg); color: var(--navy-2); }
.tbl-f { margin-top: auto; display: flex; justify-content: space-between; padding: 12px 18px; font-size: 12px; color: var(--ink-3); }
.tbl-f b { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.app { height: 100vh; min-height: 0; overflow: hidden; }
.seal { white-space: nowrap; font-size: 13px; letter-spacing: -.04em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cols { grid-template-columns: 432px 1fr; gap: 18px; padding: 18px 22px 20px; min-height: 0; }
.intake { gap: 13px; padding: 18px 22px 18px; }
.in-h { padding-bottom: 12px; }
.in-h h1 { font-size: 28px; }
.docs li { padding: 7px 12px; }
.ft { width: 28px; height: 34px; font-size: 8px; padding-bottom: 4px; }
.conflict { padding: 10px 14px; }
.in-f { padding-top: 12px; }
th:nth-child(2) { width: 44px; } th:nth-child(3) { width: 104px; } th:nth-child(4) { width: 150px; } th:nth-child(5) { width: 58px; } th:nth-child(6) { width: 104px; }
td { padding: 7px 10px; white-space: nowrap; }
.side { padding-top: 20px; }

.seal { display: flex; align-items: center; justify-content: center; }
.fee { white-space: nowrap; gap: 6px; }
.fee span { color: var(--ink-3); }
.notes { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: #fcfbf8; }
.intake { gap: 12px; }
.in-f { padding-top: 12px; }
.intake { gap: 10px; padding-top: 16px; padding-bottom: 16px; }
.in-h { padding-bottom: 10px; }
.docs li { padding: 5px 12px; }
.party { padding: 8px 12px; }
.seg button { height: 28px; }
.sel { height: 36px; }
.atty, .fee { height: 38px; }
.notes { padding: 7px 12px; line-height: 1.45; }
.in-f { padding-top: 10px; }
.seal { font-size: 12px; letter-spacing: -.02em; }

/* No italics anywhere (operator rule): accent words stay upright. */
*, *::before, *::after { font-style: normal !important; }

/* ===================== the working app (multi-page) ===================== */
.mb-chat { --mb-accent: #14254a; }
.side .firm { position: relative; }
.nav-x, .burger { display: none; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 8px; }
.side nav a .ext { margin-left: auto; font-size: 12px; color: #8e9ab8; }
.badge[hidden] { display: none; }
.app.scroll { height: auto; min-height: 100vh; overflow: visible; }
.app.scroll .side { position: sticky; top: 0; height: 100vh; }
.app.scroll .work { min-height: 100vh; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--navy); }
.crumbs b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { min-width: 0; }

/* intake queue picker */
.qpick-wrap { position: relative; min-width: 0; }
.qpick { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; margin-left: -8px; border-radius: 8px; max-width: 100%; }
.qpick:hover, .qpick[aria-expanded="true"] { background: var(--bg); }
.qpick svg { width: 14px; height: 14px; fill: none; stroke: var(--ink-3); stroke-width: 2; }
.qmenu { position: absolute; top: 38px; left: -8px; z-index: 40; width: 340px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(20,37,74,.35); padding: 6px; }
.qmenu button { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; }
.qmenu button:hover, .qmenu button[aria-selected="true"] { background: var(--navy-bg); }
.qmenu b { font-weight: 600; color: var(--ink); }
.qmenu small { grid-column: 1; color: var(--ink-3); font-size: 12px; }
.qmenu em { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 11px; font-weight: 600; color: var(--amber); background: var(--amber-bg); padding: 2px 7px; border-radius: 8px; }
.qnone { padding: 10px; color: var(--ink-3); }

/* intake form controls */
.sel { position: relative; padding: 0; }
.sel select, .atty select { appearance: none; -webkit-appearance: none; font: inherit; color: inherit; background: none; border: 0; width: 100%; height: 100%; padding: 0 34px 0 12px; font-weight: 500; cursor: pointer; outline: none; }
.sel svg { position: absolute; right: 12px; pointer-events: none; }
.atty { position: relative; padding: 0 0 0 10px; gap: 0; }
.atty select { padding-left: 8px; font-weight: 600; }
.atty:focus-within, .sel:focus-within { border-color: var(--navy-2); box-shadow: 0 0 0 3px var(--navy-bg); }
textarea.notes { display: block; width: 100%; resize: none; font: inherit; font-size: 12.5px; color: var(--ink-2); outline: none; }
textarea.notes:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px var(--navy-bg); }
.adddoc { justify-content: center; }
.adddoc button { font-size: 12.5px; font-weight: 600; color: var(--navy-2); padding: 2px 0; }
.primary:disabled { background: #9aa3b8; box-shadow: none; cursor: not-allowed; }
a.primary, a.ghost { display: inline-flex; align-items: center; }
.mini { height: 30px; padding: 0 12px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none; }
.mini.ghosty { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); width: 32px; padding: 0; font-size: 16px; }
.mini:disabled { opacity: .4; cursor: default; }
.linkish { margin-left: auto; font-weight: 600; color: #1e5a3c; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(30,90,60,.35); }
.conflict .mini { margin-left: auto; }
.conflict > div { min-width: 0; }
.conflict.todo { background: #f3f4f7; border-color: var(--line-2); }
.conflict.todo .ok { background: #8a90a0; }
.conflict.todo b { color: var(--ink); } .conflict.todo small { color: var(--ink-3); }
.conflict.hit { background: var(--amber-bg); border-color: #efd4ac; }
.conflict.hit .ok { background: var(--amber); }
.conflict.hit b { color: #7a4710; } .conflict.hit small { color: #8a5a22; display: block; }
.conflict.hit .mini { background: var(--amber); }
.conflict.run { background: var(--navy-bg); border-color: #d2d9ea; }
.conflict.run b { color: var(--navy); } .conflict.run small { color: var(--ink-2); }
.spin { background: transparent !important; border: 3px solid #c6cfe3; border-top-color: var(--navy); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.report { margin-top: -4px; padding: 10px 14px; background: var(--green-bg); border-radius: 10px; font-size: 12.5px; color: var(--ink-2); }
.report ul { list-style: none; margin: 6px 0; display: grid; gap: 2px; }
.report em { color: var(--ink-3); font-size: 11.5px; margin-left: 4px; }
.report small { color: var(--ink-3); }
.empty-q { margin: auto; text-align: center; display: grid; justify-items: center; gap: 10px; padding: 40px 0; }
.empty-q h1 { font-family: var(--serif); font-size: 28px; color: var(--navy); font-weight: 600; }
.empty-q p { color: var(--ink-3); }
.seal.big { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--gold); color: var(--navy); font-family: var(--serif); font-size: 20px; font-weight: 600; }
.tbl-f { justify-content: flex-start; gap: 28px; }
td a { display: block; min-width: 0; }
tbody tr[data-id] { cursor: pointer; }
td.none { text-align: center; padding: 28px; color: var(--ink-3); white-space: normal; }
b.lt { font-weight: 500 !important; color: var(--ink-2) !important; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; box-shadow: 0 12px 30px -10px rgba(20,37,74,.6); transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* pages */
.pg { padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pg-head h1 { font-family: var(--serif); font-size: 32px; font-weight: 600; color: var(--navy); line-height: 1.05; letter-spacing: -.01em; }
.sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.pg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.mcard { overflow: hidden; }
.fbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs.wrap { flex-wrap: wrap; }
.fsel { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.selbox { position: relative; display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.selbox::after { content: ""; position: absolute; right: 10px; top: 12px; width: 6px; height: 6px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(45deg); pointer-events: none; }
.selbox select { appearance: none; -webkit-appearance: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink); background: none; border: 0; height: 100%; padding: 0 28px 0 10px; outline: none; cursor: pointer; }
.selbox:focus-within { border-color: var(--navy-2); box-shadow: 0 0 0 3px var(--navy-bg); }
.selbox.av { padding-left: 6px; }
.selbox.av img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.mtable.full th:nth-child(3) { width: 140px; } .mtable.full th:nth-child(4) { width: 190px; } .mtable.full th:nth-child(6) { width: 128px; }
.pillsel { position: relative; display: inline-flex; align-items: center; height: 26px; border-radius: 13px; font-size: 12px; font-weight: 600; }
.pillsel::before { content: ""; position: absolute; left: 10px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pillsel::after { content: ""; position: absolute; right: 9px; top: 9px; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); pointer-events: none; }
.pillsel select { appearance: none; -webkit-appearance: none; font: inherit; color: inherit; background: none; border: 0; height: 100%; padding: 0 24px 0 22px; cursor: pointer; outline: none; }
.pillsel:focus-within { box-shadow: 0 0 0 2px var(--navy-2); }
.pillsel.ok { background: var(--green-bg); color: var(--green); } .pillsel.risk { background: var(--amber-bg); color: var(--amber); }
.pillsel.over { background: var(--red-bg); color: var(--red); } .pillsel.new { background: #f5ecd9; color: #8a6a2e; }
.pillsel.wait { background: #eeeef2; color: #5f6578; } .pillsel.filed { background: var(--navy-bg); color: var(--navy-2); }
.rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.feed-card { padding: 14px 14px 12px; }
.feed-card .mb-feed-list li { background: #faf9f6; border: 1px solid var(--line); }
.feed-card .mb-ico { background: var(--navy-bg); color: var(--navy); }
.soon { padding: 14px 6px 8px; }
.soon h2 { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--navy); padding: 0 10px 6px; }
.soon ol { list-style: none; }
.soon a { display: grid; grid-template-columns: 52px minmax(0, 1fr) 26px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; }
.soon a:hover { background: var(--bg); }
.soon .when { font-weight: 700; color: var(--navy); font-size: 12.5px; }
.soon .when.red { color: var(--red); } .soon .when.amber { color: var(--amber); }
.soon b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soon small { display: block; color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soon img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.none { color: var(--ink-3); padding: 10px; }

/* matter detail */
.mhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 20px 22px; flex-wrap: wrap; }
.mh-l { min-width: 0; }
.mhead h1 { font-family: var(--serif); font-size: 32px; font-weight: 600; color: var(--navy); line-height: 1.05; margin-top: 4px; }
.mhead .sub { font-size: 14px; color: var(--ink-2); }
.vs { color: var(--gold); font-family: var(--serif); font-size: 16px; margin: 0 2px; }
.mh-r { display: flex; gap: 12px; flex-wrap: wrap; }
.fieldsel { display: grid; gap: 4px; }
.fieldsel > span:first-child { font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
.fieldsel .pillsel { height: 32px; border-radius: 16px; }
.fieldsel .pillsel::after { top: 12px; }
.dgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sec { padding: 16px 18px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.sec-h h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--navy); }
.cnt { font-size: 12px; color: var(--ink-3); }
.cnt b { color: var(--ink); }
.dl { list-style: none; display: grid; gap: 6px; }
.dl li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.dl li b { font-weight: 600; display: block; }
.dl li small { color: var(--ink-3); font-size: 12px; }
.dl li.late { border-color: #efc9c5; background: #fdf6f5; }
.dl li.soon { border-color: #efd9b6; background: #fffaf2; }
.dl li.done b { text-decoration: line-through; color: var(--ink-3); font-weight: 500; }
.tag { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.late .tag { color: var(--red); } .soon .tag { color: var(--amber); } .done .tag { color: var(--green); }
.cb { position: relative; width: 22px; height: 22px; cursor: pointer; }
.cb input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cb span:first-of-type { display: block; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: #fff; }
.cb input:checked + span { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 3px var(--green); }
.cb input:checked + span::after { content: "✓"; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; height: 100%; margin-top: -1px; }
.cb input:focus-visible + span { box-shadow: 0 0 0 3px var(--navy-bg); }
.addrow { display: flex; gap: 8px; margin-top: 10px; }
.addrow input { height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none; min-width: 0; background: #fff; }
.addrow input[type="text"] { flex: 1; }
.addrow input[type="date"] { width: 150px; }
.addrow input[type="number"] { width: 72px; }
.addrow input:focus, .addnote textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px var(--navy-bg); }
.addrow .mini { height: 34px; }
.addnote { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin-bottom: 12px; }
.addnote textarea { resize: none; border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; background: #fcfbf8; }
.nlist { list-style: none; display: grid; gap: 12px; }
.nlist li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.nlist img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; }
.nlist b { font-weight: 600; font-size: 13px; }
.nlist b small { font-weight: 500; color: var(--ink-3); margin-left: 4px; font-size: 12px; }
.nlist p { color: var(--ink-2); font-size: 13px; line-height: 1.5; margin-top: 2px; }
.facts dl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.facts dt { color: var(--ink-3); font-weight: 500; }
.facts dd { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.facts dd small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12px; }
.okline { color: var(--green) !important; font-weight: 600 !important; }
.sec .docs b { overflow-wrap: anywhere; }
.tlist { list-style: none; display: grid; }
.tlist li { display: grid; grid-template-columns: 52px minmax(0, 1fr) 40px; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.tlist li > span:first-child { color: var(--ink-3); font-size: 12px; }
.tlist small { display: block; color: var(--ink-3); font-size: 12px; }
.tlist b { text-align: right; font-weight: 600; }
.tlist .prior { color: var(--ink-3); }

/* attorney filter buttons */
.who { display: flex; gap: 6px; }
.who.wrap { flex-wrap: wrap; }
.who button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 500; }
.who button img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; margin-left: -6px; }
.who button.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* calendar */
.cal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.month { padding: 14px 16px 16px; }
.mnav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.mnav h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--navy); min-width: 170px; text-align: center; }
.legend { margin-left: auto; display: flex; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: -6px; }
.legend i.k-dl, .ev.k-dl { background: var(--navy-bg); color: var(--navy); }
.legend i.k-late, .ev.k-late { background: var(--red-bg); color: var(--red); }
.legend i.k-consult, .ev.k-consult { background: #f5ecd9; color: #7a5a1e; }
.legend i.k-firm, .ev.k-firm { background: #eeeef2; color: #5f6578; }
.ev.k-done { background: var(--green-bg); color: var(--green); text-decoration: line-through; }
.dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 0 0 6px; }
.dow span { padding-left: 8px; }
.cells { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cell { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; outline: none; }
.cell:hover { background: #fbfaf7; }
.cell:focus-visible { box-shadow: inset 0 0 0 2px var(--navy-2); }
.cell.pad { background: #faf9f6; cursor: default; }
.cell .dn { font-size: 12px; font-weight: 600; color: var(--ink-2); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cell.today .dn { background: var(--gold); color: #fff; }
.cell.sel { background: var(--navy-bg); }
.cell.sel .dn { background: var(--navy); color: #fff; }
.ev { display: block; font-size: 11.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.fresh { box-shadow: 0 0 0 2px var(--gold); }
.more { font-size: 11px; color: var(--ink-3); padding-left: 6px; }
.agenda { display: none; }
.dayp { padding: 16px; position: sticky; top: 16px; }
.dayp h2 { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--navy); }
.dlist { display: grid; gap: 8px; margin-top: 12px; }
.dlist .ev, .agenda .ev { white-space: normal; padding: 8px 10px; font-size: 13px; border-radius: 8px; }
.dlist .ev small, .agenda .ev small { display: block; font-weight: 500; opacity: .85; font-size: 12px; margin-top: 2px; }

/* clients */
.ctable th:nth-child(1) { width: auto; } .ctable th:nth-child(2) { width: 240px; } .ctable th:nth-child(3) { width: 130px; } .ctable th:nth-child(4) { width: 80px; } .ctable th:nth-child(5) { width: 110px; padding-right: 18px; }
.ctable tr[data-c] { cursor: pointer; }
.ctable tr.on td { background: var(--navy-bg); }
.ctable td:nth-child(2) small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-row td { background: #fbfaf7; padding: 6px 18px 12px; white-space: normal; }
.sub-row ul { list-style: none; display: grid; gap: 6px; }
.sub-row a { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.sub-row a:hover { border-color: var(--navy-2); }
.sub-row img { box-shadow: none; }

/* ===================== phone & tablet ===================== */
@media (max-width: 1180px) {
  .pg-grid, .cal-grid { grid-template-columns: minmax(0, 1fr); }
  .rail, .dayp { position: static; }
  .cols { grid-template-columns: minmax(0, 1fr) !important; }
  .app { height: auto; overflow: visible; }
  .app .side { position: sticky; top: 0; height: 100vh; }
}
@media (max-width: 900px) {
  .app, .app.scroll { display: block; }
  .app .side, .app.scroll .side { position: fixed; top: 0; left: 0; bottom: 0; height: 100%; width: min(300px, 84vw); z-index: 70; transform: translateX(-102%); transition: transform .25s ease, box-shadow .25s; overflow-y: auto; }
  .nav-open .side { transform: none; box-shadow: 20px 0 40px -20px rgba(0,0,0,.4); }
  .scrim { position: fixed; inset: 0; z-index: 65; background: rgba(12,20,40,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .nav-x { display: grid; place-items: center; margin-left: auto; width: 40px; height: 40px; border-radius: 10px; color: #c9d1e4; font-size: 24px; }
  .side nav a { height: 44px; }
  .burger { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); flex: none; }
  .burger svg { width: 20px; height: 20px; fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; }
  .top { height: auto; min-height: 60px; padding: 10px 16px; gap: 10px; flex-wrap: wrap; position: sticky; top: 0; z-index: 30; }
  .crumbs { flex: 1; }
  .date, kbd { display: none; }
  .search { order: 3; width: 100%; margin-left: 0; }
  .cols { padding: 14px 16px 90px; gap: 14px; }
  .pg { padding: 16px 16px 90px; }
  .intake { padding: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis > div:nth-child(3) { border-left: 0; }
  .kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tbl-h { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .tabs { flex-wrap: wrap; }
  .fbtn { margin-left: 0; }
  .fsel { margin-left: 0; width: 100%; }
  .fsel .selbox { flex: 1; }
  .fsel .selbox select { width: 100%; }
  /* matter tables become cards */
  .mtable, .mtable tbody, .ctable, .ctable tbody { display: block; }
  .mtable thead, .ctable thead { display: none; }
  .mtable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .mtable td { display: block; padding: 0 !important; border: 0; background: none !important; white-space: normal; box-shadow: none !important; }
  .mtable td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .mtable td:nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; }
  .mtable td:nth-child(3) { display: none; }
  .mtable td:nth-child(4) { grid-column: 1; grid-row: 2; }
  .mtable td:nth-child(4) b, .mtable td:nth-child(4) small { display: inline; }
  .mtable td:nth-child(4) small::before { content: " · "; }
  .mtable td:nth-child(5) { display: none; }
  .mtable td:nth-child(6) { grid-column: 2; grid-row: 2; justify-self: end; }
  .mtable tr.newrow { background: #fbf8f0; }
  .mtable td.none { grid-column: 1 / -1; }
  .ctable tr[data-c] { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .ctable td { display: block; padding: 0 !important; border: 0; white-space: normal; background: none !important; }
  .ctable tr.on { background: var(--navy-bg); }
  .ctable td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .ctable td:nth-child(2) span, .ctable td:nth-child(2) small { display: inline; }
  .ctable td:nth-child(2) small::before { content: " · "; }
  .ctable td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; }
  .ctable td:nth-child(4), .ctable td:nth-child(5) { display: none; }
  .sub-row { display: block; }
  .sub-row td { display: block; padding: 8px 12px 12px; }
  .dgrid { grid-template-columns: minmax(0, 1fr); }
  .mhead { padding: 16px; }
  .mhead h1, .pg-head h1 { font-size: 26px; }
  .mh-r { width: 100%; }
  .addrow { flex-wrap: wrap; }
  .addrow input[type="text"] { flex: 1 1 100%; }
  .addrow input[type="date"] { flex: 1; width: auto; }
  .month .dow, .month .cells, .legend { display: none; }
  .agenda { display: grid; gap: 14px; list-style: none; }
  .agenda h3 { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
  .agenda h3.today { color: var(--gold); }
  .agenda li { display: grid; gap: 6px; }
  .dayp { display: none; }
  .mnav h2 { min-width: 0; flex: 1; }
  .qmenu { left: -60px; }
}
@media (max-width: 520px) {
  .parties, .row2 { grid-template-columns: 1fr; }
  .seg { flex-wrap: wrap; }
  .seg button { flex: 1 1 30%; }
  .in-h h1 { font-size: 24px; }
  .in-f { flex-wrap: wrap; }
  .in-f > * { flex: 1; justify-content: center; }
  .kpis .v { font-size: 24px; }
  .kpis > div { padding: 12px 14px; }
  .conflict { flex-wrap: wrap; }
  .conflict .mini { margin-left: 42px; }
  .mh-r .fieldsel { flex: 1 1 40%; }
  .mh-r .selbox, .mh-r .pillsel { width: 100%; }
  .mh-r select { width: 100%; }
  .tbl-f { flex-wrap: wrap; gap: 4px 16px; }
}
.app:not(.scroll) { grid-template-rows: 100vh; }
@media (min-width: 901px) { .crumbs { flex: none; max-width: 46%; } }
.addf { font-size: 11.5px; font-weight: 600; color: var(--navy-2); }
.addf:hover { text-decoration: underline; }
.nodocs { font-size: 12.5px; color: var(--ink-3); padding: 9px 12px; border: 1px dashed var(--line-2); border-radius: 10px; }
.ft.doc { background: #2f5aa8; }
@media (min-width: 901px) { .qpick { max-width: none; } .qpick b { overflow: visible; text-overflow: clip; } .crumbs { max-width: none; } }
@media (max-width: 900px) { .app .side, .app.scroll .side { visibility: hidden; transition: transform .25s ease, visibility 0s .25s; } .nav-open .app .side { visibility: visible; transition: transform .25s ease; } }
