﻿:root {
  --paper: #f7f0e4;
  --paper-strong: #fff9f1;
  --ink: #111111;
  --ink-soft: rgba(17, 17, 17, 0.68);
  --line: rgba(17, 17, 17, 0.12);
  --ember: #e36414;
  --ember-deep: #c4440e;
  --butter: #f6c445;
  --teal: #177e89;
  --teal-soft: #d7efef;
  --rose: #f0b4a1;
  --mint: #b7d3be;
  --shadow: 0 24px 70px rgba(17, 17, 17, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --topbar-height: 82px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(240, 180, 161, 0.45), transparent 34%),
    radial-gradient(circle at 90% 20%, rgba(246, 196, 69, 0.35), transparent 26%),
    linear-gradient(180deg, #f8f1e7 0%, #f4ead8 55%, #efe4d2 100%);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(17, 17, 17, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 92%);
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(17, 17, 17, 0.03) 0.6px, transparent 0.6px);
  background-size: 10px 10px;
  mix-blend-mode: multiply;
  opacity: 0.32;
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  min-height: var(--topbar-height);
  backdrop-filter: blur(18px);
  background: rgba(247, 240, 228, 0.82);
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--ember), #ff9044);
  color: #fffdf9;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  box-shadow: 0 16px 30px rgba(227, 100, 20, 0.28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text strong {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.brand-text small {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a,
.text-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 700;
  position: relative;
}

.nav-links a::after,
.text-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms ease;
}

.nav-links a:hover::after,
.text-link:hover::after {
  transform: scaleX(1);
}

main {
  padding: 28px;
}

section {
  margin-bottom: 36px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  min-height: calc(100vh - var(--topbar-height) - 56px);
}

.hero-copy,
.hero-stack,
.panel,
.footer {
  position: relative;
  overflow: hidden;
}

.hero-copy,
.panel,
.footer {
  background: rgba(255, 249, 241, 0.84);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: auto -24% -42% auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 126, 137, 0.14), transparent 62%);
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 900;
}

.hero h1,
.section-head h2 {
  margin: 0;
  font-family: "Arial Narrow", "Avenir Next Condensed", "PingFang SC", sans-serif;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.96;
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 6.4rem);
  max-width: 10ch;
}

.hero-text {
  max-width: 62ch;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.8;
}

.hero-actions,
.hero-notes,
.section-chip-row,
.panel-head,
.progress-label-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 28px;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.primary-button {
  background: linear-gradient(135deg, var(--ember), #ff8a3d);
  color: #fffdf9;
  box-shadow: 0 16px 34px rgba(227, 100, 20, 0.25);
}

.primary-button:hover,
.ghost-button:hover,
.small:hover {
  transform: translateY(-2px);
}

.ghost-button {
  background: rgba(17, 17, 17, 0.04);
  color: var(--ink);
  border: 1px solid rgba(17, 17, 17, 0.1);
}

.small {
  padding: 10px 16px;
  font-size: 0.85rem;
}

.hero-notes {
  margin-top: 28px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.hero-notes span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.04);
}

.hero-stack {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 18px;
}

.status-slab {
  padding: 28px;
  border-radius: var(--radius-xl);
  min-height: 180px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(17, 17, 17, 0.06);
}

.status-slab span,
.panel-tag,
.upload-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 900;
}

.status-slab strong {
  display: block;
  margin-top: 16px;
  font-size: 1.9rem;
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  letter-spacing: -0.03em;
}

.status-slab p {
  margin: 14px 0 0;
  max-width: 28ch;
  line-height: 1.6;
}

.status-slab-1 {
  background: linear-gradient(135deg, rgba(227, 100, 20, 0.98), rgba(249, 148, 42, 0.88));
  color: #fffdf9;
  transform: rotate(-2.2deg);
}

.status-slab-2 {
  background: linear-gradient(135deg, rgba(255, 249, 241, 1), rgba(215, 239, 239, 0.96));
  transform: translateX(-12px);
}

.status-slab-3 {
  background: linear-gradient(135deg, rgba(23, 126, 137, 0.98), rgba(76, 178, 174, 0.92));
  color: #f7fffd;
  transform: rotate(2.2deg);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 3.4rem);
  max-width: 15ch;
}

.chip {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.chip-ember { background: rgba(227, 100, 20, 0.12); color: var(--ember-deep); }
.chip-ink { background: rgba(17, 17, 17, 0.08); color: var(--ink); }
.chip-teal { background: rgba(23, 126, 137, 0.12); color: var(--teal); }

.sop-layout,
.dashboard-grid,
.batch-grid,
.history-grid,
.rules-grid,
.config-layout {
  display: grid;
  gap: 18px;
}

.sop-layout {
  grid-template-columns: 1.28fr 0.92fr;
  align-items: start;
}

.dashboard-grid {
  grid-template-columns: 1.05fr 1fr 0.95fr;
}

.batch-grid {
  grid-template-columns: 1.1fr 1fr 0.85fr;
}

.history-grid,
.rules-grid,
.config-layout {
  grid-template-columns: 1.15fr 0.85fr;
}

.panel {
  padding: 24px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-head h3 {
  margin: 0;
  font-size: 1.18rem;
}

.sop-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.sop-node {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 250px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(247, 240, 228, 0.92));
}

.sop-node::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.12);
}

.sop-node-head,
.sop-node-heading,
.sop-batch-head,
.sop-batch-note {
  display: flex;
  gap: 12px;
}

.sop-node-head,
.sop-batch-head {
  align-items: flex-start;
  justify-content: space-between;
}

.sop-node-heading {
  flex-direction: column;
}

.sop-node-index,
.sop-batch-label {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sop-node-heading strong {
  font-size: 1.12rem;
}

.sop-state-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.sop-node-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

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

.sop-node-metrics span,
.sop-batch-stats article,
.sop-config-card {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 17, 17, 0.06);
}

.sop-node-metrics span {
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 800;
}

