:root {
  --bg-0: #0a0d12;
  --bg-1: #10141b;
  --bg-2: #171c25;
  --border: #232a35;
  --border-strong: #2e3644;
  --text-primary: #e8ecf1;
  --text-secondary: #a3adbb;
  --text-dim: #6b7585;
  --accent: #ffb648;
  --accent-dim: rgba(255, 182, 72, 0.15);
  --green: #4ade80;
  --blue: #60a5fa;
  --yellow: #facc15;
  --red: #ff5c5c;
  --purple: #b380ff;
  --radius: 6px;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Consolas', monospace;
  --topbar-h: 52px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  overflow: hidden;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.12s, color 0.12s;
}
.btn:hover { border-color: var(--accent-dim); }
.btn svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }
.btn-accent { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.btn-accent:hover { background: var(--accent); color: var(--bg-0); }
.btn-icon { padding: 7px; }
.btn-close { background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; line-height: 1; }

/* ===================== Login ===================== */

.login-screen {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-0);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  width: 340px; max-width: 90vw;
  padding: 32px;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  text-align: center;
}
.login-logo { width: 48px; height: 48px; margin-bottom: 12px; }
.login-box h1 { font-size: 16px; font-weight: 600; margin: 0 0 24px; }
.login-box form { text-align: left; }
.login-submit { width: 100%; margin-top: 8px; justify-content: center; }
.login-error { color: var(--red); font-size: 12px; margin: 10px 0 0; text-align: left; }

.settings-field { margin-bottom: 14px; }
.settings-field label { display: block; font-size: 11px; color: var(--text-secondary); margin-bottom: 5px; }
.settings-field input, .settings-field select, .settings-field textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-0);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-primary);
}
.settings-field input:focus, .settings-field select:focus, .settings-field textarea:focus { outline: none; border-color: var(--accent-dim); }

/* ===================== App shell ===================== */

.app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr 6px var(--browser-h, 280px);
  height: 100vh;
  visibility: hidden;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 24px; height: 24px; }
.brand-title { font-weight: 600; font-size: 14px; letter-spacing: 0.01em; }
.brand-version { font-size: 10px; color: var(--text-dim); background: var(--bg-2); padding: 2px 6px; border-radius: 4px; }
.toolbar { display: flex; align-items: center; gap: 8px; }
.current-user { font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); cursor: pointer; padding: 5px 8px; border-radius: var(--radius); }
.current-user:hover { background: var(--bg-2); color: var(--text-primary); }

.hamburger-wrap { position: relative; }
.hamburger-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: var(--radius);
  min-width: 200px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: flex; flex-direction: column; gap: 2px;
}
.hamburger-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; background: none; border: none; border-radius: 6px;
  color: var(--text-secondary); font-size: 13px; text-align: left; cursor: pointer;
}
.hamburger-item svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.hamburger-item:hover { background: var(--bg-2); color: var(--text-primary); }
.hamburger-divider { height: 1px; background: var(--border); margin: 4px 2px; }

/* Left panel: project section, clip info, keyboard shortcuts help */
.clipinfo-scroll { overflow-y: auto; height: 100%; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.panel-divider { height: 1px; background: var(--border); margin: 0 -14px; }

.project-section { display: flex; flex-direction: column; gap: 8px; }
.current-project {
  font-size: 15px; font-weight: 600; font-family: var(--font-mono);
  color: var(--accent); cursor: pointer; word-break: break-word;
}
.current-project:hover { text-decoration: underline; }
.current-project-id {
  font-size: 10px; font-family: var(--font-mono); color: var(--text-dim); cursor: pointer;
  word-break: break-all;
}
.current-project-id:hover { color: var(--text-secondary); }
.project-detail-grid { margin-top: 4px; }
.project-detail-table { border-collapse: collapse; font-size: 11px; color: var(--text-secondary); }
.project-detail-table td { padding: 2px 0; vertical-align: top; }
.project-detail-table td.label { color: var(--text-dim); padding-right: 10px; white-space: nowrap; }
.btn-icon-text { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.btn-icon-text svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }

.shortcuts-help { }
.shortcuts-help-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim);
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px;
  user-select: none;
}
.shortcuts-help-title::-webkit-details-marker { display: none; }
.shortcuts-help-title::before {
  content: '▸'; font-size: 9px; color: var(--text-dim); transition: transform 0.12s;
}
.shortcuts-help[open] .shortcuts-help-title::before { transform: rotate(90deg); }
.shortcuts-help-title:hover { color: var(--text-secondary); }
.shortcuts-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; font-size: 11px;
  margin-top: 10px;
}
.shortcuts-grid span:nth-child(odd) {
  font-family: var(--font-mono); color: var(--accent); background: var(--bg-2);
  padding: 1px 6px; border-radius: 3px; justify-self: start;
}
.shortcuts-grid span:nth-child(even) { color: var(--text-secondary); align-self: center; }

