/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg: #0b0b10;
  --surface: #111118;
  --surface2: #16161f;
  --border: #1f1f2e;
  --border2: #2a2a3e;
  --accent: #7fff6a;
  --accent2: #6af0ff;
  --danger: #ff4f4f;
  --warn: #ffcc4a;
  --text: #e2e2ef;
  --muted: #52526a;
  --muted2: #3a3a52;
  --radius: 10px;
  --radius-lg: 14px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

.mono { font-family: 'Consolas', 'SF Mono', 'Fira Code', monospace; }
.muted { color: var(--muted); }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,11,16,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 50px;
}
.nav-logo {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 6px; color: var(--text);
}
.nav-logo span { filter: drop-shadow(0 0 6px rgba(127,255,106,0.5)); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user { display: flex; align-items: center; gap: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border2); }
.nav-user span { font-size: 13px; color: var(--muted); }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent); color: #000; font-weight: 600;
  border-radius: var(--radius); padding: 11px 20px; font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px; transition: all 0.2s;
  box-shadow: 0 0 18px rgba(127,255,106,0.12);
}
.btn-primary:hover { box-shadow: 0 0 26px rgba(127,255,106,0.3); transform: translateY(-1px); }
.btn-primary.full { width: 100%; justify-content: center; }

.btn-accent {
  background: rgba(127,255,106,0.1); color: var(--accent);
  border: 1px solid rgba(127,255,106,0.2); border-radius: 8px;
  padding: 7px 13px; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.btn-accent:hover { background: rgba(127,255,106,0.18); }
.btn-accent:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-danger {
  background: rgba(255,79,79,0.1); color: var(--danger);
  border: 1px solid rgba(255,79,79,0.2); border-radius: 8px;
  padding: 7px 13px; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.15s;
}
.btn-danger:hover { background: rgba(255,79,79,0.18); }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border2); border-radius: 8px;
  padding: 7px 13px; font-size: 13px; font-weight: 500; transition: all 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted2); }

.btn-sm { padding: 5px 11px; font-size: 12px; }

.icon-btn {
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all 0.15s; flex-shrink: 0;
}
.del-btn { color: var(--muted); }
.del-btn:hover { background: rgba(255,79,79,0.12); color: var(--danger); }
.preview-btn { color: var(--muted); }
.preview-btn:hover { background: rgba(106,240,255,0.1); color: var(--accent2); }

/* ── Page ───────────────────────────────────────────────── */
.page { max-width: 900px; margin: 0 auto; padding: 20px 14px 40px; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.page-title { font-size: clamp(16px, 5vw, 20px); font-weight: 700; }
.page-sub { font-size: 12px; color: var(--muted); margin-top: 3px; font-family: monospace; }

/* ── Search & Filter ────────────────────────────────────── */
.search-filter-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; align-items: center;
}
.search-wrap { flex: 1; min-width: 160px; }
.search-input {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px; padding: 8px 12px;
  outline: none; transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }

.filter-select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 12px;
  padding: 8px 10px; outline: none; cursor: pointer;
  -webkit-appearance: none; appearance: none; font-family: inherit;
}
.filter-select:focus { border-color: var(--accent); }

.repo-count { font-size: 12px; color: var(--muted); font-family: monospace; white-space: nowrap; padding: 8px 4px; }

/* ── Repo Grid ──────────────────────────────────────────── */
.repo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px;
}

.repo-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 15px; transition: all 0.18s; cursor: pointer;
}
.repo-card:hover {
  border-color: var(--border2); background: var(--surface2);
  transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}
.repo-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.repo-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.repo-icon { font-size: 13px; flex-shrink: 0; }
.repo-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.repo-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.lang-dot { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent2); }
.repo-branch, .repo-date { font-size: 11px; font-family: monospace; }

.badge-public, .badge-private {
  font-size: 10px; font-family: monospace; padding: 2px 7px; border-radius: 20px; flex-shrink: 0;
}
.badge-public { background: rgba(106,240,255,0.07); color: var(--accent2); border: 1px solid rgba(106,240,255,0.15); }
.badge-private { background: rgba(255,204,74,0.07); color: var(--warn); border: 1px solid rgba(255,204,74,0.15); }

