:root {
  --ink: #242521;
  --ink-soft: #5f625b;
  --paper: #f5f2ea;
  --paper-deep: #ebe6da;
  --white: #fffdf8;
  --line: #d9d5ca;
  --line-dark: #b8b6aa;
  --teal: #167d78;
  --teal-soft: #e0f0ec;
  --rust: #b85d3f;
  --rust-soft: #f7e5dc;
  --gold: #bd8619;
  --gold-soft: #f7eed7;
  --plum: #6e587e;
  --plum-soft: #eee8f2;
  --shadow: 0 18px 50px rgba(53, 48, 35, 0.08);
  --shadow-small: 0 7px 22px rgba(53, 48, 35, 0.07);
  font-family: "Inter", "Avenir Next", "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 0%, rgba(22, 125, 120, 0.1), transparent 27rem),
    radial-gradient(circle at 20% 24%, rgba(184, 93, 63, 0.07), transparent 23rem),
    var(--paper);
}

button { font: inherit; }

button:focus-visible {
  outline: 3px solid rgba(22, 125, 120, 0.35);
  outline-offset: 3px;
}

.app-shell { min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
  padding: 1rem clamp(1.2rem, 3.2vw, 3.5rem);
  background: rgba(250, 248, 242, 0.86);
  backdrop-filter: blur(16px);
}

.brand-lockup,
.topbar-meta,
.flow-actions,
.section-label,
.legend-row,
.flow-caption,
.metric-list > div {
  display: flex;
  align-items: center;
}

.brand-lockup { gap: 0.9rem; min-width: 0; }
.brand-lockup > div:last-child { min-width: 0; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1;
  text-align: center;
  aspect-ratio: 1 / 1;
}

.brand-mark span { color: var(--teal); font-size: 0.58rem; }

.kicker,
.eyebrow,
.node-code,
.section-label,
.path-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker { color: var(--teal); }

.topbar h1 {
  margin: 0.18rem 0 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(1.25rem, 2.1vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}
.mobile-title { display: none; }

.topbar-meta { gap: 0.6rem; }

.model-launch {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(22, 125, 120, 0.36);
  border-radius: 999px;
  padding: 0.48rem 0.7rem;
  color: #0e6965;
  background: linear-gradient(135deg, #e8f4f0, #f6faf5);
  font-size: 0.69rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 7px 18px rgba(22, 125, 120, 0.12);
  transition: 160ms ease;
}

.model-launch:hover {
  border-color: var(--teal);
  color: #07514e;
  background: var(--teal-soft);
  transform: translateY(-1px);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.32rem 0.68rem;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.72);
  font-size: 0.72rem;
  white-space: nowrap;
}

.meta-pill.accent { border-color: rgba(22, 125, 120, 0.34); color: var(--teal); background: var(--teal-soft); }
.journal-link { color: var(--ink-soft); text-decoration: none; }
.journal-link:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

.icon-button,
.small-button {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.7);
  cursor: pointer;
  transition: 160ms ease;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  font-size: 0.77rem;
}

.icon-button:hover,
.small-button:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

.workspace {
  display: grid;
  grid-template-columns: 240px minmax(600px, 1fr) 410px;
  min-height: calc(100vh - 86px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 2rem 1.25rem 1.25rem;
  background: rgba(239, 235, 225, 0.45);
}

.sidebar-intro h2 {
  margin: 0.65rem 0 0.8rem;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 1.68rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.055em;
}

.sidebar-intro > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.7;
}

.sidebar-section { margin-top: 2rem; }
.sidebar > .sidebar-section:first-child { margin-top: 0; }

.section-label {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.62rem;
  color: var(--ink);
}

.section-label span { color: var(--teal); }

.route-list { display: grid; gap: 0.18rem; margin-top: 0.65rem; }

.route-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 0;
  border-radius: 8px;
  padding: 0.42rem 0.45rem;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: 150ms ease;
}

.route-item:hover,
.route-item.is-active { color: var(--teal); background: var(--teal-soft); }

.route-index {
  display: grid;
  flex: 0 0 22px;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.64rem;
  font-weight: 800;
}

.route-item span:last-child { font-size: 0.79rem; }

.legend-section { margin-top: 1.55rem; }
.legend-row { gap: 0.55rem; margin-top: 0.62rem; color: var(--ink-soft); font-size: 0.76rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-dark); }
.legend-dot.input { background: var(--teal); }
.legend-dot.decision { background: var(--rust); transform: rotate(45deg); border-radius: 2px; }
.legend-dot.model { background: var(--plum); }
.legend-dot.evidence { background: var(--gold); }

