/* Skills2Sell Studio — tokens taken from DESIGN.md, then components built only from tokens. */

:root {
  /* color */
  --primary: #4F46E5;
  --accent: #5E51F8;
  --accent-2: #9437ED;
  --ink: #1C1917;
  --ink-2: #44403C;
  --ink-3: #57534E;
  --muted: #78716C;
  --muted-2: #A8A29E;
  --border: #E7E5E4;
  --border-2: #E5E7EB;
  --border-strong: #ACB4BF;
  --surface: #FFFFFF;
  --surface-2: #F5F5F5;
  --surface-tint: #F5EBFD;
  --surface-cool: #ECEEF4;
  --danger: #DC2626; /* added: DESIGN.md has no recording/error color */

  /* type */
  --font: 'Inter', -apple-system, 'SF Pro Text', system-ui, sans-serif;
  --text-xs: 13px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 26px;
  --text-4xl: 34px;
  --text-display: clamp(34px, 5.4vw, 60px); /* added: marketing hero needs one size above the scale */

  /* spacing (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 32px;
  --s-7: 36px;
  --s-section: clamp(64px, 9vw, 112px);

  /* shape */
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 16px;
  --r-2xl: 20px;
  --r-3xl: 28px;
  --r-full: 9999px;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .03), 0 .5px 1px rgba(0, 0, 0, .02), 0 .25px .5px rgba(0, 0, 0, .02);
  --shadow-ring: inset 0 0 0 1px rgba(12, 12, 12, .06);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, .25);
  --shadow-glow: 0 0 10px rgba(0, 0, 0, .3);
  --shadow-side: -4px 0 12px rgba(0, 0, 0, .06);

  /* motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --t-fast: .15s var(--ease);
  --t-base: .2s var(--ease);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s-5); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 44px; padding: 0 var(--s-5);
  border: 1px solid transparent; border-radius: var(--r-full);
  font-size: var(--text-sm); font-weight: 600; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-base);
}
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--surface); }
.btn-primary:hover:not([disabled]) { background: var(--accent); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost[aria-pressed="true"] { background: var(--surface-tint); border-color: var(--accent); color: var(--primary); }
.btn-danger { background: var(--danger); color: var(--surface); }
.btn-danger:hover:not([disabled]) { box-shadow: var(--shadow-glow); }
.btn-text { background: none; color: var(--muted); height: auto; padding: var(--s-1) var(--s-2); border-radius: var(--r-md); }
.btn-text:hover:not([disabled]) { color: var(--ink); background: var(--surface-2); }
.btn-sm { height: 36px; padding: 0 var(--s-4); font-size: var(--text-xs); }
.btn-lg { height: 52px; padding: 0 var(--s-6); font-size: var(--text-base); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--r-md); flex: none;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  display: grid; place-items: center;
}
.brand-mark::after { content: ''; width: 10px; height: 10px; border-radius: var(--r-full); background: var(--surface); }

/* =====================================================================
   LANDING PAGE
   ===================================================================== */
