/* ==========================================================================
   BankMarketing AI — asosiy uslublar
   Dizayn tizimi: iliq fon, chuqur yashil, oltin aksent, serif sarlavhalar
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/inter-var-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/fraunces-var-latin.woff2") format("woff2");
}

/* ------------------------------ Tokens ---------------------------------- */
:root {
  --bg: #f7f6f1;
  --bg-soft: #f1f2ea;
  --surface: #ffffff;
  --surface-2: #f3f5ef;
  --surface-3: #e9ede4;
  --ink: #10231c;
  --ink-2: #233c32;
  --muted: #5d7067;
  --muted-2: #7f9188;
  --line: #e1e7de;
  --line-strong: #cfd9cf;
  --primary: #0e5c46;
  --primary-2: #14a97a;
  --primary-3: #0a4937;
  --primary-soft: #e3f3ec;
  --accent: #c98a2e;
  --accent-soft: #f8edda;
  --blue: #3c6e9f;
  --blue-soft: #e5eef7;
  --danger: #bf5a4c;
  --danger-soft: #f8e6e2;
  --chart-1: #0e5c46;
  --chart-2: #14a97a;
  --chart-3: #c98a2e;
  --chart-4: #3c6e9f;
  --chart-5: #8b6bb1;
  --chart-muted: #c6d1c8;
  --chart-grid: #e6ebe4;
  --chart-tip-bg: #10231c;
  --chart-tip-ink: #f4f7f3;
  --footer-bg: #0a1f17;
  --shadow-xs: 0 1px 2px rgba(16, 35, 28, 0.05);
  --shadow-sm: 0 1px 2px rgba(16, 35, 28, 0.04), 0 8px 20px -10px rgba(16, 35, 28, 0.12);
  --shadow: 0 1px 2px rgba(16, 35, 28, 0.04), 0 18px 40px -22px rgba(16, 35, 28, 0.22);
  --shadow-lg: 0 2px 4px rgba(16, 35, 28, 0.04), 0 32px 80px -36px rgba(16, 35, 28, 0.35);
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --container: 1200px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #07130f;
  --bg-soft: #0a1913;
  --surface: #0d1d17;
  --surface-2: #11261e;
  --surface-3: #173128;
  --ink: #eaf3ed;
  --ink-2: #cfe0d6;
  --muted: #9db2a7;
  --muted-2: #7b9186;
  --line: #1d342a;
  --line-strong: #2a463a;
  --primary: #36d6a2;
  --primary-2: #6fe7bd;
  --primary-3: #1fb485;
  --primary-soft: #102c22;
  --accent: #e3b05c;
  --accent-soft: #2b2417;
  --blue: #7aabe0;
  --blue-soft: #142438;
  --danger: #e08070;
  --danger-soft: #2d1916;
  --chart-1: #36d6a2;
  --chart-2: #6fe7bd;
  --chart-3: #e3b05c;
  --chart-4: #7aabe0;
  --chart-5: #b79ade;
  --chart-muted: #355347;
  --chart-grid: #1a3027;
  --chart-tip-bg: #eaf3ed;
  --chart-tip-ink: #10231c;
  --footer-bg: #050f0b;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 20px -10px rgba(0, 0, 0, 0.5);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 40px -22px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 32px 80px -36px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ------------------------------ Reset ----------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--primary-2);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--primary-2);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: none;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 300;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--danger);
  color: #fff;
  text-align: center;
}

/* ------------------------------ Typography ------------------------------ */
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.9rem, 6vw, 4.9rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(2rem, 3.6vw, 3.15rem);
  line-height: 1.08;
}

h3 {
  font-size: clamp(1.12rem, 1.6vw, 1.32rem);
}

h4 {
  font-size: 0.98rem;
}

p {
  margin: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

strong,
b {
  font-weight: 650;
}

/* ------------------------------ Layout ---------------------------------- */
.container {
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: clamp(72px, 9vw, 118px);
}

.section-alt {
  background:
    radial-gradient(ellipse at 0% 0%, color-mix(in srgb, var(--primary-2) 6%, transparent), transparent 42%),
    var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 48px;
  align-items: start;
}

.section-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}

.section-index::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line-strong);
}

.section-head-text {
  max-width: 820px;
}

/* Grid/flex bolalari jadval yoki rasm kengligi bilan sahifani cho‘zmasin. */
.hero-copy,
.hero-visual,
.data-tables,
.table-block,
.table-scroll,
.chart-card,
.model-grid,
.tree-card,
.tree-image-wrap,
.code-layout,
.code-main,
.code-side,
.predict-grid,
.predict-form,
.result-column,
.batch-card,
.conversion-grid,
.how-strip,
.footer-top,
.footer-col,
.confusion,
.importance-row {
  min-width: 0;
}

.section-head-text p {
  max-width: 720px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.02rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

[data-theme="dark"] .eyebrow {
  color: var(--primary-2);
}

.eyebrow-pill {
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--primary-2) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-soft) 70%, transparent);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--primary);
}