.rating-row { padding: 10px 14px; border-bottom: 1px solid var(--border); }

#global-loading-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity 0.2s; box-shadow: 0 0 8px var(--accent);
}
#global-loading-bar.active { opacity: 1; animation: loading-bar-sweep 1.1s ease-in-out infinite; }
@keyframes loading-bar-sweep {
  0% { width: 0%; margin-left: 0%; }
  50% { width: 55%; margin-left: 25%; }
  100% { width: 0%; margin-left: 100%; }
}

/* ===================== Workspace (clip info + viewer + markers) ===================== */

.workspace { display: grid; grid-template-columns: 280px 1fr 320px; min-height: 0; }

.panel-clipinfo { display: flex; flex-direction: column; background: var(--bg-1); border-right: 1px solid var(--border); min-height: 0; overflow: hidden; }
.clipinfo-empty { text-align: center; color: var(--text-dim); font-size: 12px; padding: 8px 0; }
.clipinfo-body { display: flex; flex-direction: column; gap: 12px; }
.clipinfo-name {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-primary);
  word-break: break-word; cursor: pointer; line-height: 1.4;
}
.clipinfo-name:hover { color: var(--accent); }
.clipinfo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.clipinfo-stat { display: flex; flex-direction: column; gap: 2px; }
.clipinfo-stat-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.03em; }
.clipinfo-stat-value { font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); }
.clipinfo-actions { display: flex; gap: 8px; }
.clipinfo-actions .btn { flex: 1; justify-content: center; }
.clipinfo-fullwidth { width: 100%; justify-content: center; }
.clipinfo-nav-row { display: flex; gap: 8px; }
.clipinfo-nav-row .btn { flex: 1; justify-content: center; font-size: 11px; }
.clipinfo-nav-row .btn svg { fill: currentColor; }

.panel-viewer { display: flex; flex-direction: column; background: var(--bg-0); min-height: 0; }
.viewer-frame { flex: 1; position: relative; min-height: 0; background: #05070a; }
.viewer-empty, .no-proxy-notice {
  position: absolute; inset: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-dim); gap: 8px; text-align: center;
}
.no-proxy-notice { color: var(--accent); }
.no-proxy-notice svg { fill: var(--accent); opacity: 0.8; margin-bottom: 6px; }
.no-proxy-notice p { margin: 2px 0; color: var(--text-secondary); }
.corner { position: absolute; width: 20px; height: 20px; border: 2px solid var(--border-strong); }
.corner-tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.corner-tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.corner-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.corner-br { bottom: 0; right: 0; border-left: none; border-top: none; }

.video-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; }
.video-stage { flex: 1; position: relative; min-height: 0; }
.video-js { width: 100%; height: 100%; }
.video-js .vjs-tech { object-fit: contain; }
#image-view { width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; }
/* Matches Video.js's actual control-bar bounds: play/pause etc. occupy
   the left ~90px, volume/fullscreen/etc. the right ~134px, so the
   scrubber itself doesn't span the full width - marker dots need the
   same margins to land on the real timeline instead of the whole bar. */
.marker-track { position: relative; height: 0; margin-left: 90px; margin-right: 134px; }
.marker-dot {
  position: absolute; top: -8px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--bg-0); cursor: grab; z-index: 20;
}
.marker-dot.color-green { background: var(--green); }
.marker-dot.color-blue { background: var(--blue); }
.marker-dot.color-yellow { background: var(--yellow); }
.marker-dot.color-red { background: var(--red); }

.rating { display: flex; gap: 2px; }
.rating .star { cursor: pointer; color: var(--text-dim); font-size: 18px; }
.rating .star.filled { color: var(--accent); }
#btn-trash-clip.active { color: var(--red); border-color: var(--red); }

/* ===================== Markers & tags panel ===================== */

.panel-markers { display: flex; flex-direction: column; background: var(--bg-1); border-left: 1px solid var(--border); min-height: 0; }
.panel-header { padding: 10px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); border-bottom: 1px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; }
.panel-header .btn-icon { display: inline-flex; align-items: center; justify-content: center; }