.sop-node-config {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.sop-node-config p {
  margin: 0;
  padding: 11px 12px;
  border-radius: 14px;
  background: rgba(17, 17, 17, 0.04);
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.sop-node-actions {
  margin-top: 4px;
}

.sop-node-alert {
  background: linear-gradient(180deg, rgba(255, 242, 236, 0.92), rgba(247, 240, 228, 0.94));
  border-color: rgba(227, 100, 20, 0.16);
}

.sop-node-alert::after,
.sop-state-pill.sop-node-alert {
  background: rgba(227, 100, 20, 0.18);
  color: var(--ember-deep);
}

.sop-node-live {
  background: linear-gradient(180deg, rgba(231, 247, 247, 0.92), rgba(255, 249, 241, 0.94));
  border-color: rgba(23, 126, 137, 0.16);
}

.sop-node-live::after,
.sop-state-pill.sop-node-live {
  background: rgba(23, 126, 137, 0.16);
  color: var(--teal);
}

.sop-node-ok::after,
.sop-state-pill.sop-node-ok {
  background: rgba(17, 17, 17, 0.1);
  color: var(--ink);
}

.sop-node-muted {
  opacity: 0.88;
}

.sop-node-muted::after,
.sop-state-pill.sop-node-muted {
  background: rgba(17, 17, 17, 0.08);
  color: var(--ink-soft);
}

.sop-side-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 14px);
}

.sop-batch-card {
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 180, 161, 0.28), transparent 38%),
    linear-gradient(135deg, rgba(255, 249, 241, 0.96), rgba(231, 247, 247, 0.9));
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.sop-batch-head strong {
  display: block;
  margin-top: 10px;
  font-size: 1.55rem;
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
  letter-spacing: -0.03em;
}

.sop-batch-head p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.sop-batch-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sop-batch-stats article {
  padding: 14px;
}

.sop-batch-stats span,
.sop-config-card span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sop-batch-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 1.36rem;
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
}

.sop-batch-note {
  flex-wrap: wrap;
  margin-top: 14px;
}

.sop-batch-note span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  font-size: 0.82rem;
  font-weight: 800;
}

.sop-quick-actions,
.sop-config-strip {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

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

.sop-quick-actions button {
  width: 100%;
}

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

.sop-config-card {
  padding: 16px;
}

.sop-config-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.45;
}

.sop-config-card p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

.sop-config-card .inline-action {
  margin-top: 12px;
}

.sop-config-card.focused {
  background: linear-gradient(135deg, rgba(23, 126, 137, 0.14), rgba(255, 249, 241, 0.98));
  border-color: rgba(23, 126, 137, 0.2);
}

.sop-stage-grid {
  min-height: 620px;
}

.flowmap-shell {
  display: grid;
  gap: 16px;
  min-height: 620px;
}

.flowmap-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(231, 247, 247, 0.92));
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.flowmap-label,
.flow-anchor-label,
.flow-node-index {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flowmap-head strong {
  display: block;
  margin-top: 10px;
  font-size: 1.24rem;
}

.flowmap-head p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.flowmap-head-meta,
.flow-anchor-meta,
.flow-node-meta,
.flow-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flowmap-head-meta {
  justify-content: flex-end;
}

.flowmap-head-meta span,
.flow-anchor-meta span,
.flow-node-meta span {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  font-size: 0.8rem;
  font-weight: 800;
}

.flowmap-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr) 46px minmax(0, 1fr) 46px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 54px minmax(0, 1fr);
  gap: 12px 10px;
  align-items: stretch;
}

.flow-anchor-card,
.flow-node {
  display: grid;
  gap: 12px;
  min-height: 188px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 240, 228, 0.94));
  text-align: left;
  appearance: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.flow-anchor-card strong,
.flow-node strong {
  font-size: 1.05rem;
  line-height: 1.2;
}

.flow-anchor-card p,
.flow-node p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.flow-anchor-card .inline-action,
.flow-node .inline-action {
  width: fit-content;
}

.flow-anchor-card:hover,
.flow-node:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 126, 137, 0.24);
  box-shadow: 0 18px 38px rgba(17, 17, 17, 0.12);
}

.flow-node.is-focused {
  border-color: rgba(227, 100, 20, 0.3);
  box-shadow: 0 20px 42px rgba(227, 100, 20, 0.14);
}

.flow-node-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.flow-node-state {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  font-size: 0.76rem;
  font-weight: 900;
}

.flow-node-actions {
  margin-top: auto;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.flow-arrow,
.flow-spacer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-arrow {
  color: var(--ember-deep);
  font-size: 1.8rem;
  font-weight: 900;
}

.flow-arrow.vertical {
  font-size: 2rem;
}

.mindmap-canvas {
  position: relative;
  min-height: 620px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(23, 126, 137, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(247, 240, 228, 0.92));
  border: 1px solid rgba(17, 17, 17, 0.06);
}

.mindmap-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.96), transparent 92%);
  pointer-events: none;
}

.mindmap-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.mindmap-toolbar-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  pointer-events: auto;
}

.mindmap-toolbar-hint,
.mindmap-zoom-label {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 249, 241, 0.86);
  border: 1px solid rgba(17, 17, 17, 0.08);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.mindmap-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

.mindmap-viewport.is-dragging {
  cursor: grabbing;
}

.mindmap-scene {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  transition: transform 140ms ease;
}

.mindmap-viewport.is-dragging .mindmap-scene {
  transition: none;
}

.mindmap-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mindmap-lines line,
.mindmap-lines circle {
  stroke: rgba(17, 17, 17, 0.16);
  fill: rgba(17, 17, 17, 0.16);
  stroke-width: 2.4;
  transition: stroke 180ms ease, fill 180ms ease, opacity 180ms ease;
  opacity: 0.72;
}

.mindmap-lines .line-active {
  stroke: rgba(227, 100, 20, 0.5);
  fill: rgba(227, 100, 20, 0.5);
  opacity: 1;
}

