.statlite-demo {
    --demo-bg: #050807;
    --demo-panel: #0d1410;
    --demo-panel-2: #101813;
    --demo-border: #1f2a24;
    --demo-text: #e5e7eb;
    --demo-strong: #f3f4f6;
    --demo-soft: #cbd5e1;
    --demo-muted: #8b949e;
    --demo-green: #2fd36b;
    --demo-blue: #60a5fa;
    --demo-amber: #f59e0b;
    --demo-red: #ef4444;
    --demo-violet: #a78bfa;
    background: var(--demo-bg);
    color: var(--demo-text);
    font-size: 14px;
    line-height: 1.45;
    border-top: 1px solid var(--demo-border);
}

.statlite-demo h1,
.statlite-demo h2,
.statlite-demo h3 {
    max-width: none;
    margin: 0;
    color: var(--demo-strong);
    font-family: Inter, system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
}

.statlite-demo p { margin: 0; }

.statlite-demo a {
    color: var(--demo-muted);
    text-decoration: none;
}

.statlite-demo a:hover,
.statlite-demo a:focus-visible {
    color: var(--demo-green);
    text-decoration: underline;
}

.statlite-demo .dashboard-bar,
.statlite-demo .demo-body,
.statlite-demo .dashboard-footer {
    width: min(1440px, calc(100% - 32px));
    margin-inline: auto;
}

.statlite-demo .dashboard-bar {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0 0;
}

.statlite-demo .demo-heading {
    min-width: 0;
}

