/*
  Copyright (c) 2024-2026 Dr. Hanna. All Rights Reserved.
  This software is proprietary and confidential.
  Unauthorized copying, distribution, or use of this file via any medium is strictly prohibited without a valid license.
  For licensing inquiries, please contact: hannafeedingcalc@proton.me
*/
:root {
    --bg-color: #f7fdf8;
    --primary: #1a7a6d;
    --primary-text: #FFFFFF;
    --secondary: #2a9d8f;
    --secondary-text: #1a1a1a;
    --highlight: #FFB366;
    --danger: #dc3545;
    --warning: #ffc107;
    --white: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border: #e0e0e0;
    --schedule-bg: #f9f9f9;
    --warning-bg: #fff3cd;
    --warning-text: #856404;
    --danger-bg: #f8d7da;
    --danger-text: #721c24;
    --info-bg: #d1ecf1;
    --info-border: #17a2b8;
    --info-text: #0c5460;
    --primary-hover: #15665b;
    --secondary-hover: #239485;
    --highlight-hover: #e6a85c;
    --copy-btn: #6c757d;
    --copy-btn-hover: #5a6268;
    --success: #28a745;
    --success-bg: #d4edda;
    --light-bg: #f0f9f7;
    --clearance-not-cleared-bg: #fdf2f2;
}

