/* 数字文旅政策文本分析工作台 —— 纯静态样式，无外部依赖 */

:root {
  --r: 8px;
  --sans: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --fs: 14px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1015;
  --bg-soft: #111620;
  --panel: #151a22;
  --panel-2: #1a212b;
  --panel-3: #222a36;
  --border: #242c38;
  --border-strong: #33404f;
  --fg: #e6eaf2;
  --fg-dim: #b3bccb;
  --muted: #8590a3;
  --accent: #4d8dff;
  --accent-hover: #6ba0ff;
  --accent-fg: #ffffff;
  --accent-soft: rgba(77, 141, 255, 0.14);
  --ok: #3cba7a;
  --ok-soft: rgba(60, 186, 122, 0.14);
  --warn: #dda43a;
  --warn-soft: rgba(221, 164, 58, 0.15);
  --err: #e2594f;
  --err-soft: rgba(226, 89, 79, 0.15);
  --log-bg: #0b0e13;
  --track: #1f2733;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg-soft: #eef1f6;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #eef2f7;
  --border: #dde4ed;
  --border-strong: #c3cedb;
  --fg: #1b2330;
  --fg-dim: #3d4759;
  --muted: #68738a;
  --accent: #1f6feb;
  --accent-hover: #1a5fd0;
  --accent-fg: #ffffff;
  --accent-soft: rgba(31, 111, 235, 0.09);
  --ok: #17864f;
  --ok-soft: rgba(23, 134, 79, 0.10);
  --warn: #9a6a12;
  --warn-soft: rgba(154, 106, 18, 0.10);
  --err: #c0392b;
  --err-soft: rgba(192, 57, 43, 0.09);
  --log-bg: #f7f9fc;
  --track: #e3e9f1;
  --shadow: 0 1px 0 rgba(16, 24, 40, 0.03);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--fs);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 提示条 ---------- */
.banner {
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn);
  color: var(--fg);
  padding: 9px 20px;
  font-size: 13px;
  text-align: center;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r);
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--accent);
}

.brand-text { min-width: 0; }
.brand-text h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text .sub {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; min-width: 0; }

.health {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 12px;
  color: var(--fg-dim);
  max-width: 320px;
  min-width: 0;
  flex: 0 1 auto;
}
.health-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 18%, transparent);
}
.dot[data-state="ok"] {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}
.dot[data-state="err"] {
  background: var(--err);
  box-shadow: 0 0 0 3px var(--err-soft);
}
.dot[data-state="checking"] { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 20px 0;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.4px;
  text-transform: none;
  color: var(--fg);
}
.hint, .note { color: var(--muted); font-size: 12px; }
.note { margin: 8px 0 0; line-height: 1.5; }

.field { margin-bottom: 16px; }
.field:last-of-type { margin-bottom: 0; }
.field-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--fg-dim); }

.badge {
  font-size: 11px;
  padding: 0 6px;
  line-height: 17px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.badge.req { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.badge.opt { color: var(--muted); }

/* ---------- 拖拽区 ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 14px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--panel-2);
  color: var(--fg-dim);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.dropzone strong { font-size: 13px; font-weight: 600; color: var(--fg); }
.dz-sub { font-size: 12px; color: var(--muted); }
.dz-icon { color: var(--muted); margin-bottom: 2px; }
.dropzone:hover { border-color: var(--accent); color: var(--fg); }
.dropzone:hover .dz-icon { color: var(--accent); }
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--fg);
}
.dropzone[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- 文件元信息 ---------- */
.file-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--panel-2);
}
.fm-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 4px;
  padding: 0 5px;
  line-height: 17px;
  flex: none;
}
.fm-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.fm-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-size { font-size: 11.5px; color: var(--muted); }

