/* Graph Paper — shared look & feel.
   Warm "drafting table" palette: ivory paper, terracotta for the main action,
   graphite for secondary actions. Font: DM Sans (bundled, SIL OFL — fonts/OFL-LICENSE.txt). */
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url("fonts/dm-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url("fonts/dm-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 600; font-display: swap; src: url("fonts/dm-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url("fonts/dm-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #faf7f2;            /* ivory */
  --card: #fffdfa;
  --surface: #f2ece3;       /* drafting-table desk / toggle tracks */
  --text: #2b2521;
  --muted: #7a6e63;
  --line: #e7ddd0;
  --accent: #c0532f;        /* terracotta — main action, selection */
  --accent-hover: #a8462a;
  --accent-soft: #f8e9e2;
  --accent-ink: #ffffff;
  --graphite: #3b3430;      /* secondary actions */
  --graphite-hover: #2b2521;
  --graphite-ink: #ffffff;
  --highlight: #d9963f;     /* amber — logo word */
  --icon: #a8603f;          /* brown — grid-type icons */
  --shadow-card: 0 1px 2px rgba(60, 40, 25, .06), 0 6px 20px rgba(60, 40, 25, .07);
  --shadow-page: 0 1px 3px rgba(60, 40, 25, .12), 0 14px 34px rgba(60, 40, 25, .14);
  --shadow-thumb: 0 1px 2px rgba(60, 40, 25, .16), 0 1px 1px rgba(60, 40, 25, .06);
  --gutter: 18px;
  --control-h: 36px;
  --radius-lg: 18px;
  --radius: 10px;
  --radius-sm: 8px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1715;
    --card: #221e1b;
    --surface: #2b2623;
    --text: #f1ebe4;
    --muted: #ab9f93;
    --line: #3a332e;
    --accent: #e2774f;
    --accent-hover: #ef8d68;
    --accent-soft: #3a2a23;
    --accent-ink: #1a1715;
    --graphite: #e9e1d8;
    --graphite-hover: #ffffff;
    --graphite-ink: #1a1715;
    --highlight: #e8ad5f;
    --icon: #d39a78;
    --shadow-card: 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-page: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .45);
    --shadow-thumb: 0 1px 2px rgba(0, 0, 0, .5);
  }
}

/* Buttons: flat and solid with a crisp bottom edge (no gradients / glow). */
.btn {
  height: 40px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .06);
  font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .08s ease;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.secondary { background: var(--graphite); border-color: var(--graphite); color: var(--graphite-ink); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); }
.btn.secondary:hover { background: var(--graphite-hover); border-color: var(--graphite-hover); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.tip { margin: 0; font-size: 12px; color: var(--muted); }
.tip b { color: var(--text); font-weight: 600; }
