/* Dark theme for the VSBLTY model card inventory.
   Two columns: sidebar (search + list) + main pane (header + tabs + content). */

:root {
  --bg: #0d1421;
  --bg-2: #131a2a;
  --bg-3: #1a2236;
  --border: #1f2a44;
  --text: #e6e9f2;
  --text-dim: #a3acc4;
  --accent: #4f8cff;
  --accent-2: #6aa9ff;
  --green: #2bb673;
  --green-bg: #14352a;
  --yellow: #d4a73b;
  --red: #d04848;
  --header-bg: #0a111d;
  --shadow: 0 1px 3px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  height: 100vh;
  overflow: hidden;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top header ---------- */

.topbar {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.topbar .title { font-size: 18px; font-weight: 600; }
.topbar .subtitle { color: var(--text-dim); margin-left: 12px; font-size: 13px; }
.topbar .right { color: var(--text-dim); font-size: 13px; display: flex; gap: 16px; align-items: center; }
.topbar .right .button {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.topbar .right .button:hover { background: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------- main layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - 56px);
}

/* ---------- sidebar ---------- */

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px;
}

.sidebar .search-row {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.sidebar input[type="text"],
.sidebar select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  width: 100%;
}
.sidebar .filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar .new-card-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 4px;
  width: 100%;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 8px;
}
.sidebar .new-card-btn:hover { background: var(--accent-2); }

.sidebar .import-btn {
  background: var(--bg-3);
  border: 1px dashed var(--border);
  color: var(--text);
  padding: 8px;
  border-radius: 4px;
  width: 100%;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 16px;
}

