/* Editor UI in Bright Kumedzro's system: near-black, soft greys, one blue accent, Plus Jakarta Sans, soft pills. */
:root { --r: 14px; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 500 14px/1.45 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }
.muted { color: var(--soft); } .small { font-size: 13px; } .err { color: var(--danger); min-height: 1.4em; }
[hidden] { display: none !important; }

.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 16px; height: 40px; border-radius: 999px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { background: var(--raise); border-color: var(--line-strong); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn.danger { color: var(--danger); }
.btn[aria-pressed='true'] { background: var(--tint); border-color: var(--accent); color: var(--accent-text); }

/* Top bar */
.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; background: var(--topbar); backdrop-filter: blur(10px); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand i { width: 26px; height: 18px; border-radius: 5px; background: var(--accent); display: block; position: relative; }
.brand i::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: -6px; height: 3px; border-radius: 2px; background: var(--ink); }
.title-wrap { flex: 0 1 auto; max-width: 420px; min-width: 0; }
.title { width: min(420px, 55vw); background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 15px; }
.title:hover { border-color: var(--line); } .title:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.saved { color: var(--faint); font-size: 12px; min-width: 110px; }
.actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* Layout */
.app { display: grid; grid-template-columns: 210px minmax(0, 1fr) 310px; height: calc(100vh - 61px); min-height: 480px; }
.resizer { display: none; }
.strip { border-right: 1px solid var(--line); overflow-y: auto; padding: 12px; }
.strip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.main { min-width: 0; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; }
.panel { border-left: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; min-width: 0; }
.panel > *, .panel .sec > *, .panel .field, .panel .row > *, .panel .step, .panel .step > * { min-width: 0; }
.panel input, .panel select, .panel textarea { max-width: 100%; }

/* Filmstrip */
.sl { position: relative; border-radius: 12px; border: 2px solid transparent; padding: 4px; display: block; background: transparent; }
.sl-btn { display: block; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; border-radius: 8px; }
.sl-thumb { display: block; position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--thumb); border: 1px solid var(--line); }
.sl-thumb img, .sl-thumb canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.sl[aria-current='true'] { border-color: var(--accent); background: var(--tint-soft); }
.sl-meta { display: flex; gap: 6px; align-items: baseline; padding: 6px 2px 0; font-size: 12px; color: var(--soft); }
.sl-n { font-weight: 800; color: var(--ink); min-width: 18px; }
.sl-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sl-b { font-size: 10px; border-radius: 999px; padding: 1px 7px; background: var(--raise); color: var(--soft); border: 1px solid var(--line); white-space: nowrap; }

