/* ============================================================
   Signet — Dashboard
   Base UI recreated from the Modulix reference; extended with
   Signet-specific states (PR status, release chain, reputation).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600;700;800;900&family=Spline+Sans+Mono:wght@400;500;600&display=swap');

:root {
  /* surfaces */
  --bg-app: #0b0c0e;
  --bg-side: #0c0c0c;
  --bg-card: #121212;
  --bg-card-2: #161616;
  --bg-elev: #1b1b1b;
  --bg-input: #101010;

  /* borders */
  --bd: rgba(255, 255, 255, 0.07);
  --bd-strong: rgba(255, 255, 255, 0.12);
  --bd-soft: rgba(255, 255, 255, 0.045);

  /* text */
  --tx: #f4f4f5;
  --tx-2: #a1a1a4;
  --tx-3: #6b6b6e;
  --tx-4: #565659;

  /* accents — primary brand hue uses the official Sui palette
     (Sui Sea Blue #4DA2FF + Aqua #C0E6FF). Status colors (green/red/amber)
     stay semantic so success/error/warning remain readable. */
  --green: #46d18a;
  --green-dim: #2fae6f;
  --red: #f15b4c;
  --amber: #f0b13e;
  --blue: #c6f24e;   /* primary accent — electric lime (Terminal/Proof identity; off Sui-blue). Token name kept; value reskinned. */
  --violet: #d8ff6a; /* light ink accent */

  --disp: 'Archivo', system-ui, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, 'JetBrains Mono', monospace;

  /* motion tokens — keep the existing Modulix feel, unified */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --t-fast: .12s;
  --t: .2s;
  --t-slow: .3s;

  --r-lg: 4px;
  --r-md: 3px;
  --r-sm: 3px;

  --side-w: 286px;
  --side-w-collapsed: 84px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #000;
}

body {
  font-family: var(--mono);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Display face for headings + big titles (Terminal/Proof: Archivo over mono body). */
h1, h2, h3, .view-title, .modal h2, .sec-title { font-family: var(--disp); letter-spacing: -0.01em; }

.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100vh;
  background: var(--bg-app);
  transition: grid-template-columns var(--t)var(--ease);
}
.app.collapsed { grid-template-columns: var(--side-w-collapsed) 1fr; }

svg { display: block; }
.ico { width: 22px; height: 22px; flex: none; stroke: currentColor; }

a { color: inherit; text-decoration: none; }

/* ---- Global focus-visible (keyboard a11y) — mouse focus untouched ---- */
:focus { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible,
.nav-item:focus-visible, .subitem:focus-visible, .toggle:focus-visible,
.seg button:focus-visible, .sr-item:focus-visible, .dd-menu div:focus-visible,
.tree-row:focus-visible, .copy-btn:focus-visible, .wm-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ---- Universal pressed feedback (tactile) — reduce-motion safe ---- */
button:active:not(:disabled), .nav-item:active, .subitem:active,
.tb-btn:active, .copy-btn:active, .filter-btn:active, .back-btn:active,
.cmd-copy:active, .cmd-action:active, .sr-item:active, .wm-item:active,
.dd-btn:active { transform: scale(.97); }
button, .nav-item, .tb-btn, .copy-btn, .filter-btn, .back-btn, .cmd-copy,
.cmd-action, .dd-btn { transition: transform var(--t-fast) var(--ease),
  background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
  border-color var(--t-fast) var(--ease), filter var(--t-fast) var(--ease); }
button:disabled, input:disabled, textarea:disabled, select:disabled {
  opacity: .5; cursor: not-allowed;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.side {
  background: var(--bg-side);
  border-right: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  padding: 26px 22px 22px;
  /* Scroll the sidebar itself when the viewport is too short, so every nav
     item stays reachable (and all are visible at once on normal heights). */
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bd-strong) transparent;
}
.side::-webkit-scrollbar { width: 8px; }
.side::-webkit-scrollbar-thumb {
  background: var(--bd-strong);
  border-radius: 8px;
}
.side::-webkit-scrollbar-track { background: transparent; }

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand .logo {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: radial-gradient(120% 120% at 50% 0%, #11161f, #0a0d14);
  border: 1px solid var(--bd-strong);
  display: grid; place-items: center;
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}
.brand .logo svg { width: 34px; height: 34px; display: block; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.brand .name { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.brand .collapse {
  margin-left: auto;
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--tx-3);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.brand .collapse:hover { background: var(--bg-elev); color: var(--tx); }

.side-divider {
  border: none;
  border-top: 1px dashed rgba(255,255,255,.11);
  margin: 22px 0 18px;
}

.nav-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--tx-4);
  margin: 0 4px 12px;
  text-transform: uppercase;
}

.nav { display: flex; flex-direction: column; gap: 5px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  color: var(--tx-2);
  font-size: 15.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.035); color: var(--tx); }
.nav-item.active {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border-color: var(--bd-strong);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.nav-item .ico { width: 21px; height: 21px; color: inherit; }
.nav-item .chev {
  margin-left: auto;
  width: 18px; height: 18px;
  color: var(--tx-3);
  transition: transform var(--t);
}
.nav-item.open .chev { transform: rotate(180deg); }
.nav-item .label-txt { transition: opacity var(--t-fast); }
.nav-item .count {
  margin-left: auto;
  font-size: 12.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg-elev); color: var(--tx-2);
  font-family: var(--mono);
}
.nav-item.open .count { margin-left: 0; margin-right: 6px; }

/* submenu */
.submenu {
  display: flex;
  flex-direction: column;
  margin: 2px 0 4px 27px;
  padding-left: 16px;
  border-left: 1.5px solid rgba(255,255,255,.1);
  overflow: hidden;
  transition: max-height var(--t-slow)ease, opacity var(--t);
}
.subitem {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0 9px 4px;
  color: var(--tx-2);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color var(--t-fast);
}
.subitem::before {
  content: "";
  position: absolute;
  left: -17px; top: 50%;
  width: 16px; height: 1.5px;
  background: rgba(255,255,255,.1);
}
.subitem .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--tx-3);
  flex: none;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.subitem:hover { color: var(--tx); }
