:root {
    --bg: #0d0b08;
    --bg-2: #14110d;
    --panel: #1a1612;
    --panel-2: #221d17;
    --border: #2e2820;
    --border-bright: #423a2d;
    --text: #ebe4d4;
    --text-dim: #948a76;
    --text-faint: #5a5346;
    --accent: #d97757;
    --accent-dim: #8a4a30;
    --ok: #7ba87a;
    --warn: #d4a557;
    --crit: #d04848;
    --grid: rgba(217, 119, 87, 0.06);
    --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
    --display: 'Inter Tight', system-ui, sans-serif;
}

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

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.5;
    min-height: 100vh;
}

body {
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: -1px -1px;
}

.frame {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* === HEADER === */
header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

h1 {
    font-family: var(--display);
    font-weight: 900;
    font-size: 28px;
    letter-spacing: -0.02em;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 12px;
}
h1 .dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 2.4s ease-in-out infinite;
}
h1 .slash { color: var(--text-faint); font-weight: 500; }
h1 .sub { color: var(--accent); font-weight: 500; font-size: 16px; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.85); }
}

.status-row {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border-bright);
    border-radius: 2px;
    background: var(--panel);
}
.status-pill .led {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 6px currentColor;
}
.status-pill.err  .led { background: var(--crit); color: var(--crit); }
.status-pill.warn .led { background: var(--warn); color: var(--warn); }

/* === BUCKET GRID === */
.section-title {
    font-family: var(--display);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-title::before, .section-title::after {
    content: '';
    flex: 0 0 12px;
    height: 1px;
    background: var(--border-bright);
}
.section-title::after { flex: 1; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.bucket {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}
.bucket:hover { border-color: var(--border-bright); }

.bucket::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    height: 2px;
    width: var(--util, 0%);
    background: var(--bucket-color, var(--accent));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px var(--bucket-color, var(--accent));
}

.bucket .label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}
.bucket .name {
    font-family: var(--display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}
.bucket .value {
    font-family: var(--display);
    font-weight: 900;
    font-size: 56px;
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--bucket-color, var(--accent));
    margin-bottom: 4px;
}
.bucket .value .unit {
    font-size: 24px;
    color: var(--text-dim);
    font-weight: 500;
    margin-left: 4px;
}
.bucket .reset {
    font-size: 11px;
    color: var(--text-dim);
    border-top: 1px solid var(--border);
    margin-top: 16px;
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
}
.bucket .reset .val { color: var(--text); }

.bucket.empty {
    border-style: dashed;
    opacity: 0.4;
}
.bucket.empty .value { color: var(--text-faint); font-size: 24px; }

/* === FOOTER === */
.footer {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    color: var(--text-faint);
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.footer a {
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-faint);
}
.footer a:hover { color: var(--accent); border-color: var(--accent); }

/* === ERROR === */
.error-banner {
    background: rgba(208, 72, 72, 0.08);
    border: 1px solid rgba(208, 72, 72, 0.3);
    color: #e88080;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 12px;
}
.error-banner strong { color: #ff9090; }
