:root {
  --ink: #0d1f2d;
  --muted: #5e6d78;
  --paper: #f7f4ed;
  --surface: #fffdf8;
  --line: #d8d7d0;
  --blue: #2667ff;
  --blue-soft: #eaf0ff;
  --violet: #7457db;
  --violet-soft: #f0edff;
  --green: #167c68;
  --green-soft: #e5f5ef;
  --amber: #b66b16;
  --amber-soft: #fff0d8;
  --shadow: 0 22px 70px rgba(13, 31, 45, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
::selection { background: #cfe0ff; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px max(26px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid rgba(13, 31, 45, .10);
  background: rgba(247, 244, 237, .92);
  backdrop-filter: blur(18px);
}
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(13, 31, 45, .16);
}
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 14px; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .10em; text-transform: uppercase; }
.page-tabs { display: flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .60); }
.page-tabs a { min-width: 92px; padding: 9px 15px; border-radius: 999px; color: var(--muted); text-align: center; text-decoration: none; font-size: 13px; font-weight: 800; transition: .18s ease; }
.page-tabs a:hover { color: var(--ink); background: white; }
.page-tabs a.active { color: white; background: var(--ink); box-shadow: 0 6px 17px rgba(13, 31, 45, .18); }
.paper-link { justify-self: end; text-decoration: none; font-size: 13px; font-weight: 800; }
.paper-link span { color: var(--blue); }

.hero {
  position: relative;
  max-width: 1440px;
  min-height: 640px;
  margin: 0 auto;
  padding: 82px 0 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(330px, .72fr);
  gap: 75px;
  align-items: center;
}
.hero::before {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  left: -390px;
  top: 38px;
  border: 1px solid rgba(38, 103, 255, .22);
  border-radius: 50%;
  box-shadow: inset 0 0 0 80px rgba(38, 103, 255, .025), inset 0 0 0 160px rgba(38, 103, 255, .02);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.hero-meta span { padding: 7px 11px; border: 1px solid rgba(13, 31, 45, .13); border-radius: 999px; background: rgba(255, 255, 255, .45); color: var(--muted); font-size: 12px; font-weight: 750; }
.hero h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(48px, 4.7vw, 68px); line-height: 1.04; letter-spacing: -.05em; font-weight: 500; white-space: nowrap; }
.hero-subtitle { max-width: 760px; margin: 27px 0 0; color: var(--muted); font-size: 19px; line-height: 1.72; }
.abstract-toggle { max-width: 790px; margin-top: 32px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.abstract-toggle summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 17px 2px; font-size: 15px; font-weight: 850; }
.abstract-toggle summary::-webkit-details-marker { display: none; }
.abstract-toggle summary b { color: var(--blue); font-size: 22px; font-weight: 400; transition: transform .2s ease; }
.abstract-toggle[open] summary b { transform: rotate(45deg); }
.abstract-content { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 0 0 22px; }
.abstract-content p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.78; }

