@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
    color-scheme: light;
    --ink: #16201c;
    --muted: #5c6a62;
    --soft: #eef4f0;
    --line: #d8e4dd;
    --paper: #f6faf7;
    --panel: #ffffff;
    --green: #167a4b;
    --green-deep: #0f5b38;
    --saffron: #f09a2a;
    --blue: #2364aa;
    --red: #bf3131;
    --shadow: 0 18px 45px rgba(19, 43, 31, .11);
    --shadow-soft: 0 10px 24px rgba(26, 58, 42, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, #eaf4ee 0, rgba(246, 250, 247, 0) 380px),
        linear-gradient(90deg, rgba(240, 154, 42, .08), rgba(35, 100, 170, .07)),
        var(--paper);
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

h1, h2, h3, h4, h5, h6, .brand-text, .category-card-title, .question, .quiz-head h1, .score-line {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    letter-spacing: -0.02em;
}

button,
input {
    font: inherit;
}

select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 40px 10px 13px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
    cursor: pointer;
}

.archive-form {
    width: 100%;
    display: grid;
    gap: 8px;
}

.archive-form label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px);
}

.topbar-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
    color: var(--ink);
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: block;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 91, 56, .16);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.date-pill {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 13px;
    background: #fff;
    color: var(--green-deep);
    font-weight: 800;
}

.home-link {
    border: 1px solid rgba(22, 122, 75, .28);
    border-radius: 999px;
    padding: 9px 14px;
    background: #fff;
    color: var(--green-deep);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
}

.home-link:hover,
.home-link:focus-visible {
    border-color: var(--green);
    color: var(--green);
    outline: none;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 30px auto 56px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: stretch;
}

.quiz-shell,
.side-panel,
.result-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.quiz-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 10px;
    background:
        linear-gradient(120deg, rgba(22, 122, 75, .09), rgba(240, 154, 42, .07)),
        #fff;
}

.headline-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 22px;
}

.head-actions {
    width: min(320px, 100%);
    display: grid;
    gap: 10px;
}

.language-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px;
    background: rgba(255, 255, 255, .76);
}

.lang-btn {
    min-height: 36px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
}

.lang-btn.active {
    background: var(--green);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.kicker {
    width: fit-content;
    border: 1px solid rgba(22, 122, 75, .2);
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, .72);
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.quiz-head .kicker {
    text-transform: none;
    background: rgba(99, 102, 241, 0.07);
    border: 1px solid rgba(99, 102, 241, 0.18);
    color: #4f46e5;
    font-size: 12.5px;
    font-weight: 700;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.03);
    margin-top: 0;
    margin-bottom: 0;
}

h1 {
    margin: 0;
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.12;
    letter-spacing: 0;
    max-width: 620px;
}

.summary {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.quiz-notice {
    margin-top: 14px;
    border: 1px solid rgba(240, 154, 42, .34);
    border-radius: 8px;
    padding: 11px 13px;
    background: #fff8ec;
    color: #785018;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.access-panel {
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 252, 250, .98)),
        #fff;
}

.access-box {
    max-width: 620px;
    border: 1px solid rgba(22, 122, 75, .22);
    border-radius: 8px;
    padding: 18px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.access-box h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.access-box p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.access-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.mock-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.home-shell {
    overflow: hidden;
}

.home-shell .quiz-head {
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(22, 122, 75, .12), rgba(240, 154, 42, .1)),
        linear-gradient(180deg, #fff, #f8fcfa);
}

.home-shell .summary {
    max-width: 760px;
    font-size: 16px;
}

.language-note {
    width: fit-content;
    margin-inline: auto;
    border: 1px solid rgba(22, 122, 75, .28);
    border-radius: 999px;
    padding: 9px 14px;
    background: #fff;
    color: var(--green-deep);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.language-note p {
    margin: 0;
}

.language-note p:first-child {
    font-size: 18px;
    font-weight: 900;
    line-height: 1.12;
}

.language-note p:last-child {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.home-shell .question-area {
    padding: 20px;
    display: block;
}

.mock-card {
    min-height: 190px;
    border: 1px solid rgba(22, 122, 75, 0.16);
    border-radius: 16px;
    padding: 24px;
    display: grid;
    align-content: space-between;
    gap: 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(22, 122, 75, 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s ease, 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mock-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--green), var(--saffron));
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.mock-card::after {
    content: "→";
    position: absolute;
    right: 20px;
    bottom: 18px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(22, 122, 75, 0.08), rgba(22, 122, 75, 0.02));
    border: 1px solid rgba(22, 122, 75, 0.1);
    color: var(--green-deep);
    font-weight: 800;
    font-size: 16px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease;
}

.mock-card:hover {
    border-color: rgba(22, 122, 75, 0.35);
    box-shadow: 0 24px 50px rgba(22, 122, 75, 0.12), 0 0 0 1px rgba(22, 122, 75, 0.05);
    transform: translateY(-6px);
}

.mock-card:hover::after {
    transform: translateX(4px);
    background: linear-gradient(135deg, rgba(22, 122, 75, 0.18), rgba(22, 122, 75, 0.08));
}

.archive-card {
    grid-column: 2;
    border-color: rgba(240, 154, 42, .42);
    background:
        linear-gradient(180deg, rgba(255, 249, 237, .98), rgba(255, 255, 255, .98)),
        #fff;
}

.archive-card::before {
    background: linear-gradient(90deg, var(--saffron), var(--green));
}

.premium-pill {
    width: fit-content;
    border-radius: 999px;
    padding: 7px 10px;
    background: #fff3dc;
    color: #875410;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.archive-shell {
    overflow: hidden;
}

.archive-list {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.archive-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.archive-overview div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fcfa;
}

.archive-overview strong {
    display: block;
    color: var(--green-deep);
    font-size: 24px;
    line-height: 1;
}

.archive-overview span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.archive-empty {
    border: 1px dashed rgba(22, 122, 75, .35);
    border-radius: 8px;
    padding: 20px;
    background: #f8fcfa;
    color: var(--muted);
    text-align: center;
}

.archive-date-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.archive-month-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.archive-date-head,
.archive-month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fbfdfc, #f7fbf8);
}

.archive-date-head h2,
.archive-month-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.2;
}

