:root {
    --bg-primary: #070d1e;
    --bg-secondary: #0d1733;
    --bg-card: rgba(18, 30, 60, 0.7);
    --bg-card-hover: rgba(25, 42, 85, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-blue: #38bdf8;
    --accent-ca: #3b82f6;
    --accent-mg: #a855f7;
    --accent-kh: #10b981;
    --accent-warn: #f59e0b;
    --accent-danger: #f43f5e;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 9999px;

    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at 50% 0%, #11224d 0%, #070d1e 70%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- iOS Top Header --- */
.ios-header {
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    background-color: rgba(7, 13, 30, 0.8);
    border-bottom: 1px solid var(--border-color);
    padding-top: max(env(safe-area-inset-top), 12px);
    padding-bottom: 12px;
    padding-left: 18px;
    padding-right: 18px;
}

.ios-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 680px;
    margin: 0 auto;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 1.6rem;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.4px;
    background: linear-gradient(135deg, #ffffff 30%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.btn-icon-plus {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.btn-icon-plus:active {
    transform: scale(0.92);
}

/* --- Main Content Container --- */
.ios-main-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 16px 18px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 85px);
}

/* --- Hero Card --- */
.hero-card {
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.12), rgba(18, 30, 60, 0.7));
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 22px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.hero-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.hero-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hero-time {
    text-align: right;
}

.time-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.time-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.hero-meta {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* --- Section Titles --- */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 22px 0 12px 2px;
}

.section-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
    border-radius: var(--radius-pill);
    font-weight: 600;
    text-transform: uppercase;
}