.site-nav { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-nav .wrap { display: flex; align-items: center; gap: var(--s-6); height: 64px; }
.site-links { display: flex; gap: var(--s-5); margin-left: auto; }
.site-links a { font-size: var(--text-sm); font-weight: 500; color: var(--ink-3); text-decoration: none; transition: color var(--t-fast); }
.site-links a:hover { color: var(--primary); }
@media (max-width: 720px) { .site-links { display: none; } .site-nav .btn { margin-left: auto; } }

.hero { padding: var(--s-section) 0 var(--s-7); background: linear-gradient(180deg, var(--surface-tint), var(--surface) 70%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.eyebrow { display: inline-block; font-size: var(--text-xs); font-weight: 600; color: var(--accent-2); margin-bottom: var(--s-4); }
.hero h1 { font-size: var(--text-display); line-height: 1.05; letter-spacing: -.03em; font-weight: 600; text-wrap: balance; }
.hero .lede { margin-top: var(--s-5); font-size: var(--text-lg); color: var(--ink-3); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero-note { margin-top: var(--s-4); font-size: var(--text-xs); color: var(--muted); }

/* product mock */
.mock { background: var(--surface); border-radius: var(--r-3xl); padding: var(--s-3); box-shadow: var(--shadow-lg), var(--shadow-ring); }
.mock-stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-2xl); background: var(--ink); overflow: hidden; display: grid; place-items: center; }
.mock-slide { width: 72%; background: var(--surface); border-radius: var(--r-lg); padding: 7% 8%; display: grid; gap: var(--s-2); }
.mock-slide small { font-size: 11px; font-weight: 600; color: var(--accent-2); }
.mock-slide strong { font-size: clamp(13px, 1.7vw, 20px); line-height: 1.2; letter-spacing: -.01em; }
.mock-slide i { height: 6px; border-radius: var(--r-full); background: var(--surface-cool); }
.mock-slide i.short { width: 55%; }
.mock-bubble { position: absolute; right: 5%; bottom: 8%; width: 19%; aspect-ratio: 1; border-radius: var(--r-full); border: 3px solid var(--surface); background: radial-gradient(circle at 50% 38%, var(--surface-tint) 0 22%, transparent 23%), radial-gradient(circle at 50% 105%, var(--surface-tint) 0 45%, transparent 46%), linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-glow); }
.mock-rec { position: absolute; top: 5%; left: 4%; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-full); background: rgba(28, 25, 23, .7); color: var(--surface); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mock-rec span { width: 7px; height: 7px; border-radius: var(--r-full); background: var(--danger); }
.mock-outline { display: grid; gap: 2px; padding: var(--s-3) var(--s-2) var(--s-1); counter-reset: s; }
.mock-outline li { counter-increment: s; display: flex; gap: var(--s-3); align-items: center; padding: var(--s-2) var(--s-3); border-radius: var(--r-md); font-size: var(--text-xs); color: var(--muted); }
.mock-outline li::before { content: counter(s); width: 20px; height: 20px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--surface-2); font-size: 11px; font-weight: 600; flex: none; }
.mock-outline li.done { color: var(--muted-2); text-decoration: line-through; }
.mock-outline li.now { background: var(--surface-tint); color: var(--ink); font-weight: 500; }
.mock-outline li.now::before { background: var(--primary); color: var(--surface); }

.section { padding: var(--s-section) 0; }
.section-head { max-width: 640px; margin-bottom: var(--s-7); }
.section-head h2 { font-size: var(--text-4xl); line-height: 1.15; letter-spacing: -.02em; font-weight: 600; text-wrap: balance; }
.section-head p { margin-top: var(--s-3); color: var(--ink-3); font-size: var(--text-lg); }
.alt { background: var(--surface-2); }

.formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 960px) { .formats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .formats { grid-template-columns: 1fr; } }
.format { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: var(--s-5); box-shadow: var(--shadow-sm); transition: border-color var(--t-fast), transform var(--t-base); }
.format:hover { border-color: var(--accent); transform: translateY(-2px); }
.format-thumb { aspect-ratio: 16 / 10; border-radius: var(--r-md); background: var(--ink); margin-bottom: var(--s-4); position: relative; overflow: hidden; }
.format-thumb b, .format-thumb em { position: absolute; display: block; }
.format-thumb b { background: var(--surface-cool); border-radius: 4px; }
.format-thumb em { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.t-webinar b { inset: 10% 10%; } .t-webinar em { right: 6%; bottom: 8%; width: 22%; aspect-ratio: 1; border-radius: var(--r-full); border: 2px solid var(--surface); }
.t-workshop b { inset: 12% 36% 12% 6%; } .t-workshop em { inset: 12% 6% 12% 68%; border-radius: 6px; }
.t-steps b { inset: 10% 10%; } .t-steps em { left: 6%; bottom: 8%; width: 22%; aspect-ratio: 1; border-radius: var(--r-full); border: 2px solid var(--surface); }
.t-howto b { inset: 8% 8%; } .t-howto em { display: none; }
.format h3 { font-size: var(--text-lg); font-weight: 600; }
.format p { margin-top: var(--s-2); font-size: var(--text-sm); color: var(--ink-3); }
.format .meta { margin-top: var(--s-3); font-size: var(--text-xs); color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); counter-reset: n; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: n; border-top: 1px solid var(--border); padding-top: var(--s-5); }
.steps li::before { content: '0' counter(n); display: block; font-size: var(--text-xs); font-weight: 600; color: var(--accent-2); margin-bottom: var(--s-3); font-variant-numeric: tabular-nums; }
.steps h3 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -.01em; }
.steps p { margin-top: var(--s-2); color: var(--ink-3); font-size: var(--text-sm); }