.archive-date-head span,
.archive-month-head span {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 7px 10px;
    background: #fff3dc;
    color: #875410;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.archive-date-list {
    display: grid;
}

.archive-date-row {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.archive-date-row:last-child {
    border-bottom: 0;
}

.archive-date-label strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.1;
}

.archive-date-label span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.archive-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.archive-quiz-chip {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(22, 122, 75, .2);
    border-radius: 999px;
    padding: 8px 11px;
    background: #f6faf7;
    color: var(--green-deep);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.archive-quiz-chip:hover,
.archive-quiz-chip:focus-visible {
    border-color: rgba(22, 122, 75, .45);
    background: #e7f7ed;
    transform: translateY(-1px);
    outline: none;
}

.archive-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.archive-category-card {
    min-height: 92px;
    border: 1px solid rgba(22, 122, 75, .18);
    border-radius: 8px;
    padding: 13px;
    display: grid;
    align-content: space-between;
    gap: 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(248, 252, 250, .98)),
        #fff;
    color: var(--ink);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.archive-category-card:hover {
    border-color: rgba(22, 122, 75, .45);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.archive-category-card strong {
    font-size: 16px;
    line-height: 1.2;
}

.archive-category-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.archive-more {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.archive-more .btn {
    min-width: 190px;
}

.mock-card h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.16;
}

.mock-card p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.mock-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mock-time {
    width: fit-content;
    border-radius: 999px;
    padding: 7px 10px;
    background: #eef6f1;
    color: var(--green-deep);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.mock-number {
    color: rgba(22, 32, 28, .18);
    font-size: 26px;
    line-height: 1;
    font-weight: 900;
}

.mock-cta {
    align-self: end;
    color: var(--green-deep);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}


.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.stat {
    min-height: 62px;
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 9px 10px;
    background: linear-gradient(180deg, #ffffff, #f7faf8);
    box-shadow: var(--shadow-soft);
}

.stat strong {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.stat span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.countdown-card {
    border: 1px solid #d9e6df;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.page-countdown {
    width: min(420px, 100%);
    margin: 24px auto 0;
    text-align: center;
}

.countdown-card span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.countdown-card strong {
    display: block;
    margin-top: 3px;
    color: var(--green-deep);
    font-size: 20px;
    line-height: 1.1;
}

.countdown-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.progress-wrap {
    height: 12px;
    border-radius: 999px;
    background: #e8eee9;
    overflow: hidden;
    border: 1px solid #dbe6df;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--saffron));
    transition: width .25s ease;
}

.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.progress-head strong {
    color: var(--green-deep);
    font-size: 14px;
}

.question-area {
    padding: 18px 22px;
    background:
        linear-gradient(180deg, #fff, #fbfdfc);
    display: grid;
    grid-template-rows: auto auto auto minmax(68px, auto) auto auto auto;
    position: relative;
}

.info-btn {
    position: static;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--blue);
    font-weight: 900;
    font-style: italic;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.info-btn:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.info-btn.active {
    background: var(--blue);
    color: #fff;
}

.question-date {
    width: min(360px, 100%);
    margin-bottom: 10px;
}

.available-calendar {
    display: none;
    width: min(360px, 100%);
    margin: -2px 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.available-calendar.open {
    display: block;
}

.calendar-toggle {
    position: relative;
    width: min(360px, 100%);
    min-height: 56px;
    border: 1px solid rgba(22, 122, 75, .35);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(240, 249, 244, .98)),
        #fff;
    color: var(--green-deep);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    margin: -2px 0 10px;
    padding: 10px 42px 10px 46px;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.calendar-toggle::before {
    content: "\25A6";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: var(--green);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    transform: translateY(-50%);
}

.calendar-toggle::after {
    content: "\2304";
    position: absolute;
    right: 14px;
    top: 50%;
    color: var(--green-deep);
    font-size: 18px;
    transform: translateY(-50%);
}

.calendar-toggle:hover,
.calendar-toggle:focus-visible {
    border-color: var(--green);
    box-shadow: 0 16px 34px rgba(17, 86, 57, .14);
    transform: translateY(-1px);
    outline: none;
}

.calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.calendar-title {
    flex: 1;
    text-align: center;
}

.calendar-title span,
.calendar-title strong {
    display: block;
}

.calendar-title strong {
    margin-top: 2px;
    color: var(--text);
    font-size: 13px;
}

.calendar-nav {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(22, 122, 75, .22);
    border-radius: 7px;
    background: #f6faf7;
    color: var(--green-deep);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.calendar-nav:hover,
.calendar-nav:focus-visible {
    border-color: var(--green);
    background: #e7f7ed;
    outline: none;
}

.calendar-nav:disabled {
    cursor: not-allowed;
    opacity: .35;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day,
.calendar-weekday {
    min-height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
}

.calendar-weekday {
    color: var(--muted);
    min-height: 18px;
    font-size: 10px;
}

.calendar-day {
    border: 1px solid transparent;
    background: #f6faf7;
    color: #9aa59f;
}

.calendar-day.available {
    border-color: rgba(22, 122, 75, .35);
    background: #e7f7ed;
    color: var(--green-deep);
    cursor: pointer;
}

.calendar-day.selected {
    background: var(--green);
    color: #fff;
}

.question-language {
    width: min(280px, 100%);
    margin-bottom: 8px;
}

.question-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    overflow: hidden;
}

.question-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    background: rgba(22, 122, 75, 0.08);
    color: var(--green-deep);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid rgba(22, 122, 75, 0.12);
    flex-shrink: 0;
}

.tag-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    flex-shrink: 1;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    background: var(--soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

#timer-badge {
    background: rgba(99, 102, 241, 0.06);
    color: var(--indigo);
    border-color: rgba(99, 102, 241, 0.12);
    flex-shrink: 0;
}

#difficulty-tag {
    background: rgba(22, 122, 75, 0.06);
    color: var(--green-deep);
    border-color: rgba(22, 122, 75, 0.12);
    flex-shrink: 0;
}

.question {
    min-height: 68px;
    margin: 0 0 6px;
    font-size: clamp(20px, 2.4vw, 28px);
    line-height: 1.18;
    letter-spacing: 0;
    display: flex;
    align-items: flex-start;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.options {
    display: grid;
    gap: 7px;
    min-height: 270px;
    align-content: start;
}

.option {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-size: 17px;
    font-weight: 500;
    box-shadow: 0 8px 18px rgba(20, 41, 30, .05);
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.option span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.option:hover {
    border-color: var(--green);
    background: #f5fbf7;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(20, 41, 30, .08);
}

.option:disabled {
    cursor: default;
    opacity: .92;
    transform: none;
}

.option.selected {
    border-color: var(--blue);
    background: #eef5ff;
}

.option.correct {
    border-color: var(--green);
    background: #eaf7ef;
    color: #123d2a;
}

.option.wrong {
    border-color: var(--red);
    background: #fff0f0;
    color: #632121;
}

.option-key {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--ink);
    font-weight: 800;
    font-size: 14px;
}

.option.correct .option-key {
    background: var(--green);
}

.option.wrong .option-key {
    background: var(--red);
}

.explanation {
    min-height: 52px;
    margin-top: 8px;
    border: 1px solid #f2d39d;
    border-left: 5px solid var(--saffron);
    padding: 10px 12px;
    background: #fff8ed;
    color: #61420f;
    border-radius: 0 8px 8px 0;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.controls {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    min-width: 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.auto-next-toggle {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.auto-next-toggle .auto-icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--soft);
    color: var(--green-deep);
    font-size: 14px;
    line-height: 1;
}

.auto-next-toggle.active {
    border-color: rgba(22, 122, 75, .45);
    background: #effaf3;
    color: var(--green-deep);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 22px;
    background: #fff;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 480px) {
    .result-actions {
        flex-direction: column;
        gap: 8px;
    }
    .result-actions .btn {
        width: 100%;
    }
}

.btn.primary {
    border-color: var(--green);
    background: linear-gradient(135deg, var(--green), var(--green-deep));
    color: #fff;
}

.btn.secondary {
    color: var(--green-deep);
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.side-panel {
    position: sticky;
    top: 88px;
    height: calc(100vh - 108px);
    max-height: calc(100vh - 108px);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: start;
    min-height: 0;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(22, 122, 75, .06), rgba(35, 100, 170, .04)),
        #fff;
}

.sidebar-toggle {
    display: none;
}

.side-section {
    display: grid;
    gap: 10px;
}

.map-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.side-bottom {
    margin-top: auto;
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, .76), #fff);
}

.side-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.side-title {
    margin: 0;
    font-size: 20px;
}

.side-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.jump {
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.jump:hover {
    transform: translateY(-1px);
    border-color: var(--blue);
}

.jump.current {
    border-color: var(--blue);
    color: #fff;
    background: var(--blue);
}

.jump.done {
    border-color: var(--green);
    color: var(--green-deep);
    background: #eaf7ef;
}

.jump.correct {
    border-color: var(--green);
    color: #fff;
    background: var(--green);
}

.jump.wrong {
    border-color: var(--red);
    color: #fff;
    background: var(--red);
}

.pipeline {
    display: grid;
    gap: 10px;
}

.pipeline-row {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
    color: var(--muted);
    font-size: 14px;
}

.dot {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #eef6f1;
    color: var(--green);
    font-weight: 900;
}

.result-panel {
    display: none;
    margin-top: 24px;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(35, 100, 170, .08), rgba(240, 154, 42, .08)),
        #fff;
    overflow: visible;
}

.result-panel.show {
    display: block;
}

.score-line {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1;
}

.review-list {
    margin-top: 20px;
    display: grid;
    gap: 12px;
}

.review-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    min-width: 0;
    overflow-wrap: anywhere;
}

.review-item.correct {
    border-color: rgba(22, 122, 75, .35);
    background: #f2fbf5;
}

.review-item.wrong {
    border-color: rgba(191, 49, 49, .3);
    background: #fff6f6;
}

.review-item strong {
    display: block;
    margin-bottom: 6px;
    white-space: pre-line;
}

.muted {
    color: var(--muted);
}

.result-analytics {
    display: grid;
    gap: 16px;
    margin: 18px 0;
}

.result-card-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.result-card {
    min-height: 76px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    display: grid;
    align-content: center;
    gap: 4px;
    min-width: 0;
}

.result-card strong {
    margin: 0;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    overflow-wrap: anywhere;
}

.result-card span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.result-card.good {
    border-color: rgba(22, 122, 75, .32);
    background: #f2fbf5;
}

.result-card.warn {
    border-color: rgba(240, 154, 42, .38);
    background: #fff9ef;
}

.result-card.bad {
    border-color: rgba(191, 49, 49, .28);
    background: #fff6f6;
}

.result-breakdowns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.result-breakdown {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    min-width: 0;
}

.result-breakdown h3 {
    margin: 0 0 10px;
    font-size: 14px;
}

.breakdown-list {
    display: grid;
    gap: 8px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #edf3ef;
    padding-top: 8px;
    color: var(--muted);
    font-size: 13px;
    min-width: 0;
}

.breakdown-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.breakdown-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.breakdown-row strong {
    color: var(--green-deep);
    white-space: nowrap;
}

.review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
}

.review-meta span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px;
    background: #fff;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.review-item.correct .review-status {
    border-color: rgba(22, 122, 75, .35);
    background: #eaf7ef;
    color: var(--green-deep);
}

.review-item.wrong .review-status {
    border-color: rgba(191, 49, 49, .3);
    background: #fff0f0;
    color: var(--red);
}

.answer-review {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.answer-review div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, .72);
    min-width: 0;
}

.answer-review span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.answer-review strong {
    margin: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.explanation-toggle {
    border: 1px solid rgba(35, 100, 170, .28);
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: var(--blue);
    font-weight: 900;
    cursor: pointer;
}

.review-explanation {
    margin-top: 10px;
    border-left: 3px solid var(--blue);
    border-radius: 0 8px 8px 0;
    padding: 10px 12px;
    background: #f3f8ff;
    color: var(--ink);
    line-height: 1.55;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

footer {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 34px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

@media (max-width: 920px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .mock-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-card-grid,
    .result-breakdowns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .archive-card {
        grid-column: auto;
    }

    .headline-row {
        align-items: stretch;
        flex-direction: column;
    }

    .side-panel {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 40;
        width: min(80vw, 360px);
        height: 100vh;
        max-height: none;
        overflow: hidden;
        border-radius: 0;
        transform: translateX(105%);
        transition: transform .22s ease;
    }

    body.sidebar-open .side-panel {
        transform: translateX(0);
    }

    body.sidebar-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 35;
        background: rgba(10, 24, 18, .38);
    }

    .sidebar-toggle {
        position: fixed;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 46;
        width: 40px;
        height: 54px;
        display: grid;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--green);
        color: #fff;
        font-size: 22px;
        font-weight: 900;
        font-family: Arial, Helvetica, sans-serif;
        line-height: 1;
        box-shadow: var(--shadow);
        cursor: pointer;
        transition: right .22s ease;
    }

    body.sidebar-open .sidebar-toggle {
        right: min(80vw, 360px);
        border-radius: 8px 0 0 8px;
        border-right: 0;
    }

    .side-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .topbar-inner,
    main,
    footer {
        width: min(100% - 22px, 1180px);
    }

    .topbar-inner {
        min-height: 62px;
    }

    .nav-actions {
        font-size: 12px;
    }

    .brand-text {
        display: inline;
        font-size: 15px;
    }

    .question-area,
    .result-panel {
        padding: 14px;
    }

    .quiz-head {
        padding: 14px;
    }

    .question-area {
        grid-template-rows: auto auto auto minmax(84px, auto) auto auto auto;
    }

    .question {
        min-height: 84px;
        margin-bottom: 5px;
    }

    .options {
        min-height: 266px;
        gap: 7px;
    }

    .archive-form {
        max-width: none;
    }

    .controls {
        align-items: stretch;
    }

    .controls {
        flex-wrap: wrap;
    }

    .control-group {
        flex: 1 1 0;
        gap: 6px;
    }

    .control-group:first-child {
        min-width: 152px;
    }

    .control-group:last-child {
        min-width: 132px;
        justify-content: flex-end;
    }

    .controls .btn {
        min-width: 0;
        padding-left: 12px;
        padding-right: 12px;
        white-space: nowrap;
    }

    #prev-btn {
        width: 46px;
        flex: 0 0 46px;
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
        color: transparent;
        position: relative;
    }

    #prev-btn::before {
        content: "<";
        position: absolute;
        inset: 0;
        display: grid;
        place-items: center;
        color: var(--green-deep);
        font-size: 22px;
        font-weight: 900;
    }

    .auto-next-toggle {
        padding-left: 8px;
        padding-right: 8px;
        white-space: nowrap;
    }

    .option {
        grid-template-columns: 30px 1fr;
        padding: 11px;
        font-size: 15px;
    }

    .option-key {
        width: 30px;
        height: 30px;
    }

    .mock-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .mock-card {
        padding: 18px;
        min-height: auto;
        gap: 12px;
    }

    .mock-card h2 {
        font-size: 18px;
    }

    .mock-card p {
        margin-top: 6px;
        font-size: 13px;
        line-height: 1.45;
    }

    .result-card-grid,
    .result-breakdowns,
    .answer-review {
        grid-template-columns: 1fr;
    }

    .archive-category-grid {
        grid-template-columns: 1fr;
    }

    .archive-overview {
        grid-template-columns: 1fr;
    }

    .archive-date-row {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .archive-date-head,
    .archive-month-head {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Homepage Category Grid & Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.category-card {
    border: 1px solid rgba(99, 102, 241, 0.16);
    border-radius: 16px;
    padding: 26px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.04);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s ease, 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--green), var(--saffron));
    opacity: 0.35;
    transition: opacity 0.3s ease;
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 24px 50px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.05);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card-number {
    position: absolute;
    top: 22px;
    right: 22px;
    color: rgba(99, 102, 241, 0.14);
    font-size: 24px;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.category-card:hover .category-card-number {
    color: rgba(99, 102, 241, 0.28);
    transform: scale(1.05);
}

.category-card-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12));
    color: var(--green-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover .category-card-icon {
    transform: scale(1.1) rotate(6deg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(168, 85, 247, 0.22));
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.14);
}

.category-card-title {
    font-size: 21px;
    font-weight: 800;
    margin: 0;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.category-card-desc {
    font-size: 13.5px;
    color: var(--muted);
    margin: 14px 0 20px;
    line-height: 1.55;
    flex-grow: 1;
}

.category-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.category-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 12px;
}

.category-card-footer .btn {
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    height: 36px;
}

.category-card:hover .btn.primary {
    background: var(--green-deep);
}

.category-card:hover .btn-arrow {
    transform: translateX(4px);
}

.category-card-badge {
    font-size: 11px;
    font-weight: 800;
    color: #5551ff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.02));
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

/* Category Page Mixed Quiz Block */
.full-syllabus-block {
    background: linear-gradient(135deg, rgba(22, 122, 75, 0.03) 0%, rgba(240, 154, 42, 0.02) 100%), #fff;
    border: 1px solid rgba(22, 122, 75, 0.16);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(22, 122, 75, 0.03);
    transition: all 0.3s ease;
}

.full-syllabus-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 35px rgba(22, 122, 75, 0.06);
    border-color: rgba(22, 122, 75, 0.25);
}

.full-syllabus-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.full-syllabus-block label {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.full-syllabus-block select {
    background-color: #fafafa;
    border: 1px solid var(--line);
    color: var(--ink);
    font-weight: 600;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.full-syllabus-block select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(22, 122, 75, 0.12);
    outline: none;
}

@media (max-width: 768px) {
    .full-syllabus-block {
        padding: 16px 14px !important;
        border-radius: 12px !important;
        gap: 14px !important;
    }
    
    .full-syllabus-block form {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }
    
    .full-syllabus-block form div {
        width: 100% !important;
    }
    
    .full-syllabus-block form select {
        width: 100% !important;
    }
    
    .full-syllabus-block form button {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Quiz List Items (Replaced Inline-styled blocks) */
.quiz-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.16);
    background: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.02);
    gap: 20px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    margin-bottom: 16px;
}

.quiz-list-item:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.08);
}