.tags-section { padding: 10px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tags-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tags-chips:empty { margin-bottom: 0; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-dim); color: var(--accent); border-radius: 12px; padding: 3px 6px 3px 10px; font-size: 11px; font-family: var(--font-mono); }
.tag-chip-global { background: rgba(179,128,255,0.15); color: var(--purple); }
.tag-chip-global .tag-chip-remove { color: var(--purple); }
.tag-chip-remove { background: none; border: none; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; padding: 0 2px; opacity: 0.7; }
.tag-chip-remove:hover { opacity: 1; }
.tags-input-row input { width: 100%; padding: 6px 10px; background: var(--bg-0); border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text-primary); font-size: 12px; }
.tags-input-row input:focus { outline: none; border-color: var(--accent-dim); }
.tags-quick { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tags-quick:empty { margin-top: 0; }
.tag-quick-btn { font-size: 11px; padding: 3px 9px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text-secondary); cursor: pointer; }
.tag-quick-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.tag-quick-btn-global:hover { border-color: var(--purple); color: var(--purple); }

.marker-list { flex: 1; overflow-y: auto; padding: 8px; }
.marker-list-empty { padding: 24px 12px; text-align: center; color: var(--text-dim); font-size: 12px; }
.marker-item { padding: 10px; border-radius: var(--radius); margin-bottom: 6px; background: var(--bg-2); cursor: pointer; border-left: 3px solid transparent; }
.marker-item.color-green { border-left-color: var(--green); }
.marker-item.color-blue { border-left-color: var(--blue); }
.marker-item.color-yellow { border-left-color: var(--yellow); }
.marker-item.color-red { border-left-color: var(--red); }
.marker-time-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.marker-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.marker-author { font-size: 10px; color: var(--text-dim); font-family: var(--font-mono); margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marker-move { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 2px; }
.marker-move svg { fill: currentColor; }
.marker-move:hover { color: var(--accent); }
.marker-comment { width: 100%; background: transparent; border: none; color: var(--text-primary); font-size: 12px; resize: none; padding: 0; margin-bottom: 4px; }
.marker-comment:focus { outline: none; color: var(--text-primary); }
.marker-delete { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 2px; flex-shrink: 0; margin-left: auto; }
.marker-delete svg { fill: currentColor; }
.marker-delete:hover { color: var(--red); }

/* ===================== Browser row (tree + filelist) ===================== */

.browser-resize-handle { cursor: row-resize; background: var(--bg-1); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.browser-row { display: grid; grid-template-columns: 280px 1fr; min-height: 0; }

.panel-tree { display: flex; flex-direction: column; background: var(--bg-1); border-right: 1px solid var(--border); min-height: 0; }
.tree-scroll { flex: 1; overflow-y: auto; padding: 6px; }
.tree-row { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: var(--radius); cursor: pointer; font-size: 12px; }
.tree-row:hover { background: var(--bg-2); }
.tree-row.active { background: var(--accent-dim); color: var(--accent); }
.tree-caret { width: 12px; height: 12px; flex-shrink: 0; color: var(--text-dim); transition: transform 0.1s; }
.tree-caret.expanded { transform: rotate(90deg); }
.tree-caret.leaf { visibility: hidden; }
.tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tree-video-count { flex-shrink: 0; font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); background: var(--bg-2); border-radius: 3px; padding: 1px 5px; margin-left: 6px; }
.tree-unplayable-count { flex-shrink: 0; font-family: var(--font-mono); font-size: 10px; color: var(--red); background: rgba(255,92,92,0.15); border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
.tree-children { margin-left: 16px; }

.no-project-state { padding: 20px 16px; text-align: center; }
.no-project-state p { color: var(--text-secondary); font-size: 13px; margin: 0 0 8px; }
.no-project-state .btn { margin-top: 10px; }

.panel-filelist { display: flex; flex-direction: row; background: var(--bg-1); min-height: 0; }

.filelist { flex: 1; overflow-y: auto; padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; align-content: start; }
.filelist-empty-filtered { grid-column: 1 / -1; text-align: center; padding: 30px; color: var(--text-dim); font-size: 12px; }

.file-tile { position: relative; cursor: pointer; }
.file-tile.trashed .tile-thumb { opacity: 0.4; }
.file-tile.trashed .tile-name { text-decoration: line-through; }
.file-tile.active .tile-thumb { outline: 2px solid var(--accent); }
.file-tile.no-proxy .tile-thumb { outline: 1px solid rgba(255,182,72,0.4); }

.tile-thumb { position: relative; aspect-ratio: 16/9; background: var(--bg-2); border-radius: var(--radius); overflow: hidden; }
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; }

.badge { font-size: 10px; font-weight: 600; padding: 3px 6px; border-radius: 3px; background: rgba(0,0,0,0.65); color: var(--text-secondary); letter-spacing: 0.03em; display: inline-flex; align-items: center; gap: 3px; }
.badge svg { fill: currentColor; }
.proxy-badge { color: var(--green); }
.raw-badge { color: var(--purple); }
.ext-badge { color: var(--green); }
.no-proxy-badge { color: var(--accent); background: rgba(255,182,72,0.2); }
.proxy-missing-badge { color: var(--red); background: rgba(255,92,92,0.2); }
.media-offline-badge { color: var(--text-secondary); background: rgba(255,92,92,0.2); }
.marker-flag-badge { color: var(--yellow); }
.hidden-badge { display: none; }

.tile-meta { position: absolute; bottom: 4px; right: 4px; font-size: 9px; color: var(--text-secondary); background: rgba(0,0,0,0.65); padding: 2px 5px; border-radius: 3px; font-family: var(--font-mono); }

/* Status (PROXY/NO PROXY/...) and extension badges sit at bottom-left,
   sized to match the duration/size text they're symmetrically opposite
   to at bottom-right (tile-meta) - deliberately smaller than the
   marker-count badge that stays up top. */
.tile-badges-bottomleft { position: absolute; bottom: 4px; left: 4px; display: flex; gap: 4px; max-width: calc(100% - 8px); }
.tile-badges-bottomleft .badge { font-size: 9px; padding: 2px 5px; }

.tile-trash-icon {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.65); border: none; border-radius: 4px;
  color: var(--text-secondary); cursor: pointer; opacity: 0; transition: opacity 0.12s;
}
.tile-trash-icon svg { fill: currentColor; }
.file-tile:hover .tile-trash-icon { opacity: 1; }

