/* =========================
   ОСНОВА
   ========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6fb;
    color: #222;
}


/* =========================
   ОСНОВНОЙ КОНТЕЙНЕР
   ========================= */

#app {
    display: flex;
    min-height: 100vh;
}


/* =========================
   БОКОВОЕ МЕНЮ
   ========================= */

#sidebar {
    width: 250px;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    padding: 25px 15px;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    position: fixed;
    left: 0;
    top: 0;
}


/* =========================
   ЛОГОТИП
   ========================= */

#logo {
    text-align: center;
    margin-bottom: 30px;
}

#logo h1 {
    margin: 0;
    font-size: 26px;
}

#logo p {
    margin-top: 7px;
    color: #777;
    font-size: 13px;
}


/* =========================
   КНОПКИ МЕНЮ
   ========================= */

#sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#sidebar button {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

#sidebar button:hover {
    background: rgba(255, 255, 255, 0.65);
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

#sidebar button:active {
    transform: translateX(3px) scale(0.98);
}


/* =========================
   ОСНОВНАЯ ОБЛАСТЬ
   ========================= */

#main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 40px;
}


/* =========================
   ПРИВЕТСТВИЕ
   ========================= */

#welcome {
    background: rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    text-align: center;
}

#welcome h2 {
    margin: 0 0 6px 0;
    font-size: 21px;
    font-weight: 500;
}

#welcome p {
    margin: 0;
    color: #777;
    font-size: 14px;
    line-height: 1.4;
}


/* =========================
   РАЗДЕЛЫ
   ========================= */

#homework {
    max-width: 1000px;
}

#homework h2 {
    font-size: 26px;
    margin-bottom: 20px;
}

#homework h3 {
    margin-top: 0;
}


/* =========================
   КАРТОЧКИ
   ========================= */

.homework-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 12px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.homework-card p {
    line-height: 1.5;
}


/* =========================
   КНОПКИ В РАЗДЕЛАХ
   ========================= */

button {
    border: none;
    border-radius: 10px;
    padding: 10px 15px;
    margin: 4px;
    background: #e9edf7;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: scale(0.97);
}


/* =========================
   КНОПКА УДАЛЕНИЯ
   ========================= */

.delete-button {
    background: #ffe5e5;
}


/* =========================
   ПОЛЯ
   ========================= */

input,
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    margin: 6px 0;
    border: 1px solid #d9dce5;
    border-radius: 10px;
    font-size: 15px;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #7c8cff;
}


/* ====================
   КАРТОЧКИ ГЛАВНОЙ
   ==================== */

/* ====================
   КАРТОЧКИ ГЛАВНОЙ
   ==================== */

.dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
}

.dashboard-card-header h3 {
    margin: 0;
}


/* Кнопка сворачивания */

.dashboard-toggle {
    width: 34px !important;
    height: 34px !important;

    min-width: 34px;
    min-height: 34px;

    padding: 0 !important;
    margin: 0 !important;

    border: 1px solid rgba(0, 0, 0, 0.08);

    background: rgba(255, 255, 255, 0.7);

    border-radius: 50%;

    font-size: 17px;
    font-weight: 500;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #555;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease,
        color 0.2s ease;
}


/* Наведение */

.dashboard-toggle:hover {
    background: rgba(255, 255, 255, 0.95);

    transform: scale(1.06);

    color: #333;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.09);
}


/* Нажатие */

.dashboard-toggle:active {
    transform: scale(0.94);
}


/* Содержимое карточки */

.dashboard-card-content {
    overflow: hidden;

    max-height: 1000px;

    opacity: 1;

    margin-top: 12px;

    transition:
        max-height 0.35s ease,
        opacity 0.25s ease,
        margin-top 0.35s ease;
}


/* Свернутое состояние */

.dashboard-card-content.collapsed {
    max-height: 0;

    opacity: 0;

    margin-top: 0;
}


/* Кнопка в свернутом состоянии */

.dashboard-toggle.collapsed {
    transform: rotate(0deg);
}
/* ====================
   КАРТОЧКИ ГЛАВНОЙ
   ==================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}


.dashboard-card {
    background: rgba(255, 255, 255, 0.72);

    border: 1px solid rgba(0, 0, 0, 0.05);

    border-radius: 18px;

    padding: 20px;

    box-shadow:
        0 5px 18px rgba(0, 0, 0, 0.05);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


/* Наведение на карточку */

.dashboard-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08);
}


/* Заголовок карточки */

.dashboard-card h3 {
    font-size: 17px;
    font-weight: 600;
}


/* Текст внутри карточки */

.dashboard-card p {
    margin: 8px 0;

    font-size: 14px;

    line-height: 1.5;

    color: #555;
}
/* ====================
   📅 КАЛЕНДАРЬ
   ==================== */

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
}

.calendar-header h3 {
    margin: 0;
    font-size: 24px;
}

.calendar-header button {
    font-size: 24px;
    padding: 8px 16px;
    cursor: pointer;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    gap: 5px;
}

.calendar-weekdays div {
    text-align: center;
    font-weight: bold;
    padding: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    gap: 5px;
}

.calendar-day {
    min-height: 65px;
    border: 1px solid #ccc;
    border-radius: 7px;
    padding: 7px;
    background: white;
    cursor: pointer;
    box-sizing: border-box;
}