.quiz-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quiz-metadata-row {
    font-size: 11px;
    font-weight: 700;
    color: var(--green-deep);
    margin: 4px 0 0 0;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.quiz-metadata-row .pipe {
    color: rgba(99, 102, 241, 0.2);
}

.quiz-list-action {
    display: flex;
    align-items: center;
}

.quiz-list-action .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.quiz-list-action .btn:active {
    transform: scale(0.98);
}

/* Category Grid & Cards Responsiveness */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .category-card {
        padding: 16px !important;
        border-radius: 12px !important;
    }
    
    .category-card-header {
        gap: 8px !important;
        margin-bottom: 8px !important;
    }
    
    .category-card-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }
    
    .category-card-title {
        font-size: 17px !important;
    }
    
    .category-card-desc {
        font-size: 12.5px !important;
        margin: 8px 0 12px !important;
        line-height: 1.45 !important;
    }
    
    .category-card-footer {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
    }
    
    .category-card-badge {
        padding: 4px 10px !important;
        font-size: 9.5px !important;
        text-align: left !important;
        white-space: nowrap !important;
    }
    
    .category-card-footer .btn {
        width: auto !important;
        height: 30px !important;
        font-size: 11px !important;
        padding: 0 10px !important;
        white-space: nowrap !important;
    }
    
    .category-card-number {
        top: 16px !important;
        right: 16px !important;
        font-size: 18px !important;
    }
    
    .quiz-list-item {
        flex-direction: row;
        align-items: center;
        padding: 6px 8px;
        gap: 8px;
        margin-bottom: 6px;
        border-radius: 8px;
    }
    
    .quiz-list-info {
        flex: 1;
        min-width: 0;
        gap: 2px;
    }
    
    .quiz-list-info p {
        display: none; /* Hide repetitive description on mobile */
    }
    
    .quiz-metadata-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        font-size: 8.5px !important;
        gap: 3px !important;
        margin-top: 2px !important;
    }
    
    .quiz-list-info div {
        margin-bottom: 2px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
    
    .quiz-list-info div span,
    .quiz-list-info div .premium-pill {
        font-size: 8px !important;
        padding: 2px 5px !important;
        border-radius: 3px !important;
    }
    
    .quiz-list-info h5,
    .quiz-list-info h2 {
        font-size: 12.5px !important;
        margin: 0 !important;
        line-height: 1.3 !important;
    }
    
    .quiz-list-action {
        width: auto;
        flex-shrink: 0;
    }
    
    .quiz-list-action .btn {
        width: 95px !important;
        min-width: 95px !important;
        height: 28px !important;
        padding: 0 4px !important;
        font-size: 9px !important;
        border-radius: 6px !important;
        justify-content: center !important;
        align-items: center !important;
        display: inline-flex !important;
        white-space: nowrap !important;
    }
    
    /* Layout structural padding reductions on mobile */
    main {
        margin: 12px auto 24px !important;
    }
    
    .question-area {
        padding: 10px 8px !important;
    }
    
    .syllabus-unit-section {
        padding: 10px 8px !important;
        border-radius: 8px !important;
        margin-bottom: 12px !important;
    }
    
    .quiz-head {
        padding: 12px 14px !important;
    }
    

    
    .chapter-card-chip {
        padding: 12px !important;
        border-radius: 10px !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
    }
    
    .chapter-card-main {
        gap: 10px !important;
    }
    
    .chapter-icon-wrapper {
        width: 34px !important;
        height: 34px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }
    
    .chapter-card-info strong {
        font-size: 13.5px !important;
    }
    
    .custom-test-icon-wrapper {
        display: none !important;
    }
    
    /* Toggle desktop/mobile text */
    .mobile-text {
        display: inline !important;
    }
    .desktop-text {
        display: none !important;
    }
    

}

