:root {
    --bg: #f4efe6;
    --bg-warm: #efe4d2;
    --surface: rgba(255, 253, 248, 0.86);
    --surface-solid: #fffdf9;
    --surface-soft: #f7f1e8;
    --surface-muted: #eee5d8;
    --text: #182724;
    --muted: #60706b;
    --muted-soft: #7c8a85;
    --line: rgba(24, 39, 36, 0.12);
    --line-strong: rgba(24, 39, 36, 0.2);
    --accent: #0d8c8a;
    --accent-strong: #0b6665;
    --accent-soft: #dcf5f0;
    --success: #2a8b68;
    --success-strong: #216f54;
    --success-soft: #ddf4e9;
    --danger: #d35d52;
    --danger-strong: #b24840;
    --danger-soft: #f9e0dd;
    --warm: #d87443;
    --warm-soft: #f6dfd2;
    --shadow-lg: 0 22px 60px rgba(43, 35, 22, 0.12);
    --shadow-md: 0 14px 34px rgba(43, 35, 22, 0.09);
    --shadow-sm: 0 10px 20px rgba(43, 35, 22, 0.08);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

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

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 1.4rem;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(216, 116, 67, 0.18), transparent 32%),
        radial-gradient(circle at 85% 15%, rgba(13, 140, 138, 0.16), transparent 28%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 100%);
}

body.editor-mode {
    background:
        radial-gradient(circle at 0% 0%, rgba(13, 140, 138, 0.08), transparent 26%),
        radial-gradient(circle at 100% 10%, rgba(216, 116, 67, 0.1), transparent 22%),
        linear-gradient(180deg, #f6f1e8 0%, #ede3d4 100%);
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.hidden {
    display: none !important;
}

.center-text {
    text-align: center;
}

h1,
h2,
h3,
.editor-title,
.field-label,
.card-heading h3,
.sidebar-head h2,
.landing-card__header h2,
.editor-hero-card h2 {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    letter-spacing: -0.03em;
    color: var(--text);
}

h3 {
    font-size: 2rem;
}

p {
    line-height: 1.6;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--muted-soft);
}

.eyebrow--header {
    color: rgba(255, 255, 255, 0.72);
}

.mybtn,
.sidebar-link,
.add-answer-btn,
.type-toggle,
.tof-toggle,
.editor-nav-btn {
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.mybtn {
    width: 100%;
    min-height: 4.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.8rem;
    border-radius: 999px;
    border: none;
    font-weight: 700;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.mybtn:hover,
.sidebar-link:hover,
.add-answer-btn:hover,
.type-toggle:hover,
.tof-toggle:hover,
.editor-nav-btn:hover {
    transform: translateY(-1px);
}

.mybtn.new {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: white;
}

.mybtn.save {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-strong) 100%);
    color: white;
}

.mybtn.close {
    background: var(--danger-soft);
    color: var(--danger-strong);
    border: 1px solid rgba(211, 93, 82, 0.22);
    box-shadow: none;
}

.mybtn:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    transform: none;
    box-shadow: none;
}

#dragdrop {
    width: 100%;
    min-height: 100vh;
    padding: clamp(2.4rem, 4vw, 5rem);
    display: none;
    position: relative;
    overflow: hidden;
}

#dragdrop::before,
#dragdrop::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(12px);
    pointer-events: none;
}

#dragdrop::before {
    width: 28rem;
    height: 28rem;
    background: rgba(13, 140, 138, 0.15);
    top: -8rem;
    left: -7rem;
}

#dragdrop::after {
    width: 32rem;
    height: 32rem;
    background: rgba(216, 116, 67, 0.12);
    bottom: -10rem;
    right: -8rem;
}

.landing-grid {
    width: min(118rem, 100%);
    margin: 0 auto;
    min-height: calc(100vh - 8rem);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(30rem, 0.9fr);
    gap: 2.8rem;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.landing-hero,
.landing-card {
    border-radius: 3.2rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.landing-hero {
    padding: clamp(3.2rem, 6vw, 7rem);
    background: linear-gradient(140deg, rgba(20, 52, 48, 0.96) 0%, rgba(12, 102, 98, 0.94) 58%, rgba(20, 114, 109, 0.9) 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.landing-hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -28% auto;
    width: 42rem;
    height: 42rem;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 65%);
}

.landing-hero .eyebrow,
.landing-hero .landing-copy,
.landing-hero .landing-footnote {
    position: relative;
    z-index: 1;
}

.landing-hero .eyebrow {
    color: rgba(255, 255, 255, 0.68);
}

.landing-hero h1 {
    position: relative;
    z-index: 1;
    font-size: clamp(4.8rem, 8vw, 8.8rem);
    line-height: 0.92;
    color: white;
    max-width: 8ch;
    margin-top: 1.6rem;
}

.landing-copy {
    font-size: 1.9rem;
    max-width: 56rem;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.82);
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 2.8rem;
    position: relative;
    z-index: 1;
}

.landing-actions .mybtn {
    width: auto;
    min-width: 22rem;
}

.landing-footnote {
    margin-top: 1.8rem;
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.76);
}