.calendar-day:hover {
    transform: scale(1.02);
}

.calendar-day strong {
    font-size: 16px;
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.today {
    border: 3px solid #333;
}

#calendar-events {
    width: 100%;
    max-width: 900px;
    margin: 25px auto;
}

#calendar-events p {
    padding: 10px;
    border-radius: 8px;
    background: #f2f2f2;
}
/* ====================
   📅 СОБЫТИЯ КАЛЕНДАРЯ
   ==================== */

.calendar-events {
    margin-top: 6px;
    font-size: 12px;
}

.calendar-event {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.calendar-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    display: inline-block;
}

.homework-dot {
    background: #e53935;
}

.exam-dot {
    background: #1e88e5;
}

.task-dot {
    background: #fb8c00;
}

.holiday-dot {
    background: #43a047;
}

.calendar-legend {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
#current-date-time {
    display: inline-block;

    margin: 20px 0 15px 20px;
    padding: 10px 18px;

    background: #f7f7f8;
    border-radius: 12px;

    color: #222;
    font-size: 21px;
    font-weight: 600;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* Flexible content also supports long subject names, URLs and filenames. */
#sync-panel {
    max-width: 1000px;
    margin-bottom: 16px;
    padding: 14px;
    background: white;
    border: 1px solid #d9dce5;
    border-radius: 14px;
    overflow-wrap: anywhere;
}

#sync-panel summary {
    cursor: pointer;
    min-height: 32px;
    line-height: 1.5;
}

#sync-panel button {
    min-height: 44px;
    max-width: calc(100% - 8px);
}

#sync-panel input { font-size: 16px; }
#sync-panel [hidden] { display: none; }
#sync-panel p { line-height: 1.5; }
.sync-hint { font-size: 13px; color: #555; }
.sync-tab-notice { padding: 24px; background: #fff4d1; }
#sync-choices { border-top: 1px solid #d9dce5; margin-top: 12px; }

#main-content,
#homework,
.dashboard-card,
.dashboard-card-header > h3,
.lesson-info {
    min-width: 0;
    overflow-wrap: anywhere;
}

#sidebar {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
}

#sidebar button {
    margin: 0;
}

.dashboard-card-header {
    gap: 10px;
}

.dashboard-toggle {
    flex-shrink: 0;
}

.dashboard-card-content:not(.collapsed) {
    max-height: none;
    overflow: visible;
}

.calendar-grid,
.calendar-weekdays {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-day,
.calendar-event > span:last-child {
    min-width: 0;
}

.calendar-event > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

button,
input,
select,
textarea {
    max-width: 100%;
}

button {
    white-space: normal;
    overflow-wrap: anywhere;
    touch-action: manipulation;
}

button:focus-visible {
    outline: 3px solid #5262bb;
    outline-offset: 3px;
}

/* Tablet / narrow desktop window: retain the sidebar. */
@media (min-width: 761px) and (max-width: 1100px) {
    #sidebar {
        width: 210px;
        padding: 20px 12px;
    }

    #main-content {
        margin-left: 210px;
        width: calc(100% - 210px);
        padding: 24px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phone: navigation flows above the page and never covers forms or keyboard. */
@media (max-width: 760px) {
    #app {
        display: block;
    }

    #sidebar {
        position: static;
        width: 100%;
        height: auto;
        min-height: 0;
        overflow: visible;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    #logo {
        text-align: left;
        margin-bottom: 14px;
    }

    #logo h1 {
        font-size: 24px;
    }

    #logo p {
        margin: 6px 0 0;
    }

    #sidebar nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    #sidebar button {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 15px;
        background: rgba(255, 255, 255, 0.7);
    }

    #main-content {
        margin-left: 0;
        width: 100%;
        padding: 16px 16px max(24px, env(safe-area-inset-bottom));
    }

    #current-date-time {
        max-width: 100%;
        margin: 0 0 8px;
        padding: 10px 14px;
        font-size: 17px;
    }

    #homework h2 {
        font-size: 23px;
        line-height: 1.3;
        margin: 16px 0;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin-top: 16px;
    }

    .homework-card,
    .dashboard-card,
    #welcome {
        padding: 16px;
    }

    #homework button {
        min-height: 44px;
        max-width: calc(100% - 8px);
    }

    .dashboard-toggle {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px;
    }

    input,
    select,
    textarea {
        min-width: 0;
        min-height: 44px;
        font-size: 16px;
    }

    input[type="file"] {
        overflow: hidden;
    }

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

    #homework .day-button {
        margin: 0;
        max-width: 100%;
        text-align: left;
        padding: 12px 10px;
    }

    .schedule-lesson {
        padding: 16px;
        margin: 12px 0;
        border-radius: 16px;
        background: white;
    }

    .lesson-number,
    .lesson-time,
    .lesson-name {
        margin-bottom: 8px;
    }

    .calendar-header {
        gap: 8px;
    }

    .calendar-header h3 {
        font-size: 18px;
        text-align: center;
    }

    #homework .calendar-header button {
        flex: 0 0 44px;
        margin: 0;
        padding: 8px;
    }

    .calendar-grid,
    .calendar-weekdays {
        gap: 3px;
    }

    .calendar-weekdays div {
        padding: 8px 0;
        font-size: 13px;
    }

    .calendar-day {
        min-height: 76px;
        padding: 5px 3px;
    }

    .calendar-day strong {
        font-size: 14px;
    }

    .calendar-day.today {
        border-width: 1px;
        box-shadow: inset 0 0 0 2px #333;
    }

    .calendar-event {
        gap: 3px;
        font-size: 11px;
    }

    .calendar-dot {
        width: 6px;
        min-width: 6px;
        height: 6px;
    }

    .calendar-events small {
        display: block;
        font-size: 10px;
        white-space: normal;
    }

    .calendar-legend {
        gap: 10px 14px;
        font-size: 13px;
    }
}

