
:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface2: #f0f0f0;
    --border: #cccccc;
    --green: #0E4E2B;
    --green-light: #176B3C;
    --green-pale: #e0f5e9;
    --green-mid: #a8d9bc;
    --purple: #6B4089;
    --purple-pale: #ece4f4;
    --purple-200: #4a3f5c;
    --purple-100: #8a7a9e;
    --yellow: #EBF03B;
    --ink: #1a1a1a;
    --ink-soft: #2d2d2d;
    --ink-muted: #555555;
    --red: #b83228;
    --red-pale: #fdf0ee;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 16px rgba(14, 78, 43, 0.08);
    --shadow-lg: 0 8px 40px rgba(14, 78, 43, 0.14);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #ffffff !important;
    color: #1a1a1a !important;
    min-height: 100vh;
    line-height: 1.6;
    color-scheme: light only;
}

html {
    background: #ffffff !important;
    color-scheme: light only;
}

/* HEADER */
.site-header {
    background: var(--green);
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 8px;
}

.logo {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 0.95rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo span {
    color: var(--yellow);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    overflow: hidden;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.header-user .hdr-name {
    display: none; /* hidden on mobile, shown on wider screens */
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.btn-hdr {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-hdr:hover {
    background: rgba(255, 255, 255, 0.28);
}

@media (min-width: 480px) {
    .site-header {
        padding: 0 28px;
    }

    .logo {
        font-size: 1.05rem;
    }

    .header-user .hdr-name {
        display: inline;
    }

    .btn-hdr {
        font-size: 0.8rem;
        padding: 6px 14px;
    }
}

/* SCREENS */
.screen {
    display: none;
    background: #ffffff;
}

.screen.active {
    display: block;
    animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 52px 24px 96px;
    background: #ffffff;
}

.container-wide {
    max-width: 1000px;
    margin: 0 auto;
    padding: 48px 24px 96px;
    background: #ffffff;
}

/* AUTH */
.auth-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #ffffff;
}

.auth-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 44px 40px;
    width: 100%;
    max-width: 430px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.auth-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    color: var(--green);
    margin-bottom: 4px;
}

.auth-logo span {
    color: var(--purple);
}

.auth-sub {
    font-size: 0.86rem;
    color: #555555;
    margin-bottom: 30px;
    line-height: 1.6;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 26px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #555555;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: 'DM Sans', sans-serif;
}

.auth-tab.active {
    color: var(--green);
    border-bottom-color: var(--green);
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d2d2d;
    margin-bottom: 5px;
    letter-spacing: 0.03em;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.93rem;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--green);
}

.form-error {
    font-size: 0.79rem;
    color: var(--red);
    margin-top: 8px;
    text-align: center;
    min-height: 18px;
}

.role-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.role-opt {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s;
}

.role-opt:hover {
    border-color: var(--green-mid);
    background: var(--green-pale);
}

.role-opt.selected {
    border-color: var(--green);
    background: var(--green-pale);
}

.role-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.role-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink);
}

.role-desc {
    font-size: 0.72rem;
    color: #555555;
}

.auth-guest {
    text-align: center;
    margin-top: 18px;
    font-size: 0.84rem;
    color: #555555;
}

.auth-guest button {
    background: none;
    border: none;
    color: var(--green);
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
}

.hidden {
    display: none !important;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--green);
    color: #fff;
    font-size: 0.95rem;
    padding: 13px 26px;
    width: 100%;
}

.btn-primary:hover {
    background: var(--green-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-sm {
    width: auto;
    padding: 11px 22px;
    font-size: 0.88rem;
}

.btn-outline {
    background: #fff;
    color: var(--ink);
    border: 1.5px solid var(--border);
    font-size: 0.88rem;
    padding: 11px 20px;
}

.btn-outline:hover {
    background: var(--green-pale);
    border-color: var(--green-mid);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--green);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.btn-ghost:hover {
    opacity: 0.7;
}

.btn-danger {
    background: var(--red-pale);
    color: var(--red);
    border: 1px solid #f5c0bb;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-danger:hover {
    background: #fce8e6;
}

/* INTRO */
.intro-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--green-pale);
    color: var(--green);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 22px;
    border: 1px solid var(--green-mid);
}

