/* ReCap — Adobe Premiere "Text panel" look */

:root {
  --bg: #232323;
  --bg-2: #2d2d2d;
  --input-bg: #1a1a1a;
  --input-border: #444444;
  --border: #444444;
  --hairline: #3a3a3a;

  --ink: #f8fafc;
  --dim: #94a3b8;
  --dimmer: #64748b;
  --active: #ffffff;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --blue: #3b82f6;

  --bg-0: #1a1a1a;
  --bg-3: #444444;
  --highlight: #475569;

  --danger: #ef4444;
  --success: #10b981;

  --radius: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 12px;
  height: 100%;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; height: 100vh; }
main { flex: 1; overflow-y: auto; min-height: 0; }

.hidden { display: none !important; }

/* ---------- tab header ---------- */
.tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
  overflow-x: auto;
}
.tabbar::-webkit-scrollbar {
  display: none;
}
.tabs { display: flex; gap: 20px; height: 100%; position: relative; }
.tabs .thumb { display: none; }
.tabs button {
  background: none; border: none; cursor: pointer;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  height: 100%;
  padding: 0;
  position: relative;
  display: flex; align-items: center;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--active); }
.tabs button.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--active);
}
.tab-file {
  font-size: 12px; color: var(--dim);
  max-width: 160px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- transcribe progress bar ---------- */
.xbar {
  flex: none; position: relative;
  height: 3px; width: 100%;
  background: var(--hairline);
  overflow: hidden;
}
.xbar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #0070f3, #4aa3ff);
  transition: width .25s ease;
}
.xbar.indet .xbar-fill {
  width: 35%;
  transition: none;
  animation: xbar-slide 1.1s infinite ease-in-out;
}
@keyframes xbar-slide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(330%); }
}

/* ---------- pages ---------- */
.page { display: none; flex-direction: column; }
.page.active { display: flex; }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.search {
  flex: 1 1 120px;
  display: flex; align-items: center; gap: 6px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  padding: 0 8px;
  height: 30px;
  min-width: 100px;
}
.search .ic { width: 14px; height: 14px; color: var(--dimmer); flex: none; }
.search input {
  flex: 1; min-width: 0;
  background: transparent; border: none;
  color: var(--ink); font: inherit; font-size: 12px;
  height: 100%;
}
.search input:focus { outline: none; }
.search input::placeholder { color: var(--dimmer); }

.tb-ic {
  flex: none;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--dim); border-radius: var(--radius);
}
.tb-ic:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.tb-ic:disabled { opacity: .35; cursor: default; }
.tb-ic:disabled:hover { background: transparent; color: var(--dim); }
.tb-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tb-label {
  font-size: 12px; color: var(--ink);
  margin-left: 4px; white-space: nowrap;
}

/* ---------- empty CTA ---------- */
.empty-cta {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 40px 24px;
  gap: 6px;
}
.cta-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.cta-hint { font-size: 12px; color: var(--dim); line-height: 1.5; max-width: 280px; margin-bottom: 14px; }

.cta-icon {
  width: 52px; height: 52px; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(20,115,230,.12);
  border: 1px solid rgba(20,115,230,.35);
}
.cta-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cta-steps {
  list-style: none; counter-reset: step;
  margin: 4px 0 16px; padding: 0;
  text-align: left; max-width: 260px;
  display: flex; flex-direction: column; gap: 8px;
}
.cta-steps li {
  counter-increment: step;
  position: relative; padding-left: 28px;
  font-size: 12px; color: var(--dim); line-height: 1.4;
}
.cta-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg-3); color: var(--ink);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.cta-field { width: 100%; max-width: 260px; margin-bottom: 16px; text-align: left; }
.cta-field-label { display: block; font-size: 11px; color: var(--dim); margin-bottom: 6px; }
.cta-note {
  margin-top: 8px; font-size: 11px; line-height: 1.45;
  color: #E0B341;
  background: rgba(224,179,65,.10);
  border: 1px solid rgba(224,179,65,.30);
  border-radius: var(--radius);
  padding: 7px 9px;
}
.cta-note b { color: #F0C75A; font-weight: 700; }

/* ---------- transcript speaker block ---------- */
.speaker-block { padding: 14px 16px; }
.speaker-head { display: flex; gap: 12px; margin-bottom: 8px; }
.speaker-dots { color: var(--dim); font-size: 13px; letter-spacing: 1px; line-height: 1.2; }
.speaker-name { font-size: 14px; color: var(--ink); font-weight: 500; }
.speaker-time { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; margin-top: 2px; }
.speaker-text {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit; font-size: 14px; line-height: 1.6;
  padding: 6px;
  resize: none;          /* auto-grows to fit content via JS */
  overflow: hidden;
  min-height: 48px;
}
.speaker-text:hover { border-color: var(--hairline); }
.speaker-text:focus { outline: none; border-color: var(--accent); background: var(--input-bg); }
.block-actions { display: flex; justify-content: space-between; margin-top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-3); color: var(--ink);
  border: 1px solid transparent; border-radius: 14px;
  padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.sm { padding: 5px 12px; font-size: 11px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }

.btn.btn-primary { 
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%); 
  color: #fff; 
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn.btn-primary:hover:not(:disabled) { 
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%); 
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}
.btn.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.btn.btn-secondary { background: transparent; color: var(--ink); border-color: #6A6A6A; }
.btn.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,.08); }

