:root {
  /* Showplain: ink on paper, one volt-lime highlight, record red only while recording */
  --navy: #141318;
  --navy-2: #26242d;
  --ink: #141318;
  --paper: #f7f5ee;
  --card: #fffdf8;
  --lime: #c6f23c;
  --lime-soft: #c6f23c4d;
  --violet: #141318;
  --muted: #5b5866;
  --line: #1413181f;
  --red: #ff4a2e;
  --green: #12b76a;
  --brand: #141318;
  --on-brand: #fffdf8;
  --radius: 16px;
  --shadow: 0 1px 2px #1413180d, 0 8px 24px #1413180f;
  --display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15px/1.55 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--ink); text-decoration-color: var(--lime); text-decoration-thickness: 2px; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .4em; font-weight: 700; font-family: var(--display); letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(26px, 4vw, 34px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* --- buttons + inputs --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 500 14px/1 inherit; font-family: inherit; padding: 11px 16px; border-radius: 999px;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--lime); color: var(--ink); border-color: transparent; font-weight: 600; }
.btn-brand { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-red { background: var(--red); color: #fff; border-color: transparent; }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; }

label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #14131829; border-radius: 12px; padding: 11px 13px; outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--lime-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--violet); width: 16px; height: 16px; }

/* --- app shell --- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2)); background: var(--navy); color: #fff;
}
.logo { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font: 700 21px/1 var(--display); letter-spacing: -.035em; }
.logo-word b { font-weight: inherit; position: relative; z-index: 0; color: var(--ink); }
.logo-word b::before { content: ''; position: absolute; z-index: -1; left: -.04em; right: -.07em; top: .3em; bottom: -.04em; background: var(--lime); clip-path: polygon(.16em 0, 100% 0, 100% 100%, 0 100%); border-radius: 0 .2em .2em 0; }
.logo-mark { width: 30px; height: 30px; flex: none; background: url(/brand/mark.svg) center / contain no-repeat; }
.topbar .logo-mark { background-image: url(/brand/mark-lime.svg); }
.topbar .spacer { flex: 1; }
.topbar .btn:not(.btn-primary) { background: #ffffff14; color: #fff; border-color: #ffffff1f; }
.topbar a.navlink { color: #ffffffcc; text-decoration: none; font-size: 14px; padding: 8px 10px; }
.topbar a.navlink:hover { color: #fff; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }

/* --- toasts --- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px #0006; transition: opacity .4s, transform .4s; }
.toast-ok { background: #0b6b45; }
.toast-error { background: #b4233c; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* --- auth --- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 500px at 85% -10%, #c6f23c26, transparent 60%), var(--navy); }
.auth .card { width: min(100%, 420px); padding: 30px; }
.auth form { display: grid; gap: 14px; margin-top: 18px; }
.auth .switch { margin-top: 16px; text-align: center; font-size: 14px; }
.auth .logo { color: var(--ink); margin-bottom: 14px; }
.error-text { color: var(--red); font-size: 14px; min-height: 1em; margin: 0; }

/* --- library --- */
.lib-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; }
.lib-head h1 { margin: 0; flex: 1; }
.lib-head input[type=search] { width: min(100%, 280px); border-radius: 999px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.vcard { overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s; }
.vcard:hover { transform: translateY(-2px); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--navy-2) center / cover no-repeat; }
.thumb .dur { position: absolute; right: 8px; bottom: 8px; background: #000b; color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 6px; }
.thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #ffffff80; font-size: 13px; }
.vcard .body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.vcard .title { font-weight: 600; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .meta { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.vcard .meta .grow { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--lime-soft); color: var(--ink); }
.chip-warn { background: #ffb02014; color: #b26b00; }
.chip-ok { background: #12b76a17; color: #0b7a4a; }
.empty { text-align: center; padding: 60px 20px; }
.empty .big { font-size: 46px; }

/* --- recorder --- */
.rec-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 10px; cursor: pointer; text-align: center; font: 500 13.5px/1.3 inherit; font-family: inherit; color: var(--ink); }
.mode .ico { font-size: 24px; display: block; margin-bottom: 6px; }
.mode[aria-pressed=true] { border-color: var(--violet); background: #c6f23c33; box-shadow: 0 0 0 3px var(--lime-soft); }
.stack { display: grid; gap: 14px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.corners { display: flex; gap: 8px; }
.corners button { width: 42px; height: 30px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; position: relative; }
.corners button::after { content: ''; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.corners [data-corner=tl]::after { top: 4px; left: 5px; } .corners [data-corner=tr]::after { top: 4px; right: 5px; }
.corners [data-corner=bl]::after { bottom: 4px; left: 5px; } .corners [data-corner=br]::after { bottom: 4px; right: 5px; }
.corners [aria-pressed=true] { border-color: var(--violet); } .corners [aria-pressed=true]::after { background: var(--violet); }
.stage-preview { aspect-ratio: 16 / 9; border-radius: var(--radius); background: radial-gradient(800px 400px at 70% 0%, #c6f23c22, transparent 60%), var(--navy); position: relative; overflow: hidden; display: grid; place-items: center; color: #ffffffb0; text-align: center; }
.stage-preview .hint { max-width: 340px; padding: 20px; font-size: 14px; }
.stage-preview .hint strong { color: #fff; display: block; font-size: 18px; margin-bottom: 4px; }
#cam-preview-wrap { position: absolute; left: 4%; bottom: 6%; width: 26%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 4px solid #fff; box-shadow: 0 10px 30px #0008; }
body[data-corner=tl] #cam-preview-wrap, body[data-corner=tr] #cam-preview-wrap { bottom: auto; top: 6%; }
body[data-corner=tr] #cam-preview-wrap, body[data-corner=br] #cam-preview-wrap { left: auto; right: 4%; }
body[data-mode=cam] #cam-preview-wrap { position: absolute; inset: 0; width: auto; border-radius: 0; border: 0; aspect-ratio: auto; }
body[data-mode=cam] .stage-preview .hint { display: none; }
#cam-preview { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.meter { height: 6px; border-radius: 6px; background: #0b0e1f14; overflow: hidden; }
.meter::after { content: ''; display: block; height: 100%; width: calc(var(--level, 0) * 100%); background: var(--green); transition: width .08s; }
.perm { border: 1px dashed var(--violet); background: #c6f23c26; border-radius: 14px; padding: 14px; display: grid; gap: 10px; font-size: 14px; }
.notice { background: #fff6e5; border: 1px solid #ffd58a; border-radius: 12px; padding: 12px 14px; font-size: 14px; }

.recording { display: grid; gap: 16px; justify-items: center; }
#rec-preview { width: min(100%, 980px); border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
#rec-preview canvas, #rec-preview video { display: block; width: 100%; height: auto; }
.rec-bar { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 10px 12px 10px 18px; border-radius: 999px; box-shadow: 0 10px 30px #0b0e1f40; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--red); animation: blink 1.2s infinite; }
.is-paused .rec-dot { animation: none; background: #ffb020; }
@keyframes blink { 50% { opacity: .25; } }
#rec-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 64px; }
.rec-bar .btn { background: #ffffff1a; color: #fff; border-color: transparent; }
.rec-bar .btn-red { background: var(--red); }
.countdown { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #141318cc; color: #fff; font-size: 140px; font-weight: 700; }

.done { max-width: 620px; margin: 30px auto; text-align: center; padding: 30px; }
.done .big { font-size: 48px; }
.progress { height: 8px; background: #0b0e1f12; border-radius: 8px; overflow: hidden; margin: 14px 0 8px; }
.progress > div { height: 100%; width: 3%; background: var(--ink); transition: width .3s; }
.done.has-error .progress > div { background: var(--red); }
.done.is-finished .progress > div { background: var(--green); }
.linkbox { display: flex; gap: 8px; margin: 18px 0 10px; }
.linkbox input { flex: 1; }
.done .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* --- video editor --- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 22px; align-items: start; }
.player { width: 100%; border-radius: var(--radius); background: #000; display: block; aspect-ratio: 16 / 9; }
.title-input { font-size: 20px !important; font-weight: 600; border-color: transparent !important; padding-left: 4px !important; background: transparent !important; }
.title-input:hover { border-color: var(--line) !important; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 13px 12px; font: 500 14px inherit; font-family: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--ink); border-color: var(--lime); border-bottom-width: 3px; }
.tabpanel { padding: 18px; max-height: calc(100vh - 220px); overflow: auto; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.block-ed { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: #fafbff; }
.block-ed .head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.block-ed .head .grow { flex: 1; }
.block-ed img { border-radius: 8px; max-height: 160px; object-fit: cover; }
.add-blocks { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- AI notes + transcript (editor and share page) --- */
.ai-notes p { margin: 0 0 12px; }
.ai-notes ul { margin: 0 0 14px; padding-left: 20px; }
.ai-notes li { margin-bottom: 4px; }
.ai-notes h3 { margin-top: 14px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.chapters { list-style: none; padding: 0 !important; margin: 0 0 14px; }
.chapters button { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 10px; font: inherit; cursor: pointer; color: var(--ink); }
.chapters button:hover, .chapters button.on { background: var(--lime-soft); }
.chapters time, .transcript time { color: var(--brand); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; min-width: 44px; }
.transcript { display: grid; gap: 2px; }
.transcript .seg { display: flex; gap: 12px; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.transcript .seg:hover { background: #0b0e1f08; }
.transcript .seg.on { background: var(--lime-soft); }
.transcript mark { background: #ffe58a; border-radius: 3px; }
.transcript [contenteditable] { outline: none; flex: 1; }
.transcript [contenteditable]:focus { background: #fff; box-shadow: 0 0 0 2px var(--lime); border-radius: 6px; }
.status-line { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #c6f23c33; font-size: 14px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #14131826; border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- share page --- */
.share-top { display: flex; align-items: center; gap: 12px; padding: 14px max(16px, calc((100vw - 1180px) / 2)); background: #fff; border-bottom: 1px solid var(--line); }
.share-top .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; color: var(--ink); }
.share-top .brand img { height: 34px; width: auto; max-width: 160px; object-fit: contain; }
.share-top .spacer { flex: 1; }
.share-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; align-items: start; }
.share-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.page-blocks { display: grid; gap: 18px; }
.page-blocks .md h2 { font-size: 22px; } .page-blocks .md h3 { font-size: 18px; }
.page-blocks .md p { margin: 0 0 10px; }
.page-blocks .md blockquote { margin: 0 0 10px; padding: 8px 14px; border-left: 3px solid var(--brand); background: #fff; border-radius: 0 8px 8px 0; }
.page-blocks figure { margin: 0; } .page-blocks figure img { border-radius: 12px; display: block; }
.page-blocks figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.side-card { position: sticky; top: 16px; }
.side-card .tabpanel { max-height: calc(100vh - 120px); }
.made-with { text-align: center; padding: 30px 16px 40px; font-size: 13px; color: var(--muted); }
.made-with a { color: var(--ink); font-weight: 600; text-decoration: none; }

/* --- landing --- */
.hero { background: radial-gradient(900px 480px at 80% -10%, #c6f23c2e, transparent 60%), var(--navy); color: #fff; padding: 70px 16px 90px; text-align: center; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); max-width: 860px; margin: 0 auto 16px; letter-spacing: -.02em; }
.hero h1 span { color: var(--ink); background: var(--lime); padding: 0 .12em; border-radius: .08em .2em .2em .08em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero p { color: #ffffffbf; font-size: 18px; max-width: 620px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .cta .btn:not(.btn-primary) { background: #ffffff14; color: #fff; border-color: #ffffff2a; }
.hero .fine { font-size: 13px; color: #ffffff90; margin-top: 16px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: -50px; }
.feature { padding: 22px; }
.feature .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--lime-soft); font-size: 21px; margin-bottom: 12px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: s; }
.steps li { list-style: none; padding: 20px; }
.steps li::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--ink); font-weight: 600; margin-bottom: 10px; }
footer.site { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px 40px; }

@media (max-width: 960px) {
  .rec-layout, .editor, .share-layout { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .tabpanel, .side-card .tabpanel { max-height: none; }
}
@media (max-width: 560px) {
  .modes { grid-template-columns: 1fr 1fr 1fr; }
  .mode { padding: 10px 4px; font-size: 12px; }
  .row-2 { grid-template-columns: 1fr; }
  .topbar a.navlink { display: none; }
  .linkbox { flex-direction: column; }
  .countdown { font-size: 90px; }
}

/* --- plans + billing --- */
.plan-pill { font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--lime); color: var(--ink); text-decoration: none; white-space: nowrap; }
.plan-pill.is-paid { background: #ffffff14; color: #fff; border: 1px solid #ffffff26; }
.pro-tag { display: inline-block; font: 700 10px/1 var(--display); letter-spacing: .06em; padding: 4px 6px; border-radius: 6px; background: var(--ink); color: var(--lime); text-decoration: none; vertical-align: middle; }
.banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 14px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); margin-bottom: 18px; font-size: 14.5px; }
.banner.hl { background: #c6f23c33; border-color: #c6f23c; }
.banner .grow { flex: 1; min-width: 200px; }
.locked { opacity: .55; pointer-events: none; }
.lock-note { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; border: 1px dashed #14131840; font-size: 14px; }
.lock-note .grow { flex: 1; }
.chip-dead { background: #ff4a2e1a; color: #b8321c; }
.made-badge { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 10px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-size: 13px; font-weight: 500; box-shadow: 0 8px 24px #14131840; }
.made-badge img { width: 20px; height: 20px; }
.made-badge b { color: var(--lime); font-weight: 600; }
.price-toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); gap: 4px; }
.price-toggle button { border: 0; background: none; font: 500 14px var(--display); padding: 9px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.price-toggle button[aria-pressed=true] { background: var(--ink); color: #fff; }
.price-toggle .save { color: var(--ink); background: var(--lime); font-size: 11px; padding: 2px 6px; border-radius: 6px; margin-left: 4px; }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tier { padding: 24px; display: grid; gap: 14px; }
.tier.featured { border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--lime); }
.tier .price { font: 700 44px/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tier .price small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tier ul { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 14.5px; }
.tier .tag { justify-self: start; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: #c6f23c4d; }
.legal { max-width: 760px; }
.legal h2 { margin-top: 30px; font-size: 22px; }
.legal p, .legal li { color: #2b2a31; }
.legal ul { padding-left: 22px; }
@media (max-width: 900px) { .tiers { grid-template-columns: 1fr; } }
