:root {
  color-scheme: light;
  --ink: #152b3c;
  --muted: #4a6071;
  --line: #d2dfe7;
  --paper: #fff;
  --accent: #125c68;
  --soft: #e7f2f3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #eef3f6; color: var(--ink); font: 15px/1.55 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif; }
.wrap { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.top { background: #14293a; color: #e9f4fa; }
.top-row { min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.top-row a { color: inherit; }
.top-row .badge { margin-left: auto; }
.separator { color: #9bb7c6; margin-inline: 6px; }
h1, h2, p, figure { margin: 0; }
h1 { font-size: clamp(29px, 5vw, 44px); line-height: 1.15; margin: 7px 0 10px; letter-spacing: -.025em; }
h2 { font-size: 21px; line-height: 1.3; }
.intro { padding: 32px 0 24px; }
.intro > p:last-child, .muted { color: var(--muted); }
.eyebrow, .mono { font: 600 12px/1.5 ui-monospace, monospace; letter-spacing: .08em; color: var(--accent); }
.controls, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; }
button, select, input { min-height: 40px; border: 1px solid #a6bcc8; border-radius: 6px; padding: 7px 10px; background: #fff; color: var(--ink); font: inherit; }
select, input { width: 100%; }
button { cursor: pointer; }
button:hover:not(:disabled) { background: var(--soft); }
button:disabled { cursor: default; opacity: .55; }
button.primary { background: var(--accent); color: white; border-color: var(--accent); font-weight: 700; }
button.primary:hover:not(:disabled) { background: #0c4650; }
:focus-visible { outline: 3px solid #187c9d; outline-offset: 2px; }
.notice { margin: 10px 0 18px; color: var(--muted); }
.notice[data-stopped="true"] { color: #9c3024; font-weight: 700; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-heading h2 { margin-top: 3px; }
.badge { display: inline-block; flex: none; padding: 4px 8px; border-radius: 4px; background: #e7edf2; color: #334a5c; font-size: 12px; font-weight: 750; }
.badge[data-state="PASS"] { background: #ddf4e8; color: #146044; }
.badge[data-state="FAIL"], .badge[data-state="ERROR"] { background: #fbe9e7; color: #912e26; }
.badge[data-state="HOLD"] { background: #fff0d6; color: #774600; }
.views, .agent-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.views button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--soft); font-weight: 700; }
figure { background: #14293a; color: #e9f4fa; border-radius: 7px; overflow: hidden; }
svg { display: block; width: 100%; height: auto; }
figcaption { padding: 10px 12px; font-size: 13px; border-top: 1px solid #385364; }
.timeline { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.timeline li { counter-increment: step; position: relative; padding: 0 0 14px 40px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.timeline li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 1px; color: var(--accent); font: 700 13px/1.6 ui-monospace, monospace; }
.timeline li:last-child { border: 0; padding-bottom: 0; }
.timeline p { color: var(--muted); margin-top: 3px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 7px 5px; }
th { color: var(--muted); white-space: nowrap; }
tbody tr.selected { background: var(--soft); }
td button { white-space: nowrap; font-size: 12px; min-height: 32px; }
form { display: grid; gap: 8px; margin-top: 10px; }
form button { justify-self: start; }
.agent-actions { margin-top: 12px; }
.agent-output { background: #f0f5f7; border-radius: 6px; padding: 10px; white-space: pre-line; overflow-wrap: anywhere; }
.portfolio ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.portfolio li { border-top: 1px solid var(--line); padding-top: 8px; }
.portfolio span { display: block; color: var(--muted); }
footer { padding: 16px 0 24px; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 28px); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
  .controls, .portfolio ol { grid-template-columns: minmax(0, 1fr); }
  .top-row { gap: 8px; font-size: 13px; }
  .panel { padding: 12px; }
  td button { padding-inline: 5px; }
}

.live-inputs, .live-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.live-images { margin-top: 16px; }
.live-inputs + p, .live-images h2 + p { margin-top: 8px; }
.live-images canvas { display: block; width: 100%; height: auto; margin-top: 10px; border-radius: 6px; background: #14293a; }
.live-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.live-actions input { max-width: 145px; }
.live-note { margin: 10px 0; }
.live-regions { margin-bottom: 0; }
.live-regions:empty { display: none; }
.live-samples { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin-bottom: 16px; }
.live-samples label { min-width: min(100%, 220px); }
.live-samples p { flex-basis: 100%; }
.live-review { padding: 10px 12px; margin: 10px 0; border-radius: 6px; background: #fff0d6; color: #674000; font-weight: 650; }
@media (max-width: 620px) {
  .live-inputs, .live-images { grid-template-columns: minmax(0, 1fr); }
}