.metric-list { display: grid; gap: 0.58rem; margin-top: 0.78rem; }
.metric-list > div { justify-content: space-between; gap: 0.5rem; }
.metric-list strong { color: var(--rust); font-family: Georgia, serif; font-size: 1.45rem; font-weight: 600; }
.metric-list span { color: var(--ink-soft); font-size: 0.73rem; text-align: right; }
.sidebar-note { margin: 0.7rem 0 0; color: var(--ink-soft); font-size: 0.71rem; line-height: 1.55; }
.sidebar-footer { margin-top: auto; padding-top: 2rem; color: #8a8a80; font-size: 0.69rem; line-height: 1.55; }

.flow-section { min-width: 0; padding: 2rem 1.3rem 2rem; }

.flow-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; max-width: 980px; margin: 0 auto; }
.eyebrow { display: flex; align-items: center; gap: 0.48rem; color: var(--teal); }
.eyebrow-line { display: inline-block; width: 24px; height: 1px; background: currentColor; }
.flow-header h2 { margin: 0.55rem 0 0; font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif; font-size: clamp(1.6rem, 3vw, 2.45rem); font-weight: 500; letter-spacing: -0.065em; }
.flow-actions { gap: 0.45rem; }
.small-button { border-radius: 999px; padding: 0.4rem 0.65rem; font-size: 0.71rem; }

.model-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 980px;
  margin: 1rem auto 0;
  border: 1px solid rgba(22, 125, 120, 0.25);
  border-left: 4px solid var(--teal);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  background: linear-gradient(110deg, rgba(232, 244, 240, 0.96), rgba(255, 253, 248, 0.96));
  box-shadow: 0 10px 24px rgba(22, 125, 120, 0.08);
}

.model-banner span {
  display: block;
  color: var(--teal);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.model-banner strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink);
  font-size: 0.9rem;
}

