:root {
    font-family:
        Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;

    color: #18201d;
    background-color: #f4f7f5;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
}

button,
input,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

#app {
    flex: 1 0 auto;
    width: min(100% - 32px, 960px);
    margin: 0 auto;
    padding: 28px 0 60px;
}

.site-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(100% - 32px, 960px);
    margin: 0 auto;
    padding: 20px 0 26px;
    border-top: 1px solid #dce4e0;
    color: #68766f;
    font-size: 0.88rem;
}

.site-footer > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-footer__link,
.site-footer__feedback {
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.site-footer__link {
    padding: 8px 6px;
    border: 0;
    background: transparent;
    color: #66746e;
}

.site-footer__feedback {
    padding: 9px 13px;
    border: 1px solid #39715c;
    background: #ffffff;
    color: #2d7358;
}

.site-footer__link:hover,
.site-footer__feedback:hover {
    background: #edf3f0;
}

.feedback-overlay {
    position: fixed;
    z-index: 1100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(16, 27, 23, 0.58);
    backdrop-filter: blur(4px);
}

.feedback-dialog {
    width: min(100%, 540px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 26px;
    border: 1px solid #d7e0dc;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 35, 27, 0.25);
}

.feedback-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.feedback-dialog__header h2 {
    margin: 5px 0 0;
}

.feedback-context {
    display: grid;
    gap: 3px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eef6f2;
    color: #375348;
}

.feedback-context small {
    color: #6b7973;
}

.feedback-form {
    display: grid;
    gap: 16px;
}

.feedback-form label {
    display: grid;
    gap: 7px;
    color: #31443c;
    font-weight: 700;
}

.feedback-form select,
.feedback-form textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cbd8d2;
    border-radius: 11px;
    background: #ffffff;
    color: #18201d;
    resize: vertical;
}

.feedback-form select:focus,
.feedback-form textarea:focus {
    border-color: #39715c;
    outline: 3px solid rgba(57, 113, 92, 0.14);
}

.feedback-email-note {
    margin: 0;
    color: #718079;
    font-size: 0.84rem;
    line-height: 1.5;
}

.feedback-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.consent-banner {
    position: fixed;
    z-index: 1050;
    right: 18px;
    bottom: 18px;
    left: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: min(calc(100% - 36px), 900px);
    margin: 0 auto;
    padding: 18px 20px;
    border: 1px solid #cfdcd6;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 60px rgba(16, 35, 27, 0.2);
}

.consent-banner p {
    margin: 6px 0 0;
    color: #617069;
    font-size: 0.86rem;
    line-height: 1.5;
}

.consent-banner__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
}

@media (max-width: 650px) {
    .site-footer,
    .consent-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .site-footer > div,
    .consent-banner__actions {
        justify-content: space-between;
    }

    .consent-banner__actions > button {
        flex: 1;
        width: auto;
    }

    .feedback-dialog__actions {
        flex-direction: column-reverse;
    }

    .feedback-dialog__actions > button {
        width: 100%;
    }
}

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

.app-header h1 {
    margin: 4px 0 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 6px 14px 6px 7px;
    border: 1px solid #d6dfdb;
    border-radius: 14px;
    background: #ffffff;
    color: #18201d;
    font-weight: 700;
    cursor: pointer;
}

.account-button:hover:not(:disabled) {
    border-color: #80aa98;
    background: #edf3f0;
}

.account-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.account-button__avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #dfeee7;
    color: #276148;
    font-size: 0.95rem;
    font-weight: 800;
    overflow: hidden;
}