.statlite-demo .demo-heading h1 {
    color: var(--demo-green);
    font-family: Sora, Inter, system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.statlite-demo .demo-heading p {
    margin-top: 2px;
    color: var(--demo-muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.statlite-demo .demo-body {
    margin-top: 18px;
    margin-bottom: 28px;
}

.statlite-demo .dashboard-footer {
    padding: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    color: var(--demo-muted);
    font-size: 12px;
}

.statlite-demo .footer-summary,
.statlite-demo .footer-project {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.statlite-demo .footer-separator { color: var(--demo-border); }

.statlite-demo .target-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 14px;
    min-width: 0;
    color: var(--demo-soft);
    font-size: 13px;
}

.statlite-demo .target-name {
    min-width: 0;
    font-weight: 700;
    color: var(--demo-strong);
    overflow-wrap: anywhere;
}

.statlite-demo .target-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
}

.statlite-demo .target-status {
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1;
}

.statlite-demo .target-status.ok { color: var(--demo-green); }
.statlite-demo .target-status.warn { color: var(--demo-muted); }
.statlite-demo .target-status.bad { color: var(--demo-red); }

.statlite-demo .target-type {
    color: var(--demo-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.statlite-demo .target-type-wrap,
.statlite-demo .label-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.statlite-demo .target-endpoint {
    flex: 1 1 260px;
    min-width: 0;
    color: var(--demo-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.statlite-demo .target-select {
    max-width: 240px;
    min-height: 44px;
    border: 1px solid var(--demo-border);
    border-radius: 6px;
    background: var(--demo-panel-2);
    color: var(--demo-text);
    padding: 8px 10px;
    font: inherit;
    font-weight: 600;
}

.statlite-demo .target-select.hidden,
.statlite-demo .target-name.hidden {
    display: none;
}

.statlite-demo .range {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--demo-border);
    border-radius: 8px;
    background: var(--demo-panel-2);
}

.statlite-demo .range button {
    min-width: 64px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--demo-soft);
    padding: 8px 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.statlite-demo .range button:hover,
.statlite-demo .range button:focus-visible {
    background: rgba(229, 231, 235, 0.06);
    color: var(--demo-text);
}

.statlite-demo .range button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.statlite-demo .range button.active {
    background: rgba(47, 211, 107, 0.14);
    color: var(--demo-green);
    border-color: rgba(47, 211, 107, 0.35);
}

.statlite-demo .status-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(132px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
    min-width: 0;
}

.statlite-demo .metric,
.statlite-demo .chart,
.statlite-demo .section {
    min-width: 0;
    background: var(--demo-panel);
    border: 1px solid var(--demo-border);
    border-radius: 8px;
}

.statlite-demo .metric {
    min-height: 64px;
    padding: 10px 12px;
}

.statlite-demo .metric.poll-status { min-height: 72px; }

.statlite-demo .label {
    color: var(--demo-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.statlite-demo .label-help {
    display: flex;
    align-items: center;
    gap: 6px;
}

.statlite-demo .help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid var(--demo-border);
    border-radius: 50%;
    background: transparent;
    color: var(--demo-muted);
    padding: 0;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    cursor: help;
}

.statlite-demo .help:hover,
.statlite-demo .help:focus-visible,
.statlite-demo .help.open {
    color: var(--demo-text);
    border-color: rgba(47, 211, 107, 0.45);
}

.statlite-demo .tooltip {
    display: none;
    position: absolute;
    z-index: 20;
    left: 0;
    top: calc(100% + 6px);
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    padding: 8px 10px;
    border: 1px solid var(--demo-border);
    border-radius: 6px;
    background: #080d0a;
    color: var(--demo-text);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.statlite-demo .tooltip.right {
    left: auto;
    right: 0;
}

.statlite-demo .help:hover + .tooltip,
.statlite-demo .help:focus-visible + .tooltip,
.statlite-demo .help.open + .tooltip {
    display: block;
}

.statlite-demo .value {
    margin-top: 4px;
    font-size: 17px;
    font-weight: 700;
    color: var(--demo-strong);
    overflow-wrap: anywhere;
}

.statlite-demo .value.small {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.statlite-demo .poll-status-state.ok { color: var(--demo-green); }
.statlite-demo .poll-status-state.bad { color: var(--demo-red); }

.statlite-demo .poll-status-error {
    margin-top: 3px;
    color: var(--demo-muted);
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.statlite-demo .poll-status-error[hidden] { display: none; }

.statlite-demo .pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: #162019;
    color: var(--demo-muted);
    border: 1px solid var(--demo-border);
}

.statlite-demo .pill.ok {
    background: rgba(47, 211, 107, 0.12);
    color: var(--demo-green);
    border-color: rgba(47, 211, 107, 0.24);
}

.statlite-demo .pill.warn {
    background: rgba(245, 158, 11, 0.12);
    color: var(--demo-amber);
    border-color: rgba(245, 158, 11, 0.24);
}

.statlite-demo .pill.bad {
    background: rgba(239, 68, 68, 0.12);
    color: var(--demo-red);
    border-color: rgba(239, 68, 68, 0.24);
}

.statlite-demo .chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
}

.statlite-demo .capability-section { margin-top: 18px; }
.statlite-demo .capability-section[hidden] { display: none; }

.statlite-demo .capability-section > h2 {
    margin: 0 0 10px;
    color: var(--demo-strong);
    font-size: 17px;
}

.statlite-demo .chart {
    overflow: hidden;
    min-height: 300px;
    padding: 14px;
}

.statlite-demo .chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    min-width: 0;
}

.statlite-demo .chart h2,
.statlite-demo .section h2 {
    margin: 0;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--demo-strong);
}

.statlite-demo .note {
    color: var(--demo-muted);
    font-size: 12px;
    min-height: 18px;
    text-align: right;
}

.statlite-demo .canvas-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 238px;
}

.statlite-demo .canvas-wrap canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 100% !important;
}

.statlite-demo .lower {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
    min-width: 0;
}

.statlite-demo .section {
    padding: 14px;
    min-height: 260px;
}

.statlite-demo .events {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.statlite-demo .event {
    display: grid;
    grid-template-columns: 144px 86px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border-top: 1px solid var(--demo-border);
}

.statlite-demo .events > .event:first-child { border-top: 0; }

.statlite-demo .event-time,
.statlite-demo .event-kind {
    color: var(--demo-muted);
    font-size: 12px;
}

.statlite-demo .event-kind,
.statlite-demo .event-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

.statlite-demo pre {
    margin: 12px 0 0;
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--demo-border);
    border-radius: 6px;
    padding: 12px;
    background: #070c09;
    color: var(--demo-text);
    font-size: 12px;
}

.statlite-demo .empty {
    margin-top: 12px;
    color: var(--demo-muted);
}

@media (max-width: 1100px) {
    .statlite-demo .status-grid { grid-template-columns: repeat(4, minmax(132px, 1fr)); }
}

@media (max-width: 820px) {
    .statlite-demo .dashboard-bar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0 0;
    }

    .statlite-demo .status-grid,
    .statlite-demo .chart-grid,
    .statlite-demo .lower {
        grid-template-columns: 1fr;
    }

    .statlite-demo .range {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .statlite-demo .range button { min-width: 0; }

    .statlite-demo .event {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

@media (max-width: 520px) {
    .statlite-demo .dashboard-bar,
    .statlite-demo .demo-body,
    .statlite-demo .dashboard-footer {
        width: min(100% - 20px, 1440px);
    }

    .statlite-demo .target-context {
        align-items: flex-start;
        flex-direction: column;
    }

    .statlite-demo .target-picker { width: 100%; }
    .statlite-demo .target-select { max-width: 100%; width: 100%; }
    .statlite-demo .target-endpoint { flex: 0 1 auto; max-width: 100%; }
    .statlite-demo .chart { padding: 12px; }

    .statlite-demo .chart-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .statlite-demo .note { text-align: left; }

    .statlite-demo .dashboard-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
