:root {
  color-scheme: dark;
  --bg-base: #070b18;
  --bg-deep: #050813;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #edf2ff;
  --text-muted: #a8b3cf;
  --text-subtle: #7d8aad;

  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.18);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.16);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.18);

  --gradient: linear-gradient(135deg, #22d3ee 0%, #a78bfa 100%);
  --gradient-soft: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(167, 139, 250, 0.18));

  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow: 0 18px 48px rgba(2, 5, 15, 0.5);
  --shadow-soft: 0 8px 22px rgba(2, 5, 15, 0.35);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  position: relative;
  min-height: 100vh;
  background: radial-gradient(120% 80% at 50% 0%, #0d1432 0%, var(--bg-base) 55%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
}

.bgFx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bgGlow {
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.4;
}

.bgGlow--purple {
  top: -180px;
  left: -180px;
  background: radial-gradient(closest-side, rgba(124, 58, 237, 0.55), transparent 70%);
}

.bgGlow--cyan {
  bottom: -220px;
  right: -180px;
  background: radial-gradient(closest-side, rgba(6, 182, 212, 0.45), transparent 70%);
}

.bgGrid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(110% 80% at 50% 0%, #000 30%, transparent 80%);
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

/* ---- Auth overlay ---- */
.authOverlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: radial-gradient(120% 80% at 50% 0%, #0d1432 0%, var(--bg-base) 55%, var(--bg-deep) 100%);
}

.authOverlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(closest-side, rgba(124, 58, 237, 0.35), transparent 70%) -120px -120px / 540px 540px no-repeat,
    radial-gradient(closest-side, rgba(6, 182, 212, 0.3), transparent 70%) calc(100% + 80px) calc(100% + 60px) / 520px 520px no-repeat;
  filter: blur(60px);
  pointer-events: none;
}

.authOverlay.active {
  display: grid;
}

body.authLocked {
  overflow: hidden;
}

body.authLocked .shell,
body.authLocked .bgFx {
  visibility: hidden;
}

.authCard {
  position: relative;
  width: min(100%, 400px);
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow);
}

.authIntro {
  display: grid;
  gap: 4px;
}

.authCard h2 {
  margin: 2px 0 2px;
  font-size: 22px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.authError {
  min-height: 16px;
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

/* ---- Layout shell ---- */
.shell {
  width: min(1480px, calc(100% - 28px));
  max-width: 100%;
  margin: 0 auto;
  padding: 14px 0 22px;
  display: grid;
  gap: 10px;
}

.shell > * {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

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

.brandText {
  display: grid;
  gap: 0;
}

.brandText h1 {
  font-size: 20px;
}

.brandMark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient);
  color: #050813;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.32);
}

.configLine {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar {
  display: flex;
  gap: 8px;
}

/* ---- Typography ---- */
h1,
h2,
h3,
p,
pre {
  margin: 0;
}

h1 {
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.eyebrow {
  margin: 0;
  color: var(--cyan-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.muted {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---- Metrics ---- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  position: relative;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.metric:hover::before {
  opacity: 1;
}

.metric span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.metric.green strong {
  color: var(--green);
}

.metric.amber strong {
  color: var(--amber);
}

.metric.red strong {
  color: var(--red);
}

/* ---- Panels ---- */
.panel {
  position: relative;
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.sectionHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sectionHead.compact {
  margin-bottom: 8px;
}

.sectionHead h2 {
  margin: 2px 0 0;
}

/* ---- Hero / live workflow ---- */
.heroPanel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(6, 182, 212, 0.06)), var(--surface);
  border: 1px solid rgba(167, 139, 250, 0.18);
  overflow: hidden;
}

.heroHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.heroTitle h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.heroTitle p {
  font-size: 11px;
}

.heroRight {
  display: flex;
  align-items: center;
  gap: 12px;
}

.runBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.runBadge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-subtle);
}

.runBadge.running {
  background: var(--gradient-soft);
  border-color: rgba(34, 211, 238, 0.45);
  color: var(--cyan-light);
}

.runBadge.running::before {
  background: var(--cyan-light);
  box-shadow: 0 0 12px var(--cyan-light);
  animation: pulse 1.4s ease-in-out infinite;
}

.runBadge.success,
.runBadge.completed {
  background: var(--green-soft);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--green);
}

.runBadge.success::before,
.runBadge.completed::before {
  background: var(--green);
}

.runBadge.failure,
.runBadge.error,
.runBadge.cancelled {
  background: var(--red-soft);
  border-color: rgba(251, 113, 133, 0.4);
  color: var(--red);
}

.runBadge.failure::before,
.runBadge.error::before,
.runBadge.cancelled::before {
  background: var(--red);
}

.runMetric {
  text-align: right;
}

.metricLabel {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.runMetric strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.progressTrack {
  position: relative;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progressFill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient);
  transition: width 0.4s ease;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.4);
  position: relative;
}

.progressFill.running::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 1.6s linear infinite;
}