.card-item {
  background: var(--bg-3);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 120ms;
}
.card-item:hover { border-color: var(--accent); }
.card-item.active { border-color: var(--accent); background: rgba(79, 140, 255, 0.1); }
.card-item .name { font-weight: 600; margin-bottom: 4px; }
.card-item .meta { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.card-item .badges { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.badge.production { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.badge.staging { color: var(--yellow); border-color: var(--yellow); }
.badge.deprecated { color: var(--red); border-color: var(--red); }
.badge.ok { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.badge.warning { color: var(--yellow); border-color: var(--yellow); }
.badge.error { color: var(--red); border-color: var(--red); }

/* ---------- main pane ---------- */

.main {
  overflow-y: auto;
  padding: 32px 48px;
}

.empty-state {
  color: var(--text-dim);
  text-align: center;
  margin-top: 80px;
  font-size: 16px;
}

.card-header { margin-bottom: 24px; }
.card-header h1 {
  margin: 0 0 4px 0;
  font-size: 28px;
  font-weight: 700;
  display: inline;
}
.card-header .version-badge {
  display: inline-block;
  color: var(--text-dim);
  margin-left: 8px;
  font-size: 14px;
  vertical-align: middle;
}
.card-header .badges {
  display: inline-flex;
  gap: 8px;
  vertical-align: middle;
  margin-left: 12px;
}
.card-header .sub-meta {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------- tabs ---------- */

.tabs {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 0;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  user-select: none;
}
.tab.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.tab:hover { color: var(--text); }

.tab-content { padding-bottom: 60px; }

/* ---------- sections ---------- */

.section { margin-bottom: 32px; }
.section h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
}
.subhead {
  text-transform: uppercase;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  margin: 16px 0 8px 0;
  font-weight: 600;
}

.kv {
  display: grid;
  grid-template-columns: 180px 1fr;
  row-gap: 10px;
  margin-bottom: 12px;
}
.kv > .k { color: var(--text-dim); }
.kv > .v { color: var(--text); word-break: break-word; }

.kv-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}
table.data th, table.data td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
table.data th {
  background: var(--bg-3);
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  font-weight: 600;
}
table.data tr:last-child td { border-bottom: 0; }
table.data .pass-ok { color: var(--green); }
table.data .pass-no { color: var(--red); }

ul.bullets { margin: 0 0 12px 16px; padding: 0; }
ul.bullets li { margin-bottom: 4px; }

.placeholder { color: var(--text-dim); font-style: italic; }

/* ---------- editor specifics ---------- */

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.editor-toolbar .file-pill {
  background: var(--bg-3);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.editor-toolbar .badge.unsaved { color: var(--yellow); border-color: var(--yellow); }
.editor-toolbar .spacer { flex: 1; }
.editor-toolbar button {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.editor-toolbar button:hover { border-color: var(--accent); }
.editor-toolbar button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.editor-toolbar button.danger { background: var(--bg-3); color: var(--red); border-color: var(--red); }

form .field { margin-bottom: 12px; }
form label.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
form label.field-label .req { color: var(--red); }
form input[type="text"],
form input[type="email"],
form input[type="date"],
form input[type="number"],
form textarea,
form select {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}
form textarea { min-height: 80px; resize: vertical; }
form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
form fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}
form fieldset legend {
  color: var(--text-dim);
  padding: 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
form .add-btn {
  background: var(--bg-3);
  border: 1px dashed var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 16px;
}
form .add-btn:hover { border-color: var(--accent); color: var(--accent-2); }
form .remove-btn {
  float: right;
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.repeat-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--bg-3);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 200ms;
  z-index: 9999;
  max-width: 380px;
}
.toast.show { opacity: 1; }
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }

/* ---------- markdown ---------- */
.markdown { line-height: 1.6; }
.markdown p { margin: 0 0 12px 0; }
.markdown ul, .markdown ol { margin: 0 0 12px 24px; padding: 0; }
.markdown li { margin-bottom: 4px; }
.markdown strong { color: var(--text); font-weight: 600; }
.markdown em { font-style: italic; }
.markdown code {
  font-family: ui-monospace, monospace;
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12.5px;
}
.markdown pre {
  background: var(--bg-3);
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
}
.markdown a { color: var(--accent-2); }
.markdown h1, .markdown h2, .markdown h3 { color: var(--text); margin-top: 16px; margin-bottom: 8px; }

/* ---------- attachments gallery ---------- */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
figure.attachment {
  margin: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
figure.attachment.image img {
  width: 100%;
  height: auto;
  display: block;
  background: white;
}
figure.attachment.file {
  padding: 20px;
}
figure.attachment .file-link {
  display: block;
  font-size: 14px;
}
figure.attachment figcaption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ---------- validation banner ---------- */
.validation-banner {
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--yellow);
  background: rgba(212, 167, 59, 0.08);
}
.validation-banner.error {
  border-color: var(--red);
  background: rgba(208, 72, 72, 0.08);
}
.validation-banner strong { display: block; margin-bottom: 6px; }
.validation-banner ul { margin: 6px 0 0 24px; padding: 0; font-size: 12px; }
.validation-banner code { font-family: ui-monospace, monospace; color: var(--text); }

/* ---------- header action buttons ---------- */
.header-actions { display: flex; gap: 8px; }
.action-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  display: inline-block;
}
.action-btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* ---------- model versions ---------- */
.version-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.version-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.version-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.version-header .version-name {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 14px;
}
.version-created { color: var(--text-dim); font-size: 12px; }
.version-file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-3);
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.version-file-info { display: flex; align-items: center; gap: 10px; }
.version-file-info .file-icon { font-size: 18px; }
.version-file-info code {
  font-family: ui-monospace, monospace;
  background: transparent;
  font-size: 13px;
}
.version-size { color: var(--text-dim); font-size: 12px; }
.version-path {
  color: var(--text-dim);
  font-size: 11px;
  margin-bottom: 8px;
}
.version-path code { background: transparent; font-family: ui-monospace, monospace; }
.version-notes { margin-top: 8px; }

/* ---------- severity badges ---------- */
.badge.severity-low      { color: var(--green); border-color: var(--green); background: var(--green-bg); }
.badge.severity-medium   { color: var(--yellow); border-color: var(--yellow); }
.badge.severity-high     { color: var(--red); border-color: var(--red); }
.badge.severity-critical { color: white; background: var(--red); border-color: var(--red); }

/* ---------- Orin testing tab — stat cards + comparison table ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--bg-3) 0%, #1c2845 100%);
  border-color: var(--accent);
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

.stat-card.highlight .stat-value {
  color: var(--accent-2);
}

.stat-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 2px;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

table.comparison-table td.num,
table.comparison-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.comparison-table tr.row-total {
  background: rgba(79, 140, 255, 0.06);
  font-weight: 600;
}

table.comparison-table tr.row-total td {
  border-top: 2px solid var(--border);
}

.ratio-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.ratio-pill.ratio-great {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.ratio-pill.ratio-good {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green);
}

.ratio-pill.ratio-tied {
  color: var(--text-dim);
}

.ratio-pill.ratio-bad {
  color: var(--red);
  border-color: var(--red);
}

@media print {
  .stat-card { background: white !important; border: 1px solid #999 !important; }
  .stat-card.highlight { background: #f0f5ff !important; }
  .stat-value, .stat-card.highlight .stat-value { color: black !important; }
  .stat-label, .stat-sub, .stat-unit { color: #555 !important; }
  .ratio-pill.ratio-great { background: #2bb673 !important; color: white !important; }
  .ratio-pill.ratio-good { background: #d4ecdc !important; color: #1f7d4a !important; }
  table.comparison-table tr.row-total { background: #f0f0f0 !important; }
}

/* ---------- Video comparison: side-by-side autoplay pair ---------- */

.video-compare-section {
  background: var(--bg-2);
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.video-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .video-compare-grid { grid-template-columns: 1fr; }
}

.video-compare-pane {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-compare-pane.ours-pane     { border-color: var(--green); }
.video-compare-pane.baseline-pane { border-color: var(--text-dim); }

.video-pane-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 13px;
}

.video-pane-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}

