:root {
  --pre: #f0c00c; --pre-ink: #7a5a00; --pre-soft: #fdf5d2; --ret: #243c80; --ret-soft: #e6ebf6;
  --bg: #f4f5f7; --panel: #ffffff; --text: #1d2330; --muted: #667085; --line: #e3e6ec;
  --accent: #243c80; --accent-soft: #e6eef9; --good: #1e7a46; --good-soft: #e3f4ea;
  --warn: #9a6200; --warn-soft: #fdf3dc; --bad: #a12c2c; --bad-soft: #fbe6e6;
  --gold: #b07d12; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1b1f27; --text: #e6e9ef; --muted: #9aa3b2; --line: #2b313c;
    --accent: #7aa7e6; --accent-soft: #1f2c40; --good: #5cc48a; --good-soft: #17301f;
    --warn: #e2b04a; --warn-soft: #33290f; --bad: #ef7f7f; --bad-soft: #3a1c1c;
    --gold: #e2b04a; --shadow: none; color-scheme: dark;
    --pre: #f0c00c; --pre-ink: #f4cf45; --pre-soft: #3a300a; --ret: #5b8fd6; --ret-soft: #1f2c40;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1, h2 { margin: 0; }
.muted, .sub, .note { color: var(--muted); }

.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15;   /* above an enlarged panel (10), so search and dial lists show over it */ flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); }
.links { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.links a { color: var(--muted); } .links a.on { color: var(--text); font-weight: 600; }
.sync-note { color: var(--muted); font-size: 12px; white-space: nowrap; }
.btn.refresh { padding: 4px 10px; }
.btn.refresh[disabled] { opacity: .6; cursor: progress; }
.who { color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.side { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted);
  padding: 12px 16px; font: inherit; font-size: 18px; font-weight: 600; cursor: pointer; text-align: center; }
.side span { display: block; font-size: 12px; font-weight: 400; margin-top: 2px; }
.side.prehire.on { background: var(--pre); border-color: var(--pre); color: #1d2330; }
.side.prehire.on span { color: #3d3420; }
.side.retained.on { background: var(--ret); border-color: var(--ret); color: #fff; }
body[data-side=prehire] .side-panel { border-top: 4px solid var(--pre); }
body[data-side=retained] .side-panel { border-top: 4px solid var(--ret); }
body[data-side=prehire] .chip.on { background: var(--pre-soft); border-color: var(--pre); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.rail { position: sticky; top: 72px; max-height: calc(100vh - 92px); }
.rail .badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: #fff; }
.badge.prehire { background: var(--pre); color: #1d2330; } .badge.retained { background: var(--ret); color: #fff; } .badge.lost { background: var(--muted); color: #fff; }
.rail h3 { margin: 6px 0 2px; font-size: 18px; }
.rail dl { display: grid; grid-template-columns: 100px 1fr; gap: 4px 8px; margin: 12px 0; }
.rail dt { color: var(--muted); } .rail dd { margin: 0; overflow-wrap: anywhere; }
.rail .money { display: flex; gap: 16px; margin: 10px 0; }
.rail .money div { flex: 1; background: var(--bg); border-radius: 8px; padding: 8px; }
.rail .money b { display: block; font-size: 16px; }
.tabs { display: inline-flex; gap: 2px; margin-left: 8px; }
.tabs button { border: 0; background: none; color: var(--muted); font: inherit; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.tabs button.on { background: var(--bg); color: var(--text); font-weight: 600; }
#tl-filter, #tl-range, #tl-order, #tl-custom input { margin-bottom: 8px; margin-right: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 22px; }
.timeline .dot { position: absolute; left: -12px; top: 0; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; color: #fff; background: var(--muted); }
.dot.email { background: #a8357a; } .dot.call { background: #2e7d6b; } .dot.text { background: #6a4bb3; }
.dot.update, .dot.sync { background: #c2410c; } .dot.money { background: var(--good); } .dot.time { background: #312e81; }
.dot.sign { background: #4a7fb5; } .dot.file, .dot.form { background: #b8860b; } .dot.task, .dot.calendar { background: var(--accent); }
.dot.note { background: #64748b; }
.timeline .t-title { font-weight: 600; }
.timeline .t-meta { color: var(--muted); font-size: 12px; }
.timeline .t-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .t-body { max-height: 6em; overflow: hidden; color: var(--muted); font-size: 13px; white-space: pre-wrap; cursor: pointer; }
.timeline .t-body.open { max-height: none; }
.timeline .chips { margin: 4px 0 0; }
.rail.maxed .timeline .t-body { max-height: 12em; }
.cal-day { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 2px; }
.cal-ev { display: grid; grid-template-columns: 76px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.cal-ev .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.cal-ev .w { font-weight: 600; } .cal-ev .loc, .cal-ev .cal { color: var(--muted); font-size: 12px; }
.mail li { cursor: pointer; } .mail li.unread .s { font-weight: 700; }
#email li { flex-direction: column; gap: 0; cursor: pointer; }
#email li .row { display: flex; gap: 8px; width: 100%; } #email li .f { font-weight: 600; }
#email li.unread .f::before { content: "● "; color: var(--accent); }
#email li .s { color: var(--muted); }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; border-top: 1px solid var(--line); padding-top: 8px; }
.clickable { cursor: pointer; } .clickable:hover td { background: var(--bg); }
tr.picked td { background: var(--accent-soft); }
.search { flex: 1; min-width: 180px; max-width: 360px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }

main { padding: 16px 20px 40px; max-width: 1600px; margin: 0 auto; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.results { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; padding: 8px 14px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
  box-shadow: var(--shadow); min-height: 220px; max-height: 420px; display: flex; flex-direction: column; overflow: hidden; }
.panel.wide { grid-column: span 2; }
.panel.full { grid-column: 1 / -1; max-height: none; }
.table td.dt, .table td.hrs { width: 1%; white-space: nowrap; }   /* time entries: hours sit right after the date */
.table td.hrs { padding-right: 18px; }
.panel .fold { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 2px; margin-left: 4px; }
.panel .grip { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: grab; font-size: 16px; padding: 0 4px; touch-action: none; user-select: none; -webkit-user-select: none; }
.panel .grip + .max { margin-left: 4px; }
#p-email > header .grip { margin-left: 4px; }   /* the search box already pushes these right */
.panel .grip:hover, .panel .grip:focus-visible { color: var(--text); }
.panel.maxed .grip { display: none; }
.panel.dragging { opacity: .6; outline: 2px dashed var(--accent); outline-offset: 2px; }
body.pane-dragging, body.pane-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.layout-reset { margin: 10px 2px 0; display: flex; gap: 8px; align-items: center; }
.panel.folded { min-height: 0; align-self: start; }
.panel.folded > :not(header) { display: none !important; }
.panel.folded > header { margin-bottom: 0; }
.panel > header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.panel h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: #243c80; }
@media (prefers-color-scheme: dark) { .panel h2 { color: #f0c00c; } }
.panel .max { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.panel > :not(header) { overflow: auto; }
.panel.maxed { position: fixed; inset: calc(var(--topbar-h, 60px) + 8px) 20px 20px; z-index: 10; max-height: none; }   /* starts below the top bar, however many rows it wraps to */
.empty { color: var(--muted); padding: 20px 4px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .when { margin-left: auto; color: var(--muted); white-space: nowrap; font-size: 12px; }
.list .mail-fld { margin-left: auto; font-size: 11px; color: var(--muted); border: 1px solid var(--line, #ccc); border-radius: 999px; padding: 0 7px; white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
.list .mail-fld + .when { margin-left: 8px; }
.list .overdue .when { color: var(--bad); font-weight: 600; }
.feed li { flex-direction: column; gap: 2px; }
.feed .meta { color: var(--muted); font-size: 12px; }
.feed .body { white-space: pre-wrap; max-height: 4.5em; overflow: hidden; }

.inline-form { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.inline-form input, .inline-form select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); font: inherit; min-width: 0; }
.inline-form input[name=task] { flex: 1; }
.inline-form.stack { flex-direction: column; margin-top: 14px; }
.btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
  color: var(--text); font: inherit; cursor: pointer; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); display: inline-block; padding: 10px 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: var(--bg);
  color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); }
.chip b { margin-left: 4px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.table td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tr.refund td.num { color: var(--bad); }
.table tr.failed td { color: var(--muted); text-decoration: line-through; }
.table tr.failed input:not([type=checkbox]), .table tr.failed select { color: var(--muted); background: var(--bg, #f3f4f6); text-decoration: line-through; }
.tag { font-size: 11px; color: var(--muted); }

.billing { display: grid; grid-template-columns: 260px 1fr 1fr; gap: 20px; }
.billing .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.billing .big { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.billing .split { color: var(--muted); font-size: 12px; margin: 4px 0 10px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: grid; grid-template-columns: 110px 1fr 80px; gap: 6px; align-items: center; font-size: 12px; padding: 2px 0; }
.history .bar { height: 8px; background: var(--accent-soft); border-radius: 4px; overflow: hidden; }
.history .bar i { display: block; height: 100%; background: var(--accent); }
.history .amt { text-align: right; font-variant-numeric: tabular-nums; }

.board .thermos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.thermo { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.t-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.t-bar { height: 22px; background: var(--bg); border-radius: 11px; margin: 10px 0; overflow: hidden; border: 1px solid var(--line); }
.t-fill { height: 100%; width: 0; background: var(--pre); transition: width .6s; }
.t-fill.mid { background: var(--accent); } .t-fill.high, .t-fill.done { background: var(--good); }
.thermo { display: grid; grid-template-columns: 1fr auto; align-items: end; }
.t-bar, .t-foot { grid-column: 1 / -1; }
.t-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.t-bar { position: relative; }
.t-bar i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.t-foot { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }
.quarter .total.sub { border: 0; margin-top: 0; padding-top: 2px; font-weight: 400; color: var(--muted); }
.quarters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quarter { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.quarter.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.quarter h3 { margin: 0 0 8px; font-size: 15px; display: flex; justify-content: space-between; }
.quarter h3 span { color: var(--muted); font-weight: 400; font-size: 12px; }
.quarter ol { list-style: none; margin: 0; padding: 0; }
.quarter li { display: flex; justify-content: space-between; padding: 3px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.quarter li .n { color: var(--muted); width: 28px; }
.quarter li.goal { background: var(--good-soft); color: var(--good); }
.quarter li.best { background: var(--warn-soft); color: var(--gold); font-weight: 700; }
.quarter li.now { outline: 1px dashed var(--accent); }
.quarter li.blank .v { color: var(--muted); }
.quarter .total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; display: flex; justify-content: space-between; font-weight: 700; }

.login { display: grid; place-items: center; min-height: 100vh; }
.login-diag { margin: 18px 0 0; font-size: 11px; color: var(--muted); word-break: break-all; }
.login-code { display: grid; gap: 8px; margin-top: 18px; }
.login-code input { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg, #fff); color: inherit; text-align: center; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; text-align: center; width: min(360px, 92vw); }
.alert { background: var(--bad-soft); color: var(--bad); padding: 8px 10px; border-radius: 6px; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; } .rail { position: static; max-height: none; }
  .grid { grid-template-columns: 1fr 1fr; } .panel.wide { grid-column: 1 / -1; }
  .billing { grid-template-columns: 1fr; } .quarters { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .inline-form input[name=task] { flex-basis: 100%; }
  main { padding: 12px 16px 32px; }
  .grid, .quarters, .board .thermos { grid-template-columns: 1fr; }
  .side { font-size: 15px; padding: 10px; }
  .panel.maxed { inset: calc(var(--topbar-h, 60px) + 6px) 8px 8px; }
}
.panel.side-panel { max-height: 520px; }
.panel > header, .chips, .inline-form { flex-shrink: 0; }

/* ---- case view and intake forms ---- */
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn.primary.small { display: inline-block; padding: 4px 12px; margin-left: 8px; }
.btn[disabled] { opacity: .6; cursor: progress; }
#p-work { max-height: none; }
#p-work #list-view { display: flex; flex-direction: column; max-height: 520px; overflow: hidden; }
#p-work #list-view .table-scroll { overflow: auto; }
#p-work header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
#p-work header .max { margin-left: auto; }
.side-switch { margin-top: 0; }
#p-work.maxed #list-view { max-height: none; height: 100%; }
.case-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.case-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.case-title h2 { font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--text); }
.case-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.case-tabs button { padding: 5px 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px 24px; }
.detail-grid section { break-inside: avoid; }
.detail-grid h4, .lm-heading { margin: 4px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kv { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 4px 10px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.addr { white-space: pre-line; }
.form-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.lm-form { display: flex; flex-direction: column; gap: 8px; }
.lm-row { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 8px 14px; }
.lm-row:has(> .lm-heading) { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.lm-field { display: flex; flex-direction: column; gap: 3px; }
.lm-field[hidden] { display: none; }
.lm-label { font-size: 12px; color: var(--muted); } .lm-label .req { color: var(--bad); }
.lm-field input, .lm-field select, .lm-field textarea { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); font: inherit; width: 100%; }
.lm-field .ro { padding: 6px 0; color: var(--muted); }
.form-actions { position: sticky; bottom: 0; display: flex; gap: 8px; justify-content: flex-end; align-items: center;
  background: var(--panel); border-top: 1px solid var(--line); padding: 10px 0 2px; margin-top: 12px; }
.form-actions .sub { margin-right: auto; }
@media (max-width: 700px) { .lm-row { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
.multi { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 4px 0; }
.multi .check { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; }
.multi .check input { width: auto; }
.stage-pick { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-left: auto; }
.stage-pick select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.lm-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }
a.btn { text-decoration: none; display: inline-block; }
a.btn.primary { color: #fff; }
.danger-zone { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn.danger { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.review-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.review-tools select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
tr.dup td { background: var(--warn-soft); }
.dup-of { font-size: 13px; }
#list-mode b { font-weight: 700; color: var(--pre-ink); }

/* ---- email reader ---- */
.reader { position: fixed; inset: 56px 0 0 0; z-index: 20; background: var(--bg); overflow: auto; padding: 14px 20px 40px; }
body.reading main { visibility: hidden; }
.reader-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: sticky; top: -14px; background: var(--bg); padding: 8px 0; }
.reader-bar #reader-webmail { margin-left: auto; }
.reader-head { max-width: 900px; margin: 10px auto 12px; }
.reader-head h2 { font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--text); margin-bottom: 6px; }
.reader-text { max-width: 900px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 22px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.reader-html { display: block; width: 100%; max-width: 900px; margin: 0 auto; height: calc(100vh - 240px); border: 1px solid var(--line);
  border-radius: 10px; background: #fff; }
.reader-note { max-width: 900px; margin: 6px auto; }
#reader-mode button[disabled] { opacity: .4; cursor: default; }
.reader { visibility: visible; }

/* ---- composer ---- */
.composer .reader-bar strong { font-size: 15px; }
.composer #cmp-status { margin-left: auto; }
.cmp-body { max-width: 900px; margin: 10px auto; display: flex; flex-direction: column; gap: 8px; }
.cmp-row { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; color: var(--muted); }
.cmp-row input, .cmp-ai input, #cmp-text { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--text); font: inherit; width: 100%; }
#cmp-text { min-height: 300px; resize: vertical; line-height: 1.5; }
.cmp-ai { display: flex; gap: 8px; } .cmp-ai input { flex: 1; }
.cmp-files { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cmp-files .file { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.cmp-files .file button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.cmp-sig pre, .cmp-quote pre { white-space: pre-wrap; font: inherit; font-size: 13px; color: var(--muted); max-height: 300px; overflow: auto; }
/* the original message shows in full under the reply; the composer scrolls down to it (Mike, 2026-11-17) */
.cmp-quote pre { max-height: none; overflow: visible; color: var(--text); border-left: 3px solid var(--line); padding-left: 12px; margin: 8px 0 0; overflow-wrap: anywhere; }
body.reading .composer { visibility: visible; }
#mail-folders { margin-left: 4px; }
#p-email > header #mail-folders { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }   /* a narrow window scrolls the folders, not the whole header */
#p-email > header { flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { border-radius: 4px; background: #fff; }
.login-logo { display: block; margin: 0 auto 10px; border-radius: 6px; background: #fff; }
.feed li.connect { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }

/* ---- document preview ---- */
#doc-viewer #doc-note { margin-left: auto; }
.doc-body { max-width: 1000px; margin: 10px auto; }
.doc-frame { display: block; width: 100%; height: calc(100vh - 140px); border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.doc-img { display: block; max-width: 100%; margin: 0 auto; border-radius: 8px; }
body.reading #doc-viewer { visibility: visible; }

/* ---- accordion under the Pre-hire / Hired buttons ---- */
.side { position: relative; }
.side .caret { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-style: normal; opacity: .8; }
.side .caret::before { content: "▸"; }
body.work-open .side.on .caret::before { content: "▾"; }
body:not(.work-open) .side.prehire.on { background: var(--pre-soft); color: var(--pre-ink); border-color: var(--pre); }
body:not(.work-open) .side.retained.on { background: var(--ret-soft); color: var(--ret); border-color: var(--ret); }
body:not(.work-open) .side-switch { margin-bottom: 14px; }
.grid + .grid, .grid + article, article + .grid { margin-top: 14px; }

/* ---- email delete ---- */
#email li .trash { margin-left: 6px; border: 0; background: none; cursor: pointer; opacity: 0; font-size: 13px; padding: 0 2px; }
#email li:hover .trash, #email li .trash:focus { opacity: .7; }
#email li .trash:hover { opacity: 1; }
@media (hover: none) { #email li .trash { opacity: .6; } }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40; background: var(--text); color: var(--bg);
  padding: 10px 14px; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.2); display: flex; gap: 10px; align-items: center; }
.toast .btn { background: transparent; color: var(--bg); border-color: rgba(255,255,255,.4); }

/* ---- logo: full wordmark; dark mode swaps in a copy with white lettering (logo-full-dark.png) ---- */
.brand .brand-full { display: block; height: 34px; width: auto; }
.brand .brand-dark { display: none; align-items: center; gap: 8px; }
.login-logo.brand-full { display: block; width: min(300px, 80%); height: auto; margin: 0 auto 14px; background: none; }
.login h1.brand-dark, .login-logo.brand-dark { display: none; }
.brand img.brand-full { background: none; border-radius: 0; }
.brand .brand-full { height: 46px; }
.topbar { padding-top: 6px; padding-bottom: 6px; }
body:not(.work-open) .side.prehire.on span { color: inherit; opacity: .85; }
.timeline { margin-left: 14px; }

/* ---- Tasks | Texts ---- */
#p-tasks > header { flex-wrap: wrap; }
.badge-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--bad); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.texts li { flex-direction: column; gap: 0; cursor: pointer; }
.texts li .row { display: flex; gap: 8px; width: 100%; } .texts li .f { font-weight: 600; }
.texts li .s { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.texts li.unread .s { color: var(--text); font-weight: 600; }
.thread-view { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.thread-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; }
.thread-to { display: flex; gap: 8px; align-items: center; color: var(--muted); margin-bottom: 8px; }
.thread-to input { flex: 1; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.thread { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; min-height: 120px; }
.bubble { max-width: 80%; padding: 7px 11px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.in { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble .meta { font-size: 11px; opacity: .7; margin-top: 2px; }
.thread-reply { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.thread-reply textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.thread-actions { display: flex; align-items: center; gap: 8px; } .thread-actions .sub { margin-right: auto; }
#p-tasks #texts-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#p-tasks #texts-body[hidden] { display: none; }

/* ---- Tasks | Texts switch: two half-width colored buttons ---- */
#p-tasks > header.tt-head { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 8px; }
.tt-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tt-switch .tt { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-weight: 600;
  font-size: 15px; cursor: pointer; text-align: center; }
.tt.tasks { background: var(--ret-soft); color: var(--ret); border-color: var(--ret-soft); }
.tt.texts { background: var(--pre-soft); color: var(--pre-ink); border-color: var(--pre-soft); }
.tt.tasks.on { background: var(--ret); color: #fff; border-color: var(--ret); }
.tt.texts.on { background: var(--pre); color: #1d2330; border-color: var(--pre); }
.tt-switch .tt:only-child { grid-column: 1 / -1; }
.tt-bar { display: flex; align-items: center; gap: 10px; min-height: 0; }
.tt-bar .max { margin-left: auto; }

/* ---- To box suggestions ---- */
.thread-to label { color: var(--muted); }
.pick { position: relative; flex: 1; }
.pick input { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.pick-list { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: 4px 0; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 260px; overflow: auto; }
.pick-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 6px 10px; cursor: pointer; }
.pick-list li.on, .pick-list li:hover { background: var(--accent-soft); }
.pick-list .nm { font-weight: 600; } .pick-list .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.pick-list .src { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }

/* ---- App buttons (Claude, ChatGPT) ---- */
.app-btns { display: flex; gap: 6px; }
.app-btns .btn { padding: 4px 10px; }

/* ---- Text attachments ---- */
.thread-files { display: flex; flex-wrap: wrap; gap: 6px; }
.thread-files:empty { display: none; }
.thread-files .file { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.thread-files .file button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.bubble .pics { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bubble .pics img { max-width: 180px; max-height: 180px; border-radius: 8px; display: block; background: var(--bg); }
.bubble .pics a.doc { color: inherit; font-size: 13px; text-decoration: underline; }
.cmp-row .pick input { padding: 8px 10px; }
.cmp-row .pick-list { color: var(--text); }

/* ---- Dial box in the top bar ---- */
.topbar .dial { flex: 0 1 240px; }
.topbar .dial input { padding: 5px 10px; font-size: 14px; }
.topbar .dial .pick-list { left: auto; width: 340px; text-align: left; }
.links > a, .links > .who, .links > .btn, .app-btns .btn { white-space: nowrap; flex-shrink: 0; }
.links { gap: 12px; min-width: 0; }
.topbar .dial { flex: 0 1 220px; min-width: 150px; }

/* ---- In-dashboard phone: a drawer on the right that stays loaded so calls keep going ---- */
.phone-btn { padding: 4px 10px; background: var(--ret); color: #fff; border-color: var(--ret); white-space: nowrap; }
.phone-drawer { position: fixed; top: 64px; right: 12px; z-index: 35; width: 340px; height: min(640px, calc(100vh - 80px));
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.2); overflow: hidden; transform: translateX(calc(100% + 24px)); visibility: hidden;
  transition: transform .18s ease, visibility 0s linear .18s; }
.phone-drawer.open { transform: none; visibility: visible; transition: transform .18s ease; }
.phone-head { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.phone-head .btn { margin-left: auto; }
.phone-caller { padding: 8px 10px; background: var(--pre-soft); border-bottom: 1px solid var(--line); }
.phone-caller .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.phone-caller .btn { margin-top: 6px; }
.phone-drawer iframe { flex: 1; width: 100%; border: 0; background: #fff; }
#phone-quiet.on { background: var(--pre-soft); border-color: var(--pre); }
.phone-head #phone-quiet { margin-left: auto; } .phone-head #phone-close { margin-left: 0; }
.phone-btn.ringing { animation: ring-flash 1s ease-in-out infinite; }
@keyframes ring-flash { 50% { background: var(--pre); border-color: var(--pre); color: #1d2330; } }
.phone-head .btn { white-space: nowrap; }
.app-btns .btn { display: inline-flex; align-items: center; gap: 6px; }
.app-btns .btn.app-color { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.app-btns .btn.app-color:hover { filter: brightness(1.1); }
.app-btns .btn img { display: block; }
/* keep the top bar on one line on a laptop/desktop screen */
.topbar .search { min-width: 140px; max-width: 300px; }
.topbar .dial { flex: 0 1 200px; min-width: 140px; }
@media (max-width: 1500px) { .sync-note { display: none; } }
@media (max-width: 1400px) { .links .who { display: none; } .topbar { gap: 10px; } .links { gap: 10px; } }

/* ---- recent searches ---- */
.recent-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 6px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.linkish { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; text-transform: none; letter-spacing: 0; }

/* search results drop down under the box (stays visible wherever the page is scrolled) */
.search-wrap { position: relative; flex: 1; min-width: 140px; max-width: 300px; }
.search-wrap .search { width: 100%; max-width: none; min-width: 0; box-sizing: border-box; }
.search-wrap .results { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: min(760px, 92vw);
  max-height: 70vh; overflow: auto; margin: 0; box-shadow: 0 10px 28px rgba(0,0,0,.18); }
#phone-dnd.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.phone-head #phone-dnd { margin-left: auto; } .phone-head #phone-quiet { margin-left: 0; }
.phone-btn.dnd { background: var(--bad); border-color: var(--bad); }

/* ---- Faxes (third tab beside Tasks and Texts) ---- */
.tt.faxes { background: var(--good-soft); color: var(--good); border-color: var(--good-soft); }
.tt.faxes.on { background: var(--good); color: #fff; border-color: var(--good); }
#p-tasks #faxes-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#p-tasks #faxes-body[hidden] { display: none; }
.faxes li .row .st { font-size: 12px; color: var(--muted); }
.faxes li .st.bad { color: var(--bad); }
.fax-compose { display: flex; flex-direction: column; gap: 8px; }
.fax-compose textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.fax-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fax-add select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; max-width: 100%; }

/* ---- Calendar | Tasks switch (same look as Texts | Faxes) ---- */
#p-calendar > header.tt-head { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 8px; }
.tt.cal { background: var(--ret-soft); color: var(--ret); border-color: var(--ret-soft); }
.tt.cal.on { background: var(--ret); color: #fff; border-color: var(--ret); }
.tt.tasks { background: #e2f1f2; color: #2a7f8a; border-color: #e2f1f2; }
@media (prefers-color-scheme: dark) { .tt.tasks { background: #173235; color: #6cc3cc; border-color: #173235; } }
.tt.tasks.on { background: #2a7f8a; color: #fff; border-color: #2a7f8a; }
/* dark mode: give the phone panel's buttons color so they stand out */
@media (prefers-color-scheme: dark) {
  .phone-head #phone-dnd:not(.on) { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
  .phone-head #phone-dnd:disabled { opacity: .55; }
  .phone-head #phone-quiet { background: var(--pre-soft); border-color: var(--pre); color: var(--pre-ink); }
  .phone-head #phone-close { background: var(--ret-soft); border-color: var(--ret); color: var(--accent); }
  #phone-dnd.on { color: #1d2330; font-weight: 600; }
}

/* ---- pane outlines in brand colors: blue (light), gold (dark); Intake & Billing green in both ---- */
.panel { border: 1px solid #243c80; }
#p-billing { border-color: var(--good); }
@media (prefers-color-scheme: dark) {
  .panel { border-color: #f0c00c; }
  #p-billing { border-color: var(--good); }
}

/* ---- calendar: 2 weeks | Month switch and month grid ---- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--bg); color: var(--muted); font: inherit; font-size: 12px; padding: 3px 10px; cursor: pointer; }
.seg button.on { background: var(--ret); color: #fff; }
#cal-month { overflow: auto; min-height: 0; }
.mo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mo-head strong { min-width: 150px; text-align: center; }
.mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mo-wd { font-size: 11px; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .04em; padding: 2px 0; }
.mo-cell { display: flex; flex-direction: column; align-items: stretch; gap: 1px; min-height: 64px; padding: 3px; text-align: left;
  border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; overflow: hidden; }
.mo-cell.other { opacity: .45; }
.mo-cell.today { border-color: var(--ret); box-shadow: inset 0 0 0 1px var(--ret); }
.mo-cell.sel { background: var(--accent-soft); }
.mo-cell .n { font-size: 12px; font-weight: 600; }
.mo-cell .chip { font-size: 10.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--ret-soft); color: var(--ret); border-radius: 3px; padding: 0 3px; }
.mo-cell .more { font-size: 10px; color: var(--muted); }
.mo-detail { margin-top: 8px; }
.panel.maxed .mo-cell { min-height: 110px; } .panel.maxed .mo-cell .chip { font-size: 12px; }
@media (prefers-color-scheme: dark) { .mo-cell .chip { color: #cfe0f7; } }

/* ---- Pre-hire stage buttons in brand yellow ---- */
#stages .chip { background: var(--pre-soft); border-color: var(--pre); color: var(--pre-ink); font-weight: 600; }
#stages .chip:hover { filter: brightness(.97); }
#stages .chip.on { background: var(--pre); border-color: var(--pre); color: #1d2330; }
@media (prefers-color-scheme: dark) { #stages .chip:not(.on) { color: #fff; } }

/* ---- Intake form buttons: each form its own solid color ---- */
.form-btn { font-weight: 600; border: 1px solid transparent; color: #fff; }
.form-btn.c0 { background: #243c80; border-color: #243c80; }
.form-btn.c1 { background: #f0c00c; border-color: #f0c00c; color: #1d2330; }
.form-btn.c2 { background: #1e7a46; border-color: #1e7a46; }
.form-btn.c3 { background: #2a7f8a; border-color: #2a7f8a; }
.form-btn.c4 { background: #c0603a; border-color: #c0603a; }
.form-btn.c5 { background: #6b4fa0; border-color: #6b4fa0; }
.form-btn:hover { filter: brightness(1.08); }
@media (prefers-color-scheme: dark) {
  .form-btn.c0 { background: #5b8fd6; border-color: #5b8fd6; }
  .form-btn.c2 { background: #3fa86b; border-color: #3fa86b; }
  .form-btn.c3 { background: #3d9faa; border-color: #3d9faa; }
  .form-btn.c4 { background: #d9774f; border-color: #d9774f; }
  .form-btn.c5 { background: #8a6fc4; border-color: #8a6fc4; }
}

/* ---- matter action buttons: solid colors ---- */
.lm-links #hire-btn { background: #1e7a46; border-color: #1e7a46; color: #fff; font-weight: 600; }
.lm-links #close-btn, .lm-links #reopen-btn { background: #6b4fa0; border-color: #6b4fa0; color: #fff; }
.lm-links #send-doc-btn { background: #c2410c; border-color: #c2410c; color: #fff; font-weight: 600; }
.lm-links button.btn:hover { filter: brightness(1.08); }
@media (prefers-color-scheme: dark) {
  .lm-links #hire-btn { background: #3fa86b; border-color: #3fa86b; }
  .lm-links #close-btn, .lm-links #reopen-btn { background: #8a6fc4; border-color: #8a6fc4; }
  .lm-links #send-doc-btn { background: #e8590c; border-color: #e8590c; }
}
.badge.closed { background: var(--muted); color: #fff; }
.src-badge.closed { background: var(--line); color: var(--muted); }
.note-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.note-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel); color: var(--text); }
.note-form .row { display: flex; gap: 8px; align-items: center; }
.mc-note .note-actions { float: right; display: flex; gap: 4px; }

/* ---- Add contact dialog ---- */
.cd-back { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.cd-card { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  width: min(420px, 92vw); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.cd-card h3 { margin: 0 0 2px; font-size: 16px; }
.cd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cd-field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.cd-field input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.cd-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; } .cd-actions .sub { margin-right: auto; }
.cd-field input { min-width: 0; width: 100%; box-sizing: border-box; }
/* ...but not checkboxes: Safari shrinks a full-width checkbox in a row to nothing */
.cd-field input[type=checkbox], .cd-field input[type=radio] { width: auto; min-width: 13px; padding: 0; border: 0; background: none; flex: none; }
.phone-caller { position: relative; }
.phone-caller .cc-close { position: absolute; top: 4px; right: 6px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }

/* ---- MyCase tasks ---- */
.task-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tasks li.task { display: flex; gap: 10px; align-items: flex-start; }
.tasks .tick { padding-top: 2px; } .tasks .tick input { width: 16px; height: 16px; cursor: pointer; }
.tasks .tbody { flex: 1; min-width: 0; }
.tasks .row { display: flex; justify-content: space-between; gap: 10px; }
.tasks .row .f { font-weight: 600; }
.tasks .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tasks .when.late { color: var(--bad); font-weight: 600; }
.tasks .s { font-size: 13px; color: var(--muted); }
.tasks .case-link { color: var(--accent); }
.tasks .prio { color: var(--bad); font-size: 12px; }
#tasks-body { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: auto; }
#tasks-body[hidden] { display: none; }
.cal-ev .case-link { color: var(--accent); font-weight: 600; }
.past-events { margin-top: 10px; } .past-events summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 4px; }

/* ---- MyCase case tabs ---- */
.mc-open { background: #2a7f8a; border-color: #2a7f8a; color: #fff; font-weight: 600; }
.mc-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.mc-form input, .mc-form select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.mc-form input[name=tname], .mc-form .grow { flex: 1; min-width: 180px; }
.mc-form input[name=hours] { width: 80px; }
.doc-row { display: flex; gap: 10px; align-items: center; } .doc-row a:first-child { flex: 1; color: var(--accent); }
.doc-group { margin-bottom: 8px; }
.mc-note { padding: 6px 0; border-bottom: 1px solid var(--line); } .note-text { white-space: pre-wrap; font-size: 14px; }
.table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-balance { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; } .mc-balance b { font-size: 18px; margin-left: 4px; }
.trust-held { margin-top: 10px; } .trust-held summary { cursor: pointer; font-weight: 600; }
.trust-held.stale summary { color: var(--bad); } .trust-held table { max-width: 520px; }
#manual-form label.sub { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
#manual-form label.sub input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }

/* ---- MyCase dialogs, documents, Time & Billing ---- */
.cd-card.wide { width: min(560px, 94vw); max-height: 90vh; overflow: auto; }
.cd-field textarea, .cd-field select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.cd-field .pick { position: relative; } .cd-field .pick input { width: 100%; box-sizing: border-box; }
.staff-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text); }
.all-day { align-self: end; padding-bottom: 8px; }
.cal-ev a.w { color: var(--text); text-decoration: none; } .cal-ev a.w:hover { text-decoration: underline; }
.tasks a.f { color: var(--text); text-decoration: none; } .tasks a.f:hover { text-decoration: underline; }
.drop-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; margin-bottom: 10px;
  border: 2px dashed var(--line); border-radius: 10px; }
.drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone input[list] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; min-width: 220px; }
.folder { margin: 2px 0; } .folder > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.folder-body { padding-left: 18px; }
.tb-head { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mc-rate { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.timer { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.timer-clock { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; }
.timer .btn.running { background: var(--bad); border-color: var(--bad); color: #fff; }
.mc-form input[name=amount] { width: 110px; flex: none; }
/* Pre-Hire / Hired lists: about 5 cases, scroll for the rest (⤢ enlarges to show more) */
#p-work #list-view #pipeline-wrap { max-height: 270px; overflow: auto; }
#p-work #list-view #pipeline-wrap thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
#p-work.maxed #list-view #pipeline-wrap { max-height: none; flex: 1 1 auto; min-height: 0; }   /* enlarged: the whole page (the 270px rule above outranked .panel.maxed) */
#pipeline-wrap .list-more td { text-align: center; padding: 10px; font-size: 13px; }
.staff-checks label.check { white-space: nowrap; }
.list-search { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; width: 220px; }
.src-badge { font-size: 12px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.src-badge.lm { background: var(--pre-soft); color: var(--pre-ink); }
.src-badge.mc { background: #e2f1f2; color: #2a7f8a; }
@media (prefers-color-scheme: dark) { .src-badge.mc { background: #173235; color: #8fd3db; } }
.repeat-tag { color: #2a7f8a; font-size: 12px; white-space: nowrap; } .repeat-note { font-size: 12px; margin: -4px 0 0; }

/* ---- top-bar billing timer ---- */
.gtimer { display: inline-flex; gap: 2px; }
.gtimer .btn { padding: 4px 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gt-main.running { background: var(--good); border-color: var(--good); color: #fff; font-weight: 600; }
.gt-main.paused { background: var(--pre-soft); border-color: var(--pre); color: var(--pre-ink); font-weight: 600; }
.gt-stop { background: var(--bad); border-color: var(--bad); color: #fff; }
.gt-summary { margin: 0; color: var(--muted); } .gt-summary b { color: var(--text); }

/* ---- intake forms styled like Lawmatics: tall white fields, "Select..." drop-downs, on/off switches ---- */
.lm-form { gap: 14px; }
.lm-row { gap: 14px 18px; }
.lm-heading { font-size: 14px !important; font-weight: 700; color: var(--text) !important; letter-spacing: .03em; margin-top: 8px !important; }
.lm-row:has(> .lm-heading) { border-top: 0; padding-top: 12px; }
.lm-label { font-size: 13px; color: var(--text); opacity: .8; }
.lm-field input, .lm-field select, .lm-field textarea {
  min-height: 46px; padding: 10px 14px; border: 1px solid #c9ced6; border-radius: 4px; background-color: #fff; color: #1d2330;
  font-size: 15px; box-sizing: border-box; width: 100%; }
.lm-field textarea { min-height: 70px; }
.lm-field input:focus, .lm-field select:focus, .lm-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.lm-field select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23333'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.lm-field select:has(option[value=""]:checked) { color: #8a93a3; font-style: italic; }
.lm-field select option { color: #1d2330; font-style: normal; }
.lm-field input::placeholder, .lm-field textarea::placeholder { color: #8a93a3; font-style: italic; }
/* on/off switch */
.switch { position: relative; display: inline-block; width: 52px; height: 30px; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; cursor: pointer; background: #e9ecf1; border: 1px solid #c9ced6; border-radius: 999px; transition: background .15s; }
.switch .slider::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%;
  background: #b7bdc8; transition: transform .15s, background .15s; }
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(22px); background: #fff; }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 2px var(--accent-soft); }
.lm-field:has(.switch) { align-items: flex-start; }
@media (prefers-color-scheme: dark) {
  .lm-field input, .lm-field select, .lm-field textarea { background-color: #12151b; color: var(--text); border-color: #3a4250; }
  .lm-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23ccd'/%3E%3C/svg%3E"); }
  .lm-field select option { color: var(--text); background: #1b1f27; }
  .switch .slider { background: #2b313c; border-color: #3a4250; } .switch .slider::before { background: #6b7385; }
}
.ggr-btn { background: #f0c00c; border-color: #f0c00c; color: #1d2330; font-weight: 600; }
.ggr-btn:disabled { background: var(--good-soft); border-color: var(--good); color: var(--good); opacity: 1; cursor: default; }

/* ---- public web form (/intake/{slug}) ---- */
.public-wrap { max-width: 760px; margin: 24px auto; padding: 0 16px; }
.public-wrap h1 { font-size: 1.4rem; margin: 16px 0; }
.pf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pf-note { margin-top: 16px; }
.doc-row .doc-move { max-width: 160px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: 12px; }
.doc-row .grow { flex: 1; }
.drop-zone select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.folder-tools { margin-left: 12px; font-weight: 400; font-size: 12px; display: inline-flex; gap: 8px; }
.folder-tools .linkish { font-size: 12px; }
.form-pick { display: inline-flex; align-items: stretch; gap: 2px; }
.form-pick .form-pdf { align-self: center; }
/* timeline: every entry shows; details are cut at 10 lines, "Show more" opens that one */
.timeline .t-detail { max-height: calc(10 * 1.45em); overflow: hidden; line-height: 1.45; }
.timeline .t-detail .t-line { line-height: 1.45; }
.timeline .t-detail.open { max-height: none; }
.timeline .t-more { font-size: 12px; padding: 2px 0; }

/* ---- document templates (the assembler) ---- */
.tpl-page { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .tpl-page { grid-template-columns: 1fr; } }
.tpl-list header { display: flex; justify-content: space-between; align-items: center; }
.tpl-list h4 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.tpl-list li { padding: 3px 0; } .tpl-list li.on a { font-weight: 700; } .tpl-list li.off a { color: var(--muted); }
.tpl-show-off { font-size: 12px; margin: 6px 0; }
.tpl-firm { margin-top: 14px; font-size: 13px; } .tpl-firm .cd-field { margin: 6px 0; }
.tpl-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 10px; }
.tpl-head .grow { flex: 1; min-width: 240px; } .tpl-name { font-size: 16px; font-weight: 600; }
.tpl-toolbar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.tpl-toolbar .tb-gap { width: 10px; }
.tpl-block { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 6px; }
.tpl-block.ruled { border-color: #c9a227; }
.tpl-rule { font-size: 12px; color: #7a5d00; background: #fff5d1; border-radius: 6px; padding: 3px 8px; margin-bottom: 6px; cursor: pointer; }
@media (prefers-color-scheme: dark) { .tpl-rule { background: #3a3110; color: #f0d77a; } }
.tpl-row { display: flex; gap: 6px; align-items: flex-start; }
.tpl-tools { display: flex; flex-direction: column; gap: 4px; }
.tpl-tools .has-rule { background: #f0c00c; border-color: #f0c00c; color: #1d2330; }
.tpl-text, .tpl-fixed { flex: 1; min-height: 3em; }
.tpl-fixed { display: flex; align-items: center; justify-content: center; color: var(--muted); background: #fff; border-radius: 6px; padding: 8px; }
.tpl-logo { height: 48px; }
.doc-page { background: #fff; color: #000; font-family: "Times New Roman", Times, serif; font-size: 16px; line-height: 1.35;
  padding: 18px 28px; border-radius: 6px; outline: none; }
.doc-page:focus { box-shadow: 0 0 0 2px var(--accent); }
.doc-page p { margin: 0 0 10px; } .doc-page ol, .doc-page ul { margin: 0 0 10px; padding-left: 36px; }
.doc-page ol { padding-left: 0.3in; } .doc-page ol > li { padding-left: 0.2in; }
.doc-page .doc-block { margin-bottom: 10px; } .doc-page .doc-logo { text-align: center; margin-bottom: 36px; } .doc-page .doc-logo img { height: 60px; }
.doc-page .doc-line { border: 0; border-top: 1px solid #000; } .doc-page .doc-break { border-top: 2px dashed #bbb; margin: 16px 0; }
.doc-page .sig-spot { display: inline-block; min-width: 220px; border-bottom: 1px solid #000; color: #888; font-size: 12px; }
.doc-page .missing { background: #fff3c4; }
.tok { display: inline-block; padding: 0 6px; margin: 0 1px; border-radius: 4px; background: #dbe6ff; color: #1b3a8a;
  font-family: -apple-system, system-ui, sans-serif; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tok.sig { background: #e4f4e6; color: #1e6b33; } .tok.bad { background: #ffd9d9; color: #8a1b1b; }
.tpl-add { display: flex; gap: 14px; justify-content: center; padding: 4px; font-size: 12px; opacity: .55; }
.tpl-add:hover { opacity: 1; }
.tpl-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 12px; position: sticky; bottom: 0;
  background: var(--panel); padding: 8px 0; }
.tpl-menu { position: absolute; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.tpl-fields { max-height: 50vh; overflow: auto; }
.logic-row { display: flex; gap: 6px; margin: 6px 0; } .logic-row select, .logic-row input { flex: 1; min-width: 0; }
.cd-card.logic { width: min(720px, 94vw); }
.cd-card.doc-preview { width: min(980px, 96vw); max-height: 92vh; overflow: auto; }
.cd-actions.top { justify-content: space-between; }
.panel.tpl-list, .panel.tpl-edit { max-height: none; overflow: visible; min-height: 0; }
.setup-menu { position: relative; flex-shrink: 0; }
.setup-menu summary { list-style: none; cursor: pointer; color: var(--muted); white-space: nowrap; }
.setup-menu summary::-webkit-details-marker { display: none; }
.setup-menu summary.on { color: var(--text); font-weight: 600; }
.setup-list { position: absolute; right: 0; top: 140%; z-index: 30; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 0; min-width: 190px; box-shadow: 0 8px 20px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.setup-list a { padding: 6px 14px; color: var(--text); } .setup-list a:hover { background: var(--bg); }
.doc-page ul { list-style-type: disc; }

/* ---- the signing page (/sign/...) ---- */
.sign-top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.sign-top span { font-weight: 600; }
.sign-wrap { max-width: 900px; margin: 18px auto 40px; padding: 0 16px; }
.sign-doc { padding: 36px 48px; box-shadow: var(--shadow); margin: 12px 0; }
@media (max-width: 640px) { .sign-doc { padding: 18px; font-size: 14px; } }
.sign-doc .sig-spot { background: #f3f5fa; }
.sign-doc .sig-spot.mine { background: #fff3c4; color: #7a5d00; font-weight: 600; }
.sign-doc .sig-done img { display: block; } .sign-doc .sig-note { font-size: 10px; color: #555; }
.sign-panel, .sign-done { max-height: none; min-height: 0; overflow: visible; gap: 10px; }
.sign-panel .consent { align-items: flex-start; line-height: 1.4; }
#sg-canvas { width: 100%; max-width: 600px; aspect-ratio: 9 / 2; border: 1px dashed var(--line); border-radius: 8px; background: #fff; touch-action: none; }
#sg-canvas.drawing { border-color: var(--accent); cursor: crosshair; }
.sign-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; } .sign-actions .sub { margin-right: auto; }
.sign-done { font-size: 16px; font-weight: 600; color: #1e7a46; }
.sign-pdf { text-align: center; }
.cd-card.send-doc { width: min(980px, 96vw); max-height: 94vh; overflow: auto; }
.send-preview { flex: none; height: 62vh; min-height: 360px; overflow: auto; border: 1px solid var(--line); padding: 36px 56px; }
.send-preview[contenteditable="true"] { box-shadow: 0 0 0 2px var(--accent); }
.esign-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.esign-card .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.esign-status { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--bg); }
.esign-card.signed .esign-status { background: #e4f4e6; color: #1e6b33; }
.esign-card.declined .esign-status, .esign-card.expired .esign-status { background: #ffe1e1; color: #8a1b1b; }
#p-email > header { flex-wrap: nowrap; } #p-email > header .count, #p-email > header h2 { white-space: nowrap; flex: none; } #p-email > header #email-new { flex: none; white-space: nowrap; }
#p-email > header .mail-q { margin-left: auto; flex: 0 1 240px; min-width: 70px; width: 0; padding: 5px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.inv-pick { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.inv-pick .grow { flex: 1; } .inv-pick .num { font-variant-numeric: tabular-nums; }
.inv-preview { flex: none; max-height: 60vh; overflow: auto; border: 1px solid var(--line); padding: 34px 46px; position: relative; }
.money-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 14px; }
.mcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.mcard h4 { margin: 0 0 6px; font-size: 14px; }
.mcard .mrow { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.mcard .mrow b { font-variant-numeric: tabular-nums; font-weight: 500; } .mcard .mrow.strong b { font-weight: 700; font-size: 15px; }
.mcard .msub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.mcard .mbtns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; } .mcard > .btn { align-self: flex-start; margin-top: 8px; }
.trust-ledger { margin: 0 0 14px; } .trust-ledger summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.trust-page { max-height: none; } .trust-page tr.strong td { font-weight: 700; }
.recon { border: 2px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 12px; }
.recon.ok { border-color: #3fa86b; } .recon.bad { border-color: #d9534f; }
@media print { .topbar, #tr-tabs, #tr-print, .mc-form button { display: none !important; } .panel { box-shadow: none; border: 0; } }
.tt-bar .text-q { flex: 0 1 200px; min-width: 70px; width: 0; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
#faxes-list .fax-save { float: right; margin-top: -2px; }
/* the client's pay page */
.pay-wrap { max-width: 560px; }
.pay-panel { gap: 12px; max-height: none; min-height: 0; overflow: visible; } .pay-panel > * { flex-shrink: 0; }
.pay-due { font-size: 28px; font-weight: 700; margin: 2px 0 4px; }
.pay-row { display: flex; gap: 12px; flex-wrap: wrap; } .pay-row > .cd-field { flex: 1 1 140px; }
.pay-exp { display: flex; gap: 6px; } .pay-exp select { flex: 1; }
.hf { height: 40px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 8px; }
.hf iframe { width: 100%; height: 38px; border: 0; }
.pay-secure { margin: 0; font-size: 12px; }
.badge.private { background: #5b3a8c; color: #fff; margin-right: 6px; }
/* the client portal */
.portal-wrap { max-width: 760px; }
.portal-body .sign-top .grow { flex: 1; }
.portal-login { max-width: 440px; margin: 30px auto; gap: 10px; max-height: none; min-height: 0; overflow: visible; }
.pt-cards { display: grid; gap: 12px; }
.pt-case { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; cursor: pointer; font: inherit; color: var(--text); max-height: none; min-height: 0; }
.pt-new { color: #fff; background: #243C80; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.pt-card { margin: 14px 0; gap: 8px; max-height: none; min-height: 0; overflow: visible; }
.pt-card > * { flex-shrink: 0; }
.pt-card h3 { margin: 0; } .pt-card h4 { margin: 10px 0 0; font-size: 14px; }
.pt-list { list-style: none; margin: 0; padding: 0; }
.pt-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pt-list li:last-child { border-bottom: 0; } .pt-list .grow { flex: 1 1 200px; }
.pt-list.todo li { padding: 10px 0; }
.pt-thread { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.pt-msg { max-width: 85%; padding: 8px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.pt-msg.me { align-self: flex-end; background: #e8eefb; }
.pt-msg-head { font-size: 12px; color: var(--muted); margin-bottom: 2px; } .pt-msg-body { white-space: pre-wrap; }
.pt-write textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--bg); color: var(--text); }
.portal-foot { text-align: center; margin: 24px 0; }
.doc-row .on-share { background: #e8eefb; border-color: #243C80; color: #243C80; }
.doc-row .pt-tag { background: #fff3cd; color: #7a5b00; padding: 1px 8px; border-radius: 999px; }
.pt-thread.staff { margin-bottom: 8px; }
.portal-login form { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 520px) { .portal-body #pt-who { display: none; } }
.pick-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 4px; margin: 6px 0; border-bottom: 1px solid var(--line); }
.doc-row .doc-pick, .folder summary .doc-pick { width: auto; margin: 0 6px 0 0; flex: none; }
/* the bottom panel's switch, and reports */
#p-billing > header.tt-head { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 8px; }
.tt.billing { background: var(--good-soft); color: var(--good); border-color: var(--good-soft); }
.tt.billing.on { background: var(--good); color: #fff; border-color: var(--good); }
.tt.reports { background: #ece7f6; color: #5b3a8c; border-color: #ece7f6; }
.tt.reports.on { background: #5b3a8c; color: #fff; border-color: #5b3a8c; }
@media (prefers-color-scheme: dark) { .tt.reports { background: #2a2238; color: #b9a2e0; border-color: #2a2238; } }
.bt-switch { grid-template-columns: repeat(3, 1fr); }
.tt.plans { background: #e3eefa; color: #1f5a96; border-color: #e3eefa; }
.tt.plans.on { background: #1f5a96; color: #fff; border-color: #1f5a96; }
@media (prefers-color-scheme: dark) { .tt.plans { background: #1b2a3b; color: #9cc3ec; border-color: #1b2a3b; } }
.rp-bar { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-end; padding: 4px 2px 10px; border-bottom: 1px solid var(--line); }
.rp-field, .rp-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.rp-meta b { font-size: 15px; color: var(--text); text-transform: none; letter-spacing: 0; }
.rp-field select, .rp-custom input { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; text-transform: none; }
.rp-custom { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 2px; }
.rp-tools .grow { flex: 1; } .rp-total { font-size: 15px; } .rp-total b { font-size: 18px; }
.rp-grid { width: 100%; } .rp-grid th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; }
.rp-grid .rp-group td { background: #8e96a6; color: #fff; font-weight: 700; font-size: 15px; padding: 10px 12px; cursor: pointer; border-top: 2px solid var(--panel); }
.rp-grid .rp-group:hover td, .rp-grid .rp-group:focus td { background: #7a8394; outline: none; }
.rp-grid .rp-caret { display: inline-block; width: 14px; }
.rp-grid .rp-row td { padding: 8px 12px; }
.rp-grid .rp-email { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-grid tfoot td { font-weight: 700; padding: 10px 12px; }
.mo-cell .chip { cursor: pointer; } .mo-cell .chip.open:hover { filter: brightness(0.92); text-decoration: underline; }
.mo-cell .more { cursor: pointer; } .mo-cell .more:hover { text-decoration: underline; }
.cd-card .go-case { align-self: flex-start; margin-bottom: 4px; }
/* contacts beyond the client */
.people-card { max-width: 640px; }
.people-card .pc-block { margin: 8px 0; } .people-card .pc-block h4 { margin: 10px 0 4px; font-size: 13px; }
.people-card .addr, .people-card .pc-notes { white-space: pre-wrap; }
.multi-rows { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.multi-row { display: flex; gap: 6px; width: 100%; } .multi-row input { flex: 1; } .multi-row select { flex: none; width: auto; }
.pick-list.inline { position: static; max-height: 240px; }
.pick-list li.new { color: var(--ret); font-weight: 600; }
.case-people .people-list { list-style: none; margin: 0; padding: 0; }
.case-people .people-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.case-people .pl-role { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.case-people .pl-tools { display: flex; gap: 10px; font-size: 12px; }
.ct-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 10px; }
.ct-bar input { flex: 1 1 280px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.ct-bar select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.act-pick { position: relative; display: inline-block; flex: none; }
.act-pick input { width: 190px; box-sizing: border-box; }
.act-list { min-width: 220px; max-height: 280px; overflow: auto; }
.act-list li.act-tool { color: var(--ret); font-weight: 600; }
.act-list li.act-tool + li:not(.act-tool) { border-top: 1px solid var(--line); }
.act-list li.on { background: var(--ret-soft); }
/* calendar: coloured by the case's lead attorney */
.cal-ev.lead { border-left: 4px solid var(--lead); padding-left: 8px; }
.mo-cell .chip.lead { background: color-mix(in srgb, var(--lead) 20%, var(--panel)); border-left: 3px solid var(--lead); color: var(--text); }
.lead-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.lead-key .lk { display: inline-flex; align-items: center; gap: 5px; }
.lead-key .lk i { width: 10px; height: 10px; border-radius: 3px; background: var(--lead); display: inline-block; }
.lead-key .lk.none i { background: var(--ret-soft); border: 1px solid var(--line); }
.cmp-drop { position: fixed; inset: 64px 8px 8px 8px; z-index: 30; display: flex; align-items: center; justify-content: center;
  border: 3px dashed var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent-soft) 85%, transparent);
  font-size: 22px; font-weight: 700; color: var(--accent); pointer-events: none; }
/* the automation builder */
.au-page { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .au-page { grid-template-columns: 1fr; } }
.au-list header { display: flex; align-items: center; justify-content: space-between; }
.au-item { cursor: pointer; padding: 8px 6px; border-bottom: 1px solid var(--line); border-radius: 6px; }
.au-item.on, .au-item:hover { background: var(--accent-soft); }
.au-item .row { display: flex; justify-content: space-between; gap: 8px; }
.au-pill { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.au-pill.on { background: #2e9d6a; color: #fff; }
.au-settings { margin-top: 12px; font-size: 13px; }
.au-edit { max-height: none; min-height: 0; overflow: visible; }
.au-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.au-top h2 { margin: 0 8px 0 0; }
.au-active { font-weight: 600; }
.au-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.au-inline .grow { flex: 1 1 280px; }
.au-num { width: 90px !important; }
.au-steps { display: flex; flex-direction: column; gap: 4px; }
.au-step { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.au-step.t-wait { border-left-color: #9aa3b2; } .au-step.t-email { border-left-color: #2f6fdb; } .au-step.t-text { border-left-color: #2e9d6a; }
.au-step.t-task { border-left-color: #d9822b; } .au-step.t-stage { border-left-color: #8e44ad; } .au-step.t-invoice { border-left-color: #b8860b; }
.au-step.t-branch { border-left-color: #1597a8; background: var(--bg); } .au-step.t-end { border-left-color: #c0392b; }
.au-step-head { display: flex; align-items: center; gap: 8px; } .au-step-head .au-tools { margin-left: auto; display: flex; gap: 4px; }
.au-ic { width: 22px; text-align: center; }
.au-step textarea, .au-step input:not([type=checkbox]), .au-step select, .au-edit .cd-field input, .au-edit .cd-field textarea, .au-edit select {
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; box-sizing: border-box; }
.au-step textarea { width: 100%; }
.au-add select { border: 1px dashed var(--line); background: transparent; color: var(--muted); font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.au-fill { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.au-preview { white-space: pre-wrap; background: var(--bg); border: 1px dashed var(--line); padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13px; margin: 0; }
.au-cases { display: flex; flex-direction: column; gap: 8px; }
.au-case { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.au-case.else { border-style: dashed; }
.au-case-head { display: flex; gap: 8px; align-items: center; } .au-case-head input { flex: 1; }
.au-areas summary { cursor: pointer; font-size: 13px; color: var(--muted); } .au-areas .staff-checks { margin-top: 6px; }
.au-list .list li.au-item { display: block; grid-template-columns: none; }
.au-pill { flex: none; align-self: flex-start; }
/* a case's timeline: a centered reading column, slightly larger text */
.case-pane[data-pane="timeline"] { max-width: 860px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.case-pane[data-pane="timeline"] .timeline { font-size: 16px; }
.case-pane[data-pane="timeline"] .timeline .t-meta { font-size: 13px; }
.case-pane[data-pane="timeline"] .timeline .t-body { font-size: 15px; }
.case-pane[data-pane="timeline"] .timeline .t-more { font-size: 13px; }
.case-pane[data-pane="timeline"] .timeline .chips { margin: 4px 0 6px; }
.team .key-made { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.team .key-value { width: 100%; max-width: 560px; font-family: ui-monospace, monospace; font-size: 13px; }
.team td input:not([type=checkbox]):not([type=number]), .team .mc-form input:not([type=number]) { min-width: 12em; }
.doc-row .doc-name { flex: 1; color: var(--accent); }
.doc-row .sh-tag { background: #e8eefb; color: #243C80; padding: 1px 8px; border-radius: 999px; }
.pick-bar .pick-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pick-bar .pick-tools .doc-move { max-width: 180px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.pick-bar .pick-tools :disabled { opacity: .45; cursor: default; }
/* the client's booking page */
.book-wrap { max-width: 760px; }
.book-panel { padding: 18px 20px; margin-bottom: 14px; }
.bk-row { margin-bottom: 18px; }
.bk-label { display: block; font-weight: 600; margin-bottom: 8px; }
.book-panel .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.book-panel .seg button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.book-panel .seg button.on { background: #243C80; border-color: #243C80; color: #fff; }
.bk-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
.bk-day { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 74px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.bk-day b { font-size: 13px; } .bk-day span { font-size: 12px; color: var(--muted); }
.bk-day.on { border-color: #243C80; box-shadow: 0 0 0 1px #243C80; }
.bk-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bk-time { justify-content: center; padding: 9px 6px; }
.bk-chosen { font-weight: 600; margin: 0 0 12px; }
.bk-when { font-size: 18px; font-weight: 600; }
.bk-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.bk-foot { text-align: center; margin-top: 18px; }
.book-panel textarea { width: 100%; box-sizing: border-box; }
.case-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; margin: 2px 0 0; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: #eef1f8; color: #243C80; font-size: 12px; font-weight: 600; }
.tag-chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.tag-add { font-size: 12px; }
.tag-input { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 12px; background: var(--bg); color: var(--text); width: 14em; }
@media (prefers-color-scheme: dark) { .tag-chip { background: #26304a; color: #c9d5f5; } }
.book-panel { max-height: none; min-height: 0; display: block; overflow: visible; }
.book-panel > :not(header) { overflow: visible; }
.book-panel .bk-days { overflow-x: auto; }
.book-panel .seg { display: flex; border: 0; border-radius: 0; overflow: visible; }
.book-panel .seg button { font-size: 14px; color: var(--text); }
.au-list { max-height: none; overflow: visible; }
.au-list > .list { max-height: 60vh; overflow: auto; }
#au-book .au-inline { flex-wrap: wrap; margin: 6px 0; }
#au-book .cd-field { margin: 6px 0; }
.pics .pic-wrap { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.pics .pic-save { font-size: 12px; }
.details-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.quick-edit .lm-heading { margin-top: 14px; }

/* Email ↻ (check for new mail now) */
#email-refresh.spinning { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.au-stage-group { margin-top: 6px; } .au-stage-group strong { font-size: 13px; }
.au-sub { margin: 4px 0 10px 22px; } .au-toggle { display: block; margin-top: 8px; font-weight: 600; }
.pf-book { margin-top: 14px; } .pf-book .btn { margin-left: 6px; }
.fr-list { list-style: none; padding: 0; } .fr-item { padding: 12px 0; border-bottom: 1px solid var(--line, #e5e7eb); } .fr-item .fr-input { margin-top: 6px; }
.file-asks { margin: 8px 0 12px; padding: 8px 10px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; }
.file-ask { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.au-set { margin-bottom: 6px; } .au-set select, .au-set input { min-width: 220px; }
.inv-edit { margin: 12px 0; border: 1px solid var(--line, #d8dde6); border-radius: 8px; padding: 8px 12px; }
.inv-edit > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.inv-edit[open] > summary { margin-bottom: 4px; }
.tag.warn { color: #9a5b00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.warn { color: #f0b45a; } }
:root[data-theme="dark"] .tag.warn { color: #f0b45a; }

/* ---- Email pane enlarged (⤢): laid out like Mac Mail, list with previews on the left, the message on the right ---- */
#email li .pv { display: none; }
@media (min-width: 901px) {
  #p-email.maxed { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #p-email.maxed > header { grid-column: 1 / -1; }
  #p-email.maxed #email { overflow: auto; border-right: 1px solid var(--line); padding: 0 8px 0 0; min-height: 0; }
  #p-email.maxed #email li { padding: 9px 12px; border-bottom: 0; border-radius: 8px; position: relative; }
  #p-email.maxed #email li::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; border-bottom: 1px solid var(--line); }
  #p-email.maxed #email li.on::after, #p-email.maxed #email li:has(+ li.on)::after { border-bottom-color: transparent; }
  #p-email.maxed #email li:hover { background: var(--hover, rgba(127,127,127,.08)); }
  #p-email.maxed #email li .f { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #p-email.maxed #email li .s { color: var(--text); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #p-email.maxed #email li .pv { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    color: var(--muted); font-size: 13px; line-height: 18px; max-height: 36px; margin-top: 2px; flex: none; }
  #p-email.maxed #email li.on { background: #2f6bd8; }
  #p-email.maxed #email li.on .f, #p-email.maxed #email li.on .s, #p-email.maxed #email li.on .when,
  #p-email.maxed #email li.on .pv, #p-email.maxed #email li.on .trash { color: #fff; }
  #p-email.maxed #email li.on.unread .f::before { color: #fff; }
  #p-email.maxed .mail-dock { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  #p-email.maxed .mail-dock[hidden] { display: none; }
  #p-email.maxed .mail-dock > .empty { margin: auto; }
  .reader.docked { position: static; inset: auto; z-index: auto; flex: 1; min-height: 0; padding: 0 0 0 20px; background: transparent;
    display: flex; flex-direction: column; overflow: hidden; }
  .reader.docked[hidden] { display: none; }
  .reader.docked .reader-bar { position: static; top: auto; background: transparent; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
  .reader.docked #reader-back { display: none; }
  .reader.docked .reader-head { max-width: none; margin: 12px 0 10px; }
  .reader.docked .reader-text { max-width: none; margin: 0; flex: 1; min-height: 0; overflow: auto; }
  .reader.docked .reader-html { max-width: none; margin: 0; flex: 1; height: auto; min-height: 0; }
}

/* An enlarged pane says plainly how to get back: "⤡ Shrink" in place of the faint ⤢ (Esc works too; the text is set in common.js) */
.panel.maxed .max { font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 4px 10px; color: var(--text); flex: none; white-space: nowrap; }
.panel.maxed .max:hover { background: var(--accent-soft); }

/* top search: where a key term was found on the matter */
.search-wrap .results .why { color: var(--muted); font-size: 12px; margin-top: 2px; min-width: 220px; max-width: 360px; overflow-wrap: anywhere; }
.search-wrap .results td:nth-child(4) { white-space: nowrap; }

/* ---- AI output | Intake Board switch, and the board (from the Cowork "Contant Law Intake Board") ---- */
#p-feed > header.tt-head { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 8px; }
.tt.aiout { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.tt.aiout.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.tt.board { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-soft); }
.tt.board.on { background: var(--warn); color: #fff; border-color: var(--warn); }
@media (prefers-color-scheme: dark) { .tt.aiout.on, .tt.board.on { color: #1d2330; } }
.ib { display: grid; gap: 12px; align-content: start; }
.ib[hidden] { display: none; }
.ib-tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.ib-tile, .ib-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.ib-tile { display: grid; gap: 4px; align-content: start; color: inherit; text-decoration: none; }
.ib-tile:hover { border-color: var(--accent); }
.ib-when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ib-when.stale { color: var(--warn); }
.ib-sum { font-size: 13px; }
.ib-pill { justify-self: start; font-size: 12px; padding: 0 8px; border-radius: 999px; border: 1px solid currentColor; color: var(--muted); }
.ib-pill.ok { color: var(--good); } .ib-pill.warn { color: var(--warn); } .ib-pill.bad { color: var(--bad); }
.ib-card h3 { margin: 0 0 4px; font-size: 15px; }
.ib-card h4 { margin: 12px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.ib-note { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.ib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ib-list li { display: grid; gap: 2px; padding-left: 10px; border-left: 3px solid var(--line); min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.ib-urgent { border-color: var(--bad-soft); }
.ib-urgent .ib-list li { border-left-color: var(--bad); }
.ib-list .who { font-weight: 600; color: inherit; max-width: none; white-space: normal; overflow: visible; justify-self: start; }
.ib-list a.who:hover { color: var(--accent); }
.ib-list .meta { font-size: 12px; color: var(--muted); }
.ib-list li.none { border: 0; padding: 0; color: var(--muted); }
.ib-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.ib-card details { margin-top: 10px; }
.ib-card summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.ib-hist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12px; }
.ib-hist li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 8px; }
.ib-hist .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.ib-hist .bad { color: var(--bad); }

/* Pay Later (Affirm) on the client's pay page: a link to LawPay's own Pay Later page */
.pay-later { margin-top: 12px; gap: 6px; max-height: none; min-height: 0; flex: none; overflow: visible; }
.pay-later h3 { margin: 0; font-size: 16px; }
.pay-later p { margin: 0 0 6px; }
.pay-later .btn { align-self: flex-start; }
.doc-sort { display: flex; align-items: center; gap: 6px; margin: 4px 0 8px; }

/* scoreboard: pick a fiscal year; Setup › Scoreboard goals */
.board-year { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.board-year select { margin-left: 6px; font: inherit; padding: 4px 8px; }
.goals-page .goal-in { width: 9em; min-width: 7em; margin-left: 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--panel); color: var(--text); height: auto; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.goals-page td { white-space: nowrap; vertical-align: middle; }

/* automation email editor (rich_editor.js) */
.rt-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.rt-bar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px 6px; border-bottom: 1px solid var(--line);
  background: var(--bg); border-radius: 8px 8px 0 0; position: sticky; top: 0; z-index: 2; }
.rt-btn { min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px; background: none;
  color: var(--text); font: inherit; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.rt-btn:hover { background: var(--accent-soft); border-color: var(--line); }
.rt-bar .rt-sel { width: auto; min-width: 0; height: 30px; margin: 0; font-size: 13px; line-height: normal; padding: 2px 6px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--text); }
.rt-word { font-size: 13px; padding: 0 8px; }
.rt-bar .rt-sel:last-child { max-width: 190px; }
.rt-link { color: #1a5fd0; text-decoration: underline; }
.rt-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.rt-area { position: relative; }
.rt-box { min-height: 200px; max-height: 520px; overflow: auto; padding: 10px 12px; outline: none; color: var(--text); line-height: 1.45;
  font-family: Helvetica, Arial, sans-serif; font-size: 14px; -webkit-user-modify: read-write; overflow-wrap: anywhere; }
.rt-wrap.ro .rt-box { -webkit-user-modify: read-only; background: var(--bg); }
.rt-box p { margin: 0 0 .8em; } .rt-box ul, .rt-box ol { margin: 0 0 .8em; padding-left: 1.6em; }
.rt-box blockquote { margin: 0 0 .8em; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.rt-box a { color: #1a5fd0; text-decoration: underline; }
.rt-bubble { position: absolute; z-index: 3; display: flex; gap: 4px; align-items: center; max-width: 320px; padding: 6px 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.rt-bubble[hidden] { display: none; }
.rt-href { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rt-preview { white-space: normal; }
.rt-preview .rt-box { min-height: 0; max-height: none; border: 1px solid var(--line); border-radius: 6px; margin-top: 6px; background: var(--panel); }
/* an email attachment and its "Save to a matter…" button */
#reader-attach .mail-file { display: inline-flex; align-items: center; gap: 6px; margin: 2px 12px 2px 0; }
/* Send Doc: start the first invoice's draft from the intake form */
.draft-inv { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--line, #ddd); border-radius: 8px; }
.draft-inv .sub { margin-top: 4px; }
.draft-inv .warn { color: var(--warn, #a15c00); }
/* the intake form's Invoice activity: the Time & Billing activity box, full width like the other fields */
.act-pick.act-wide { display: block; width: 100%; }
.act-pick.act-wide input { width: 100%; }

/* Scoreboard: every year side by side (Mike, 2026-11-16) */
.compare-wrap { margin-top: 22px; }
.compare-wrap h2 { font-size: 16px; margin: 0 0 10px; }
.compare-wrap .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table.compare { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.compare th, table.compare td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); }
table.compare thead th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
table.compare th:first-child { text-align: left; }
table.compare tbody tr:last-child > * { border-bottom: 0; }
table.compare tr.picked { background: var(--accent-soft); }
table.compare a { color: var(--accent); font-weight: 700; text-decoration: none; }
table.compare .strong { font-weight: 700; }
table.compare .up { color: var(--good); } table.compare .down { color: var(--bad); }

/* Junk / NQ reason (Mike, 2026-11-17) */
.junk-card { width: min(440px, 94vw); }
.junk-reasons { display: grid; gap: 6px; margin: 4px 0 12px; }
.junk-reason { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.junk-reason input { width: auto; min-width: 16px; margin: 0; }
.junk-reason:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rp-why { margin-left: 12px; color: inherit; opacity: .85; font-weight: 400; font-size: 12px; }
.rp-reason { color: var(--muted); }
.jr-list { padding-left: 22px; display: grid; gap: 6px; max-width: 560px; }
.jr-list li { display: flex; gap: 6px; align-items: center; }
.jr-list input, .jr-add input { flex: 1; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: inherit; min-width: 0; }
.jr-add { display: flex; gap: 6px; max-width: 538px; margin: 10px 0 12px 22px; }

/* invoice status pills (billing tab and invoice window), the same colours as the invoice's corner banner */
.inv-pill { display: inline-block; margin-top: 3px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  line-height: 1.5; white-space: nowrap; color: #fff; border: 1px solid transparent; }
.inv-pill.paid { background: #3d8a3a; } .inv-pill.partial { background: #e8b53e; color: #2b2100; }
.inv-pill.unpaid { background: #c0392b; } .inv-pill.void { background: #7a7f87; }
.inv-pill.draft { background: transparent; color: var(--muted); border-color: var(--line); }

/* the several-documents ZIP download's progress box (bottom right) */
.zip-progress { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(320px, calc(100vw - 32px)); padding: 12px 14px;
  border-radius: 10px; background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.18);
  display: grid; gap: 8px; font-size: 13px; }
.zip-progress progress { width: 100%; height: 10px; accent-color: var(--accent); }
.zip-progress .zip-what { color: var(--muted); font-size: 12px; }

/* merging two matters */
.dz-break { flex-basis: 100%; height: 0; }
.merge-card { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.merge-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.merge-pair label { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.merge-pair label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.merge-pair .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.merge-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.merge-table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 13px; }
.merge-table th, .merge-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.merge-table td label { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; }
.merge-table td label:has(input:checked) { font-weight: 600; }
.merge-moves { margin: 4px 0 10px; }
@media (max-width: 600px) { .merge-pair { grid-template-columns: 1fr; } }
.pp-grid .sub { font-size: 12px; color: var(--muted); }
.pp-missed { font-size: 12px; color: var(--bad); font-weight: 600; }
.pp-sum { margin-left: 4px; }
.owed-pick { width: 26px; } .owed-pick input { width: 16px; height: 16px; cursor: pointer; }
.owed-bulk { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.owed-bulk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .owed-bulk-head button { margin-left: auto; }
.owed-bulk .mc-form input[name=deposit] { width: 170px; } .owed-bulk .mc-form .grow { min-width: 140px; }
.owed-bulk-foot { display: flex; align-items: center; gap: 10px; } .owed-bulk-foot .btn { margin-left: auto; white-space: nowrap; flex: none; }
#owed-bulk-status.warn { color: var(--bad); }

/* ---------- the demo copy (demo.py) ---------- */
.demo-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 16px; font-size: 13px;
  background: var(--warn-soft); color: var(--text); border-bottom: 1px solid var(--line); }
.demo-bar strong { color: var(--warn); text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
.demo-bar span { flex: 1 1 320px; }
.demo-fb-card { width: min(520px, 94vw); display: flex; flex-direction: column; gap: 8px; }
.demo-fb-card textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--text); resize: vertical; }
.demo-fb-row { display: flex; gap: 8px; }
.ob-wrap { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 14px; align-items: start; }
.ob-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  max-height: 75vh; overflow-y: auto; }
.ob-list li { padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ob-list li:last-child { border-bottom: 0; }
.ob-list li.on { background: var(--accent-soft); }
.ob-list li:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ob-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.ob-subj { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-to { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-kind { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.ob-kind.got { background: var(--good-soft); color: var(--good); border-color: transparent; }
.ob-view { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-height: 300px; background: var(--panel); }
.ob-view dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0 0 10px; font-size: 13px; }
.ob-view dt { color: var(--muted); } .ob-view dd { margin: 0; overflow-wrap: anywhere; }
.ob-view iframe { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ob-view pre { white-space: pre-wrap; font: inherit; margin: 0; }
.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.fb-list li.done { opacity: .55; }
.fb-list .fb-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.fb-list .fb-text { white-space: pre-wrap; margin: 6px 0 0; }
@media (max-width: 760px) { .ob-wrap { grid-template-columns: 1fr; } .ob-view iframe { height: 50vh; } }