.hero-aside { position: relative; display: grid; gap: 12px; }
.hero-aside::before { content: ""; position: absolute; inset: 24px -28px -24px 48px; border-radius: 36px; background: #dde8ff; opacity: .58; transform: rotate(3deg); z-index: -1; }
.promise-card { padding: 22px 24px; border: 1px solid rgba(13, 31, 45, .12); border-radius: 22px; background: rgba(255, 253, 248, .93); box-shadow: 0 12px 36px rgba(13, 31, 45, .055); }
.promise-card.primary { color: white; background: var(--ink); transform: translateX(-18px); }
.promise-card > span { display: block; margin-bottom: 9px; color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .10em; text-transform: uppercase; }
.promise-card.primary > span { color: #91b2ff; }
.promise-card strong { display: block; font-family: Georgia, "Noto Serif SC", serif; font-size: 22px; font-weight: 500; }
.promise-card p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.promise-card.primary p { color: #b4c0ca; }

.workflow-intro { max-width: 1440px; margin: 0 auto 32px; padding: 32px 36px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 55px; align-items: end; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.eyebrow { display: block; color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.workflow-intro h2 { margin: 7px 0 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 41px; font-weight: 500; letter-spacing: -.035em; }
.workflow-intro p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }

.workspace { max-width: 1440px; margin: 0 auto 90px; display: grid; grid-template-columns: minmax(0, 1fr) 470px; gap: 24px; align-items: start; }
.flow-column { min-width: 0; }
.phase { position: relative; overflow: hidden; padding: 35px; border: 1px solid rgba(13, 31, 45, .11); border-radius: 28px; box-shadow: 0 16px 48px rgba(13, 31, 45, .055); }
.phase::before { content: ""; position: absolute; inset: 0; opacity: .27; background-image: linear-gradient(rgba(13, 31, 45, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(13, 31, 45, .05) 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(to bottom, black, transparent 52%); pointer-events: none; }
.phase > * { position: relative; z-index: 1; }
.phase-data { background: #eef4ff; }
.phase-train { background: #f1edfb; }
.phase-test { background: #eaf4ef; }
.phase-header { display: flex; align-items: center; gap: 18px; margin-bottom: 27px; }
.phase-index { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; background: var(--ink); color: white; font-size: 13px; font-weight: 900; }
.phase-header h3 { margin: 5px 0 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 34px; font-weight: 500; letter-spacing: -.03em; }
.phase-header p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }

.linear-flow, .train-core { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr); gap: 7px; align-items: center; }
.train-core { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr); max-width: 760px; margin: 0 auto; }
.flow-arrow { color: rgba(13, 31, 45, .48); font-size: 22px; text-align: center; }
.flow-node { width: 100%; min-height: 126px; display: flex; flex-direction: column; align-items: flex-start; padding: 17px; border: 1px solid rgba(13, 31, 45, .15); border-radius: 17px; background: rgba(255, 253, 248, .86); text-align: left; cursor: pointer; transition: .18s ease; }
.flow-node:hover, .flow-node:focus-visible { transform: translateY(-4px); border-color: rgba(38, 103, 255, .60); background: white; box-shadow: 0 14px 30px rgba(13, 31, 45, .10); outline: none; }
.flow-node.selected { color: white; border-color: var(--ink); background: var(--ink); box-shadow: 0 16px 34px rgba(13, 31, 45, .17); transform: translateY(-3px); }
.node-code { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .09em; }
.flow-node.selected .node-code { color: #91b2ff; }
.flow-node strong { margin-top: 11px; font-size: 16px; line-height: 1.35; }
.flow-node small { margin-top: auto; padding-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.flow-node.selected small { color: #adbac5; }
.flow-node.compact { min-height: 110px; }
.flow-node.wide { min-height: 102px; max-width: 460px; margin: 0 auto; }

.phase-files { margin-top: 23px; border-top: 1px solid rgba(13, 31, 45, .14); }
.phase-files summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 15px 1px 0; color: var(--muted); font-size: 13px; font-weight: 850; }
.phase-files summary::-webkit-details-marker { display: none; }
.phase-files summary span { color: var(--blue); font-size: 18px; transition: .18s ease; }
.phase-files[open] summary span { transform: rotate(45deg); }
.phase-files > div { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 13px; }
.phase-files a { padding: 8px 11px; border: 1px solid rgba(13, 31, 45, .13); border-radius: 10px; background: rgba(255, 253, 248, .78); text-decoration: none; font-size: 12px; font-weight: 750; }
.phase-files a:hover { border-color: var(--blue); color: var(--blue); background: white; }

.phase-bridge { height: 94px; display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--muted); }
.phase-bridge span { padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .68); font-size: 11px; font-weight: 800; }
.phase-bridge b { color: var(--blue); font-size: 30px; line-height: 1; }

.algorithm-strip { display: grid; grid-template-columns: 1fr 18px 1fr 18px 1fr 18px 1fr 18px 1fr; gap: 5px; align-items: center; margin-bottom: 28px; padding: 15px; border: 1px solid rgba(13, 31, 45, .12); border-radius: 18px; background: rgba(255, 253, 248, .72); }
.algorithm-strip > div { min-width: 0; display: flex; align-items: flex-start; gap: 9px; }
.algorithm-strip b { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--violet-soft); color: var(--violet); font-size: 11px; }
.algorithm-strip span { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.algorithm-strip strong { font-size: 12px; line-height: 1.35; }
.algorithm-strip small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.algorithm-strip i { color: rgba(13, 31, 45, .38); font-style: normal; }

.fork { display: flex; flex-direction: column; align-items: center; margin: 3px auto 0; }
.fork-stem { color: var(--violet); font-size: 27px; line-height: 1; }
.fork-label { display: flex; align-items: baseline; gap: 9px; padding: 9px 13px; border-radius: 12px; background: rgba(255, 253, 248, .75); }
.fork-label small { color: var(--muted); font-size: 11px; }
.fork-label strong { font-size: 13px; }
.fork-lines { width: 58%; height: 32px; position: relative; }
.fork-lines::before { content: ""; position: absolute; top: 0; left: 50%; height: 15px; border-left: 2px solid rgba(116, 87, 219, .42); }
.fork-lines::after { content: ""; position: absolute; top: 15px; left: 0; right: 0; border-top: 2px solid rgba(116, 87, 219, .42); }
.fork-lines span { position: absolute; top: 15px; height: 17px; border-left: 2px solid rgba(116, 87, 219, .42); }
.fork-lines span:first-child { left: 0; }
.fork-lines span:last-child { right: 0; }

.decision-paths { display: grid; grid-template-columns: 1.45fr .55fr; gap: 14px; }
.decision-path { padding: 18px; border: 1px solid rgba(13, 31, 45, .12); border-radius: 19px; background: rgba(255, 253, 248, .72); }
.decision-path > header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.decision-path > header > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--violet); color: white; font-size: 12px; font-weight: 900; }
.decision-path > header > div { display: flex; flex-direction: column; gap: 3px; }
.decision-path header strong { font-size: 13px; }
.decision-path header small { color: var(--muted); font-size: 11px; }
.branch-grid { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding-top: 15px; }
.branch-grid::before { content: ""; position: absolute; left: 16.6%; right: 16.6%; top: 1px; border-top: 2px solid rgba(116, 87, 219, .30); }
.branch-grid .flow-node::before { content: "↓"; position: absolute; top: -17px; left: 50%; color: var(--violet); transform: translateX(-50%); }
.branch-grid .flow-node { position: relative; }
.defer-path > header > span { background: var(--green); }
.single-path { display: flex; flex-direction: column; align-items: center; }
.down-arrow { color: var(--green); font-size: 21px; height: 24px; }
.merge-output { margin: 18px auto 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: white; font-size: 13px; }
.merge-output span { color: #91b2ff; font-size: 20px; }

.test-entry { display: flex; justify-content: center; }
.test-fork, .test-merge { display: flex; flex-direction: column; align-items: center; }
.test-fork span, .test-merge span { color: var(--green); font-size: 24px; line-height: 1; }
.test-fork div, .test-merge div { width: 76%; height: 16px; border-top: 2px solid rgba(22, 124, 104, .33); border-left: 2px solid rgba(22, 124, 104, .33); border-right: 2px solid rgba(22, 124, 104, .33); }
.test-merge { flex-direction: column-reverse; margin-top: 2px; }
.test-merge div { transform: rotate(180deg); }
.evaluation-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.detail-rail { position: sticky; top: 92px; height: calc(100vh - 116px); overflow: hidden; display: flex; flex-direction: column; border: 1px solid rgba(13, 31, 45, .13); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); }
.rail-progress { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 13px 19px; background: var(--ink); color: white; }
.rail-progress span { color: #b6c3ce; font-size: 12px; font-weight: 800; }
.rail-progress b { width: 36px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .10); color: #91b2ff; font-size: 11px; }
.rail-scroll { min-height: 0; overflow-y: auto; padding: 23px; scrollbar-width: thin; scrollbar-color: #bac2c7 transparent; }
.rail-header { padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.rail-header h3 { margin: 8px 0 11px; font-family: Georgia, "Noto Serif SC", serif; font-size: 30px; line-height: 1.15; font-weight: 500; letter-spacing: -.025em; }
.rail-header p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.rail-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 17px 0; }
.rail-metric { min-width: 0; padding: 11px; border-radius: 12px; background: var(--blue-soft); }
.rail-metric:nth-child(2) { background: var(--violet-soft); }
.rail-metric:nth-child(3) { background: var(--green-soft); }
.rail-metric span { display: block; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.rail-metric strong { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 16px; font-weight: 500; line-height: 1.25; }
.rail-copy { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fcfbf7; }
.rail-copy p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.78; }
.rail-copy p + p { margin-top: 11px; }
.rail-formula { margin-top: 13px; padding: 13px 14px; border-radius: 12px; background: var(--ink); color: white; font: 13px/1.65 "SFMono-Regular", Consolas, monospace; }
.rail-figures { display: grid; grid-template-columns: 1fr; gap: 11px; margin-top: 14px; }
.rail-figures figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; }
.rail-figures a { display: block; padding: 8px; }
.rail-figures img { display: block; width: 100%; height: 215px; object-fit: contain; border-radius: 9px; }
.rail-figures figcaption { padding: 11px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.55; }

.rail-content { display: grid; gap: 15px; margin-top: 17px; }
.detail-block { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fcfbf7; }
.detail-block h4, .detail-callout h4 { margin: 0 0 11px; font-size: 15px; }
.text-block p, .detail-callout p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.78; }
.text-block p + p { margin-top: 11px; }
.detail-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 8px; }
.detail-facts > div { padding: 13px; border-radius: 13px; background: var(--blue-soft); }
.detail-facts > div:nth-child(3n + 2) { background: var(--violet-soft); }
.detail-facts > div:nth-child(3n + 3) { background: var(--green-soft); }
.detail-facts span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; }
.detail-facts strong { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 17px; font-weight: 500; line-height: 1.3; }
.detail-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.detail-steps li { display: grid; grid-template-columns: 31px 1fr; gap: 10px; align-items: start; }
.detail-steps b { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--violet-soft); color: var(--violet); font-size: 10px; }
.detail-steps span { padding-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.detail-list { margin: 0; padding-left: 19px; color: var(--muted); }
.detail-list li { padding-left: 3px; font-size: 15px; line-height: 1.65; }
.detail-list li + li { margin-top: 6px; }
.detail-table-wrap, .result-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.detail-table-wrap table, .result-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table-wrap th, .detail-table-wrap td, .result-table-wrap th, .result-table-wrap td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.45; }
.detail-table-wrap th, .result-table-wrap th { color: var(--muted); background: #f2f4f5; font-size: 11px; font-weight: 850; white-space: nowrap; }
.detail-table-wrap tr:last-child td, .result-table-wrap tr:last-child td { border-bottom: 0; }
.detail-formula { padding: 15px; border-radius: 13px; background: var(--ink); color: white; }
.detail-formula span { display: block; margin-bottom: 8px; color: #91b2ff; font-size: 10px; font-weight: 900; letter-spacing: .10em; text-transform: uppercase; }
.detail-formula code { font: 13px/1.65 "SFMono-Regular", Consolas, monospace; white-space: normal; }
.detail-callout { padding: 16px; border: 1px solid #eccd9e; border-radius: 14px; background: var(--amber-soft); }
.detail-callout h4 { color: #8b5617; }
.detail-callout p { color: #725020; font-size: 15px; }
.detail-links { display: grid; gap: 8px; }
.detail-links a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: white; text-decoration: none; transition: .18s ease; }
.detail-links a:hover { border-color: var(--blue); background: var(--blue-soft); }
.detail-links a > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.detail-links strong { font-size: 13px; }
.detail-links small { color: var(--muted); font-size: 11px; }
.detail-links a > b { color: var(--blue); }

.tool-page { max-width: 1440px; margin: 0 auto; padding: 64px 0 90px; }
.tool-hero { max-width: 1240px; margin-bottom: 38px; }
.tool-hero h1 { margin: 9px 0 15px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(48px, 5vw, 68px); line-height: 1.02; font-weight: 500; letter-spacing: -.045em; white-space: nowrap; }
.tool-hero p { max-width: 1220px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.72; white-space: nowrap; }
.current-method { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: -11px 0 25px; padding: 13px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 12px 36px rgba(13, 31, 45, .05); }
.current-method > div { padding: 14px 15px; border-radius: 13px; background: #f2f4f5; }
.current-method > div.primary { background: var(--violet-soft); box-shadow: inset 0 0 0 1px rgba(116, 87, 219, .18); }
.current-method span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.current-method strong { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.current-method small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.current-method > p { grid-column: 1 / -1; margin: 0; padding: 3px 6px 1px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.mode-tabs { display: inline-flex; gap: 5px; margin-bottom: 17px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.mode-tabs button { padding: 9px 15px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 800; }
.mode-tabs button.active { background: var(--ink); color: white; }
.prediction-workspace, .training-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 22px; align-items: start; }
.input-panel, .training-form { min-width: 0; }
.input-panel form, .training-section { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 15px 48px rgba(13, 31, 45, .06); }
.form-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.form-intro h2 { margin: 6px 0 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 31px; font-weight: 500; }
.secondary-button { padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; font-size: 12px; font-weight: 800; }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.patient-meta-fields, .feature-grid, .config-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.patient-meta-fields { margin-bottom: 14px; }
.feature-grid { grid-template-columns: repeat(4, 1fr); padding: 16px 0 2px; }
.patient-meta-fields label, .feature-grid label, .config-grid label { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.patient-meta-fields label > span, .feature-grid label > span, .config-grid label > span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 800; }
.patient-meta-fields small, .feature-grid small, .config-grid small { color: var(--muted); font-size: 10px; font-weight: 500; }
input, select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(38, 103, 255, .10); }
.feature-group { margin-top: 10px; border-top: 1px solid var(--line); }
.feature-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 14px 1px 3px; }
.feature-group summary::-webkit-details-marker { display: none; }
.feature-group summary > span { display: flex; align-items: baseline; gap: 9px; }
.feature-group summary strong { font-size: 14px; }
.feature-group summary small { color: var(--muted); font-size: 11px; }
.feature-group summary b { color: var(--blue); font-size: 18px; font-weight: 400; }
.primary-button { width: 100%; margin-top: 20px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 13px; background: var(--ink); color: white; cursor: pointer; font-size: 14px; font-weight: 850; box-shadow: 0 12px 28px rgba(13, 31, 45, .16); }
.primary-button:hover { background: #183449; }
.primary-button span { color: #91b2ff; font-size: 19px; }
.upload-zone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-zone label { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; border: 1px dashed #9caab4; border-radius: 18px; background: #fcfbf7; cursor: pointer; text-align: center; }
.upload-zone label:hover { border-color: var(--blue); background: var(--blue-soft); }
.upload-zone label strong { font-size: 18px; }
.upload-zone label span { max-width: 480px; margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.upload-zone label small { margin-top: 17px; padding: 7px 10px; border-radius: 8px; background: white; color: var(--blue); font-size: 12px; font-weight: 750; }

.output-panel, .training-output { position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow: hidden; display: flex; flex-direction: column; border: 1px solid rgba(13, 31, 45, .13); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.output-status { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; background: var(--ink); color: white; }
.output-status span { color: #b6c3ce; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.output-status b { color: #91b2ff; font-size: 12px; }
.output-scroll, .training-output-scroll { min-height: 0; overflow-y: auto; padding: 20px; }
.empty-output { padding: 17px; border-bottom: 1px solid var(--line); }
.empty-output:last-child { border-bottom: 0; }
.empty-output > span { color: var(--blue); font-family: Georgia, serif; font-size: 19px; }
.empty-output h2 { margin: 7px 0 5px; font-size: 17px; }
.empty-output p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.prediction-record { display: grid; gap: 13px; }
.record-index { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .10em; text-transform: uppercase; }
.risk-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.risk-summary > div { padding: 14px; border-radius: 13px; background: var(--blue-soft); }
.risk-summary > div:last-child { background: var(--violet-soft); }
.risk-summary span, .probability-head span, .decision-card > span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; }
.risk-summary strong { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.probability-card, .decision-card, .set-card, .input-warning { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fcfbf7; }
.probability-head { display: flex; justify-content: space-between; align-items: baseline; }
.probability-head strong { font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.probability-bar { height: 9px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: #dce3e7; }
.probability-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--violet)); }
.probability-split { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 10px; }
.decision-card.accepted { border-color: #9fd1c2; background: var(--green-soft); }
.decision-card.deferred { border-color: #eccd9e; background: var(--amber-soft); }
.decision-card strong { display: block; margin-top: 7px; font-family: Georgia, "Noto Serif SC", serif; font-size: 24px; font-weight: 500; }
.decision-card p, .input-warning p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.set-card h3 { margin: 0 0 10px; font-size: 14px; }
.set-card dl { margin: 0; display: grid; gap: 7px; }
.set-card dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.set-card dt { color: var(--muted); font-size: 12px; }
.set-card dt small { margin-left: 5px; color: var(--violet); font-size: 9px; font-weight: 900; }
.set-card dd { margin: 0; text-align: right; font-size: 12px; font-weight: 800; }
.set-card .primary-set { margin: 0 -7px; padding: 9px 7px; border-radius: 9px; background: var(--violet-soft); }
.batch-summary { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 13px; background: var(--blue-soft); }
.batch-summary span { color: var(--muted); font-size: 11px; }
.batch-summary strong { font-size: 15px; }
.batch-results { display: grid; gap: 17px; margin-top: 17px; }
.batch-results .prediction-record { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.loading-output, .training-running { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.loading-output i, .training-running i { width: 34px; height: 34px; margin-bottom: 16px; border: 3px solid #dce3e7; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-output strong { font-size: 14px; }
.service-error { min-height: 310px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.service-error > span { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 50%; background: var(--amber-soft); color: var(--amber); font-size: 22px; font-weight: 900; }
.service-error h2 { margin: 14px 0 7px; font-family: Georgia, "Noto Serif SC", serif; font-size: 27px; font-weight: 500; }
.service-error p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.service-error small { margin-top: 13px; color: var(--muted); font-size: 11px; line-height: 1.55; }

.training-form { display: grid; gap: 15px; }
.training-section { box-shadow: none; }
.section-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.section-heading > span { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: white; font-size: 11px; font-weight: 900; }
.section-heading h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 27px; font-weight: 500; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.source-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.data-role-guide { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 11px; }
.data-role-guide article { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fcfbf7; }
.data-role-guide b { display: block; color: var(--blue); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.data-role-guide strong { display: block; margin-top: 5px; font-size: 13px; }
.data-role-guide p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.role-reason { margin: 0 0 15px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); color: #35516a; font-size: 13px; line-height: 1.65; }
.parameter-guide { margin-bottom: 16px; padding: 14px 15px; border: 1px solid #ddd4fa; border-radius: 13px; background: var(--violet-soft); }
.parameter-guide > strong { display: block; color: #4d3999; font-size: 13px; }
.parameter-guide p { margin: 7px 0 0; color: #5d537c; font-size: 13px; line-height: 1.65; }
.parameter-guide b { color: #3f2e82; }
.source-choice label { position: relative; cursor: pointer; }
.source-choice input { position: absolute; opacity: 0; }
.source-choice label > span { display: flex; flex-direction: column; min-height: 90px; justify-content: center; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fcfbf7; }
.source-choice input:checked + span { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.source-choice strong { font-size: 14px; }
.source-choice small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.dataset-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.dataset-status > div { padding: 12px; border-radius: 12px; background: var(--green-soft); }
.dataset-status span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.dataset-status strong { display: block; margin-top: 4px; font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.dataset-upload-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 12px; }
.dataset-upload-grid:not([hidden]) { display: grid; }
.dataset-upload-grid label { padding: 13px; border: 1px dashed #9caab4; border-radius: 13px; background: #fcfbf7; }
.dataset-upload-grid label > span { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 850; }
.dataset-upload-grid input { min-height: auto; padding: 0; border: 0; background: transparent; font-size: 11px; }
.dataset-upload-grid small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.config-grid { grid-template-columns: repeat(3, 1fr); }
.method-checks { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 7px; }
.method-checks > span { width: 100%; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 800; }
.method-checks > div { padding: 7px 9px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 750; }
.method-checks b { margin-right: 4px; }
.train-button { margin-top: 0; }
.training-timeline { display: grid; gap: 10px; }
.training-timeline > div { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.training-timeline > div:last-child { border-bottom: 0; }
.training-timeline b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--violet-soft); color: var(--violet); font-size: 11px; }
.training-timeline span { display: flex; flex-direction: column; gap: 4px; }
.training-timeline strong { font-size: 13px; }
.training-timeline small { color: var(--muted); font-size: 11px; }
.training-running h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 27px; font-weight: 500; }
.training-running p { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.training-complete-head { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.training-complete-head > span { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.training-complete-head h2 { margin: 7px 0 8px; font-family: Georgia, "Noto Serif SC", serif; font-size: 27px; font-weight: 500; }
.training-complete-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.training-result-facts { display: grid; gap: 7px; margin: 15px 0; }
.training-result-facts > div { padding: 12px; border-radius: 12px; background: var(--blue-soft); }
.training-result-facts > div:nth-child(2) { background: var(--violet-soft); }
.training-result-facts > div:nth-child(3) { background: var(--green-soft); }
.training-result-facts span { color: var(--muted); font-size: 10px; font-weight: 800; }
.training-result-facts strong { display: block; margin-top: 4px; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.training-result-section { margin-top: 15px; }
.training-result-section h3 { margin: 0 0 9px; font-size: 14px; }
.quantile-list { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.quantile-list > div { padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fcfbf7; }
.quantile-list dt { color: var(--muted); font-size: 10px; }
.quantile-list dd { margin: 4px 0 0; font-family: Georgia, serif; font-size: 17px; }
.output-link { margin-top: 17px; padding: 12px 14px; display: flex; justify-content: space-between; border-radius: 12px; background: var(--ink); color: white; text-decoration: none; font-size: 13px; font-weight: 800; }
.output-link span { color: #91b2ff; }

.page-footer { max-width: 1440px; margin: 0 auto; padding: 29px 0 45px; display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.page-footer strong { color: var(--ink); }
.page-footer div { display: flex; gap: 18px; }
.page-footer a { text-decoration: none; font-weight: 750; }
.page-footer a:hover { color: var(--blue); }

.placeholder-main { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 50px 24px; }
.placeholder-card { width: min(720px, 100%); padding: 50px; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.placeholder-card h1 { margin: 12px 0 15px; font-family: Georgia, "Noto Serif SC", serif; font-size: 46px; font-weight: 500; }
.placeholder-card p { max-width: 520px; margin: 0 auto; color: var(--muted); font-size: 17px; line-height: 1.75; }
.placeholder-card a { display: inline-block; margin-top: 25px; padding: 11px 17px; border-radius: 12px; background: var(--ink); color: white; text-decoration: none; font-size: 14px; font-weight: 800; }

/* CSV-only prediction and one-file training controls */
.prediction-input-panel, .training-form { min-width: 0; }
.prediction-workspace { grid-template-columns: minmax(0, 1fr) 470px; }
.current-method { grid-template-columns: repeat(2, 1fr); }
.service-banner { margin-bottom: 15px; padding: 15px 17px; border: 1px solid #e3b96f; border-radius: 14px; background: var(--amber-soft); color: #714b14; }
.service-banner strong { font-size: 14px; }
.service-banner p { margin: 6px 0 0; font-size: 12px; line-height: 1.6; }
.model-choice-panel { margin-bottom: 15px; padding: 21px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.mini-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 13px; }
.mini-heading > span { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: white; font-size: 10px; font-weight: 900; }
.mini-heading div { display: flex; flex-direction: column; gap: 3px; }
.mini-heading strong { font-size: 14px; }
.mini-heading small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.model-source-choice { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.model-source-choice label { position: relative; cursor: pointer; }
.model-source-choice input { position: absolute; opacity: 0; }
.model-source-choice label > span { min-height: 74px; display: flex; flex-direction: column; justify-content: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf7; }
.model-source-choice input:checked + span { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.model-source-choice input:disabled + span { opacity: .48; cursor: not-allowed; }
.model-source-choice strong { font-size: 13px; }
.model-source-choice small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.prediction-mode-choice { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 13px; }
.prediction-mode-choice label { position: relative; cursor: pointer; }
.prediction-mode-choice input { position: absolute; opacity: 0; }
.prediction-mode-choice label > span { min-height: 72px; display: flex; flex-direction: column; justify-content: center; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbf7; }
.prediction-mode-choice input:checked + span { border-color: var(--violet); background: var(--violet-soft); box-shadow: inset 0 0 0 1px var(--violet); }
.prediction-mode-choice strong { font-size: 12px; }
.prediction-mode-choice small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.direct-prediction-form { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 15px 48px rgba(13, 31, 45, .06); }
.direct-form-heading { align-items: flex-start; }
.direct-form-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.input-divider { display: flex; align-items: center; gap: 14px; margin: 19px 0; color: var(--muted); font-size: 12px; font-weight: 750; }
.input-divider::before, .input-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.direct-feature-group:first-child { margin-top: 15px; }
.direct-feature-group .feature-grid { padding-top: 13px; }
.range-note { margin: 10px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.upload-zone { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; border: 1px dashed #9caab4; border-radius: 18px; background: #fcfbf7; cursor: pointer; text-align: center; }
.upload-zone:hover { border-color: var(--blue); background: var(--blue-soft); }
.upload-zone .upload-icon { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 15px; background: var(--ink); color: white; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.upload-zone strong { margin-top: 14px; font-size: 18px; }
.upload-zone small { max-width: 520px; margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.upload-zone em { margin-top: 17px; padding: 7px 10px; border-radius: 8px; background: white; color: var(--blue); font-size: 12px; font-style: normal; font-weight: 750; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.csv-prediction-form { padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 15px 48px rgba(13, 31, 45, .06); }
.csv-note { margin-top: 14px; padding: 14px 16px; border-radius: 13px; background: var(--blue-soft); color: #35516a; }
.csv-note strong { font-size: 13px; }
.csv-note p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; }
.example-download { margin-top: 13px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); text-decoration: none; }
.example-download:hover { border-color: var(--blue); background: var(--blue-soft); }
.example-download > span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.example-download strong { font-size: 12px; }
.example-download small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.example-download > b { color: var(--blue); font-size: 18px; }
.prediction-table-wrap { overflow-x: auto; margin-top: 14px; }
.prediction-table { width: 100%; border-collapse: collapse; min-width: 680px; font-size: 12px; }
.prediction-table th { padding: 9px 8px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.prediction-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.decision-pill { display: inline-block; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.decision-pill.accept { background: var(--green-soft); color: var(--green); }
.decision-pill.defer { background: var(--amber-soft); color: var(--amber); }
.mondrian-set { color: var(--violet); font-weight: 750; }
.patient-result-list { display: grid; gap: 11px; margin-top: 13px; }
.patient-result-card { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fcfbf7; }
.patient-result-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.patient-result-head span, .patient-result-grid span, .patient-mondrian span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.patient-result-head strong { font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.patient-result-head small { margin-left: auto; padding-left: 10px; color: var(--blue); font-size: 10px; font-weight: 800; }
.patient-result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 10px; }
.patient-result-grid > div { padding: 9px; border-radius: 10px; background: var(--blue-soft); }
.patient-result-grid > div:nth-child(2n) { background: var(--green-soft); }
.patient-result-grid strong { display: block; margin-top: 4px; font-size: 13px; }
.patient-result-grid strong.defer { color: var(--amber); }
.patient-result-grid strong.accept { color: var(--green); }
.patient-mondrian { margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--violet-soft); }
.patient-mondrian strong { display: block; margin-top: 4px; color: var(--violet); font-size: 13px; }
.patient-mondrian p { margin: 5px 0 0; color: #5d537c; font-size: 11px; line-height: 1.55; }
.patient-selector { margin-bottom: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fcfbf7; }
.patient-selector > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.patient-selector > div:first-child strong { font-size: 13px; }
.patient-selector > div:first-child small { color: var(--muted); font-size: 10px; }
.patient-selector-grid { max-height: 116px; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding-right: 3px; }
.patient-selector-grid button { overflow: hidden; padding: 7px 5px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--muted); cursor: pointer; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 750; }
.patient-selector-grid button:hover, .patient-selector-grid button.active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.patient-result-card.detailed { display: grid; gap: 10px; }
.patient-advice { padding: 13px; border: 1px solid #9fd1c2; border-radius: 12px; background: var(--green-soft); }
.patient-advice.review_uncertain { border-color: #eccd9e; background: var(--amber-soft); }
.patient-advice.review_high_risk { border-color: #e7a39b; background: #fff0ed; }
.patient-advice.out_of_distribution { border-color: #df8d83; background: #fff0ed; }
.patient-advice span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.patient-advice strong { display: block; margin-top: 4px; color: var(--green); font-size: 16px; }
.patient-advice.review_uncertain strong { color: var(--amber); }
.patient-advice.review_high_risk strong { color: #b54134; }
.patient-advice.out_of_distribution strong { color: #9f2f25; }
.patient-advice p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.input-range-warning { padding: 12px 13px; border: 1px solid #df8d83; border-radius: 12px; background: #fff6f4; }
.input-range-warning > strong { color: #9f2f25; font-size: 12px; }
.input-range-warning > div { display: grid; gap: 4px; margin-top: 7px; }
.input-range-warning span { color: #76504b; font-size: 10px; line-height: 1.45; }
.timeline-summary { margin-bottom: 11px; padding: 14px; border-radius: 13px; background: var(--blue-soft); }
.timeline-summary span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.timeline-summary strong { display: block; margin-top: 5px; font-family: Georgia, "Noto Serif SC", serif; font-size: 17px; font-weight: 500; line-height: 1.35; }
.timeline-summary p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.risk-curve-card { margin-bottom: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fcfbf7; }
.risk-curve-card > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.risk-curve-card > div strong { font-size: 12px; }
.risk-curve-card > div small { color: var(--muted); font-size: 9px; }
.risk-curve-card svg { width: 100%; height: auto; display: block; margin-top: 7px; overflow: visible; }
.risk-curve-card .axis { stroke: #acb8c1; stroke-width: 1; }
.risk-curve-card .threshold { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 5 4; }
.risk-curve-card .threshold-label { fill: var(--amber); font-size: 9px; font-weight: 800; }
.risk-curve-card .risk-line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.risk-curve-card circle { fill: white; stroke: var(--blue); stroke-width: 1.6; }
.risk-curve-card circle.invalid { fill: #fff0ed; stroke: #b54134; }
.risk-curve-card .axis-label { fill: var(--muted); font-size: 9px; }
.timeline-table { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.timeline-table summary { cursor: pointer; padding: 11px 13px; font-size: 11px; font-weight: 800; }
.timeline-table > div { max-height: 210px; overflow: auto; border-top: 1px solid var(--line); }
.timeline-table table { width: 100%; border-collapse: collapse; font-size: 10px; }
.timeline-table th, .timeline-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.timeline-table th { position: sticky; top: 0; background: #f2f4f5; color: var(--muted); }
.single-file-upload { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 15px; border: 1px dashed #9caab4; border-radius: 13px; background: #fcfbf7; }
.single-file-upload > span { font-size: 12px; font-weight: 850; }
.single-file-upload input { min-height: auto; padding: 0; border: 0; background: transparent; font-size: 11px; }
.single-file-upload small { color: var(--muted); font-size: 11px; }
.training-complete { padding: 8px 2px; }
.complete-mark { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 24px; font-weight: 900; }
.training-complete h2 { margin: 14px 0 7px; font-family: Georgia, "Noto Serif SC", serif; font-size: 28px; font-weight: 500; }
.training-complete > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.training-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 17px; }
.training-metrics > div { padding: 10px; border-radius: 11px; background: var(--blue-soft); }
.training-metrics > div:nth-child(3n) { background: var(--green-soft); }
.training-metrics span { display: block; color: var(--muted); font-size: 10px; }
.training-metrics strong { display: block; margin-top: 4px; font-family: Georgia, serif; font-size: 17px; font-weight: 500; }
.quantile-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.quantile-list > strong { width: 100%; font-size: 13px; }
.quantile-list > span { padding: 8px 10px; border-radius: 9px; background: var(--violet-soft); color: #4d3999; font-size: 11px; }

@media (max-width: 1220px) {
  .hero h1, .tool-hero h1, .tool-hero p { white-space: normal; }
  .site-header, .hero, .workflow-intro, .workspace, .tool-page, .page-footer { margin-left: 24px; margin-right: 24px; }
  .site-header { margin: 0; padding: 10px 24px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 370px; }
  .prediction-workspace, .training-workspace { grid-template-columns: minmax(0, 1fr) 390px; }
  .phase { padding: 28px; }
  .linear-flow { grid-template-columns: 1fr 18px 1fr; }
  .linear-flow .flow-arrow:nth-of-type(2) { display: none; }
  .linear-flow .flow-node:nth-of-type(3) { grid-column: 1; }
  .linear-flow .flow-arrow:nth-of-type(3) { grid-column: 2; }
  .linear-flow .flow-node:nth-of-type(4) { grid-column: 3; }
  .linear-flow .flow-node:nth-of-type(3), .linear-flow .flow-node:nth-of-type(4) { margin-top: 10px; }
  .evaluation-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .paper-link { display: none; }
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 38px; padding: 62px 0; }
  .hero-aside { grid-template-columns: repeat(3, 1fr); }
  .promise-card.primary { transform: none; }
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .prediction-workspace, .training-workspace { grid-template-columns: minmax(0, 1fr) 350px; }
  .algorithm-strip { grid-template-columns: 1fr; gap: 7px; }
  .algorithm-strip i { transform: rotate(90deg); text-align: center; }
  .decision-paths { grid-template-columns: 1fr; }
  .fork-lines { width: 34%; }
}

@media (max-width: 800px) {
  .site-header { grid-template-columns: 1fr; gap: 8px; padding-bottom: 9px; }
  .brand { display: none; }
  .page-tabs { justify-self: center; }
  .hero-aside { grid-template-columns: 1fr; }
  .abstract-content { grid-template-columns: 1fr; }
  .workflow-intro { grid-template-columns: 1fr; gap: 16px; }
  .workspace { grid-template-columns: 1fr; }
  .prediction-workspace, .training-workspace { grid-template-columns: 1fr; }
  .detail-rail { position: relative; top: 0; height: auto; max-height: none; grid-row: 1; margin-bottom: 18px; }
  .rail-scroll { max-height: 70vh; }
  .flow-column { grid-row: 2; }
  .output-panel, .training-output { position: relative; top: 0; max-height: none; grid-row: 1; }
  .input-panel, .training-form { grid-row: 2; }
  .output-scroll, .training-output-scroll { max-height: 70vh; }
  .feature-grid, .config-grid { grid-template-columns: repeat(2, 1fr); }
  .current-method, .data-role-guide { grid-template-columns: 1fr 1fr; }
  .current-method > p { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .site-header, .hero, .workflow-intro, .workspace, .tool-page, .page-footer { margin-left: 16px; margin-right: 16px; }
  .site-header { margin: 0; padding-left: 16px; padding-right: 16px; }
  .page-tabs { width: 100%; }
  .page-tabs a { min-width: 0; flex: 1; padding-left: 8px; padding-right: 8px; }
  .hero h1 { font-size: 48px; }
  .tool-hero h1 { font-size: 45px; }
  .hero-subtitle { font-size: 17px; }
  .workflow-intro { padding: 25px; }
  .phase { padding: 22px 17px; border-radius: 22px; }
  .phase-header { align-items: flex-start; }
  .phase-index { width: 43px; height: 43px; }
  .phase-header h3 { font-size: 30px; }
  .linear-flow, .train-core { grid-template-columns: 1fr; }
  .linear-flow .flow-arrow, .train-core .flow-arrow { display: block !important; grid-column: 1 !important; transform: rotate(90deg); }
  .linear-flow .flow-node, .train-core .flow-node { grid-column: 1 !important; margin-top: 0 !important; }
  .branch-grid, .evaluation-grid { grid-template-columns: 1fr; }
  .branch-grid::before, .branch-grid .flow-node::before, .test-fork div, .test-merge div { display: none; }
  .fork-lines { width: 72%; }
  .merge-output { align-items: flex-start; text-align: center; }
  .rail-metrics { grid-template-columns: 1fr; }
  .patient-meta-fields, .feature-grid, .config-grid, .source-choice, .dataset-status, .dataset-upload-grid:not([hidden]) { grid-template-columns: 1fr; }
  .current-method, .data-role-guide { grid-template-columns: 1fr; }
  .input-panel form, .training-section { padding: 21px 17px; }
  .page-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