.mindmap-root,
.mindmap-branch {
  position: absolute;
  appearance: none;
  text-align: left;
  border: 1px solid rgba(17, 17, 17, 0.08);
  box-shadow: 0 18px 40px rgba(17, 17, 17, 0.08);
  cursor: pointer;
  transition: box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mindmap-root:hover,
.mindmap-branch:hover {
  box-shadow: 0 22px 44px rgba(17, 17, 17, 0.12);
}

.mindmap-root {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(250px, 29%, 320px);
  min-height: 176px;
  padding: 22px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(246, 196, 69, 0.28), transparent 42%),
    linear-gradient(135deg, rgba(255, 249, 241, 0.98), rgba(231, 247, 247, 0.92));
}

.mindmap-root.is-focused {
  border-color: rgba(227, 100, 20, 0.28);
  box-shadow: 0 28px 52px rgba(227, 100, 20, 0.16);
}

.mindmap-root-badge,
.sop-focus-label {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mindmap-root strong {
  display: block;
  margin-top: 12px;
  font-size: 1.34rem;
  line-height: 1.1;
}

.mindmap-root p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.mindmap-root-stats,
.mindmap-branch-meta,
.sop-focus-meta,
.sop-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mindmap-root-stats {
  margin-top: 14px;
}

.mindmap-root-stats span,
.mindmap-branch-meta span,
.sop-focus-meta span {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  font-size: 0.8rem;
  font-weight: 800;
}

.mindmap-branch {
  width: clamp(180px, 22%, 222px);
  min-height: 148px;
  padding: 16px;
  border-radius: 24px;
}

.mindmap-branch.is-focused {
  border-color: rgba(227, 100, 20, 0.32);
  box-shadow: 0 24px 46px rgba(227, 100, 20, 0.16);
}

.mindmap-branch-index,
.mindmap-branch small {
  display: block;
  color: var(--ink-soft);
  font-weight: 800;
}

.mindmap-branch-index {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mindmap-branch-head {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mindmap-branch-head strong {
  font-size: 1.02rem;
  line-height: 1.2;
}

.mindmap-branch-state {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  font-size: 0.76rem;
  font-weight: 900;
}

.mindmap-branch p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.mindmap-branch-meta {
  margin-top: 12px;
}

.mindmap-branch small {
  margin-top: 12px;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.branch-top {
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.branch-left-top {
  top: 132px;
  left: 22px;
}

.branch-right-top {
  top: 132px;
  right: 22px;
}

.branch-left-bottom {
  bottom: 112px;
  left: 72px;
}

.branch-right-bottom {
  bottom: 112px;
  right: 72px;
}

.branch-bottom {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.sop-focus-panel {
  margin-top: 14px;
}

.sop-focus-card {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(247, 240, 228, 0.94));
}

.sop-focus-card strong {
  display: block;
  margin-top: 12px;
  font-size: 1.1rem;
}

.sop-focus-card p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.sop-focus-meta,
.sop-focus-actions {
  margin-top: 14px;
}

.sop-focus-note {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sop-focus-note p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(17, 17, 17, 0.04);
}

.sop-inline-editor {
  margin-top: 12px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(247, 240, 228, 0.96));
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.sop-inline-editor-head,
.inline-config-head,
.inline-config-section header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.sop-inline-editor-head span,
.inline-config-section header span {
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
}

.inline-config-section {
  margin-top: 12px;
}

.inline-config-section header {
  margin-bottom: 10px;
}

.inline-config-list {
  display: grid;
  gap: 10px;
}

.inline-config-item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(17, 17, 17, 0.06);
}

.inline-config-head code {
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(17, 17, 17, 0.06);
  font-size: 0.76rem;
}

.inline-config-item p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.config-editor-field.inline {
  margin-top: 10px;
}

.config-item-actions.compact {
  margin-top: 10px;
}

.config-focus-rail {
  margin: 14px 0 12px;
}

.config-focus-banner {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(231, 247, 247, 0.94));
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.config-focus-banner span {
  display: inline-flex;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.config-focus-banner strong {
  display: block;
  margin-top: 8px;
  font-size: 1.02rem;
}

.config-focus-banner p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.config-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tab-button.focus-linked {
  border-color: rgba(227, 100, 20, 0.24);
  background: rgba(227, 100, 20, 0.08);
}

.panel-tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  color: var(--ink-soft);
}

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

.metric-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(247, 240, 228, 0.94));
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.metric-card span {
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  font-family: "Arial Narrow", "Avenir Next Condensed", sans-serif;
}

.metric-card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.pipeline-track {
  display: grid;
  gap: 12px;
}

.pipeline-node {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: rgba(17, 17, 17, 0.03);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.pipeline-node.active {
  background: linear-gradient(135deg, rgba(23, 126, 137, 0.14), rgba(255, 249, 241, 0.92));
  border-color: rgba(23, 126, 137, 0.2);
}

.node-index {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 900;
  background: var(--ink);
  color: #fffdf9;
}

.pipeline-node h4,
.pipeline-node p,
.log-list,
.review-list,
.rule-rows,
.manual-list {
  margin: 0;
}

.pipeline-node h4 {
  font-size: 1rem;
}

.pipeline-node p {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.node-state {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--teal);
}

.log-list,
.review-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.log-list li,
.review-list li {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(17, 17, 17, 0.04);
  border-left: 4px solid var(--ember);
}

.log-list small,
.review-list small,
.support-text {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.upload-shell {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 16px;
  margin-bottom: 20px;
}

.dropzone {
  min-height: 220px;
  border-radius: 24px;
  border: 2px dashed rgba(17, 17, 17, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(135deg, rgba(23, 126, 137, 0.08), rgba(255, 249, 241, 0.94));
}

.composer-zone {
  align-items: stretch;
  justify-content: flex-start;
  padding: 18px;
}

.excel-import-card {
  width: 100%;
  padding: 18px;
  border-radius: 20px;
  border: 2px dashed rgba(23, 126, 137, 0.24);
  background: rgba(255, 255, 255, 0.66);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.excel-import-card.dragover {
  border-color: rgba(227, 100, 20, 0.5);
  background: rgba(255, 244, 235, 0.92);
  transform: translateY(-1px);
}

.excel-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.file-hint {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(17, 17, 17, 0.12);
}

.composer-grid,
.batch-meta-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.batch-meta-grid {
  margin-top: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(23, 126, 137, 0.42);
  box-shadow: 0 0 0 3px rgba(23, 126, 137, 0.12);
}

.field.span-2 {
  grid-column: span 2;
}

.composer-actions,
.batch-action-row,
.preview-meta,
.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.composer-actions,
.batch-action-row,
.review-actions {
  margin-top: 16px;
}

.preview-meta {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.preview-meta strong {
  color: var(--ink);
}

.primary-button.small,
.ghost-button.small,
.inline-action.small {
  padding: 10px 14px;
  font-size: 0.88rem;
}

.dropzone strong {
  font-size: 1.16rem;
}

.dropzone span,
.upload-copy p,
.access-card p,
.rule-card p,
.manual-item p,
.history-card p {
  color: var(--ink-soft);
  line-height: 1.7;
}

.upload-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(227, 100, 20, 0.1);
  color: var(--ember-deep);
}

.upload-copy h3 {
  margin: 16px 0 10px;
  font-size: 1.6rem;
}

.meter {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(17, 17, 17, 0.08);
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--ember));
  transition: width 320ms ease;
}

.table-shell {
  overflow-x: auto;
}

.table-shell table {
  width: 100%;
  border-collapse: collapse;
}

.table-shell th,
.table-shell td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  vertical-align: top;
}

.table-shell th {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(23, 126, 137, 0.12);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
}

.state-pill.pending {
  background: rgba(17, 17, 17, 0.08);
  color: var(--ink);
}

.state-pill.error {
  background: rgba(227, 100, 20, 0.14);
  color: var(--ember-deep);
}

.state-pill.ok {
  background: rgba(23, 126, 137, 0.14);
  color: var(--teal);
}

.inline-action {
  border: 1px solid rgba(17, 17, 17, 0.12);
  background: rgba(17, 17, 17, 0.04);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.inline-action:hover {
  background: rgba(17, 17, 17, 0.08);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.empty-row {
  color: var(--ink-soft);
  text-align: center;
}

.empty-row td {
  padding: 28px 12px;
}

.feedback-error {
  color: var(--ember-deep);
}

.feedback-ok {
  color: var(--teal);
}

.step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.step-list li {
  position: relative;
  padding: 16px 16px 16px 58px;
  border-radius: var(--radius-lg);
  background: rgba(17, 17, 17, 0.04);
}

.step-list li::before {
  content: attr(data-step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #fffdf9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
}

.step-list strong {
  display: block;
}

.history-cards,
.rule-rows,
.manual-list {
  display: grid;
  gap: 14px;
}

.history-card,
.rule-card,
.manual-item {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(17, 17, 17, 0.04);
}

.history-card {
  border: 1px solid transparent;
}

button.history-card {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

button.history-card:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 126, 137, 0.24);
}

button.history-card.selected {
  border-color: rgba(227, 100, 20, 0.28);
  background: linear-gradient(135deg, rgba(227, 100, 20, 0.1), rgba(255, 249, 241, 0.92));
}

.history-card header,
.rule-card header,
.manual-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-card strong,
.rule-card strong,
.manual-item strong {
  font-size: 1rem;
}

.history-card .kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.detail-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-card,
.empty-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(17, 17, 17, 0.04);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.detail-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.detail-card p,
.empty-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.detail-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.detail-kpis span {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.84rem;
  font-weight: 800;
}

.status-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.log-timeline {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.log-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 17, 17, 0.06);
}

.log-item-head,
.log-item-meta,
.listing-preview-head-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.log-item-head {
  justify-content: space-between;
}

.log-item p,
.log-item small {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.listing-preview-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.listing-preview-list li {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 17, 17, 0.06);
}

.listing-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.listing-preview-head strong {
  display: block;
  font-size: 0.96rem;
}

.listing-preview-head code {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
}

.listing-preview-note {
  margin-top: 10px;
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.55;
}

.mono {
  font-family: "Consolas", "SFMono-Regular", monospace;
}

.listing-preview-body {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.listing-preview-body p {
  margin: 0;
  display: grid;
  gap: 4px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.listing-preview-body span {
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.listing-preview-list code {
  color: var(--ink-soft);
}

.kpi-row span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
  font-weight: 800;
}

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-button {
  border: 1px solid rgba(17, 17, 17, 0.1);
  background: rgba(17, 17, 17, 0.03);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.tab-button.active {
  background: var(--ink);
  color: #fffdf9;
}

.config-detail {
  display: grid;
  gap: 12px;
}

.config-editor-field {
  margin-top: 12px;
}

.config-editor-field textarea,
.config-editor-field input,
.config-editor-field select {
  width: 100%;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}

.config-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.config-item {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(247, 240, 228, 0.96));
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.config-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.config-item code {
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.06);
}

.access-grid {
  display: grid;
  gap: 12px;
}

.access-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.access-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.support-inline {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.access-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(23, 126, 137, 0.08), rgba(255, 249, 241, 1));
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.access-card span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 900;
}

.access-card strong {
  display: block;
  font-size: 1.2rem;
}

.rule-card {
  border-left: 5px solid var(--ink);
}

.rule-card.high { border-left-color: var(--ember); }
.rule-card.medium { border-left-color: var(--butter); }
.rule-card.low { border-left-color: var(--teal); }

.rules-toolbar,
.rule-card-actions,
.rule-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.rules-toolbar {
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 800;
}

.rules-toolbar span,
.rule-meta-row span,
.rule-meta-row code {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.rule-meta-row {
  margin-top: 12px;
}

.rule-form {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.rule-form strong {
  display: block;
  font-size: 1rem;
}

.rule-form-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.rule-tags span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  font-size: 0.78rem;
  font-weight: 800;
}

.manual-markdown-preview {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 17, 17, 0.08);
  color: var(--ink-soft);
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: "Consolas", "SFMono-Regular", monospace;
}

.footer {
  margin: 0 28px 28px;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .flowmap-head {
    flex-direction: column;
  }

  .flowmap-head-meta {
    justify-content: flex-start;
  }

  .flowmap-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .flow-arrow,
  .flow-spacer {
    min-height: 30px;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }

  .flow-arrow.vertical {
    transform: none;
  }

  .mindmap-canvas {
    min-height: auto;
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .mindmap-toolbar {
    position: static;
    padding: 0;
    pointer-events: auto;
  }

  .mindmap-viewport {
    position: static;
    overflow: visible;
  }

  .mindmap-scene {
    position: static;
    transform: none !important;
  }

  .mindmap-lines {
    display: none;
  }

  .mindmap-root,
  .mindmap-branch {
    position: static;
    width: auto;
    min-width: 0;
    min-height: 0;
    transform: none;
  }

  .hero,
  .sop-layout,
  .dashboard-grid,
  .batch-grid,
  .history-grid,
  .rules-grid,
  .config-layout,
  .upload-shell,
  .composer-grid,
  .batch-meta-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .sop-side-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .topbar,
  .section-head,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    justify-content: flex-start;
  }

  main {
    padding: 18px;
  }

  .hero-copy,
  .panel,
  .footer {
    padding: 20px;
  }

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

  .sop-stage-grid,
  .sop-quick-actions,
  .sop-config-strip,
  .sop-batch-stats,
  .sop-node-metrics {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }

  .field.span-2 {
    grid-column: auto;
  }
}

@media (min-width: 1181px) {
  body {
    overflow: hidden;
  }

  .nav-links a[href="#dashboard"] {
    display: none;
  }

  .mindboard-main {
    display: grid;
    grid-template-columns: 350px minmax(620px, 1fr) 380px;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    height: calc(100vh - var(--topbar-height) - 24px);
    padding: 16px 20px 20px;
    overflow: hidden;
    align-items: stretch;
  }

  .mindboard-main > section {
    margin: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .hero,
  .dashboard-archive,
  .footer {
    display: none;
  }

  #new-batch {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  #sop {
    grid-column: 2;
    grid-row: 1;
  }

  #history {
    grid-column: 2;
    grid-row: 2;
  }

  #config {
    grid-column: 3;
    grid-row: 1;
  }

  #rules {
    grid-column: 3;
    grid-row: 2;
  }

  #new-batch .section-head,
  #sop .section-head,
  #history .section-head,
  #config .section-head,
  #rules .section-head {
    margin-bottom: 10px;
    flex: 0 0 auto;
  }

  #new-batch .section-head h2,
  #sop .section-head h2,
  #history .section-head h2,
  #config .section-head h2,
  #rules .section-head h2 {
    max-width: none;
    font-size: 1.62rem;
    line-height: 1.02;
  }

  #new-batch .batch-grid,
  #history .history-grid,
  #config .config-layout,
  #rules .rules-grid {
    flex: 1;
    min-height: 0;
    grid-template-columns: 1fr;
  }

  #new-batch .batch-grid {
    grid-template-rows: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 0.55fr);
  }

  #history .history-grid {
    grid-template-rows: minmax(0, 0.78fr) minmax(0, 1.22fr);
  }

  #config .config-layout {
    grid-template-rows: minmax(0, 1.02fr) minmax(0, 0.98fr);
  }

  #rules .rules-grid {
    grid-template-rows: minmax(0, 1.06fr) minmax(0, 0.94fr);
  }

  #new-batch .panel,
  #history .panel,
  #config .panel,
  #rules .panel,
  #sop .panel {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }

  #new-batch .upload-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  #new-batch .uploader-panel,
  #new-batch .preview-panel,
  #new-batch .steps-panel {
    padding: 18px;
  }

  #new-batch .composer-zone {
    min-height: auto;
  }

  #new-batch .composer-grid,
  #new-batch .batch-meta-grid,
  #new-batch .rule-form-grid {
    grid-template-columns: 1fr;
  }

  #new-batch .field.span-2 {
    grid-column: auto;
  }

  #new-batch .dropzone strong {
    font-size: 1rem;
  }

  #new-batch .upload-copy h3 {
    font-size: 1.25rem;
    margin: 10px 0 8px;
  }

  #sop .sop-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
    min-height: 0;
  }

  #sop .sop-summary-card {
    padding: 16px;
  }

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

  #sop .metric-card {
    padding: 14px;
  }

  #sop .metric-card strong {
    font-size: 1.5rem;
  }

  #sop .pipeline-track.compact,
  #sop .log-list.compact {
    gap: 8px;
  }

  #sop .pipeline-node,
  #sop .log-list.compact li {
    padding: 10px 12px;
  }

  #sop .pipeline-node p,
  #sop .log-list.compact small {
    font-size: 0.8rem;
  }

  #sop .sop-layout {
    flex: 1;
    min-height: 0;
    grid-template-columns: 1.12fr 0.88fr;
  }

  #sop .sop-stage-panel,
  #sop .sop-side-panel {
    position: static;
  }

  #sop .sop-stage-grid {
    display: block;
    min-height: auto;
  }

  #sop .sop-quick-actions,
  #sop .sop-config-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #sop .sop-batch-card,
  #sop .sop-config-card {
    padding: 14px;
  }

  #history .history-panel,
  #history .review-panel,
  #config .tabs-panel,
  #config .access-panel,
  #rules .rules-panel,
  #rules .fields-panel {
    padding: 18px;
  }

  #history .history-card,
  #history .detail-card,
  #history .empty-card,
  #rules .rule-card,
  #rules .manual-item,
  #config .config-item,
  #config .access-card {
    padding: 14px;
  }

  #history .listing-preview-list,
  #history .log-timeline,
  #rules .rule-rows,
  #rules .manual-list,
  #config .config-detail {
    gap: 10px;
  }

  #config .tab-strip {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 10px;
    background: rgba(255, 249, 241, 0.92);
  }

  #config .access-grid {
    grid-template-columns: 1fr;
  }

  #rules .manual-markdown-preview {
    max-height: 240px;
    overflow: auto;
  }
}