.icon-btn {
  background: transparent; border: none; color: var(--dim);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: var(--radius);
}
.icon-btn:hover { color: var(--ink); background: rgba(255,255,255,.06); }

.link {
  background: none; border: none; color: var(--accent);
  font: inherit; font-size: 12px; cursor: pointer; padding: 0;
}
.link:hover { text-decoration: underline; }
.link.strong { font-weight: 600; }

/* ---------- caption tools (filters + replace) ---------- */
.cap-tools {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-2);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips button {
  border: 1px solid var(--border);
  background: #2A2A2A; color: var(--ink);
  font: inherit; font-size: 11px;
  border-radius: var(--radius);
  padding: 4px 8px; cursor: pointer;
}
.chips button:hover { background: #353535; }

.fr-row { display: flex; gap: 6px; }
.fr-row input {
  flex: 1; min-width: 0;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  border-radius: var(--radius);
  padding: 6px 9px; font: inherit; font-size: 12px; color: var(--ink);
}
.fr-row input:focus { outline: none; border-color: var(--accent); }

/* ---------- caption list (numbered, in/out) ---------- */
.cap-list { display: flex; flex-direction: column; }
.cap-row textarea {
  flex: 1; min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  font: inherit; font-size: 13px; line-height: 1.45;
  color: var(--ink); resize: none;
  border-radius: var(--radius);
  padding: 4px 6px;
  transition: all 0.2s ease;
}
.cap-row textarea:hover { border-color: var(--hairline); background: rgba(255,255,255,0.02); }
.cap-row textarea:focus { outline: none; border-color: var(--accent); background: var(--input-bg); box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.2); }
.cap-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.2s ease;
}
.cap-row:hover {
  background: rgba(255,255,255,0.02);
}
.cap-num {
  width: 18px; flex: none;
  font-size: 12px; color: var(--dim);
  text-align: right;
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
}
.cap-tc {
  flex: none; width: 96px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--dim);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}
.cap-del {
  flex: none; align-self: flex-start;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--dimmer); border-radius: var(--radius);
  opacity: 0; transition: opacity .15s ease, color .15s ease, background .15s ease;
}
.cap-row:hover .cap-del { opacity: 1; }
.cap-del:hover { color: var(--danger); background: rgba(226,76,76,.12); }
.cap-del svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty {
  text-align: center; color: var(--dim);
  font-size: 12px; padding: 32px 0;
}

/* ---------- page footer (update) ---------- */
.page-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--hairline);
}
.footnote { text-align: center; font-size: 11px; color: var(--dimmer); margin-top: 10px; }