/* Dark mode — tool-specific overrides (shared vars in dark-theme.css) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --schedule-bg: #333333;
        --info-bg: #203540;
        --info-border: #4dd0e1;
        --info-text: #80deea;
        --primary-hover: #8CD9C0;
        --secondary-hover: #a3e3cf;
        --highlight-hover: #ffc994;
        --copy-btn: #4a4a4a;
        --copy-btn-hover: #5a5a5a;
        --light-bg: #1e3a36;
        --clearance-not-cleared-bg: #3a1f1f;
    }
}

:root[data-theme="dark"] {
    --schedule-bg: #333333;
    --info-bg: #203540;
    --info-border: #4dd0e1;
    --info-text: #80deea;
    --primary-hover: #8CD9C0;
    --secondary-hover: #a3e3cf;
    --highlight-hover: #ffc994;
    --copy-btn: #4a4a4a;
    --copy-btn-hover: #5a5a5a;
    --light-bg: #1e3a36;
    --clearance-not-cleared-bg: #3a1f1f;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    line-height: 1.6;
    font-size: 15px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

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

.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

#resultSection {
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .container {
        padding: 0 4px;
    }

    .date-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .date-quick-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .btn-date-quick {
        flex: 1;
    }
}

fieldset {
    margin-top: 15px;
    padding: 18px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background-color: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

legend {
    font-weight: 600;
    color: var(--primary);
    padding: 0 10px;
    font-size: 18px;
}

label {
    display: block;
    margin-top: 10px;
    color: var(--primary);
    font-weight: 500;
    font-size: 15px;
}

input[type="number"],
input[type="date"],
input[type="text"],
select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background-color: var(--white);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="number"]:focus-visible,
input[type="date"]:focus-visible,
input[type="text"]:focus-visible,
select:focus-visible {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.15);
}

.radio-group,
.checkbox-group {
    display: flex;
    align-items: center;
    margin-top: 8px;
    gap: 5px;
}

.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
    margin-right: 5px;
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 360px;
}

.date-input-group input[type="date"] {
    flex: 1;
    max-width: 180px;
}

#feedingInterval {
    max-width: 360px;
}

.date-quick-buttons {
    display: flex;
    gap: 5px;
}

.btn-date-quick {
    padding: 8px 14px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--white);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

.btn-date-quick:hover {
    background-color: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
}

.btn-date-quick:active {
    transform: scale(0.98);
}

.growth-display {
    background: var(--schedule-bg);
    border-left: 4px solid var(--secondary);
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    color: var(--text-primary);
}

.growth-display strong {
    color: var(--primary);
}

.alert {
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 15px;
    line-height: 1.5;
}

.alert-warning {
    background-color: var(--warning-bg);
    border-color: var(--warning);
    color: var(--warning-text);
}

.alert-danger {
    background-color: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger-text);
}

.alert-info {
    background-color: var(--info-bg);
    border-color: var(--info-border);
    color: var(--info-text);
}

.exclusion-checklist {
    background: var(--white);
    border: 1.5px solid var(--danger);
    border-left: 4px solid var(--danger);
    padding: 16px 18px;
    margin: 15px 0;
    border-radius: 8px;
}

.exclusion-checklist label {
    font-weight: normal;
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
    color: var(--text-primary);
}

.exclusion-checklist input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    margin-top: 4px;
}

.parental-communication {
    background: var(--white);
    border: 1.5px solid var(--primary);
    border-left: 4px solid var(--primary);
    padding: 16px 18px;
    margin: 15px 0;
    border-radius: 8px;
}

.parental-communication legend,
.parental-communication h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 8px 0;
}

.parental-communication label {
    font-weight: normal;
    display: flex;
    align-items: flex-start;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    cursor: pointer;
}

.parental-communication input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    margin-top: 3px;
}

button {
    padding: 10px 18px;
    font-size: 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 5px 5px 5px 0;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
}

button:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-text);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(26, 122, 109, 0.25);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--primary-text);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    box-shadow: 0 2px 8px rgba(42, 157, 143, 0.25);
}

.btn-success {
    background: var(--success);
    color: var(--primary-text);
}

.btn-success:hover {
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.25);
}

.btn-danger {
    background: var(--danger);
    color: var(--primary-text);
}

.btn-danger:hover {
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-primary);
}

.btn-warning:hover {
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.25);
}

.btn-copy {
    background: var(--copy-btn);
    color: white;
}

.btn-copy:hover {
    background: var(--copy-btn-hover);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#result {
    margin-top: 20px;
    background: var(--white);
    padding: 0;
    border-radius: 10px;
    border: 1.5px solid var(--secondary);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#result .header {
    background: var(--secondary);
    color: white;
    padding: 16px 20px;
    text-align: left;
}

#result .header h3 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 500;
}

#result .header .timestamp {
    font-size: 15px;
    opacity: 0.9;
}

#result .section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

#result .section:last-child {
    border-bottom: none;
}

#result .section-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#result .info-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
    margin: 4px 0;
    font-size: 15px;
    line-height: 1.4;
}

#result .info-label {
    font-weight: 500;
    color: var(--text-secondary);
}

#result .info-value {
    color: var(--text-primary);
}

#result .schedule-list {
    font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background: var(--schedule-bg);
    padding: 14px;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
    color: var(--text-primary);
}

#result .schedule-item {
    padding: 2px 0;
    font-weight: normal;
}

#result .schedule-item.milestone {
    font-weight: normal;
    color: var(--text-primary);
}

#result .safety-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#result .safety-list li {
    padding: 4px 0;
    padding-left: 25px;
    position: relative;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
}

#result .safety-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--text-secondary);
    font-weight: normal;
}

#result .disclaimer {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning);
    padding: 12px 16px;
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.5;
    font-weight: normal;
    color: var(--warning-text);
    border-radius: 4px;
}

#warningsContainer {
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.milestone {
    font-weight: normal;
    color: var(--secondary);
}

.disabled-section {
    opacity: 0.5;
    pointer-events: none;
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: var(--secondary);
    font-weight: bold;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background-color: var(--secondary);
    color: white;
    border-radius: 50%;
    font-size: 13px;
    font-weight: bold;
    margin-left: 5px;
    cursor: help;
    position: relative;
}

.info-icon:hover {
    background-color: var(--secondary-hover);
}

.info-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    background-color: var(--primary);
    color: white;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    width: 280px;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.info-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--primary) transparent transparent transparent;
}

.info-icon:hover .info-tooltip {
    visibility: visible;
    opacity: 1;
}

.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.print-only {
    display: none;
}

.notice-box {
    background: var(--white);
    border: 1.5px solid var(--primary);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin: 0 auto 24px auto;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.notice-box h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.notice-box p {
    margin: 6px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

footer {
    margin-top: 40px;
    padding: 24px 20px;
    background: var(--schedule-bg);
    border-top: 1.5px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 10px 10px 0 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

footer p {
    margin: 5px 0;
}

/* ============================================================================
   STICKY BOTTOM ACTION BAR — Progressive Disclosure
   ============================================================================ */

