@import url("fonts/fonts.css");
/* GlideClip, light editor ("StudioLight"). Used by index.html and account.html. */
:root {
  --bg: #f4f5f7; --surface: #ffffff; --sunk: #f3f4f6; --seg: #eef0f3; --ink: #12161c; --muted: #5b6472; --faint: #7a8492;
  --line: #e3e6eb; --line2: #dde1e7; --field: #c9cfd8;
  --accent: #f2b544; --accent-ink: #1a1306; --soft: #fff8e6; --link: #8a5a00; --focus: #0b3d91; --danger: #b4472a;
  --email: #ef4444; --phone: #f59e0b; --url: #8b5cf6; --number: #0ea5e9; --money: #ec4899; --term: #10b981; --manual: #64748b;
  --ok-ink: #1e6b4a; --ok-bg: #e8f6ef; --ok-line: #bfe5d2; --warn-ink: #8a5a00; --warn-line: #f2b544;
  --panel: #ffffff; --input: #ffffff; --icon: #4a5361; --hover: #eceef2; --hover-line: #a9b0bc; --ink-hover: #2a313b;
  --stage: #eceef2; --stage-dot: #d3d8df; --logo-top: #12161c;
  --head: "Instrument Sans", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --brand: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;   /* the "GlideClip" wordmark: part of the logo */
  --body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
/* dark (the "Studio" artboard): follows the system unless the top-bar switch says otherwise (theme.js sets
   data-theme on <html>). Same values twice: once for the system setting, once for the switch. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1014; --surface: #11151b; --panel: #151a21; --sunk: #1b212a; --seg: #1a2028; --input: #0f1318;
    --ink: #e7ebf0; --muted: #9aa4b2; --faint: #6b7584; --line: #232a34; --line2: #29313c; --field: #3a4350;
    --soft: #241e10; --link: #f2c46a; --focus: #6cb4f5; --danger: #f29a7e; --icon: #9aa4b2;
    --hover: #232a34; --hover-line: #4a5361; --ink-hover: #c9d1dc; --stage: #0f1318; --stage-dot: #1c222b; --logo-top: #f4f5f7;
    --ok-ink: #9ee3c2; --ok-bg: #12261e; --ok-line: #2e6b52; --warn-ink: #ffd27a; --warn-line: #8a6a1f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1014; --surface: #11151b; --panel: #151a21; --sunk: #1b212a; --seg: #1a2028; --input: #0f1318;
  --ink: #e7ebf0; --muted: #9aa4b2; --faint: #6b7584; --line: #232a34; --line2: #29313c; --field: #3a4350;
  --soft: #241e10; --link: #f2c46a; --focus: #6cb4f5; --danger: #f29a7e; --icon: #9aa4b2;
  --hover: #232a34; --hover-line: #4a5361; --ink-hover: #c9d1dc; --stage: #0f1318; --stage-dot: #1c222b; --logo-top: #f4f5f7;
  --ok-ink: #9ee3c2; --ok-bg: #12261e; --ok-line: #2e6b52; --warn-ink: #ffd27a; --warn-line: #8a6a1f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.offscreen { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--body); }
a { color: var(--link); }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2 { font-family: var(--head); font-weight: 600; letter-spacing: -0.01em; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 10px 16px; padding: 10px 20px; background: var(--surface);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; flex: none; }
.brand { font-family: var(--brand); font-weight: 700; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.logo { color: var(--accent); flex: none; }
img.logo { display: block; }
.logo-top { fill: var(--logo-top); }   /* the logo's top step: ink on light, light on dark */
.theme-btn svg { display: none; }
.theme-btn[data-pick="system"] .i-system, .theme-btn[data-pick="light"] .i-light, .theme-btn[data-pick="dark"] .i-dark { display: block; }
.spacer { flex: 1 1 0; min-width: 0; }
.file-info { color: var(--muted); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
/* wide windows: one row; a long file name shortens with "..." (full name on hover) instead of pushing items to a 2nd row */
@media (min-width: 1100px) {
  .editor-page .top { flex-wrap: nowrap; }
  .editor-page .top > * { flex-shrink: 0; }
  .editor-page .file-info { flex: 0 1 auto; max-width: none; }
  .editor-page .top .spacer { flex: 1 1 0; }
}
.file-info .mono { font-family: var(--mono); color: var(--faint); }
.privacy { margin-left: auto; text-decoration: none; font-size: 13px; color: var(--ok-ink); background: var(--ok-bg);
  border: 1px solid var(--ok-line); padding: 5px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.privacy u { color: var(--ink); }
.editor-page .privacy { margin-left: 0; }
/* "Sent from this tab": green while nothing has been sent, amber once something has (netmeter.js) */
.net { position: relative; }
.net-pill { font: inherit; font-size: 13px; cursor: pointer; }
.net-pill .net-num { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.net-pill.sent { color: var(--warn-ink); background: var(--soft); border-color: var(--warn-line); }
.net-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(440px, 92vw); padding: 14px 16px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18); font-size: 13px; }
.net-list { margin: 8px 0; padding: 0; list-style: none; max-height: 220px; overflow: auto; font-family: var(--mono); font-size: 12px; }
.net-list li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.license { font-size: 13px; color: var(--muted); border: 1px solid var(--line2); padding: 5px 12px; border-radius: 999px; cursor: default; }
.license.ok { color: var(--ok-ink); border-color: var(--ok-line); background: var(--ok-bg); }
.license.warn { color: var(--warn-ink); border-color: var(--warn-line); background: var(--soft); }
.account-btn { padding: 5px 12px; font-size: 13px; border-radius: 999px; }
.acct-slot { display: flex; align-items: center; gap: 8px; }
.acct-slot:empty { display: none; }
/* the editor: license, account and policy sit at the foot of the rail; the top bar's copy is for the start screen */
body:not(:has(#work[hidden])) .acct-top { display: none; }
.rail-spacer { flex: 1 1 auto; min-height: 12px; }
.rail-foot { flex-direction: column; align-items: stretch; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.rail-foot .license { white-space: normal; overflow-wrap: anywhere; border-radius: 10px; font-size: 12px; line-height: 1.35; }
.rail-foot .account-btn { border-radius: 10px; }
.stage-bar .file-info { font-size: 13px; max-width: 32ch; }
.undo-row { display: flex; gap: 4px; }
.btn.icon-sq { width: 34px; height: 34px; padding: 0; border-radius: 8px; border-color: var(--line2); background: transparent; color: var(--icon); }
.btn.pill-btn { border-radius: 999px; padding: 7px 16px; font-size: 14px; }
/* before a video is loaded, the editor's own top-bar controls have nothing to act on */
body:has(#work[hidden]) .top :is(.undo-row, [data-section], #fileInfo) { display: none; }

/* ---------- phones: "best on a computer" (phone.js sets data-device="phone" on <html>) ---------- */
.phone-notice { display: none; }
html[data-device="phone"] .phone-notice { display: flex; }
html[data-device="phone"] :is(#drop, #work, .undo-row, .top [data-section], #fileInfo, .net) { display: none !important; }
html[data-device="phone"] main { padding: 0; }
.phone-notice { flex-direction: column; gap: 12px; padding: 28px 20px 32px; max-width: 560px; margin: 0 auto; }
.phone-notice h1 { margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; }
.pn-tag { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--accent);
  font-family: var(--mono); font-size: 12px; color: var(--ink); }
.pn-why { margin: 0; color: var(--muted); }
.pn-head { margin: 10px 0 0; font-weight: 600; }
.pn-act { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pn-act svg { flex: none; color: var(--icon); }
.pn-act > span { display: flex; flex-direction: column; }
.pn-name { font-weight: 600; }
.pn-sub { font-size: 13px; color: var(--muted); }
.pn-link { margin: -4px 2px 0; font-size: 13px; color: var(--muted); }
.pn-url { font-family: var(--mono); color: var(--ink); user-select: all; word-break: break-all; }
.pn-anyway { margin-top: 18px; text-align: center; font-size: 14px; color: var(--muted); padding: 12px; }

/* ---------- account page ---------- */
.account-page { max-width: 620px; display: flex; flex-direction: column; gap: 16px; padding: 24px 20px; margin: 0 auto; }
.account-page h1 { font-size: 26px; margin: 0 0 4px; }
.account-page h2 { margin: 0 0 4px; }
.account-page .who { font-weight: 600; margin: 0; }
.account-page .msg:empty { display: none; }
.account-page .msg { color: var(--warn-ink); }
.account-page input { width: 100%; margin: 8px 0; }
.account-page .note { margin: 0 4px; }
.admin-page { max-width: 760px; }
.admin-page #panels { display: flex; flex-direction: column; gap: 16px; }
.admin-page #panels[hidden] { display: none; }
.admin-page textarea { width: 100%; box-sizing: border-box; margin: 6px 0 10px; font: inherit; }
.admin-page .toggle input, .admin-page .adm-field .toggle input { width: auto; margin: 0 6px 0 0; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; margin-top: 8px; }
.adm-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px; margin: 4px 0 10px; }
.adm-field { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.4fr) auto auto; gap: 8px; align-items: center; }
.adm-field input[type="text"] { margin: 4px 0; }
.adm-tpl { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.adm-save { grid-template-columns: 1fr; }
@media (max-width: 600px) { .adm-field { grid-template-columns: 1fr 1fr; } }
.locked::after { content: "Pro"; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 600;
  vertical-align: 1px; color: var(--link); background: var(--soft); border: 1px solid var(--accent); }

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--field);
  background: var(--sunk); color: var(--ink); padding: 9px 14px; border-radius: 10px; font-weight: 600;
  cursor: pointer; text-decoration: none; }
.btn:hover:not(:disabled) { border-color: var(--hover-line); background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: #e9a930; border-color: #e9a930; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.active { background: var(--soft); border-color: var(--accent); }
.fine { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.policy-note { display: block; margin: 4px 0 8px; }
.seg.mode button { font-size: 12px; line-height: 1.2; padding: 7px 2px; }
.locked[data-feature="trainingData"]::after { content: "Enterprise"; }
/* "Requires Pro" dialog (license.js) */
.gc-dialog { border: 0; padding: 0; border-radius: 16px; background: var(--panel); color: var(--ink); max-width: min(460px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.gc-dialog::backdrop { background: rgba(13,16,20,.45); }
.gc-dlg-box { padding: 24px 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.gc-dlg-box h2 { margin: 0; font-family: var(--head); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; }
.gc-dlg-box p { margin: 0; }
.gc-dlg-tag { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; color: var(--link);
  background: var(--soft); border: 1px solid var(--accent); }
.gc-dlg-lead { font-size: 16px; }
.gc-dlg-list { margin: 2px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.gc-dlg-note { font-size: 13px; color: var(--muted); }
.gc-dlg-note.warn { color: var(--warn-ink); }
.gc-dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
/* training data (training.js) */
.tr-field { margin-top: 10px; }
.tr-field input, .tr-field textarea, .tr-field select { margin-top: 4px; }
.tr-item { width: 100%; text-align: left; font: inherit; color: var(--ink); background: transparent; border: 1px solid transparent; cursor: pointer; }
.tr-item.sel { background: var(--soft); border-color: var(--accent); }
.tr-num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; }
.tr-state { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.tr-state.ok { color: var(--ok-ink); background: var(--ok-bg); border: 1px solid var(--ok-line); }
.tr-state.warn { color: var(--warn-ink); background: var(--soft); border: 1px solid var(--warn-line); }
.tr-seg { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 4px; }
.tr-h { margin: 10px 0 0; font-size: 15px; }
.tr-seg .grid2 { margin-top: 10px; }
.tr-seg .grid2 .btn { width: 100%; }
.tr-seg .btn.ghost { margin-top: 0; }
.tr-sumtools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.tr-pic { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 4px; }
.tr-pic .lbl { flex-basis: 100%; }
.tr-pic .fine { flex-basis: 100%; margin: 0; }
.tr-ai { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.tr-ai .fine { margin: 0; }
.tr-by { margin: 4px 0 0; color: var(--warn-ink); }
.tr-said { margin: 4px 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--sunk); font-size: 13px; color: var(--muted); }
.tr-preview { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tr-q { align-self: flex-end; background: var(--ink); color: var(--bg); border-radius: 12px 12px 4px 12px; padding: 6px 12px; font-size: 14px; }
.tr-a { font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.tr-a ol { margin: 0; padding-left: 20px; }
.tr-cleared { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; }
.tr-format { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--accent); }
.tr-format .fine { margin: 2px 0 0; }
.tr-files { padding-left: 18px; }
.tr-checks { margin: 4px 0 6px; padding-left: 18px; color: var(--warn-ink); font-size: 14px; }
.linkish { border: 0; background: none; padding: 0; color: var(--link); text-align: left; font: inherit; cursor: pointer; text-decoration: underline; }
.warn-ink { color: var(--warn-ink); }
/* no blurring needed (app.js syncNoBlur): those steps step aside; a note if something sensitive turns up */
body.noblur .rail-item[data-section="review"], body.noblur .rail-item[data-section="export"] { display: none; }
.nb-note { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--soft); border: 1px solid var(--warn-line); color: var(--ink); font-size: 14px; }
.nb-note p { margin: 0 0 8px; }
.nb-actions { display: flex; gap: 8px; }
.nb-actions .btn { padding: 6px 12px; font-size: 13px; }
/* screen recording (recorder.js) */
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.drop-actions .drop-btn { width: 190px; justify-content: center; gap: 10px; font-size: 16px; padding: 11px 16px; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; vertical-align: 0; }
.rec-dot.paused { background: var(--faint); }
.rec-dialog { width: min(520px, calc(100vw - 32px)); max-width: min(520px, calc(100vw - 32px)); }
.rec-mic { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 6px 26px; }
.rec-meter { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.rec-meter span { display: block; height: 100%; width: 0; background: var(--ok-ink); transition: width .08s linear; }
.rec-count { font-family: var(--head); font-size: 72px; font-weight: 600; text-align: center; margin: 8px 0; }
.rec-time { font-family: var(--mono); font-size: 40px; text-align: center; margin: 4px 0; }
/* join clips (join.js) */
.join-dialog { width: min(760px, calc(100vw - 32px)); max-width: min(760px, calc(100vw - 32px)); }
.join-box .lbl { margin-top: 4px; }
.join-list { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow: auto; }
.join-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.join-row.odd { border-color: var(--warn-line); background: var(--soft); }
.join-num { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-family: var(--mono); font-size: 12px; }
.join-thumb { width: 96px; flex: none; border-radius: 6px; border: 1px solid var(--line2); }
.join-txt { flex: 1 1 180px; min-width: 150px; display: flex; flex-direction: column; gap: 2px; }   /* room for the name; the buttons wrap below when narrow */
.join-txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.join-tools { display: flex; gap: 6px; flex: none; margin-left: auto; }
.join-redo { padding: 6px 10px; font-size: 13px; }
.join-add { display: flex; gap: 8px; flex-wrap: wrap; }
.join-seg { margin-bottom: 4px; }
.join-total { margin-right: auto; align-self: center; font-size: 14px; color: var(--muted); }
.join-bar { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.join-bar span { display: block; height: 100%; width: 0; background: var(--accent); }
.join-nothumb { height: 54px; background: var(--sunk); }
.join-clear { align-self: flex-start; font-size: 13px; }
.join-past-head { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.join-past { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 24vh; overflow: auto; }
.join-past li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
/* intro & outro editor (cards-ui.js) */
.co-tabs { margin: 4px 0 12px; }
.co-field { margin-top: 10px; }
.co-field input, .co-field select { margin-top: 4px; }
.co-block { border: 1px solid var(--line2); border-radius: 10px; padding: 8px; margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.co-block-head { display: flex; align-items: center; gap: 8px; }
.co-block-head .spacer { flex: 1 1 auto; }
.co-add { margin-top: 6px; }
.co-timing { margin: 4px 0 6px; }
.co-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
/* segment cards block (Studio > Callouts) */
.seg-cards { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc-title { font-weight: 600; }
.sc-row { margin: 4px 0 6px; }
.lbl { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
textarea, input[type=text], input[type=number], input[type=password] { width: 100%; border: 1px solid var(--field); border-radius: 8px;
  padding: 8px 10px; background: var(--input); color: var(--ink); resize: vertical; }
.select { width: 100%; padding: 8px 10px; border: 1px solid var(--field); border-radius: 8px; background: var(--input);
  color: var(--ink); margin-bottom: 2px; }
input[type=checkbox], input[type=range] { accent-color: var(--ink); }
.toggle { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.toggle.strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.opt { font-family: var(--body); font-weight: 400; color: var(--muted); font-size: 12px; }
.row { display: flex; justify-content: space-between; align-items: center; }
.pill { background: var(--soft); color: var(--link); border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600;
  font-family: var(--mono); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 6px; }
.grid2 select, .grid2 input { width: 100%; margin-top: 4px; padding: 7px 8px; border: 1px solid var(--field); border-radius: 8px;
  background: var(--input); color: var(--ink); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 8px; }
.btn-row .btn { padding: 8px; font-size: 13px; }
.linkish { border: 0; background: none; color: var(--link); cursor: pointer; padding: 0; text-decoration: underline; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.card h2 { font-size: 18px; margin: 0 0 8px; }

/* ---------- page frame ---------- */
main { padding: 20px; }
.drop { border: 2px dashed var(--field); border-radius: 16px; background: var(--surface); min-height: 60vh; max-width: 1100px;
  margin: 0 auto; display: grid; place-items: center; text-align: center; padding: 24px; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--soft); }
.drop-inner { max-width: 580px; }
.drop h1 { font-size: 32px; line-height: 1.15; margin: 0 0 10px; }
.drop p { color: var(--muted); }

/* the editor fills the window: top bar, then rail | stage | inspector over a timeline */
.editor-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.editor-page main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.editor-page main:has(> .work:not([hidden])) { padding: 0; }
.work { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 248px minmax(0, 1fr) 400px;
  grid-template-rows: minmax(0, 1fr) auto; }

/* rail */
.rail { grid-column: 1; grid-row: 1 / 3; border-right: 1px solid var(--line); background: var(--surface); padding: 16px 14px;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--seg); border: 1px solid var(--line2);
  border-radius: 10px; padding: 3px; }
.seg button { border: 0; border-radius: 8px; padding: 7px 0; font-size: 13px; font-weight: 600; background: transparent; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg.mode { margin-bottom: 12px; }
.rail-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 10px; color: var(--ink);
  background: transparent; border: 1px solid transparent; cursor: pointer; text-align: left; }
.rail-item svg { flex: none; color: var(--icon); }
.rail-item:hover { background: var(--sunk); }
.rail-item.on { background: var(--soft); border-color: var(--accent); }
.rail-item .ri-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.rail-item .ri-name { font-weight: 600; }
.rail-item .ri-sub { font-size: 12px; color: var(--muted); }
.rail-item .pill { flex: none; }

/* stage */
.stage { grid-column: 2; grid-row: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 20px 12px; background-color: var(--stage); background-image: radial-gradient(var(--stage-dot) 1px, transparent 1px);
  background-size: 18px 18px; }
.stage-bar { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg.shape { grid-auto-columns: auto; border-radius: 999px; }
.seg.shape button { padding: 4px 12px; border-radius: 999px; font-family: var(--mono); font-weight: 500; }
.shape-note { font-size: 13px; color: var(--faint); }
body[data-mode="safe"] .studio-only { display: none !important; }
.stage-title { font-size: 11px; letter-spacing: .08em; font-family: var(--mono); color: var(--faint); text-transform: uppercase; }
.canvas-wrap { flex: 1 1 auto; min-height: 0; position: relative; }
/* scaled to fit both ways, aspect kept: pointer maths uses the canvas's own box, so no object-fit letterboxing */
#view { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; width: auto; height: auto; display: block;
  border-radius: 8px; background: #000; box-shadow: 0 10px 30px rgba(18, 22, 28, .18); }
#view.drawing { cursor: crosshair; }
.draw-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--ink);
  color: var(--bg); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; pointer-events: none; }
.controls { flex: none; display: flex; align-items: center; gap: 12px; }
.controls input[type=range] { flex: 1; min-width: 120px; }
.btn.play { width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); font-size: 13px; }
.btn.play:hover:not(:disabled) { background: var(--ink-hover); }
.time { font-family: var(--mono); font-size: 14px; min-width: 110px; }

/* inspector */
.inspector { grid-column: 3; grid-row: 1; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
.sec { padding: 18px; }
.sec > h2 { margin: 0 0 10px; font-size: 22px; }
.sub-card { padding: 12px 14px; border-radius: 12px; background: var(--sunk); }
.sub-card .fine { margin-bottom: 0; }
.strong-line { margin: 0; font-weight: 600; }
.toggle-card { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.toggle-card input { margin-top: 4px; }
.toggle-card > span { display: flex; flex-direction: column; gap: 2px; }
.audio-row { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.audio-row .lbl { font-weight: 600; color: var(--ink); font-size: 14px; margin: 0; }
.toggle.strong-ish { color: var(--ink); font-size: 14px; }
/* a header field Suggest filled in: marked until you change it */
input.suggested { border-color: var(--accent); background: var(--soft); }
.suggested-note { margin: 6px 0 0; }
.resume-bar { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px;
  background: var(--soft); border: 1px solid var(--accent); font-size: 14px; }
.resume-bar span { flex: 1 1 260px; }
.resume-bar .btn { padding: 6px 12px; font-size: 13px; }
.warn-note { color: var(--warn-ink); background: var(--soft); border: 1px solid var(--warn-line); border-radius: 8px; padding: 8px 10px; }
.cut-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cut-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px;
  background: var(--sunk); font-family: var(--mono); font-size: 13px; }
.cut-list button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; }

/* timeline */
.tl { grid-column: 2 / 4; grid-row: 2; border-top: 1px solid var(--line); background: var(--panel); padding: 8px 20px 12px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tl-label { font-size: 11px; letter-spacing: .08em; font-family: var(--mono); color: var(--faint); }
.tl { position: relative; }
.tl-head { display: flex; align-items: center; gap: 8px; }
.tl-tools { display: flex; gap: 4px; }
.tl-tools .btn.icon-sq { width: 26px; height: 24px; font-size: 15px; line-height: 1; }
.tl-fit { padding: 2px 10px; font-size: 12px; height: 24px; }
.tl-zoom-label { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.tl-head .btn.tl-fold { width: 22px; height: 22px; font-size: 12px; line-height: 1; padding: 0; }
.tl.closed { padding-bottom: 8px; }
.tl.closed .timeline, .tl.closed .tl-tools, .tl.closed .tl-zoom-label { display: none; }
.tl-pop { position: absolute; z-index: 5; display: flex; gap: 6px; padding: 6px; border-radius: 10px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.tl-pop .btn { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.timeline { width: 100%; border-radius: 6px; background: var(--sunk); display: block; cursor: pointer; }

/* narrow windows: rail becomes a strip, inspector stacks under the stage, the page scrolls */
@media (max-width: 1100px) {
  .editor-page { height: auto; min-height: 100vh; overflow: visible; }
  .work { display: flex; flex-direction: column; }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .seg.mode { margin: 0 8px 0 0; }
  .rail-item { width: auto; padding: 6px 10px; }
  .rail-item .ri-sub { display: none; }
  .stage { order: 1; }
  .canvas-wrap { flex: none; height: min(62vh, 56vw); }
  .tl { order: 2; }
  .inspector { order: 3; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
}

/* ---------- lists ---------- */
.cats { display: grid; gap: 6px; margin-bottom: 10px; }
.cats label { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.email { background: var(--email); } .dot.phone { background: var(--phone); } .dot.url { background: var(--url); }
.dot.number { background: var(--number); } .dot.money { background: var(--money); } .dot.term { background: var(--term); } .dot.manual { background: var(--manual); }
.dot.step { background: #0ea5e9; } .dot.info { background: #3b82f6; } .dot.cond { background: #f59e0b; }
.dot.warn { background: #ef4444; } .dot.ok { background: #22c55e; } .dot.hl { background: transparent; border: 2px solid #0ea5e9; }
.status { margin-top: 10px; font-size: 13px; color: var(--muted); }
.bar { height: 6px; background: var(--seg); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.findings { max-height: 420px; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.findings:empty { display: none; }
.findings .empty { color: var(--muted); font-size: 13px; margin: 4px 0; }
.item { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; align-items: center; padding: 7px 9px;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-size: 13px; }
.item:hover { background: var(--sunk); }
.item .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .when { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.item.off .txt { text-decoration: line-through; color: var(--muted); }
.item .del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.item.sel { background: var(--soft); border-color: var(--accent); }
.item .ttl[contenteditable] { outline: none; border-radius: 4px; }
.item .ttl[contenteditable]:focus { background: var(--input); box-shadow: 0 0 0 1px var(--accent); }
.manual-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 8px 8px 30px; font-size: 12px; color: var(--muted); }
.manual-edit input { padding: 4px 6px; font-size: 12px; }
.toggle.ai { margin: 10px 0 4px; color: var(--ink); font-size: 14px; }
.ai-box { background: var(--sunk); border-radius: 10px; padding: 2px 10px 10px; }

/* ---------- callout editor ---------- */
.editor { border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 12px; display: flex;
  flex-direction: column; gap: 8px; font-size: 13px; }
.editor .r { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.editor .r3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.editor label { color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.editor input, .editor select { padding: 6px 8px; font-size: 13px; }
.editor select { border: 1px solid var(--field); border-radius: 8px; background: var(--input); color: var(--ink); }
.editor .time-in { display: flex; gap: 4px; }
.editor .time-in input { min-width: 0; font-family: var(--mono); }
.editor .now { border: 1px solid var(--field); background: var(--sunk); color: var(--ink); border-radius: 6px;
  font-size: 11px; padding: 0 6px; cursor: pointer; }
.editor .items { display: flex; flex-direction: column; gap: 4px; }
.editor .it { display: grid; grid-template-columns: 96px 1fr 72px auto auto; gap: 4px; align-items: center; }
.editor .it img { max-height: 28px; max-width: 100%; border-radius: 4px; }
.editor .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.editor .foot { display: flex; gap: 6px; justify-content: space-between; margin-top: 4px; }
.editor .foot .btn { padding: 6px 10px; font-size: 13px; }
.editor .hint { color: var(--muted); }
.pos-row { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 14px; align-items: start; }
.pos-row .pos-lbl { grid-column: 1 / 3; color: var(--muted); }
.pos-grid { display: grid; grid-template-columns: repeat(3, 30px); grid-template-rows: repeat(3, 20px); gap: 4px; padding: 6px;
  border: 1px solid var(--line2); border-radius: 10px; background: var(--surface); }
.pos-grid button { border: 1px solid var(--field); border-radius: 4px; background: var(--seg); padding: 0; cursor: pointer; }
.pos-grid button:hover { border-color: var(--accent); }
.pos-grid button.on { background: var(--accent); border-color: var(--accent); }
.pos-row .hint { align-self: center; }

/* ---------- callout preview (a short render in a dialog) ---------- */
.preview-dlg { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface); color: var(--ink);
  width: min(1100px, 94vw); }
.preview-dlg::backdrop { background: rgba(18, 22, 28, 0.55); }
.preview-dlg video { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 8px; background: #000; display: block; }
.preview-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }

/* ---------- keyboard shortcuts ---------- */
kbd { font-family: var(--mono); font-size: 12px; padding: 0 5px; border: 1px solid var(--line2); border-bottom-width: 2px;
  border-radius: 5px; background: var(--surface); color: var(--ink); }
.keys-hint { border: 0; background: none; padding: 4px 0; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.keys-hint:hover { color: var(--ink); }
@media (max-width: 1300px) { .keys-hint { display: none; } }
.keys-dlg { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: var(--surface); color: var(--ink);
  width: min(520px, 94vw); }
.keys-dlg::backdrop { background: rgba(18, 22, 28, 0.55); }
.keys-dlg h2 { margin: 0 0 12px; font-size: 22px; }
.keys-dlg dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.keys-dlg dt { white-space: nowrap; }
.keys-dlg dd { margin: 0; color: var(--muted); }

/* ---------- brand kit ---------- */
.brand-kit { border-radius: 12px; padding: 12px 14px; margin-top: 12px; font-size: 13px; background: var(--sunk); }
.brand-kit summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.brand-kit[open] summary { margin-bottom: 8px; }
.bk-files { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.bk-files .btn { padding: 6px 12px; font-size: 13px; background: var(--surface); }
.bk-files img { height: 32px; width: auto; border-radius: 6px; }
.bk-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-bottom: 8px; }
.bk-colors label { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--muted); }
.bk-colors input[type=color] { width: 34px; height: 26px; border: 1px solid var(--field); border-radius: 6px; padding: 1px; background: var(--surface); }
.brand-kit input[type=range] { width: 100%; }

/* ---------- intro / outro ---------- */
.intro-outro { display: flex; flex-direction: column; gap: 12px; }
.intro-outro .grid2 { margin: 8px 0 0; }
.intro-outro input[type=text] { padding: 7px 9px; font-size: 13px; }
.editor label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
/* blur presets: Save as preset... / Update / Delete under the level hint (app.js presetRow) */
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 2px 0 8px; }
.preset-row input[type=text] { flex: 1 1 160px; min-width: 0; }
