/* git-vault — modern SaaS design system */
:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef3f9;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --brand-soft: #eff6ff;
  --accent: #ea580c;
  --accent-soft: #fff7ed;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 12px 32px -18px rgba(15, 23, 42, .28), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-lg: 0 30px 70px -35px rgba(15, 23, 42, .35), 0 8px 20px -12px rgba(15, 23, 42, .12);
  --radius: 18px;
  --radius-sm: 11px;
  --radius-lg: 26px;
  --font: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --bg-elev: #0d1a2b;
  --surface: #0e1b2d;
  --surface-2: #122238;
  --surface-3: #16283f;
  --text: #eff6ff;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --line: #1e3550;
  --line-strong: #2b4765;
  --brand: #60a5fa;
  --brand-2: #818cf8;
  --brand-soft: rgba(96, 165, 250, .12);
  --accent: #fb923c;
  --accent-soft: rgba(251, 146, 60, .12);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .1);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, .1);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, .7), 0 2px 10px rgba(0, 0, 0, .2);
  --shadow-lg: 0 36px 90px -40px rgba(0, 0, 0, .9), 0 12px 30px -14px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 8% -8%, rgba(37, 99, 235, .12), transparent 60%),
    radial-gradient(900px 460px at 96% 2%, rgba(234, 88, 12, .09), transparent 60%),
    var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 500px at 8% -8%, rgba(37, 99, 235, .2), transparent 60%),
    radial-gradient(900px 460px at 96% 2%, rgba(234, 88, 12, .1), transparent 60%),
    var(--bg);
}
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4 { margin: 0 0 .55rem; line-height: 1.12; letter-spacing: -.035em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 4vw, 3.6rem); }
h2 { font-size: clamp(1.45rem, 2.2vw, 2rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }
code, .mono { font-family: var(--mono); font-size: .86em; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .84rem; margin: 0; }
.small { font-size: .82rem; }
.skip { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 3px; border-radius: 6px; }
.container { width: min(1240px, calc(100% - 2.5rem)); margin-inline: auto; }
.page-enter { animation: pageIn .5s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.header-inner { min-height: 74px; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); font-weight: 700; letter-spacing: -.04em; font-size: 1.08rem; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--brand) 70%, transparent);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-word { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word small { font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.site-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.nav-link { color: var(--muted); font-size: .9rem; font-weight: 600; padding: .55rem .8rem; border-radius: 9px; transition: .2s; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.nav-actions { display: flex; align-items: center; gap: .45rem; padding-left: .9rem; border-left: 1px solid var(--line); }
.auth-nav { display: inline-flex; align-items: center; gap: .4rem; }
.auth-nav .nav-link { padding: .5rem .65rem; }
.icon-button {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px; color: var(--muted);
  background: var(--surface); cursor: pointer; transition: .2s; flex: none;
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-button svg { width: 17px; height: 17px; }
.nav-toggle { display: none; }
.btn, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .65rem 1rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--text);
  font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s, background .18s;
  box-shadow: var(--shadow-sm); text-decoration: none; white-space: nowrap;
}
.btn:hover, .button:hover { border-color: var(--line-strong); transform: translateY(-1px); color: var(--text); }
.button.primary, .btn.primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 26px -14px color-mix(in srgb, var(--brand) 80%, transparent);
}
.button.primary:hover, .btn.primary:hover { color: #fff; filter: brightness(1.06); box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--brand) 85%, transparent); }
.button svg, .btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.nav-link svg, .trust-chip svg, .auth-point svg, .link-arrow svg, .quick-action svg { width: 15px; height: 15px; flex: 0 0 auto; }
.button.accent { background: var(--accent); color: #fff; border-color: transparent; }
.button.danger, .btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); background: var(--danger-soft); }
.button.ghost { background: transparent; box-shadow: none; }
.button.small, .btn.small { min-height: 34px; padding: .4rem .7rem; font-size: .8rem; border-radius: 8px; }
button:disabled, .button[aria-disabled="true"] { opacity: .48; cursor: not-allowed; transform: none !important; }
.link-button { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: .3rem .2rem; }
.link-arrow { display: inline-flex; align-items: center; gap: .35rem; font-weight: 650; font-size: .9rem; }
.link-arrow svg { width: 15px; height: 15px; transition: transform .18s; }
.link-arrow:hover svg { transform: translateX(3px); }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; }
.stack { display: grid; gap: 1rem; }
.section { padding: 4rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.35rem; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; color: var(--brand); font-size: .72rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.section-kicker { color: var(--brand); font-size: .7rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .45rem; }
.section-title { font-size: clamp(1.55rem, 2.6vw, 2.25rem); }
.section-sub { color: var(--muted); max-width: 48ch; margin: 0; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }

/* Hero */
.hero { padding: clamp(3rem, 7vw, 6.5rem) 0 2rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); align-items: center; gap: clamp(2rem, 5vw, 4.5rem); }
.hero h1 { font-size: clamp(2.7rem, 5.5vw, 4.9rem); line-height: 1.02; letter-spacing: -.065em; max-width: 11ch; margin-bottom: 1.2rem; }
.gradient-text { background: linear-gradient(110deg, var(--brand), var(--brand-2) 52%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.14rem); max-width: 55ch; margin-bottom: 1.8rem; }
.preserve-card { background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 20px; padding: .85rem; box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); }
.preserve-form { display: flex; align-items: center; gap: .5rem; }
.preserve-input-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: .2rem .6rem .2rem .8rem; transition: .2s; }
.preserve-input-wrap:focus-within { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); box-shadow: 0 0 0 4px var(--brand-soft); }
.preserve-input-wrap svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.preserve-input-wrap input { border: 0; background: transparent; box-shadow: none; min-height: 46px; padding-left: 0; }
.preserve-input-wrap input:focus { box-shadow: none; }
.preserve-form .button { min-height: 48px; padding-inline: 1.25rem; border-radius: 11px; }
.preserve-hint { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .76rem; padding: .65rem .3rem .1rem; }
.preserve-hint svg { width: 13px; height: 13px; }
.trust-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.trust-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--muted); padding: .4rem .65rem; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 62%, transparent); border-radius: 999px; }
.trust-chip svg { width: 13px; height: 13px; color: var(--success); }
.hero-visual { position: relative; min-height: 430px; display: grid; place-items: center; }
.vault-glow { position: absolute; width: 80%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 200deg, rgba(37,99,235,.35), rgba(79,70,229,.15), rgba(234,88,12,.25), rgba(37,99,235,.35)); filter: blur(45px); opacity: .65; }
.vault-stage { position: relative; width: min(100%, 390px); transform: rotate(1.8deg); }
.vault-card { position: relative; background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-2) 90%, transparent)); border: 1px solid color-mix(in srgb, var(--line) 75%, transparent); border-radius: 24px; padding: 1.4rem; box-shadow: var(--shadow-lg); backdrop-filter: blur(20px); overflow: hidden; }
.vault-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.18), transparent 38%); pointer-events: none; }
.vault-card-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.vault-label { font-size: .68rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.vault-dot { display: inline-flex; align-items: center; gap: .35rem; color: var(--success); font-size: .72rem; font-weight: 650; }
.vault-dot::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; box-shadow: 0 0 0 4px var(--success-soft); }
.vault-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: .7rem; padding: .8rem 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.vault-row:last-of-type { border-bottom: 0; }
.vault-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.vault-icon svg { width: 15px; height: 15px; }
.vault-row strong { display: block; font-size: .82rem; }
.vault-row span { color: var(--muted); font-size: .7rem; }
.vault-value { font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.vault-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: .35rem; }
.vault-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.float-badge { position: absolute; right: -18px; bottom: -22px; display: flex; align-items: center; gap: .55rem; padding: .65rem .8rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .72rem; font-weight: 650; transform: rotate(-2deg); }
.float-badge svg { width: 15px; height: 15px; color: var(--accent); }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.stat-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.15rem; box-shadow: var(--shadow-sm); overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -20px; bottom: -40px; width: 100px; height: 100px; border-radius: 50%; background: var(--brand-soft); opacity: .55; }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: .85rem; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-value { font-size: clamp(1.55rem, 2.5vw, 2.1rem); font-weight: 750; letter-spacing: -.05em; line-height: 1; }
.stat-label { margin-top: .35rem; font-size: .76rem; font-weight: 650; color: var(--text-2); }
.stat-detail { margin-top: .2rem; font-size: .7rem; color: var(--muted); }
.stat-card:nth-child(2) .stat-icon { background: var(--accent-soft); color: var(--accent); }
.stat-card:nth-child(2)::after { background: var(--accent-soft); }
.stat-card:nth-child(3) .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-card:nth-child(3)::after { background: var(--success-soft); }
.stat-card:nth-child(4) .stat-icon { background: color-mix(in srgb, var(--brand-2) 12%, transparent); color: var(--brand-2); }