.intro-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    line-height: 1.15;
    margin-bottom: 16px;
    color: #1a1a1a !important;
}

.intro-title em {
    color: #0E4E2B !important;
    font-style: normal;
}

.intro-desc {
    font-size: 1.05rem;
    color: #1a1a1a !important;
    max-width: 560px;
    margin-bottom: 34px;
    line-height: 1.8;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 9px;
    margin-bottom: 36px;
}

.cat-pill {
    background: #ffffff;
    border: 1.5px solid #cccccc;
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.intro-meta {
    font-size: 0.79rem;
    color: #555555;
    margin-top: 16px;
}

/* QUIZ */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 10px;
}

.cat-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green);
    background: var(--green-pale);
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid var(--green-mid);
}

.prog-info {
    font-size: 0.9rem;
    color: #2d2d2d;
    font-weight: 600;
}

.prog-wrap {
    background: var(--surface2);
    border-radius: 100px;
    height: 5px;
    margin-bottom: 34px;
    overflow: hidden;
}

.prog-fill {
    height: 100%;
    background: var(--green);
    border-radius: 100px;
    transition: width 0.4s ease;
}

.q-num {
    font-size: 0.82rem;
    color: #0E4E2B;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
}

.q-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #1a1a1a;
    font-weight: 600;
}

.q-note {
    font-size: 0.9rem;
    color: #1a1a1a;
    margin-bottom: 22px;
    line-height: 1.7;
    background: #e0f5e9;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid #0E4E2B;
}

.opts {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 30px;
}

.opt-btn {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 18px 17px;
    background: #ffffff;
    border: 2px solid #bbbbbb;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: all 0.18s;
    font-family: 'DM Sans', sans-serif;
    width: 100%;
}

.opt-btn:hover {
    border-color: var(--green-mid);
    background: var(--green-pale);
}

.opt-btn.selected {
    border-color: var(--green);
    background: var(--green-pale);
}

.opt-letter {
    min-width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: #1a1a1a;
    flex-shrink: 0;
    transition: all 0.18s;
}

.opt-btn.selected .opt-letter {
    background: var(--green);
    color: #fff;
}

.opt-text {
    font-size: 1rem;
    color: #1a1a1a;
    line-height: 1.5;
    padding-top: 2px;
    font-weight: 500;
}

.quiz-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* RESULTS */
.results-hero {
    background: var(--green);
    color: #fff;
    border-radius: var(--radius);
    padding: 38px 34px;
    margin-bottom: 26px;
    position: relative;
    overflow: hidden;
}

.results-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(235, 240, 59, 0.15);
}

.r-name {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 5px;
}

.r-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.score-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.score-big {
    font-family: 'Playfair Display', serif;
    font-size: 3.8rem;
    font-weight: 700;
    line-height: 1;
}

.score-denom {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.4);
}

.s-band {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.band-strong {
    background: var(--yellow);
    color: #1a3a00;
}

.band-good {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.band-fair {
    background: var(--purple-100);
    color: #fff;
}

.band-attention {
    background: var(--red);
    color: #fff;
}

.score-desc {
    font-size: 0.91rem;
    color: rgba(255, 255, 255, 0.72);
    max-width: 500px;
    line-height: 1.7;
    position: relative;
    z-index: 1;
    margin-top: 10px;
}

.sec-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.18rem;
    margin-bottom: 13px;
}

.cat-rows {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 30px;
}

.cat-row {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 13px 17px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
}

.cat-row-name {
    font-size: 0.87rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.cat-bar-bg {
    background: #ddd;
    border-radius: 100px;
    height: 6px;
}

.cat-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s ease;
}

.cat-pct {
    font-size: 0.81rem;
    font-weight: 600;
    color: #2d2d2d;
    white-space: nowrap;
}

.r-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 38px;
}

