/* Baseone Resolve — styles.
   Layout: fixed left rail on desktop, top tab bar on phones; content column with summary before detail.
   Tokens: slate-blue neutrals, steel-blue accent, reserved status colours, five source colours. */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #e9edf3;
  --line: #d3dae4;
  --fg: #16202c;
  --fg-2: #4a5867;
  --fg-3: #74818f;
  --accent: #1f5f8b;
  --accent-fg: #ffffff;
  --accent-soft: #e1edf6;
  --good: #1e7f4f; --good-soft: #e3f3ea;
  --warn: #9a6700; --warn-soft: #fbf0d6;
  --serious: #b4501a; --serious-soft: #fbe8dc;
  --critical: #b42318; --critical-soft: #fbe3e1;
  --src-hms: #2f6fb7; --src-contractor: #b8641b; --src-tenant: #7a4fb5; --src-inspection: #1f8a6e; --src-finance: #a0522d;
  --font-ui: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(22, 32, 44, .06), 0 4px 14px rgba(22, 32, 44, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161d; --surface: #181f28; --surface-2: #1f2832; --line: #2c3743;
    --fg: #e6ebf1; --fg-2: #aab6c3; --fg-3: #7d8a98;
    --accent: #6fb1e0; --accent-fg: #0d1a24; --accent-soft: #1b3447;
    --good: #5cc48e; --good-soft: #15342a; --warn: #e2b55a; --warn-soft: #3a2f14;
    --serious: #ef8f5a; --serious-soft: #3d2416; --critical: #f07d74; --critical-soft: #42201e;
    --src-hms: #4f8ccc; --src-contractor: #c8803c; --src-tenant: #9c78cf; --src-inspection: #3fa788; --src-finance: #c5724f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11161d; --surface: #181f28; --surface-2: #1f2832; --line: #2c3743;
  --fg: #e6ebf1; --fg-2: #aab6c3; --fg-3: #7d8a98;
  --accent: #6fb1e0; --accent-fg: #0d1a24; --accent-soft: #1b3447;
  --good: #5cc48e; --good-soft: #15342a; --warn: #e2b55a; --warn-soft: #3a2f14;
  --serious: #ef8f5a; --serious-soft: #3d2416; --critical: #f07d74; --critical-soft: #42201e;
  --src-hms: #4f8ccc; --src-contractor: #c8803c; --src-tenant: #9c78cf; --src-inspection: #3fa788; --src-finance: #c5724f;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-2); }
.faint { color: var(--fg-3); }
.small { font-size: 12px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100%; }
.rail {
  background: var(--surface); border-right: 1px solid var(--line);
  padding-block: 18px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 12px;
  display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: var(--accent-fg);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -.04em;
}
.brand-name { font-weight: 600; font-size: 15px; }
.brand-by { font-size: 11px; color: var(--fg-3); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius); text-decoration: none; color: var(--fg-2); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav .count { font-size: 11px; background: var(--surface-2); color: var(--fg-2); border-radius: 999px; padding: 1px 7px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.landlord { font-size: 12px; color: var(--fg-2); }
.landlord strong { display: block; color: var(--fg); font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar .grow { flex: 1 1 auto; min-width: 0; }
.asof { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-2); }
.asof input { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--fg); }
.demo-banner {
  background: var(--warn-soft); color: var(--fg); font-size: 12px; border-bottom: 1px solid var(--line);
  padding-block: 6px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.content {
  padding-block: 22px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 22px; max-width: 1180px; width: 100%;
}
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .lede { color: var(--fg-2); max-width: 64ch; margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; font-size: 13px;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.danger { color: var(--critical); }
.btn:disabled { opacity: .5; cursor: default; }
select, textarea, input[type="text"], input[type="date"], input[type="number"] {
  font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 9px;
}
textarea { width: 100%; min-height: 120px; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--fg-2); }
label.field span { font-weight: 500; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }

/* ---------- cards & tiles ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.card > .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card > .card-body { padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile .value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.tile .label { font-size: 12px; color: var(--fg-2); }
.tile .sub { font-size: 12px; color: var(--fg-3); }
.tile[data-tone="critical"] .value { color: var(--critical); }
.tile[data-tone="serious"] .value { color: var(--serious); }
.tile[data-tone="warn"] .value { color: var(--warn); }
.tile[data-tone="good"] .value { color: var(--good); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.good { color: var(--good); background: var(--good-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.serious { color: var(--serious); background: var(--serious-soft); }
.pill.critical { color: var(--critical); background: var(--critical-soft); }
.pill.info, .pill.neutral { color: var(--fg-2); background: var(--surface-2); }
.pill.plain::before { display: none; }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--fg-2); }
.src::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--src-color, var(--fg-3)); }
[data-source="hms"] { --src-color: var(--src-hms); }
[data-source="contractor"] { --src-color: var(--src-contractor); }
[data-source="tenant"] { --src-color: var(--src-tenant); }
[data-source="inspection"] { --src-color: var(--src-inspection); }
[data-source="finance"] { --src-color: var(--src-finance); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--surface-2); }
td .addr { font-weight: 500; }
td .sub { font-size: 12px; color: var(--fg-3); }

/* ---------- duty meters ---------- */
.duties { display: flex; flex-direction: column; gap: 14px; }
.duty { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.duty .name { font-weight: 500; }
.duty .basis { font-size: 12px; color: var(--fg-3); grid-column: 1 / -1; }
.duty .meter { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; position: relative; }
.duty .meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--meter, var(--fg-3)); }
.duty .meter > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--fg-2); }
.duty .dates { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 11px; color: var(--fg-3); }
.duty[data-status="met"] { --meter: var(--good); }
.duty[data-status="met_late"] { --meter: var(--warn); }
.duty[data-status="on_track"] { --meter: var(--accent); }
.duty[data-status="at_risk"] { --meter: var(--warn); }
.duty[data-status="breached"] { --meter: var(--critical); }