/* 2026-04 Reset: stable single-page workspace */
body.ops-reset {
  overflow: auto !important;
  background: #f4efe6;
}

body.ops-reset .hero,
body.ops-reset .dashboard-archive,
body.ops-reset .footer {
  display: none !important;
}

body.ops-reset .noise {
  opacity: 0.12;
}

body.ops-reset main.ops-shell {
  padding: 16px;
  display: grid;
  grid-template-columns: 360px minmax(560px, 1fr) 420px;
  gap: 16px;
  min-height: calc(100vh - var(--topbar-height));
}

body.ops-reset .ops-column {
  min-height: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}

body.ops-reset .ops-column-left {
  grid-template-rows: minmax(0, 1.35fr) minmax(0, 0.95fr);
}

body.ops-reset .ops-column-center {
  grid-template-rows: minmax(0, 0.65fr) minmax(0, 1fr) minmax(0, 1.2fr);
}

body.ops-reset .ops-column-right {
  grid-template-rows: minmax(0, 1fr) minmax(0, 0.82fr) minmax(0, 1fr) minmax(0, 0.9fr);
}

body.ops-reset .ops-panel {
  min-height: 0;
  overflow: hidden;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

body.ops-reset .ops-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

body.ops-reset .ops-panel-head.small-gap {
  margin-bottom: 10px;
}

body.ops-reset .ops-panel-head h2,
body.ops-reset .ops-panel-head h3 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.05;
}