.tile-star-row { display: flex; gap: 1px; margin-top: 4px; justify-content: center; }
/* Stacked vertically (one tag per line) rather than a horizontal row -
   each line gets the thumbnail's full width instead of fighting
   several other chips for horizontal space, so names need far less
   truncation. */
.tile-tags-row { position: absolute; top: 22px; left: 4px; right: 4px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.tile-tag-chip {
  font-size: 10px; font-weight: 600; color: var(--text-secondary); background: rgba(0,0,0,0.65);
  border-radius: 3px; padding: 3px 6px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%; letter-spacing: 0.03em;
}
.tile-tags-more { font-size: 10px; color: var(--text-dim); background: rgba(0,0,0,0.65); border-radius: 3px; padding: 3px 6px; align-self: flex-start; }
.tile-star-row .star { cursor: pointer; color: var(--text-dim); font-size: 11px; }
.tile-star-row .star.filled { color: var(--accent); }

.tile-name-row { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.tile-name { flex: 1; min-width: 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-trash { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 2px; flex-shrink: 0; }
.tile-trash.active { color: var(--red); }
.tile-trash:hover { color: var(--red); }

.filter-sidebar { width: 320px; flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border-left: 1px solid var(--border); overflow-y: auto; align-content: start; }
.filter-search { grid-column: 1 / -1; width: 100%; padding: 7px 10px; background: var(--bg-0); border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text-primary); font-size: 12px; }
.filter-search:focus { outline: none; border-color: var(--accent-dim); }
.filter-select { width: 100%; padding: 7px 8px; background: var(--bg-0); border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text-primary); font-size: 12px; }
.filter-toggle { font-size: 11px; padding: 6px 9px; width: 100%; }
.filter-toggle.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.filter-colors { grid-column: 1 / -1; display: flex; gap: 6px; }
.filter-color-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); cursor: pointer; padding: 0; background: transparent; color: var(--text-dim); font-size: 10px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.filter-color-dot.color-green { background: var(--green); border-color: var(--green); }
.filter-color-dot.color-blue { background: var(--blue); border-color: var(--blue); }
.filter-color-dot.color-yellow { background: var(--yellow); border-color: var(--yellow); }
.filter-color-dot.color-red { background: var(--red); border-color: var(--red); }
.filter-color-dot.active { box-shadow: 0 0 0 2px var(--accent); }
.filter-clear { grid-column: 1 / -1; font-size: 12px; padding: 6px 10px; width: 100%; }