.subitem:hover .dot { border-color: var(--tx); }
.subitem.active { color: #fff; }
.subitem.active .dot { background: var(--green); border-color: var(--green); }

/* user card */
.user-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--bd);
  background: var(--bg-card);
}
.user-card .av {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: var(--blue); color: #0a0c05;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px;
  flex: none;
  font-family: var(--mono);
}
.user-card .u-name { font-size: 14px; font-weight: 700; color: var(--tx); font-family: var(--mono); }
.user-card .u-mail { font-size: 12px; color: var(--tx-3); margin-top: 2px; }
.user-card .logout {
  margin-left: auto;
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--tx-2);
  border: 1px solid var(--bd);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.user-card .logout:hover { background: var(--bg-elev); color: #fff; }

/* collapsed state */
.app.collapsed .side { padding-left: 16px; padding-right: 16px; }
.app.collapsed .brand .name,
.app.collapsed .nav-label,
.app.collapsed .nav-item .label-txt,
.app.collapsed .nav-item .chev,
.app.collapsed .nav-item .count,
.app.collapsed .submenu,
.app.collapsed .user-card .u-name,
.app.collapsed .user-card .u-mail,
.app.collapsed .user-card .logout { display: none; }
.app.collapsed .brand .collapse { display: grid; margin-left: 0; }
.app.collapsed .brand { justify-content: center; }
.app.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.app.collapsed .user-card { justify-content: center; padding: 10px; }

/* ============================================================
   MAIN
   ============================================================ */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 34px;
  border-bottom: 1px solid var(--bd);
  flex: none;
}
.crumb { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.crumb .c-dim { color: var(--tx-3); font-weight: 500; }
.crumb .c-sep { color: var(--tx-4); }
.crumb .c-cur { display: flex; align-items: center; gap: 10px; color: var(--tx); font-weight: 600; }
.crumb .c-cur .ico { width: 22px; height: 22px; color: var(--tx-2); }

.net-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 4px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid rgba(70,209,138,.3);
  background: rgba(70,209,138,.08);
  color: var(--green); font-size: 13px; font-weight: 700;
  font-family: var(--mono);
}
.net-badge .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(70,209,138,.6);
  animation: pulse 1.8s infinite;
}
.net-badge.degraded { color: var(--amber); border-color: rgba(240,177,62,.36); background: rgba(240,177,62,.1); }
.net-badge.degraded .pulse { background: var(--amber); box-shadow: 0 0 0 0 rgba(240,177,62,.5); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(70,209,138,.5); }
  70% { box-shadow: 0 0 0 7px rgba(70,209,138,0); }
  100% { box-shadow: 0 0 0 0 rgba(70,209,138,0); }
}

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(440px, 38vw);
  padding: 13px 18px;
  border-radius: 13px;
  border: 1px solid var(--bd);
  background: var(--bg-input);
  color: var(--tx-3);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.search:focus-within { border-color: var(--bd-strong); background: #131313; }
.search .ico { width: 21px; height: 21px; }
.search input {
  border: none; background: none; outline: none;
  color: var(--tx); font-family: inherit; font-size: 15.5px;
  width: 100%;
}
.search input::placeholder { color: var(--tx-3); }

.content {
  padding: 30px 34px 40px;
  overflow-y: auto;
  flex: 1;
}
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: #1d1d1d; border-radius: 8px; border: 3px solid var(--bg-app); }

/* welcome */
.welcome-row { display: flex; align-items: flex-start; gap: 20px; }
.welcome h1 {
  font-size: 33px; font-weight: 800; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px;
}
.welcome p { color: var(--tx-2); font-size: 16.5px; margin-top: 10px; max-width: 640px; }
.cal-btn {
  margin-left: auto;
  height: 52px; padding: 0 20px;
  border-radius: 14px;
  border: 1px solid var(--bd);
  background: var(--bg-card);
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--tx-2);
  cursor: pointer; flex: none;
  font-family: var(--mono); font-size: 14px; font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast);
}
.cal-btn:hover { background: var(--bg-elev); color: #fff; }
.cal-btn .ico { width: 20px; height: 20px; }

/* stat cards */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 26px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  padding: 26px 28px 24px;
}
.stat .s-head { display: flex; align-items: center; gap: 14px; }
.stat .s-ico {
  width: 46px; height: 46px;
  border-radius: 12px;
  border: 1px solid var(--bd);
  background: var(--bg-card-2);
  display: grid; place-items: center;
  color: var(--tx);
}
.stat .s-ico .ico { width: 24px; height: 24px; }
.stat .s-title { font-size: 19px; font-weight: 600; }
.stat hr { border: none; border-top: 1px dashed rgba(255,255,255,.1); margin: 22px 0 0; }
.stat .s-bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 18px; }
.stat .s-num { font-size: 44px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-family: var(--mono); }
.stat .s-delta { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 16px; }
.stat .s-delta b { font-weight: 700; }
.stat .s-delta .up { color: var(--green); }
.stat .s-delta .down { color: var(--red); }
.stat .s-delta span { color: var(--tx-3); }
.spark { width: 92px; height: 50px; flex: none; }

/* layout: overview + side panel */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(300px, 1fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}
.col-left { display: flex; flex-direction: column; gap: 22px; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
}