.runDetailRow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.runDetailRow strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan-light);
}

.runDetailRow .muted {
  flex: 1;
  font-size: 12px;
}

/* ---- Workflow graph ---- */
.workflowGraph {
  display: flex;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.workflowGraph::-webkit-scrollbar {
  height: 5px;
}

.workflowGraph::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.flowNode {
  position: relative;
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 116px;
  min-height: 70px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.flowNode strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.flowNode small {
  display: block;
  min-height: 26px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

.flowIndex {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}

.flowNode.done {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.32);
}

.flowNode.done .flowIndex {
  background: var(--green);
  color: #04150a;
}

.flowNode.active {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12), 0 6px 18px rgba(34, 211, 238, 0.18);
}

.flowNode.active .flowIndex {
  background: var(--gradient);
  color: #050813;
}

.flowNode.active::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 211, 238, 0.55);
  animation: nodePulse 1.6s ease-out infinite;
  pointer-events: none;
}

.flowNode.failed {
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.45);
}

.flowNode.failed .flowIndex {
  background: var(--red);
  color: #200508;
}

.flowNode.muted {
  opacity: 0.5;
}

.flowEdge {
  position: relative;
  flex: 0 0 22px;
  align-self: center;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.flowEdge span {
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--cyan-light), transparent);
}

.flowEdge.done {
  background: rgba(34, 197, 94, 0.55);
}

.flowEdge.active span {
  animation: shimmer 1.1s linear infinite;
}

.flowEdge.failed {
  background: rgba(251, 113, 133, 0.6);
}

/* ---- Mid grid: console + forms ---- */
.midGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 10px;
  align-items: stretch;
}

.formStack {
  display: grid;
  gap: 10px;
}

.consolePanel {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 14px;
  min-height: 0;
}

