/* ---------- Design tokens ---------- */
:root {
  --bg: #14121f;
  --bg-elev-1: #1c1930;
  --bg-elev-2: #262140;
  --bg-elev-3: #2f2a4d;
  --border: #38335a;
  --text: #f2f0fb;
  --text-dim: #b6b0d6;
  --text-faint: #837da8;
  --accent: #ffb03b;
  --accent-text: #1e1408;
  --violet: #8b6cf2;
  --violet-dim: #5a4a8f;
  --danger: #ff6b6b;
  --danger-bg: #3a1f22;
  --success: #4fd692;
  --idea: #6ea8ff;
  --locked: #4fd692;
  --uncertain: #ffb03b;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
  --nav-h: 64px;
  --top-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f4fb;
    --bg-elev-1: #ffffff;
    --bg-elev-2: #f0ecfb;
    --bg-elev-3: #e7e1f7;
    --border: #ded7f2;
    --text: #221d38;
    --text-dim: #5c5480;
    --text-faint: #8a83ad;
    --accent: #e08e00;
    --accent-text: #ffffff;
    --violet: #6a4fd6;
    --violet-dim: #ccc0f2;
    --danger: #d84343;
    --danger-bg: #fbe4e4;
    color-scheme: light;
  }
}

:root[data-theme="dark"] {
  --bg: #14121f; --bg-elev-1: #1c1930; --bg-elev-2: #262140; --bg-elev-3: #2f2a4d;
  --border: #38335a; --text: #f2f0fb; --text-dim: #b6b0d6; --text-faint: #837da8;
  --accent: #ffb03b; --accent-text: #1e1408; --violet: #8b6cf2; --violet-dim: #5a4a8f;
  --danger: #ff6b6b; --danger-bg: #3a1f22; color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f4fb; --bg-elev-1: #ffffff; --bg-elev-2: #f0ecfb; --bg-elev-3: #e7e1f7;
  --border: #ded7f2; --text: #221d38; --text-dim: #5c5480; --text-faint: #8a83ad;
  --accent: #e08e00; --accent-text: #ffffff; --violet: #6a4fd6; --violet-dim: #ccc0f2;
  --danger: #d84343; --danger-bg: #fbe4e4; color-scheme: light;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; }
p { margin: 0 0 .8em; }
::selection { background: var(--violet-dim); }

/* ---------- Layout shell ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.topbar {
  height: calc(var(--top-h) + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: 12px; padding-right: 12px;
  background: var(--bg-elev-1);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  z-index: 20;
}
.project-switch {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text); max-width: 70%;
  transition: background-color .12s ease;
}
.project-switch:active { background: var(--bg-elev-2); }
.logo-mark { color: var(--accent); display: flex; }
.project-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--text-faint); flex: 0 0 auto; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 50%; color: var(--text-dim);
  transition: background-color .12s ease, color .12s ease;
}
.icon-btn:active { background: var(--bg-elev-2); color: var(--text); }

.ios-install-banner {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  background: var(--violet-dim); color: var(--text); border-bottom: 1px solid var(--border);
  padding: 10px 14px; font-size: 13px; line-height: 1.4;
}
.ios-install-banner svg { flex: 0 0 auto; color: var(--violet); }
.ios-install-banner .msg { flex: 1 1 auto; }
.ios-install-banner button {
  flex: 0 0 auto; background: none; border: none; color: var(--text-faint);
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.ios-install-banner button:active { background: rgba(0,0,0,.08); }

.shell { flex: 1 1 auto; display: flex; min-height: 0; }

.sidenav {
  width: 220px; flex: 0 0 auto; display: none;
  flex-direction: column; gap: 2px; padding: 14px 10px;
  background: var(--bg-elev-1); border-right: 1px solid var(--border);
  overflow-y: auto;
}
.sidenav .nav-item {
  display: flex; align-items: center; gap: 12px;
  background: none; border: none; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: background-color .12s ease, color .12s ease;
}
.sidenav .nav-item:hover { background: var(--bg-elev-2); color: var(--text); }
.sidenav .nav-item.active { background: var(--violet-dim); color: var(--text); }
.sidenav .nav-item svg { flex: 0 0 auto; opacity: .9; }

.view-root {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  padding: 16px 16px calc(24px + var(--safe-bottom));
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.bottomnav {
  display: flex; flex: 0 0 auto;
  background: var(--bg-elev-1); border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 20;
}
.bottomnav .nav-item {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; padding: 8px 4px 6px;
  color: var(--text-faint); font-size: 11px; font-weight: 600;
  transition: color .12s ease, transform .1s ease;
}
.bottomnav .nav-item:active { transform: scale(.94); }
.bottomnav .nav-item.active { color: var(--accent); }

@media (min-width: 900px) {
  .sidenav { display: flex; }
  .bottomnav { display: none; }
  .view-root { padding: 24px 32px 32px; }
}
@media (min-width: 1300px) {
  .view-root { padding: 28px 5vw 40px; }
}

/* ---------- Lock screen ---------- */
.lock-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 20%, #2b2450 0%, #14121f 70%);
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  color: #f2f0fb;
  color-scheme: dark;
}
.lock-card { width: 100%; max-width: 340px; text-align: center; }
.lock-logo { color: #ffb03b; display: flex; justify-content: center; margin-bottom: 14px; }
.lock-screen h1 { color: #f2f0fb; }
.lock-subtitle { color: #b6b0d6; font-size: 14px; margin-bottom: 22px; }
.lock-input-wrap { position: relative; margin-bottom: 10px; }
.lock-input {
  width: 100%; padding: 14px 46px 14px 16px;
  background: #262140; border: 1px solid #38335a; border-radius: var(--radius-md);
  color: #f2f0fb; font-size: 16px; text-align: center; letter-spacing: 2px;
}
.lock-input::placeholder { color: #837da8; }
.lock-input:focus { outline: 2px solid var(--violet); outline-offset: 1px; }
.lock-eye-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: #837da8; border-radius: 50%;
}
.lock-eye-btn:active { background: rgba(255,255,255,.08); }
.lock-error { color: #ff6b6b; font-size: 13px; margin: -2px 0 10px; }
.btn-link {
  background: none; border: none; color: #837da8; font-size: 13px;
  margin-top: 14px; text-decoration: underline; text-underline-offset: 3px;
}
.btn-link.danger { color: #ff6b6b; }
.lock-screen .btn-primary { background: #ffb03b; color: #1e1408; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-md); border: 1px solid transparent;
  font-weight: 600; font-size: 14px;
  transition: transform .08s ease, background-color .12s ease, opacity .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--bg-elev-3); color: var(--text); border-color: var(--border); }
.btn-ghost { background: none; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.fab {
  position: fixed; right: 20px; bottom: calc(var(--nav-h) + 20px + var(--safe-bottom));
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text); border: none;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
  z-index: 15; transition: transform .1s ease;
}
.fab:active { transform: scale(.92); }
@media (min-width: 900px) { .fab { bottom: 28px; right: 32px; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 6px; }
.mask-field {
  -webkit-text-security: disc;
  text-security: disc;
}
.input, .textarea, .select {
  width: 100%; padding: 11px 13px; background: var(--bg-elev-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 16px;
  transition: border-color .12s ease;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--violet); }
.textarea { resize: vertical; min-height: 90px; font-family: inherit; }
.hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.checkrow { display: flex; align-items: center; gap: 8px; padding: 9px 0; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elev-2); color: var(--text-dim); font-size: 13px; font-weight: 600;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.chip.active { background: var(--violet); border-color: var(--violet); color: #fff; }
.chip[data-tag="Antagonist"].active { background: #d64f4f; border-color: #d64f4f; }
.chip[data-tag="Protagonist"].active { background: #4f8cd6; border-color: #4f8cd6; }
.chip[data-tag="Relationship"].active { background: #d64f9c; border-color: #d64f9c; }
.chip[data-tag="Future Arc"].active { background: #4fd6a8; border-color: #4fd6a8; color: #063; }
.chip[data-tag="Past"].active { background: #a08a5a; border-color: #a08a5a; }
.chip[data-tag="Origin"].active { background: #ffb03b; border-color: #ffb03b; color: #1e1408; }

/* ---------- Cards & lists ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-header h2 { font-size: 20px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-input { flex: 1 1 200px; }

.card {
  background: var(--bg-elev-1); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 12px;
  transition: border-color .12s ease, transform .08s ease;
}
.card:active { transform: scale(.995); }
.card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-weight: 700; font-size: 15.5px; margin-bottom: 2px; }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.card-desc { color: var(--text-dim); font-size: 13.5px; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}
.badge-idea { background: rgba(110,168,255,.16); color: var(--idea); }
.badge-locked { background: rgba(79,214,146,.16); color: var(--locked); }
.badge-uncertain { background: rgba(255,176,59,.16); color: var(--uncertain); }
.badge-muted { background: var(--bg-elev-3); color: var(--text-faint); }
.tag-pill {
  display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--bg-elev-3); color: var(--text-dim);
}

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-faint); }
.empty-state svg { opacity: .5; margin-bottom: 10px; }
.empty-state h3 { color: var(--text-dim); font-size: 16px; }

.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

.thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm);
  background: var(--bg-elev-3); margin-bottom: 10px; display: block;
}
.thumb-placeholder {
  width: 100%; aspect-ratio: 4/3; border-radius: var(--radius-sm); background: var(--bg-elev-3);
  display: flex; align-items: center; justify-content: center; color: var(--text-faint); margin-bottom: 10px;
}

/* ---------- Editor / detail sheet ---------- */
.editor-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.editor-backdrop.open { opacity: 1; pointer-events: auto; }
.editor {
  position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 480px;
  background: var(--bg); border-left: 1px solid var(--border); z-index: 41;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .18s ease;
  padding-top: var(--safe-top); padding-bottom: var(--safe-bottom);
}
.editor.open { transform: translateX(0); }
.editor-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.editor-body { flex: 1 1 auto; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.editor-foot { flex: 0 0 auto; padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
@media (max-width: 640px) {
  .editor { max-width: 100%; }
}

/* ---------- Sheet (bottom sheet: project switcher / more menu) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; opacity: 0; transition: opacity .15s ease; pointer-events: none; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  background: var(--bg-elev-1); border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0; max-height: 80vh; overflow-y: auto;
  padding: 10px 16px calc(20px + var(--safe-bottom));
  transform: translateY(100%); transition: transform .18s ease;
}
.sheet.open { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; background: var(--border); border-radius: 4px; margin: 4px auto 14px; }
@media (min-width: 900px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%,-45%); width: 100%; max-width: 420px; border-radius: var(--radius-lg); border: 1px solid var(--border); opacity: 0; pointer-events: none; }
  .sheet.open { transform: translate(-50%,-50%); opacity: 1; pointer-events: auto; }
}
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 10px; background: none; border: none; border-radius: var(--radius-sm); color: var(--text);
}
.sheet-item:active { background: var(--bg-elev-2); }
.sheet-item .meta { margin-left: auto; color: var(--text-faint); font-size: 12px; }
.sheet-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin: 14px 10px 6px; }
.sheet-title:first-child { margin-top: 2px; }

/* ---------- Modal (prompt/confirm dialogs) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 70;
  opacity: 0; pointer-events: none; transition: opacity .15s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal-card {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%,-46%); z-index: 71;
  width: calc(100% - 40px); max-width: 380px;
  background: var(--bg-elev-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
}
.modal-card.open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%); }
.modal-card h3 { font-size: 17px; margin-bottom: 8px; }
.modal-card .muted { margin-bottom: 14px; }
.modal-card .input, .modal-card .textarea { margin-bottom: 10px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + var(--safe-bottom));
  transform: translateX(-50%) translateY(10px); background: var(--bg-elev-3); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); z-index: 60; opacity: 0; transition: opacity .15s ease, transform .15s ease;
  border: 1px solid var(--border); max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* ---------- Timeline ---------- */
.timeline-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.timeline-scroll { overflow-x: auto; padding-bottom: 12px; -webkit-overflow-scrolling: touch; }
.timeline-svg-wrap { min-width: 100%; }
.phase-board { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .phase-board { grid-template-columns: 1fr 1fr 1fr; } }
.phase-col { background: var(--bg-elev-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; min-height: 120px; }
.phase-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); display: flex; align-items: center; gap: 8px; }
.phase-dot { width: 9px; height: 9px; border-radius: 50%; }
.phase-card {
  background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-top: 10px; font-size: 13px;
}
.phase-card .t { font-weight: 700; margin-bottom: 3px; }

/* ---------- Storyboard ---------- */
.sb-preview {
  display: grid; gap: 3px; aspect-ratio: 2/2.6; background: var(--border);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 10px;
}
.sb-mini-panel { background: var(--bg-elev-3); overflow: hidden; }
.sb-mini-panel img { width: 100%; height: 100%; object-fit: cover; display: block; }

.layout-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.layout-option {
  padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elev-2); display: flex; align-items: center; justify-content: center;
}
.layout-option.active { border-color: var(--violet); background: var(--violet-dim); }
.layout-mini {
  display: grid; gap: 2px; width: 44px; height: 56px;
}
.layout-mini div { background: var(--text-faint); opacity: .55; border-radius: 2px; }
.layout-option.active .layout-mini div { background: var(--violet); opacity: .9; }

.storyboard-page {
  display: grid; gap: 6px; max-width: 560px; margin: 0 auto 20px;
  aspect-ratio: 2/2.6; background: var(--border); border-radius: var(--radius-md);
  overflow: hidden; padding: 6px;
}
.sb-panel {
  position: relative; background: var(--bg-elev-2); border-radius: var(--radius-sm);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
}
.sb-panel-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.sb-panel-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--text-faint); font-size: 12px; font-weight: 600;
}
.sb-caption-input {
  position: relative; z-index: 1; margin-top: auto; width: 100%; border: none;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; padding: 6px 8px;
  backdrop-filter: blur(2px);
}
.sb-caption-input::placeholder { color: rgba(255,255,255,.65); }
.sb-panel:has(.sb-panel-img) .sb-caption-input { position: absolute; bottom: 0; left: 0; }

.thumb-pick {
  background: none; border: none; padding: 0; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.thumb-pick .thumb { margin-bottom: 4px; }

/* ---------- AI Assistant ---------- */
.msg { padding: 12px 14px; border-radius: var(--radius-md); margin-bottom: 10px; font-size: 14px; white-space: pre-wrap; }
.msg-user { background: var(--violet-dim); margin-left: 15%; }
.msg-ai { background: var(--bg-elev-1); border: 1px solid var(--border); margin-right: 5%; }
.ai-input-row { display: flex; gap: 8px; align-items: flex-end; }
.provider-toggle { display: flex; gap: 6px; margin-bottom: 14px; }

/* ---------- Filter bar (discarded) ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Utility ---------- */
.muted { color: var(--text-faint); }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  border-top-color: var(--accent); animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(90deg, var(--bg-elev-2) 25%, var(--bg-elev-3) 37%, var(--bg-elev-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