.landing-card {
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.88), rgba(255, 249, 241, 0.72));
    border: 1px solid var(--line);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(18px);
}

.landing-card__header h2 {
    font-size: 3.2rem;
    margin-top: 1rem;
}

.landing-steps {
    list-style: none;
    display: grid;
    gap: 1.4rem;
    margin-top: 2.4rem;
}

.landing-steps li {
    padding: 1.5rem 1.6rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(24, 39, 36, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.landing-steps strong {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.landing-steps span {
    color: var(--muted);
    font-size: 1.35rem;
}

.landing-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.landing-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    background: rgba(13, 140, 138, 0.09);
    color: var(--accent-strong);
    font-size: 1.25rem;
    font-weight: 700;
}

.settings-btn {
    position: fixed;
    top: 1.8rem;
    right: 2rem;
    width: 4.8rem;
    height: 4.8rem;
    border-radius: 50%;
    border: 1px solid rgba(24, 39, 36, 0.1);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    font-size: 2.2rem;
    cursor: pointer;
    z-index: 500;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.settings-btn:hover {
    background: white;
}

.settings-btn.hidden {
    display: none;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 24, 22, 0.35);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

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

.settings-modal {
    background: rgba(255, 253, 248, 0.98);
    border-radius: var(--radius-lg);
    padding: 3rem;
    min-width: min(54rem, 100%);
    max-width: 62rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
}

.settings-modal > h3 {
    font-size: 2.4rem;
    margin-bottom: 0.8rem;
}

.setting-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.4rem;
    padding: 1.6rem 0;
    border-bottom: 1px solid rgba(24, 39, 36, 0.08);
    cursor: pointer;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item input[type="checkbox"] {
    width: 2rem;
    height: 2rem;
    accent-color: var(--accent);
    margin-top: 0.2rem;
}

.setting-item strong {
    display: block;
    color: var(--text);
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.setting-item p {
    color: var(--muted);
    font-size: 1.3rem;
}

.password-change-modal {
    max-width: 52rem;
}

.password-change-modal > p:not(.eyebrow) {
    color: var(--muted);
    margin-bottom: 1.6rem;
}

.password-change-modal .mybtn {
    width: 100%;
    margin: 1.4rem 0 0;
}

.setting-item--compact {
    padding: 1.2rem 0;
    margin-top: 0.4rem;
}

.editor-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.6rem;
    padding: 1.4rem clamp(1.8rem, 3vw, 3rem);
    background: rgba(20, 52, 48, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 28px rgba(18, 29, 27, 0.14);
}

.editor-header.hidden {
    display: none;
}

.editor-header__left {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    min-width: 0;
}

.editor-header__titles {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.editor-title {
    font-size: 2rem;
    color: white;
}

.editor-header__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.8rem;
}

.editor-nav-btn {
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.editor-nav-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 1.24rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill--muted {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
}

.status-pill--primary {
    background: rgba(13, 140, 138, 0.12);
    border-color: rgba(13, 140, 138, 0.18);
    color: var(--accent-strong);
}

.edit-parent {
    width: min(156rem, calc(100% - 4rem));
    margin: 2.6rem auto 4rem;
    display: grid;
    grid-template-columns: minmax(33rem, 38rem) minmax(0, 1fr);
    gap: 2.2rem;
    align-items: start;
}

.edit-parent.hidden {
    display: none;
}

.sidebar {
    position: sticky;
    top: 8.8rem;
    align-self: start;
    max-height: calc(100vh - 11.4rem);
    overflow: auto;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-md);
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2.2rem;
}

.sidebar-head h2 {
    font-size: 3.2rem;
    margin-top: 0.8rem;
}

.sidebar-copy {
    margin-top: 1rem;
    color: var(--muted);
}

.workflow-step-label {
    margin: 1.4rem 0 0.4rem;
    color: var(--muted);
}

.question-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.question-nav__btn {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.question-nav__btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.question-nav__label {
    min-width: 11rem;
    text-align: center;
    font-weight: 600;
    color: var(--muted);
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.metric-card {
    padding: 1.3rem 1.2rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(24, 39, 36, 0.08);
    text-align: center;
}

.metric-card strong {
    display: block;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    font-size: 2.3rem;
    line-height: 1;
}

.metric-card span {
    display: block;
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.metric-card--alert {
    background: var(--warm-soft);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-title-row--compact {
    margin-top: 0.8rem;
}

.section-title-row h3 {
    font-size: 2.1rem;
}

.mini-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mini-tag--neutral {
    background: var(--surface-muted);
    color: var(--muted);
}

.section-copy,
.card-hint,
.panel-header p,
.editor-hero-copy,
.field-help {
    color: var(--muted);
    font-size: 1.3rem;
}

.question-list {
    min-height: 22rem;
    max-height: 39rem;
    margin-top: 1.2rem;
    overflow: auto;
    padding-right: 0.3rem;
}

.question-list:empty::after {
    content: "No questions yet. Add your first question to start building this draft.";
    display: block;
    padding: 1.6rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
    background: rgba(255, 255, 255, 0.55);
    color: var(--muted-soft);
    font-size: 1.3rem;
    line-height: 1.6;
}

.question-list p {
    position: relative;
    padding: 1.5rem 5rem 1.5rem 1.6rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.75);
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 0.8rem;
    box-shadow: 0 8px 18px rgba(43, 35, 22, 0.05);
}

.question-list p:hover {
    cursor: pointer;
    border-color: rgba(13, 140, 138, 0.28);
    background: white;
}

.question-list p.selected {
    background: var(--accent-soft);
    border-color: rgba(13, 140, 138, 0.45);
    color: var(--accent-strong);
}

.delete {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 3.4rem;
    height: 3.4rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--danger);
    font-size: 2rem;
    font-weight: 700;
    cursor: pointer;
}

.delete:hover {
    background: var(--danger-soft);
}

.button-stack,
.panel-button-stack {
    display: grid;
    gap: 0.9rem;
}

.sidebar-link {
    width: 100%;
    min-height: 4.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: none;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.sidebar-link.new {
    color: var(--accent-strong);
}

.sidebar-link.save {
    color: var(--success-strong);
}

.sidebar-link.close {
    color: var(--danger-strong);
}

.supabase-panel {
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(253, 248, 241, 0.82));
    border: 1px solid rgba(24, 39, 36, 0.08);
    padding: 1.8rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.panel-header h3 {
    font-size: 2.2rem;
    margin-top: 0.8rem;
}

.panel-field-group {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.2rem;
}

.panel-input,
#question-input,
.image-url-field,
.answer-input .multi-input {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 1.15rem 1.4rem;
    background: rgba(255, 255, 255, 0.94);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 10px 24px rgba(43, 35, 22, 0.04);
    outline: none;
}

.panel-input:focus,
#question-input:focus,
.image-url-field:focus,
.answer-input .multi-input:focus {
    border-color: rgba(13, 140, 138, 0.55);
    box-shadow: 0 0 0 4px rgba(13, 140, 138, 0.12);
}

.panel-input::placeholder,
#question-input::placeholder,
.image-url-field::placeholder,
.answer-input .multi-input::placeholder {
    color: #94a09c;
}

.panel-button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 1.2rem 0 1rem;
}

.panel-button-row .mybtn,
.panel-button-stack .mybtn {
    margin: 0;
}

.auth-status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 4.2rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(24, 39, 36, 0.08);
    color: var(--muted);
    font-size: 1.28rem;
    font-weight: 600;
    margin-top: 1.2rem;
}

.auth-status.error {
    background: var(--danger-soft);
    color: var(--danger-strong);
    border-color: rgba(211, 93, 82, 0.18);
}

.category-logo-preview {
    width: 100%;
    min-height: 13rem;
    margin: 1rem 0;
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 240, 232, 0.68));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
}

.category-logo-preview img {
    max-width: 100%;
    max-height: 9rem;
    object-fit: contain;
    display: none;
}

#category-logo-placeholder {
    color: var(--muted-soft);
    font-size: 1.25rem;
    text-align: center;
}

.upload-zone {
    width: 100%;
    min-height: 9rem;
    padding: 1.6rem;
    border-radius: var(--radius-md);
    border: 1.5px dashed rgba(13, 140, 138, 0.35);
    background: linear-gradient(180deg, rgba(220, 245, 240, 0.55), rgba(255, 255, 255, 0.68));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--accent-strong);
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 0.8rem;
}

.upload-zone:hover {
    border-color: rgba(13, 140, 138, 0.6);
    background: linear-gradient(180deg, rgba(220, 245, 240, 0.7), rgba(255, 255, 255, 0.78));
}

.upload-zone.upload-zone-sm {
    min-height: 6.8rem;
}

.music-preview {
    width: 100%;
    height: 4.4rem;
    margin: 0.6rem 0 0.8rem;
}

.music-volume {
    width: 100%;
    accent-color: var(--accent);
    margin: 0.6rem 0 1.2rem;
}

.xlsx-import-heading {
    margin-top: 1.8rem;
}

.xlsx-import-copy {
    margin: 0.6rem 0 1rem;
    color: var(--muted);
    font-size: 1.25rem;
}

.xlsx-import-review {
    margin: 1rem 0;
    padding: 1.4rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(24, 39, 36, 0.1);
}

.xlsx-import-review.error {
    background: var(--danger-soft);
    border-color: rgba(211, 93, 82, 0.22);
}

.xlsx-import-review h4 {
    font-size: 1.55rem;
    margin-bottom: 0.8rem;
}

.xlsx-import-review ul {
    margin: 0;
    padding-left: 1.8rem;
}

.xlsx-import-review li {
    margin: 0.35rem 0;
    color: var(--muted);
}

.xlsx-import-review strong {
    color: var(--text);
}

.xlsx-import-errors {
    max-height: 15rem;
    overflow: auto;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.74);
    color: var(--danger-strong);
    font-size: 1.18rem;
}