.filepick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--panel-2);
  color: var(--fg-dim);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, color 0.15s;
}
.filepick:hover { border-color: var(--accent); color: var(--fg); }
.filepick:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 参数折叠面板 ---------- */
.params {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--panel-2);
  margin: 16px 0;
  overflow: hidden;
}
.params > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  color: var(--fg-dim);
  user-select: none;
}
.params > summary::-webkit-details-marker { display: none; }
.params > summary::before {
  content: "▸";
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.15s;
  display: inline-block;
}
.params[open] > summary::before { transform: rotate(90deg); }
.params > summary:hover { color: var(--fg); }
.sum-label { font-weight: 600; }
.sum-tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 5px;
  line-height: 16px;
}
.params-body { padding: 4px 12px 12px; border-top: 1px solid var(--border); }
.param-block { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.param-block:last-child { border-bottom: 0; padding-bottom: 0; }
.param-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-dim);
  margin-bottom: 8px;
}

.step-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--fg-dim);
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  min-width: 0;
}
.check:hover { background: var(--panel-3); }
.check input { accent-color: var(--accent); margin: 0; flex: none; }
.check span { white-space: nowrap; }
.check .tag { font-size: 10.5px; color: var(--warn); font-style: normal; white-space: nowrap; }
.check:has(.tag) { justify-content: flex-start; }

.inline-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); flex: 1 1 84px; }
.mini-field.grow { flex: 1 1 150px; }
.mini-field input, .mini-field select {
  font: inherit;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 8px;
  width: 100%;
  min-width: 0;
}
.mini-field select { font-family: var(--sans); }
.mini-field input:focus, .mini-field select:focus { border-color: var(--accent); outline: none; }
.mini-field input:disabled, .mini-field select:disabled { opacity: 0.5; }
.select-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--r);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost {
  background: transparent;
  color: var(--fg-dim);
  border-color: var(--border-strong);
}
.btn.ghost:hover { background: var(--panel-3); color: var(--fg); }
.btn.small { font-size: 12px; padding: 5px 9px; border-radius: 6px; }
.icon-btn svg { display: block; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="light"] .i-moon { display: none; }

.actions { display: flex; gap: 10px; margin-top: 4px; }
.actions .btn.primary { flex: 1 1 auto; }
.actions .btn.ghost { flex: none; }

/* ---------- 上传进度 ---------- */
.upload { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.upload-text { font-size: 11.5px; color: var(--muted); flex: none; }

/* ---------- 进度条 ---------- */
.bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
  width: 100%;
}
.bar.thin { height: 5px; flex: 1 1 auto; }
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* ---------- 运行面板 ---------- */
.run-head { align-items: center; }
.run-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-id {
  font-size: 11.5px;
  color: var(--muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: var(--panel-2);
  white-space: nowrap;
}
.pill[data-status="running"], .pill[data-status="pending"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--accent-soft);
}
.pill[data-status="done"] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: var(--ok-soft); }
.pill[data-status="failed"] { color: var(--err); border-color: color-mix(in srgb, var(--err) 50%, transparent); background: var(--err-soft); }
.pill[data-status="cancelled"] { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: var(--warn-soft); }

.stages {
  display: flex;
  align-items: flex-start;
  gap: 0;
  list-style: none;
  margin: 0 0 14px;
  padding: 4px 0 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.stage {
  position: relative;
  flex: 1 0 auto;
  min-width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  padding: 0 3px;
}
.stage::after {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% + 15px);
  width: calc(100% - 30px);
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  z-index: 0;
}
.stage:last-child::after { display: none; }
.st-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1;
  flex: none;
}
.st-label {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-state {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
}
.stage[data-status="running"] .st-state { color: var(--accent); }
.stage[data-status="done"] .st-state { color: var(--ok); }
.stage[data-status="failed"] .st-state { color: var(--err); }
.stage[data-status="skipped"] .st-state { color: var(--muted); }
.st-detail {
  font-size: 10.5px;
  color: var(--muted);
  opacity: 0.85;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 0;
}
.st-detail:empty { display: none; }

.stage[data-status="running"] .st-icon {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.stage[data-status="running"] .st-icon::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.75s linear infinite;
}
.stage[data-status="running"] .st-label { color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.stage[data-status="done"] .st-icon {
  border-color: var(--ok);
  color: var(--ok);
  background: var(--ok-soft);
}
.stage[data-status="done"] .st-label { color: var(--fg-dim); }
.stage[data-status="done"]::after { background: var(--ok); opacity: 0.55; }

.stage[data-status="failed"] .st-icon {
  border-color: var(--err);
  color: var(--err);
  background: var(--err-soft);
}
.stage[data-status="failed"] .st-label { color: var(--err); }

.stage[data-status="skipped"] .st-icon {
  border-style: dashed;
  color: var(--muted);
  opacity: 0.8;
}
.stage[data-status="skipped"] .st-label { color: var(--muted); }

.progress-wrap { margin-bottom: 14px; }
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--fg-dim);
}
.elapsed { font-size: 12px; color: var(--fg-dim); }

