:root {
  --bg: #F3F3EE;
  --surface: #FFFFFF;
  --surface-2: #FAFAF5;
  --ink: #191D1F;
  --muted: #666B64;
  --border: #E3E4DC;
  --border-strong: #CFD2C6;
  --accent: #E8AE04;
  --accent-deep: #A87D02;
  --accent-soft: #FBF3D5;
  --on-accent: #1A1400;
  --green: #16A34A;
  --shadow-sm: 0 1px 2px rgba(20, 22, 20, 0.07);
  --shadow-md: 0 2px 6px rgba(20, 22, 20, 0.06), 0 10px 28px rgba(20, 22, 20, 0.09);
  --shadow-lg: 0 4px 12px rgba(20, 22, 20, 0.09), 0 22px 50px rgba(20, 22, 20, 0.16);
  --radius: 16px;
  --radius-sm: 11px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
[data-theme="dark"] {
  --bg: #111315;
  --surface: #1A1D1F;
  --surface-2: #212427;
  --ink: #F1EEE4;
  --muted: #A2A69B;
  --border: #2C3033;
  --border-strong: #41464A;
  --accent: #F5C518;
  --accent-deep: #D9AC0B;
  --accent-soft: #2E2506;
  --on-accent: #141003;
  --green: #22C55E;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--bg); color: var(--ink);
  line-height: 1.5; min-height: 100svh;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
::selection { background: var(--accent); color: var(--on-accent); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink); cursor: pointer;
  transition: border-color .2s var(--ease), transform .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 20px; height: 20px; stroke-width: 2; }

.chip {
  font-family: "IBM Plex Mono", monospace; font-size: .78rem; font-weight: 500;
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  transition: transform .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.chip:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
/* keep the selected chip readable in every theme */
.chip.active:hover, [data-theme="dark"] .chip.active, [data-theme="dark"] .chip.active:hover { color: var(--on-accent); }

.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 70%,100% { transform: scale(3.2); opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 999px;
  font-size: .86rem; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease); z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
