:root {
  --bg: #07090d;
  --surface: #0e1117;
  --surface-2: #131720;
  --surface-3: #181d27;
  --line: #242a36;
  --line-strong: #343c4b;
  --text: #f3f5f7;
  --muted: #8e98a8;
  --accent: #c7ff59;
  --accent-2: #8fea49;
  --blue: #79a9ff;
  --orange: #f5aa5d;
  --radius: 15px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { overflow-y: scroll; scrollbar-gutter: stable; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 18% -10%, #182014 0, transparent 27%), var(--bg); }
button, select, input { font: inherit; }
button { color: inherit; }
textarea { font: inherit; }
.app-shell { width: min(1560px, 100%); margin: 0 auto; padding: 0 28px 28px; }
.workspace-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 40px 0 28px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; max-width: 720px; font-size: clamp(30px, 4vw, 52px); line-height: .98; letter-spacing: -.045em; }
.workspace-head p:last-child { max-width: 700px; margin: 14px 0 0; color: var(--muted); line-height: 1.6; }
.view-switcher { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #0b0e13; }
.view-button { display: flex; align-items: center; gap: 8px; min-width: 150px; padding: 11px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 750; }
.view-button.is-active { color: #091004; background: var(--accent); }
.button-icon { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 6px; border: 1px solid currentColor; font-size: 9px; }
.system-selector-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 15px 18px; }
.system-selector-copy > small { color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.system-selector-copy h2 { margin: 4px 0 0; font-size: 16px; }
.system-selector-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.system-choice-buttons { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)); gap: 8px; }
.system-choice-button { min-width: 0; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--muted); background: #0b0e13; text-align: left; cursor: pointer; }
.system-choice-button:hover { border-color: #617082; color: var(--text); }
.system-choice-button.is-active { border-color: var(--accent); color: #101609; background: var(--accent); box-shadow: 0 0 0 1px rgba(199,255,89,.08); }
.system-choice-button span, .system-choice-button small { display: block; }
.system-choice-button span { font-size: 11px; font-weight: 850; }
.system-choice-button small { margin-top: 3px; color: inherit; font-size: 8px; opacity: .72; }
.system-placeholder { display: grid; min-height: 440px; place-content: center; justify-items: center; padding: 48px 24px; text-align: center; }
.system-placeholder--debug { min-height: 650px; }
.system-placeholder-mark { display: grid; width: 54px; height: 54px; place-items: center; margin-bottom: 18px; border: 1px solid var(--line-strong); border-radius: 15px; color: var(--accent); background: #0b0e13; font-size: 14px; font-weight: 900; letter-spacing: .08em; }
.system-placeholder h2 { margin: 0; font-size: clamp(22px, 3vw, 34px); letter-spacing: -.025em; }
.system-placeholder > p:last-child { max-width: 520px; margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.user-image-editor-system { min-width: 0; height: max(920px, calc(100vh - 150px)); overflow: hidden; padding: 0; background: #07090c; }
.user-image-editor-frame { display: block; width: 100%; height: 100%; border: 0; background: #07090c; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(19,23,32,.98), rgba(12,15,21,.98)); box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.visually-hidden-control { position: fixed !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }
.user-workflow-system { display: grid; gap: 14px; }
.user-workflow-panel { min-width: 0; padding: 18px; }
.user-category-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.user-category-button { display: flex; min-width: 128px; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); background: #0b0e13; cursor: pointer; font-size: 10px; font-weight: 800; }
.user-category-button span { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid currentColor; border-radius: 6px; font-size: 8px; }
.user-category-button:hover, .user-workflow-button:hover { border-color: #617082; color: var(--text); }
.user-category-button.is-active { border-color: var(--accent); color: #0b1005; background: var(--accent); }
.user-workflow-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.user-workflow-button { display: flex; min-width: 0; min-height: 48px; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); background: #0b0e13; cursor: pointer; text-align: left; }
.user-workflow-button > span { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: #b8c1cd; font-size: 8px; font-weight: 900; }
.user-workflow-button .user-choice-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.user-workflow-button strong { min-width: 0; overflow: hidden; font-size: 10px; line-height: 1.25; text-overflow: ellipsis; }
.user-workflow-button .user-workflow-badge { margin-left: auto; padding: 3px 6px; border: 1px solid rgba(224,169,73,.58); border-radius: 999px; color: #efbf69; font-size: 7px; font-style: normal; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.user-workflow-button.is-unavailable { cursor: not-allowed; opacity: .68; }
.user-workflow-button.is-unavailable:hover { border-color: var(--line-strong); color: var(--muted); }
.user-workflow-button.is-active { border-color: rgba(199,255,89,.72); color: var(--text); background: linear-gradient(90deg, rgba(18,112,92,.86), rgba(47,50,125,.92)); box-shadow: 0 0 0 1px rgba(199,255,89,.08); }
.user-workflow-button.is-active > span { border-color: rgba(199,255,89,.5); color: var(--accent); background: rgba(7,9,13,.36); }
.user-workflow-summary { margin-top: 14px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.user-workflow-summary > div:first-child { min-width: 0; }
.user-workflow-summary strong { font-size: 11px; }
.user-workflow-summary .field-help { margin-bottom: 0; }
.user-case-selector { display: grid; gap: 9px; margin-top: 12px; }
.user-case-control-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 8px; font-weight: 800; }
.user-case-control-heading em { font-style: normal; letter-spacing: .03em; text-transform: uppercase; }
.user-case-control-heading em.is-missing { color: #ff7179; }
.user-case-control-heading em.is-complete { color: var(--accent); }
.user-case-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 11px; }
.user-case-selector.is-required-missing .user-case-buttons { border-color: rgba(255,92,101,.84); }
.user-case-selector.is-complete .user-case-buttons { border-color: rgba(74,201,148,.88); }
.user-case-button { min-width: 0; width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--muted); background: #0b0e13; cursor: pointer; font-size: 9px; font-weight: 800; text-transform: capitalize; }
.user-case-button.is-active { border-color: var(--accent); color: #0b1005; background: var(--accent); }
.user-generation-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
.generation-panel, .result-panel { min-width: 0; }
.user-generation-layout > .result-panel { padding: 18px; }
.user-generation-layout > .result-panel > .d3-section-heading { padding: 0 2px; }
.user-output-grid { grid-template-columns: minmax(0, 1fr); margin-top: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.user-generate-row { align-items: stretch; flex-direction: column; }
.user-generate-row > div { width: 100%; text-align: center; }
.user-generate-row .generate-button { width: 100%; }
#user-assets > .d3-no-user-inputs { grid-column: 1 / -1; }
#user-fields + #no-user-inputs { margin-top: 12px; }
label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: #c8ced7; background: #0b0e13; }
.field-help { margin: 9px 0; color: #6f7989; font-size: 11px; line-height: 1.5; }
.catalog-error { margin-bottom: 14px; padding: 12px 14px; border: 1px solid rgba(255,106,106,.35); border-radius: 10px; color: #ffaaaa; background: rgba(255,106,106,.08); font-size: 12px; }
.generate-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 16px; padding: 16px 0 0; border-top: 1px solid var(--line); }
.generate-row strong, .generate-row span { display: block; }
.generate-row strong { font-size: 12px; }
.generate-row span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.generate-button { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border: 0; border-radius: 9px; color: #88909c; background: #252b35; font-weight: 800; }
.generate-button:not(:disabled) { color: #11150a; background: var(--accent); cursor: pointer; }
.generate-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.debug-layout { display: block; }
.debug-workspace { min-width: 0; }
.canvas-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-radius: 12px 12px 0 0; }
.canvas-toolbar > div:first-child { display: grid; grid-template-columns: auto auto; align-items: center; gap: 4px 8px; }
.canvas-toolbar small { grid-column: 2; color: var(--muted); font-size: 10px; }
.canvas-dot { grid-row: 1 / 3; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.canvas-workflow-control { display: flex; align-items: center; gap: 8px; min-width: min(380px, 35vw); }
.canvas-workflow-control label { margin: 0; }
.canvas-workflow-control select { padding: 8px 10px; font-size: 10px; }
.canvas-grid { position: absolute; inset: 0; opacity: .45; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(to bottom, #000, transparent 95%); }
.pipeline-node { position: relative; flex: 0 0 250px; max-height: 515px; overflow: auto; padding: 14px; border: 1px solid var(--line-strong); border-top: 2px solid var(--blue); border-radius: 11px; background: linear-gradient(145deg, #181d27, #10141b); box-shadow: 0 12px 35px rgba(0,0,0,.38); }
.pipeline-node::before, .pipeline-node::after { content: ''; position: absolute; top: 50%; z-index: -1; }
.pipeline-node::before { left: -7px; width: 10px; height: 10px; border: 2px solid #788499; border-radius: 50%; background: #0c0f15; transform: translateY(-50%); }
.pipeline-node::after { right: -80px; width: 78px; border-top: 2px dashed #4b5668; }
.pipeline-node:last-child::after { display: none; }
.pipeline-node header { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.pipeline-node header em { font-style: normal; letter-spacing: 0; }
.pipeline-node h3 { margin: 16px 0 9px; font-size: 12px; }
.pipeline-node p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.pipeline-node ul { margin: 10px 0 0; padding-left: 16px; color: var(--muted); font-size: 8px; line-height: 1.7; }
.canvas-watermark { position: absolute; right: 24px; bottom: 20px; color: #313846; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.system-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.system-strip article { display: flex; align-items: center; gap: 11px; padding: 13px 16px; background: #0c0f14; }
.system-strip small, .system-strip strong { display: block; }
.system-strip small { color: var(--muted); font-size: 9px; }
.system-strip strong { margin-top: 3px; font-size: 11px; }
.health-light { width: 8px; height: 8px; border-radius: 50%; background: #6f7989; }
.health-light.is-healthy, .health-light.is-safe { background: var(--accent); box-shadow: 0 0 12px rgba(199,255,89,.5); }
.health-light.is-error { background: #ff6a6a; }
.user-output-grid .d6-result-node { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); box-shadow: none; }
.user-output-grid .d3-node-header { padding: 14px 16px 12px; }
.user-output-grid .d3-node-body { padding: 14px 16px 16px; }
[hidden] { display: none !important; }

/* F4 Review 4 - Image Editor Debug uses the real Editor first, then read-only evidence. */
.f4-debug-shell { display: grid; min-width: 0; gap: 14px; }
.f4-debug-editor-stage { min-width: 0; overflow: hidden; background: #07090c; }
.f4-debug-editor-frame-wrap { height: max(920px, calc(100vh - 150px)); min-height: 760px; overflow: hidden; }
.f4-debug-editor-stage .user-image-editor-frame { height: 100%; }
.f4-debug-runtime { padding: 16px 18px 18px; border-top: 1px solid var(--line); background: linear-gradient(145deg, rgba(16,20,27,.98), rgba(9,12,17,.98)); }
.f4-debug-evidence-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 350px; align-items: start; min-width: 0; gap: 14px; }
.f4-debug-main-column, .f4-debug-settings-rail { display: grid; min-width: 0; gap: 14px; }
.f4-debug-settings-rail { position: sticky; top: 14px; }
.f4-debug-panel, .f4-debug-prompt-structure { min-width: 0; padding: 18px; }
.f4-debug-section-heading { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 16px; }
.f4-debug-section-heading > div { min-width: 0; }
.f4-debug-section-heading small { display: block; color: var(--accent); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.f4-debug-section-heading h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.025em; }
.f4-debug-help { max-width: 980px; margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.f4-debug-badge, .f4-debug-readonly { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); background: #0a0d12; font-size: 8px; font-weight: 900; line-height: 1; white-space: nowrap; }
.f4-debug-badge.is-ready, .f4-debug-badge.is-pass { border-color: rgba(199,255,89,.54); color: var(--accent); background: rgba(199,255,89,.07); }
.f4-debug-badge.is-running { border-color: rgba(85,167,255,.58); color: #86c2ff; background: rgba(85,167,255,.08); }
.f4-debug-badge.is-fail { border-color: rgba(255,92,101,.58); color: #ff8188; background: rgba(255,92,101,.08); }
.f4-debug-badge.is-not-run { color: #9ca6b5; }
.f4-debug-badge.is-skipped { border-color: #303640; color: #697381; background: #090b0e; }
button.f4-debug-badge { appearance: none; font-family: inherit; cursor: pointer; }
button.f4-debug-badge:hover, button.f4-debug-badge:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(199,255,89,.12); }
.f4-debug-evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.f4-debug-evidence-grid > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(6,9,13,.62); }
.f4-debug-evidence-grid dt { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.f4-debug-evidence-grid dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--text); font-size: 10px; line-height: 1.45; }
.f4-debug-content-empty, .f4-debug-result-empty { margin-top: 14px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); background: rgba(7,10,14,.55); font-size: 10px; line-height: 1.55; }
.f4-debug-assignment-grid, .f4-debug-recipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.f4-debug-assignment-card, .f4-debug-recipe-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #090d13; }
.f4-debug-assignment-card header, .f4-debug-recipe-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.f4-debug-assignment-card small, .f4-debug-recipe-card small { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.f4-debug-assignment-card strong, .f4-debug-recipe-card strong { display: block; margin-top: 7px; overflow-wrap: anywhere; font-size: 11px; line-height: 1.4; }
.f4-debug-assignment-card p, .f4-debug-recipe-card p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.f4-debug-provider-paths, .f4-debug-recipe-paths { display: grid; gap: 10px; margin-top: 14px; }
.f4-debug-operation-selector { display: grid; gap: 7px; padding: 10px; border: 1px solid rgba(199,255,89,.38); border-radius: 9px; background: rgba(199,255,89,.045); }
.f4-debug-operation-selector label { display: grid; gap: 6px; }
.f4-debug-operation-selector label > span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.f4-debug-operation-selector select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 7px; padding: 9px; color: var(--text); background: #070b10; font-size: 9px; font-weight: 800; }
.f4-debug-operation-selector small { color: var(--muted); font-size: 8px; line-height: 1.5; }
.f4-debug-provider-scope { display: grid; gap: 3px; }
.f4-debug-provider-scope strong { font-size: 10px; }
.f4-debug-provider-scope small { overflow-wrap: anywhere; }
.f4-debug-assignment-error { margin: 0; padding: 10px; border: 1px solid rgba(255,92,101,.48); border-radius: 8px; color: #ff8188; background: rgba(255,92,101,.08); font-size: 9px; line-height: 1.5; }
.f4-debug-operation-assignments { margin-top: 1px; }
.f4-debug-operation-assignments .f2c-compact-summary-row > span { color: #b7c4d5; }
.f4-debug-path-group { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #080c12; }
.f4-debug-path-heading { display: grid; gap: 3px; padding: 10px 11px; border-bottom: 1px solid var(--line); background: #0d131c; }
.f4-debug-path-heading strong { overflow-wrap: anywhere; font-size: 10px; }
.f4-debug-path-heading small { overflow-wrap: anywhere; color: var(--muted); font-size: 7px; }
.f4-debug-provider-group { display: grid; gap: 7px; padding: 9px; border-bottom: 1px solid var(--line); }
.f4-debug-provider-group:last-child { border-bottom: 0; }
.f4-debug-provider-group > h3 { margin: 0; color: var(--muted); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.f4-debug-model-card, .f4-debug-recipe-card { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #090d13; }
.f4-debug-model-card.is-current, .f4-debug-recipe-card.is-current { border-color: rgba(199,255,89,.45); box-shadow: inset 0 0 0 1px rgba(199,255,89,.1); }
.f4-debug-model-card > header, .f4-debug-recipe-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.f4-debug-model-card > header strong, .f4-debug-recipe-card > header strong { display: block; overflow-wrap: anywhere; font-size: 9px; }
.f4-debug-model-card > header small, .f4-debug-recipe-card > header small { display: block; margin-top: 3px; overflow-wrap: anywhere; color: var(--muted); font-size: 7px; }
.f4-debug-model-statuses { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.f4-debug-version-select { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 7px; margin-top: 8px; }
.f4-debug-version-select span { color: var(--muted); font-size: 7px; }
.f4-debug-version-select select { min-width: 0; border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px; color: var(--text); background: #070b10; font-size: 8px; }
.f4-debug-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.f4-debug-card-actions button { min-width: 0; border: 1px solid var(--line-strong); border-radius: 7px; padding: 8px 5px; color: #c8d3e1; background: #101720; font-size: 7px; font-weight: 850; cursor: pointer; }
.f4-debug-card-actions button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.f4-debug-card-actions button.is-current { border-color: rgba(199,255,89,.55); color: var(--accent); background: rgba(199,255,89,.08); }
.f4-debug-card-actions button:disabled { cursor: default; opacity: .68; }
.f4-debug-recipe-paths .f4-debug-recipe-card { margin: 9px; }
#f4-debug-confirm-action { color: #0b1005; border-color: var(--accent); background: var(--accent); }
.f4-debug-structure-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.f4-debug-structure-grid > section { min-width: 0; padding: 12px; border: 1px solid rgba(199,255,89,.3); border-radius: 10px; background: rgba(10,18,13,.62); }
.f4-debug-structure-grid header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid rgba(199,255,89,.22); }
.f4-debug-structure-grid h3 { margin: 0; color: var(--accent); font-size: 14px; }
.f4-debug-structure-grid header span { color: var(--muted); font-size: 8px; }
.f4-debug-tag-list { display: grid; gap: 7px; margin-top: 9px; }
.f4-debug-tag { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7,10,14,.72); }
.f4-debug-tag header { padding: 0; border: 0; }
.f4-debug-tag strong { font-size: 9px; }
.f4-debug-tag em { color: var(--accent); font-size: 8px; font-style: normal; font-weight: 900; }
.f4-debug-tag p { margin: 6px 0 0; overflow-wrap: anywhere; color: #b7c1d0; font-size: 9px; line-height: 1.55; white-space: pre-wrap; }
.f4-debug-system-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.f4-debug-system-node { min-width: 0; padding: 11px; border: 1px solid var(--line); border-top: 2px solid var(--blue); border-radius: 9px; background: #090d13; }
.f4-debug-system-node header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.f4-debug-system-node strong { font-size: 9px; }
.f4-debug-system-node p { margin: 7px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.f4-debug-system-node-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; }
.f4-debug-system-version { padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 999px; color: #acd2ff; background: rgba(85,167,255,.06); font-size: 7px; font-weight: 900; line-height: 1; white-space: nowrap; }
.f4-debug-locator-empty { display: grid; min-height: 220px; margin-top: 14px; place-items: center; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); background: #070a0e; font-size: 10px; text-align: center; }
.f4-debug-locator-view { display: grid; gap: 10px; margin-top: 14px; }
.f4-debug-locator-figure { display: grid; min-height: 260px; margin: 0; place-items: center; padding: 12px; overflow: hidden; border: 1px solid rgba(199,255,89,.34); border-radius: 10px; background: #05080b; }
.f4-debug-locator-figure img { display: block; width: auto; max-width: 100%; height: auto; max-height: 620px; object-fit: contain; }
.f4-debug-locator-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.f4-debug-locator-meta > div { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #090d13; }
.f4-debug-locator-meta small, .f4-debug-locator-meta strong { display: block; }
.f4-debug-locator-meta small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.f4-debug-locator-meta strong { margin-top: 4px; overflow-wrap: anywhere; font-size: 9px; line-height: 1.4; }
.f4-debug-code { max-width: 100%; max-height: 420px; margin: 14px 0 0; padding: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; color: #d9e1ec; background: #070a0e; font: 9px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; word-break: break-word; }
.f4-debug-code:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.f4-debug-transport { display: grid; gap: 8px; margin-top: 14px; }
.f4-debug-transport-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.f4-debug-transport-summary > div { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #090d13; }
.f4-debug-transport-summary small, .f4-debug-transport-summary strong { display: block; }
.f4-debug-transport-summary small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.f4-debug-transport-summary strong { margin-top: 4px; overflow-wrap: anywhere; font-size: 9px; line-height: 1.4; }
.f4-debug-asset-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.f4-debug-asset-table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: 8px; }
.f4-debug-asset-table th, .f4-debug-asset-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.f4-debug-asset-table th { color: var(--muted); background: #0d1118; text-transform: uppercase; }
.f4-debug-asset-table tr:last-child td { border-bottom: 0; }
.f4-debug-result-empty strong { color: var(--text); font-size: 11px; }
.f4-debug-result-empty p { margin: 5px 0 0; }

@media (max-width: 1050px) {
  .workspace-head { align-items: stretch; flex-direction: column; }
  .view-switcher { align-self: flex-start; }
  .system-selector-panel { align-items: stretch; flex-direction: column; }
  .system-choice-buttons { width: 100%; }
  .user-workflow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-generation-layout { grid-template-columns: 1fr; }
  .system-strip { grid-template-columns: 1fr 1fr; }
  .canvas-toolbar { flex-wrap: wrap; gap: 12px; }
  .canvas-workflow-control { order: 3; width: 100%; min-width: 0; }
  .f4-debug-evidence-grid, .f4-debug-structure-grid, .f4-debug-locator-meta { grid-template-columns: 1fr; }
  .f4-debug-system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .f4-debug-evidence-workspace { grid-template-columns: 1fr; }
  .f4-debug-settings-rail { position: static; }
}

@media (max-width: 700px) {
  .app-shell { padding: 0 14px 20px; }
  .workspace-head { padding-top: 28px; }
  .view-switcher { width: 100%; }
  .view-button { flex: 1; min-width: 0; justify-content: center; }
  .system-choice-buttons { grid-template-columns: 1fr 1fr; }
  .user-category-grid, .user-case-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .user-category-button, .user-case-button { min-width: 0; }
  .user-workflow-grid { grid-template-columns: 1fr; }
  .system-strip { grid-template-columns: 1fr; }
  .canvas-grid, .canvas-watermark { min-width: 1000px; }
  .f4-debug-editor-frame-wrap { height: 880px; min-height: 0; }
  .f4-debug-section-heading { align-items: stretch; flex-direction: column; gap: 9px; }
  .f4-debug-badge, .f4-debug-readonly { align-self: flex-start; }
  .f4-debug-assignment-grid, .f4-debug-recipe-grid, .f4-debug-system-grid, .f4-debug-transport-summary { grid-template-columns: 1fr; }
}
