/* SPINZ mockup — base layout + shared components (theme-agnostic) */
:root {
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --transition: 160ms ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- demo bar ---------- */
.demobar {
  position: sticky; top: 0; z-index: 50;
  background: var(--demobg);
  border-bottom: 1px solid var(--border);
  color: var(--demotext);
}
.demobar__inner {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  align-items: center; padding: 8px 20px;
  max-width: 1280px; margin: 0 auto;
}
.demobar__tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}
.demobar__group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.demobar__label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; opacity: .6;
}
.demobar__seg { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.demobar__seg button {
  border: none; background: transparent; color: var(--demotext);
  font-size: 12px; padding: 4px 10px; white-space: nowrap; transition: var(--transition);
}
.demobar__seg button:hover { background: var(--hover); }
.demobar__seg button.is-active { background: var(--accent); color: var(--on-accent); }

/* ---------- app bar ---------- */
.appbar {
  position: sticky; top: 41px; z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.appbar__inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: var(--space-5); height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .04em; }
.brand__mark { width: 20px; height: 20px; border-radius: 6px; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
.nav { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; flex: 1; }
.nav a { padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 13.5px; transition: var(--transition); }
.nav a:hover { color: var(--ink); background: var(--hover); }
.nav a.is-active { color: var(--ink); background: var(--hover); box-shadow: inset 0 -2px 0 var(--accent); }
.nav__group { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 14px 2px; opacity: .7; display: flex; align-items: flex-end; white-space: nowrap; }
.appbar__right { display: flex; align-items: center; gap: 12px; }
.planbadge {
  font-family: var(--font-mono); font-size: 12px; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--muted);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px;
}

/* ---------- screen shell ---------- */
.screen { max-width: 1280px; margin: 0 auto; padding: var(--space-6) 20px var(--space-7); }
.screenhead { margin-bottom: var(--space-5); }
.screenhead__title { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.screenhead__sub { color: var(--muted); margin: 0; max-width: 640px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: 10px; font-weight: 600; font-size: 14px;
  padding: 9px 16px; min-height: 40px; transition: var(--transition); white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn--ghost:hover { background: var(--hover); }
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: color-mix(in oklab, var(--danger) 10%, transparent); }
.btn--sm { padding: 6px 12px; min-height: 32px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- shared components ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-family: var(--font-mono); }
.pill--accent { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 40%, transparent); background: color-mix(in oklab, var(--accent) 8%, transparent); }

.waveform { display: flex; align-items: center; gap: 2px; height: 32px; }
.waveform span { flex: 1; background: var(--accent); border-radius: 1px; opacity: .5; }
.waveform span:nth-child(odd) { opacity: .85; }

.progress { height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }

.badge {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px; font-weight: 600;
}
.badge--free { background: var(--hover); color: var(--muted); }
.badge--pro { background: color-mix(in oklab, var(--accent) 14%, transparent); color: var(--accent); }
.badge--studio { background: var(--accent); color: var(--on-accent); }

.input, .select, textarea.input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; color: var(--ink); font-family: inherit; font-size: 14px;
  transition: var(--transition);
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }

.modalbackdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60;
  display: grid; place-items: center; padding: 20px;
}
.modal { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: var(--space-5); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.modal h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 18px; }
.modal p { color: var(--muted); margin: 0 0 16px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; }
.hidden { display: none !important; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); }
.empty-state { border: 1px dashed var(--border); border-radius: var(--radius-l); padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-state__title { font-family: var(--font-display); font-size: 18px; color: var(--ink); margin: 0 0 6px; }

@media (max-width: 720px) {
  .nav { gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex: 1; max-width: 100%; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 10px 12px; font-size: 13px; white-space: nowrap; flex: none; min-height: 44px; display: inline-flex; align-items: center; }
  /* demo bar: stacked scrollable rows — tag, then theme/plan/state each on its own line */
  .demobar__inner { padding: 8px 12px; flex-direction: column; align-items: stretch; gap: 8px; }
  .demobar__tag { align-self: flex-start; }
  .demobar__group { flex-direction: column; align-items: stretch; min-width: 0; width: 100%; max-width: 100%; }
  .demobar__label { min-width: 42px; flex: none; margin-bottom: 4px; }
  .demobar__seg { overflow-x: auto; scrollbar-width: none; min-width: 0; max-width: 100%; }
  .demobar__seg::-webkit-scrollbar { display: none; }
  .demobar__seg button { min-height: 40px; flex: 0 0 auto; white-space: nowrap; }
  .appbar__inner { padding: 0 8px; gap: var(--space-2); height: 56px; }
  /* demo bar scrolls away on mobile; appbar becomes the sole sticky header */
  .demobar { position: static; }
  .appbar { position: sticky; top: 0; }
  .brand__name { display: none; }
  .brand__mark { width: 24px; height: 24px; }
  .appbar__right { gap: 8px; }
  .planbadge { display: none; }
  .screen { padding: var(--space-4) 12px var(--space-6); }
  /* tap targets */
  .btn { min-height: 44px; }
  .btn--sm { min-height: 40px; }
  .playbtn { width: 44px; height: 44px; }
  h1.screenhead__title { font-size: 22px; }
}
@media (max-width: 430px) {
  .demobar__tag { display: none; }
  .screen { padding: var(--space-3) 10px var(--space-6); }
  .screenhead__title { font-size: 21px; }
  .avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}