/* ---------- findings ---------- */
.findings { display: flex; flex-direction: column; gap: 10px; }
.finding { border: 1px solid var(--line); border-left-width: 4px; border-radius: 6px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.finding[data-severity="critical"] { border-left-color: var(--critical); }
.finding[data-severity="serious"] { border-left-color: var(--serious); }
.finding[data-severity="warning"] { border-left-color: var(--warn); }
.finding[data-severity="info"] { border-left-color: var(--fg-3); }
.finding.decided { opacity: .78; }
.finding .f-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.finding .f-title { font-weight: 600; }
.finding .f-rule { font-size: 11px; color: var(--fg-3); }
.finding .f-body { color: var(--fg-2); }
.finding .f-evidence { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); color: var(--fg-2); border: 0; cursor: pointer; font-family: var(--font-mono); }
.chip:hover { background: var(--accent-soft); color: var(--accent); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--src-color, var(--fg-3)); }
.finding .f-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.decision { font-size: 12px; background: var(--surface-2); border-radius: 4px; padding: 8px 10px; color: var(--fg-2); }
.decision strong { color: var(--fg); }
.decide-form { display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); padding: 10px; border-radius: 6px; }
.decide-form textarea { min-height: 64px; font-family: var(--font-ui); font-size: 13px; }