/* Premium Unlock Modal Styles */
.premium-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 24, 18, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.premium-modal-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 50px rgba(10, 24, 18, 0.2);
    border: 1px solid rgba(22, 122, 75, 0.15);
    overflow: hidden;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.premium-modal-header {
    padding: 24px 24px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.premium-modal-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(240, 154, 42, 0.1);
    color: #e67e22;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(240, 154, 42, 0.05);
}

.premium-modal-header h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: var(--ink);
}

.premium-modal-body {
    padding: 0 24px 20px;
    text-align: center;
}

.premium-modal-body p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

.premium-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-btn.login-btn {
    background: var(--soft);
    color: var(--green-deep);
    border: 1px solid rgba(22, 122, 75, 0.15);
}

.modal-btn.login-btn:hover {
    background: rgba(22, 122, 75, 0.08);
}

.modal-btn.subscribe-btn {
    background: linear-gradient(135deg, var(--green), var(--green-deep));
    color: #fff;
    box-shadow: 0 4px 12px rgba(22, 122, 75, 0.15);
}

.modal-btn.subscribe-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(22, 122, 75, 0.25);
}

.modal-btn.cancel-btn {
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}

.modal-btn.cancel-btn:hover {
    color: var(--ink);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Premium Select Dropdown & Button Styles */
.custom-select-box {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    height: 42px;
    min-height: 42px;
    padding: 8px 36px 8px 14px !important;
    font-size: 13.5px;
    border-radius: 8px;
    border: 1px solid var(--line) !important;
    background-color: #fafafa;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%232c3e50%22%20d%3D%22M10.293%203.293L6%207.586%201.707%203.293A1%201%200%2000.293%204.707l5%205a1%201%200%20001.414%200l5-5a1%201%200%2010-1.414-1.414z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-select-box:focus {
    border-color: var(--green) !important;
    box-shadow: 0 0 0 3px rgba(22, 122, 75, 0.12) !important;
    outline: none;
}

.custom-start-btn {
    border: none !important;
    background: linear-gradient(135deg, var(--green), var(--green-deep)) !important;
    box-shadow: 0 4px 15px rgba(22, 122, 75, 0.18) !important;
    transition: all 0.25s ease !important;
}

.custom-start-btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(22, 122, 75, 0.3) !important;
}

