:root {
  --bg: #000000;
  --card: #0c1210;
  --tx: #e8f6df;
  --mute: #93a898;
  --dim: #c5d7c4;
  --lime: #d6ff4a;
  --lime-2: #9ae62a;
  --grn: #a6e22e;
  --cyan: #22d3ee;
  --red: #ff6b78;
  --amber: #ffc44a;
  --line: rgba(198, 241, 53, .16);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(34, 211, 238, .16), transparent 55%),
    radial-gradient(820px 480px at 100% 0%, rgba(166, 226, 46, .12), transparent 50%),
    var(--bg);
  color: var(--tx);
  min-height: 100dvh;
}
button, a, input, select { font: inherit; color: inherit; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; }
a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.svg { width: 22px; height: 22px; display: block; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app { min-height: 100dvh; }
.rail { display: none; }
.main-col { min-width: 0; }

.top {
  position: sticky;
  top: 0;
  z-index: 8;
  background: rgba(0, 0, 0, .92);
  border-bottom: 1px solid rgba(34, 211, 238, .16);
  backdrop-filter: blur(10px);
}
.top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 10px 16px;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  color: inherit;
}
.logo-wide { display: none; height: 44px; width: auto; max-width: min(240px, 46vw); object-fit: contain; object-position: left center; }
.logo-kire { height: 30px; width: auto; max-width: 30vw; display: block; flex: 0 1 auto; object-fit: contain; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px rgba(255,255,255,.4)); }
.logo-mark { width: auto; height: 30px; display: block; flex: 0 0 auto; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px rgba(255,255,255,.4)); }
.top-meta {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  flex: 1 1 180px;
}
.btn .svg { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; }
.fresh-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}
.fresh { color: var(--mute); font-size: 12px; min-width: 0; overflow-wrap: anywhere; text-align: right; }
.fresh.is-retry { color: var(--amber); }

main {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 14px 16px calc(var(--nav-h) + var(--safe-b) + 18px);
  min-width: 0;
}
.panel { display: none; }
.panel.on { display: grid; gap: 12px; }

.sec-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  padding: 2px 2px 0;
}
.sec-head h2, .card h2, .copy h3 {
  overflow-wrap: anywhere;
}
.sec-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.02em;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sec-head h2 .age {
  margin-left: auto;
  font-weight: 400;
  font-size: 12px;
  color: var(--mute);
}
.age.stale { color: var(--red); font-weight: 700; }
.lead { margin: 3px 0 0; color: var(--mute); font-size: 13px; }
.count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--red);
  color: #2a060a;
  font-size: 13px;
  font-weight: 800;
}
.count.zero { background: #1a221c; color: var(--mute); }

.stack { display: grid; gap: 10px; }
.card {
  background: linear-gradient(180deg, rgba(18, 28, 24, .96), rgba(8, 12, 10, .96));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  min-width: 0;
}
.card.bad { border-color: rgba(255, 107, 120, .42); box-shadow: inset 3px 0 0 var(--red); }
.card.wait { border-color: rgba(255, 196, 74, .4); box-shadow: inset 3px 0 0 var(--amber); }
.card.good { border-color: rgba(166, 226, 46, .28); box-shadow: inset 3px 0 0 var(--grn); }
.card.cool { border-color: rgba(34, 211, 238, .32); box-shadow: inset 3px 0 0 var(--cyan); }

.item-top, .row-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}
.copy { min-width: 0; flex: 1; }
.copy h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.copy p, .sub { margin: 4px 0 0; color: var(--dim); font-size: 13.5px; overflow-wrap: anywhere; }
.title-row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.title-row h3 { flex: 1 1 160px; }

.ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #071208;
}
.ico .svg { width: 20px; height: 20px; }
.ico.bad { background: linear-gradient(145deg, #ffb0b8, #ff5d6c); color: #2a060c; }
.ico.wait { background: linear-gradient(145deg, #ffe7a6, #f5b431); color: #2a1c04; }
.ico.good { background: linear-gradient(145deg, #eaff9a, #a6e22e); color: #142004; }
.ico.info { background: linear-gradient(145deg, #9af4ff, #14c6e0); color: #042228; }
.ico.mix { background: linear-gradient(145deg, #d6ff4a, #22d3ee); color: #062018; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px 4px 7px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.bad { background: rgba(255, 107, 120, .16); color: #ff9aa4; }
.chip.wait { background: rgba(255, 196, 74, .16); color: #ffd56a; }
.chip.good { background: rgba(166, 226, 46, .16); color: #d6ff4a; }

.btns, .row-end, .actions, .modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.btn {
  appearance: none;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  white-space: normal;
  flex: 1 1 140px;
  border: 0;
  cursor: pointer;
}
.btn.go {
  background: linear-gradient(135deg, #e4ff6e, #2ee0c8);
  color: #071208;
}
.btn.warn {
  background: linear-gradient(135deg, #ffe08a, #ffb020);
  color: #2a1c04;
}
.btn.stop {
  background: #101816;
  color: #e9f8ee;
  border: 1px solid rgba(34, 211, 238, .38);
}
.btn.ghost {
  background: transparent;
  color: var(--lime);
  border: 1px solid rgba(214, 255, 74, .4);
  min-height: 44px;
  padding: 8px 12px;
  flex: 0 0 auto;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:active { transform: scale(.98); }

.quiet {
  margin: 0;
  color: var(--mute);
  font-size: 13px;
  text-align: center;
}
.text-btn {
  background: none;
  border: 0;
  color: var(--cyan);
  font-weight: 800;
  padding: 8px;
  min-height: 44px;
  cursor: pointer;
}
.ack-link {
  margin: 2px 0 12px;
  text-align: left;
}
.ack-link .text-btn {
  padding-left: 0;
  padding-right: 8px;
}
.ack-list { margin-bottom: 12px; }
.pipe {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.pipe div {
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  min-width: 0;
  background: #08110e;
}
.pipe b {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.pipe span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.25;
  color: var(--mute);
  overflow-wrap: anywhere;
}
.pipe .c1 { background: linear-gradient(180deg, rgba(34, 211, 238, .2), rgba(34, 211, 238, .04)); }
.pipe .c1 b { color: var(--cyan); }
.pipe .c2 { background: linear-gradient(180deg, rgba(255, 196, 74, .2), rgba(255, 196, 74, .04)); }
.pipe .c2 b { color: var(--amber); }
.pipe .hot { box-shadow: inset 0 0 0 1.5px rgba(255, 196, 74, .85); }
.pipe .c3 { background: linear-gradient(180deg, rgba(166, 226, 46, .2), rgba(166, 226, 46, .04)); }
.pipe .c3 b { color: var(--lime); }

.chart { width: 100%; height: auto; display: block; max-width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 8px; color: var(--mute); font-size: 12px; }
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}
.swatch-lime { background: linear-gradient(180deg, #e4ff6e, #a6e22e); }
.swatch-cyan { background: #22d3ee; }
.axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--mute);
  font-size: 11px;
  margin-top: 2px;
}

.statline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.statline div {
  background: #08110e;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  min-width: 0;
}
.statline b { display: block; font-size: 20px; color: var(--cyan); font-variant-numeric: tabular-nums; }
.statline span { display: block; margin-top: 2px; font-size: 11px; color: var(--mute); line-height: 1.25; overflow-wrap: anywhere; }
.statline .hot b { color: var(--amber); }

.know, .sources { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.know li, .sources li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .06);
  overflow-wrap: anywhere;
}
.know li:first-child, .sources li:first-child { border-top: 0; padding-top: 0; }
.tick { color: var(--cyan); flex: 0 0 auto; margin-top: 2px; }
.sources li { justify-content: space-between; align-items: baseline; }
.sources .label { color: var(--dim); }
.health-line { margin: 6px 0 0; font-size: 16px; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  background: rgba(0, 0, 0, .96);
  border-top: 1px solid rgba(214, 255, 74, .2);
  padding: 4px 4px calc(4px + var(--safe-b));
  backdrop-filter: blur(12px);
}
.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #819487;
  flex: 1 1 0;
  min-width: 0;
  min-height: 56px;
  border-radius: 12px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.nav-btn span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}
.bottom-nav .nav-btn.on { color: var(--lime); background: rgba(214, 255, 74, .08); }
.bottom-nav .nav-btn.on .svg { color: var(--cyan); }

.modal, .sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, .72);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.modal.open, .sheet-scrim.open { display: flex; }
.box, .sheet {
  width: min(480px, 100%);
  max-height: min(86dvh, 720px);
  overflow: auto;
  background: #0c1210;
  border: 1px solid rgba(34, 211, 238, .28);
  border-radius: 18px;
  padding: 16px;
  min-width: 0;
}
.box h3, .sheet h3 { margin: 0 0 8px; font-size: 18px; }
.box p, .sheet p { margin: 0 0 8px; overflow-wrap: anywhere; color: var(--tx); }
.kicker { color: var(--cyan); font-size: 12px; font-weight: 800; margin: 0 0 4px; }
.sheet label, .gate-card label {
  display: block;
  margin: 10px 0 4px;
  color: var(--mute);
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}
input, select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(214, 255, 74, .22);
  background: #000;
  color: var(--tx);
  font-size: 16px;
}
.ups-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ups-check, .check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  color: var(--dim);
  font-size: 14px;
}
.ups-check input { width: 20px; height: 20px; min-height: 0; accent-color: #a6e22e; }
.error { color: var(--red); font-size: 13px; font-weight: 700; }
.note { margin-top: 12px !important; color: var(--amber) !important; font-size: 12px; }
.meta, .hint { color: var(--mute); font-size: 12px; }
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  z-index: 50;
  background: #07110e;
  border: 1px solid rgba(214, 255, 74, .4);
  color: var(--tx);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
  font-weight: 700;
}
.gate {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.gate-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 18px;
}
.logo-stacked {
  display: block;
  width: auto;
  height: auto;
  max-height: 45vh;
  max-width: min(560px, 94vw);
  margin: 0 auto 16px;
  object-fit: contain;
}
.problem { margin: 6px 0 0; color: var(--red); overflow-wrap: anywhere; }

@media (max-width: 420px) {
  .ups-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 700px) {
  .logo-wide { display: block; }
  .logo-mark { display: none; }
  .logo-kire { display: none; }
  .pipe { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .rail {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    padding: 18px 12px 16px;
    background: #050807;
    border-right: 1px solid rgba(214, 255, 74, .16);
    z-index: 12;
  }
  .rail-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 16px;
    min-width: 0;
    color: inherit;
  }
  .rail-brand img { width: 42px; height: 42px; border-radius: 10px; }
  .rail-brand strong { display: block; font-size: 16px; color: var(--tx); }
  .rail-brand span { display: block; color: var(--mute); font-size: 12px; }
  .rail .nav-btn {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    min-height: 48px;
    padding: 8px 12px;
    width: 100%;
    color: #819487;
  }
  .rail .nav-btn span { font-size: 15px; }
  .rail .nav-btn.on {
    color: #f3ffc4;
    background: linear-gradient(90deg, rgba(214, 255, 74, .18), rgba(34, 211, 238, .1));
    box-shadow: inset 3px 0 0 var(--lime);
  }
  .main-col { margin-left: 220px; }
  .bottom-nav { display: none; }
  main { padding: 18px 28px 40px; }
  .toast { left: auto; right: 28px; width: min(420px, calc(100% - 280px)); bottom: 24px; }
  .modal, .sheet-scrim { align-items: center; }
  .item .btns { margin-top: 0; justify-content: flex-end; }
  .item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
    column-gap: 12px;
    align-items: center;
  }
}

/* Investments card (read only) */
.inv-card h4 { margin: 14px 0 6px; font-size: .9rem; color: var(--mute, #94a3b8); font-weight: 600; }
.inv-asof { margin: 4px 0 0; color: var(--mute, #94a3b8); }
.inv-stale { color: #fbbf24; margin: 6px 0 0; }
.inv-total b { font-size: 1.8rem; margin-right: 8px; }
.inv-total span, .inv-muted { color: var(--mute, #94a3b8); }
.inv-muted.small, .small { font-size: .82rem; }
.inv-line { width: 100%; height: 60px; display: block; }
.inv-pos .inv-line { height: 26px; }
.inv-alloc { display: flex; align-items: center; gap: 14px; }
.inv-legend, .inv-flags, .inv-pos { list-style: none; margin: 0; padding: 0; }
.inv-legend li { margin: 3px 0; } .inv-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.inv-flags li { padding: 6px 0; border-top: 1px solid rgba(255,255,255,.07); line-height: 1.35; }
.inv-flags li.bad { color: #f87171; font-weight: 700; }
.inv-pos li { padding: 8px 0; border-top: 1px solid rgba(255,255,255,.07); }
.inv-pos-head { display: flex; justify-content: space-between; gap: 8px; }
.inv-bar { position: relative; height: 10px; margin-top: 6px; border-radius: 5px; background: rgba(255,255,255,.08); }
.inv-bar span { position: absolute; top: -2px; width: 3px; height: 14px; transform: translateX(-50%); border-radius: 2px; }
.inv-bar .stop { background: #f87171; } .inv-bar .cost { background: #94a3b8; }
.inv-bar .px { width: 12px; height: 12px; top: -1px; border-radius: 50%; background: #a6e22e; }
.inv-bar .px.warn { background: #fbbf24; } .inv-bar .px.bad { background: #f87171; }
.inv-nostop { font-size: .8rem; color: var(--mute, #94a3b8); margin-top: 4px; }

/* Socials card (read only) */
.soc-card h4 { margin: 14px 0 6px; font-size: .9rem; color: var(--mute, #94a3b8); font-weight: 600; }
.soc-asof, .soc-muted, .soc-meta, .soc-why { color: var(--mute, #94a3b8); }
.soc-muted { font-size: .82rem; }
.soc-wait { color: var(--mute, #94a3b8); }
.soc-stale { color: #fbbf24; }
.soc-hold { background: rgba(192,132,252,.14); border: 1px solid rgba(192,132,252,.45); color: #e9d5ff; border-radius: 10px; padding: 8px 10px; font-weight: 700; margin: 8px 0; }
.soc-counts { display: flex; gap: 18px; flex-wrap: wrap; }
.soc-counts b { display: block; font-size: 1.5rem; } .soc-counts span { color: var(--mute, #94a3b8); font-size: .82rem; }
.soc-list, .soc-plat { list-style: none; margin: 0; padding: 0; }
.soc-list li { padding: 7px 0; border-top: 1px solid rgba(255,255,255,.07); line-height: 1.35; overflow-wrap: anywhere; }
.soc-list a { color: #7dd3fc; } .soc-meta { display: block; font-size: .8rem; }
.soc-plat li { margin: 2px 0; }