.accent-serif {
  color: var(--primary);
  position: relative;
  white-space: nowrap;
}

.accent-serif::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 0.04em;
  height: 0.14em;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-2), var(--accent));
  opacity: 0.45;
  transform: scaleX(0.96);
  transform-origin: left;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted-2);
}

/* ------------------------------ Buttons --------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    transform 0.22s var(--ease),
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--primary) 60%, transparent);
}

[data-theme="dark"] .btn-primary {
  background: var(--primary-2);
  color: #062019;
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--primary-2) 50%, transparent);
}

.btn-primary:hover {
  background: var(--primary-3);
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--primary);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--primary-2);
  background: var(--surface);
  color: var(--primary);
}

[data-theme="dark"] .btn-ghost:hover {
  color: var(--primary-2);
}

.btn-lg {
  padding: 15px 24px;
  font-size: 0.98rem;
}

.btn-sm {
  padding: 9px 15px;
  font-size: 0.8rem;
}

.btn-sm svg {
  width: 16px;
  height: 16px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.text-link svg {
  width: 15px;
  height: 15px;
}

.text-link:hover {
  border-color: var(--primary);
}

[data-theme="dark"] .text-link {
  color: var(--primary-2);
}

/* ------------------------------ Badges ---------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-green {
  background: var(--primary-soft);
  color: var(--primary);
}

[data-theme="dark"] .badge-green {
  color: var(--primary-2);
}

.badge-amber {
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
}

.badge-red {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-muted {
  background: var(--surface-2);
  color: var(--muted);
}

/* ------------------------------ Header ---------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px -24px rgba(16, 35, 28, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--primary) 70%, transparent);
}

[data-theme="dark"] .brand-mark {
  background: var(--primary-2);
  color: #062019;
}

.brand-mark svg {
  width: 26px;
  height: 26px;
}

.brand-name {
  font-size: 1.02rem;
  white-space: nowrap;
}

.brand-name em {
  font-style: normal;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.78em;
  letter-spacing: 0.02em;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--primary-soft);
  vertical-align: 2px;
}

[data-theme="dark"] .brand-name em {
  color: var(--primary-2);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline: auto;
}

.nav a {
  position: relative;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 550;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
}

.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary-2);
  transform: translateX(-50%);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.lang-chip {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: block;
}

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.2s ease;
}

.menu-btn[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-btn[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-2), var(--accent));
  transition: width 0.1s linear;
}

/* ------------------------------ Hero ------------------------------------ */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(56px, 8vw, 100px));
  padding-bottom: 48px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.orb-a {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: color-mix(in srgb, var(--primary-2) 26%, transparent);
}

.orb-b {
  width: 460px;
  height: 460px;
  top: 80px;
  right: -140px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  animation-delay: -5s;
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 10%, transparent 75%);
  opacity: 0.7;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-copy h1 {
  margin-top: 18px;
}

.hero-lead {
  max-width: 590px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.hero-stat:first-child {
  padding-left: 0;
  border-left: 0;
}

.hero-stat strong {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.hero-stat span {
  color: var(--muted-2);
  font-size: 0.72rem;
  line-height: 1.3;
}

.hero-visual {
  position: relative;
  justify-self: center;
  width: min(100%, 470px);
}

.hero-card {
  position: relative;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: rotate(1.2deg);
  transition: transform 0.5s var(--ease);
}

.hero-card:hover {
  transform: rotate(0deg) translateY(-3px);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--primary-2) 45%, transparent), transparent 35%, transparent 65%, color-mix(in srgb, var(--accent) 35%, transparent));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-2);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-2) 55%, transparent);
  animation: livePulse 2.2s infinite;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-2);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-2) 55%, transparent);
  animation: livePulse 2.2s infinite;
}

