/* Layout + components. Tokens live in tokens.css. */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 450; /* slightly heavier per CJ; falls back gracefully */
}
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- app chrome ---------- */
#root { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 10px 20px;
}
.topbar .brand { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.topbar .brand .sys { color: var(--muted); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--muted); }
.topbar .who b { color: var(--ink); font-weight: 600; }

.page { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.page.narrow { max-width: 560px; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px;
  padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 22px;
}
.page-head h1 { font-size: 21px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.page-head .subtitle { font-size: 14px; color: var(--muted); margin-top: 4px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  font-size: 14px; font-weight: 600; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 14px; cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #263d68; }
.btn.danger { color: var(--rev); border-color: var(--rev-line); }
.btn.danger:hover { background: var(--rev-bg); }
.btn.quiet { font-weight: 500; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 13px; }

/* ---------- cards / forms ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; margin: 0 0 14px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input[type=text], .field input[type=password], .field select, .field textarea {
  font: inherit; width: 100%; padding: 9px 11px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
}
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.form-error { color: var(--rev); font-size: 14px; margin-top: 10px; min-height: 18px; }
.hint { font-size: 13px; color: var(--muted); }

/* ---------- status chips (triad pattern) ---------- */
.chip {
  display: inline-block; font-size: 12px; font-weight: 650; border-radius: 999px;
  padding: 3px 10px; border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  white-space: nowrap;
}
.chip.done   { background: var(--done-bg); border-color: var(--done-line); color: var(--done); }
.chip.review { background: var(--rev-bg);  border-color: var(--rev-line);  color: var(--rev); }
.chip.pend   { background: var(--pend-bg); border-color: var(--pend-line); color: var(--pend); }
.chip.off    { background: var(--off-bg);  border-color: var(--off-line);  color: var(--off); }
.chip.accent { background: var(--accent-bg); border-color: #b9c6dd; color: var(--accent); }

/* ---------- tables ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.list td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.rowlink { cursor: pointer; }
table.list tr.rowlink:hover td { background: var(--accent-bg); }

/* ---------- login ---------- */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 400px; max-width: 100%; }
.login-card .brand-block { text-align: center; margin-bottom: 22px; }
.login-card .brand-block h1 { font-size: 23px; margin: 0; font-weight: 650; }
.login-card .brand-block .subtitle { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- all cases ---------- */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.case-card {
  text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .12s;
}
.case-card:hover { border-color: var(--accent); }
.case-card .cname { font-size: 16px; font-weight: 650; margin-bottom: 4px; }
.case-card .cmeta { font-size: 13px; color: var(--muted); }
.case-card .cchips { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.empty { font-size: 14px; color: var(--muted); font-style: italic; padding: 8px 2px; }

/* ---------- workspace shell ---------- */
.ws { flex: 1; display: flex; min-height: 0; }
.ws-rail {
  width: 230px; flex: none; background: var(--card); border-right: 1px solid var(--line);
  padding: 14px 10px 24px; overflow-y: auto;
}
.ws-rail .rail-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: 6px 10px 8px;
}
.ws-rail button.pane-link {
  display: block; width: 100%; text-align: left;
  font-size: 14px; color: var(--ink); background: none; border: none;
  border-radius: 6px; padding: 8px 10px; cursor: pointer; margin-bottom: 1px;
}
.ws-rail button.pane-link:hover { background: var(--bg); }
.ws-rail button.pane-link.active { background: var(--accent-bg); color: var(--accent); font-weight: 650; }
.ws-main { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px 80px; }

.ws-head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.ws-head .case-name { font-size: 19px; font-weight: 650; }
.ws-head .case-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

.stub {
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  background: var(--card); padding: 40px 24px; text-align: center; color: var(--muted);
}
.stub .stub-title { font-size: 16px; font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.stub .stub-note { font-size: 14px; max-width: 460px; margin: 0 auto; }

/* ---------- future-tools switcher ---------- */
.tools-rail { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.tools-rail .tools-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-right: 4px; }
.tool-tab {
  font-size: 13px; font-weight: 600; border-radius: 999px; padding: 5px 13px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer;
  white-space: nowrap;
}
.tool-tab.active { background: var(--accent-bg); border-color: #b9c6dd; color: var(--accent); }
.tool-tab:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- compact stepper (from prototype — keep) ---------- */
.stepper { display: inline-flex; align-items: stretch; height: 34px; }
.stepper input {
  font: inherit; font-size: 15px; text-align: center; width: 46px; padding: 0 4px;
  border: 1px solid var(--line); border-right: none; border-radius: 7px 0 0 7px;
  color: var(--ink); background: var(--bg);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.stepper .arrows { display: flex; flex-direction: column; width: 26px; border: 1px solid var(--line); border-radius: 0 7px 7px 0; overflow: hidden; }
.stepper .arrows button {
  flex: 1; width: 100%; border: none; background: var(--card); cursor: pointer;
  color: var(--muted); font-size: 7px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.stepper .arrows button:first-child { border-bottom: 1px solid var(--line); }
.stepper .arrows button:hover { background: var(--bg); color: var(--ink); }
.stepper .arrows button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- status dots ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; vertical-align: 1px; }
.dot.green  { background: var(--done);  box-shadow: 0 0 0 3px var(--done-bg); }
.dot.yellow { background: var(--pend);  box-shadow: 0 0 0 3px var(--pend-bg); }
.dot.red    { background: var(--rev);   box-shadow: 0 0 0 3px var(--rev-bg); }
.dot.grey   { background: var(--off-line); box-shadow: 0 0 0 3px var(--off-bg); }

/* ---------- milestone bars ---------- */
.mbar-wrap { min-width: 160px; }
.mbar { display: flex; gap: 3px; height: 12px; }
.mseg { flex: 1; border-radius: 3px; background: var(--bg); border: 1px solid var(--line); transition: background .25s, border-color .25s; }
.mseg.done { background: var(--done-bg); border-color: var(--done-line); }
.mseg.skipped {
  background: repeating-linear-gradient(45deg, var(--off-bg), var(--off-bg) 3px, var(--card) 3px, var(--card) 6px);
  border-color: var(--off-line);
}
.mbar-label { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---------- banners ---------- */
.banner { border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 16px; font-weight: 600; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid; }
.banner .spacer { flex: 1; }
.banner.done { background: var(--done-bg); border-color: var(--done-line); color: var(--done); }
.banner.locked { background: var(--off-bg); border-color: var(--off-line); color: var(--off); }

/* ---------- dashboard ---------- */
.scope-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.scope-item { display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.scope-item.on { background: var(--done-bg); border-color: var(--done-line); color: var(--done); font-weight: 600; }
.scope-item input { accent-color: var(--done); }
.scope-item.disabled { opacity: .6; cursor: not-allowed; }

.tool-progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tp-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
.tp-card.offscope { opacity: .55; }
.tp-title { font-size: 13px; font-weight: 650; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tp-title .chip { font-size: 11px; padding: 2px 8px; }

/* party rows: undecided items call attention; decided items recede */
.party-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.party-row:last-child { border-bottom: none; }
.party-row .ptype { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; width: 210px; flex: none; }
.party-row .pname { font-weight: 600; flex: 1; }
.party-row .pname.unnamed { color: var(--rev); font-style: italic; font-weight: 650; }
.party-row .pacts { display: flex; gap: 6px; }

/* ---------- upload tool ---------- */
.up-cols { display: flex; gap: 0; align-items: stretch; min-height: 0; }
.up-main { flex: 1; min-width: 0; }
.up-side {
  flex: none; width: 300px; min-width: 180px; max-width: 560px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 18px; overflow-y: auto; max-height: 76vh; box-shadow: var(--shadow);
}
.up-splitter { flex: none; width: 12px; cursor: col-resize; display: flex; align-items: center; justify-content: center; }
.up-splitter::before { content: ''; width: 3px; height: 48px; border-radius: 2px; background: var(--line); }
.up-splitter:hover::before { background: var(--accent); }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius-lg); background: var(--bg);
  padding: 34px 20px; text-align: center; color: var(--muted); font-size: 14px;
  transition: border-color .12s, background .12s;
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.dropzone .dz-hint { margin-top: 6px; font-size: 13px; }
.upload-msg { font-size: 14px; color: var(--done); font-weight: 600; min-height: 18px; margin-top: 10px; }

.cat-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cat-row:last-child { border-bottom: none; }
.cat-row .cat-label { flex: 1; display: flex; align-items: center; gap: 9px; }
.cat-row .cat-count { color: var(--muted); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: none; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 600; padding: 5px 9px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on-complete { background: var(--done-bg); color: var(--done); }
.seg button.on-incomplete { background: var(--pend-bg); color: var(--pend); }
.seg button.on-none { background: var(--rev-bg); color: var(--rev); }

details.doc-cat { border-bottom: 1px solid var(--line); }
details.doc-cat:last-child { border-bottom: none; }
details.doc-cat summary {
  display: flex; align-items: center; gap: 10px; padding: 10px 4px;
  font-size: 14px; font-weight: 600; cursor: pointer; list-style: none;
}
details.doc-cat summary::-webkit-details-marker { display: none; }
details.doc-cat summary::before { content: '▸'; color: var(--muted); font-size: 12px; transition: transform .12s; }
details.doc-cat[open] summary::before { transform: rotate(90deg); }
details.doc-cat summary .cat-count { color: var(--muted); font-weight: 500; font-size: 13px; }
.doc-row { display: flex; align-items: center; gap: 9px; padding: 6px 4px 6px 26px; font-size: 14px; border-top: 1px dashed var(--line); }
.doc-row .doc-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.doc-row .doc-size { color: var(--muted); font-size: 12px; white-space: nowrap; }
.doc-row .doc-del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.doc-row .doc-del:hover { color: var(--rev); background: var(--rev-bg); }

.side-cat { margin-bottom: 14px; }
.side-cat .side-cat-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.side-cat ul { margin: 0; padding-left: 16px; }
.side-cat li { font-size: 13px; margin-bottom: 3px; overflow-wrap: anywhere; }
.side-cat .side-empty { font-size: 13px; color: var(--muted); font-style: italic; }

/* trial schedule rows (dashboard) */
.sched-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.sched-row:last-child { border-bottom: none; }
.sched-row .sched-label { width: 200px; flex: none; font-weight: 600; }
.sched-row .sched-fields { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* proof chart outline */
.pc-row { display: flex; align-items: center; gap: 10px; padding: 4px 2px; border-radius: 6px; }
.pc-row:hover { background: var(--bg); }
.pc-row .pc-bullet { color: var(--accent); flex: none; width: 14px; text-align: center; }
.pc-row .pc-text { flex: 1; min-width: 0; padding: 3px 6px; border-radius: 4px; outline-offset: 0; }
.pc-row .pc-text:focus { background: var(--card); outline: 2px solid var(--accent); }
.pc-row .pc-acts { display: none; gap: 3px; flex: none; }
.pc-row:hover .pc-acts, .pc-row:focus-within .pc-acts { display: inline-flex; }

/* deposition designations — 3-column layout */
.dep-cols { display: flex; gap: 14px; align-items: flex-start; min-height: 0; }
.dep-left { flex: none; width: 250px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; max-height: 82vh; overflow-y: auto; }
.dep-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; box-shadow: var(--shadow); }
.dep-tagbtn {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 13px;
  background: none; border: none; border-radius: 5px; padding: 4px 7px; cursor: pointer; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dep-tagbtn:hover { background: var(--bg); }
.dep-tagbtn.on { background: var(--done-bg); color: var(--done); font-weight: 600; }
.dep-center {
  flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 22px; box-shadow: var(--shadow);
  max-height: 82vh; overflow-y: auto; font-family: "Courier New", Courier, monospace; font-size: 14px;
}
.dep-pagehead { text-align: center; color: var(--muted); font-weight: 700; padding: 14px 0 6px; user-select: none; }
.dep-line { display: flex; gap: 12px; padding: 1px 4px; border-radius: 3px; }
.dep-line .dep-ln { flex: none; width: 24px; text-align: right; color: var(--muted); user-select: none; font-size: 12px; padding-top: 1px; }
.dep-line .dep-txt { flex: 1; white-space: pre-wrap; }
.dep-line.designated { background: #fdf3c9; }
.dep-line.designated .dep-txt { }
.dep-right { flex: none; width: 330px; position: sticky; top: 0; max-height: 82vh; overflow-y: auto; }
.dep-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow);
}
.dep-tile:hover { border-color: var(--accent); }
.dep-tile.active { border-color: var(--accent); outline: 2px solid var(--accent-bg); background: var(--accent-bg); }
.dep-pop {
  position: absolute; z-index: 60; background: var(--card); border: 1px solid var(--accent);
  border-radius: 8px; padding: 5px; box-shadow: 0 4px 14px rgba(28,34,48,.2);
}

/* exhibit list — spreadsheet-like */
.ex-table { display: flex; flex-direction: column; }
.ex-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.ex-row:hover:not(.ex-header) { background: var(--accent-bg); }
.ex-row.ex-header { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; cursor: default; background: none; }
.ex-row.ex-header:hover { background: none; }
.ex-row.dragging { opacity: .4; }
.ex-row.drag-over { border-top: 2px solid var(--accent); }
.ex-row.inactive { opacity: .5; background: var(--off-bg); cursor: pointer; }
.ex-row.combine-sel { background: var(--done-bg); }
.ex-num { flex: none; width: 44px; padding: 8px 6px; text-align: center; font-weight: 650; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.ex-name { flex: 1; min-width: 0; padding: 8px 10px; border-left: 1px solid var(--line); }
.ex-name .ex-title { font-weight: 600; overflow-wrap: anywhere; }
.ex-name .ex-bates { font-size: 12px; color: var(--muted); }
.ex-label { flex: 1.1; min-width: 0; padding: 8px 10px; border-left: 1px solid var(--line); color: var(--ink); overflow-wrap: anywhere; display: flex; align-items: center; }
.ex-stats { flex: none; display: flex; border-left: 1px solid var(--line); }
.ex-stat { width: 34px; border: none; border-right: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; color: var(--ink); font-size: 14px; }
.ex-header .ex-stats span { width: 34px; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--line); padding: 8px 0; }
.ex-stat.on-green { background: var(--done-bg); color: var(--done); }
.ex-stat.on-x { background: var(--rev-bg); color: var(--rev); }
.ex-acts { flex: none; width: 150px; display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-left: 1px solid var(--line); justify-content: flex-end; }
.ex-inactive-head { padding: 10px; margin-top: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--off-bg); border-radius: 6px; }

/* split grid */
.split-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; margin-top: 12px; max-height: 320px; overflow-y: auto; }
.split-cell { padding: 10px 4px; border: 1px solid var(--line); background: var(--bg); border-radius: 6px; cursor: pointer; font: inherit; font-variant-numeric: tabular-nums; }
.split-cell.sel { background: var(--done-bg); border-color: var(--done-line); color: var(--done); font-weight: 700; }

/* pdf viewer */
.viewer-canvas-wrap { position: relative; display: inline-block; border: 1px solid var(--line); max-width: 100%; overflow: auto; cursor: crosshair; }
.viewer-canvas-wrap canvas { display: block; }
.viewer-box { position: absolute; border: 2px solid #d3352e; background: rgba(211,53,46,.12); pointer-events: none; }

/* witness list */
.wit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.wit-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow); cursor: pointer; }
.wit-tile:hover { border-color: var(--accent); }
.wit-name { font-weight: 650; font-size: 15px; color: var(--accent); }
.wit-call { font: inherit; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 10px; border: 1px solid; cursor: pointer; white-space: nowrap; }
.wit-call.will { background: var(--done-bg); border-color: var(--done-line); color: var(--done); }
.wit-call.may { background: var(--pend-bg); border-color: var(--pend-line); color: var(--pend); }
.wit-contact { font-size: 13px; color: var(--muted); margin-top: 8px; white-space: pre-wrap; }
.wit-conn { font-size: 13px; margin-top: 6px; max-height: 60px; overflow: hidden; }
.wit-tilefoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.wit-methods { display: flex; gap: 10px; }
.wit-method-opt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; }
.wit-time { font-size: 13px; color: var(--muted); font-weight: 600; }
.wit-typechip { margin-top: 8px; }
.wit-profile .rte { min-height: 60px; border: 1px solid var(--line); border-radius: 0 0 6px 6px; padding: 8px 10px; background: var(--bg); font: inherit; }
.wit-profile .rte:focus { outline: 2px solid var(--accent); }
.rte-bar { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-bottom: none; border-radius: 6px 6px 0 0; background: var(--card); }
.rte-bar .btn { padding: 2px 9px; }
.avail-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.avail-cell { border: 1px solid var(--line); border-radius: 6px; padding: 6px; cursor: pointer; font-size: 12px; }
.avail-cell .avail-date { font-weight: 600; }
.avail-cell .avail-event { color: var(--accent); font-weight: 600; font-size: 11px; }
.avail-cell .avail-state { text-transform: capitalize; font-size: 11px; margin-top: 2px; }
.avail-cell.state-unavailable { background: var(--off-bg); color: var(--muted); }
.avail-cell.state-likely { background: var(--pend-bg); color: var(--pend); }
.avail-cell.state-confirmed { background: var(--done-bg); color: var(--done); }

/* motions in limine */
.mil-card .mil-num { font-weight: 700; color: var(--accent); white-space: nowrap; }
.mil-research { background: var(--accent-bg); border: 1px solid #b9c6dd; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.mil-research-head { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.mil-draft { min-height: 140px; }

/* create filings — QC + exports */
.qc-flag { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--rev-line); background: var(--rev-bg); border-radius: 6px; margin-bottom: 6px; font-size: 14px; cursor: pointer; }
.qc-flag input { margin-top: 3px; flex: none; }
.qc-note { font-size: 13px; color: var(--muted); padding: 4px 10px; }
.export-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.export-row:last-child { border-bottom: none; }

/* trial scheduling — grid calendar */
.sched-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px; }
.sched-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.sched-swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sched-ominous-legend { color: var(--rev); font-weight: 600; }
.sched-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sched-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; text-align: center; padding: 4px 0; }
.sched-cell { min-height: 84px; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: var(--card); }
.sched-cell.weekend { background: var(--bg); }
.sched-daynum { font-size: 12px; color: var(--muted); font-weight: 600; }
.sched-ev { font-size: 11px; border-radius: 4px; padding: 2px 5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-ev.court { background: #d5dced; color: #2f4a7c; font-weight: 600; }
.sched-ev.court.tentative { opacity: .6; font-style: italic; }
.sched-ev.p-expert { background: #cfe0f7; color: #1c4e87; }
.sched-ev.p-fact { background: #d7ecd9; color: #2c6b3f; }
.sched-ev.defense { background: #e3d4f2; color: #5b2a86; }
.sched-ev.thirdparty { background: var(--off-bg); color: var(--off); }
.sched-ev.ominous { border: 2px solid #b3140c; color: #b3140c; font-weight: 700; }
.sched-swatch.court { background: #d5dced; } .sched-swatch.p-expert { background: #cfe0f7; } .sched-swatch.p-fact { background: #d7ecd9; } .sched-swatch.defense { background: #e3d4f2; } .sched-swatch.thirdparty { background: var(--off-bg); }
.plead-cat { margin-bottom: 12px; }
.plead-cat-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.plead-cat ul { margin: 0; padding-left: 18px; } .plead-cat li { font-size: 13px; margin-bottom: 2px; }

/* rail: scope-disabled panes */
.ws-rail button.pane-link:disabled { color: var(--off-line); cursor: not-allowed; background: none; }
.ws-rail .leave-btn { margin: 2px 10px 12px; width: calc(100% - 20px); }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(28,34,48,.42);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 40;
}
.modal { background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--line); width: 480px; max-width: 100%; max-height: 82vh; overflow-y: auto; padding: 22px; }
.modal h2 { margin-top: 0; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
