/* A/B Test Calculator — leans on ../css/protium-ui.css tokens. Self-contained
   copy of the layout/card idioms used by the calculators tool. */

.page { flex: 1; min-height: 0; padding: 24px 32px; overflow: hidden; }
.layout {
  height: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 28px;
  align-items: stretch;
}

/* Sidebar */
.sidebar { height: 100%; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.side-section { font-size: 12.5px; font-weight: 700; color: var(--text); padding: 12px 8px 6px; margin-top: 8px; border-top: 1px solid var(--border-faint); text-transform: uppercase; letter-spacing: 0.03em; }
.side-section:first-child { margin-top: 0; border-top: 0; padding-top: 2px; }
.side-group { margin-bottom: 12px; }
.side-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); padding: 4px 8px; margin-bottom: 2px; }
.side-item { display: block; width: 100%; text-align: left; font: inherit; font-size: 13.5px; color: var(--text-muted); background: transparent; border: 0; border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; transition: background var(--t), color var(--t); }
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.is-active { background: var(--accent-soft); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }

/* Content */
.content { min-width: 0; height: 100%; overflow-y: auto; }
.tool-head { margin-bottom: 18px; }
.tool-head h1 { font-family: var(--font-display); font-size: 27px; letter-spacing: -0.01em; margin-bottom: 5px; }
.tool-head p { color: var(--text-muted); font-size: 15px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px 26px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; }

/* Fields */
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.fields.cols-1 { grid-template-columns: 1fr; max-width: 420px; }
.fields.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field { display: block; }
.field > span { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select { color-scheme: dark; }
html.theme-light .field input, html.theme-light .field select { color-scheme: light; }
.field-note { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }

/* Result blocks */
.result { margin-top: 18px; background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; }
.result:empty { display: none; }
.r-line { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--border-faint); font-size: 14px; }
.r-line:last-child { border-bottom: 0; }
.r-line .k { color: var(--text-muted); }
.r-line .v { color: var(--text); font-weight: 600; text-align: right; }
.r-mono .v { font-family: var(--font-mono); }

/* Hero headline number */
.hero { text-align: center; margin: 20px 0; font-family: var(--font-display); font-size: 30px; color: var(--accent); letter-spacing: -0.01em; }
.hero small { display: block; font-family: var(--font-sans); font-size: 13px; color: var(--text-muted); font-weight: 400; margin-top: 4px; }
.hero.is-bad { color: var(--bad); }

/* Stat tiles */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.stat-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.statbox { background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; text-align: center; }
.statbox .v { font-family: var(--font-display); font-size: 20px; color: var(--text); letter-spacing: -0.01em; }
.statbox .k { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.statbox.hero-tile { background: var(--accent-soft); border-color: var(--accent-ring); }
.statbox.hero-tile .v { color: var(--accent); }

.stat { background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; }
.stat .k { font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
.stat .v { font-family: var(--font-display); font-size: 21px; color: var(--text); letter-spacing: -0.01em; }

/* Verdict banner */
.verdict { margin-top: 18px; border-radius: var(--r-md); padding: 14px 18px; font-size: 14.5px; font-weight: 600; border: 1px solid var(--border); }
.verdict small { display: block; font-weight: 400; font-size: 13px; margin-top: 4px; color: var(--text-muted); }
.verdict.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.verdict.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.verdict.neutral { background: var(--surface-2); color: var(--text); }

/* Segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.seg-btn { font: inherit; font-size: 13px; color: var(--text-muted); background: transparent; border: 0; padding: 7px 16px; border-radius: 7px; cursor: pointer; transition: background var(--t), color var(--t); }
.seg-btn.is-active { background: var(--accent); color: #fff; }

.note { color: var(--text-muted); font-size: 13px; margin-top: 16px; }

/* Method / formula block */
.info {
  max-width: 1240px; margin: 18px auto 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 24px;
}
.info h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 12px; }
.info p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 12px; }
.formula {
  font-family: var(--font-mono); font-size: 14px; color: var(--text);
  background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 14px; overflow-x: auto; white-space: pre; line-height: 1.6;
}
.defs { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 7px; }
.defs li { font-size: 13.5px; color: var(--text-muted); }
.defs b { color: var(--text); font-family: var(--font-mono); }

@media (max-width: 860px) {
  .page { padding: 16px; overflow: visible; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .sidebar { height: auto; }
  .content { height: auto; overflow: visible; }
  .fields, .fields.cols-3 { grid-template-columns: 1fr; }
  .stat-row, .stat-row.cols-2 { grid-template-columns: 1fr; }
}