.hero-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 4px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: linear-gradient(140deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-profile div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hero-profile strong {
  font-size: 0.9rem;
}

.hero-profile span {
  color: var(--muted-2);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-tag {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary) !important;
  font-size: 0.62rem !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="dark"] .profile-tag {
  color: var(--primary-2) !important;
}

.hero-gauge-wrap {
  height: 150px;
  margin: 4px 0 0;
}

.hero-gauge {
  width: 100%;
  height: 100%;
}

.hero-verdict {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: -4px;
}

.hero-verdict-note {
  color: var(--muted-2);
  font-size: 0.7rem;
}

.hero-factors {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.hero-factor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
}

.hero-factor span {
  color: var(--muted);
}

.hero-factor b {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 650;
}

.pos {
  color: var(--primary-2);
}

.neg {
  color: var(--danger);
}

.hero-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 0.64rem;
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.float-chip {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: chipFloat 7s ease-in-out infinite;
}

.float-chip div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.float-chip strong {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.float-chip span {
  color: var(--muted-2);
  font-size: 0.62rem;
}

.chip-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.chip-icon svg {
  width: 17px;
  height: 17px;
}

.chip-icon-green {
  background: var(--primary-soft);
  color: var(--primary);
}

[data-theme="dark"] .chip-icon-green {
  color: var(--primary-2);
}

.chip-icon-gold {
  background: var(--accent-soft);
  color: var(--accent);
}

.chip-icon-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.chip-a {
  top: -18px;
  left: -34px;
  animation-delay: -1s;
}

.chip-b {
  top: 38%;
  right: -46px;
  animation-delay: -3s;
}

.chip-c {
  bottom: -52px;
  left: 18px;
  animation-delay: -5s;
}

.hero-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: clamp(48px, 7vw, 84px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.strip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.strip-item b {
  color: var(--ink);
  font-weight: 600;
}

.strip-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--primary);
  background: var(--surface);
}

[data-theme="dark"] .strip-icon {
  color: var(--primary-2);
}

.strip-icon svg {
  width: 17px;
  height: 17px;
}

/* ------------------------------ KPI ------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s ease, border-color 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary-2) 35%, var(--line));
  box-shadow: var(--shadow);
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 11px;
}

.kpi-icon svg {
  width: 21px;
  height: 21px;
}

.kpi-green {
  background: var(--primary-soft);
  color: var(--primary);
}

[data-theme="dark"] .kpi-green {
  color: var(--primary-2);
}

.kpi-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.kpi-gold {
  background: var(--accent-soft);
  color: var(--accent);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 2.6vw, 2.5rem);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  margin-top: 6px;
  font-size: 0.84rem;
  font-weight: 600;
}

.kpi-note {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 0.7rem;
}

/* ------------------------------ Cards ----------------------------------- */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-head h3 {
  font-size: 1.02rem;
}

.card-head p {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 0.75rem;
  line-height: 1.5;
}

.card-head p b {
  color: var(--ink);
}

.chart-tag {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ------------------------------ Charts ---------------------------------- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.chart-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.chart-card:hover {
  border-color: color-mix(in srgb, var(--primary-2) 22%, var(--line));
  box-shadow: var(--shadow-sm);
}

.chart {
  position: relative;
  width: 100%;
  margin-top: 16px;
}

.chart--md { height: 236px; }
.chart--jobs { height: 330px; }
.chart--mini { height: 150px; margin-top: 8px; }
.chart--donut { height: 190px; margin-top: 6px; }
.chart--conversion { height: 260px; margin-top: 0; }
.chart--curve { height: 300px; }

.chart-note {
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 0.68rem;
  line-height: 1.5;
}

.chart-note code {
  color: var(--muted);
}

.chart-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-text {
  fill: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 10.5px;
}

.chart-text-strong {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 650;
}

.chart-grid-line {
  stroke: var(--chart-grid);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.chart-axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart-bar {
  fill: var(--chart-2);
  transition: opacity 0.2s ease;
  cursor: default;
}

.chart-bar:hover {
  opacity: 0.78;
}

.chart-bar-alt {
  fill: var(--chart-3);
}

.chart-bar-muted {
  fill: var(--chart-muted);
}

.chart-bar-soft {
  fill: color-mix(in srgb, var(--chart-2) 22%, transparent);
}

.chart-line {
  fill: none;
  stroke: var(--chart-2);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-alt {
  fill: none;
  stroke: var(--chart-4);
  stroke-width: 2.2;
  stroke-dasharray: 5 5;
  stroke-linecap: round;
}

.chart-point {
  fill: var(--surface);
  stroke: var(--chart-2);
  stroke-width: 2.2;
}

.chart-dot {
  fill: var(--chart-3);
}

.chart-tip {
  position: absolute;
  z-index: 5;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--chart-tip-bg);
  color: var(--chart-tip-ink);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -120%);
  transition: opacity 0.12s ease;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.4);
}

.chart-tip.is-visible {
  opacity: 1;
}

.chart-area {
  fill: var(--chart-2);
  opacity: 0.08;
}

/* Donut */
.donut-track {
  stroke: var(--surface-2);
}

.donut-seg-1 {
  stroke: var(--chart-muted);
}

.donut-seg-2 {
  stroke: var(--chart-2);
}

.donut-seg-3 {
  stroke: var(--chart-3);
}

.donut-center-value {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 550;
  letter-spacing: -0.03em;
}

.donut-center-sub {
  fill: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 9.5px;
}

/* Gauge */
.gauge-track {
  stroke: var(--surface-2);
}

.gauge-band-muted {
  stroke: var(--chart-muted);
}

.gauge-band-blue {
  stroke: var(--blue);
}

.gauge-band-amber {
  stroke: var(--accent);
}

.gauge-band-green {
  stroke: var(--chart-2);
}

.gauge-needle {
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.gauge-hub {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
}

.gauge-hub-dot {
  fill: var(--ink);
}

.gauge-value {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 550;
  letter-spacing: -0.04em;
}

.gauge-sub {
  fill: var(--muted-2);
  font-family: var(--font-sans);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gauge-tick-label {
  fill: var(--muted-2);
  font-family: var(--font-mono);
}

.gauge-threshold-line {
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.6;
}

.gauge-base-dot {
  fill: var(--ink);
  opacity: 0.35;
}

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.donut-legend {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.donut-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
}

.donut-legend-row .legend-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
}

.donut-legend-row span:nth-child(2) {
  color: var(--muted);
}

.donut-legend-row b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.mini-charts {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.mini-title {
  color: var(--muted-2);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.conversion-card {
  padding: 28px;
}

.conversion-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 36px;
  align-items: center;
}

.conversion-copy h3 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 500;
  line-height: 1.12;
}

.conversion-copy p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.conversion-copy p b {
  color: var(--ink);
}

.insight-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--primary-2) 25%, var(--line));
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 600;
}