/* ── Repo Header ────────────────────────────────────────── */
.repo-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.repo-header-left { display: flex; flex-direction: column; gap: 5px; }
.back-btn { font-size: 12px; color: var(--muted); }
.back-btn:hover { color: var(--text); }

.branch-wrap { display: flex; align-items: center; gap: 6px; }
.branch-select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 12px;
  padding: 6px 10px; outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none; font-family: monospace;
}
.branch-select:focus { border-color: var(--accent); }

/* ── Action Bar ─────────────────────────────────────────── */
.action-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 7px 12px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; font-family: monospace; font-size: 11px;
}
.crumb { color: var(--accent2); }
.crumb:hover { text-decoration: underline; }
.crumb-sep { color: var(--muted); }

/* ── File List ──────────────────────────────────────────── */
.file-list {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); transition: background 0.12s;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--surface2); }

.file-check-wrap { flex-shrink: 0; }
.file-check { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }
.file-info-wrap { flex: 1; min-width: 0; }
.file-name {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dir-link:hover { color: var(--accent2); }
.file-icon { font-size: 13px; flex-shrink: 0; }
.file-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.file-size { font-size: 11px; font-family: monospace; margin-right: 4px; }

.empty-folder {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 36px; color: var(--muted); font-size: 13px;
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 50px; color: var(--muted); font-size: 13px;
}
.empty-icon { font-size: 32px; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); width: 100%; max-width: 500px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-sm { max-width: 380px; }
.modal-lg { max-width: 700px; }

.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-close { font-size: 16px; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { color: var(--text); background: var(--surface2); }

.modal-body { padding: 15px 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--border);
}

/* ── Drop Zone ──────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius);
  padding: 26px 16px; text-align: center; cursor: pointer; transition: all 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent); background: rgba(127,255,106,0.03);
}
.drop-icon { font-size: 26px; margin-bottom: 6px; }
.drop-text { font-size: 14px; font-weight: 600; }
.drop-sub { font-size: 11px; color: var(--muted); margin-top: 3px; font-family: monospace; }

.file-chosen {
  margin-top: 8px; padding: 7px 12px;
  background: rgba(127,255,106,0.06); border: 1px solid rgba(127,255,106,0.18);
  border-radius: 8px; font-family: monospace; font-size: 12px; color: var(--accent);
}

/* ── Form Fields ────────────────────────────────────────── */
.field { margin-bottom: 12px; }
.field.mt { margin-top: 14px; }
label {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 5px;
}
input[type="text"], input[type="password"], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px; padding: 9px 11px;
  outline: none; transition: border-color 0.2s; -webkit-appearance: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(127,255,106,0.07);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; font-family: 'Consolas', monospace; font-size: 12px; line-height: 1.6; }

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.opt-row {
  display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer;
  padding: 7px 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; transition: border-color 0.15s;
}
.opt-row:hover { border-color: var(--border2); }
.opt-row input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }

/* ── Progress ───────────────────────────────────────────── */
.progress-bar-bg { height: 3px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px; transition: width 0.3s;
}
.progress-label { font-size: 11px; color: var(--muted); font-family: monospace; margin-top: 5px; text-align: right; }

/* ── Log ────────────────────────────────────────────────── */
.log-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px;
  font-family: 'Consolas', monospace; font-size: 11px;
  line-height: 1.7; max-height: 180px; overflow-y: auto; margin-top: 10px;
}
.log-line { display: block; }
.log-ok { color: var(--accent); }
.log-warn { color: var(--warn); }
.log-err { color: var(--danger); }
.log-info { color: var(--accent2); }