.consoleOutput {
  width: 100%;
  min-height: 180px;
  height: 100%;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd6f0;
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.consoleOutput::-webkit-scrollbar {
  width: 5px;
}

.consoleOutput::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.consoleOutput .ts {
  color: var(--text-subtle);
}

.consoleOutput .lvl-system {
  color: var(--cyan-light);
}

.consoleOutput .lvl-running {
  color: var(--amber);
}

.consoleOutput .lvl-done {
  color: var(--green);
}

.consoleOutput .lvl-error {
  color: var(--red);
}

/* ---- Forms ---- */
.formCard {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.field {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.field > span:first-child {
  letter-spacing: 0.04em;
}

.field input,
.field select,
input,
select {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 28, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder {
  color: var(--text-subtle);
}

input:focus,
select:focus {
  border-color: rgba(34, 211, 238, 0.6);
  background: rgba(8, 12, 28, 0.85);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

select option {
  background: var(--bg-deep);
  color: var(--text);
}

.field.check {
  align-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(8, 12, 28, 0.5);
  color: var(--text);
  cursor: pointer;
}

.field.check input {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  accent-color: var(--cyan-light);
}

.denseFields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.span2 {
  grid-column: span 2;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  text-decoration: none;
}

.btn.small {
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.btn.primary {
  background: var(--gradient);
  color: #050813;
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn.primary:active {
  transform: translateY(0);
}

.btn.ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn.ghost:hover {
  background: var(--surface-hover);
  border-color: rgba(34, 211, 238, 0.4);
  color: var(--cyan-light);
}

.btn[hidden] {
  display: none;
}

/* ---- Data grid ---- */
.dataGrid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 10px;
}

/* ---- Tables ---- */
.tableWrap {
  width: 100%;
  max-height: 220px;
  overflow: auto;
  border-radius: var(--radius-sm);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.tableWrap::-webkit-scrollbar {
  height: 5px;
  width: 5px;
}

.tableWrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

th,
td {
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  position: sticky;
  top: 0;
  background: rgba(8, 12, 28, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 1;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

td a {
  color: var(--cyan-light);
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

/* ---- Pills ---- */
.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill.published,
.pill.success,
.pill.completed {
  background: var(--green-soft);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--green);
}

.pill.failed,
.pill.failure,
.pill.failed_publish {
  background: var(--red-soft);
  border-color: rgba(251, 113, 133, 0.4);
  color: var(--red);
}

.pill.processing,
.pill.running,
.pill.in_progress,
.pill.queued,
.pill.ready_to_publish,
.pill.published_with_warnings,
.pill.dry_run {
  background: var(--amber-soft);
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--amber);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.panelFooter {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.panelFooter .btn[hidden] {
  display: none;
}

/* ---- Animations ---- */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.55;
  }
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes nodePulse {
  from {
    transform: scale(1);
    opacity: 0.7;
  }
  to {
    transform: scale(1.05);
    opacity: 0;
  }
}

/* ---- Responsive ---- */
@media (max-width: 1180px) {
  .midGrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 18px, 1480px);
    padding: 12px 0 24px;
  }

  .topbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .configLine {
    flex: 1 1 100%;
    order: 3;
    text-align: left;
    font-size: 11px;
    white-space: normal;
  }

  .toolbar {
    margin-left: auto;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heroHead {
    flex-direction: column;
    align-items: stretch;
  }

  .heroRight {
    width: 100%;
    justify-content: space-between;
  }

  .dataGrid {
    grid-template-columns: 1fr;
  }

  .denseFields {
    grid-template-columns: 1fr;
  }

  .span2 {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 12px;
  }

  .shell {
    width: 100%;
    padding: 12px;
    gap: 10px;
  }

  .topbar {
    padding: 10px 12px;
    border-radius: 12px;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .brandMark {
    width: 36px;
    height: 36px;
    font-size: 13px;
    border-radius: 10px;
    flex: 0 0 auto;
  }

  .brandText {
    min-width: 0;
  }

  .brandText .eyebrow {
    display: none;
  }

  .brandText h1 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .configLine {
    display: none;
  }

  .toolbar {
    gap: 6px;
  }

  .toolbar .btn {
    height: 30px;
    padding: 0 12px;
    font-size: 11px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric {
    padding: 10px 12px;
    border-radius: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .metric span {
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  .metric strong {
    font-size: 22px;
  }

  .panel,
  .heroPanel,
  .consolePanel,
  .formCard {
    padding: 14px;
    border-radius: 12px;
  }

  .heroPanel {
    gap: 12px;
  }

  .heroHead {
    flex-direction: column;
    gap: 12px;
  }

  .heroLeft {
    align-items: flex-start;
    gap: 10px;
  }

  .heroTitle h2 {
    font-size: 16px;
    line-height: 1.25;
  }

  .heroTitle p {
    font-size: 11px;
  }

  .heroRight {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .runBadge {
    height: 22px;
    padding: 0 10px;
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .runMetric strong {
    font-size: 18px;
  }

  .runDetailRow {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .runDetailRow strong {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .runDetailRow .muted {
    font-size: 12px;
  }

  .progressTrack {
    height: 7px;
  }

  .flowNode {
    min-width: 108px;
    min-height: 64px;
    padding: 9px 10px;
  }

  .flowNode strong {
    font-size: 11px;
  }

  .flowNode small {
    font-size: 10px;
    min-height: 22px;
  }

  .flowIndex {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .flowEdge {
    flex-basis: 16px;
  }

  .midGrid {
    gap: 10px;
  }

  .formStack {
    gap: 10px;
  }

  .consoleOutput {
    min-height: 160px;
    max-height: 220px;
    padding: 12px;
    font-size: 11px;
    line-height: 1.55;
  }

  .formCard {
    gap: 10px;
  }

  .denseFields {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .span2 {
    grid-column: auto;
  }

  .field {
    font-size: 11px;
  }

  .field input,
  .field select,
  input,
  select {
    height: 36px;
    font-size: 12px;
    padding: 0 12px;
  }

  .field.check {
    height: 36px;
    padding: 0 12px;
  }

  .btn {
    height: 36px;
    font-size: 12px;
    padding: 0 16px;
  }

  .btn.small {
    height: 30px;
    font-size: 11px;
    padding: 0 12px;
  }

  .dataGrid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tableWrap {
    max-height: none;
    overflow: visible;
    border-radius: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
    border-collapse: separate;
  }

  thead {
    position: absolute;
    left: -9999px;
    top: -9999px;
  }

  tbody tr {
    margin-bottom: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  tbody tr:last-child {
    margin-bottom: 0;
  }

  tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    font-size: 11px;
    text-align: right;
    overflow: hidden;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--text-subtle);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: left;
  }

  td a {
    word-break: break-all;
    text-align: right;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  td.emptyRow {
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    border: 0;
    padding: 12px;
  }

  td.emptyRow::before {
    display: none;
  }

  .pill {
    height: 20px;
    padding: 0 8px;
    font-size: 10px;
  }

  .badge {
    height: 22px;
    padding: 0 10px;
    font-size: 10px;
  }

  .eyebrow {
    font-size: 10px;
  }

  h2 {
    font-size: 14px;
  }
}

@media (max-width: 460px) {
  .shell {
    padding: 10px;
    gap: 8px;
  }

  .topbar {
    padding: 9px 11px;
  }

  .brandText {
    display: none;
  }

  .toolbar {
    gap: 4px;
    margin-left: auto;
  }

  .toolbar .btn {
    padding: 0 10px;
    font-size: 10px;
    height: 28px;
  }

  .panel,
  .heroPanel,
  .formCard,
  .consolePanel {
    padding: 12px;
  }

  .metric strong {
    font-size: 20px;
  }

  .heroTitle h2 {
    font-size: 15px;
  }

  .runMetric strong {
    font-size: 16px;
  }

  .flowNode {
    min-width: 96px;
    min-height: 60px;
    padding: 8px 9px;
  }

  .consoleOutput {
    min-height: 140px;
    max-height: 200px;
    font-size: 10px;
  }
}