[data-theme="dark"] .insight-pill {
  color: var(--primary-2);
}

/* ------------------------------ Tables ---------------------------------- */
.data-tables {
  display: grid;
  gap: 22px;
  margin-top: 28px;
}

.table-block {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.table-head h3 {
  font-size: 1.02rem;
}

.table-head p {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 0.74rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  white-space: nowrap;
}

.data-table th {
  padding: 10px 14px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  color: var(--ink-2);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--primary-soft) 40%, transparent);
}

.data-table code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 0.72rem;
}

[data-theme="dark"] .data-table code {
  color: var(--primary-2);
}

.type-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 650;
}

.type-pill-target {
  background: var(--accent-soft);
  color: var(--accent);
}

.preview-table .label-yes {
  color: var(--primary);
  font-weight: 650;
}

[data-theme="dark"] .preview-table .label-yes {
  color: var(--primary-2);
}

.preview-table .label-no {
  color: var(--muted-2);
}

/* ------------------------------ Pipeline -------------------------------- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.pipeline-step {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.pipeline-step::after {
  content: "";
  position: absolute;
  top: 28px;
  right: -15px;
  width: 16px;
  height: 1px;
  background: var(--line-strong);
}

.pipeline-step:last-child::after {
  display: none;
}

.step-num {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--primary-2);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pipeline-step h3 {
  font-size: 0.9rem;
}

.pipeline-step p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.pipeline-step code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 0.66rem;
}

/* ------------------------------ Metrics --------------------------------- */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  position: relative;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 2px;
  background: color-mix(in srgb, var(--primary-2) 50%, transparent);
  border-radius: 0 0 2px 2px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.metric-label {
  display: block;
  color: var(--muted-2);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 2.6vw, 2.4rem);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.metric-desc {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.metric-hero {
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary-2) 12%, transparent), transparent 55%),
    var(--surface);
}

.metric-accent .metric-value {
  color: var(--accent);
}

.metric-spark {
  height: 4px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.metric-spark span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

/* ------------------------------ Model grid ------------------------------ */
.model-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.confusion-card,
.curve-card,
.importance-card,
.params-card {
  padding: 22px;
}

.confusion {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.confusion-corner,
.confusion-axis,
.confusion-cell {
  border-radius: 10px;
}

.confusion-axis {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--muted-2);
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.confusion-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 88px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--cell-color, var(--primary-2)) calc(var(--tone, 0.2) * 26%), var(--surface));
  transition: transform 0.25s var(--ease);
}

.confusion-cell:hover {
  transform: translateY(-2px);
}

.confusion-cell strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 550;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.confusion-cell span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.3;
}

.confusion-cell em {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 0.6rem;
  font-style: normal;
}

.confusion-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.confusion-summary > div {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}

.confusion-summary span {
  display: block;
  color: var(--muted-2);
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.confusion-summary b {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 550;
  line-height: 1.1;
}

.confusion-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.66rem;
}

.confusion-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--muted-2);
}

.legend-tn { background: var(--blue); }
.legend-fp { background: var(--accent); }
.legend-fn { background: var(--danger); }
.legend-tp { background: var(--primary-2); }

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}

.segmented button {
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

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

.curve-meta div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--surface-2);
}

.curve-meta span {
  color: var(--muted-2);
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.curve-meta strong {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ Importance ------------------------------ */
.importance-list {
  display: grid;
  gap: 11px;
  margin-top: 20px;
}

.importance-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 48px;
  gap: 12px;
  align-items: center;
}

.importance-label {
  color: var(--ink-2);
  font-size: 0.74rem;
  line-height: 1.3;
}

.importance-track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.importance-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transform-origin: left;
  transition: width 0.8s var(--ease);
}

.importance-row:nth-child(2) .importance-fill {
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary-2) 70%, var(--blue)), var(--primary-2));
}

.importance-row:nth-child(n + 4) .importance-fill {
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary-2) 55%, var(--chart-muted)), var(--primary-2));
}

.importance-value {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.callout {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  line-height: 1.55;
}

.callout svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.callout strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.74rem;
}

.callout p {
  color: var(--muted);
}

.callout-warn {
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 55%, transparent);
  color: color-mix(in srgb, var(--accent) 75%, var(--ink));
}