body.ops-reset .ops-head-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.ops-reset .ops-head-status span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

body.ops-reset .uploader-panel-body,
body.ops-reset .history-stack-layout,
body.ops-reset .config-detail,
body.ops-reset .rule-rows,
body.ops-reset .manual-list {
  min-height: 0;
  overflow: auto;
}

body.ops-reset .uploader-panel-body {
  display: grid;
  gap: 14px;
}

body.ops-reset .compact-shell,
body.ops-reset .history-stack-layout,
body.ops-reset .review-list,
body.ops-reset .detail-stack,
body.ops-reset .config-detail,
body.ops-reset .rule-rows,
body.ops-reset .manual-list,
body.ops-reset .manual-markdown-preview,
body.ops-reset .access-form {
  overflow: auto;
}

body.ops-reset .overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

body.ops-reset .overview-block {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(17, 17, 17, 0.03);
  border: 1px solid rgba(17, 17, 17, 0.07);
}

body.ops-reset .overview-block h4 {
  margin: 0;
  font-size: 0.98rem;
}

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

body.ops-reset .metric-card {
  padding: 12px;
}

body.ops-reset .metric-card strong {
  font-size: 1.45rem;
}

body.ops-reset .pipeline-track.compact,
body.ops-reset .log-list.compact {
  gap: 8px;
}

