/* ═══════════════════════════════════════════════════════════
   Redigeo — Design System "Editorial Architect"
   Dark/Light dual-theme · Manrope + Inter · No-line rule
   ═══════════════════════════════════════════════════════════ */

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

/* ── TOKENS — DARK (default) ────────────────────────────── */
:root {
  --bg:       #0b1326;
  --s0:       #060e20;
  --s1:       #131b2e;
  --s2:       #171f33;
  --s3:       #222a3d;
  --s4:       #2d3449;
  --sbr:      #31394d;
  --fg:       #dae2fd;
  --fg-v:     #dec1b3;
  --fg-d:     rgba(218,226,253,.5);
  --fg-m:     rgba(218,226,253,.28);
  --orange:   #ffb690;
  --orange-h: #f88038;
  --on-org:   #552100;
  --btn-end:  #c95e18;
  --green:    #69dba8;
  --green-bg: #00825a;
  --blue:     #6ad3ff;
  --blue-bg:  #00aedf;
  --red:      #ffb4ab;
  --out:      rgba(87,66,56,.22);
  --r:        8px;
  --r-sm:     5px;
  --r-lg:     14px;
  --r-xl:     20px;
}

/* ── TOKENS — LIGHT ─────────────────────────────────────── */
html[data-theme="light"] {
  --bg:       #f6fafe;
  --s0:       #f0f4f8;
  --s1:       #ffffff;
  --s2:       #eaeef2;
  --s3:       #e4e9ed;
  --s4:       #dfe3e7;
  --sbr:      #ddc1b4;
  --fg:       #171c1f;
  --fg-v:     #564239;
  --fg-d:     rgba(23,28,31,.55);
  --fg-m:     rgba(23,28,31,.32);
  --orange:   #9f4200;
  --orange-h: #e27233;
  --on-org:   #ffffff;
  --btn-end:  #c97240;
  --green:    #1a6e45;
  --green-bg: #1a6e45;
  --blue:     #005f7e;
  --blue-bg:  #005f7e;
  --red:      #ba1a1a;
  --out:      rgba(138,114,103,.16);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── NUMBER INPUT — hide spinners ───────────────────────── */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ── SCROLLBARS ─────────────────────────────────────────── */
::-webkit-scrollbar        { width: 3px; height: 3px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--sbr); border-radius: 3px; }

/* ── TYPOGRAPHY HELPERS ─────────────────────────────────── */
.t-d   { color: var(--fg-d); }
.t-m   { color: var(--fg-m); }
.t-org { color: var(--orange); }
.t-grn { color: var(--green); }
.mono  { font-family: 'Menlo','Consolas',monospace; }

/* ═══════════════════════════════════════════════════════════
   LOGIN OVERLAY
   ═══════════════════════════════════════════════════════════ */
#loginOverlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; overflow: hidden;
}
#loginOverlay::before, #loginOverlay::after {
  content: ''; position: absolute; border-radius: 50%;
  filter: blur(120px); pointer-events: none;
}
#loginOverlay::before {
  width: 40%; height: 40%; top: -10%; left: -10%;
  background: rgba(248,128,56,.07);
}
#loginOverlay::after {
  width: 40%; height: 40%; bottom: -10%; right: -10%;
  background: rgba(62,181,132,.04);
}
html[data-theme="light"] #loginOverlay::before { background: rgba(159,66,0,.05); }
html[data-theme="light"] #loginOverlay::after  { background: rgba(0,95,126,.04); }

.login-shell { width: 100%; max-width: 420px; position: relative; z-index: 1; }

.login-logo {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 36px; gap: 6px;
}
.login-logo-hex {
  font-size: 3.2rem; line-height: 1;
  color: var(--orange-h);
  font-weight: 900;
  letter-spacing: 0;
  user-select: none;
}
.login-logo h1 {
  font-family: 'Manrope', sans-serif; font-size: 1.9rem;
  font-weight: 900; color: var(--orange-h); letter-spacing: -.03em;
}
.login-logo p {
  font-size: .63rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .2em; color: var(--fg-v);
}