@media (hover: none) {
    #sidebar button:hover,
    button:hover,
    .dashboard-card:hover,
    .calendar-day:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
    }
}

/* MyStudy Clear: one shared presentation system for both themes. */
:root {
    color-scheme: light;
    --bg: #f4f7fb; --surface: #fff; --surface-soft: #f8fafd;
    --text: #18212f; --text-muted: #627083; --border: #dde5ef;
    --primary: #2f6feb; --primary-hover: #245cc6; --primary-soft: #eaf1ff;
    --amber: #d99a32; --teal: #299c96; --danger: #d94b4b;
    --solid: #2f6feb; --danger-text: #ad3030; --danger-soft: #fff4f4;
    --success-text: #16716c; --success-soft: #edf8f6;
    --nav-width: 240px; --shadow: 0 1px 2px #18212f08, 0 6px 18px #18212f0a;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f141b; --surface: #171e27; --surface-soft: #1c2531;
    --text: #f1f5f9; --text-muted: #a8b3c2; --border: #2b3645;
    --primary: #6d9eff; --primary-hover: #87afff; --primary-soft: #1a2b49;
    --amber: #e3ad55; --teal: #52b8b0; --danger: #f06a6a;
    --solid: #326bd6; --danger-text: #f89b9b; --danger-soft: #302126;
    --success-text: #7dd7ca; --success-soft: #18312f; --shadow: 0 1px 2px #00000012;
}
body { font-family: 'Segoe UI Variable', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 17px; font-weight: 450; line-height: 1.5; background: var(--bg); color: var(--text); }
button, input, select, textarea { font-family: inherit; }
button { min-height: 42px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); color: var(--text); font-size: 15px; font-weight: 600; transition: background-color 160ms ease, border-color 160ms ease; }
button:hover, button:active, #sidebar button:hover, #sidebar button:active,
.dashboard-card:hover, .homework-card:hover, .calendar-day:hover, .dashboard-toggle:hover { transform: none; box-shadow: none; }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus, select:focus, textarea:focus { outline: 3px solid var(--primary); outline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; }
a { color: var(--primary); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; font-size: 16px; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
#app { display: block; }
#sidebar { position: fixed; inset: 0 auto 0 0; width: var(--nav-width); height: 100dvh; min-height: 0; padding: 20px 16px; overflow-y: auto; background: var(--surface); border: 0; border-right: 1px solid var(--border); z-index: 30; transform: translateX(0); opacity: 1; transition: transform 260ms ease, opacity 240ms ease; backdrop-filter: none; }
.sidebar-collapsed #sidebar { transform: translateX(-100%); opacity: 0; pointer-events: none; }
#sidebar nav { display: flex; flex-direction: column; gap: 5px; }
#sidebar nav button { display: block; width: 100%; margin: 0; padding: 10px 14px; min-height: 44px; font-size: 16px; text-align: left; white-space: nowrap; color: var(--text-muted); background: transparent; border: 0; border-radius: 9px; }
#sidebar nav button[aria-current="page"] { background: var(--primary-soft); color: var(--primary); box-shadow: inset 3px 0 var(--primary); font-weight: 650; }
#sidebar #sidebar-toggle { width: auto; margin: 0 0 18px; padding: 6px 12px; min-height: 38px; border: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
#logo { margin: 0 0 26px; padding: 0 12px; text-align: left; }
#logo h1 { margin: 0; font-size: 24px; letter-spacing: -.5px; color: var(--primary); }
#logo p { margin: 5px 0 0; color: var(--text-muted); font-size: 13px; }
#main-content { margin-left: var(--nav-width); width: calc(100% - var(--nav-width)); max-width: none; padding: 24px clamp(20px, 3vw, 44px) 40px; transition: margin-left 260ms ease, width 260ms ease; }
.sidebar-collapsed #main-content { margin-left: 0; width: 100%; }
#homework { max-width: 1400px; }
.appearance-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1400px; margin-bottom: 14px; min-height: 40px; }
#menu-open { visibility: hidden; margin: 0; }
.sidebar-collapsed #menu-open { visibility: visible; }
.theme-switch, .semester-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; width: fit-content; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px; }
.theme-switch { margin-left: auto; }
.theme-switch button, .semester-tabs button { margin: 0; background: transparent; border-color: transparent; }
.theme-switch button { min-height: 34px; padding: 5px 10px; font-size: 14px; }
.theme-switch button[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); border-color: var(--border); }
#sync-panel { max-width: 1400px; margin: 0 0 12px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: none; color: var(--text); }
#sync-panel summary { min-height: 28px; font-size: 14px; line-height: 1.6; list-style: none; }
#sync-panel summary::-webkit-details-marker { display: none; }
#sync-panel summary::after { float: right; margin-left: 12px; color: var(--primary); }
#sync-status, #file-sync-status, .sync-hint { color: var(--text-muted); }
#sync-choices, .sync-tab-notice { border-left: 3px solid var(--amber); padding-left: 12px; background: var(--surface); color: var(--text); }
#current-date-time { margin: 0 0 16px; padding: 0; color: var(--text-muted); background: transparent; box-shadow: none; font-size: 14px; font-weight: 450; }
#homework h2 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.45px; margin: 8px 0 22px; }
#homework:has(.dashboard-grid) > h2 { font-size: 32px; }
#homework h3 { font-size: 19px; line-height: 1.35; font-weight: 650; margin-top: 0; color: var(--text); }
.homework-card, .dashboard-card, #welcome, .grade-subject, .schedule-day { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.dashboard-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.dashboard-card { border-top: 2px solid var(--primary); }
.dashboard-card:has(#dashboard-exam), .homework-card:has(button[onclick^="editExam"]) { border-top: 2px solid var(--amber); }
.homework-card.completed { border-top: 2px solid var(--teal); }
.dashboard-card-header { align-items: flex-start; gap: 10px; }
.dashboard-card-header h3 { margin: 0; }
.dashboard-card p, .dashboard-card-content, .schedule-subtitle, #welcome p { font-size: 15px; color: var(--text-muted); }
#homework .dashboard-toggle { width: auto !important; height: auto !important; min-width: 0; min-height: 30px; max-width: none; padding: 3px 7px !important; border: 0; border-radius: 6px; box-shadow: none; background: var(--surface-soft); color: var(--primary); font-size: 13px; font-weight: 550; }
#homework button[onclick^="openAdd"], #homework button[onclick^="save"], #homework .schedule-add,
#sync-auth button[type="submit"], #sync-now { background: var(--solid); border-color: var(--solid); color: white; }
#homework button[onclick^="clear"], #homework button[onclick^="delete"], #homework button[onclick^="remove"], .delete-button { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger); }
#homework .complete-button { color: var(--success-text); background: var(--success-soft); border-color: var(--teal); }
.semester-tabs { margin-bottom: 14px; }
.semester-tabs button[aria-pressed="true"], #homework .day-button[aria-pressed="true"] { background: var(--solid); border-color: var(--solid); color: white; }
.grade-fields { display: grid; gap: 12px; margin: 20px 0; }
.grade-fields label { display: grid; gap: 6px; }
.grade-fields input, .grade-fields select { max-width: 420px; }
.grade-subject { padding: 0; margin: 14px 0; overflow: hidden; }
.grade-subject summary { padding: 16px 20px; cursor: pointer; }
.grade-subject summary span { display: block; color: var(--text-muted); font-size: 14px; }
.grade-subject-body { padding: 0 20px 16px; }
.grade-result { border-top: 1px solid var(--border); padding: 10px 0; }
.grade-result h4 { margin: 4px 0; }
.grade-subject-total { padding: 12px; background: var(--surface-soft); border-radius: 10px; }
#homework:has(.semester-tabs) .homework-card p, .grade-result p, .grade-subject-total p { margin: 6px 0; }
#homework:has(.semester-tabs) .homework-card strong { color: var(--primary); }
.schedule-menu { padding: 0; }
.schedule-days { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
#homework .day-button { min-height: 40px; padding: 7px 12px; margin: 0; background: var(--surface-soft); color: var(--text); border: 1px solid var(--border); border-radius: 9px; font-size: 14px; }
.schedule-hint { font-size: 14px; color: var(--text-muted); margin: 0 0 10px; }
#homework .schedule-lesson { display: block; padding: 0; margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; background: var(--surface); }
.schedule-lesson summary { display: grid; grid-template-columns: 24px 112px minmax(0,1fr); align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; cursor: pointer; list-style: none; }
.schedule-lesson summary::-webkit-details-marker { display: none; }
.lesson-number, .lesson-time, .lesson-name { margin: 0; padding: 0; border: 0; background: transparent; line-height: 1.35; }
.lesson-number { font-size: 14px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lesson-time { font-size: 14px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lesson-name { font-size: 17px; font-weight: 550; overflow-wrap: anywhere; }
.lesson-actions { padding: 0 12px 10px 48px; }
.schedule-lesson[open] { outline: 1px solid var(--border); }
.schedule-lesson[open] summary { background: var(--primary-soft); }
.schedule-empty { padding: 16px; background: var(--surface-soft); color: var(--text-muted); border-radius: 10px; }
#homework:has(> .trash-heading) > hr { display: none; }
#homework:has(> .trash-heading) > h3 { margin: 20px 0 6px; font-size: 18px; }
#homework:has(> .trash-heading) > p { margin: 4px 0 12px; padding: 0; border: 0; background: transparent; color: var(--text-muted); font-size: 15px; }
#homework:has(> .trash-heading) .homework-card { box-shadow: none; padding: 14px 18px; }
.calendar-day { background: var(--surface); border-color: var(--border); border-radius: 8px; }
.calendar-day.today { border: 2px solid var(--primary); background: var(--primary-soft); }
#calendar-events p { background: var(--surface-soft); }
.homework-dot, .task-dot { background: var(--primary); }
.exam-dot { background: var(--amber); }
.holiday-dot { background: var(--text-muted); }
.calendar-header button { font-size: 14px; }
@media (hover: hover) and (pointer: fine) {
    button:hover, #sidebar nav button:hover, .schedule-lesson summary:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--text); }
    #homework button[onclick^="save"]:hover, #homework button[onclick^="openAdd"]:hover { background: #245cc6; color: white; }
}
@media (max-width: 1100px) and (min-width: 801px) {
    .dashboard-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
    #sidebar { width: 240px; box-shadow: 12px 0 28px #00000014; }
    #main-content, .sidebar-collapsed #main-content { margin-left: 0; width: 100%; padding: 16px 16px 28px; }
    body { font-size: 16px; }
    #homework h2, #homework:has(.dashboard-grid) > h2 { font-size: 26px; }
    #homework h3 { font-size: 18px; }
    .dashboard-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .homework-card, .dashboard-card, #welcome { padding: 16px; }
    .dashboard-card p, .dashboard-card-content { font-size: 14px; }
    .schedule-lesson summary { grid-template-columns: 18px 100px minmax(0,1fr); min-height: 52px; gap: 8px; padding: 8px 10px; }
    .lesson-name { font-size: 16px; }
    .lesson-time { font-size: 14px; }
    #homework .calendar-header button { flex-basis: auto; font-size: 13px; }
    .calendar-header h3 { font-size: 16px !important; }
    .calendar-weekdays div { font-size: 11px; padding: 4px 0; }
    .calendar-day { min-height: 62px; padding: 4px 2px; }
    .calendar-event { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 800px) {
    #main-content { transition: none; }
}
/* Owner feedback: readable text, defined groups and consistent controls. */
:root {
    --text: #142033; --text-muted: #43546b; --border: #b9c8db;
    --divider: #dce4ee;
    --teal: #22924b; --success-text: #166534; --success-soft: #edf9f0;
    --warning-text: #805200; --warning-soft: #fff5d9;
    --info-border: #7aa5ee; --success-border: #65b67d;
    --warning-border: #d3a33f; --danger-border: #df7777;
    --success-action: #218c49; --success-action-hover: #19753c;
    --danger-action: #d14343; --danger-action-hover: #b93636;
}
:root[data-theme="dark"] {
    --text: #f3f6fc; --text-muted: #c0cede; --border: #465973;
    --divider: #304156;
    --teal: #55c982; --success-text: #87e4a7; --success-soft: #193528;
    --warning-text: #f6d079; --warning-soft: #3b301c;
    --info-border: #4778ca; --success-border: #39865a;
    --warning-border: #8d6b2e; --danger-border: #9d4d54;
    --success-action: #287d49; --success-action-hover: #32945a;
    --danger-action: #a83e47; --danger-action-hover: #bd4a54;
}
body { font-size: 18px; font-weight: 500; }
#homework h3 { font-weight: 650; }
.dashboard-card p, .dashboard-card-content, .schedule-subtitle, #welcome p { font-size: 16px; }
#sidebar nav button { color: var(--text); font-weight: 600; }
#current-date-time { font-size: 19px; font-weight: 600; color: var(--text); margin: 4px 0 20px; }
.dashboard-card, .dashboard-card:has(#dashboard-exam), .homework-card:has(button[onclick^="editExam"]), .homework-card.completed { border: 1px solid var(--border); }
.homework-card > h3:not(:first-child) { border-top: 1px solid var(--divider); padding-top: 14px; margin-top: 18px; }
.homework-card > p + p, .dashboard-card-content > p + p { border-top: 1px solid var(--divider); padding-top: 10px; }
.exam-card > p { padding: 7px 0; margin: 0; border: 0; background: transparent; }
.exam-card > p + p { border-top: 1px solid var(--divider); }
.grade-result, .grade-subject-total { border: 1px solid var(--divider); border-radius: 9px; padding: 12px; margin-top: 10px; }
.homework-card > button, .lesson-actions { margin-top: 10px; }
button, #sidebar #sidebar-toggle, #homework .dashboard-toggle, #homework .day-button {
    min-height: 42px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 600;
}
#homework .dashboard-toggle { padding: 6px 10px !important; background: var(--primary-soft); color: var(--primary); }
#sidebar #sidebar-toggle { background: var(--primary-soft); color: var(--primary); }
#homework button[onclick^="edit"], #homework button[onclick^="openExamResult"] { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
#homework button[onclick^="openHolidayForm"] { background: var(--solid); color: white; border-color: var(--solid); }
#homework button[onclick^="delete"], #homework button[onclick^="clear"], #homework button[onclick^="remove"], .delete-button { background: var(--danger-soft); border: 1px solid var(--danger); color: var(--danger-text); font-weight: 650; }
#homework .day-button[aria-pressed="true"] { background: var(--solid); color: white; border-color: var(--solid); font-weight: 700; }
#homework .add-button { width: 44px; height: 44px; padding: 0; font-size: 28px; line-height: 1; }
#homework .calendar-header button { font-size: 23px; min-width: 44px; padding: 4px 12px; }
.holiday-dot { background: var(--teal); }
.appearance-bar { flex-wrap: wrap; }
#sync-visibility-toggle { margin: 0 0 0 auto; }
#theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 10px; color: var(--primary); background: var(--primary-soft); }
#theme-toggle svg { width: 22px; height: 22px; }
#sync-panel[hidden] { display: none; }
#sidebar { transition: transform 280ms cubic-bezier(.2,.7,.2,1), opacity 260ms ease; }
#sidebar nav { opacity: 1; transition: opacity 240ms ease; }
.sidebar-collapsed #sidebar nav { opacity: 0; }
#main-content { transition-duration: 280ms; }
#homework .status-success { color: var(--success-text); background: var(--success-soft); }
#homework .status-info { color: var(--primary); background: var(--primary-soft); }
#homework .status-warning { color: var(--warning-text); background: var(--warning-soft); }
#homework .status-danger { color: var(--danger-text); background: var(--danger-soft); }
#homework :is(.status-success,.status-info,.status-warning,.status-danger) { padding: 8px 10px; border-radius: 8px; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
    #homework button[onclick^="edit"]:hover, #homework .day-button:hover, #homework .dashboard-toggle:hover { background: var(--primary-soft); border-color: var(--primary); }
    #homework .day-button[aria-pressed="true"]:hover { background: #245cc6; color: white; }
}
@media (max-width: 800px) {
    body { font-size: 17px; }
    .dashboard-card p, .dashboard-card-content { font-size: 16px; }
    #current-date-time { font-size: 18px; }
    #main-content { transition: none; }
}

/* Home acceptance: hierarchy and quiet internal grouping, scoped to the dashboard. */
#current-date-time { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 20px; }
.clock-time { font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--text); }
.clock-date { font-size: 16px; font-weight: 600; color: var(--text-muted); }
#home-dashboard .dashboard-card-header h3 { font-size: 20px; font-weight: 650; line-height: 1.35; }
#home-dashboard .dashboard-card-content, #home-dashboard .dashboard-card-content p { font-size: 17px; color: var(--text); }
#home-dashboard .dashboard-card-content .home-secondary { font-size: 15px; color: var(--text-muted); }
#home-dashboard .dashboard-card-content > p + p { border-top: 0; padding-top: 0; }
#home-dashboard hr { border: 0; border-top: 1px solid var(--divider); margin: 16px 0; }
#home-dashboard .dashboard-toggle { height: 42px !important; padding: 8px 12px !important; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); color: var(--text); font-size: 15px; font-weight: 600; flex-shrink: 0; }
#home-dashboard .dashboard-card-content :is(.status-success,.status-info,.status-warning,.status-danger) { display: table; font-size: 15px; padding: 5px 9px; border-radius: 7px; }
#home-dashboard .dashboard-card-content .status-success { color: var(--success-text); }
#home-dashboard .dashboard-card-content .status-info { color: var(--primary); }
#home-dashboard .dashboard-card-content .status-warning { color: var(--warning-text); }
#home-dashboard .dashboard-card-content .status-danger { color: var(--danger-text); }
/* All study-item creation controls share the existing primary palette. */
#homework button.add-button { width: auto; height: 44px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--solid); border-radius: 10px; font-size: 15px; line-height: 1.4; font-weight: 600; background: var(--solid); color: white; }
@media (hover: hover) and (pointer: fine) {
    #home-dashboard .dashboard-toggle:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--text); }
    #homework button.add-button:hover { background: #245cc6; border-color: #245cc6; color: white; }
}
@media (max-width: 800px) {
    .clock-time { font-size: 26px; }
}
.clock-separator { display: none; }

/* Desktop/tablet density follows the accepted phone design; phones stay untouched. */
@media (min-width: 601px) {
    body { font-size: 17px; }
    #homework h3 { font-size: 18px; }
    #home-dashboard .dashboard-card-header h3 { font-size: 20px; }
    .homework-card, .dashboard-card, #welcome { padding: 16px; }
    .dashboard-grid { gap: 12px; align-items: start; }
}
@media (min-width: 601px) and (max-width: 1100px) {
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 801px) {
    #main-content { padding: 20px 24px 32px; }
}

/* UI-001 controls: shared geometry and semantic button variants. */
button {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
#sidebar #sidebar-toggle, #menu-open, #sync-visibility-toggle, #theme-toggle,
#homework .day-button, #homework .calendar-header button {
    border-radius: 10px;
}
#sidebar #sidebar-toggle, #menu-open { min-height: 44px; padding: 8px 16px; font-size: 15px; }
#homework .day-button { min-height: 44px; padding: 8px 14px; font-size: 15px; }
#homework button[onclick^="edit"], #homework button[onclick^="openExamResult"] {
    background: var(--primary-soft); color: var(--primary); border-color: var(--primary);
}
#homework button[onclick^="delete"], #homework button[onclick^="clear"],
#homework button[onclick^="remove"], #homework .schedule-delete, .delete-button {
    background: var(--danger-action); color: white; border-color: var(--danger-action); font-weight: 600;
}
#homework .complete-button {
    background: var(--success-action); color: white; border-color: var(--success-action); font-weight: 600;
}

