:root {
  /* christophermoravec.com (AEH) tokens: warm paper, white cards, muted teal. */
  --bg: #fcfaf6;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --line: #e7e1d6;
  --text: #1f2328;
  --muted: #6b6456;
  --accent: #2a6f8c;
  --accent-2: #185987;
  --accent-soft: #dfeaf0;
  --accent-line: #a9c6d4;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --rec: #e5383b;
  --shadow: 0 1px 2px rgba(30, 60, 80, .06), 0 8px 24px rgba(30, 60, 80, .08);
  --shadow-lg: 0 20px 60px rgba(30, 60, 80, .22);
  --radius: 14px;
  --font: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fira Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.45;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: url(/icon.svg) center / cover; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .seg button:focus-visible, .icon-btn:focus-visible, .sp-btn:focus-visible, .corners button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px;
}
.btn[disabled] { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 7%, transparent); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-rec { background: var(--rec); border-color: var(--rec); color: #fff; box-shadow: 0 4px 14px rgba(239, 68, 68, .32); }
.btn-rec:hover { background: #f25c5c; border-color: #f25c5c; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.icon-btn svg, .btn svg { width: 18px; height: 18px; flex: none; }
.linkish { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: clamp(18px, 4vw, 40px); }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.hero h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }

/* ---------- library ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card a.thumb { display: block; position: relative; aspect-ratio: 16 / 9; background: #18181b; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .dur {
  position: absolute; right: 8px; bottom: 8px; font-size: 12px; font-weight: 600;
  background: rgba(0, 0, 0, .7); color: #fff; padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.card .badge {
  position: absolute; left: 8px; top: 8px; font-size: 12px; font-weight: 600;
  background: rgba(0, 0, 0, .7); color: #fff; padding: 3px 8px; border-radius: 6px;
}
.card .body { padding: 12px 12px 12px 14px; display: flex; gap: 8px; align-items: flex-start; }
.card .text { flex: 1; min-width: 0; }
.card .name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card .tools { display: flex; gap: 2px; opacity: .9; }
.empty { text-align: center; padding: 70px 20px; border: 1.5px dashed var(--line); border-radius: 18px; color: var(--muted); }
.empty h2 { color: var(--text); margin: 0 0 6px; font-size: 19px; }
.empty p { margin: 0 0 20px; }

/* ---------- sign in ---------- */
.signin { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 20px; }
.signin form {
  width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px;
}
.signin h1 { margin: 0; font-size: 20px; }
.field { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); padding: 0 12px; width: 100%; }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.error { color: var(--danger); font-size: 13.5px; min-height: 1em; margin: 0; }

