/* Poirot. Custody house style (custodia2026 theme, guide of 14 Oct 2026):
   rail + sheet shell, Inter throughout with Georgia for the page title only,
   hairline borders, white cards on a #fafafa sheet. Gold is the primary action,
   the active marker, focus and highlights. In Poirot a gold highlight also marks
   an agent proposal awaiting a person's decision; status is always text on tint. */
:root {
    /* theme tokens */
    --surface-1: #fafafa;
    --surface-2: #ffffff;
    --surface-3: #f5f5f5;
    --hairline: #c8ccd1;
    --ink: #1a1a1a;
    --ink-soft: #333333;
    --ink-muted: #6b6b6b;
    --accent: #fbd068;
    --accent-soft: rgba(251, 208, 104, 0.18);
    --module-bg: #eef0f2;
    --module-border: #d8dadd;
    /* gold family */
    --gold-pressed: #f6c43c;
    --gold-hover: #cc9a06;
    --gold-active: #e8b333;
    --gold-tint: #fff8e1;
    --gold-text: #8a6d00;
    /* neutrals */
    --muted: #888;
    --muted-2: #9aa0a6;
    --secondary: #555;
    --soft-border: #e3e6e9;
    --soft-fill: #f3f5f7;
    /* status palette: text / tint / dot */
    --ok: #1e7a36; --ok-tint: #e6f4ea; --ok-dot: #2e9e54;
    --warn: #b26a00; --warn-tint: #fff1e0; --warn-dot: #e0a200;
    --bad: #b3261e; --bad-tint: #fdeaea; --bad-dot: #d23b32;
    --mut: #5a6470; --mut-tint: #eceff1; --mut-dot: #9aa6b2;
    --destructive: #c62828;
    --link-blue: #2a6fb0;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --serif: Georgia, 'Times New Roman', Times, serif;
    --mono: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    --rail-w: 220px;
    --agent-w: 440px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body {
    margin: 0; background: var(--surface-2); color: var(--ink-soft);
    font-family: var(--sans); font-size: 1rem; line-height: 1.65; letter-spacing: -0.005em;
    font-feature-settings: 'cv11', 'ss01', 'ss03';
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent); text-decoration: underline; }
h1 {
    font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; color: var(--ink); line-height: 1.2;
    font-size: clamp(1.375rem, calc(1.375rem + 1.5vw), 2.5rem); margin: 0 0 0.4rem;
}
h2, h3, h4 { font-family: var(--sans); font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 0.75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
p { margin: 0 0 0.6rem; max-width: 78ch; }
code, .mono { font-family: var(--mono); font-size: 0.875em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.empty { color: var(--muted); font-size: 0.9rem; }
.needs { background: var(--gold-tint); color: var(--gold-text); font-weight: 600; padding: 1px 8px; border-radius: 6px; }
.error { color: var(--bad); }
form.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--muted); }
.linkbtn:hover { color: var(--ink); text-decoration: underline; }