body.ops-reset .pipeline-track.compact,
body.ops-reset .log-list.compact,
body.ops-reset .history-cards,
body.ops-reset .review-list,
body.ops-reset .detail-stack,
body.ops-reset .config-detail,
body.ops-reset .rule-rows,
body.ops-reset .manual-list {
  min-height: 0;
}

body.ops-reset .pipeline-node,
body.ops-reset .log-list li,
body.ops-reset .history-card,
body.ops-reset .detail-card,
body.ops-reset .empty-card,
body.ops-reset .config-item,
body.ops-reset .rule-card,
body.ops-reset .manual-item,
body.ops-reset .access-card,
body.ops-reset .listing-preview-list li {
  box-shadow: none;
}

body.ops-reset .flow-panel-main {
  gap: 14px;
}

body.ops-reset .sop-stage-grid {
  min-height: 0;
}

body.ops-reset .flow-sequence-shell {
  display: grid;
  gap: 12px;
}

body.ops-reset .flow-sequence-intro {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(23, 126, 137, 0.08);
  border: 1px solid rgba(23, 126, 137, 0.16);
}

body.ops-reset .flow-sequence-intro strong {
  display: block;
  font-size: 1rem;
}

body.ops-reset .flow-sequence-intro p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

body.ops-reset .flow-sequence {
  display: grid;
  gap: 0;
}

body.ops-reset .flow-sequence-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

body.ops-reset .flow-sequence-link span {
  width: 2px;
  height: 24px;
  background: rgba(23, 126, 137, 0.35);
}

body.ops-reset .flow-sequence-link small {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.ops-reset .flow-node {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
  appearance: none;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

body.ops-reset .flow-node:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 126, 137, 0.24);
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08);
}

body.ops-reset .flow-node.is-focused {
  border-color: rgba(227, 100, 20, 0.3);
  box-shadow: 0 16px 30px rgba(227, 100, 20, 0.12);
}

body.ops-reset .flow-node-top,
body.ops-reset .flow-runtime-grid,
body.ops-reset .history-stack-layout {
  display: grid;
  gap: 12px;
}

body.ops-reset .flow-node-top {
  grid-template-columns: auto auto;
  justify-content: space-between;
  align-items: center;
}