.section-link {
    font-size: 0.85rem;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

/* --- KPI Parameter Grid --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

@media (min-width: 500px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s ease;
}

.kpi-card:active {
    transform: scale(0.98);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.kpi-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.kpi-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
}

.kpi-badge.optimal {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.kpi-badge.low, .kpi-badge.critical_low {
    background: rgba(244, 63, 94, 0.2);
    color: #fb7185;
}

.kpi-badge.high, .kpi-badge.critical_high {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.kpi-value {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
}

.kpi-unit {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.kpi-target {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.kpi-footer {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* --- Fauna Marin Balling Cards --- */
.balling-cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.balling-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.balling-card.kh-accent { border-left: 4px solid var(--accent-kh); }
.balling-card.ca-accent { border-left: 4px solid var(--accent-ca); }
.balling-card.mg-accent { border-left: 4px solid var(--accent-mg); }

.balling-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.balling-channel-num {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.1);
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.balling-card.kh-accent .balling-channel-num { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.balling-card.ca-accent .balling-channel-num { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.balling-card.mg-accent .balling-channel-num { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.balling-card-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.balling-card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.balling-metrics {
    display: grid;
    grid-template-columns: 1fr auto 1.2fr 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

@media (max-width: 480px) {
    .balling-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .metric-arrow {
        display: none;
    }
}

.metric-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px;
    border: 1px solid var(--border-color);
}

.metric-box.highlight {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.3);
}

.metric-box.correction {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
}

.metric-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.metric-val {
    font-size: 1.15rem;
    font-weight: 800;
}

.metric-val small {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
}

.metric-val.ok { color: #34d399; }
.metric-val.pause { color: #f59e0b; font-size: 0.95rem; }

.metric-sub {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.metric-delta {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 4px;
}

.metric-delta.plus { color: #34d399; }
.metric-delta.minus { color: #f43f5e; }

.metric-arrow {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
}

/* --- Pump Instruction Banner --- */
.pump-instruction-banner {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.pump-icon {
    font-size: 1.6rem;
}

.pump-text {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.pump-text strong {
    color: #fff;
    display: block;
    margin-bottom: 2px;
}

.pump-final-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #38bdf8;
}

.pump-note {
    font-size: 0.75rem;
    margin-top: 2px;
    color: var(--text-muted);
}

.balling-advice-text {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* --- Nutrients Card --- */
.nutrients-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 22px;
}

.nutrients-ratio-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.ratio-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ratio-val {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.ratio-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.ratio-badge.optimal { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.ratio-badge.low, .ratio-badge.high { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.alert-box {
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-top: 10px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.alert-box.critical {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fecdd3;
}

.alert-box.tips {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #bae6fd;
}

.alert-item {
    margin-bottom: 4px;
}
.alert-item:last-child {
    margin-bottom: 0;
}

/* --- Canister Preview --- */
.canisters-preview-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

@media (min-width: 500px) {
    .canisters-preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.canister-card-mini {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.canister-card-mini.low {
    border-color: rgba(245, 158, 11, 0.4);
}

.canister-mini-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.canister-days.warn {
    color: #f59e0b;
}

.canister-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 6px;
}

.canister-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 0.3s ease;
}

.canister-mini-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* --- iOS Bottom Tab Bar --- */
.ios-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    background-color: rgba(7, 13, 30, 0.88);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    padding-bottom: max(env(safe-area-inset-bottom), 10px);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    gap: 3px;
    transition: color 0.15s ease;
    flex: 1;
}

.tab-icon {
    width: 22px;
    height: 22px;
    transition: transform 0.15s ease;
}

.tab-item.active {
    color: var(--accent-blue);
}

.tab-item.active .tab-icon {
    transform: translateY(-1px);
}

/* --- Modal Sheet iOS --- */
.ios-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.ios-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.ios-modal-sheet {
    background: #0d1733;
    border-top: 1px solid var(--border-highlight);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 16px 20px 40px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-modal-overlay.open .ios-modal-sheet {
    transform: translateY(0);
}

.modal-handle {
    width: 36px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto 12px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    width: 30px;
    height: 30px;
    border-radius: var(--radius-pill);
    font-size: 1.2rem;
    cursor: pointer;
}

/* --- Forms & Inputs --- */
.modal-form, .settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, .input-with-unit input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s ease;
    width: 100%;
}

.form-group input:focus, .input-with-unit input:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.09);
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.unit-tag {
    position: absolute;
    right: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

.section-title-sm {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-top: 6px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.btn-primary-ios {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
    transition: transform 0.15s ease;
    margin-top: 8px;
}

.btn-primary-ios:active {
    transform: scale(0.97);
}

.btn-secondary-ios {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

/* --- Toast --- */
.ios-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(13, 23, 51, 0.95);
    border: 1px solid var(--accent-blue);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 300;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.ios-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* --- Calculator Page Specifics --- */
.calc-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.calc-tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.calc-tab-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--accent-blue);
    color: #fff;
}

.tab-badge-num {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: var(--radius-pill);
}

.calc-card, .calc-results-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 18px;
    backdrop-filter: blur(20px);
}

.calc-input-row {
    margin-bottom: 16px;
}

.input-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.input-labels label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.val-display {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent-blue);
}

input[type=range] {
    width: 100%;
    accent-color: var(--accent-blue);
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
}

.res-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.res-badge {
    font-size: 0.72rem;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    text-transform: uppercase;
}

.res-canister-title {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.res-grid-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.res-stat-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.res-stat-box.highlight {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.stat-lbl {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: block;
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 4px 0;
}

.stat-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.pump-rec-box {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
}

.rec-title {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.rec-val {
    font-size: 1.7rem;
    font-weight: 800;
    color: #38bdf8;
    margin: 4px 0;
}

.rec-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.rec-then {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.res-advice-box {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.res-recipe-box {
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 0.8rem;
}

.recipe-title {
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.recipe-content {
    color: var(--text-secondary);
}

/* --- History Page & Charts --- */
.chart-card, .table-card, .settings-card, .guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(20px);
}

.chart-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.chart-tab-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}

.chart-tab-btn.active {
    background: var(--accent-blue);
    color: #070d1e;
    font-weight: 700;
}

.chart-container {
    position: relative;
    height: 240px;
    width: 100%;
}

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

.measurement-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.measurement-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.row-date {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-del {
    background: none;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.6;
}

.btn-del:hover {
    opacity: 1;
}

.row-values {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.val-item {
    display: flex;
    flex-direction: column;
}

.v-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.v-num {
    font-size: 0.95rem;
    font-weight: 700;
}

.v-num.warn {
    color: #f59e0b;
}

.v-num small {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted);
}

.row-extra {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* --- Canisters Page --- */
.canisters-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.canister-full-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}

.canister-full-card.low {
    border-color: rgba(245, 158, 11, 0.5);
}

.canister-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.canister-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.canister-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.canister-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.canister-badge.ok {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.canister-badge.warn {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.canister-tank-display {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
}

.tank-outline {
    width: 60px;
    height: 90px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px 8px 12px 12px;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.tank-liquid {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: height 0.4s ease;
}

.tank-percentage {
    font-size: 0.65rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tank-metrics {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tank-metric-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
}

.tank-metric-item .val.highlight {
    font-weight: 800;
    color: #38bdf8;
}

.canister-recipe-note {
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.canister-actions {
    display: flex;
    gap: 10px;
}

.btn-refill, .btn-manual-set {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-refill {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-manual-set {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid var(--border-color);
}

/* --- Mixing Guide --- */
.guide-step {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
}

.guide-step:last-child {
    margin-bottom: 0;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-pill);
    background: var(--accent-blue);
    color: #070d1e;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-body h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.step-body p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* --- Settings Hints --- */
.field-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* --- Login / Lock Screen --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-wrapper {
    width: 100%;
    max-width: 320px;
    text-align: center;
    padding: 20px;
}

.login-lock-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 800;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.pin-dots .dot {
    width: 14px;
    height: 14px;
    border-radius: var(--radius-pill);
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.15s ease;
}

.pin-dots .dot.filled {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.login-error {
    color: var(--accent-danger);
    font-size: 0.85rem;
    font-weight: 600;
    height: 20px;
    margin-bottom: 16px;
}

.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    justify-items: center;
}

.numpad-key {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s ease, transform 0.1s ease;
}

.numpad-key:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.94);
}

.numpad-key.empty {
    visibility: hidden;
}

.numpad-key.delete {
    font-size: 1.2rem;
    background: none;
    border: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.login-wrapper.shake {
    animation: shake 0.4s ease;
}
