/* Shared look for the hub's tool pages (gas, expiry board, smart money, work, status). Same palette as Chain view. */
:root {
    --bg: #070b12; --bg-2: #0b111c; --surface: #101826; --surface-2: #142033; --line: #1e2c42;
    --text: #dbe5f1; --text-dim: #8fa1b8; --accent: #4fd1ff; --accent-2: #7c6cff; --amber: #ffc860; --red: #ff6b7a; --green: #5ce0a8; --pink: #ff9ad0;
    --font-display: "Space Grotesk", "Segoe UI", sans-serif; --font-body: "Inter", "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
    --pad: clamp(16px, 3vw, 32px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100svh; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background: radial-gradient(ellipse 60% 40% at 15% 0%, rgba(79, 209, 255, .08), transparent 70%), radial-gradient(ellipse 50% 40% at 90% 10%, rgba(124, 108, 255, .08), transparent 70%); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--font-mono); }
.dim { color: var(--text-dim); }
.small { font-size: .8rem; }
.up { color: var(--green); }
.down { color: var(--red); }

.bar { display: flex; align-items: center; gap: 18px; padding: 14px var(--pad); border-bottom: 1px solid var(--line); flex-wrap: wrap; background: rgba(7, 11, 18, .7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.back { color: var(--text-dim); font-weight: 500; }
.back:hover { color: var(--accent); text-decoration: none; }
.bar h1 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.bar h1 .dim { font-weight: 500; font-size: .85rem; margin-left: 8px; }
.controls { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sel { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .12em; }
select, input[type="text"], input[type="email"], input[type="number"], textarea {
    background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: .92rem; width: auto; }
textarea { resize: vertical; min-height: 120px; width: 100%; }
select:focus, input:focus, textarea:focus { outline: none; border-color: rgba(79, 209, 255, .6); }
.pill { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim); white-space: nowrap; }
.pill.ok, .pill[data-state="live"] { color: var(--green); border-color: rgba(92, 224, 168, .4); }
.pill.warn, .pill[data-state="stale"] { color: var(--amber); border-color: rgba(255, 200, 96, .4); }
.pill.bad, .pill[data-state="error"] { color: var(--red); border-color: rgba(255, 107, 122, .4); }

.btn { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--accent), #8ad9ff); color: #061018; border: 0; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: rgba(79, 209, 255, .5); color: var(--accent); }
.btn.sm { padding: 5px 10px; font-size: .8rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: default; }

main { padding: 18px var(--pad) 48px; max-width: 1400px; margin: 0 auto; }
.lead { color: var(--text-dim); max-width: 760px; margin-bottom: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; min-width: 0; }
.card h2 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.card h3 { font-family: var(--font-display); font-size: .95rem; font-weight: 600; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.section-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; margin: 26px 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-title .dim { font-family: var(--font-body); font-size: .82rem; font-weight: 400; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .86rem; margin-top: 10px; }
.kv dt { color: var(--text-dim); }
.kv dd { text-align: right; font-family: var(--font-mono); font-size: .82rem; }

.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); font-weight: 600; background: var(--bg-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: rgba(79, 209, 255, .04); }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; margin-top: 22px; padding: 16px 18px; border-radius: 16px; border: 1px solid rgba(124, 108, 255, .35); background: linear-gradient(135deg, rgba(124, 108, 255, .12), rgba(79, 209, 255, .06)); }
.cta p { color: var(--text-dim); max-width: 640px; }
.cta b { color: var(--text); }
.note { margin-top: 14px; font-size: .78rem; color: var(--text-dim); }
.empty { padding: 26px; text-align: center; color: var(--text-dim); }
.err { color: var(--red); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-size: .88rem; z-index: 20; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }

@media (max-width: 640px) {
    .bar { gap: 10px; }
    .controls { margin-left: 0; width: 100%; }
    th, td { padding: 8px 9px; }
}

/* ---------- Single-view pages: on a desktop-sized window the page fits the
   viewport and only inner panels scroll. Below that, normal scrolling. ---------- */
@media (min-width: 1000px) and (min-height: 640px) {
    body.app { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
    body.app > .bar { position: static; flex: 0 0 auto; }
    body.app > main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; width: 100%; padding-top: 12px; padding-bottom: 12px; }
    body.app .fill { flex: 1 1 auto; min-height: 0; }
    body.app .lead { margin-bottom: 10px; }
}
.foot-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 10px; font-size: .78rem; color: var(--text-dim); }
.foot-line .btn { padding: 6px 12px; font-size: .8rem; }
.kind { display: inline-block; font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.kind.exchange { color: var(--accent); border-color: rgba(79, 209, 255, .45); }
.kind.contract, .kind.router { color: #b9b0ff; border-color: rgba(124, 108, 255, .5); }
.kind.bridge { color: var(--pink); border-color: rgba(255, 154, 208, .45); }
.kind.bot { color: var(--amber); border-color: rgba(255, 200, 96, .45); }
.kind.fund { color: var(--green); border-color: rgba(92, 224, 168, .45); }
.kind.guess { border-style: dashed; }
