:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --blue: #1d4ed8;
    --green: #10b981;
    --grey: #374151;
    --dark-red: #7f1d1d;
    --alert-red: #e11d48;
    --alert-yellow: #f59e0b;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background: linear-gradient(90deg, rgba(29,48,59,1) 0%, rgba(0,0,0,1) 50%, rgba(29,48,59,1) 100%);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

h2 {
    margin-top: 0;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #333;
    padding-bottom: 16px;
    margin-bottom: 32px;
}

/* Chart Section */
.chart-wrapper {
    position: relative;
    margin-bottom: 40px;
}

.chart-container-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.chart-container {
    display: flex;
    height: 54px;
    background-color: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 100%;
    border: 1px solid #333;
}

.segment {
    height: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    white-space: nowrap;
    box-sizing: border-box;
    position: relative;
}

/* Specific Chart Colours */
.bg-weights { background-color: var(--blue); }
.bg-reserve {
    background: repeating-linear-gradient(
        45deg,
        var(--dark-red),
        var(--dark-red) 10px,
        #500b0b 10px,
        #500b0b 20px
    );
}
.bg-pool-container { background-color: var(--grey); display: flex; justify-content: flex-start; }
.bg-pool-active { background-color: var(--green); height: 100%; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

/* Readouts Grid */
.readout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.readout-card {
    background: #2a2a2a;
    padding: 20px 16px;
    border-radius: var(--border-radius);
    text-align: center;
    border-top: 4px solid transparent;
    transition: transform 0.2s;
}

.readout-card:hover {
    transform: translateY(-2px);
}

.readout-card .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.readout-card .value {
    font-size: 1.5rem;
    font-weight: bold;
}

.c-total { border-top-color: #ffffff; }
.c-weights { border-top-color: var(--blue); }
.c-weights .value { color: #93c5fd; }

.c-pool { border-top-color: var(--grey); }

.c-active { border-top-color: var(--green); }
.c-active .value { color: #6ee7b7; }

.c-max { border-top-color: var(--alert-yellow); background: #332a1b; grid-column: 1 / -1; }
.c-max .value { color: var(--alert-yellow); }

/* Controls Section */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
    background: #1a1a1a;
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid #2a2a2a;
}

@media (max-width: 600px) {
    .controls { grid-template-columns: 1fr; }
}

.control-group { display: flex; flex-direction: column; gap: 12px; }

.control-header { display: flex; justify-content: space-between; align-items: center; }

label {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.slider-val {
    background: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: monospace;
    color: white;
}

.val-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.num-input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.875rem;
    font-family: monospace;
    text-align: right;
    width: 40px;
    padding: 0;
    outline: none;
    appearance: textfield;
    -moz-appearance: textfield;
}

.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; height: 20px; width: 20px; border-radius: 50%;
    background: var(--text-main); cursor: pointer; margin-top: -8px; box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 6px; cursor: pointer; background: #444; border-radius: 3px;
}

input[type=range]:focus { outline: none; }

/* Warning Banner */
.banner {
    padding: 16px;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.banner.stable {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border: 1px solid var(--green);
}

.banner.queued {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--alert-yellow);
    border: 1px solid var(--alert-yellow);
    animation: pulse 2s infinite;
}

        .banner.critical {
            background-color: rgba(225, 29, 72, 0.1);
            color: var(--alert-red);
            border: 1px solid var(--alert-red);
            animation: pulse 2s infinite;
        }

        .disclaimer {
            text-align: center;
            font-size: 0.75rem;
            color: var(--text-muted);
            font-style: italic;
            margin-top: 16px;
            line-height: 1.4;
        }

        @keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