/* Catalog */
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem; margin-bottom: 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.filters { display: flex; gap: .55rem; align-items: end; flex-wrap: wrap; }
.filters .field { margin: 0; }
.filters input, .filters select { min-height: 38px; padding: .45rem .65rem; border-radius: 8px; }
.filters .field > label { font-size: .68rem; }
.filters button { min-height: 38px; padding: .45rem .8rem; font-size: .82rem; }
.catalog-count { color: var(--muted); font-size: .8rem; padding-right: .4rem; }
.repo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.repo-card { position: relative; display: flex; flex-direction: column; gap: .85rem; padding: 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; overflow: hidden; }
.repo-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); box-shadow: var(--shadow); }
.repo-card-head { display: flex; justify-content: space-between; align-items: start; gap: .75rem; }
.repo-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--brand); }
.repo-icon svg { width: 18px; height: 18px; }
.repo-title { margin: .1rem 0 0; font-size: .98rem; letter-spacing: -.025em; overflow-wrap: anywhere; }
.repo-title a { color: var(--text); }
.repo-desc { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.45em; }
.repo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; padding: .65rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.repo-stat { font-size: .68rem; color: var(--muted); }
.repo-stat strong { display: block; color: var(--text-2); font-size: .85rem; font-weight: 700; }
.repo-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; color: var(--muted); font-size: .7rem; }
.repo-foot .mono { color: var(--text-2); }
.empty { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .32rem; padding: .24rem .55rem; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .01em; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.live, .badge.approved, .badge.ok, .badge.preserved { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 22%, var(--line)); }
.badge.pending, .badge.queued, .badge.pending_review, .badge.running { color: var(--warning); background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 22%, var(--line)); }
.badge.failed, .badge.error, .badge.denied, .badge.rejected, .badge.dmca_takedown { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 22%, var(--line)); }
.badge.archived, .badge.private_or_deleted, .badge.owner_deleted, .badge.paused, .badge.skipped { color: var(--muted); }
.badge.verified { color: var(--success); background: var(--success-soft); }