/* ---------- library ---------- */
.lib-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.lib-path {
  font-size: 12px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.comp-list { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
  gap: 12px; 
  padding: 12px 16px; 
}
.comp-list.list-view {
  display: flex; flex-direction: column; gap: 8px;
}
.comp-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card, var(--bg-2));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.comp-item .thumb {
  width: calc(100% + 24px); height: 90px;
  margin: -12px -12px 10px;
  background: #111;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
  border-radius: 5px 5px 0 0;
}
.comp-item .thumb img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0.85;
  display: block;
}
.comp-item .cat-badge {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px;
}
.comp-item .info { flex: 1; }
.comp-item .name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.comp-item .meta { font-size: 11px; color: var(--dim); margin-bottom: 10px; line-height: 1.3; }
.comp-item .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.comp-item .actions button {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent; color: var(--ink);
  font: inherit; font-size: 11px;
  padding: 6px 0; cursor: pointer;
  display: flex; justify-content: center; align-items: center;
}
.comp-item .actions button:hover { background: rgba(255,255,255,.05); }
.comp-item .actions .import { flex: 1 1 100%; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.comp-item .actions .import:hover { background: var(--accent-hover); }

.comp-item .actions .icon-btn { flex: 1; height: 26px; padding: 0; color: var(--ink); }
.comp-item .actions .icon-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.comp-item .actions .delete { border-color: transparent; color: var(--danger); }
.comp-item .actions .delete:hover { background: rgba(255,0,0,0.1); color: #ff5555; }

/* List View Overrides */
.comp-list.list-view .comp-item {
  flex-direction: row; align-items: center; justify-content: flex-start;
  padding: 8px;
}
.comp-list.list-view .comp-item .thumb {
  width: 60px; height: 40px; margin: 0 12px 0 0;
  border-bottom: none; border-radius: 4px; flex: none;
}
.comp-list.list-view .comp-item .cat-badge { display: none; }
.comp-list.list-view .comp-item .name { margin-bottom: 2px; }
.comp-list.list-view .comp-item .meta { margin-bottom: 0; }
.comp-list.list-view .comp-item .actions {
  flex: none; margin-left: 12px; gap: 4px; flex-wrap: nowrap;
}
.comp-list.list-view .comp-item .actions .import { flex: 0 0 auto; min-width: 90px; }
.comp-list.list-view .comp-item .actions .icon-btn { flex: 0 0 28px; }
.comp-list.list-view .comp-item .actions button { padding: 4px 8px; }

/* View toggles */
.view-toggles .tb-ic.active { color: var(--ink); background: rgba(255,255,255,.08); }

/* ---------- status ---------- */
.statusbar {
  flex: none;
  border-top: 1px solid var(--hairline);
  padding: 0 14px;
  min-height: 0;
}
.statusbar .status:empty { display: none; }
.statusbar .status { padding: 7px 0; }
.status { font-size: 12px; color: var(--dim); }
.status.ok { color: var(--success); }
.status.err { color: var(--danger); }
.status:empty { display: none; }
#save-status { padding: 8px 16px; }

/* ---------- modals (create + settings) ---------- */
/* The modal layer scrolls (not the inner card), so tall dialogs are never
   clipped in a short, docked AE panel. margin:auto centers when there's room. */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex;
  overflow-y: auto;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-overlay { position: fixed; inset: 0; background: rgba(2, 6, 23, .7); backdrop-filter: blur(4px); }
.modal-content {
  position: relative;
  width: 100%; max-width: 360px;
  margin: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(0,0,0,.8);
  padding: 18px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-header .card-title { font-size: 14px; font-weight: 600; }
.close-btn { width: 24px; height: 24px; }
.card-title { font-size: 12px; font-weight: 600; color: var(--ink); }

/* ---------- create-captions panel (inline, accordion) ---------- */
.create-panel {
  background: var(--bg-2);
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.create-panel-title {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.create-panel-title .ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.create-panel-title span { flex: 1; }

/* flat form (all settings visible) */
.create-form { display: flex; flex-direction: column; }
.form-section {
  display: flex; flex-direction: column; gap: 16px;
  padding: 14px 16px 18px;
  border-bottom: 1px solid var(--hairline);
}
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--dim);
}
.field { display: flex; flex-direction: column; }
.field-cols { display: flex; gap: 22px; align-items: flex-start; }
.field-cols > * { flex: 1; min-width: 0; }

.create-foot { padding: 14px 16px; }

/* ---------- create-captions dialog (legacy modal bits) ---------- */
.preset-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.dropdown-fake {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px; color: var(--ink);
}
.prefs-header {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 9px 10px;
  margin-bottom: 14px;
  font-size: 13px; color: var(--ink);
}
.prefs-header .ic { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.form-group { margin-bottom: 14px; }
.adobe-label { font-size: 13px; color: var(--ink); margin-bottom: 6px; display: flex; align-items: center; }
.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: #555; color: #fff; font-size: 10px; font-weight: bold;
  margin-left: 6px; cursor: help;
}
.adobe-radio-group { display: flex; gap: 18px; }
.adobe-radio { display: flex; align-items: center; font-size: 13px; color: var(--ink); cursor: pointer; }
.adobe-radio input { display: none; }
.radio-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #777; margin-right: 7px;
  display: inline-block; position: relative;
}
.adobe-radio input:checked + .radio-dot { border-color: var(--accent); }
.adobe-radio input:checked + .radio-dot::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
}

.adobe-slider-row { display: flex; align-items: center; gap: 12px; }
.adobe-range { -webkit-appearance: none; flex: 1; height: 2px; background: #444; border-radius: 2px; outline: none; }
.adobe-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #999; background: var(--bg-2); cursor: pointer;
}
.adobe-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #999; background: var(--bg-2); cursor: pointer;
}
.adobe-number {
  width: 52px; background: var(--input-bg);
  border: 1px solid var(--input-border); color: var(--ink);
  font: inherit; font-size: 13px; padding: 5px; text-align: center;
  border-radius: var(--radius);
}
.adobe-number:focus { outline: none; border-color: var(--accent); }
.adobe-unit { font-size: 13px; color: var(--dim); }

