:root {
  /* Surfaces — solid, slightly lifted panels on a deep neutral canvas */
  --bg: #0c0e12;
  --bg-2: #0f1217;
  --panel: #161a21;
  --panel-2: #1b2029;
  --panel-3: #212834;
  --hover: #232a36;

  --ink: #e6eaf0;
  --ink-soft: #c2c9d4;
  --muted: #8b94a3;
  --muted-2: #6a7280;

  --line: #262c37;
  --line-2: #2e3543;
  --line-soft: #1c212a;

  /* Single confident accent (Vertali blue) */
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-ink: #bcd6ff;
  --accent-soft: #15233b;
  --accent-border: #2c4a7a;

  /* Semantic */
  --ok: #3fb950;
  --ok-soft: #14301d;
  --warn: #d6a02a;
  --warn-soft: #322611;
  --err: #f0616d;
  --err-soft: #341a1f;
  --info: #4a9fd6;

  --scroll: #2a313d;
  --scroll-hover: #3a4452;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 5px;

  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --topbar-h: 56px;
  --sidebar-w: 244px;
}

* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { min-height: 100%; background: var(--bg); }
body {
  font-family: var(--font);
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-2); text-decoration: none; transition: color .12s ease; }
a:hover { color: var(--accent-ink); text-decoration: none; }

