:root {
  --bg: #f4f0e7;
  --bg-soft: #fbf8f2;
  --panel: rgba(255, 252, 247, 0.94);
  --panel-2: rgba(250, 245, 236, 0.98);
  --line: rgba(82, 98, 122, 0.14);
  --line-strong: rgba(82, 98, 122, 0.28);
  --text: #1f2a37;
  --muted: #5d6b80;
  --accent: #3f6fb2;
  --accent-2: #7b9cc8;
  --good: #5ea77b;
  --warn: #c18b2f;
  --bad: #c86b6b;
  --shadow: 0 18px 50px rgba(70, 58, 40, 0.12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(123, 156, 200, 0.10), transparent 20%),
    radial-gradient(circle at 90% 0%, rgba(63, 111, 178, 0.08), transparent 26%),
    linear-gradient(180deg, #f7f4ee 0%, #efe8dc 100%);
  min-height: 100vh;
}
.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(250, 246, 239, 0.88);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.95), rgba(245, 238, 227, 0.98));
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
}
.brand-title { font-weight: 800; font-size: 17px; }
.brand-subtitle { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 4px; }
.step-nav { display: flex; flex-direction: column; gap: 8px; overflow: auto; max-height: calc(100vh - 130px); padding-right: 4px; }
.step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px 12px;
  text-align: left;
  cursor: pointer;
}
.step-item:hover { background: rgba(63,111,178,0.08); border-color: rgba(63,111,178,0.14); }
.step-item.active { background: rgba(63,111,178,0.12); border-color: var(--line-strong); }
.step-num {
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(63,111,178,0.10);
  color: var(--accent);
}
.step-item.active .step-num { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #ffffff; }
.step-copy { display: flex; flex-direction: column; gap: 4px; }
.step-copy strong { font-size: 14px; line-height: 1.35; }
.step-copy span { font-size: 12px; color: var(--muted); line-height: 1.45; }
.main-column { padding: 18px; }
.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(248, 243, 235, 0.98));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.topbar {
  position: sticky;
  top: 18px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--accent-2);
  margin-bottom: 6px;
}
.topbar-title { font-size: 22px; font-weight: 800; line-height: 1.15; }
.topbar-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.stat-pill {
  min-width: 118px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
}
.stat-pill-wide { min-width: 220px; }
.train-range {
  width: 100%;
  margin-top: 10px;
  accent-color: var(--accent);
}
.stat-pill span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 6px; }
.stat-pill strong { font-size: 20px; }
.topbar-actions { display: flex; gap: 10px; }
.primary-button, .ghost-button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.primary-button { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #ffffff; }
.ghost-button { background: rgba(255,255,255,0.78); color: var(--text); border: 1px solid var(--line); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) 360px; gap: 18px; align-items: start; }
.stage, .comments { padding: 22px; }
.stage-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 14px; }
#stageHeading { margin: 0; font-size: clamp(28px, 3vw, 42px); line-height: 1.08; }
.stage-lead { margin: 0 0 18px; font-size: 18px; line-height: 1.7; color: var(--muted); }
.progress-box { min-width: 200px; }
.topbar-progress { margin-top: 10px; max-width: 320px; }
.progress-label, .progress-text { font-size: 12px; color: var(--muted); }
.progress-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; margin: 8px 0; }
#progressFill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.visual-area { display: flex; flex-direction: column; gap: 16px; }
.photo-strip { display: grid; grid-template-columns: 1fr; gap: 16px; }
.photo-card { border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: rgba(255,255,255,0.78); }
.photo-card img { width: 100%; height: auto; display: block; border-radius: 14px; }
.photo-caption { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255,255,255,0.68);
}
.panel h3, .panel h4 { margin: 0 0 12px; }
.panel p:last-child { margin-bottom: 0; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.data-table th, .data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  font-size: 14px;
  transition: background-color 0.15s ease, font-weight 0.15s ease;
}
.data-table th { color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; background: rgba(63,111,178,0.06); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: rgba(63,111,178,0.08); font-weight: 800; }
.data-table tbody tr.row-correct td { background: rgba(94,167,123,0.12); font-weight: 800; color: #2b6a43; }
.data-table tbody tr.row-wrong td { background: rgba(200,107,107,0.12); font-weight: 800; color: #9f4040; }
.highlight-col { background: rgba(110,242,218,0.08); }
.unknown { color: var(--warn); font-weight: 800; }
.binary { font-weight: 800; }
.tag-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tag {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.78);
  color: var(--text);
}
.feature-chip-wrap { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.feature-chip {
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(63,111,178,0.18);
  background: rgba(255,255,255,0.42);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}
.feature-chip.active {
  background: rgba(94,167,123,0.16);
  border-color: rgba(94,167,123,0.45);
  color: #2b6a43;
  font-weight: 700;
}
.feature-chip.preselected-blur {
  filter: blur(4px);
  opacity: 0.9;
}
.feature-chip.preselected-blur.revealed {
  filter: none;
  opacity: 1;
}
.feature-chip.revealed {
  box-shadow: inset 0 0 0 1px rgba(63,111,178,0.35);
}
.feature-chip.hidden-feature {
  color: transparent;
  text-shadow: 0 0 10px rgba(63,111,178,0.22);
  min-width: 116px;
}
.feature-chip.hidden-feature.revealed {
  color: var(--text);
  text-shadow: none;
  background: rgba(255,255,255,0.78);
}
.quiz-options { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.quiz-option {
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(160, 170, 185, 0.18);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}
.quiz-option.correct {
  background: rgba(94,167,123,0.16);
  border-color: rgba(94,167,123,0.45);
  color: #2b6a43;
  font-weight: 700;
}
.quiz-option.wrong {
  background: rgba(200,107,107,0.14);
  border-color: rgba(200,107,107,0.38);
  color: #9f4040;
  font-weight: 700;
}
.metric-quiz-list { display: flex; flex-direction: column; gap: 14px; }
.metric-quiz-item {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.68);
}
.metric-quiz-item p { margin: 0; }
.metric-quiz-options { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.blurred-panel {
  position: relative;
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}
.blurred-panel.revealed {
  filter: none;
  pointer-events: auto;
  user-select: auto;
}
.reveal-wrap { position: relative; }
.reveal-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(247,244,238,0.25), rgba(247,244,238,0.55));
  border-radius: 18px;
}
.reveal-overlay.hidden { display: none; }
.diagram-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.large-tables-grid { display: grid; grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr); gap: 16px; align-items: center; }
.ellipsis-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 28px;
  letter-spacing: 0.2em;
  font-weight: 800;
}
.table-note { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.truncate-row td {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.mini-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.72);
}
.mini-card strong { display: block; font-size: 14px; margin-bottom: 8px; color: var(--accent-2); }
.split-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split-box { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: rgba(255,255,255,0.72); }
.split-box.train { box-shadow: inset 0 0 0 1px rgba(98,216,159,0.15); }
.split-box.test { box-shadow: inset 0 0 0 1px rgba(255,204,102,0.16); }
.split-box h4 { margin: 0 0 10px; }
.network {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: center;
}
.layer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.node { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 22px rgba(119,176,255,0.35); }
.blackbox-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.blackbox-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.blackbox-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.72);
}
.blackbox {
  min-height: 220px;
  border-radius: 24px;
  background: linear-gradient(180deg, #111111 0%, #232323 100%);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 20px 40px rgba(0,0,0,0.18);
}
.security-scene {
  display: grid;
  grid-template-columns: 1fr 180px 1fr;
  gap: 18px;
  align-items: center;
}
.security-person {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,0.75);
  text-align: center;
}
.security-icon {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 10px;
}
.security-gate {
  min-height: 220px;
  border: 8px solid #64748b;
  border-bottom-width: 14px;
  border-radius: 18px 18px 10px 10px;
  position: relative;
  background: linear-gradient(180deg, rgba(99,102,241,0.06), rgba(255,255,255,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
}
.security-alert {
  position: absolute;
  bottom: 20px;
  right: 14px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: rgba(200,107,107,0.18);
  border: 2px solid rgba(200,107,107,0.45);
  display: grid;
  place-items: center;
  color: #9f4040;
  font-size: 26px;
  font-weight: 800;
}
.blackbox-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.blackbox-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.74);
  text-align: center;
  max-width: 150px;
  line-height: 1.5;
}
.model-types {
  margin-top: 18px;
  border: 1px solid rgba(63,111,178,0.18);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(63,111,178,0.06), rgba(255,255,255,0.72));
}
.flow-demo {
  margin-top: 18px;
  border: 1px solid rgba(63,111,178,0.18);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,0.72);
}
.flow-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.flow-title { font-weight: 800; }
.flow-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 120px;
  gap: 18px;
  align-items: center;
}
.flow-row {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.84);
  display: flex;
  align-items: center;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(0,0,0,0.04);
}
.flow-row.animating {
  animation: flowPulse 1.2s ease;
}
.flow-output {
  min-height: 100px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.flow-output-value {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
  background: rgba(160,170,185,0.18);
  color: var(--text);
}
.flow-output-value.one { background: rgba(94,167,123,0.16); color: #2b6a43; }
.flow-output-value.zero { background: rgba(63,111,178,0.12); color: #2f5a93; }
.flow-caption { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.6; }
@keyframes flowPulse {
  0% { transform: translateX(0); opacity: 0.85; }
  35% { transform: translateX(18px); opacity: 1; }
  70% { transform: translateX(36px); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}
.model-types-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 10px;
}
.model-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 0; }
.confusion {
  display: grid;
  grid-template-columns: 160px repeat(2, minmax(110px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.cell {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.76);
  min-height: 90px;
}
.cell.head { min-height: 64px; display: grid; place-items: center; font-weight: 700; color: var(--accent); }
button.cell.head {
  cursor: pointer;
  background: rgba(255,255,255,0.82);
}
button.cell.head:hover {
  background: rgba(63,111,178,0.10);
}
button.cell.head.active-filter {
  background: rgba(63,111,178,0.14);
  border-color: rgba(63,111,178,0.34);
}
.cell.metric-good { background: rgba(98,216,159,0.11); }
.cell.metric-warn { background: rgba(255,204,102,0.1); }
.cell.metric-bad { background: rgba(255,141,141,0.1); }
.cell .big { display: block; font-size: 30px; font-weight: 800; margin-top: 6px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: rgba(255,255,255,0.74); }
.metric-card strong { display: block; color: var(--accent-2); margin-bottom: 8px; }
.metric-card .big { font-size: 28px; font-weight: 800; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare-card { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: rgba(255,255,255,0.74); }
.comment-block + .comment-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.comments h2, .comments h3 { margin: 0 0 10px; }
.comments p { margin: 0; color: var(--muted); line-height: 1.75; }
.comments p strong.definition-highlight {
  font-weight: 800;
  color: #264d7e;
  background: linear-gradient(180deg, rgba(123,156,200,0.18), rgba(123,156,200,0.10));
  border: 1px solid rgba(63,111,178,0.14);
  border-radius: 8px;
  padding: 1px 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.caption { color: var(--muted); font-size: 14px; line-height: 1.65; }
@media (max-width: 1160px) {
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .step-nav { max-height: none; }
  .topbar { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .main-column { padding: 12px; }
  .stage, .comments, .topbar { padding: 16px; }
  .diagram-grid, .split-layout, .metric-grid, .compare-grid, .photo-strip, .large-tables-grid, .blackbox-wrap, .flow-stage, .security-scene { grid-template-columns: 1fr; }
  .ellipsis-divider { min-height: 16px; }
  .confusion { grid-template-columns: 1fr; }
  .topbar-actions { width: 100%; }
  .topbar-actions button { flex: 1; }
}