/* overview */
.overview { padding: 26px 28px 22px; }
.ov-head { display: flex; align-items: flex-start; }
.ov-head h2 { font-size: 23px; font-weight: 700; }
.dropdown { position: relative; margin-left: auto; }
.dd-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1px solid var(--bd);
  background: var(--bg-card-2);
  color: var(--tx); font-size: 16px; font-weight: 600;
  cursor: pointer;
}
.dd-btn .ico { width: 18px; height: 18px; color: var(--tx-3); transition: transform var(--t); }
.dropdown.open .dd-btn .ico { transform: rotate(180deg); }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-elev);
  border: 1px solid var(--bd-strong);
  border-radius: 12px;
  padding: 6px;
  min-width: 170px;
  z-index: 20;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
}
.dropdown.open .dd-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }
.dd-menu div {
  padding: 10px 14px; border-radius: 8px; font-size: 15px; color: var(--tx-2); cursor: pointer;
}
.dd-menu div:hover { background: rgba(255,255,255,.06); color: #fff; }
.dd-menu div.sel { color: #fff; }

.ov-sub { margin-top: 20px; }
.ov-sub .lbl { color: var(--tx-2); font-size: 16px; }
.ov-avg { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.ov-avg .big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-family: var(--mono); }
.badge-pct {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 9px;
  background: rgba(70,209,138,.12);
  color: var(--green); font-size: 14px; font-weight: 700;
}

/* chart */
.chart { margin-top: 26px; position: relative; }
.gridlines { position: absolute; inset: 0 0 38px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.gridlines i { border-top: 1px dashed rgba(255,255,255,.07); display: block; }
.bars {
  position: relative; z-index: 2;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: clamp(14px, 2.4vw, 40px);
  height: 300px;
  padding: 0 6px;
}
.bar-wrap { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; cursor: pointer; }
.bar {
  width: 100%;
  max-width: 78px;
  min-height: 4px;
  border-radius: 12px 12px 8px 8px;
  position: relative;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 9px),
    var(--bg-elev);
  border: 1px solid rgba(255,255,255,.05);
  transition: filter var(--t-fast), height .4s var(--ease);
}
.bar::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 26px;
  background: #2a2a2a;
  border-radius: 11px 11px 0 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.bar-wrap:hover .bar { filter: brightness(1.35); }
.bar-wrap.active .bar {
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,.10) 0 2px, transparent 2px 9px),
    #ffffff;
  border-color: #fff;
}
.bar-wrap.active .bar::before { background: #fff; border-bottom-color: rgba(0,0,0,.08); }
.bar-month { margin-top: 16px; font-size: 15px; color: var(--tx-2); font-weight: 500; }
.bar-wrap.active .bar-month { color: #fff; font-weight: 600; }

/* capsule marker on active bar */
.cap {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  width: 78%; max-width: 60px;
  display: flex; flex-direction: column; align-items: center;
  z-index: 3; pointer-events: none;
}
.cap .nub { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--green); margin-bottom: -6px; z-index: 2; }
.cap .body {
  width: 100%; height: 30px; background: #fff; border-radius: 9px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: 0 8px;
}
.cap .body i { display: block; height: 1.5px; background: rgba(0,0,0,.14); border-radius: 2px; }

/* tooltip */
.tooltip {
  position: absolute; z-index: 6;
  transform: translate(-50%, -100%);
  background: #fff; color: #161616;
  border-radius: 14px;
  padding: 13px 18px;
  text-align: center;
  box-shadow: 0 14px 36px rgba(0,0,0,.45);
  pointer-events: none;
  transition: left var(--t) ease, top var(--t) ease;
}
.tooltip .t-date { font-size: 14px; color: #6b6b6e; font-weight: 500; }
.tooltip .t-val { font-size: 22px; font-weight: 800; margin-top: 3px; font-family: var(--mono); }
.tooltip::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 9px solid #fff;
}

/* table panel (recent pull requests) */
.deliveries { padding: 26px 28px 20px; }
.del-head { display: flex; align-items: center; }
.del-head h2 { font-size: 23px; font-weight: 700; }
.del-all {
  margin-left: auto;
  padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--bd); background: var(--bg-card-2);
  color: var(--tx-2); font-size: 13.5px; font-weight: 600; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.del-all:hover { background: var(--bg-elev); color: #fff; }
/* shared button style (still used by the Verify action button #verifyBtn) */
.filter-btn {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 12px;
  border: 1px solid var(--bd); background: var(--bg-card-2);
  color: var(--tx); font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background var(--t-fast);
}
.filter-btn:hover { background: var(--bg-elev); }
.filter-btn .ico { width: 18px; height: 18px; color: var(--tx-2); }

table { width: 100%; border-collapse: collapse; margin-top: 22px; }
thead th {
  text-align: left; font-size: 15px; font-weight: 600; color: var(--tx-2);
  padding: 0 0 16px; border-bottom: 1px solid var(--bd);
}
thead th .th-in { display: flex; align-items: center; gap: 10px; }
thead th .ico { width: 16px; height: 16px; color: var(--tx-3); }
tbody td { padding: 18px 0; font-size: 15.5px; color: var(--tx); border-bottom: 1px solid var(--bd-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: rgba(255,255,255,.012); }
.td-id { display: flex; align-items: center; gap: 14px; color: var(--tx-2); font-family: var(--mono); font-size: 14px; }
.mono { font-family: var(--mono); font-size: 14px; }
.link { color: var(--blue); }
.link:hover { text-decoration: underline; }
.btn-link { border: 0; background: transparent; padding: 0; cursor: pointer; color: inherit; }
.btn-link:hover { text-decoration: underline; }
.payment-qr {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.payment-qr .loading-shimmer {
  width: 132px;
  height: 44px;
  border-radius: 6px;
  display: block;
}
.qr-box {
  width: 132px;
  height: 132px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  overflow: hidden;
  background: #09111f;
}
.qr-box svg { width: 100%; height: 100%; display: block; }
.pg-walrus { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 2px; font-size: 11.5px; color: var(--green); font-family: var(--mono); }
.pg-walrus span, .pg-walrus a { border: 1px solid rgba(70,209,138,.25); background: rgba(70,209,138,.08); border-radius: 7px; padding: 3px 7px; }
.pg-walrus.bad { color: var(--amber); }
.pg-walrus.bad span, .pg-walrus.bad a { border-color: rgba(240,177,62,.3); background: rgba(240,177,62,.08); }

.status { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.status .ico { width: 18px; height: 18px; }
.status.open { color: var(--amber); }
.status.merged { color: var(--violet); }
.status.closed { color: var(--tx-3); }
.status.scheduled { color: var(--green); }
.status.way { color: var(--blue); }

/* side panel (latest releases) */
.buying { padding: 26px 26px 14px; }
.buying h2 { font-size: 23px; font-weight: 700; padding-bottom: 22px; border-bottom: 1px solid var(--bd); }
.buy-item { display: flex; gap: 16px; padding: 20px 0; border-bottom: 1px dashed rgba(255,255,255,.09); }
.buy-item:last-child { border-bottom: none; }
.buy-thumb {
  width: 52px; height: 52px; border-radius: 12px; flex: none;
  border: 1px solid var(--bd);
  background: var(--blue); color: #0a0c05;
  display: grid; place-items: center;
}
.buy-thumb .ico { width: 26px; height: 26px; }
.buy-info { min-width: 0; flex: 1; }
.buy-name { font-size: 16px; font-weight: 700; font-family: var(--mono); }
.buy-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx-3); margin-top: 9px; }
.buy-row .k { color: var(--tx-3); }
.buy-row .v { color: var(--tx-2); font-family: var(--mono); font-size: 13px; }

.pill {
  display: inline-flex; align-items: center;
  padding: 4px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid;
}
.pill.progress, .pill.open { color: var(--amber); border-color: rgba(240,177,62,.35); background: rgba(240,177,62,.08); }
.pill.merged, .pill.paid { color: var(--violet); border-color: rgba(176,140,245,.35); background: rgba(176,140,245,.08); }
.pill.released { color: var(--green); border-color: rgba(70,209,138,.35); background: rgba(70,209,138,.08); }
.pill.cancelled, .pill.closed { color: var(--red); border-color: rgba(241,91,76,.35); background: rgba(241,91,76,.08); }
.pill.hold, .pill.claimed { color: var(--blue); border-color: rgba(198,242,78,.35); background: rgba(198,242,78,.08); }

/* loading / empty / error states */
.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-card-2) 25%, var(--bg-elev) 50%, var(--bg-card-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-num { display: inline-block; width: 64px; height: 40px; }

/* skeleton placeholders for grids / tables / lists */
.skeleton-card {
  background: var(--bg-card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 22px 24px;
}
.skel-row { display: flex; align-items: center; gap: 12px; }
.skel-dot { width: 28px; height: 28px; border-radius: 8px; flex: none; display: inline-block; }
.skel-line { display: block; height: 11px; border-radius: 6px; }
.skel-tr td { padding: 18px 0; }

.empty-state {
  padding: 40px 0; text-align: center; color: var(--tx-3); font-size: 15px;
}
.empty-state.err { color: var(--red); }
/* subtle "breathing" only on loading-type empty states */
.empty-state.loading-pulse { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* reputation list (reuses buying panel) */
.rep-item { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px dashed rgba(255,255,255,.09); }
.rep-item:last-child { border-bottom: none; }
.rep-av { width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 12px; background: var(--bg-elev); color: var(--tx-2); border: 1px solid var(--bd); }
.rep-meta { flex: 1; min-width: 0; }
.rep-addr { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.rep-stats { display: flex; gap: 12px; margin-top: 5px; font-size: 12.5px; color: var(--tx-3); font-family: var(--mono); }
.rep-stats b { color: var(--tx); font-weight: 600; }

/* ============================================================
   Secondary views (Repositories / PRs / Releases / Agents / info)
   ============================================================ */
.view-head { margin-bottom: 22px; }
.view-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.view-head p { color: var(--tx-2); font-size: 16px; margin-top: 10px; max-width: 720px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px;
  margin-top: 26px;
}

/* repo / pr / agent / info cards share a base */
.repo-card, .pr-card, .agent-card, .info-card, .release-card {
  background: var(--bg-card);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.repo-card:hover, .pr-card:hover, .agent-card:hover, .info-card:hover {
  border-color: var(--bd-strong);
  transform: translateY(-2px);
}

.repo-card-head, .agent-card-head { display: flex; align-items: center; gap: 14px; }
.repo-ico {
  width: 44px; height: 44px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--blue); color: #0a0c05;
  border: 1px solid var(--bd-strong);
}
.repo-name { font-size: 17px; font-weight: 700; font-family: var(--mono); }
.repo-branch { font-size: 13px; color: var(--tx-3); margin-top: 3px; font-family: var(--mono); }

.repo-meta { margin-top: 18px; display: flex; flex-direction: column; gap: 11px; }
.repo-meta > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.repo-meta .k { color: var(--tx-3); font-size: 13px; }

/* PR cards */
.pr-card-top { display: flex; align-items: center; gap: 12px; }
.pr-title { font-size: 17px; font-weight: 600; margin: 14px 0 4px; }

/* release cards + provenance chain */
.release-card { margin-top: 20px; }
.release-head { display: flex; align-items: center; gap: 14px; }
.chain {
  margin-top: 20px;
  display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
}
.chain-node {
  flex: 1 1 160px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--bd); background: var(--bg-card-2);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.chain-node:hover { background: var(--bg-elev); }
.chain-node.g { border-left: 3px solid var(--green); }
.chain-node.b { border-left: 3px solid var(--blue); }
.chain-node.v { border-left: 3px solid var(--violet); }
.chain-label { font-size: 12px; color: var(--tx-3); text-transform: uppercase; letter-spacing: .08em; }
.chain-blob { font-size: 14px; color: var(--blue); }
.chain-arrow { display: grid; place-items: center; color: var(--tx-4); font-size: 22px; }

/* agent cards */
.agent-card-head { margin-bottom: 18px; }
.agent-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.agent-stat { background: var(--bg-card-2); border: 1px solid var(--bd); border-radius: 12px; padding: 14px 10px; text-align: center; }
.agent-stat .as-num { font-size: 26px; font-weight: 800; font-family: var(--mono); }
.agent-stat .as-lbl { font-size: 11.5px; color: var(--tx-3); margin-top: 4px; }
.agent-note { margin-top: 16px; font-size: 13px; color: var(--tx-3); line-height: 1.5; }

/* info cards (Trust / Walrus / MCP) */
.info-card h3 { font-size: 18px; font-weight: 700; margin: 16px 0 8px; }
.info-card p { font-size: 14.5px; color: var(--tx-2); line-height: 1.6; }
.info-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  border: 1px solid var(--bd-strong);
}
.info-ico.g { background: linear-gradient(160deg, #46d18a, #1d6e48); }
.info-ico.b { background: var(--bg-elev); border: 1px solid var(--bd-strong); color: var(--blue); }
.info-ico.v { background: var(--bg-elev); border: 1px solid var(--bd-strong); color: var(--violet); }

.endpoint-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 22px; }
.endpoint {
  flex: 1 1 280px;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 20px; border-radius: 14px;
  border: 1px solid var(--bd); background: var(--bg-card);
}
.endpoint .k { font-size: 12px; color: var(--tx-3); text-transform: uppercase; letter-spacing: .08em; }

.code-block {
  margin-top: 22px;
  background: #0a0a0a; border: 1px solid var(--bd);
  border-radius: 14px; padding: 20px 22px;
  overflow-x: auto;
}
.code-block code { font-family: var(--mono); font-size: 13.5px; color: var(--green); line-height: 1.7; white-space: pre; }

/* ============================================================
   Issues / Bounties / Activity / drill-down / cmd panels
   ============================================================ */

.clickable { cursor: pointer; }
.clickable:hover { border-color: var(--bd-strong); }

.bounty-amount { font-size: 17px; font-weight: 800; color: var(--green); }

/* command panel ("Do this via CLI/MCP") */
.cmd-panel {
  background: linear-gradient(180deg, rgba(198,242,78,.06), transparent);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 24px;
}
.cmd-head { display: flex; align-items: center; gap: 12px; }
.cmd-title { font-size: 14px; font-weight: 700; color: var(--tx); }
.cmd-copy {
  margin-left: auto;
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--bd-strong); background: var(--bg-elev);
  color: var(--tx); font-family: var(--mono); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.cmd-copy:hover { background: var(--blue); color: #0a0c05; border-color: var(--blue); }
.cmd-copy.copied { background: var(--green); color: #04140c; border-color: var(--green); }
.cmd-body { margin: 12px 0 8px; background: #0a0a0a; border: 1px solid var(--bd); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.cmd-body code { font-family: var(--mono); font-size: 13px; color: var(--green); white-space: pre; }
.cmd-note { font-size: 12.5px; color: var(--tx-3); }

/* activity feed */
.feed { margin-top: 26px; position: relative; padding-left: 8px; }
.feed-item { display: flex; gap: 16px; padding: 14px 0; position: relative; border-bottom: 1px solid var(--bd-soft); }
.feed-item:last-child { border-bottom: none; }
.feed-item::before {
  content: ""; position: absolute; left: 5px; top: 0; bottom: 0;
  width: 1.5px; background: var(--bd);
}
.feed-item:first-child::before { top: 22px; }
.feed-item:last-child::before { bottom: calc(100% - 22px); }
.feed-dot {
  width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 6px;
  background: var(--tx-3); border: 2px solid var(--bg-app); position: relative; z-index: 1;
}
.feed-dot.forge { background: var(--green); }
.feed-dot.pull_request { background: var(--amber); }
.feed-dot.release { background: var(--violet); }
.feed-dot.reputation { background: var(--blue); }
.feed-dot.issue { background: #e08c5a; }
.feed-dot.bounty { background: var(--green-dim); }
.feed-body { flex: 1; min-width: 0; }
.feed-top { display: flex; align-items: center; gap: 10px; }
.feed-type { font-size: 15px; font-weight: 700; }
.feed-mod { font-size: 11.5px; color: var(--tx-3); padding: 2px 8px; border-radius: 999px; background: var(--bg-elev); }
.feed-meta { display: flex; gap: 14px; margin-top: 5px; font-size: 13px; color: var(--tx-3); }

/* detail (drill-down) view */
.detail-bar { display: flex; align-items: center; gap: 16px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 11px;
  border: 1px solid var(--bd); background: var(--bg-card);
  color: var(--tx-2); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.back-btn:hover { background: var(--bg-elev); color: #fff; }
.back-btn .ico { width: 18px; height: 18px; }
.detail-title { font-size: 27px; font-weight: 800; letter-spacing: -.02em; font-family: var(--mono); }
.detail-grid { margin: 22px 0 24px; flex-direction: row !important; flex-wrap: wrap; gap: 24px !important; }
.detail-grid > div { flex-direction: column; align-items: flex-start !important; gap: 4px; justify-content: flex-start !important; }
.detail-h3 { font-size: 17px; font-weight: 700; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--bd); }

.repo-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 6px 0 22px;
}
.repo-guide-card {
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(198,242,78,.06), rgba(255,255,255,.01));
}
.repo-guide-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--tx-2); }
.repo-guide-body { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--tx-3); min-height: 44px; }
.repo-guide-foot { margin-top: 12px; }
.repo-guide-action.cmd-action { margin-left: 0; margin-right: 0; }

.repo-actions-panel {
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 24px;
  background: var(--bg-card);
}
.repo-actions-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.repo-actions-title { font-size: 14px; font-weight: 800; }
.repo-actions-note { margin-top: 4px; font-size: 12.5px; color: var(--tx-3); }
.repo-actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.repo-actions-row .cmd-action { margin: 0; }

.repo-inline-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: -2px 0 14px; }
.repo-inline-actions .cmd-action { margin: 0; }

.repo-proof-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.repo-proof-panel .cmd-action { margin-left: auto; margin-right: 8px; }
.repo-action-danger {
  border-color: rgba(241,91,76,.35);
  background: rgba(241,91,76,.12);
  color: #ffd3ce;
}
.repo-action-danger:hover { background: rgba(241,91,76,.2); }

.repo-agent-card .agent-link {
  border: 0;
  background: transparent;
  color: var(--tx);
  cursor: pointer;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
}
.repo-agent-card .agent-link:hover { color: #fff; }

/* file tree */
.tree { border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; }
.tree-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; cursor: pointer;
  border-bottom: 1px solid var(--bd-soft);
  transition: background var(--t-fast);
}
.tree-row:last-child { border-bottom: none; }
.tree-row:hover { background: rgba(255,255,255,.025); }
.tree-ico { width: 17px; height: 17px; color: var(--tx-3); }
.tree-path { font-family: var(--mono); font-size: 14px; flex: 1; }
.tree-prove { font-family: var(--mono); font-size: 11px; color: var(--blue); background: rgba(198,242,78,.08);
  border: 1px solid rgba(198,242,78,.25); border-radius: 999px; padding: 3px 9px; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast); }
.tree-prove:hover { background: rgba(198,242,78,.16); color: var(--violet); }
.tree-size { font-size: 12.5px; color: var(--tx-4); }
.tree-hash { font-size: 12.5px; color: var(--tx-3); width: 70px; text-align: right; }

.file-view { margin-top: 16px; }
.file-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg-elev); border: 1px solid var(--bd); border-radius: 10px 10px 0 0; font-size: 13.5px; }
.file-code { margin: 0; background: #0a0a0a; border: 1px solid var(--bd); border-top: none; border-radius: 0 0 10px 10px; padding: 16px 18px; overflow-x: auto; max-height: 460px; overflow-y: auto; }
.file-code code { font-family: var(--mono); font-size: 13px; color: var(--tx); white-space: pre; line-height: 1.6; }

/* diff */
.diff { border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; }
.diff-row { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--bd-soft); font-family: var(--mono); font-size: 13.5px; }
.diff-row:last-child { border-bottom: none; }
.diff-mark { width: 16px; text-align: center; font-weight: 700; }
.diff-add { background: rgba(70,209,138,.06); } .diff-add .diff-mark { color: var(--green); }
.diff-del { background: rgba(241,91,76,.06); } .diff-del .diff-mark { color: var(--red); }
.diff-mod { background: rgba(240,177,62,.05); } .diff-mod .diff-mark { color: var(--amber); }

.review-card { margin-bottom: 16px; }

/* release provenance (big) */
.prov-chain { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.prov-node {
  flex: 1 1 200px; min-width: 180px;
  border: 1px solid var(--bd); border-radius: 14px; background: var(--bg-card-2);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 8px;
}
.prov-node.g { border-top: 3px solid var(--green); }
.prov-node.b { border-top: 3px solid var(--blue); }
.prov-node.v { border-top: 3px solid var(--violet); }
.prov-node.release { border-top: 3px solid #fff; background: linear-gradient(180deg, rgba(255,255,255,.06), transparent); }
.prov-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--tx-3); }
.prov-blob { font-size: 14px; }
.prov-preview { margin: 0; font-family: var(--mono); font-size: 11px; color: var(--tx-3); white-space: pre-wrap; word-break: break-all; max-height: 90px; overflow: hidden; background: #0a0a0a; border-radius: 8px; padding: 8px 10px; }
.prov-seal { font-size: 13px; font-weight: 700; color: var(--green); }
.prov-arrow { display: grid; place-items: center; color: var(--tx-4); font-size: 22px; }

/* ============================================================
   Verify (provenance) + SLSA-style badges
   ============================================================ */
.verify-bar { display: flex; gap: 12px; margin: 24px 0; }
.verify-select {
  flex: 1; max-width: 420px;
  padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--bd); background: var(--bg-card-2);
  color: var(--tx); font-family: var(--mono); font-size: 14px;
}
.verify-result { margin-top: 8px; }
.verify-top { margin-bottom: 16px; }
.vbadge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 700; font-family: var(--mono);
  border: 1px solid;
}
.vbadge.pass { color: var(--green); border-color: rgba(70,209,138,.4); background: rgba(70,209,138,.1); }
.vbadge.fail { color: var(--red); border-color: rgba(241,91,76,.4); background: rgba(241,91,76,.1); }
.verify-steps { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; }
.vstep { display: flex; align-items: center; gap: 14px; padding: 13px 16px; background: var(--bg-card); border-bottom: 1px solid var(--bd-soft); }
.vstep:last-child { border-bottom: none; }
.vmark { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.vstep.ok .vmark { background: rgba(70,209,138,.15); color: var(--green); }
.vstep.bad .vmark { background: rgba(241,91,76,.15); color: var(--red); }
.vlabel { font-size: 14.5px; font-weight: 600; flex: 1; }
.vbody { min-width: 0; }
.vtitle { font-size: 13.5px; font-weight: 700; }
.vdetail { font-size: 12.5px; color: var(--tx-3); }

/* SLSA-style provenance badge on release cards/detail */
.slsa-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; font-family: var(--mono);
  color: var(--green); border: 1px solid rgba(70,209,138,.35); background: rgba(70,209,138,.08);
}

/* trust-layer UI: score badge, lock tag, approval bar, vouch */
.score-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 999px; font-family: var(--mono);
  font-size: 12px; font-weight: 600; letter-spacing: .01em; color: var(--blue);
  border: 1px solid rgba(198,242,78,.3); background: rgba(198,242,78,.09);
}
.score-badge::before { content: "★"; font-size: 10px; line-height: 1; opacity: .85; }
.lock-tag { font-family: var(--mono); font-size: 12px; color: var(--violet); }
.tier-badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border: 1px solid; }
.tier-trusted { color: var(--green); border-color: rgba(70,209,138,.4); background: rgba(70,209,138,.1); }
.tier-verified { color: var(--blue); border-color: rgba(198,242,78,.4); background: rgba(198,242,78,.1); }
.tier-contributor { color: var(--amber); border-color: rgba(240,177,62,.4); background: rgba(240,177,62,.1); }
.tier-new { color: var(--tx-3); border-color: var(--bd); background: var(--bg-elev); }
.market-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 10px; align-items: center; }
.market-search {
  display: flex; align-items: center; gap: 10px; min-width: min(340px, 100%);
  padding: 10px 13px; border-radius: 10px; border: 1px solid var(--bd);
  background: var(--bg-input); color: var(--tx-3);
}
.market-search .ico { width: 18px; height: 18px; }
.market-search input { width: 100%; border: none; outline: none; background: transparent; color: var(--tx); font: inherit; font-size: 13.5px; }
.market-select {
  height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--bd);
  background: var(--bg-card-2); color: var(--tx); font-family: var(--mono); font-size: 12px;
}
.market-summary { margin: 0 0 16px; color: var(--tx-3); font-size: 13px; font-family: var(--mono); }
.agent-link {
  border: none; background: none; padding: 0; color: var(--blue); cursor: pointer;
  font-family: var(--mono); font-size: 14px; font-weight: 700; text-align: left; min-width: 0;
}
.agent-link:hover { text-decoration: underline; }
.agent-market-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 2px; }
.market-pill {
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--bd);
  background: var(--bg-elev); color: var(--tx-2); font-family: var(--mono); font-size: 11px;
}
.agent-profile-actions { display: flex; justify-content: flex-start; margin: -8px 0 10px; }
.package-trust-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr) minmax(240px, .8fr); gap: 16px; margin-top: 18px; }
.package-card-main { grid-row: span 2; }
.maint-row { display: block; margin-top: 10px; word-break: break-all; }
.agent-foot { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.prove-btn:hover { background: var(--bg-card) !important; border-color: var(--bd-strong) !important; }
.vouch-btn { font-size: 12px; padding: 6px 14px; }
.approval-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 16px 0; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--bd); font-family: var(--mono); font-size: 13.5px;
}
.approval-bar.met { border-color: rgba(70,209,138,.35); background: rgba(70,209,138,.07); color: var(--green); }
.approval-bar.pending { border-color: rgba(240,177,62,.3); background: rgba(240,177,62,.06); color: var(--amber); }
.approval-note { color: var(--tx-3); font-family: var(--mono); font-size: 13px; }

