/* StepCast, in the ShiftRight family look (shift-right.co): misty lavender paper, deep ink,
   violet for actions, Bricolage Grotesque headlines over Geist text, pill buttons, soft orbs.
   Amber is kept for one job only: the box StepCast draws around "the thing to click". */
:root {
  --ink: #1C1633;
  --ink-2: #2A2247;
  --ink-soft: #4A4363;
  --slate: #6B6585;
  --mist: #F5F3FC;
  --paper: #F5F3FC;
  --card: #FFFFFF;
  --line: #E3DFF2;
  --line-2: #CFC8EC;
  --violet: #7B3FBF;
  --violet-deep: #5B2A93;
  --violet-soft: #EFE8FA;
  --lavender: #B9B4F0;
  --amber: #F2A93B;
  --mint: #2BB98A;
  --rec: #E0424A;
  --marker: var(--amber);
  --ok: var(--mint);
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(28,22,51,.04), 0 18px 40px -28px rgba(60,30,110,.35);
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Geist", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { overflow-x: clip; }
body { font: 16px/1.55 var(--body); color: var(--ink); background: var(--mist); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font-size: .92em; background: var(--violet-soft); padding: 1px 6px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* the ShiftRight orb */
.orb { --c1: #C9A6F2; --c2: #7B3FBF; --c3: #3E1D6B; display: inline-block; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 6%, var(--c1) 34%, var(--c2) 78%, var(--c3) 100%);
  box-shadow: inset -6px -8px 16px rgba(28,22,51,.25), 0 12px 24px -12px var(--c2); }
.orb.a { --c1: #FFE3B0; --c2: #F2A93B; --c3: #B5701A; }
.orb.m { --c1: #BFF2DF; --c2: #2BB98A; --c3: #13704F; }
.orb.l { --c1: #E4E1FF; --c2: #9C95E6; --c3: #5A52B0; }

/* ---------- controls ---------- */
button, input, textarea, select { font: inherit; color: inherit; }
button {
  border: 0; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2);
  border-radius: var(--radius-pill); padding: 9px 16px; font-weight: 600; cursor: pointer; line-height: 1.2;
  transition: transform .15s, background .2s, box-shadow .2s, color .2s;
}
button:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; transform: none; }
button.primary { background: var(--violet); color: #fff; box-shadow: none; }
button.primary:hover { background: var(--violet-deep); }
button.primary.alt { background: var(--ink); color: #fff; }
button.primary.alt:hover { background: var(--ink-2); }
button.rec { background: var(--rec); color: #fff; box-shadow: none; }
button.rec::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #fff; margin-right: 9px; vertical-align: 1px; }
button.rec:hover { background: #C8323A; }
button.big { padding: 15px 24px; font-size: 16px; }
button.small { padding: 6px 13px; font-size: 14px; }
button.wide { width: 100%; text-align: left; border-radius: var(--radius-md); }
button.link { box-shadow: none; background: none; padding: 0; border-radius: 0; color: var(--violet); text-decoration: underline; font-weight: 500; }
button.danger { background: none; box-shadow: none; color: var(--rec); }
button.danger:hover { box-shadow: inset 0 0 0 1.5px var(--rec); }
button.ghostDark { background: none; }
input[type=text], input[type=url], input[type=search], input[type=password], input[type=number], textarea, select {
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); padding: 10px 13px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 4px rgba(123,63,191,.14); }
textarea { resize: vertical; line-height: 1.5; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); }
.check input { margin-top: 3px; accent-color: var(--violet); }
.fine { font-size: 13px; color: var(--slate); }
.err { color: var(--rec) !important; }

/* ---------- top bar: frosted, like the ShiftRight nav ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 3vw, 32px); min-height: 68px; background: rgba(245,243,252,.84);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 23px/1 var(--display); letter-spacing: -.03em; color: var(--ink); text-decoration: none; }
.brand b { color: var(--violet); font-weight: 800; }
.brand .orb { width: 24px; height: 24px; }
.topNav { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; justify-content: flex-end; font-size: 14px; }
.top .ghost, .top .onDark { background: transparent; box-shadow: none; color: var(--ink-soft); padding: 8px 12px; font-weight: 500; }
.top .ghost:hover { color: var(--ink); background: rgba(123,63,191,.08); }
.top button.rec { padding: 10px 18px; }
.navLink { color: var(--ink-soft); font-weight: 500; text-decoration: none; padding: 8px 6px; }
.navLink:hover { color: var(--ink); }
.extOk { color: var(--ink-soft); font-size: 13px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-pill); }
.extOk::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(43,185,138,.18); }
.account { display: inline-flex; gap: 6px; align-items: center; color: var(--slate); font-size: 13px; padding-left: 8px; border-left: 1px solid var(--line); }

.banner { margin: 0; padding: 12px clamp(16px, 3vw, 32px); background: #FFF4E0; border-bottom: 1px solid #F3D9A6; font-size: 14px; }

/* live recording strip */
.recLive { position: sticky; top: 68px; z-index: 25; display: flex; align-items: center; gap: 14px;
  margin: 12px clamp(16px, 3vw, 32px) 0; padding: 10px 10px 10px 18px; border-radius: var(--radius-pill);
  background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 18px 40px -20px rgba(28,22,51,.6); }
.recLive .onDark { margin-left: auto; background: var(--rec); color: #fff; box-shadow: none; padding: 10px 18px; }
.recLive .onDark:hover { background: #C8323A; }
.recDot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 0 rgba(224,66,74,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(224,66,74,0); } 100% { box-shadow: 0 0 0 0 rgba(224,66,74,0); } }

/* ---------- sign-in ---------- */
.auth { position: relative; max-width: 1180px; margin: 0 auto; padding: 9vh clamp(20px, 4vw, 40px) 72px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.auth::before { content: ""; position: absolute; z-index: -1; right: -140px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 5%, #E4E1FF 34%, #B9B4F0 72%, #9C95E6 100%); opacity: .7; filter: blur(.5px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--violet);
  background: var(--violet-soft); padding: 6px 12px; border-radius: var(--radius-pill); margin: 0 0 18px; }
.auth h1 { font: 800 clamp(44px, 6.4vw, 80px)/.98 var(--display); letter-spacing: -.035em; margin: 0 0 18px; }
.auth h1 span { display: block; color: var(--ink-soft); font-weight: 500; font-size: .62em; letter-spacing: -.02em; line-height: 1.12; margin-top: 10px; }
.lede { font-size: 18px; color: var(--ink-soft); margin: 0 0 26px; max-width: 48ch; }
button.google { display: inline-flex; align-items: center; gap: 12px; padding: 15px 26px; font-size: 16px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--ink); }
button.google:hover { background: var(--ink); color: #fff; }
#authMsg { min-height: 22px; font-size: 14px; margin: 12px 0 0; }
.auth .fine { margin-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.chips li { border: 1px solid var(--line); padding: 6px 12px; border-radius: var(--radius-pill); font-size: 13px; background: var(--card); color: var(--ink-soft); }

.authDemo { margin: 0; }
.demoFrame { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; box-shadow: 0 40px 80px -40px rgba(60,30,110,.5); }
.demoBar { display: flex; align-items: center; gap: 6px; padding: 4px 8px 12px; color: var(--slate); font-size: 12px; }
.demoBar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.demoBar span { margin-left: 8px; background: var(--mist); padding: 3px 10px; border-radius: var(--radius-pill); }
.demoPage { background: var(--mist); border-radius: 18px; padding: 28px 28px 32px; display: grid; gap: 12px; }
.demoLine { height: 12px; border-radius: 6px; background: #E6E2F4; }
.demoLine.w60 { width: 60%; height: 20px; background: #D8D2EE; }
.demoLine.w40 { width: 40%; }
.demoField { height: 36px; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; margin-top: 6px; }
.demoField.short { width: 55%; }
.demoBtn { justify-self: start; position: relative; margin-top: 8px; padding: 10px 18px; border-radius: var(--radius-pill); background: var(--violet); color: #fff; font-weight: 600; font-size: 14px; }
/* the one orchestrated moment: the highlight box draws itself around the button */
.demoHl { position: absolute; inset: -8px; border: 3px solid var(--amber); border-radius: 999px; box-shadow: 0 0 0 4px rgba(242,169,59,.22); animation: draw 1.1s .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes draw { from { opacity: 0; transform: scale(1.35); } to { opacity: 1; transform: scale(1); } }
.authDemo figcaption { display: flex; gap: 12px; align-items: center; margin-top: 18px; font-weight: 600; color: var(--ink-soft); }

.stepTag { flex: none; display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius-pill);
  background: var(--violet); color: #fff; font: 800 15px/1 var(--display); }

.family { text-align: center; font-size: 13px; color: var(--slate); padding: 0 20px 36px; }
.family a { color: var(--violet); font-weight: 600; text-decoration: none; }
.family a:hover { text-decoration: underline; }

/* ---------- app layout ---------- */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.library { padding: 22px 14px 22px clamp(14px, 2vw, 22px); }
.libHead { display: flex; justify-content: space-between; align-items: center; margin: 0 6px 12px; }
.libHead h2 { font: 800 18px/1 var(--display); letter-spacing: -.02em; margin: 0; }
.search { width: 100%; margin-bottom: 12px; border-radius: var(--radius-pill) !important; padding-left: 16px !important; }
#guideList { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#guideList button { width: 100%; text-align: left; box-shadow: none; background: transparent; padding: 11px 14px; border-radius: 14px; font-weight: 600; font-size: 14.5px; line-height: 1.3; }
#guideList button:hover { background: rgba(123,63,191,.07); }
#guideList button small { display: block; color: var(--slate); font-weight: 400; font-size: 12.5px; margin-top: 4px; }
#guideList button[aria-current="true"] { background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
#guideList button[aria-current="true"]::before { content: ""; float: left; width: 4px; height: 34px; margin: 2px 10px 0 -6px; border-radius: 4px; background: var(--violet); }
#guideList .fine { padding: 8px 12px; }
.sharedDot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); margin-left: 6px; vertical-align: 1px; }

main { padding: 28px clamp(16px, 3vw, 40px) 80px 8px; min-width: 0; }
.importMsg { margin: 0 0 20px; padding: 13px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); font-weight: 600; box-shadow: var(--shadow); }
.importMsg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); margin-right: 10px; vertical-align: 1px; }
.importMsg.err::before { background: var(--rec); }

/* start / empty state */
.start { max-width: 820px; }
.start h1 { font: 800 clamp(34px, 4.4vw, 52px)/1.02 var(--display); letter-spacing: -.035em; margin: 10px 0 14px; }
.recordForm { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 22px 18px; display: grid; gap: 12px; margin-bottom: 28px; box-shadow: var(--shadow); }
.recordForm > label:first-child { font: 800 16px/1.2 var(--display); }
.recRow { display: flex; gap: 10px; flex-wrap: wrap; }
.recRow input { flex: 1 1 280px; font-size: 16px; padding: 13px 18px; border-radius: var(--radius-pill); }
.recRow button { padding: 13px 22px; }
.extHelp { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 22px 120px 22px 24px; margin-bottom: 28px; position: relative; overflow: hidden; }
.extHelp::after { content: ""; position: absolute; right: -46px; top: -46px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff 0 5%, #C9A6F2 34%, #7B3FBF 78%, #3E1D6B 100%); opacity: .55; }
.extHelp > * { position: relative; z-index: 1; }
.extHelp h2 { font: 800 20px/1.2 var(--display); margin: 0 0 6px; }
.extHelp p, .extHelp li { color: #D9D4F1; }
.extHelp code { background: rgba(255,255,255,.12); color: #fff; }
.extHelp a { color: #fff; }
.howto { margin: 8px 0 0; padding-left: 20px; }
.howto li { margin: 4px 0; }
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: f; }
.flow li { counter-increment: f; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: grid; gap: 4px; align-content: start; }
.flow li::before { content: counter(f); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font: 800 14px/1 var(--display); margin-bottom: 8px; text-shadow: 0 1px 2px rgba(28,22,51,.55);
  background: radial-gradient(circle at 32% 28%, #fff 0 4%, #C9A6F2 30%, #7B3FBF 75%, #3E1D6B 100%); }
.flow li:nth-child(2)::before { background: radial-gradient(circle at 32% 28%, #fff 0 4%, #FFE3B0 30%, #F2A93B 75%, #B5701A 100%); }
.flow li:nth-child(3)::before { background: radial-gradient(circle at 32% 28%, #fff 0 4%, #BFF2DF 30%, #2BB98A 75%, #13704F 100%); }
.flow strong { font: 800 18px/1.2 var(--display); letter-spacing: -.01em; }
.flow span { color: var(--ink-soft); font-size: 14px; }

/* guide editor */
.guideHead { margin-bottom: 20px; }
.title { width: 100%; border: 0; border-bottom: 2px solid transparent; background: transparent; font: 800 clamp(28px, 3.2vw, 40px)/1.1 var(--display); letter-spacing: -.03em; padding: 2px 0; border-radius: 0; }
.meta { color: var(--slate); margin: 8px 0 0; font-size: 14px; }
#saveState { margin-left: 6px; color: var(--mint); font-weight: 600; }

/* ---------- step editor ---------- */
.lead { display: block; font-size: 13px; font-weight: 600; color: var(--slate); margin: 0 0 18px; }
.lead textarea { display: block; width: 100%; margin-top: 6px; font-weight: 400; font-size: 15px; color: var(--ink); border-radius: var(--radius-md); }
#notice { min-height: 0; margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); }
#notice:empty { margin: 0; }
#notice.err { color: var(--rec); }

#steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 18px; }
#steps > li { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 16px 18px 18px; box-shadow: var(--shadow); }
.stepHead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stepHead input { flex: 1 1 220px; min-width: 0; border-color: transparent; background: transparent; font: 700 19px/1.3 var(--display); letter-spacing: -.01em; padding: 6px 10px; }
.stepHead input:hover { border-color: var(--line); }
.tools { display: flex; gap: 2px; margin-left: auto; }
.tools button { padding: 6px 11px; font-size: 13px; font-weight: 500; color: var(--slate); background: transparent; box-shadow: none; }
.tools button:hover { color: var(--ink); background: var(--mist); box-shadow: none; }
.tools button.del:hover { color: var(--rec); background: #FDECEE; }
.shot { position: relative; margin: 14px 0; border-radius: 16px; overflow: hidden; background: var(--ink); line-height: 0; border: 1px solid var(--line); }
.shot img { width: 100%; height: auto; display: block; }
.hl { position: absolute; border: 3px solid var(--amber); border-radius: 8px; box-shadow: 0 0 0 3px rgba(28,22,51,.5), 0 0 0 9999px rgba(28,22,51,.16); pointer-events: none; }
.shot.blurring { cursor: crosshair; outline: 3px solid var(--violet); touch-action: none; }
.shot.blurring img { pointer-events: none; user-select: none; }
.blurBox { position: absolute; background: rgba(28,22,51,.55); border: 2px dashed #fff; pointer-events: none; }
.narr { display: block; font-size: 13px; font-weight: 600; color: var(--slate); }
.narr textarea { display: block; width: 100%; margin-top: 6px; font-size: 15px; font-weight: 400; color: var(--ink); border-radius: 14px; background: var(--mist); border-color: transparent; }
.narr textarea:focus { background: var(--card); }
.stepFoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: center; margin-top: 10px; }
.voiceTag { font-size: 12px; color: var(--slate); }
.hold { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--slate); }
.hold input { width: 74px; padding: 6px 10px; border-radius: var(--radius-pill); }

.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--slate); }
.field select, .field input { font-weight: 400; color: var(--ink); }
.hint { margin: 0; font-size: 13px; color: var(--slate); }


.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.musicInfo { display: grid; gap: 6px; font-size: 14px; }
#musicName { font-weight: 600; }

/* ---------- dialogs ---------- */
dialog { border: 0; border-radius: var(--radius-lg); padding: 0; max-width: min(94vw, 1100px); box-shadow: 0 40px 100px -20px rgba(28,22,51,.55); color: var(--ink); background: var(--card); }
dialog::backdrop { background: rgba(28,22,51,.55); backdrop-filter: blur(3px); }
dialog form { padding: 26px; width: min(92vw, 540px); }
dialog h2 { margin: 0 0 8px; font: 800 26px/1.12 var(--display); letter-spacing: -.025em; }
dialog h3 { font: 800 16px/1.2 var(--display); margin: 20px 0 8px; }
dialog p { color: var(--ink-soft); font-size: 14px; margin: 0 0 14px; }
dialog label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
dialog label input, dialog label textarea { display: block; width: 100%; margin-top: 6px; font-weight: 400; font-size: 15px; }
dialog label.check { display: flex; }
dialog label.check input { width: auto; }
dialog textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
dialog input[readonly] { background: var(--mist); }
.row { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row.between { justify-content: space-between; align-items: center; margin: 0 0 6px; }
#shareMsg { min-height: 18px; }
#pasteDlg form { width: min(92vw, 640px); }
#playerDlg { background: var(--ink); color: #fff; width: min(94vw, 1100px); }
#playerDlg button:not(.primary) { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; }
.dlgHead { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; }
#stage { display: block; width: 100%; height: auto; background: #120E24; }
#playerStatus { margin: 0; padding: 12px 18px 16px; font-size: 14px; color: var(--lavender); min-height: 46px; }
#adminDlg form { width: min(94vw, 980px); }
.tableWrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--card); }
#adminDlg table { width: 100%; border-collapse: collapse; font-size: 14px; }
#adminDlg th, #adminDlg td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
#adminDlg th { font-weight: 600; color: var(--slate); background: var(--mist); }
#adminDlg .num { text-align: right; font-variant-numeric: tabular-nums; }
#adminDlg tbody tr:last-child td { border-bottom: 0; }
#adminDlg td a { font-weight: 600; color: var(--violet); }

/* ---------- shared guide page ---------- */
.viewer { max-width: 940px; margin: 0 auto; padding: 36px 20px 80px; }
.viewer h1 { font: 800 clamp(34px, 4.6vw, 54px)/1.02 var(--display); letter-spacing: -.035em; margin: 0 0 12px; }
.viewer .lede { margin-bottom: 24px; }
.playerBox { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--ink); line-height: 0; box-shadow: 0 40px 80px -40px rgba(60,30,110,.6); }
.playerBox canvas { width: 100%; height: auto; display: block; }
.playerBox .bigPlay { position: absolute; left: 50%; top: auto; bottom: 9%; transform: translateX(-50%); background: var(--violet); color: #fff; box-shadow: 0 14px 30px -10px rgba(0,0,0,.5); padding: 15px 28px; font-size: 17px; }
.playerBox .bigPlay:hover { background: var(--violet-deep); }
.playerBar { display: flex; gap: 12px; align-items: center; margin: 14px 0 0; min-height: 40px; }
.playerBar p { margin: 0; flex: 1; color: var(--ink-soft); font-size: 15px; }
.viewer ol { list-style: none; margin: 44px 0 0; padding: 0; display: grid; gap: 22px; counter-reset: step; }
.viewer ol > li { counter-increment: step; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 18px 20px 20px; box-shadow: var(--shadow); }
.viewer ol > li::before { content: counter(step); grid-row: span 4; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--violet); color: #fff; font: 800 16px/1 var(--display); }
.viewer h2 { font: 800 21px/1.25 var(--display); letter-spacing: -.015em; margin: 5px 0 4px; }
.viewer li p { margin: 0 0 12px; color: var(--ink-soft); max-width: 70ch; }
.viewer .shot { margin: 0; }
.viewer li button { justify-self: start; padding: 7px 14px; font-size: 13px; margin-top: 10px; }
.viewer .outro { color: var(--ink-soft); font-size: 18px; margin-top: 32px; }
.viewer .made { margin-top: 48px; font-size: 13px; color: var(--slate); }
.viewer .made a { font-weight: 600; color: var(--violet); }
body.embed { background: var(--card); }
body.embed .top { display: none; }
body.embed .viewer { padding-top: 16px; }

/* ---------- legal pages ---------- */
.legal { max-width: 70ch; margin: 0 auto; padding: 44px 20px 80px; }
.legal h1 { font: 800 42px/1.05 var(--display); letter-spacing: -.03em; margin: 0 0 8px; }
.legal h2 { font: 800 20px/1.25 var(--display); margin: 30px 0 6px; }
.legal .updated { color: var(--slate); font-size: 14px; margin: 0 0 20px; }
.legal p, .legal li { color: var(--ink-soft); }

/* ---------- screen recorder page ---------- */
.recorderPage { max-width: 780px; margin: 0 auto; padding: 40px 20px 80px; }
.recorderPage h1 { font: 800 clamp(34px, 4.4vw, 48px)/1.04 var(--display); letter-spacing: -.035em; margin: 0 0 12px; }
.recorderPage > p { color: var(--ink-soft); max-width: 62ch; }
.recCard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); display: grid; gap: 16px; margin-top: 22px; }
.recCard .opts { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.recCard .opts label { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.recCard .opts input { accent-color: var(--violet); width: 18px; height: 18px; }
.cam { display: flex; gap: 18px; align-items: center; }
.cam video { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; background: var(--ink); transform: scaleX(-1); box-shadow: 0 0 0 4px #fff, 0 18px 40px -16px rgba(60,30,110,.6); }
.cam p { color: var(--ink-soft); font-size: 14px; }
.recCard .row { justify-content: flex-start; align-items: center; margin: 0; }
#clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--rec); }
#msg { min-height: 24px; color: var(--ink); font-weight: 600; margin: 0; }
#result video { width: 100%; border-radius: 16px; background: var(--ink); margin: 4px 0 12px; }
a.dl { display: inline-flex; align-items: center; font-weight: 600; text-decoration: none; background: var(--violet); color: #fff; border-radius: var(--radius-pill); padding: 10px 18px; }
a.dl:hover { background: var(--violet-deep); }
button.stop { background: var(--rec); color: #fff; box-shadow: none; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .extHelp { padding-right: 24px; }
  .extHelp::after { display: none; }
  .auth { grid-template-columns: 1fr; padding-top: 6vh; gap: 40px; }
  .auth::before { width: 260px; height: 260px; right: -110px; top: -90px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .library { padding: 16px; border-bottom: 1px solid var(--line); }
  main { padding: 20px 16px 72px; }
  .flow { grid-template-columns: 1fr; }
  .top { flex-wrap: wrap; padding: 10px 16px; min-height: 60px; }
  .topNav { gap: 6px; }
  .navLink, .extOk, #accountEmail { display: none; }
  .account { border-left: 0; padding-left: 0; }
  .recLive { top: 0; margin: 10px 16px 0; }
  .banner { padding-left: 16px; padding-right: 16px; }
  .tools { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .stepHead input { flex-basis: 160px; }
  .tools button { white-space: nowrap; }
}
@media print { .top, .playerBox, .playerBar, .viewer li button, .family { display: none !important; } .viewer ol > li { break-inside: avoid; box-shadow: none; } }

/* ---------- details ---------- */
.guideHead input.title { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 2px 0; border-radius: 0; box-shadow: none; }
.guideHead input.title:hover { border-bottom-color: var(--line); }
.guideHead input.title:focus { border-bottom-color: var(--violet); }
.recordForm .fine:empty { display: none; }
.recordForm .fine { margin: 0; }

/* ---------- sidebar ---------- */
.library { display: flex; flex-direction: column; gap: 0; position: sticky; top: 68px; height: calc(100vh - 68px); overflow-y: auto; }
.newBtn { width: 100%; justify-content: center; background: var(--violet); color: #fff; box-shadow: none; padding: 12px 16px; margin-bottom: 18px; }
.newBtn::before { content: "+"; font-size: 18px; line-height: 0; margin-right: 8px; vertical-align: -1px; }
.newBtn:hover { background: var(--violet-deep); box-shadow: none; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--violet-soft); color: var(--violet); font: 600 12px/1 var(--body); vertical-align: 2px; }
.count:empty { display: none; }
#guideList { flex: 1 1 auto; align-content: start; }
.sideTools { display: grid; gap: 2px; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.sideLink { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 12px; background: none; box-shadow: none; color: var(--ink-soft); font-weight: 500; font-size: 14px; text-decoration: none; }
.sideLink:hover { background: rgba(123,63,191,.07); color: var(--ink); box-shadow: none; }
.sideLink i { font-style: normal; width: 16px; text-align: center; color: var(--violet); font-size: 11px; }
.extBox { margin: 8px 4px 0; display: grid; gap: 6px; justify-items: start; }

/* ---------- guide header ---------- */
.guideHead { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; margin-bottom: 18px; }
.guideHeadText { min-width: 0; }
textarea.title { display: block; width: 100%; resize: none; overflow: hidden; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; box-shadow: none;
  font: 800 clamp(26px, 3vw, 38px)/1.12 var(--display); letter-spacing: -.03em; padding: 2px 0; color: var(--ink); }
textarea.title:hover { border-bottom-color: var(--line); }
textarea.title:focus { border-bottom-color: var(--violet); box-shadow: none; }
.guideHeadSide { display: grid; gap: 10px; }
.guideHeadSide #poster { width: 100%; height: auto; display: block; border-radius: 16px; background: var(--ink); box-shadow: var(--shadow); }
.headBtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.headBtns button { white-space: nowrap; padding: 10px 12px; font-size: 15px; }
#btnShare.isShared { box-shadow: inset 0 0 0 1.5px var(--mint); color: #13704F; }
#btnShare.isShared::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); margin-right: 8px; vertical-align: 1px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 18px; scrollbar-width: none; }
.tabs [role=tab] { flex: none; background: none; box-shadow: none; border-radius: 0; padding: 12px 14px; color: var(--slate); font-weight: 600; font-size: 15px;
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs [role=tab]:hover { color: var(--ink); box-shadow: none; }
.tabs [role=tab][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--violet); }
.tabPanel { max-width: 980px; min-width: 0; }
#guideView, .guideHeadText { min-width: 0; }
#panel-steps { max-width: 900px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 10px; align-content: start; margin-bottom: 16px; min-width: 0; }
.card h3 { font: 800 17px/1.2 var(--display); letter-spacing: -.01em; margin: 0; }
.card p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.cards2 > .card { margin-bottom: 0; }
.cards2 + .card, .card + .cards2 { margin-top: 16px; }
.row.start { justify-content: flex-start; margin-top: 4px; }
.copyRow { display: flex; gap: 8px; flex-wrap: wrap; }
.copyRow input { flex: 1 1 260px; min-width: 0; background: var(--mist); }
#embedCode, #videoCode { width: 100%; font: 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; background: var(--mist); }
.dangerZone { border-color: #F5C9CC; }
#shareMsg:empty { display: none; }

/* ---------- analytics ---------- */
.statsHead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.statsHead .hint { flex: 1 1 320px; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.callout { background: #FFF4E0; border: 1px solid #F3D9A6; border-radius: 14px; padding: 12px 14px; margin: 0 0 16px; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.tileLabel { font-size: 13px; color: var(--slate); font-weight: 500; }
.tile strong { font: 800 30px/1.15 var(--display); letter-spacing: -.02em; color: var(--ink); }
.tileSub { font-size: 12.5px; color: var(--slate); }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .axis { fill: var(--slate); font: 11px var(--body); }
svg.chart .bar { fill: var(--violet); }
svg.chart .hit { fill: transparent; }
svg.chart .hit:hover { fill: rgba(123,63,191,.07); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.sw.watched, .fBar i.watched { background: var(--violet); }
.sw.read, .fBar i.read { background: #E0962A; }
.funnel { display: grid; gap: 10px; }
.fRow { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 12px; align-items: center; }
.fName { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fBars { display: grid; gap: 4px; }
.fBar { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.fBar::before { content: none; }
.fBar i { display: block; height: 9px; border-radius: 0 4px 4px 0; min-width: 2px; grid-column: 1; grid-row: 1; }
.fBar span { grid-column: 2; font-size: 12.5px; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.statTable { width: 100%; border-collapse: collapse; font-size: 14px; }
.statTable th, .statTable td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.statTable th { color: var(--slate); font-weight: 600; background: var(--mist); }
.statTable tr:last-child td { border-bottom: 0; }
.statTable .num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 960px) {
  .guideHead { grid-template-columns: 1fr; }
  .guideHeadSide { grid-template-columns: 160px 1fr; align-items: center; }
  .headBtns { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .library { position: static; height: auto; }
  .sideTools { grid-template-columns: 1fr 1fr; }
  .extBox { grid-column: 1 / -1; }
  .fRow { grid-template-columns: 1fr; gap: 4px; }
}