/* ── Alert ──────────────────────────────────────────────── */
.alert { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-err { background: rgba(255,79,79,0.08); border: 1px solid rgba(255,79,79,0.2); color: var(--danger); }

/* ── Delete confirm ─────────────────────────────────────── */
.delete-confirm-text {
  font-size: 13px; line-height: 1.6; padding: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}

/* ── File Preview ───────────────────────────────────────── */
.preview-info {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 9px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
  font-family: monospace; font-size: 11px; color: var(--muted); margin-bottom: 10px;
}
.preview-info strong { color: var(--text); }
.preview-code {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
  font-family: 'Consolas', 'SF Mono', monospace; font-size: 12px;
  line-height: 1.7; max-height: 420px; overflow: auto;
  white-space: pre; color: var(--text); tab-size: 2;
}
.preview-image {
  max-width: 100%; max-height: 400px; border-radius: 8px;
  display: block; margin: 0 auto; border: 1px solid var(--border);
}
.preview-loading { text-align: center; padding: 40px; color: var(--muted); font-family: monospace; font-size: 12px; }

/* ── New File/Folder ────────────────────────────────────── */
.create-tabs {
  display: flex; gap: 4px; margin-bottom: 14px;
  background: var(--bg); padding: 3px; border-radius: 8px; border: 1px solid var(--border);
}
.create-tab {
  flex: 1; padding: 7px 12px; border-radius: 6px; font-size: 13px; font-weight: 600;
  color: var(--muted); transition: all 0.15s; text-align: center; cursor: pointer; border: none; background: none;
}
.create-tab.active { background: var(--surface2); color: var(--text); }

/* ── Login ──────────────────────────────────────────────── */
.login-body { display: flex; flex-direction: column; min-height: 100vh; }

.login-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(127,255,106,0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(106,240,255,0.03) 0%, transparent 60%);
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px; opacity: 0.28;
}

.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; z-index: 1; }

.login-card {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 28px 24px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 48px rgba(0,0,0,0.4);
}

.login-logo { text-align: center; margin-bottom: 24px; }
.logo-mark { font-size: 28px; margin-bottom: 6px; display: block; filter: drop-shadow(0 0 10px rgba(127,255,106,0.5)); }
.login-logo h1 { font-size: 22px; font-weight: 700; }
.login-sub { font-size: 12px; color: var(--muted); font-family: monospace; margin-top: 3px; }

.login-form { margin-bottom: 18px; }
.login-form .field { margin-bottom: 13px; }

.token-link-row { display: flex; justify-content: flex-end; margin-top: -6px; margin-bottom: 13px; }
.token-link { font-size: 11px; color: var(--accent2); font-family: monospace; }
.token-link:hover { text-decoration: underline; }

.login-tips { border-top: 1px solid var(--border); padding-top: 14px; }
.tip-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.tip-line { display: flex; gap: 6px; align-items: flex-start; font-size: 11px; color: var(--muted); font-family: monospace; padding: 2px 0; line-height: 1.5; }
.tip-line.warn { color: var(--warn); margin-top: 4px; }
.tip-arrow { color: var(--accent2); flex-shrink: 0; }
.tip-line strong { color: var(--text); }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); padding: 16px;
  margin-top: 30px;
}
.footer-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px;
}
.footer-copy { font-size: 12px; color: var(--muted); font-family: monospace; }
.footer-copy strong { color: var(--text); }
.footer-links { display: flex; gap: 14px; }
.footer-links a { font-size: 11px; color: var(--muted); font-family: monospace; transition: color 0.15s; }
.footer-links a:hover { color: var(--accent2); }