.model-banner p {
  margin: 0.22rem 0 0;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.model-banner a {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.58rem 0.8rem;
  color: #fff;
  background: var(--teal);
  font-size: 0.68rem;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 7px 16px rgba(22, 125, 120, 0.2);
}

.model-banner a:hover { background: #0e6965; }

.flow-caption { justify-content: space-between; gap: 1rem; max-width: 980px; margin: 1.05rem auto 0; border-top: 1px solid var(--line); padding-top: 0.7rem; color: #808076; font-size: 0.72rem; }
.flow-caption b { color: var(--ink-soft); }
.zoom-status { border-left: 1px solid var(--line); padding-left: 0.8rem; color: var(--teal); font-variant-numeric: tabular-nums; }

.flow-viewport { max-width: 980px; height: calc(100vh - 260px); min-height: 630px; margin: 0.4rem auto 0; overflow: auto; overscroll-behavior: contain; }
.flow-canvas { min-width: 830px; padding: 1.8rem 1.5rem 3rem; transform-origin: top center; transition: transform 180ms ease; }
.flow-mainline { display: flex; flex-direction: column; align-items: center; }

.flow-node,
.decision-node {
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease, opacity 170ms ease;
}

.flow-node { position: relative; display: flex; flex-direction: column; align-items: flex-start; width: 292px; border: 1px solid var(--line); border-radius: 14px; padding: 0.88rem 1rem; color: var(--ink); background: var(--white); box-shadow: var(--shadow-small); }
.flow-node:hover,
.flow-node.is-selected { z-index: 2; border-color: var(--teal); box-shadow: 0 14px 30px rgba(22, 125, 120, 0.16); transform: translateY(-3px); }
.framework-card.is-selected,
.test-card.is-selected { border-color: var(--teal); box-shadow: 0 10px 24px rgba(22, 125, 120, 0.14); transform: translateY(-2px); }
.flow-node.is-dimmed,
.decision-node.is-dimmed { opacity: 0.28; }
.flow-node strong { margin-top: 0.35rem; font-size: 0.98rem; font-weight: 750; line-height: 1.35; }
.node-code { color: var(--teal); font-size: 0.58rem; }
.node-summary { margin-top: 0.32rem; color: var(--ink-soft); font-size: 0.74rem; line-height: 1.5; }
.flow-node em { margin-top: 0.55rem; border-top: 1px solid rgba(110, 88, 126, 0.18); padding-top: 0.48rem; color: var(--plum); font-size: 0.69rem; font-style: normal; font-weight: 700; }

.input-node { border-top: 3px solid var(--teal); }
.process-node { border-top: 3px solid var(--rust); }
.feature-node { border-top: 3px solid var(--gold); }
.model-node { width: 190px; min-height: 152px; border-top: 3px solid var(--plum); background: #fcfafc; }
.model-node strong { font-size: 0.93rem; }
.output-node { border-top: 3px solid var(--teal); background: #eff7f3; }
.evidence-node { border-top: 3px solid var(--gold); background: #fffaf0; }
.stop-node { border-top: 3px solid #9b9d93; background: #f1f0eb; }
.end-node { border: 1px solid var(--teal); background: var(--teal-soft); box-shadow: 0 14px 30px rgba(22, 125, 120, 0.1); }
.end-node .node-code { color: var(--teal); }

.arrow { position: relative; display: flex; flex-direction: column; align-items: center; width: 1px; height: 54px; background: var(--line-dark); }
.arrow::after { position: absolute; bottom: -1px; content: ""; width: 8px; height: 8px; border-right: 1px solid var(--ink-soft); border-bottom: 1px solid var(--ink-soft); transform: rotate(45deg); background: var(--paper); }
.arrow span { position: absolute; z-index: 1; top: 18px; left: 13px; width: max-content; color: #9a9a8f; font-size: 0.63rem; white-space: nowrap; }
.arrow span::before { content: ""; position: absolute; left: -6px; right: -6px; top: 0.5em; bottom: 0.5em; z-index: -1; background: var(--paper); }

.decision-block { position: relative; width: min(100%, 670px); }
.decision-node { display: grid; place-items: center; width: 128px; height: 92px; border: 1px solid var(--rust); padding: 1.35rem; color: var(--rust); background: var(--rust-soft); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); text-align: center; }
.decision-node span { font-size: 0.78rem; font-weight: 800; line-height: 1.35; transform: rotate(0); }
.decision-node:hover,
.decision-node.is-selected { box-shadow: 0 12px 24px rgba(184, 93, 63, 0.18); transform: scale(1.035); }
.decision-block > .decision-node { margin: 0 auto 0.3rem; }

.decision-paths { position: relative; display: grid; gap: 1.4rem; margin-top: 0.72rem; padding-top: 1rem; }
.decision-paths::before { position: absolute; top: 0; left: 25%; right: 25%; height: 1px; content: ""; background: var(--line-dark); }
.two-paths { grid-template-columns: 1fr 1fr; }
.path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.45rem; min-width: 0; }
.path::before { position: absolute; top: -1rem; width: 1px; height: 1rem; content: ""; background: var(--line-dark); }
.path-label { color: var(--rust); font-size: 0.58rem; white-space: nowrap; }
.path-no .path-label { color: #8b8e83; }
.compact-node { width: 260px; min-height: 135px; }

.merge-arrow { margin-top: 0.78rem; }
.merge-arrow span { top: 22px; }

.target-block { width: 100%; max-width: 860px; }
.task-branches { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.65rem; margin-top: 0.72rem; padding-top: 1.05rem; }
.task-branches::before { position: absolute; top: 0; left: 12.5%; right: 12.5%; height: 1px; content: ""; background: var(--line-dark); }
.task-path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.45rem; }
.task-path::before { position: absolute; top: -1.05rem; width: 1px; height: 1.05rem; content: ""; background: var(--line-dark); }
.task-path .path-label { color: var(--plum); font-size: 0.62rem; font-weight: 750; }
.model-node .node-code { font-size: 0.62rem; }
.model-node .node-summary { font-size: 0.78rem; }
.model-node em { font-size: 0.74rem; }
.task-classification { width: 100%; }
.classification-arrow { position: relative; display: flex; justify-content: center; width: 1px; height: 34px; margin: 0 auto; background: var(--line-dark); }
.classification-arrow::after { position: absolute; bottom: -1px; left: -3px; width: 8px; height: 8px; border-right: 1px solid var(--ink-soft); border-bottom: 1px solid var(--ink-soft); content: ""; transform: rotate(45deg); background: var(--plum-soft); }
.classification-arrow span { position: absolute; top: 7px; left: 11px; width: max-content; border-radius: 999px; padding: 0.2rem 0.36rem; color: var(--plum); background: var(--plum-soft); font-size: 0.68rem; font-weight: 750; white-space: nowrap; }
.classification-branches { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; margin-top: 0.05rem; padding-top: 0.78rem; }
.classification-branches::before { position: absolute; top: 0; left: 25%; right: 25%; height: 1px; content: ""; background: var(--line-dark); }
.classification-outcome { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 0.48rem 0.22rem 0.44rem; background: var(--white); text-align: center; }
.classification-outcome::before { position: absolute; top: -0.78rem; left: 50%; width: 1px; height: 0.78rem; content: ""; background: var(--line-dark); }
.classification-outcome::after { position: absolute; top: -0.18rem; left: calc(50% - 3px); width: 6px; height: 6px; border-right: 1px solid var(--ink-soft); border-bottom: 1px solid var(--ink-soft); content: ""; transform: rotate(45deg); background: var(--white); }
.classification-outcome b { font-size: 0.8rem; line-height: 1.2; }
.classification-outcome small { min-height: 1.7em; margin-top: 0.2rem; color: var(--ink-soft); font-size: 0.62rem; line-height: 1.35; white-space: normal; }
.classification-outcome.positive { border-color: rgba(184, 93, 63, 0.38); background: rgba(249, 237, 232, 0.78); }
.classification-outcome.positive b { color: var(--rust); }
.classification-outcome.negative { border-color: rgba(22, 125, 120, 0.3); background: rgba(239, 247, 243, 0.82); }
.classification-outcome.negative b { color: var(--teal); }

.merge-branch-arrow { position: relative; width: 1px; height: 72px; margin-top: 0.45rem; background: var(--line-dark); }
.merge-branch-arrow::after { position: absolute; bottom: -1px; left: -3px; content: ""; width: 8px; height: 8px; border-right: 1px solid var(--ink-soft); border-bottom: 1px solid var(--ink-soft); transform: rotate(45deg); background: var(--paper); }
.merge-branch-arrow span { position: absolute; top: 29px; left: 14px; width: max-content; color: #99998d; font-size: 0.63rem; white-space: nowrap; }
.merge-branch-arrow span::before { position: absolute; top: 0; right: -5px; bottom: 0; left: -5px; z-index: -1; content: ""; background: var(--paper); }

.validation-block { width: min(100%, 670px); margin-top: 0.05rem; }
.validation-block .decision-node { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.validation-block .path-label { color: var(--gold); }
.validation-block .path-no .path-label { color: #8b8e83; }
.validation-block + .end-node { margin-top: 1.35rem; }

.training-zone,
.test-zone {
  width: min(100%, 860px);
  border-radius: 20px;
  padding: 1.15rem;
}

.training-zone {
  border: 1px dashed rgba(110, 88, 126, 0.42);
  background: rgba(238, 232, 242, 0.38);
}

.prep-zone {
  width: min(100%, 860px);
  border: 1px dashed rgba(22, 125, 120, 0.42);
  border-radius: 20px;
  padding: 1.15rem;
  background: rgba(232, 244, 240, 0.46);
}

.prep-zone .zone-kicker,
.prep-zone .prep-step > span { color: var(--teal); }

.prep-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(22, 125, 120, 0.18);
  border-radius: 14px;
  padding: 0.72rem;
  background: rgba(255, 255, 255, 0.74);
}

.prep-step {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
  border: 1px solid rgba(22, 125, 120, 0.2);
  border-radius: 10px;
  padding: 0.55rem;
  background: var(--white);
}

.prep-step > span {
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.prep-step strong { font-size: 0.76rem; }
.prep-step small { color: var(--ink-soft); font-size: 0.62rem; line-height: 1.35; }

.prep-flow > i {
  position: relative;
  display: block;
  height: 1px;
  background: var(--line-dark);
}

.prep-flow > i::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 7px;
  height: 7px;
  border-top: 1px solid var(--ink-soft);
  border-right: 1px solid var(--ink-soft);
  content: "";
  transform: rotate(45deg);
}

.test-zone {
  border: 1px solid rgba(189, 134, 25, 0.42);
  background: rgba(247, 238, 215, 0.38);
}

.zone-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 1rem;
}

.zone-heading h3 {
  margin: 0.35rem 0 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.zone-heading p {
  max-width: 290px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: right;
}

.zone-kicker,
.framework-label,
.test-code {
  color: var(--plum);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.test-zone .zone-kicker,
.test-zone .test-code { color: var(--gold); }

.algorithm-frame {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) 42px minmax(170px, 1fr) 42px minmax(150px, 1fr);
  align-items: stretch;
  gap: 0.55rem;
  border: 1px solid rgba(110, 88, 126, 0.2);
  border-radius: 14px;
  padding: 0.85rem;
  background: rgba(255, 253, 248, 0.7);
}

.algorithm-column { display: flex; flex-direction: column; gap: 0.52rem; min-width: 0; }
.algorithm-column > strong { font-size: 0.78rem; }
.classifier-column { justify-content: flex-start; }
.framework-tags { display: flex; flex-wrap: wrap; gap: 0.32rem; align-content: flex-start; }
.framework-tags span { border: 1px solid rgba(110, 88, 126, 0.2); border-radius: 999px; padding: 0.32rem 0.46rem; color: var(--ink-soft); background: var(--plum-soft); font-size: 0.63rem; line-height: 1.1; }
.classifier-tags span { color: var(--plum); font-weight: 700; }

.framework-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.24rem;
  border: 1px solid rgba(22, 125, 120, 0.25);
  border-radius: 9px;
  padding: 0.52rem 0.58rem;
  color: var(--ink);
  background: var(--teal-soft);
  cursor: pointer;
  text-align: left;
  transition: 160ms ease;
}

.framework-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.framework-card b { font-size: 0.73rem; }
.framework-card small { color: var(--ink-soft); font-size: 0.62rem; line-height: 1.35; }
.framework-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; color: #99998e; font-size: 0.58rem; }
.framework-link i { position: relative; display: block; width: 100%; height: 1px; background: var(--line-dark); }
.framework-link i::after { position: absolute; top: -3px; right: 0; width: 7px; height: 7px; border-top: 1px solid var(--line-dark); border-right: 1px solid var(--line-dark); content: ""; transform: rotate(45deg); }
.framework-arrow { position: relative; display: flex; justify-content: center; width: 1px; height: 40px; margin: 0.3rem auto; background: var(--line-dark); }
.framework-arrow::after { position: absolute; bottom: -1px; width: 8px; height: 8px; border-right: 1px solid var(--ink-soft); border-bottom: 1px solid var(--ink-soft); content: ""; transform: rotate(45deg); background: var(--plum-soft); }
.framework-arrow span { position: absolute; top: 12px; left: 13px; width: max-content; color: var(--plum); font-size: 0.61rem; white-space: nowrap; }
.framework-result { display: flex; flex-direction: column; align-items: center; }
.framework-result-line { width: 1px; height: 20px; background: var(--line-dark); }
.benchmark-node { width: 300px; background: #fffaf0; }
.training-output-divider { display: flex; align-items: center; gap: 0.7rem; width: min(100%, 860px); margin: 1.25rem 0 0.95rem; color: var(--plum); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.13em; }
.training-output-divider::before,
.training-output-divider::after { flex: 1; height: 1px; border-top: 1px dashed rgba(110, 88, 126, 0.6); content: ""; }

.test-intro { width: 100%; border-top-color: var(--gold); }
.test-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.58rem; margin-top: 0.72rem; }
.test-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 134px; border: 1px solid rgba(189, 134, 25, 0.26); border-radius: 12px; padding: 0.72rem; color: var(--ink); background: rgba(255, 253, 248, 0.78); cursor: pointer; text-align: left; transition: 160ms ease; }
.test-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.test-card strong { margin-top: 0.35rem; font-size: 0.78rem; line-height: 1.35; }
.test-card b { margin-top: auto; color: var(--rust); font-family: Georgia, serif; font-size: 1.25rem; font-weight: 600; }
.test-card small { margin-top: 0.22rem; color: var(--ink-soft); font-size: 0.61rem; line-height: 1.4; }
.pending-test b { color: var(--gold); font-family: inherit; font-size: 0.75rem; }
.pending-test small { color: #8d8877; }

.detail-panel { position: sticky; top: 0; height: calc(100vh - 86px); max-height: calc(100vh - 86px); border-left: 1px solid var(--line); padding: 2rem 1.4rem; background: rgba(255, 253, 248, 0.54); overflow-y: auto; scrollbar-gutter: stable; }
.detail-content { padding-top: 0; }
.detail-content.is-empty { padding-top: 5rem; color: var(--ink-soft); text-align: center; }
.detail-code { color: var(--teal); font-size: 0.67rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.detail-content h3 { margin: 0.55rem 0 0; font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif; font-size: 1.72rem; font-weight: 500; line-height: 1.16; letter-spacing: -0.055em; }
.detail-lead { margin: 0.9rem 0 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.72; }
.detail-divider { height: 1px; margin: 1.25rem 0; background: var(--line); }
.detail-content h4 { margin: 0 0 0.6rem; color: var(--ink); font-size: 0.67rem; letter-spacing: 0.13em; text-transform: uppercase; }
.detail-points { display: grid; gap: 0.62rem; margin: 0; padding: 0; list-style: none; }
.detail-points li { position: relative; padding-left: 1rem; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.6; }
.detail-points li::before { position: absolute; top: 0.58em; left: 0; width: 5px; height: 5px; border-radius: 50%; content: ""; background: var(--rust); }
.detail-table-wrap { margin-top: 1.1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.detail-table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 0.68rem; }
.detail-table th,
.detail-table td { border-bottom: 1px solid var(--line); padding: 0.52rem 0.55rem; text-align: left; vertical-align: top; }
.detail-table th { color: var(--teal); background: var(--teal-soft); font-size: 0.62rem; font-weight: 800; white-space: nowrap; }
.detail-table td { color: var(--ink-soft); line-height: 1.4; }
.detail-table tr:last-child td { border-bottom: 0; }
.detail-meta { display: grid; gap: 0.62rem; margin-top: 1.2rem; }
.detail-meta-row { display: flex; justify-content: space-between; gap: 0.7rem; border-bottom: 1px dashed var(--line); padding-bottom: 0.45rem; font-size: 0.75rem; }
.detail-meta-row span:first-child { color: #93948a; }
.detail-meta-row span:last-child { color: var(--ink-soft); font-weight: 700; text-align: right; }
.detail-figure { margin: 1.25rem 0 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white); }
.detail-figure img { display: block; width: 100%; max-height: 170px; object-fit: contain; }
.detail-figure figcaption { border-top: 1px solid var(--line); padding: 0.5rem 0.62rem; color: #8a8b82; font-size: 0.67rem; line-height: 1.45; }
.detail-links { margin-top: 1.25rem; }
.detail-links h4 { margin-bottom: 0.58rem; }
.detail-link-list { display: grid; gap: 0.45rem; }
.detail-link-list a { display: flex; flex-direction: column; gap: 0.18rem; border: 1px solid rgba(22, 125, 120, 0.2); border-radius: 9px; padding: 0.55rem 0.62rem; color: var(--teal); background: rgba(224, 240, 236, 0.48); text-decoration: none; transition: 160ms ease; }
.detail-link-list a:hover { border-color: var(--teal); background: var(--teal-soft); transform: translateY(-1px); }
.detail-link-list a span { font-size: 0.73rem; font-weight: 800; }
.detail-link-list a span b { float: right; font-size: 0.8rem; }
.detail-link-list a small { overflow-wrap: anywhere; color: var(--ink-soft); font-size: 0.63rem; line-height: 1.4; }
.detail-tag { display: inline-flex; margin-top: 1.1rem; border-radius: 999px; padding: 0.34rem 0.58rem; color: var(--teal); background: var(--teal-soft); font-size: 0.68rem; font-weight: 700; }

.detail-panel.is-closed .detail-content { opacity: 0.35; }
.flow-canvas.is-collapsed .task-branches { grid-template-columns: 1fr; max-width: 330px; margin-right: auto; margin-left: auto; }
.flow-canvas.is-collapsed .task-path:not(:first-child) { display: none; }
.flow-canvas.is-collapsed .task-branches::before,
.flow-canvas.is-collapsed .task-path::before { display: none; }

@media (max-width: 1280px) {
  .workspace { grid-template-columns: 210px minmax(560px, 1fr) 360px; }
  .sidebar { padding-right: 1rem; padding-left: 1rem; }
  .detail-panel { padding-right: 1rem; padding-left: 1rem; }
}

@media (max-width: 1040px) {
  .workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .detail-panel { position: fixed; z-index: 10; top: 86px; right: 0; bottom: 0; width: min(390px, 86vw); border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(53, 48, 35, 0.12); transform: translateX(0); transition: transform 200ms ease; }
  .detail-panel.is-closed { visibility: hidden; opacity: 0; pointer-events: none; transform: translateX(105%); }
  .flow-viewport { height: calc(100vh - 260px); }
}

@media (max-width: 760px) {
  .topbar { display: block; padding: 0.9rem 1rem; }
  .brand-lockup { width: 100%; }
  .brand-lockup > div:last-child { flex: 1 1 auto; width: 0; max-width: calc(100vw - 80px); }
  .topbar h1 { font-size: 0.98rem; line-height: 1.12; }
  .desktop-title { display: none; }
  .mobile-title { display: inline; }
  .topbar-meta { display: none; }
  .topbar h1 { font-size: 1.15rem; }
  .workspace { display: block; }
  .sidebar { display: none; }
  .flow-section { padding: 1.3rem 0.8rem 1rem; }
  .flow-header { align-items: flex-start; flex-direction: column; }
  .flow-header h2 { font-size: 1.8rem; }
  .model-banner { align-items: flex-start; flex-direction: column; }
  .flow-caption { align-items: flex-start; flex-direction: column; gap: 0.45rem; }
  .zoom-status { border-left: 0; padding-left: 0; }
  .flow-viewport { height: calc(100vh - 250px); min-height: 550px; }
  .flow-canvas { padding-right: 0.5rem; padding-left: 0.5rem; }
  .flow-mainline { align-items: flex-start; margin-left: 1rem; }
  .detail-panel { top: 75px; width: min(390px, 92vw); }
}

/* ═══════════════════════════════════════════════════════
   VIEW TABS & MULTI-VIEW SYSTEM
   ═══════════════════════════════════════════════════════ */

.main-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 2px solid var(--line);
  padding: 0.8rem clamp(1.2rem, 3.2vw, 3.5rem);
  background: var(--paper);
}

.main-tab {
  border: 2px solid var(--line-dark);
  border-radius: 999px;
  padding: 0.65rem 2.2rem;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.7);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: 150ms ease;
  white-space: nowrap;
  justify-self: center;
}

.main-tab:first-child { grid-column: 1; }
.main-tab:last-child { grid-column: 3; }

.main-tab:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.main-tab.is-active { color: var(--white); background: var(--teal); border-color: var(--teal); }

.view-container { display: none !important; }
.view-container.is-active { display: block !important; }

/* Flowchart view uses grid contents layout */
[data-view-panel="flowchart"].is-active { display: contents !important; }

/* Non-flowchart views span full workspace width */
[data-view-panel="prediction"].is-active,
[data-view-panel="training"].is-active {
  display: block !important;
  grid-column: 1 / -1;
}

/* Prediction & Training views take full workspace width */
[data-view-panel="prediction"],
[data-view-panel="training"] {
  grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════
   SUMMARY TOGGLE & NODE DISTINCTION
   ═══════════════════════════════════════════════════════ */

.summary-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  color: var(--teal);
  background: rgba(255, 253, 248, 0.7);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: 150ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.summary-toggle:hover { border-color: var(--teal); background: var(--teal-soft); }

.summary-toggle-icon {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.summary-toggle.is-open .summary-toggle-icon { transform: rotate(45deg); }

.flow-summary {
  max-width: 980px;
  margin: 0 auto 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.7);
  overflow: hidden;
  transition: max-height 300ms ease, opacity 200ms ease, padding 200ms ease;
}

.flow-summary p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.72;
}

.flow-summary.is-collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
}

.flow-summary.is-expanded {
  max-height: 300px;
  opacity: 1;
}

/* Non-clickable nodes visual distinction */
.prep-step,
.zone-heading {
  cursor: default;
}

.prep-step {
  opacity: 0.85;
}

/* Clickable nodes enhanced hover */
.flow-node,
.framework-card,
.decision-node,
.test-card {
  cursor: pointer;
}

.flow-node.is-selected {
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 3px rgba(22, 125, 120, 0.2), var(--shadow);
  transform: translateY(-2px);
}

.framework-card.is-selected,
.test-card.is-selected {
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 3px rgba(22, 125, 120, 0.2), var(--shadow-small);
}

.decision-node.is-selected {
  box-shadow: 0 0 0 3px rgba(184, 93, 63, 0.25), var(--shadow);
}

/* ═══════════════════════════════════════════════════════
   WORKBENCH VIEWS (Prediction + Training)
   ═══════════════════════════════════════════════════════ */

.workbench-view {
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem 1.3rem 3rem;
  display: grid;
  gap: 1.25rem;
}

.workbench-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
}

.workbench-header h2 {
  margin: 0.4rem 0 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.workbench-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.65;
  max-width: 400px;
  text-align: right;
}

/* Target selector cards */
.target-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 0.65rem;
}

.target-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  cursor: pointer;
  background: var(--white);
  transition: 160ms ease;
  box-shadow: var(--shadow-small);
}

.target-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.target-card.is-active { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 7px 22px rgba(22, 125, 120, 0.12); }

.target-card .tc-name {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.target-card .tc-auc {
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--teal);
}

.target-card .tc-meta {
  color: var(--ink-soft);
  font-size: 0.68rem;
  margin-top: 0.25rem;
  line-height: 1.45;
}

/* Workbench grid (2-column layout) */
.workbench-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Panels */
.wb-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem;
  background: var(--white);
  box-shadow: var(--shadow-small);
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.wb-panel-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.wb-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

.wb-panel h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 500;
}

.wb-panel-body { display: grid; gap: 0.4rem; }
.wb-placeholder { color: var(--ink-soft); font-size: 0.8rem; }
.wb-hint { margin: 0; color: var(--ink-soft); font-size: 0.78rem; line-height: 1.55; }

/* Info rows */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.78rem;
}

.info-row span:first-child { color: var(--ink-soft); }
.info-row span:last-child { color: var(--ink); font-weight: 700; }

/* Input grid */
.input-grid { display: grid; gap: 0.3rem; }

.input-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0.4rem 0 0.2rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
}