/* One line-style chevron for every expand/collapse control. */
.expand-control, #homework .dashboard-toggle {
    width: 36px !important;
    min-width: 36px;
    height: 36px !important;
    min-height: 36px;
    padding: 0 !important;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
}
.expand-control::before, details > summary::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(225deg);
    transition: transform 180ms ease;
}
.expand-control.collapsed::before { transform: rotate(45deg); }
#sync-visibility-toggle { margin-left: auto; }
details > summary { position: relative; }
details > summary::after {
    float: right;
    margin: 6px 3px 0 14px;
    color: var(--text-muted);
}
details:not([open]) > summary::after { transform: rotate(45deg); }
#sync-panel summary::after, #sync-panel[open] summary::after { content: ''; }
.schedule-lesson summary { grid-template-columns: 24px 112px minmax(0, 1fr) 16px; }
@media (max-width: 800px) {
    .schedule-lesson summary { grid-template-columns: 18px 100px minmax(0, 1fr) 16px; }
}
@media (hover: hover) and (pointer: fine) {
    button:hover, .expand-control:hover, details > summary:hover {
        border-color: var(--primary);
        background: var(--primary-soft);
        color: var(--text);
    }
    #homework button.add-button:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: white; }
    #homework button[onclick^="delete"]:hover, #homework button[onclick^="clear"]:hover,
    #homework button[onclick^="remove"]:hover, #homework .schedule-delete:hover, .delete-button:hover {
        background: var(--danger-action-hover); color: white; border-color: var(--danger-action-hover);
    }
    #homework .complete-button:hover {
        background: var(--success-action-hover); color: white; border-color: var(--success-action-hover);
    }
}

