.subtitle-editor { 
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 17px;
  overflow: hidden;
}
.project-list { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; padding: 16px; }
.project-row { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 188px auto; gap: 10px 12px; align-items: start; min-height: 290px; padding: 12px; }
.project-row > .project-row-preview { grid-column: 1 / -1; width: 100%; height: 188px; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; border: 1px solid #252c24; border-radius: 7px; background: #080a08; }
.project-row > .project-row-preview img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
.project-row-preview i { color: #555d52; font-size: 10px; font-style: normal; }
.project-row > .project-row-info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.project-row-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row-info span { margin-top: 0; }
.project-row > em { align-self: start; }
.project-cover { width: 100%; height: 190px; object-fit: cover; border-radius: 7px; background: #080a08; grid-column: 1 / -1; }
.project-open { min-width: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-open > span { min-width: 0; }
.project-open b, .project-open span { display: block; }
.project-open span span { color: #6d7369; font-size: 9px; margin-top: 5px; }
.project-open em { color: var(--acid); font-size: 9px; font-style: normal; white-space: nowrap; }
.project-delete { border: 1px solid #49302f; background: transparent; color: #ff8580; border-radius: 7px; padding: 8px 10px; font-size: 9px; cursor: pointer; }
.project-delete:hover { background: rgba(255,107,103,.1); border-color: #ff6b67; }
.export-history { grid-column: 1 / -1; margin-top: 8px; padding-top: 10px; border-top: 1px solid #252a24; font-size: 9px; color: #72796e; }
.export-history b { display: block; color: #aeb6a7; margin-bottom: 6px; }
.export-history div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.file-card { transition: border-color .18s, background .18s, transform .18s, box-shadow .18s; }
.file-card.drag-over { border-color: var(--acid); background: rgba(202,255,63,.12); box-shadow: 0 0 0 2px rgba(202,255,63,.2), 0 12px 34px rgba(0,0,0,.25); transform: translateY(-2px); }
.file-grid { grid-template-columns: repeat(4, 1fr); }
.folder-picker { min-height: 58px; margin: 0 0 16px; padding: 13px 16px; border: 1px dashed #3b4535; border-radius: 11px; background: rgba(202,255,63,.035); display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.folder-picker input { display: none; }
.folder-picker span { display: flex; flex-direction: column; gap: 4px; }
.folder-picker b { font-size: 11px; }
.folder-picker small { color: #747b70; font-size: 9px; }
.folder-picker em { color: var(--acid); font-size: 9px; font-style: normal; }
.folder-picker:hover, .folder-picker.selected { border-color: var(--acid); background: rgba(202,255,63,.08); }
.export-mode { display: inline-flex; align-items: center; gap: 6px; height: 36px; border: 1px solid #30352e; border-radius: 9px; padding: 0 8px; color: #8f968a; font-size: 9px; }
.export-mode select { border: 0; outline: 0; background: transparent; color: var(--acid); font-size: 9px; cursor: pointer; }
.export-mode option { background: #111411; color: #e8ece3; }
@media (max-width: 900px) { .file-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .file-grid { grid-template-columns: 1fr; } }
.hero { padding-top: 48px; padding-bottom: 58px; }
.hero > h1 { font-size: clamp(30px, 3vw, 42px); letter-spacing: 0; }
.subtitle-editor-head {
  min-height: 64px;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.subtitle-editor-head > div { display: flex; flex-direction: column; }
.subtitle-editor-head b { font-size: 12px; }
.subtitle-editor-head span { font-size: 8px; color: #666d63; margin-top: 4px; }
.subtitle-rows { max-height: 520px; overflow: auto; padding: 8px; }
.subtitle-row {
  display: grid;
  grid-template-columns: 34px minmax(240px, 1fr) 92px 92px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #1d221c;
}
.subtitle-row > span { font: 10px ui-monospace, monospace; color: var(--acid); }
.subtitle-row textarea,
.subtitle-row input {
  border: 1px solid #30362e;
  border-radius: 7px;
  background: #0a0c0a;
  color: #e8ece3;
  padding: 8px;
  font-size: 10px;
}
.subtitle-row textarea { resize: vertical; min-height: 42px; line-height: 1.5; }
.subtitle-row input { font: 10px ui-monospace, monospace; color: var(--acid); }
.review { grid-template-columns: minmax(390px, .9fr) minmax(560px, 1.6fr); gap: 18px; }
.preview-panel { padding: 22px; max-width: 520px; width: 100%; justify-self: center; }
.phone { width: min(100%, 390px); margin: 0 auto; aspect-ratio: 9 / 16; }
.live-subtitle-editor { margin-top: 12px; padding: 12px; border: 1px solid #30362e; border-radius: 10px; background: #0a0c0a; }
.live-subtitle-editor > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.preview-subtitle-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: #9da59a; font-size: 9px; cursor: pointer; }
.preview-subtitle-toggle input { accent-color: var(--acid); width: 13px; height: 13px; }
.preview-subtitle-toggle:has(input:checked) { color: var(--acid); }
.live-subtitle-editor b { font-size: 10px; }
.live-subtitle-editor span { color: #697166; font: 9px ui-monospace, monospace; }
.live-subtitle-editor textarea { width: 100%; margin: 9px 0; min-height: 48px; resize: vertical; border: 1px solid #30362e; border-radius: 7px; background: #050605; color: #e8ece3; padding: 8px; font-size: 10px; line-height: 1.5; }
.live-subtitle-editor .ghost { width: 100%; }
@media (max-width: 1100px) { .review { grid-template-columns: minmax(320px, .8fr) 1.2fr; } }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } .preview-panel { max-width: none; } }
@media (max-width: 620px) {
  .subtitle-row { grid-template-columns: 28px 1fr 76px 76px; }
  .subtitle-editor-head { align-items: flex-start; gap: 10px; padding: 14px; }
  .phone { max-width: 390px; }
}

/* Async actions keep a visible, consistent loading state while the server works. */
button.is-loading {
  cursor: wait;
  opacity: .76;
  pointer-events: none;
}
.button-spinner {
  width: 12px;
  height: 12px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin .7s linear infinite;
}
@keyframes button-spin { to { transform: rotate(360deg); } }

/* Editing workspace: preview, asset bin, and a compact horizontal timeline. */
.editor-workspace { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: start; }
.editor-main { min-width: 0; display: grid; gap: 14px; }
.asset-panel, .timeline-panel { min-width: 0; overflow: hidden; }
.asset-panel { border: 1px solid var(--line); background: var(--panel); border-radius: 17px; }
.asset-heading { min-height: 64px; padding: 0 17px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); }
.asset-heading > div { display:flex; flex-direction:column; }
.asset-heading b { font-size:12px; }
.asset-heading span { font-size:8px; color:#666d63; margin-top:4px; }
.asset-heading strong { color:var(--acid); font:11px ui-monospace,monospace; }
.asset-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(108px,1fr)); gap:10px; padding:12px; max-height:365px; overflow:auto; }
.asset-card { position:relative; min-width:0; border:1px solid #282d27; border-radius:10px; padding:7px; background:#101310; color:var(--text); text-align:left; cursor:pointer; display:flex; flex-direction:column; gap:5px; transition:.16s; }
.asset-card:hover { border-color:#59674a; background:#151a13; transform:translateY(-1px); }
.asset-card.active { border-color:var(--acid); background:rgba(202,255,63,.08); box-shadow:0 0 0 1px rgba(202,255,63,.14); }
.asset-card img { width:100%; aspect-ratio:9/14; object-fit:cover; border-radius:6px; background:#080a08; }
.asset-card .asset-index { position:absolute; top:12px; left:12px; padding:3px 5px; border-radius:4px; background:rgba(0,0,0,.7); color:var(--acid); font:10px ui-monospace,monospace; }
.asset-card b { font-size:9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.asset-card small { font-size:8px; color:#737b70; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.timeline-tools { display:flex; align-items:center; gap:6px; }
.tool-button { width:30px; height:30px; border:1px solid #30352e; border-radius:8px; background:#111411; color:#bec6b7; cursor:pointer; }
.tool-button:hover { color:var(--acid); border-color:var(--acid); }
.timeline-ruler { display:flex; justify-content:space-between; padding:8px 16px 0; color:#60685c; font:9px ui-monospace,monospace; }
.timeline-list { overflow-x:auto; overflow-y:hidden; padding:10px; }
.timeline-track { min-width:100%; width:max-content; display:flex; align-items:stretch; gap:3px; }
.timeline-item { position:relative; flex:0 0 var(--track-size); min-width:96px; height:94px; display:grid; grid-template-columns:42px minmax(0,1fr); grid-template-rows:1fr 28px; gap:7px; align-items:center; padding:8px; border:1px solid #30362c; border-radius:8px; background:#111511; cursor:pointer; overflow:hidden; }
.timeline-item:hover { background:#131613; }
.timeline-item.active { background:rgba(202,255,63,.09); border-color:var(--acid); box-shadow:inset 3px 0 0 var(--acid); }
.timeline-item .timeline-thumb { width:42px; height:55px; aspect-ratio:auto; border-radius:5px; object-fit:cover; }
.timeline-clip-copy { min-width:0; display:flex; flex-direction:column; gap:6px; }
.timeline-clip-copy b { font-size:9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.timeline-clip-copy span { color:#70786c; font:8px ui-monospace,monospace; white-space:nowrap; }
.timeline-item .duration-input { grid-column:1 / -1; width:100%; height:26px; padding:4px; }
@media (max-width: 1050px) { .editor-workspace { grid-template-columns:300px minmax(0,1fr); } .asset-grid { grid-template-columns:repeat(3,1fr); } }
@media (max-width: 900px) { .editor-workspace { grid-template-columns:1fr; } .preview-panel { max-width:420px; justify-self:center; width:100%; } .asset-grid { max-height:none; grid-template-columns:repeat(auto-fill,minmax(100px,1fr)); } }

/* Timeline editor matching the reference video platform: fixed labels, stacked tracks, draggable clip edges. */
:root { --track-label-width: 118px; }
.timeline-tools { flex-wrap:nowrap; }
.timeline-zoom-tools { display:flex; align-items:center; gap:4px; }
.timeline-fit { border:1px solid #4b5c2e !important; color:var(--acid) !important; padding:0 9px !important; }
.timeline-fit:hover { background:rgba(202,255,63,.12) !important; }
.timeline-zoom { width:96px; accent-color:var(--acid); cursor:pointer; }
.timeline-scroll { position:relative; overflow-x:auto; overflow-y:hidden; min-height:218px; padding-bottom:12px; background:#090b09; }
.timeline-ruler { height:28px; min-width:760px; display:flex; align-items:center; justify-content:space-between; padding:0 16px 0 calc(var(--track-label-width) + 16px); color:#626a5e; font:9px ui-monospace,monospace; border-bottom:1px solid #1f251e; }
.editor-track { position:relative; min-width:760px; width:max-content; min-height:78px; display:flex; border-bottom:1px solid #1f251e; }
.track-label { flex:0 0 var(--track-label-width); width:var(--track-label-width); padding:16px 12px; background:#0d100d; border-right:1px solid #252c23; display:flex; flex-direction:column; gap:5px; }
.track-label b { color:#a9b1a4; font-size:10px; }
.track-label small { color:#5f685c; font-size:8px; line-height:1.35; }
.track-clips { display:flex; align-items:center; gap:3px; padding:9px 12px; min-height:78px; }
.timeline-clip { position:relative; flex:0 0 auto; height:58px; border:1px solid #34402e; border-radius:7px; overflow:hidden; background:#151a14; cursor:pointer; transition:border-color .15s,box-shadow .15s; }
.timeline-clip:hover { border-color:#91b73f; }
.timeline-clip.active { border-color:var(--acid); box-shadow:0 0 0 1px rgba(202,255,63,.3); }
.timeline-clip img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.45; }
.clip-shade { position:absolute; inset:0; background:linear-gradient(90deg,rgba(6,9,6,.75),rgba(6,9,6,.2)); }
.clip-content { position:absolute; inset:7px 10px; display:flex; flex-direction:column; justify-content:space-between; pointer-events:none; min-width:0; }
.clip-content b { color:var(--acid); font:10px ui-monospace,monospace; }
.clip-content span { color:#eef2e9; font-size:9px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.clip-content small { color:#bbc4b2; font:8px ui-monospace,monospace; }
.clip-handle { position:absolute; top:0; right:0; width:10px; height:100%; border:0; border-left:2px solid rgba(202,255,63,.55); background:rgba(202,255,63,.08); cursor:ew-resize; z-index:3; }
.clip-handle:hover { background:rgba(202,255,63,.3); border-left-color:var(--acid); }
.narration-track { min-height:70px; }
.audio-clip { margin:12px; height:46px; flex:0 0 auto; border:1px solid #806b20; border-radius:7px; background:linear-gradient(90deg,rgba(130,103,22,.4),rgba(72,61,18,.2)); color:#e8d98f; display:flex; align-items:center; gap:10px; padding:0 12px; font-size:9px; }
.audio-clip span { font-size:15px; color:#f1d84e; }
.audio-clip em { margin-left:auto; color:#d8cb8b; font:8px ui-monospace,monospace; font-style:normal; }
.timeline-playhead { position:absolute; top:28px; bottom:0; left:calc(var(--track-label-width) + 12px); width:1px; background:var(--acid); pointer-events:none; z-index:8; box-shadow:0 0 8px rgba(202,255,63,.65); }
.timeline-playhead i { display:block; width:14px; height:10px; margin-left:0; background:var(--acid); clip-path:polygon(0 0,100% 0,50% 100%); transform:translateX(-50%); }
@media (max-width:900px) { .timeline-tools { flex-wrap:wrap; } .timeline-zoom { width:74px; } }
.import-intro { max-width: 700px; margin: 0 auto 26px; color: #a1ab99; line-height: 1.7; text-align: center; }
.file-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.material-item.needs-review { border-color: #ae833e; }
.material-item.needs-review > small { color: #e1b864; }
.match-dialog { width: min(900px,94vw); max-height: 88vh; overflow: auto; background: #111710; color: #e8eee3; }
.match-overview,.review-inspector { padding: 20px; border-top: 1px solid #30392d; }
.match-overview p,.review-evidence { font-size: 13px; color: #a5b49e; line-height: 1.6; }
.review-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.review-jumps button,.review-warning { color: #e6bc73; }
.review-heading { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.review-heading select { flex: 1; min-width: 200px; }
.review-texts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.review-texts > div { border: 1px solid #30392d; padding: 14px; border-radius: 8px; }
.review-texts p { font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.review-image-row { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 18px; margin: 18px 0; align-items: start; }
.review-image-row img { width: 130px; max-height: 235px; object-fit: contain; }
.review-image-row select { display: block; width: 100%; margin: 10px 0; }
.review-image-row p { font-size: 12px; color: #a5b49e; }
.match-dialog select { color: #edf5e6; background: #1b2518; border: 1px solid #44523d; padding: 9px; border-radius: 6px; }
@media(max-width:650px) { .review-texts { grid-template-columns: 1fr; } .file-grid { grid-template-columns: 1fr; } }
/* Keep the supplied white logo intact; frame its transparent margins in CSS. */
.brand-logo { display:inline-block!important; position:relative; width:56px; height:35.76px; overflow:hidden; flex:0 0 auto; }
.brand-logo img { position:absolute; width:274.17%; height:372.4%; max-width:none!important; left:-87.05%; top:-136.41%; }
.hero-logo { display:flex; justify-content:center; margin:0 0 24px; }
.hero-logo .brand-logo { width:100px; height:63.87px; }