/* "you" tag + walruscan link + reduce-motion + onboarding + footer */
.you-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; color: var(--green); background: rgba(70,209,138,.12); border: 1px solid rgba(70,209,138,.3); vertical-align: middle; }
.walruscan-link { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--blue); font-family: var(--mono); }
.walruscan-link:hover { text-decoration: underline; }

body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: .001s !important; transition-duration: .001s !important;
}

@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body:not(.reduce-motion) .card-grid > *:not(.skeleton-card),
body:not(.reduce-motion) .feed-item,
body:not(.reduce-motion) .release-card:not(.skeleton-card),
body:not(.reduce-motion) .repo-card:not(.skeleton-card) {
  animation: cardIn .32s var(--ease) both;
}
/* staggered cascade — capped so long lists don't lag */
body:not(.reduce-motion) .card-grid > *:nth-child(1),
body:not(.reduce-motion) .feed-item:nth-child(1) { animation-delay: 0ms; }
body:not(.reduce-motion) .card-grid > *:nth-child(2),
body:not(.reduce-motion) .feed-item:nth-child(2) { animation-delay: 40ms; }
body:not(.reduce-motion) .card-grid > *:nth-child(3),
body:not(.reduce-motion) .feed-item:nth-child(3) { animation-delay: 80ms; }
body:not(.reduce-motion) .card-grid > *:nth-child(4),
body:not(.reduce-motion) .feed-item:nth-child(4) { animation-delay: 120ms; }
body:not(.reduce-motion) .card-grid > *:nth-child(5),
body:not(.reduce-motion) .feed-item:nth-child(5) { animation-delay: 160ms; }
body:not(.reduce-motion) .card-grid > *:nth-child(6),
body:not(.reduce-motion) .feed-item:nth-child(6) { animation-delay: 200ms; }
body:not(.reduce-motion) .card-grid > *:nth-child(n+7),
body:not(.reduce-motion) .feed-item:nth-child(n+7) { animation-delay: 240ms; }