/* ---------- timeline ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 112px 18px minmax(0, 1fr); gap: 0 12px; }
.tl-when { font-size: 12px; color: var(--fg-3); padding-top: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.tl-when b { display: block; color: var(--fg-2); font-weight: 500; }
.tl-spine { position: relative; }
.tl-spine::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-item:first-child .tl-spine::before { top: 18px; }
.tl-item:last-child .tl-spine::before { bottom: calc(100% - 18px); }
.tl-dot { position: absolute; left: 3px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: var(--src-color, var(--fg-3)); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--src-color, var(--fg-3)); }
.tl-card { margin: 6px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tl-card.hl { outline: 2px solid var(--accent); outline-offset: 1px; }
.tl-card .tl-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tl-card .tl-title { font-weight: 500; }
.tl-card .tl-detail { color: var(--fg-2); font-size: 13px; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--fg-3); }
.tl-meta .mono { font-size: 11px; }
.attach { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 7px; border-radius: 4px; border: 1px dashed var(--line); color: var(--fg-2); }

/* ---------- layout helpers ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--fg-3); }
.kv dd { margin: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--fg-2); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 14px; border-radius: 6px; font-size: 13px; box-shadow: var(--shadow); z-index: 50; }
.empty { padding: 28px 16px; text-align: center; color: var(--fg-3); }
.rule-list { display: flex; flex-direction: column; }
.rule { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.rule:last-child { border-bottom: 0; }
.rule .r-id { font-family: var(--font-mono); font-size: 12px; color: var(--fg-3); }
.rule .r-name { font-weight: 600; }
.rule .r-logic { color: var(--fg-2); font-size: 13px; margin-top: 2px; }

/* ---------- floating assistant ---------- */
.ai-pill {
  position: fixed; right: calc(20px + env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px 11px 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-fg); font-weight: 600; font-size: 14px; letter-spacing: .005em;
  box-shadow: 0 6px 20px rgba(22, 32, 44, .22), 0 0 0 1px rgba(255,255,255,.08) inset; view-transition-name: ai;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
}
.ai-pill:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 10px 26px rgba(22, 32, 44, .28); }
.ai-spark { display: inline-block; font-size: 15px; line-height: 1; animation: spark 2.8s ease-in-out infinite; }
@keyframes spark { 0%, 100% { transform: rotate(0) scale(1); opacity: 1; } 50% { transform: rotate(90deg) scale(1.18); opacity: .78; } }
.ai-panel {
  position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 32px - env(safe-area-inset-bottom, 0px)));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(22, 32, 44, .28); overflow: hidden; view-transition-name: ai;
}
.ai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ai-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ai-title .ai-spark { color: var(--accent); }
.ai-context { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.ai-thread { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); min-height: 0; }
.ai-bubble { max-width: 92%; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; display: flex; flex-direction: column; gap: 8px; animation: fade-up .3s ease-out both; }
.ai-bubble p { margin: 0; white-space: pre-wrap; }
.ai-bubble.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-bubble.user { align-self: flex-end; background: var(--accent-soft); color: var(--fg); border-bottom-right-radius: 4px; }
.ai-note { font-size: 11px; color: var(--fg-3); border-top: 1px dashed var(--line); padding-top: 6px; }
.ai-cite { font: inherit; font-family: var(--font-mono); font-size: 11px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent); cursor: pointer; vertical-align: baseline; }
.ai-cite:hover { background: var(--accent-soft); }
.ai-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-3); animation: dot 1.2s ease-in-out infinite; }
.ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }
.ai-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px 0; background: var(--surface); }
.ai-chips .chip { font-family: var(--font-ui); font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.ai-chips .chip::before { display: none; }
.ai-form { display: flex; gap: 8px; padding: 10px 16px; background: var(--surface); align-items: flex-end; }
.ai-form textarea { flex: 1; min-height: 38px; max-height: 120px; resize: none; font-family: var(--font-ui); font-size: 13px; border-radius: 10px; }
.ai-foot { font-size: 11px; color: var(--fg-3); padding: 0 16px 12px; background: var(--surface); }
@media (max-width: 600px) {
  .ai-panel { right: 0; bottom: 0; width: 100vw; height: min(85vh, 640px); border-radius: 16px 16px 0 0; }
}

/* ---------- evidence pack ---------- */
.pack { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px 32px; display: flex; flex-direction: column; gap: 22px; max-width: 860px; }
.pack h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); font-weight: 600; }
.pack .pack-title { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; border-bottom: 2px solid var(--fg); padding-bottom: 14px; }
.pack .pack-title h1 { font-size: 20px; }
.pack .hash { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); word-break: break-all; }
.pack ol, .pack ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; gap: 12px; padding-right: max(16px, env(safe-area-inset-right, 0px)); border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .nav { flex-direction: row; }
  .nav a { padding: 6px 10px; white-space: nowrap; }
  .nav .count { display: none; }
  .rail-foot { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 18px minmax(0, 1fr); }
  .tl-when { grid-column: 2; text-align: left; padding-top: 0; order: -1; display: flex; gap: 8px; }
  .tl-when b { display: inline; }
  .tl-spine { grid-row: 1 / span 2; }
  .rule { grid-template-columns: 1fr; gap: 4px; }
  .pack { padding: 18px 16px; }
}
/* ---------- motion ----------
   Entrances run only when the view changes (.anim is set by the app), so typing or recording a decision never re-animates the page.
   Shared elements carry view-transition-name so a table row morphs into the case header, and the case into its evidence pack. */
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes meter-fill { from { width: 0; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes mark-breathe { 0%, 100% { border-radius: 7px; } 50% { border-radius: 50% 7px 50% 7px; } }
.anim .page-head, .anim .tile, .anim .card, .anim .finding, .anim .tl-item, .anim .duty, .anim .rule { animation: fade-up .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 50ms); }
.anim .card { --i: 1; }
.anim .duty .meter > i { animation: meter-fill 1s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 120ms + 250ms); }
.tl-card.hl { animation: pulse-ring 1.1s ease-out 2; }
.toast { animation: toast-in .25s ease-out both; }
.brand-mark { transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), border-radius .45s ease; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); animation: mark-breathe 1.6s ease-in-out infinite; }
.tl-card, .finding, .btn, .row-link td, .nav a { transition: background-color .18s ease, outline-color .18s ease, border-color .18s ease, transform .18s ease; }
.row-link:hover .addr { color: var(--accent); }
.finding:hover { transform: translateX(2px); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; }
::view-transition-group(*) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(*), ::view-transition-new(*) { mix-blend-mode: normal; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
