/* ════════════════════════════════════════════
   TELESCRIPT — Design System v2
   Light app (blue/yellow) + Dark teleprompter
════════════════════════════════════════════ */

:root {
  --blue:      #2F6BFF;
  --blue-700:  #2257D6;
  --blue-tint: #EBF1FF;
  --blue-tint2:#F3F7FF;
  --yellow:    #FFE000;
  --yellow-d:  #F5D400;
  --yellow-tint:#FFF7CC;
  --bg:        #F5F6F8;
  --card:      #FFFFFF;
  --line:      #E9EBEF;
  --line-2:    #EEF0F3;
  --ink:       #16181C;
  --ink-2:     #3A3F47;
  --muted:     #8A9099;
  --muted-2:   #A8ADB5;
  --green:     #22C55E;
  --orange:    #FB8C2E;
  --red:       #EF4444;
  --purple:    #A855F7;
  --st-idea:   #3B82F6;
  --st-script: #F5C518;
  --st-ready:  #2F6BFF;
  --st-live:   #22C55E;
  --sans: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow:    0 2px 8px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.12);
  --tp-bg:#000; --tp-panel:#0C0D10; --tp-card:#121317; --tp-line:#20222A;
  --tp-text:#FFF; --tp-dim:#4C4F57; --tp-acc:#EAFF1F; --tp-blue:#3B82F6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; cursor: pointer; }