.xlsx-import-actions {
    margin-bottom: 1.5rem;
}

.edit-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.editor-hero-card,
.editor-card {
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--line);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
}

.editor-hero-card {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.6rem;
    padding: 2.4rem 2.6rem;
}

.editor-hero-card h2 {
    font-size: clamp(2.8rem, 3vw, 4rem);
    margin-top: 0.8rem;
}

.editor-hero-copy {
    margin-top: 1rem;
    max-width: 62rem;
}

.editor-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-end;
}

.preview-toggle {
    min-height: 4.4rem;
    padding: 0 1.6rem;
    border-radius: 999px;
    border: 1px solid rgba(13, 140, 138, 0.18);
    background: rgba(13, 140, 138, 0.08);
    color: var(--accent-strong);
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
}

.preview-toggle:hover {
    background: rgba(13, 140, 138, 0.14);
}

.preview-toggle.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-sm);
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
    gap: 2rem;
    align-items: start;
}

.editor-card {
    padding: 2.2rem;
}

.preview-empty,
.preview-shell {
    border-radius: var(--radius-lg);
}

.preview-empty {
    padding: 2.2rem;
    border: 1px dashed var(--line-strong);
    background: rgba(255, 255, 255, 0.62);
    color: var(--muted-soft);
    text-align: center;
}