/* One badge geometry and semantic exam accents across views. */
#homework .status-badge,
#home-dashboard .dashboard-card-content .status-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}
#homework .status-info { border-color: var(--info-border); }
#homework .status-warning { border-color: var(--warning-border); }
#homework .status-success { border-color: var(--success-border); }
#homework .status-danger { border-color: var(--danger-border); }

/* UI-001 reference: monochrome application chrome; calendar colors stay semantic. */
:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-soft: #f2f3f5;
    --text: #111318;
    --text-muted: #596273;
    --border: #d9dde3;
    --divider: #e7e9ed;
    --primary: #202327;
    --primary-hover: #090b0d;
    --primary-soft: #eceef1;
    --solid: #202327;
    --control-surface: #f5f6f7;
    --control-hover: #e9ebee;
    --status-strong: #202327;
    --status-soft: #7d8590;
    --shadow: 0 1px 2px #11131808, 0 8px 24px #1113180a;
    --calendar-blue: #2f6feb;
    --calendar-amber: #d99a32;
    --calendar-green: #22924b;
    --calendar-red: #d94b4b;
    --nav-width: 260px;
}
:root[data-theme="dark"] {
    --bg: #0d1117;
    --surface: #171c24;
    --surface-soft: #222831;
    --text: #f4f6f8;
    --text-muted: #aeb5bf;
    --border: #39424e;
    --divider: #2c3440;
    --primary: #f0f2f5;
    --primary-hover: #ffffff;
    --primary-soft: #282f39;
    --solid: #090c10;
    --control-surface: #232a34;
    --control-hover: #303844;
    --status-strong: #f1f3f5;
    --status-soft: #8d96a2;
    --shadow: 0 1px 2px #0003, 0 10px 28px #0002;
}
body { background: var(--bg); color: var(--text); }
#sidebar {
    padding: 28px 16px 22px;
    background: var(--surface);
    border-right: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
}
#logo { margin-bottom: 34px; }
#logo h1 { color: var(--text); font-size: 28px; font-weight: 750; letter-spacing: -.8px; }
#logo p { color: var(--text-muted); font-size: 14px; }
#sidebar nav { gap: 8px; }
#sidebar nav button {
    min-height: 52px;
    padding: 12px 16px;
    border-radius: 11px;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 550;
}
#sidebar nav button[aria-current="page"] {
    background: var(--primary-soft);
    color: var(--text);
    box-shadow: none;
    font-weight: 650;
}
#theme-toggle {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 9px;
    color: var(--text);
    background: var(--control-surface);
    border-color: var(--border);
}
#main-content { padding: 34px clamp(28px, 4vw, 64px) 48px; }
#homework, .appearance-bar, #sync-panel { max-width: 1180px; }
.appearance-bar { min-height: 48px; margin-bottom: 12px; flex-wrap: nowrap; }
.header-account { display: flex; align-items: center; gap: 12px; margin-left: auto; color: var(--text); }
.brand-mark, .nav-icon, .section-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: currentColor; }
.brand-mark { width: 38px; height: 38px; }
.nav-icon, .section-icon { width: 22px; height: 22px; }
.brand-mark svg, .nav-icon svg, .section-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#logo { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; column-gap: 10px; }
#logo h1, #logo p { margin: 0; }
#logo p { grid-column: 2; }
#sidebar nav button { display: flex; align-items: center; gap: 14px; }
.page-heading { display: flex; align-items: center; gap: 12px; }
.page-heading .section-icon { width: 30px; height: 30px; }
#sync-status { color: var(--text-muted); font-size: 14px; white-space: nowrap; }
#header-email { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.account-avatar { position: relative; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; background: var(--primary-soft); border: 1px solid var(--border); }
.account-avatar::before { content: ''; position: absolute; left: 50%; top: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--text-muted); transform: translateX(-50%); }
.account-avatar::after { content: ''; position: absolute; left: 50%; bottom: 7px; width: 22px; height: 11px; border-radius: 12px 12px 8px 8px; background: var(--text-muted); transform: translateX(-50%); }
#sync-visibility-toggle { margin: 0; background: transparent; border-color: transparent; }
#sync-panel { margin-bottom: 18px; padding: 12px 16px; background: var(--surface); border-color: var(--divider); box-shadow: var(--shadow); }
#sync-panel summary { color: var(--text); font-weight: 650; }
#current-date-time { margin: 4px 0 20px; }
#homework h2, #homework:has(.dashboard-grid) > h2 { color: var(--text); font-size: 34px; font-weight: 750; letter-spacing: -.7px; }
#homework h3 { color: var(--text); font-size: 22px; font-weight: 700; }
.homework-card, .dashboard-card, #welcome, .grade-subject, .schedule-day {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: var(--shadow);
}
.dashboard-card, .dashboard-card:has(#dashboard-exam), .homework-card:has(button[onclick^="editExam"]), .homework-card.completed,
.exam-card, .exam-card.exam-info, .exam-card.exam-warning, .exam-card.exam-success, .exam-card.exam-danger {
    border: 1px solid var(--border);
}
button {
    min-height: 44px;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--control-surface);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
#homework button.button--primary, button.button--primary,
#homework button.button--strong, button.button--strong {
    background: var(--solid); border-color: var(--solid); color: white;
}
#homework button.button--secondary, button.button--secondary,
#homework button.button--success, button.button--success,
#homework button.button--danger, button.button--danger {
    background: var(--control-surface); border-color: var(--border); color: var(--text);
}
#homework button.add-button,
#homework button[onclick^="save"],
#homework .schedule-add,
#homework .exam-card > button[onclick^="openExamResult"],
#sync-auth button[type="submit"], #sync-now {
    background: var(--solid);
    border-color: var(--solid);
    color: white;
}
#homework button[onclick^="edit"], #homework button[onclick^="openExamResult"],
#homework button[onclick^="delete"], #homework button[onclick^="clear"], #homework button[onclick^="remove"],
#homework .schedule-delete, #homework .delete-button, #homework .complete-button,
#homework .exam-card > button.delete-button, #homework .exam-card > button.complete-button {
    background: var(--control-surface);
    border-color: var(--border);
    color: var(--text);
}
#homework .day-button[aria-pressed="true"], .semester-tabs button[aria-pressed="true"] {
    background: var(--solid);
    border-color: var(--solid);
    color: white;
}
.status-badge, #homework .status-badge, #home-dashboard .dashboard-card-content .status-badge {
    position: relative;
    min-height: 40px;
    padding: 8px 14px 8px 20px;
    overflow: hidden;
    border: 1px solid var(--divider);
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--text);
    font-size: 15px;
    font-weight: 650;
}
.status-badge::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--status-soft); }
.status-badge.status-warning::before, .status-badge.status-danger::before { background: var(--status-strong); }
#homework .status-badge.status-warning, #homework .status-badge.status-danger { font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
    button:hover, #homework button[onclick^="edit"]:hover, #homework button[onclick^="delete"]:hover,
    #homework button[onclick^="clear"]:hover, #homework button[onclick^="remove"]:hover,
    #homework .complete-button:hover, #homework .schedule-delete:hover {
        background: var(--control-hover); border-color: #aeb4bd; color: var(--text);
    }
    #homework button.add-button:hover, #homework button[onclick^="save"]:hover,
    #homework .exam-card > button[onclick^="openExamResult"]:hover {
        background: var(--primary-hover); border-color: var(--primary-hover); color: white;
    }
    #homework button.button--primary:hover, button.button--primary:hover,
    #homework button.button--strong:hover, button.button--strong:hover {
        background: var(--primary-hover); border-color: var(--primary-hover); color: white;
    }
    #homework button.button--secondary:hover, button.button--secondary:hover,
    #homework button.button--success:hover, button.button--success:hover {
        background: var(--control-hover); border-color: #aeb4bd; color: var(--text);
    }
    #homework button.button--danger:hover, button.button--danger:hover {
        background: color-mix(in srgb, #b84a4a 10%, var(--control-surface));
        border-color: color-mix(in srgb, #b84a4a 48%, var(--border));
        color: color-mix(in srgb, #b84a4a 78%, var(--text));
    }
}
/* Calendar event colors intentionally remain semantic. */
.homework-dot, .task-dot { background: var(--calendar-blue); }
.exam-dot { background: var(--calendar-amber); }
.holiday-dot { background: var(--calendar-green); }
.calendar-day.today { border-color: var(--calendar-blue); background: color-mix(in srgb, var(--calendar-blue) 10%, var(--surface)); }
@media (max-width: 800px) {
    #main-content { padding: 16px 16px 30px; }
    .appearance-bar { align-items: flex-start; gap: 6px; }
    .header-account { min-width: 0; gap: 5px; }
    #menu-open { padding-inline: 10px; }
    #theme-toggle { width: 38px; height: 38px; min-height: 38px; padding: 8px; }
    #sync-status { display: none; }
    #header-email { min-width: 0; max-width: clamp(48px, 17vw, 112px); font-size: 13px; }
    .account-avatar { width: 38px; height: 38px; flex-basis: 38px; }
    #homework h2, #homework:has(.dashboard-grid) > h2 { font-size: 28px; }
    .page-heading .section-icon { width: 26px; height: 26px; }
    #homework h3 { font-size: 20px; }
    .homework-card, .dashboard-card, #welcome { padding: 18px; }
}
