:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --line: #e7e9ee;
  --line-soft: #eff1f4;
  --field-line: #dfe2e8;
  --ink: #2a2f3a;
  --ink-2: #4a5160;
  --muted: #6b7280;
  --faint: #8a90a0;
  --accent: #5563b0;
  --accent-deep: #46529a;
  --accent-soft: #eef0f9;
  --accent-ink: #4a57a0;
  --pass: #2f7a55;
  --pass-soft: #e8f3ed;
  --fail: #a8453f;
  --fail-soft: #f9ecea;
  --warn: #80591b;
  --warn-soft: #f7f0e2;
  --neutral-soft: #f1f2f5;
  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid #8e99d6; outline-offset: 2px; }
code { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border-radius: 4px; background: var(--neutral-soft); }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  padding: 0.5rem 0.8rem; border-radius: var(--radius-sm);
  background: var(--ink); color: #fff;
}
.skip-link:focus { top: 0.5rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  min-height: 48px;
  padding: 0 clamp(12px, 3vw, 32px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { display: block; width: 28px; height: 28px; }
.project-badge {
  padding: 1px 6px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: 11px;
}
.topbar-divider { width: 1px; height: 18px; background: var(--line); }
.topnav { display: flex; gap: 2px; margin-right: auto; }
.topnav a {
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px;
  border-radius: 6px; color: var(--ink-2); font-size: 13px; font-weight: 500;
}
.topnav a:hover { background: #f3f4f7; color: var(--ink); text-decoration: none; }
.topnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.session { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 13px; }
.topnav + .session { margin-left: 0; }
.session-email { color: var(--muted); }
.session form { margin: 0; }

/* Page */
.page {
  display: flex; flex-direction: column; gap: 12px;
  padding: clamp(16px, 3vw, 32px);
  min-width: 0;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
h1 { font-size: 22px; letter-spacing: -0.015em; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
h4 { font-size: 13px; }
p { margin: 0; }

.lede { color: var(--ink-2); font-size: 15px; text-wrap: pretty; max-width: 40rem; }
.hint, .quiet { color: var(--muted); }
.hint { text-wrap: pretty; }
.kicker { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Radar viewer */
.radar-page { padding: 12px clamp(12px, 2vw, 24px); gap: 10px; }
.radar-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.radar-heading { display: flex; align-items: baseline; gap: 12px; margin-right: auto; }
.radar-heading h1 { font-size: 20px; }
.radar-date-form { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.radar-date-form label { color: var(--muted); font-size: 13px; }
.radar-date-control { display: flex; height: 36px; width: 158px; border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--surface); }
.radar-date-control:focus-within { outline: 2px solid #8e99d6; outline-offset: 2px; }
.radar-date-control input[type="text"] { width: 122px; min-width: 0; padding: 6px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: inherit; outline: none; }
.radar-calendar-control { position: relative; width: 34px; flex-shrink: 0; display: grid; place-items: center; }
.radar-calendar-control svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.radar-calendar-control input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; color-scheme: light; }
.radar-calendar-control input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.radar-date-error { position: absolute; top: 100%; right: 0; z-index: 2; margin-top: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--fail); font-size: 12px; max-width: min(260px, 80vw); }
.radar-date-form a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.radar-view { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.radar-frame { display: block; width: 100%; height: calc(100dvh - 130px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.radar-message { display: grid; gap: 12px; padding: clamp(24px, 5vw, 48px); min-height: 220px; align-content: center; }
@media (max-width: 640px) {
  .radar-toolbar { gap: 10px; }
  .radar-heading { width: auto; }
  .radar-date-form { order: 3; flex-basis: 100%; flex-wrap: nowrap; }
  .radar-date-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .radar-frame { height: calc(100dvh - 188px); }
}

/* Buttons */
.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 500; white-space: nowrap;
  cursor: pointer;
}
.button:hover, button:hover { background: var(--accent-deep); color: #fff; text-decoration: none; }
.button-secondary, button.button-secondary {
  background: var(--surface); color: var(--ink); border-color: var(--field-line);
}
.button-secondary:hover, button.button-secondary:hover { background: var(--bg); color: var(--ink); }
.button-small { height: 30px; padding: 0 12px; font-size: 13px; }
.button-block { width: 100%; height: 40px; }
.link-button, button.link-button {
  height: auto; padding: 0; border: 0; background: none;
  color: var(--ink-2); font-size: inherit; font-weight: 400;
}
.link-button:hover, button.link-button:hover { background: none; color: var(--ink); }
button.link-accent { color: var(--accent); }
button.link-accent:hover { color: var(--accent-deep); text-decoration: underline; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions > *, .title-row > .pill, .title-row > .tag { flex: none; }
.actions form { margin: 0; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 16px; margin: 0; }
label, .field {
  display: flex; flex-direction: column; gap: 6px;
  color: var(--ink-2); font-size: 13px; font-weight: 500;
}
.optional { font-weight: 400; color: var(--faint); }
input, select, textarea {
  width: 100%; min-height: 38px; padding: 0 12px;
  border: 1px solid var(--field-line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 400;
}
input:focus, select:focus, textarea:focus { border-color: #a9b1e0; outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { padding: 10px 12px; min-height: 8rem; resize: vertical; font-family: var(--mono); font-size: 13px; line-height: 1.6; }
input[readonly] { background: var(--surface-soft); font-family: var(--mono); font-size: 12px; }
.code-input { height: 48px; font-family: var(--mono); font-size: 20px; letter-spacing: 0.4em; text-align: center; }
.field-narrow { max-width: 240px; }

/* Banners */
.banner { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); text-wrap: pretty; }
.banner-danger { background: var(--fail-soft); color: #9a3f3a; }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-info { background: var(--accent-soft); color: #3f4a8a; }

/* Pills and tags */
.pill, .tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap;
  background: var(--neutral-soft); color: var(--ink-2);
}
.tag { background: var(--surface); border: 1px solid var(--line); font-weight: 400; }
.pill-muted { background: var(--surface); color: var(--muted); border: 1px dashed #cfd3da; }
.pill-accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill[data-status="passed" i] { background: var(--pass-soft); color: var(--pass); }
.pill[data-status="failed" i] { background: var(--fail-soft); color: var(--fail); }
.pill[data-status="blocked" i] { background: #f7efdf; color: #8a6320; }
.pill[data-status="skipped" i], .pill[data-status="invalid" i] { background: #eef0f3; color: #5f6b7a; }
.pill[data-status="retest" i], .pill[data-status="in_progress" i] { background: var(--accent-soft); color: var(--accent-ink); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.cache-state { display: inline-flex; align-items: center; gap: 6px; }
.cache-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b6bbc6; }
.cache-state[data-state="fresh"]::before { background: #86bea0; }

/* Centered pages: home, sign in, error */
.center-page {
  width: min(560px, 100%); margin: 8vh auto 0;
  display: flex; flex-direction: column; gap: 14px;
}
.center-page.text-center { align-items: center; text-align: center; }
.state-page { margin: 0 auto; min-height: min(60vh, 520px); justify-content: center; gap: 10px; }
.state-page h1 { font-size: 22px; }
.state-page .actions { justify-content: center; margin-top: 8px; }
.state-icon {
  width: 40px; height: 40px; margin-bottom: 4px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--neutral-soft); color: var(--faint);
  font-weight: 600; font-size: 18px; line-height: 1;
}
.state-icon::before { content: "!"; }
.center-page h1 { font-size: 26px; letter-spacing: -0.02em; }

.auth {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 6vh 0 24px;
}
.auth-card {
  width: min(400px, 100%);
  display: flex; flex-direction: column; gap: 20px;
  padding: 32px;
  box-shadow: 0 1px 2px rgba(20, 24, 40, 0.04);
}
.auth-head { display: flex; flex-direction: column; gap: 6px; }
.auth-head h1 { font-size: 20px; }
.auth-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; }
.auth-foot form { margin: 0; }
.auth-note { color: var(--muted); font-size: 12px; }

/* Link builder */
.composer { width: min(680px, 100%); display: flex; flex-direction: column; gap: 20px; }
.composer-head { display: flex; flex-direction: column; gap: 6px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-head label { display: inline; }
button.guide-link { gap: 5px; font-size: 13px; font-weight: 500; }
button.guide-link svg { width: 14px; height: 14px; flex: none; align-self: center; }
.guide { width: min(44rem, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 16px 24px 24px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 32px rgba(20, 24, 40, 0.12); }
.guide::backdrop { background: rgba(20, 24, 40, 0.35); }
.guide form { display: flex; flex-direction: column; gap: 22px; margin: 0; }
.guide h2 { font-size: 18px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 1; margin: 0 -16px 0 -24px; padding: 10px 10px 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
button.icon-close { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); flex: 0 0 auto; }
button.icon-close svg { width: 16px; height: 16px; }
button.icon-close:hover { background: var(--surface-soft); color: var(--ink); }
.comment-sheet textarea { min-height: 16rem; font-family: inherit; font-size: 15px; line-height: 1.55; letter-spacing: 0; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.guide-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 0 8px 6px 0; }
.guide-table td { padding: 9px 12px 9px 0; border-top: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-2); line-height: 1.55; }
.guide-table td:first-child { white-space: nowrap; width: 6rem; }
.guide-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.guide-examples code { display: block; padding: 8px 10px; border-radius: 8px; background: var(--surface-soft); border: 1px solid var(--line-soft); color: var(--ink-2); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.composer .card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.finder { display: flex; flex-direction: column; gap: 8px; }
.finder-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.finder-row label { flex: 1 1 180px; }
.finder-results { display: flex; flex-direction: column; max-height: 16rem; overflow: auto; border: 1px solid var(--line-soft); border-radius: 8px; }
.finder-case { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); font-weight: 400; color: var(--ink); cursor: pointer; }
.finder-case:last-child { border-bottom: 0; }
.finder-case:hover { background: #f7f8fb; }
.finder-case input { width: auto; min-height: 0; }
.working { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.working[hidden] { display: none; }
.working::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
button:disabled { opacity: 0.55; }
.built { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.built h2 { font-size: 14px; }
.built-row { display: flex; flex-wrap: wrap; gap: 8px; }
.built-row input { flex: 1 1 280px; min-width: 0; }
.inject-row { display: grid; grid-template-columns: minmax(140px, 1fr) 150px minmax(180px, 1.4fr) auto; gap: 12px; align-items: end; }

/* Report */
.page-head { display: block; }
.page-head h1 { font-size: 18px; line-height: 1; height: 28px; display: inline-flex; align-items: center; }
.report-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.report-line .pill, .report-line .id-chip { height: 28px; padding: 0 8px; line-height: 1; box-sizing: border-box; }
.report-line .actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-line .actions form { margin: 0; display: flex; align-items: center; }
.case-ids { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; max-width: min(40rem, 100%); }
.case-ids-panel { position: relative; }
.case-ids-panel > summary { cursor: pointer; list-style: none; gap: 6px; }
.case-ids-panel > summary::-webkit-details-marker { display: none; }
.case-ids-panel > summary::marker { content: ""; }
.case-ids-panel > summary::after { content: ""; width: 0; height: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid currentColor; opacity: 0.7; }
.case-ids-panel[open] > summary::after { transform: rotate(180deg); }
.case-ids-panel > .case-ids { position: absolute; z-index: 4; top: calc(100% + 6px); left: 0; width: max-content; max-width: min(28rem, calc(100vw - 48px)); padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(42, 47, 58, 0.08); }
.id-chip { display: inline-flex; align-items: center; justify-content: center; height: 28px; padding: 0 8px; border-radius: 6px; background: #f3f4f8; color: var(--ink-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); font-size: 13px; }
.crumbs .tag { margin-left: 4px; padding: 0 7px; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; }
.crumbs .tag + .tag { margin-left: 0; }
.page-head .title-row { margin: 2px 0; }
.page-head .links { margin-top: 2px; }
.crumbs span[aria-hidden] { color: #b6bbc6; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }

.run-summary { padding: 12px 0 2px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.run-summary h2 { font-size: 15px; }
.run-summary-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.run-summary-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.case-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Workspace: fixed titles on the page, panels open and close below them */
.workspace { --pane-time: 240ms; --pane-ease: cubic-bezier(0.22, 0.8, 0.26, 1); display: flex; flex-direction: column; gap: 8px; }
.workspace-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
button.pane-switch {
  height: 32px; padding: 0 8px; margin: 0 -8px; gap: 6px;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  transition: background-color 120ms ease, color 120ms ease;
}
button.pane-switch:hover { background: rgba(42, 47, 58, 0.06); color: var(--ink); }
button.pane-switch[aria-expanded="false"] { color: var(--muted); }
button.pane-switch .chevron { width: 16px; height: 16px; color: var(--faint); transition: transform var(--pane-time) var(--pane-ease); }
button.pane-switch:hover .chevron { color: var(--ink-2); }
button.pane-switch[aria-expanded="false"] .chevron,
button.pane-switch-end[aria-expanded="true"] .chevron { transform: rotate(180deg); }
button.pane-switch-end[aria-expanded="false"] .chevron { transform: none; }

.workspace-panes {
  display: grid; align-items: start;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 12px;
  transition: grid-template-columns var(--pane-time) var(--pane-ease), column-gap var(--pane-time) var(--pane-ease);
}
.workspace:not(.is-list-open) .workspace-panes { grid-template-columns: minmax(0, 0fr) minmax(0, 1fr); column-gap: 0; }
.workspace:not(.is-detail-open) .workspace-panes { grid-template-columns: minmax(0, 1fr) minmax(0, 0fr); column-gap: 0; }
.workspace:not(.is-list-open):not(.is-detail-open) .workspace-panes { grid-template-columns: minmax(0, 0fr) minmax(0, 0fr); }
.case-rail, .case-panel {
  min-width: 0; overflow: hidden;
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows var(--pane-time) var(--pane-ease), visibility 0s;
}
.case-rail > [data-pane-body], .case-panel > [data-pane-body] {
  min-height: 0;
  transition: opacity 160ms ease, transform var(--pane-time) var(--pane-ease);
}
.workspace:not(.is-list-open) .case-rail,
.workspace:not(.is-detail-open) .case-panel { visibility: hidden; transition: grid-template-rows var(--pane-time) var(--pane-ease), visibility 0s linear var(--pane-time); }
.workspace:not(.is-list-open) .case-rail > [data-pane-body] { opacity: 0; transform: translateX(-16px); }
.workspace:not(.is-detail-open) .case-panel > [data-pane-body] { opacity: 0; transform: translateX(16px); }
.case-list { overflow: hidden; }
.case-panel-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.list-tools { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.list-tools input { height: 36px; min-height: 0; }
.list-tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.status-chip, button.status-chip {
  height: 28px; padding: 0 10px; border-radius: 999px;
  border: 1px solid #e1e4ea; background: var(--surface); color: var(--ink-2);
  font-size: 12px; font-weight: 500; text-transform: capitalize;
}
.status-chip:hover, button.status-chip:hover { background: var(--bg); color: var(--ink); }
.status-chip[aria-pressed="true"], button.status-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: #d3d8f0; color: var(--accent-ink); }
#filter-count { margin-left: auto; font-size: 12px; }

.list-group {
  padding: 14px 16px 6px;
  color: var(--faint); font-size: 12px; font-weight: 500;
}
.case-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid #f3f4f6;
  color: inherit;
}
.case-row:last-of-type { border-bottom: 0; }
.case-row:hover { background: #f7f8fb; color: inherit; text-decoration: none; }
.case-row[aria-current="true"] { background: #f3f4fb; }
.case-row-id { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.case-row-title { font-weight: 500; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.case-row-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 11rem; }
.pill-count { margin-left: 4px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.list-empty { padding: 32px 16px; text-align: center; color: var(--muted); }

/* Case detail */
.case-detail { scroll-margin-top: 64px; }
.case-detail:focus { outline: none; }
.case-head { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 8px; }
.case-head h2 { font-size: 18px; text-wrap: pretty; }
.case-head:last-child { padding-bottom: 4px; }
.tabs { display: flex; gap: 20px; margin-top: 6px; border-bottom: 1px solid var(--line-soft); }
.tabs button {
  height: auto; padding: 8px 0 10px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; color: var(--muted); font-weight: 500;
}
.tabs button:hover { background: none; color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.case-section { padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 22px; }
.case-section + .case-section { border-top: 1px solid var(--line-soft); }
.rich { color: #3a404c; line-height: 1.6; text-wrap: pretty; overflow-wrap: anywhere; }
.rich p { margin: 0 0 0.5em; }
.rich p:last-child { margin-bottom: 0; }
.conditions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.box { padding: 12px 14px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--surface-soft); }
.field-label { margin-bottom: 4px; color: var(--faint); font-size: 12px; font-weight: 500; }
.none { color: #b6bbc6; }
.section-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps .steps { padding-left: 28px; }
.step { counter-increment: step; }
.step-row { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.step-num {
  flex: none; min-width: 26px; height: 24px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted);
  font-family: var(--mono); font-size: 12px;
}
.step-num::before { content: counters(step, "."); }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.step-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 12px 24px; }
.step-outcome { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-soft); border: 1px solid var(--line-soft); }

/* Results */
.attempt { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 12px; }
.attempt + .attempt { margin-top: 4px; }
.attempt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.attempt-head .links { margin-left: auto; }
.hash { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.outcomes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.outcome { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.outcome-head { display: flex; align-items: center; gap: 8px; }
.outcome-pos { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); }
.outcome-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px 20px; width: 100%; padding: 10px 12px; border-radius: 8px; background: var(--surface-soft); }
.outcome-guide .rich { color: var(--ink-2); }
.outcome-recorded { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.empty-box { padding: 28px 16px; border: 1px dashed var(--field-line); border-radius: var(--radius-sm); text-align: center; color: var(--muted); }

/* Evidence */
.evidence { display: flex; flex-wrap: wrap; gap: 10px; }
.shot { position: relative; display: flex; flex-direction: column; gap: 4px; width: 200px; margin: 0; color: var(--ink-2); font-size: 12px; }
.shot img { width: 200px; height: 124px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.shot figcaption { overflow-wrap: anywhere; }
.shot-open {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 6px;
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 24, 40, 0.16);
}
.shot-open svg { width: 14px; height: 14px; }
.shot-open:hover { background: #fff; color: var(--ink); text-decoration: none; }
.shot img[data-full] { cursor: zoom-in; }
.evidence .file { padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.photo-layer {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  background: rgba(20, 24, 40, 0.78);
}
.photo-layer img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; }

@media (min-width: 801px) {
  .case-rail > [data-pane-body] { min-width: 280px; }
  .case-panel > [data-pane-body] { min-width: 420px; }
  /* The case list stays in view while the page scrolls the details. */
  .workspace.is-detail-open .case-rail { position: sticky; top: 60px; }
  .workspace.is-detail-open .case-list { max-height: calc(100vh - 72px); overflow-y: auto; overscroll-behavior: contain; }
  .workspace.is-detail-open .list-tools { position: sticky; top: 0; z-index: 1; }
}

@media (max-width: 800px) {
  .workspace-panes,
  .workspace:not(.is-list-open) .workspace-panes,
  .workspace:not(.is-detail-open) .workspace-panes,
  .workspace:not(.is-list-open):not(.is-detail-open) .workspace-panes { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .workspace:not(.is-list-open) .workspace-panes,
  .workspace:not(.is-detail-open) .workspace-panes { row-gap: 0; }
  .workspace:not(.is-list-open) .case-rail,
  .workspace:not(.is-detail-open) .case-panel { grid-template-rows: 0fr; }
  .workspace:not(.is-list-open) .case-rail > [data-pane-body],
  .workspace:not(.is-detail-open) .case-panel > [data-pane-body] { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .workspace { --pane-time: 0ms; }
  .case-rail > [data-pane-body], .case-panel > [data-pane-body] { transition: none; }
}

@media (max-width: 640px) {
  .step-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .report-line .actions { margin-left: 0; }
  .session-email { display: none; }
  .auth-card { padding: 24px 20px; }
  .page-head .actions { width: 100%; }
  .inject-row { grid-template-columns: 1fr; }
}

/* Agent navigation */
.agent-menu{position:relative}
.agent-menu summary{display:flex;align-items:center;gap:7px;cursor:pointer;list-style:none;height:30px;padding:0 10px;border-radius:6px;color:var(--ink-2);font-size:13px;font-weight:500}
.agent-menu summary::-webkit-details-marker{display:none}
.agent-menu summary:hover{background:#f3f4f7}
.agent-menu summary.is-current,.agent-menu[open] summary{background:var(--accent-soft);color:var(--accent-ink)}
.agent-menu-chevron{display:block;flex:none;transform-origin:center}
.agent-menu[open] .agent-menu-chevron{transform:rotate(180deg)}
.agent-menu-items{position:absolute;left:0;top:calc(100% + 8px);z-index:6;width:min(1480px,calc(100vw - 24px));max-height:calc(100dvh - 112px);display:flex;flex-direction:column;overflow:hidden;padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);box-shadow:0 8px 24px #20264018}
.agent-menu-search{flex:none;padding:6px 6px 12px;border-bottom:1px solid var(--line);}
.agent-menu-search label{font-size:12px;margin-bottom:6px;}
.agent-menu-search input{height:40px;}
.agent-menu-links{min-height:0;overflow-y:auto;overscroll-behavior:contain;scroll-padding:6px;display:grid;grid-template-columns:minmax(0,1fr);gap:4px 12px;padding-top:6px;align-items:start;}
.agent-menu-links a{overflow-wrap:anywhere;}
.agent-menu-links .agent-menu-empty{grid-column:1 / -1;}
@media (min-width:560px){.agent-menu-links{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (min-width:900px){.agent-menu-links{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media (min-width:1200px){.agent-menu-links{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media (min-width:1600px){.agent-menu-links{grid-template-columns:repeat(5,minmax(0,1fr));}}
.agent-menu-empty{padding:14px 10px;color:var(--muted);}
.topnav .agent-menu-items a,.agent-menu-unavailable{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:54px;height:auto;padding:9px 10px;font-size:13px;border-radius:5px}
.agent-menu-label{display:flex;flex-direction:column;gap:2px;min-width:0}
.agent-menu-name{font-weight:600;line-height:1.4}
.agent-menu-tagline{color:var(--muted);font-size:12px;font-weight:400;line-height:1.4}
.agent-menu-unavailable{color:var(--muted)}
.agent-menu-unavailable small{flex:none;font-size:11px;color:var(--faint)}

@media (max-width: 400px) { .topnav a, .agent-menu summary { padding-left: 7px; padding-right: 7px; font-size: 12px; } }
.radar-action { width: min(840px, calc(100vw - 32px)); max-height: 90dvh; border: 1px solid var(--line); border-radius: 16px; padding: 0 24px 24px; color: var(--ink); background: white; font-size: 15px; line-height: 1.6; }
.radar-toast { position: fixed; right: 20px; bottom: 20px; z-index: 1000; max-width: calc(100vw - 40px); padding: 12px 18px; border-radius: 10px; background: var(--ink); color: white; box-shadow: 0 6px 24px #17213b26; pointer-events: none; overflow-wrap: anywhere; }
.radar-toast:empty { visibility: hidden; }
.radar-action::backdrop { background: #17213b66; }
.radar-action-heading, .radar-jira-choices { display: flex; gap: 16px; justify-content: space-between; align-items: start; }
.radar-action-heading h2 { margin-top: 0; }
.radar-action-heading { position: sticky; top: 0; z-index: 1; background: white; margin: 0 -24px 18px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.radar-action-heading h2 { margin: 0; font-size: 21px; line-height: 1.3; }
#radar-issue-form { display: grid; gap: 16px; justify-items: start; }
#radar-ask { width: 100%; }
.radar-jira-actions { gap: 12px; margin-top: 16px; }
#radar-action-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.radar-state { display: inline-block; padding: 3px 10px; border-radius: 20px; background: #eef0fa; color: #424c81; font-weight: 600; }
.radar-state[data-state="Completed"] { background: #e8f3e8; color: #31623c; }
#radar-action-result:empty { display: none; }
#radar-action-result { border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 18px 0; background: #fbfcfe; overflow-wrap: anywhere; }
.radar-prose { line-height: 1.7; }
.radar-prose p { margin: 0 0 14px; }
.radar-prose h3, .radar-prose h4, .radar-draft-section h4 { font-size: 16px; margin: 22px 0 9px; line-height: 1.4; }
.radar-prose > :first-child, #radar-action-result > :first-child { margin-top: 0; }
.radar-prose ul, .radar-prose ol { padding-left: 24px; margin: 8px 0 18px; }
.radar-prose li { padding-left: 3px; margin: 7px 0; }
.radar-prose a { text-decoration: underline; text-underline-offset: 3px; }
.radar-prose code { background: #eaf0f5; padding: 2px 5px; border-radius: 4px; font-size: .92em; }
.radar-prose pre { padding: 14px; border-radius: 8px; background: #eaf0f5; }
.radar-draft-section + .radar-draft-section { border-top: 1px solid var(--line); padding-top: 2px; margin-top: 16px; }
.radar-draft-meta { color: var(--muted); font-size: 13px; }
.radar-jira-choices > div { flex: 1; min-width: 0; }
.radar-jira-choices select { width: 100%; }
.radar-jira-choices { margin: 20px 0; }
.radar-jira-choices label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.radar-jira-choices select { font-size: 15px; line-height: 1.5; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.radar-action pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.radar-action input { width: 100%; margin: 6px 0; }
.radar-action a:not([href]) { pointer-events: none; opacity: .55; }
@media (max-width: 480px) { .radar-jira-choices { flex-direction: column; } .radar-jira-choices > div { width: 100%; } }
@media (max-width: 480px) { .radar-action { padding: 0 16px 18px; } .radar-action-heading { margin: 0 -16px 16px; padding: 16px; } .radar-action-heading h2 { font-size: 19px; } #radar-action-result { padding: 15px; } }
