html, body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

.banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #007E8E;
    color: #ffffff;
    padding: 25px 20px;
    border-bottom-left-radius: 48px;
    border-bottom-right-radius: 48px;
    z-index: 100;
}

.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 100%;
}

.banner-text {
    flex: 1;
    padding-left: 130px;
}

.banner h1 {
    font-size: 2.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.banner h2 {
    font-size: 1.3rem;
    font-weight: 400;
    margin: 0;
    opacity: 0.9;
}

.banner-logo {
    flex-shrink: 0;
    padding-right: 130px;
}

.banner-image {
    height: 100px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.button-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 12px 20px;
    flex-wrap: wrap;
}

.nav-btn {
    background-color: #A020F0;
    color: #ffffff;
    border: none;
    border-radius: 32px;
    padding: 12px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 180px;
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.btn-text {
    display: block;
}

.btn-subtext {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: #ffffff;
    opacity: 1;
}

.nav-btn:hover {
    background-color: #7C0FC5;
}

.nav-btn.secondary {
    background-color: #fff;
    color: #007E8E;
    border: 2px solid #007E8E;
}

.nav-btn.secondary:hover {
    background-color: #f0fafa;
}

/* ─── Calculate & Clear Buttons - Separate Styling ─ */
.btn-calculate {
    background-color: #007E8E;
    color: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin: 0;
}

.btn-calculate:hover {
    background-color: #006666;
}

.btn-clear {
    background-color: #f0f0f0;
    color: #333;
    border: 2px solid #ccc;
    border-radius: 16px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-clear:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

.content-area {
    margin-top: 160px;
    margin-bottom: 30px;
    padding: 0 150px 20px 150px;
}

.home-terms {
    padding: 24px 0 20px 0;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.6;
}

.terms-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #007E8E;
    margin: 20px 0 2px 0;
}

.terms-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 12px;
    border-left: 4px solid #007E8E;
    padding-left: 10px;
    display: inline-block;
}

.home-terms p {
    font-weight: 400;
}

.dev-note-banner {
    font-size: 0.85rem;
    font-weight: 400;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.version-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #007E8E;
    color: #ffffff;
    text-align: center;
    padding: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Tablet */
@media (max-width: 768px) and (min-width: 481px) {
    .banner h1 {
        font-size: 1.4rem;
    }

    .banner h2 {
        font-size: 1.1rem;
    }

    .banner {
        padding: 28px 16px;
    }

    .content-area {
        padding: 0 40px 20px 40px;
    }

    .nav-btn {
        min-width: auto;
        padding: 10px 26px;
        font-size: 1.1rem;
    }

    .summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
}

/* Mobile */
@media (max-width: 480px) {
    .banner h1 {
        font-size: 1.1rem;
    }

    .banner h2 {
        font-size: 0.95rem;
    }

    .banner.home-page h2 {
        display: none;
    }

    .banner {
        padding: 20px 12px;
    }

    .banner-logo {
        display: none;
    }

    .banner-text {
        text-align: center;
        padding-left: 0;
    }

    .home-terms {
        font-size: 0.85rem;
        padding: 0 12px 16px 12px;
    }

    .terms-date {
        margin-top: 8px;
        margin-bottom: 2px;
    }

    .content-area {
        margin-top: 100px;
        margin-bottom: 20px;
        padding: 0 16px 20px 16px;
    }

    .nav-btn {
        padding: 10px 24px;
        font-size: 1rem;
        min-width: 140px;
        margin-bottom: 8px;
    }

    .btn-subtext {
        font-size: 0.85rem;
    }

    .calc-form {
        padding: 0 16px 16px 16px;
        margin: 0;
    }

    .form-section-title {
        font-size: 1.25rem;
        margin: 0 0 18px 0;
    }

    .form-row {
        flex-direction: row;
        gap: 12px;
        flex-wrap: wrap;
    }

    .form-group {
        min-width: auto;
        width: auto;
        flex: 1;
    }

    .sex-group {
        width: 100%;
        flex-basis: 100%;
    }

    .sex-group + .form-group {
        width: 100%;
        flex-basis: 100%;
    }

    .sex-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .form-action-row {
        display: flex;
        flex-direction: row;
        gap: 8px;
        margin-top: 16px;
    }

    .result-dose-value {
        font-size: 1.2rem;
    }

    .result-card-header {
        padding: 12px 16px !important;
        font-size: 0.75rem !important;
    }

    .card-green .result-card-header,
    .card-amber .result-card-header,
    .card-red .result-card-header {
        font-size: 0.75rem !important;
    }

    .result-rationale,
    .result-dose-block,
    .result-subsection {
        padding-left: 16px;
        padding-right: 16px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        width: 100% !important;
    }

    .summary-item {
        padding: 12px;
        min-height: 60px;
    }

    .summary-label {
        font-size: 0.7rem;
        font-weight: 400;
    }

    .summary-value {
        font-size: 0.9rem;
    }
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ─── Banner back button ─────────────────────────── */
.banner-back {
    position: absolute;
    left: 20px;
    top: 40px;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.8rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.banner-back:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}


/* ─── Input Form ─────────────────────────────────── */
.calc-form {
    padding-top: 40px;
}

.form-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #007E8E;
    margin: 0 0 32px 0;
    border-left: 4px solid #007E8E;
    padding-left: 10px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 140px;
}

.sex-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-input {
    border: 1.5px solid #ccc;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #007E8E;
}

.radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
    padding-top: 8px;
}

.sex-button-group {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.sex-btn {
    flex: 1;
    background-color: #f0f0f0;
    color: #333;
    border: 2px solid #ccc;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.sex-btn:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

.sex-btn.active {
    color: #ffffff;
    border-color: #007E8E;
}

.sex-btn[data-sex="male"].active {
    background-color: #0066cc;
    border-color: #0066cc;
}

.sex-btn[data-sex="female"].active {
    background-color: #ff69b4;
    border-color: #ff69b4;
}

/* Mode button group for Treatment/Prophylaxis selection */
.mode-button-group {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.mode-btn {
    flex: 1;
    background-color: #f0f0f0;
    color: #333;
    border: 2px solid #ccc;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-btn:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

.mode-btn.active {
    background-color: #0067A5;
    color: #ffffff;
    border-color: #0067A5;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    accent-color: #007E8E;
    width: 16px;
    height: 16px;
}

.validation-error {
    background: #fdecea;
    border-left: 4px solid #e53935;
    color: #b71c1c;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.form-action-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 16px;
}

/* ─── Results ────────────────────────────────────── */
.results-section {
    margin-top: 24px;
}

.results-summary {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 20px;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #A020F0;
    margin: 160px 0 32px 0;
    padding-top: 20px;
}

.summary-title-blue {
    color: #0067A5 !important;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f5fafa;
    border: 1px solid #b2dfdb;
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    min-height: 80px;
}

.summary-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: #05214D;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
}

.summary-item.highlight {
    background: #e0f5f5;
    border-color: #007E8E;
}

.summary-item.highlight .summary-value {
    color: #007E8E;
    font-size: 1.3rem;
}

.result-warning-box {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    color: #6d4c00;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.result-card {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.result-card-header {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.card-green .result-card-header  { font-size: 1.1em; background-color: #A020F0; }
.card-amber .result-card-header  { font-size: 1.1em; background-color: #e08000; }
.card-red   .result-card-header  { font-size: 1.7em; background-color: #c0392b; }
.card-blue  .result-card-header  { background-color: #0067A5; }

.result-rationale {
    padding: 12px 20px 0 20px;
    font-size: 0.9rem;
    color: #444;
    margin: 0;
}

.result-dose-block {
    margin: 16px 20px;
    background: #F3E5FF;
    border-radius: 8px;
    padding: 14px 18px;
}

.prophylaxis-dose-block {
    background: #dde9f8;
}

.prophylaxis-dose-block .result-dose-label {
    color: #0067A5;
}

.prophylaxis-dose-block .result-dose-value {
    color: #0067A5;
}

.result-dose-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #A020F0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.result-dose-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #7C0FC5;
}

.result-subsection {
    padding: 12px 20px;
    border-top: 1px solid #eee;
}

.result-subsection.warning {
    background: #fffde7;
}

.result-subsection.iv-heparin {
    background: #f5f5f5;
}

.result-subsection-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #05214D;
    margin-bottom: 6px;
}

.result-subsection p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
    color: #333;
    line-height: 1.6;
}

/* Result action buttons */
.result-action-buttons {
    display: flex;
    gap: 12px;
    padding: 20px 0;
    justify-content: center;
}

.btn-secondary {
    background-color: #0067A5;
    color: #ffffff;
    border: 2px solid #0067A5;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #6d28d9;
    border-color: #6d28d9;
}

/* ─── Extra Information Section ──────────────────── */
.extra-info-card {
    background: linear-gradient(135deg, #f0fffe 0%, #e8f9f8 100%);
    border: 2px solid #007E8E;
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 128, 128, 0.15);
}

.extra-info-header {
    background: linear-gradient(135deg, #007E8E 0%, #006666 100%);
    color: #ffffff;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 700;
}

.extra-info-content {
    padding: 20px;
}

.extra-info-content p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 400;
    color: #333;
    line-height: 1.6;
}

/* ─── Info Boxes Grid ────────────────────────────── */
.info-boxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-box {
    background: #ffffff;
    border: 2px solid #b2dfdb;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.info-box:hover {
    border-color: #007E8E;
    box-shadow: 0 4px 12px rgba(0, 128, 128, 0.2);
    transform: translateY(-2px);
}

.info-box-title {
    font-size: 1rem;
    font-weight: 700;
    color: #007E8E;
    margin-bottom: 8px;
}

.info-box-description {
    font-size: 0.85rem;
    color: #666;
}

/* ─── Modal Styles ───────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998 !important;
    display: block !important;
    visibility: visible !important;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    min-width: 300px;
    max-width: 650px;
    width: 85%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 9999 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #007E8E;
    background: linear-gradient(135deg, #f0fffe 0%, #e8f9f8 100%);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #007E8E;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #007E8E;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #006666;
}

.modal-body {
    padding: 30px;
}

.formula-section {
    margin-bottom: 25px;
}

.formula-section h3 {
    font-size: 1.1rem;
    color: #007E8E;
    margin: 0 0 12px 0;
    font-weight: 700;
}

.formula-box {
    background: linear-gradient(135deg, #f9fffe 0%, #f0fffe 100%);
    border: 2px solid #b2dfdb;
    border-radius: 8px;
    padding: 30px;
    font-family: 'Segoe UI', 'Courier New', monospace;
    color: #1a5555;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 128, 128, 0.08);
}

.formula-result {
    font-size: 1.3rem;
    font-weight: 700;
    color: #007E8E;
    white-space: nowrap;
}

.formula-fraction {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.formula-numerator {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding-bottom: 12px;
    color: #1a5555;
}

.formula-fraction-line {
    width: 100%;
    height: 3px;
    background-color: #007E8E;
    margin: 8px 0;
    border-radius: 2px;
}

.formula-denominator {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding-top: 12px;
    color: #1a5555;
}

.formula-notes {
    background: #e8f5f5;
    padding: 16px;
    border-radius: 5px;
    margin-top: 20px;
}

.formula-notes p {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #007E8E;
}

.formula-notes ul {
    margin: 8px 0 0 20px;
    padding: 0;
    font-weight: 400;
}

.formula-notes li {
    margin: 6px 0;
    font-weight: 400;
    color: #333;
}

.guideline-section {
    margin: 0 !important;
    margin-bottom: 0 !important;
}

.guideline-toggle {
    margin: 0 !important;
}

.guideline-section p {
    margin: 0 !important;
}

.formula-section-inline {
    padding: 12px;
    background: #f9f9f9;
    border-left: 3px solid #007E8E;
    margin: 8px 0;
    border-radius: 4px;
}

.formula-text {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
}

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

.calc-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #f5fafa;
    border: 1px solid #b2dfdb;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    min-height: 100px;
}

.calc-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.calc-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #007E8E;
}

.modal-footer {
    padding: 8px 20px 0 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 0;
}

.warning-modal {
    max-height: auto !important;
    overflow-y: visible !important;
    height: auto !important;
}

.warning-modal .modal-header {
    justify-content: center;
}

.extreme-size-warning .modal-header {
    background: linear-gradient(135deg, #fff3f0 0%, #ffe8e0 100%);
    border-bottom-color: #E67E50;
}

.extreme-size-warning .modal-header h2 {
    color: #E67E50;
}

.extreme-size-warning .modal-footer .btn-calculate {
    background-color: #E67E50;
    border-color: #E67E50;
}

.extreme-size-warning .modal-footer .btn-calculate:hover {
    background-color: #D46735;
}

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

.warning-modal .modal-footer {
    padding: 12px 20px;
}

/* ─── Mobile adjustments ─────────────────────────── */
@media (max-width: 480px) {
    .sex-group-label {
        width: 100%;
    }

    .form-input {
        font-size: 16px;
    }

    .banner-back {
        left: 12px;
        top: 16px;
        font-size: 1.5rem;
    }

    .banner-logo {
        display: none;
    }

    .banner-text {
        text-align: center;
        padding-left: 0;
    }

    /* Modal responsiveness */
    .modal {
        padding: 8px;
        max-height: 70vh;
    }

    .modal-header {
        padding: 10px 12px;
    }

    .modal-header h2 {
        font-size: 1.1rem;
        margin: 0;
    }

    .modal-body {
        padding: 10px 10px 0 10px;
    }

    .modal h3 {
        font-size: 0.8rem;
        margin-top: 8px;
        margin-bottom: 6px;
    }

    .formula-box {
        gap: 3px;
    }

    .guideline-section {
        margin: 0 !important;
        margin-bottom: 0 !important;
    }

    .guideline-toggle {
        margin: 0 !important;
    }

    .formula-result {
        font-size: 0.7rem;
    }

    .formula-numerator {
        font-size: 0.7rem;
        padding: 4px 0;
    }

    .formula-denominator {
        font-size: 0.7rem;
        padding: 4px 0;
    }

    .formula-fraction-line {
        margin: 2px 0;
        height: 2px;
    }

    .formula-notes {
        font-size: 0.75rem;
    }

    .formula-notes p {
        margin: 6px 0 4px 0;
        font-weight: 400;
    }

    .formula-notes ul {
        padding-left: 16px;
        font-weight: 400;
    }

    .formula-notes li {
        margin: 2px 0;
    }

    .modal-footer {
        padding: 6px;
        margin-bottom: 0;
    }

    .modal-footer button {
        font-size: 0.85rem;
        padding: 6px 16px;
    }

    .modal-body > h3 {
        font-size: 0.9rem;
        margin: 12px 0 6px 0 !important;
    }

    .modal-body > p {
        font-size: 0.85rem;
        font-weight: 400;
        margin: 8px 0;
    }

    .modal-body > ul {
        font-size: 0.8rem;
        font-weight: 400;
        margin: 6px 0;
        padding-left: 16px;
    }

    .modal-body > ul > li {
        margin: 4px 0;
    }

    .results-summary {
        margin-top: -20px;
    }

    .summary-title {
        margin-top: 0 !important;
    }
}

@media (min-width: 769px) {
    .summary-title {
        margin-top: 40px;
    }
}