.feature-input-row {
  display: grid;
  grid-template-columns: 130px 1fr 44px;
  gap: 0.45rem;
  align-items: center;
  padding: 0.2rem 0;
}

.feature-input-row label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-input-row input {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 0.55rem;
  font-size: 0.78rem;
  background: rgba(255, 253, 248, 0.8);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.feature-input-row input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 2px rgba(22, 125, 120, 0.15); }

.feature-input-row .unit-hint {
  color: var(--ink-soft);
  font-size: 0.65rem;
  text-align: right;
}

/* CSV import bar */
.csv-import-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.65rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(245, 242, 234, 0.6);
}

.csv-status {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-left: auto;
}

.csv-status.success { color: var(--teal); }
.csv-status.error { color: var(--rust); }

.csv-row-bar {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.csv-row-bar.is-hidden { display: none; }

.csv-row-bar select {
  flex: 1;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  background: rgba(255, 253, 248, 0.8);
}

/* Action buttons */
.wb-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.wb-primary-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  color: var(--white);
  background: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(22, 125, 120, 0.16);
  transition: 160ms ease;
}

.wb-primary-btn:hover { background: #0e6965; transform: translateY(-1px); }
.wb-primary-btn:disabled { background: var(--line-dark); box-shadow: none; cursor: not-allowed; }

.wb-secondary-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.48rem 0.85rem;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.7);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: 150ms ease;
}