.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.feature { padding: var(--s-6); border-radius: var(--r-2xl); background: var(--surface); border: 1px solid var(--border); }
.feature h3 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -.01em; }
.feature p { margin-top: var(--s-2); color: var(--ink-3); font-size: var(--text-sm); max-width: 48ch; }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); max-width: 760px; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }
.plan { padding: var(--s-6); border-radius: var(--r-3xl); border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: var(--s-4); }
.plan.featured { border-color: var(--accent); background: var(--surface-tint); }
.plan h3 { font-size: var(--text-lg); font-weight: 600; }
.plan .price { font-size: var(--text-4xl); font-weight: 600; letter-spacing: -.02em; }
.plan .price span { font-size: var(--text-sm); font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .yearly { font-size: var(--text-sm); font-weight: 500; color: var(--ink-3); margin-top: calc(var(--s-2) * -1); }
.plan .blurb { font-size: var(--text-sm); color: var(--ink-3); }
.plan ul { display: grid; gap: var(--s-2); font-size: var(--text-sm); color: var(--ink-2); flex: 1; }
.plan li { padding-left: var(--s-5); position: relative; }
.plan li::before { content: ''; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: var(--r-full); background: var(--accent); }

.cta-band { text-align: center; padding: var(--s-section) var(--s-5); background: var(--ink); color: var(--surface); }
.cta-band h2 { font-size: var(--text-4xl); font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.cta-band p { margin: var(--s-3) auto var(--s-6); color: var(--muted-2); max-width: 48ch; }
.site-foot { padding: var(--s-6) 0; font-size: var(--text-xs); color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; align-items: center; }

/* =====================================================================
   STUDIO APP
   ===================================================================== */
.app { background: var(--surface-2); min-height: 100vh; display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start; }
.count { min-width: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--surface-cool); font-size: 11px; font-weight: 600; line-height: 20px; text-align: center; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* workspace sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s-4); padding: var(--s-4); background: var(--surface); border-right: 1px solid var(--border); }
.sidebar .brand { padding: var(--s-1) var(--s-2); font-size: var(--text-sm); }
.ws-name { display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: var(--s-2); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-size: var(--text-sm); font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; transition: background-color var(--t-fast), border-color var(--t-fast); }
.ws-name:hover { background: var(--surface-2); border-color: var(--border-strong); }
.ws-name span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-avatar { flex: none; width: 28px; height: 28px; border-radius: var(--s-2); background: var(--surface-tint); color: var(--primary); display: grid; place-items: center; font-size: var(--text-xs); font-weight: 600; }
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.side-actions .btn { padding: 0 var(--s-3); }
#side-record.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.is-live #side-record { background: var(--danger); }
.is-live #side-record .rec-dot { animation: pulse 1.2s var(--ease) infinite; }
.side-nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: var(--s-3); height: 40px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-md); background: none; font-size: var(--text-sm); font-weight: 500; color: var(--ink-3); text-align: left; white-space: nowrap; cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast); }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item:active { background: var(--surface-cool); }
.nav-item[aria-current="page"] { background: var(--surface-tint); color: var(--primary); }
.nav-item .count { margin-left: auto; }
.upgrade-card { margin-top: auto; display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-xl); background: var(--surface-tint); font-size: var(--text-xs); color: var(--ink-3); }
.upgrade-card strong { font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); gap: var(--s-3); }
  .side-nav { display: flex; overflow-x: auto; margin: 0 calc(var(--s-4) * -1); padding: 0 var(--s-4); }
  .nav-item { flex: none; }
  .nav-item .count { margin-left: 0; }
  .upgrade-card { margin-top: 0; }
}

