:root {
    --bg: #111713;
    --panel: #19211d;
    --panel-soft: #202a25;
    --line: rgba(214, 229, 218, 0.12);
    --text: #eff5ef;
    --muted: #97a79d;
    --soft: #cad8cf;
    --green: #8bd3a7;
    --mint: #62d5b1;
    --amber: #e2c36e;
    --rose: #ef8f8f;
    --cyan: #82c7d8;
}

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

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
}

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

.pulse-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 42px;
}

.brand-link {
    font-family: 'Merriweather', serif;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--text);
}

.brand-link:hover { color: var(--green); }

.topbar-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 0.9rem;
}

.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px rgba(139, 211, 167, 0.55);
}

.pulse-hero {
    position: relative;
    min-height: 300px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 28px;
    align-items: end;
    margin-bottom: 28px;
}

.hero-copy {
    align-self: center;
    padding: 28px 0;
}

.eyebrow {
    display: inline-flex;
    color: var(--green);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.hero-copy h1 {
    font-family: 'Merriweather', serif;
    font-size: 4rem;
    line-height: 1.05;
    margin-bottom: 18px;
}

.hero-copy p {
    max-width: 620px;
    color: var(--muted);
    font-size: 1.1rem;
}

.hero-metrics {
    align-self: end;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    z-index: 2;
}

.hero-metric {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(25, 33, 29, 0.88);
}

.hero-metric span,
.metric-label,
.forge-grid span,
.system-row span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-metric strong {
    font-size: 1.45rem;
    line-height: 1;
}

.service-section,
.metric-card,
.chart-card,
.system-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.service-section {
    padding: 20px;
    margin-bottom: 18px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-header.compact { margin-bottom: 16px; }

.section-header h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.35rem;
    line-height: 1.2;
}

.section-header p,
.section-header span {
    color: var(--muted);
    font-size: 0.9rem;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.service-pill {
    min-height: 74px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.service-pill strong {
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

.service-pill span {
    color: var(--muted);
    font-size: 0.8rem;
}

.service-pill .status-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rose);
}

.service-pill.is-up .status-dot {
    background: var(--green);
    box-shadow: 0 0 12px rgba(139, 211, 167, 0.45);
}

.metric-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.8fr 0.8fr 0.9fr;
    gap: 18px;
    margin-bottom: 18px;
}

.metric-card {
    min-height: 220px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.metric-card-large { min-width: 0; }

.metric-card strong {
    font-size: 2.35rem;
    line-height: 1;
}

.metric-card p {
    color: var(--muted);
    font-size: 0.92rem;
}

.token-bars {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.token-bar {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.token-bar span {
    color: var(--muted);
    font-size: 0.82rem;
}

.token-bar i,
.meter {
    height: 9px;
    border-radius: 8px;
    background: #111713;
    overflow: hidden;
}

.token-bar i::before,
.meter i {
    content: "";
    display: block;
    width: var(--w, 0%);
    height: 100%;
    border-radius: 8px;
    background: var(--green);
}

#bar-reasoning::before { background: var(--amber); }
#bar-output::before { background: var(--cyan); }
#meter-io-wait,
#meter-io-pressure { background: var(--amber); }
#meter-swap { background: var(--cyan); }

.ring-card {
    align-items: center;
    text-align: center;
}

.ring {
    width: 132px;
    height: 132px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--amber) var(--angle, 0deg), #111713 0);
}

.ring::before {
    content: "";
    position: absolute;
}

.ring span {
    width: 94px;
    height: 94px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--panel);
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 800;
}

.ring-green { background: conic-gradient(var(--green) var(--angle, 0deg), #111713 0); }

.visual-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
    gap: 18px;
    margin-bottom: 18px;
}

.chart-card {
    min-height: 260px;
    padding: 20px;
}

#token-chart {
    width: 100%;
    height: 150px;
    display: block;
}

.chart-axis { stroke: rgba(214, 229, 218, 0.1); stroke-width: 1; }
.chart-area { fill: rgba(139, 211, 167, 0.12); }
.chart-line { fill: none; stroke: var(--green); stroke-width: 3; }
.chart-dot { fill: var(--green); }

.forge-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.forge-grid div {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.forge-grid strong {
    font-size: 1.65rem;
    line-height: 1;
}

.edge-traffic-card {
    align-self: start;
    display: flex;
    flex-direction: column;
    grid-column: 2;
    min-height: auto;
}

.traffic-total {
    display: block;
    font-size: 3rem;
    line-height: 1;
    margin: 24px 0 40px;
}

.traffic-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
}

.traffic-split div {
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.traffic-split span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.traffic-split strong {
    font-size: 1.22rem;
    line-height: 1;
}

.system-panel {
    padding: 20px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.system-bars {
    display: grid;
    gap: 9px;
    margin-top: auto;
}

.system-row {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 76px;
    align-items: center;
    gap: 12px;
}

.system-row strong {
    text-align: right;
    font-size: 0.96rem;
}

.pulse-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 28px;
    color: var(--muted);
    font-size: 0.9rem;
}

.pulse-footer a {
    color: var(--green);
}

@media (max-width: 980px) {
    .pulse-hero,
    .visual-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .edge-traffic-card {
        align-self: stretch;
        grid-column: auto;
    }

    .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .pulse-shell {
        width: min(100% - 28px, 1180px);
        padding-top: 18px;
    }

    .topbar,
    .section-header,
    .pulse-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-copy h1 {
        font-size: 2.55rem;
    }

    .service-grid,
    .forge-grid {
        grid-template-columns: 1fr;
    }

    .system-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .system-row strong {
        text-align: left;
    }
}