/* ===== App shell ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--bg-2); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 0 18px;
  height: var(--topbar-h); border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.sidebar-brand .logo { height: 26px; width: auto; filter: brightness(0) invert(1); }
.sidebar-brand .b-name { font-weight: 600; font-size: 14.5px; color: var(--ink); letter-spacing: -.01em; }
.sidebar-brand .b-sub { font-size: 11px; color: var(--muted-2); }

.sidebar-nav { padding: 14px 12px; flex: 1 0 auto; }
.nav-group { margin-bottom: 18px; }
.nav-group-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted-2); padding: 0 10px; margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-soft); font-size: 13.5px; font-weight: 450; margin-bottom: 2px;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: #fff; }
.nav-item.active .ni-ico { color: var(--accent-2); }
.ni-ico { width: 18px; text-align: center; color: var(--muted); flex: 0 0 auto; font-size: 13px; }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.sidebar-foot .sf-meta { font-size: 11px; color: var(--muted-2); text-align: center; line-height: 1.5; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* Top bar */
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 22px; background: var(--bg-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .crumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.topbar .crumb .sep { color: var(--muted-2); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.topbar-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.topbar-user { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-soft); }
.avatar { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; border: 1px solid var(--accent-border); }

.content { padding: 26px 28px 40px; max-width: 1240px; width: 100%; flex: 1 0 auto; }
.content-narrow { max-width: 940px; }

/* Page header */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 21px; font-weight: 650; color: var(--ink); margin: 0 0 4px; letter-spacing: -.02em; }
.page-head p { color: var(--muted); font-size: 13.5px; margin: 0; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ===== Components ===== */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: .01em; text-transform: uppercase; }
.card-title-row { display: flex; align-items: center; gap: 9px; }
.card-title-row .ct-ico { color: var(--accent-2); font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); margin: 0 0 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 550; text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: #2f6fe0; border-color: #2f6fe0; color: #fff; }
.btn:focus-visible { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(59,130,246,.3); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--panel-2); color: var(--ink-soft); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); border-color: var(--line-2); }
.btn-danger { background: var(--err-soft); color: var(--err); border-color: #4a2329; }
.btn-danger:hover { background: var(--err); color: #fff; border-color: var(--err); }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: #5fd17a; border-color: #234c33; }
.pill-warn { background: var(--warn-soft); color: #e6b94e; border-color: #4d3a16; }
.pill-err { background: var(--err-soft); color: #ff8b94; border-color: #4a2329; }
.pill-neutral { background: var(--panel-3); color: var(--muted); border-color: var(--line-2); }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.stat .s-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.stat .s-label .si { color: var(--accent-2); }
.stat .s-value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.stat .s-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }

/* Tool grid */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tool {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; transition: border-color .12s ease, background .12s ease;
}
.tool:hover { border-color: var(--accent-border); background: var(--panel-2); text-decoration: none; }
.tool-ico { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-2); display: flex; align-items: center; justify-content: center; font-size: 16px; border: 1px solid var(--accent-border); margin-bottom: 12px; }
.tool h3 { margin: 0 0 5px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.tool p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.tool .tool-tag { display: inline-block; margin-top: 10px; font-size: 11px; color: var(--accent-2); font-weight: 500; }

/* Tables */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: var(--bg-2); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--panel-2); }
.cell-strong { font-weight: 600; color: var(--ink); }
.cell-muted { color: var(--muted); }
.cell-mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cell-actions { white-space: nowrap; text-align: right; }
.link { color: var(--accent-2); background: none; border: none; padding: 0; cursor: pointer; font-size: 13px; font-family: inherit; }
.link:hover { color: var(--accent-ink); text-decoration: underline; }
.link-danger { color: var(--err); }
.link-sep { color: var(--line-2); margin: 0 8px; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input {
  width: 100%; padding: 9px 12px; background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 13.5px; font-family: var(--font);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,130,246,.22); }
.input-mono { font-family: var(--mono); font-size: 12.5px; }
.search-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.search-bar .input { flex: 1; }

/* Toolbar / filters */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-bar { flex: 1 1 280px; margin-bottom: 0; }

/* Onboarding empty state */
.onboard { background: var(--panel); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 40px 28px; text-align: center; }
.onboard-ico { width: 48px; height: 48px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-2); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.onboard-ico svg { width: 22px; height: 22px; }
.onboard .tool-grid { justify-content: center; }

/* Pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager-nav { display: flex; gap: 8px; }

/* Clickable table rows */
table.data.clickable tbody tr { cursor: pointer; }

/* Settings */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row .sr-label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.setting-row .sr-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.setting-row .sr-val { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.code-chip { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--radius-xs); padding: 4px 8px; display: inline-flex; align-items: center; gap: 8px; }
.code-chip .copy { color: var(--accent-2); cursor: pointer; background: none; border: none; font-size: 12px; }

.callout-ok { background: var(--ok-soft); color: #6ee096; border-color: #234c33; }
.callout-err { background: var(--err-soft); color: #ff8b94; border-color: #4a2329; }
.callout-info { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-border); }

/* ===== Submission viewer (focused, top bar only) ===== */
.focus-topbar {
  height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 22px; background: var(--bg-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.focus-topbar .ft-brand { display: flex; align-items: center; gap: 10px; }
.focus-topbar .ft-brand .logo { height: 26px; width: auto; filter: brightness(0) invert(1); }
.focus-topbar .ft-meta { font-size: 12px; color: var(--muted); }

.submission { max-width: 1000px; margin: 0 auto; padding: 26px 22px 48px; }
.sub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sub-title { font-size: 20px; font-weight: 650; color: var(--ink); margin: 0 0 4px; letter-spacing: -.02em; }
.sub-sub { color: var(--muted); font-size: 13px; }
.sub-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.share-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.share-box label { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.share-row { display: flex; gap: 8px; }
.share-row .input { flex: 1; }
.btn-copy.copied { background: var(--ok); border-color: var(--ok); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.tile .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-bottom: 4px; }
.tile .v { font-size: 14px; color: var(--ink); font-weight: 600; word-break: break-word; }

.filetree { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); padding: 6px; }
ul.tree, ul.tree-sub { list-style: none; margin: 2px 0; padding-left: 16px; }
ul.tree { padding-left: 4px; }
.tree li { padding: 2px 0; }
.tree .dir > .dl { font-weight: 600; color: var(--accent-2); }
.tree .ico { color: var(--muted); margin-right: 6px; font-size: 11px; }
.tree .file a { font-size: 13px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 5px; width: 100%; }
.tree .file a:hover { background: var(--panel-2); text-decoration: none; }
.tree .file a::before { content: "\1F4C4"; font-size: 12px; opacity: .7; }

.preview { background: #06080c; color: #c0ccd9; padding: 14px; border-radius: var(--radius-sm); max-height: 420px; overflow: auto; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; margin-top: 12px; border: 1px solid var(--line); }
.preview::-webkit-scrollbar-thumb { background: #1d2735; }

/* Login (centered, no sidebar) */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand .logo { height: 28px; width: auto; filter: brightness(0) invert(1); }
.auth-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.auth-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 18px; }

/* Footer (compact, unified) */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); flex-shrink: 0; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 22px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-left { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.footer-left .logo { height: 20px; width: auto; filter: brightness(0) invert(1); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); font-size: 12.5px; }
.footer-links a:hover { color: var(--ink); }
.footer-meta { font-size: 12px; color: var(--muted-2); text-align: right; }
.footer-meta .attr { color: var(--muted); }

/* ===== Docs (privacy / terms) ===== */
.docs { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; max-width: 1180px; }
.docs-rail { position: sticky; top: 86px; }
.docs-rail .rail-eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 12px; }
.docs-nav { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs-nav a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; }
.docs-nav a:hover { color: var(--ink); text-decoration: none; }
.docs-nav a.active { color: var(--accent-2); border-left-color: var(--accent-2); font-weight: 600; }
.docs-title { font-size: 28px; font-weight: 650; color: var(--ink); margin: 0 0 6px; letter-spacing: -.02em; }
.docs-lead { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.docs-meta { color: var(--muted-2); font-size: 12.5px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 18px; }
.docs-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0 24px; }
.sum-card { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 14px 16px; }
.sum-card h4 { margin: 0 0 5px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.sum-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.docs-main h2 { font-size: 18px; font-weight: 650; color: var(--ink); margin: 30px 0 12px; scroll-margin-top: 80px; }
.docs-main h2 .num { color: var(--accent-2); font-weight: 700; margin-right: 8px; }
.docs-main h3 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 18px 0 8px; }
.docs-main p { color: var(--ink-soft); font-size: 14px; margin: 0 0 12px; line-height: 1.7; }
.docs-main ul { color: var(--ink-soft); font-size: 14px; padding-left: 20px; margin: 0 0 12px; line-height: 1.7; }
.docs-main li { margin: 7px 0; }
.docs-main a { color: var(--accent-2); }
.docs-main strong { color: #fff; font-weight: 600; }
.docs-main .notice { background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--radius-sm); padding: 13px 15px; font-size: 13px; color: var(--accent-ink); margin: 0 0 22px; }
.docs-main .notice strong { color: #fff; }
.docs-main .deflist { margin: 0 0 12px; }
.docs-main .deflist div { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.docs-main .deflist div:last-child { border-bottom: none; }
.docs-main .deflist dt { font-weight: 600; color: var(--accent-2); flex: 0 0 140px; }
.docs-main .deflist dd { margin: 0; color: var(--muted); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .docs { grid-template-columns: 1fr; gap: 20px; }
  .docs-rail { position: static; }
  .docs-nav { display: none; }
  .docs-summary { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .stat-grid, .tool-grid, .tiles { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 36px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }
}
