/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Custom Properties ── */
:root {
  --toolbar-h: 52px;
  --radius: 12px;
  --radius-sm: 8px;
  --t-fast: 150ms ease;
  --t-med:  280ms ease;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", monospace;
  --accent: #4f8ef7;
  --accent-dim: rgba(79,142,247,.13);
  --accent-bg: #f0f4ff;
  --accent-surface: #fafcff;
  --accent-surface2: #e4edff;
  --accent-toolbar: rgba(240,244,255,.92);
}

/* ── Dark theme ── */
.theme-dark {
  --bg:         #0f1117;
  --surface:    #1a1d27;
  --surface-2:  #22263a;
  --border:     rgba(255,255,255,.08);
  --text-pri:   #f0f2f8;
  --text-sec:   #8890a8;
  --text-muted: #555e7a;
  --toolbar-bg: rgba(15,17,23,.9);
  --shadow:     0 2px 20px rgba(0,0,0,.5);
}

/* ── Light theme ── */
.theme-light {
  --bg:         var(--accent-bg, #f0f2f7);
  --surface:    var(--accent-surface, #ffffff);
  --surface-2:  var(--accent-surface2, #e4e7f0);
  --border:     rgba(0,0,0,.09);
  --text-pri:   #1a1d2e;
  --text-sec:   #555e7a;
  --text-muted: #9099b8;
  --toolbar-bg: var(--accent-toolbar, rgba(240,242,247,.92));
  --shadow:     0 2px 12px rgba(0,0,0,.1);
}

/* ── Base ── */
html, body {
  min-height: 100%;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-pri);
  transition: background var(--t-med), color var(--t-med);
  overflow-x: hidden;
}

/* ── Toolbar ── */
.toolbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--toolbar-h);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--accent-toolbar, rgba(240,242,247,.92));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.app-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-pri);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-title .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transition: background var(--t-med);
  flex-shrink: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  color: var(--text-sec);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.toolbar-btn:hover { background: var(--surface-2); color: var(--text-pri); }
.toolbar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toolbar-btn svg { width: 18px; height: 18px; }
#btn-accent svg { width: 22px; height: 22px; }

/* ── Footer ── */
.site-footer {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  padding: 20px 20px 32px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  line-height: 1.6;
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ── Utility ── */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