.ans-group {
    margin-bottom: 10px;
}

.ans-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 17px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: background 0.2s;
}

.ans-header:hover {
    background: var(--green-pale);
}

.ans-header h4 {
    font-size: 0.87rem;
    font-weight: 600;
}

.chevron {
    font-size: 0.73rem;
    color: #555555;
    transition: transform 0.2s;
}

.ans-header.open .chevron {
    transform: rotate(180deg);
}

.ans-body {
    display: none;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.ans-body.open {
    display: block;
}

.ans-row {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 10px 17px;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

.ans-row:last-child {
    border-bottom: none;
}

.ans-qn {
    color: #555555;
    font-weight: 600;
}

.ans-qt {
    color: #2d2d2d;
    line-height: 1.5;
}

.ans-dot {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.67rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.dot-a {
    background: var(--red);
}

.dot-b {
    background: var(--purple-200);
}

.dot-c {
    background: var(--green);
}

/* DASHBOARD */
.dash-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 30px;
    overflow-x: auto;
}

.dash-tab {
    padding: 10px 18px;
    font-size: 0.87rem;
    font-weight: 600;
    color: #555555;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: 'DM Sans', sans-serif;
}

.dash-tab.active {
    color: var(--green);
    border-bottom-color: var(--green);
}

.dash-panel {
    display: none;
}

.dash-panel.active {
    display: block;
    animation: fadeUp 0.3s ease;
}

/* HISTORY */
.history-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-card:hover {
    border-color: var(--green-mid);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.hc-date {
    font-size: 0.77rem;
    color: #555555;
    margin-bottom: 3px;
}

.hc-score {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    color: var(--green);
}

.hc-score span {
    font-size: 0.82rem;
    color: #555555;
    font-family: 'DM Sans', sans-serif;
}

.mini-band {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 4px;
}

.mb-strong {
    background: var(--green-pale);
    color: var(--green);
    border: 1px solid var(--green-mid);
}

.mb-good {
    background: var(--purple-pale);
    color: var(--purple);
    border: 1px solid #d8c8ec;
}

.mb-fair {
    background: #f0edf5;
    color: var(--purple-200);
    border: 1px solid #ccc6d8;
}

.mb-attention {
    background: var(--red-pale);
    color: var(--red);
    border: 1px solid #f5c0bb;
}

.h-empty {
    text-align: center;
    padding: 56px 24px;
    color: #555555;
}

.h-empty .ei {
    font-size: 2.4rem;
    margin-bottom: 14px;
}

.h-empty h3 {
    font-size: 1rem;
    color: #2d2d2d;
    margin-bottom: 6px;
}

/* ADMIN */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 18px 16px;
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #555555;
    margin-bottom: 7px;
}

.stat-val {
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    color: var(--green);
    line-height: 1;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
}

.admin-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    outline: none;
}

.admin-search:focus {
    border-color: var(--green);
}

.tbl-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.sub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.sub-table th {
    background: var(--green);
    color: #fff;
    padding: 11px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.76rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sub-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    color: #2d2d2d;
    vertical-align: middle;
}

.sub-table tr:last-child td {
    border-bottom: none;
}

.sub-table tr:hover td {
    background: var(--green-pale);
}

.band-chip {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

/* NAME SCREEN */
.name-center {
    max-width: 460px;
    margin: 0 auto;
    padding: 80px 24px;
    text-align: center;
}

.name-center h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    margin-bottom: 26px;
}

/* MODAL */
.modal-ov {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0
    }
    to {
        opacity: 1
    }
}

.modal-ov.hidden {
    display: none;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 34px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.2s ease;
}

.modal-box.wide {
    max-width: 600px;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0
    }
    to {
        transform: scale(1);
        opacity: 1
    }
}

.modal-box h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 7px;
}

