body[data-color-theme="violet"] {
    --violet: #6457d9;
    --violet-dark: #5144c5;
    --violet-soft: #f0efff;
    --theme-gradient-start: #8879fa;
    --theme-gradient-mid: #6457d9;
    --theme-gradient-end: #4338a8;
    --theme-preview-light: #f0efff;
    --theme-glow: #c4baff78;
    --theme-text-soft: #e5e1ff;
    --theme-text-accent: #d1caff;
}

body[data-color-theme="blue"] {
    --violet: #2563c7;
    --violet-dark: #1d4e9f;
    --violet-soft: #eaf2ff;
    --theme-gradient-start: #60a5fa;
    --theme-gradient-mid: #2563eb;
    --theme-gradient-end: #1e3a8a;
    --theme-preview-light: #eaf2ff;
    --theme-glow: #93c5fd70;
    --theme-text-soft: #dbeafe;
    --theme-text-accent: #bfdbfe;
}

body[data-color-theme="green"] {
    --violet: #16805d;
    --violet-dark: #106448;
    --violet-soft: #e7f6ef;
    --theme-gradient-start: #34d399;
    --theme-gradient-mid: #059669;
    --theme-gradient-end: #064e3b;
    --theme-preview-light: #e7f6ef;
    --theme-glow: #6ee7b770;
    --theme-text-soft: #d1fae5;
    --theme-text-accent: #a7f3d0;
}

body[data-color-theme="orange"] {
    --violet: #c85b1c;
    --violet-dark: #a94714;
    --violet-soft: #fff0e5;
    --theme-gradient-start: #fdba74;
    --theme-gradient-mid: #ea580c;
    --theme-gradient-end: #9a3412;
    --theme-preview-light: #fff0e5;
    --theme-glow: #fed7aa70;
    --theme-text-soft: #ffedd5;
    --theme-text-accent: #fed7aa;
}

body[data-color-theme="rose"] {
    --violet: #cf315f;
    --violet-dark: #a91f4c;
    --violet-soft: #fff0f4;
    --theme-gradient-start: #fb7185;
    --theme-gradient-mid: #e11d48;
    --theme-gradient-end: #881337;
    --theme-preview-light: #fff0f4;
    --theme-glow: #fda4af70;
    --theme-text-soft: #ffe4e9;
    --theme-text-accent: #fecdd6;
}

body[data-color-theme="teal"] {
    --violet: #0f766e;
    --violet-dark: #115e59;
    --violet-soft: #e6f7f5;
    --theme-gradient-start: #2dd4bf;
    --theme-gradient-mid: #0f766e;
    --theme-gradient-end: #134e4a;
    --theme-preview-light: #e6f7f5;
    --theme-glow: #5eead470;
    --theme-text-soft: #ccfbf1;
    --theme-text-accent: #99f6e4;
}

body[data-color-theme="slate"] {
    --violet: #475569;
    --violet-dark: #334155;
    --violet-soft: #eef2f6;
    --theme-gradient-start: #94a3b8;
    --theme-gradient-mid: #475569;
    --theme-gradient-end: #1e293b;
    --theme-preview-light: #eef2f6;
    --theme-glow: #cbd5e170;
    --theme-text-soft: #e2e8f0;
    --theme-text-accent: #cbd5e1;
}

body[data-color-theme="gold"] {
    --violet: #a56a08;
    --violet-dark: #80520a;
    --violet-soft: #fff7df;
    --theme-gradient-start: #facc15;
    --theme-gradient-mid: #ca8a04;
    --theme-gradient-end: #713f12;
    --theme-preview-light: #fff7df;
    --theme-glow: #fde68a70;
    --theme-text-soft: #fef3c7;
    --theme-text-accent: #fde68a;
}

.side-nav a:hover,
.side-nav a.active {
    background: var(--violet-soft);
}

body[data-color-theme] .brand-mark,
body[data-color-theme] .login-icon {
    background: linear-gradient(145deg, var(--theme-gradient-start), var(--theme-gradient-mid) 58%, var(--theme-gradient-end));
}

body[data-color-theme] .student-banner,
body[data-color-theme] .login-visual {
    background: linear-gradient(120deg, var(--theme-gradient-end) 0%, var(--theme-gradient-mid) 54%, var(--theme-gradient-start) 100%);
}

body[data-color-theme] .app-shell-student .student-banner,
body[data-color-theme] .app-shell-student .student-banner .eyebrow,
body[data-color-theme] .app-shell-student .student-banner h2,
body[data-color-theme] .app-shell-student .student-banner p,
body[data-color-theme] .app-shell-student .student-banner .banner-art {
    color: #fff;
}