.bottom-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 75;
    background: var(--bg-color);
    border-top: 1.5px solid var(--border);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    padding: 10px 0;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
}

.bottom-action-bar.visible {
    transform: translateY(0);
}

body.has-bottom-bar {
    padding-bottom: 60px;
}

.bottom-bar-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 24px;
}

.bottom-bar-patient {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
}

.bar-placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.bar-badge {
    font-size: 16px;
    padding: 4px 12px;
    border-radius: 5px;
    background: var(--schedule-bg);
    color: var(--text-color);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.bottom-bar-actions {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
}

.bottom-bar-actions button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bar-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    margin: 0 4px;
}

.mobile-handle {
    display: none;
}

.print-dropdown {
    position: relative;
}

.print-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    min-width: 200px;
    z-index: 80;
}

.print-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 15px;
    font-family: inherit;
    text-align: left;
    border: none;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    margin: 0;
    border-radius: 0;
}

.print-menu button:hover {
    background: var(--schedule-bg);
}

.print-menu button:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 16px;
    min-height: 40px;
}

@media (max-width: 768px) {
    /* Bottom bar: collapsed drawer on mobile */
    .bottom-action-bar {
        padding: 0;
        transition: none;
    }

    .bottom-action-bar .mobile-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 16px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        color: var(--text-color);
    }

    .bottom-action-bar .mobile-handle .handle-pill {
        width: 36px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
    }

    .bottom-bar-inner {
        flex-direction: column;
        gap: 10px;
        padding: 0 16px 16px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease-out, padding 0.35s ease-out;
    }

    .bottom-action-bar.expanded .bottom-bar-inner {
        max-height: 400px;
        padding: 12px 16px 20px;
    }

    .bottom-bar-patient {
        font-size: 15px;
    }

    .bottom-bar-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .btn-sm {
        font-size: 14px;
        padding: 10px 16px;
        min-height: 44px;
        flex: 1 1 45%;
    }

    .bar-divider {
        display: none;
    }

    .print-dropdown {
        flex: 1 1 45%;
    }

    .print-dropdown .btn-sm {
        width: 100%;
    }

    /* Journey map: too small to render inline on mobile */
    #journeyMapPreview canvas {
        display: none;
    }
    #journeyMapPreview::after {
        content: 'Preview available on desktop. Check the box to include when printing.';
        display: block;
        font-size: 14px;
        color: var(--text-secondary);
        font-style: italic;
        padding: 10px 0;
    }

    /* Larger checkboxes on mobile */
    input[type="checkbox"] {
        width: 20px !important;
        height: 20px;
        min-width: 20px;
    }
}

[data-theme="dark"] .bottom-action-bar {
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25);
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--primary);
    color: #fff;
    /* Always white text on primary background for contrast */
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 500;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 4px solid var(--secondary);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