.preview-shell {
    padding: 2rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(245, 239, 230, 0.84));
    border: 1px solid rgba(24, 39, 36, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.preview-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.6rem;
}

.preview-category {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.preview-category h4,
.preview-question-text {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    letter-spacing: -0.03em;
    color: var(--text);
}

.preview-category h4 {
    font-size: 2.1rem;
}

.preview-category-logo {
    width: 6.4rem;
    height: 6.4rem;
    border-radius: 1.8rem;
    background: white;
    border: 1px solid rgba(24, 39, 36, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    overflow: hidden;
}

.preview-category-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-label {
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted-soft);
}

.preview-badge,
.preview-answer-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.1rem;
    border-radius: 999px;
    background: rgba(13, 140, 138, 0.1);
    color: var(--accent-strong);
    font-size: 1.2rem;
    font-weight: 700;
}

.preview-question-block,
.preview-explanation-block {
    margin-top: 2rem;
}

.preview-question-text {
    font-size: clamp(2.4rem, 2.4vw, 3.2rem);
    margin-top: 0.8rem;
    line-height: 1.15;
}

.preview-image-wrap {
    margin-top: 1.6rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    border: 1px solid rgba(24, 39, 36, 0.08);
    max-width: 44rem;
}

.preview-image-wrap img {
    width: 100%;
    max-height: 28rem;
    object-fit: cover;
}

.preview-answer-list {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.preview-answer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
    padding: 1.4rem 1.5rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(24, 39, 36, 0.08);
}

.preview-answer-item--correct {
    background: var(--success-soft);
    border-color: rgba(42, 139, 104, 0.22);
}

.preview-answer-item--empty {
    color: var(--muted-soft);
    justify-content: center;
    text-align: center;
}