.custom-start-btn:active {
    transform: scale(0.98);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Chapter Grid & Chapter Card Chip Desktop Rules */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.chapter-card-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--soft);
    text-decoration: none;
    color: var(--ink);
    border: 1px solid var(--line);
    transition: all 0.2s ease;
}

.chapter-card-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.25);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.chapter-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.chapter-card-info strong {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
}

.chapter-card-info span {
    font-size: 11px;
    color: var(--muted);
    font-weight: 700;
}
/* Home shell question area desktop */
.home-shell .question-area {
    background: #fff;
    padding: 24px;
    display: grid;
    grid-template-rows: none;
    gap: 28px;
}
/* Extra-small screen optimizations (<=360px) */
@media (max-width: 360px) {
    .brand-text {
        font-size: 13.5px !important;
    }
    .brand-mark {
        width: 36px !important;
        height: 36px !important;
    }
    .topbar-inner {
        min-height: 56px !important;
        gap: 8px !important;
    }
    .control-group {
        gap: 4px !important;
    }
    .controls {
        gap: 8px !important;
    }
}

/* Custom test icon wrapper & count badge styles */
.custom-test-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(22, 122, 75, 0.08);
    color: var(--green-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: inset 0 2px 6px rgba(22, 122, 75, 0.1);
}

