: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; }
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; }
input[type=color] { width: 64px; height: 38px; padding: 3px; cursor: pointer; }
.of-url-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.of-divider { text-align: center; font-size: 12px; color: var(--muted); margin: 16px 0 4px; }
.of-badge { font-size: 11px; line-height: 1; padding: 3px 8px; border-radius: 999px; margin-inline-start: 8px; border: 1px solid var(--control-line); color: var(--muted); white-space: nowrap; vertical-align: 1px; }
.of-badge.direct { border-color: var(--accent); color: var(--accent); }
#steps { font-size: 13px; color: var(--muted); line-height: 1.6; }
input[type=file] { cursor: pointer; }
textarea { resize: vertical; font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
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; }
#status:empty { display: none; }
#preview { display: block; max-width: 100%; max-height: 320px; width: auto; height: auto; object-fit: contain; border-radius: 8px; margin-block-end: 16px; }
#video { max-width: 100%; }
#board { max-width: 100%; height: auto; touch-action: none; cursor: crosshair; }
#wave { display: block; max-width: 100%; height: auto; border-radius: 12px; touch-action: none; cursor: crosshair; }
input[type=checkbox] { width: auto; justify-self: start; }
.seg { display: inline-flex; 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); }
.diff { font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.diff div { padding: 2px 12px; white-space: pre; }
.diff .add { background: rgba(30, 170, 80, .16); }
.diff .del { background: rgba(228, 32, 40, .13); }
.diff .same { color: var(--muted); }
.tiles { display: grid; gap: 8px; }
.tiles figure { margin: 0; display: grid; gap: 6px; justify-items: center; }
.tiles img { max-width: 100%; border-radius: 8px; }
#qr { display: block; margin: 0 auto; max-width: min(320px, 100%); height: auto; border-radius: 12px; }
.file-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 14px; }
#timer { font-variant-numeric: tabular-nums; font-weight: 600; }
: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; }
.save-img { display: block; max-width: 260px; width: 100%; margin: 14px auto 0; }
.save-img[hidden] { display: none; }