/* ---------- recorder sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(12, 11, 10, .5); z-index: 50;
  display: grid; place-items: center; padding: 16px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
.sheet {
  width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 22px; display: grid; gap: 18px;
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.seg button {
  border: 0; background: transparent; border-radius: 9px; padding: 10px 6px; cursor: pointer;
  display: grid; justify-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.seg button svg { width: 22px; height: 22px; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.preview {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, #2a2420, #151417); display: grid; place-items: center;
}
.preview .screen-hint { color: #cfc9bf; font-size: 13px; display: grid; justify-items: center; gap: 8px; }
.preview .screen-hint svg { width: 34px; height: 34px; opacity: .7; }
.preview video.cam-full { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .bubble {
  position: absolute; left: 14px; bottom: 14px; width: 30%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .45); border: 3px solid rgba(255, 255, 255, .92); background: #000;
}
.preview .bubble video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .cam-off { color: #cfc9bf; font-size: 13px; }
.devices { display: grid; gap: 10px; }
.device { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; }
.device > span:first-child svg { width: 20px; height: 20px; color: var(--muted); display: block; }
.device > span:empty { width: 42px; }
.device select {
  height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); padding: 0 10px; min-width: 0; width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239c988f' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.toggle {
  width: 42px; height: 24px; border-radius: 99px; border: 0; background: var(--line); position: relative; cursor: pointer; flex: none;
  transition: background .15s ease;
}
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s ease; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(18px); }
.meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: -4px; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #a3e635); transition: width .08s linear; }
.sheet-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.sheet-foot .note { font-size: 12.5px; color: var(--muted); }

/* ---------- live recording ---------- */
.recbar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: #17171a; color: #fff; border-radius: 16px; padding: 8px 8px 8px 16px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 16px 50px rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .08);
  animation: rise .22s cubic-bezier(.2, .9, .3, 1.2);
}
.recbar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); animation: pulse 1.2s ease-in-out infinite; }
.recbar.paused .dot { animation: none; background: #f5a524; }
.recbar .time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 52px; }
.recbar .icon-btn { color: #dcd8cf; }
.recbar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.recbar .stop { background: var(--rec); color: #fff; border-radius: 10px; height: 36px; padding: 0 14px; border: 0; font-weight: 700; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.recbar .stop:hover { background: #f25c5c; }
.recbar .stop svg { width: 14px; height: 14px; }
.recbar .up { font-size: 12px; color: #b3aea4; }
.stage { position: fixed; inset: 0; z-index: 55; background: #0e0e10; display: grid; place-items: center; }
.stage > video { width: 100%; height: 100%; object-fit: contain; }
.stage video.mirror { transform: scaleX(-1); }
.stage .stage-hidden { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.stage-center { display: grid; gap: 8px; justify-items: center; text-align: center; color: #cfc9bf; padding: 20px; }
.stage-self { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; margin-bottom: 10px; background: #000; box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 16px 40px rgba(0, 0, 0, .5); }
.stage-self video { width: 100%; height: 100%; object-fit: cover; }
.stage-title { font-size: 17px; font-weight: 700; color: #fff; }
.stage-sub { font-size: 13px; }
.stage-note { font-size: 12.5px; color: #9c988f; }
.stage-warn { font-size: 13px; color: #fff; background: rgba(220, 38, 38, .9); padding: 6px 10px; border-radius: 8px; }
.stage > .stage-warn { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); }
.countdown {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(12, 11, 10, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.countdown span { font-size: 140px; font-weight: 800; color: #fff; text-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: tick 1s ease forwards; }
.finishing { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: var(--bg); }
.finishing .box { text-align: center; display: grid; gap: 14px; justify-items: center; }
.progress { width: 260px; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

/* ---------- share page ---------- */
.share-main { max-width: 1100px; margin: 0 auto; padding: clamp(14px, 3vw, 32px) clamp(14px, 3vw, 32px) 60px; }
.share-head { margin: 2px 2px 16px; }
.byline { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--line); flex: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.avatar-blank { display: inline-block; }
.byline-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who { font-weight: 650; font-size: 14.5px; }
.when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.title { margin: 0; font-size: clamp(21px, 2.8vw, 30px); letter-spacing: -.02em; line-height: 1.2; outline: none; border-radius: 8px; padding: 2px 4px; margin-left: -4px; }
.title[contenteditable="true"]:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.title[contenteditable="true"]:focus { background: color-mix(in srgb, var(--text) 7%, transparent); box-shadow: 0 0 0 2px var(--accent); }
.player-pending { aspect-ratio: 16 / 9; border-radius: 16px; background: #111214; display: grid; place-items: center; align-content: center; gap: 12px; color: #cfc9bf; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.spacer { flex: 1; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; display: grid; min-width: 190px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.menu a { padding: 9px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; }
.menu a:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.owner-panel { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); display: grid; gap: 12px; }
.layout-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-label { font-weight: 650; font-size: 13px; color: var(--muted); min-width: 48px; }
.seg-inline { display: inline-flex; gap: 2px; padding: 3px; }
.seg-inline button { display: block; padding: 6px 12px; font-size: 13px; }
.seg-small button { padding: 6px 10px; }
.corners { display: inline-grid; grid-template-columns: repeat(2, 24px); gap: 4px; padding: 5px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.corners button { width: 24px; height: 16px; border-radius: 4px; border: 0; background: var(--line); cursor: pointer; padding: 0; }
.corners button[aria-pressed="true"] { background: var(--accent); }
.notice {
  font-size: 13.5px; padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 11%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
}
.empty-state { text-align: center; padding: 120px 20px; }
.empty-state h1 { font-size: 24px; margin: 0 0 6px; }
.empty-state p { color: var(--muted); }

/* ---------- transcript ---------- */
.transcript-card { margin-top: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 14px 18px 6px; }
.tc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tc-head h2 { font-size: 16px; margin: 0; }
.tc-tools, .tc-edit-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tc-msg { margin: 4px 0 14px; font-size: 14px; }
.tc-body { max-height: 420px; overflow: auto; padding-right: 6px; }
.tc-p { margin: 0 0 14px; line-height: 1.8; font-size: 15px; }
.tc-ts {
  border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums;
  margin-right: 6px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.tc-ts:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.w { cursor: pointer; border-radius: 4px; padding: 1px 0; transition: background .12s; }
.w:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.w.now { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.w.cut { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); opacity: .6; }
.tc-body.editing { cursor: text; }
.tc-body.editing .w { cursor: text; }
.tc-body.editing ::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.sel-tools {
  position: absolute; z-index: 90; display: flex; gap: 6px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: pop .14s ease;
}

/* ---------- player ---------- */
.sp {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0b0b0d; border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-lg); outline: none; -webkit-user-select: none; user-select: none; --unit: 1;
}
.sp.fs { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.sp-bg {
  position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease;
  background:
    radial-gradient(110% 90% at 0% 0%, rgba(42, 111, 140, .30) 0%, transparent 55%),
    radial-gradient(110% 100% at 100% 100%, rgba(251, 191, 36, .14) 0%, transparent 55%),
    linear-gradient(135deg, #1c1714, #0f0f12);
}
.sp.sp-framed .sp-bg { opacity: 1; }
.sp-main-wrap { position: absolute; overflow: hidden; isolation: isolate; -webkit-mask-image: -webkit-radial-gradient(white, black); transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease, border-radius .35s ease, box-shadow .35s ease; }
.sp.sp-framed .sp-main-wrap { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 22px 50px rgba(0, 0, 0, .5); }
.sp-main { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.sp-cam-wrap {
  position: absolute; overflow: hidden; background: #000; cursor: pointer;
  isolation: isolate; -webkit-mask-image: -webkit-radial-gradient(white, black); /* clip video to the rounded shape */
  transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease, border-radius .35s ease, transform .25s ease;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.sp-cam-wrap[data-shape="bubble"] { box-shadow: 0 0 0 var(--ring, 4px) rgba(255, 255, 255, .95), 0 12px 32px rgba(0, 0, 0, .45); }
.sp-cam-wrap[data-shape="card"] { box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 16px 40px rgba(0, 0, 0, .5); }
.sp-cam { display: block; width: 100%; height: 100%; object-fit: cover; }
.sp-name {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px);
  padding: 4px 9px; border-radius: 8px; background: rgba(17, 18, 20, .62); color: #fff;
  font-size: max(11px, calc(15px * var(--unit))); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sp-cam-wrap[data-shape="bubble"] .sp-name { display: none; }
.sp.started.controls-on .sp-cam-wrap.bottom { transform: translateY(-46px); }
.sp-caption {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: max-content; max-width: 78%;
  text-align: center; pointer-events: none; transition: bottom .2s ease;
}
.sp.started.controls-on .sp-caption { bottom: 62px; }
.sp-caption span {
  background: rgba(0, 0, 0, .74); color: #fff; padding: .18em .55em; border-radius: 8px; line-height: 1.5;
  font-size: max(14px, calc(26px * var(--unit))); font-weight: 600;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.sp-big {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 84px; height: 84px; border-radius: 50%;
  border: 0; background: rgba(17, 18, 20, .58); color: #fff; display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .15s ease, background .15s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.sp-big:hover { background: var(--accent); transform: translate(-50%, -50%) scale(1.05); }
.sp-big svg { width: 34px; height: 34px; }
.sp-big[aria-label="Play"] svg { margin-left: 4px; }
.sp-end { position: absolute; inset: 0; background: rgba(0, 0, 0, .42); }
.sp-spin {
  position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: spin .8s linear infinite; pointer-events: none;
}
.sp-controls {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 4px;
  padding: 22px 10px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.sp.started.controls-on .sp-controls { opacity: 1; pointer-events: auto; }
.sp-btn {
  width: 36px; height: 36px; border: 0; background: transparent; color: #fff; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer; flex: none; padding: 0;
}
.sp-btn:hover { background: rgba(255, 255, 255, .14); }
.sp-btn svg { width: 20px; height: 20px; }
.sp-btn[aria-pressed="true"] { color: var(--accent-2); }
.sp-btn svg, .sp-big svg { pointer-events: none; } /* the click always lands on the button itself */
.sp-speed { width: auto; height: 28px; padding: 0 9px; margin: 0 2px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 999px; }
.sp-speed-wrap { position: relative; flex: none; }
.sp-speed-menu {
  position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 5; display: grid; padding: 4px; min-width: 76px;
  background: rgba(20, 21, 24, .94); border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
.sp-speed-menu[hidden] { display: none; }
.sp-speed-menu button {
  border: 0; background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums;
  padding: 7px 12px; border-radius: 7px; text-align: right; cursor: pointer;
}
.sp-speed-menu button:hover { background: rgba(255, 255, 255, .14); }
.sp-speed-menu button[aria-checked="true"] { background: rgba(255, 255, 255, .2); }
.sp-time { color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 6px; }
.sp-scrub { flex: 1; min-width: 40px; height: 22px; margin: 0 6px; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; --p: 0%; }
.sp-scrub::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--p), rgba(255, 255, 255, .32) var(--p)); }
.sp-scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -5px; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.sp-scrub::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .32); }
.sp-scrub::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
.sp-scrub::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: 18px; transform: translate(-50%, -30px); opacity: 0; pointer-events: none;
  background: #17171a; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); z-index: 100; transition: transform .25s ease, opacity .25s ease;
  display: flex; gap: 8px; align-items: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { background: var(--danger); }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }
.finishing .spinner { border-color: var(--line); border-top-color: var(--accent); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes tick { 0% { transform: scale(1.4); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: scale(.85); } }

@media (max-width: 600px) {
  .hero h1 { font-size: 22px; }
  .recbar { bottom: 14px; }
  .sp { border-radius: 12px; }
  .sp-big { width: 64px; height: 64px; }
  .sp-big svg { width: 26px; height: 26px; }
  .sp-btn { width: 32px; height: 32px; }
  .sp-time { font-size: 12px; padding: 0 2px; }
  .sp-speed { padding: 0 4px; }
  .sp.started.controls-on .sp-cam-wrap.bottom { transform: translateY(-40px); }
  .sp.started.controls-on .sp-caption { bottom: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Brand type: Fira Sans for headings and the name, mono for times. */
h1, h2, .title, .brand, .who, .sheet-head h2, .stage-title { font-family: var(--display); }
.tc-ts, .sp-time, .dur, .recbar .time, .when { font-family: var(--mono); font-feature-settings: "tnum"; }

.description { margin: 6px 0 0; max-width: 70ch; color: var(--muted); font-size: 16px; line-height: 1.5; white-space: pre-wrap; border-radius: 8px; padding: 2px 6px; margin-left: -6px; outline: none; }
.description[contenteditable]:empty::before { content: attr(data-placeholder); color: color-mix(in srgb, var(--muted) 60%, transparent); }
.description[contenteditable]:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.description[contenteditable]:focus { background: var(--panel); box-shadow: 0 0 0 2px var(--accent); color: var(--text); }
.desc-write { font-size: 13px; margin-top: 6px; }
.row-note { font-size: 13px; color: var(--muted); }