.modal-box p {
    color: #555555;
    font-size: 0.87rem;
    margin-bottom: 20px;
    line-height: 1.65;
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* LOADING */
.loading-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    color: #555555;
}

.spin {
    width: 34px;
    height: 34px;
    border: 3px solid var(--green-mid);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spinA 0.7s linear infinite;
}

.spin-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinA 0.6s linear infinite;
}

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

/* TOAST */
.toast {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green);
    color: #fff;
    padding: 11px 22px;
    border-radius: 100px;
    font-size: 0.87rem;
    font-weight: 500;
    z-index: 200;
    animation: toastIn 0.3s ease;
    pointer-events: none;
}

.toast.err {
    background: var(--red);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translate(-50%, 12px)
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0)
    }
}

@media (max-width: 560px) {
    .container, .container-wide {
        padding: 30px 16px 60px
    }

    .results-hero {
        padding: 26px 20px
    }

    .score-big {
        font-size: 3rem
    }

    .auth-card {
        padding: 30px 22px
    }

    .site-header {
        padding: 0 16px
    }
}

/* ── FORCE LIGHT MODE — override phone dark mode ── */
@media (prefers-color-scheme: dark) {
    html, body {
        background: #ffffff !important;
        color: #1a1a1a !important;
    }

    .screen, .container, .container-wide {
        background: #ffffff !important;
    }

    .intro-title {
        color: #1a1a1a !important;
    }

    .intro-title em {
        color: #0E4E2B !important;
    }

    .intro-desc, p, h1, h2, h3, h4, span, div, label {
        color: #1a1a1a !important;
    }

    .opt-btn {
        background: #ffffff !important;
        border-color: #bbbbbb !important;
    }

    .opt-text {
        color: #1a1a1a !important;
    }

    .q-text {
        color: #1a1a1a !important;
    }

    .q-note {
        background: #e0f5e9 !important;
        color: #1a1a1a !important;
    }

    .cat-pill {
        background: #ffffff !important;
        color: #1a1a1a !important;
        border-color: #cccccc !important;
    }

    .auth-card {
        background: #ffffff !important;
    }

    .form-input {
        background: #ffffff !important;
        color: #1a1a1a !important;
        border-color: #bbbbbb !important;
    }

    .results-hero {
        background: #0E4E2B !important;
    }

    .results-hero * {
        color: #ffffff !important;
    }

    .site-header {
        background: #0E4E2B !important;
    }

    .site-header * {
        color: #ffffff !important;
    }

    .cat-tag {
        background: #e0f5e9 !important;
        color: #0E4E2B !important;
    }

    .intro-badge {
        background: #e0f5e9 !important;
        color: #0E4E2B !important;
    }

    .btn-primary {
        background: #0E4E2B !important;
        color: #ffffff !important;
    }

    .btn-outline {
        background: #ffffff !important;
        color: #1a1a1a !important;
        border-color: #cccccc !important;
    }

    .cat-row, .history-card, .stat-card, .ans-header {
        background: #f0f0f0 !important;
    }

    .modal-box {
        background: #ffffff !important;
    }
}


/* ── QUIZ EDITOR ── */
.qe-card {
    background: #fff;
    border: 1.5px solid #cccccc;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

.qe-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
}

.qe-header:hover {
    background: #f0f0f0;
}

.qe-num {
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0E4E2B;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qe-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
}

.qe-cat-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 100px;
    background: #e0f5e9;
    color: #0E4E2B;
    border: 1px solid #a8d9bc;
    white-space: nowrap;
}

.qe-body {
    padding: 18px;
    display: none;
}

.qe-body.open {
    display: block;
}

.qe-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #555;
    margin-bottom: 5px;
    margin-top: 14px;
}

.qe-field-label:first-child {
    margin-top: 0;
}

.qe-input {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #cccccc;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
}

.qe-input:focus {
    border-color: #0E4E2B;
}