/* workspace pages */
.page { max-width: 1200px; margin: 0 auto; padding: var(--s-6) var(--s-5); }
.narrow-page { max-width: 760px; }
.page-head { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: space-between; align-items: end; margin-bottom: var(--s-5); }
.page-head h1 { font-size: var(--text-3xl); font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.page-head p { font-size: var(--text-sm); color: var(--muted); margin-top: var(--s-1); max-width: 60ch; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s-3); }
.section-head h2 { font-size: var(--text-lg); font-weight: 600; }
.quiet { font-size: var(--text-sm); color: var(--muted); }
.home-formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-6); }
@media (max-width: 1100px) { .home-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .home-formats { grid-template-columns: 1fr; } }
.format-card { display: grid; gap: var(--s-1); align-content: start; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-2xl); background: var(--surface); box-shadow: var(--shadow-sm); text-align: left; cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-base); }
.format-card:hover { border-color: var(--accent); background: var(--surface-tint); }
.format-card:active { transform: scale(.98); }
.format-card strong { font-size: var(--text-base); font-weight: 600; }
.format-card span { font-size: var(--text-xs); color: var(--muted); }
.start-card { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-6); background: var(--surface); border-radius: var(--r-2xl); box-shadow: var(--shadow-sm), var(--shadow-ring); }
.start-card > div { flex: 1; min-width: 200px; display: grid; gap: var(--s-2); }
.start-card strong { font-size: var(--text-sm); font-weight: 600; }
.progress { height: 8px; border-radius: var(--r-full); background: var(--surface-cool); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: var(--r-full); background: var(--primary); transition: width var(--t-base); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.toolbar .input { max-width: 320px; }
.toolbar .select { width: auto; max-width: 240px; }
.checklist { display: grid; gap: var(--s-2); margin-top: var(--s-5); }
.check { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-4); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-ring); }
.check > div { flex: 1; min-width: 0; }
.check h3 { font-size: var(--text-sm); font-weight: 600; }
.check p { font-size: var(--text-xs); color: var(--muted); }
.check .tick { flex: none; width: 24px; height: 24px; border-radius: var(--r-full); border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: var(--text-xs); font-weight: 600; color: var(--surface); }
.check.done .tick { background: var(--primary); border-color: var(--primary); }
.check.done h3 { color: var(--muted); text-decoration: line-through; }
.rows { display: grid; gap: var(--s-2); }
.row-card { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-4); background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-ring); }
.row-card > div { flex: 1; min-width: 140px; }
.row-card h3 { font-size: var(--text-sm); font-weight: 600; overflow-wrap: anywhere; }
.row-card p { font-size: var(--text-xs); color: var(--muted); }
.pl-list { display: grid; margin-bottom: var(--s-4); }
.pl-list label { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; font-size: var(--text-sm); cursor: pointer; }
.pl-list input { width: 18px; height: 18px; accent-color: var(--primary); }
.inline-form { display: flex; gap: var(--s-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-4); }
dialog.tiny { max-width: min(420px, calc(100vw - 32px)); }
.card-actions { flex-wrap: wrap; }

.studio { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-5); padding: var(--s-5); max-width: 1440px; margin: 0 auto; align-items: start; }
@media (max-width: 1000px) { .studio { grid-template-columns: 1fr; padding: var(--s-4); } }

.stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-2xl); overflow: hidden; background: var(--ink); box-shadow: var(--shadow-sm), var(--shadow-ring); }
.stage canvas, .stage video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage video { background: var(--ink); object-fit: contain; }
.rec-badge { position: absolute; top: var(--s-4); left: var(--s-4); display: flex; align-items: center; gap: var(--s-2); padding: 6px var(--s-3); border-radius: var(--r-full); background: rgba(28, 25, 23, .72); color: var(--surface); font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-badge .dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--danger); animation: pulse 1.2s var(--ease) infinite; }
.rec-badge.paused .dot { background: var(--muted-2); animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(28, 25, 23, .55); color: var(--surface); font-size: clamp(72px, 16vw, 160px); font-weight: 600; font-variant-numeric: tabular-nums; }

.controls { margin-top: var(--s-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-3); background: var(--surface); border-radius: var(--r-3xl); box-shadow: var(--shadow-sm), var(--shadow-ring); }
.controls .group { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.controls .spacer { flex: 1; }
.ico { width: 16px; height: 16px; flex: none; }
.rec-dot { width: 10px; height: 10px; border-radius: var(--r-full); background: currentColor; }
.rec-square { width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.hint { margin-top: var(--s-3); font-size: var(--text-xs); color: var(--muted); }
.hint kbd { font: inherit; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-3); }

.review { margin-top: var(--s-4); padding: var(--s-5); background: var(--surface); border-radius: var(--r-3xl); box-shadow: var(--shadow-sm), var(--shadow-ring); display: grid; gap: var(--s-4); }
.review h2 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -.01em; }
.review .actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.field { display: grid; gap: var(--s-2); }
.field label, .label { font-size: var(--text-xs); font-weight: 600; color: var(--ink-3); }
.input, .select { width: 100%; height: 44px; padding: 0 var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-size: var(--text-sm); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input:hover, .select:hover { border-color: var(--border-strong); }
.input:focus-visible, .select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--surface-tint); }
.chapters { font-size: var(--text-sm); color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); white-space: pre-wrap; font-variant-numeric: tabular-nums; max-height: 180px; overflow: auto; margin: 0; font-family: var(--font); }

