/* Expected Value — Apple-minimal, self-contained (shares the site's
   token values from app-style.css; tools with their own style.css do not
   get the shared sheet, so the tokens and the classes this page uses are
   duplicated here). */
:root {
  color-scheme: light;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  --canvas: #f5f5f7;
  --surface: #fff;
  --recessed: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #65656b;
  --line: rgb(0 0 0 / .06);
  --control-line: rgb(0 0 0 / .14);
  --selected: rgb(0 0 0 / .075);
  --accent: #0071e3;
  --accent-hover: #0065cc;
  --accent-ink: #fff;
  --motion: .2s cubic-bezier(.16, 1, .3, 1);
  color: var(--ink);
  background: var(--canvas);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #161618;
  --surface: #1e1e20;
  --recessed: #242426;
  --ink: #f5f5f7;
  --muted: #ababaf;
  --line: rgb(255 255 255 / .08);
  --control-line: rgb(255 255 255 / .19);
  --selected: rgb(255 255 255 / .10);
  --accent: #5aaaf9;
  --accent-hover: #7bbaff;
  --accent-ink: #101820;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; transition: background-color var(--motion), color var(--motion); }
main { width: min(896px, calc(100% - 32px)); margin: clamp(32px, 7vw, 80px) auto; }
h1 { font-size: clamp(2.25rem, 5vw, 4rem); font-weight: 600; line-height: 1.12; letter-spacing: -.045em; margin: 16px 0 8px; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 0; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { color: var(--muted); margin: 0; }
a { color: var(--ink); text-underline-offset: .2em; }
.panel { display: grid; gap: 24px; margin-block-start: 32px; border: 1px solid var(--line); border-radius: 24px; padding: clamp(16px, 4vw, 32px); background: var(--surface); }
label { min-width: 0; font-size: 14px; font-weight: 500; display: grid; gap: 8px; }
input, select, textarea { min-width: 0; width: 100%; color: inherit; background: var(--recessed); border: 1px solid var(--control-line); border-radius: 8px; font: inherit; padding: 8px 12px; }
.of-url-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
button, .button { display: inline-flex; justify-content: center; align-items: center; background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-radius: 8px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 500; padding: 8px 16px; text-decoration: none; cursor: pointer; transition: background-color var(--motion), transform var(--motion); }
button:not(:disabled):hover, .button:hover { background: var(--accent-hover); }
button:not(:disabled):active, .button:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: wait; }
.secondary { color: var(--ink); background: var(--recessed); }
.secondary:not(:disabled):hover, a.secondary:hover { background: var(--selected); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--recessed); border: 1px solid var(--control-line); border-radius: 10px; padding: 4px; }
.seg button { background: transparent; color: var(--ink); border: 0; min-height: 36px; border-radius: 7px; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) { .fields { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } :active { transform: none !important; } }

/* Discreet brand line on every standalone app (Chan, 2026-11-27). */
.brand-line { text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .14em; padding: 20px 0 28px; margin: 0; }

/* --- Expected Value specific --- */
.subtitle { font-size: 1.25rem; color: var(--muted); margin: 0 0 8px; }
.lede { max-width: 62ch; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.badges span { white-space: nowrap; }
.sq-stat { flex: 1 1 120px; min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--recessed); padding: 12px 16px; }
.sq-stat .num { font-size: 24px; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; }
.sq-stat .lbl { font-size: 13px; color: var(--muted); margin-top: 2px; }
#share-status:empty { display: none; }
#share-status { color: var(--muted); font-size: 14px; }
.exp-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.exp-steps { color: var(--ink); font-size: 15px; margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.exp-steps li { overflow-wrap: break-word; font-variant-numeric: tabular-nums; }
.exp-result-line { color: var(--ink); font-size: 18px; font-weight: 600; }
.exp-msg-good { color: #1e7e34 !important; }
.exp-msg-bad { color: #c0392b !important; }
.exp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.exp-table th, .exp-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.exp-table th { color: var(--muted); font-weight: 600; }
.exp-table td { color: var(--ink); }
.exp-table input { padding: 6px 10px; }
.exp-del { min-height: 36px; padding: 4px 12px; font-size: 18px; line-height: 1; }
.exp-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#table-error, #cross-warn { color: #c0392b !important; }
.exp-bar-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; font-size: 14px; }
.exp-bar-label { flex: 0 0 72px; color: var(--ink); font-variant-numeric: tabular-nums; }
.exp-bar-track { flex: 1; height: 18px; background: var(--recessed); border-radius: 9px; overflow: hidden; }
.exp-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 9px; }
.exp-bar-val { flex: 0 0 150px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
#sim-conv { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
#quiz-options { display: grid; gap: 8px; }
#quiz-options button { justify-content: flex-start; text-align: left; min-height: 44px; }
#quiz-options button.exp-opt-correct { outline: 2px solid #1e7e34; outline-offset: 1px; }
#quiz-options button.exp-opt-wrong { outline: 2px solid #c0392b; outline-offset: 1px; }
#quiz-question { font-size: 17px; font-weight: 600; color: var(--ink); }
#quiz-progress { font-size: 13px; }
@media (max-width: 640px) {
  .sq-stat .num { font-size: 20px; }
  .exp-bar-label { flex-basis: 56px; }
  .exp-bar-val { flex-basis: 110px; font-size: 12px; }
}