.onboard {
  margin: 0 0 22px; padding: 18px 22px; border-radius: var(--r-lg);
  border: 1px solid rgba(198,242,78,.3); background: linear-gradient(180deg, rgba(198,242,78,.08), transparent);
  display: flex; align-items: center; gap: 18px;
}
.onboard h3 { font-size: 17px; font-weight: 700; }
.onboard p { font-size: 13.5px; color: var(--tx-2); margin-top: 4px; }
.onboard-cta { display: flex; gap: 10px; margin-left: auto; flex: none; }
.onboard-x { background: none; border: none; color: var(--tx-3); cursor: pointer; font-size: 20px; align-self: flex-start; }

.footer { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--bd); display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.footer a { font-size: 13px; color: var(--tx-3); display: inline-flex; align-items: center; gap: 5px; }
.footer a:hover { color: var(--tx); }
.footer .foot-brand { font-family: var(--mono); font-weight: 700; color: var(--tx-2); margin-right: auto; }

/* roadmap block */
.roadmap { margin-top: 26px; }
.roadmap .info-card { border-style: dashed; }
.roadmap-tag { display: inline-block; font-size: 10px; font-weight: 700; color: var(--amber); background: rgba(240,177,62,.1); border: 1px solid rgba(240,177,62,.3); border-radius: 999px; padding: 1px 8px; margin-left: 8px; vertical-align: middle; }

