* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0b0b0c; color: #fff; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
h1 { font-size: 30px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin: 0 0 12px; line-height: 1.25; }
p { line-height: 1.5; margin: 0 0 14px; font-size: 16px; }
.dim { color: #a8a8ad; }
.small { font-size: 14px; }
[hidden] { display: none !important; }

.screen { position: fixed; inset: 0; display: none; flex-direction: column; }
.screen.show { display: flex; }
.screen.black { background: #000; }
.pad { padding: calc(env(safe-area-inset-top) + 22px) 20px calc(env(safe-area-inset-bottom) + 22px); }
section.pad { overflow-y: auto; }
.center { justify-content: center; text-align: center; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
main.pad { padding-top: 8px; }

.top { padding: calc(env(safe-area-inset-top) + 18px) 20px 10px; }
.top.row { padding-bottom: 4px; }
.back { color: #fff; font-size: 17px; font-weight: 600; padding: 8px 12px 8px 0; }
.brandrow { display: flex; align-items: center; justify-content: space-between; }
.brand { height: 25px; width: auto; opacity: 0.5; }
.tabs { display: flex; gap: 8px; margin-top: 14px; }
.tabs button { flex: 1; padding: 11px; border-radius: 12px; background: #1a1a1d; color: #a8a8ad; font-weight: 600; font-size: 15px; }
.tabs button.on { background: #fff; color: #000; }

.group { padding: 14px 20px 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8b8b91; }
.card { display: block; width: calc(100% - 32px); margin: 0 16px 10px; padding: 16px; border-radius: 16px; background: #17171a; text-align: left; }
.card .tag, .tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #ffd60a; margin-bottom: 7px; }
.tagrow { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.tagrow .tag { margin-bottom: 0; }
.pri { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: #fff; background: #ff3b30; padding: 3px 8px; border-radius: 6px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 10px; }
.tile { position: relative; min-height: 104px; padding: 16px 14px 14px; border-radius: 16px; background: #17171a; text-align: left; display: flex; flex-direction: column; justify-content: flex-end; }
.tile .tname { font-size: 18px; font-weight: 700; line-height: 1.2; }
.tile .tcount { margin-top: 5px; font-size: 13.5px; color: #a8a8ad; }
.tile .pri { position: absolute; top: 12px; left: 14px; }
.tile.quiet .tname { color: #8b8b91; }
.crumb { display: block; padding: 6px 20px 2px; color: #a8a8ad; font-size: 16px; font-weight: 600; }
.cattitle { padding: 6px 20px 12px; margin: 0; font-size: 26px; }
.empty.short { padding: 18px 30px 26px; }
.card .hl { font-size: 18px; font-weight: 700; line-height: 1.28; }
.card .sum { margin-top: 7px; color: #a8a8ad; font-size: 14.5px; line-height: 1.42;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: 9px; font-size: 13px; color: #8b8b91; }
.card.done .hl { color: #c9c9ce; }
.card.pending { background: #2a2110; }
.card.pending .acts { display: flex; gap: 8px; margin-top: 12px; }
.card.pending .acts button { flex: 1; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.14); font-weight: 600; font-size: 14px; }
.empty { padding: 44px 30px; text-align: center; color: #8b8b91; line-height: 1.5; }

.big { display: block; width: 100%; margin-top: 14px; padding: 17px; border-radius: 14px; background: #fff; color: #000; font-weight: 700; font-size: 17px; text-align: center; }
.ghost { display: block; width: 100%; margin-top: 10px; padding: 16px; border-radius: 14px; background: #1c1c1f; color: #fff; font-weight: 600; font-size: 16px; text-align: center; }
.big:disabled, .ghost:disabled { opacity: 0.5; }
.script { white-space: pre-wrap; background: #141416; border-radius: 14px; padding: 16px; font-size: 16px; line-height: 1.55; color: #e7e7ea; margin: 6px 0 4px; }
.label { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #8b8b91; margin: 22px 0 8px; }
.reveal { font-size: 18px; line-height: 1.45; color: #fff; background: #1d1a0c; border-left: 3px solid #ffd60a; border-radius: 10px; padding: 13px 14px; margin: 0 0 4px; }
h2 + .label, .sentnote + .label { margin-top: 6px; }
.sentnote { font-size: 14.5px; color: #8fb4ff; margin: -4px 0 12px; }
.vers { display: flex; gap: 8px; margin-top: 12px; }
.ver { flex: 1; padding: 12px; border-radius: 12px; background: #26262b; text-align: left; }
.ver .vname { font-size: 16px; font-weight: 700; }
.ver .vmeta { margin-top: 3px; font-size: 12.5px; color: #8b8b91; }
.ver.ig .vname { color: #ff7ab8; } .ver.tt .vname { color: #5fe3e8; }

/* Ready: count on the tab, check circles, save bar */
.tabs button { position: relative; }
.badge { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #ff3b30; color: #fff; font-size: 12.5px; font-weight: 800; text-align: center; vertical-align: 1px; }
.grouprow { display: flex; align-items: center; justify-content: space-between; }
.link { color: #ffd60a; font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; padding: 6px 0 6px 12px; }
.pickrow { display: flex; align-items: center; gap: 14px; }
.open { flex: 1; min-width: 0; text-align: left; }
.tick { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #6a6a70; position: relative; }
.tick::before { content: ""; position: absolute; inset: -9px; }
.tick.on { background: #ffd60a; border-color: #ffd60a; }
.tick.on::after { content: ""; position: absolute; left: 9px; top: 4px; width: 7px; height: 13px; border: solid #000; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.card.sel, .ver.sel { box-shadow: inset 0 0 0 2px #ffd60a; }
.ver { display: flex; align-items: center; gap: 8px; }
.savedlink { margin-top: 10px; padding-bottom: 12px; font-size: 15px; }
#selBar { padding: 12px 16px calc(env(safe-area-inset-bottom) + 14px); background: #0b0b0c; border-top: 1px solid #232326; display: flex; gap: 10px; }
#selBar .big { margin-top: 0; flex: 1; }
#selBar .ghost { margin-top: 0; width: auto; padding: 16px 20px; }

/* Film */
#cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); background: #111; }
#nocam { position: absolute; left: 0; right: 0; top: 54%; text-align: center; color: #bbb; font-size: 15px; padding: 0 30px; display: none; }
#prompter { position: absolute; left: 0; right: 0; top: 0; height: 46%; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 62%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 16%, #000 62%, transparent 100%); }
#roll { position: absolute; left: 0; right: 0; top: 0; will-change: transform; text-align: center; }
.ln { height: var(--lh); line-height: var(--lh); font-size: var(--fs); font-weight: 800; letter-spacing: 0.01em; white-space: nowrap;
  color: rgba(255,255,255,0.5); text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.9); }
.ln.on { color: #fff; }
#cue { position: absolute; left: 18px; right: 18px; top: calc(env(safe-area-inset-top) + 58px); text-align: center; font-size: 19px; font-weight: 700; line-height: 1.3;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.9); display: none; }
#paused { position: absolute; left: 50%; top: 47%; transform: translateX(-50%); background: rgba(0,0,0,0.65); padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; display: none; white-space: nowrap; }
#count { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 140px; font-weight: 800; text-shadow: 0 4px 24px rgba(0,0,0,0.8); }
#closeFilm { position: absolute; left: 14px; top: calc(env(safe-area-inset-top) + 10px); width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.5); font-size: 17px; z-index: 3; }
#timer { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 132px); background: rgba(0,0,0,0.6); padding: 5px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; display: none; }
#timer::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; margin-right: 7px; }
#bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 18px calc(env(safe-area-inset-bottom) + 18px); display: flex; align-items: center; justify-content: space-between; background: linear-gradient(to top, rgba(0,0,0,0.75), transparent); }
.ctl { width: 108px; text-align: center; }
.ctl.off { visibility: hidden; }
.ctl .lab { font-size: 12px; color: #d0d0d0; margin-bottom: 6px; font-weight: 600; }
.rowc { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ctl button { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.18); font-size: 22px; font-weight: 700; line-height: 1; }
.ctl .val { min-width: 24px; font-size: 13px; font-variant-numeric: tabular-nums; }
#rec { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; display: flex; align-items: center; justify-content: center; flex: none; }
#rec i { display: block; width: 58px; height: 58px; border-radius: 50%; background: #ff3b30; transition: all 0.15s; }
#rec.on i { width: 30px; height: 30px; border-radius: 7px; }

#play, #finalPlay { width: 100%; max-height: 52vh; background: #111; border-radius: 14px; }
.meter { height: 10px; border-radius: 999px; background: #232326; overflow: hidden; margin: 22px 0 16px; }
.meter i { display: block; height: 100%; width: 0; background: #fff; border-radius: 999px; transition: width 0.25s; }

#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 28px); transform: translateX(-50%); background: #fff; color: #000; padding: 11px 18px;
  border-radius: 999px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: 88vw; text-align: center; z-index: 9; }
#toast.show { opacity: 1; }