.video-pane-tag.ours-tag {
  color: white;
  background: var(--green);
}

.video-pane-tag.baseline-tag {
  color: var(--text-dim);
  background: var(--border);
}

.video-pane-label {
  color: var(--text);
  font-weight: 500;
}

.video-compare-pane video {
  width: 100%;
  height: auto;
  display: block;
  background: black;
}

.video-pane-metric {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.video-compare-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.video-source-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
}

.video-source-note code {
  background: transparent;
  font-family: ui-monospace, monospace;
}

@media print {
  .video-compare-section { background: white !important; border: 1px solid #999 !important; }
  .video-compare-pane { display: none; }     /* videos can't print — substitute a note */
  .video-compare-section::after {
    content: "(Video comparison — see live model card)";
    display: block;
    color: #888 !important;
    font-style: italic;
    padding: 12px 0;
  }
  .video-compare-controls { display: none; }
}

/* ---------- video attachment (full width) ---------- */
figure.attachment.video {
  grid-column: 1 / -1;      /* span the whole attachments grid */
}
figure.attachment.video video {
  width: 100%;
  max-height: 78vh;
  display: block;
  background: #000;
}

/* ---------- image lightbox ---------- */
img.zoomable { cursor: zoom-in; }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
}
.lightbox.open { display: flex; }

.lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  margin-top: 14px;
  color: #e6e9f2;
  font-size: 14px;
  max-width: 80vw;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