.preview-answer-text {
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1.5;
}

.preview-explanation {
    margin-top: 0.8rem;
    padding: 1.6rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(24, 39, 36, 0.08);
    color: var(--text);
    line-height: 1.7;
}

.preview-explanation em {
    color: var(--muted);
}

.editor-card--answers {
    grid-column: 1 / -1;
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.6rem;
    margin-bottom: 1.8rem;
}

.card-kicker {
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted-soft);
}

.card-heading h3 {
    font-size: 2.4rem;
    margin-top: 0.6rem;
}

.field-block {
    margin-top: 1.8rem;
}

.field-block:first-of-type {
    margin-top: 0;
}

.field-label {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.9rem;
}

#question-input {
    min-height: 16rem;
    resize: vertical;
    line-height: 1.6;
}

.image-url-field {
    min-height: 4.8rem;
}

.tox-tinymce {
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(43, 35, 22, 0.05);
}

.tox .tox-editor-header,
.tox .tox-toolbar-overlord {
    background: #f4f0e8 !important;
    border-bottom: 1px solid rgba(24, 39, 36, 0.08) !important;
}

.type-toggle,
.tof-toggle {
    width: 100%;
    min-height: 5rem;
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.type-toggle {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.type-toggle.tof {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-strong) 100%);
}

.tof-toggle {
    background: linear-gradient(135deg, var(--warm) 0%, #be5633 100%);
}

.tof-toggle.true {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-strong) 100%);
}

.multipe-choice-answers.hidden,
.tof-answer.hidden {
    display: none;
}

.answer-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(24, 39, 36, 0.08);
    background: rgba(255, 255, 255, 0.7);
}

.answer-input .multi-input {
    min-height: 5rem;
    resize: vertical;
    line-height: 1.5;
}

.answer-input .multi-check {
    width: 1.9rem;
    height: 1.9rem;
    accent-color: var(--success);
    cursor: pointer;
}

.remove-answer-btn {
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 50%;
    border: none;
    background: var(--danger-soft);
    color: var(--danger-strong);
    font-size: 2rem;
    font-weight: 700;
    cursor: pointer;
}

.add-answer-btn {
    width: 100%;
    min-height: 5rem;
    border-radius: var(--radius-md);
    border: 1.5px dashed rgba(13, 140, 138, 0.35);
    background: rgba(13, 140, 138, 0.08);
    color: var(--accent-strong);
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
}

.sidebar-overlay.hidden {
    display: none;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(24, 39, 36, 0.18);
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

@media only screen and (min-width: 1201px) {
    .editor-header__left .editor-nav-btn {
        display: none;
    }
}

@media only screen and (max-width: 1200px) {
    .landing-grid {
        grid-template-columns: 1fr;
    }

    .edit-parent {
        width: min(100%, calc(100% - 3.2rem));
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 8rem;
        left: 1.6rem;
        width: min(40rem, calc(100vw - 3.2rem));
        max-height: calc(100vh - 9.6rem);
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 140;
        transform: translateX(calc(-100% - 2rem));
        transition: transform 0.22s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(21, 34, 30, 0.32);
        backdrop-filter: blur(4px);
        z-index: 130;
        display: block;
    }

    .editor-header__meta {
        display: none;
    }
}

@media only screen and (max-width: 980px) {
    .preview-topbar,
    .preview-answer-item {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .editor-hero-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-heading {
        flex-direction: column;
    }
}

@media only screen and (max-width: 720px) {
    html {
        font-size: 58%;
    }

    #dragdrop {
        padding: 1.8rem;
    }

    .landing-hero,
    .landing-card,
    .editor-card,
    .editor-hero-card,
    .settings-modal,
    .sidebar {
        border-radius: 2.4rem;
    }

    .landing-actions {
        flex-direction: column;
    }

    .landing-actions .mybtn {
        width: 100%;
    }

    .panel-button-row {
        grid-template-columns: 1fr;
    }

    .answer-input {
        grid-template-columns: 1fr auto;
    }

    .answer-input .multi-input {
        grid-column: 1 / -1;
    }

    .metric-strip {
        grid-template-columns: 1fr;
    }

    .editor-header {
        padding: 1.2rem 1.4rem;
    }

    .editor-title {
        font-size: 1.8rem;
    }
}

@media only screen and (max-width: 480px) {
    .sidebar {
        left: 1rem;
        width: calc(100vw - 2rem);
    }

    .sidebar-panel,
    .supabase-panel,
    .editor-card,
    .editor-hero-card,
    .landing-card {
        padding: 1.6rem;
    }
}