.glass-card {
  background: rgba(19,27,46,.75);
  backdrop-filter: blur(24px);
  border-radius: var(--r-lg);
  border-top: 1px solid rgba(222,193,179,.08);
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
html[data-theme="light"] .glass-card {
  background: rgba(255,255,255,.85);
  border-top: 1px solid rgba(226,114,51,.12);
  box-shadow: 0 12px 40px rgba(23,28,31,.08);
}

.auth-tabs {
  display: flex; margin-bottom: 24px;
  background: var(--s0); border-radius: var(--r-sm); padding: 3px;
}
.auth-tab {
  flex: 1; padding: 8px;
  font-size: .69rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; cursor: pointer; border: none;
  background: transparent; color: var(--fg-d);
  border-radius: calc(var(--r-sm) - 1px); transition: all .2s;
  font-family: 'Manrope', sans-serif;
}
.auth-tab.active { background: var(--s3); color: var(--fg); }
html[data-theme="light"] .auth-tab.active { background: var(--s2); }

.auth-error {
  font-size: .78rem; color: var(--red);
  margin-top: 4px; display: none;
  padding: 8px 10px; background: rgba(255,180,171,.08);
  border-radius: var(--r-sm);
}
html[data-theme="light"] .auth-error { background: rgba(186,26,26,.06); }

/* ── FIELDS ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field.mb0 { margin-bottom: 0; }
.field label {
  font-size: .61rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .15em; color: var(--fg-v);
}
.field-wrap { position: relative; }
.field input, .field select, select {
  width: 100%; background: var(--s0); border: none;
  border-radius: var(--r-sm); padding: 12px 14px;
  font-size: .9rem; color: var(--fg); font-family: inherit; outline: none;
  transition: box-shadow .2s; appearance: none; -webkit-appearance: none;
}
.field input::placeholder { color: var(--fg-m); }
.field input:focus { box-shadow: 0 0 0 1px rgba(255,182,144,.25); }
html[data-theme="light"] .field input:focus { box-shadow: 0 0 0 1.5px rgba(226,114,51,.35); }
.field-line {
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 2px; background: var(--orange-h);
  border-radius: 0 0 2px 2px; transition: width .3s ease;
}
.field-wrap:focus-within .field-line { width: 100%; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 16px; border: none;
  border-radius: var(--r-sm); font-family: 'Manrope', sans-serif;
  font-size: .76rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; cursor: pointer; transition: all .15s; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--orange-h), var(--btn-end));
  color: var(--on-org);
  box-shadow: 0 4px 16px rgba(248,128,56,.25);
}
.btn-primary:hover { filter: brightness(1.08); }
html[data-theme="light"] .btn-primary { box-shadow: 0 4px 16px rgba(159,66,0,.2); }
.btn-secondary { background: var(--s3); color: var(--fg); }
.btn-secondary:hover { background: var(--s4); }
.btn-ghost { background: transparent; color: var(--fg-d); }
.btn-ghost:hover { background: var(--s2); color: var(--fg); }
.btn-danger { background: rgba(255,180,171,.08); color: var(--red); }
.btn-danger:hover { background: rgba(255,180,171,.16); }
html[data-theme="light"] .btn-danger { background: rgba(186,26,26,.07); }
html[data-theme="light"] .btn-danger:hover { background: rgba(186,26,26,.13); }
.btn-full  { width: 100%; }
.btn-sm    { padding: 7px 13px; font-size: .71rem; }
.btn-xs    { padding: 4px 10px; font-size: .65rem; }
.btn-icon  { padding: 8px; width: 40px; height: 40px; border-radius: var(--r-sm); }

/* ═══════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════ */
#appShell {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}

/* ── TOP NAV ─────────────────────────────────────────────── */
.topnav {
  height: 62px;
  background: rgba(11,19,38,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--out);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px; flex-shrink: 0; z-index: 10;
}
html[data-theme="light"] .topnav {
  background: rgba(255,255,255,.88);
  box-shadow: 0 1px 0 var(--out);
}
.nav-logo {
  font-family: 'Manrope', sans-serif; font-weight: 900;
  font-size: 1.1rem; color: var(--orange-h); letter-spacing: -.03em;
  display: flex; align-items: center; gap: 6px;
}
.nav-logo-hex {
  font-size: 1.3em; line-height: 1; color: var(--orange-h);
  user-select: none;
}
.nav-spacer { flex: 1; }

.nav-processing {
  display: none; align-items: center; gap: 8px;
  padding: 4px 11px; background: rgba(248,128,56,.08); border-radius: 100px;
}
.nav-processing.on { display: flex; }
.nav-processing .nav-proc-label { font-size: .67rem; color: var(--orange); font-weight: 600; }

/* Waveform bars */
.waveform-bars { display: flex; align-items: center; gap: 2px; height: 18px; }
.waveform-bars span {
  display: block; width: 2px; border-radius: 1px; background: var(--orange);
  animation: wave-dance 1.1s ease-in-out infinite; transform-origin: bottom;
}
@keyframes wave-dance {
  0%,100% { transform: scaleY(.25); opacity: .35; }
  50%      { transform: scaleY(1);  opacity: 1; }
}

.nav-credits {
  font-family: 'Manrope', sans-serif; font-size: .71rem; font-weight: 700;
  color: var(--fg-d); display: flex; align-items: center; gap: 4px;
}
.nav-credits strong { color: var(--orange); font-size: .84rem; }
.nav-credits .material-symbols-outlined { font-size: .95rem; }

.nav-email {
  font-size: .76rem; color: var(--fg-d);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── APP BODY ────────────────────────────────────────────── */
.app-body { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* ── LEFT SIDEBAR ────────────────────────────────────────── */
.sidebar {
  width: 280px; flex-shrink: 0; background: var(--s0);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-hdr { padding: 16px 14px 7px; flex-shrink: 0; display: flex; align-items: center; }
.sidebar-label {
  font-size: .59rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .2em; color: var(--fg-m); padding: 0 4px; flex: 1;
}
.sidebar-new-proj-form {
  padding: 8px 12px 10px; background: var(--s2); border-bottom: 1px solid var(--out);
}
.sidebar-new-proj-form input {
  width: 100%; background: var(--s1); border: 1px solid var(--out); border-radius: var(--r-sm);
  padding: 6px 9px; font-size: .78rem; color: var(--fg); font-family: inherit; outline: none;
  margin-bottom: 6px;
}
.sidebar-new-proj-form input:focus { border-color: var(--orange-h); }
.sidebar-list { flex: 1; overflow-y: auto; padding: 4px 6px; }
.sidebar-tree { flex: 1; overflow-y: auto; padding: 6px 0; }

/* Tx list item */
.tx-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 9px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .15s; position: relative;
}
.tx-item:hover { background: var(--s2); }
.tx-item.active {
  background: var(--s2);
  border-left: 2px solid var(--orange-h);
  padding-left: 7px;
}
.tx-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tx-dot.s-completed  { background: var(--green); }
.tx-dot.s-pending    { background: var(--orange); animation: dot-pulse 1.6s ease-in-out infinite; }
.tx-dot.s-processing { background: var(--orange-h); animation: dot-pulse .9s ease-in-out infinite; }
.tx-dot.s-failed     { background: var(--red); }
@keyframes dot-pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50%      { opacity: .5; box-shadow: 0 0 0 3px rgba(248,128,56,0); }
}

.tx-info { flex: 1; min-width: 0; }
.tx-name {
  font-size: .78rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg);
}
.tx-meta { font-size: .63rem; color: var(--fg-m); margin-top: 2px; }
.tx-item.active .tx-name { color: var(--orange-h); }

/* Processing: indeterminate animated bar */
.tx-processing-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.tx-indeterminate-bar {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--s3); overflow: hidden; position: relative;
}
@keyframes indeterminate {
  0%   { left: -60%; width: 40%; }
  60%  { left: 100%; width: 60%; }
  100% { left: 160%; width: 40%; }
}
.tx-indeterminate-bar::after {
  content: ''; position: absolute; top: 0; height: 100%;
  background: linear-gradient(90deg, transparent, var(--orange-h), var(--orange), transparent);
  animation: indeterminate 1.8s ease-in-out infinite;
}
.tx-eta { font-size: .59rem; color: var(--fg-m); font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 32px; text-align: right; }