/* ===================== Modals ===================== */

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: 10px; max-height: 85vh; display: flex; flex-direction: column; }
.modal-small { width: 380px; max-width: 92vw; }
.modal-large { width: 640px; max-width: 92vw; }
.modal-help { width: 75vw; max-width: 1100px; height: 75vh; }
.help-body { display: flex; gap: 20px; flex: 1; min-height: 0; }
.help-nav { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; width: 160px; border-right: 1px solid var(--border); padding-right: 12px; overflow-y: auto; }
.help-nav-link { color: var(--text-secondary); font-size: 12px; padding: 7px 8px; border-radius: 6px; text-decoration: none; }
.help-nav-link:hover { background: var(--bg-2); color: var(--text-primary); }
.help-content { flex: 1; overflow-y: auto; padding-right: 6px; }
.help-content section { margin-bottom: 22px; }
.help-content h3 { font-size: 14px; margin: 0 0 8px; color: var(--text-primary); }
.help-content p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 8px; }
.changelog-entry { font-size: 12px; color: var(--text-secondary); line-height: 1.6; padding: 8px 0; border-bottom: 1px solid var(--border); }
.changelog-entry strong { color: var(--accent); font-family: var(--font-mono); margin-right: 8px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600; gap: 10px; }
.modal-header span:first-child { margin-right: auto; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-help .modal-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-hint { color: var(--text-secondary); font-size: 12px; margin: 0 0 14px; line-height: 1.5; }
.modal-hint-small { color: var(--text-dim); font-size: 11px; }
.mediainfo-section { margin-bottom: 20px; }
.mediainfo-section h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); margin: 0 0 10px; font-weight: 600; }
.mediainfo-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.mediainfo-row span:first-child { color: var(--text-secondary); }
.mediainfo-row span:last-child { font-family: var(--font-mono); text-align: right; }
#mediainfo-raw { background: var(--bg-0); padding: 12px; border-radius: var(--radius); font-size: 11px; overflow-x: auto; white-space: pre-wrap; }

.jobs-list { max-height: 260px; overflow-y: auto; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.jobs-list-empty { padding: 20px; text-align: center; color: var(--text-dim); font-size: 12px; }
.job-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
.job-row:last-child { border-bottom: none; }
.job-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-status { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 600; text-transform: uppercase; }
.status-done { background: rgba(74,222,128,0.15); color: var(--green); }
.status-error { background: rgba(255,92,92,0.15); color: var(--red); }
.status-queued, .status-running { background: rgba(255,182,72,0.15); color: var(--accent); }
.jobs-toolbar { display: flex; gap: 8px; }

.project-current-btn { font-size: 11px; color: var(--accent); border-color: var(--accent-dim); cursor: default; }
.project-row { gap: 10px; }
.project-row-info { flex: 1; min-width: 0; }
.project-row-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row-meta { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.project-delete-btn { color: var(--red); border-color: rgba(255,92,92,0.3); font-size: 11px; }
.project-delete-btn:hover { background: rgba(255,92,92,0.12); border-color: var(--red); }

#log-content { background: var(--bg-0); padding: 12px; border-radius: var(--radius); font-size: 11px; white-space: pre-wrap; max-height: 60vh; overflow-y: auto; }

.marker-color-picker { display: flex; gap: 10px; margin: 4px 0 16px; }
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.color-dot.color-green { background: var(--green); }
.color-dot.color-blue { background: var(--blue); }
.color-dot.color-yellow { background: var(--yellow); }
.color-dot.color-red { background: var(--red); }
.color-dot.active { border-color: var(--text-primary); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bg-2); border: 1px solid var(--border-strong); padding: 10px 18px; border-radius: var(--radius); font-size: 12px; z-index: 300; max-width: 500px; text-align: center; }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.success { border-color: var(--green); color: var(--green); }

.flatpickr-calendar { background: var(--bg-1) !important; border: 1px solid var(--border-strong) !important; box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important; }
.flatpickr-months, .flatpickr-weekdays { background: var(--bg-1) !important; }
.flatpickr-current-month .flatpickr-monthDropdown-months, .flatpickr-current-month input.cur-year { color: var(--text-primary) !important; }
.flatpickr-day { color: var(--text-primary) !important; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: var(--text-dim) !important; }
.flatpickr-day.selected, .flatpickr-day.selected:hover { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--bg-0) !important; }
.flatpickr-day:hover { background: var(--bg-2) !important; }
span.flatpickr-weekday { color: var(--text-dim) !important; }
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month { fill: var(--text-secondary) !important; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .panel-markers { display: none; }
  .panel-clipinfo { display: none; }
  .browser-row { grid-template-columns: 1fr; }
  .panel-tree { display: none; }
}