[data-theme="dark"] .callout-warn {
  color: var(--accent);
}

/* ------------------------------ Params ---------------------------------- */
.param-list {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
}

.param-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}

.param-row:last-child {
  border-bottom: 0;
}

.param-row dt {
  color: var(--muted);
  font-size: 0.72rem;
}

.param-row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: right;
}

.cv-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.cv-box > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2);
}

.cv-box span {
  color: var(--muted-2);
  font-size: 0.6rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cv-box strong {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.cv-box em {
  color: var(--muted-2);
  font-size: 0.62rem;
  font-style: normal;
}

/* ------------------------------ Methodology ----------------------------- */
.methodology {
  display: flex;
  gap: 22px;
  margin-top: 8px;
  padding: clamp(24px, 3.4vw, 38px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary-2) 18%, transparent), transparent 45%),
    linear-gradient(135deg, var(--primary-3), var(--primary));
  color: #f2f8f4;
  box-shadow: var(--shadow);
}

[data-theme="dark"] .methodology {
  background:
    radial-gradient(circle at 100% 0%, rgba(54, 214, 162, 0.16), transparent 45%),
    linear-gradient(135deg, #0b2e23, #0e3f30);
}

.methodology-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.methodology-icon svg {
  width: 26px;
  height: 26px;
}

.methodology .eyebrow {
  color: #9fe7c9;
}

.methodology h3 {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 500;
}

.methodology-body > p {
  max-width: 850px;
  margin-top: 10px;
  color: rgba(242, 248, 244, 0.78);
  font-size: 0.82rem;
  line-height: 1.65;
}

.methodology-body > p b,
.methodology-body > p em {
  color: #fff;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  max-width: 700px;
}

.compare-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.compare-card span {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

.compare-card strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 550;
  line-height: 1.1;
}

.compare-card em {
  font-size: 0.64rem;
  font-style: normal;
  opacity: 0.75;
}

.compare-card small {
  margin-top: 4px;
  font-size: 0.58rem;
  opacity: 0.55;
}

.compare-old {
  border-style: dashed;
}

.compare-new {
  border-color: rgba(159, 231, 201, 0.5);
  background: rgba(159, 231, 201, 0.1);
}

.compare-arrow {
  color: rgba(255, 255, 255, 0.45);
  font-size: 1.2rem;
}

/* ------------------------------ Tree ------------------------------------ */
.tree-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
  align-items: center;
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.tree-copy h3 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 500;
}

.tree-copy p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.tree-copy .btn {
  margin-top: 16px;
}

.tree-image-wrap {
  position: relative;
  overflow: auto;
  max-height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  scrollbar-width: thin;
}

.tree-image-wrap img {
  width: 100%;
  min-width: 700px;
  height: auto;
}

.tree-image-wrap::after {
  content: "";
  position: sticky;
  right: 0;
  bottom: 0;
  display: block;
  height: 20px;
  margin-top: -20px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9));
  pointer-events: none;
}

/* ------------------------------ Predict --------------------------------- */
.predict-section {
  background:
    radial-gradient(ellipse at 85% 5%, color-mix(in srgb, var(--primary-2) 7%, transparent), transparent 38%),
    var(--bg);
}

.predict-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 22px;
  align-items: start;
}

.predict-form {
  display: grid;
  gap: 16px;
}

.form-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.form-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.form-step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

[data-theme="dark"] .form-step {
  color: var(--primary-2);
}

.form-card-head h3 {
  font-size: 0.98rem;
}

.form-card-head p {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 0.7rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 16px;
}

.field:first-of-type {
  margin-top: 0;
}

.field label {
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 600;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field-value {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .field-value {
  color: var(--primary-2);
}

.field-hint {
  color: var(--muted-2);
  font-size: 0.64rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-row .field {
  margin-top: 16px;
}

.range-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 14px;
  align-items: center;
}

.range {
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  accent-color: var(--primary-2);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) var(--fill, 50%), var(--surface-3) var(--fill, 50%));
}

.range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6.5px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--primary-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  -webkit-appearance: none;
  appearance: none;
}

.range::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
}

.range::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--primary);
}

.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--primary-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.num-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.num-input:focus {
  border-color: var(--primary-2);
  background: var(--surface);
  outline: none;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  padding: 11px 38px 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.select-wrap select:focus {
  border-color: var(--primary-2);
  background: var(--surface);
  outline: none;
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted-2);
  pointer-events: none;
  transform: translateY(-50%);
}

.switch-list {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding-top: 4px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  cursor: pointer;
}

.switch-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.switch-copy b {
  font-size: 0.76rem;
  font-weight: 600;
}

.switch-copy small {
  color: var(--muted-2);
  font-size: 0.64rem;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  display: block;
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: var(--surface-3);
  transition: background-color 0.2s ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s var(--ease);
}

.switch input:checked + .switch-track {
  background: var(--primary-2);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(19px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--primary-2);
  outline-offset: 3px;
}