/* Queue position for pending items */
.tx-queue-row  { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.tx-queue-dots { display: flex; gap: 3px; align-items: center; }
@keyframes queueDot {
  0%, 80%, 100% { opacity: .25; transform: scale(.75); }
  40%           { opacity: 1;   transform: scale(1); }
}
.tx-queue-dots span {
  display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--fg-m); animation: queueDot 1.4s ease-in-out infinite;
}
.tx-queue-dots span:nth-child(2) { animation-delay: .2s; }
.tx-queue-dots span:nth-child(3) { animation-delay: .4s; }
.tx-queue-label { font-size: .59rem; color: var(--fg-m); }

/* Shimmer for processing items */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.tx-item[data-status="processing"] {
  background: linear-gradient(90deg, transparent 0%, rgba(248,128,56,.04) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}
html[data-theme="light"] .tx-item[data-status="processing"] {
  background: linear-gradient(90deg, transparent 0%, rgba(159,66,0,.04) 50%, transparent 100%);
  background-size: 200% 100%;
}
.tx-item[data-status="processing"]:hover { animation: none; background: var(--s2); }

.tx-del {
  background: transparent; border: none; color: var(--fg-m);
  cursor: pointer; opacity: 0; padding: 2px; border-radius: 3px;
  transition: all .15s; display: flex; align-items: center; flex-shrink: 0;
}
.tx-item:hover .tx-del,
.tx-item:hover .tx-move { opacity: 1; }
.tx-del:hover { color: var(--red); background: rgba(255,180,171,.1); }
.tx-del .material-symbols-outlined { font-size: .92rem; }
html[data-theme="light"] .tx-del:hover { background: rgba(186,26,26,.08); }

.del-confirm {
  display: none; padding: 10px 8px; margin: 2px 0 4px;
  background: rgba(255,180,171,.05);
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,180,171,.1);
}
html[data-theme="light"] .del-confirm {
  background: rgba(186,26,26,.04);
  border: 1px solid rgba(186,26,26,.1);
}
.del-confirm p { font-size: .73rem; color: var(--red); margin-bottom: 8px; }

.sidebar-footer {
  padding: 10px 9px 14px;
  border-top: 1px solid var(--out); flex-shrink: 0;
}
.sidebar-storage { font-size: .63rem; color: var(--fg-m); text-align: center; margin-top: 7px; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 20px; text-align: center; color: var(--fg-m);
}
.empty-state .material-symbols-outlined { font-size: 2rem; margin-bottom: 8px; opacity: .4; }
.empty-state p { font-size: .78rem; }

/* ── MAIN AREA ───────────────────────────────────────────── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }

/* ── UPLOAD VIEW ─────────────────────────────────────────── */
.upload-view {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 36px;
}
.upload-card {
  width: 100%; max-width: 540px;
  background: var(--s1); border-radius: var(--r-xl); padding: 36px;
  box-shadow: 0 4px 32px rgba(0,0,0,.12);
}
html[data-theme="light"] .upload-card {
  box-shadow: 0 4px 24px rgba(23,28,31,.07);
}
.upload-icon { text-align: center; margin-bottom: 14px; color: var(--orange-h); font-size: 2rem; }
.upload-title {
  font-family: 'Manrope', sans-serif; font-size: 1.05rem;
  font-weight: 700; text-align: center; margin-bottom: 4px;
}
.upload-sub { text-align: center; font-size: .73rem; color: var(--fg-d); margin-bottom: 24px; }

.file-wrap { position: relative; margin-bottom: 14px; }
.file-wrap input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.file-label {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px; background: var(--s0); border-radius: var(--r-sm);
  border: 1px dashed rgba(87,66,56,.4); cursor: pointer;
  transition: border-color .2s; font-size: .84rem; color: var(--fg-d);
}
html[data-theme="light"] .file-label { border-color: rgba(138,114,103,.3); }
.file-label:hover { border-color: var(--orange-h); color: var(--fg); }
.file-label .material-symbols-outlined { color: var(--orange-h); font-size: 1.15rem; }

.form-row  { display: grid; grid-template-columns: 1fr 1fr;     gap: 10px; margin-bottom: 10px; }
.form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;  margin-bottom: 10px; }

.check-label {
  display: flex; align-items: center; gap: 7px;
  font-size: .78rem; color: var(--fg-d); cursor: pointer;
  text-transform: none; letter-spacing: 0; font-weight: 400; padding-top: 6px;
}
input[type="checkbox"] { width: 13px; height: 13px; accent-color: var(--orange-h); cursor: pointer; }

.uploading-state { text-align: center; padding: 12px 0 0; }