.wb-secondary-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

/* Model source toggle */
.model-source-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.source-btn {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.3rem 0.6rem;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.source-btn.is-active { background: var(--teal); color: var(--white); border-color: var(--teal); }
.source-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.custom-badge {
  display: inline-flex;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.62rem;
  font-weight: 800;
}

.custom-badge.is-hidden { display: none; }

/* Result panel */
.wb-result {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
}

.wb-result.positive { border-color: rgba(184, 93, 63, 0.35); background: var(--rust-soft); }
.wb-result.negative { border-color: rgba(22, 125, 120, 0.35); background: var(--teal-soft); }

.pred-label {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.pred-prob {
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  margin: 0.3rem 0;
}

.pred-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin: 0.5rem 0;
}

.pred-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.pred-bar-fill.positive { background: var(--rust); }
.pred-bar-fill.negative { background: var(--teal); }

.pred-detail-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.pred-detail-line span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
  padding: 0.25rem 0.5rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

/* Feature importance */
.wb-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem;
  background: var(--white);
  box-shadow: var(--shadow-small);
}

.wb-chart { display: grid; gap: 0.3rem; }

.importance-row {
  display: grid;
  grid-template-columns: 130px 1fr 52px;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.75rem;
}

.importance-row .feature-name {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.importance-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.importance-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.importance-bar-fill.positive { background: var(--teal); }
.importance-bar-fill.negative { background: var(--ink-soft); }

.importance-row .importance-value {
  text-align: right;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

/* Subject browser */
.subject-bar {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.subject-bar select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 0.55rem;
  font-size: 0.75rem;
  background: rgba(255, 253, 248, 0.8);
}

.subject-bar select:first-child { width: 120px; }
.subject-bar select:last-child { flex: 1; }

.subject-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.subject-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(255, 253, 248, 0.7);
}

.subject-card.correct { border-color: rgba(22, 125, 120, 0.35); background: var(--teal-soft); }
.subject-card.incorrect { border-color: rgba(184, 93, 63, 0.35); background: var(--rust-soft); }

.subject-card h4 { margin: 0 0 0.3rem; font-size: 0.82rem; }
.subject-card .sc-prob { font-family: Georgia, serif; font-size: 1.35rem; font-weight: 600; color: var(--teal); margin: 0.2rem 0; }
.subject-card .sc-detail { color: var(--ink-soft); font-size: 0.68rem; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════
   TRAINING VIEW COMPONENTS
   ═══════════════════════════════════════════════════════ */

.per-target-config {
  display: grid;
  gap: 0.4rem;
}

.tcr {
  display: grid;
  grid-template-columns: 80px 1fr 90px;
  gap: 0.4rem;
  align-items: center;
}

.tcr-header {
  display: grid;
  grid-template-columns: 80px 1fr 90px;
  gap: 0.4rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.15rem;
}

.tcr-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink);
}