.login-footer { text-align: center; padding: 12px; position: relative; z-index: 1; font-size: 11px; color: var(--muted); font-family: monospace; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 500px) {
  .repo-grid { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr; }
  .nav-user span { display: none; }
  .page-header { flex-direction: column; }
  .search-wrap { max-width: 100%; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ── Logo ───────────────────────────────────────────────── */
.nav-logo-img {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}
.login-logo-img {
  width: 72px; height: 72px;
  display: block; margin: 0 auto 10px;
  border-radius: 18px;
  box-shadow: 0 0 32px rgba(90,255,110,0.25);
}

/* ── Hamburger ──────────────────────────────────────────── */
.hamburger {
  display: flex; flex-direction: column; justify-content: center;
  gap: 5px; width: 36px; height: 36px; padding: 6px;
  border-radius: 8px; cursor: pointer; background: none; border: none;
  transition: background 0.15s;
}
.hamburger:hover { background: var(--surface2); }
.hamburger span {
  display: block; height: 2px; border-radius: 2px;
  background: var(--text); transition: all 0.2s;
}
.hamburger span:nth-child(1) { width: 20px; }
.hamburger span:nth-child(2) { width: 14px; }
.hamburger span:nth-child(3) { width: 17px; }
.hamburger:hover span { width: 20px; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.sidebar-overlay.open { opacity: 1; pointer-events: all; }

.sidebar {
  position: fixed; top: 0; right: 0; z-index: 301;
  width: 280px; max-width: 85vw; height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border2);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  box-shadow: -12px 0 40px rgba(0,0,0,0.4);
}
.sidebar.open { transform: translateX(0); }

.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px; border-bottom: 1px solid var(--border);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--border2); }
.sidebar-name { font-size: 14px; font-weight: 600; }
.sidebar-handle { font-size: 11px; color: var(--muted); font-family: monospace; margin-top: 1px; }
.sidebar-close {
  width: 30px; height: 30px; border-radius: 8px; font-size: 14px;
  color: var(--muted); display: grid; place-items: center; transition: all 0.15s;
}
.sidebar-close:hover { background: var(--surface2); color: var(--text); }

.sidebar-body { flex: 1; overflow-y: auto; padding: 10px 8px; }

.sidebar-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted2); font-weight: 600; padding: 6px 10px 4px;
  font-family: monospace;
}
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 0; }

.sidebar-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--text); background: none; border: none; text-align: left;
  cursor: pointer; transition: background 0.15s; text-decoration: none;
}
.sidebar-item:hover { background: var(--surface2); }
.sidebar-item.danger { color: var(--danger); }
.sidebar-item.danger:hover { background: rgba(255,79,79,0.08); }
.si-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }

.sidebar-foot {
  padding: 14px 16px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted); font-family: monospace; text-align: center;
}

/* ── Profile Modal ──────────────────────────────────────── */
.profile-card {
  text-align: center; padding: 16px 0 20px;
  border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--border2); }
.profile-name { font-size: 16px; font-weight: 700; margin-top: 10px; }
.profile-handle { font-size: 12px; color: var(--muted); font-family: monospace; margin-top: 2px; }
.profile-gh-link {
  display: inline-block; margin-top: 10px; font-size: 11px;
  color: var(--accent2); font-family: monospace;
}
.profile-gh-link:hover { text-decoration: underline; }
.profile-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px;
}
.profile-info-row:last-child { border-bottom: none; }
.profile-label { color: var(--muted); font-family: monospace; }
.profile-value { color: var(--text); font-family: monospace; }

/* ── Contact List ───────────────────────────────────────── */
.contact-list { display: flex; flex-direction: column; gap: 6px; }
.contact-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  text-decoration: none; color: var(--text); transition: all 0.15s;
}
.contact-item:hover { border-color: var(--border2); background: var(--surface2); }
.contact-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.contact-name { font-size: 13px; font-weight: 600; }
.contact-handle { font-size: 11px; color: var(--muted); font-family: monospace; margin-top: 1px; }
.contact-arrow { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ── Terms of Service ───────────────────────────────────── */
.tos-body { font-size: 12px; line-height: 1.75; color: var(--muted); }
.tos-body h4 { font-size: 12px; font-weight: 700; color: var(--text); margin: 14px 0 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.tos-body p { margin-bottom: 4px; }
.tos-updated { font-family: monospace; font-size: 11px; color: var(--muted2); margin-bottom: 12px; }

/* ── Login ToS line ─────────────────────────────────────── */
.login-tos {
  text-align: center; font-size: 11px; color: var(--muted);
  margin-top: 14px; line-height: 1.6;
}
.login-tos button { color: var(--accent2); font-size: 11px; text-decoration: underline; cursor: pointer; background: none; border: none; font-family: inherit; }

/* ── ToS Checkbox ───────────────────────────────────────── */
.tos-check-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text);
  transition: border-color 0.2s;
  line-height: 1.5;
}
.tos-check-row:hover { border-color: var(--border2); }
.tos-check-row input[type="checkbox"] {
  width: 16px; height: 16px; margin-top: 2px;
  accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
  border: none; padding: 0;
}
.tos-check-row:has(input:checked) {
  border-color: rgba(127,255,106,0.4);
  background: rgba(127,255,106,0.04);
}
.tos-inline-link {
  background: none; border: none; padding: 0;
  color: var(--accent2); font-size: 13px;
  text-decoration: underline; cursor: pointer;
  font-family: inherit;
}
.tos-inline-link:hover { color: var(--accent); }