/* Flux loader */
.flux { display: inline-flex; gap: 3px; align-items: flex-end; height: 20px; }
.flux span {
  display: block; width: 3px; border-radius: 2px; background: var(--orange-h);
  animation: flux-b 1.1s ease-in-out infinite;
}
.flux span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.flux span:nth-child(2) { height: 12px; animation-delay: .12s; }
.flux span:nth-child(3) { height: 18px; animation-delay: .24s; }
.flux span:nth-child(4) { height: 12px; animation-delay: .36s; }
.flux span:nth-child(5) { height: 6px;  animation-delay: .48s; }
@keyframes flux-b {
  0%,100% { transform: scaleY(.35); opacity: .35; }
  50%      { transform: scaleY(1);  opacity: 1; }
}

.notice { padding: 9px 12px; border-radius: var(--r-sm); font-size: .79rem; margin-bottom: 10px; }
.notice-ok  { background: rgba(105,219,168,.08); color: var(--green); }
.notice-err { background: rgba(255,180,171,.08); color: var(--red); }
html[data-theme="light"] .notice-ok  { background: rgba(26,110,69,.08); }
html[data-theme="light"] .notice-err { background: rgba(186,26,26,.06); }

/* ── EDITOR VIEW ─────────────────────────────────────────── */
.editor-view { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.editor-toolbar {
  height: 52px; background: rgba(19,27,46,.4);
  border-bottom: 1px solid var(--out);
  display: flex; align-items: center; padding: 0 24px; gap: 12px; flex-shrink: 0;
}
html[data-theme="light"] .editor-toolbar {
  background: rgba(255,255,255,.6);
}
.editor-filename-wrap { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.editor-filename {
  font-family: 'Manrope', sans-serif; font-weight: 700;
  font-size: .9rem; color: var(--fg); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.editor-filename-input {
  flex: 1; background: var(--s2); border: none; border-radius: var(--r-sm);
  padding: 5px 9px; font-size: .88rem; font-weight: 700; color: var(--fg);
  font-family: 'Manrope', sans-serif; outline: 2px solid var(--orange-h); min-width: 0;
}
html[data-theme="light"] .editor-filename-input { background: var(--s1); }

/* Status badge */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 8px; border-radius: 100px;
  font-size: .59rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  flex-shrink: 0;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-completed  { color: var(--green);   background: rgba(105,219,168,.1); }
.badge-pending    { color: var(--orange);  background: rgba(255,182,144,.1); }
.badge-processing {
  color: var(--orange-h); background: rgba(248,128,56,.1);
  animation: badge-anim .9s ease-in-out infinite;
}
.badge-failed { color: var(--red); background: rgba(255,180,171,.1); }
html[data-theme="light"] .badge-completed  { background: rgba(26,110,69,.1); }
html[data-theme="light"] .badge-pending    { background: rgba(159,66,0,.1); }
html[data-theme="light"] .badge-processing { background: rgba(226,114,51,.1); }
html[data-theme="light"] .badge-failed     { background: rgba(186,26,26,.08); }
@keyframes badge-anim { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* Editor scroll — full width between sidebars */
.editor-scroll {
  flex: 1; overflow-y: auto;
  padding: 40px 52px;
  width: 100%;
}

/* Segment groups */
.seg-group { display: flex; gap: 28px; margin-bottom: 36px; position: relative; }
.seg-group.playing::before {
  content: ''; position: absolute;
  left: -16px; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(to bottom, var(--orange-h), transparent);
  border-radius: 1px;
}

.seg-left { width: 118px; flex-shrink: 0; padding-top: 1px; }

.seg-spk-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px 4px 6px; border-radius: 100px;
  font-size: .61rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  cursor: pointer; transition: filter .15s;
  white-space: nowrap; max-width: 116px; overflow: hidden; text-overflow: ellipsis;
}
.seg-spk-pill:hover { filter: brightness(1.15); }
html[data-theme="light"] .seg-spk-pill:hover { filter: brightness(.92); }
.seg-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.seg-ts-group { font-size: .59rem; font-family: 'Menlo',monospace; color: var(--fg-m); margin-top: 5px; display: block; }

.seg-right { flex: 1; min-width: 0; }
.seg-row { display: flex; align-items: baseline; gap: 7px; margin-bottom: 2px; border-radius: 4px; padding: 1px 3px; margin-left: -3px; }
.seg-body { font-size: 1rem; line-height: 1.78; color: rgba(218,226,253,.9); flex: 1; }
html[data-theme="light"] .seg-body { color: rgba(23,28,31,.85); }
.seg-row-ts { font-size: .59rem; font-family: 'Menlo',monospace; color: var(--fg-m); flex-shrink: 0; width: 34px; }
.seg-opts {
  background: transparent; border: none; color: var(--fg-m);
  cursor: pointer; font-size: 1rem; padding: 0 3px;
  opacity: 0.2; transition: opacity .15s; line-height: 1;
}
.seg-row:hover { background: rgba(255,182,144,.07); }
html[data-theme="light"] .seg-row:hover { background: rgba(159,66,0,.05); }
.seg-row:hover .seg-opts { opacity: 1; }
.seg-opts:hover { color: var(--fg); }

/* Word highlights */
.w { cursor: pointer; border-radius: 3px; transition: background .08s; padding: 0 1px; }
.w:hover { background: rgba(255,182,144,.12); }
.w.on   { background: rgba(255,182,144,.18); color: var(--orange); font-weight: 600; }
html[data-theme="light"] .w:hover { background: rgba(226,114,51,.1); }
html[data-theme="light"] .w.on    { background: rgba(159,66,0,.12); color: var(--orange); }

/* Future segments */
.seg-group.future { opacity: .38; transition: opacity .3s; }
.seg-group.future:hover { opacity: 1; }

/* ── RIGHT SIDEBAR ───────────────────────────────────────── */
.right-sidebar {
  width: 270px; flex-shrink: 0; background: var(--s1);
  border-left: 1px solid var(--out);
  display: flex; flex-direction: column;
  overflow-y: auto; padding: 18px 14px;
}
.rs-sec { margin-bottom: 24px; }
.rs-label {
  font-size: .59rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .2em; color: var(--fg-m); margin-bottom: 9px; display: block;
}

/* Speaker rows */
.spk-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .15s; margin-bottom: 2px;
}
.spk-row:hover { background: var(--s2); }
.spk-row-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.spk-row-name { flex: 1; font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spk-row-count { font-size: .63rem; color: var(--fg-m); }

/* Speaker edit card */
.spk-edit-card {
  background: var(--s3); border-radius: var(--r); padding: 14px;
  margin-top: 6px; display: none; border: 1px solid var(--out);
}
.spk-edit-card.open { display: block; }
.spk-edit-title { font-size: .71rem; font-weight: 700; color: var(--fg-v); margin-bottom: 10px; }
.spk-edit-card .field { margin-bottom: 10px; }
.spk-edit-card .field input,
.spk-edit-card .field select { padding: 8px 10px; font-size: .82rem; }
.spk-edit-card .field label { font-size: .59rem; }

/* Speaker add form */
.spk-add-form {
  background: var(--s2); border-radius: var(--r); padding: 12px;
  margin-top: 6px; display: none;
}
.spk-add-form.open { display: block; }
.spk-add-form .field { margin-bottom: 8px; }
.spk-add-form .field input { padding: 7px 10px; font-size: .82rem; }
.spk-add-form .field label { font-size: .59rem; }

/* Export buttons */
.exp-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 11px 13px; background: var(--s2); border: none;
  border-radius: var(--r-sm); cursor: pointer; text-align: left;
  margin-bottom: 5px; color: var(--fg); transition: background .15s; font-family: inherit;
}
.exp-btn:hover { background: var(--s3); }
.exp-btn-l { display: flex; align-items: center; gap: 9px; font-size: .82rem; font-weight: 500; }
.exp-btn-l .material-symbols-outlined { color: var(--fg-d); font-size: 1rem; }
.exp-btn-r .material-symbols-outlined { color: var(--fg-m); font-size: .88rem; }

/* ── PLAYER BAR ──────────────────────────────────────────── */
.player-bar {
  height: 0; overflow: hidden; flex-shrink: 0;
  background: rgba(11,19,38,.92);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--out);
  display: flex; align-items: center; padding: 0 20px; gap: 16px;
  transition: height .3s cubic-bezier(.4,0,.2,1);
}
html[data-theme="light"] .player-bar {
  background: rgba(255,255,255,.88);
  box-shadow: 0 -4px 20px rgba(23,28,31,.06);
}
.player-bar.up { height: 78px; }

.p-info { width: 160px; flex-shrink: 0; min-width: 0; }
.p-fname { font-size: .76rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-spkr { font-size: .63rem; color: var(--orange-h); margin-top: 2px; font-weight: 600; }

.p-ctrl { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.p-skip {
  background: transparent; border: none; color: var(--fg-d); cursor: pointer;
  font-size: .67rem; font-weight: 700; padding: 5px 8px; border-radius: var(--r-sm);
  transition: all .15s; font-family: 'Manrope', sans-serif;
}
.p-skip:hover { background: var(--s2); color: var(--fg); }

.p-play {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-h), var(--btn-end));
  color: var(--on-org);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s; box-shadow: 0 4px 14px rgba(248,128,56,.3); flex-shrink: 0;
}
.p-play:hover { filter: brightness(1.08); transform: scale(1.04); }
.p-play:active { transform: scale(.95); }
.p-play .material-symbols-outlined {
  font-size: 1.3rem;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.p-prog { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.p-track {
  flex: 1; height: 4px; background: var(--s3); border-radius: 2px;
  position: relative; cursor: pointer; transition: height .15s;
}
.p-track:hover { height: 6px; }
.p-fill {
  position: absolute; left: 0; top: 0; bottom: 0; background: var(--orange-h);
  border-radius: 2px; width: 0; box-shadow: 0 0 6px rgba(255,182,144,.4);
  transition: width .1s linear;
}
html[data-theme="light"] .p-fill { box-shadow: 0 0 6px rgba(159,66,0,.3); }
.p-thumb {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--orange-h);
  left: 0; transition: left .1s linear; box-shadow: 0 0 7px rgba(255,182,144,.6);
}
.p-time { font-size: .66rem; font-family: 'Menlo',monospace; color: var(--fg-d); white-space: nowrap; flex-shrink: 0; }
.p-speed {
  background: var(--s2); border: none; color: var(--fg-d); cursor: pointer;
  font-size: .69rem; font-weight: 700; padding: 4px 10px; border-radius: 100px;
  transition: all .15s; font-family: 'Manrope', sans-serif; flex-shrink: 0;
}
.p-speed:hover { background: var(--s3); color: var(--fg); }
.p-close {
  background: transparent; border: none; color: var(--fg-m); cursor: pointer;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); transition: all .15s; flex-shrink: 0;
}
.p-close:hover { background: var(--s2); color: var(--fg); }
.p-close .material-symbols-outlined { font-size: 1rem; }

/* ── REASSIGN POPUP ──────────────────────────────────────── */
.reassign-pop {
  position: fixed; background: var(--s4);
  border-radius: var(--r); box-shadow: 0 20px 40px rgba(0,0,0,.45);
  border: 1px solid var(--out); padding: 5px; min-width: 175px; z-index: 200;
}
html[data-theme="light"] .reassign-pop { box-shadow: 0 12px 32px rgba(23,28,31,.1); }
.reassign-pop-hdr {
  font-size: .59rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .15em; color: var(--fg-m); padding: 3px 8px 7px;
}
.reassign-pop button {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 7px 9px; background: transparent; border: none;
  cursor: pointer; font-size: .8rem; color: var(--fg);
  border-radius: var(--r-sm); font-family: inherit; text-align: left; transition: background .1s;
}
.reassign-pop button:hover { background: var(--s3); }
.rpop-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.rpop-sep { border: none; border-top: 1px solid var(--out); margin: 3px 0; }
.rpop-new { display: flex; gap: 5px; padding: 5px 3px 3px; align-items: center; }
.rpop-new input {
  flex: 1; background: var(--s2); border: none; border-radius: var(--r-sm);
  padding: 5px 7px; font-size: .75rem; color: var(--fg); outline: none; font-family: inherit;
}
.rpop-new button {
  width: auto; background: var(--s2); font-size: .66rem;
  padding: 5px 7px; flex-shrink: 0; border-radius: var(--r-sm);
  font-weight: 600; color: var(--orange-h);
}
.rpop-new button:hover { background: var(--s3); }
.rpop-apply-all { color: var(--fg-d) !important; font-size: .76rem !important; font-style: italic; }
.rpop-apply-all:hover { color: var(--fg) !important; background: var(--s3) !important; }

/* ── SETTINGS PANEL ──────────────────────────────────────── */
.settings-section { margin-bottom: 24px; }
.settings-label {
  font-size: .59rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .2em; color: var(--fg-m); margin-bottom: 9px;
}
.settings-profile-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--s2); border-radius: 8px; padding: 13px;
}
.settings-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-h), var(--btn-end));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.05rem;
  color: var(--on-org); flex-shrink: 0;
}
.settings-profile-info { min-width: 0; }
.settings-email { font-size: .86rem; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-role { font-size: .67rem; color: var(--fg-m); margin-top: 2px; text-transform: uppercase; letter-spacing: .1em; }

.settings-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.settings-stat-card { background: var(--s2); border-radius: 8px; padding: 13px 15px; }
.settings-stat-value { font-family: 'Manrope', sans-serif; font-size: 1.5rem; font-weight: 800; }
.settings-stat-key { font-size: .63rem; color: var(--fg-m); margin-top: 2px; text-transform: uppercase; letter-spacing: .1em; }

.settings-storage-bar-wrap { display: flex; flex-direction: column; gap: 6px; }
.settings-storage-bar { height: 6px; background: var(--s3); border-radius: 3px; overflow: hidden; }
.settings-storage-fill { height: 100%; background: linear-gradient(90deg, var(--orange-h), var(--btn-end)); border-radius: 3px; width: 0; transition: width .5s ease; }
.settings-storage-lbl { font-size: .71rem; color: var(--fg-d); text-align: right; }

/* ── TOASTS ──────────────────────────────────────────────── */
#toasts {
  position: fixed; bottom: 84px; right: 18px;
  display: flex; flex-direction: column; gap: 7px; z-index: 300;
}
.toast {
  padding: 10px 14px; border-radius: var(--r-sm);
  font-size: .78rem; font-weight: 500; max-width: 270px;
  backdrop-filter: blur(12px); animation: t-in .2s ease;
  box-shadow: 0 4px 18px rgba(0,0,0,.3);
}
@keyframes t-in {
  from { transform: translateX(16px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-s { background: rgba(0,130,90,.92); color: #dde; }
.toast-e { background: rgba(147,0,10,.92); color: var(--red); }
.toast-i { background: rgba(34,42,61,.96); color: var(--fg); border: 1px solid var(--out); }
html[data-theme="light"] .toast-s { background: rgba(26,110,69,.94); color: #e8faf0; }
html[data-theme="light"] .toast-e { background: rgba(186,26,26,.94); color: #ffeae8; }
html[data-theme="light"] .toast-i { background: rgba(240,244,248,.97); color: var(--fg); border-color: var(--out); box-shadow: 0 4px 18px rgba(23,28,31,.12); }

/* ── PROJECTS / SETTINGS MODAL ──────────────────────────── */
#projectsModal, #settingsModal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-start; justify-content: flex-end;
}
.proj-overlay {
  position: absolute; inset: 0;
  background: rgba(6,14,32,.6); backdrop-filter: blur(4px);
}
html[data-theme="light"] .proj-overlay {
  background: rgba(23,28,31,.25); backdrop-filter: blur(3px);
}
.proj-panel {
  position: relative; z-index: 1;
  width: 360px; height: 100%;
  background: var(--s1);
  border-left: 1px solid var(--out);
  display: flex; flex-direction: column;
  animation: slide-in-r .22s cubic-bezier(.4,0,.2,1);
}
@keyframes slide-in-r {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}
.proj-panel-hdr {
  height: 58px; display: flex; align-items: center;
  padding: 0 18px; gap: 10px; flex-shrink: 0;
  border-bottom: 1px solid var(--out);
}
.proj-panel-title {
  font-family: 'Manrope', sans-serif; font-weight: 800;
  font-size: .92rem; color: var(--fg); flex: 1;
}
.proj-panel-body { flex: 1; overflow-y: auto; padding: 10px 10px; }
.proj-panel-footer { padding: 10px 10px 14px; border-top: 1px solid var(--out); flex-shrink: 0; }

.proj-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 10px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .15s; margin-bottom: 2px;
}
.proj-item:hover { background: var(--s2); }
.proj-item.active { background: var(--s2); border-left: 2px solid var(--orange-h); padding-left: 8px; }
.proj-item-icon { color: var(--fg-d); font-size: 1.08rem; flex-shrink: 0; }
.proj-item-name { flex: 1; font-size: .84rem; font-weight: 600; color: var(--fg); }
.proj-item-count { font-size: .67rem; color: var(--fg-m); }

.proj-new-form { display: none; }
.proj-new-form.open { display: block; }
.proj-new-form .field { margin-bottom: 8px; }

/* New project inline toggle */
.new-proj-row {
  display: none; margin-top: 6px;
  background: var(--s0); border-radius: var(--r-sm);
  padding: 10px 12px; gap: 8px; align-items: center;
}
.new-proj-row.open { display: flex; }
.new-proj-row input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: .86rem; color: var(--fg); font-family: inherit;
}
.new-proj-row input::placeholder { color: var(--fg-m); }

/* ── SIDEBAR TREE ────────────────────────────────────────── */
.tree-section-hdr {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px 5px;
  font-size: .57rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .18em; color: var(--fg-m); margin-top: 2px;
}
.tree-section-count {
  font-family: 'Manrope', sans-serif; font-size: .63rem; font-weight: 700;
  color: var(--fg-m); background: var(--s3); border-radius: 10px;
  padding: 1px 6px; margin-left: auto;
}

.tree-proj-hdr {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 10px 7px 8px; border-radius: var(--r-sm);
  cursor: pointer; transition: background .15s; margin: 1px 6px;
}
.tree-proj-hdr:hover { background: var(--s2); }

.tree-proj-arrow {
  font-size: .75rem; color: var(--fg-m); flex-shrink: 0;
  transition: transform .18s; width: 14px; text-align: center;
  font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 20;
}
.tree-proj.open > .tree-proj-hdr .tree-proj-arrow { transform: rotate(90deg); }

.tree-proj-icon {
  font-size: .92rem; color: var(--orange-h); flex-shrink: 0;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.tree-proj-name {
  flex: 1; font-size: .8rem; font-weight: 600; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tree-proj-count {
  font-size: .63rem; color: var(--fg-m); flex-shrink: 0;
  font-family: 'Manrope', sans-serif; font-weight: 700;
}
.tree-proj-arrow-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; flex-shrink: 0;
}
.tree-proj-action {
  background: none; border: none; cursor: pointer; color: var(--fg-m);
  padding: 2px; border-radius: 3px; display: flex; align-items: center;
  opacity: 0; transition: opacity .15s, color .15s; flex-shrink: 0;
}
.tree-proj-action .material-symbols-outlined { font-size: .78rem; }
.tree-proj-hdr:hover .tree-proj-action { opacity: 1; }
.tree-proj-action:hover { color: var(--fg); background: var(--s3); }
.tree-proj-del-btn:hover { color: var(--red); }
.tree-proj-rename-input {
  flex: 1; min-width: 0; background: var(--s3); border: 1px solid var(--orange-h);
  border-radius: 3px; padding: 2px 6px; font-size: .8rem; font-weight: 600;
  color: var(--fg); font-family: inherit; outline: none;
}
.proj-del-confirm {
  background: rgba(255,180,171,.06); border-radius: var(--r-sm);
  padding: 8px 12px; margin: 2px 6px 4px; font-size: .73rem; color: var(--red);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.proj-del-confirm button {
  background: var(--s3); border: none; border-radius: 4px; cursor: pointer;
  padding: 3px 10px; font-size: .71rem; color: var(--fg); font-family: inherit;
}
.proj-del-confirm button:first-of-type { background: var(--red); color: #1a0000; }
.tree-proj-hdr.drag-over { background: rgba(248,128,56,.12); outline: 1.5px dashed var(--orange-h); border-radius: var(--r-sm); }
#noProjectZone.drag-over-zone { background: rgba(248,128,56,.04); outline: 1.5px dashed var(--orange-h); border-radius: var(--r-sm); }

.tree-proj-body { display: none; padding-left: 16px; }
.tree-proj.open > .tree-proj-body { display: block; }
.tree-empty-proj { font-size: .71rem; color: var(--fg-m); padding: 6px 8px; font-style: italic; }

/* Move button on tx-item */
.tx-move {
  background: transparent; border: none; color: var(--fg-m);
  cursor: pointer; opacity: 0; padding: 2px; border-radius: 3px;
  transition: all .15s; display: flex; align-items: center; flex-shrink: 0;
}
.tx-move:hover { color: var(--blue); background: rgba(106,211,255,.1); }
.tx-move .material-symbols-outlined { font-size: .92rem; }
html[data-theme="light"] .tx-move:hover { background: rgba(0,95,126,.08); }

/* Move popup */
.move-pop {
  position: fixed; background: var(--s4);
  border-radius: var(--r); box-shadow: 0 20px 40px rgba(0,0,0,.45);
  border: 1px solid var(--out); padding: 5px; min-width: 190px; z-index: 200;
}
html[data-theme="light"] .move-pop { box-shadow: 0 12px 32px rgba(23,28,31,.1); }
.move-pop-hdr {
  font-size: .59rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .15em; color: var(--fg-m); padding: 3px 8px 7px;
}
.move-pop button {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 7px 9px; background: transparent; border: none;
  cursor: pointer; font-size: .8rem; color: var(--fg);
  border-radius: var(--r-sm); font-family: inherit; text-align: left; transition: background .1s;
}
.move-pop button:hover { background: var(--s3); }
.move-pop-cur { font-weight: 700; }

/* ── PROJECT VIEW ────────────────────────────────────────── */
.project-view {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.pv-toolbar {
  height: 52px; background: rgba(19,27,46,.4);
  border-bottom: 1px solid var(--out);
  display: flex; align-items: center; padding: 0 24px; gap: 14px; flex-shrink: 0;
}
html[data-theme="light"] .pv-toolbar { background: rgba(255,255,255,.6); }
.pv-title {
  font-family: 'Manrope', sans-serif; font-weight: 800;
  font-size: .92rem; color: var(--fg); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-tx-count { font-size: .71rem; color: var(--fg-m); flex-shrink: 0; }
.pv-scroll { flex: 1; overflow-y: auto; padding: 28px 40px; }

/* Speaker cards row */
.pv-spk-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px;
}
.pv-spk-card {
  background: var(--s2); border-radius: var(--r); padding: 14px 18px;
  cursor: pointer; transition: all .18s; min-width: 150px; flex: 1;
  border-top: 3px solid transparent;
}
.pv-spk-card:hover { background: var(--s3); transform: translateY(-2px); }
.pv-spk-card.active { background: var(--s3); box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.pv-spk-card.dim { opacity: .35; }
.pv-spk-name {
  font-weight: 700; font-size: .88rem; margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-spk-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.pv-spk-stats span { font-size: .63rem; color: var(--fg-d); }

/* Timeline */
.pv-timeline { }
.pv-tx-group {
  margin-bottom: 28px;
}
.pv-tx-hdr {
  display: flex; align-items: center; gap: 8px;
  font-size: .71rem; font-weight: 700; color: var(--fg-d);
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--out);
  margin-bottom: 10px;
}
.pv-tx-meta { color: var(--fg-m); font-weight: 400; margin-left: auto; font-size: .63rem; }
.pv-seg {
  display: flex; align-items: baseline; gap: 12px;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.025);
  transition: opacity .18s;
}
html[data-theme="light"] .pv-seg { border-bottom-color: rgba(0,0,0,.04); }
.pv-seg-pill {
  display: inline-block; padding: 2px 8px; border-radius: 100px;
  font-size: .59rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  flex-shrink: 0; white-space: nowrap; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis;
}
.pv-seg-ts { font-size: .59rem; font-family: 'Menlo', monospace; color: var(--fg-m); flex-shrink: 0; width: 36px; }
.pv-seg-text { font-size: .9rem; line-height: 1.6; color: var(--fg); flex: 1; }
html[data-theme="light"] .pv-seg-text { color: rgba(23,28,31,.85); }
.pv-play-btn {
  flex-shrink: 0; background: none; border: none; padding: 2px 4px;
  color: var(--fg-m); cursor: pointer; border-radius: 4px;
  opacity: 0; transition: opacity .15s, color .15s;
  font-size: .85rem; line-height: 1;
}
.pv-play-btn .material-symbols-outlined { font-size: 1rem; vertical-align: middle; }
.pv-seg:hover .pv-play-btn { opacity: 1; }
.pv-play-btn:hover { color: var(--orange); }

/* ── WORD EDIT ───────────────────────────────────────────── */
.w { cursor: pointer; }
.w:hover { opacity: .75; }
.word-edit-inp {
  font: inherit; font-size: inherit;
  color: var(--fg);
  background: var(--s3);
  border: none;
  border-bottom: 1.5px solid var(--orange);
  border-radius: 3px 3px 0 0;
  outline: none;
  padding: 0 3px;
  min-width: 40px;
  display: inline-block;
  vertical-align: baseline;
}
html[data-theme="light"] .word-edit-inp {
  color: rgba(23,28,31,.9);
  background: rgba(159,66,0,.06);
  border-bottom-color: var(--orange-h);
}

/* ── BILLING ─────────────────────────────────────────────── */
.billing-info {
  font-size: .74rem;
  color: var(--fg-d);
  margin-bottom: 10px;
}
html[data-theme="light"] .billing-info { color: rgba(23,28,31,.5); }
.billing-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.billing-btn {
  background: var(--s3);
  border: 1px solid var(--out);
  border-radius: 7px;
  color: var(--fg);
  font-family: 'Manrope', sans-serif;
  font-size: .74rem;
  font-weight: 700;
  padding: 8px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  cursor: pointer;
  text-align: center;
  transition: background .15s, border-color .15s, color .15s;
}
.billing-btn:hover {
  background: var(--orange-h);
  border-color: var(--orange-h);
  color: var(--on-org);
}
html[data-theme="light"] .billing-btn {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.1);
  color: rgba(23,28,31,.8);
}
.billing-btn-credits { font-size: .78rem; font-weight: 700; }
.billing-btn-price   { font-size: .68rem; color: var(--fg-d); font-weight: 500; }
.billing-btn:hover .billing-btn-price { color: rgba(85,33,0,.65); }
.billing-bonus {
  display: inline-block;
  background: rgba(105,219,168,.15);
  color: var(--green);
  border-radius: 4px;
  padding: 0 4px;
  font-size: .66rem; font-weight: 700;
}
.billing-btn:hover .billing-bonus { background: rgba(85,33,0,.12); color: var(--on-org); }
html[data-theme="light"] .billing-btn:hover {
  background: var(--orange-h);
  border-color: var(--orange-h);
  color: #fff;
}

/* ── TRANSACTION LIST ─────────────────────────────────────── */
.txn-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 260px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid var(--out);
  background: var(--s2);
}
.txn-empty {
  padding: 14px;
  text-align: center;
  color: var(--fg-d);
  font-size: .76rem;
}
.txn-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--s1);
  font-size: .76rem;
  border-bottom: 1px solid var(--out);
}
.txn-row:last-child { border-bottom: none; }
.txn-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.txn-desc {
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.txn-date { color: var(--fg-d); font-size: .7rem; }
.txn-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.txn-amount { font-weight: 700; font-size: .82rem; }
.txn-balance { color: var(--fg-d); font-size: .7rem; white-space: nowrap; }
.txn-receipt {
  color: var(--fg-d);
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: color .15s;
}
.txn-receipt:hover { color: var(--orange-h); }

/* ── MISC ────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 8px; }
.mt8 { margin-top: 8px; }
.mt4 { margin-top: 4px; }
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