/* Cards, page and tables */
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card { padding: 1.25rem; }
.card.stack { display: grid; gap: 1rem; }
.page-head { display: flex; justify-content: space-between; gap: 1.2rem; align-items: end; margin: 2.4rem 0 1.5rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .35rem; }
.page-head p { margin: 0; color: var(--muted); max-width: 60ch; }
.breadcrumbs { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .78rem; margin: 1.6rem 0 0; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs span { opacity: .5; }
.repo-hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 1rem; margin-top: 1rem; }
.repo-hero-main { padding: 1.45rem; background: linear-gradient(150deg, var(--surface), color-mix(in srgb, var(--brand-soft) 55%, var(--surface))); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.repo-hero-main h1 { font-size: clamp(1.7rem, 3vw, 2.55rem); margin: .55rem 0 .6rem; }
.repo-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: 1.2rem; }
.metric { padding: .8rem; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.metric strong { display: block; font-size: 1.2rem; letter-spacing: -.04em; }
.metric span { color: var(--muted); font-size: .68rem; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: .55rem; }
.count { padding: .8rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.count strong { display: block; font-size: 1.25rem; letter-spacing: -.04em; }
.count span { color: var(--muted); font-size: .7rem; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th { text-align: left; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; padding: .7rem .85rem; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .7rem .85rem; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.sha { font-family: var(--mono); font-size: .72rem; color: var(--text-2); }
.notice { padding: .8rem 1rem; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line)); background: var(--brand-soft); color: var(--text-2); font-size: .85rem; }
.error-box, .error { padding: .8rem 1rem; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--line)); background: var(--danger-soft); color: var(--danger); font-size: .85rem; }
.error:empty { display: none; }
.success-box { padding: .8rem 1rem; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--success) 25%, var(--line)); background: var(--success-soft); color: var(--success); }
.pagination { display: flex; justify-content: center; align-items: center; gap: .8rem; margin-top: 1.4rem; color: var(--muted); font-size: .8rem; }
.pagination button { min-height: 36px; padding: .4rem .75rem; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; color: var(--text); font: inherit; cursor: pointer; }