.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.counter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--panel-2);
  min-width: 0;
}
.c-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.c-value { font-size: 18px; line-height: 1.25; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.c-value.ok { color: var(--ok); }
.c-value.err { color: var(--err); }

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.log-head h3 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--fg-dim); }
.log-tools { display: flex; align-items: center; gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { accent-color: var(--accent); margin: 0; }

.log {
  margin: 0;
  height: 268px;
  overflow: auto;
  background: var(--log-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
}
.log:empty::before {
  content: "等待任务开始…";
  color: var(--muted);
  font-family: var(--sans);
}
.log-line {
  display: grid;
  grid-template-columns: 62px 40px 1fr;
  gap: 8px;
  padding: 1px 0;
  border-radius: 4px;
}
.log-line:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); }
.log-ts { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-lv { text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.3px; padding-top: 2px; color: var(--muted); }
.log-msg { color: var(--fg-dim); }
.log-line[data-level="info"] .log-lv { color: var(--accent); }
.log-line[data-level="warn"] .log-lv { color: var(--warn); }
.log-line[data-level="warn"] .log-msg { color: var(--warn); }
.log-line[data-level="error"] .log-lv { color: var(--err); }
.log-line[data-level="error"] .log-msg { color: var(--err); }

.run-note { margin-top: 10px; }

/* ---------- 结果 ---------- */
.results { margin: 16px 20px 0; max-width: 1400px; }
body > .results { width: calc(100% - 40px); margin: 16px auto 0; max-width: 1400px; }
.results-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-summary { font-size: 12px; color: var(--muted); }

.outputs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
}
.output {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--panel-2);
  min-width: 0;
}
.out-kind {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}
.thumb {
  width: 44px;
  height: 44px;
  flex: none;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--panel-3);
  cursor: zoom-in;
  transition: border-color 0.15s;
}
.thumb:hover { border-color: var(--accent); }
.out-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; gap: 1px; }
.out-name {
  font-size: 12.5px;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.out-meta { font-size: 11px; color: var(--muted); }
.output-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 32px;
  background: rgba(6, 8, 12, 0.86);
  backdrop-filter: blur(2px);
  cursor: zoom-out;
}
.lightbox img {
  max-width: min(92vw, 1400px);
  max-height: 82vh;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  cursor: zoom-out;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #e6eaf2;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
}
.lightbox-cap { color: #b3bccb; font-size: 12px; max-width: 80vw; text-align: center; word-break: break-all; }

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: auto auto 0;
  padding: 18px 20px 22px;
  color: var(--muted);
  font-size: 11.5px;
  max-width: 1440px;
  width: 100%;
}

.error-text { color: var(--err); font-size: 12.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .brand-text .sub { display: none; }
  .health { max-width: none; }
}

@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; }
  .top-actions { width: 100%; justify-content: space-between; }
  .health { flex: 1 1 auto; }
  .layout { padding: 12px 12px 0; }
  .panel { padding: 13px; }
  .results, body > .results { width: calc(100% - 24px); margin: 12px auto 0; }
  .outputs { grid-template-columns: minmax(0, 1fr); }
  .step-grid { grid-template-columns: 1fr; }
  .log { height: 220px; font-size: 11.5px; }
  .log-line { grid-template-columns: 58px 34px 1fr; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