/* command-panel in-browser action button + wallet picker */
.cmd-action {
  margin-left: auto; margin-right: 8px; padding: 7px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--blue); cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 700;
  background: var(--blue); color: #0a0c05;
}
.cmd-action:hover { filter: brightness(1.1); }
.wallet-pick { display: flex; flex-direction: column; gap: 10px; }
.wallet-pick-btn {
  width: 100%; display: flex; align-items: center; gap: 12px;
  justify-content: flex-start; padding: 13px 15px; font-size: 14.5px; font-weight: 600;
  border-radius: 12px; cursor: pointer;
  background: var(--bg-card-2); border: 1px solid var(--bd); color: var(--tx);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.wallet-pick-btn:hover { background: var(--bg-elev); border-color: var(--bd-strong); }
.wallet-pick-btn:active { transform: scale(.98); }
.wallet-pick-btn img { border-radius: 6px; flex: none; }

/* ============================================================
   Topbar actions (refresh / settings / connect) + search
   ============================================================ */
.search-wrap { position: relative; margin-left: auto; width: min(420px, 34vw); }
.search-wrap .search { margin-left: 0; width: 100%; }
.search-kbd {
  font-family: var(--mono); font-size: 11px; color: var(--tx-4);
  border: 1px solid var(--bd); border-radius: 6px; padding: 2px 6px; flex: none;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 50;
  background: var(--bg-elev); border: 1px solid var(--bd-strong); border-radius: 14px;
  padding: 6px; max-height: 60vh; overflow-y: auto;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px); transform-origin: top center;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
}
.search-results.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.sr-group { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--tx-4); padding: 8px 12px 4px; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.sr-item:hover, .sr-item.active { background: rgba(255,255,255,.05); }
.sr-item .sr-kind { font-size: 11px; color: var(--tx-3); margin-left: auto; font-family: var(--mono); }
.sr-empty { padding: 16px 12px; color: var(--tx-3); font-size: 13.5px; text-align: center; }

