/* Propofol TCI TIVA V2.1 - Precision Instrument Dark Theme */
/* iPhone-optimized 3-step wizard UI */

/* ============================================
   CSS Variables - Clinical Monitor Palette
   Inspired by Philips IntelliVue / GE CARESCAPE
   ============================================ */
:root {
    --primary: #5BA4CF;
    --primary-dark: #3D7EA6;
    --primary-light: rgba(91,164,207,0.12);

    --success: #0F6E56;
    --success-light: rgba(15,110,86,0.15);
    --warning: #D4A017;
    --warning-light: rgba(212,160,23,0.12);
    --danger: #D85A30;
    --danger-light: rgba(216,90,48,0.12);
    --info: #5BA4CF;

    --bg: #0D1117;
    --bg-card: #161B22;
    --bg-surface: #21262D;
    --bg-elevated: #30363D;

    --text: #C9D1D9;
    --text-secondary: #8B949E;
    --text-muted: #484F58;
    --text-bright: #E6EDF3;

    --border: #30363D;
    --border-light: #21262D;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);

    --font: "Figtree", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --mono: "SF Mono", "JetBrains Mono", "Fira Code", "Menlo", monospace;

    --sat: env(safe-area-inset-top, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);

    --header-h: 48px;
    --step-nav-h: 44px;

    /* Chart colors — matches published comparison charts */
    --chart-cp: #3266AD;
    --chart-ce: #1D9E75;
    --chart-rate: #9B72B0;
    --chart-target: #D85A30;
    --chart-upper: #BA7517;
    --chart-grid: rgba(255,255,255,0.06);
}

/* ============================================
   Google Fonts
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Prevent iOS auto-zoom on input focus */
input, select, textarea {
    font-size: max(16px, 1rem);
    color: var(--text);
}

/* ============================================
   Loading Screen
   ============================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    background: #010409;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: var(--primary);
}

.loading-content h2 {
    color: var(--text-bright);
    margin-top: 8px;
}

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

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: calc(90vh - var(--sat));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: var(--sab);
    border-top: 1px solid var(--border);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-header h2, .modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-bright);
}

.modal-body {
    padding: 16px 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    padding: 4px 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Disclaimer Modal - centered on larger screens */
#disclaimerModal .modal-content {
    border-radius: 16px;
    max-width: 420px;
    margin: auto;
    padding-bottom: 0;
    border: 1px solid var(--border);
}