@media print {

    .notice-box,
    footer {
        display: none !important;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 25px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-content h3 {
    margin-top: 0;
    color: var(--primary);
}

.modal-content ul {
    margin: 10px 0;
    padding-left: 25px;
}

.modal-content a {
    color: var(--secondary);
    text-decoration: underline;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

/* Print styles - only override what's needed for print */
@media print {

    /* Hide non-printable elements */
    .no-print,
    h1,
    .version,
    .container,
    form,
    #warningsContainer,
    .header-logo-container {
        display: none !important;
    }

    #resultSection {
        display: block !important;
    }

    #resultSection h2 {
        display: none !important;
    }

    @page {
        margin: 0.3in;
        size: letter portrait;
    }

    /* Color overrides and spacing adjustments for print */
    #result {
        border-color: black !important;
        background: white !important;
        color: black !important;
        padding: 8px !important;
    }

    #result .header {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid black !important;
        padding: 4px 0 !important;
        margin-bottom: 4px !important;
        text-align: left !important;
    }

    #result .header h3,
    #result .header .timestamp {
        text-align: left !important;
    }

    #result .section {
        border-bottom-color: #999 !important;
        padding: 4px 0 !important;
    }

    #result .section-title {
        margin-bottom: 4px !important;
    }

    #result .info-row {
        margin: 1px 0 !important;
        line-height: 1.2 !important;
    }

    #result .schedule-list {
        background: white !important;
        border-color: #999 !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 6px !important;
        margin: 2px 0 !important;
        line-height: 1.3 !important;
    }

    #result .schedule-item {
        padding: 0 !important;
        line-height: 1.3 !important;
    }

    #result .schedule-item,
    #result .schedule-item.milestone {
        color: black !important;
    }

    #result .info-label,
    #result .info-value,
    #result .safety-list li {
        color: black !important;
    }

    #result .safety-list {
        margin: 2px 0 !important;
    }

    #result .safety-list li {
        padding: 1px 0 1px 18px !important;
        line-height: 1.2 !important;
    }

    #result .safety-list li:before {
        color: black !important;
    }

    #result .disclaimer {
        padding: 4px 8px !important;
        margin: 2px 0 !important;
        line-height: 1.2 !important;
    }

    #result .final-disclaimer {
        padding: 3px 0 !important;
        margin-top: 3px !important;
    }

    #result .final-disclaimer p {
        font-size: 9pt !important;
        line-height: 1.15 !important;
        padding: 0 5px !important;
    }

    /* Print growth chart on page 2 if checkbox is checked */
    #printGrowthChart.show-in-print,
    #printJourneyMap.show-in-print {
        display: block !important;
        page-break-before: always;
    }

    #printJourneyMap canvas {
        max-width: 100% !important;
        width: 100% !important;
        display: block;
    }

    #printGrowthChart.show-in-print h2 {
        font-size: 16pt;
        margin: 0 0 10px 0;
    }
}

.current-feeds-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.feed-input-box {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--schedule-bg);
}

.feed-input-box label {
    margin-top: 0;
    font-size: 15px;
}

.conversion-note {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 5px;
}

.header-logo-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    color: white;
    flex-shrink: 0;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
}

.footer-reference {
    font-size: 11px;
    font-style: italic;
    color: var(--text-secondary);
}

.footer-growth-link-p {
    margin-top: 10px;
    font-size: 13px;
}

.footer-growth-link-a {
    color: var(--primary);
    text-decoration: underline;
}

.footer-dev-info {
    margin-top: 10px;
    font-size: 11px;
}

.tier-update-warning {
    background: var(--warning-bg);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    border-left: 4px solid #ffc107;
}

.disclaimer-text {
    margin: 0;
    font-size: 11pt;
    line-height: 1.3;
    text-align: center;
    font-style: italic;
}

/* New classes for refactored inline styles */
.alert-danger-custom {
    margin-top: 15px;
}

.alert-info-custom {
    margin-top: 15px;
    font-size: 15px;
}

.fieldset-visible {
    overflow: visible;
}

.clinical-note-row {
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 10px;
}

.action-buttons-container {
    margin-top: 20px;
}