.btn-github {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 11px 20px; font-size: 14px; font-weight: 600;
  background: #fff; color: #24292f; border-radius: var(--radius);
  border: 1.5px solid #d0d7de; transition: all 0.2s; cursor: pointer;
  text-decoration: none; margin-bottom: 16px;
}
.btn-github:hover { background: #f6f8fa; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; color: var(--muted); font-size: 11px; font-family: monospace;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Disabled login button style */
.btn-primary:disabled {
  background: var(--border2); color: var(--muted);
  cursor: not-allowed; box-shadow: none; transform: none;
  opacity: 0.6;
}

/* ── New Feature Styles ──────────────────────────────────── */

/* Light theme */
[data-theme="light"] {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface2: #e8eaed;
  --border: #d0d4db;
  --text: #0d1117;
  --muted: #57606a;
  --accent: #1a7f37;
  --accent2: #0969da;
  --danger: #cf222e;
}

[data-theme="light"] .navbar { background: #ffffff; border-bottom: 1px solid #d0d4db; }
[data-theme="light"] .sidebar { background: #ffffff; border-left: 1px solid #d0d4db; }
[data-theme="light"] .sidebar-head { background: #f6f8fa; border-bottom: 1px solid #d0d4db; }
[data-theme="light"] .sidebar-foot { background: #f6f8fa; border-top: 1px solid #d0d4db; color: #57606a; }
[data-theme="light"] .sidebar-section-label { color: #57606a; }
[data-theme="light"] .sidebar-item { color: #0d1117; }
[data-theme="light"] .sidebar-item:hover { background: #f0f2f5; }
[data-theme="light"] .sidebar-item.danger { color: #cf222e; }
[data-theme="light"] .sidebar-name { color: #0d1117; }
[data-theme="light"] .sidebar-handle { color: #57606a; }
[data-theme="light"] .sidebar-divider { background: #d0d4db; }
[data-theme="light"] .hamburger span { background: #0d1117; }
[data-theme="light"] .nav-logo { color: #0d1117; }
[data-theme="light"] .nav-user { color: #0d1117; }
[data-theme="light"] .file-list { background: #ffffff; border: 1px solid #d0d4db; }
[data-theme="light"] .file-row { border-bottom: 1px solid #eaedf0; }
[data-theme="light"] .file-row:hover { background: #f6f8fa; }
[data-theme="light"] .file-name { color: #0d1117; }
[data-theme="light"] .dir-link { color: #0969da; }
[data-theme="light"] .breadcrumb { background: #ffffff; border: 1px solid #d0d4db; }
[data-theme="light"] .crumb { color: #0969da; }
[data-theme="light"] .crumb-sep { color: #57606a; }
[data-theme="light"] .action-bar { background: transparent; }
[data-theme="light"] .btn-ghost { background: #ffffff; border: 1px solid #d0d4db; color: #0d1117; }
[data-theme="light"] .btn-ghost:hover { background: #f0f2f5; }
[data-theme="light"] .branch-select { background: #ffffff; border: 1px solid #d0d4db; color: #0d1117; }
[data-theme="light"] .modal { background: #ffffff; border: 1px solid #d0d4db; }
[data-theme="light"] .modal-head { background: #f6f8fa; border-bottom: 1px solid #d0d4db; color: #0d1117; }
[data-theme="light"] .modal-foot { background: #f6f8fa; border-top: 1px solid #d0d4db; }
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.4); }
[data-theme="light"] .modal-close { color: #57606a; }
[data-theme="light"] .modal-close:hover { background: #eaedf0; color: #0d1117; }
[data-theme="light"] input, [data-theme="light"] textarea, [data-theme="light"] select { background: #ffffff; border: 1px solid #d0d4db; color: #0d1117; }
[data-theme="light"] input::placeholder, [data-theme="light"] textarea::placeholder { color: #8c96a3; }
[data-theme="light"] label { color: #0d1117; }
[data-theme="light"] .drop-zone { background: #f6f8fa; border: 2px dashed #d0d4db; color: #57606a; }
[data-theme="light"] .drop-zone:hover { border-color: var(--accent); background: #f0fff4; }
[data-theme="light"] .file-chosen { color: #1a7f37; background: #f0fff4; border: 1px solid #a6f0c6; }
[data-theme="light"] .log-box { background: #f6f8fa; border: 1px solid #d0d4db; }
[data-theme="light"] .log-line { color: #0d1117; }
[data-theme="light"] .log-ok { color: #1a7f37; }
[data-theme="light"] .log-err { color: #cf222e; }
[data-theme="light"] .log-warn { color: #9a6700; }
[data-theme="light"] .progress-bar-bg { background: #eaedf0; }
[data-theme="light"] .progress-label { color: #57606a; }
[data-theme="light"] .create-tab { background: #f0f2f5; color: #57606a; border: 1px solid #d0d4db; }
[data-theme="light"] .create-tab.active { background: #ffffff; color: #0d1117; border-color: #d0d4db; border-bottom: 2px solid var(--accent); }
[data-theme="light"] .edit-textarea { background: #f6f8fa; color: #0d1117; border-color: #d0d4db; }
[data-theme="light"] .preview-code { background: #f6f8fa; color: #0d1117; }
[data-theme="light"] .preview-loading { color: #57606a; }
[data-theme="light"] .preview-info { color: #57606a; background: #f6f8fa; border-bottom: 1px solid #d0d4db; }
[data-theme="light"] .commit-item { border-color: #eaedf0; }
[data-theme="light"] .commit-msg { color: #0d1117; }
[data-theme="light"] .search-result-row { color: #0d1117; }
[data-theme="light"] .search-result-row:hover { background: #f0f2f5; }
[data-theme="light"] .profile-card { background: #f6f8fa; }
[data-theme="light"] .profile-name { color: #0d1117; }
[data-theme="light"] .profile-handle { color: #57606a; }
[data-theme="light"] .profile-info-row { border-color: #eaedf0; }
[data-theme="light"] .profile-label { color: #57606a; }
[data-theme="light"] .profile-value { color: #0d1117; }
[data-theme="light"] .contact-item { background: #f6f8fa; border: 1px solid #eaedf0; color: #0d1117; }
[data-theme="light"] .contact-item:hover { background: #f0f2f5; border-color: #d0d4db; }
[data-theme="light"] .contact-name { color: #0d1117; }
[data-theme="light"] .contact-handle { color: #57606a; }
[data-theme="light"] .contact-arrow { color: #57606a; }
[data-theme="light"] .tos-body h4 { color: #0d1117; }
[data-theme="light"] .tos-body p { color: #57606a; }
[data-theme="light"] .tos-updated { color: #8c96a3; }
[data-theme="light"] .dot-menu-btn { color: #57606a; }
[data-theme="light"] .dot-menu-btn:hover { background: #f0f2f5; color: #0d1117; }
[data-theme="light"] .dot-menu-item { color: #0d1117; }
[data-theme="light"] .dot-menu-item:hover { background: #f0f2f5; }
[data-theme="light"] .dot-menu-danger { color: #cf222e; }
[data-theme="light"] .repo-badge { background: #f0f2f5; border: 1px solid #d0d4db; color: #57606a; }
[data-theme="light"] .badge-private { background: rgba(207,34,46,0.08); color: #cf222e; border-color: rgba(207,34,46,0.2); }
[data-theme="light"] .badge-public { background: rgba(26,127,55,0.08); color: #1a7f37; border-color: rgba(26,127,55,0.2); }
[data-theme="light"] .back-btn { color: #0969da; }
[data-theme="light"] .page-title { color: #0d1117; }
[data-theme="light"] .site-footer { background: #ffffff; border-top: 1px solid #d0d4db; color: #57606a; }
[data-theme="light"] .empty-folder { color: #57606a; }
[data-theme="light"] .muted { color: #57606a; }
[data-theme="light"] .opt-row { color: #0d1117; }
[data-theme="light"] .options-grid { background: #f6f8fa; border: 1px solid #eaedf0; }
[data-theme="light"] .delete-confirm-text { color: #0d1117; }
[data-theme="light"] code { background: #eaedf0; color: #0d1117; }

/* file-info-wrap with timestamp */
.file-info-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.file-date { font-size: 10px; padding-left: 22px; opacity: 0.55; }

/* Edit textarea */
.edit-textarea {
  width: 100%; min-height: 320px; background: var(--bg);
  color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; font-family: 'Geist Mono', monospace;
  font-size: 12px; line-height: 1.6; resize: vertical; box-sizing: border-box;
}
.modal-xl { max-width: 780px; width: 96vw; }

/* Commit history */
.commit-item {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.commit-item:last-child { border-bottom: none; }
.commit-sha { flex-shrink: 0; }
.commit-sha a { color: var(--accent2); font-size: 12px; text-decoration: none; }
.commit-sha a:hover { text-decoration: underline; }
.commit-info { flex: 1; min-width: 0; }
.commit-msg { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commit-meta { font-size: 11px; margin-top: 2px; }

/* Search results */
.search-result-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 6px; cursor: pointer; text-decoration: none;
  color: var(--text); transition: background 0.15s;
}
.search-result-row:hover { background: var(--surface2); }
.search-result-path { font-size: 13px; font-family: monospace; }

/* Alert variants */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.alert-ok  { background: rgba(127,255,106,0.08); border: 1px solid rgba(127,255,106,0.2); color: var(--accent); }
.alert-err { background: rgba(255,80,80,0.08);   border: 1px solid rgba(255,80,80,0.2);   color: var(--danger); }

/* Branch select in modal */
#branchModal select, #branchModal input { width: 100%; }

/* Footer keyboard hints */
.footer-kbd { display: none; }
@media (min-width: 600px) { .footer-kbd { display: inline; } }

/* repo header responsive */
.repo-header {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px;
}

/* Preview edit/download buttons */
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ── Dot Menu ────────────────────────────────────────────── */
.dot-menu-btn {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--muted); padding: 2px 8px;
  border-radius: 6px; line-height: 1; transition: background 0.15s, color 0.15s;
  letter-spacing: 1px;
}
.dot-menu-btn:hover { background: var(--surface2); color: var(--text); }

.dot-menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; background: none; border: none;
  padding: 12px 20px; font-size: 14px; color: var(--text);
  cursor: pointer; text-align: left; transition: background 0.12s;
}
.dot-menu-item:hover { background: var(--surface2); }
.dot-menu-danger { color: var(--danger); }
.dot-menu-icon { font-size: 16px; width: 22px; text-align: center; }

/* ── Prism Code Preview ──────────────────────────────────── */
.preview-code {
  margin: 0 !important; border-radius: 8px !important;
  font-size: 12px !important; line-height: 1.6 !important;
  max-height: 60vh; overflow: auto;
  background: #1e1e2e !important;
}
.preview-code code { font-family: 'Geist Mono', 'Fira Code', monospace !important; }

/* ── File row tightened ──────────────────────────────────── */
.file-info-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.file-name { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
