/* Function Plotter — 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; }
label:has(output) { grid-template-columns: 1fr auto; }
label input[type=range] { grid-column: 1 / -1; accent-color: var(--accent); }
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(3, minmax(0, 1fr)); gap: 16px; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
: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; }

/* --- Function Plotter 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; }
#plot-chart { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); touch-action: manipulation; }
.fp-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.fp-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.fp-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.fp-chip { min-height: 40px; }
.fp-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.fp-chip.fp-focused { outline: 2px solid var(--accent); outline-offset: 1px; }
.fp-point-line { color: var(--ink); font-size: 15px; margin: 2px 0; }
.fp-point-line .fp-empty { color: var(--muted); }
#share-status:empty { display: none; }
#share-status { color: var(--muted); font-size: 14px; }
.fp-msg-good { color: #1e7e34 !important; }
.fp-msg-bad { color: #c0392b !important; }
#quiz-options { display: grid; gap: 8px; }
#quiz-options button { justify-content: flex-start; text-align: left; min-height: 44px; }
#quiz-options button.fp-opt-correct { outline: 2px solid #1e7e34; outline-offset: 1px; }
#quiz-options button.fp-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; }
