:root {
  color-scheme: light dark;
  --page: #f7f8fb;
  --surface: #ffffff;
  --surface-muted: #f0f3f8;
  --ink: #17212f;
  --muted: #617084;
  --line: #dce2eb;
  --accent: #315cb8;
  --accent-soft: #e8efff;
  --success: #207456;
  --danger: #b33b46;
  --warning: #a65d00;
  --health-neutral: #5f6c7d;
  --health-stale: #7a8798;
  --health-on-green: var(--surface);
  --health-on-red: var(--surface);
  --health-on-amber: var(--surface);
  --health-on-grey: var(--surface);
  --health-on-pulsing: var(--surface);
  --shadow: 0 12px 32px rgb(31 45 70 / 9%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #11161f;
    --surface: #1a2230;
    --surface-muted: #222d3e;
    --ink: #f2f5f9;
    --muted: #aebbd0;
    --line: #344258;
    --accent: #9ab9ff;
    --accent-soft: #1f355d;
    --success: #72d4a8;
    --danger: #ff9ca5;
    --warning: #f1b85c;
    --health-neutral: #aebbd0;
    --health-stale: #aebbd0;
    --health-on-green: var(--page);
    --health-on-red: var(--page);
    --health-on-amber: var(--page);
    --health-on-grey: var(--page);
    --health-on-pulsing: var(--page);
    --shadow: 0 12px 32px rgb(0 0 0 / 20%);
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; height: 100%; margin: 0; }
[hidden] { display: none !important; }
body { background: var(--page); color: var(--ink); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
.app-shell { display: grid; grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { position: sticky; inset-block: 0; align-self: start; height: 100vh; height: 100dvh; overflow-y: auto; overflow-x: hidden; border-right: 1px solid var(--line); background: var(--surface); padding: 27px 18px 36px; }
.wordmark { display: block; color: var(--ink); font-size: 18px; font-weight: 760; letter-spacing: -.025em; text-decoration: none; margin: 0 6px 27px; }
.wordmark span { color: var(--accent); font-weight: 520; }
.filter-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin: 0 6px 6px; text-transform: uppercase; letter-spacing: .06em; }
.filter { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: var(--page); color: var(--ink); outline-color: var(--accent); }
.tree-actions { display: flex; gap: 8px; margin: 13px 2px 17px; }
.tree-actions button { appearance: none; border: 0; background: transparent; color: var(--accent); padding: 3px 4px; font-size: 12px; font-weight: 650; }
.feature-tree, .feature-tree ul { list-style: none; margin: 0; padding: 0; }
.tree-item { margin: 1px 0; }
.tree-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 2px; align-items: center; min-height: 31px; border-radius: 7px; padding: 2px 5px 2px 2px; }
.tree-row.selected { background: var(--accent-soft); }
.tree-toggle { border: 0; background: transparent; padding: 0; width: 20px; height: 24px; color: var(--muted); font-size: 15px; line-height: 1; }
.tree-toggle.placeholder { cursor: default; }
.tree-link { min-width: 0; color: var(--ink); overflow: hidden; padding: 3px 2px; text-align: left; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.tree-row.selected .tree-link { color: var(--accent); font-weight: 700; }
.count, .badge { display: inline-flex; align-items: center; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1; padding: 5px 7px; white-space: nowrap; }
.tree-row.selected .count { background: var(--surface); }
.tree-children { border-left: 1px solid var(--line); margin-left: 11px !important; padding-left: 7px !important; }
.tree-story-results { display: grid; gap: 3px; list-style: none; margin: 2px 0 5px 28px; padding: 0; }
.tree-story-link { color: var(--accent); font-size: 12px; line-height: 1.3; text-decoration: none; }
.tree-story-link:hover, .tree-story-link:focus-visible { text-decoration: underline; }
.main-content { min-width: 0; height: 100%; overflow: auto; padding: clamp(28px, 5vw, 72px); }
.page { max-width: 1420px; margin: 0 auto; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 19px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb .separator { margin: 0 2px; }
h1 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; line-height: 1.08; margin: 0; }
.summary { color: var(--muted); font-size: 18px; max-width: 700px; margin: 13px 0 42px; }
.stories { display: grid; gap: 34px; }
.storyboard { scroll-margin-top: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.story-header { display: flex; align-items: flex-start; gap: 18px; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.story-title { font-size: 20px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px; }
.story-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.badge.status-passed { color: var(--success); }
.badge.status-failed { color: var(--danger); }
.anchor-link { color: var(--accent); font-size: 13px; text-decoration: none; padding-top: 2px; }
.step-strip { display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-inline: contain; padding: 22px 24px 26px; scroll-snap-type: x proximity; }
.step-strip:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.step-card { flex: 0 0 min(310px, 78vw); scroll-snap-align: start; }
.step-number { display: block; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .075em; margin-bottom: 7px; text-transform: uppercase; }
.frame { display: grid; place-items: center; height: 390px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #e9edf3; }
.frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.no-frame { color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }
.gherkin { margin: 12px 2px 0; padding: 0; list-style: none; font-size: 14px; }
.gherkin li { margin: 4px 0; }
.keyword { color: var(--accent); font-weight: 780; }
.children-section { margin-top: 46px; }
.children-section h2 { font-size: 20px; margin: 0 0 14px; }
.child-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.child-card { display: block; min-height: 126px; border: 1px solid var(--line); border-radius: 12px; padding: 17px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.child-card:hover { border-color: var(--accent); }
.child-card h3 { font-size: 16px; margin: 0 0 7px; }
.child-card p { color: var(--muted); font-size: 13px; margin: 0 0 11px; }
.empty, .not-found { border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); padding: 26px; background: var(--surface); }
.not-found a { color: var(--accent); }
.lightbox { width: min(1000px, calc(100vw - 36px)); max-height: calc(100vh - 36px); padding: 45px 12px 12px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: 0 20px 80px rgb(0 0 0 / 45%); }
.lightbox::backdrop { background: rgb(0 0 0 / 72%); }
.lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 90px); margin: auto; object-fit: contain; }
.lightbox-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.lightbox-compare:not([hidden]) { display: grid; }
.lightbox-compare figure { min-width: 0; margin: 0; }
.lightbox-compare figcaption { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.lightbox-compare img { width: 100%; max-height: min(34vh, 360px); border: 1px solid var(--line); border-radius: 8px; background: #151b25; }
.lightbox-close { position: absolute; top: 10px; right: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); padding: 6px 9px; }
.settings-link { display: inline-flex; align-items: center; gap: 7px; margin: -17px 6px 20px; color: var(--muted); font-size: 13px; text-decoration: none; }
.gallery-link { margin-top: -12px; }
.story-controls, .feature-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.editor-button, .editor-step-controls button, .editor-footer button, .editor-line button, .history-row button, .feature-dialog button { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 7px 10px; text-decoration: none; font-size: 13px; }
.feature-actions { margin: -20px 0 28px; }
.editor-page { max-width: 1180px; }
.editor-header { display: grid; gap: 17px; margin-bottom: 20px; }
.editor-title { width: 100%; border: 0; background: transparent; color: var(--ink); font-size: clamp(29px,4vw,45px); font-weight: 800; letter-spacing: -.04em; outline-color: var(--accent); }
.editor-version { width: fit-content; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 12px; font-weight: 700; padding: 5px 8px; }
.parent-picker { width: min(420px,100%); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 9px; margin: 0 0 18px; }
.editor-steps { display: grid; gap: 24px; }
.editor-step { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 18px; }
.editor-step-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.editor-step-controls .step-number { margin-right: auto; }
.needs-test-badge { border-radius: 999px; background: var(--surface-muted); color: var(--ink); font-size: 11px; font-weight: 750; padding: 4px 7px; }
.annotation-editor { max-width: 700px; }
.image-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.annotation-surface, .annotated-frame { position: relative; overflow: hidden; touch-action: none; }
.annotation-surface { width: min(700px, 100%); min-height: 140px; border: 1px solid var(--line); background: #151b25; }
.annotation-surface img { display: block; width: 100%; height: 100%; object-fit: contain; margin: auto; }
.annotation-surface .editor-note { position: absolute; inset: 35% 12%; text-align: center; }
.annotation-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.annotation-editor .annotation-svg { pointer-events: auto; }
.annotation-shape { fill: rgb(255 186 48 / 13%); stroke: #e07500; stroke-width: .006; vector-effect: non-scaling-stroke; cursor: pointer; }
.annotation-svg g.selected .annotation-shape { stroke: var(--accent); stroke-width: .01; }
.annotation-delete { display: none; fill: #7b2500; font: bold .075px/1 sans-serif; stroke: var(--surface); stroke-width: .012; paint-order: stroke; cursor: pointer; }
.annotation-svg g.selected .annotation-delete { display: block; }
.picked-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); margin: 0 0 18px; padding: 12px; }
.picked-title { font-weight: 750; }
.picked-panel select, .gallery-tools select { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 7px; }
.image-prompt { min-width: min(260px, 100%); flex: 1 1 260px; border: 1px solid var(--line); border-radius: 7px; background: var(--page); color: var(--ink); padding: 8px; }
.reference-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.reference-chip { max-width: 150px; overflow: hidden; border-radius: 99px; background: var(--surface-muted); color: var(--muted); font-size: 11px; padding: 4px 7px; text-overflow: ellipsis; white-space: nowrap; }
.inline-status { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; background: var(--accent-soft); padding: 7px 9px; font-size: 12px; }
.inline-status.failed { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }
.inline-status.done { background: color-mix(in srgb, var(--success) 14%, var(--surface)); }
.upload-choice { display: inline-flex; gap: 6px; }
.history-preview { display: grid; gap: 8px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.gallery-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 13px; }
.gallery-tools input:not([type=file]) { min-width: min(280px, 100%); flex: 1 1 280px; }
.gallery-pick { position: sticky; bottom: 16px; margin-top: 14px; }
.gallery-card button { margin: 8px 0 0 10px; }
.health-dot { display: inline-grid; width: 13px; height: 13px; place-items: center; border: 2px solid currentColor; border-radius: 50%; color: var(--muted); font-size: 0; text-decoration: none; }
.health-dot:hover { transform: scale(1.15); }
.health-green { background: var(--success); border-color: var(--success); color: var(--success); }
.health-red { background: var(--danger); border-color: var(--danger); color: var(--danger); }
.health-amber { background: var(--warning); border-color: var(--warning); color: var(--warning); }
.health-grey { background: var(--health-neutral); border-color: var(--health-neutral); color: var(--health-neutral); }
.health-needs-test { background: var(--surface-muted); border-color: var(--muted); color: var(--muted); }
.health-hollow { background: transparent; border-color: var(--health-stale); color: var(--health-stale); }
.health-pulsing { background: var(--accent); border-color: var(--accent); color: var(--accent); animation: health-pulse 1.25s ease-in-out infinite; }
.health-rollup, .health-tree-count { display: inline-flex; align-items: center; border-radius: 999px; font-size: 10px; font-weight: 750; line-height: 1; padding: 3px 5px; white-space: nowrap; }
.health-rollup::before { display: none; }
.health-tree-count { max-width: none; overflow: visible; text-overflow: clip; }
.health-rollup.health-green, .health-tree-count.health-green { color: var(--health-on-green); }
.health-rollup.health-red, .health-tree-count.health-red { color: var(--health-on-red); }
.health-rollup.health-amber, .health-tree-count.health-amber { color: var(--health-on-amber); }
.health-rollup.health-grey, .health-tree-count.health-grey { color: var(--health-on-grey); }
.health-rollup.health-needs-test, .health-tree-count.health-needs-test { color: var(--ink); }
.health-rollup.health-pulsing, .health-tree-count.health-pulsing { color: var(--health-on-pulsing); }
.health-rollup.health-hollow, .health-tree-count.health-hollow { color: var(--ink); }
.health-rollup.health-hollow, .health-tree-count.health-hollow { background: var(--surface-muted); }
.tree-row.selected .health-tree-count, .tree-row.selected .health-tree-count:hover { background: var(--accent); color: var(--health-on-pulsing); }
.health-state-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 12px; margin-top: 26px; }
.health-state-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 15px; }
.health-state-card p { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin: 0; }
.run-page { max-width: 1260px; }
.run-page > .editor-button { display: inline-flex; margin-bottom: 18px; }
.run-status { border-left: 4px solid var(--muted); border-radius: 0 8px 8px 0; background: var(--surface-muted); margin: 18px 0; padding: 10px 13px; text-transform: capitalize; }
.run-status.status-failed { border-left-color: var(--danger); }
.run-status.status-passed { border-left-color: var(--success); }
.run-status.status-error, .run-status.status-timeout, .run-status.status-interrupted { border-left-color: #d48a17; }
.run-header { display: flex; flex-wrap: wrap; gap: 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 14px; color: var(--muted); font-size: 13px; }
.run-header strong { color: var(--ink); }
.actor-chip { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 12px; padding: 3px 8px; }
.run-steps { display: grid; gap: 16px; margin: 18px 0; }
.run-step { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 15px; }
.run-step.run-failed { border-color: var(--danger); box-shadow: inset 4px 0 var(--danger); }
.run-assertion { margin: 8px 0 0; color: var(--muted); }
.run-frame-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.run-frame-cell { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.run-frame-cell img, .run-frame-cell .no-frame { display: block; width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; background: #151b25; }
.run-failure { display: grid; gap: 8px; border-radius: 8px; background: color-mix(in srgb, var(--danger) 9%, var(--surface)); margin-top: 12px; padding: 12px; }
.run-failure p, .run-failure pre { margin: 0; }
.run-failure pre { max-height: 140px; overflow: auto; border-radius: 6px; background: color-mix(in srgb, var(--danger) 7%, var(--page)); padding: 8px; white-space: pre-wrap; }
.run-history, .promote-panel, .run-settings { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-top: 18px; padding: 15px; }
.run-history h2, .promote-panel h2 { font-size: 18px; margin: 0 0 10px; }
.run-history-row { display: block; border-top: 1px solid var(--line); color: var(--accent); padding: 9px 0; text-decoration: none; }
.run-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.run-actions button, .promote-panel button { border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); padding: 8px 11px; }
.promote-panel { display: grid; gap: 9px; }
.promote-panel label { color: var(--muted); }
.editor-health-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; border-left: 4px solid #d48a17; border-radius: 0 8px 8px 0; background: color-mix(in srgb, #d48a17 12%, var(--surface)); margin: 0 0 18px; padding: 11px 13px; }
@keyframes health-pulse { 50% { opacity: .38; transform: scale(1.18); } }
.editor-lines { display: grid; gap: 8px; margin-top: 14px; max-width: 700px; }
.editor-line { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.editor-line input, .ai-prompt, .feature-dialog input, .gallery-page input { border: 1px solid var(--line); border-radius: 7px; background: var(--page); color: var(--ink); padding: 9px; }
.ai-prompt { display: block; width: 100%; min-height: 90px; margin: 26px 0 13px; resize: vertical; }
.editor-footer { display: flex; gap: 9px; }
.job-status { margin: 15px 0; border-radius: 8px; padding: 11px 13px; background: var(--accent-soft); color: var(--ink); }
.job-status.failed { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }
.job-status.done { background: color-mix(in srgb, var(--success) 14%, var(--surface)); }
.job-status.working { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.step-composer { display: grid; gap: 8px; margin-top: 14px; }
.composer-input { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 7px; align-items: end; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 7px; }
.composer-message { min-height: 42px; border: 0; background: transparent; color: var(--ink); font: inherit; outline-color: var(--accent); resize: vertical; }
.composer-plus, .composer-send, .composer-remove { border: 1px solid var(--line); border-radius: 7px; background: var(--surface-muted); color: var(--ink); font-weight: 750; padding: 7px 10px; }
.composer-send { background: var(--accent); border-color: var(--accent); color: var(--health-on-pulsing); }
.composer-menu { display: grid; width: fit-content; gap: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); padding: 6px; }
.composer-menu button, .composer-menu a { border: 0; border-radius: 6px; background: transparent; color: var(--ink); padding: 7px 9px; text-align: left; text-decoration: none; }
.composer-menu button:hover, .composer-menu a:hover { background: var(--accent-soft); }
.composer-attachment { display: grid; grid-template-columns: 72px minmax(0,1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-muted); padding: 7px; }
.composer-attachment img { width: 72px; height: 48px; border-radius: 5px; object-fit: cover; }
.composer-attachment-text { min-width: 0; color: var(--muted); font-size: 13px; }
.composer-remove { color: var(--danger); }
.editor-note { margin: 16px 0; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--muted); padding: 10px 13px; }
.history-panel { margin-top: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 15px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; }
.gallery-title { font-size: clamp(30px,4vw,45px); font-weight: 800; letter-spacing: -.04em; margin-bottom: 18px; }
.gallery-page > input { width: min(500px, 100%); margin-bottom: 18px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(190px,1fr)); gap: 13px; }
.gallery-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding-bottom: 10px; }
.gallery-card img { display: block; width: 100%; height: 130px; object-fit: cover; }
.gallery-card > div { padding: 7px 10px 0; font-size: 13px; }
.feature-dialog { width: min(500px,calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.feature-dialog form, .feature-dialog { display: grid; gap: 11px; padding: 20px; }
.project-label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; margin: 0 6px 6px; text-transform: uppercase; }
.project-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: center; margin: 0 2px 17px; }
.project-control select { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--page); color: var(--ink); padding: 9px 8px; }
.project-help { color: var(--muted); font-size: 12px; line-height: 1.35; margin: -10px 6px 16px; }
.settings-link:hover { color: var(--accent); }
.frame { height: auto; aspect-ratio: var(--frame-aspect, 9 / 19.5); background: #151b25; }
.frame img { object-fit: contain; }
.step-card.web-step { flex-basis: min(590px, 86vw); }
.gherkin { color: var(--ink); }
.gherkin .keyword { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.story-via { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.child-grid { grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
.wedge-card { --card-accent: light-dark(var(--icon-light), var(--icon-dark)); position: relative; display: flex; min-height: 244px; flex-direction: column; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 18px 32px 18px 18px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); text-decoration: none; }
.wedge-card::before { position: absolute; top: 0; right: 0; width: 73px; height: 73px; background: var(--card-accent); clip-path: polygon(100% 0,100% 100%,0 0); content: ''; opacity: .15; }
.wedge-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.wedge-card .top { display: flex; min-height: 69px; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wedge-card .tag { align-self: flex-start; padding: 5px 8px; border-radius: 99px; background: color-mix(in srgb, var(--card-accent) 10%, transparent); color: var(--card-accent); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.wedge-card .mascot { position: relative; z-index: 1; flex: 0 0 66px; width: 66px; height: 61px; object-fit: contain; object-position: 50% 58%; filter: drop-shadow(0 3px 2px rgb(20 27 47 / 16%)); }
.wedge-card .corner-visual { position: relative; z-index: 1; }
.wedge-card .mark { display: grid; flex: 0 0 66px; width: 66px; height: 61px; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(4, 1fr); gap: 3px; padding: 7px; border-radius: 13px; background: color-mix(in srgb, light-dark(var(--icon-light), var(--icon-dark)) 10%, transparent); }
.wedge-card .mark i { display: block; border-radius: 2px; background: light-dark(var(--icon-light), var(--icon-dark)); opacity: .13; }
.wedge-card .mark i.on { opacity: 1; }
.wedge-card .mark i.mid { opacity: .55; }
.wedge-card.group .mark { grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 6px; background: transparent; }
.wedge-card.group .mark i { border-radius: 4px; opacity: .2; }
.wedge-card.group .mark i:nth-child(3n) { opacity: .9; }
.wedge-card.group .mark i:nth-child(4n) { opacity: .55; }
.wedge-card .corner-icon { display: grid; flex: 0 0 66px; width: 66px; height: 61px; place-items: center; border-radius: 13px; background: color-mix(in srgb, light-dark(var(--icon-light), var(--icon-dark)) 10%, transparent); color: light-dark(var(--icon-light), var(--icon-dark)); font-size: 29px; filter: drop-shadow(0 3px 2px rgb(20 27 47 / 12%)); }
.wedge-card .code { margin-top: 8px; color: var(--card-accent); font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .09em; }
.wedge-card h3 { max-width: 80%; margin: 5px 0 7px; font-size: 19px; letter-spacing: -.035em; line-height: 1.08; }
.wedge-card .summary { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.43; }
.wedge-card .meta { display: flex; min-height: 27px; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; color: var(--muted); font-size: 11px; font-weight: 750; }
.wedge-card .family-count { display: flex; gap: 3px; }
.wedge-card .family-count b { width: 13px; height: 13px; border-radius: 3px; background: var(--card-accent); opacity: .25; }
.wedge-card .family-count b:nth-child(2) { opacity: .5; }
.wedge-card .family-count b:nth-child(3) { opacity: .75; }
.wedge-card .family-count b:nth-child(4) { opacity: 1; }
.card-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; }
.card-copy strong { font-size: 16px; line-height: 1.2; }
.card-copy small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.card-copy .badge { margin-top: auto; }
.settings-page { max-width: 1500px; }
.save-note, .rule-of-thumb { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--muted); margin: 17px 0; max-width: 850px; padding: 10px 13px; }
.save-note.online { border-left-color: var(--success); }
.settings-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; max-width: 850px; margin: 24px 0; }
.settings-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 13px; text-transform: capitalize; }
.settings-fields input, .appearance-row input, .appearance-row select { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 8px; }
.server-actions { display: flex; gap: 9px; margin: 18px 0; }
.server-actions button { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 8px 12px; }
.server-actions .primary-button { background: var(--accent); border-color: var(--accent); color: white; }
.settings-title { margin: 38px 0 13px; font-size: 22px; }
.appearance-table { display: grid; gap: 10px; }
.appearance-row { display: grid; grid-template-columns: minmax(140px, .8fr) minmax(235px, 1.2fr) 170px minmax(160px, 1fr) minmax(220px, 1fr); align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 11px; }
.appearance-name { font-size: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.swatch { width: 19px; height: 19px; border: 2px solid transparent; border-radius: 50%; background: light-dark(var(--panel-light), var(--panel-dark)); cursor: pointer; }
.swatch.selected { border-color: var(--ink); outline: 1px solid var(--surface); }
.wedge-card.compact { min-height: 70px; padding: 10px; }
.wedge-card.compact .top { min-height: 42px; }
.wedge-card.compact .mascot, .wedge-card.compact .mark, .wedge-card.compact .corner-icon { flex-basis: 44px; width: 44px; height: 40px; }
.wedge-card.compact .corner-icon { font-size: 19px; }
.wedge-card.compact .mark { gap: 2px; padding: 5px; }
.wedge-card.compact .tag, .wedge-card.compact .summary, .wedge-card.compact .meta { display: none; }
.wedge-card.compact .code { margin-top: 3px; font-size: 9px; }
.wedge-card.compact h3 { margin-top: 3px; font-size: 14px; }
.imagery-page { max-width: 1420px; }
.imagery-preview { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-muted); margin: 20px 0 26px; padding: 18px; }
.imagery-preview .settings-title { margin: 0 0 13px; }
.imagery-preview-card { max-width: 340px; }
.imagery-appearance { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; }
.imagery-appearance .settings-title { margin: 0; }
.imagery-control-group { display: grid; gap: 8px; }
.imagery-control-group strong { color: var(--muted); font-size: 13px; }
.imagery-control-group select, .imagery-control-group input, .imagery-icon-free { min-width: min(320px, 100%); width: min(520px, 100%); border: 1px solid var(--line); border-radius: 7px; background: var(--page); color: var(--ink); padding: 8px; }
.imagery-row { margin-top: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; }
.imagery-row-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.imagery-row-heading h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.imagery-row-state { border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; padding: 4px 7px; }
.imagery-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.imagery-row button, .imagery-free-icon + button { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); padding: 7px 10px; font-size: 13px; }
.imagery-row button:disabled, .imagery-appearance button:disabled { cursor: not-allowed; opacity: .52; }
.candidate-strip, .imagery-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 11px; }
.candidate-tile, .imagery-tile { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 9px; }
.candidate-tile.selected, .imagery-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 26%, transparent); }
.candidate-tile.hidden-candidate { opacity: .62; }
.candidate-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.candidate-label { display: inline-grid; width: 25px; height: 25px; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.candidate-rank, .candidate-from { color: var(--muted); font-size: 11px; font-weight: 750; }
.candidate-tile img { display: block; width: 100%; height: 132px; margin: 7px 0; object-fit: contain; border-radius: 7px; background: var(--surface-muted); }
.candidate-placeholder { display: grid; height: 132px; place-items: center; margin: 7px 0; border: 1px dashed var(--line); border-radius: 7px; background: var(--surface-muted); color: var(--muted); font-size: 12px; text-align: center; }
.candidate-caption { min-height: 38px; margin: 5px 0; color: var(--ink); font-size: 12px; line-height: 1.35; }
.candidate-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.candidate-actions button { flex: 1 1 auto; padding: 5px 6px; font-size: 11px; }
.imagery-row-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 13px; color: var(--muted); font-size: 12px; }
.imagery-hidden-toggle { color: var(--accent) !important; }
.usage-note { margin-left: auto; }
.judge-note { grid-column: 1 / -1; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--muted); margin: 2px 0 0; padding: 8px 10px; }
.imagery-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 13px; }
.imagery-palette strong { color: var(--muted); font-size: 13px; }
.imagery-address-mark { display: grid; width: 116px; height: 100px; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(4, 1fr); gap: 4px; margin: 0 auto 8px; padding: 9px; border-radius: 12px; background: color-mix(in srgb, light-dark(var(--icon-light), var(--icon-dark)) 10%, transparent); }
.imagery-address-mark i { display: block; border-radius: 2px; background: light-dark(var(--icon-light), var(--icon-dark)); opacity: .13; }
.imagery-address-mark i.on { opacity: 1; }
.imagery-address-mark i.mid { opacity: .55; }
.address-tile, .icon-tile { display: grid; gap: 8px; align-content: start; text-align: center; }
.address-tile strong, .icon-tile strong { font-size: 12px; }
.icon-tile > i { display: grid; height: 100px; place-items: center; color: var(--accent); font-size: 38px; }
.icon-tile button, .address-tile button { width: 100%; }
.imagery-free-icon { display: inline-block; margin-top: 13px; }
.imagery-free-icon input { width: 100%; }
.imagery-note { border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--accent-soft); color: var(--muted); margin: 15px 0 0; padding: 10px 13px; }
.imagery-note.failed { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.imagery-empty { grid-column: 1 / -1; }

/* Run history and frame comparison. These tokens deliberately reuse the board palette. */
.page h1 { font-size: clamp(26px, 3.2vw, 38px); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs .separator { margin: 0 2px; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.head-actions .editor-button[disabled], button.editor-button[disabled] { opacity: .55; cursor: not-allowed; }
.page-lead { color: var(--muted); font-size: 15px; margin: 8px 0 22px; max-width: 760px; }
.scheduler-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 13px; margin: 0 0 18px; padding: 11px 14px; }
.scheduler-line strong { color: var(--ink); }
.scheduler-line a { color: var(--accent); }
.runs-tools { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.runs-filter { width: min(360px, 100%); border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 8px 10px; }
.batch-list { display: grid; gap: 10px; }
.batch-row { display: grid; grid-template-columns: 150px minmax(180px, 1.2fr) 190px minmax(240px, 2fr) 120px; gap: 12px 16px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 13px 16px; text-decoration: none; box-shadow: var(--shadow); }
.batch-row:hover { border-color: var(--accent); }
.batch-when, .batch-trigger, .batch-build { display: grid; gap: 2px; font-size: 13px; min-width: 0; }
.batch-when strong { font-size: 14px; }
.batch-when span, .batch-build span, .batch-trigger span { color: var(--muted); font-size: 12px; }
.batch-trigger strong { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-trigger i { color: var(--accent); width: 15px; text-align: center; }
.batch-build code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.batch-outcome { display: grid; gap: 6px; min-width: 0; }
.batch-bar { display: flex; height: 12px; overflow: hidden; border-radius: 999px; background: var(--surface-muted); }
.batch-bar span { display: block; min-width: 0; }
.seg-passed { background: var(--success); } .seg-unverified { background: color-mix(in srgb, var(--success) 55%, var(--surface)); } .seg-failed { background: var(--danger); } .seg-error { background: var(--warning); }
.seg-skipped { background: repeating-linear-gradient(135deg, var(--health-stale) 0 4px, var(--surface) 4px 8px); } .seg-scope { background: var(--surface-muted); }
.batch-counts { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 12px; }
.batch-counts b { color: var(--ink); font-weight: 650; }
.batch-status { justify-self: end; text-align: right; display: grid; gap: 4px; justify-items: end; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1; padding: 5px 9px; background: var(--surface-muted); color: var(--muted); white-space: nowrap; }
.status-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-finished, .status-passed { color: var(--success); } .status-interrupted, .status-error, .status-timeout { color: var(--warning); } .status-failed { color: var(--danger); } .status-cancelled, .status-skipped, .status-refused, .status-not-automated, .status-other-lane, .status-not-requested { color: var(--health-stale); } .status-running, .status-queued { color: var(--accent); } .status-unverified { color: color-mix(in srgb, var(--success) 65%, var(--muted)); }
.drift-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1; padding: 4px 8px; white-space: nowrap; }
.drift-chip.attention { border-color: var(--warning); color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.drift-chip.none { color: var(--muted); font-weight: 600; }
.drift-chip.current { border-color: var(--success); color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
.cut-evidence { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cut-chip { display: inline-flex; align-items: center; min-height: 24px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 4px 8px; }
.cut-workflow { color: var(--accent); font-size: 12px; font-weight: 700; text-underline-offset: 2px; }
.history-trigger { display: grid; gap: 6px; }
.empty-state { border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); padding: 22px; background: var(--surface); }
.run-grid { display: grid; gap: 4px 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 14px 16px; overflow-x: auto; }
.run-grid > * { min-width: 0; }
.run-grid .grid-head { color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; line-height: 1.2; }
.run-grid .grid-head span { display: block; color: var(--ink); font-size: 12px; }
.run-grid .grid-story { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 0; }
.run-grid .grid-story a { color: var(--ink); text-decoration: none; }
.run-grid .grid-story a:hover { color: var(--accent); }
.grid-cell { display: grid; place-items: center; }
.grid-cell .health-dot { width: 15px; height: 15px; }
.health-dot.health-skipped { background: transparent; border: 2px dashed var(--health-stale); color: var(--health-stale); }
.health-dot.health-none { border: 2px dotted var(--line); background: transparent; color: var(--line); }
.health-dot.health-unverified { background: color-mix(in srgb, var(--success) 55%, var(--surface)); border-color: var(--success); }
.grid-more { grid-column: 1 / -1; color: var(--muted); font-size: 12px; padding-top: 6px; }
.grid-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; margin-top: 10px; }
.grid-legend span { display: inline-flex; align-items: center; gap: 6px; }
.batch-header { display: grid; gap: 8px 22px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px 18px; margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.batch-header div { display: grid; gap: 3px; }
.batch-header strong { color: var(--ink); font-size: 14px; }
.batch-header code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.batch-summary { margin: 0 0 18px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-left: 4px solid var(--warning); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--warning) 12%, var(--surface)); margin: 0 0 18px; padding: 11px 13px; }
.banner.info { border-left-color: var(--accent); background: var(--accent-soft); }
.banner.danger { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.banner.success { border-left-color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.banner button { margin-left: auto; }
.outcome-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; font-size: 13px; }
.table-scroll { max-width: 100%; overflow-x: auto; border-radius: 12px; }
.table-scroll .outcome-table { min-width: 720px; }
.outcome-table th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.outcome-table td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.outcome-table tr:first-child td { border-top: 0; }
.outcome-table td a { color: var(--ink); text-decoration: none; }
.outcome-table td a:hover { color: var(--accent); text-decoration: underline; }
.story-key { display: block; margin-top: 3px; color: var(--muted); font: 10px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.outcome-table .reason, .history-table .evidence { color: var(--muted); }
.group-title { display: flex; align-items: baseline; gap: 10px; font-size: 18px; margin: 24px 0 10px; }
.group-title span { color: var(--muted); font-size: 13px; font-weight: 500; }
details.scope { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0; margin-top: 18px; }
details.scope summary { cursor: pointer; font-size: 18px; font-weight: 700; padding: 12px 16px; }
details.scope .outcome-table { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.history-table td:first-child { white-space: nowrap; }
.history-table .status-chip { text-transform: capitalize; }
.outdated { color: var(--health-stale); font-weight: 650; }
.story-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin: 6px 0 20px; }
.run-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 14px; margin: 18px 0; position: sticky; top: 12px; z-index: 3; box-shadow: var(--shadow); }
.rollup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; }
.rollup strong { font-size: 15px; }
.rollup .muted { color: var(--muted); }
.compare-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.compare-toggle button { border: 0; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 650; padding: 7px 12px; }
.compare-toggle button + button { border-left: 1px solid var(--line); }
.compare-toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.run-steps { display: grid; gap: 16px; margin: 18px 0; }
.run-step { scroll-margin-top: 130px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 15px; }
.run-step.highlight { outline: 2px solid var(--accent); outline-offset: 2px; }
.run-step.run-failed { border-color: var(--danger); box-shadow: inset 4px 0 var(--danger); }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.step-head strong { font-size: 15px; }
.step-head .assertion { color: var(--muted); font-size: 13px; }
.step-head .drift-chip { margin-left: auto; }
.gherkin.small { font-size: 13px; margin: 8px 2px 0; }
.frame-labels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 12px; }
.frame-labels span small { color: var(--muted); font-weight: 500; }
.compare { margin-top: 8px; }
.compare-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compare-side img, .compare-stage img, .no-frame.frame-cell { display: block; width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; background: #151b25; }
.compare-stage { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #151b25; --split: 50; }
.compare-stage img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
.compare-stage .top { clip-path: inset(0 calc(100% - var(--split) * 1%) 0 0); }
.compare-stage .divider { position: absolute; top: 0; bottom: 0; left: calc(var(--split) * 1%); width: 2px; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 45%); pointer-events: none; }
.compare-stage .divider::after { content: "⇔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #17212f; font-size: 15px; font-weight: 700; }
.compare-stage input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare-stage .tag { position: absolute; top: 8px; border-radius: 6px; background: rgb(23 33 47 / 78%); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 7px; pointer-events: none; }
.compare-stage .tag.left { left: 8px; } .compare-stage .tag.right { right: 8px; }
.compare-stage.changes .under { opacity: .35; }
.compare-pane { display: none; }
.run-steps[data-view="side"] .compare-pane.side, .run-steps[data-view="overlay"] .compare-pane.overlay, .run-steps[data-view="changes"] .compare-pane.changes { display: block; }
.run-step.no-overlay .compare-pane.overlay, .run-step.no-overlay .compare-pane.changes { display: none; }
.run-steps:not([data-view="side"]) .run-step.no-overlay .compare-pane.side { display: block; }
.frame-note { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12px; margin-top: 8px; }
.frame-note.warn { color: var(--warning); }
.adopt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.adopt-row label { display: inline-flex; align-items: center; gap: 7px; }
.adopt-row .why { color: var(--muted); }
.adopt-bar { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 14px; margin: 18px 0 0; box-shadow: 0 -8px 24px rgb(31 45 70 / 9%); }
.adopt-bar .muted { color: var(--muted); font-size: 13px; }
.adopt-proxy { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.primary-button, .adopt-dialog .primary { border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: var(--health-on-pulsing); padding: 8px 12px; font-weight: 650; }
.primary-button[disabled] { opacity: .5; cursor: not-allowed; }
.no-frame.frame-cell { display: grid; place-items: center; color: var(--muted); font-size: 13px; padding: 20px; text-align: center; background: var(--surface-muted); }
.run-frame-cell { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.run-frame-cell img, .run-frame-cell .no-frame { display: block; width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; background: #151b25; }
.run-failure { display: grid; gap: 8px; border-radius: 8px; background: color-mix(in srgb, var(--danger) 9%, var(--surface)); margin-top: 12px; padding: 12px; }
.run-failure p, .run-failure pre { margin: 0; }
.run-failure pre { max-height: 140px; overflow: auto; border-radius: 6px; background: color-mix(in srgb, var(--danger) 7%, var(--page)); padding: 8px; white-space: pre-wrap; }
.adopt-dialog { width: min(720px, calc(100vw - 36px)); border: 0; border-radius: 14px; padding: 22px 24px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 80px rgb(0 0 0 / 45%); }
.adopt-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.adopt-dialog h2 { font-size: 20px; margin: 0 0 6px; }
.adopt-dialog p { color: var(--muted); margin: 0 0 14px; }
.adopt-list { display: grid; gap: 10px; margin: 0 0 16px; }
.adopt-item { display: grid; grid-template-columns: 128px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.adopt-item img { width: 128px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.adopt-item .warn { color: var(--warning); font-size: 12px; }
.adopt-item .ok { color: var(--muted); font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-actions button { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 8px 12px; }
.lightbox-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.lightbox-context { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.lightbox-confirm { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; color: var(--ink); font-size: 13px; }
.lightbox-footer > a { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 8px 12px; text-decoration: none; }
.lightbox-footer button { border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: var(--health-on-pulsing); padding: 8px 12px; }
.lightbox-footer button:disabled { cursor: not-allowed; opacity: .55; }
.lightbox-status { color: var(--muted); font-size: 13px; margin: 0; }
.lightbox-status.failed, .lightbox-status.conflict { color: var(--danger); } .lightbox-status.done { color: var(--success); } .lightbox-status.working { color: var(--accent); }
.failure-evidence { display: grid; grid-template-columns: minmax(76px, auto) 1fr; gap: 10px; align-items: start; margin: 6px 0; }
.failure-evidence > strong { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.failure-reason { margin: 10px 0; }
.run-settings-links { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 900px) { .batch-row { grid-template-columns: 1fr 1fr; } .batch-status { justify-self: start; justify-items: start; text-align: left; } .compare-side { grid-template-columns: 1fr; } .frame-labels { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  a, button, input, select { min-width: 44px; min-height: 44px; }
  :is(.runs-page, .batch-page, .story-history-page, .run-page, #lightbox, dialog) :is(a, button) { display: inline-flex; min-height: 44px; align-items: center; }
  .batch-row { grid-template-columns: 1fr; gap: 9px; padding: 14px; }
  .batch-status { justify-self: stretch; justify-items: start; text-align: left; }
  .run-toolbar { position: static; }
  .compare-toggle { width: 100%; }
  .compare-toggle button { flex: 1; min-height: 44px; padding-inline: 7px; }
  .adopt-dialog { width: calc(100vw - 24px); padding: 18px 15px; }
  .adopt-item { grid-template-columns: 86px 1fr; }
  .adopt-item > .drift-chip { grid-column: 2; justify-self: start; }
  .adopt-item img { width: 86px; }
  .editor-button, .primary-button, .head-actions button, .head-actions a, .dialog-actions button, .lightbox-footer button { min-height: 44px; }
  .runs-tools { justify-content: stretch; }
  .runs-filter { width: 100%; min-height: 44px; }
  .outcome-table { display: block; overflow-x: auto; white-space: nowrap; }
  .outcome-table td.reason { white-space: normal; min-width: 240px; }
  .run-grid { padding: 12px; }
  .run-grid .grid-story { min-height: 44px; display: flex; align-items: center; }
  .grid-cell { min-height: 44px; }
  .run-step { padding: 12px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; height: auto; overflow: visible; }
  .sidebar { position: relative; height: auto; max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 14px; }
  .main-content { height: auto; overflow: visible; }
  .wordmark { margin-bottom: 17px; }
  .main-content { padding: 30px 16px 48px; }
  .story-header { padding: 18px; }
  .step-strip { padding: 18px; }
  .frame { height: 360px; }
  .frame { height: auto; }
  .appearance-row { grid-template-columns: 1fr; }
  .run-frame-pair { grid-template-columns: 1fr; }
  .usage-note { margin-left: 0; }
}
.test-authoring { margin-top: .8rem; padding: .75rem; border: 1px solid var(--line); border-radius: .75rem; background: color-mix(in srgb, var(--panel) 88%, transparent); display: grid; gap: .65rem; }
.test-authoring-title { font-weight: 700; }
.test-action-list { display: grid; gap: .5rem; }
.test-action-row { display: grid; grid-template-columns: minmax(8rem, .8fr) repeat(2, minmax(8rem, 1fr)) auto; gap: .45rem; align-items: center; }
.test-action-row input, .test-action-row select, .test-authoring input, .test-authoring select { min-width: 0; }
.test-assertion { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.test-assertion legend { grid-column: 1 / -1; font-weight: 600; }
.test-assertion label { display: grid; gap: .25rem; }
@media (max-width: 700px) { .test-action-row, .test-assertion { grid-template-columns: 1fr; } .test-assertion legend { grid-column: auto; } }
