/* Lokalize Custom — hand-written design system.
   High-end look comes from restraint: one accent, generous spacing, soft depth. */
:root {
  --bg: #0b1020;
  --bg-soft: #10162b;
  --panel: #141b32;
  --panel-2: #1a2340;
  --line: #26304f;
  --line-soft: #1e2842;
  --ink: #eef2ff;
  --muted: #9aa6c4;
  --faint: #6b7699;
  --brand: #6366f1;
  --brand-2: #818cf8;
  --brand-ink: #c7d2fe;
  --green: #22c55e;
  --amber: #f59e0b;
  --danger: #f43f5e;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(129, 140, 248, 0.12), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* Subtle, transparent scrollbars everywhere (no white/highlighted bar at pane edges) */
* { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.28) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28); border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.45); }
::-webkit-scrollbar-corner { background: transparent; }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 20px; height: 60px;
  padding: 0 22px; border-bottom: 1px solid var(--line-soft);
  background: rgba(11, 16, 32, 0.7); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; }
.logo .dot { width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 0 18px rgba(99,102,241,.7); }
.logo small { color: var(--faint); font-weight: 500; }
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
  font-size: 0.82rem; background: var(--panel);
}
.pill .live { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.project-select {
  margin-left: 6px; background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; max-width: 240px;
}
.project-select:focus { outline: none; border-color: var(--brand); }
.pill.connected .live { background: var(--green); box-shadow: 0 0 10px var(--green); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 0.88rem; color: var(--ink);
  border: 1px solid var(--line); background: var(--panel-2); border-radius: var(--radius-sm);
  padding: 8px 14px; transition: transform 0.06s, border-color 0.2s, background 0.2s;
  white-space: nowrap; flex: none;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; box-shadow: 0 8px 24px rgba(99,102,241,.35); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-danger { color: #fecdd3; border-color: rgba(244,63,94,.4); }
.btn-danger:hover { border-color: var(--danger); background: rgba(244,63,94,.12); }

/* Landing */
.landing { max-width: 900px; margin: 0 auto; padding: 80px 24px; }
.landing h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; margin: 0 0 14px; }
.landing p.lead { color: var(--muted); font-size: 1.15rem; max-width: 620px; }
.landing .actions { display: flex; gap: 12px; margin-top: 28px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 56px; }
.feature { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 22px; background: var(--panel); }
.feature h3 { margin: 0 0 6px; font-size: 1rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Editor layout — flexbox so we can swap sides and collapse a pane */
.editor { display: flex; height: calc(100vh - 60px); }
.pane { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; position: relative; }
.pane.preview { border-right: 1px solid var(--line-soft); background: var(--bg-soft); }
.editor.swapped { flex-direction: row-reverse; }
.editor.swapped .pane.preview { border-right: none; border-left: 1px solid var(--line-soft); }

/* Collapsed pane -> narrow rail with a vertical expand button */
.pane .rail {
  display: none; flex: 1; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel); color: var(--muted); border: none; cursor: pointer;
  writing-mode: vertical-rl; font: inherit; font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.pane .rail:hover { color: var(--ink); background: var(--panel-2); }
.editor.collapse-preview #pane-preview,
.editor.collapse-table #pane-table { flex: 0 0 46px; }
.editor.collapse-preview #pane-preview > :not(.rail),
.editor.collapse-table #pane-table > :not(.rail) { display: none; }
.editor.collapse-preview #pane-preview .rail,
.editor.collapse-table #pane-table .rail { display: flex; }

.icon-btn {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 0.9rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--brand); color: var(--ink); }
.count { font-size: 0.78rem; color: var(--faint); }
.pane-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft); background: rgba(20, 27, 50, 0.5);
}
.pane-head h2 { font-size: 0.92rem; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.pane-head .spacer { flex: 1; }

/* Preview iframe */
.frame-toolbar { display: flex; gap: 7px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); flex-wrap: nowrap; overflow: hidden; }
.frame-toolbar > strong { white-space: nowrap; flex: none; }
.frame-toolbar .btn-sm { padding: 5px 9px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.seg button { background: transparent; color: var(--muted); border: none; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 0.82rem; white-space: nowrap; flex: 0 0 auto; }

/* Language bar: scrollable when many languages, with a thin transparent scrollbar */
#locale-seg {
  max-width: 190px; overflow-x: auto; overflow-y: hidden; flex: 0 1 auto;
  scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}