/* ---------- print stylesheet ---------- */
@media print {
  body { background: white; color: black; height: auto; overflow: visible; }
  .topbar, .sidebar, .no-print { display: none !important; }
  .layout { display: block; height: auto; }
  .main { overflow: visible; padding: 0; }
  .print-section { page-break-inside: avoid; margin-bottom: 24px; }
  .print-section-title {
    font-size: 22px;
    border-bottom: 2px solid #333;
    padding-bottom: 4px;
    margin: 24px 0 16px 0;
  }
  table.data { border-color: #ccc; }
  table.data th, table.data td { border-color: #ccc; color: black; }
  table.data th { background: #eee; }
  .card-item, .card-header h1, .markdown, .v, .k { color: black !important; }
  .placeholder { color: #888 !important; }
  figure.attachment.image img { page-break-inside: avoid; max-height: 360px; object-fit: contain; }
}

.dl-hint { color: var(--muted, #666); margin: 0 0 12px; }
.dl-sha { flex-basis: 100%; font-family: monospace; font-size: 11px; color: var(--muted, #888); word-break: break-all; margin-top: 4px; }
.version-file-info { flex-wrap: wrap; }

/* ---------- readability pass ---------- */
.action-btn { white-space: nowrap; }
table.data td { overflow-wrap: break-word; vertical-align: top; line-height: 1.45; }
.badge { white-space: nowrap; }
.kv .v { overflow-wrap: anywhere; }
table.data th { white-space: nowrap; }
.version-card { overflow: hidden; }
.card-item { padding: 12px 14px; }
.card-item .meta { margin-bottom: 6px; }
.home-table tbody tr { cursor: pointer; }
.home-table tbody tr:hover td { background: var(--bg-3); }
.home-table td { vertical-align: middle; padding: 14px; font-size: 14px; }
.home-table .row-actions { text-align: right; white-space: nowrap; }
.version-card h3 .badge, .version-header h3 .badge { vertical-align: middle; margin-left: 4px; }

/* ---------- at a glance + home ---------- */
.dim { color: var(--text-dim); }
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 28px; }
.glance-item { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.glance-label { color: var(--text-dim); font-size: 12px; margin-bottom: 6px; line-height: 1.35; }
.glance-value { font-size: 18px; font-weight: 700; line-height: 1.25; }
.glance-value.small { font-size: 14px; font-weight: 400; }
.glance-action { display: flex; align-items: center; justify-content: center; }
.action-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.action-btn.primary:hover { background: var(--accent-2); text-decoration: none; }
.home-table .h-metric strong { font-size: 15px; }
.home-table td .badge { margin: 2px 2px 2px 0; }
.home-table .h-files { white-space: nowrap; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =================== visual polish =================== */
:root {
  --bg: #0b1120;
  --bg-2: #111a2e;
  --bg-3: #17223a;
  --border: #22304f;
  --text: #eef1f8;
  --accent: #5b8cff;
  --accent-2: #7aa5ff;
  --radius: 12px;
}
html, body { font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body { background: radial-gradient(1200px 600px at 70% -10%, rgba(91,140,255,0.10), transparent 60%), var(--bg); }
code, .dl-sha, .version-file-info code { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* top bar */
.topbar { background: rgba(8,13,26,0.85); backdrop-filter: blur(8px); height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 800; font-size: 15px;
  background: linear-gradient(135deg, #5b8cff, #8b5bff); color: #fff; box-shadow: 0 4px 14px rgba(91,140,255,0.35); }
.topbar .title { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.topbar .subtitle { border-left: 1px solid var(--border); padding-left: 12px; }

/* sidebar: flat list with accent bar */
.sidebar { background: rgba(17,26,46,0.6); padding: 16px 12px; }
.sidebar input[type="text"] { border-radius: 8px; padding: 10px 12px; }
.card-item { background: transparent; border: 0; border-left: 3px solid transparent; border-radius: 8px; padding: 10px 12px; margin-bottom: 2px; }
.card-item:hover { background: var(--bg-3); }
.card-item.active { background: rgba(91,140,255,0.12); border-left-color: var(--accent); }
.card-item .name { font-size: 13.5px; }
.card-item .meta { margin-bottom: 0; }
.card-item .badges:empty { display: none; }

/* main + headings */
.main { padding: 36px 48px; }
.card-header h1 { font-size: 30px; letter-spacing: -0.6px; }
.section h2 { letter-spacing: -0.3px; }
.tabs { gap: 6px; border-bottom: 1px solid var(--border); }
.tab { padding: 10px 14px; border-radius: 8px 8px 0 0; font-weight: 500; }
.tab:hover { background: var(--bg-2); }
.tab.active { background: var(--bg-2); }
.action-btn { border-radius: 8px; font-weight: 500; transition: background 120ms, border-color 120ms; }
.action-btn:hover { border-color: var(--accent); text-decoration: none; }
.action-btn.primary { background: linear-gradient(135deg, #5b8cff, #6f7dff); border-color: transparent; box-shadow: 0 4px 14px rgba(91,140,255,0.25); }
table.data { border-radius: var(--radius); }
.version-card { border-radius: var(--radius); }
.badge { border-radius: 999px; padding: 2px 10px; font-weight: 500; }
.val-note { display: block; font-size: 12px; font-weight: 500; color: var(--text-dim); margin-top: 2px; }

/* at a glance */
.glance-item { border-radius: var(--radius); background: linear-gradient(180deg, var(--bg-2), rgba(17,26,46,0.6)); }
.glance-item:first-child { border-color: rgba(91,140,255,0.45); }
.glance-value { font-size: 22px; letter-spacing: -0.3px; }

/* home */
.home-hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.8px; margin: 0 0 8px; }
.home-hero p { color: var(--text-dim); font-size: 15px; margin: 0 0 24px; max-width: 760px; line-height: 1.55; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.stat-value { font-size: 32px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff, #9fb9ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding-bottom: 48px; }
.model-tile { background: linear-gradient(180deg, var(--bg-2), rgba(17,26,46,0.55)); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: transform 140ms, border-color 140ms, box-shadow 140ms; }
.model-tile:hover { transform: translateY(-2px); border-color: rgba(91,140,255,0.6); box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tile-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; letter-spacing: -0.2px; }
.tile-ver { flex-shrink: 0; font-size: 12px; color: var(--accent-2); background: rgba(91,140,255,0.12); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.tile-metric { flex: 1; }
.tile-metric-label { color: var(--text-dim); font-size: 12px; line-height: 1.4; margin-bottom: 4px; }
.tile-metric-value { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.2; }
.tile-metric-value.muted { font-size: 15px; font-weight: 500; color: var(--text-dim); }
.tile-hw .badge { font-size: 11.5px; }
.tile-actions { display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.tile-actions .action-btn { flex: 1; text-align: center; padding: 8px 10px; }
@media (max-width: 1100px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.tabs { gap: 2px; }
.tab { padding: 10px 12px; }

/* =================== UX pass =================== */
.title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.title-line h1 { display: block; margin: 0; }
.title-line .tile-ver { font-size: 13px; padding: 4px 12px; }
.card-header .sub-meta { font-size: 14px; margin-top: 8px; max-width: 780px; line-height: 1.5; }
.card-header .header-actions { align-self: flex-start; }
.stat-row .stat-label { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }
.tile-purpose { color: var(--text-dim); font-size: 13px; line-height: 1.45; margin-top: -6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-sha { cursor: pointer; position: relative; padding-right: 64px; }
.dl-sha::after { content: attr(data-label); position: absolute; right: 0; top: 0; color: var(--accent-2); font-family: 'Inter', sans-serif; opacity: 0; transition: opacity 120ms; }
.version-file:hover .dl-sha::after, .dl-sha.copied::after { opacity: 1; }
.dl-sha.copied { color: var(--green); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
@media (max-width: 1050px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 24px 20px; }
}

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 32px; display: grid; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.login-card .brand { margin-bottom: 4px; }
.login-sub { color: var(--text-dim); margin: 0 0 8px; line-height: 1.5; }
.login-card label { font-size: 13px; color: var(--text-dim); }
.login-card input { background: var(--bg-3); border: 1px solid var(--border); color: var(--text); padding: 11px 12px; border-radius: 8px; font-size: 14px; }
.login-card input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.login-card button { padding: 11px; font-size: 14px; margin-top: 4px; cursor: pointer; }
.login-error { background: rgba(208,72,72,0.12); border: 1px solid rgba(208,72,72,0.5); color: #ff9a9a; padding: 9px 12px; border-radius: 8px; font-size: 13px; }