.topbar-actions { display: flex; align-items: center; gap: 10px; position: relative; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--bd); background: var(--bg-card);
  color: var(--tx-2); cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.tb-btn:hover { background: var(--bg-elev); color: #fff; }
.tb-btn .ico { width: 18px; height: 18px; }
.tb-updated { font-family: var(--mono); font-size: 12px; color: var(--tx-4); }
.tb-btn#refreshBtn.spinning .ico { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tb-connect { background: var(--blue); color: #0a0c05; border-color: transparent; font-weight: 700; }
.tb-connect:hover { filter: brightness(1.08); color: #0a0c05; }
.tb-connect.connected { background: var(--bg-card); color: var(--green); border: 1px solid rgba(70,209,138,.3); }

.wallet-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 280px;
  background: var(--bg-elev); border: 1px solid var(--bd-strong); border-radius: 14px; padding: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
}
.wallet-menu.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }
.wm-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13.5px; }
.wm-row .k { color: var(--tx-3); }
.wm-row .v { margin-left: auto; font-family: var(--mono); }
.wm-sep { height: 1px; background: var(--bd); margin: 6px 0; }
.wm-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: var(--tx-2); }
.wm-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.net-switch { cursor: pointer; transition: filter .12s ease; }
.net-switch:hover { filter: brightness(1.25); }
.wm-bal { font-family: var(--mono); font-weight: 700; color: var(--green); }
.wm-bal:has(.wm-retry) { color: var(--red, #f15b4c); font-weight: 500; }
.wm-retry { margin-left: 8px; font: inherit; font-size: 11.5px; padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--bd, #1d3a52); background: transparent; color: var(--blue, #4da2ff); cursor: pointer; }
.wm-retry:hover { background: rgba(198,242,78,.12); }

/* help & concepts modal */
.help-lead { color: var(--tx-2); line-height: 1.55; margin: 0 0 14px; }
.help-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--tx-3); margin: 16px 0 8px; }
.help-gloss { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.help-gloss li { color: var(--tx-2); line-height: 1.5; font-size: 13.5px; }
.help-gloss b { color: var(--tx); }
.help-links { display: flex; flex-wrap: wrap; gap: 8px; }
.help-link { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--bd); background: var(--bg-card-2);
  color: var(--tx-2); font-size: 13px; font-weight: 600; text-decoration: none; transition: background var(--t-fast), color var(--t-fast); }
.help-link:hover { background: var(--bg-elev); color: #fff; }
.help-foot { margin: 16px 0 0; color: var(--tx-3); font-size: 12.5px; }

/* stat fetch-failure marker + agent "prove work" button (moved off inline styles) */
.stat-err { color: var(--red, #f15b4c); font-size: 24px; }
.prove-btn { background: var(--bg-elev); color: var(--tx); border: 1px solid var(--bd); }

/* settings slide-over */
.settings-overlay { position: fixed; inset: 0; z-index: 800; background: rgba(0,0,0,.5); opacity: 0; transition: opacity var(--t); }
.settings-overlay.shown { opacity: 1; }
.settings-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 810; width: min(380px, 92vw);
  background: var(--bg-card); border-left: 1px solid var(--bd-strong); padding: 24px;
  transform: translateX(100%); transition: transform var(--t) var(--ease); overflow-y: auto;
}
.settings-panel.shown { transform: translateX(0); }
.settings-panel h2 { font-size: 21px; font-weight: 800; margin-bottom: 18px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--bd-soft); }
.set-row input[type="number"] {
  background: var(--bg-input); color: var(--tx); font-family: var(--mono); font-size: 13px;
  border: 1px solid var(--bd); border-radius: var(--r-sm); padding: 7px 10px; text-align: right;
  outline: none; transition: border-color var(--t-fast);
}
.set-row input[type="number"]:focus { border-color: var(--blue); }
.set-row .set-label { flex: 1; }
.set-row .set-label b { display: block; font-size: 14px; }
.set-row .set-label span { display: block; font-size: 12px; color: var(--tx-3); margin-top: 2px; }
.toggle { width: 42px; height: 24px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--bd); position: relative; cursor: pointer; flex: none; transition: background var(--t-fast); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--tx-3); transition: transform var(--t), background var(--t); }
.toggle.on { background: rgba(198,242,78,.2); border-color: rgba(198,242,78,.45); }
.toggle.on::after { transform: translateX(18px); background: var(--blue); }
.seg { display: inline-flex; border: 1px solid var(--bd); border-radius: 9px; overflow: hidden; }
.seg button { padding: 7px 12px; background: var(--bg-elev); border: none; color: var(--tx-2); cursor: pointer; font-size: 12.5px; font-family: var(--mono); }
.seg button.on { background: var(--blue); color: #0a0c05; }

/* ============================================================
   Toasts
   ============================================================ */
.toast-host {
  position: fixed; right: 22px; bottom: 22px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px 13px 15px; border-radius: 13px;
  background: var(--bg-elev); border: 1px solid var(--bd-strong);
  color: var(--tx); font-size: 14px; font-weight: 500;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  transform: translateX(120%); opacity: 0;
  transition: transform var(--t) var(--ease), opacity var(--t);
}
.toast.shown { transform: translateX(0); opacity: 1; }
.toast.leaving { transform: translateX(120%); opacity: 0; }
.toast-ico { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; }
.toast-ico svg { width: 14px; height: 14px; stroke: currentColor; }
.toast-success .toast-ico { color: var(--green); background: rgba(70,209,138,.14); }
.toast-error .toast-ico { color: var(--red); background: rgba(241,91,76,.14); }
.toast-info .toast-ico { color: var(--blue); background: rgba(198,242,78,.14); }
.toast-msg { flex: 1; min-width: 0; }
.toast-link, .toast-retry { font-family: var(--mono); font-size: 12.5px; color: var(--blue); background: none; border: none; cursor: pointer; white-space: nowrap; }
.toast-retry { color: var(--amber); font-weight: 600; }
.toast-x { background: none; border: none; color: var(--tx-3); font-size: 18px; cursor: pointer; line-height: 1; padding: 0 2px; }
.toast-x:hover { color: var(--tx); }

/* ============================================================
   Copy buttons
   ============================================================ */
.copy-btn {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px; border: 1px solid transparent; background: none;
  color: var(--tx-3); cursor: pointer; vertical-align: middle; margin-left: 5px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.copy-btn svg { width: 13px; height: 13px; stroke: currentColor; }
.copy-btn:hover { background: var(--bg-elev); color: var(--tx); border-color: var(--bd); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
  opacity: 0; transition: opacity var(--t);
}
.modal-overlay.shown { opacity: 1; }
.modal-overlay.leaving { opacity: 0; }
.modal {
  width: min(520px, 100%); max-height: 85vh; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--bd-strong);
  border-radius: var(--r-lg); box-shadow: 0 24px 70px rgba(0,0,0,.6);
  transform: translateY(12px) scale(.98); transition: transform var(--t);
}
.modal-wide { width: min(760px, 100%); }
.modal-overlay.shown .modal { transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--bd); }
.modal-head h3 { font-size: 19px; font-weight: 700; }
.modal-x { background: none; border: none; color: var(--tx-3); font-size: 24px; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--tx); }
.modal-body { padding: 20px 22px 24px; }
.modal-body label { display: block; font-size: 13px; color: var(--tx-2); margin: 14px 0 6px; font-weight: 600; }
.modal-body input[type=text], .modal-body input[type=number], .modal-body textarea, .modal-body select {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--bd); background: var(--bg-input); color: var(--tx);
  font-family: inherit; font-size: 14.5px; outline: none;
}
.modal-body input:focus, .modal-body textarea:focus, .modal-body select:focus { border-color: var(--bd-strong); }
.modal-body textarea { min-height: 90px; resize: vertical; font-family: var(--mono); font-size: 13px; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.btn-primary {
  flex: 1; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--blue); cursor: pointer;
  background: var(--blue); color: #0a0c05;
  font-size: 14px; font-weight: 700; transition: filter var(--t-fast), background var(--t-fast);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost {
  padding: 12px 18px; border-radius: 11px; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--bd); color: var(--tx-2);
  font-size: 14.5px; font-weight: 600;
}
.btn-ghost:hover { color: #fff; }

/* how it works strip (Dashboard) */
.howitworks {
  display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
  margin-top: 22px; padding: 18px 20px;
  border: 1px solid var(--bd); border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(198,242,78,.05), transparent);
}
.hiw-step { display: flex; align-items: center; gap: 11px; flex: 1 1 140px; }
.hiw-n { width: 28px; height: 28px; min-width: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 700; font-size: 13px; line-height: 1; color: #0a0c05; background: var(--blue); border: 1px solid rgba(198,242,78,.6); box-shadow: 0 0 0 3px rgba(198,242,78,.12); }
.hiw-step b { display: block; font-size: 14px; }
.hiw-step span { display: block; font-size: 12px; color: var(--tx-3); margin-top: 2px; }
.hiw-sep { display: grid; place-items: center; color: var(--tx-4); font-size: 18px; }

/* delegation chain (Agents tab) */
.delegation { margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(255,255,255,.09); }
.deleg-line { display: flex; align-items: center; gap: 9px; font-size: 13px; flex-wrap: wrap; }
.deleg-arrow { color: var(--tx-4); }
.deleg-scopes { margin-top: 8px; font-size: 12.5px; color: var(--tx-3); }
.scope-chip { display: inline-block; padding: 2px 8px; margin: 0 3px; border-radius: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--blue); border: 1px solid rgba(198,242,78,.3); background: rgba(198,242,78,.08); }
.scope-chip.none { color: var(--tx-4); border-color: var(--bd); background: transparent; }
.cap-status { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; font-family: var(--mono); }
.cap-status.active { color: var(--green); border: 1px solid rgba(70,209,138,.3); background: rgba(70,209,138,.08); }
.cap-status.revoked { color: var(--red); border: 1px solid rgba(241,91,76,.3); background: rgba(241,91,76,.08); }
.cap-status.soon { color: #e6a23c; border: 1px solid rgba(230,162,60,.35); background: rgba(230,162,60,.1); }
.deleg-note { margin-top: 8px; font-size: 11.5px; color: var(--tx-4); font-style: italic; }

/* ============================================================
   Polish pass — hover on pills/badges/chips, form states,
   micro-entrances, tooltip, decorative glow
   ============================================================ */

/* pills / badges / chips get a subtle interactive lift */
.pill, .slsa-badge, .vbadge, .scope-chip, .net-badge, .roadmap-tag, .you-tag, .cap-status {
  transition: filter var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.pill:hover, .slsa-badge:hover, .vbadge:hover, .scope-chip:hover, .cap-status:hover { filter: brightness(1.18); }

/* clickable table rows + tree + search items active/keyboard states */
tbody tr { cursor: default; }
.tree-row:active { background: rgba(255,255,255,.05); }
.sr-item.active { background: rgba(198,242,78,.12); }

/* form fields: focus glow ring + label focus-within highlight */
.modal-body input:focus, .modal-body textarea:focus, .modal-body select:focus,
.search:focus-within, .verify-select:focus {
  box-shadow: 0 0 0 3px rgba(198,242,78,.18);
}
.modal-body input, .modal-body textarea, .modal-body select, .verify-select, .search {
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

/* toggle / segmented control polish */
.toggle { transition: background var(--t) var(--ease), border-color var(--t) var(--ease); }
.toggle::after { transition: transform var(--t) var(--ease), background var(--t) var(--ease); }
.toggle:hover { border-color: var(--bd-strong); }
.toggle:active::after { width: 22px; }
.seg button { transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }

/* micro-entrances */
@keyframes capIn { from { opacity: 0; transform: translateX(-50%) scaleY(.4); } to { opacity: 1; transform: translateX(-50%) scaleY(1); } }
body:not(.reduce-motion) .cap { animation: capIn var(--t) var(--ease) both; transform-origin: bottom; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
body:not(.reduce-motion) .toast-ico { animation: pop .24s var(--ease) both; }
body:not(.reduce-motion) .onboard { animation: cardIn .4s var(--ease) both; }

/* nudge transitions onto cards/chain/tree to feel unified */
.repo-card, .pr-card, .agent-card, .info-card, .release-card { transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.repo-card:hover, .pr-card:hover, .agent-card:hover, .info-card:hover, .release-card.clickable:hover { box-shadow: 0 8px 30px rgba(0,0,0,.35); }

/* decorative glow behind the brand logo (subtle, in-theme) */
.brand { position: relative; }
.brand .logo::after {
  content: ""; position: absolute; inset: -40% -40%; z-index: -1;
  background: radial-gradient(circle, rgba(42,109,240,.35), transparent 70%);
  filter: blur(14px); opacity: .6; pointer-events: none;
}
/* faint top highlight on stat cards (matches nav-item.active) */
.stat { position: relative; }
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); border-radius: var(--r-lg) var(--r-lg) 0 0; pointer-events: none; }

/* custom tooltip */
.wf-tip {
  position: fixed; z-index: 2000; pointer-events: none;
  background: #0a0a0a; border: 1px solid var(--bd-strong); color: var(--tx);
  font-family: var(--mono); font-size: 12px; padding: 6px 10px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); white-space: nowrap;
  opacity: 0; transform: translateY(4px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.wf-tip.show { opacity: 1; transform: translateY(0); }

/* responsive */
@media (max-width: 1180px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .prov-chain { flex-direction: column; }
  .prov-arrow { transform: rotate(90deg); }
  .package-trust-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: var(--side-w-collapsed) 1fr; }
  .agent-stats { grid-template-columns: repeat(2, 1fr); }
  /* collapse the sidebar to a clean icon rail (mirror .app.collapsed) — the width
     already narrows here, so hide the labels/submenus to match, no toggle needed. */
  .side { padding-left: 16px; padding-right: 16px; }
  .brand .name, .nav-label, .nav-item .label-txt, .nav-item .chev, .nav-item .count,
  .submenu, .user-card .u-name, .user-card .u-mail, .user-card .logout { display: none; }
  .brand { justify-content: center; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .user-card { justify-content: center; padding: 10px; }
}

/* ============================================================
   Playground (chat + preview + gallery)
   ============================================================ */
.pg-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 30px; }
@media (max-width: 1000px) { .pg-split { grid-template-columns: 1fr; } }

/* ============================================================
   Phone (<=640px) — tighter chrome, single-column grids, scrollable tables
   ============================================================ */
@media (max-width: 980px) {
  .repo-actions-head { flex-direction: column; }
  .repo-actions-row { flex-direction: column; }
  .repo-actions-row .cmd-action,
  .repo-inline-actions .cmd-action,
  .repo-guide-action.cmd-action { width: 100%; }
}

@media (max-width: 640px) {
  .topbar { padding: 12px 14px; gap: 10px; }
  .content { padding: 16px 14px 28px; }
  .search { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .welcome-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cal-btn { margin-left: 0; }
  .onboard { flex-direction: column; align-items: stretch; gap: 12px; }
  .onboard-cta { margin-left: 0; flex-wrap: wrap; }
  /* wide tables (PRs, etc.) scroll horizontally instead of overflowing the viewport */
  .content table { display: block; overflow-x: auto; white-space: nowrap; }
}

.pg-chat { display: flex; flex-direction: column; gap: 12px; background: var(--bg-card); border: 1px solid var(--bd); border-radius: var(--r-lg); padding: 16px; min-height: 480px; }
.pg-settings-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pg-keystate { font-family: var(--mono); font-size: 12px; color: var(--tx-3); }
.pg-ok { color: var(--green); } .pg-warn { color: var(--amber); }
.pg-mini { padding: 6px 12px !important; font-size: 12.5px !important; }

.pg-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; min-height: 220px; }
.pg-msg { max-width: 92%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.pg-msg.user { align-self: flex-end; background: var(--blue); color: #061018; }
.pg-msg.bot { align-self: flex-start; background: var(--bg-elev); color: var(--tx); border: 1px solid var(--bd); }
.pg-typing { color: var(--tx-3); font-style: italic; }
.pg-err { color: var(--red); }
.pg-cat { font-family: var(--mono); font-size: 11px; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; }

.pg-composer { display: flex; gap: 8px; }
.pg-composer textarea { flex: 1; resize: vertical; background: var(--bg-input); color: var(--tx); border: 1px solid var(--bd); border-radius: var(--r-sm); padding: 10px; font-family: inherit; font-size: 14px; outline: none; }
.pg-composer textarea:focus { border-color: var(--blue); }
.pg-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-example { font-size: 11.5px; color: var(--tx-2); background: var(--bg-elev); border: 1px solid var(--bd); border-radius: var(--r-sm); padding: 4px 10px; cursor: pointer; transition: .15s; }
.pg-example:hover { border-color: var(--blue); color: var(--tx); }

.pg-preview { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--bd); border-radius: var(--r-lg); overflow: hidden; min-height: 480px; }
.pg-frame-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--bg-elev); border-bottom: 1px solid var(--bd); }
.pg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bd-strong); }
.pg-frame-title { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--tx-3); flex: 1; }
.pg-frame-wrap { position: relative; flex: 1; display: flex; }
.pg-preview-frame { flex: 1; width: 100%; border: 0; background: var(--bg-app); }
/* preview empty-state overlay (before an app is built) */
.pg-preview-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 0 22px; color: var(--tx-3); font-family: var(--mono); font-size: 12.5px; line-height: 1.6; pointer-events: none; }
.pg-preview-empty b { color: var(--tx-2); font-weight: 600; }
.pg-preview-empty b:first-child { display: block; color: var(--tx-3); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
/* chat empty-state guide (before the first build) */
.pg-empty { padding: 22px 20px; }
.pg-empty-k { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--blue); margin-bottom: 12px; }
.pg-empty-lead { color: var(--tx); font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
.pg-empty-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.pg-empty-steps li { display: flex; align-items: flex-start; gap: 11px; font-size: 13px; color: var(--tx-2); line-height: 1.5; }
.pg-empty-steps li > span { flex: none; width: 19px; height: 19px; display: inline-grid; place-items: center; border-radius: var(--r-sm); background: var(--blue); color: #0a0c05; font-family: var(--mono); font-weight: 700; font-size: 11px; margin-top: 1px; }
.pg-empty-steps b { color: var(--tx); }
.pg-empty-steps kbd { font-family: var(--mono); font-size: 11px; color: var(--tx-3); border: 1px solid var(--bd); border-radius: 3px; padding: 1px 5px; }
.pg-empty-note { color: var(--tx-3); font-size: 12px; line-height: 1.55; border-top: 1px dashed var(--bd); padding-top: 13px; margin: 0; }
/* dark, mono publish-bar selects (native white default clashes with the terminal UI) */
.pg-frame-bar select.pg-mini { background: var(--bg-input); color: var(--tx); border: 1px solid var(--bd-strong); border-radius: var(--r-sm); font-family: var(--mono); cursor: pointer; }
.pg-frame-bar select.pg-mini option { background: var(--bg-elev); color: var(--tx); }

.pg-gallery-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 8px 0 16px; }
.pg-gallery-head h2 { font-size: 21px; font-weight: 800; }
.pg-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pg-pill { font-size: 12.5px; color: var(--tx-2); background: var(--bg-elev); border: 1px solid var(--bd); border-radius: var(--r-sm); padding: 6px 13px; cursor: pointer; transition: .15s; }
.pg-pill:hover { color: var(--tx); }
.pg-pill.on { background: rgba(198,242,78,.14); border-color: rgba(198,242,78,.45); color: var(--blue); }
.pg-search { background: var(--bg-input); color: var(--tx); border: 1px solid var(--bd); border-radius: 999px; padding: 6px 13px; font-size: 13px; outline: none; min-width: 180px; }
.pg-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pg-cat-pill { font-size: 11.5px; text-transform: capitalize; color: var(--tx-2); background: transparent; border: 1px solid var(--bd); border-radius: var(--r-sm); padding: 4px 11px; cursor: pointer; transition: .15s; }
.pg-cat-pill:hover { color: var(--tx); }
.pg-cat-pill.on { background: rgba(198,242,78,.12); border-color: rgba(198,242,78,.4); color: var(--blue); }
.hist-actions { display: inline-flex; gap: 5px; margin-left: auto; }
.diff-summary { font-size: 12.5px; margin: 0 0 10px; }
.diff-add { color: #3fb950; } .diff-del { color: #f85149; }
.diff-body { max-height: 60vh; overflow: auto; font-family: var(--mono, monospace); font-size: 12px; }
.diff-line { white-space: pre-wrap; padding: 1px 6px; border-radius: 3px; }
.diff-line.add { background: rgba(63,185,80,.12); } .diff-line.del { background: rgba(248,81,73,.12); }
.diff-sign { display: inline-block; width: 12px; opacity: .7; }
.pg-search:focus { border-color: var(--blue); }

.pg-card { background: var(--bg-card); border: 1px solid var(--bd); border-radius: var(--r-md); padding: 15px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.pg-card:hover { border-color: var(--bd-strong); }
.pg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pg-card-name { font-weight: 700; font-size: 15px; font-family: var(--mono); }
.pg-card-name-link { cursor: pointer; transition: color var(--t-fast); }
.pg-card-name-link:hover { color: var(--blue); }
.pg-prompt { font-size: 13px; color: var(--tx-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.pg-card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--tx-3); }
.pg-by a { color: var(--tx-2); }
.pg-lineage { color: var(--violet); font-family: var(--mono); }
.pg-stats { display: flex; gap: 14px; }
.pg-stat { font-family: var(--mono); font-size: 12.5px; color: var(--tx-2); }
.pg-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.pg-verify { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--green); border: 1px solid rgba(70,209,138,.35); background: rgba(70,209,138,.08); border-radius: 999px; padding: 3px 9px; }
.pg-dim { color: var(--tx-3); }
.pg-builder { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; padding: 0; }
.pg-builder:hover { text-decoration: underline; }

.pg-profile-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.pg-profile-name { font-size: 20px; font-weight: 800; }
.pg-profile-stats { display: flex; flex-wrap: wrap; gap: 22px; padding: 14px 0; border-top: 1px solid var(--bd-soft); border-bottom: 1px solid var(--bd-soft); }
.pg-profile-stats div { display: flex; flex-direction: column; }
.pg-profile-stats b { font-size: 20px; font-family: var(--mono); color: var(--blue); }
.pg-profile-stats span { font-size: 12px; color: var(--tx-3); }