.disclaimer-content ul {
    margin: 8px 0 12px;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

.disclaimer-content li {
    margin-bottom: 4px;
}

.disclaimer-content li strong {
    color: var(--warning);
}

.disclaimer-basis {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.disclaimer-dev {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   Main App Layout
   ============================================ */
.main-app {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.main-app.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   Header - Dark OR Style
   ============================================ */
.app-header {
    min-height: var(--header-h);
    padding-top: var(--sat);
    background: #010409;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 2px solid var(--primary);
    padding-left: max(12px, var(--sal));
    padding-right: max(12px, var(--sar));
    flex-shrink: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-light);
}

.header-left h1 {
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--primary);
}

.version {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    background: rgba(91,164,207,0.15);
    color: var(--primary);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: var(--text);
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s;
}

.btn-icon:active {
    background: rgba(255,255,255,0.15);
}

.patient-summary {
    font-size: 12px;
    color: var(--text-secondary);
}

.icon-person {
    font-size: 16px;
    color: var(--primary);
}

/* ============================================
   Step Navigation Bar
   ============================================ */
.step-nav {
    height: var(--step-nav-h);
    background: #0D1117;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 max(8px, var(--sal));
    flex-shrink: 0;
    z-index: 10;
}

.step-tab {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: all 0.2s ease;
}

.step-tab.active {
    background: var(--primary-light);
    color: var(--primary);
}

.step-tab.completed {
    color: var(--success);
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-tab.active .step-num {
    background: var(--primary);
    color: #010409;
}

.step-tab.completed .step-num {
    background: var(--success);
    color: #010409;
}

.step-label {
    font-size: 13px;
}

.step-arrow {
    color: var(--text-muted);
    font-size: 10px;
}

/* ============================================
   Wizard Viewport & Track
   ============================================ */
.wizard-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.wizard-track {
    display: flex;
    width: 300%;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.wizard-step {
    width: calc(100% / 3);
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.step-content {
    padding: 12px max(12px, var(--sal)) calc(12px + var(--sab)) max(12px, var(--sar));
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   Step Title Bar
   ============================================ */
.step-title-bar {
    margin-bottom: 12px;
}

.step-title-bar h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-bright);
}

/* ============================================
   Control Cards
   ============================================ */
.control-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

/* ============================================
   Stepper Controls
   ============================================ */
.stepper-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stepper-control {
    width: 100%;
}

.stepper-control > label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stepper-row {
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    transition: border-color 0.2s;
}

.stepper-row:focus-within {
    border-color: var(--primary);
}

.stepper-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--bg-surface);
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
    transition: background 0.15s;
}

.stepper-btn:active {
    background: var(--primary);
    color: #010409;
}

.stepper-btn.holding {
    background: var(--primary);
    color: #010409;
}

.stepper-input {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    outline: none;
    padding: 0 4px;
}

/* Hide native number spinners */
.stepper-input::-webkit-inner-spin-button,
.stepper-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.stepper-input[type=number] {
    -moz-appearance: textfield;
}

.stepper-compact {
    flex: 0 1 auto;
}

.stepper-compact .stepper-row {
    width: auto;
}

.stepper-compact .stepper-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.stepper-compact .stepper-input {
    width: 60px;
    height: 40px;
    font-size: 16px;
}

/* ============================================
   Action Bar
   ============================================ */
.action-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary { background: var(--primary); color: #010409; font-weight: 700; }
.btn-primary:active:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-surface); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: #010409; font-weight: 700; }
.btn-success { background: var(--success); color: #010409; }
.btn-info { background: var(--info); color: #010409; }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-action { flex: 1; min-height: 44px; }

.hidden { display: none !important; }

/* ============================================
   Concentration Display
   ============================================ */
.concentration-display {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.conc-card {
    background: var(--bg-surface);
    border-radius: var(--border-radius-sm);
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.conc-card-primary {
    background: var(--primary-light);
    border: 1px solid var(--primary-dark);
}

.conc-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.conc-value-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.conc-value {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-bright);
}

.conc-card-primary .conc-value {
    color: var(--primary);
}

.conc-unit {
    font-size: 11px;
    color: var(--text-muted);
}

.time-mono {
    font-family: var(--mono);
}

/* ============================================
   LOC Ce Display
   ============================================ */
.loc-ce-display {
    margin-bottom: 12px;
}

.loc-ce-card {
    background: var(--warning-light);
    border: 2px solid var(--warning);
    border-radius: var(--border-radius);
    padding: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loc-ce-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--warning);
}

.loc-ce-value {
    font-family: var(--mono);
    font-size: 24px;
    font-weight: 800;
    color: var(--warning);
}

.loc-ce-unit {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   Transfer Banners
   ============================================ */
.transfer-banner {
    background: var(--primary-light);
    border: 1px solid var(--primary-dark);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    margin-bottom: 12px;
}

.transfer-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.transfer-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
}

.transfer-value {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.transfer-unit {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   Safety Margin
   ============================================ */
.margin-setting {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.margin-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-bright);
}

.margin-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.margin-formula {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.margin-unit {
    font-size: 13px;
    color: var(--text-secondary);
}

.target-result {
    background: var(--bg-surface);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-light);
}

.target-result-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.target-result-value {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.target-result-unit {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   Parameter Grid
   ============================================ */
.param-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.param-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.param-item > label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ============================================
   Advanced Settings
   ============================================ */
.advanced-settings {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.advanced-settings summary {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 0;
    -webkit-tap-highlight-color: transparent;
}

.advanced-settings .param-grid {
    margin-top: 8px;
}

/* ============================================
   Chart Container
   ============================================ */
.chart-container {
    position: relative;
    width: 100%;
    height: 220px;
    margin-bottom: 12px;
    background: #0D1117;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
    padding: 4px;
    touch-action: pan-y;
}

/* ============================================
   Results Grid
   ============================================ */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.results-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.result-card {
    background: var(--bg-surface);
    border-radius: var(--border-radius-sm);
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.result-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.result-value {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-bright);
    display: block;
}

.result-value-sm {
    font-size: 13px;
}

.result-unit {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

/* ============================================
   Protocol Results
   ============================================ */
.protocol-results {
    margin-top: 12px;
}

.dosing-schedule-details {
    margin-bottom: 12px;
}

.dosing-schedule-details summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 0;
}

.protocol-table {
    overflow-x: auto;
}

.protocol-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.protocol-table th,
.protocol-table td {
    border: 1px solid var(--border);
    padding: 6px 8px;
    text-align: center;
    color: var(--text);
}

.protocol-table th {
    background: var(--bg-surface);
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
}

.protocol-table .predictive {
    background: rgba(91,164,207,0.10);
    border-left: 3px solid var(--info);
}

.protocol-table .reactive {
    background: rgba(244,67,54,0.15);
    border-left: 3px solid var(--danger);
}

/* ============================================
   Dose Events
   ============================================ */
.dose-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.dose-events-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-bright);
}

.dose-events-list {
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dose-event {
    background: var(--bg-surface);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--success);
}

.dose-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-bright);
}

.dose-details {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.dose-stop {
    color: var(--danger);
    font-weight: 600;
}

.delete-dose {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* ============================================
   Snapshots
   ============================================ */
.snapshots-section {
    margin-bottom: 12px;
}

.snapshots-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-bright);
}

.snapshot-item {
    background: var(--bg-surface);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    margin-bottom: 6px;
    border-left: 3px solid var(--primary);
}

.snapshot-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.snapshot-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.snapshot-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.snapshot-values {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   Step Navigation Bottom
   ============================================ */
.step-nav-bottom {
    padding: 12px 0 8px;
}

.step-nav-dual {
    display: flex;
    gap: 8px;
}

.step-nav-dual .btn-back {
    flex: 0 0 auto;
}

.step-nav-dual .btn-next {
    flex: 1;
}

/* ============================================
   Form Styles
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-group > label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="time"],
.time-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    transition: border-color 0.2s;
    background: var(--bg-surface);
    color: var(--text);
}

.form-group input:focus,
.time-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.bmi-display {
    background: var(--bg-surface);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    text-align: center;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    border: 1px solid var(--border-light);
}

.bmi-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.radio-group {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    cursor: pointer;
    font-weight: normal;
    color: var(--text);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ============================================
   Simulation Results
   ============================================ */
.simulation-results {
    margin-top: 12px;
}

/* ============================================
   Utility
   ============================================ */
@keyframes valueUpdate {
    0% { background-color: rgba(91,164,207,0.25); }
    100% { background-color: transparent; }
}

.conc-value.updating {
    animation: valueUpdate 0.4s ease;
}

/* ============================================
   Responsive - Tablet and larger
   ============================================ */
@media (min-width: 768px) {
    .chart-container {
        height: 300px;
    }

    .concentration-display {
        gap: 12px;
    }

    .conc-value {
        font-size: 24px;
    }

    .step-content {
        max-width: 680px;
        padding: 16px 24px calc(16px + var(--sab));
    }

    .modal {
        align-items: center;
    }

    .modal-content {
        border-radius: 16px;
        max-height: 85vh;
    }
}

/* ============================================
   Desktop - larger screens
   ============================================ */
@media (min-width: 1024px) {
    .chart-container {
        height: 380px;
    }

    .step-content {
        max-width: 760px;
    }
}

/* ============================================
   High contrast
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --border: #888;
        --text-secondary: #ccc;
        --text-muted: #999;
    }

    .stepper-row {
        border-width: 3px;
    }
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .wizard-track {
        transition: none;
    }
}

/* ============================================
   Print
   ============================================ */
@media print {
    .app-header, .step-nav, .action-bar, .step-nav-bottom, .btn, .modal {
        display: none !important;
    }

    .wizard-viewport, .wizard-track, .wizard-step {
        overflow: visible;
        height: auto;
        width: 100%;
        position: static;
    }

    .wizard-track {
        display: block;
        width: 100%;
        transform: none !important;
    }

    .chart-container {
        height: 300px;
    }

    body {
        background: white;
        color: black;
    }
}