body[data-color-theme] .visual-glow {
    background: radial-gradient(circle, var(--theme-glow), transparent 70%);
}

body[data-color-theme] .visual-content h1 em {
    color: var(--theme-text-accent);
}

body[data-color-theme] .visual-content p {
    color: var(--theme-text-soft);
}

body[data-color-theme] .visual-points i {
    color: var(--theme-text-accent);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline-color: var(--violet);
}

.subject-tag,
.empty-icon,
.avatar {
    color: var(--violet);
    background: var(--violet-soft);
}

.color-theme-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.color-theme-fieldset legend {
    margin-bottom: 9px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
}

.color-theme-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.color-theme-option {
    display: flex;
    min-height: 88px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.color-theme-option:has(input:checked) {
    border-color: var(--violet);
    box-shadow: 0 0 0 2px var(--violet-soft);
}

.color-theme-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.color-theme-option:focus-within {
    outline: 3px solid var(--violet);
    outline-offset: 2px;
}

.color-theme-option strong {
    color: var(--ink);
    font-size: 11px;
}

.color-theme-preview {
    display: flex;
    width: 100%;
    height: 34px;
    align-items: flex-end;
    gap: 4px;
    padding: 5px;
    border-radius: 6px;
    background: var(--theme-preview-light);
}

.color-theme-preview i {
    display: block;
    width: 9px;
    height: 16px;
    border-radius: 3px;
    background: var(--theme-gradient-mid);
}

.color-theme-preview i:nth-child(2) {
    width: 45%;
    height: 9px;
    margin-left: auto;
    background: var(--theme-gradient-end);
}

.color-theme-preview i:nth-child(3) {
    height: 21px;
    background: var(--theme-gradient-start);
}

.color-theme-preview-violet {
    --theme-gradient-start: #8879fa;
    --theme-gradient-mid: #6457d9;
    --theme-gradient-end: #4338a8;
    --theme-preview-light: #f0efff;
    --theme-glow: #c4baff78;
    --theme-text-soft: #e5e1ff;
    --theme-text-accent: #d1caff;
}

.color-theme-preview-blue {
    --theme-gradient-start: #60a5fa;
    --theme-gradient-mid: #2563eb;
    --theme-gradient-end: #1e3a8a;
    --theme-preview-light: #eaf2ff;
    --theme-glow: #93c5fd70;
    --theme-text-soft: #dbeafe;
    --theme-text-accent: #bfdbfe;
}

.color-theme-preview-green {
    --theme-gradient-start: #34d399;
    --theme-gradient-mid: #059669;
    --theme-gradient-end: #064e3b;
    --theme-preview-light: #e7f6ef;
    --theme-glow: #6ee7b770;
    --theme-text-soft: #d1fae5;
    --theme-text-accent: #a7f3d0;
}

.color-theme-preview-orange {
    --theme-gradient-start: #fdba74;
    --theme-gradient-mid: #ea580c;
    --theme-gradient-end: #9a3412;
    --theme-preview-light: #fff0e5;
    --theme-glow: #fed7aa70;
    --theme-text-soft: #ffedd5;
    --theme-text-accent: #fed7aa;
}

.color-theme-preview-rose {
    --theme-gradient-start: #fb7185;
    --theme-gradient-mid: #e11d48;
    --theme-gradient-end: #881337;
    --theme-preview-light: #fff0f4;
    --theme-glow: #fda4af70;
    --theme-text-soft: #ffe4e9;
    --theme-text-accent: #fecdd6;
}

.color-theme-preview-teal {
    --theme-gradient-start: #2dd4bf;
    --theme-gradient-mid: #0f766e;
    --theme-gradient-end: #134e4a;
    --theme-preview-light: #e6f7f5;
    --theme-glow: #5eead470;
    --theme-text-soft: #ccfbf1;
    --theme-text-accent: #99f6e4;
}

.color-theme-preview-slate {
    --theme-gradient-start: #94a3b8;
    --theme-gradient-mid: #475569;
    --theme-gradient-end: #1e293b;
    --theme-preview-light: #eef2f6;
    --theme-glow: #cbd5e170;
    --theme-text-soft: #e2e8f0;
    --theme-text-accent: #cbd5e1;
}

.color-theme-preview-gold {
    --theme-gradient-start: #facc15;
    --theme-gradient-mid: #ca8a04;
    --theme-gradient-end: #713f12;
    --theme-preview-light: #fff7df;
    --theme-glow: #fde68a70;
    --theme-text-soft: #fef3c7;
    --theme-text-accent: #fde68a;
}

@media (max-width: 560px) {
    .color-theme-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