.tcr-select,
.tcr-input {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  background: rgba(255, 253, 248, 0.8);
  color: var(--ink);
}

.tcr-input { font-variant-numeric: tabular-nums; }

.preprocess-hint {
  color: var(--ink-soft);
  font-size: 0.72rem;
  margin: 0.2rem 0 0.45rem;
  line-height: 1.5;
}

.upload-section {
  display: grid;
  gap: 0.45rem;
}

.upload-area {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 1.1rem;
  text-align: center;
  cursor: pointer;
  transition: 160ms ease;
  background: rgba(245, 242, 234, 0.5);
}

.upload-area:hover { border-color: var(--teal); background: var(--teal-soft); }
.upload-area.dragover { border-color: var(--teal); background: var(--teal-soft); }

.upload-area-sm { padding: 0.8rem; }

.upload-placeholder { display: grid; gap: 0.35rem; justify-items: center; }
.upload-icon { font-size: 1.6rem; }
.upload-placeholder span:last-child { color: var(--ink-soft); font-size: 0.78rem; }

.upload-file-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(22, 125, 120, 0.3);
  border-radius: 8px;
  background: var(--teal-soft);
}

.upload-file-info.is-hidden { display: none; }
.upload-file-info .file-name { font-weight: 800; font-size: 0.82rem; color: var(--ink); }
.upload-file-info .file-meta { color: var(--teal); font-size: 0.72rem; flex: 1; }