/* ---------------------------------------------------------------- shell: rail */
.left-nav {
    position: fixed; top: 3px; left: 4px; bottom: 0; width: var(--rail-w); z-index: 50;
    display: flex; flex-direction: column; gap: 12px; padding: 16px 12px;
    background: var(--surface-1); border: 1px solid var(--hairline); border-bottom: 0;
    border-top-right-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); overflow-y: auto;
    transition: transform 0.2s ease;
}
.left-nav__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.left-nav__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.left-nav__brand:hover { color: var(--ink); text-decoration: none; }
.left-nav__mark { width: 40px; height: 40px; border-radius: 6px; background: var(--ink); position: relative; flex: 0 0 auto; }
.left-nav__mark::after { content: ''; position: absolute; right: 8px; bottom: 8px; width: 12px; height: 12px; background: var(--accent); }
.left-nav__hide, .left-nav__show {
    width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; line-height: 1; background: transparent; border: 1px solid rgba(0,0,0,0.18); border-radius: 6px;
    color: inherit; cursor: pointer; font-family: inherit;
}
.left-nav__hide { opacity: 0; transition: opacity 0.15s ease; }
.left-nav:hover .left-nav__hide, .left-nav__hide:focus-visible { opacity: 1; }
.left-nav__show { position: fixed; top: 10px; left: 10px; z-index: 45; background: var(--surface-1); display: none; }
.left-nav__group { display: flex; flex-direction: column; gap: 2px; }
.left-nav__group + .left-nav__group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hairline); }
.left-nav__link { display: block; padding: 8px 12px; border-radius: 6px; font-size: 0.95rem; line-height: 1.4; transition: background 0.15s ease; }
.left-nav__link:hover { background: rgba(0,0,0,0.06); color: inherit; text-decoration: none; }
.left-nav__link.active { background: rgba(0,0,0,0.08); font-weight: 600; }
.left-nav__spacer { flex: 1 1 auto; }
.left-nav__footer { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.08); }
.left-nav__user-name { flex: 1 1 auto; font-size: 0.85rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.left-nav__user-name.active { font-weight: 600; opacity: 1; }
.left-nav__signout { flex: 0 0 auto; font: 500 0.8rem var(--sans); padding: 0.2rem 0.55rem; border-radius: 6px; border: 1px solid rgba(0,0,0,0.18); background: transparent; color: inherit; cursor: pointer; }
.left-nav__signout:hover { background: var(--surface-3); border-color: #999; }

/* ---------------------------------------------------------------- shell: sheet */
.has-left-nav .main-wrapper { margin-left: calc(var(--rail-w) + 4px); padding: 3px 16px 16px 4px; transition: margin-left 0.2s ease; }
.left-nav-collapsed .left-nav { transform: translateX(calc(-100% - 8px)); }
.left-nav-collapsed .main-wrapper { margin-left: 0; padding-left: 52px; }
.left-nav-collapsed .left-nav__show { display: inline-flex; }

.page, .case-main {
    background: var(--surface-1); border: 1px solid var(--hairline); border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04); font-size: 14px;
    min-height: calc(100vh - 19px);
}
.page { padding: 20px 24px 48px; }
.page > * { max-width: 1100px; }
.page.narrow > * { max-width: 560px; }
.page-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-title h1 { margin: 0; }

/* flash: settings-flash */
.flash-stack { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; width: max-content; max-width: calc(100% - 32px); pointer-events: none; }
.flash { padding: 8px 14px; border-radius: 6px; font-size: 0.9rem; background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12); pointer-events: auto; cursor: pointer; animation: flash-out 4s ease forwards; }
.flash-error, .flash-warn { animation-duration: 9s; }
.flash:hover { animation-play-state: paused; }
@keyframes flash-out { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.flash-error { background: #ffebee; color: #b71c1c; border-color: #ffcdd2; }
.flash-warn { background: #fff7e6; color: #7a5a00; border-color: #f0d9a8; }
.flash-info { background: #e3f2fd; color: #0d47a1; border-color: #bbdefb; }

/* sign in: no rail */
.page-login { background: var(--surface-1); }
.login { max-width: 380px; margin: 12vh auto 0; padding: 28px 28px 32px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); font-size: 14px; }
.login h1 { font-size: 2.2rem; }
.login label { margin-top: 1rem; }
.login .btn { margin-top: 1.5rem; width: 100%; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-block; padding: 0.375rem 0.75rem; font-family: inherit; font-size: 1rem; font-weight: 500; line-height: 1.5;
    color: #292828; background: transparent; border: 1px solid #cccccc; border-radius: 4px;
    text-align: center; text-decoration: none; vertical-align: middle; cursor: pointer; user-select: none; white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { color: var(--ink); background: var(--surface-3); border-color: #999; text-decoration: none; }
.btn:disabled { opacity: 0.65; pointer-events: none; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.btn-primary, .btn-accept { color: var(--ink); background: var(--accent); border-color: var(--accent); font-weight: 600; letter-spacing: 0.01em; }
.btn-primary:hover, .btn-accept:hover { color: var(--ink); background: var(--gold-hover); border-color: var(--gold-hover); }
.btn-primary:active, .btn-accept:active { background: var(--gold-active); border-color: var(--gold-active); }
.btn-quiet { color: #292828; }

/* ---------------------------------------------------------------- forms (stacked label idiom) */
label { display: block; font-weight: 500; color: var(--ink); letter-spacing: 0.01em; margin-bottom: 0.3rem; }
label.check { display: flex; align-items: center; gap: 0.5rem; }
input[type=text], input:not([type]), input[type=email], input[type=password], input[type=number], input[type=search],
input[type=datetime-local], input[type=file], select, textarea {
    display: block; width: 100%; font-family: inherit; font-size: 1rem; font-weight: 400; line-height: 1.5; color: var(--ink-soft);
    background-color: var(--surface-2); border: 1px solid var(--hairline); border-radius: 4px; padding: 0.375rem 0.6rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select {
    appearance: none; padding-right: 2.25rem; background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px 12px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
textarea { resize: vertical; min-height: 80px; }
textarea.mono, input.mono { font-family: var(--mono); font-size: 0.875rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.65; background-color: var(--surface-3); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: auto; margin: 0; }
small { display: block; font-size: 0.82rem; color: #8a8f94; margin-top: 0.35rem; line-height: 1.45; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; align-items: start; margin: 0.75rem 0; }
.grid-form .f:has(> .btn:only-child), .grid-form .f:has(> label.check:only-child) { align-self: end; }
.grid-form .f-wide { grid-column: 1 / -1; }
.settings { max-width: 760px; }
.sandbox-state p { margin-bottom: 0.5rem; }
.f { min-width: 0; }

/* accordions: native <details>, edit-acc look */
details.panel { background: var(--surface-2); border: 1px solid var(--module-border); border-radius: 10px; margin: 1.25rem 0; overflow: hidden; }
details.panel > summary { cursor: pointer; list-style: none; padding: 0.75rem 1.1rem; font-weight: 600; font-size: 0.98rem; color: var(--ink); background: var(--soft-fill); }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "\25B8"; display: inline-block; margin-right: 0.5rem; color: var(--muted); transition: transform 0.15s; }
details.panel[open] > summary::before { transform: rotate(90deg); }
details.panel[open] > summary { border-bottom: 1px solid #e2e6ea; }
details.panel > :not(summary) { margin-left: 1.1rem; margin-right: 1.1rem; }
details.panel > :nth-child(2) { margin-top: 1rem; }
details.panel > :last-child { margin-bottom: 1.1rem; }
details.edit > summary { font-size: 0.82rem; font-weight: 600; color: var(--link-blue); cursor: pointer; margin-top: 0.4rem; width: max-content; list-style: none; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] { background: var(--surface-1); border: 1px solid var(--soft-border); padding: 0.25rem 0.85rem 0.5rem; margin-top: 0.5rem; border-radius: 8px; }

/* ---------------------------------------------------------------- pills (text on tint) */
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.74rem; font-weight: 600; line-height: 1.4; white-space: nowrap; background: var(--mut-tint); color: var(--mut); }
.b-critical, .b-malicious, .b-confirmed, .b-high, .b-suspicious { background: var(--bad-tint); color: var(--bad); }
.b-critical, .b-malicious { box-shadow: inset 0 0 0 1px var(--bad); }
.b-medium, .b-unexplained, .b-triage { background: var(--warn-tint); color: var(--warn); }
.b-low, .b-info, .b-closed { background: var(--mut-tint); color: var(--mut); }
.b-ruled_out, .b-expected, .b-answered, .b-contained { background: var(--ok-tint); color: var(--ok); }
.b-active { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px #d2d5d9; }
.b-open { background: var(--surface-2); color: var(--secondary); box-shadow: inset 0 0 0 1px #d2d5d9; }
.src { display: inline-block; white-space: nowrap; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 8px; border-radius: 999px; background: var(--mut-tint); color: var(--mut); vertical-align: 1px; }
.src-agent { background: var(--gold-tint); color: var(--gold-text); }

/* ---------------------------------------------------------------- incident list */
.case-list { list-style: none; padding: 0; margin: 0 0 2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.case { padding: 0.9rem 1.1rem; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; box-shadow: 0 1px 2px rgba(26,26,26,0.03); }
.case-link { display: grid; grid-template-columns: 8.5rem 1fr; column-gap: 1rem; }
.case-link:hover { color: inherit; text-decoration: none; }
.case-ref { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); padding-top: 0.2rem; grid-row: span 2; }
.case-title { font-size: 1.05rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.case-link:hover .case-title { color: var(--accent); text-decoration: underline; }
.case-client { color: var(--muted); font-size: 0.9rem; }
.case-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; font-size: 0.84rem; margin: 0.5rem 0 0 9.5rem; }
.running { color: var(--warn); font-weight: 600; }
.running::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--warn-dot); box-shadow: 0 0 0 3px rgba(224,162,0,0.18); margin-right: 0.4rem; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------------------------------------------------------------- incident workspace */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) var(--agent-w); gap: 4px; }
.case-main { padding: 0 24px 48px; min-width: 0; }
.case-crumb { font-size: 0.85rem; color: var(--muted); margin: 1rem 0 0.3rem; }
.case-head h1 { max-width: 40ch; }
.case-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; font-size: 0.9rem; }

/* tab strips: customer-tabstrip (incident) and admin-tabstrip (admin) */
.tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid #eee; margin: 1.25rem 0; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 0.4rem 0 0.6rem; color: #888; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover, .tabs a:focus-visible { color: var(--ink); border-bottom-color: var(--accent); text-decoration: none; }
.tabs a[aria-current] { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.tabs-admin { gap: 0; border-bottom-color: var(--module-border); margin-bottom: 1.5rem; }
.tabs-admin a { padding: 0.55rem 1.25rem 0.6rem; font-size: 0.92rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; border-bottom-width: 3px; }
.tabs-admin a:hover { border-bottom-color: rgba(251,208,104,0.45); }
.tabs-admin a[aria-current] { font-weight: 600; border-bottom-color: var(--accent); }
.tab-pending { display: inline-block; min-width: 1.35rem; padding: 0 0.35rem; text-align: center; font-size: 0.7rem; font-weight: 700; line-height: 1.5; border-radius: 999px; background: var(--ink); color: #fff; vertical-align: 1px; }
.tab-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.tab-tools p { margin: 0; }
.filters { display: flex; align-items: center; gap: 0.6rem; }
.filters label { margin: 0; }
.filters select { width: auto; }

/* proposals awaiting a decision: filter-banner treatment */
.review-strip, .proposal-notice {
    display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; align-items: baseline; margin: 0 0 1.25rem; padding: 8px 14px;
    background: var(--gold-tint); border: 1px solid var(--gold-pressed); border-radius: 6px; font-size: 0.9rem;
}
.review-strip a, .proposal-notice a { font-weight: 600; color: var(--gold-text); }

/* overview */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2rem; }
.ov-main h2:first-child, .ov-main section:first-child h2 { margin-top: 0; }
.ov-side { display: flex; flex-direction: column; gap: 1rem; }
.facts { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.facts h2 { margin: 0 0 0.6rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; padding-bottom: 0.5rem; border-bottom: 1px solid var(--hairline); }
.facts dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 0.75rem; margin: 0; font-size: 0.85rem; }
.facts dt { color: var(--ink-muted); }
.facts dd { margin: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.facts p { font-size: 0.88rem; }
.facts p:last-child { margin-bottom: 0; }

.questions { list-style: none; padding: 0; margin: 0 0 1rem; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden; }
.question + .question { border-top: 1px solid var(--hairline); }
.question summary { display: grid; grid-template-columns: 2.6rem 1fr; column-gap: 0.5rem; padding: 0.65rem 0.9rem; cursor: pointer; list-style: none; }
.question summary:hover { background: var(--surface-3); }
.question summary::-webkit-details-marker { display: none; }
.q-ref { font-weight: 700; font-size: 0.85rem; padding-top: 0.1rem; color: var(--ink); }
.q-title { color: var(--ink); }
.q-side { grid-column: 2; display: flex; gap: 0.75rem; align-items: center; font-size: 0.8rem; margin-top: 0.2rem; }
.q-count { color: var(--link-blue); }
.q-notes { margin: 0 0.9rem 0.5rem 4rem; font-size: 0.9rem; color: var(--secondary); }
.question form { margin: 0 0.9rem 0.9rem 4rem; }
.inline-add { display: flex; gap: 0.5rem; }

/* records (findings) */
.records { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.record { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden; }
.record > details > summary { padding: 0.65rem 0.9rem; cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; justify-content: space-between; }
.record > details > summary:hover { background: var(--surface-3); }
.record > details > summary::-webkit-details-marker { display: none; }
.rec-title { color: var(--ink); flex: 1 1 28rem; }
.rec-meta { display: flex; gap: 0.5rem; align-items: center; font-size: 0.8rem; flex-wrap: wrap; }
.interp { color: var(--muted); }
.i-supports { color: var(--bad); }
.i-against { color: var(--ok); }
.rec-body { padding: 0.75rem 0.9rem 0.9rem; border-top: 1px solid var(--hairline); }
.rec-body p { font-size: 0.93rem; }
.rec-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; font-size: 0.84rem; margin: 0.5rem 0; }
.rec-facts dt { color: var(--ink-muted); }
.rec-facts dd { margin: 0; word-break: break-word; }
.rv-proposed { background: var(--gold-tint); }
.record.rv-proposed { border-color: #ecc14e; }
.record.rv-proposed > details > summary:hover { background: #fff3cc; }
.rv-rejected { opacity: 0.55; }
.rec-review { padding: 0 0.9rem 0.65rem; }
.rec-review:has(> form + form) { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.rec-review form.inline:has(label.check) { display: inline-flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.template-ask { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.template-ask input { width: 16rem; max-width: 100%; }
.policy-note { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; }
.policy-note p { margin: 0 0 0.4rem; font-size: 0.92rem; max-width: none; }
.policy-note p:last-child { margin-bottom: 0; }
.label-like { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--ink); }
.fixed-value { margin: 0; padding: 0.5rem 0; font-size: 0.92rem; }
.draft-issues { background: var(--gold-tint); color: var(--gold-text); border-radius: 6px; padding: 0.5rem 0.75rem; font-size: 0.88rem; }
.draft-original { max-height: 28rem; overflow: auto; margin: 0.5rem 0; padding: 0.75rem 1rem; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 6px; }

/* document view and visual editor for drafted reports */
.doc-body { font-size: 0.95rem; line-height: 1.6; color: var(--ink); }
.doc-body h2 { font-size: 1.15rem; font-weight: 600; margin: 1.1rem 0 0.4rem; }
.doc-body h3 { font-size: 1.02rem; font-weight: 600; margin: 0.9rem 0 0.3rem; }
.doc-body h4 { font-size: 0.95rem; font-weight: 600; margin: 0.8rem 0 0.3rem; }
.doc-body > :first-child { margin-top: 0; }
.doc-body p { margin: 0 0 0.6rem; max-width: none; }
.doc-body ul, .doc-body ol { margin: 0 0 0.6rem; padding-left: 1.4rem; }
.doc-body ul { list-style: disc; }
.doc-body ol { list-style: decimal; }
.doc-body table { border-collapse: collapse; width: 100%; margin: 0.5rem 0 0.8rem; font-size: 0.9rem; }
.doc-body th, .doc-body td { border: 1px solid var(--hairline); padding: 0.35rem 0.5rem; text-align: left; vertical-align: top; min-width: 3rem; }
.doc-body th { background: var(--surface-3); font-weight: 600; }
.doc-body blockquote { margin: 0.5rem 0; padding: 0.4rem 0.8rem; background: var(--surface-3); border-radius: 6px; }
.doc-body pre { white-space: pre-wrap; font-family: var(--mono); font-size: 0.82rem; background: var(--surface-3); padding: 0.5rem; border-radius: 6px; }
.rich { border: 1px solid var(--hairline); border-radius: 8px; background: #fff; overflow: hidden; }
.rich:focus-within { border-color: var(--accent); }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px; border-bottom: 1px solid var(--hairline); background: var(--surface-2); position: sticky; top: 0; }
.rich-btn { font: inherit; font-size: 0.8rem; padding: 3px 8px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--ink); cursor: pointer; }
.rich-btn:hover { background: var(--surface-3); border-color: var(--hairline); }
.rich-btn[aria-pressed="true"] { background: var(--gold-tint); border-color: var(--accent); }
.rich-btn-bold { font-weight: 700; }
.rich-btn-italic { font-style: italic; }
.rich-btn-source { margin-left: auto; }
.rich-sep { width: 1px; height: 18px; background: var(--hairline); margin: 0 4px; }
.rich-edit { min-height: 18rem; max-height: 70vh; overflow: auto; padding: 0.9rem 1.1rem; outline: none; }
.rich textarea.rich-source-on { border: 0; border-radius: 0; width: 100%; max-width: none; min-height: 18rem; display: block; }
.rich textarea[hidden], .rich-edit[hidden] { display: none; }
.review { display: inline-flex; gap: 0.4rem; }
td .rec-review { padding: 0.4rem 0 0; }

/* timeline */
.timeline { border-left: 2px solid var(--hairline); margin-left: 0.4rem; padding-left: 1.25rem; }
.tl-day { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 1.5rem 0 0.5rem -1.25rem; padding-left: 1.25rem; position: relative; }
.tl-day::before { content: ''; position: absolute; left: -6px; top: 0.45em; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.tl-event { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 1px solid var(--hairline); }
.tl-event.rv-proposed { padding-left: 0.5rem; border-radius: 5px; }
.tl-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.tl-local { font-weight: 600; color: var(--ink); }
.tl-local abbr { text-decoration: none; margin-left: 0.15rem; color: var(--warn); }
.tl-utc { font-size: 0.78rem; color: var(--muted); }
.tl-what p { margin: 0; }
.tl-src { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem !important; }

/* tables: theme .table */
table.data { width: 100%; border-collapse: collapse; background: var(--surface-2); border-top: 1px solid var(--hairline); font-size: 0.9rem; margin: 0.5rem 0 1.5rem; }
table.data th, table.data td { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--hairline); vertical-align: top; text-align: left; }
table.data th { font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); white-space: nowrap; }
table.data tbody tr:hover > td { background-color: var(--accent-soft); }
table.data tr.rv-proposed td { background: var(--gold-tint); }
table.data tr.absent td { color: var(--muted); }
table.data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data .actions { white-space: nowrap; text-align: right; }
table.data .actions > * { margin-left: 0.3rem; }
td.mono { word-break: break-all; }
.hash { font-size: 0.78rem; white-space: nowrap; word-break: normal; }
.ctx { font-size: 0.84rem; color: var(--secondary); margin: 0.2rem 0 0; white-space: pre-line; }
.entities td:first-child { width: 22%; }
.entities td:nth-child(2), .entities td:nth-child(3) { white-space: nowrap; }

/* filter chips: sec-chip */
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chips a { border: 1px solid #d2d5d9; background: var(--surface-2); color: var(--secondary); border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.82rem; font-weight: 500; }
.chips a:hover { border-color: #9aa0a6; color: var(--ink); text-decoration: none; }
.chips a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }

.preview pre { max-height: 60vh; overflow: auto; background: var(--surface-1); border: 1px solid var(--soft-border); border-radius: 6px; padding: 0.75rem; white-space: pre-wrap; word-break: break-all; font-size: 0.8rem; }
.preview h2 { margin: 1rem 0 0.25rem; display: flex; justify-content: space-between; gap: 1rem; font-size: 0.95rem; font-family: var(--mono); font-weight: 600; }

/* figures: sec-kpi tiles */
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.figure { background: var(--surface-2); border: 1px solid #e2e5e8; border-radius: 10px; padding: 0.85rem 1rem; }
.figure.rv-proposed { background: var(--gold-tint); border-color: #ecc14e; }
.fig-value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: var(--ink); margin: 0; font-variant-numeric: tabular-nums; }
.fig-unit { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.fig-label { font-size: 0.92rem; font-weight: 600; color: var(--ink); line-height: 1.4; margin: 0.45rem 0 0.25rem; }
.fig-basis { font-size: 0.82rem; color: var(--secondary); margin: 0; }
.progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.progress-grid > section { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 14px 16px; }
.progress-grid h3 { margin: 0 0 0.5rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; }
.bar { display: flex; height: 12px; gap: 2px; margin: 0.4rem 0; border-radius: 3px; overflow: hidden; }
.bar .seg { min-width: 4px; }
.bar-key { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; font-size: 0.8rem; color: var(--secondary); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.35rem; vertical-align: 0; }
/* solid (dot) colours for bar segments and key swatches */
.seg.badge, .sw.badge { box-shadow: none; }
.seg.b-critical, .sw.b-critical, .seg.b-malicious, .sw.b-malicious, .seg.b-confirmed, .sw.b-confirmed { background: #8e1f19; }
.seg.b-high, .sw.b-high, .seg.b-suspicious, .sw.b-suspicious { background: var(--bad-dot); }
.seg.b-medium, .sw.b-medium, .seg.b-unexplained, .sw.b-unexplained { background: var(--warn-dot); }
.seg.b-low, .sw.b-low, .seg.b-open, .sw.b-open { background: var(--mut-dot); }
.seg.b-info, .sw.b-info { background: #c5cbd1; }
.seg.b-ruled_out, .sw.b-ruled_out, .seg.b-expected, .sw.b-expected, .seg.b-answered, .sw.b-answered { background: var(--ok-dot); }
.facts-inline { display: grid; grid-template-columns: auto auto; gap: 0.3rem 1rem; font-size: 0.88rem; margin: 0; }
.facts-inline dt { color: var(--ink-muted); }
.facts-inline dd { margin: 0; font-variant-numeric: tabular-nums; }

/* notes: note-card */
.note-form textarea { max-width: 78ch; }
.notes { list-style: none; padding: 0; margin: 1.5rem 0; display: flex; flex-direction: column; gap: 0.75rem; }
.note { background: var(--surface-2); border: 1px solid var(--soft-border); border-radius: 8px; padding: 0.85rem 1.05rem 0.55rem; font-size: 0.92rem; line-height: 1.55; color: #23262b; }
.note-meta { font-size: 0.76rem; color: #8a8f94; margin-bottom: 0.4rem; }

/* reports */
.report-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.copy-status { font-size: 0.85rem; color: var(--ok); }
.report-frame { width: 100%; height: 70vh; border: 1px solid var(--hairline); border-radius: 8px; background: #fff; }
.report-source { font-size: 0.78rem; }

/* ---------------------------------------------------------------- agent panel */
.agent {
    position: sticky; top: 3px; height: calc(100vh - 19px);
    display: flex; flex-direction: column; background: var(--surface-2); font-size: 14px;
    border: 1px solid var(--hairline); border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); overflow: hidden;
}
.agent-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem; border-bottom: 1px solid var(--hairline); background: var(--surface-1); }
.agent-head h2 { margin: 0; font-size: 1rem; white-space: nowrap; }
.agent.is-running .agent-head h2::after { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--warn-dot); box-shadow: 0 0 0 3px rgba(224,162,0,0.18); margin-left: 0.5rem; vertical-align: 1px; animation: pulse 1.4s infinite; }
.agent-pick { flex: 1; min-width: 0; }
.agent-pick select { font-size: 0.85rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.agent-close { display: none; }
.agent-meta { font-size: 0.76rem; color: var(--muted-2); padding: 0.35rem 1rem; border-bottom: 1px solid #f0f2f4; margin: 0; max-width: none; }
.ask { font-size: 0.82rem; font-weight: 600; color: var(--link-blue); background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.ask:hover { text-decoration: underline; }
.agent-compose.flash-in textarea { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow 0.2s; }
.agent-log { flex: 1; overflow-y: auto; padding: 1rem; font-size: 0.9rem; }
.agent-empty p { font-size: 0.9rem; }
.msg { margin-bottom: 0.9rem; }
.msg p, .msg li { max-width: none; }
.msg pre { background: var(--surface-1); border: 1px solid var(--soft-border); border-radius: 6px; padding: 0.5rem; overflow-x: auto; font-size: 0.78rem; }
.msg code { background: var(--surface-3); padding: 0 0.25rem; border-radius: 3px; }
.msg ul, .msg ol { padding-left: 1.2rem; margin: 0 0 0.6rem; }
.md-h { font-weight: 700; color: var(--ink); margin-top: 0.8rem; }
.md-table { overflow-x: auto; margin-bottom: 0.6rem; }
.md-table table { border-collapse: collapse; font-size: 0.8rem; }
.md-table th, .md-table td { border: 1px solid var(--soft-border); padding: 0.2rem 0.4rem; text-align: left; vertical-align: top; }
.md-table th { background: var(--surface-1); }
.msg-user { background: var(--surface-1); border: 1px solid var(--soft-border); border-radius: 8px; padding: 0.5rem 0.75rem; }
.msg-user .who { font-size: 0.74rem; font-weight: 600; color: #5a5f65; margin: 0 0 0.2rem; }
.msg-sub { margin-left: 1rem; opacity: 0.85; }
/* tool activity: consecutive tool calls grouped into one block */
.activity { margin: 0 0 0.8rem; border: 1px solid #eceef0; border-radius: 8px; background: #fafbfc; font-size: 0.8rem; }
.activity > summary { cursor: pointer; padding: 0.4rem 0.7rem; color: var(--muted-2); list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity > summary::-webkit-details-marker { display: none; }
.activity > summary::before { content: "\25B8"; display: inline-block; width: 0.9rem; color: #b8bdc2; transition: transform 0.15s; }
.activity[open] > summary::before { transform: rotate(90deg); }
.activity.is-live > summary { color: #33373b; font-weight: 600; }
.activity.is-live > summary::after { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #e6e8ea; border-top-color: var(--accent); margin-left: 0.45rem; vertical-align: -2px; animation: spin 0.8s linear infinite; }
.act-sum { font-family: var(--mono); font-size: 0.74rem; font-weight: 400; }
.act-err { color: var(--bad); font-weight: 600; margin-left: 0.3rem; }
.steps { list-style: none; margin: 0; padding: 0 0.4rem 0.4rem; border-top: 1px solid #eceef0; }
.step { margin: 0; }
.step.sub { margin-left: 1rem; }
.step summary { cursor: pointer; list-style: none; padding: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted-2); border-radius: 4px; }
.step summary::-webkit-details-marker { display: none; }
.step summary:hover { background: var(--surface-2); }
.mark { display: inline-block; width: 1rem; text-align: center; font-weight: 700; }
.step.pending .mark::before { content: '\2026'; color: var(--warn); }
.step.ok .mark::before { content: '\2713'; color: #3a9d5d; }
.step.err .mark::before { content: '\2715'; color: var(--bad); }
.step.denied .mark::before { content: '\2298'; color: var(--warn); }
.tool-name { font-weight: 600; color: #33373b; }
.tool-sum { font-family: var(--mono); font-size: 0.74rem; }
.out-meta { color: var(--muted-2); font-size: 0.72rem; margin-left: 0.3rem; }
.step.err .out-meta, .step.denied .out-meta { color: var(--bad); }
.tool-out { max-height: 260px; overflow: auto; background: var(--surface-2); border: 1px solid #eceef0; border-radius: 6px; padding: 0.5rem; font-size: 0.74rem; white-space: pre-wrap; word-break: break-all; margin: 0.2rem 0 0.4rem 1rem; }
.agent-live { font-size: 0.84rem; color: #33373b; font-weight: 600; margin: 0.2rem 0 0.8rem; }
.agent-live::after { content: '\2026'; animation: pulse 1.4s infinite; }
.msg-status { font-size: 0.78rem; color: var(--muted); margin: 0.25rem 0 0.9rem; padding: 0.3rem 0.6rem; border-radius: 6px; background: var(--mut-tint); }
.msg-status.st-quiet { background: none; padding-left: 0; font-size: 0.74rem; }
.msg-status.st-error { color: var(--bad); background: var(--bad-tint); }
.msg-status.st-warn { color: var(--warn); background: var(--warn-tint); }
.msg-status.st-done { color: var(--ok); background: var(--ok-tint); }
.agent-compose { border-top: 1px solid var(--hairline); padding: 0.75rem 1rem 1rem; background: var(--surface-1); }
.agent-compose textarea { font-size: 0.95rem; }
.agent-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.agent-status { flex: 1; font-size: 0.8rem; color: var(--muted); }
.agent-readonly { padding: 1rem; }
.agent-open { display: none; }

/* ---------------------------------------------------------------- incident search */
.isearch { position: sticky; top: 3px; z-index: 20; margin: 0 -24px 0; padding: 12px 24px; background: var(--surface-1); border-bottom: 1px solid var(--hairline); border-radius: 10px 10px 0 0; }
.isearch input[type=search] {
    padding: 0.5rem 2.6rem 0.5rem 2.4rem;
    background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E") no-repeat 0.8rem center;
}
.isearch.is-loading input[type=search] { background-image: none; }
.isearch.is-loading::before { content: ''; position: absolute; left: calc(24px + 0.85rem); top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 2px solid #e6e8ea; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.isearch-key { position: absolute; right: calc(24px + 0.75rem); top: 50%; transform: translateY(-50%); font: 600 0.75rem var(--mono); color: var(--muted); border: 1px solid var(--hairline); border-radius: 4px; padding: 0 0.35rem; background: var(--surface-1); }
.isearch input:focus ~ .isearch-key { display: none; }
.isearch-pop { position: absolute; left: 24px; right: 24px; top: calc(100% - 0.5rem); background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); overflow: hidden; }
#isearch-list { list-style: none; margin: 0; padding: 0.3rem 0; max-height: min(65vh, 560px); overflow-y: auto; }
#isearch-list .grp { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.9rem 0.25rem; border-top: 1px solid #f0f2f4; margin-top: 0.25rem; }
#isearch-list .grp:first-child { border-top: 0; margin-top: 0; }
.grp-count { font-size: 0.74rem; color: var(--muted-2); }
#isearch-list .opt { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.45rem 0.9rem 0.45rem 1.4rem; cursor: pointer; }
#isearch-list .opt.is-active { background: var(--accent-soft); }
#isearch-list .opt.is-rejected { opacity: 0.55; }
.opt-title { color: var(--ink); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-title.mono { font-size: 0.86rem; }
.opt-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: center; font-size: 0.74rem; color: var(--muted); }
.opt-detail { font-size: 0.78rem; color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#isearch-list .opt-action { flex-direction: row; font-size: 0.85rem; color: var(--ink); border-top: 1px solid #f0f2f4; padding-left: 0.9rem; }
#isearch-list .opt-action + .opt-action { border-top: 0; }
#isearch-list .opt-agent::before { content: '\203A'; margin-right: 0.4rem; color: var(--muted); font-weight: 700; }
#isearch-list .none { padding: 0.7rem 0.9rem; color: var(--muted); font-size: 0.88rem; }
mark { background: var(--accent); color: inherit; padding: 0 1px; border-radius: 2px; }
.isearch-foot { margin: 0; max-width: none; padding: 0.45rem 0.9rem; border-top: 1px solid #f0f2f4; background: var(--surface-1); font-size: 0.74rem; color: var(--muted); }
.isearch-foot button { font: 0.72rem var(--mono); background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 4px; padding: 0 0.3rem; cursor: pointer; color: var(--ink); }
.isearch-foot button:hover { border-color: #999; background: var(--surface-3); }

/* record type labels: entities solid (they are the indicators), others text on tint */
.kind { display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--mut-tint); color: var(--mut); }
.kind-entity { background: var(--ink); color: #fff; }
.kind-finding { background: var(--bad-tint); color: var(--bad); }
.kind-event { background: var(--mut-tint); color: var(--mut); }
.kind-evidence { background: var(--ok-tint); color: var(--ok); }
.kind-question { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px #d2d5d9; }
.kind-note { background: var(--soft-fill); color: var(--secondary); }
.kind-figure { background: var(--warn-tint); color: var(--warn); }

/* full results page */
.search-title { margin-top: 0; }
.sr-group h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; margin: 1.5rem 0 0.5rem; }
.sr-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.sr-item { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--hairline); align-items: start; }
.sr-item .kind { justify-self: start; margin-top: 0.15rem; }
.sr-meta { display: block; font-size: 0.8rem; color: var(--muted); }
.sr-detail { font-size: 0.86rem; color: var(--secondary); margin: 0.15rem 0 0; }
.sr-item a { color: var(--ink); }

/* the record a search result pointed at */
.hit { animation: hit 2.4s ease-out; }
@keyframes hit { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); background-color: var(--gold-tint); } 100% { box-shadow: 0 0 0 3px transparent; } }
:target { scroll-margin-top: 6rem; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
    :root { --agent-w: 380px; }
    /* the rail becomes an overlay so the sheet and agent panel keep their width */
    .has-left-nav .main-wrapper, .left-nav-collapsed .main-wrapper { margin-left: 0; padding-left: 52px; }
    .left-nav { transform: translateX(calc(-100% - 8px)); box-shadow: 8px 0 24px rgba(0,0,0,0.08); }
    .left-nav__hide { opacity: 1; }
    .left-nav__show { display: inline-flex; }
    .left-nav-open .left-nav { transform: none; }
    .overview { grid-template-columns: 1fr; }
    .ov-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
}
@media (max-width: 1000px) {
    .workspace { grid-template-columns: 1fr; }
    .agent { position: fixed; inset: 3px 4px 4px auto; height: auto; width: min(calc(100% - 8px), 480px); z-index: 40; transform: translateX(calc(100% + 8px)); transition: transform 0.2s ease; box-shadow: -8px 0 24px rgba(0,0,0,0.08); }
    .agent-shown .agent { transform: none; }
    .agent-close { display: inline; }
    .agent-open { display: block; position: fixed; right: 1rem; bottom: 1rem; z-index: 35; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
    .agent-shown .agent-open { display: none; }
}
@media (max-width: 768px) {
    .has-left-nav .main-wrapper, .left-nav-collapsed .main-wrapper { padding: 48px 4px 4px; }
    .page { padding: 16px 16px 5rem; }
    .case-main { padding: 0 16px 5rem; }
    .isearch { margin: 0 -16px; padding: 10px 16px; }
    .isearch-pop { left: 0.5rem; right: 0.5rem; }
    .isearch-key { display: none; }
    .case-link { grid-template-columns: 1fr; }
    .case-ref { grid-row: auto; padding: 0; }
    .case-meta { margin-left: 0; }
    .tl-event { grid-template-columns: 1fr; gap: 0.2rem; }
    .tl-time { flex-direction: row; gap: 0.6rem; align-items: baseline; }
    table.data { display: block; overflow-x: auto; }
    .inline-add { flex-direction: column; }
    .q-notes, .question form { margin-left: 0.9rem; }
    .sr-item { grid-template-columns: 1fr; gap: 0.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
.offer { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 8px; padding: 0.75rem 1rem; margin: 0.75rem 0; }
.offer table.data { margin: 0.5rem 0; }