.custom-test-count-badge {
    font-size: 10px;
    font-weight: 700;
    background: rgba(22, 122, 75, 0.08);
    color: var(--green-deep);
    padding: 3px 7px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(22, 122, 75, 0.15);
}

/* Uniform size and design for start/unlock buttons in row lists */
.start-btn {
    background: linear-gradient(135deg, var(--green), var(--green-deep)) !important;
    color: #fff !important;
    border: none !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 13.5px;
    height: 38px;
    padding: 0 16px;
    white-space: nowrap;
}

.unlock-btn {
    background: #e67e22 !important;
    color: #fff !important;
    border: none !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 13.5px;
    height: 38px;
    padding: 0 16px;
    white-space: nowrap;
}

.start-btn:hover,
.unlock-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quiz-list-action .btn {
    width: 145px;
    min-width: 145px;
    justify-content: center;
    align-items: center;
    display: inline-flex;
    box-sizing: border-box;
}

/* Desktop and base styles for the modern Chapter Card Chip */
.chapter-card-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px;
    padding: 16px;
    background: #fff;
    text-decoration: none;
    color: var(--ink);
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.02);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-card-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(22, 122, 75, 0.25);
    box-shadow: 0 10px 25px rgba(22, 122, 75, 0.08);
}

.chapter-card-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.chapter-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(22, 122, 75, 0.06);
    color: var(--green-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.chapter-card-chip:hover .chapter-icon-wrapper {
    background: var(--green);
    color: #fff;
    transform: scale(1.05);
}

.chapter-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.chapter-card-info strong {
    font-weight: 800;
    font-size: 14.5px;
    line-height: 1.35;
    color: var(--ink);
}

.chapter-card-info span {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 700;
}

.chapter-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--soft);
    color: var(--muted);
    font-size: 11px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-card-chip:hover .chapter-arrow {
    background: var(--green-deep);
    color: #fff;
}