/* Stage */
.empty { flex: 1; display: grid; place-items: center; }
.drop { max-width: 640px; text-align: center; padding: 48px 32px; border: 2px dashed var(--dash); border-radius: 28px; background: radial-gradient(120% 120% at 50% 0%, var(--tint-soft), transparent 60%); }
.drop h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 800; }
.drop p { color: var(--soft); font-size: 15px; margin: 0 0 18px; }
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.drop.over { border-color: var(--accent); background: var(--tint); }
.work { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ed-stage { position: relative; width: min(100%, calc((100vh - 170px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); container-type: normal; }
.ed-content, .ed-content > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ed-content > img { object-fit: contain; }
.ed-content .dk-ln { opacity: 1; transform: none; filter: none; transition: none; }
.ov { position: absolute; inset: 0; z-index: 2; cursor: crosshair; }
.ov:not(.draw) { cursor: default; pointer-events: none; }
.ov.draw { touch-action: none; }
.hs-mark { position: absolute; border: 1px dashed rgba(255, 255, 255, .55); border-radius: 3px; pointer-events: none; }
.hs-mark.on { background: rgba(255, 255, 255, .06); }
.stepbox { position: absolute; border: 2px solid var(--accent); border-radius: 6px; background: rgba(51, 173, 255, .12); cursor: pointer; pointer-events: auto; padding: 0; }
.stepbox.spot { border-color: #ffd24a; background: rgba(255, 210, 74, .12); }
.stepbox.k-circle { border-radius: 50%; } .stepbox.k-blur { border-style: dashed; } .stepbox.k-magnify { border-radius: 50%; border-style: double; border-width: 4px; }
.stepbox.k-reveal { border-color: #c27bff; background: rgba(194, 123, 255, .16); } .stepbox.k-reveal b { background: #c27bff; }
.stepbox.k-highlight { border-color: #ffb84a; background: rgba(255, 184, 74, .2); } .stepbox.k-highlight b { background: #ffb84a; }
.stepbox.k-pulse { border-radius: 10px; border-style: dotted; } .stepbox.k-click { border-radius: 50%; border-style: dotted; }
.stepbox.k-note { border-color: #ffd24a; background: rgba(255, 216, 74, .18); border-style: dashed; } .stepbox.k-note b { background: #ffd24a; color: #2a2410; }
.stepbox.k-stamp { border-color: #e5483d; background: rgba(229, 72, 61, .14); } .stepbox.k-stamp b { background: #e5483d; }
.stepbox.k-strike { border-color: #e5483d; background: rgba(229, 72, 61, .1); border-style: dashed; } .stepbox.k-strike b { background: #e5483d; }
.stepbox.k-countup { border-style: double; border-width: 4px; }
.stepbox.sel { box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); }
.stepbox b { position: absolute; left: -2px; top: -2px; min-width: 22px; height: 22px; border-radius: 6px 0 6px 0; background: var(--accent); color: var(--on-accent); font-size: 12px; display: grid; place-items: center; }
.stepbox.spot b { background: #ffd24a; }
.stepbox.tmp { pointer-events: none; border-style: dashed; }
.hint { margin: 0; color: var(--faint); font-size: 12.5px; text-align: center; max-width: 640px; }
.dk-fx { z-index: 3; }

/* Panel */
.sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sec .btn { max-width: 100%; white-space: normal; height: auto; min-height: 34px; padding-block: 6px; }
.sec p { overflow-wrap: anywhere; }
.sec h2 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.field > span { font-size: 12.5px; color: var(--soft); font-weight: 600; }
input[type='text'], input[type='search'], textarea, select, input[type='email'], input[type='number'] { width: 100%; background: var(--surface); border: 1px solid var(--field); border-radius: 12px; padding: 10px 12px; }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
input[type='text']:focus, textarea:focus, select:focus, input[type='email']:focus, input[type='number']:focus { outline: none; border-color: var(--accent); }
input[type='range'] { width: 100%; accent-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input[type='range'] { flex: 1 1 120px; min-width: 0; width: auto; }
.subh { margin: 18px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--soft); }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; background: var(--surface); }
.step.sel { border-color: var(--accent); }
.step .head .seg button { padding: 5px 9px; }
.step .head .iconbtn { width: 28px; height: 28px; }
.step .head { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.step .num { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.step .num.k-note { background: #ffd24a; color: #2a2410; } .step .num.k-stamp, .step .num.k-strike { background: #e5483d; }
.step .num.k-spotlight { background: #ffd24a; } .step .num.k-reveal { background: #c27bff; } .step .num.k-highlight { background: #ffb84a; }
.iconbtn { border: 1px solid var(--line); background: var(--raise); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; display: grid; place-items: center; font-size: 14px; }
.iconbtn:hover:not(:disabled) { border-color: var(--line-strong); } .iconbtn:disabled { opacity: .35; cursor: not-allowed; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.preset { width: 52px; height: 36px; border-radius: 10px; border: 2px solid var(--line); cursor: pointer; font-size: 17px; font-weight: 800; padding: 0; }
.preset[aria-pressed='true'] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--tint-ring); }

/* Dialogs, toast */
.dlg { border: 1px solid var(--line); border-radius: 22px; background: var(--dlg); color: var(--ink); padding: 24px; width: min(440px, calc(100vw - 32px)); }
.dlg.wide { width: min(560px, calc(100vw - 32px)); }
.dlg::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
.dlg h2 { margin: 0 0 10px; font-size: 20px; letter-spacing: -.02em; }
.dlg p { margin: 0 0 12px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
progress { width: 100%; height: 8px; border-radius: 999px; overflow: hidden; appearance: none; background: var(--raise); border: 0; }
progress::-webkit-progress-bar { background: var(--raise); } progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; } progress::-moz-progress-bar { background: var(--accent); }
.decklist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.decklist li { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.decklist .th { width: 72px; aspect-ratio: 16/9; border-radius: 6px; background: var(--thumb) center / cover; flex: none; }
.decklist .nm { flex: 1; min-width: 0; } .decklist .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decklist .nm span { color: var(--faint); font-size: 12px; }
.link-out { display: flex; gap: 8px; } .link-out input { flex: 1; min-width: 0; }
.checks { margin: 8px 0; padding-left: 18px; color: var(--soft); } .checks code { color: var(--ink); background: var(--surface); padding: 1px 6px; border-radius: 6px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 450; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.dropveil { position: fixed; inset: 0; z-index: 250; background: var(--veil); display: grid; place-items: center; font-size: 28px; font-weight: 800; border: 3px dashed var(--accent); margin: 10px; border-radius: 24px; inset: 0; pointer-events: none; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; max-width: 420px; text-align: center; }
.card h1 { margin: 0 0 8px; letter-spacing: -.02em; }

/* Presenter view */
.pv { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }
.pv-top { display: flex; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pv-title { font-size: 16px; } .pv-status { color: var(--soft); font-size: 13px; } .pv-sp { flex: 1; }
.pv-clock { font-size: 15px; color: var(--soft); display: inline-flex; gap: 10px; align-items: center; } .pv-clock b { font-size: 26px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pv-main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; padding: 20px; min-height: 0; }
.pv-cur, .pv-side { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.pv-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.pv-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pv-frame.sm { max-width: 300px; } .pv-frame.end { opacity: .35; }
.pv-box { position: absolute; border: 3px solid var(--accent); border-radius: 6px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
.pv-meta { margin: 0; color: var(--soft); font-size: 14px; }
.pv h2 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.pv-next { flex: none; }
.pv-notes { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#pv-notes { flex: 1; overflow: auto; font-size: clamp(20px, 2.4vw, 34px); line-height: 1.4; font-weight: 500; white-space: pre-wrap; padding: 14px 18px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line); }
#pv-notes.empty { color: var(--faint); font-size: 18px; }
.pv-foot { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
@media (max-width: 800px) { .pv { height: auto; overflow: auto; } .pv-main { grid-template-columns: 1fr; } }

/* Small screens: one column, filmstrip on top, panel below. Nothing scrolls sideways. */
@media (max-width: 900px) {
  body.ed { overflow-x: hidden; }
  .app { display: block; height: auto; }
  .strip { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; overflow-x: auto; overflow-y: hidden; }
  .strip-list { display: flex; gap: 8px; }
  .sl { flex: 0 0 132px; }
  .main { padding: 12px; overflow: visible; }
  .panel { border-left: 0; border-top: 1px solid var(--line); overflow: visible; padding: 16px 12px 48px; }
  .ed-stage { width: 100%; }
  .top { padding: 10px 12px; gap: 8px; }
  .actions { margin-left: 0; width: 100%; gap: 6px; }
  .actions .btn { padding: 0 12px; height: 38px; font-size: 13px; flex: 1 1 auto; }
  .saved { order: 3; flex: 1; text-align: right; }
  .btn { height: 44px; } .btn.sm { height: 40px; }
  .iconbtn { width: 40px; height: 40px; }
  .drop { padding: 28px 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; } }

.illo { display: block; margin: 0 auto 14px; max-width: 100%; height: auto; }
.credits { padding: 14px 16px 18px; text-align: center; font-size: 12px; color: var(--faint); }
.credits a { color: var(--soft); }

.strip { overflow-x: hidden; }
.strip-list { grid-template-columns: minmax(0, 1fr); }
.sl { min-width: 0; }
@media (max-width: 900px) { .strip { overflow-x: auto; } .strip-list { grid-template-columns: none; } }
a.btn { display: inline-grid; place-items: center; text-decoration: none; }

/* Theme switch placement */
.pv-top .theme-toggle { margin-left: 4px; }
.center-page .theme-toggle { position: fixed; top: 14px; right: 14px; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }

/* A slide whose image is gone from this device */
.missing { display: grid; place-content: center; text-align: center; gap: 6px; width: 100%; height: 100%; padding: 6px; color: var(--soft); background: var(--thumb); font-size: 11px; font-weight: 600; }
.missing.big { position: absolute; inset: 0; z-index: 1; background: var(--surface); color: var(--ink); font-size: 14px; }
.missing.big b { font-size: 18px; } .missing.big span { color: var(--soft); max-width: 36ch; }

/* Publish dialog: waiting for the sign-in link, and the live link */
.pub-wait { background: var(--tint-soft); border: 1px solid var(--tint-ring); border-radius: 16px; padding: 16px 18px 6px; margin-bottom: 8px; }
.pub-wait-h { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.pub-live { background: var(--tint-soft); border: 1px solid var(--tint-ring); border-radius: 16px; padding: 14px 16px 4px; margin: 12px 0; }
.pub-live-h { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 10px !important; }
.pub-live-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.pub-live .btn, .done-acts .btn { display: inline-grid; place-items: center; text-decoration: none; }
.done-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
#done { max-width: 480px; }

/* Share panel */
.sh-h { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--soft); margin: 0 0 6px !important; }
.pub-live .sh-h:first-of-type { margin-top: 0; }
.btn.copied { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sh-mail { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px 8px; border: 1px solid var(--field); border-radius: 12px; background: var(--bg); cursor: text; }
.chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint-ring); }
.chips input { flex: 1; min-width: 160px; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important; padding: 6px 4px; font: inherit; color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--tint); color: var(--ink); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.chip-x { border: 0; background: transparent; color: var(--soft); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1; }
.chip-x:hover { background: var(--raise); color: var(--ink); }
.sh-note { position: relative; margin-top: 8px; }
.sh-note textarea { width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--field); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; padding: 8px 12px 24px; }
.sh-note textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint-ring); }
.sh-note span { position: absolute; right: 12px; bottom: 6px; }
.sh-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.sh-row p { margin: 0 !important; flex: 1; min-width: 0; }
.shared-wrap { margin-top: 10px; }
.shared-with { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 4px; max-height: 120px; overflow: auto; font-size: 14px; }
.shared-with li { display: flex; justify-content: space-between; gap: 12px; } .shared-with li span:first-child { overflow-wrap: anywhere; }
.pub-live .link-out input { font-size: 14px; }

/* ---- Top bar: logo and deck menu on the left; theme, Publish and a Present split button on the right ---- */
.title-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 8px 12px 8px 14px; font-weight: 700; font-size: 15px; cursor: pointer; }
.title-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.title-btn:hover, .title-btn[aria-expanded='true'] { border-color: var(--line); background: var(--surface); }
.caret { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .75; }
.actions { align-items: center; flex-wrap: nowrap; }
.split { display: inline-flex; }
.split .btn:first-child { border-radius: 999px 0 0 999px; }
.split .caret-btn { border-radius: 0 999px 999px 0; padding: 0 12px; border-left: 1px solid rgba(4, 18, 28, .28); }
.split .caret-btn .caret { opacity: 1; }

/* ---- Menus and bottom sheets ---- */
.menu-layer { position: fixed; inset: 0; z-index: 500; pointer-events: none; }
.menu { position: fixed; pointer-events: auto; min-width: 224px; max-width: min(340px, calc(100vw - 16px)); background: var(--dlg); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); display: grid; gap: 1px; }
.menu-i { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; border: 0; background: none; border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 14px; cursor: pointer; color: inherit; }
.menu-i:hover:not(:disabled) { background: var(--raise); }
.menu-i:focus-visible { outline: none; background: var(--raise); box-shadow: inset 0 0 0 2px var(--accent-text); }
.menu-i:disabled { opacity: .4; cursor: not-allowed; }
.menu-i.danger { color: var(--danger); }
.menu-ic svg { width: 18px; height: 18px; display: block; }
.menu-t { flex: 1; } .menu-k { color: var(--faint); font-size: 12px; font-weight: 500; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-h { margin: 6px 10px 4px; font-weight: 800; font-size: 13px; color: var(--soft); }
.sheet-bg { position: fixed; inset: 0; background: var(--backdrop); pointer-events: auto; }
.menu.sheet { left: 0; right: 0; bottom: 0; top: auto; max-width: none; border-radius: 22px 22px 0 0; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); animation: sheet-in .2s ease-out; }
.sheet .menu-i { padding: 14px 12px; font-size: 16px; }
.sheet .menu-ic svg { width: 22px; height: 22px; }
@keyframes sheet-in { from { transform: translateY(40px); opacity: .4; } }

/* ---- Filmstrip: each thumbnail carries its own actions ---- */
.sl-grip { position: absolute; left: 10px; top: 10px; width: 22px; height: 26px; display: none; place-items: center; color: #fff; background: rgba(12, 12, 12, .72); border-radius: 7px; pointer-events: none; z-index: 2; }
.sl-grip svg { width: 18px; height: 18px; }
.sl-acts { position: absolute; right: 10px; top: 10px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; z-index: 2; }
.sl:hover .sl-acts, .sl:focus-within .sl-acts { opacity: 1; }
.ib { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(12, 12, 12, .78); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.ib svg { width: 15px; height: 15px; display: block; }
.ib:hover { background: #000; } .ib.danger:hover { background: #c62828; }
.ib:focus-visible { outline: 3px solid #fff; outline-offset: 0; box-shadow: 0 0 0 5px #0066b3; }
.sl-more { display: none; position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; z-index: 2; }
.sl-more svg { width: 20px; height: 20px; }
.ins { position: absolute; left: 0; right: 0; top: -12px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; opacity: 0; z-index: 3; }
.ins span { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.ins svg { width: 14px; height: 14px; }
.ins:hover, .ins:focus-visible, .ins[aria-expanded='true'] { opacity: 1; }
.sl-add { list-style: none; min-width: 0; position: relative; }
.sl-addbtn { width: 100%; aspect-ratio: 16 / 9; border: 2px dashed var(--dash); border-radius: 12px; background: transparent; color: var(--soft); cursor: pointer; display: grid; place-content: center; justify-items: center; gap: 2px; font-weight: 700; font-size: 13px; }
.sl-addbtn .plus svg { width: 22px; height: 22px; display: block; }
.sl-addbtn:hover, .sl-addbtn[aria-expanded='true'] { border-color: var(--accent); color: var(--accent-text); background: var(--tint-soft); }
.sl.dragging { opacity: .35; }
.sl.lifting { transform: scale(1.05); box-shadow: var(--shadow); z-index: 5; background: var(--surface); }
.sl.drop-before::before, .sl.drop-after::after, .sl-add.drop-before::before { content: ''; position: absolute; left: -2px; right: -2px; height: 4px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 3px var(--tint-ring); z-index: 6; }
.sl.drop-before::before, .sl-add.drop-before::before { top: -8px; } .sl.drop-after::after { bottom: -8px; }
.is-dragging .sl-btn { pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .sl-btn { cursor: grab; } .sl:hover .sl-grip, .sl:focus-within .sl-grip { display: grid; } }
@media (hover: none), (pointer: coarse) {
  .sl-acts, .sl-grip, .ins { display: none !important; }
  .sl-more { display: grid; }
  .sl { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}
@media (max-width: 900px) {
  .sl.drop-before::before, .sl-add.drop-before::before, .sl.drop-after::after { top: -2px; bottom: -2px; left: auto; right: auto; width: 4px; height: auto; }
  .sl.drop-before::before, .sl-add.drop-before::before { left: -8px; } .sl.drop-after::after { right: -8px; }
  .ins { top: 0; bottom: 0; left: -14px; right: auto; width: 22px; height: auto; }
  .sl-add { flex: 0 0 132px; align-self: flex-start; padding: 4px; }
  .strip-list { padding-top: 2px; }
}

/* ---- The resizable settings pane (desktop) ---- */
@media (min-width: 1024px) {
  .app { grid-template-columns: 210px minmax(0, 1fr) 8px var(--pane-w, 310px); transition: grid-template-columns .12s ease-out; }
  .app.resizing { transition: none; cursor: col-resize; user-select: none; }
  .panel { border-left: 0; }
  .resizer { display: block; position: relative; cursor: col-resize; touch-action: none; outline-offset: -3px; border-radius: 4px; }
  .resizer i { position: absolute; left: 3px; top: 0; bottom: 0; width: 2px; background: var(--line); transition: background .15s, width .15s, left .15s; }
  .resizer:hover i, .resizer:focus-visible i, .resizing .resizer i { background: var(--accent); width: 4px; left: 2px; }
}

/* ---- Transition picker ---- */
.fxp { display: grid; gap: 8px; }
.fxrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fxs { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; } .fxs-name { font-weight: 800; font-size: 15px; }
.fxdir { display: flex; gap: 4px; }
.dirb { width: 38px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.dirb[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dirb:disabled { opacity: .4; cursor: not-allowed; }
.fxq { margin-bottom: 4px; }
.fxg h3 { margin: 12px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.fxg h4 { margin: 8px 0 4px; font-size: 12px; color: var(--soft); font-weight: 700; }
.fxgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fxt { border: 2px solid var(--line); background: var(--surface); border-radius: 10px; padding: 4px; cursor: pointer; display: grid; gap: 4px; text-align: center; min-width: 0; }
.fxt:hover:not(:disabled) { border-color: var(--line-strong); }
.fxt[aria-checked='true'] { border-color: var(--accent); background: var(--tint-soft); }
.fxt:disabled { opacity: .45; cursor: not-allowed; }
.tl { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #1f8fe6; }
.tp .still { width: 100%; height: 100%; display: block; }
.tph { position: absolute; inset: 0; pointer-events: none; } .tph * { pointer-events: none; }
.gen .a, .gen .b { position: absolute; inset: 0; display: block; }
.gen .a { background: linear-gradient(135deg, hsl(var(--h, 210) 75% 42%), hsl(calc(var(--h, 210) + 25) 80% 55%)); }
.gen .b { background: linear-gradient(135deg, #ff7a59, #ffc15a); opacity: 0; }
.gen-fade .b { background: #ff7a59; }
.gen.go.gen-fade .b { animation: fxg-fade 1.2s ease-in-out both; } .gen.go.gen-cut .b { animation: fxg-cut 1.2s steps(1) both; }
.gen.go.gen-elemental .b { animation: fxg-up 1.2s ease-in-out both; } .gen.go.gen-shinobi .b { animation: fxg-smoke 1.2s ease-out both; } .gen.go.gen-paper .b { animation: fxg-page 1.2s ease-in-out both; }
.gen-elemental .b { background: linear-gradient(0deg, hsl(var(--h, 20) 90% 55%), hsl(calc(var(--h, 20) + 30) 95% 65%)); } .gen-shinobi .b { background: radial-gradient(circle at 50% 50%, hsl(var(--h, 270) 70% 55%), #140a26); } .gen-paper .b { background: linear-gradient(90deg, #f3efe6, #d8d0bf); }
@keyframes fxg-fade { 0% { opacity: 0; } 70%, 100% { opacity: 1; } }
@keyframes fxg-cut { 0%, 49% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes fxg-up { 0% { opacity: 1; clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%); } 70%, 100% { opacity: 1; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); } }
@keyframes fxg-smoke { 0% { opacity: 0; transform: scale(1.5); filter: blur(8px); } 70%, 100% { opacity: 1; transform: none; filter: none; } }
@keyframes fxg-page { 0% { opacity: 1; clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%); } 70%, 100% { opacity: 1; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); } }
.tp.rm .b { opacity: 1; animation: none; }

/* ---- Focus step kinds ---- */
.kinds { display: none; gap: 8px; }
.step.sel .kinds { display: grid; }
.kgroup { display: grid; gap: 4px; min-width: 0; }
.kg { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.kg-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.kind { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; min-width: 0; }
.kind .ki svg { width: 20px; height: 20px; display: block; }
.kind .kl { font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.kind:hover { border-color: var(--line-strong); }
.kind .kn { position: absolute; top: 3px; right: 3px; padding: 0 3px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 7px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; line-height: 1.4; }
.count { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cf { display: grid; gap: 3px; min-width: 0; font-size: 11px; font-weight: 700; color: var(--soft); }
.cf input { min-width: 0; width: 100%; box-sizing: border-box; }
.kind[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kname { font-size: 12.5px; font-weight: 700; color: var(--soft); }
.step.unknown { opacity: .7; }
.dur { min-width: 52px; text-align: right; color: var(--soft); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---- Small screens ---- */
@media (max-width: 900px) {
  .actions { width: 100%; flex-wrap: nowrap; }
  .actions .btn { flex: 0 0 auto; }
  #btn-share { flex: 1 1 auto; }
  .split { flex: 1.4 1 auto; } .split #btn-present { flex: 1; }
  .theme-toggle { height: 44px; width: 44px; }
  .title-wrap { flex: 1 1 0; }
  .menu-i { min-height: 44px; }
}
@media (max-width: 520px) {
  .brand { font-size: 0; gap: 0; }
  .saved { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); min-width: 0; }
}

/* ---- Dropdown (js/ui/select.js): the menu look, as a button + listbox ---- */
.sel-btn { appearance: none; display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; max-width: 100%; height: 40px; padding: 0 10px 0 14px; border: 1px solid var(--field); border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-align: left; }
.sel-btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--raise); }
.sel-btn:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.sel-btn[aria-expanded='true'] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint-ring); }
.sel-btn:disabled { opacity: .55; cursor: not-allowed; }
.sel-btn.sm { height: 34px; font-size: 13px; padding: 0 8px 0 12px; }
.sel-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-c { display: inline-grid; place-items: center; color: var(--soft); flex: none; }
.sel-c svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.sel-btn[aria-expanded='true'] .sel-c svg { transform: rotate(180deg); }
.sel-list { overflow: auto; overscroll-behavior: contain; }
.sel-list.sheet { max-height: 80vh; }
.sel-o { cursor: pointer; align-items: flex-start; user-select: none; }
.sel-o.active { background: var(--raise); box-shadow: inset 0 0 0 2px var(--accent-text); }
.sel-o.off { opacity: .4; cursor: not-allowed; }
.sel-t { flex: 1; display: grid; gap: 1px; min-width: 0; }
.sel-l { font-weight: 600; }
.sel-d { color: var(--soft); font-size: 12.5px; font-weight: 500; line-height: 1.35; }
.sel-ck { width: 18px; height: 18px; flex: none; visibility: hidden; color: var(--accent-text); margin-top: 1px; }
.sel-ck svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sel-o[aria-selected='true'] .sel-ck { visibility: visible; }
@media (max-width: 640px) { .sel-o { padding: 14px 12px; font-size: 16px; } .sel-btn { height: 44px; } .sel-btn.sm { height: 40px; } }
@media (prefers-reduced-motion: reduce) { .menu.sheet, .sel-c svg { animation: none; transition: none; } }

/* ---- Account bits: avatar, Sign in, save status ---- */
.acct { display: inline-flex; align-items: center; }
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; }
.avbtn { appearance: none; border: 2px solid transparent; background: none; padding: 0; border-radius: 50%; cursor: pointer; display: inline-grid; }
.avbtn:hover { border-color: var(--line-strong); } .avbtn[aria-expanded='true'] { border-color: var(--accent); }
.saved { display: inline-flex; align-items: center; gap: 6px; }
.saved::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); display: none; flex: none; }
.saved[data-state='saved']::before, .saved[data-state='local']::before { display: inline-block; background: #2e9d5b; }
.saved[data-state='saving']::before { display: inline-block; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.saved[data-state='offline']::before { display: inline-block; background: #d99a1a; }
.saved[data-state='error']::before { display: inline-block; background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .saved[data-state='saving']::before { animation: none; } }
.saved[data-state='offline'], .saved[data-state='error'] { color: var(--ink); font-weight: 600; }
.nudge { appearance: none; border: 0; background: none; color: var(--accent-text); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 4px 6px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; }
.nudge:hover { background: var(--tint-soft); }
body[data-mode='home'] .title-wrap, body[data-mode='home'] #saved, body[data-mode='home'] #btn-share, body[data-mode='home'] #btn-analytics, body[data-mode='home'] .split, body[data-mode='home'] #nudge,
body[data-mode='analytics'] .title-wrap, body[data-mode='account'] .title-wrap, body[data-mode='account'] #saved, body[data-mode='account'] #btn-share, body[data-mode='account'] #btn-analytics, body[data-mode='account'] .split, body[data-mode='account'] #nudge,
body[data-mode='analytics'] .title-wrap, body[data-mode='analytics'] #saved, body[data-mode='analytics'] #btn-share, body[data-mode='analytics'] #btn-analytics, body[data-mode='analytics'] .split, body[data-mode='analytics'] #nudge { display: none; }
body[data-mode='home'] .top .actions, body[data-mode='analytics'] .top .actions, body[data-mode='account'] .top .actions { margin-left: auto; }
@media (max-width: 520px) {
  .saved { position: static; width: auto; height: auto; overflow: visible; clip-path: none; min-width: 0; order: 5; font-size: 12px; }
  .nudge { order: 6; }
}

/* ---- Sign-in dialog ---- */
.si-code { display: grid; gap: 10px; }
.si-lead { margin: 0; font-weight: 600; }
.codebox { font: 700 34px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; letter-spacing: .32em; text-align: center; padding: 14px 8px !important; border-radius: 14px !important; }
#dlg-signin .field input { height: 46px; }

/* ---- Decks home ---- */
.home { padding: 28px 24px 60px; }
.home-in { max-width: 1120px; margin: 0 auto; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.home-head h1 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.home-acts { display: flex; gap: 8px; }
.home-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.tab { appearance: none; border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--soft); cursor: pointer; }
.tab[aria-selected='true'] { background: var(--ink); color: var(--bg); }
.dsearch { max-width: 280px; border-radius: 999px !important; }
.dgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.dcard { position: relative; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.dcard:hover { border-color: var(--line-strong); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .dcard { transition: none; } .dcard:hover { transform: none; } }
.dc-main { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.dc-main:focus-visible { outline: 3px solid var(--accent-text); outline-offset: -3px; border-radius: 16px; }
.dc-cover { display: block; aspect-ratio: 16 / 9; background: var(--thumb); overflow: hidden; }
.dc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* a deck without a cover image: its first statement slide in miniature (or its title in type), in the deck's own colours and font */
.dc-cover { container-type: inline-size; }
.dc-ph { display: flex; flex-direction: column; justify-content: center; gap: 1.2cqw; height: 100%; box-sizing: border-box; padding: 9cqw 10cqw; overflow: hidden; font-family: system-ui, sans-serif; text-align: left; }
.dc-ph.center { text-align: center; align-items: center; }
.dc-ph-l { display: block; font-size: 6.4cqw; line-height: 1.15; font-weight: 600; letter-spacing: -0.01em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%; opacity: 0.72; }
.dc-ph-l:first-child { font-size: 9.6cqw; font-weight: 800; letter-spacing: -0.02em; opacity: 1; }
.dc-t { display: grid; gap: 2px; padding: 12px 14px 14px; min-width: 0; }
.dc-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.dc-badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; }
.dc-b { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; background: rgba(12, 12, 12, .74); color: #fff; font-size: 11.5px; font-weight: 700; backdrop-filter: blur(6px); }
.dc-bi svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.dc-more { position: absolute; right: 8px; top: 8px; background: rgba(12, 12, 12, .74) !important; color: #fff !important; border-radius: 50% !important; width: 34px !important; height: 34px !important; backdrop-filter: blur(6px); }
.dc-more svg { width: 18px; height: 18px; }
.dcard.sk { min-height: 200px; } .dcard.sk .dc-cover { background: var(--raise); animation: pulse 1.2s ease-in-out infinite; }
.dempty { grid-column: 1 / -1; text-align: center; padding: 36px 12px; list-style: none; }
.dempty-h { font-size: 20px; font-weight: 800; margin: 8px 0 4px; }
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0 6px; }
.home-in.need { text-align: center; padding-top: 40px; max-width: 520px; }
.home-in.need h1 { margin: 6px 0 8px; }
@media (max-width: 640px) { .home { padding: 18px 16px 48px; } .dsearch { max-width: none; width: 100%; } .dgrid { grid-template-columns: 1fr 1fr; gap: 10px; } .dc-t { padding: 9px 10px 11px; } .dc-t b { font-size: 13.5px; } }
@media (max-width: 420px) { .dgrid { grid-template-columns: 1fr; } }

/* ---- Share dialog ---- */
.share { width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
.share .subh { margin: 18px 0 8px; font-size: 13px; color: var(--soft); }
.sh-addrow { display: flex; gap: 8px; align-items: flex-start; }
.sh-addrow .chips { flex: 1; min-width: 0; }
.sh-addrow .sel-btn { height: 44px; flex: none; }
.sh-detail { display: grid; gap: 10px; margin-top: 10px; }
.sh-note { display: grid; gap: 4px; justify-items: end; } .sh-note textarea { min-height: 64px; }
.sh-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); }
/* the Share dialog's member list: one full-width row per person. Scoped by id so the top bar's avatar row (.people, flex) can't restyle it */
#sh-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-height: 260px; overflow: auto; }
.person { display: flex; align-items: center; gap: 12px; padding: 6px 4px; border-radius: 12px; }
.person .pe { flex: 1; min-width: 0; display: grid; }
.person .pe b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.role-fixed { color: var(--soft); font-size: 13px; font-weight: 600; padding-right: 10px; }
.general { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ga-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--accent-text); flex: none; }
.ga-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ga-t { flex: 1; min-width: 0; display: grid; gap: 6px; justify-items: start; } .ga-t p { margin: 0; }
.sh-foot { justify-content: space-between; align-items: center; }
.sh-linkbox { display: grid; gap: 4px; justify-items: start; } .sh-linkbox p { margin: 0; max-width: 300px; }
@media (max-width: 640px) { .sh-addrow { flex-direction: column; } .sh-addrow .sel-btn { width: 100%; } .share { padding: 18px; } }

/* Transition tiles: a distinct still before hover. Light effects hold their real mid-frame; the Reveal ones show their own shape and hue. */
.tp.has-frozen .still { display: none; } .tp.playing .frozen { display: none; }
.gen:not(.go):not(.rm) .b { opacity: 1; }
.gen.gen-fade:not(.go):not(.rm) .b { opacity: .5; }
.gen-cut:not(.go) .b { clip-path: inset(0 0 0 50%); }
.gen-elemental:not(.go) .b { clip-path: polygon(0 calc(62% - var(--k, 0) * 4%), 100% calc(38% + var(--k, 0) * 3%), 100% 100%, 0 100%); }
.gen-shinobi:not(.go) .b { clip-path: circle(calc(26% + var(--k, 0) * 2.5%) at calc(34% + var(--k, 0) * 4%) 50%); }
.gen-paper:not(.go) .b { clip-path: polygon(calc(44% + var(--k, 0) * 3%) 0, 100% 0, 100% 100%, calc(62% + var(--k, 0) * 2%) 100%); }

#sh-msg { margin: 10px 0 0; min-height: 1.3em; }

/* ---------------- live co-editing: who is here, calmly ----------------
   Colours come from the server (the same six as the share dialog and the emails) as --pc; text on them is white, as in .av. */
.people { display: flex; align-items: center; padding-left: 6px; }
.people[hidden] { display: none; }
.pav { position: relative; appearance: none; border: 2px solid var(--bg); background: var(--pc, var(--accent)); color: #fff; width: 32px; height: 32px; border-radius: 50%; margin-left: -8px; padding: 0; cursor: pointer; display: inline-grid; place-items: center; font: 700 13px/1 inherit; transition: transform .18s ease, margin .18s ease; animation: pav-in .35s ease both; }
.pav:first-child { margin-left: 0; }
.pav:hover, .pav:focus-visible { transform: translateY(-2px); z-index: 3; }
.pav:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.pav-i { pointer-events: none; }
.pav-dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: #2e9d5b; border: 2px solid var(--bg); }
.pav-more { background: var(--raise); color: var(--ink); border-color: var(--bg); font-size: 12px; }
.pav-more[aria-expanded='true'] { border-color: var(--accent); }
.pav-tip { position: absolute; top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px); background: var(--ink); color: var(--bg); border-radius: 10px; padding: 6px 10px; text-align: left; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30; font-weight: 600; font-size: 13px; display: grid; gap: 1px; }
.pav-tip small { font-weight: 500; font-size: 11.5px; opacity: .8; }
.pav:hover .pav-tip, .pav:focus-visible .pav-tip { opacity: 1; transform: translate(-50%, 0); }
@keyframes pav-in { from { opacity: 0; transform: scale(.7); } }

/* the save indicator's connection word */
.saved[data-conn='live'][data-state='saved']::before { background: var(--live, #2e9d5b); box-shadow: 0 0 0 0 rgba(46, 157, 91, .5); animation: live-ring 2.4s ease-out infinite; }
.saved[data-conn='reconnecting'][data-state='saved']::before { background: #d99a1a; animation: pulse 1s ease-in-out infinite; }
@keyframes live-ring { 0% { box-shadow: 0 0 0 0 rgba(46, 157, 91, .45); } 70%, 100% { box-shadow: 0 0 0 6px rgba(46, 157, 91, 0); } }

/* the filmstrip: an outline in the person's colour and tiny avatars on the slide they are on */
.sl.has-peer .sl-thumb { outline: 2px solid var(--pc); outline-offset: 2px; transition: outline-color .25s; }
.sl-peers { position: absolute; top: 10px; right: 10px; display: flex; pointer-events: none; z-index: 2; }
.sl-peers .mini { width: 18px; height: 18px; border-radius: 50%; background: var(--pc); color: #fff; border: 2px solid var(--bg); display: grid; place-items: center; font: 700 9px/1 inherit; margin-left: -6px; animation: pav-in .3s ease both; box-sizing: content-box; }
.sl-peers .mini:first-child { margin-left: 0; }
.sl-peers .mini.more { background: var(--ink); color: var(--bg); }
.sl.arrive { animation: arrive .9s ease both; }
@keyframes arrive { 0% { opacity: 0; transform: translateY(-8px) scale(.97); background: var(--tint); } 100% { opacity: 1; transform: none; } }
.stepbox.arrive { animation: arrive-box .9s ease both; }
@keyframes arrive-box { from { opacity: 0; transform: scale(1.06); } }

/* live cursors on the stage: smoothed, with a name, gone after a few quiet seconds */
.cursors { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.pc { position: absolute; color: var(--pc); opacity: 0; transition: left .12s linear, top .12s linear, opacity .35s ease; will-change: left, top; }
.pc.on { opacity: 1; } .pc.on.idle { opacity: 0; }
.pc-a { display: block; width: 18px; height: 20px; margin: -2px 0 0 -3px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.pc-a svg { width: 100%; height: 100%; display: block; }
.pc-l { position: absolute; left: 14px; top: 16px; background: var(--pc); color: #fff; font: 700 11px/1 'Plus Jakarta Sans', system-ui, sans-serif; padding: 4px 8px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }

/* a field somebody else is in: a ring in their colour and a chip with their name */
.peer-host { position: relative; }
.peer-ring { box-shadow: 0 0 0 2px var(--pc), 0 0 0 5px color-mix(in srgb, var(--pc) 22%, transparent) !important; border-color: var(--pc) !important; transition: box-shadow .25s; }
.peer-chip { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: var(--pc); color: #fff; font: 700 11px/1 'Plus Jakarta Sans', system-ui, sans-serif; padding: 4px 9px 4px 4px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); animation: pav-in .3s ease both; z-index: 2; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peer-chip i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .25); display: grid; place-items: center; font-size: 9px; flex: none; }
.peer-chip.below { top: calc(100% + 4px); right: auto; left: 8px; }
@media (max-width: 900px) { .people { order: 2; } .pav { width: 34px; height: 34px; } }
@media (prefers-reduced-motion: reduce) {
  .pav, .sl-peers .mini, .peer-chip, .sl.arrive, .stepbox.arrive { animation: none; }
  .pc { transition: opacity .01ms; } .pav, .pav-tip { transition: none; }
  .saved[data-conn='live'][data-state='saved']::before { animation: none; }
}

/* ---- Batch: import dialogs, placeholder slides, apply-to-all, multi-select ---- */
.imp-sub { min-height: 1.4em; margin: 6px 0 0; }
.field-err { color: var(--danger); font-size: 13px; font-weight: 600; margin: 6px 0 0; }
#dlg-pages .field { margin-top: 12px; }
#dlg-pages input[type='text'] { height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 0 14px; font: inherit; width: 100%; box-sizing: border-box; }
#dlg-pages input[aria-invalid='true'] { border-color: var(--danger); }
.dlg-actions.stack { flex-direction: column; align-items: stretch; }
.dlg-actions.stack .btn { width: 100%; justify-content: center; }
#ap-body { margin-top: 6px; max-height: min(60vh, 520px); overflow: auto; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--soft); }

/* a PDF page that could not be imported */
.pending-thumb { display: grid; place-content: center; justify-items: center; text-align: center; gap: 2px; width: 100%; height: 100%; padding: 4px; background: repeating-linear-gradient(135deg, var(--thumb), var(--thumb) 8px, var(--raise) 8px, var(--raise) 16px); color: var(--soft); font-size: 11px; font-weight: 700; }
.pending-thumb b { color: var(--ink); font-size: 12px; }
.missing.big.pending-note { gap: 10px; padding: 24px; }
.missing.big.pending-note .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }

/* Apply to all */
.applyall { display: flex; justify-content: flex-start; margin-top: 8px; }
.row .applyall { margin: 0; }
.field .applyall { margin-top: 6px; }

/* Multi-select in the filmstrip */
.selbar { position: sticky; top: -12px; z-index: 8; margin: -12px -12px 10px; padding: 10px 12px; background: var(--tint); border-bottom: 1px solid var(--tint-ring); backdrop-filter: blur(6px); display: grid; gap: 8px; }
.sel-count { font-weight: 800; font-size: 14px; }
.sel-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.sel-acts .btn { height: 34px; padding: 0 12px; font-size: 13px; }
.sl-check { display: none; position: absolute; left: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(12, 12, 12, .55); z-index: 3; place-items: center; pointer-events: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.sl-check svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; }
.strip-list.selecting .sl-check { display: grid; }
.sl.multi { border-color: var(--accent); background: var(--tint); box-shadow: inset 0 0 0 1px var(--accent); }
.sl.multi .sl-check { background: var(--accent); border-color: var(--accent); }
.sl.multi .sl-check svg { opacity: 1; stroke: var(--on-accent); }
.sl.multi .sl-thumb { outline: 3px solid var(--accent); outline-offset: -3px; }
.strip-list.selecting .sl-grip { display: none !important; }
@media (max-width: 900px) {
  .selbar { position: sticky; left: 0; top: auto; margin: 0 0 8px; width: calc(100vw - 24px); box-sizing: border-box; border-radius: 12px; border: 1px solid var(--tint-ring); }
  .sl-check { width: 26px; height: 26px; }
}

/* Confirmation dialog (ui/confirm.js) */
.confirm-dlg { animation: cf-in .16s ease both; }
.confirm-dlg h2 { overflow-wrap: anywhere; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 700; }
.btn.danger-solid:hover:not(:disabled) { background: var(--danger); filter: brightness(1.1); border-color: var(--danger); }
@keyframes cf-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (max-width: 640px) {
  .confirm-dlg { margin: auto 0 0; width: 100%; max-width: none; border-radius: 22px 22px 0 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); animation-name: cf-sheet; }
  .confirm-dlg .dlg-actions { flex-direction: column-reverse; align-items: stretch; }
  .confirm-dlg .btn { height: 48px; }
  @keyframes cf-sheet { from { transform: translateY(100%); } }
}
@media (prefers-reduced-motion: reduce) { .confirm-dlg { animation: none; } }
.saved[data-state='trouble']::before { display: inline-block; background: var(--danger); }
.saved-details { background: none; border: 0; padding: 0 3px; color: var(--faint); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.saved-details:hover, .saved-details:focus-visible { color: var(--ink); }
.upgrade { position: fixed; left: 16px; bottom: 16px; z-index: 440; display: flex; align-items: center; gap: 10px; background: var(--dlg); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 8px 6px 16px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
@media (max-width: 640px) { .upgrade { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; } }

/* your own other windows: visible, but quieter than other people (lighter, dashed ring) */
.pav-self { background: transparent; color: var(--pc, var(--accent)); border: 2px dashed var(--pc, var(--accent)); opacity: .85; }
.pav-self .pav-i { font-weight: 700; }
.sl.has-self .sl-thumb { outline: 2px dashed var(--pc); outline-offset: 2px; opacity: .95; }
.sl-peers.self .mini { background: transparent; color: var(--pc); border: 2px dashed var(--pc); }
.pc.self { opacity: .7; } .pc.self .pc-l { background: transparent; color: var(--pc); border: 1px dashed var(--pc); }
.peer-chip.self { background: var(--bg); color: var(--pc); border: 1px dashed var(--pc); }
.peer-self.peer-ring { outline-style: dashed; }

/* ---- Sign-in methods and passkeys ---- */
.si-methods { display: grid; gap: 10px; margin: 16px 0 0; }
/* Google's button, per their branding guidelines: white with a grey outline in light, #131314 in dark, the four-colour G, "Continue with Google" */
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid #747775; background: #fff; color: #1f1f1f; font-family: inherit; font-weight: 500; font-size: 15px; line-height: 1; text-decoration: none; cursor: pointer; transition: background .15s, box-shadow .15s; }
.gbtn:hover { background: #f6f6f6; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.gbtn:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.gbtn img { width: 18px; height: 18px; flex: none; display: block; }
:root[data-theme='dark'] .gbtn { background: #131314; border-color: #8e918f; color: #e3e3e3; }
:root[data-theme='dark'] .gbtn:hover { background: #1f1f20; box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .gbtn { background: #131314; border-color: #8e918f; color: #e3e3e3; }
  :root:not([data-theme='light']) .gbtn:hover { background: #1f1f20; box-shadow: none; }
}
.si-methods .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; height: 48px; }
.pk-ic { width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: url(/img/passkey.svg) center / contain no-repeat; mask: url(/img/passkey.svg) center / contain no-repeat; }
.si-or { display: flex; align-items: center; gap: 12px; color: var(--soft); font-size: 13px; font-weight: 600; margin: 18px 0 14px; }
.si-or::before, .si-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#dlg-signin .si-form { margin: 0; }
#dlg-signin .si-form .dlg-actions { margin-top: 12px; }
#dlg-signin .si-form .btn.primary { width: 100%; height: 46px; }

/* the passkey offer after sign-in: a quiet card at the bottom, not a dialog; nothing waits on it */
.pk-offer { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 240; width: min(520px, calc(100vw - 32px)); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; background: var(--dlg); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow); }
.pk-offer .pk-badge { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; background: var(--tint); color: var(--accent-text); display: grid; place-items: center; }
.pk-offer .pk-badge .pk-ic { width: 20px; height: 20px; }
.pk-offer h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.pk-offer p { margin: 0; color: var(--soft); font-size: 13px; }
.pk-offer .pk-acts { grid-column: 2; display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pk-offer .err { min-height: 0; }
@media (max-width: 520px) { .pk-offer { bottom: 12px; grid-template-columns: minmax(0, 1fr); } .pk-offer .pk-badge { display: none; } .pk-offer .pk-acts { grid-column: 1; } .pk-offer .pk-acts .btn { flex: 1 1 0; } }
@media (prefers-reduced-motion: no-preference) { .pk-offer { animation: pk-in .25s ease-out; } @keyframes pk-in { from { opacity: 0; transform: translate(-50%, 12px); } } }

/* the passkeys list in the account menu's dialog */
.pk-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.pk-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--surface); }
.pk-item .pk-ic { width: 20px; height: 20px; color: var(--accent-text); }
.pk-name { font-weight: 600; overflow-wrap: anywhere; } .pk-meta { color: var(--soft); font-size: 12.5px; }
.pk-item .pk-acts { display: flex; gap: 6px; align-items: center; }
.pk-item .field { grid-column: 2 / -1; }
.pk-empty { margin: 14px 0 0; }
.pk-item.blocked .pk-meta { color: var(--danger); }
@media (max-width: 520px) { .pk-item { grid-template-columns: auto minmax(0, 1fr); } .pk-item .pk-acts { grid-column: 1 / -1; justify-content: flex-end; } }

/* Email gate on a shared link (api/d.js gatePage) */
.gate { display: grid; gap: 10px; width: min(360px, 100%); margin: 0 auto 18px; text-align: left; }
.gate-l { font-size: 12.5px; font-weight: 600; color: var(--soft); }
.gate input { height: 46px; }
.gate .btn { justify-content: center; width: 100%; }
.gate-err { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.gate-n { margin: 4px 0 0; font-size: 12.5px; color: var(--soft); text-align: center; }
#dlg-signin .si-legal { margin: 14px 0 0; text-align: center; font-size: 12.5px; }
#dlg-signin .si-legal a { color: var(--soft); }

/* Analytics page (editor/analytics.js). Chart colours are the Okabe-Ito pair, one per chart, so colour never carries meaning alone. */
.an { max-width: 1120px; }
.an-head { align-items: flex-end; }
.an-t h1 { margin: 6px 0 2px; }
.an-t p { margin: 0; }
.an-acts { align-items: center; flex-wrap: wrap; }
.pro-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--tint); color: var(--accent-text); font-size: 12px; font-weight: 700; }
.an-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.an-tile { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 16px 18px; display: grid; gap: 2px; }
.an-v { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.an-l { color: var(--soft); font-size: 13px; font-weight: 600; }
.an-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.an-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 12px; min-width: 0; }
.an-grid2 .an-card { margin-bottom: 0; }
.an-card h2 { margin: 0 0 2px; font-size: 16px; letter-spacing: -.01em; }
.an-card > p { margin: 0 0 10px; }
.an-fig { margin: 0; }
.an-svg { width: 100%; height: auto; display: block; overflow: visible; }
.an-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.an-axis { fill: var(--soft); font-size: 11px; font-weight: 600; }
.an-svg.a .an-bar { fill: var(--an-a); }
.an-svg.b .an-bar { fill: var(--an-b); }
.an-bar:hover { opacity: .8; }
.an-visits { width: 100%; border-collapse: collapse; font-size: 14px; }
.an-visits th { text-align: left; color: var(--soft); font-size: 12.5px; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.an-visits td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.an-visits tr:last-child td { border-bottom: 0; }
.an-who { appearance: none; background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-align: left; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.an-who:hover b { text-decoration: underline; }
.an-who:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
.an-tag { font-size: 11.5px; color: var(--soft); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.an-empty { border: 1px dashed var(--dash); border-radius: 20px; }
.an-foot { margin-top: 18px; }
.an-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; max-height: 52vh; overflow: auto; }
.an-steps li { display: grid; grid-template-columns: 110px 1fr 56px; align-items: center; gap: 10px; font-size: 14px; }
.an-sb { height: 10px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.an-sb i { display: block; height: 100%; background: var(--an-b); border-radius: 999px; }
.an-ss { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 900px) { .an-grid2 { grid-template-columns: 1fr; } .an-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .an-visits thead { position: absolute; left: -9999px; }
  .an-visits, .an-visits tbody, .an-visits tr, .an-visits td { display: block; }
  .an-visits tr { border-bottom: 1px solid var(--line); padding: 10px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
  .an-visits td { border: 0; padding: 2px 0; color: var(--soft); font-size: 13px; }
  .an-visits td:first-child { grid-column: 1 / -1; color: var(--ink); font-size: 15px; }
  .an-visits td[data-l]:not(:first-child)::before { content: attr(data-l) ": "; color: var(--faint); }
  .an-steps li { grid-template-columns: 92px 1fr 48px; }
}
/* Share dialog: Links and settings */
.sh-links { display: grid; gap: 10px; margin: 0 0 6px; }
.lk { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.lk-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lk-name { font-weight: 700; flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.lk-meta { color: var(--soft); font-size: 12.5px; }
.lk-state { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: var(--tint); color: var(--accent-text); }
.lk-state.off, .lk-state.expired { background: var(--raise); color: var(--soft); }
.lk-edit { display: grid; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.lk-edit[hidden] { display: none; }
.lk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sw { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.sw input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line-strong); position: relative; margin: 0; cursor: pointer; flex: none; transition: background .15s; }
.sw input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
.sw input:checked { background: var(--accent); border-color: var(--accent); }
.sw input:checked::after { transform: translateX(16px); background: var(--on-accent); }
.sw input:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.sh-set { display: grid; gap: 10px; margin-top: 6px; }

/* Home and Analytics: the header stays on one line at phone width (the editor's full-width actions row is for the editor only) */
@media (max-width: 900px) { body[data-mode='home'] .top .actions, body[data-mode='analytics'] .top .actions, body[data-mode='account'] .top .actions { width: auto; margin-left: auto; flex: 0 0 auto; } }

/* ---- Names: the sign-up step, the one-time card, the account-menu dialog; name + email in Share and Analytics ---- */
.name-form { display: grid; gap: 8px; }
.name-form .name-input { height: 46px; }
.name-form .name-input[aria-invalid='true'] { border-color: var(--danger); }
.name-form .name-err { min-height: 0; margin: 0; }
.name-form .dlg-actions { margin-top: 8px; }
.name-dlg p { margin: 0 0 12px; }
.name-offer .name-form { grid-column: 2; }
.name-offer .name-form .field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.name-offer .name-form .name-input { height: 40px; }
.name-offer .name-form .name-err { min-height: 0; }
@media (max-width: 520px) { .name-offer .name-form { grid-column: 1; } }
.person .pe .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-nm { display: inline-grid; min-width: 0; }
.an-nm small.an-em, p.an-em { font-size: 12px; color: var(--soft); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.name-offer .name-form .pk-acts { grid-column: auto; margin-top: 4px; }
.person .pe b .you { color: var(--soft); font-weight: 500; }
.name-offer .pk-badge { background: none; width: 40px; height: 40px; border-radius: 0; }
.name-offer .name-form .field > span + input { margin: 0; }

/* ---- The Pro badge's explanation (ui/tip.js) ---- */
.tip-wrap { display: inline-flex; }
button.pro-badge { appearance: none; border: 0; font-family: inherit; cursor: pointer; }
button.pro-badge:hover { background: var(--tint-ring); }
.tip { position: fixed; z-index: 600; background: var(--dlg); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45; font-weight: 500; box-shadow: var(--shadow); text-align: left; }
.tip[hidden] { display: none; }
.pro-thanks { max-width: 340px; }

/* ---- Account settings (/account) ---- */
.acct-page { max-width: 760px; }
.acct-head { margin-bottom: 18px; }
.acct-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px 8px; margin-bottom: 14px; }
.acct-card h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.01em; }
.acct-card > p { margin: 0 0 8px; }
.acct-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.acct-card > h2 + .acct-row { border-top: 0; }
.acct-k { display: grid; gap: 3px; min-width: 0; justify-items: start; }
.acct-v { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.acct-name { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.acct-name form { width: min(380px, 100%); text-align: left; display: grid; gap: 6px; }
.acct-name .name-input { width: 100%; }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.acct-ok { font-weight: 600; }
.acct-sub { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.acct-sub h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: -.01em; }
.acct-sub p { margin: 0 0 8px; }
.acct-sub .pk-list { margin-top: 10px; }
.acct-card .pk-status, .acct-card [role='status'] { min-height: 1.2em; margin: 8px 0 0; }
.acct-card .pk-section [role='status'] { margin-top: 10px; }
.acct-foot { text-align: center; margin: 22px 0 0; }
.acct-foot a { color: var(--soft); }
.acct-done { text-align: center; padding: 56px 12px; max-width: 480px; margin: 0 auto; }
.acct-done h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.03em; }
.dev-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.dev-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--surface); }
.dev-item.current { border-color: var(--tint-ring); background: var(--tint-soft); }
.dev-ic { width: 20px; height: 20px; color: var(--accent-text); display: block; }
.dev-ic svg { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dev-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--tint); color: var(--accent-text); font-size: 11.5px; font-weight: 700; }
.del-list { margin: 0 0 12px; padding-left: 20px; color: var(--soft); }
.del-list li { margin: 2px 0; }
#dlg-delete { width: min(480px, calc(100vw - 32px)); }
@media (max-width: 640px) {
  .acct-card { padding: 16px 16px 6px; }
  .acct-row { grid-template-columns: minmax(0, 1fr); }
  .acct-v, .acct-name { text-align: left; justify-content: flex-start; }
  .dev-item { grid-template-columns: auto minmax(0, 1fr); }
  .dev-item > .btn { grid-column: 1 / -1; justify-self: end; }
}

/* ---- The tool switch on the stage: Select / Draw focus step ---- */
.tools { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 6; display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--chrome-bg); border: 1px solid var(--chrome-line); backdrop-filter: blur(8px); }
.tools[hidden] { display: none; }
body:has(.present-root) .tools { display: none; }
.tool { appearance: none; border: 0; background: transparent; color: var(--chrome-ink); height: 30px; padding: 0 12px 0 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; cursor: pointer; position: relative; }
.tool:hover { background: var(--chrome-hover); }
.tool[aria-pressed='true'] { background: var(--accent); color: var(--on-accent); }
.tool:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 1px; }
.tool-i { width: 16px; height: 16px; display: inline-flex; }
.tool-i svg { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool-i svg path[fill] { fill: currentColor; stroke: none; }
@media (max-width: 520px) { .tool { padding: 0 10px 0 8px; height: 32px; } }
.ed-stage { user-select: none; -webkit-user-select: none; }
.acct-card a { color: var(--accent-text); }
.sh-mode { display: grid; gap: 6px; justify-items: start; }
.sh-mode .sel-btn { min-width: min(300px, 100%); }
.sh-mode p { margin: 0; max-width: 46ch; }
.sh-mode-l { font-size: 12.5px; color: var(--soft); font-weight: 600; }
.acct-v .sel-btn { min-width: 250px; }
@media (max-width: 640px) { .acct-v .sel-btn { min-width: 0; width: 100%; } }

/* ---- Feedback widget hooks (js/feedback-embed.js): stay clear of the tool switch, toasts and the filmstrip; lifted above the bottom bar on phones; hidden over dialogs, menus and present mode ---- */
:root { --feedback-offset: 16px; --feedback-launcher: block; }
@media (max-width: 640px) { :root { --feedback-offset: 84px; } }
:root:has(.present-root), :root:has(dialog[open]), :root:has(.menu-layer) { --feedback-launcher: none; }