/* Forms */
.field { display: grid; gap: .35rem; }
.field > label { font-size: .76rem; font-weight: 700; color: var(--text-2); }
input, select, textarea {
  width: 100%; font: inherit; font-size: .9rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .8rem; min-height: 44px; transition: border-color .18s, box-shadow .18s;
}
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); box-shadow: 0 0 0 4px var(--brand-soft); }
input[type="checkbox"] { width: auto; min-height: auto; accent-color: var(--brand); }
form.card { padding: 1.35rem; }
form .button[type="submit"] { justify-self: start; margin-top: .2rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .wide { grid-column: 1 / -1; }

/* Auth */
.auth-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 2rem; align-items: center; padding: 3.5rem 0; min-height: 70vh; }
.auth-aside { padding: 2rem 0; }
.auth-aside h1 { font-size: clamp(2rem, 4vw, 3.3rem); max-width: 12ch; }
.auth-points { display: grid; gap: .8rem; margin-top: 1.5rem; }
.auth-point { display: flex; gap: .65rem; color: var(--muted); font-size: .86rem; }
.auth-point svg { width: 17px; height: 17px; color: var(--success); flex: none; margin-top: .1rem; }
.auth-card { max-width: 470px; width: 100%; justify-self: end; padding: 1.5rem; }
.auth-card h2 { font-size: 1.5rem; }
.auth-card .button { width: 100%; }
.auth-links { color: var(--muted); font-size: .82rem; }