.qe-opts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.qe-opt-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qe-opt-letter {
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #1a1a1a;
    flex-shrink: 0;
}

.qe-opt-row:first-child .qe-opt-letter {
    background: #fde8e6;
    color: #b83228;
}

.qe-opt-row:nth-child(2) .qe-opt-letter {
    background: #ece4f4;
    color: #6B4089;
}

.qe-opt-row:last-child .qe-opt-letter {
    background: #e0f5e9;
    color: #0E4E2B;
}

.qe-select {
    padding: 9px 12px;
    border: 1.5px solid #cccccc;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    width: 100%;
}

.qe-select:focus {
    border-color: #0E4E2B;
}

.qe-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e0e0e0;
}

.qe-del {
    background: #fdf0ee;
    color: #b83228;
    border: 1px solid #f5c0bb;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 7px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}

.qe-del:hover {
    background: #fce8e6;
}

.qe-save {
    background: #0E4E2B;
    color: #fff;
    border: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 7px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}

.qe-save:hover {
    background: #176B3C;
}

/* User table extras */
.role-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
}

.role-admin {
    background: #ece4f4;
    color: #6B4089;
    border: 1px solid #d8c8ec;
}

.role-user {
    background: #e0f5e9;
    color: #0E4E2B;
    border: 1px solid #a8d9bc;
}


/* ── DASHBOARD HOME ── */
.dh-welcome {
    background: var(--green);
    color: #fff;
    border-radius: var(--radius);
    padding: 32px 36px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.dh-welcome::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(235, 240, 59, 0.15);
}

.dh-welcome::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -20px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.dh-welcome-top {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
}

.dh-welcome h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.dh-welcome p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 1;
}

.dh-welcome-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.btn-yellow {
    background: var(--yellow);
    color: #1a3a00;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-yellow:hover {
    background: #d4d800;
    transform: translateY(-1px);
}

.btn-ghost-white {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost-white:hover {
    background: rgba(255, 255, 255, 0.25);
}

.dh-stats {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.dh-stat {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 16px;
    text-align: center;
}

.dh-stat-val {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--green);
    line-height: 1;
    margin-bottom: 4px;
}

.dh-stat-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #555;
}

.dh-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.dh-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 22px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dh-card:hover {
    border-color: var(--green-mid);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.dh-card-icon {
    font-size: 1.8rem;
}

.dh-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.dh-card-desc {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.5;
}

.dh-card-count {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--green);
}

.dh-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    margin-bottom: 14px;
    color: #1a1a1a;
}

.dh-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.dh-feed-item {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.dh-feed-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--green-pale);
    border: 2px solid var(--green-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--green);
    flex-shrink: 0;
}

.dh-feed-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
}

.dh-feed-meta {
    font-size: 0.78rem;
    color: #555;
    margin-top: 2px;
}

.dh-feed-score {
    margin-left: auto;
    text-align: right;
    flex-shrink: 0;
}

.dh-feed-score strong {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--green);
}

.dh-feed-score span {
    font-size: 0.72rem;
    color: #555;
}

/* User home specifics */
.dh-cat-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 28px;
}

.dh-cat-item {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    display: grid;
    grid-template-columns:1fr auto;
    align-items: center;
    gap: 12px;
}

.dh-cat-name {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.dh-cat-bar-bg {
    background: #e0e0e0;
    border-radius: 100px;
    height: 7px;
}

.dh-cat-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s ease;
}

.dh-cat-score {
    font-size: 0.82rem;
    font-weight: 700;
    color: #555;
    white-space: nowrap;
}

.tip-card {
    background: var(--green-pale);
    border: 1.5px solid var(--green-mid);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 10px;
}

.tip-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.tip-cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tip-cat-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tip-text {
    font-size: 0.88rem;
    color: #2d2d2d;
    line-height: 1.65;
}

/* Sparkline chart */
.chart-wrap {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 28px;
}

.chart-wrap canvas {
    width: 100% !important;
}