.account-button__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-button__avatar.profile-avatar-theme--mint,
.auth-profile__avatar.profile-avatar-theme--mint { background: linear-gradient(145deg, #d7f3e4, #9ed3b8); }
.account-button__avatar.profile-avatar-theme--blue,
.auth-profile__avatar.profile-avatar-theme--blue { background: linear-gradient(145deg, #d9effa, #9bc8e0); }
.account-button__avatar.profile-avatar-theme--rose,
.auth-profile__avatar.profile-avatar-theme--rose { background: linear-gradient(145deg, #ffe0e3, #efadb5); }
.account-button__avatar.profile-avatar-theme--violet,
.auth-profile__avatar.profile-avatar-theme--violet { background: linear-gradient(145deg, #eee2ff, #c4a6e8); }
.account-button__avatar.profile-avatar-theme--amber,
.auth-profile__avatar.profile-avatar-theme--amber { background: linear-gradient(145deg, #fff0c7, #ecc66a); }
.account-button__avatar.profile-avatar-theme--red,
.auth-profile__avatar.profile-avatar-theme--red { background: linear-gradient(145deg, #ffe1dc, #ee9d91); }
.account-button__avatar.profile-avatar-theme--navy,
.auth-profile__avatar.profile-avatar-theme--navy { background: linear-gradient(145deg, #dce8f2, #8dabc3); }
.account-button__avatar.profile-avatar-theme--space,
.auth-profile__avatar.profile-avatar-theme--space { background: linear-gradient(145deg, #30374e, #675189); }

.auth-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(16, 27, 23, 0.55);
    backdrop-filter: blur(4px);
}

.auth-dialog {
    width: min(100%, 460px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 26px;
    border: 1px solid #d7e0dc;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(15, 35, 27, 0.25);
}

.auth-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.auth-dialog__header h2 {
    margin: 5px 0 0;
    font-size: 1.65rem;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    color: #31443c;
    font-weight: 700;
}

.auth-form label small {
    color: #68766f;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cbd8d2;
    border-radius: 11px;
    background: #ffffff;
    color: #18201d;
}

.auth-form input:focus {
    border-color: #39715c;
    outline: 3px solid rgba(57, 113, 92, 0.14);
}

.auth-password-field {
    position: relative;
}

.auth-password-field input {
    padding-right: 48px;
    width: 100%;
}

.auth-password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #68766f;
    cursor: pointer;
    display: inline-flex;
    font-size: 1.05rem;
    height: 36px;
    justify-content: center;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    background: #edf5f1;
    color: #39715c;
    outline: none;
}

.auth-verification-note {
    background: #f4f8f6;
    border: 1px solid #dce7e2;
    border-radius: 12px;
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
}

.auth-verification-note p {
    color: #68766f;
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0;
}

.auth-full-button {
    width: 100%;
    justify-content: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #7a8781;
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e0e7e3;
}

.auth-dialog__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 18px;
    margin-top: 18px;
}

.auth-message {
    min-height: 1px;
    padding: 0;
    color: #9d2c2c;
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-message:not(:empty) {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff0f0;
}

.auth-message--success:not(:empty) {
    background: #eaf6ef;
    color: #276148;
}

.auth-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 16px;
    background: #f1f7f4;
}

.auth-profile__avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #39715c;
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 800;
    overflow: hidden;
}

.auth-profile__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-profile div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.auth-profile span,
.auth-profile small {
    overflow: hidden;
    color: #617069;
    text-overflow: ellipsis;
}

.auth-setup-note {
    padding: 18px;
    border: 1px solid #e5d59c;
    border-radius: 14px;
    background: #fff9e8;
    color: #574a25;
    line-height: 1.55;
}

.auth-setup-note p {
    margin: 8px 0;
}

.auth-setup-note code {
    display: block;
    overflow-x: auto;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
}

.auth-setup-note ol {
    margin: 14px 0 0;
    padding-left: 20px;
}

.eyebrow {
    margin: 0;
    color: #39715c;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.icon-button,
.back-button {
    border: 1px solid #d6dfdb;
    border-radius: 12px;
    background-color: #ffffff;
    color: #18201d;
    cursor: pointer;
}

.icon-button {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

.back-button {
    padding: 11px 16px;
    font-weight: 650;
}

.icon-button:hover,
.back-button:hover {
    background-color: #edf3f0;
}

.intro {
    margin-bottom: 28px;
}

.intro h1,
.intro h2 {
    margin: 6px 0 8px;
    font-size: clamp(1.7rem, 4vw, 2.3rem);
}

.intro p {
    margin: 0;
    color: #5d6a65;
    line-height: 1.6;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.topic-card {
    display: flex;
    gap: 18px;
    width: 100%;
    min-height: 180px;
    padding: 24px;
    border: 1px solid #d7e0dc;
    border-radius: 18px;
    background-color: #ffffff;
    color: #18201d;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(24, 32, 29, 0.05);
    transition:
        transform 150ms ease,
        box-shadow 150ms ease,
        border-color 150ms ease;
    text-decoration: none;
}

.topic-card:not(:disabled):hover {
    transform: translateY(-3px);
    border-color: #80aa98;
    box-shadow: 0 14px 32px rgba(24, 32, 29, 0.1);
}

.topic-icon {
    font-size: 2rem;
}

.topic-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.topic-title {
    margin-bottom: 8px;
    font-size: 1.2rem;
    font-weight: 750;
}

.topic-description {
    margin-bottom: 20px;
    color: #5d6a65;
    line-height: 1.5;
}

.open-label {
    margin-top: auto;
    color: #2d7358;
    font-weight: 750;
}

.status-label {
    margin-top: auto;
    padding: 5px 9px;
    border-radius: 999px;
    background-color: #edf1ef;
    color: #75817c;
    font-size: 0.8rem;
    font-weight: 700;
}

.topic-card--disabled {
    cursor: not-allowed;
    opacity: 0.62;
    box-shadow: none;
}

.topic-card--resource {
    border-color: #c8d9d1;
    background: linear-gradient(145deg, #ffffff, #f0f7f4);
}

.resource-site-label {
    margin: 0 0 12px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e0eee8;
    color: #316c55;
    font-size: 0.82rem;
    font-weight: 750;
}

.audience-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-width: 560px;
    margin-bottom: 28px;
    padding: 5px;
    border: 1px solid #d6dfdb;
    border-radius: 16px;
    background-color: #e9efec;
}

.audience-switch__button {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 18px;
    border: 0;
    border-radius: 11px;
    background-color: transparent;
    color: #53615b;
    cursor: pointer;
    font-weight: 800;
}

.audience-switch__button small {
    font-size: 0.74rem;
    font-weight: 600;
}

.audience-switch__button--active {
    background-color: #ffffff;
    color: #245f49;
    box-shadow: 0 2px 9px rgba(24, 32, 29, 0.1);
}

.audience-switch__button:focus-visible {
    outline: 3px solid rgba(57, 113, 92, 0.2);
    outline-offset: 2px;
}

.vital-audience-panel {
    padding-top: 2px;
}

.vital-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.vital-section-heading h2 {
    margin: 4px 0 0;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.audience-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background-color: #edf3f0;
    color: #39715c;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.audience-badge--adult {
    background-color: #e4efe9;
    color: #245f49;
}

.adult-vital-choice-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 16px;
}

.adult-vital-choice {
    display: flex;
    align-items: flex-start;
    gap: 17px;
    min-height: 220px;
    padding: 24px;
    border: 1px solid #d7e0dc;
    border-radius: 18px;
    background-color: #ffffff;
    color: #18201d;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(24, 32, 29, 0.05);
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.adult-vital-choice:hover {
    transform: translateY(-3px);
    border-color: #80aa98;
    box-shadow: 0 14px 32px rgba(24, 32, 29, 0.1);
}

.adult-vital-choice--primary {
    border-color: #9cbeae;
    background: linear-gradient(145deg, #ffffff, #eff7f3);
}

.adult-vital-choice__icon {
    font-size: 2rem;
}

.adult-vital-choice > span:last-child {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.adult-vital-choice strong {
    font-size: 1.15rem;
}

.adult-vital-choice small {
    display: block;
    margin-top: 8px;
    color: #5d6a65;
    font-size: 0.9rem;
    line-height: 1.5;
}

.adult-vital-choice .open-label {
    margin-top: auto;
    padding-top: 16px;
}

.adult-vital-tags {
    display: block;
    margin-top: 16px;
    font-size: 1.05rem;
}

@media (max-width: 650px) {
    #app {
        width: min(100% - 24px, 960px);
        padding-top: 20px;
    }

    .app-header {
        margin-bottom: 34px;
    }

    .topic-grid {
        grid-template-columns: 1fr;
    }

    .topic-card {
        min-height: 150px;
        padding: 20px;
    }

    .audience-switch {
        max-width: none;
    }

    .audience-switch__button {
        padding-inline: 10px;
    }

    .adult-vital-choice-grid {
        grid-template-columns: 1fr;
    }

    .adult-vital-choice {
        min-height: 190px;
        padding: 20px;
    }
}
.quiz-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.secondary-button,
.primary-button,
.mode-button,
.danger-button {
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
}

.primary-button {
    padding: 13px 22px;
    border: 1px solid #2d7358;
    background-color: #2d7358;
    color: #ffffff;
}

.primary-button:hover {
    background-color: #245f49;
}

.secondary-button {
    padding: 11px 16px;
    border: 1px solid #d6dfdb;
    background-color: #ffffff;
    color: #18201d;
}

.secondary-button:hover {
    background-color: #edf3f0;
}

.quiz-mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.mode-button {
    padding: 11px 16px;
    border: 1px solid #d6dfdb;
    background-color: #ffffff;
    color: #4d5b56;
}

.mode-button--active {
    border-color: #39715c;
    background-color: #e5f1ec;
    color: #245f49;
}

.quiz-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.quiz-stats div {
    padding: 15px;
    border: 1px solid #d7e0dc;
    border-radius: 14px;
    background-color: #ffffff;
}

.quiz-stats strong {
    display: block;
    margin-top: 4px;
    font-size: 1.15rem;
}

.stat-label {
    color: #68756f;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.quiz-card {
    padding: 30px;
    border: 1px solid #d7e0dc;
    border-radius: 20px;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(24, 32, 29, 0.06);
}

.adult-vital-note {
    margin-bottom: 22px;
}

.adult-vital-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 230px;
    margin-bottom: 20px;
    text-align: center;
}

.adult-vital-question__icon {
    margin-bottom: 9px;
    font-size: 2.7rem;
}

.adult-vital-question h2 {
    margin: 12px 0 5px;
    font-size: clamp(2rem, 6vw, 3.3rem);
}

.adult-vital-question p {
    margin: 0;
    color: #4f5d57;
    font-size: 1.05rem;
}

.adult-vital-question small {
    margin-top: 8px;
    color: #718078;
}

.adult-vital-quiz-card .answer-key td:last-child {
    min-width: 260px;
    white-space: normal;
}

.source-disclosure {
    margin: 18px 4px 0;
}

.source-disclosure__toggle {
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: #5f6d67;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.source-disclosure__content {
    margin-top: 8px;
    padding: 13px 15px;
    border: 1px solid #dce3e0;
    border-radius: 11px;
    background: #f8faf9;
    color: #69766f;
    font-size: 0.8rem;
    line-height: 1.55;
}

.source-disclosure__content[hidden] {
    display: none;
}

.source-disclosure__content a {
    color: #2d7358;
    font-weight: 700;
}

.quiz-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    margin-bottom: 20px;
    text-align: center;
}

.quiz-question span {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
}

.quiz-question--compact span {
    overflow-wrap: anywhere;
    font-size: clamp(1.55rem, 5vw, 2.7rem);
    line-height: 1.2;
}

.quiz-question small {
    margin-top: 8px;
    color: #69766f;
    font-size: 1rem;
}

.answer-form {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.answer-input {
    width: min(100%, 380px);
    padding: 13px 15px;
    border: 1px solid #aebbb5;
    border-radius: 12px;
    background-color: #ffffff;
    color: #18201d;
    font-size: 1.05rem;
}

.answer-input:focus {
    outline: 3px solid rgba(57, 113, 92, 0.18);
    border-color: #39715c;
}

.symbol-helper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    color: #68756f;
    font-size: 0.88rem;
    font-weight: 700;
}

.symbol-button {
    min-width: 42px;
    min-height: 38px;
    padding: 6px 12px;
    border: 1px solid #b9c8c1;
    border-radius: 10px;
    background-color: #f7faf8;
    color: #245f49;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 800;
}

.symbol-button:hover {
    border-color: #80aa98;
    background-color: #edf3f0;
}

.symbol-button:focus-visible {
    outline: 3px solid rgba(57, 113, 92, 0.18);
    outline-offset: 2px;
}

.quiz-feedback {
    min-height: 32px;
    margin-top: 18px;
    text-align: center;
    font-weight: 700;
}

.quiz-feedback--correct {
    color: #23714e;
}

.quiz-feedback--wrong {
    color: #ad2f2f;
}

.quiz-feedback--warning {
    color: #946500;
}

.quiz-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.answer-key {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e3e8e5;
}

.answer-key[hidden] {
    display: none;
}

.answer-key h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
}

.answer-key-table-wrapper {
    overflow-x: auto;
    border: 1px solid #d7e0dc;
    border-radius: 12px;
}

.answer-key table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    text-align: left;
}

.answer-key th,
.answer-key td {
    padding: 12px 14px;
    border-bottom: 1px solid #e3e8e5;
    white-space: nowrap;
}

.answer-key thead th {
    background-color: #edf3f0;
    color: #3f4d47;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.answer-key tbody th {
    color: #245f49;
}

.answer-key tbody tr:last-child th,
.answer-key tbody tr:last-child td {
    border-bottom: 0;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    background-color: rgba(17, 24, 21, 0.48);
}

.settings-overlay[hidden] {
    display: none;
}

.settings-panel {
    width: min(100%, 520px);
    padding: 24px;
    border-radius: 20px;
    background-color: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

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

.settings-header h2 {
    margin: 0;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 0;
    border-bottom: 1px solid #e3e8e5;
}

.setting-row span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-row small {
    color: #66736d;
    line-height: 1.4;
}

.setting-row input {
    width: 20px;
    height: 20px;
}

.settings-save-note {
    margin: 16px 0 0;
    color: #6b7872;
    font-size: 0.8rem;
}

.settings-danger-zone {
    display: grid;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e3e8e5;
}

.settings-danger-zone > div {
    display: grid;
    gap: 4px;
}

.settings-danger-zone small {
    color: #66736d;
    line-height: 1.45;
}

.settings-danger-zone .danger-button {
    margin-top: 4px;
}

.settings-reset-status {
    min-height: 1.2em;
    margin: 0;
    color: #276148;
    font-size: 0.85rem;
    font-weight: 700;
}

.confirmation-overlay {
    z-index: 30;
    background-color: rgba(17, 24, 21, 0.62);
}

.confirmation-panel {
    max-width: 440px;
    text-align: center;
}

.confirmation-panel h2 {
    margin: 10px 0 8px;
}

.confirmation-panel p {
    margin: 0;
    color: #66736d;
    line-height: 1.55;
}

.confirmation-icon {
    display: block;
    font-size: 2rem;
}

.confirmation-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
}

.confirmation-actions .danger-button {
    margin-top: 0;
}

.danger-button {
    width: 100%;
    margin-top: 22px;
    padding: 12px 16px;
    border: 1px solid #d8a4a4;
    background-color: #fff5f5;
    color: #9d2c2c;
}

.danger-button:hover {
    background-color: #ffeaea;
}

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

@media (max-width: 750px) {
    .quiz-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quiz-mode-selector {
        flex-direction: column;
    }

    .answer-form {
        flex-direction: column;
    }

    .answer-input,
    .primary-button {
        width: 100%;
    }

    .quiz-card {
        padding: 22px 18px;
    }
}

@media (max-width: 560px) {
    .app-header {
        align-items: flex-start;
    }

    .header-actions {
        align-items: flex-end;
        flex-direction: column-reverse;
    }

    .account-button {
        max-width: 150px;
    }

    .account-button > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .auth-dialog {
        padding: 20px;
        border-radius: 18px;
    }

    .auth-dialog__links {
        align-items: flex-start;
        flex-direction: column;
    }
}

.news2-header {
    margin-bottom: 34px;
}

.news2-progress {
    display: flex;
    gap: 8px;
}

.news2-progress span {
    padding: 9px 12px;
    border: 1px solid #d7e0dc;
    border-radius: 999px;
    background-color: #ffffff;
    color: #5d6a65;
    font-size: 0.85rem;
}

.news2-progress strong {
    color: #245f49;
}

.news2-intro {
    max-width: 720px;
}

.clinical-note {
    margin-bottom: 28px;
    padding: 16px 18px;
    border: 1px solid #d5e3dd;
    border-left: 5px solid #39715c;
    border-radius: 12px;
    background-color: #eef6f2;
    color: #40504a;
    line-height: 1.55;
}

.news2-mode-section {
    margin-bottom: 24px;
}

.news2-mode-section h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.news2-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.news2-mode-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 112px;
    padding: 17px;
    border: 1px solid #d7e0dc;
    border-radius: 14px;
    background-color: #ffffff;
    color: #18201d;
    text-align: left;
    cursor: pointer;
}

.news2-mode-card span {
    color: #65726c;
    font-size: 0.88rem;
    line-height: 1.4;
}

.news2-mode-card:hover {
    border-color: #80aa98;
}

.news2-mode-card--active {
    border-color: #39715c;
    background-color: #e8f3ee;
    box-shadow: inset 0 0 0 1px #39715c;
}

.news2-workspace {
    padding: 26px;
    border: 1px solid #d7e0dc;
    border-radius: 20px;
    background-color: #ffffff;
    box-shadow: 0 10px 30px rgba(24, 32, 29, 0.06);
}

.news2-task-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.news2-task-heading h2 {
    margin: 4px 0 0;
    font-size: clamp(1.25rem, 3vw, 1.65rem);
}

.news2-task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.news2-table-wrapper {
    overflow-x: auto;
    border: 1px solid #dce3e0;
    border-radius: 14px;
    background-color: #ffffff;
}

.news2-table-wrapper:focus-visible {
    outline: 3px solid rgba(57, 113, 92, 0.22);
    outline-offset: 3px;
}

.news2-scroll-hint {
    display: none;
    margin: 0 0 8px;
    color: #68756f;
    font-size: 0.78rem;
    font-weight: 700;
}

.news2-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.news2-table th,
.news2-table td {
    border-right: 3px solid #ffffff;
    border-bottom: 3px solid #ffffff;
}

.news2-table tr:last-child th,
.news2-table tr:last-child td {
    border-bottom: 0;
}

.news2-table th:last-child,
.news2-table td:last-child {
    border-right: 0;
}

.news2-parameter-heading,
.news2-row-heading {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 190px;
    background-color: #f8faf9;
    text-align: left;
}

.news2-parameter-heading {
    z-index: 3;
    padding: 14px 16px;
    color: #52605a;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.news2-score-heading {
    height: 66px;
    text-align: center;
}

.news2-score-heading span {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0.72;
    text-transform: uppercase;
}

.news2-score-heading strong {
    display: block;
    margin-top: 2px;
    font-size: 1.35rem;
}

.news2-row-heading {
    height: 94px;
    padding: 13px 16px;
    color: #18201d;
}

.news2-row-heading span,
.news2-row-heading small {
    display: block;
}

.news2-row-heading span {
    line-height: 1.25;
}

.news2-row-heading small {
    margin-top: 5px;
    color: #708078;
    font-weight: 600;
}

.news2-info {
    width: 22px;
    height: 22px;
    margin-top: 7px;
    padding: 0;
    border: 1px solid #8ba79a;
    border-radius: 50%;
    background-color: #ffffff;
    color: #39715c;
    cursor: help;
    font-size: 0.75rem;
    font-weight: 800;
}

.news2-cell {
    height: 94px;
    padding: 9px;
    text-align: center;
    vertical-align: middle;
}

.news2-cell > span {
    display: inline-block;
    max-width: 100%;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: normal;
}

.news2-tone--normal {
    background-color: #e8f2ed;
}

.news2-tone--medium {
    background-color: #fff2c9;
}

.news2-tone--high {
    background-color: #ffe1cc;
}

.news2-tone--critical {
    background-color: #f7cdcf;
}

.news2-cell--empty {
    background-image: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.18) 75%,
        transparent 75%
    );
    background-size: 12px 12px;
}

.news2-answer-input {
    width: 100%;
    min-width: 76px;
    padding: 10px 7px;
    border: 2px dashed #6f8078;
    border-radius: 9px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #18201d;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 750;
}

.news2-answer-input:focus {
    outline: 3px solid rgba(57, 113, 92, 0.2);
    border-color: #39715c;
}

.news2-cell--correct {
    box-shadow: inset 0 0 0 3px #2f8a63;
}

.news2-cell--wrong {
    box-shadow: inset 0 0 0 3px #bd4141;
}

.news2-correct-answer {
    display: block;
    margin-top: 5px;
    color: #922d2d;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
}

.news2-correct-answer[hidden] {
    display: none;
}

.news2-symbol-helper {
    margin-top: 16px;
}

.news2-check-button {
    display: block;
    min-width: 190px;
    margin: 4px auto 0;
}

.news2-answer-key .news2-table {
    min-width: 1180px;
    table-layout: fixed;
}

.news2-answer-key .news2-cell {
    height: 112px;
    padding: 12px 10px;
    overflow: hidden;
}

.news2-answer-key .news2-cell > span {
    font-size: 0.86rem;
    line-height: 1.45;
}

@media (max-width: 750px) {
    .news2-progress {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }

    .news2-progress span {
        padding: 6px 9px;
        font-size: 0.75rem;
    }

    .news2-mode-grid {
        grid-template-columns: 1fr;
    }

    .news2-mode-card {
        min-height: 0;
    }

    .news2-workspace {
        padding: 20px 12px;
    }

    .news2-scroll-hint {
        display: block;
    }

    .news2-task-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .news2-task-actions,
    .news2-task-actions .secondary-button {
        width: 100%;
    }

    .news2-parameter-heading,
    .news2-row-heading {
        width: 150px;
    }

    .news2-check-button {
        width: 100%;
    }
}