.adobe-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin: 18px -18px -18px;            /* span the card's padding */
  padding: 14px 18px;
  border-top: 1px solid var(--hairline);
  position: sticky; bottom: -18px;     /* keep buttons reachable while scrolling */
  background: var(--bg-2);
  border-radius: 0 0 6px 6px;
}

/* ---------- settings ---------- */
.settings-group { margin-bottom: 20px; }
.settings-group:last-child { margin-bottom: 0; }
.settings-label { font-size: 12px; color: var(--ink); margin-bottom: 8px; font-weight: 600; }
.settings-hint { font-size: 11px; color: var(--dim); margin-bottom: 12px; line-height: 1.5; }
.dropdown-select {
  width: 100%;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: var(--radius); color: var(--ink);
  font: inherit; font-size: 13px; padding: 6px 8px; cursor: pointer;
}
.dropdown-select:focus { outline: none; border-color: var(--accent); }
.dropdown-select option { background: var(--bg-2); color: var(--ink); }

/* ---------- custom dropdown (replaces unreliable native <select> popups) ---------- */
.cdd { position: relative; width: 100%; }
.cdd-native {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none; left: 0; top: 0;
}
.cdd-trigger {
  width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: center;
}
.cdd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdd-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 300;
  background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
  max-height: 240px; overflow-y: auto;
  padding: 4px;
}
.cdd-option {
  padding: 7px 10px; font-size: 13px; color: var(--ink);
  cursor: pointer; border-radius: 3px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.cdd-option:hover { background: var(--highlight); }
.cdd-option.sel { background: rgba(20,115,230,.28); color: #fff; }
.setup-area {
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
}

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { display: none; width: 0; height: 0; }
::-webkit-scrollbar-thumb { display: none; }
::-webkit-scrollbar-track { display: none; }

/* Reference Proxy (Alignment) */
.ref-proxy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 54px;
  height: 54px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px;
  gap: 4px;
}
.ref-proxy button {
  background: var(--bg-3);
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  transition: all 0.1s ease;
}
.ref-proxy button:hover {
  background: var(--highlight);
  border-color: rgba(255,255,255,0.2);
}
.ref-proxy button.active {
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

/* ---------- logo header ---------- */
.logo-header {
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
}
.logo-text {
  font-size: 16px;
  font-weight: 800;
  font-style: italic;
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

/* ---------- responsive ---------- */
@media (max-width: 480px) {
  .tabs button {
    font-size: 12px;
  }
  .tabs { gap: 12px; }
  .tab-file { display: none; }
  .lib-path { flex: 1 1 100%; text-align: left; }
  #btn-save-comp { flex: 1 1 100%; }
}
@media (max-width: 380px) {
  .search { flex: 1 1 100%; order: -1; }
  .toolbar { justify-content: space-between; }
  .tb-ic { width: 28px; height: 28px; }
  .fr-row { flex-wrap: wrap; }
  .fr-row input, .fr-row button { flex: 1 1 100%; }
}
