:root {
  --bg: #08070b;
  --panel: #131118;
  --panel-2: #1a1720;
  --line: #2a2530;
  --text: #f3eee8;
  --muted: #958d99;
  --ember: #ff7a1a;
  --ember-deep: #c2410c;
  --cyan: #38bdf8;
  --good: #34d399;
  --warn: #ffb347;
  --bad: #ff5a3c;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Sora", "Manrope", system-ui, sans-serif; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.02rem; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.main { padding: 20px 26px 40px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Sidebar */
.side { position: sticky; top: 0; height: 100vh; padding: 26px 18px; border-right: 1px solid #17141b; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(180deg, #0c0a10, var(--bg)); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ember); margin: 0 6px 26px; }
.brand svg { width: 28px; height: 28px; filter: drop-shadow(0 0 10px rgba(255, 122, 26, .45)); }
.brand span { font: 600 1.32rem/1 "Sora", sans-serif; color: var(--text); letter-spacing: -0.02em; }
.brand em { font-style: normal; color: var(--ember); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); text-decoration: none; color: #cfc8d2; font-weight: 500; border: 1px solid transparent; }
.nav a:hover { background: #16131a; color: var(--text); }
.nav a.on { border-color: #5b2c12; background: linear-gradient(90deg, rgba(255, 122, 26, .16), rgba(255, 122, 26, .02)); color: var(--text); }
.ic { width: 30px; height: 30px; border-radius: 8px; background: #1b1820 center/16px no-repeat; border: 1px solid #2b2631; flex: none; }
.nav a.on .ic { background-color: #2a160b; border-color: #6b3414; }
.ic-grid { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff8a33'%3E%3Crect x='3' y='3' width='8' height='8' rx='2'/%3E%3Crect x='13' y='3' width='8' height='8' rx='2'/%3E%3Crect x='3' y='13' width='8' height='8' rx='2'/%3E%3Crect x='13' y='13' width='8' height='8' rx='2'/%3E%3C/svg%3E"); }
.ic-scan { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9d2dc' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 8V5a1 1 0 0 1 1-1h3M16 4h3a1 1 0 0 1 1 1v3M20 16v3a1 1 0 0 1-1 1h-3M8 20H5a1 1 0 0 1-1-1v-3M4 12h16'/%3E%3C/svg%3E"); }
.ic-report { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9d2dc' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 4v8h8'/%3E%3C/svg%3E"); }
.ic-cube { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9d2dc' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m12 3 8 4.5v9L12 21l-8-4.5v-9Z'/%3E%3Cpath d='M4 7.5 12 12l8-4.5M12 12v9'/%3E%3C/svg%3E"); }
.ic-alert { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9d2dc' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='4' width='16' height='16' rx='3'/%3E%3Cpath d='M12 8v5M12 16.5v.01'/%3E%3C/svg%3E"); }
.ic-clock { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9d2dc' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Cpath d='M12 8v4l3 2'/%3E%3C/svg%3E"); }
.ic-help { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9d2dc' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 13v-1a7 7 0 0 1 14 0v1'/%3E%3Crect x='3' y='13' width='4' height='6' rx='1.5'/%3E%3Crect x='17' y='13' width='4' height='6' rx='1.5'/%3E%3C/svg%3E"); }
.side-rule { height: 1px; margin: 26px 18px; background: linear-gradient(90deg, transparent, #ff7a1a66, transparent); }
.side-head { margin: 0 10px 6px; color: var(--muted); font-size: .86rem; }
.pro { margin-top: auto; padding: 16px; border-radius: var(--r-md); border: 1px solid #5b2c12; background: radial-gradient(120% 90% at 0% 0%, rgba(255, 122, 26, .22), transparent 60%), #120e10; }
.pro h3 { font-size: .98rem; margin-bottom: 6px; }
.pro p { margin: 0 0 12px; font-size: .84rem; color: #b9b0b4; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 11px 18px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.btn.sm { padding: 7px 14px; font-size: .88rem; }
.btn-ember { color: #1a0b03; background: linear-gradient(180deg, #ff9a45, #ff6a10); box-shadow: 0 0 0 1px #ff8a33 inset, 0 8px 24px -8px rgba(255, 106, 16, .7); }
.btn-ember:hover { filter: brightness(1.06); }
.btn-ghost { border-color: #3a333f; color: var(--text); background: #121016; }
.btn-ghost:hover { border-color: #5a505f; }
.btn[disabled] { opacity: .65; cursor: progress; }
.link { background: none; border: 0; padding: 0; color: #ffb27a; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 14px; }
.greet { margin: 0; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: #b8f5dc; padding-right: 6px; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(52, 211, 153, .16); }
.menu { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); flex-direction: column; justify-content: center; align-items: center; gap: 4px; cursor: pointer; }
.menu span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* Panels */
.panel { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid #221e27; border-radius: var(--r-lg); padding: 18px; position: relative; min-width: 0; }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tag { font-size: .78rem; color: #cfc6d2; padding: 3px 9px; border-radius: 999px; background: #221e27; border: 1px solid #2f2935; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); font-size: .9rem; }

/* Metrics */
.metrics h2 { margin-bottom: 14px; font-size: 1.12rem; }
.mgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 16px; border-radius: var(--r-md); border: 1px solid #241f29; background: radial-gradient(90% 120% at 0% 0%, rgba(255, 122, 26, .32), rgba(255, 122, 26, 0) 55%), #0f0d12; display: flex; flex-direction: column; gap: 6px; }
.metric span { color: #c2b9c4; font-size: .86rem; }
.metric b { font: 600 1.7rem/1.1 "Sora", sans-serif; }

/* Scan bar */
.scanbar { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 12px; }
.select { position: relative; }
.select select { appearance: none; width: 100%; height: 50px; border-radius: var(--r-md); border: 1px solid #2a2530; background: #17141b; color: var(--text); font: 600 .92rem "Manrope", sans-serif; padding: 0 40px 0 16px; cursor: pointer; }
.select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 1.5px solid #8e8693; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9c1cc' stroke-width='3'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") center/12px no-repeat; pointer-events: none; }
#addr { height: 50px; border-radius: var(--r-md); border: 1px solid #2a2530; background: #121015; color: var(--text); padding: 0 16px; font: 500 .95rem "Manrope", sans-serif; min-width: 0; }
#addr::placeholder { color: #6f6873; }
#addr:focus { border-color: #6b3414; outline: none; box-shadow: 0 0 0 3px rgba(255, 122, 26, .18); }
.scan-btn { height: 50px; min-width: 150px; }
.scan-btn .ic { width: 20px; height: 20px; background-color: transparent; border: 0; filter: brightness(0) saturate(100%); opacity: .8; }
.hint { margin: -8px 2px 0; color: var(--muted); font-size: .86rem; }
.hint.err { color: #ff9b85; }

/* Row 1 */
.row3 { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 16px; }
.big { font: 600 2rem/1 "Sora", sans-serif; display: block; margin: -4px 0 6px; }
.radar { position: relative; width: min(220px, 100%); margin: 0 auto; }
.radar svg { width: 100%; height: auto; display: block; }
.sweep { transform-origin: 110px 110px; animation: sweep 4s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.radar-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: .74rem; color: #c9f6ff; background: rgba(8, 7, 11, .7); padding: 3px 8px; border-radius: 6px; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }
.blip-tag { font: 600 9px "Manrope", sans-serif; }

.gwrap { position: relative; max-width: 260px; margin: 0 auto; }
.gsvg { width: 100%; height: auto; display: block; }
#garc { transition: stroke-dasharray 1.1s cubic-bezier(.2, .8, .2, 1); }
.gread { position: absolute; inset: 34% 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.gread span { color: #cfc6d2; font-size: .9rem; }
.gread b { font: 600 2.6rem/1.05 "Sora", sans-serif; }
.gread em { font-style: normal; font-size: .82rem; color: var(--muted); }
.legend { list-style: none; padding: 0; margin: 6px 0 0; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; font-size: .76rem; color: #c2b9c4; }
.legend li { display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: center; text-align: center; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.legend b { grid-column: 1 / -1; font-weight: 700; color: var(--text); }

.overview dl { margin: 0; display: grid; gap: 2px; }
.overview dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #1f1b23; font-size: .9rem; }
.overview dl div:last-child { border-bottom: 0; }
.overview dt { color: var(--muted); }
.overview dd { margin: 0; font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up { color: var(--good); } .down { color: var(--bad); }

/* Row 2 */
.row3b { display: grid; grid-template-columns: 1.25fr 1fr 1.25fr; gap: 16px; }
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pool { padding: 11px 12px; border-radius: var(--r-sm); background: #0f0d12; border: 1px solid #231f28; min-width: 0; }
.pool b { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool span { display: block; font-weight: 700; margin-top: 2px; }
.pool small { color: var(--muted); }
.cklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; max-height: 330px; overflow-y: auto; }
.cklist li:not(.empty) { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: #0f0d12; border: 1px solid #231f28; font-size: .86rem; }
.cklist li small { display: block; color: var(--muted); font-size: .76rem; }
.st { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; }
.st.ok { background: rgba(52, 211, 153, .14); color: var(--good); border: 1px solid rgba(52, 211, 153, .5); }
.st.warn { background: rgba(255, 179, 71, .12); color: var(--warn); border: 1px solid rgba(255, 179, 71, .5); }
.st.bad { background: rgba(255, 90, 60, .14); color: var(--bad); border: 1px solid rgba(255, 90, 60, .55); }
.st.na { background: #1d1a21; color: var(--muted); border: 1px solid #2d2832; }
.htable { width: 100%; border-collapse: collapse; font-size: .86rem; }
.htable th { text-align: left; font-weight: 500; color: var(--muted); padding: 7px 8px; background: #1d1a21; }
.htable th:first-child { border-radius: 8px 0 0 8px; } .htable th:last-child { border-radius: 0 8px 8px 0; }
.htable td { padding: 9px 8px; border-bottom: 1px solid #1f1b23; }
.htable td:first-child { font-family: "Manrope", sans-serif; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: .74rem; font-weight: 700; }
.pill.g { background: rgba(52, 211, 153, .15); color: var(--good); }
.pill.o { background: rgba(255, 179, 71, .14); color: var(--warn); }
.pill.r { background: rgba(255, 90, 60, .15); color: var(--bad); }
.pill.n { background: #221e27; color: #cfc6d2; }

.rlist { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.rlist li:not(.empty) { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #0f0d12; border: 1px solid #231f28; cursor: pointer; font-size: .86rem; }
.rlist li b { font-family: "Sora", sans-serif; }

/* Modules */
.modules { margin-top: 14px; }
.sec-head { max-width: 62ch; margin-bottom: 16px; }
.sec-head h2 { font-size: 1.5rem; margin-bottom: 6px; }
.sec-head p { margin: 0; color: #c2b9c4; }
.mods { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.mod { grid-column: span 2; display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; border: 1px solid #241f29; background: var(--panel); }
.mod:nth-child(1), .mod:nth-child(2) { grid-column: span 3; }
.mod img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: center; border-bottom: 1px solid #241f29; }
.mod.live { border-color: #6b3414; box-shadow: 0 0 0 1px rgba(255, 122, 26, .25), 0 20px 50px -30px rgba(255, 122, 26, .6); }
.mod-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mod-body h3 { font-size: 1.08rem; display: flex; align-items: center; gap: 10px; }
.mod-body p { margin: 0; color: #c9c0cb; max-width: 60ch; }
.key { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: .82rem; color: var(--ember); background: #24140b; border: 1px solid #5b2c12; }
.badge { align-self: flex-start; margin-top: auto; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #221e27; color: #cfc6d2; text-decoration: none; }
.badge.good { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.badge.live { background: rgba(255, 122, 26, .16); color: #ffb27a; border: 1px solid #6b3414; }

/* Why */
.why { padding: 24px; background: radial-gradient(70% 120% at 100% 0%, rgba(255, 122, 26, .14), transparent 60%), linear-gradient(180deg, var(--panel-2), var(--panel)); }
.why h2 { font-size: 1.35rem; margin-bottom: 8px; }
.lead { margin: 0 0 18px; color: #d6ced8; max-width: 70ch; }
.whygrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.whygrid div { padding: 16px; border-radius: var(--r-md); background: #0f0d12; border: 1px solid #241f29; border-left: 3px solid var(--ember); }
.whygrid .src { display: inline-block; margin-bottom: 8px; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ember); text-decoration: none; }
.whygrid .src::after { content: " ↗"; }
.whygrid .src:hover { text-decoration: underline; }
.whygrid h3 { font-size: .98rem; margin-bottom: 6px; }
.whygrid p { margin: 0; color: #c2b9c4; font-size: .9rem; }

.foot { color: var(--muted); font-size: .84rem; max-width: 90ch; }
.foot b { color: #e6dfe8; }
.fine { opacity: .7; }

/* Loading shimmer on panels while scanning */
.scanning .row3 .panel, .scanning .row3b .panel { opacity: .6; transition: opacity .2s; }

/* Responsive */
@media (max-width: 1200px) {
  .row3 { grid-template-columns: 1fr 1fr; }
  .overview { grid-column: 1 / -1; }
  .row3b { grid-template-columns: 1fr 1fr; }
  .pools { grid-column: 1 / -1; }
  .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .25s ease; padding-top: calc(26px + env(safe-area-inset-top, 0px)); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 20; display: none; }
  .scrim.on { display: block; }
  .menu { display: flex; }
  .greet { display: none; }
  .main { padding: 14px 14px 32px; }
  .row3, .row3b { grid-template-columns: 1fr; }
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:last-child { grid-column: 1 / -1; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scanbar { grid-template-columns: 1fr auto; }
  .select { grid-column: 1 / -1; }
  .scan-btn { min-width: 0; }
  .mods { grid-template-columns: 1fr; }
  .mod, .mod:nth-child(1), .mod:nth-child(2) { grid-column: auto; }
  .whygrid { grid-template-columns: 1fr; }
  .top-actions .btn-ghost { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sweep { animation: none; }
  #garc { transition: none; }
  html { scroll-behavior: auto; }
}
