/* style.css — plain, clean styling. Function over polish. */

:root {
  /* RÊVE Sovereign OS brand palette (brand board 2026-09-11) */
  --ink: #2e2e2e;          /* Charcoal */
  --muted: #6e6659;        /* warm gray, readable on ivory */
  --line: #e5ddd2;         /* Stone */
  --accent: #0b1f2e;       /* Deep Navy */
  --bg: #f8f5ef;           /* Ivory */
  --warn-bg: #fff4e5;
  --warn-border: #d97706;
  --warn-ink: #7c2d12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

header {
  background: var(--accent);
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.brand { font-weight: 700; letter-spacing: 2px; font-size: 20px; }
.tagline { color: #cdd6e4; font-size: 14px; }
.proto { color: #ffd27a; font-weight: 600; }

main { max-width: 820px; margin: 28px auto; padding: 0 20px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

h1 { margin: 0 0 6px; font-size: 22px; }
.sub { color: var(--muted); margin: 0 0 20px; }

label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 4px; }
.doc-desc { color: var(--muted); font-size: 14px; font-style: italic; min-height: 1px; }

select, input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}
textarea { resize: vertical; }
.field { margin-bottom: 4px; }

button {
  margin-top: 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary, a.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); margin: 0; padding: 7px 14px; font-size: 13px; }
a.secondary { display: inline-block; text-decoration: none;
  font-weight: 600; border-radius: 8px; cursor: pointer; }

.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }

.hidden { display: none !important; }

/* Connect-Claude panel */
.connect-card { padding-top: 18px; padding-bottom: 18px; }
.connect-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.connect-head h2 { font-size: 16px; }

.pill {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: #e5e7eb; color: #374151;
}
.pill.engine-live   { background: #dcfce7; color: #166534; }
.pill.engine-bridge { background: #e0e7ff; color: #3730a3; }
.pill.engine-demo   { background: #fef3c7; color: #92400e; }

.radio, .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400;
  font-size: 14px; margin: 8px 0; cursor: pointer; }
.radio input, .check input { width: auto; margin-top: 3px; }

.key-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.key-box summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); }
.key-box code, .connect-card code { background: #eef2ff; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.key-box input[type="password"] { margin-top: 8px; }

/* The required, unmissable attorney-review banner */
.review-banner {
  background: var(--warn-bg);
  border: 2px solid var(--warn-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.review-banner strong { color: var(--warn-border); letter-spacing: 0.5px; }
.review-banner span { color: var(--warn-ink); font-size: 14px; }

.result-head { display: flex; justify-content: space-between; align-items: center; }
h2 { margin: 0; font-size: 18px; }

pre#draft-output {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 13.5px;
  line-height: 1.6;
  margin-top: 14px;
  max-height: 70vh;
  overflow: auto;
}

.status { text-align: center; font-size: 14px; min-height: 20px; }
.status.working { color: var(--accent); }
.status.error { color: #b91c1c; }
.status.ok { color: #166534; }

/* ---- Module navigation (header) ---- */
nav.modules { margin-left: auto; display: flex; gap: 6px; align-items: center; }
nav.modules a {
  color: #cdd6e4; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 6px 14px; border-radius: 999px;
}
nav.modules a.active, nav.modules a:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* ---- The Opportunity Analyzer ---- */
.criteria-heading { margin-bottom: 4px; }

.criterion {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px 10px;
  margin: 12px 0;
  background: #fcfcfd;
}
.criterion.answered { background: #fff; }
.criterion.critical { border-color: var(--warn-border); background: var(--warn-bg); }

.criterion-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.criterion-number {
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
  border-radius: 999px; width: 24px; height: 24px; display: inline-flex;
  align-items: center; justify-content: center; flex: none;
}
.criterion-title { font-weight: 700; font-size: 15px; }
.critical-tag {
  font-size: 12px; font-weight: 600; color: var(--warn-border);
  border: 1px solid var(--warn-border); border-radius: 999px; padding: 2px 10px;
}

.subquestions { margin: 8px 0 10px; padding-left: 34px; color: var(--muted); font-size: 13.5px; }
.subquestions li { margin: 3px 0; }
.subquestions strong { color: var(--ink); }

.answer-row { display: flex; gap: 8px; padding-left: 34px; padding-bottom: 4px; }
.answer {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px;
  font-weight: 600; margin: 0; padding: 6px 16px; border: 1px solid var(--line);
  border-radius: 999px; cursor: pointer; background: #fff;
}
.answer input { width: auto; margin: 0; }
.answer.yes:has(input:checked)    { background: #dcfce7; border-color: #166534; color: #166534; }
.answer.unsure:has(input:checked) { background: #fef3c7; border-color: #92400e; color: #92400e; }
.answer.no:has(input:checked)     { background: #fee2e2; border-color: #b91c1c; color: #b91c1c; }

/* ---- The verdict ---- */
.verdict-banner { border-radius: 10px; padding: 22px 24px; text-align: center; }
.verdict-banner.verdict-go   { background: #dcfce7; border: 2px solid #166534; }
.verdict-banner.verdict-stop { background: #fee2e2; border: 2px solid #b91c1c; }
.verdict-headline { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.verdict-go .verdict-headline   { color: #166534; }
.verdict-stop .verdict-headline { color: #b91c1c; }
.verdict-message { margin-top: 8px; font-size: 15px; color: var(--ink); }

#exchange-offer { margin-top: 16px; text-align: center; }
#exchange-offer .sub { margin-bottom: 8px; }
#again-btn { display: block; margin: 18px auto 0; }

/* ---- Recent runs table ---- */
.runs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.runs-table th, .runs-table td { white-space: nowrap; }
.runs-table th.wrap, .runs-table td.wrap { white-space: normal; }
.runs-table td.wrap { min-width: 240px; }
/* One-line description cells: full text on hover, never two rows */
.runs-table td.clip1 { max-width: 340px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
/* Fit mode: on desktop these tables always fit their card exactly.
   Fixed column layout; long text trims with an ellipsis (full text on
   hover) instead of pushing the last columns off screen. On small
   screens they fall back to sideways scrolling. */
/* Narrow desktop windows: the least critical columns step back so
   client and matter names keep readable space. */
@media (max-width: 1199px) {
  .runs-table .hide-narrow { display: none; }
}
@media (min-width: 901px) {
  .fit-table { table-layout: fixed; width: 100%; }
  .fit-table th, .fit-table td { overflow: hidden;
    text-overflow: ellipsis; }
  .fit-table td.clip1 { max-width: none; }
}
/* Make sideways scrolling obvious: a scrollbar that is always there,
   not the Mac overlay one that hides until you touch it. */
.table-scroll { scrollbar-width: thin; scrollbar-color: #cfc4b0 #f3efe7; }
.table-scroll::-webkit-scrollbar { height: 9px; }
.table-scroll::-webkit-scrollbar-track { background: #f3efe7;
  border-radius: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: #cfc4b0;
  border-radius: 8px; }
/* Action column pinned to the right edge, so its buttons never get cut
   off when a wide table scrolls sideways inside its card. */
.runs-table th.sticky-act, .runs-table td.sticky-act {
  position: sticky; right: 0; background: #fff; }
.table-scroll.is-scrollable .sticky-act {
  box-shadow: -10px 0 10px -10px rgba(11, 31, 46, 0.28); }
.runs-table th.sticky-act-l, .runs-table td.sticky-act-l {
  position: sticky; left: 0; background: #fff; }
.table-scroll.is-scrollable .sticky-act-l {
  box-shadow: 10px 0 10px -10px rgba(11, 31, 46, 0.28); }
button, .btn-xs, .pdf-btn, .cat-pill, .unvetted-pill, .pill-overdue,
.pill-none { white-space: nowrap; }
/* New matter wizard stepper: the MyCase-style circle trail. */
.nm-stepper { display: flex; align-items: flex-start; margin: 14px 0 16px; }
.nm-sitem { flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px; position: relative; }
.nm-sitem:not(:first-child)::before { content: ""; position: absolute;
  top: 12px; right: 50%; width: 100%; height: 2px;
  background: var(--line); z-index: 0; }
.nm-sitem.done:not(:first-child)::before,
.nm-sitem.current:not(:first-child)::before { background: var(--accent); }
.nm-sdot { width: 25px; height: 25px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; position: relative; z-index: 1; }
.nm-sitem.current .nm-sdot { border-color: var(--accent);
  background: var(--accent); color: #f8f5ef; }
.nm-sitem.done .nm-sdot { border-color: var(--accent);
  background: #fff; color: var(--accent); }
.nm-sitem.done { cursor: pointer; }
.nm-sitem.done:hover .nm-sdot { background: #f3efe7; }
.nm-slab { font-size: 10.5px; letter-spacing: .04em; text-transform:
  uppercase; color: var(--muted); font-weight: 600; }
.nm-sitem.current .nm-slab { color: var(--accent); }

/* Stacked choice cards carry sentences; they wrap. */
button.nmm-type-btn { white-space: normal; border: 1px solid var(--line);
  border-radius: 14px; background: #fff; padding: 13px 16px !important;
  line-height: 1.45; transition: border-color .12s ease,
  box-shadow .12s ease, transform .12s ease; }
button.nmm-type-btn strong { color: var(--accent); font-size: 14.5px; }
button.nmm-type-btn .hint { font-size: 12.5px; margin-top: 2px;
  display: inline-block; }
button.nmm-type-btn:hover { border-color: #8b6f45;
  box-shadow: 0 6px 18px rgba(11, 31, 46, .10);
  transform: translateY(-1px); }
.card:has(.runs-table) { overflow-x: auto; }
.runs-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.runs-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.runs-table td.verdict-yes { color: #166534; font-weight: 700; }
.runs-table td.verdict-no  { color: #b91c1c; font-weight: 700; }

/* ---- The OP Exchange ---- */
main.wide { max-width: 1100px; }
.kind-row { display: flex; gap: 10px; margin-bottom: 6px; }
.exchange-form button { margin-top: 16px; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 860px) { .columns { grid-template-columns: 1fr; } }
.column h2 { margin-bottom: 4px; }

.listing { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; background: #fcfcfd; }
.listing-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-pill {
  font-size: 12px; font-weight: 700; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 2px 10px;
}
.source-pill {
  font-size: 12px; font-weight: 600; color: #3730a3; background: #e0e7ff;
  border-radius: 999px; padding: 3px 10px;
}
.listing-when { margin-left: auto; color: var(--muted); font-size: 12px; }
.listing-title { font-weight: 700; font-size: 15px; margin-top: 8px; }
.listing-details { color: var(--muted); font-size: 14px; margin-top: 4px; }
.listing-actor { color: var(--muted); font-size: 13px; margin-top: 8px; font-style: italic; }

.held-banner {
  margin-top: 14px; background: var(--warn-bg); border: 2px solid var(--warn-border);
  color: var(--warn-ink); border-radius: 8px; padding: 12px 14px; font-size: 14px;
}

/* ---- The Value Ledger ---- */
.estimate-banner {
  background: var(--warn-bg); border: 2px solid var(--warn-border);
  border-radius: 8px; padding: 14px 16px; margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.estimate-banner strong { color: var(--warn-border); letter-spacing: 0.5px; }
.estimate-banner span { color: var(--warn-ink); font-size: 14px; }

.ledger-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
@media (max-width: 700px) { .ledger-summary { grid-template-columns: 1fr; } }
.ledger-box { border: 1px solid var(--line); border-radius: 10px; padding: 18px; text-align: center; }
.ledger-box.returned { border-color: #166534; background: #f0fdf4; }
.ledger-box-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.ledger-box-amount { font-size: 32px; font-weight: 800; margin-top: 4px; }
.ledger-box.returned .ledger-box-amount { color: #166534; }

.ledger-table td { vertical-align: top; }
.ledger-line-label { font-weight: 700; }
.ledger-amount { font-weight: 700; white-space: nowrap; }
.ledger-amount.activity { white-space: normal; }
.ledger-method { color: var(--muted); font-size: 13px; }

/* ---- My Mandate ---- */
.asset-row { flex-wrap: wrap; padding-left: 0; margin-top: 6px; }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .range-row { grid-template-columns: 1fr; } }

.listing.match { border-color: #166534; background: #f0fdf4; }
.listing.no-match { opacity: 0.85; }

.check-table { margin-top: 10px; font-size: 13px; }
.check-table th { font-size: 12px; }
tr.check-pass td:nth-child(2) { color: #166534; font-weight: 700; }
tr.check-fail td:nth-child(2) { color: #b91c1c; font-weight: 700; }
tr.check-na td:nth-child(2) { color: var(--muted); }

/* ---- Member gate and consent ---- */
.gate-card { max-width: 460px; margin: 60px auto; }
.gate-error { color: #b91c1c; font-size: 14px; margin: 8px 0 0; }
.consent-body p { font-size: 14.5px; line-height: 1.65; }
.consent-check { margin-top: 18px; font-size: 14.5px; font-weight: 600; }

/* ---- Review handoff and The Moat ---- */
.handoff { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.handoff h2 { font-size: 16px; }
.handoff button { margin-top: 10px; }
.review-confirm {
  background: #f0fdf4; border: 1px solid #166534; color: #166534;
  border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-top: 12px;
}
.review-confirm.billable { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-ink); }
.billable-pill { font-size: 12px; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg);
  border: 1px solid var(--warn-border); border-radius: 999px; padding: 2px 10px; }
.included-pill { font-size: 12px; font-weight: 700; color: #166534; background: #dcfce7;
  border: 1px solid #166534; border-radius: 999px; padding: 2px 10px; }

/* ---- Guided drafting (interview mode) ---- */
.transcript { max-height: 55vh; overflow-y: auto; padding: 4px 2px; }
.turn { margin: 10px 0; padding: 12px 14px; border-radius: 10px; }
.turn.engine { background: #f3f6fb; border: 1px solid var(--line); margin-right: 10%; }
.turn.member { background: #eef7f0; border: 1px solid #cde3d2; margin-left: 10%; }
.turn-who { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.turn-text { font-size: 14.5px; white-space: pre-wrap; margin-top: 4px; }

#composer { margin-top: 14px; }
#input-row { display: flex; gap: 10px; align-items: flex-end; }
#input-row textarea { flex: 1; }
#input-row button { margin: 0; padding: 12px 18px; }

.doc-block { margin-top: 18px; }
.doc-text {
  white-space: pre-wrap; word-wrap: break-word; background: #fafafa;
  border: 1px solid var(--line); border-radius: 8px; padding: 18px;
  font-family: "SF Mono", "Menlo", monospace; font-size: 13px; line-height: 1.6;
  margin-top: 10px; max-height: 55vh; overflow: auto;
}

.studio-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 700px) { .studio-modes { grid-template-columns: 1fr; } }
.mode-tile { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink); display: block; background: #fcfcfd; }
.mode-tile:hover { border-color: var(--accent); }
/* Search filtering must beat the tiles' own display rules */
.mode-tile.hidden, .st-cat.hidden, #st-none.hidden { display: none !important; }
.mode-title { font-weight: 700; color: var(--accent); }
.mode-desc { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

.mode-review { font-size: 12px; color: var(--warn-ink); background: var(--warn-bg); border-radius: 6px; padding: 4px 8px; margin-top: 8px; display: inline-block; }
.review-note { font-size: 14px; color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 8px; padding: 8px 12px; }

/* ---- PLG desk ---- */
.intake-doc { margin-top: 10px; }
.intake-doc summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--accent); }

/* ---- The Hunt Room ---- */
.unvetted-pill { font-size: 12px; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg);
  border: 1px solid var(--warn-border); border-radius: 999px; padding: 2px 10px; }
.fit-pill { font-size: 12px; font-weight: 700; color: #166534; background: #dcfce7;
  border: 1px solid #166534; border-radius: 999px; padding: 2px 10px; }
.scope-note { font-size: 13px; color: var(--warn-ink); background: var(--warn-bg);
  border: 1px solid var(--warn-border); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; line-height: 1.5; }
nav.modules a.signout { opacity: 0.7; font-weight: 400; }
select.view-switch {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  width: auto; background: rgba(255,255,255,0.14); color: #cdd6e4; border: none;
  border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; line-height: inherit;
}
select.view-switch:hover { color: #fff; }
select.view-switch option { color: var(--ink); }

/* ---- quick-reply chips + rendered engine text ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px 6px; }
.chip { margin: 0; background: #fff; color: var(--accent); border: 1.5px solid var(--accent);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; }
.chip:hover { background: #eef2ff; }
.turn-text p { margin: 0 0 8px; }
.turn-text ul, .turn-text ol { margin: 4px 0 8px 20px; }
.turn-text li { margin: 2px 0; }
.matter-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px; margin: 8px 0; text-decoration: none; color: var(--ink); background: #fcfcfd; }
.matter-row:hover { border-color: var(--accent); background: #f3f6fb; }
.matter-label { font-weight: 700; font-size: 15px; }
.matter-row .listing-when { margin-left: auto; }

/* Search inputs on the PLG desk */
input.matter-search { width: 100%; box-sizing: border-box; margin: 6px 0 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; }
input.matter-search:focus { outline: none; border-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 31, 46, .12); }
input, select, textarea { transition: border-color .12s ease,
  box-shadow .12s ease; }

/* Staff-side progress bars and row call-to-action cues */
.progress-wrap { display: inline-block; width: 110px; height: 8px;
  background: #e4e9f0; border-radius: 4px; overflow: hidden; flex: none; }
.progress-wrap.progress-wide { width: 260px; height: 10px; }
.progress-bar { display: block; height: 100%; background: var(--accent);
  border-radius: 4px; }
.progress-pct { font-size: 0.8rem; color: var(--muted, #667); flex: none; }
.progress-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.matter-row .row-cta { font-size: 0.8rem; color: var(--accent);
  white-space: nowrap; flex: none; }
a.pdf-btn { display: inline-block; text-decoration: none; }
a.pdf-btn { background: #fff; color: var(--accent); border: 1px solid var(--accent);
  padding: 7px 14px; font-size: 13px; border-radius: 6px; }
a.pdf-btn:hover { background: #f3f6fb; }
select.row-actions { padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; font-size: 13px; background: #fff;
  color: var(--accent); cursor: pointer; }
select.row-actions:focus { outline: none; border-color: var(--accent); }

/* The matter page: Clio-flavored, tabs and clean reading typography */
.matter-head h1 { margin: 0 0 6px; }
.matter-meta { display: flex; align-items: center; gap: 10px; color: var(--muted);
  font-size: 13.5px; margin: 0 0 10px; }
.action-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.nm-sug { border: 1px solid var(--line); border-radius: 8px;
  margin: 4px 0 8px; max-height: 190px; overflow: auto; }
.nm-sug button { display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 7px 10px; font: inherit;
  font-size: 13px; cursor: pointer; color: var(--ink); margin: 0; }
.nm-sug button:hover { background: #f3f6fb; }
.nm-sug .hint { padding: 7px 10px; margin: 0; }
.nm-sug-row { display: flex; align-items: center; }
.nm-sug-row button { flex: 1; width: auto; }
.nm-sug-open { flex: none; font-size: 12px; font-weight: 600;
  padding: 3px 10px; margin-right: 6px; color: var(--accent);
  text-decoration: none; border: 1px solid var(--line);
  border-radius: 99px; background: #fff; white-space: nowrap; }
.nm-sug-open:hover { border-color: var(--accent); }
.nm-dup-live { border: 1px solid #d8c9a8; background: #f9f4ea;
  border-radius: 10px; padding: 8px 12px; margin: 8px 0 4px; }
.nm-dup-row { display: flex; align-items: center; gap: 8px;
  margin: 5px 0; flex-wrap: wrap; }
.nm-dup-row .nm-dup-name { font-weight: 600; font-size: 13px;
  flex: 1 1 100%; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 40px; box-sizing: border-box; width: 100%; }
.pw-eye { position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%); margin: 0; padding: 4px 6px;
  background: none; border: none; cursor: pointer; color: var(--muted);
  line-height: 1; }
.pw-eye:hover { color: var(--ink); }
.set-layout { display: flex; gap: 18px; align-items: flex-start;
  margin-top: 18px; }
.set-rail { width: 190px; flex-shrink: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  position: sticky; top: 14px; }
.set-rail-head { font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.08em; color: var(--muted); padding: 10px 10px 4px; }
.set-rail .tab-btn { display: block; width: 100%; text-align: left;
  background: none; border: none; margin: 0 0 1px; padding: 7px 10px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  border-radius: 8px; cursor: pointer; }
.set-rail .tab-btn:hover { background: #f3f6fb; color: var(--ink); }
.set-rail .tab-btn.active { background: var(--accent); color: #fff; }
.set-rail .tab-btn .side-count { float: right; font-size: 12px;
  color: var(--muted); }
.set-rail .tab-btn.active .side-count { color: rgba(255,255,255,0.75); }
.set-body { flex: 1; min-width: 0; }
.set-body .sec { margin-top: 0; }
/* Settings list rows: never crush the name — wrap instead, with the
   email/meta detail dropping to its own line under the controls. */
.set-body .matter-row { flex-wrap: wrap; gap: 8px 10px; }
.set-body .matter-label { white-space: nowrap; }
.set-body .matter-row .listing-when { margin-left: 0; flex-basis: 100%;
  order: 9; }
@media (max-width: 900px) {
  .set-layout { flex-direction: column; }
  .set-rail { width: 100%; position: static; display: flex;
    flex-wrap: wrap; gap: 2px; align-items: center; }
  .set-rail .tab-btn { width: auto; }
  .set-rail-head { width: 100%; padding: 6px 10px 2px; }
}
/* Formatted document rendering (member drafts on screen) */
.doc-html { background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 22px; max-height: 560px;
  overflow-y: auto; font-size: 13.5px; line-height: 1.55;
  font-family: Georgia, "Times New Roman", serif; }
.doc-html .doc-h { font-size: 14px; margin: 16px 0 6px; font-weight: 700;
  font-family: inherit; }
.doc-html .doc-p { margin: 0 0 8px; }
.doc-html .doc-item { margin-left: 20px; }

/* Client portal case-status stepper */
.ps-steps { display: flex; align-items: flex-start; margin: 14px 0 4px; }
.ps-step { flex: 1; text-align: center; position: relative;
  font-size: 11.5px; color: var(--muted); padding: 0 2px; }
.ps-dot { width: 22px; height: 22px; border-radius: 50%; margin: 0 auto 5px;
  background: #fff; border: 2px solid var(--line); display: flex;
  align-items: center; justify-content: center; font-size: 11px;
  font-weight: 700; color: var(--muted); position: relative; z-index: 1; }
.ps-line { position: absolute; top: 11px; right: 50%; width: 100%;
  height: 2px; background: var(--line); z-index: 0; }
.ps-step:first-child .ps-line { display: none; }
.ps-step.done .ps-dot { background: #1a6b34; border-color: #1a6b34;
  color: #fff; }
.ps-step.done .ps-line { background: #1a6b34; }
.ps-step.current .ps-dot { border-color: var(--accent);
  color: var(--accent); }
.ps-step.current { color: var(--ink); font-weight: 700; }
.ps-step.current .ps-line { background: #1a6b34; }
.ps-list { margin: 6px 0 0 18px; padding: 0; font-size: 13.5px; }
.ps-list li { margin: 4px 0; }
@media (max-width: 640px) { .ps-step { font-size: 10px; } }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 10px; }
.chip-row.hidden { display: none; }
.chip-btn { margin: 0; padding: 6px 12px; font-size: 12.5px;
  background: #fff; color: var(--accent); border: 1px solid var(--accent);
  border-radius: 99px; cursor: pointer; }
.chip-btn:hover { background: #f3f6fb; }
.chip-btn.sel { background: var(--accent); color: #fff; font-weight: 700; }
.chip-send { margin: 0; padding: 6px 14px; font-size: 12.5px;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  border-radius: 99px; cursor: pointer; font-weight: 700; }
.chip-send:disabled { opacity: .45; cursor: default; }
/* The drafting interview's progress bar: quiet, top of the chat card. */
.iv-progress { display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; }
.iv-progress.hidden { display: none; }
.iv-progress-track { flex: 1; height: 6px; border-radius: 99px;
  background: var(--line); overflow: hidden; }
.iv-progress-fill { height: 100%; width: 0; border-radius: 99px;
  background: var(--accent); transition: width .6s ease; }
.iv-progress-label { font-size: 11.5px; font-weight: 700;
  color: var(--muted); letter-spacing: .5px; min-width: 86px;
  text-align: right; }
/* The honest out: always available, never buried in the chips. */
.idk-btn { background: #fff; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  font-size: 13px; white-space: nowrap; }
.idk-btn:hover { color: var(--accent); border-color: var(--accent); }
/* Finished documents: one labeled line per way to take it home. */
.doc-actions { display: flex; flex-direction: column; gap: 7px;
  align-items: flex-start; margin: 8px 0 14px; }
.doc-actions .pdf-btn, .doc-actions .secondary { margin: 0; }
/* The fork at the end of a drafting session: two clear paths. */
.next-path { border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-top: 12px; }
.next-path h3 { margin: 0 0 4px; font-size: 14.5px; }
.next-path .sub { margin: 0 0 10px; }
/* My Drafts: one folded row per draft, so a busy member's list stays
   a list. */
.draft-fold { border: 1px solid var(--line); border-radius: 12px;
  padding: 0; margin-top: 10px; background: #fff; }
.draft-fold summary { cursor: pointer; padding: 12px 16px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  list-style-position: inside; }
.draft-fold summary strong { font-size: 14.5px; }
.draft-fold .draft-body { padding: 0 16px 14px; }
.rename-row { display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; margin-top: 14px; }
.rename-row input { flex: 1; min-width: 240px; margin: 0; }
.rename-row button, .rename-row .secondary { margin: 0; }
.rename-row .status { margin: 0; }
.moat-send { margin: 0; }
/* The rename pencil: quiet until hovered, an inline field when clicked. */
.df-pencil { background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 14px; padding: 0 2px; margin: 0;
  line-height: 1; }
.df-pencil:hover { color: var(--accent); }
.df-pencil.hidden, .df-name.hidden { display: none; }
.df-editbox { display: inline-flex; gap: 6px; align-items: center; }
.df-edit { margin: 0; padding: 5px 9px; font-size: 13.5px;
  width: min(320px, 60vw); }
.df-save { margin: 0; padding: 5px 12px; font-size: 12.5px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; cursor: pointer; font-weight: 700; }

/* The Classroom: course cards, curriculum, lesson pages. */
.crs-grid { display: grid; gap: 16px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.crs-card { display: block; border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; background: #fff;
  text-decoration: none; color: inherit;
  transition: box-shadow .15s ease; }
a.crs-card:hover { box-shadow: 0 8px 26px rgba(11,31,46,.12); }
.crs-locked { opacity: .92; }
.crs-cover { height: 120px; background-size: cover;
  background-position: center; position: relative; }
.crs-cover-brand { background: linear-gradient(160deg, #0b1f2e, #16354a);
  display: flex; align-items: center; justify-content: center; }
.crs-cover-brand span { font-family: "Cormorant Garamond", serif;
  color: #f8f5ef; font-size: 22px; letter-spacing: 5px; }
.crs-cover-brand em { color: #cbb887; font-style: normal; }
.crs-flag { position: absolute; top: 10px; right: 10px;
  background: rgba(11,31,46,.85); color: #f8f5ef; font-size: 10px;
  letter-spacing: 1.5px; font-weight: 700; padding: 4px 9px;
  border-radius: 99px; }
.crs-body { padding: 14px 16px 16px; }
.crs-body h2 { margin: 0 0 4px; font-size: 16px; }
.crs-meta { display: flex; justify-content: space-between;
  align-items: center; margin-top: 8px; }
.crs-ring { font-size: 12px; font-weight: 800; color: var(--accent); }
.crs-hero { height: 180px; border-radius: 12px; background-size: cover;
  background-position: center; margin-bottom: 14px; }
.crs-module { margin-top: 14px; }
.crs-module h3 { margin: 0 0 6px; font-size: 14px;
  letter-spacing: .5px; }
.crs-lesson { text-decoration: none; color: inherit; }
.crs-tick { width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line); display: inline-flex;
  align-items: center; justify-content: center; font-size: 11.5px;
  font-weight: 700; color: var(--muted); flex: 0 0 24px; }
.crs-tick.done { background: #1a6b34; border-color: #1a6b34;
  color: #fff; }
.crs-video { position: relative; padding-top: 56.25%;
  border-radius: 12px; overflow: hidden; margin: 10px 0 14px;
  background: #0b1f2e; }
.crs-video iframe { position: absolute; inset: 0; width: 100%;
  height: 100%; border: 0; }
.luxe .card.crs-upsell, .card.crs-upsell, .crs-upsell {
  background: linear-gradient(160deg, #0b1f2e, #16354a);
  border-color: #0b1f2e; color: #f8f5ef; }
.luxe .card.crs-upsell h2, .crs-upsell h2 { color: #f8f5ef; }
.luxe .card.crs-upsell .sub, .crs-upsell .sub { color: #d9d2c4; }
.crs-unlock { background: #cbb887; color: #0b1f2e; border: none;
  border-radius: 10px; padding: 11px 18px; font-weight: 800;
  cursor: pointer; font-size: 14px; }
.crs-unlock:hover { background: #d9c99e; }
.crs-admin-module { border-top: 1px solid var(--line);
  padding-top: 4px; margin-top: 10px; }
/* Space quick links: one notch in from the section's main entries. */
.side-links .side-sub { padding-left: 30px; font-size: 13px;
  opacity: .88; }
.side-links .side-locked { opacity: .55; }
.side-links .side-locked:hover { opacity: .8; }
.side-lock { font-size: 10px; margin-left: 4px; }
.cm-ptext a, .community-post a { color: var(--accent);
  font-weight: 600; word-break: break-all; }

/* Locked Studio documents: visible, named, and not clickable through. */
button.mode-tile.st-locked { text-align: left; font: inherit;
  cursor: pointer; opacity: .62; background: #fff;
  border-style: dashed; }
button.mode-tile.st-locked:hover { opacity: .85; }
.st-lock { font-size: 12px; margin-left: 4px; }
.st-incl { margin-top: 6px; font-size: 11px; letter-spacing: 1px;
  font-weight: 700; color: var(--accent); text-transform: uppercase; }

/* The law firm door. */
.luxe .card.clp-cta, .card.clp-cta {
  background: linear-gradient(160deg, #0b1f2e, #16354a);
  border-color: #0b1f2e; color: #f8f5ef; }
.luxe .card.clp-cta h2, .card.clp-cta h2 { color: #f8f5ef; }
.luxe .card.clp-cta .sub, .card.clp-cta .sub { color: #d9d2c4; }

/* Membership levels. */
.lv-card { border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-top: 12px; background: #fff; }
.lv-card.lv-here { border-color: var(--accent); box-shadow:
  0 0 0 1px var(--accent); }
.lv-head { display: flex; align-items: center; gap: 10px; }
.lv-head h2 { margin: 0; }
.lv-you { font-size: 10px; letter-spacing: 1.5px; font-weight: 800;
  color: var(--accent); }

/* My account. */
.acct-row { display: flex; gap: 16px; align-items: center;
  margin-top: 8px; }
.acct-photo { width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--line); }
.acct-initials { display: flex; align-items: center;
  justify-content: center; background: #0b1f2e; color: #f8f5ef;
  font-weight: 800; font-size: 22px; }
.acct-initials.hidden { display: none; }
.ma-btn { position: relative; overflow: hidden; }
.ma-photo { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; }
.room-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.room-face { position: relative; width: 40px; height: 40px;
  border-radius: 50%; background: #0b1f2e; color: #f8f5ef;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; overflow: hidden;
  border: 2px solid var(--line); }
.room-face img { position: absolute; inset: 0; width: 100%;
  height: 100%; object-fit: cover; }
/* Record tabs (contact + matter pages): compact, and they wrap onto a
   second line on narrow screens instead of growing a scrollbar. */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 18px 0 0;
  border-bottom: 2px solid var(--line); }
.tab-btn { background: none; border: none; padding: 8px 12px; font: inherit;
  font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  white-space: nowrap; border-bottom: 2px solid transparent;
  margin-bottom: -2px; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { margin-top: 14px; }
.doc-card { padding: 4px 0 18px; border-bottom: 1px solid var(--line); }
.doc-card:last-child { border-bottom: none; }
.doc-card h2 { margin: 10px 0 4px; }
.doc-body { font-size: 15px; line-height: 1.65; max-width: 74ch; }
.doc-body h1, .doc-body h2, .doc-body h3 { margin: 18px 0 6px; line-height: 1.3; }
.doc-body h1 { font-size: 19px; } .doc-body h2 { font-size: 17px; }
.doc-body h3 { font-size: 15.5px; }
.doc-body p { margin: 0 0 10px; }
.doc-body ul, .doc-body ol { margin: 6px 0 12px 22px; }
.doc-body li { margin: 3px 0; }
.doc-body strong { color: var(--ink); }
.matter-chat { max-height: 62vh; }
.file-table td, .file-table th { font-size: 13.5px; }
.upload-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Option B matter layout: sidebar file cabinet */
.matter-layout { display: flex; max-width: 1080px; margin: 28px auto;
  padding: 0 20px; gap: 18px; align-items: flex-start; }
.matter-side { width: 210px; flex: none; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px;
  position: sticky; top: 16px; }
.matter-side .side-link { display: block; padding: 10px 14px; border-radius: 8px;
  text-decoration: none; color: var(--ink); font-size: 14.5px; }
.matter-side .side-link.active { background: #eef2f8; color: var(--accent);
  font-weight: 700; }
.matter-side .side-link:hover { background: #f3f6fb; }
.side-count { float: right; color: var(--muted); font-size: 12.5px; }
.matter-content { flex: 1; min-width: 0; }
.activity-feed { border-left: 2px solid var(--line); margin: 6px 0 4px 6px;
  padding-left: 16px; }
.activity-item { position: relative; padding: 7px 0; font-size: 14px; }
.activity-item::before { content: ""; position: absolute; left: -21px;
  top: 14px; width: 8px; height: 8px; border-radius: 4px;
  background: var(--accent); }
.activity-when { color: var(--muted); font-size: 12.5px; display: block; }
.activity-who { color: var(--muted); font-size: 12.5px; margin-left: 6px; }

/* Clio-style application shell: dark left sidebar, top bar, content */
body.app { display: flex; min-height: 100vh; background: var(--bg); margin: 0; }
.side-nav { width: 212px; flex: none; background: var(--accent); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; }
.side-brand { font-weight: 700; letter-spacing: 2px; font-size: 17px;
  padding: 20px 18px 14px; line-height: 1.25; }
.side-brand span { font-size: 11px; letter-spacing: 3px; color: #cdd6e4; }
.side-links { flex: 1; padding: 6px 10px; }
.side-links a { display: block; color: #cdd6e4; text-decoration: none;
  padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 1px 0; }
.side-links a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-links a.active { background: rgba(255,255,255,.16); color: #fff;
  font-weight: 600; }
.side-sec { font-size: 11px; letter-spacing: 1.5px; color: #8fa1bd;
  font-weight: 700; padding: 16px 12px 4px; }
.side-head { flex: none; }
.menu-btn { display: none; background: rgba(255,255,255,.14); color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  padding: 7px 13px; cursor: pointer; font-family: inherit; }
.side-bottom { padding: 12px 10px 16px; border-top: 1px solid rgba(255,255,255,.15); }
.side-bottom a { display: block; color: #cdd6e4; text-decoration: none;
  padding: 7px 12px; font-size: 13px; }
.side-bottom a:hover { color: #fff; }
.side-bottom select.view-switch { display: block; width: 100%;
  margin: 0 0 6px; text-align: left; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-bar { background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 10px 22px;
  position: sticky; top: 0; z-index: 10; }
.top-bar .tb-title { flex: 1; font-weight: 700; color: var(--muted);
  font-size: 13px; letter-spacing: .5px; }
.global-search { flex: 1; max-width: 440px; }
.global-search input { width: 100%; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; font-size: 13.5px; background: var(--bg); }
.global-search input:focus { outline: none; border-color: var(--accent); background: #fff; }
.quick-create { position: relative; }
.quick-create > button { background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 8px 16px; font: inherit; font-size: 13.5px;
  font-weight: 600; cursor: pointer; }
.qc-menu { position: absolute; right: 0; top: 40px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20,30,60,.13); min-width: 210px; padding: 6px;
  z-index: 20; }
.qc-menu a { display: block; padding: 9px 13px; border-radius: 7px;
  text-decoration: none; color: var(--ink); font-size: 14px; }
.qc-menu a:hover { background: #f3f6fb; }
.top-user { margin-left: auto; color: var(--muted); font-size: 13px;
  white-space: nowrap; }
body.app main { max-width: 900px; margin: 22px auto; padding: 0 22px; width: 100%; }
body.app main.wide { max-width: 1120px; }
/* Full-screen money screens (Billing), MyCase-style. */
main.xwide, body.app main.xwide { max-width: none; }
/* Dashboard stat tiles */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; }
.stat .n { font-size: 26px; font-weight: 700; color: var(--accent); }
.stat .l { font-size: 12.5px; color: var(--muted); }

/* Clio matter dashboard: two columns, financial boxes, contact card */
.two-col { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; }
.two-col .col-main { flex: 1; min-width: 0; }
.two-col .col-side { width: 320px; flex: none; }
.fin-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fin-head h2 { margin: 0; }
.fin-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.fin-box { background: #eef7f0; border: 1px solid #cde3d2; border-radius: 8px;
  padding: 14px 16px; text-align: center; }
.fin-label { font-size: 12.5px; color: #1a6b34; font-weight: 600; }
.fin-amount { font-size: 24px; font-weight: 700; color: #14522a; margin-top: 2px; }
.fin-sub { font-size: 11.5px; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-top: 8px; font-size: 14px; }
.d-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.contact-card { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.avatar { width: 42px; height: 42px; border-radius: 21px; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex: none; }
.contact-lines { font-size: 13.5px; color: var(--ink); line-height: 1.7; margin: 6px 0 0; }
.matter-title { color: var(--accent); }
/* Messaging threads */
.msg-thread { max-height: 40vh; overflow-y: auto; margin: 8px 0; }
.msg { border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.msg.from-team { background: #f3f6fb; border: 1px solid var(--line); margin-right: 12%; }
.msg.from-client { background: #eef7f0; border: 1px solid #cde3d2; margin-left: 12%; }
.msg-who { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.msg-text { font-size: 14px; white-space: pre-wrap; margin-top: 2px; }
/* Folders */
details.folder { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
details.folder summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
details.folder summary .side-count { float: none; margin-left: 6px; }
/* Tasks */
tr.task-done, .task-row.task-done { opacity: .55; }
.task-notes { margin: -4px 0 8px 8px; }
/* Matters table, Clio style */
.filter-row { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.filter-tabs { display: inline-flex; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; }
.f-tab { background: #fff; border: none; border-right: 1px solid var(--line);
  padding: 7px 16px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.f-tab:last-child { border-right: none; }
.f-tab.active { background: var(--accent); color: #fff; font-weight: 600; }
.matters-table td { vertical-align: middle; }
a.matter-link { color: var(--accent); font-weight: 600; text-decoration: none; }
a.matter-link:hover { text-decoration: underline; }
/* MyCase-style dashboard: quick actions + colored stat boxes + big number */
.qa-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.qa-btn { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px;
  font-size: 13.5px; color: var(--ink); text-decoration: none; background: #fff; }
.qa-btn:hover { border-color: var(--accent); color: var(--accent); background: #f3f6fb; }
.mc-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.mc-boxes-3 { grid-template-columns: 1fr 1fr 1fr; }
.mc-box { border-radius: 8px; padding: 12px 14px; border: 1px solid var(--line); }
.mc-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.mc-amount { font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.mc-plain { background: #f7f7f9; }
.mc-yellow { background: #fdf3d7; border-color: #ecd9a0; }
.mc-yellow .mc-label { color: #8a6d1a; }
.mc-red { background: #fde3e3; border-color: #f0b9b9; }
.mc-red .mc-label { color: #a03030; }
.mc-green { background: #e6f6ea; border-color: #bfe3c9; }
.big-number { font-size: 54px; font-weight: 800; color: var(--ink); line-height: 1; margin: 8px 0 12px; }
.stat-lines { border-top: 1px solid var(--line); }
.stat-line { display: flex; justify-content: space-between; padding: 9px 2px;
  border-bottom: 1px solid #f0f1f4; font-size: 14px; }
.stat-line span:last-child { font-weight: 700; }
/* Modal */
.modal-overlay { position: fixed; inset: 0;
  background: rgba(11, 31, 46, .38);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 60; padding: 18px; }
.modal { background: #fffdf9; border-radius: 18px; padding: 24px 28px;
  width: 460px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  border: 1px solid rgba(229, 221, 210, .9);
  box-shadow: 0 8px 24px rgba(11, 31, 46, .10),
              0 24px 70px rgba(11, 31, 46, .22); }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-x { background: none; border: none; font-size: 17px; cursor: pointer;
  color: var(--muted); padding: 4px 8px; }
.modal-x:hover { color: var(--ink); }
.modal label { margin-top: 10px; }
/* The overlay must lose to .hidden regardless of rule order */
.modal-overlay.hidden { display: none !important; }

/* Dashboard (My Day) compact formatting */
.dash-head h1 { font-size: 21px; margin: 0; }
.dash h2 { font-size: 15px; }
.dash .card { padding: 16px 18px; }
.dash .matter-row { flex-wrap: wrap; gap: 6px 10px; padding: 9px 12px;
  margin: 6px 0; align-items: baseline; }
.dash .matter-label { font-weight: 600; font-size: 13.5px; flex: 1 1 auto;
  min-width: 0; }
.dash .col-main .matter-label { overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 100%; }
.dash .matter-row .listing-when { margin-left: 0; flex-basis: 100%;
  font-size: 12px; color: var(--muted); white-space: normal; order: 5; }
.dash .cat-pill, .dash .billable-pill, .dash .unvetted-pill,
.dash .progress-pct { font-size: 10px; padding: 2px 7px; flex: none; }
.dash .row-cta { font-size: 11.5px; flex: none; }
.dash .task-notes { font-size: 12px; margin: 0 4px 8px 12px; }
.dash .col-side .matter-label { white-space: normal; word-break: break-word;
  font-size: 13px; }
.dash .activity-item { font-size: 13px; padding: 5px 0; }
.dash .activity-when { font-size: 11.5px; }
.qa-row .qa-btn { font-size: 13px; padding: 7px 12px; }
.search-type { border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px;
  font: inherit; font-size: 13px; background: var(--bg); color: var(--muted); margin-right: 6px; }
.global-search { display: flex; align-items: center; }
.global-search input { flex: 1; }
/* Global search: input + category multiselect */
.global-search { display: flex; align-items: center; gap: 6px; max-width: 560px; }
.global-search input[type="search"] { flex: 1; min-width: 160px; width: auto; }
.gs-filter { position: relative; flex: none; }
#gs-filter-btn { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  font: inherit; font-size: 13px; background: var(--bg); color: var(--muted);
  cursor: pointer; white-space: nowrap; }
.gs-menu { position: absolute; top: 40px; left: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(20,30,60,.13); z-index: 30; min-width: 160px; }
.gs-menu label { display: block; font-size: 13.5px; padding: 4px 0; cursor: pointer; }
.gs-menu.hidden { display: none !important; }
.gs-go { border: none; border-radius: 8px; padding: 8px 14px; font: inherit;
  font-size: 13px; font-weight: 600; background: var(--accent); color: #fff;
  cursor: pointer; flex: none; }

/* Top bar: uniform control heights and spacing */
.top-bar { gap: 10px; padding: 10px 22px; }
.global-search { gap: 8px; }
.global-search input[type="search"] { height: 36px; padding: 0 12px;
  border-radius: 8px; font-size: 13.5px; box-sizing: border-box; margin: 0; }
#gs-filter-btn, .gs-go, .quick-create > button { height: 36px;
  padding: 0 14px; border-radius: 8px; font-size: 13.5px;
  box-sizing: border-box; display: inline-flex; align-items: center;
  line-height: 1; margin: 0; }

/* Search category dropdown: aligned rows, consistent sizing */
.gs-menu { top: 42px; min-width: 180px; padding: 6px; }
.gs-menu label { display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--ink); padding: 7px 10px; margin: 0;
  border-radius: 7px; line-height: 1.2; }
.gs-menu label:hover { background: #f3f6fb; }
.gs-menu input[type="checkbox"] { width: 15px; height: 15px; margin: 0;
  flex: none; accent-color: var(--accent); }

/* Calendar grid */
.cal-grid { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 10px; }
.cal-grid th { font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .5px; padding: 6px; border-bottom: 1px solid var(--line); }
.cal-grid td { border: 1px solid #f0f1f4; vertical-align: top; height: 92px;
  padding: 4px 5px; font-size: 12.5px; }
.cal-grid td.cal-empty { background: #fafafb; }
.cal-grid td.cal-today { background: #eef2f8; border-color: var(--accent); }
.cal-daynum { font-weight: 700; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.cal-chip { background: #eef7f0; border: 1px solid #cde3d2; border-radius: 6px;
  padding: 1px 5px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; display: flex; align-items: center; gap: 4px;
  font-size: 11px; line-height: 1.45; }
.cal-chip a { color: #14522a; text-decoration: none; overflow: hidden;
  text-overflow: ellipsis; flex: 1; }
.cal-chip.cal-task { background: #fdf3d7; border-color: #ecd9a0; }
.cal-chip.cal-task a { color: #8a6d1a; }
.cal-x { background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 10px; padding: 0; flex: none; }
.assignee-checks { border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 10px; max-height: 110px; overflow-y: auto; }
.assignee-checks label { display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; padding: 3px 0; margin: 0; }
.assignee-checks input { width: 14px; height: 14px; margin: 0;
  accent-color: var(--accent); }

/* Dashboard mini calendar */
.mini-cal { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 6px; }
.mini-cal th { font-size: 10.5px; color: var(--muted); padding: 3px 0; text-align: center; }
.mini-cal td { text-align: center; padding: 4px 0; font-size: 12.5px; position: relative; height: 30px; }
.mini-cal td a { color: var(--ink); text-decoration: none; display: inline-block;
  width: 24px; height: 24px; line-height: 24px; border-radius: 12px; }
.mini-cal td a:hover { background: #f3f6fb; }
.mini-cal td.mc-today a { background: var(--accent); color: #fff; font-weight: 700; }
.mc-dot { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 3px; background: #d97706; }
.see-more { background: none; border: none; color: var(--accent); font: inherit;
  font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.see-more:hover { text-decoration: underline; }

/* Dashboard: single-line document rows */
.dash .matter-row.doc-mini { flex-wrap: nowrap; align-items: center;
  padding: 6px 10px; margin: 4px 0; gap: 8px; }
.doc-mini-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink); }
.doc-mini-when { flex: none; font-size: 11.5px; color: var(--muted); }
.doc-mini-dot { flex: none; width: 8px; height: 8px; border-radius: 4px;
  background: #1a6b34; }

/* Right-rail hover preview cards */
.dash .col-side a.hoverable { position: relative; overflow: visible; }
.hover-pop { display: none; position: absolute; right: calc(100% + 10px);
  top: -4px; width: 270px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(20,30,60,.18);
  z-index: 40; white-space: normal; }
a.hoverable:hover .hover-pop { display: block; }
.hp-title { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; color: var(--ink); }
.hp-line { font-size: 12.5px; color: var(--ink); margin: 3px 0; line-height: 1.45; }
.hp-muted { color: var(--muted); font-size: 11.5px; }
/* Hover cards: never let long file names escape the box */
.hover-pop, .hp-title, .hp-line { overflow-wrap: anywhere; word-break: break-word; }

/* MyCase-flavored matters table */
.practice-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.task-flag { font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.task-flag.overdue { color: #a03030; }
.note-cell { max-width: 260px; }
.note-text { font-size: 12.5px; line-height: 1.4; }
.add-note-link { font-size: 11.5px; color: var(--accent); text-decoration: none; font-weight: 600; }
.add-note-link:hover { text-decoration: underline; }
.note-editor { display: flex; gap: 6px; margin-top: 5px; }
.note-editor.hidden { display: none !important; }
.note-input { flex: 1; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; font-size: 12.5px; }
.mine-toggle { display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted); white-space: nowrap; margin: 0; }
.mine-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
/* Stage filter button: match the compact filter controls */
#stage-filter-btn { height: 34px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 14px; font: inherit; font-size: 13px; background: #fff;
  color: var(--muted); cursor: pointer; display: inline-flex;
  align-items: center; white-space: nowrap; }
#stage-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-row { align-items: center; }
.contact-mail { color: var(--accent); text-decoration: none; font-size: 13.5px; }
.contact-mail:hover { text-decoration: underline; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px;
  margin: 6px 0; }
.switch-row input { width: 38px; height: 20px; appearance: none;
  background: #cfd6e0; border-radius: 10px; position: relative; cursor: pointer;
  transition: background .15s; margin: 0; flex: none; }
.switch-row input:checked { background: #1a6b34; }
.switch-row input::after { content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 8px; background: #fff;
  transition: left .15s; }
.switch-row input:checked::after { left: 20px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 12.5px; color: var(--muted); margin: 8px 0 2px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; }
.cat-row input[type="color"] { width: 44px; height: 32px; padding: 2px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
/* Calendar categories in Settings: tight aligned rows */
.cat-row { display: flex; align-items: center; gap: 10px; margin: 6px 0;
  max-width: 420px; }
.cat-row input[type="color"] { width: 36px; height: 30px; flex: none;
  padding: 1px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; cursor: pointer; }
.cat-row .cat-name { flex: 1; min-width: 0; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 6px; font: inherit;
  font-size: 13px; margin: 0; height: 30px; box-sizing: border-box; }
.cat-row .cat-del { flex: none; height: 30px; width: 30px; padding: 0;
  font-size: 12px; line-height: 1; display: inline-flex; align-items: center;
  justify-content: center; margin: 0; }
.cat-actions { display: flex; gap: 8px; margin-top: 10px; }
.cat-actions button { margin: 0; }
/* Category rows: swatch, name, then Remove pinned to the far right */
.cat-row { max-width: none; }
.cat-row .cat-name { flex: 0 1 320px; }
.cat-row .cat-del { width: auto; padding: 0 14px; margin-left: auto; }

/* Bills tab: sub-pills + MyCase summary bar */
.bill-pills { display: inline-flex; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; margin: 10px 0; }
.bill-pill { background: #fff; border: none; border-right: 1px solid var(--line);
  padding: 8px 16px; font: inherit; font-size: 13px; cursor: pointer;
  color: var(--muted); }
.bill-pill:last-child { border-right: none; }
.bill-pill.active { background: var(--accent); color: #fff; font-weight: 600; }
.bill-summary { display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; }
.bs-cell { padding: 14px 16px; border-right: 1px solid var(--line);
  text-align: center; }
.bs-cell:last-child { border-right: none; }
.bs-label { font-size: 11.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .4px; }
.bs-amount { font-size: 20px; font-weight: 700; margin-top: 4px; }
.bs-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.act-row { display: flex; gap: 6px; align-items: center; }
.act-row .act-select { flex: 1; min-width: 0; }
.act-row .act-add-btn { flex: none; width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; margin: 0; }
/* The activity popup must layer above the time/expense popups that open it */
#act-modal { z-index: 200; }

/* Documents tab: sub-pills mirror the billing pills */
.doc-pills { display: inline-flex; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; margin: 10px 0; }
.doc-pill { background: #fff; border: none; border-right: 1px solid var(--line);
  padding: 8px 16px; font: inherit; font-size: 13px; cursor: pointer;
  color: var(--muted); }
.doc-pill:last-child { border-right: none; }
.doc-pill.active { background: var(--accent); color: #fff; font-weight: 600; }
.comm-pill { background: #fff; border: none; border-right: 1px solid var(--line);
  padding: 8px 16px; font: inherit; font-size: 13px; cursor: pointer;
  color: var(--muted); }
.comm-pill:last-child { border-right: none; }
.comm-pill.active { background: var(--accent); color: #fff; font-weight: 600; }
.comm-row:hover td { background: #f7f8fa; }

/* Task urgency colors: yellow inside two days, red once overdue */
.pill-overdue { font-size: 11px; font-weight: 700; color: #fff;
  background: #d92d20; border-radius: 999px; padding: 2px 9px;
  white-space: nowrap; display: inline-block; }
.pill-partial { font-size: 11px; font-weight: 700; color: #fff;
  background: #1570c9; border-radius: 999px; padding: 2px 9px;
  white-space: nowrap; display: inline-block; }
.pill-draft { font-size: 11px; font-weight: 700; color: #fff;
  background: #0b1f2e; border-radius: 999px; padding: 2px 9px;
  white-space: nowrap; display: inline-block; }
/* Invoice row action icons: $ records a payment, trash deletes. */
.ic-btn { display: inline-block; box-sizing: border-box;
  width: 26px; height: 24px;
  line-height: 22px; text-align: center; font-size: 13px;
  font-weight: 700; color: var(--accent); background: #fff;
  border: 1px solid var(--line); border-radius: 7px; cursor: pointer;
  text-decoration: none; padding: 0; margin: 0 2px 0 0;
  vertical-align: middle; }
.ic-btn:hover { border-color: var(--accent); background: #f3f6fb; }
.ic-btn.ic-danger:hover { border-color: #d92d20; color: #d92d20;
  background: #fef3f2; }
/* Member-side avatar menu, mirroring the Catalyst top bar. */
.ma-wrap { margin-left: auto; position: relative; }
.ma-btn { width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #f8f5ef; border: 2px solid #d8c9a8;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 0; line-height: 1; }
.ma-menu { position: absolute; right: 0; top: calc(100% + 8px);
  background: #fffdf9; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(11, 31, 46, .18); min-width: 210px;
  padding: 10px 0; z-index: 60; }
.ma-menu a { display: block; padding: 8px 16px; font-size: 13.5px;
  font-weight: 500; color: var(--ink); text-decoration: none; }
.ma-menu a:hover { background: #f3efe7; }
.ma-name { padding: 2px 16px; font-weight: 700; font-size: 13.5px; }
.ma-tier { padding: 0 16px 4px; font-size: 11px; letter-spacing: 1.2px;
  color: #8b6f45; font-weight: 700; text-transform: uppercase; }
.ma-line { border-top: 1px solid var(--line); margin: 6px 0; }
/* Invoice edit screen: MyCase-style section bands and shaded table
   headers, so the sheet reads like the screen the team knows. */
.ed-sec { padding: 0 0 12px; overflow: hidden; }
.ed-sec > *:not(.ed-band) { margin-left: 16px; margin-right: 16px; }
h2.ed-band { background: #ece5d8; color: var(--ink); margin: 0 0 12px;
  padding: 11px 18px; font-size: 15px;
  border-bottom: 1px solid var(--line); }
.ed-table th { background: #f3efe7; }
.ed-table input { margin: 0; }
.pill-soon { font-size: 11px; font-weight: 700; color: #7a5200;
  background: #fdf0d3; border-radius: 999px; padding: 2px 9px;
  white-space: nowrap; display: inline-block; }
.task-overdue { border-left: 3px solid #d92d20; background: #fdf3f2; }
.task-soon { border-left: 3px solid #e0a82e; background: #fdf9ef; }

/* Recent matters dropdown under the global search bar */
.global-search { position: relative; }
.gs-recent { position: absolute; top: 100%; left: 0; margin-top: 4px;
  min-width: 340px; max-width: 460px; z-index: 300; }
.gs-recent-head { font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; }
.gs-recent a { display: block; padding: 8px 12px; text-decoration: none;
  color: inherit; font-size: 13px; border-radius: 6px; }
.gs-recent a:hover { background: #f0f2f5; }

/* Danger button: matter deletion only */
.btn-danger { background: #d92d20; color: #fff; border: 1px solid #d92d20;
  border-radius: 8px; margin: 0; padding: 7px 14px; font: inherit;
  font-size: 13px; cursor: pointer; }
.btn-danger:hover { background: #b3241a; border-color: #b3241a; }

/* Notification bell */
.notif { position: relative; }
.notif { position: relative; margin-left: auto; }
.notif #nb-btn { background: #fff; border: 1px solid var(--line);
  border-radius: 8px; height: 36px; width: 40px; cursor: pointer;
  color: var(--ink); position: relative; display: inline-flex;
  align-items: center; justify-content: center; padding: 0; }
.notif #nb-btn svg { flex-shrink: 0; }
.nb-badge { position: absolute; top: -6px; right: -6px; background: #d92d20;
  color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px;
  min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  padding: 0 3px; }
.nb-menu { position: absolute; left: auto; right: 0; top: 100%;
  margin-top: 4px; min-width: 320px; max-width: min(400px, 92vw);
  max-height: 380px; overflow-y: auto; z-index: 300; }
.nb-menu a { display: block; padding: 8px 12px; text-decoration: none;
  color: inherit; font-size: 13px; border-radius: 6px; }
.nb-menu a:hover { background: #f0f2f5; }
.nb-menu a.nb-fail { color: #b3241a; }

/* Back link on detail pages */
.back-link { display: inline-block; font-size: 13px; color: var(--muted);
  text-decoration: none; margin: 2px 0 10px; }
.back-link:hover { color: var(--accent); text-decoration: underline; }

/* Collapsible source groups + summary accordions */
details.src-group { border: 1px solid var(--line); border-radius: 10px;
  margin: 8px 0; background: #fafbfc; }
details.src-group > summary { padding: 9px 14px; cursor: pointer;
  font-weight: 600; font-size: 13.5px; display: flex; align-items: center;
  gap: 10px; list-style: none; }
details.src-group > summary::-webkit-details-marker { display: none; }
details.src-group > summary::before { content: "▸"; color: var(--muted); }
details.src-group[open] > summary::before { content: "▾"; }
.src-state { margin-left: auto; font-size: 12px; color: var(--muted);
  font-weight: 400; }
.src-body { padding: 4px 14px 10px 30px; border-top: 1px solid var(--line); }
.src-tools { font-size: 12px; margin: 6px 0 2px; }
.src-tools a { color: var(--accent); margin-right: 14px; }
details.doc-fold { border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; }
details.doc-fold > summary { padding: 11px 14px; cursor: pointer;
  font-weight: 600; font-size: 13.5px; display: flex; align-items: center;
  gap: 10px; list-style: none; }
details.doc-fold > summary::-webkit-details-marker { display: none; }
details.doc-fold > summary::before { content: "▸"; color: var(--muted); }
details.doc-fold[open] > summary::before { content: "▾"; }
details.doc-fold .doc-scroll { border-top: 1px solid var(--line);
  max-height: 300px; overflow-y: auto; padding: 12px 16px; margin: 0; }

/* Task popup: two columns — details + checklist left, comments right */
.td-cols { display: flex; gap: 20px; }
.td-left { flex: 1.15; min-width: 0; }
.td-right { flex: 1; min-width: 0; border-left: 1px solid var(--line);
  padding-left: 20px; display: flex; flex-direction: column; }
.td-sec-h { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--accent); margin: 14px 0 6px;
  display: flex; align-items: center; gap: 10px; }
.td-prog-wrap { flex: 1; max-width: 150px; height: 7px; background: #eef1f5;
  border-radius: 99px; overflow: hidden; display: inline-block; }
.td-prog-bar { display: block; height: 100%; background: #1a6b34;
  width: 0%; transition: width 0.3s; }
.td-assign-row { display: flex; flex-wrap: wrap; gap: 2px 4px;
  margin-top: 4px; }
.td-todos { border: 1px solid var(--line); border-radius: 10px;
  max-height: 240px; overflow-y: auto; }
.td-todo-item { display: flex; gap: 9px; align-items: flex-start;
  padding: 7px 11px; border-bottom: 1px solid var(--line);
  font-size: 13.5px; }
.td-todo-item:last-child { border-bottom: none; }
.td-todo-item input[type="checkbox"] { width: 15px; height: 15px;
  margin-top: 2px; flex-shrink: 0; }
.td-done { color: var(--muted); text-decoration: line-through; }
.td-who { margin-left: auto; font-size: 11.5px; color: var(--muted);
  white-space: nowrap; }
.td-todo-x { border: none; background: none; color: var(--muted);
  cursor: pointer; font-size: 12px; padding: 0 2px; }
.td-todo-x:hover { color: #d92d20; }
.td-comments { flex: 1; max-height: 300px; overflow-y: auto;
  margin-bottom: 8px; }
@media (max-width: 860px) {
  .td-cols { flex-direction: column; }
  .td-right { border-left: none; padding-left: 0; }
}

/* Draft reader: big, readable, self-explanatory */
.dr-modal { max-width: 1050px; width: 94vw; display: flex;
  flex-direction: column; max-height: 92vh; }
.dr-modal #dr-frame { flex: 1; min-height: 66vh; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; width: 100%; }
.dr-meta { font-size: 11px; font-weight: 700; color: var(--accent);
  background: #eef1f5; border-radius: 999px; padding: 2px 10px;
  white-space: nowrap; }
.dr-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px;
  flex-wrap: wrap; }
.dr-btn { border: 1px solid var(--accent); color: var(--accent);
  background: #fff; border-radius: 7px; padding: 5px 12px; font-size: 12.5px;
  cursor: pointer; text-decoration: none; font-family: inherit;
  display: inline-block; }
.dr-btn:hover { background: var(--accent); color: #fff; }
.dr-file-zone { margin-left: auto; display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap; }
.dr-file-label { font-size: 12px; color: var(--muted); }
.dr-file-zone select { width: auto; padding: 6px 10px; font-size: 13px;
  margin: 0; }

/* Task popup sizing: room for the checklist and the comment thread */
.td-modal-box { max-width: 1150px; width: 94vw; max-height: 92vh;
  overflow-y: auto; }
.td-modal-box .td-todos { max-height: 34vh; }
.td-modal-box .td-comments { max-height: 44vh; }


/* --- Platform audit fixes --- */
#input-row.hidden { display: none !important; }
tr.task-done { opacity: 0.55; }
.cat-pill, .unvetted-pill, .billable-pill { white-space: nowrap;
  display: inline-block; }
.pill-none { font-size: 11px; font-weight: 700; color: var(--muted);
  background: #eef1f5; border-radius: 999px; padding: 2px 9px;
  white-space: nowrap; display: inline-block; }
.file-table td { overflow-wrap: anywhere; }
.matter-label { min-width: 0; overflow-wrap: anywhere; }
.activity-what { display: block; }
.btn-xs { background: #fff; color: var(--muted); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 9px; font-size: 11.5px; cursor: pointer;
  font-family: inherit; margin: 0; vertical-align: middle; }
.btn-xs:hover { color: #d92d20; border-color: #d92d20; }
.td-todo-item .td-text { flex: 1; min-width: 0; }
/* Matter dashboard: compact all-contacts card */
.contact-mini { display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; padding: 3px 0; }
.contact-mini a { font-weight: 600; }
.contact-mini .hint { font-size: 11.5px; }

/* Bulk multi-select bar */
.bulk-bar { display: flex; align-items: center; gap: 10px; background: #eef2f8;
  border: 1px solid var(--accent); border-radius: 10px; padding: 8px 14px;
  margin: 10px 0; font-size: 13px; }
.bulk-bar.hidden { display: none; }
.bulk-bar select { width: auto; margin: 0; padding: 6px 10px; font-size: 13px; }
.bulk-count { font-weight: 700; color: var(--accent); }
.row-sel, #sel-all { width: 15px; height: 15px; margin: 0; }


/* Compact tables: smaller type so rows fit one line */
.matters-table td { font-size: 13px; padding: 8px 10px; }
.matters-table .matter-link { font-size: 13px; }

/* Firm members as small chips */
.staff-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.staff-chip { display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px;
  font-size: 12.5px; background: #fafbfc; }
.staff-chip button { border: none; background: #eef1f5; color: var(--muted);
  border-radius: 999px; width: 18px; height: 18px; line-height: 1;
  font-size: 11px; cursor: pointer; padding: 0; }
.staff-chip button:hover { background: #d92d20; color: #fff; }

/* Matters list, Option B: update line under the matter name */
.note-line { font-size: 11.5px; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 460px;
  margin-top: 2px; }
.nl-meta { opacity: 0.75; }
.m-menu { max-width: 54px; color: var(--muted); }

/* Slim billing tables inside a matter */
.bill-slim td, .bill-slim th { font-size: 12.5px; padding: 6px 8px; }
.bill-slim .cat-pill, .bill-slim .unvetted-pill { font-size: 10px; }
.bill-slim input[type=checkbox] { width: 14px; height: 14px; }

/* Firm-defined custom status pills */
.cpill { font-size: 10.5px; font-weight: 700; border-radius: 99px;
         padding: 2px 8px; display: inline-block; white-space: nowrap;
         letter-spacing: .03em; }
.cpill-red { background: #d92d20; color: #fff; }
.cpill-amber { background: #fdf0d3; color: #7a5200; }
.cpill-green { background: #e5f6ea; color: #166534; }
.cpill-blue { background: #e3ecfb; color: #1d4ed8; }
.cpill-purple { background: #efe7fb; color: #6b21a8; }
.cpill-gray { background: #eef1f5; color: #1f3a5f; }

/* Compact Fathom card in Settings + type-ahead matter picker */
.fathom-compact .sub, .fathom-compact .hint { font-size: 12px; }
.fathom-compact .matter-row { padding: 5px 0; gap: 8px; }
.fathom-compact .matter-label { font-size: 12.5px; }
.fathom-compact .listing-when { font-size: 11px; white-space: nowrap; }
.fathom-compact summary { font-size: 12.5px; }
.fathom-assign-input { width: 200px; margin: 0; padding: 5px 8px;
                       font-size: 12.5px; }

/* ---- Phones: most members arrive on a phone. The app shell collapses
   to a top strip: brand, a horizontally scrollable nav, then the hat
   switcher and Sign out inline. Applies to both the member shell and
   the firm shell, so every hat works from a phone. ---- */
@media (max-width: 760px) {
  body.app { flex-direction: column; }
  .side-nav { width: 100%; height: auto; position: sticky; top: 0;
    z-index: 40; }
  .side-head { display: flex; align-items: center;
    justify-content: space-between; padding-right: 12px; }
  .side-brand { padding: 12px 14px; font-size: 15px; }
  .side-brand br { display: none; }
  .side-brand span { margin-left: 8px; }
  .menu-btn { display: block; }
  .side-links, .side-bottom { display: none; }
  body.nav-open .side-links { display: block; flex: none;
    padding: 2px 10px 6px; }
  body.nav-open .side-links a { padding: 10px 12px; font-size: 14px; }
  body.nav-open .side-bottom { display: flex; align-items: center;
    flex-wrap: wrap; gap: 6px; padding: 6px 10px 12px;
    border-top: 1px solid rgba(255,255,255,.15); }
  .side-bottom select.view-switch { width: auto; margin: 0; flex: none; }
  .side-bottom a { flex: none; }
  body.app main { margin: 14px auto; padding: 0 12px; }
  .top-bar { position: static; flex-wrap: wrap; padding: 8px 12px; }
  .two-col { flex-direction: column; }
  .two-col .col-side { width: 100%; }
  .matter-row { flex-wrap: wrap; row-gap: 6px; }
  .matter-row .listing-when { margin-left: 0; width: 100%; }
  /* Legacy top-nav pages (gate, portal, consent) wrap instead of
     overflowing. */
  header { flex-wrap: wrap; padding: 14px 16px; row-gap: 6px; }
  nav.modules { flex-wrap: wrap; margin-left: 0; }
  .fin-head { flex-wrap: wrap; gap: 8px; }
  .filter-row { flex-wrap: wrap; }
}

/* ---- RÊVE quiet luxury (member side). The palette lives in these
   variables so Jade, the visual identity authority, can swap in the
   official brand values without touching a single layout rule. ---- */
.luxe {
  --lx-ivory: #f8f5ef;    /* Ivory */
  --lx-card: #fffdf9;
  --lx-line: #e5ddd2;      /* Stone */
  --lx-gold: #d4b483;      /* Champagne Gold (display/accents) */
  --lx-gold-soft: #f1e7d4;
  --lx-gold-ink: #8b6f45;  /* readable gold for text */
  --lx-navy: #0b1f2e;      /* Deep Navy */
  --lx-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}
body.luxe, body.app.luxe { background: var(--lx-ivory); }
.luxe h1, .luxe h2, .luxe .mode-title, .luxe .choose-name {
  font-family: var(--lx-serif); letter-spacing: .2px; }
.luxe main h1 { font-size: 30px; font-weight: 600; }
.luxe main h2 { font-size: 21px; font-weight: 600; }
.luxe .card { background: var(--lx-card); border: 1px solid var(--lx-line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(22,32,58,.05),
              0 18px 40px -30px rgba(22,32,58,.25); }
.luxe .side-nav { background: linear-gradient(180deg, #121b31 0%,
  var(--lx-navy) 55%, #13293c 100%); }
.luxe .side-brand span { color: #cbb887; }
.luxe .side-links a:hover { background: rgba(179,146,79,.12); }
.luxe .side-links a.active { background: rgba(179,146,79,.20);
  color: #eddcae; }
.luxe .side-sec { color: #a58f5c; }
.luxe .side-bottom { border-top-color: rgba(203,184,135,.28); }
.luxe select.view-switch { background: rgba(179,146,79,.18); }
.luxe .top-bar { background: #fbf8f1;
  border-bottom: 1px solid var(--lx-line); }
.luxe .top-bar .tb-title { color: #8a7647; text-transform: uppercase;
  letter-spacing: 2.5px; font-size: 11.5px; }
.luxe .cat-pill { background: var(--lx-gold-soft); color: var(--lx-gold-ink);
  border: 1px solid #d8c592; letter-spacing: 1.2px; }
.luxe .mode-tile { background: #fff; border: 1px solid var(--lx-line);
  border-radius: 12px; transition: transform .18s ease,
  box-shadow .18s ease, border-color .18s ease; }
.luxe .mode-tile:hover { border-color: var(--lx-gold);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -22px rgba(22,32,58,.4); }
.luxe .mode-title { font-size: 18.5px; font-weight: 700; }
.luxe .matter-row { border-color: var(--lx-line); border-radius: 10px; }
.luxe .matter-row:hover { border-color: var(--lx-gold);
  background: #fbf7ee; }
.luxe #st-search { border: 1px solid var(--lx-line); border-radius: 999px;
  padding: 11px 18px; background: #fff; }
.luxe #st-search:focus { border-color: var(--lx-gold); outline: none; }
.luxe .lx-date { color: #8a7647; font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; margin: 0 0 8px; }
.luxe .choose-opt { border-color: var(--lx-line); background: #fff; }
.luxe .choose-opt:hover { border-color: var(--lx-gold);
  background: #fbf7ee; }
.luxe .choose-go { color: var(--lx-gold); }
.luxe header { background: var(--lx-navy); }

/* ---- The hat switcher: a styled popover, not the native select ---- */
.vs-wrap { position: relative; }
.vs-btn { background: rgba(255,255,255,0.14); color: #cdd6e4; border: none;
  border-radius: 999px; padding: 7px 14px; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit; width: 100%;
  text-align: left; }
.vs-btn:hover { color: #fff; }
.vs-menu { position: absolute; bottom: calc(100% + 8px); left: 0;
  width: 100%; min-width: 200px; box-sizing: border-box;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 14px 36px -14px rgba(22,32,58,.4);
  padding: 6px; z-index: 60; }
.vs-menu.hidden { display: none !important; }
.vs-item { display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: 14px; }
.vs-item:hover { background: #f3f6fb; }
.vs-item.on { font-weight: 700; }
.vs-item.on::before { content: "✓ "; }
.side-bottom .vs-wrap { margin: 0 0 6px; }
.luxe .vs-btn { background: rgba(179,146,79,.18); }
.luxe .vs-menu { background: var(--lx-card);
  border-color: var(--lx-line); }
.luxe .vs-item:hover { background: #fbf7ee; }
.luxe .vs-item.on { color: var(--lx-gold-ink); }
/* Inside the sidebar the generic .side-bottom a colors would wash the
   menu out; these win on specificity so items stay ink-on-white on
   EVERY shell. The gold values are literal with the luxe variable as
   an optional override, so a page without the luxe palette never
   falls back to white-on-white. */
.side-bottom .vs-menu a.vs-item { color: var(--ink); padding: 9px 12px;
  font-size: 14px; }
.side-bottom .vs-menu a.vs-item:hover { color: var(--ink);
  background: #f3f6fb; }
.luxe .side-bottom .vs-menu a.vs-item:hover,
.luxe .vs-menu a.vs-item:hover { background: #fbf7ee;
  color: var(--lx-gold-ink, #8b6f45); }
.vs-menu a.vs-item.on,
.side-bottom .vs-menu a.vs-item.on,
.luxe .side-bottom .vs-menu a.vs-item.on {
  color: var(--lx-gold-ink, #8b6f45); font-weight: 700; }
.vs-menu a.vs-item.on:hover,
.side-bottom .vs-menu a.vs-item.on:hover {
  color: var(--lx-gold-ink, #8b6f45); background: #f6f1e6; }
@media (max-width: 760px) {
  .vs-menu { bottom: auto; top: calc(100% + 8px); }
  .side-bottom .vs-wrap { flex: none; margin: 0; }
  .vs-btn { width: auto; }
}


/* ---- Toasts: action results pop at the top right, not page-bottom ---- */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { background: #14532d; color: #fff; padding: 12px 16px;
  border-radius: 10px; font-size: 14px; line-height: 1.45;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); cursor: pointer;
  animation: toast-in .18s ease; word-break: break-word; }
.toast.error { background: #991b1b; }
.toast code { background: rgba(255,255,255,.16); border-radius: 5px;
  padding: 1px 5px; font-size: 12.5px; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* --- Add task: the MyCase-style two-column screen ------------------------- */
.qct-box { max-width: 920px; width: 94vw; }
.qct-cols { display: flex; gap: 24px; align-items: flex-start; }
.qct-left { flex: 1.45; min-width: 0; }
.qct-right { flex: 1; min-width: 240px; }
.qct-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px;
  align-items: start; margin: 0 0 13px; }
.qct-row > label { margin: 7px 0 0; font-size: 13px; }
.qct-row input[type="text"], .qct-row input[type="date"],
.qct-row select, .qct-row textarea { margin: 0; }
.qct-note { background: #eef4fb; border-left: 3px solid #2f6fb3;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
  border-radius: 6px; margin: 0 0 14px; }
.qct-assign-h { display: flex; justify-content: space-between;
  align-items: center; font-weight: 700; font-size: 13px;
  margin: 12px 0 2px; }
.qct-assign-h .hint { font-weight: 400; }
.qct-assign-list label { display: flex; justify-content: space-between;
  align-items: center; gap: 8px; padding: 7px 2px; margin: 0;
  border-top: 1px solid var(--line); font-size: 13.5px;
  font-weight: 400; text-transform: none; }
.qct-assign-list label span { flex: 1; }
.qct-cl-item { display: flex; gap: 8px; align-items: center;
  margin: 0 0 7px; }
.qct-cl-item .qct-cl-grip { color: var(--muted); cursor: default; }
.qct-cl-item input[type="text"] { flex: 1; margin: 0; }
.qct-cl-del { background: none; border: none; cursor: pointer;
  font-size: 15px; color: var(--muted); padding: 2px 4px; }
.qct-cl-del:hover { color: #d92d20; }
@media (max-width: 760px) {
  .qct-cols { display: block; }
  .qct-row { grid-template-columns: 1fr; gap: 4px; }
}
.qct-assign-list input[type="checkbox"] { width: 16px; height: 16px;
  flex: 0 0 auto; margin: 0; }

/* --- Matter type-ahead picker ---------------------------------------------- */
.qc-mfind { position: relative; }
.qc-mfind-input { padding-right: 34px; }
.qc-mfind-off .qc-mfind-input { background: #f1f2f4; color: var(--muted); }
.qc-mfind-clear { position: absolute; right: 10px; top: 11px;
  background: none; border: none; cursor: pointer; font-size: 14px;
  color: var(--muted); padding: 0 2px; line-height: 1; margin: 0; }
.qc-mfind-clear:hover { color: #d92d20; }
.qc-mfind-menu { position: absolute; left: 0; right: 0;
  top: calc(100% + 4px); background: #fffdf9;
  border: 1px solid var(--line); border-radius: 12px; z-index: 50;
  max-height: 240px; overflow-y: auto; padding: 4px;
  box-shadow: 0 14px 40px rgba(11, 31, 46, .16); }
.qc-mfind-item { padding: 9px 12px; font-size: 13.5px; cursor: pointer;
  border-radius: 8px; }
.qc-mfind-item:hover, .qc-mfind-item.sel { background: #eef3fa; }
.qc-mfind-item + .qc-mfind-item { border-top: none; }
.qc-mfind-item:hover { background: #f3efe7; }
.qc-mfind-none { padding: 8px 12px; font-size: 12.5px;
  color: var(--muted); }

/* --- Tasks list: one line per task, table always fits its card ----------- */
.tasks-oneline { width: 100%; table-layout: fixed; }
.tasks-oneline td, .tasks-oneline th { white-space: nowrap;
  vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.tasks-oneline th:nth-child(1) { width: 34px; }
.tasks-oneline th:nth-child(2) { width: 104px; }
.tasks-oneline th:nth-child(3) { width: auto; }
.tasks-oneline th:nth-child(4) { width: 24%; }
.tasks-oneline th:nth-child(5) { width: 130px; }
.tasks-oneline th:nth-child(6) { width: 98px; }
.tasks-oneline th:nth-child(7) { width: 104px; }
.tasks-oneline td:nth-child(1), .tasks-oneline th:nth-child(1),
.tasks-oneline td:nth-child(2), .tasks-oneline th:nth-child(2),
.tasks-oneline td:nth-child(7), .tasks-oneline th:nth-child(7) {
  text-overflow: clip; }
.tasks-oneline .task-done-btn { white-space: nowrap; }
@media (max-width: 900px) {
  .tasks-oneline th:nth-child(5) { width: 90px; }
  .tasks-oneline th:nth-child(2) { width: 84px; }
}

/* --- CLP sidebar brand: Catalyst wordmark, powered by RÊVE ---------------- */
.clp-brand { letter-spacing: normal; }
.clp-brand .clp-mark { font-weight: 700; font-size: 17px;
  letter-spacing: 2.5px; line-height: 1.25; color: #fff; }
.clp-brand .clp-sub { font-size: 11px; letter-spacing: 3.2px;
  color: #cdd6e4; font-weight: 600; }
.clp-brand .clp-powered { margin-top: 5px; font-size: 6.5px;
  letter-spacing: 1.1px; color: #7286a0; font-weight: 500; }
@media (max-width: 760px) {
  .clp-brand .clp-mark { font-size: 14px; }
  .clp-brand .clp-powered { display: none; }
}

/* --- RÊVE brand marks ------------------------------------------------------ */
.reve-brand { font-family: var(--lx-serif, Georgia, serif); }
.reve-mono { height: 36px; display: block; margin: 0 0 7px;
  filter: brightness(1.25); }
@media (max-width: 760px) { .reve-mono { display: none; } }
.clp-logo { width: 148px; display: block; margin: 2px 0 0;
  image-rendering: -webkit-optimize-contrast; }

/* --- Invoice document (MyCase-style) --------------------------------------- */
.inv-doc { padding: 34px 38px 30px; }
.inv-ribbon { position: absolute; top: 22px; left: -42px;
  transform: rotate(-45deg); color: #fff; font-weight: 700;
  font-size: 13px; letter-spacing: 2px; padding: 6px 48px; }
.inv-meta { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.inv-meta th { text-align: left; font-weight: 700; padding: 5px 14px 5px 0;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.inv-meta td { text-align: right; padding: 5px 0;
  border-bottom: 1px solid var(--line); }
.inv-totals { border-collapse: collapse; font-size: 13.5px;
  min-width: 300px; border-top: 4px solid #cfc8bb; }
.inv-totals th { text-align: left; font-weight: 600; padding: 6px 26px 6px 4px; }
.inv-totals td { text-align: right; padding: 6px 4px; white-space: nowrap; }
.inv-totals .inv-balance th, .inv-totals .inv-balance td {
  background: #f1ece2; font-weight: 700; border-top: 1px solid var(--line);
  border-bottom: 4px solid #cfc8bb; }
@media print {
  .side-nav, .topbar, .no-print, .toast-wrap { display: none !important; }
  body, body.app { background: #fff !important; }
  .app-main, main { margin: 0 !important; padding: 0 !important; }
  .inv-doc { border: none !important; box-shadow: none !important; }
}

/* --- Matters list: fixed grid, single-line names --------------------------- */
.matters-fixed { table-layout: fixed; width: 100%; }
.matters-fixed th:nth-child(1) { width: 34px; }
.matters-fixed th:nth-child(3) { width: 160px; }
.matters-fixed th:nth-child(4) { width: 175px; }
.matters-fixed th:nth-child(5) { width: 96px; }
.matters-fixed th:nth-child(6) { width: 66px; }
.matters-fixed td { vertical-align: middle; }
.matters-fixed .m-top { display: flex; align-items: center; gap: 6px;
  min-width: 0; }
.matters-fixed .m-top .matter-link { flex: 0 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matters-fixed .m-top .pill-none, .matters-fixed .m-top .pill-overdue,
.matters-fixed .m-top .cpill { flex: none; }
.matters-fixed .note-line { overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.matters-fixed td:nth-child(3) { overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.matters-fixed .stage-select { width: 100%; }

/* --- Invoice tables: always fit the card ----------------------------------- */
.table-scroll { overflow-x: auto; }
/* Auto layout: every column sizes to its content on one line and the
   table scrolls sideways inside its card (one-line rule, 2026-09). */
.inv-table { width: 100%; }
.inv-table th, .inv-table td { white-space: nowrap;
  vertical-align: middle; }
/* Contact and Case: one line, trimmed with an ellipsis when the
   column runs out of room; the full name shows on hover. */
.inv-table td.i-clip, .ci-table td.i-clip { white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  line-height: 1.35; padding-top: 8px; padding-bottom: 8px; }
.inv-actions { display: inline-flex; gap: 8px; align-items: stretch; }
.inv-actions .pdf-btn, .inv-actions .secondary { margin: 0;
  display: inline-flex; align-items: center; padding: 8px 14px;
  font-size: 13.5px; line-height: 1.2; border-radius: 8px;
  box-sizing: border-box; }

/* --- Invoice actions: Share dropdown --------------------------------------- */
.inv-share { position: relative; display: inline-flex; }
.share-menu { position: absolute; top: calc(100% + 6px); right: 0;
  background: #fffdf9; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(11, 31, 46, .14); min-width: 190px;
  padding: 6px; z-index: 40; }
.share-menu button { display: block; width: 100%; text-align: left;
  background: none; border: none; margin: 0; padding: 9px 12px;
  font-size: 13.5px; border-radius: 8px; cursor: pointer;
  color: var(--ink, #2e2e2e); }
.share-menu button:hover { background: #f1ece2; }
.share-menu a { display: block; padding: 9px 12px; font-size: 13.5px;
  border-radius: 8px; color: var(--ink, #2e2e2e); text-decoration: none; }
.share-menu a:hover { background: #f1ece2; }

/* --- Invoice history trail -------------------------------------------------- */
.inv-hist-row { display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 150px minmax(0, 180px);
  gap: 10px; align-items: center; padding: 8px 2px;
  border-bottom: 1px solid var(--line); font-size: 13.5px; }
.inv-hist-row:last-of-type { border-bottom: none; }
.inv-hist-dot { width: 8px; height: 8px; border-radius: 50%;
  background: #c9b8a6; }
.inv-hist-row .listing-when { overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-align: right; }

/* --- Create a New Invoice screen -------------------------------------------- */
.ci-table { width: 100%; }
.ci-table th, .ci-table td { white-space: nowrap;
  vertical-align: middle; }
.ci-table input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
.ci-table .btn-xs { white-space: nowrap; }
.cs-lines { table-layout: fixed; width: 100%; }
.cs-lines input, .cs-lines select { margin: 0; padding: 7px 9px;
  font-size: 13.5px; width: 100%; box-sizing: border-box; }
.cs-lines td { vertical-align: middle; }
.cs-lines input:disabled { background: #f3efe7; color: #a89e8f; }
.cs-lines .l-del { white-space: nowrap; }


/* --- Dashboard: greeting + Quick actions (MyCase-style, RÊVE palette) ------ */
.dash-hello { margin: 2px 0 12px; }
.dash-hello h1 { font-size: 26px; margin: 0; }
.dash-date { color: #6e6659; font-size: 14px; margin-top: 2px; }
.dash-head .qa-row { gap: 10px; }
.dash-head .qa-btn { display: inline-flex; align-items: center; gap: 8px;
  background: #f1ece2; border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; color: #2e2e2e;
  text-decoration: none; }
.dash-head .qa-btn:hover { background: #e5ddd2; border-color: #d8cfc0;
  color: #0b1f2e; }
.qa-ic { width: 17px; height: 17px; flex: none; color: #0b1f2e; }

/* Letterhead blocks: address and phone lines sit tight together. */
.inv-doc .hint { margin-top: 2px; line-height: 1.4; }


/* --- Top-bar avatar + profile menu ------------------------------------------ */
.me-wrap { position: relative; margin-left: 4px; }
.me-wrap #me-btn { width: 36px; height: 36px; border-radius: 50%;
  padding: 0; margin: 0; border: 2px solid #e5ddd2; background: #0b1f2e;
  overflow: hidden; cursor: pointer; display: flex; align-items: center;
  justify-content: center; }
.me-wrap #me-btn:hover { border-color: #c9b8a6; }
.me-wrap #me-btn img { width: 100%; height: 100%; object-fit: cover;
  display: block; }
.me-initials { color: #f8f5ef; font-weight: 700; font-size: 13.5px;
  letter-spacing: .5px; }
.me-menu { right: 0; left: auto; min-width: 210px; }
.me-menu a, .me-menu .me-upload { display: block; padding: 8px 12px;
  font-size: 13.5px; color: var(--ink, #2e2e2e); text-decoration: none;
  border-radius: 8px; cursor: pointer; margin: 0; font-weight: 400; }
.me-menu a:hover, .me-menu .me-upload:hover { background: #f1ece2; }
.dash-hello { display: flex; justify-content: space-between;
  align-items: center; gap: 12px; flex-wrap: wrap; }

.me-preview { width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: #0b1f2e; border: 2px solid #e5ddd2; overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
.me-preview img { width: 100%; height: 100%; object-fit: cover;
  display: block; }
.me-preview .me-initials { font-size: 22px; }


/* Matter list pills parked for now (Sept 12): bring back by removing
   this block. The custom-pill machinery stays intact underneath. */
.matters-fixed .m-top .pill-none,
.matters-fixed .m-top .pill-overdue,
.matters-fixed .m-top .cpill { display: none; }

/* Top bar: bell and avatar align on one axis, same footprint. */
.notif { display: flex; align-items: center; }
.me-wrap { display: flex; align-items: center; }
.notif #nb-btn { width: 36px; height: 36px; display: flex;
  align-items: center; justify-content: center; padding: 0;
  margin: 0; border-radius: 50%; box-sizing: border-box; }
.me-wrap #me-btn { box-sizing: border-box; }


/* Primary (navy) action buttons — the main move on a screen. */
.btn-navy, button.btn-navy { background: #0b1f2e; color: #f8f5ef;
  border: 1px solid #0b1f2e; }
.btn-navy:hover, button.btn-navy:hover { background: #13293c;
  color: #f8f5ef; }


/* Matter rename: quiet pencil, appears when the header is hovered. */
.mh-pencil { opacity: 0; transition: opacity .12s; padding: 5px 7px; }
.matter-head:hover .mh-pencil, .mh-pencil:focus { opacity: 1; }


/* Sidebar sub-links (Billing sections) */
.side-links .side-sub { padding-left: 34px; font-size: 13px;
  opacity: .85; }
.side-links .side-sub.active { opacity: 1; }


/* Calendar week view + editable chips */
.cal-week td { height: 320px; vertical-align: top; }
.cal-week th.cal-today-h { background: #0b1f2e; color: #f8f5ef; }
.cal-editable { cursor: pointer; }
.cal-editable:hover { filter: brightness(.96); }

/* ---- Mobile pass (Sept 12): the whole team side fits a phone. ------------- */
@media (max-width: 760px) {
  /* Top bar: search takes its own row; controls wrap tight. */
  .top-bar { row-gap: 8px; }
  .global-search { flex-wrap: wrap; flex: 1 1 100%; min-width: 0; }
  .global-search .gs-wrap { flex: 1 1 100%; min-width: 0; }
  .global-search input[type="search"], .global-search #gs-q {
    width: 100%; min-width: 0; }
  .gs-filter, .gs-go { flex: none; }
  .quick-create { margin-left: 0; }
  .notif { margin-left: auto; }

  /* Any card with a wide table scrolls inside itself instead of
     pushing the page sideways. */
  .card { overflow-x: auto; }
  .table-scroll { margin-left: -2px; }

  /* Summary strips: two columns, readable numbers. */
  .bill-summary { grid-template-columns: 1fr 1fr !important; }
  .bs-amount { font-size: 18px; }

  /* Two-column form layouts stack. */
  .qct-cols { flex-direction: column; }
  .qct-cols .qct-left, .qct-cols .qct-right { width: 100%; }
  .qct-row { grid-template-columns: 1fr; }
  .qct-row > label { padding-top: 0; }

  /* Calendar grids scroll horizontally inside their card. */
  .cal-grid { min-width: 640px; }
  .cal-week td { height: 220px; }

  /* Dashboard chips and greeting stay tidy. */
  .dash-hello h1 { font-size: 21px; }
  .dash-head .qa-btn { padding: 9px 12px; font-size: 13px; }

  /* Modals fit the screen. */
  .modal { width: calc(100vw - 28px); max-width: none;
    max-height: 88vh; overflow-y: auto; }

  /* Invoice document paddings tighten. */
  .inv-doc { padding: 14px; }
  .inv-doc > div[style*="display:flex"] { gap: 12px; }
}

/* Flex children must be allowed to shrink, or wide tables drag the
   whole page sideways on phones. */
.col-main, .col-side, .set-body, .two-col > * { min-width: 0; }
@media (max-width: 760px) {
  .two-col.dash, .two-col { display: flex; flex-direction: column; }
}

/* Column stacks must stretch children, not shrink-wrap them, and long
   unbroken text must never widen a card. */
@media (max-width: 900px) {
  .two-col, .two-col.dash { display: flex; flex-direction: column;
    align-items: stretch; }
  .two-col .col-side { width: 100%; }
  .set-layout { align-items: stretch; }
  .filter-tabs { flex-wrap: wrap; }
}
.doc-mini-name, .matter-label, .activity-what { overflow-wrap: anywhere; }

/* Tablet range: the top bar wraps instead of clipping, and wide tables
   scroll inside their card. */
@media (max-width: 1080px) {
  .top-bar { flex-wrap: wrap; row-gap: 8px; }
  .global-search { max-width: none; }
  .card { overflow-x: auto; }
}


/* Sidebar: Billing expands and collapses its sections. */
.side-row { display: flex; align-items: center; }
.side-caret { background: none; border: none; color: inherit;
  opacity: .75; cursor: pointer; font-size: 12px; padding: 8px 14px;
  margin: 0; line-height: 1; }
.side-caret:hover { opacity: 1; }

/* =====================================================================
   THE DE-PILL (Bethany, Sept 30, 2026): status markers across BOTH
   sides of the platform stop being bubbles. The editorial treatment:
   a small colored dot and letterspaced small caps, no background, no
   border, no capsule. One block restyles every pill class everywhere.
   ===================================================================== */
.cat-pill, .unvetted-pill, .billable-pill, .included-pill, .fit-pill,
.pill-none, .pill-overdue, .pill-partial, .pill-draft, .pill-soon,
.source-pill, .cpill, .cpill-red, .cpill-amber, .cpill-green,
.cpill-blue, .cpill-purple, .cpill-gray,
.luxe .cat-pill, .dash .cat-pill, .dash .billable-pill,
.dash .unvetted-pill, .bill-slim .cat-pill, .bill-slim .unvetted-pill {
  background: none !important; border: none !important;
  border-radius: 0 !important; padding: 0 !important;
  font-size: 10.5px !important; font-weight: 700 !important;
  letter-spacing: 1.3px; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; line-height: 1.6;
}
.cat-pill::before, .unvetted-pill::before, .billable-pill::before,
.included-pill::before, .fit-pill::before, .pill-none::before,
.pill-overdue::before, .pill-partial::before, .pill-draft::before,
.pill-soon::before, .source-pill::before, .cpill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .8; flex: none;
}
.cat-pill { color: var(--accent) !important; }
.cat-pill::before { background: #8b6f45; opacity: 1; }
.luxe .cat-pill { color: #8a7647 !important; letter-spacing: 1.6px; }
.unvetted-pill, .billable-pill, .pill-soon { color: #7a5200 !important; }
.included-pill, .fit-pill { color: #166534 !important; }
.pill-none { color: var(--muted) !important; }
.pill-overdue { color: #b42318 !important; }
.pill-partial { color: #1d4ed8 !important; }
.pill-draft { color: var(--accent) !important; }
.source-pill { color: #3730a3 !important; }
.cpill-red { color: #b42318 !important; }
.cpill-amber { color: #7a5200 !important; }
.cpill-green { color: #166534 !important; }
.cpill-blue { color: #1d4ed8 !important; }
.cpill-purple { color: #6b21a8 !important; }
.cpill-gray { color: #4b5b6b !important; }

/* --- The community home (Sept 30 direction: banner, feed, rails) --- */
.cm-banner { border-radius: 18px; color: #f8f5ef; padding: 34px 38px;
  margin-bottom: 20px; background: linear-gradient(120deg, #0b1f2e 0%,
  #16354a 60%, #4a3b22 100%); background-size: cover;
  background-position: center; }
.cm-banner h1 { font-family: "Cormorant Garamond", serif;
  font-size: 38px; font-weight: 600; margin: 0; color: #f8f5ef; }
.cm-tierline { font-size: 11px; letter-spacing: 2.4px; font-weight: 700;
  color: #cbb887; margin-top: 4px; }
.cm-tagline { margin: 10px 0 0; font-size: 14.5px; color: #e4dccd;
  max-width: 640px; line-height: 1.55; }
.cm-pulse { margin-top: 14px; font-size: 12.5px; color: #b9c5cd; }
.cm-grid { display: grid; grid-template-columns: 225px 1fr 300px;
  gap: 20px; align-items: start; }
@media (max-width: 1100px) { .cm-grid { grid-template-columns: 1fr; } }
.cm-railhead { font-size: 10.5px; letter-spacing: 2px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; margin: 4px 4px 8px;
  display: flex; align-items: center; justify-content: space-between; }
.cm-add { font-size: 11px; letter-spacing: 0; color: #8b6f45;
  text-decoration: none; font-weight: 700; }
.cm-space { display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 11px; font-size: 13.5px;
  font-weight: 600; color: var(--ink); text-decoration: none; }
.cm-space:hover { background: #fffdf9; }
.cm-dot { width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: #f3ead9; color: #8b6f45; display: flex;
  align-items: center; justify-content: center; font-size: 12px; }
.cm-space-name { flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.cm-n { font-size: 11px; font-weight: 700; color: #8b6f45; }
.cm-space-sub { font-size: 10.5px; letter-spacing: 1px; color: var(--muted);
  text-transform: uppercase; margin: -4px 0 6px 46px; }
.cm-composer { padding: 14px 16px; }
.cm-composer textarea { margin: 0; }
.cm-composer-row { display: flex; gap: 10px; margin-top: 8px;
  align-items: center; }
.cm-composer-row select { flex: 1; margin: 0; max-width: 280px; }
.cm-composer-row button { margin: 0 0 0 auto; }
.cm-feed { padding: 0; margin-top: 14px; overflow: hidden; }
.cm-post { padding: 16px 20px; }
.cm-post + .cm-post { border-top: 1px solid var(--line); }
.cm-pinned { background: linear-gradient(90deg, #f7efdf, transparent);
  border-left: 3px solid #8b6f45; }
.cm-pinlabel { font-size: 10px; letter-spacing: 1.8px; font-weight: 700;
  color: #8b6f45; text-transform: uppercase; margin-bottom: 6px; }
.cm-phead { display: flex; align-items: center; gap: 11px;
  margin-bottom: 7px; }
.cm-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--accent); color: #f8f5ef; display: flex;
  align-items: center; justify-content: center; font-weight: 700;
  font-size: 13px; box-shadow: 0 0 0 2px #f3ead9; }
.cm-avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.cm-pname { font-weight: 700; font-size: 14px; }
.cm-pmeta { font-size: 12px; color: var(--muted); }
.cm-pin { margin-left: auto; font-size: 11.5px; font-weight: 700;
  color: #8b6f45; text-decoration: none; }
.cm-ptext { font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; }
.cm-pact { display: flex; gap: 16px; margin-top: 9px; font-size: 12.5px;
  color: var(--muted); font-weight: 600; }
.cm-pact a { color: #8b6f45; text-decoration: none; }
.cm-sidecard { padding: 14px 16px; }
.cm-sidecard + .cm-sidecard { margin-top: 14px; }
.cm-ev { display: flex; gap: 12px; align-items: center; padding: 7px 0; }
.cm-ev + .cm-ev { border-top: 1px dashed var(--line); }
.cm-date { width: 42px; text-align: center; flex: none; }
.cm-d { font-family: "Cormorant Garamond", serif; font-size: 21px;
  font-weight: 700; color: var(--accent); line-height: 1; }
.cm-m { font-size: 9.5px; letter-spacing: 1.6px; color: #8b6f45;
  font-weight: 700; }
.cm-ev-t { font-size: 13px; font-weight: 600; }
.cm-ev-s { font-size: 11.5px; color: var(--muted); }
.cm-replay { display: flex; gap: 10px; align-items: center;
  padding: 7px 0; text-decoration: none; color: var(--ink); }
.cm-replay + .cm-replay { border-top: 1px dashed var(--line); }
.cm-thumb { width: 58px; height: 36px; border-radius: 8px; flex: none;
  background: var(--accent); color: #cbb887; display: flex;
  align-items: center; justify-content: center; font-size: 11px; }
.cm-who { display: flex; align-items: center; gap: 9px; padding: 5px 0;
  font-size: 13px; font-weight: 600; }
