/* 廿四 Make 24 — 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 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;
  --good: #1eaa50;
  --bad: #e02028;
  --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;
  --good: #4ade80;
  --bad: #f87171;
}
* { 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; letter-spacing: -.01em; margin: 0; }
p { color: var(--muted); margin: 0; }
a { color: var(--ink); text-underline-offset: .2em; }
.subtitle { font-size: 1.125rem; color: var(--ink); }
.lede { margin-top: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.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); }
.of-url-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.fineprint { font-size: 13px; color: var(--muted); }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
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; cursor: pointer; transition: background-color var(--motion), transform var(--motion); }
button:not(:disabled):hover { background: var(--accent-hover); }
button:not(:disabled):active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: default; }
.secondary { color: var(--ink); background: var(--recessed); }
.secondary:not(:disabled):hover { background: var(--selected); }
input[type=number], input[type=text] { min-width: 0; width: 100%; color: inherit; background: var(--recessed); border: 1px solid var(--control-line); border-radius: 8px; font: inherit; padding: 8px 12px; }
.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); }
#status:empty, #msg:empty { display: none; }
.brand-line { text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .14em; padding: 20px 0 28px; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* ---- Make 24 ---- */
.mk24-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mk24-stat { text-align: center; background: var(--recessed); border-radius: 14px; padding: 12px 8px; }
.mk24-stat .num { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.mk24-stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mk24-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mk24-card { display: grid; place-items: center; gap: 2px; min-height: 108px; padding: 12px 4px; background: var(--surface); color: var(--ink); border: 1px solid var(--control-line); border-radius: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.mk24-card:not(:disabled):hover { background: var(--surface); border-color: var(--accent); }
.mk24-card .mk24-rank { font-size: 2.5rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.mk24-card .mk24-suit { font-size: 12px; color: var(--muted); }
.mk24-card.used { opacity: .35; box-shadow: none; }
.mk24-expr { min-height: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--recessed); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 1.25rem; font-weight: 600; }
.mk24-expr-ph { font-size: 14px; font-weight: 400; color: var(--muted); }
.mk24-tok { padding: 2px 6px; border-radius: 6px; }
.mk24-tok.num { background: var(--surface); border: 1px solid var(--control-line); }
.mk24-tok.eq { color: var(--muted); }
.mk24-ops { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.mk24-ops button { min-height: 48px; font-size: 1.25rem; background: var(--recessed); color: var(--ink); }
.mk24-ops button:not(:disabled):hover { background: var(--selected); }
#msg { font-size: 15px; }
.mk24-msg-good { color: var(--good); }
.mk24-msg-bad { color: var(--bad); }
.mk24-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mk24-solution { display: grid; gap: 6px; background: var(--recessed); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 15px; }
.mk24-solution p { color: var(--ink); margin: 0; }
.mk24-classic { display: grid; gap: 10px; }
.mk24-classic-item { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 16px; align-items: baseline; text-align: left; padding: 12px 16px; min-height: 56px; }
.mk24-classic-cards { font-size: 1.25rem; font-weight: 700; letter-spacing: .05em; white-space: nowrap; }
.mk24-classic-hook { font-size: 13px; font-weight: 400; color: var(--muted); }
.mk24-classic-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mk24-dims { display: grid; gap: 16px; }
.mk24-dim { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; }
.mk24-dim-name { font-weight: 600; }
.mk24-bar { height: 10px; background: var(--recessed); border-radius: 999px; overflow: hidden; }
.mk24-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width var(--motion); }
.mk24-dim-meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.mk24-solver-inputs { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 8px; align-items: center; }
.mk24-solver-inputs input { text-align: center; font-size: 1.25rem; font-weight: 600; }
.mk24-seed-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
@media (max-width: 640px) {
  .mk24-stats { grid-template-columns: repeat(2, 1fr); }
  .mk24-card { min-height: 88px; }
  .mk24-card .mk24-rank { font-size: 2rem; }
  .mk24-classic-item { grid-template-columns: 1fr auto; }
  .mk24-classic-hook { grid-column: 1 / -1; }
  .mk24-dim { grid-template-columns: 84px 1fr; }
  .mk24-dim-meta { grid-column: 2; }
  .mk24-solver-inputs { grid-template-columns: repeat(4, 1fr); }
  .mk24-solver-inputs button { grid-column: 1 / -1; }
}