.remove-file-btn {
  border: 0;
  background: transparent;
  color: var(--rust);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.remove-file-btn:hover { background: var(--rust-soft); }

.sample-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 800;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.78rem;
  text-decoration: underline;
}

.link-button:hover { background: var(--teal-soft); }

.wb-status-bar {
  color: var(--ink-soft);
  font-size: 0.78rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 242, 234, 0.5);
}

.wb-status-bar.success { color: var(--teal); border-color: rgba(22, 125, 120, 0.3); background: var(--teal-soft); }
.wb-status-bar.error { color: var(--rust); border-color: rgba(184, 93, 63, 0.3); background: var(--rust-soft); }

.train-actions {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

.train-actions.is-hidden { display: none; }

.action-hint {
  color: var(--ink-soft);
  font-size: 0.72rem;
  margin: 0;
}

.loader-desc {
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.6;
  margin: 0 0 0.55rem;
}

/* Training results grid */
.train-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.train-result-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(245, 242, 234, 0.5);
}

.train-result-card.success { border-color: rgba(22, 125, 120, 0.3); background: var(--teal-soft); }
.train-result-card.error { border-color: rgba(184, 93, 63, 0.3); background: var(--rust-soft); }

.train-result-card h4 { margin: 0 0 0.45rem; font-size: 0.82rem; }

.tr-metric {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 0.2rem 0;
}

.tr-metric span { color: var(--ink-soft); }
.tr-metric strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Training section divider */
.training-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line-dark), transparent);
  margin: 2rem 0 1.5rem;
}

/* Responsive for workbench views */
@media (max-width: 1040px) {
  .workbench-grid { grid-template-columns: 1fr; }
  .target-selector { grid-template-columns: repeat(2, 1fr); }
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .workbench-header { flex-direction: column; align-items: flex-start; }
  .workbench-desc { text-align: left; max-width: 100%; }
}

@media (max-width: 760px) {
  .main-tabs { gap: 1.2rem; padding: 0.6rem 0.8rem; }
  .main-tab { padding: 0.55rem 1.5rem; font-size: 0.85rem; }
  .target-selector { grid-template-columns: 1fr; }
  .subject-grid { grid-template-columns: 1fr; }
  .train-results-grid { grid-template-columns: 1fr; }
  .tcr { grid-template-columns: 70px 1fr 70px; }
}