.switch-state {
  min-width: 26px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 650;
  text-align: right;
}

.form-extras {
  padding: 2px 2px 0;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.preset-label {
  color: var(--muted-2);
  font-size: 0.68rem;
  font-weight: 600;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.chip-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary-2);
  background: var(--primary-soft);
  color: var(--primary);
}

[data-theme="dark"] .chip-btn:hover {
  color: var(--primary-2);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 0.66rem;
  line-height: 1.5;
}

.privacy-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 1px;
}

/* ------------------------------ Result ---------------------------------- */
.result-column {
  position: sticky;
  top: calc(var(--header-h) + 18px);
}

.result-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2) 55%, var(--accent));
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.result-gauge-wrap {
  height: 142px;
  margin: 8px 0 -4px;
}

.result-gauge {
  width: 100%;
  height: 100%;
}

.result-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.result-percent {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 3.8rem);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.result-label {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.result-base {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 0.64rem;
}

.result-base b {
  color: var(--ink);
}

.result-verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  text-align: center;
}

.result-verdict p {
  color: var(--muted);
  font-size: 0.72rem;
}

.recommendation {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary-2) 22%, var(--line));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary-soft) 55%, transparent);
}

.rec-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--surface);
  color: var(--primary);
}

[data-theme="dark"] .rec-icon {
  color: var(--primary-2);
}

.rec-icon svg {
  width: 18px;
  height: 18px;
}

.recommendation strong {
  display: block;
  font-size: 0.74rem;
}

.recommendation p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.threshold-box {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}

.threshold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
}

.threshold-head b {
  color: var(--ink);
  font-family: var(--font-mono);
}

.threshold-bar {
  position: relative;
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.threshold-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--accent) 60%, var(--primary-2));
  transition: width 0.7s var(--ease);
}

.threshold-mark {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.55;
}

.threshold-box p {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 0.6rem;
}

.factor-block {
  margin-top: 16px;
}

.factor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.factor-head h3 {
  font-size: 0.76rem;
}

.factor-hint {
  color: var(--muted-2);
  font-size: 0.58rem;
}

.factor-list {
  display: grid;
  gap: 9px;
  margin-top: 9px;
}

.factor-empty {
  color: var(--muted-2);
  font-size: 0.7rem;
}

.factor-row {
  display: grid;
  gap: 4px;
}

.factor-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.factor-row-head span {
  color: var(--muted);
  font-size: 0.66rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.factor-row-head b {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.factor-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.factor-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--line-strong);
}

.factor-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  transition: width 0.5s var(--ease), left 0.5s var(--ease);
}

.factor-bar.pos {
  left: 50%;
  background: var(--primary-2);
}

.factor-bar.neg {
  background: var(--danger);
}

.agreement {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.agreement-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.64rem;
}

.agreement-head b {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.agreement-bar {
  height: 5px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.agreement-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.6s var(--ease);
}

.agreement p {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 0.58rem;
}

.sample-note {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.5;
}

.sample-note b {
  color: var(--ink);
}

.sample-note .sample-ok {
  color: var(--primary);
}

[data-theme="dark"] .sample-note .sample-ok {
  color: var(--primary-2);
}

.sample-note .sample-bad {
  color: var(--danger);
}

.result-disclaimer {
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 0.58rem;
  line-height: 1.5;
  text-align: center;
}

.result-card.is-updating .result-percent {
  animation: resultFlash 0.45s ease;
}

/* ------------------------------ How strip ------------------------------- */
.how-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.how-step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.how-num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
}

[data-theme="dark"] .how-num {
  color: var(--primary-2);
}

.how-step div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.how-step strong {
  font-size: 0.74rem;
}

.how-step span {
  color: var(--muted-2);
  font-size: 0.62rem;
}

.how-line {
  width: 40px;
  height: 1px;
  background: var(--line-strong);
}

/* ------------------------------ Batch ----------------------------------- */
.batch-card {
  margin-top: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.batch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.batch-head h3 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 500;
}

.batch-head p {
  max-width: 620px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 20px;
  padding: 32px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--primary-2);
  background: var(--primary-soft);
}

.dropzone.is-dragover {
  transform: scale(1.005);
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--primary);
}

[data-theme="dark"] .dropzone-icon {
  color: var(--primary-2);
}

.dropzone-icon svg {
  width: 24px;
  height: 24px;
}

.dropzone strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.dropzone span {
  font-size: 0.74rem;
}

.dropzone u {
  color: var(--primary);
  text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
  text-underline-offset: 3px;
}

[data-theme="dark"] .dropzone u {
  color: var(--primary-2);
}

.dropzone small {
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 0.62rem;
}

.batch-status {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.72rem;
}

.batch-status.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.batch-error {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.74rem;
  line-height: 1.5;
}

.batch-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.batch-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
}

