:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f8f9fc;
  --ink: #111827;
  --muted: #667085;
  --line: #e4e7ef;
  --accent: #243b8f;
  --accent-ink: #ffffff;
  --accent-soft: #e8edfb;
  --ok: #0e9f6e;
  --ok-soft: #e3f6ee;
  --warn: #c2770b;
  --warn-soft: #fdf3e1;
  --bad: #d92d20;
  --bad-soft: #fde8e7;
  --info: #2563eb;
  --info-soft: #e5edfd;
  --dup: #7c3aed;
  --idle: #d0d5dd;
  --tile-layout: #9ec5fe;
  --tile-facts: #5b9bf5;
  --tile-index: #12a37a;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  font: 14px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1220; --panel: #161b2e; --panel-2: #1b2137; --ink: #e8ebf3; --muted: #98a2b8; --line: #283048;
    --accent: #7d95f5; --accent-ink: #0e1220; --accent-soft: #222c50; --ok-soft: #12382d; --warn-soft: #3d2d10;
    --bad-soft: #43181a; --info-soft: #172a52; --idle: #3a4360; --tile-layout: #36508f; --tile-facts: #4f7fe0;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 14px; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.1); }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
button.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); font-weight: 600; }
button.ghost { background: transparent; border-color: transparent; }
button.danger { color: var(--bad); border-color: var(--line); background: var(--panel); }
button.danger:hover:not(:disabled) { border-color: var(--bad); background: var(--bad-soft); }
button.wide { width: 100%; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; width: 100%; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* Sidebar */
.sidebar { align-self: start; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.brand svg { width: 34px; height: 34px; } .brand rect { fill: var(--accent); } .brand path { fill: none; stroke: var(--accent-ink); stroke-width: 3; }
.brand strong { display: block; font-size: 16px; } .brand span { font-size: 12px; color: var(--muted); }
.sidebar-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 8px; }
#matter-list { display: grid; gap: 4px; overflow-y: auto; }
.matter-link { text-align: left; border: 1px solid transparent; background: none; padding: 8px 10px; display: grid; gap: 2px; }
.matter-link.active { background: var(--accent-soft); border-color: var(--accent-soft); }
.matter-link .name { font-weight: 600; } .matter-link .sub { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 6px; }
.matter-link .origin { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { margin-top: auto; font-size: 11.5px; color: var(--muted); }

/* Main */
main { padding: 24px 28px 60px; min-width: 0; }
.empty { max-width: 640px; margin: 12vh auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
.empty p { color: var(--muted); }
.matter-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.matter-head .eyebrow, .eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.matter-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.card + .card { margin-top: 14px; }
.card h2 { margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1200px) { .split { grid-template-columns: 1fr; } }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.run::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 16px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 9px 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11px; background: var(--panel-2); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.tabs.small button { padding: 7px 10px; font-size: 13px; }

/* New matter */
.steps { display: flex; gap: 8px; margin-bottom: 14px; }
.step { flex: 1; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-weight: 700; font-size: 12px; }
.step.active { border-color: var(--accent); color: var(--ink); } .step.active .n { background: var(--accent); color: var(--accent-ink); }
.step.done .n { background: var(--ok); color: #fff; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
legend { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
details { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; background: var(--panel-2); }
summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 10px; }

.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 34px 20px; text-align: center; background: var(--panel-2); transition: .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .big { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.dropzone .row { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.bar { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; border: 1px solid var(--line); }
.bar > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .25s; }
.bar.ok > span { background: var(--ok); }
.folders { display: grid; gap: 6px; margin-top: 12px; }
.folder { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.folder input { width: auto; }
.folder.off { opacity: .55; }

/* Pipeline */
.track { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; position: relative; padding: 6px 0 2px; }
.stage { display: grid; justify-items: center; text-align: center; gap: 6px; position: relative; padding: 0 4px; }
.stage::before { content: ""; position: absolute; top: 31px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.stage:first-child::before { display: none; }
.stage.done::before, .stage.running::before { background: var(--ok); }
.ring { width: 64px; height: 64px; position: relative; z-index: 1; }
.ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring circle { fill: var(--panel); stroke: var(--line); stroke-width: 6; }
.ring circle.val { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .4s; }
.stage.done .ring circle.val { stroke: var(--ok); }
.stage.warn .ring circle.val { stroke: var(--warn); }
.stage.failed .ring circle.val { stroke: var(--bad); }
.ring .icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; }
.stage.running .ring { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.stage .label { font-weight: 700; font-size: 13px; }
.stage .sub { font-size: 11.5px; color: var(--muted); min-height: 2.4em; }

.tiles-wrap { display: grid; gap: 10px; }
.tile-group .gname { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
.tiles { display: flex; flex-wrap: wrap; gap: 3px; }
.tile { width: 12px; height: 12px; border-radius: 3px; background: var(--idle); cursor: pointer; transition: background .3s; border: 0; padding: 0; }
.tile:hover { outline: 2px solid var(--ink); }
.tile.layout { background: var(--tile-layout); } .tile.facts { background: var(--tile-facts); } .tile.index { background: var(--tile-index); }
.tile.busy { animation: pulse .9s infinite; background: var(--accent); }
.tile.dup { background: var(--dup); } .tile.fail { background: var(--warn); } .tile.error { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.agents { display: grid; gap: 10px; }
.agent { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--panel-2); }
.agent .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.agent .what { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.agent.running { border-color: var(--accent); }
.agent.done { border-left: 3px solid var(--ok); }
.tasks { display: grid; gap: 4px; margin-top: 8px; }
.task { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 4px 6px; border-radius: 6px; background: var(--panel); }
.task .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--idle); }
.task.running .dot { background: var(--accent); animation: pulse 1s infinite; } .task.done .dot, .task.cached .dot { background: var(--ok); } .task.failed .dot { background: var(--bad); }
.task .last { grid-column: 2 / 4; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.meter { display: grid; gap: 6px; font-size: 12.5px; }
.meter .row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; }
.meter .row span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.feed { max-height: 360px; overflow-y: auto; display: grid; gap: 2px; font-size: 12px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.feed div { padding: 3px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed div:nth-child(odd) { background: var(--panel-2); }
.feed .t { color: var(--muted); margin-right: 6px; }

/* Statement */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .v { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel-2); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }
tr.excluded td { color: var(--muted); font-style: italic; }
.section-row td { background: var(--panel-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chip { display: inline-block; font-size: 11.5px; padding: 1px 7px; margin: 2px 4px 2px 0; border-radius: 6px; background: var(--info-soft); color: var(--info); border: 0; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.chip:hover { text-decoration: underline; }
.note { font-size: 12px; color: var(--muted); margin-top: 3px; }
.flag { color: var(--warn); font-weight: 700; }
.banner { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.warn { background: var(--warn-soft); border-color: transparent; }
.banner.ok { background: var(--ok-soft); border-color: transparent; }
.banner.bad { background: var(--bad-soft); border-color: transparent; }
.banner.info { background: var(--info-soft); border-color: transparent; }
.banner-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.banner .review-form[hidden] { display: none; }
.review-form { display: grid; grid-template-columns: 1fr 2fr auto auto; gap: 8px; align-items: end; width: 100%; }
@media (max-width: 1000px) { .review-form { grid-template-columns: 1fr; } }
.questions li { margin: 4px 0; }
.sev { font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.sev.high { color: var(--bad); } .sev.medium { color: var(--warn); } .sev.low, .sev.info { color: var(--muted); }
.handover { border-left: 3px solid var(--accent); padding-left: 12px; margin: 12px 0 18px; }
.handover ul { margin: 6px 0; padding-left: 18px; }
.ask-box { display: flex; gap: 8px; }
.answer { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); }
.answer p { margin: 0 0 10px; white-space: pre-wrap; }
.mark-ok { color: var(--ok); font-weight: 700; } .mark-bad { color: var(--bad); font-weight: 700; }

/* Viewer */
.viewer { position: fixed; inset: 0; background: rgba(9, 12, 24, .55); display: grid; place-items: center; z-index: 20; padding: 2vh 2vw; }
.viewer[hidden] { display: none; }
.viewer-panel { background: var(--panel); border-radius: 14px; width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.viewer-panel header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.viewer-panel h2 { font-size: 15px; word-break: break-all; }
.viewer-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); min-height: 0; }
.viewer-original { border-right: 1px solid var(--line); min-height: 0; background: var(--panel-2); display: grid; }
.viewer-original iframe, .viewer-original img { width: 100%; height: 100%; border: 0; object-fit: contain; }
.viewer-original pre { margin: 0; padding: 16px; overflow: auto; }
.pdf-pages { display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.pdf-bar { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.pdf-bar a { margin-left: auto; }
.pdf-page { overflow: auto; padding: 14px; display: grid; justify-items: center; align-items: start; }
.pdf-page img { width: 100%; max-width: 900px; height: auto; box-shadow: var(--shadow); background: #fff; }
.viewer-side { display: grid; grid-template-rows: auto 1fr; min-height: 0; padding: 0 14px; }
.viewer-content { overflow: auto; padding-bottom: 20px; font-size: 13px; }
.viewer-content pre { white-space: pre-wrap; font-size: 12px; font-family: ui-monospace, Menlo, monospace; background: var(--panel-2); padding: 10px; border-radius: 8px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 10px; margin-bottom: 12px; }
.kv div:nth-child(odd) { color: var(--muted); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 30; max-width: 80vw; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) { body { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .track { grid-template-columns: repeat(4, 1fr); row-gap: 14px; } .viewer-body { grid-template-columns: 1fr; } }

/* Sign-in, the signed-in user, and the two personas */
body.signin { display: grid; grid-template-columns: 1fr; place-items: center; }
.signin-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 30px 32px; width: min(420px, calc(100vw - 32px)); display: grid; gap: 14px; }
.signin-card p { margin: 0; color: var(--muted); }
.signin-card a { text-decoration: none; }
main.signin { min-height: 100vh; display: grid; place-items: center; grid-column: 1 / -1; }
.user-chip { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.user-chip .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 11.5px; }
.user-chip .who { display: grid; min-width: 0; line-height: 1.25; }
.user-chip .who strong { color: var(--ink); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 1px 7px; border-radius: 5px; white-space: nowrap; vertical-align: 1px; }
.tag-client { background: var(--info-soft); color: var(--info); }
.tag-attorney { background: var(--accent-soft); color: var(--accent); }
.tag-none { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.file-list { margin-top: 14px; }
.file-list summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.file-list table { margin-top: 8px; }
.people { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.people li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.inline-form { display: grid; grid-template-columns: minmax(0, 320px) auto; gap: 8px; justify-content: start; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; border-radius: 8px; padding: 7px 14px; background: var(--accent); color: var(--accent-ink); font-weight: 600; border: 1px solid var(--accent); user-select: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-items { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .16); padding: 6px; display: grid; gap: 2px; }
.menu-items a, .menu-items .off { display: grid; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: var(--ink); }
.menu-items a:hover { background: var(--accent-soft); }
.menu-items a span, .menu-items .off span { font-size: 12px; color: var(--muted); }
.menu-items .off { opacity: .55; cursor: not-allowed; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px 2px; }
.forms-detail { margin-top: 12px; }
.forms-detail:empty { display: none; }
.forms-detail code { font-size: 11.5px; word-break: break-all; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.client-status h2 { font-size: 19px; margin-bottom: 14px; }
.client-status.ready { border-color: var(--ok); }
.client-status a { display: inline-block; margin-top: 16px; text-decoration: none; }
.client-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.client-steps li { display: flex; gap: 9px; align-items: center; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.client-steps .n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-weight: 700; font-size: 11.5px; }
.client-steps li.active { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.client-steps li.active .n { background: var(--accent); color: var(--accent-ink); }
.client-steps li.done { color: var(--ink); }
.client-steps li.done .n { background: var(--ok); color: #fff; }
body[data-role="client"] .sidebar-label::after { content: " you can see"; }
@media (max-width: 760px) { .client-steps { grid-template-columns: 1fr 1fr; } }
.matter-head .actions { align-items: flex-start; }
details.menu { border: 0; padding: 0; margin: 0; background: none; box-shadow: none; }
details.file-list { border: 0; padding: 0; background: none; }

/* Legal systems: a badge on each matter, a filter over the list, and the picker on a new matter. */
.system-badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; white-space: nowrap; }
.system-filter { width: 100%; margin-bottom: 6px; font-size: 12.5px; }
.systems { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.systems button { text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); background: var(--panel); }
.systems button span { font-size: 12px; color: var(--muted); font-weight: 400; }
.systems button.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* What an upload just added: marked in the folder list and in the list of all files. */
.folder.fresh { background: var(--ok-soft); border-color: var(--ok); }
.file-list tr.fresh td { background: var(--ok-soft); }

/* Access and audit: the link above the signed-in user, and the page's tables. */
.access-link { display: block; text-align: left; padding: 4px 2px 10px; font-size: 13px; }

/* Confidentiality notice: accepted once, then on every page with the viewer's name across it. */
body.notice-pending > :not(.notice-card) { display: none !important; }
.notice-card { max-width: 640px; } .notice-card h1 { font-size: 17px; letter-spacing: .04em; }
.watermark { position: fixed; inset: 0; z-index: 900; pointer-events: none; background-repeat: repeat; }
.notice-strip { position: fixed; left: 0; right: 0; bottom: 0; z-index: 901; background: #7f1d1d; color: #fff; font-size: 11.5px; font-weight: 600;
  letter-spacing: .02em; padding: 5px 14px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.has-notice { padding-bottom: 26px; }
@media print { .watermark, .notice-strip { display: block; } }