#locale-seg::-webkit-scrollbar { height: 5px; }
#locale-seg::-webkit-scrollbar-track { background: transparent; }
#locale-seg::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 6px; }
#locale-seg:hover::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.6); }
.seg button.active { background: var(--brand); color: #fff; }

/* Page picker combobox */
.combo { position: relative; width: 168px; flex: none; }
.combo input {
  width: 100%; padding: 7px 28px 7px 12px; font: inherit; font-size: 0.85rem;
  color: var(--ink); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px;
}
.combo input:focus { outline: none; border-color: var(--brand); }
.combo-arrow {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.8rem;
  width: 22px; height: 24px;
}
.combo-list {
  position: fixed; max-height: 260px; overflow-y: auto; margin: 0; padding: 4px;
  list-style: none; z-index: 100; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); display: none;
  /* fixed + JS-positioned so the toolbar's overflow:hidden can't clip it */
}
.combo.open .combo-list { display: block; }
.combo-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 0.85rem;
}
.combo-list li:hover, .combo-list li.active { background: rgba(99, 102, 241, 0.16); }
.combo-list li.hidden { display: none; }
.combo-list li.nomatch { color: var(--faint); cursor: default; }
.combo-list li.nomatch:hover { background: transparent; }
.combo-path { color: var(--faint); font-size: 0.74rem; font-family: ui-monospace, Menlo, monospace; }
.auth-banner {
  display: none; align-items: center; gap: 12px; padding: 10px 16px;
  background: rgba(245, 158, 11, 0.14); border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a; font-size: 0.82rem; line-height: 1.4;
}
.auth-banner.show { display: flex; }
.frame-hint {
  display: none; align-items: center; gap: 10px; padding: 9px 14px;
  background: rgba(99, 102, 241, 0.12); border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--brand-ink); font-size: 0.8rem; line-height: 1.35; flex-wrap: wrap;
}
.frame-hint span { flex: 1 1 240px; min-width: 0; }
.frame-hint code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; font-size: 0.74rem; }
.frame-hint .btn, .frame-hint .link-btn { flex: none; white-space: nowrap; }
.frame-hint .link-btn { color: var(--brand-ink); }
.auth-banner span { flex: 1; }
.auth-banner .link-btn { color: #fde68a; }
.frame-host { flex: 1; padding: 16px; overflow: hidden; }

.frame-host iframe {
  width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; box-shadow: var(--shadow);
}

/* Preview mode visibility (URL vs Figma) */
.pane.preview.figma .url-only { display: none !important; }
.pane.preview:not(.figma) .figma-only { display: none !important; }
.figma-select {
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 0.82rem; max-width: 200px; cursor: pointer;
}
.figma-select:focus { outline: none; border-color: var(--brand); }
.figma-stage { flex: 1; overflow: auto; padding: 16px; background: var(--bg-soft); position: relative; }
.figma-empty { color: var(--faint); font-size: 0.9rem; text-align: center; padding: 48px 16px; line-height: 1.6; }
.figma-canvas { position: relative; display: inline-block; box-shadow: var(--shadow); border-radius: 8px; }
.figma-canvas img { display: block; width: 100%; height: auto; border-radius: 8px; }
.figma-overlay { position: absolute; inset: 0; }
.figma-hotspot {
  position: absolute; border: 1px solid transparent; border-radius: 3px; cursor: pointer;
  background: rgba(99, 102, 241, 0.06);
}
.figma-hotspot:hover { background: rgba(99, 102, 241, 0.18); border-color: var(--brand); }
.figma-hotspot.matched { border-color: rgba(34, 197, 94, 0.5); }
.figma-hotspot.selected { background: rgba(99, 102, 241, 0.28); border-color: var(--brand); }

/* Table pane */
.table-scroll { flex: 1; overflow: auto; }
table.grid-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.grid-table thead th {
  position: sticky; top: 0; z-index: 2; text-align: left; padding: 11px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); color: var(--muted);
  font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.grid-table thead th { overflow: hidden; text-overflow: ellipsis; }
/* Column resize handle */
.col-resizer {
  position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize;
  z-index: 3; user-select: none;
}
.col-resizer::after {
  content: ""; position: absolute; right: 2px; top: 20%; height: 60%; width: 2px;
  background: transparent; border-radius: 2px;
}
.col-resizer:hover::after, body.resizing .col-resizer::after { background: var(--brand); }
body.resizing { cursor: col-resize; user-select: none; }
.grid-table tbody td { padding: 4px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.grid-table tbody tr { cursor: pointer; }
.grid-table tbody tr:hover { background: rgba(99,102,241,.05); }
.grid-table tr.selected { background: rgba(99,102,241,.12); }
/* Light-yellow 1s flash when a row is selected from the preview */
@keyframes rowFlash { 0% { background: rgba(250, 204, 21, 0.55); } 100% { background: transparent; } }
.grid-table tr.flash-row > td { animation: rowFlash 1s ease-out; }
/* Language column header + controls */
.col-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.col-name { white-space: nowrap; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 0.82rem; }
.col-loc { color: var(--faint); }
.col-badge {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 6px;
  border-radius: 999px; background: rgba(99, 102, 241, 0.2); color: var(--brand-ink); margin-left: 4px;
}
.col-actions { display: inline-flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.grid-table thead th:hover .col-actions { opacity: 1; }
.col-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
  width: 22px; height: 22px; border-radius: 6px; font-size: 0.72rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.col-btn:hover { border-color: var(--line); color: var(--ink); background: var(--panel-2); }
.col-btn.danger:hover { border-color: var(--danger); color: #fecdd3; }

.key-cell { padding: 8px 10px !important; }
.key-ns { font-size: 0.66rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; margin-left: auto; }
/* Description is the primary field (user's tracking name): bigger, on top. */
.desc-input {
  width: 100%; font-size: 0.9rem; font-weight: 500; color: var(--ink); background: transparent;
  border: 1px solid transparent; border-radius: 7px; padding: 6px 8px;
}
.desc-input::placeholder { color: var(--faint); font-weight: 400; }
.desc-input:hover { border-color: var(--line); }
.desc-input:focus { outline: none; border-color: var(--brand); background: var(--bg-soft); }
.desc-input.saving { border-color: var(--amber); }
/* Key identifier is secondary: smaller, monospace, beneath the description. */
.key-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.key-input {
  flex: 1; min-width: 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.7rem;
  color: var(--faint); background: transparent; border: 1px solid transparent;
  border-radius: 5px; padding: 3px 6px;
}
.key-input:hover { border-color: var(--line-soft); color: var(--brand-ink); }
.key-input:focus { outline: none; border-color: var(--brand); background: var(--bg-soft); color: var(--brand-ink); }
.key-input.saving { border-color: var(--amber); }

/* Editable cell */
.cell { position: relative; }
.cell textarea {
  width: 100%; min-height: 40px; resize: vertical; font: inherit; font-size: 0.88rem;
  color: var(--ink); background: var(--panel-2); border: 1px solid transparent;
  border-radius: 8px; padding: 8px 10px; line-height: 1.4; transition: border-color 0.15s, background 0.15s;
}
.cell textarea:hover { border-color: var(--line); }
.cell textarea:focus { outline: none; border-color: var(--brand); background: var(--bg-soft); }
.cell.saving textarea { border-color: var(--amber); }
.cell.saved textarea { border-color: var(--green); }
.cell-actions { display: flex; gap: 6px; margin-top: 4px; align-items: center; }
.cell-actions .hint { font-size: 0.72rem; color: var(--faint); }
.link-btn { background: none; border: none; color: var(--brand-2); cursor: pointer; font: inherit; font-size: 0.76rem; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* History drawer */
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 420px; max-width: 92vw;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1); z-index: 40;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer.wide { width: 560px; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 0.95rem; }
.drawer-head .key-name { font-size: 0.78rem; }
.drawer-body { flex: 1; overflow: auto; padding: 12px 16px; }
.rev {
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
  background: var(--panel-2);
}
.rev.current { border-color: var(--brand); }
.rev-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rev-no { font-weight: 700; font-size: 0.8rem; }
.rev-badge { font-size: 0.68rem; padding: 2px 7px; border-radius: 999px; background: rgba(99,102,241,.18); color: var(--brand-ink); }
.rev-meta { color: var(--faint); font-size: 0.74rem; margin-left: auto; }
.rev-value { font-size: 0.86rem; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.rev-note { font-size: 0.72rem; color: var(--amber); margin-top: 6px; }
.rev-actions { display: flex; gap: 8px; margin-top: 10px; }
.backdrop { position: fixed; inset: 0; background: rgba(2, 6, 20, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 35; }
.backdrop.show { opacity: 1; pointer-events: auto; }

.empty { color: var(--faint); font-size: 0.85rem; padding: 20px; text-align: center; }

/* Toast */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 0.85rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Add-language modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(2, 6, 20, 0.6); z-index: 70;
  display: none; align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 360px; max-width: 92vw; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 6px; font-size: 1.05rem; }
.modal label { display: block; font-size: 0.78rem; color: var(--muted); margin: 14px 0 6px; }
.modal input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-2); color: var(--ink); font: inherit;
}
.modal input:focus { outline: none; border-color: var(--brand); }
.modal .err { color: var(--danger); font-size: 0.8rem; min-height: 1.1em; margin-top: 10px; }
.modal .err.progress { color: var(--amber); } /* in-progress status is amber, not red */
.btn:disabled { opacity: 0.65; cursor: default; }
.spinner {
  display: inline-block; width: 12px; height: 12px; vertical-align: -1px;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%;
  animation: lok-spin 0.7s linear infinite;
}
@keyframes lok-spin { to { transform: rotate(360deg); } }
.modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-note { color: var(--muted); font-size: 0.82rem; margin: 0 0 6px; line-height: 1.5; }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.modal.modal-lg { width: 780px; max-width: 94vw; }
.modal.modal-source { width: 520px; max-width: 92vw; }
.snapshot-scroll { max-height: 60vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: 10px; }
.snapshot-scroll table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.snapshot-scroll th { position: sticky; top: 0; background: var(--panel); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.snapshot-scroll td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.snapshot-scroll td.k { white-space: nowrap; }
.snap-desc { font-size: 0.82rem; font-weight: 500; color: var(--ink); }
.snap-key { font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; color: var(--faint); margin-top: 2px; }

/* Push / PR history list */
.commit {
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  background: var(--panel-2);
}
.commit-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.commit-no { font-weight: 700; font-size: 0.86rem; }
.commit-msg { font-size: 0.9rem; margin: 4px 0 6px; word-break: break-word; }
.commit-meta { color: var(--faint); font-size: 0.75rem; }
.commit-actions { display: flex; gap: 8px; margin-top: 10px; }
.badge {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px;
  border-radius: 999px; margin-left: auto;
}
.badge.local { background: rgba(148, 163, 184, 0.2); color: var(--muted); }
.badge.pushed { background: rgba(34, 197, 94, 0.18); color: #86efac; }
a.badge.pushed:hover { text-decoration: underline; }

/* GitHub connect */
.gh-label { display: block; font-size: 0.78rem; color: var(--muted); margin: 14px 0 6px; }
.gh-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--ink); font: inherit; }
.gh-input:focus { outline: none; border-color: var(--brand); }
.gh-steps { font-size: 0.82rem; color: var(--muted); line-height: 1.6; margin: 6px 0 4px; padding-left: 18px; }
.gh-steps code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; font-size: 0.78rem; }
.repo-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: 10px; margin-top: 8px; }
.repo-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.repo-item:last-child { border-bottom: none; }
.repo-item .repo-meta { min-width: 0; flex: 1; }
.repo-item .repo-name { font-weight: 600; font-size: 0.86rem; }
.repo-item .repo-name .lock { color: var(--faint); font-size: 0.72rem; margin-left: 6px; }
.repo-item .repo-desc { color: var(--muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.gh-connected { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin: 8px 0; }
.dot-ok { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.src-local { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; }
.src-local code { flex: 1; font-size: 0.8rem; color: var(--brand-ink); word-break: break-all; }
#source-btn.active { border-color: var(--brand); color: var(--brand-ink); }
#edit-toggle.active { border-color: var(--brand); color: var(--brand-ink); background: rgba(99,102,241,.12); }

/* ---- Sign-in page ---- */
.login-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; }
.login-card h1 { margin: 0 0 4px; font-size: 22px; }
.login-card .lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.login-card label { font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.login-card input { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--ink); font: inherit; }
.login-card input:focus { outline: none; border-color: var(--brand); }
.login-card .btn { margin-top: 20px; justify-content: center; }
.login-error { background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.4); color: #fecdd3; border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; }