/* Admin */
.admin-body { background: var(--surface-2); }
.admin-body.login-mode .admin-shell { grid-template-columns: 1fr; }
.admin-body.login-mode .sidebar { display: none; }
.admin-body.login-mode .admin-main { max-width: 1100px; }
.admin-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; padding: 1.15rem .85rem; background: var(--bg-elev); border-right: 1px solid var(--line); z-index: 40; }
.sidebar-brand { display: flex; align-items: center; gap: .65rem; color: var(--text); padding: .25rem .5rem 1rem; border-bottom: 1px solid var(--line); }
.sidebar-brand .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.sidebar-brand small { color: var(--muted); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; display: block; }
.admin-nav { display: grid; gap: .22rem; }
.admin-nav-section { padding: .75rem .6rem .3rem; color: var(--muted); font-size: .62rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.admin-nav-link { display: flex; align-items: center; gap: .65rem; padding: .62rem .7rem; border-radius: 9px; color: var(--muted); font-size: .84rem; font-weight: 600; transition: .18s; }
.admin-nav-link svg { width: 16px; height: 16px; flex: none; }
.admin-nav-link:hover { background: var(--surface-2); color: var(--text); }
.admin-nav-link.active { background: var(--brand-soft); color: var(--brand); }
.admin-nav-link .nav-count { margin-left: auto; font-size: .65rem; background: var(--surface-3); border-radius: 999px; padding: .1rem .4rem; color: var(--muted); }
.sidebar-footer { margin-top: auto; padding: .8rem .65rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; }
.sidebar-footer .status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); margin-right: .35rem; }
.admin-workspace { min-width: 0; }
.admin-topbar { position: sticky; top: 0; z-index: 30; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1.5rem; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.admin-topbar-left { display: flex; align-items: center; gap: .7rem; }
.admin-topbar .page-context { font-size: .8rem; color: var(--muted); }
.admin-topbar-actions { display: flex; align-items: center; gap: .45rem; }
.admin-main { padding: 1.6rem 1.5rem 3rem; max-width: 1500px; }
.admin-page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.35rem; flex-wrap: wrap; }
.admin-page-head h1 { font-size: clamp(1.55rem, 2.6vw, 2.15rem); margin-bottom: .25rem; }
.admin-page-head p { margin: 0; color: var(--muted); font-size: .86rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.kpi { position: relative; padding: 1rem 1.05rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.kpi-label { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.kpi-value { font-size: 1.75rem; font-weight: 750; letter-spacing: -.05em; margin-top: .35rem; line-height: 1; }
.kpi-detail { color: var(--muted); font-size: .7rem; margin-top: .35rem; }
.kpi-icon { position: absolute; top: 1rem; right: 1rem; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.kpi-icon svg { width: 15px; height: 15px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: .9rem; align-items: start; }
.dashboard-grid .empty { min-height: 150px; display: grid; place-items: center; }
.dash-card { padding: 1.15rem; }
.dash-card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dash-card-head h2 { font-size: 1rem; margin: 0; letter-spacing: -.02em; }
.activity-list { display: grid; gap: .15rem; }
.activity-row { display: flex; align-items: center; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); font-size: .8rem; }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); }
.activity-icon svg { width: 14px; height: 14px; }
.activity-main { min-width: 0; flex: 1; }
.activity-main strong { display: block; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-main span { color: var(--muted); font-size: .68rem; }
.chart-bars { display: flex; align-items: end; gap: .35rem; height: 120px; padding-top: .8rem; }
.chart-bar { flex: 1; min-width: 5px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 45%, var(--surface-3))); opacity: .82; }
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .62rem; margin-top: .45rem; }
.quick-actions { display: grid; gap: .45rem; }
.quick-action { display: flex; align-items: center; gap: .55rem; padding: .6rem .65rem; border-radius: 9px; border: 1px solid var(--line); color: var(--text-2); font-size: .78rem; font-weight: 600; }
.quick-action:hover { background: var(--surface-2); color: var(--text); }
.quick-action svg { width: 15px; height: 15px; color: var(--brand); }
.admin-main button:not(.button):not(.link-button):not(.icon-button) {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .6rem .95rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--text);
  font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: .18s;
}
.admin-main button:not(.button):not(.link-button):not(.icon-button):hover { border-color: var(--line-strong); transform: translateY(-1px); }
.admin-main button.primary:not(.button):not(.link-button):not(.icon-button) {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--brand) 80%, transparent);
}
.admin-main button.primary:not(.button):not(.link-button):not(.icon-button):hover {
  color: #fff; filter: brightness(1.05); border-color: transparent;
}
.admin-main .card { box-shadow: none; }
.admin-main > .row { margin-bottom: 1rem; }
.stack { display: grid; gap: 1rem; }
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2.2rem 0; color: var(--muted); font-size: .8rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 1.5rem; align-items: start; flex-wrap: wrap; }
.footer-brand { max-width: 32ch; }
.footer-brand .brand { margin-bottom: .6rem; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-bottom { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Small helpers */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: .7rem; font-weight: 750; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .55rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: .7rem; }
pre, .patch { overflow: auto; max-height: 60vh; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-family: var(--mono); font-size: .78rem; line-height: 1.5; white-space: pre; }
details { border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; background: var(--surface); }
summary { cursor: pointer; color: var(--text-2); font-size: .85rem; font-weight: 600; }
.notice[hidden], [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mobile-overlay { display: none; }

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .hero-visual { min-height: 340px; order: 2; }
  .vault-stage { width: min(100%, 430px); }
  .hero-copy { max-width: 760px; }
  .repo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; gap: 1rem; padding: 2rem 0; }
  .auth-card { justify-self: start; }
  .admin-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .repo-hero { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 1.4rem); }
  .header-inner { min-height: 64px; }
  .site-nav { display: none; position: fixed; left: .7rem; right: .7rem; top: 68px; z-index: 60; flex-direction: column; align-items: stretch; padding: .65rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
  body.nav-open .site-nav { display: flex; }
  .site-nav .nav-link { padding: .75rem .8rem; }
  .nav-actions { margin-left: 0; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .65rem; flex-wrap: wrap; }
  .nav-toggle { display: inline-grid; }
  .hero { padding-top: 2.5rem; }
  .hero h1 { max-width: 12ch; }
  .hero-copy, .hero-visual, .preserve-card, .preserve-form, .preserve-input-wrap { min-width: 0; width: 100%; }
  .preserve-form { flex-direction: column; align-items: stretch; }
  .preserve-form .button { width: 100%; min-width: 0; }
  .preserve-input-wrap { width: 100%; }
  .hero-visual { min-height: 300px; }
  .float-badge { right: 4px; bottom: -12px; }
  .section { padding: 2.8rem 0; }
  .repo-grid { grid-template-columns: 1fr; }
  .repo-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .catalog-toolbar { align-items: stretch; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .filters .field:nth-child(3) { grid-column: span 2; }
  .filters button { grid-column: span 2; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.admin-nav-open .sidebar { transform: none; }
  body.admin-nav-open .mobile-overlay { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(2, 8, 23, .45); backdrop-filter: blur(2px); }
  .admin-topbar { padding: 0 1rem; }
  .admin-main { padding: 1.2rem 1rem 2rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-wrap { border-radius: 10px; }
  th, td { padding: .6rem .65rem; }
  .footer-grid { flex-direction: column; }
}
@media (max-width: 420px) {
  .stats-grid, .kpi-grid { grid-template-columns: 1fr; }
  .repo-stats { grid-template-columns: repeat(2, 1fr); }
  .card, .repo-card { padding: 1rem; }
  .hero h1 { font-size: 2.6rem; }
  .vault-card { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Explore page */
.explore-hero { margin-top: 2.4rem; padding: clamp(2rem, 4vw, 3.2rem); border: 1px solid var(--line); border-radius: var(--radius-lg); background: radial-gradient(900px 280px at 90% 0%, var(--accent-soft), transparent 65%), linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--brand-soft) 55%, var(--surface))); box-shadow: var(--shadow); }
.explore-hero-copy h1 { font-size: clamp(2.2rem, 4.5vw, 3.8rem); max-width: 14ch; margin-bottom: .8rem; }
.explore-hero-copy .section-sub { max-width: 62ch; }
.explore-metrics { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.3rem; }
.explore-metrics .trust-chip strong { color: var(--text); }
.explore-section { padding-top: 2rem; }
.explore-search { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(150px, .55fr) minmax(180px, .65fr) auto; align-items: end; gap: .7rem; padding: .8rem; border-radius: 14px; box-shadow: var(--shadow-sm); }
.explore-input { display: flex; align-items: center; gap: .55rem; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: .2rem .65rem; transition: .18s; }
.explore-input:focus-within { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); box-shadow: 0 0 0 4px var(--brand-soft); }
.explore-input svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.explore-input input { border: 0; box-shadow: none; padding-left: 0; background: transparent; min-height: 42px; }
.explore-input input:focus { box-shadow: none; }
.explore-search .field { margin: 0; }
.explore-search .field > label { font-size: .68rem; }
.explore-search .button { min-height: 42px; }
.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .9rem; }
.filter-chip { display: inline-flex; align-items: center; padding: .4rem .7rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); font-size: .75rem; font-weight: 650; transition: .18s; }
.filter-chip:hover { color: var(--text); border-color: var(--line-strong); }
.filter-chip.active { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); background: var(--brand-soft); }
.explore-cta { padding: 1.25rem 1.35rem; }
.explore-cta h3 { margin-bottom: .25rem; }
.explore-empty { max-width: 560px; margin: 0 auto; text-align: center; padding: 3rem 1.5rem; }
.explore-empty .stat-icon { margin: 0 auto .8rem; width: 44px; height: 44px; }
.explore-empty h3 { font-size: 1.25rem; }
@media (max-width: 1024px) {
  .explore-search { grid-template-columns: 1fr 1fr; }
  .explore-input { grid-column: 1 / -1; }
  .explore-search .button { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .explore-hero { margin-top: 1rem; padding: 1.3rem; }
  .explore-search { grid-template-columns: 1fr; }
  .explore-search .field { width: 100%; }
  .explore-input { grid-column: auto; }
  .explore-cta { align-items: start; }
}


/* Spacing and responsive refinements */
.dashboard-grid > *, .dash-card, .card, .table-wrap, .repo-hero > * { min-width: 0; }
.patch { max-width: 100%; }
.admin-topbar .page-context, #admin-auth { white-space: nowrap; }
#admin-auth { display: inline-flex; align-items: center; gap: .4rem; }
.admin-main form .row > .field { flex: 1 1 180px; }
@media (max-width: 900px) {
  #main .grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 760px) {
  .admin-topbar .page-context { display: none; }
  .admin-topbar { padding-inline: .9rem; gap: .5rem; }
  .admin-topbar-actions { gap: .3rem; }
  #admin-auth { font-size: .72rem; }
  .admin-main form .row > .field { flex: 1 1 100% !important; min-width: 0; }
  .patch { white-space: pre-wrap; overflow-wrap: anywhere; }
  .explore-search .button { width: 100%; }
  .filter-chips { padding-bottom: .3rem; }
}


@media (max-width: 760px) {
  .estimate-table th:nth-child(3), .estimate-table td:nth-child(3),
  .estimate-table th:nth-child(4), .estimate-table td:nth-child(4) { display: none; }
  .estimate-table td, .estimate-table th { padding-inline: .5rem; }
}


.table-wrap:has(tbody:empty) { display: none; }
.admin-main .filters + .table-wrap:has(tbody:empty) + .card.empty { margin-top: 1rem; }
@media (max-width: 760px) {
  .admin-main form .button.primary { width: 100%; }
}


/* Live preservation progress */
.progress-card { border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: 14px; padding: 1rem 1.1rem; background: linear-gradient(135deg, var(--brand-soft), var(--surface)); }
.progress-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.progress-head strong { display: block; font-size: .95rem; margin-top: .2rem; }
.progress-percent { font-size: 1.2rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.progress-track { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: .8rem 0 .55rem; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s ease; }
.progress-message { margin: 0; font-size: .82rem; color: var(--text-2); }
.progress-meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: .55rem; color: var(--muted); font-size: .7rem; }
.progress-steps { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .8rem; }
.progress-step { padding: .28rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .65rem; font-weight: 650; }
.progress-step.active { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--surface); }
.progress-step.done { color: var(--success-text, #15803d); border-color: color-mix(in srgb, #22c55e 35%, var(--line)); }
@media (max-width: 760px) {
  .progress-card { padding: .9rem; }
  .progress-head strong { font-size: .88rem; }
  .progress-meta { flex-direction: column; gap: .2rem; }
}