.panel { background: var(--surface); border-radius: var(--r-3xl); box-shadow: var(--shadow-sm), var(--shadow-ring); padding: var(--s-5); display: grid; gap: var(--s-5); }
.panel h2 { font-size: var(--text-xs); font-weight: 600; color: var(--muted); margin-bottom: var(--s-3); }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.chip { min-height: 44px; padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); cursor: pointer; text-align: left; transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast); }
.chip:hover:not([disabled]) { border-color: var(--border-strong); background: var(--surface-2); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-tint); color: var(--primary); }
.chip[disabled] { opacity: .45; cursor: not-allowed; }
.format-hint { margin-top: var(--s-3); font-size: var(--text-xs); color: var(--muted); }
.row { display: flex; gap: var(--s-3); align-items: center; margin-top: var(--s-3); }
.row .label { flex: none; width: 76px; }
.swatches { display: flex; gap: var(--s-2); }
.swatch { width: 28px; height: 28px; border-radius: var(--r-full); border: 1px solid var(--border-strong); cursor: pointer; padding: 0; transition: transform var(--t-base), box-shadow var(--t-fast); }
.swatch:hover { transform: scale(1.1); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

.outline { display: grid; gap: var(--s-1); }
.outline li { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1); border-radius: var(--r-md); transition: background-color var(--t-fast); }
.outline .num { width: 24px; height: 24px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--muted); flex: none; }
.outline input { flex: 1; min-width: 0; height: 36px; border: 1px solid transparent; border-radius: var(--s-2); background: none; padding: 0 var(--s-2); font-size: var(--text-sm); }
.outline input:hover { border-color: var(--border); }
.outline input:focus-visible { outline: none; border-color: var(--accent); background: var(--surface); }
.outline .del { width: 28px; height: 28px; border: 0; border-radius: var(--r-full); background: none; color: var(--muted-2); cursor: pointer; flex: none; font-size: 16px; line-height: 1; }
.outline .del:hover { background: var(--surface-2); color: var(--danger); }
.outline li.now { background: var(--surface-tint); }
.outline li.now .num { background: var(--primary); color: var(--surface); }
.outline li.done input { color: var(--muted-2); text-decoration: line-through; }
.outline-empty { font-size: var(--text-sm); color: var(--muted); padding: var(--s-2) 0; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s-2); }

/* library */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-4); }
.card { background: var(--surface); border-radius: var(--r-2xl); box-shadow: var(--shadow-sm), var(--shadow-ring); overflow: hidden; display: flex; flex-direction: column; }
.card-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--ink); border: 0; padding: 0; cursor: pointer; display: block; width: 100%; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--t-base); }
.card-thumb:hover img { transform: scale(1.03); }
.card-thumb .dur { position: absolute; right: var(--s-2); bottom: var(--s-2); padding: 2px var(--s-2); border-radius: var(--s-2); background: rgba(28, 25, 23, .8); color: var(--surface); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.card-body { padding: var(--s-4); display: grid; gap: var(--s-1); flex: 1; }
.card-title { font-size: var(--text-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: var(--text-xs); color: var(--muted); }
.card-actions { display: flex; gap: var(--s-1); padding: 0 var(--s-3) var(--s-3); }
.empty { text-align: center; padding: var(--s-section) var(--s-5); background: var(--surface); border-radius: var(--r-3xl); box-shadow: var(--shadow-ring); }
.empty h2 { font-size: var(--text-xl); font-weight: 600; }
.empty p { margin: var(--s-2) auto var(--s-5); color: var(--muted); font-size: var(--text-sm); max-width: 42ch; }

/* dialogs + toast */
dialog { border: 0; padding: 0; border-radius: var(--r-3xl); box-shadow: var(--shadow-lg); max-width: min(920px, calc(100vw - 32px)); width: 100%; color: var(--ink); }
dialog::backdrop { background: rgba(28, 25, 23, .6); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.dialog-head h2 { font-size: var(--text-lg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-body { padding: 0 var(--s-5) var(--s-5); }
.dialog-body video { width: 100%; border-radius: var(--r-xl); background: var(--ink); display: block; aspect-ratio: 16 / 9; }
dialog.narrow { max-width: min(720px, calc(100vw - 32px)); }
.toast { position: fixed; left: 50%; bottom: var(--s-6); transform: translate(-50%, 20px); padding: var(--s-3) var(--s-5); border-radius: var(--r-full); background: var(--ink); color: var(--surface); font-size: var(--text-sm); font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity var(--t-fast), transform var(--t-base); z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.notice { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-tint); color: var(--ink-2); font-size: var(--text-xs); }