::selection { background: var(--blue); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d6dae0; border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: var(--r-sm); transition: all .12s; white-space: nowrap; border: 1px solid transparent; }
.btn:active { transform: translateY(1px); }
.btn-yellow { background: var(--yellow); color: #16181C; }
.btn-yellow:hover { background: var(--yellow-d); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-700); }
.btn-ghost { background: var(--card); color: var(--ink-2); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: #d0d5dd; background: #fafafa; }
.btn-soft { background: var(--blue-tint); color: var(--blue); }
.btn-soft:hover { background: #dde8ff; }
.btn-danger { background: #fff0f0; color: var(--red); border-color: #ffd6d6; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: var(--r); }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); }

/* ── Inputs ── */
.field { width: 100%; display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); padding: 0 14px; height: 52px; transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47,107,255,.1); }
.field input { flex: 1; border: none; outline: none; background: none; font-size: 15px; color: var(--ink); height: 100%; }
.field input::placeholder { color: var(--muted-2); }
.field .fic { color: var(--muted); display: flex; }
.eye { color: var(--muted); display: flex; padding: 4px; }
.input { width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.textarea { width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; color: var(--ink); outline: none; resize: vertical; min-height: 90px; line-height: 1.6; transition: border-color .15s; }
.textarea:focus { border-color: var(--blue); }
.select { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; font-size: 14px; color: var(--ink); outline: none; cursor: pointer; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; display: block; }
.form-group { margin-bottom: 16px; }

/* ── Tags / chips ── */
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 4px 9px; border-radius: 6px; text-transform: uppercase; }
.tag-long  { background: var(--blue-tint); color: var(--blue); }
.tag-short { background: #EAF7EE; color: #1a9d4a; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }

/* ── Avatar ── */
.avatar { border-radius: 50%; background: linear-gradient(135deg, var(--blue), #6f9bff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ════════════════════════════════════════════
   APP SHELL
════════════════════════════════════════════ */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* Sidebar */
.sidebar { width: 260px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 4px; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 18px; cursor: pointer; }
.side-brand img { width: 38px; height: 38px; border-radius: 10px; }
.side-brand .nm { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--ink-2); transition: background .1s, color .1s; }
.nav-item:hover { background: #f3f5f8; }
.nav-item.active { background: var(--blue-tint); color: var(--blue); font-weight: 700; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 4px; }
.nav-label { font-size: 11.5px; font-weight: 700; color: var(--muted-2); letter-spacing: .05em; text-transform: uppercase; padding: 4px 12px; }
.side-spacer { flex: 1; }
.help-card { background: var(--blue); color: #fff; border-radius: var(--r-lg); padding: 16px; position: relative; overflow: hidden; margin: 4px 0; }
.help-card::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 110px; height: 110px; background: rgba(255,255,255,.1); border-radius: 50%; }
.help-card h4 { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.help-card p { font-size: 12.5px; line-height: 1.5; opacity: .85; margin-bottom: 12px; }
.help-card .help-btn { display: inline-flex; align-items: center; gap: 5px; background: #fff; color: var(--blue); font-weight: 700; font-size: 12.5px; padding: 8px 14px; border-radius: 8px; position: relative; z-index: 1; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; transition: background .12s; cursor: pointer; }
.side-user:hover { background: #f3f5f8; }
.side-user .meta { line-height: 1.3; flex: 1; min-width: 0; }
.side-user .meta .n { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .meta .h { font-size: 12px; color: var(--muted); }

/* Main column */
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* Topbar */
.topbar { height: 64px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--card); }
.topbar-title { font-size: 16px; font-weight: 800; flex: 1; }
.topbar .sp { flex: 1; }
.menu-btn { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-2); }
.menu-btn:hover { background: #f3f5f8; }

/* Page scroll */
.page { flex: 1; overflow-y: auto; }
.page-inner { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); margin: 0 24px 24px; min-height: calc(100% - 24px); box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.page-head { display: flex; align-items: flex-start; gap: 16px; padding: 28px 32px 22px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head h1 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.page-head .sub { font-size: 15px; color: var(--muted); margin-top: 6px; }
.page-head .actions { display: flex; align-items: center; gap: 10px; padding-top: 4px; flex-wrap: wrap; }

/* Scrim (mobile drawer overlay) */
.scrim { display: none; position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 150; }
.app.menu-open .scrim { display: block; }
.app.menu-open .sidebar { transform: translateX(0) !important; }

/* ════════════════════════════════════════════
   LOGIN
════════════════════════════════════════════ */
.login-screen { position: relative; height: 100%; width: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.login-doodle { position: absolute; opacity: .95; pointer-events: none; }
.login-doodle img { width: 100%; height: 100%; object-fit: contain; }
.deco { position: absolute; pointer-events: none; }
.login-card { position: relative; z-index: 5; width: 100%; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 24px 70px rgba(16,24,40,.13); padding: 44px 44px 36px; text-align: center; }
.login-card .logo { width: 100px; height: 100px; border-radius: 24px; margin: 0 auto 24px; display: block; box-shadow: var(--shadow); }
.login-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.login-card .sub { font-size: 15px; color: var(--muted); margin-top: 7px; margin-bottom: 28px; line-height: 1.5; }
.login-card .field + .field { margin-top: 13px; }
.login-card .btn-lg { width: 100%; margin-top: 20px; }
.google-row { margin-top: 14px; }
.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; background: #fff; color: #16181C; border: 1.5px solid var(--line); font-size: 14px; font-weight: 700; border-radius: var(--r); cursor: pointer; transition: all .12s; box-shadow: var(--shadow-sm); }
.google-btn:hover { border-color: #c9cdd5; background: #fafafa; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 13px; color: var(--muted); }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-card .alt { font-size: 14px; color: var(--muted); margin-top: 20px; }
.login-card .alt a { color: var(--blue); font-weight: 700; }
.login-card .alt a:hover { text-decoration: underline; }
.login-error { font-size: 13px; color: var(--red); background: #fff0f0; border: 1px solid #ffd6d6; border-radius: var(--r-sm); padding: 9px 13px; margin-bottom: 14px; text-align: left; }
.remember-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; text-align: left; }
.remember-row input { accent-color: var(--blue); width: 15px; height: 15px; }
.remember-row label { font-size: 13px; color: var(--muted); cursor: pointer; }
.login-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: #f1f3f6; border-radius: 10px; padding: 4px; }
.login-tab { flex: 1; font-size: 13.5px; font-weight: 700; padding: 8px; border-radius: 7px; color: var(--muted); transition: all .12s; }
.login-tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ════════════════════════════════════════════
   BOARD / KANBAN
════════════════════════════════════════════ */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 18px; padding: 6px 32px 36px; align-items: start; overflow-x: auto; }
.col { background: #F8F9FB; border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 13px; }
.col.drag-over { background: var(--blue-tint2); border-color: #c8d9ff; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.col-head .sdot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.col-head .ttl { font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); flex: 1; }
.col-head .cnt { font-size: 12px; font-weight: 700; color: var(--muted); background: #eceff3; border-radius: 6px; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.col-body { display: flex; flex-direction: column; gap: 11px; min-height: 6px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 15px; box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow .15s, transform .1s, border-color .15s; position: relative; }
.card:hover { box-shadow: var(--shadow); border-color: #dde2e9; transform: translateY(-1px); }
.card.dragging { opacity: .4; transform: rotate(2deg); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-more { color: var(--muted-2); padding: 3px; border-radius: 6px; display: flex; }
.card-more:hover { background: #f1f3f6; color: var(--ink-2); }
.card-check { color: var(--green); display: flex; }
.card h3 { font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.card .when { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.card-prog { display: flex; align-items: center; gap: 9px; margin-top: 13px; }
.prog-bar { flex: 1; height: 6px; background: #eceff3; border-radius: 99px; overflow: hidden; }
.prog-bar i { display: block; height: 100%; border-radius: 99px; }
.card .pct { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.col-add { margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; border-radius: 10px; border: 1.5px dashed #d0d5dd; color: var(--blue); font-weight: 700; font-size: 13.5px; background: transparent; transition: background .12s, border-color .12s; }
.col-add:hover { background: #fff; border-color: var(--blue); }
.col-empty { text-align: center; padding: 24px 12px; color: var(--muted); }
.col-empty h4 { font-size: 14px; font-weight: 700; color: var(--ink-2); line-height: 1.4; margin-top: 12px; }
.col-empty p { font-size: 13px; line-height: 1.5; margin-top: 6px; }
/* Card context menu */
.card-menu { position: absolute; top: 42px; right: 10px; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 168px; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .1s; }
.menu-item:hover { background: #f3f5f8; }
.menu-item.danger { color: var(--red); }
.menu-item.danger:hover { background: #fff0f0; }
.menu-sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.menu-section-label { font-size: 11px; font-weight: 800; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; padding: 4px 11px 6px; }
/* Footer */
.board-footer { text-align: center; padding: 12px 16px 20px; font-size: 12px; color: var(--muted-2); }

/* ════════════════════════════════════════════
   EDITOR
════════════════════════════════════════════ */
.editor-page { flex: 1; overflow-y: auto; }
.editor-head { padding: 22px 32px 16px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 14px; transition: color .12s; }
.back-link:hover { color: var(--blue); }
.editor-titlebar { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.editor-titlebar .tl { flex: 1; min-width: 260px; }
.editor-titlebar .row1 { display: flex; align-items: center; gap: 10px; }
.editor-titlebar h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; min-width: 0; }
.editor-titlebar input.title-edit { font-size: 26px; font-weight: 800; letter-spacing: -.02em; border: none; outline: none; background: transparent; color: var(--ink); width: 100%; min-width: 200px; }
.editor-meta { font-size: 13px; color: var(--muted); margin-top: 6px; }
.editor-actions { display: flex; align-items: center; gap: 9px; padding-top: 2px; flex-wrap: wrap; }
.wordcount-pill { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 13px; box-shadow: var(--shadow-sm); }
.wordcount-pill .ok { color: var(--green); font-weight: 700; }
.open-tp-btn { display: flex; align-items: center; gap: 7px; background: var(--blue); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: var(--r-sm); border: none; cursor: pointer; transition: background .12s; white-space: nowrap; }
.open-tp-btn:hover { background: var(--blue-700); }

.editor-grid { display: grid; grid-template-columns: 230px 1fr 300px; gap: 20px; padding: 6px 32px 40px; align-items: start; }
/* Structure rail */
.structure { background: #F8F9FB; border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px; position: sticky; top: 8px; }
.struct-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.struct-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 11px; border-radius: 9px; cursor: pointer; transition: background .1s; }
.struct-item:hover { background: #fff; }
.struct-item.active { background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.struct-item .sd { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.struct-item .si-t { font-size: 14px; font-weight: 700; }
.struct-item .si-time { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
/* Sections */
.sections { display: flex; flex-direction: column; gap: 16px; }
.section-block { }
.section-block-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.section-block-head .sd { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.section-block-head .sh-t { font-size: 16px; font-weight: 800; }
.section-block-head .sh-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.editor-box { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.editor-box:focus-within { border-color: var(--st-script); box-shadow: 0 0 0 4px rgba(245,197,24,.13); }
.editor-area { width: 100%; min-height: 110px; border: none; outline: none; resize: vertical; padding: 14px 16px; font-size: 15px; line-height: 1.65; color: var(--ink); background: none; }
.editor-area::placeholder { color: var(--muted-2); }
.editor-toolbar { display: flex; align-items: center; gap: 3px; padding: 8px 12px; border-top: 1px solid var(--line-2); background: #fbfcfd; }
.tb-btn { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; font-size: 14px; }
.tb-btn:hover { background: #eceff3; color: var(--ink); }
.tb-sep { width: 1px; height: 16px; background: var(--line); margin: 0 5px; }
.toolbar-wc { margin-left: auto; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
/* Right rail */
.rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 8px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.panel-title { font-size: 15px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.panel-title a { color: var(--blue); font-size: 13px; font-weight: 700; }
.score-row { display: flex; align-items: center; gap: 16px; }
.score-ring { width: 78px; height: 78px; flex-shrink: 0; position: relative; }
.score-ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .num b { font-size: 24px; font-weight: 800; line-height: 1; }
.score-ring .num s { font-size: 10px; color: var(--muted); text-decoration: none; }
.score-txt .lvl { font-size: 15px; font-weight: 800; }
.score-txt p { font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 3px; }
.note-item { background: #F8F9FB; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 13px; margin-bottom: 10px; }
.note-item .ntxt { font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.4; }
.note-item .nby { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.tool-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.tool-item + .tool-item { border-top: 1px solid var(--line-2); }
.tool-ic { width: 36px; height: 36px; border-radius: 9px; background: var(--blue-tint); color: var(--blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-ic.y { background: var(--yellow-tint); color: #9a7200; }
.tool-tt { font-size: 14px; font-weight: 700; }
.tool-td { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* ════════════════════════════════════════════
   SCRIPT COMPLETO
════════════════════════════════════════════ */
.fullscript { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.fullscript-header { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; background: var(--card); flex-shrink: 0; flex-wrap: wrap; }
.fullscript-title { flex: 1; font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fullscript-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.fullscript-combined { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.8; padding: 20px 22px; outline: none; resize: none; min-height: 55vh; width: 100%; transition: border-color .15s; }
.fullscript-combined:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.1); }

/* ════════════════════════════════════════════
   CONFIG
════════════════════════════════════════════ */
.settings { flex: 1; overflow-y: auto; padding: 24px; max-width: 600px; }
.settings h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.settings-meta { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.settings-section { margin-bottom: 28px; }
.settings-section h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.settings-section p { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }
.settings-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.provider-toggle { display: flex; gap: 6px; margin-bottom: 14px; }
.provider-btn { flex: 1; padding: 8px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #f8f9fb; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .12s; }
.provider-btn.active { border-color: var(--blue); color: var(--blue); background: var(--blue-tint); }
.sync-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ════════════════════════════════════════════
   MODAL
════════════════════════════════════════════ */
.modal-bg { position: fixed; inset: 0; background: rgba(16,24,40,.5); z-index: 200; display: flex; align-items: center; justify-content: center; animation: fadeIn .15s; padding: 20px; backdrop-filter: blur(4px); }
.modal { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.modal-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-del-confirm { background: #fff0f0; border: 1px solid #ffd6d6; border-radius: var(--r-sm); padding: 14px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

/* ════════════════════════════════════════════
   TOAST
════════════════════════════════════════════ */
#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 600; padding: 12px 18px; border-radius: var(--r); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: all .25s ease; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-error { background: var(--red); }
.toast .tk { color: var(--yellow); }

/* ════════════════════════════════════════════
   TELEPROMPTER (dark theme)
════════════════════════════════════════════ */
.tp { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100dvh; background: var(--tp-bg); color: var(--tp-text); display: flex; flex-direction: column; font-family: var(--sans); z-index: 100; }
.tp-nav { height: 62px; flex-shrink: 0; display: flex; align-items: center; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--tp-line); }
.tp-brand { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.tp-brand img { width: 32px; height: 32px; border-radius: 8px; }
.tp-brand .nm { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.tp-brand .nm span { color: var(--tp-acc); }
.tp-tabs { display: flex; gap: 3px; background: var(--tp-card); border: 1px solid var(--tp-line); border-radius: 10px; padding: 3px; }
.tp-tab { padding: 7px 16px; border-radius: 7px; font-size: 13.5px; font-weight: 700; color: #9aa0a8; transition: background .12s, color .12s; }
.tp-tab:hover { color: #fff; }
.tp-tab.active { background: var(--tp-acc); color: #111; }
.tp-nav .sp { flex: 1; }
.tp-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--tp-card); border: 1px solid var(--tp-line); color: #c4c8cf; display: inline-flex; align-items: center; justify-content: center; }
.tp-user { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; }
.tp-user .nm { font-size: 13.5px; font-weight: 700; }

/* Control bar */
.tp-controls { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--tp-line); }
.tp-back { display: inline-flex; align-items: center; gap: 10px; }
.tp-back .bk { width: 34px; height: 34px; border-radius: 50%; background: var(--tp-card); border: 1px solid var(--tp-line); display: inline-flex; align-items: center; justify-content: center; color: #c4c8cf; }
.tp-back .bk:hover { background: #1a1c22; }
.tp-back .ttl { font-size: 16px; font-weight: 800; }
.tp-badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 5px; background: rgba(234,255,31,.12); color: var(--tp-acc); border: 1px solid rgba(234,255,31,.22); }
.tp-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: #c4c8cf; }
.tp-status .d { width: 8px; height: 8px; border-radius: 50%; background: var(--tp-blue); box-shadow: 0 0 0 4px rgba(59,130,246,.18); }
.tp-controls .sp { flex: 1; }
.tp-slider { display: flex; align-items: center; gap: 10px; }
.tp-slider .lbl { font-size: 13.5px; font-weight: 700; color: #c4c8cf; white-space: nowrap; }
.tp-slider .step { width: 26px; height: 26px; border-radius: 6px; background: var(--tp-card); border: 1px solid var(--tp-line); color: #c4c8cf; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; }
.tp-slider .step:hover { background: #1a1c22; color: #fff; }
.tp-slider .val { font-family: var(--mono); font-size: 14px; min-width: 28px; text-align: center; color: #fff; }
.tp-range { -webkit-appearance: none; appearance: none; width: 100px; height: 5px; border-radius: 99px; background: #2a2c33; outline: none; }
.tp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--tp-acc); cursor: pointer; box-shadow: 0 0 8px rgba(234,255,31,.5); }
.tp-range::-moz-range-thumb { width: 15px; height: 15px; border: none; border-radius: 50%; background: var(--tp-acc); cursor: pointer; }
.tp-toggle { width: 40px; height: 40px; border-radius: 9px; background: var(--tp-card); border: 1px solid var(--tp-line); color: #c4c8cf; display: inline-flex; align-items: center; justify-content: center; }
.tp-toggle:hover { background: #1a1c22; color: #fff; }
.tp-toggle.on { background: rgba(234,255,31,.14); border-color: rgba(234,255,31,.38); color: var(--tp-acc); }
.tp-start { background: var(--tp-acc); color: #111; font-weight: 800; font-size: 14.5px; padding: 10px 18px; border-radius: 9px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tp-start:hover { filter: brightness(1.05); }
.tp-start.playing { background: var(--tp-card); color: #fff; border: 1px solid var(--tp-line); }

/* Stage */
.tp-stage { flex: 1; position: relative; overflow: hidden; }
.tp-margin { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed rgba(59,130,246,.35); z-index: 3; pointer-events: none; }
.tp-margin.l { left: 11%; } .tp-margin.r { right: 11%; }
.tp-eyeline { position: absolute; left: 0; right: 0; top: 50%; height: 0; z-index: 4; pointer-events: none; }
.tp-eyeline .ln { position: absolute; left: 7%; right: 7%; top: 0; height: 2px; background: var(--tp-acc); box-shadow: 0 0 14px rgba(234,255,31,.6); }
.tp-eyeline .dot { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; background: var(--tp-acc); transform: translateY(-50%); box-shadow: 0 0 16px 3px rgba(234,255,31,.7); }
.tp-eyeline .dot.l { left: calc(7% - 6px); } .tp-eyeline .dot.r { right: calc(7% - 6px); }
.tp-scroller { position: absolute; inset: 0; overflow: hidden; }
.tp-text { position: absolute; left: 0; right: 0; top: 0; padding: 0 11%; font-weight: 700; letter-spacing: -.01em; will-change: transform; }
.tp-text p { margin: 0 0 .35em; color: var(--tp-text); }
.tp-text .w { color: inherit; transition: color .1s; }
.tp-text .w.active-w { color: var(--tp-acc); }
.tp-fade-top { position: absolute; top: 0; left: 0; right: 0; height: 20%; background: linear-gradient(#000 8%, transparent); z-index: 2; pointer-events: none; }
.tp-fade-bot { position: absolute; bottom: 0; left: 0; right: 0; height: 20%; background: linear-gradient(transparent, #000 92%); z-index: 2; pointer-events: none; }

/* Bottom bar */
.tp-foot { flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--tp-line); }
.tp-stat { background: var(--tp-card); border: 1px solid var(--tp-line); border-radius: 12px; padding: 10px 14px; min-width: 124px; }
.tp-stat .sl { font-size: 11px; color: #8a8f98; font-weight: 600; }
.tp-stat .sv { font-size: 21px; font-weight: 800; margin-top: 2px; }
.tp-stat .sv.mono { font-family: var(--mono); }
.tp-stat .up { font-size: 11.5px; color: var(--green); font-weight: 700; }
.tp-stat .mini-bar { height: 5px; background: #2a2c33; border-radius: 99px; margin-top: 7px; overflow: hidden; }
.tp-stat .mini-bar i { display: block; height: 100%; background: var(--tp-acc); border-radius: 99px; }
.tp-foot .sp { flex: 1; }
.tp-transport { display: flex; align-items: center; gap: 16px; }
.tp-skip { width: 54px; height: 54px; border-radius: 50%; background: var(--tp-card); border: 1px solid var(--tp-line); color: #d4d8df; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.tp-skip:hover { background: #1a1c22; color: #fff; }
.tp-skip span { position: absolute; font-size: 9px; font-weight: 800; font-family: var(--mono); bottom: 13px; }
.tp-play-big { width: 72px; height: 72px; border-radius: 50%; background: var(--tp-acc); color: #111; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 28px rgba(234,255,31,.35); transition: transform .1s; }
.tp-play-big:hover { transform: scale(1.05); }
.tp-foot-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; color: #c4c8cf; font-size: 11px; font-weight: 600; }
.tp-foot-btn .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--tp-card); border: 1px solid var(--tp-line); display: inline-flex; align-items: center; justify-content: center; }
.tp-foot-btn:hover .ic { background: #1a1c22; color: #fff; }

/* Immersive */
.tp.immersive .tp-nav, .tp.immersive .tp-controls, .tp.immersive .tp-foot { display: none; }
.tp.immersive .exit-btn { display: inline-flex; }
.exit-btn { display: none; position: absolute; top: 16px; right: 16px; z-index: 8; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; align-items: center; justify-content: center; backdrop-filter: blur(8px); }

/* Camera mode */
.tp-cam { position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100dvh; background: #000; overflow: hidden; display: flex; flex-direction: column; z-index: 100; }
.tp-cam-feed { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); z-index: 1; }
.tp-cam-overlay { position: absolute; top: 56px; bottom: 0; left: 0; right: 0; overflow: hidden; z-index: 2; pointer-events: auto; }
.tp-cam-text-wrap { width: 100%; padding-top: 88vh; padding-bottom: 20vh; transition: transform .016s linear; }
.tp-cam-text { color: #fff; text-align: center; font-weight: 700; line-height: 1.5; white-space: pre-wrap; text-shadow: 0 0 20px rgba(0,0,0,1), 0 2px 10px rgba(0,0,0,.9); }
.tp-cam-text .w.active-w { color: var(--tp-acc); }
.tp-cam-top-bar { position: absolute; top: 0; left: 0; right: 0; height: 56px; z-index: 10; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: rgba(0,0,0,.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.08); }
.tp-cam-btn { font-family: inherit; font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.tp-cam-range-group { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tp-cam-range-label { font-family: var(--mono); font-size: 9px; color: rgba(255,255,255,.5); }
.tp-cam-range { width: 70px; accent-color: var(--tp-acc); }
.tp-cam-rec-btn { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; padding: 8px 16px; border-radius: 20px; cursor: pointer; border: 2px solid rgba(255,255,255,.3); background: rgba(255,255,255,.15); color: #fff; transition: all .2s; flex-shrink: 0; }
.tp-cam-rec-btn.active { background: rgba(220,38,38,.7); border-color: #f87171; animation: pulse 1.5s ease-in-out infinite; }
.tp-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #f87171; flex-shrink: 0; }
.tp-rec-dot.stop { border-radius: 2px; background: #fff; }

/* ════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ════════════════════════════════════════════
   MOBILE
════════════════════════════════════════════ */
.mobile-tabbar { display: none; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); width: 280px; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; height: 56px; }
  .page-inner { margin: 0 12px 12px; border-radius: var(--r-lg); }
  .page-head { padding: 20px 18px 16px; flex-direction: column; }
  .page-head h1 { font-size: 26px; }
  .page-head .actions { width: 100%; }
  .board { padding: 4px 14px 24px; grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; }
  .editor-head { padding: 16px 16px 12px; }
  .editor-grid { grid-template-columns: 1fr; padding: 6px 14px 30px; }
  .structure { display: none; }
  .rail { position: static; }
  .editor-titlebar h1, .editor-titlebar input.title-edit { font-size: 22px; }
  .editor-actions { width: 100%; }
  .settings { padding: 16px; }
  .login-doodle, .deco { display: none; }
  .login-screen { padding: 16px; align-items: flex-start; padding-top: 5vh; }
  .login-card { max-width: 100%; padding: 30px 20px 26px; border-radius: 20px; box-shadow: var(--shadow); }
  .login-card .logo { width: 80px; height: 80px; }
  .login-card h1 { font-size: 24px; }
  .editor-area { font-size: 16px; }
  .input { font-size: 16px; }
  .field input { font-size: 16px; }
  /* Mobile tabbar */
  .mobile-tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: var(--card); border-top: 1px solid var(--line); z-index: 90; justify-content: space-around; align-items: center; padding: 0 12px; }
  .mob-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; color: var(--muted); font-size: 10px; font-weight: 700; border-radius: 8px; max-width: 80px; }
  .mob-tab.active { color: var(--blue); }
  .mob-tab svg { width: 22px; height: 22px; }
  #app { padding-bottom: 60px; }
  #toast-root { bottom: 72px; }
  .tp { padding-bottom: 0; }
  .tp-cam { padding-bottom: 0; }
}
@media (max-width: 1200px) {
  .editor-grid { grid-template-columns: 1fr 290px; }
}
@media (max-width: 1000px) {
  .editor-grid { grid-template-columns: 1fr; }
  .rail { position: static; }
}
@media (max-width: 1100px) {
  .tp-tabs { display: none; }
  .tp-slider .lbl { display: none; }
}
@media (max-width: 920px) {
  .tp-stat.hide-sm { display: none; }
  .tp-foot { gap: 10px; padding: 12px 14px; }
  .tp-transport { gap: 12px; }
  .tp-controls { gap: 10px; }
}
@media (max-width: 720px) {
  .tp-controls { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px 12px; overflow: visible; }
  .tp-status, .tp-controls .sp { display: none; }
  .tp-back { flex: 1; }
  .tp-slider { flex: 1 1 100%; }
  .tp-range { flex: 1; width: auto; }
  .tp-start { display: none; }
  .tp-nav { padding: 0 12px; gap: 10px; }
  .tp-foot { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .tp-transport { order: -1; width: 100%; justify-content: center; }
  .tp-foot .sp { display: none; }
  .tp-stat { flex: 1 1 40%; min-width: 120px; }
  .tp-foot-btn { flex: 1 1 40%; }
}

/* ── Mirror wrapper (separate from JS translateY) ── */
.tp-mirror-wrap { position: absolute; left: 0; right: 0; top: 0; }
.tp-mirror-wrap.mirror { transform: scaleX(-1); transform-origin: center; }

/* ── Section info button ── */
.section-info-btn {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue);
  font-size: 11px; font-weight: 800; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; margin-left: 6px;
  transition: background .12s;
}
.section-info-btn:hover { background: #dde8ff; }

/* ── Teleprompter paragraph spacing — respects natural pauses ── */
.tp-text p {
  margin: 0 0 1.2em !important; /* big gap between paragraphs = visual pause */
  line-height: 1.45;
}
.tp-text p:last-child { margin-bottom: 0 !important; }
.tp-text br {
  display: block;
  content: "";
  margin-top: 0.5em; /* single line break = small pause */
}
/* Camera mode same treatment */
.tp-cam-text p { margin: 0 0 1.2em !important; }
.tp-cam-text br { display: block; content: ""; margin-top: 0.5em; }

/* ── Auto-resize textareas ── */
.editor-area {
  overflow: hidden !important;
  resize: none !important;
  min-height: 110px;
  transition: height 0.1s ease;
}