body.ops-reset .flow-node-index,
body.ops-reset .flow-node-state,
body.ops-reset .sop-batch-label,
body.ops-reset .sop-focus-label,
body.ops-reset .config-focus-banner span {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.ops-reset .flow-node strong,
body.ops-reset .sop-batch-card strong,
body.ops-reset .sop-focus-card strong {
  font-size: 1.05rem;
}

body.ops-reset .flow-node p,
body.ops-reset .sop-batch-card p,
body.ops-reset .sop-focus-card p,
body.ops-reset .config-focus-banner p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

body.ops-reset .flow-node-meta,
body.ops-reset .sop-batch-note,
body.ops-reset .sop-focus-meta,
body.ops-reset .sop-focus-actions,
body.ops-reset .flow-node-actions,
body.ops-reset .flow-sequence-summary,
body.ops-reset .flow-sequence-summary div,
body.ops-reset .config-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.ops-reset .flow-node-meta span,
body.ops-reset .sop-batch-note span,
body.ops-reset .sop-focus-meta span,
body.ops-reset .flow-sequence-summary div {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  font-size: 0.78rem;
  font-weight: 800;
}

body.ops-reset .flow-node-actions {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

body.ops-reset .flow-sequence-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body.ops-reset .flow-sequence-summary div {
  display: grid;
  gap: 4px;
  border-radius: 14px;
}

body.ops-reset .flow-sequence-summary span {
  color: var(--ink-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  font-weight: 900;
}

body.ops-reset .flow-sequence-summary strong {
  font-size: 1rem;
}

body.ops-reset .flow-runtime-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.ops-reset .sop-batch-card,
body.ops-reset .sop-focus-card,
body.ops-reset .sop-inline-editor,
body.ops-reset .config-focus-banner {
  padding: 14px;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.03);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

body.ops-reset .sop-inline-editor {
  margin-top: 12px;
}

body.ops-reset .sop-inline-editor-head,
body.ops-reset .inline-config-head,
body.ops-reset .inline-config-section header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

body.ops-reset .inline-config-list {
  display: grid;
  gap: 10px;
}

body.ops-reset .inline-config-item {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(17, 17, 17, 0.06);
}

body.ops-reset .sop-quick-actions,
body.ops-reset .sop-config-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

body.ops-reset .sop-config-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(17, 17, 17, 0.07);
}

body.ops-reset .sop-config-card strong {
  display: block;
  margin-top: 6px;
  font-size: 0.96rem;
}

body.ops-reset .sop-config-card p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

body.ops-reset .sop-config-card.focused {
  border-color: rgba(23, 126, 137, 0.22);
  background: rgba(23, 126, 137, 0.08);
}

body.ops-reset .history-stack-layout {
  grid-template-rows: minmax(0, 0.9fr) minmax(0, 1.25fr) minmax(0, 0.85fr);
}

body.ops-reset .config-detail,
body.ops-reset .rule-rows,
body.ops-reset .manual-list,
body.ops-reset .manual-markdown-preview,
body.ops-reset .history-cards,
body.ops-reset .detail-stack,
body.ops-reset .review-list,
body.ops-reset .access-form {
  flex: 1;
}

body.ops-reset .table-shell.compact-shell {
  flex: 1;
}

body.ops-reset .preview-meta {
  margin: 0;
}

body.ops-reset .manual-markdown-preview {
  margin-top: 12px;
}

body.ops-reset .dropzone.composer-zone {
  min-height: 0;
}

@media (max-width: 1380px) {
  body.ops-reset main.ops-shell {
    grid-template-columns: 330px minmax(440px, 1fr) 380px;
  }
}

@media (max-width: 1180px) {
  body.ops-reset main.ops-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  body.ops-reset .ops-column-left,
  body.ops-reset .ops-column-center,
  body.ops-reset .ops-column-right,
  body.ops-reset .overview-grid,
  body.ops-reset .flow-runtime-grid,
  body.ops-reset .sop-quick-actions,
  body.ops-reset .sop-config-strip,
  body.ops-reset .flow-sequence-summary {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  body.ops-reset .ops-panel,
  body.ops-reset .uploader-panel-body,
  body.ops-reset .config-detail,
  body.ops-reset .rule-rows,
  body.ops-reset .history-stack-layout,
  body.ops-reset .review-list,
  body.ops-reset .detail-stack,
  body.ops-reset .manual-list,
  body.ops-reset .manual-markdown-preview {
    overflow: visible;
  }
}

body.flow-reset {
  overflow: hidden;
}

body.flow-reset main.flow-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  gap: 18px;
  height: calc(100vh - var(--topbar-height));
  padding: 18px 22px 22px;
  overflow: hidden;
  transition: grid-template-columns 220ms ease;
}

body.flow-reset main.flow-home.drawer-open {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
}

body.flow-reset .flow-stage-shell,
body.flow-reset .flow-drawer {
  min-height: 0;
}

body.flow-reset .flow-stage-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
}

body.flow-reset .flow-stage-header.panel,
body.flow-reset .flow-status-strip.panel,
body.flow-reset .flow-drawer-head.panel,
body.flow-reset .flow-board.panel,
body.flow-reset .drawer-inner-panel.panel {
  padding: 18px 20px;
}

body.flow-reset .flow-stage-header,
body.flow-reset .flow-board-head,
body.flow-reset .drawer-section-head,
body.flow-reset .flow-drawer-head,
body.flow-reset .flow-stage-head,
body.flow-reset .sop-batch-head,
body.flow-reset .sop-inline-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body.flow-reset .flow-subtitle,
body.flow-reset .sop-runtime-message {
  margin: 10px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

body.flow-reset .flow-status-top {
  display: grid;
  gap: 8px;
  justify-items: end;
}

body.flow-reset .flow-status-top span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.06);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

body.flow-reset .flow-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body.flow-reset .flow-status-block {
  min-height: 0;
  display: grid;
  gap: 10px;
}

body.flow-reset .flow-status-block h3,
body.flow-reset .flow-board-head h2,
body.flow-reset .drawer-section-head h3 {
  margin: 0;
}

body.flow-reset .flow-board {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  overflow: hidden;
}

body.flow-reset .flow-board-canvas {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

body.flow-reset .flow-lane {
  display: grid;
  gap: 0;
}

body.flow-reset .flow-stage {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

body.flow-reset .flow-stage-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}

body.flow-reset .flow-stage-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(17, 17, 17, 0.15);
  background: #fffdf9;
  margin-top: 20px;
}

body.flow-reset .flow-stage-dot.state-running {
  border-color: rgba(23, 126, 137, 0.38);
  background: rgba(23, 126, 137, 0.2);
}

body.flow-reset .flow-stage-dot.state-completed {
  border-color: rgba(23, 126, 137, 0.42);
  background: rgba(23, 126, 137, 0.92);
}

body.flow-reset .flow-stage-dot.state-failed {
  border-color: rgba(227, 100, 20, 0.42);
  background: rgba(227, 100, 20, 0.88);
}

body.flow-reset .flow-stage-line {
  flex: 1;
  width: 2px;
  margin: 8px 0;
  background: linear-gradient(180deg, rgba(23, 126, 137, 0.45), rgba(17, 17, 17, 0.08));
}

body.flow-reset .flow-stage-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px 18px 16px;
  margin-bottom: 12px;
  border-radius: 22px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  background: rgba(255, 255, 255, 0.76);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

body.flow-reset .flow-stage-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(17, 17, 17, 0.08);
  border-color: rgba(23, 126, 137, 0.22);
}