.export-import-container {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hidden-input {
    display: none;
}

.filter-container {
    margin-bottom: 15px;
    padding: 12px;
    background: var(--success-bg);
    border-radius: 6px;
    border: 1px solid var(--secondary);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.filter-checkbox {
    width: auto;
    margin: 0;
}

.filter-text {
    font-size: 15px;
    font-weight: 500;
}

.filter-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 5px;
    margin-left: 24px;
}

.growth-chart-option {
    margin: 10px 0;
    padding: 10px;
    background: var(--schedule-bg);
    border-radius: 4px;
}

.growth-chart-label {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 15px;
}

.growth-chart-checkbox {
    width: auto;
    margin-right: 8px;
}

.print-chart-page {
    page-break-before: always;
}

.print-chart-header {
    text-align: center;
    margin-bottom: 20px;
}

.print-chart-title {
    margin: 0;
}

.print-chart-info {
    font-size: 12pt;
    margin-top: 10px;
}

.print-chart-canvas-container {
    display: flex;
    justify-content: center;
}

.print-chart-footer {
    margin-top: 15px;
    font-size: 10pt;
    text-align: center;
    color: var(--text-secondary);
}

.print-chart-footer-text {
    margin: 5px 0;
}

/* ============================================================================
   PROGRESSIVE DISCLOSURE — Wizard Steps
   ============================================================================ */

.wizard-step {
    opacity: 1;
    transition: opacity 0.25s ease-out;
}

.wizard-step.hidden {
    display: none;
}

.wizard-step.revealing {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .wizard-step {
        transition: none;
    }
}

/* Step badge (number circle in fieldset legend) */
.step-badge {
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 6px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================================
   PROGRESSIVE DISCLOSURE — Standard / Custom mode toggle
   ============================================================================ */

/* Custom-only fields: hidden in Standard mode, visible in Custom */
body[data-mode="standard"] .custom-only {
    display: none;
}

.mode-toggle-container {
    text-align: center;
    padding: 12px 0 8px;
}

.mode-toggle-label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mode-toggle {
    display: inline-flex;
    background: var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.mode-toggle-btn {
    padding: 10px 28px;
    min-height: 44px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    margin: 0;
    font-family: inherit;
}

.mode-toggle-btn.active {
    background: var(--primary);
    color: var(--primary-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.mode-toggle-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.06);
}

.mode-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-style: italic;
}

/* ============================================================================
   PROGRESSIVE DISCLOSURE — Progress Indicator
   ============================================================================ */

.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0 8px;
    margin-bottom: 4px;
    gap: 0;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.progress-step span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid var(--border);
    color: var(--text-secondary);
    background: var(--white);
    transition: all 0.25s ease-out;
}

.progress-step small {
    font-size: 16px;
    color: var(--text-secondary);
    transition: color 0.25s ease-out;
}

.progress-step.active span {
    border-color: var(--primary);
    color: var(--primary);
}

.progress-step.active small {
    color: var(--primary);
    font-weight: 600;
}

.progress-step.completed span {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-text);
}

.progress-line {
    height: 2px;
    width: 52px;
    background: var(--border);
    margin: 0 4px;
    margin-bottom: 18px; /* offset for small label */
    transition: background 0.25s ease-out;
    flex-shrink: 0;
}

.progress-line.completed {
    background: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
    .progress-step span,
    .progress-line {
        transition: none;
    }
}

/* ============================================================================
   SETTINGS — Gear button + modal
   ============================================================================ */

.header-actions {
    position: absolute;
    right: 20px;
    top: 20px;
}

.btn-icon-clear {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.btn-icon-clear:hover {
    background: var(--primary);
    color: var(--primary-text);
}

/* ============================================================================
   PROTOCOL BAR — Inline compact protocol display
   ============================================================================ */

.protocol-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 15px;
    flex-wrap: wrap;
}

.protocol-bar-name {
    font-weight: 600;
    color: var(--primary);
}

.protocol-bar-version {
    color: var(--text-secondary);
    font-size: 13px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
    font-family: inherit;
}

.btn-link:hover {
    color: var(--primary-hover);
}

.protocol-bar .btn-link {
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 2px 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-left: 4px;
}

.protocol-bar .btn-link:hover {
    background: var(--primary);
    color: var(--primary-text, #fff);
}

/* ============================================================================
   CLEARANCE TOGGLE — Step 3 feeding clearance radio
   ============================================================================ */

.clearance-toggle {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.clearance-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: border-color 0.15s, background 0.15s;
}

.clearance-option.selected {
    border-color: var(--primary);
    background: var(--light-bg);
}

.clearance-not-cleared.selected {
    border-color: var(--danger);
    background: var(--clearance-not-cleared-bg);
}

.clearance-option input[type="radio"] {
    width: auto;
    margin: 0;
}

/* Protocol bar carryover flash */
.protocol-bar.flash {
    animation: flashHighlight 1.5s ease;
}

@keyframes flashHighlight {
    0%, 100% { background: inherit; }
    50% { background: var(--light-bg); }
}

@media (prefers-reduced-motion: reduce) {
    .protocol-bar.flash { animation: none; }
}

/* ============================================================================
   PRINT — Force all steps and fields visible
   ============================================================================ */

@media print {
    .wizard-step,
    .custom-only {
        display: block !important;
        opacity: 1 !important;
    }

    #contraindicationsPanel {
        display: block !important;
    }

    .wizard-progress,
    .mode-toggle-container,
    .protocol-bar .btn-link,
    .header-actions {
        display: none !important;
    }
}