:root {
  color-scheme: light;
  --ink: #18181b;
  --text: #3f3f46;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
  --surface: #ffffff;
  --canvas: #fafafa;
  --soft: #f4f4f5;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --amber: #a16207;
  --amber-soft: #fefce8;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; position: absolute !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.topbar { height: 60px; padding: 0 32px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 7px; font-weight: 750; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; line-height: 1.2; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.topnav { height: 100%; display: flex; gap: 24px; }
.topnav-item { padding: 0; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 600; }
.topnav-item:hover { color: var(--ink); }
.topnav-item.active { color: var(--ink); border-bottom-color: var(--ink); }
.account { justify-self: end; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.text-button { padding: 0; color: var(--text); background: transparent; border: 0; }

.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 64px; }
.view { animation: enter .18s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(3px); } }
.hero { min-height: 42px; margin-bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.hero h1, .history-heading h1 { margin: 0 0 5px; font-size: 27px; line-height: 1.2; letter-spacing: -.025em; }
.hero-description, .history-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.scope-line { padding-bottom: 3px; display: flex; gap: 18px; color: var(--muted); font-size: 11px; }
.scope-line span { white-space: nowrap; }
.scope-line span::before { content: ""; width: 4px; height: 4px; margin-right: 7px; display: inline-block; vertical-align: 2px; background: #a1a1aa; border-radius: 50%; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
h2, h3, p { margin-top: 0; }
h2 { margin-bottom: 5px; font-size: 23px; letter-spacing: -.02em; }
h3 { margin-bottom: 0; font-size: 17px; }

.stepper { margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); overflow: hidden; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stepper li { min-width: 0; padding: 11px 13px; display: flex; align-items: center; gap: 9px; color: #a1a1aa; border-right: 1px solid var(--line); }
.stepper li:last-child { border-right: 0; }
.stepper li > span { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; background: var(--soft); border-radius: 50%; font-size: 9px; font-weight: 700; }
.stepper strong, .stepper small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper strong { font-size: 11px; }
.stepper small { margin-top: 1px; font-size: 8px; font-weight: 400; }
.stepper li.active { color: var(--ink); background: #fafafa; }
.stepper li.active > span { color: #fff; background: var(--ink); }
.stepper li.done { color: var(--green); }
.stepper li.done > span { color: var(--green); background: var(--green-soft); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 16px; align-items: start; }
.intake-card, .task-summary, .result, .run-console, .history-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.intake-card { padding: 20px 22px 18px; }
.card-heading, .summary-heading, .panel-heading, .result-header, .remediation > header, .history-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.card-heading { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.card-heading strong, .card-heading small, .summary-heading strong, .summary-heading small { display: block; }
.card-heading strong, .summary-heading strong { font-size: 13px; }
.card-heading small, .summary-heading small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.privacy-badge, .quota-badge, .run-badge { padding: 4px 8px; color: var(--text); background: var(--soft); border-radius: 999px; font-size: 9px; font-weight: 650; }
.quota-badge { color: var(--accent); background: var(--accent-soft); }

.upload-toolbar { padding: 14px 0 10px; display: flex; gap: 7px; }
.upload-choice { min-width: 106px; min-height: 46px; padding: 7px 11px; display: flex; align-items: center; justify-content: space-between; gap: 9px; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; }
.upload-choice strong { font-size: 11px; }
.upload-choice span { color: var(--muted); font-size: 8px; }
.upload-choice.active { color: var(--accent); background: var(--accent-soft); border-color: #bfdbfe; }
.upload-dropzone { width: 100%; min-height: 142px; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text); background: #fafafa; border: 1px dashed #c4c4c8; border-radius: 8px; }
.upload-dropzone:hover, .upload-dropzone.dragging { background: var(--accent-soft); border-color: var(--accent); }
.upload-dropzone strong, .upload-dropzone small { display: block; }
.upload-dropzone strong { margin-top: 7px; font-size: 12px; }
.upload-dropzone small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.upload-icon { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 50%; font-size: 16px; }
.file-queue { margin-top: 10px; max-height: 176px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; }
.queue-empty { margin: 0; padding: 15px; color: var(--muted); font-size: 10px; text-align: center; }
.queue-item { min-height: 42px; padding: 7px 10px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.queue-item:last-child { border-bottom: 0; }
.queue-item strong, .queue-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item strong { font-size: 10px; }
.queue-item small { color: var(--muted); font-size: 8px; }
.queue-kind { padding: 3px 6px; color: var(--muted); background: var(--soft); border-radius: 4px; font-size: 8px; }
.queue-remove { width: 24px; height: 24px; padding: 0; color: var(--muted); background: transparent; border: 0; }
.review-scope { margin-top: 12px; padding-top: 3px; border-top: 1px solid var(--line); }
.mode-toggle { margin-top: 11px; padding: 9px 10px; display: flex; align-items: center; gap: 9px; background: #fafafa; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.mode-toggle input { width: 14px; height: 14px; flex: 0 0 auto; }
.mode-toggle span, .mode-toggle strong, .mode-toggle small { display: block; }
.mode-toggle strong { font-size: 10px; }
.mode-toggle small { margin-top: 1px; color: var(--muted); font-size: 8px; }
.copy-inputs { padding: 2px 0 14px; }
.attachment-label { padding-top: 13px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.attachment-label strong { font-size: 11px; }
.attachment-label span { color: var(--muted); font-size: 9px; }

.scenario-block { padding: 14px 0; border-bottom: 1px solid var(--line); }
.label-row { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.label-row strong, .label-row legend { padding: 0; font-size: 11px; font-weight: 650; }
.label-row > span { color: var(--muted); font-size: 9px; }
.scenario-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.scenario-card { min-height: 32px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 7px; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; transition: .15s; }
.scenario-card > span { color: var(--muted); font-size: 9px; }
.scenario-card strong { font-size: 10px; font-weight: 600; }
.scenario-card:hover { color: var(--ink); border-color: #a1a1aa; }
.scenario-card.selected { color: var(--accent); background: var(--accent-soft); border-color: #bfdbfe; }

.form-section { padding: 5px 0 0; }
.compact-section { padding-top: 0; }
.field { margin-top: 12px; display: grid; gap: 6px; }
.field > span { color: var(--text); font-size: 10px; font-weight: 600; }
.field i { color: var(--muted); font-size: 9px; font-style: normal; font-weight: 400; }
input, textarea, select { width: 100%; padding: 10px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; outline: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #a1a1aa; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
textarea { min-height: 104px; line-height: 1.6; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.three-columns { grid-template-columns: 1fr 1fr 1fr; }
.market-section { margin: 15px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); }
.market-grid { display: flex; gap: 7px; }
.market-option { cursor: pointer; position: relative; }
.market-option input { position: absolute; opacity: 0; pointer-events: none; }
.market-option > span { min-width: 92px; min-height: 34px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; }
.market-option b { color: var(--muted); font-size: 8px; }
.market-option strong { font-size: 10px; font-weight: 600; }
.market-option input:checked + span { color: var(--accent); background: var(--accent-soft); border-color: #bfdbfe; }
.market-option input:checked + span b { color: var(--accent); }

.task-summary { padding: 18px; position: sticky; top: 78px; }
.summary-heading { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.task-preview { margin: 3px 0 0; }
.task-preview > div { padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.task-preview dt { color: var(--muted); font-size: 10px; }
.task-preview dd { margin: 0; max-width: 160px; overflow: hidden; color: var(--ink); font-size: 11px; font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.primary, .secondary, .danger { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 7px; font-weight: 650; text-decoration: none; transition: .15s; }
.primary { color: #fff; background: var(--ink); border: 1px solid var(--ink); }
.primary:hover { background: #27272a; }
.secondary { color: var(--text); background: #fff; border: 1px solid var(--line-strong); }
.secondary:hover { background: var(--soft); }
.danger { color: var(--red); background: #fff; border: 1px solid #fecaca; }
.launch-button { width: 100%; min-height: 44px; display: flex; flex-direction: column; gap: 0; }
.launch-button span { font-size: 12px; }
.launch-button small { color: #d4d4d8; font-size: 8px; font-weight: 400; }
.task-preview + .launch-button { margin-top: 16px; }

.run-console { margin-top: 16px; padding: 18px 20px; }
.run-console header, .run-console header > div { display: flex; align-items: center; justify-content: space-between; gap: 11px; }
.run-console header strong, .run-console header small { display: block; }
.run-console header strong { font-size: 12px; }
.run-console header small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.running-pulse { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px var(--accent-soft); }
.run-track { height: 3px; margin: 16px 0 10px; overflow: hidden; background: var(--soft); border-radius: 3px; }
.run-track i { width: 18%; height: 100%; display: block; background: var(--accent); transition: width .5s; }
.run-phases { display: grid; grid-template-columns: repeat(5, 1fr); color: #a1a1aa; font-size: 8px; }
.run-phases span.active { color: var(--accent); }

.media-result { margin-top: 18px; }
.media-result-header { margin-bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.media-result-header h2 { margin: 0 0 3px; }
.media-result-header p { margin: 0; color: var(--muted); font-size: 10px; }
.media-result-list { display: grid; gap: 14px; }
.media-review-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.media-card-header { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.media-card-header strong, .media-card-header small { display: block; }
.media-card-header strong { font-size: 11px; }
.media-card-header small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.media-status { color: var(--accent); font-size: 9px; font-weight: 650; }
.media-status.risk { color: var(--red); }
.media-status.passed { color: var(--green); }
.media-review-layout { display: grid; grid-template-columns: minmax(360px, 1.2fr) minmax(300px, .8fr); }
.annotated-image { min-height: 340px; padding: 14px; display: grid; place-items: center; background: #f4f4f5; border-right: 1px solid var(--line); }
.annotated-canvas { max-width: 100%; max-height: 540px; border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.finding-panel { padding: 15px; }
.finding-list { display: grid; gap: 8px; }
.finding-item { padding: 11px; border: 1px solid var(--line); border-radius: 7px; }
.finding-item.active { border-color: #fca5a5; box-shadow: 0 0 0 2px var(--red-soft); }
.finding-item header { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.finding-item header strong { color: var(--red); font-size: 10px; }
.severity { padding: 2px 5px; color: var(--red); background: var(--red-soft); border-radius: 4px; font-size: 7px; }
.finding-item p { margin: 7px 0; color: var(--text); font-size: 9px; line-height: 1.6; }
.finding-rewrite { padding: 8px; background: var(--green-soft); border-radius: 5px; }
.finding-rewrite small, .finding-rewrite strong { display: block; }
.finding-rewrite small { color: var(--green); font-size: 7px; }
.finding-rewrite strong { margin-top: 3px; font-size: 9px; }
.media-edit-note { margin: 12px 0 0; padding: 10px 11px; color: var(--muted); background: #f4f4f5; border-radius: 5px; font-size: 8px; line-height: 1.6; }
.media-card-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }
.media-empty-result { padding: 24px; color: var(--green); background: var(--green-soft); border-radius: 7px; text-align: center; }
.corrected-preview { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.corrected-preview canvas { max-width: 100%; border: 1px solid var(--line); border-radius: 5px; }

.result { margin-top: 18px; overflow: hidden; }
.result-header { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.result-header p { margin-bottom: 0; color: var(--muted); font-size: 10px; }
.result-actions { display: flex; gap: 8px; }
.result-summary { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.result-summary div { padding: 14px 20px; border-right: 1px solid var(--line); }
.result-summary div:last-child { border-right: 0; }
.result-summary span, .result-summary strong { display: block; }
.result-summary span { color: var(--muted); font-size: 9px; }
.result-summary strong { margin-top: 3px; font-size: 12px; }
.notice { margin: 0; padding: 10px 24px; color: var(--amber); background: var(--amber-soft); border-bottom: 1px solid #fef08a; font-size: 9px; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; }
.evidence-column { padding: 22px 24px; }
.claims-panel { margin-bottom: 22px; }
.opportunity-panel { margin-bottom: 22px; }
.opportunity-list { display: grid; gap: 10px; }
.opportunity-card { padding: 13px; border: 1px solid #bae6fd; border-radius: 8px; background: #f0f9ff; }
.opportunity-card header { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.opportunity-card header > span { padding: 3px 6px; color: #0369a1; background: #e0f2fe; border-radius: 4px; font-size: 8px; font-weight: 700; }
.opportunity-card header strong { font-size: 11px; }
.opportunity-card div { margin-top: 8px; }
.opportunity-card small { color: var(--muted); font-size: 8px; }
.opportunity-card p { margin: 2px 0 0; color: var(--text); font-size: 9px; line-height: 1.65; }
.opportunity-value { padding: 9px; background: #fff; border-radius: 6px; }
.opportunity-value small { color: #0369a1; font-weight: 700; }
.opportunity-caveat p { color: var(--muted); }
.opportunity-card footer { margin-top: 10px; padding-top: 9px; display: flex; justify-content: space-between; border-top: 1px solid #bae6fd; font-size: 8px; }
.opportunity-card footer span { color: var(--muted); }
.opportunity-card footer a { color: var(--accent); font-weight: 650; text-decoration: none; }
.trace-column { padding: 22px; background: #fcfcfc; border-left: 1px solid var(--line); }
.panel-heading { margin-bottom: 12px; }
.panel-heading > div { display: flex; align-items: center; gap: 9px; }
.panel-heading strong { font-size: 12px; }
.panel-heading small { color: var(--muted); font-size: 8px; }
.section-index { width: 25px; height: 25px; display: grid; place-items: center; color: var(--muted); background: var(--soft); border-radius: 6px; font-size: 8px; font-weight: 700; }
.claim-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.claim-item { padding: 11px 12px; background: var(--amber-soft); border: 1px solid #fef08a; border-radius: 7px; }
.claim-item p { margin: 0; color: #713f12; font-size: 10px; }
.claim-item span { margin-top: 6px; display: block; color: var(--amber); font-size: 8px; }
.claim-item small { margin-top: 7px; display: block; color: var(--text); font-size: 8px; line-height: 1.55; }
.platform-finding { background: var(--red-soft); border-color: #fecaca; }
.platform-finding p { color: var(--red); font-weight: 650; }
.platform-finding span { color: #991b1b; line-height: 1.55; }
.market-row { margin-top: 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.market-title { min-height: 44px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; background: #fafafa; }
.market-title > div { display: flex; align-items: center; gap: 8px; }
.market-title b { width: 25px; height: 25px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 5px; font-size: 8px; }
.market-title span { color: var(--muted); font-size: 8px; }
.evidence-item { border-top: 1px solid var(--line); }
.evidence-item summary { min-height: 44px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; font-size: 10px; font-weight: 600; }
.evidence-item summary::-webkit-details-marker { display: none; }
.evidence-item summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 16px; }
.evidence-item[open] summary::after { content: "−"; }
.evidence-index { width: 21px; height: 21px; display: grid; place-items: center; color: var(--muted); background: var(--soft); border-radius: 5px; font-size: 8px; }
.evidence-body { padding: 0 13px 13px 42px; }
.evidence-body p { margin: 0 0 9px; color: var(--text); font-size: 9px; line-height: 1.7; }
.evidence-meta { margin-bottom: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.evidence-meta span { padding: 2px 5px; color: var(--muted); background: var(--soft); border-radius: 4px; font-size: 7px; }
.evidence-body a { color: var(--accent); font-size: 8px; font-weight: 600; }
.empty-evidence { margin: 0; padding: 14px; color: var(--red); background: var(--red-soft); font-size: 9px; }
.agent-trace { margin: 0; padding: 0; list-style: none; }
.agent-trace li { min-height: 52px; padding-left: 28px; position: relative; }
.agent-trace li::before { content: ""; width: 8px; height: 8px; position: absolute; left: 3px; top: 4px; border: 2px solid #d4d4d8; border-radius: 50%; background: #fff; }
.agent-trace li::after { content: ""; width: 1px; position: absolute; left: 7px; top: 16px; bottom: -2px; background: var(--line); }
.agent-trace li:last-child::after { display: none; }
.agent-trace li.completed::before { border-color: var(--green); background: var(--green); }
.agent-trace li.degraded::before { border-color: #eab308; background: #eab308; }
.agent-trace strong, .agent-trace small { display: block; }
.agent-trace strong { font-size: 9px; }
.agent-trace small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.review-actions { padding: 16px 24px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; background: #fafafa; border-top: 1px solid var(--line); }
.review-actions > div:first-child { margin-right: auto; display: flex; align-items: center; gap: 10px; }
.review-actions p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }
.remediation { border-top: 1px solid var(--line); }
.remediation > header { padding: 20px 24px; }
.remediation > header small { color: var(--muted); font-size: 8px; }
#remediation-list { padding: 0 24px 22px; }
.change { padding: 15px 0; border-top: 1px solid var(--line); }
.change-grid { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.change-grid div { padding: 11px; background: var(--red-soft); border-radius: 7px; }
.change-grid div:last-child { background: var(--green-soft); }
.change-grid small { color: var(--muted); font-size: 8px; }
.change-grid p { margin: 4px 0 0; font-size: 9px; }
.empty { margin: 0; padding: 36px; color: var(--muted); text-align: center; }

.history-heading { margin: 6px 0 20px; align-items: flex-end; }
.history-list { overflow: hidden; }
.history-item { width: 100%; padding: 15px 18px; display: grid; grid-template-columns: 52px minmax(0, 1fr) 150px 160px; gap: 14px; align-items: center; color: inherit; background: #fff; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.history-item:hover { background: #fafafa; }
.history-item:last-child { border-bottom: 0; }
.history-market { width: 39px; height: 39px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border-radius: 7px; font-size: 8px; font-weight: 700; }
.history-item strong, .history-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item small, .history-item time { color: var(--muted); font-size: 9px; }
.status { color: var(--green); font-size: 9px; font-weight: 650; }
.toast { max-width: min(420px, calc(100vw - 32px)); padding: 11px 14px; position: fixed; right: 18px; bottom: 18px; z-index: 50; color: #fff; background: var(--ink); border-radius: 7px; box-shadow: 0 12px 28px rgba(0,0,0,.18); font-size: 10px; }

@media (max-width: 900px) {
  body { padding-bottom: 76px; }
  .topbar { padding: 0 18px; grid-template-columns: 1fr auto; }
  .topnav { display: none; }
  .workspace-grid, .result-grid { grid-template-columns: 1fr; }
  .media-review-layout { grid-template-columns: 1fr; }
  .annotated-image { border-right: 0; border-bottom: 1px solid var(--line); }
  .task-summary { padding: 10px 14px; display: grid; grid-template-columns: auto minmax(220px, 360px); align-items: center; gap: 12px; position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 25; border-width: 1px 0 0; border-radius: 0; box-shadow: 0 -8px 28px rgba(0,0,0,.08); }
  .task-summary .summary-heading { padding: 0; border: 0; }
  .task-summary .summary-heading > div, .task-preview, .summary-note, .submit-hint { display: none; }
  .task-summary .quota-badge { justify-self: end; white-space: nowrap; }
  .task-summary .launch-button { grid-column: 2; grid-row: 1; min-height: 42px; }
  .trace-column { border-top: 1px solid var(--line); border-left: 0; }
  .scope-line { display: none; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 24px, 1120px); padding-top: 18px; }
  .account #account-email, .brand small { display: none; }
  .hero { min-height: 54px; }
  .hero h1 { font-size: 23px; }
  .intake-card { padding: 17px; }
  .three-columns { grid-template-columns: 1fr; }
  .market-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
  .market-option > span { min-width: 0; justify-content: center; }
  .stepper { grid-template-columns: repeat(5, minmax(45px, 1fr)); overflow-x: auto; }
  .stepper small { display: none; }
  .stepper li { padding: 9px 7px; justify-content: center; }
  .stepper li > div { display: none; }
  .result-summary { grid-template-columns: repeat(2, 1fr); }
  .result-summary div:nth-child(2) { border-right: 0; }
  .result-summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .claim-list, .change-grid { grid-template-columns: 1fr; }
  .review-actions { align-items: stretch; flex-wrap: wrap; }
  .review-actions > div:first-child { width: 100%; margin-bottom: 4px; }
  .history-item { grid-template-columns: 42px 1fr; }
  .history-item .status, .history-item time { display: none; }
  .task-summary { grid-template-columns: auto 1fr; }
  .upload-choice { min-width: 0; flex: 1; }
}