body.flow-reset .flow-stage-card.is-focused {
  border-color: rgba(227, 100, 20, 0.36);
  box-shadow: 0 18px 40px rgba(227, 100, 20, 0.14);
}

body.flow-reset .flow-stage-card.state-running {
  border-color: rgba(23, 126, 137, 0.28);
  background: linear-gradient(135deg, rgba(23, 126, 137, 0.08), rgba(255, 255, 255, 0.8));
}

body.flow-reset .flow-stage-card.state-completed {
  background: linear-gradient(135deg, rgba(23, 126, 137, 0.06), rgba(255, 249, 241, 0.9));
}

body.flow-reset .flow-stage-card.state-failed {
  border-color: rgba(227, 100, 20, 0.28);
  background: linear-gradient(135deg, rgba(227, 100, 20, 0.08), rgba(255, 255, 255, 0.82));
}

body.flow-reset .flow-stage-main {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 8px;
}

body.flow-reset .flow-stage-main strong {
  font-size: 1.08rem;
}

body.flow-reset .flow-stage-main p,
body.flow-reset .sop-focus-note p,
body.flow-reset .sop-batch-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.58;
}

body.flow-reset .flow-stage-index,
body.flow-reset .flow-stage-runtime,
body.flow-reset .sop-batch-label,
body.flow-reset .sop-focus-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.flow-reset .flow-stage-index,
body.flow-reset .sop-batch-label,
body.flow-reset .sop-focus-label {
  background: rgba(17, 17, 17, 0.06);
  color: var(--ink-soft);
}

body.flow-reset .flow-stage-runtime {
  background: rgba(17, 17, 17, 0.05);
  color: var(--ink-soft);
}

body.flow-reset .flow-stage-runtime.state-running {
  background: rgba(23, 126, 137, 0.14);
  color: var(--teal);
}

body.flow-reset .flow-stage-runtime.state-completed {
  background: rgba(23, 126, 137, 0.12);
  color: var(--teal);
}

body.flow-reset .flow-stage-runtime.state-failed {
  background: rgba(227, 100, 20, 0.14);
  color: var(--ember-deep);
}

body.flow-reset .flow-stage-metrics,
body.flow-reset .sop-batch-note,
body.flow-reset .sop-focus-meta,
body.flow-reset .sop-focus-actions,
body.flow-reset .flow-hover-actions,
body.flow-reset .config-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.flow-reset .flow-stage-metrics span,
body.flow-reset .sop-batch-note span,
body.flow-reset .sop-focus-meta span {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  font-size: 0.78rem;
  font-weight: 800;
}

body.flow-reset .flow-stage-hover {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(17, 17, 17, 0.1);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

body.flow-reset .flow-stage-card:hover .flow-stage-hover,
body.flow-reset .flow-stage-card.is-focused .flow-stage-hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

body.flow-reset .flow-hover-label {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.flow-reset .flow-board-footer {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
}

body.flow-reset .flow-board-batch,
body.flow-reset .flow-board-focus {
  min-height: 0;
}

body.flow-reset .sop-batch-card,
body.flow-reset .sop-focus-card,
body.flow-reset .sop-inline-editor,
body.flow-reset .config-focus-banner {
  padding: 16px;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.03);
  border: 1px solid rgba(17, 17, 17, 0.08);
}

body.flow-reset .sop-batch-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

body.flow-reset .sop-batch-stats article {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 17, 17, 0.07);
}

body.flow-reset .sop-batch-stats span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.flow-reset .sop-batch-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 1.12rem;
}

body.flow-reset .sop-focus-card,
body.flow-reset .sop-inline-editor {
  display: grid;
  gap: 12px;
}

body.flow-reset .flow-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.flow-reset .flow-drawer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  overflow: hidden;
}

body.flow-reset .flow-drawer.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

body.flow-reset .flow-drawer-body {
  min-height: 0;
  overflow: hidden;
}

body.flow-reset .drawer-panel {
  display: none;
  height: 100%;
  min-height: 0;
  gap: 14px;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

body.flow-reset .drawer-panel.active {
  display: grid;
}

body.flow-reset .drawer-inner-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

body.flow-reset .config-focus-rail,
body.flow-reset .table-shell.compact-shell,
body.flow-reset .history-cards,
body.flow-reset .detail-stack,
body.flow-reset .review-list,
body.flow-reset .config-detail,
body.flow-reset .rule-rows,
body.flow-reset .manual-list,
body.flow-reset .manual-markdown-preview,
body.flow-reset .uploader-panel-body,
body.flow-reset .access-form {
  min-height: 0;
  overflow: auto;
}

body.flow-reset .preview-meta {
  margin: 0;
}

body.flow-reset .sop-node-alert {
  border-left: 5px solid var(--ember);
}

body.flow-reset .sop-node-live {
  border-left: 5px solid var(--teal);
}

body.flow-reset .sop-node-ok {
  border-left: 5px solid var(--mint);
}

body.flow-reset .sop-node-muted {
  border-left: 5px solid rgba(17, 17, 17, 0.1);
}

body.flow-reset .pipeline-node.danger {
  border-color: rgba(227, 100, 20, 0.24);
}

@media (max-width: 1320px) {
  body.flow-reset main.flow-home.drawer-open {
    grid-template-columns: minmax(0, 1fr) 380px;
  }

  body.flow-reset .flow-status-strip,
  body.flow-reset .flow-board-footer,
  body.flow-reset .sop-batch-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  body.flow-reset {
    overflow: auto;
  }

  body.flow-reset main.flow-home,
  body.flow-reset main.flow-home.drawer-open {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  body.flow-reset .flow-stage-shell,
  body.flow-reset .flow-drawer,
  body.flow-reset .flow-board,
  body.flow-reset .drawer-panel,
  body.flow-reset .drawer-inner-panel {
    overflow: visible;
  }

  body.flow-reset .flow-drawer {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  body.flow-reset .flow-drawer:not(.is-open) {
    display: none;
  }

  body.flow-reset .flow-status-strip,
  body.flow-reset .flow-board-footer {
    grid-template-columns: 1fr;
  }

  body.flow-reset .flow-stage-hover {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