.chapter-card-chip:hover .chapter-arrow i {
    transform: translateX(2px);
}

/* Button text toggles */
.mobile-text {
    display: none;
}
.desktop-text {
    display: inline;
}

/* Dynamic Stats Bar Dashboard */
.stats-title {
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--green-deep);
    margin: 18px 0 10px 0;
    padding-top: 16px;
    border-top: 1px dashed rgba(22, 122, 75, 0.15);
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stats-title i {
    font-size: 10px;
    color: var(--green);
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid rgba(22, 122, 75, 0.12);
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.stats-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(22, 122, 75, 0.08);
    color: var(--green-deep);
    font-size: 16px;
    flex-shrink: 0;
}

.stats-data {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.stats-value {
    font-size: 17px;
    font-weight: 900;
    color: var(--ink);
}

.stats-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 1px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .stats-title {
        font-size: 9px;
        margin: 14px 0 8px 0;
        padding-top: 12px;
        gap: 5px;
    }
    
    .stats-title i {
        font-size: 8.5px;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stats-item {
        padding: 8px 12px;
        gap: 10px;
        border-radius: 10px;
    }
    
    .stats-icon-wrapper {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        font-size: 14px;
    }
    
    .stats-value {
        font-size: 14px;
    }
    
    .stats-label {
        font-size: 8px;
        letter-spacing: 0.01em;
    }
}

/* Interlinking Portals Header & Footer */
.portal-nav-bar {
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    width: 100%;
    overflow: hidden;
}

.portal-nav-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.portal-nav-inner::-webkit-scrollbar {
    display: none;
}

.portal-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
    background: var(--soft);
    border: 1px solid rgba(22, 122, 75, 0.05);
    transition: all 0.2s ease;
}