.batch-stat span {
  color: var(--muted-2);
  font-size: 0.6rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.batch-stat strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 550;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.batch-results {
  margin-top: 20px;
}

.batch-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.batch-results-head h4 {
  font-size: 0.86rem;
}

.batch-results-head p {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 0.66rem;
}

.prob-pill {
  display: inline-block;
  min-width: 48px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 650;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.prob-pill.is-high {
  background: var(--primary-soft);
  color: var(--primary);
}

[data-theme="dark"] .prob-pill.is-high {
  color: var(--primary-2);
}

.prob-pill.is-mid {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ------------------------------ Code ------------------------------------ */
.code-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.code-main {
  min-width: 0;
}

.code-tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.code-tabs button {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.code-tabs button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.code-tabs button.is-active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.code-panel {
  display: none;
  overflow: hidden;
  border: 1px solid #1e352b;
  border-radius: var(--radius);
  background: #0a1712;
  box-shadow: var(--shadow);
}

.code-panel.is-active {
  display: block;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid #1e352b;
  background: #0d1d17;
}

.code-head > span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.code-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.code-dot.red { background: #e06a5a; }
.code-dot.amber { background: #e3b05c; }
.code-dot.green { background: #43c996; }

.code-head b {
  margin-left: 6px;
  color: #9db2a7;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  padding: 4px 9px;
  border: 1px solid #28463a;
  border-radius: 6px;
  background: transparent;
  color: #9db2a7;
  font-size: 0.62rem;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.copy-btn:hover {
  background: #163128;
  color: #eaf3ed;
}

.code-pre {
  max-height: 480px;
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #28463a transparent;
}

.code-pre code {
  display: block;
  color: #d6e6dd;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.75;
  white-space: pre;
  tab-size: 4;
}

.tok-com { color: #718c7f; font-style: italic; }
.tok-str { color: #e3b05c; }
.tok-key { color: #6fe7bd; font-weight: 550; }
.tok-num { color: #8fb8ff; }
.tok-fn { color: #f0d9a8; }

.code-side {
  display: grid;
  gap: 14px;
}

.file-tree-card,
.code-cta-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.file-tree-card h3,
.code-cta-card h3 {
  margin-bottom: 10px;
  font-size: 0.88rem;
}

.file-tree {
  margin: 0;
  overflow-x: auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.75;
}

.ft-folder { color: var(--primary); font-weight: 650; }
[data-theme="dark"] .ft-folder { color: var(--primary-2); }
.ft-file { color: var(--muted); }

.code-cta-card p {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.inline-code {
  display: block;
  margin: 10px 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 0.66rem;
  overflow-x: auto;
  white-space: nowrap;
}

[data-theme="dark"] .inline-code {
  color: var(--primary-2);
}

.code-cta-card .btn {
  margin-top: 10px;
}

.code-cta-muted {
  background: var(--surface-2);
}

.code-cta-muted .text-link {
  margin-top: 6px;
  font-size: 0.68rem;
}

/* ------------------------------ FAQ ------------------------------------- */
.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.faq-intro {
  position: sticky;
  top: calc(var(--header-h) + 32px);
}

.faq-intro h2 {
  margin-top: 8px;
}

.faq-intro > p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.faq-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.72rem;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.25s var(--ease), background-color 0.2s ease, color 0.2s ease;
}

.faq-item[open] summary::after {
  content: "−";
  background: var(--primary-soft);
  color: var(--primary);
  transform: rotate(180deg);
}

[data-theme="dark"] .faq-item[open] summary::after {
  color: var(--primary-2);
}

.faq-item summary:hover {
  color: var(--primary);
}

[data-theme="dark"] .faq-item summary:hover {
  color: var(--primary-2);
}

.faq-answer {
  padding: 0 40px 20px 0;
}

.faq-answer p {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.7;
}

.faq-answer code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 0.72rem;
}

[data-theme="dark"] .faq-answer code {
  color: var(--primary-2);
}

/* ------------------------------ Footer ---------------------------------- */
.site-footer {
  position: relative;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(20, 169, 122, 0.12), transparent 45%),
    var(--footer-bg);
  color: #d9e7df;
  padding-top: 56px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
  padding-bottom: 42px;
}

.brand-footer {
  color: #f2f8f4;
}

.brand-footer .brand-mark {
  background: var(--primary-2);
  color: #062019;
}

.brand-footer .brand-name em {
  background: rgba(255, 255, 255, 0.1);
  color: #9fe7c9;
}

.footer-brand p {
  max-width: 340px;
  margin-top: 14px;
  color: #9db3a8;
  font-size: 0.76rem;
  line-height: 1.65;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.footer-badges span {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #9db3a8;
  font-size: 0.6rem;
  font-weight: 600;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col h4 {
  margin-bottom: 4px;
  color: #f2f8f4;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-col a {
  width: fit-content;
  color: #9db3a8;
  font-size: 0.74rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-note p {
  color: #9db3a8;
  font-size: 0.72rem;
  line-height: 1.6;
}

.footer-lang {
  display: inline-block;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #9db3a8;
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #7f978c;
  font-size: 0.66rem;
}

.footer-credit a {
  color: #c6d8ce;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* ------------------------------ Utilities ------------------------------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s var(--ease), color 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  color: var(--primary);
}

.to-top svg {
  width: 19px;
  height: 19px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
  overflow: auto;
  padding: 72px 32px 32px;
  background: rgba(4, 12, 9, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  display: block;
  margin: 0 auto;
  max-width: none;
  max-height: 88vh;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
}

.toast-container {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.74rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s var(--ease);
}

.toast.is-out {
  animation: toastOut 0.25s ease forwards;
}

/* ------------------------------ Reveal ---------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0s);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ------------------------------ Animations ------------------------------ */
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-2) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(30px, -24px, 0) scale(1.06); }
}

@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes resultFlash {
  0% { transform: scale(0.97); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

@keyframes barGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 1100px) {
  .hero-grid {
    gap: 40px;
  }

  .chip-b {
    right: -18px;
  }

  .chip-c {
    left: -18px;
  }

  .code-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .footer-top {
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: 28px;
  }
}

@media (max-width: 940px) {
  :root {
    --header-h: 64px;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .nav a.is-active {
    background: var(--primary-soft);
    color: var(--primary);
  }

  [data-theme="dark"] .nav a.is-active {
    color: var(--primary-2);
  }

  .nav a.is-active::after {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }

  .header-cta {
    display: none;
  }

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

  .hero-copy {
    max-width: 720px;
  }

  .hero-visual {
    width: min(100%, 520px);
    margin-top: 12px;
  }

  .hero-card {
    transform: none;
  }

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

  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }

  .conversion-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

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

  .pipeline-step:nth-child(3n)::after {
    display: none;
  }

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

  .model-grid,
  .model-grid-2 {
    grid-template-columns: 1fr;
  }

  .methodology {
    flex-direction: column;
    gap: 16px;
  }

  .tree-card {
    grid-template-columns: 1fr;
  }

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

  .result-column {
    position: static;
  }

  .how-strip {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 14px;
  }

  .how-line {
    display: none;
  }

  .code-layout {
    grid-template-columns: 1fr;
  }

  .code-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .faq-layout {
    grid-template-columns: 1fr;
  }

  .faq-intro {
    position: static;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(var(--container), 100% - 32px);
  }

  .section {
    padding-block: 64px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 32px;
  }

  .section-index {
    padding-top: 0;
  }

  .section-index::after {
    width: 22px;
  }

  .hero {
    padding-top: calc(var(--header-h) + 44px);
  }

  .hero-copy h1 {
    font-size: clamp(2.55rem, 11vw, 3.6rem);
  }

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

  .hero-cta .btn {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 16px 0;
    margin-top: 30px;
  }

  .hero-stat:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .hero-stat {
    padding-left: 14px;
  }

  .float-chip {
    display: none;
  }

  .hero-card {
    padding: 18px;
  }

  .hero-gauge-wrap {
    height: 132px;
  }

  .hero-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .chart-card,
  .conversion-card,
  .batch-card {
    padding: 18px;
  }

  .chart--jobs {
    height: 360px;
  }

  .chart--md {
    height: 220px;
  }

  .chart--curve {
    height: 250px;
  }

  .table-head {
    flex-direction: column;
  }

  .table-head .btn {
    align-self: flex-start;
  }

  .data-table th,
  .data-table td {
    padding: 9px 11px;
  }

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

  .pipeline-step::after {
    display: none;
  }

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

  .importance-row {
    grid-template-columns: 108px minmax(0, 1fr) 42px;
    gap: 8px;
  }

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

  .compare-arrow {
    display: none;
  }

  .confusion {
    grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px;
  }

  .confusion-cell {
    min-height: 74px;
    padding: 10px;
  }

  .confusion-cell strong {
    font-size: 1.2rem;
  }

  .confusion-axis {
    font-size: 0.56rem;
    padding: 4px;
  }

  .curve-meta {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 18px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .range-wrap {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 10px;
  }

  .how-strip {
    padding: 16px;
  }

  .batch-head,
  .batch-results-head {
    flex-direction: column;
  }

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

  .code-side {
    grid-template-columns: 1fr;
  }

  .code-tabs {
    padding-bottom: 8px;
  }

  .code-pre {
    padding: 14px;
  }

  .code-pre code {
    font-size: 0.72rem;
  }

  .faq-answer {
    padding-right: 0;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .lightbox {
    padding: 12px;
  }

  .toast-container {
    bottom: 20px;
    width: calc(100% - 32px);
  }

  .toast {
    text-align: center;
  }

  .to-top {
    display: none;
  }
}

@media (max-width: 420px) {
  .lang-chip {
    display: none;
  }

  .header-actions {
    gap: 4px;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .hero-stat strong {
    font-size: 1.45rem;
  }

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

  .form-actions .btn {
    flex: 1 1 auto;
  }
}

/* ------------------------------ Reduced motion -------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