.portal-nav-item i {
    font-size: 13px;
    color: var(--muted);
    transition: color 0.2s ease;
}

.portal-nav-item:hover:not(.active) {
    background: rgba(22, 122, 75, 0.06);
    color: var(--green-deep);
    border-color: rgba(22, 122, 75, 0.12);
}

.portal-nav-item:hover:not(.active) i {
    color: var(--green-deep);
}

.portal-nav-item.active {
    background: var(--green-deep);
    color: #ffffff;
    border-color: var(--green-deep);
    box-shadow: 0 3px 8px rgba(22, 122, 75, 0.15);
}

.portal-nav-item.active i {
    color: #ffffff;
}

/* Footer links styles */
.footer-sitemap {
    width: min(1180px, calc(100% - 32px));
    margin: 40px auto 24px;
    padding: 24px 30px;
    background: linear-gradient(135deg, rgba(22, 122, 75, 0.02), rgba(99, 102, 241, 0.02));
    border: 1px solid rgba(22, 122, 75, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

.footer-links-col h4 {
    font-size: 11.5px;
    font-weight: 900;
    color: var(--green-deep);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links-col ul li a {
    font-size: 13.5px;
    color: var(--muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 5px 10px;
    border-radius: 8px;
    margin-left: -10px;
}

.footer-links-col ul li a i {
    font-size: 13px;
    color: var(--green);
    width: 18px;
    text-align: center;
    transition: transform 0.25s ease;
}

.footer-links-col ul li a:hover {
    color: var(--green-deep);
    background: rgba(22, 122, 75, 0.05);
}

.footer-links-col ul li a:hover i {
    transform: scale(1.15) translateX(1px);
}

@media (max-width: 768px) {
    .portal-nav-inner {
        padding: 8px 12px;
        gap: 6px;
    }
    
    .portal-nav-item {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .portal-nav-item i {
        font-size: 11.5px;
    }
    
    .footer-sitemap {
        margin: 24px auto 18px;
        padding: 18px 20px;
        border-radius: 12px;
    }
    
    .footer-links-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .footer-links-col h4 {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .footer-links-col ul {
        gap: 6px;
    }
    
    .footer-links-col ul li a {
        font-size: 12.5px;
        padding: 6px 10px;
    }
}

/* Header User identity styles */
.user-greeting {
    display: inline-flex;
    align-items: center;
    font-size: 13.5px;
    color: var(--muted);
    font-weight: 600;
}

.logout-btn-header:hover,
.logout-btn-header:focus-visible {
    border-color: var(--red) !important;
    color: var(--red) !important;
    background: rgba(191, 49, 49, 0.04) !important;
}

.login-btn-header:hover,
.login-btn-header:focus-visible {
    border-color: var(--green) !important;
    color: var(--green) !important;
    background: rgba(22, 122, 75, 0.04) !important;
}

@media (max-width: 768px) {
    .user-greeting {
        display: none !important;
    }
    .topbar-inner .home-link {
        padding: 6px 10px !important;
        font-size: 11.5px !important;
    }
}
