@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
    color-scheme: light;
    font-family: "DM Sans", "Segoe UI", sans-serif;
    color: #20243b;
    background: #f5f6fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    --accent: #6558d3;
    --accent-dark: #5144bf;
    --muted: #85899e;
}

.tool-dialog-content {
    display: grid;
    gap: 14px;
}

.calculator-content {
    max-width: 440px;
    margin: 0 auto;
}

#calculator-input {
    width: 100%;
    min-height: 64px;
    padding: 12px 16px;
    border: 1px solid #e5e5ef;
    border-radius: 12px;
    background: #f7f7fc;
    color: #282a45;
    font: 700 1.6rem/1.2 "Manrope", "Segoe UI", sans-serif;
    text-align: right;
}

#calculator-status,
#weekend-todos-status {
    min-height: 1.2em;
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.calculator-keys {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.calculator-keys button {
    min-height: 52px;
    border: 1px solid #e6e6f0;
    background: #f7f7fc;
    color: #42445f;
    font-size: 1.05rem;
}

.calculator-keys button:hover {
    background: #eeecff;
    color: var(--accent-dark);
}

.calculator-keys .calculator-equals {
    background: var(--accent);
    color: #fff;
}

#weekend-todo-form {
    display: flex;
    gap: 8px;
}

#weekend-todo-input {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #e5e5ef;
    border-radius: 10px;
    background: #fbfbfd;
    color: #282a45;
    font: 400 0.9rem "DM Sans", "Segoe UI", sans-serif;
}

#weekend-todo-form button {
    flex: 0 0 auto;
}

#weekend-todos-list {
    display: grid;
    gap: 8px;
    max-height: min(52vh, 520px);
    overflow-y: auto;
}

.weekend-todo-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e8e9f1;
    border-radius: 10px;
    background: #fbfbfe;
}

.weekend-todo-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.weekend-todo-item label {
    color: #42445f;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.weekend-todo-item label.is-complete {
    color: #85889c;
    text-decoration: line-through;
}

.weekend-todo-item .remove-item {
    width: 30px;
    min-height: 30px;
}

.weekend-todos-empty {
    margin: 0;
    padding: 16px;
    border: 1px dashed #dcddea;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.88rem;
    text-align: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

* {
    box-sizing: border-box;
}

body {
    display: grid;
    width: min(1100px, calc(100% - 48px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin: 0 auto;
    padding: 66px 0 80px;
}

#auth-panel {
    grid-column: 1 / -1;
    width: min(460px, 100%);
    min-height: 0;
    margin: 8vh auto 0;
}

#auth-panel h2 {
    margin: 0 0 12px;
    color: #282a45;
    font: 700 1.25rem "Manrope", "Segoe UI", sans-serif;
}

#auth-panel > p,
.auth-warning {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

#server-access-form,
#account-form {
    display: grid;
    gap: 10px;
}

#server-access-form[hidden],
#account-panel[hidden],
#app-content[hidden] {
    display: none;
}

#server-access-form label,
#account-form label {
    margin-top: 7px;
    color: #55596f;
    font-size: 0.88rem;
    font-weight: 600;
}

#server-access-token,
#account-username,
#account-password {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #e5e5ef;
    border-radius: 10px;
    background: #fbfbfd;
    color: #282a45;
    font: 400 0.92rem "DM Sans", "Segoe UI", sans-serif;
}

#server-access-form button,
#account-submit {
    margin-top: 8px;
}

.text-button {
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-dark);
    font-size: 0.86rem;
}

.text-button:hover {
    background: transparent;
    box-shadow: none;
    text-decoration: underline;
    transform: none;
}

.auth-warning {
    margin: 16px 0 0;
    font-size: 0.78rem;
}

#app-content:not([hidden]) {
    display: contents;
}

#dashboard-grid {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
}

.dashboard-toolbar {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr));
    align-items: end;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(226, 227, 239, 0.85);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(39, 42, 83, 0.035);
}

.dashboard-toolbar label {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: #777b91;
    font-size: 0.73rem;
    font-weight: 600;
}

.dashboard-toolbar input,
.dashboard-toolbar select,
.task-fields input,
.task-fields select,
.task-reminder-fields input[type="datetime-local"],
.task-detail-fields input,
.task-priority {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #e5e5ef;
    border-radius: 9px;
    background: #fbfbfd;
    color: #42445f;
    font: 400 0.84rem "DM Sans", "Segoe UI", sans-serif;
}

.dashboard-toolbar #global-search {
    min-height: 42px;
    padding: 0 13px;
    font-size: 0.9rem;
}

#search-status {
    grid-column: 1 / -1;
    min-height: 0;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.page-header {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
}

.page-title h1 {
    margin: 0;
    color: #242640;
    font: 800 clamp(2.2rem, 5vw, 3.15rem)/1.1 "Manrope", "Segoe UI", sans-serif;
    letter-spacing: -0.07em;
}

.page-title h1::after {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    content: "Lock in bro";
    font: 400 1rem/1.5 "DM Sans", "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.header-side {
    display: grid;
    grid-template-columns: auto auto;
    align-items: start;
    column-gap: 10px;
    justify-items: end;
    gap: 10px;
}

.tools-menu,
.header-menu {
    width: 140px;
}

.tools-menu {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 3;
}

.header-menu {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 3;
}

.header-dropdown summary {
    display: flex;
    width: fit-content;
    min-height: 40px;
    align-items: center;
    margin-left: auto;
    gap: 10px;
    padding: 0 15px;
    border: 1px solid #dedcf5;
    border-radius: 10px;
    background: #fff;
    color: var(--accent-dark);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    list-style: none;
    transition: background 150ms ease, box-shadow 150ms ease;
}

.header-dropdown summary::-webkit-details-marker {
    display: none;
}

.header-dropdown summary:hover,
.header-dropdown[open] summary {
    background: #f5f3ff;
}

.header-dropdown summary:focus-visible {
    outline: 3px solid rgba(101, 88, 211, 0.25);
    outline-offset: 2px;
}

.menu-chevron {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 150ms ease;
}

.header-dropdown[open] .menu-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.header-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(260px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid rgba(226, 227, 239, 0.95);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(39, 42, 83, 0.16);
}

.tools-menu-panel {
    right: auto;
    left: 0;
}

.menu-account {
    display: grid;
    gap: 3px;
    padding: 10px 11px 12px;
}

.menu-account span {
    color: var(--muted);
    font-size: 0.72rem;
}

.menu-account strong {
    overflow: hidden;
    color: #282a45;
    font-size: 0.9rem;
    text-overflow: ellipsis;
}

.menu-actions {
    display: grid;
    gap: 2px;
}

.menu-actions button {
    min-height: 38px;
    padding: 0 11px;
    border-radius: 8px;
    background: transparent;
    color: #42445f;
    font-size: 0.84rem;
    text-align: left;
    transition: background 120ms ease, color 120ms ease;
}

.menu-actions button:hover {
    background: #f5f3ff;
    box-shadow: none;
    color: var(--accent-dark);
    transform: none;
}

.menu-actions #logout-button {
    color: #9c6262;
}

.menu-actions #logout-button:hover {
    background: #fff4f4;
    color: #8b3e3e;
}

.menu-actions #logout-button[hidden] {
    display: none;
}

.header-menu-panel hr {
    height: 1px;
    margin: 6px 4px;
    border: 0;
    background: #eeeef5;
}

.datetime-card {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 24px;
    padding: 17px 22px;
    border: 1px solid rgba(226, 227, 239, 0.8);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff 0%, #f2f0ff 100%);
    box-shadow: 0 12px 32px rgba(39, 42, 83, 0.06);
}

.date-display,
.clock-display {
    display: grid;
    gap: 5px;
}

.clock-display {
    min-width: 92px;
    padding-left: 22px;
    border-left: 1px solid #dedced;
}

.datetime-label {
    color: #898ba1;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

#date-display {
    color: #42445f;
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
}

#clock-display {
    color: var(--accent-dark);
    font: 700 1.55rem/1 "Manrope", "Segoe UI", sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.015em;
}

.access-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.access-form[hidden] {
    display: none;
}

.access-form label {
    color: var(--muted);
    font-size: 0.82rem;
}

.access-form input {
    width: min(220px, 45vw);
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid #e5e5ef;
    border-radius: 9px;
    background: #fff;
    color: #282a45;
}

.access-form button {
    min-height: 36px;
    padding: 0 13px;
    font-size: 0.82rem;
}



#backup-status {
    grid-column: 1 / -1;
    min-height: 1em;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: right;
}

.main-div {
    min-width: 0;
    min-height: 275px;
    padding: 26px;
    border: 1px solid rgba(226, 227, 239, 0.85);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(39, 42, 83, 0.045);
}

.daily-counter {
    grid-column: 1 / -1;
    min-height: 0;
    border-color: #dcebe4;
    background: linear-gradient(145deg, #fff 0%, #f4fbf7 100%);
}

.daily-counter.is-celebrating {
    animation: counter-card-glow 850ms ease-out;
}

@keyframes counter-card-glow {
    35% {
        border-color: #70bd91;
        box-shadow: 0 0 0 5px rgba(80, 164, 112, 0.15), 0 12px 32px rgba(39, 42, 83, 0.045);
    }
}

.daily-counter h3 {
    margin-bottom: 14px;
}

.counter-free-since {
    margin: 0;
    color: #697a70;
    font-size: 0.86rem;
}

.counter-free-since time {
    color: #357a59;
    font-weight: 700;
}

.counter-total {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin: 16px 0 8px;
}

.counter-total strong {
    color: #357a59;
    font: 800 2.6rem/1 "Manrope", "Segoe UI", sans-serif;
    letter-spacing: -0.05em;
}

.counter-total strong.is-celebrating {
    animation: counter-count-pop 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes counter-count-pop {
    45% {
        color: #49a96e;
        transform: translateY(-8px) scale(1.22);
    }
}

.counter-total span {
    color: #697a70;
    font-size: 0.9rem;
}

.counter-record {
    margin: 0 0 10px;
    color: #697a70;
    font-size: 0.86rem;
}

.counter-record strong {
    color: #357a59;
    font-weight: 700;
}

.counter-status {
    min-height: 1.25em;
    margin: 0 0 14px;
    color: #697a70;
    font-size: 0.8rem;
}

.counter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.counter-actions #counter-add {
    background: #39835e;
}

.counter-actions #counter-add:hover:not(:disabled) {
    background: #2f704f;
}

.counter-actions #counter-add.is-celebrating {
    animation: counter-button-pop 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes counter-button-pop {
    35% {
        background: #52a875;
        box-shadow: 0 0 0 6px rgba(80, 164, 112, 0.2), 0 6px 16px rgba(47, 112, 79, 0.24);
        transform: translateY(-3px) scale(1.04);
    }
}

.counter-actions #counter-reset {
    min-height: 38px;
    padding: 0 12px;
}

#class-tracker-div {
    grid-column: 1 / -1;
}

.class-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 18px;
}

.class-form label,
.class-assignment-form label {
    display: grid;
    min-width: 0;
    gap: 5px;
    color: #666a80;
    font-size: 0.78rem;
    font-weight: 600;
}

.class-form input,
.class-assignment-form input,
.class-assignment-form textarea {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #e5e5ef;
    border-radius: 9px;
    background: #fbfbfd;
    color: #282a45;
    font: 400 0.84rem "DM Sans", "Segoe UI", sans-serif;
}

.class-form button {
    min-height: 38px;
}

#classes-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 14px;
}

.class-tracker-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 10px 0 2px;
    color: #989bad;
    font-size: 0.86rem;
    line-height: 1.5;
}

.class-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid #e8e9f1;
    border-radius: 14px;
    background: #fbfbfe;
}

.class-card[hidden],
.class-assignment[hidden] {
    display: none;
}

.class-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 11px;
    border-bottom: 1px solid #e8e9f1;
}

.class-card-heading h4 {
    min-width: 0;
    margin: 0;
    color: #343750;
    font: 700 1rem "Manrope", "Segoe UI", sans-serif;
    overflow-wrap: anywhere;
}

.class-card-heading .remove-item {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.72rem;
}

.class-assignment-list {
    display: grid;
    gap: 7px;
    margin: 10px 0 14px;
}

.class-assignment {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    padding: 10px;
    border: 1px solid #edebf3;
    border-radius: 10px;
    background: #fff;
}

.class-assignment > input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: #39835e;
}

.class-assignment-content {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.class-assignment-content strong {
    color: #41445e;
    font-size: 0.84rem;
    overflow-wrap: anywhere;
}

.class-assignment-content strong.is-complete {
    color: #999eaa;
    text-decoration: line-through;
}

.class-assignment-content time,
.class-assignment-no-due-date {
    color: #777b91;
    font-size: 0.72rem;
}

.class-assignment-content p {
    margin: 2px 0 0;
    color: #777b91;
    font-size: 0.77rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.class-assignment-actions {
    display: flex;
    gap: 4px;
}

.class-assignment-actions button {
    min-height: 28px;
    padding: 0 7px;
    font-size: 0.7rem;
}

.class-assignment-form {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(130px, 0.8fr);
    gap: 9px;
    padding-top: 13px;
    border-top: 1px solid #e8e9f1;
}

.class-assignment-form textarea {
    min-height: 56px;
    resize: vertical;
}

.class-assignment-form .class-assignment-details,
.class-assignment-form-actions {
    grid-column: 1 / -1;
}

.class-assignment-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.class-assignment-form-actions button {
    min-height: 33px;
    padding: 0 10px;
    font-size: 0.76rem;
}

.class-assignment-form-actions .class-assignment-cancel {
    border: 1px solid #e5e5ef;
    background: #fff;
    color: #666a80;
}

#notes-div {
    min-height: 360px;
    grid-column: 1 / -1;
}

#journal-div {
    grid-column: 1 / -1;
}

#journal-form {
    display: grid;
    gap: 12px;
}

.journal-entry-date,
#journal-status {
    margin: -10px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

#journal-text {
    display: block;
    width: 100%;
    min-height: 220px;
    padding: 16px;
    border: 1px solid #e5e5ef;
    border-radius: 12px;
    background: #fbfbfd;
    color: #42445f;
    font: 400 0.98rem/1.7 "DM Sans", "Segoe UI", sans-serif;
    resize: vertical;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

#journal-text:focus {
    border-color: #b9b3ee;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(101, 88, 211, 0.08);
    outline: none;
}

.journal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

#journal-status {
    margin: 0;
}

#journal-today {
    border: 1px solid #e5e5ef;
    background: #fff;
    color: #666a80;
}

#statistics-section {
    grid-column: 1 / -1;
}

.main-div h3 {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 0 23px;
    color: #282a45;
    font: 700 1.12rem/1.4 "Manrope", "Segoe UI", sans-serif;
    letter-spacing: -0.025em;
}

#tasks-div h3::before,
#class-tracker-div h3::before,
#reminders-div h3::before,
#habits-div h3::before,
#goals-div h3::before,
#notes-div h3::before,
#journal-div h3::before {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: #f0efff;
    color: var(--accent);
    font: 600 0.85rem/1 "DM Sans", "Segoe UI", sans-serif;
    letter-spacing: 0;
}

#tasks-div h3::before {
    content: attr(data-section-number);
}

#class-tracker-div h3::before {
    background: #e9f7f2;
    color: #389675;
    content: attr(data-section-number);
}

#reminders-div h3::before {
    background: #fff3e7;
    color: #d28a41;
    content: attr(data-section-number);
}

#habits-div h3::before {
    background: #e9f7f2;
    color: #389675;
    content: attr(data-section-number);
}

#notes-div h3::before {
    background: #fff3e7;
    color: #d28a41;
    content: attr(data-section-number);
}

#journal-div h3::before {
    background: #f5edff;
    color: #8a5dc1;
    content: attr(data-section-number);
}

#goals-div h3::before {
    background: #e9f2ff;
    color: #4d80c4;
    content: attr(data-section-number);
}

#calendar-div h3::before,
#upcoming-events-div h3::before {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: #eaf3ff;
    color: #4d80c4;
    font: 600 0.85rem/1 "DM Sans", "Segoe UI", sans-serif;
    letter-spacing: 0;
}

#calendar-div h3::before {
    content: attr(data-section-number);
}

#upcoming-events-div h3::before {
    background: #f5edff;
    color: #8a5dc1;
    content: attr(data-section-number);
}

.calendar-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.calendar-heading h3 {
    margin: 0;
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 7px;
}

.calendar-navigation strong {
    min-width: 112px;
    color: #383b57;
    text-align: center;
    font-size: 0.9rem;
}

.calendar-navigation button {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 0.82rem;
}

#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #e9eaf2;
    border-radius: 12px;
}

.calendar-weekday {
    padding: 9px 2px;
    background: #f7f7fb;
    color: #85899e;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.calendar-day {
    display: flex;
    min-width: 0;
    min-height: 88px;
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    border-top: 1px solid #e9eaf2;
    border-right: 1px solid #e9eaf2;
    background: #fff;
}

.calendar-day:nth-child(7n) {
    border-right: 0;
}

.calendar-day.is-other-month {
    background: #fafafd;
}

.calendar-day.is-other-month .calendar-day-number {
    color: #b0b2c0;
}

.calendar-day.is-today {
    background: #f3f1ff;
}

.calendar-day-number {
    align-self: flex-start;
    min-height: 24px;
    width: 24px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: #54586f;
    font-size: 0.75rem;
}

.calendar-day.is-today .calendar-day-number {
    background: var(--accent);
    color: #fff;
}

.calendar-day-number:hover {
    background: #e9e7ff;
    color: var(--accent-dark);
    box-shadow: none;
}

.calendar-event {
    overflow: hidden;
    min-height: 20px;
    padding: 2px 4px;
    border-radius: 5px;
    background: #eeeaff;
    color: #5144bf;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.65rem;
    line-height: 1.3;
}

.calendar-event.event-test,
.upcoming-event.event-test {
    --event-color: #bf5962;
    --event-tint: #fff0f0;
}

.calendar-event.event-assignment,
.upcoming-event.event-assignment {
    --event-color: #4d80c4;
    --event-tint: #eaf3ff;
}

.calendar-event.event-project,
.upcoming-event.event-project {
    --event-color: #389675;
    --event-tint: #e9f7f2;
}

.calendar-event.event-event,
.upcoming-event.event-event {
    --event-color: #9a6abf;
    --event-tint: #f5edff;
}

.calendar-event[class*="event-"] {
    background: var(--event-tint, #eeeaff);
    color: var(--event-color, #5144bf);
}

.calendar-more {
    color: #777b91;
    font-size: 0.63rem;
}

.event-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
    padding-top: 19px;
    border-top: 1px solid #ececf3;
}

.event-form h4 {
    grid-column: 1 / -1;
    margin: 0;
    color: #383b57;
    font: 700 0.94rem "Manrope", "Segoe UI", sans-serif;
}

.event-form > label {
    display: grid;
    min-width: 0;
    gap: 6px;
    color: #666a80;
    font-size: 0.78rem;
    font-weight: 600;
}

.event-form input,
.event-form select,
.event-form textarea {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #e5e5ef;
    border-radius: 9px;
    background: #fbfbfd;
    color: #282a45;
    font: 400 0.84rem "DM Sans", "Segoe UI", sans-serif;
}

.event-form textarea {
    resize: vertical;
}

.event-form .event-description,
.event-form-actions {
    grid-column: 1 / -1;
}

.event-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.event-form-actions button {
    min-height: 36px;
    font-size: 0.82rem;
}

.event-form-actions #event-cancel {
    border: 1px solid #e5e5ef;
    background: #fff;
    color: #666a80;
}

#upcoming-events-container {
    display: grid;
    gap: 10px;
}

.calendar-empty {
    margin: 0;
    padding: 10px 0;
    color: #989bad;
    font-size: 0.84rem;
    line-height: 1.5;
}

.upcoming-event {
    display: grid;
    grid-template-columns: minmax(92px, auto) minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 13px;
    border: 1px solid #e9eaf2;
    border-left: 3px solid var(--event-color, #6558d3);
    border-radius: 11px;
    background: var(--event-tint, #fbfaff);
}

.upcoming-event > time {
    color: #686c82;
    font-size: 0.75rem;
    line-height: 1.5;
}

.upcoming-event-content {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.upcoming-event-content strong {
    overflow-wrap: anywhere;
    color: #383b57;
    font-size: 0.86rem;
}

.event-type {
    color: var(--event-color, #6558d3);
    font-size: 0.7rem;
    font-weight: 700;
}

.upcoming-event-content p {
    margin: 3px 0 0;
    color: #777b91;
    font-size: 0.77rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.upcoming-event-actions {
    display: flex;
    gap: 5px;
}

.upcoming-event-actions button {
    min-height: 30px;
    padding: 0 8px;
    font-size: 0.72rem;
}

#tasks-container,
#reminders-container,
#habits-container,
#goals-container {
    margin-bottom: 20px;
}

#tasks-container:empty::before,
#habits-form:empty::before,
#goals-container:empty::before {
    display: block;
    padding: 12px 0 4px;
    color: #a0a3b2;
    content: "Nothing here yet — add your first one.";
    font-size: 0.9rem;
}

#habits-form:empty::before {
    grid-column: 1 / -1;
}

#goals-container:empty::before {
    content: "Set a goal and track your progress.";
}

#reminders-container:empty::before {
    display: block;
    padding: 12px 0 4px;
    color: #a0a3b2;
    content: "No reminders yet. Set one on a task to see it here.";
    font-size: 0.9rem;
}

.reminder-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f1f6;
}

.reminder-item[hidden] {
    display: none;
}

.reminder-content {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.reminder-content strong {
    overflow-wrap: anywhere;
    color: #42445f;
    font-size: 0.9rem;
}

.reminder-content time,
.reminder-state {
    color: #777b91;
    font-size: 0.77rem;
}

.reminder-state.is-sent {
    color: #477a5a;
}

.reminder-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
}

.reminder-actions > button:not(.remove-item) {
    min-height: 32px;
    padding: 0 10px;
    background: #f0efff;
    color: var(--accent-dark);
    font-size: 0.76rem;
}

.reminder-actions > button:not(.remove-item):hover {
    background: #e6e3ff;
    box-shadow: none;
    transform: none;
}

#reminder-alerts {
    position: fixed;
    z-index: 20;
    right: 20px;
    bottom: 20px;
    display: grid;
    width: min(360px, calc(100vw - 32px));
    gap: 10px;
}

.reminder-alert {
    padding: 16px;
    border: 1px solid #dedcf5;
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(39, 42, 83, 0.2);
}

.reminder-alert strong {
    color: #282a45;
    font: 700 0.92rem "Manrope", "Segoe UI", sans-serif;
}

.reminder-alert p {
    margin: 6px 0 12px;
    color: #55596f;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
}

.reminder-alert button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.78rem;
}

.task-reminder-fields {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
    gap: 8px;
    margin: 9px 0;
}

.task-reminder-fields .reminder-enable {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.task-reminder-fields input[type="checkbox"] {
    width: 17px;
    min-height: 17px;
    margin: 0;
    accent-color: var(--accent);
}

.task-reminder-fields input[type="datetime-local"] {
    min-width: 0;
}

.task-reminder-fields input:disabled {
    opacity: 0.55;
}

.goal-item {
    display: grid;
    grid-template-columns: minmax(70px, 0.8fr) minmax(60px, 1.3fr) 42px auto 56px;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f1f6;
}

.habit-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0 10px;
}

.habit-item .remove-item {
    width: 28px;
    min-height: 28px;
    padding: 0;
    border-color: transparent;
    border-radius: 50%;
    color: #9b9eb0;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1;
}

.habit-item .remove-item:hover {
    border-color: transparent;
    background: #f7eeee;
    color: #9c6262;
}

.remove-item {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #e8dede;
    background: transparent;
    color: #9c6262;
    font-size: 0.78rem;
}

.remove-item:hover {
    border-color: #e6c5c5;
    background: #fff4f4;
    box-shadow: none;
    color: #8b3e3e;
    transform: none;
}

.goal-name {
    overflow-wrap: anywhere;
    color: #55596f;
    font-size: 0.94rem;
}

.goal-item input[type="range"] {
    width: 100%;
    margin: 0;
    accent-color: #5486d3;
    cursor: pointer;
}

.goal-percentage {
    color: #4d73b4;
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.task-item {
    position: relative;
    display: flex;
    max-height: 220px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 10px 4px;
    overflow: hidden;
    border-bottom: 1px solid #f1f1f6;
    color: #55596f;
    transition: max-height 280ms ease, opacity 220ms ease, transform 220ms ease,
        padding 280ms ease, border-color 220ms ease, color 150ms ease, background 150ms ease;
}

.task-item.is-deleting {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
    opacity: 0;
    pointer-events: none;
    transform: translateX(12px);
}

.task-content {
    min-width: 0;
    flex: 1;
}

.task-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-name {
    min-width: 0;
    min-height: 34px;
    padding: 4px 0;
    overflow-wrap: anywhere;
    background: transparent;
    color: #55596f;
    font-size: 0.94rem;
    font-weight: 500;
    text-align: left;
    transition: color 150ms ease, text-decoration-color 150ms ease;
}

.task-name:hover {
    background: transparent;
    box-shadow: none;
    color: var(--accent-dark);
    text-decoration: line-through;
    transform: none;
}

.task-priority {
    width: auto;
    min-height: 29px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.task-item[data-priority="high"] .task-priority {
    border-color: #f0cccc;
    background: #fff2f2;
    color: #a44444;
}

.task-item[data-priority="low"] .task-priority {
    border-color: #d9e8df;
    background: #f0f8f3;
    color: #477a5a;
}

.task-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.task-tag {
    padding: 3px 8px;
    border-radius: 999px;
    background: #f0efff;
    color: #6558a8;
    font-size: 0.68rem;
    line-height: 1.3;
}

.category-tag {
    background: #eef3fa;
    color: #55769e;
}

.task-details {
    margin-top: 4px;
}

.task-details summary {
    width: fit-content;
    color: #898ba1;
    cursor: pointer;
    font-size: 0.7rem;
}

.task-detail-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.task-detail-fields label,
.task-fields label,
.task-reminder-fields > label:not(.reminder-enable) {
    display: grid;
    min-width: 0;
    gap: 4px;
    color: #777b91;
    font-size: 0.72rem;
    font-weight: 600;
}

.item-reorder {
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
}

.move-item {
    width: 27px;
    min-height: 28px;
    padding: 0;
    border-radius: 7px;
    background: transparent;
    color: #85899e;
    font-size: 0.9rem;
}

.move-item:hover:not(:disabled) {
    background: #f0efff;
    box-shadow: none;
    color: var(--accent-dark);
    transform: none;
}

.move-item:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

#tasks-container[data-filtered="true"]:empty::before {
    content: "No tasks match these search and filter settings.";
}

.task-fields {
    display: grid;
    grid-template-columns: 0.8fr 1fr 1fr;
    gap: 8px;
    margin: 9px 0;
}

#habits-form {
    display: grid;
    gap: 0;
}

#habits-form input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #46a785;
    cursor: pointer;
}

#habits-form label {
    position: relative;
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f6;
    color: #55596f;
    cursor: pointer;
    font-size: 0.94rem;
    transition: color 220ms ease, opacity 220ms ease, transform 220ms ease;
}

#habits-form label::after {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 1px;
    background: #46a785;
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 260ms ease;
}

#habits-form label.is-complete {
    color: #999eaa;
    opacity: 0.72;
    transform: translateX(3px);
}

#habits-form label.is-complete::after {
    transform: scaleX(1);
}

#habits-form input[type="checkbox"]:checked {
    animation: habit-check 220ms ease-out;
}

@keyframes habit-check {
    50% {
        transform: scale(1.18);
    }
    100% {
        transform: scale(1);
    }
}

button {
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font: 600 0.9rem "DM Sans", "Segoe UI", sans-serif;
    transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

button:hover {
    background: var(--accent-dark);
    box-shadow: 0 5px 12px rgba(101, 88, 211, 0.2);
    transform: translateY(-1px);
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

button:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(101, 88, 211, 0.25);
    outline-offset: 2px;
}

#add-task-container,
#add-habit-container,
#add-goal-container {
    display: none;
    gap: 8px;
}

#add-task-container[style*="display: block"],
#add-habit-container[style*="display: block"],
#add-goal-container[style*="display: block"] {
    display: flex !important;
}

#add-task-container[style*="display: block"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

#add-task-container > * {
    min-width: 0;
}

#add-task-container > #add-task {
    justify-self: start;
}

#add-task-input,
#add-habit-input,
#add-goal-input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #e5e5ef;
    border-radius: 10px;
    background: #fbfbfd;
    color: #282a45;
    font: 400 0.9rem "DM Sans", "Segoe UI", sans-serif;
}

#add-task-input::placeholder,
#add-habit-input::placeholder,
#add-goal-input::placeholder {
    color: #a0a3b2;
}

#notes-input {
    display: block;
    width: 100%;
    min-height: 270px;
    padding: 16px;
    border: 1px solid #e5e5ef;
    border-radius: 12px;
    background: #fbfbfd;
    color: #42445f;
    font: 400 0.98rem/1.7 "DM Sans", "Segoe UI", sans-serif;
    resize: vertical;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

#notes-input::placeholder {
    color: #a0a3b2;
}

#notes-input:focus {
    border-color: #b9b3ee;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(101, 88, 211, 0.08);
    outline: none;
}

#statistics-toggle {
    min-width: 160px;
}

#statistics-toggle::before {
    display: inline-grid;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    place-items: center;
    border-radius: 9px;
    background: #f0efff;
    color: var(--accent);
    content: attr(data-section-number);
    font-size: 0.78rem;
    font-weight: 700;
    vertical-align: middle;
}

#statistics-panel {
    margin-top: 16px;
    padding: 24px;
    border: 1px solid rgba(226, 227, 239, 0.85);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(39, 42, 83, 0.045);
}

#statistics-panel[hidden] {
    display: none;
}

#statistics-panel h3 {
    margin: 0 0 18px;
    color: #282a45;
    font: 700 1.05rem "Manrope", "Segoe UI", sans-serif;
}

#statistics-panel dl {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

#statistics-panel dl > div {
    padding: 15px;
    border-radius: 12px;
    background: #f7f7fc;
}

#statistics-panel dt {
    color: var(--muted);
    font-size: 0.82rem;
}

#statistics-panel dd {
    margin: 6px 0 0;
    color: var(--accent-dark);
    font: 700 1.5rem/1.2 "Manrope", "Segoe UI", sans-serif;
    font-variant-numeric: tabular-nums;
}

#dashboard-dialog {
    width: min(440px, calc(100% - 32px));
    max-width: none;
    max-height: min(80vh, 620px);
    padding: 24px;
    border: 1px solid rgba(226, 227, 239, 0.95);
    border-radius: 18px;
    background: #fff;
    color: #20243b;
    box-shadow: 0 24px 70px rgba(25, 27, 55, 0.22);
}

#past-journal-dialog {
    width: min(1040px, calc(100% - 32px));
    max-width: none;
    max-height: min(90vh, 900px);
    padding: 24px;
    overflow-y: auto;
    border: 1px solid rgba(226, 227, 239, 0.95);
    border-radius: 18px;
    background: #fff;
    color: #20243b;
    box-shadow: 0 24px 70px rgba(25, 27, 55, 0.22);
}

#assistant-dialog {
    width: min(960px, calc(100% - 32px));
    max-width: none;
    max-height: min(92vh, 1000px);
    padding: 24px;
    overflow-y: auto;
    border: 1px solid rgba(226, 227, 239, 0.95);
    border-radius: 18px;
    background: #fff;
    color: #20243b;
    box-shadow: 0 24px 70px rgba(25, 27, 55, 0.22);
}

#calculator-dialog,
#weekend-todos-dialog {
    width: min(480px, calc(100% - 32px));
    max-width: none;
    max-height: min(90vh, 820px);
    padding: 24px;
    overflow-y: auto;
    border: 1px solid rgba(226, 227, 239, 0.95);
    border-radius: 18px;
    background: #fff;
    color: #20243b;
    box-shadow: 0 24px 70px rgba(25, 27, 55, 0.22);
}

#weekend-todos-dialog {
    width: min(620px, calc(100% - 32px));
}

.past-journal-content {
    display: grid;
    gap: 16px;
}

.assistant-dialog-content {
    display: grid;
    gap: 14px;
}

.assistant-setup {
    display: flex;
    align-items: end;
    gap: 10px;
}

.assistant-setup label {
    display: grid;
    flex: 1;
    min-width: 0;
    gap: 6px;
    color: #666a80;
    font-size: 0.78rem;
    font-weight: 600;
}

#assistant-model {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid #e5e5ef;
    border-radius: 9px;
    background: #fbfbfd;
    color: #42445f;
    font: 400 0.84rem "DM Sans", "Segoe UI", sans-serif;
}

#assistant-refresh {
    min-height: 38px;
}

#assistant-status {
    min-height: 1.2em;
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

#assistant-chat-log {
    display: flex;
    flex-direction: column;
    max-height: min(60vh, 640px);
    min-height: 260px;
    gap: 10px;
    padding: 12px;
    overflow-y: auto;
    border: 1px solid #e8e9f1;
    border-radius: 12px;
    background: #f7f7fc;
}

.assistant-message {
    width: fit-content;
    max-width: min(90%, 560px);
    flex: 0 0 auto;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(39, 42, 83, 0.05);
}

.assistant-message-user {
    align-self: flex-end;
    background: #f0efff;
}

.assistant-typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    margin-top: auto;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(39, 42, 83, 0.05);
}

.assistant-typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #777a91;
    animation: assistant-typing-bounce 0.9s ease-in-out infinite;
}

.assistant-typing-indicator span:nth-child(1) {
    animation-delay: 0.3s;
}

.assistant-typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

@keyframes assistant-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

.assistant-message strong {
    color: #55596f;
    font-size: 0.72rem;
}

.assistant-message p {
    margin: 5px 0 0;
    color: #42445f;
    font-size: 0.88rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#assistant-form {
    display: grid;
    gap: 9px;
}

#assistant-input {
    width: 100%;
    min-height: 82px;
    padding: 12px;
    border: 1px solid #e5e5ef;
    border-radius: 10px;
    background: #fbfbfd;
    color: #282a45;
    font: 400 0.9rem/1.5 "DM Sans", "Segoe UI", sans-serif;
    resize: vertical;
}

.assistant-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.assistant-actions #assistant-clear {
    border: 1px solid #e5e5ef;
    background: #fff;
    color: #666a80;
}

.assistant-actions span {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.72rem;
}

#past-journal-list {
    display: grid;
    gap: 10px;
}

.past-journal-entry {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid #e8e9f1;
    border-radius: 12px;
    background: #fbfbfe;
}

.past-journal-entry > div {
    flex: 1;
    min-width: 0;
}

.past-journal-entry time {
    color: #42445f;
    font-size: 0.86rem;
    font-weight: 700;
}

.past-journal-entry p {
    margin: 6px 0 0;
    color: #777b91;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.past-journal-entry button {
    min-height: 34px;
}

.past-journal-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

#dashboard-dialog::backdrop {
    background: rgba(30, 32, 54, 0.42);
    backdrop-filter: blur(3px);
}

#past-journal-dialog::backdrop {
    background: rgba(30, 32, 54, 0.42);
    backdrop-filter: blur(3px);
}

#assistant-dialog::backdrop {
    background: rgba(30, 32, 54, 0.42);
    backdrop-filter: blur(3px);
}

#calculator-dialog::backdrop,
#weekend-todos-dialog::backdrop {
    background: rgba(30, 32, 54, 0.42);
    backdrop-filter: blur(3px);
}

.dashboard-dialog-content {
    display: grid;
    gap: 16px;
}

.dashboard-dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.dashboard-dialog-heading h2 {
    margin: 0;
    color: #282a45;
    font: 700 1.12rem "Manrope", "Segoe UI", sans-serif;
}

.dashboard-dialog-heading p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.dialog-close {
    display: grid;
    width: 34px;
    min-height: 34px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid #e5e5ef;
    border-radius: 50%;
    background: #f3f3f8;
    color: #666a80;
    font-size: 1.2rem;
    line-height: 1;
}

.dialog-close:hover {
    background: #e9e8f3;
    border-color: #d5d3e5;
    box-shadow: none;
    transform: none;
}

.dialog-close:focus-visible {
    outline: 3px solid rgba(111, 97, 220, 0.35);
    outline-offset: 2px;
}

#dashboard-settings-list {
    display: grid;
}

.dashboard-setting-row {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #eeeef5;
}

.dashboard-setting-row > label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #42445f;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
}

.dashboard-setting-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--accent);
}

.dialog-done {
    justify-self: end;
    min-height: 38px;
}

#settings-dialog {
    width: min(560px, calc(100% - 32px));
    max-width: none;
    max-height: min(88vh, 760px);
    padding: 26px;
    overflow-y: auto;
    border: 1px solid rgba(226, 227, 239, 0.95);
    border-radius: 20px;
    background: #fff;
    color: #20243b;
    box-shadow: 0 24px 70px rgba(25, 27, 55, 0.22);
}

#settings-dialog::backdrop {
    background: rgba(30, 32, 54, 0.45);
    backdrop-filter: blur(3px);
}

.settings-dialog-content {
    display: grid;
    gap: 18px;
}

#settings-status {
    min-height: 1em;
    margin: -8px 0 0;
    color: var(--accent-dark);
    font-size: 0.84rem;
}

.settings-section {
    display: grid;
    gap: 9px;
    padding-top: 16px;
    border-top: 1px solid #eeeef5;
}

.settings-section[hidden],
#local-account-settings[hidden] {
    display: none;
}

.settings-section h3 {
    margin: 0 0 2px;
    color: #282a45;
    font: 700 0.98rem "Manrope", "Segoe UI", sans-serif;
}

.settings-section > label,
.settings-section form label {
    color: #666a80;
    font-size: 0.8rem;
    font-weight: 600;
}

.settings-section select,
.settings-section input {
    width: 100%;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid #e5e5ef;
    border-radius: 9px;
    background: #fbfbfd;
    color: #282a45;
    font: 400 0.88rem "DM Sans", "Segoe UI", sans-serif;
}

.settings-section form {
    display: grid;
    gap: 8px;
}

.settings-section form button {
    justify-self: start;
    margin-top: 4px;
    min-height: 38px;
}

.danger-zone {
    padding: 16px;
    border: 1px solid #efdada;
    border-radius: 12px;
    background: #fffafa;
}

.danger-zone h3 {
    color: #963e3e;
}

.danger-zone > p {
    margin: 0;
    color: #805d5d;
    font-size: 0.82rem;
    line-height: 1.5;
}

.danger-zone .danger-button {
    background: #a94343;
}

.danger-zone .danger-button:hover {
    background: #8f3333;
    box-shadow: 0 5px 12px rgba(169, 67, 67, 0.18);
}

#local-account-settings {
    margin: 0;
    padding: 12px;
    border-radius: 10px;
    background: #f7f7fc;
    color: var(--muted);
    font-size: 0.84rem;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    background: #151722;
    color: #e7e8f1;
}

:root[data-theme="dark"] .page-title h1 {
    color: #f0efff;
}

:root[data-theme="dark"] #auth-panel h2 {
    color: #e8e8f2;
}

:root[data-theme="dark"] #auth-panel > p,
:root[data-theme="dark"] .auth-warning,
:root[data-theme="dark"] .menu-account span {
    color: #a3a6bb;
}

:root[data-theme="dark"] #server-access-form label,
:root[data-theme="dark"] #account-form label {
    color: #d0d1df;
}

:root[data-theme="dark"] #server-access-token,
:root[data-theme="dark"] #account-username,
:root[data-theme="dark"] #account-password {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] .text-button {
    color: #b8afff;
}

:root[data-theme="dark"] .datetime-card {
    border-color: #303347;
    background: linear-gradient(135deg, #202332 0%, #25233a 100%);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .clock-display {
    border-left-color: #414258;
}

:root[data-theme="dark"] .datetime-label,
:root[data-theme="dark"] #backup-status {
    color: #a3a6bb;
}

:root[data-theme="dark"] #date-display {
    color: #dfe0ed;
}

:root[data-theme="dark"] .main-div {
    border-color: #303347;
    background: #202332;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

:root[data-theme="dark"] .daily-counter {
    border-color: #345448;
    background: linear-gradient(145deg, #202c29 0%, #202332 100%);
}

:root[data-theme="dark"] .counter-free-since,
:root[data-theme="dark"] .counter-total span,
:root[data-theme="dark"] .counter-record,
:root[data-theme="dark"] .counter-status {
    color: #a6bdb0;
}

:root[data-theme="dark"] .counter-free-since time,
:root[data-theme="dark"] .counter-total strong,
:root[data-theme="dark"] .counter-record strong {
    color: #8bd6ad;
}

:root[data-theme="dark"] .class-card {
    border-color: #3b3e53;
    background: #1b1e2b;
}

:root[data-theme="dark"] .class-card-heading {
    border-bottom-color: #3b3e53;
}

:root[data-theme="dark"] .class-card-heading h4,
:root[data-theme="dark"] .class-assignment-content strong {
    color: #e0e1ed;
}

:root[data-theme="dark"] .class-form label,
:root[data-theme="dark"] .class-assignment-form label,
:root[data-theme="dark"] .class-assignment-content time,
:root[data-theme="dark"] .class-assignment-no-due-date,
:root[data-theme="dark"] .class-assignment-content p,
:root[data-theme="dark"] .class-tracker-empty {
    color: #a3a6bb;
}

:root[data-theme="dark"] .class-form input,
:root[data-theme="dark"] .class-assignment-form input,
:root[data-theme="dark"] .class-assignment-form textarea {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] .class-assignment {
    border-color: #343648;
    background: #202332;
}

:root[data-theme="dark"] .class-assignment-form {
    border-top-color: #3b3e53;
}

:root[data-theme="dark"] .class-assignment-form-actions .class-assignment-cancel {
    border-color: #3b3e53;
    background: #202332;
    color: #d0d1df;
}

:root[data-theme="dark"] .class-assignment-content strong.is-complete {
    color: #999db1;
}

:root[data-theme="dark"] .dashboard-toolbar {
    border-color: #303347;
    background: #202332;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .dashboard-toolbar label,
:root[data-theme="dark"] .task-detail-fields label,
:root[data-theme="dark"] .task-fields label,
:root[data-theme="dark"] .task-reminder-fields > label:not(.reminder-enable) {
    color: #a3a6bb;
}

:root[data-theme="dark"] .dashboard-toolbar input,
:root[data-theme="dark"] .dashboard-toolbar select,
:root[data-theme="dark"] .task-fields input,
:root[data-theme="dark"] .task-fields select,
:root[data-theme="dark"] .task-detail-fields input,
:root[data-theme="dark"] .task-priority {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] #search-status {
    color: #a3a6bb;
}

:root[data-theme="dark"] .main-div h3 {
    color: #e8e8f2;
}

:root[data-theme="dark"] #tasks-div h3::before {
    background: #302d50;
    color: #b8afff;
}

:root[data-theme="dark"] #class-tracker-div h3::before {
    background: #233c39;
    color: #8bd6b8;
}

:root[data-theme="dark"] #reminders-div h3::before {
    background: #49382c;
    color: #f0bd82;
}

:root[data-theme="dark"] #habits-div h3::before {
    background: #233c39;
    color: #8bd6b8;
}

:root[data-theme="dark"] #notes-div h3::before {
    background: #49382c;
    color: #f0bd82;
}

:root[data-theme="dark"] #journal-div h3::before {
    background: #302d50;
    color: #c5beff;
}

:root[data-theme="dark"] #goals-div h3::before {
    background: #26364d;
    color: #9cc5ff;
}

:root[data-theme="dark"] #calendar-div h3::before {
    background: #26364d;
    color: #9cc5ff;
}

:root[data-theme="dark"] #upcoming-events-div h3::before {
    background: #302d50;
    color: #c5beff;
}

:root[data-theme="dark"] #tasks-container:empty::before,
:root[data-theme="dark"] #reminders-container:empty::before,
:root[data-theme="dark"] #habits-form:empty::before,
:root[data-theme="dark"] #goals-container:empty::before {
    color: #a2a5b9;
}

:root[data-theme="dark"] .goal-item {
    border-bottom-color: #343648;
}

:root[data-theme="dark"] .goal-name {
    color: #d0d1df;
}

:root[data-theme="dark"] .goal-percentage {
    color: #a9c7ff;
}

:root[data-theme="dark"] .remove-item {
    border-color: #554044;
    color: #e1a4a4;
}

:root[data-theme="dark"] .remove-item:hover {
    border-color: #795154;
    background: #3b292e;
    color: #ffc1c1;
}

:root[data-theme="dark"] .habit-item .remove-item {
    border-color: transparent;
    color: #999db1;
}

:root[data-theme="dark"] .habit-item .remove-item:hover {
    border-color: transparent;
    background: #3b292e;
    color: #ffc1c1;
}

:root[data-theme="dark"] .task-item {
    border-bottom-color: #343648;
    color: #d0d1df;
}

:root[data-theme="dark"] .task-name {
    color: #d0d1df;
}

:root[data-theme="dark"] .task-name:hover {
    background: #2a2940;
    color: #c5beff;
}

:root[data-theme="dark"] .task-item[data-priority="high"] .task-priority {
    border-color: #70464b;
    background: #3b292e;
    color: #ffc1c1;
}

:root[data-theme="dark"] .task-item[data-priority="low"] .task-priority {
    border-color: #3e6253;
    background: #233c39;
    color: #8bd6b8;
}

:root[data-theme="dark"] .task-tag {
    background: #302d50;
    color: #c5beff;
}

:root[data-theme="dark"] #statistics-toggle::before {
    background: #302d50;
    color: #b8afff;
}

:root[data-theme="dark"] .category-tag {
    background: #26364d;
    color: #9cc5ff;
}

:root[data-theme="dark"] .task-details summary {
    color: #a3a6bb;
}

:root[data-theme="dark"] .reminder-help,
:root[data-theme="dark"] .reminder-content time,
:root[data-theme="dark"] .reminder-state {
    color: #a3a6bb;
}

:root[data-theme="dark"] .reminder-item {
    border-bottom-color: #343648;
}

:root[data-theme="dark"] .reminder-content strong {
    color: #d0d1df;
}

:root[data-theme="dark"] .reminder-state.is-sent {
    color: #8bd6b8;
}

:root[data-theme="dark"] .reminder-actions > button:not(.remove-item) {
    background: #302d50;
    color: #c5beff;
}

:root[data-theme="dark"] .reminder-actions > button:not(.remove-item):hover {
    background: #3b3764;
}

:root[data-theme="dark"] .reminder-alert {
    border-color: #45445f;
    border-left-color: #b8afff;
    background: #202332;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .reminder-alert strong {
    color: #e8e8f2;
}

:root[data-theme="dark"] .reminder-alert p {
    color: #d0d1df;
}

:root[data-theme="dark"] .move-item {
    color: #a3a6bb;
}

:root[data-theme="dark"] .move-item:hover:not(:disabled) {
    background: #302d50;
    color: #c5beff;
}

:root[data-theme="dark"] #habits-form label {
    border-bottom-color: #343648;
    color: #d0d1df;
}

:root[data-theme="dark"] #habits-form label.is-complete {
    color: #a0a4b4;
}

:root[data-theme="dark"] .header-dropdown summary {
    border-color: #45445f;
    background: #29283b;
    color: #d0caff;
}

:root[data-theme="dark"] .header-dropdown summary:hover,
:root[data-theme="dark"] .header-dropdown[open] summary {
    background: #35324c;
}

:root[data-theme="dark"] .header-menu-panel {
    border-color: #3b3e53;
    background: #202332;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .menu-account strong {
    color: #e8e8f2;
}

:root[data-theme="dark"] .menu-actions button {
    color: #d0d1df;
}

:root[data-theme="dark"] .menu-actions button:hover {
    background: #2a2940;
    color: #c5beff;
}

:root[data-theme="dark"] .menu-actions #logout-button {
    color: #e1a4a4;
}

:root[data-theme="dark"] .menu-actions #logout-button:hover {
    background: #3b292e;
    color: #ffc1c1;
}

:root[data-theme="dark"] .header-menu-panel hr {
    background: #3b3e53;
}

:root[data-theme="dark"] #add-task-input,
:root[data-theme="dark"] #add-habit-input,
:root[data-theme="dark"] #add-goal-input,
:root[data-theme="dark"] #access-token,
:root[data-theme="dark"] #notes-input {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] #journal-text {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] #journal-text::placeholder {
    color: #9296ac;
}

:root[data-theme="dark"] #journal-today {
    border-color: #3b3e53;
    background: #202332;
    color: #d0d1df;
}

:root[data-theme="dark"] .task-reminder-fields input[type="datetime-local"] {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] #add-task-input::placeholder,
:root[data-theme="dark"] #add-habit-input::placeholder,
:root[data-theme="dark"] #add-goal-input::placeholder,
:root[data-theme="dark"] #notes-input::placeholder {
    color: #9296ac;
}

:root[data-theme="dark"] #notes-input:focus {
    border-color: #8175df;
    background: #1c1f2e;
    box-shadow: 0 0 0 3px rgba(129, 117, 223, 0.16);
}

:root[data-theme="dark"] #journal-text:focus {
    border-color: #8175df;
    background: #1c1f2e;
    box-shadow: 0 0 0 3px rgba(129, 117, 223, 0.16);
}

:root[data-theme="dark"] #statistics-panel {
    border-color: #303347;
    background: #202332;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

:root[data-theme="dark"] #statistics-panel h3 {
    color: #e8e8f2;
}

:root[data-theme="dark"] #statistics-panel dl > div {
    background: #191c29;
}

:root[data-theme="dark"] #statistics-panel dd {
    color: #b8afff;
}

:root[data-theme="dark"] #dashboard-dialog {
    border-color: #3b3e53;
    background: #202332;
    color: #e7e8f1;
}

:root[data-theme="dark"] #past-journal-dialog {
    border-color: #3b3e53;
    background: #202332;
    color: #e7e8f1;
}

:root[data-theme="dark"] #assistant-dialog {
    border-color: #3b3e53;
    background: #202332;
    color: #e7e8f1;
}

:root[data-theme="dark"] #calculator-dialog,
:root[data-theme="dark"] #weekend-todos-dialog {
    border-color: #3b3e53;
    background: #202332;
    color: #e7e8f1;
}

:root[data-theme="dark"] #calculator-dialog::backdrop,
:root[data-theme="dark"] #weekend-todos-dialog::backdrop {
    background: rgba(5, 6, 12, 0.72);
}

:root[data-theme="dark"] #calculator-input,
:root[data-theme="dark"] #weekend-todo-input {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] .calculator-keys button {
    border-color: #3b3e53;
    background: #292c3d;
    color: #d0d1df;
}

:root[data-theme="dark"] .calculator-keys button:hover {
    background: #36324f;
    color: #d0caff;
}

:root[data-theme="dark"] .calculator-keys .calculator-equals {
    border-color: #7569cf;
    background: #6658c8;
    color: #fff;
}

:root[data-theme="dark"] .weekend-todo-item {
    border-color: #3b3e53;
    background: #191c29;
}

:root[data-theme="dark"] .weekend-todo-item label {
    color: #d0d1df;
}

:root[data-theme="dark"] .weekend-todo-item label.is-complete {
    color: #9296ac;
}

:root[data-theme="dark"] .weekend-todos-empty {
    border-color: #44485f;
    color: #a3a6bb;
}

:root[data-theme="dark"] #settings-dialog {
    border-color: #3b3e53;
    background: #202332;
    color: #e7e8f1;
}

:root[data-theme="dark"] .dialog-close {
    border-color: #44485f;
    background: #292c3d;
    color: #d5d6e2;
}

:root[data-theme="dark"] .dialog-close:hover {
    border-color: #666b89;
    background: #363a50;
    color: #fff;
}

:root[data-theme="dark"] .dialog-close:focus-visible {
    outline-color: rgba(167, 157, 255, 0.55);
}

:root[data-theme="dark"] #settings-dialog::backdrop {
    background: rgba(5, 6, 12, 0.72);
}

:root[data-theme="dark"] .dashboard-dialog-heading h2,
:root[data-theme="dark"] .settings-section h3 {
    color: #e8e8f2;
}

:root[data-theme="dark"] .settings-section {
    border-top-color: #3b3e53;
}

:root[data-theme="dark"] .settings-section > label,
:root[data-theme="dark"] .settings-section form label {
    color: #c1c3d1;
}

:root[data-theme="dark"] .settings-section select,
:root[data-theme="dark"] .settings-section input {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] .danger-zone {
    border-color: #70464b;
    background: #292027;
}

:root[data-theme="dark"] .danger-zone h3 {
    color: #ffc1c1;
}

:root[data-theme="dark"] .danger-zone > p {
    color: #d8aaaa;
}

:root[data-theme="dark"] #local-account-settings {
    background: #191c29;
    color: #a3a6bb;
}

:root[data-theme="dark"] #dashboard-dialog::backdrop {
    background: rgba(5, 6, 12, 0.72);
}

:root[data-theme="dark"] #past-journal-dialog::backdrop {
    background: rgba(5, 6, 12, 0.72);
}

:root[data-theme="dark"] #assistant-dialog::backdrop {
    background: rgba(5, 6, 12, 0.72);
}

:root[data-theme="dark"] .assistant-setup label,
:root[data-theme="dark"] .assistant-message strong {
    color: #c1c3d1;
}

:root[data-theme="dark"] #assistant-model,
:root[data-theme="dark"] #assistant-input {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] #assistant-chat-log {
    border-color: #3b3e53;
    background: #191c29;
}

:root[data-theme="dark"] .assistant-message {
    background: #25283a;
}

:root[data-theme="dark"] .assistant-message-user {
    background: #302d50;
}

:root[data-theme="dark"] .assistant-typing-indicator {
    background: #25283a;
}

:root[data-theme="dark"] .assistant-typing-indicator span {
    background: #b7b9ca;
}

:root[data-theme="dark"] .assistant-message p {
    color: #e3e4ee;
}

:root[data-theme="dark"] .assistant-actions #assistant-clear {
    border-color: #3b3e53;
    background: #202332;
    color: #d0d1df;
}

:root[data-theme="dark"] .past-journal-entry {
    border-color: #3b3e53;
    background: #191c29;
}

:root[data-theme="dark"] .past-journal-entry time {
    color: #e3e4ee;
}

:root[data-theme="dark"] .past-journal-entry p,
:root[data-theme="dark"] .past-journal-empty {
    color: #a3a6bb;
}

:root[data-theme="dark"] .dashboard-dialog-heading h2,
:root[data-theme="dark"] .dashboard-setting-row label {
    color: #e8e8f2;
}

:root[data-theme="dark"] .dashboard-dialog-heading p {
    color: #a3a6bb;
}

:root[data-theme="dark"] .dashboard-setting-row {
    border-bottom-color: #3b3e53;
}

:root[data-theme="dark"] .calendar-navigation strong,
:root[data-theme="dark"] .event-form h4,
:root[data-theme="dark"] .upcoming-event-content strong {
    color: #e8e8f2;
}

:root[data-theme="dark"] #calendar-grid,
:root[data-theme="dark"] .calendar-day {
    border-color: #3b3e53;
}

:root[data-theme="dark"] .calendar-weekday {
    background: #191c29;
    color: #a3a6bb;
}

:root[data-theme="dark"] .calendar-day {
    background: #202332;
}

:root[data-theme="dark"] .calendar-day.is-other-month {
    background: #1b1e2b;
}

:root[data-theme="dark"] .calendar-day.is-today {
    background: #2c2943;
}

:root[data-theme="dark"] .calendar-day-number {
    color: #d0d1df;
}

:root[data-theme="dark"] .calendar-day.is-other-month .calendar-day-number {
    color: #777b91;
}

:root[data-theme="dark"] .calendar-day-number:hover {
    background: #3b365a;
    color: #e4e0ff;
}

:root[data-theme="dark"] .calendar-event.event-assignment,
:root[data-theme="dark"] .upcoming-event.event-assignment {
    --event-tint: #202b3c;
    --event-color: #91b8eb;
}

:root[data-theme="dark"] .calendar-event.event-test,
:root[data-theme="dark"] .upcoming-event.event-test {
    --event-tint: #38272d;
    --event-color: #e9959b;
}

:root[data-theme="dark"] .calendar-event.event-project,
:root[data-theme="dark"] .upcoming-event.event-project {
    --event-tint: #20352f;
    --event-color: #83c9ad;
}

:root[data-theme="dark"] .calendar-event.event-event,
:root[data-theme="dark"] .upcoming-event.event-event {
    --event-tint: #30263d;
    --event-color: #c6a0e6;
}

:root[data-theme="dark"] .event-form {
    border-top-color: #3b3e53;
}

:root[data-theme="dark"] .event-form > label,
:root[data-theme="dark"] .upcoming-event > time,
:root[data-theme="dark"] .upcoming-event-content p,
:root[data-theme="dark"] .calendar-more,
:root[data-theme="dark"] .calendar-empty {
    color: #a3a6bb;
}

:root[data-theme="dark"] .event-form input,
:root[data-theme="dark"] .event-form select,
:root[data-theme="dark"] .event-form textarea {
    border-color: #3b3e53;
    background: #191c29;
    color: #e3e4ee;
}

:root[data-theme="dark"] .event-form-actions #event-cancel {
    border-color: #3b3e53;
    background: #202332;
    color: #d0d1df;
}

:root[data-theme="dark"] .upcoming-event {
    border-color: #3b3e53;
}

@media (min-width: 1200px) {
    #dashboard-grid {
        display: block;
        columns: 2;
        column-gap: 22px;
    }

    #dashboard-grid > .main-div {
        break-inside: avoid;
        margin: 0 0 22px;
    }

    #dashboard-grid > .dashboard-wide-spacer[hidden] {
        display: none;
    }

    #dashboard-grid > .dashboard-wide-spacer {
        display: block;
        height: 22px;
        column-span: all;
    }

    #class-tracker-div,
    #notes-div,
    #journal-div,
    #statistics-section {
        column-span: all;
        margin: 0;
    }
}

.dashboard-wide-spacer {
    display: none;
}

@media (max-width: 640px) {
    body {
        width: min(100% - 32px, 480px);
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding-top: 38px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        margin-bottom: 8px;
    }

    .header-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-items: stretch;
    }

    #dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

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

    .dashboard-toolbar .search-field,
    #search-status {
        grid-column: 1 / -1;
    }

    .tools-menu,
    .header-menu {
        width: 100%;
    }

    .tools-menu {
        grid-column: 1;
        grid-row: 1;
    }

    .header-menu {
        grid-column: 2;
        grid-row: 1;
    }

    .tools-menu summary,
    .header-menu summary {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .header-menu-panel {
        width: min(320px, calc(100vw - 32px));
    }

    .tools-menu-panel {
        right: auto;
        left: 0;
    }

    .datetime-card {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    #backup-status {
        grid-column: 1 / -1;
    }

    .datetime-card {
        justify-content: space-between;
    }

    .access-form {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    #backup-status {
        text-align: left;
    }

    .page-title h1 {
        font-size: 2.5rem;
    }

    .main-div {
        grid-column: 1;
        min-height: auto;
        padding: 22px;
    }

    .calendar-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .class-form {
        grid-template-columns: minmax(0, 1fr);
    }

    #classes-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .class-assignment-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .class-assignment-form .class-assignment-details,
    .class-assignment-form-actions {
        grid-column: 1;
    }

    .calendar-navigation {
        width: 100%;
        justify-content: space-between;
    }

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

    .calendar-event {
        padding: 2px;
        font-size: 0.58rem;
    }

    .upcoming-event {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px 10px;
    }

    .upcoming-event > time {
        grid-column: 1 / -1;
    }

    .upcoming-event-actions {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    #notes-div {
        min-height: 320px;
    }

    #notes-input {
        min-height: 230px;
    }

    #statistics-panel {
        padding: 18px;
    }

    #statistics-panel dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .goal-item {
        grid-template-columns: minmax(0, 1fr) 42px auto;
        gap: 6px;
    }

    .goal-name {
        grid-column: 1 / 3;
    }

    .goal-item input[type="range"] {
        grid-column: 1;
        grid-row: 2;
    }

    .goal-percentage {
        grid-column: 2;
        grid-row: 2;
    }

    .goal-item .remove-item {
        grid-column: 3;
        grid-row: 1;
    }

    .goal-item .item-reorder {
        grid-column: 3;
        grid-row: 2;
    }

    .reminder-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .reminder-actions {
        width: 100%;
        justify-content: flex-end;
    }

    #dashboard-dialog {
        width: min(100% - 24px, 440px);
        padding: 20px;
    }

    #past-journal-dialog {
        width: calc(100% - 24px);
        max-height: 92vh;
        padding: 20px;
    }

    #assistant-dialog {
        width: min(100% - 24px, 620px);
        max-height: 92vh;
        padding: 20px;
    }

    #calculator-dialog,
    #weekend-todos-dialog {
        width: calc(100% - 24px);
        max-height: 92vh;
        padding: 20px;
    }

    #assistant-chat-log {
        max-height: 48vh;
        min-height: 180px;
    }

    .assistant-setup {
        align-items: stretch;
        flex-direction: column;
    }

    .assistant-actions span {
        width: 100%;
        margin-left: 0;
    }

    #settings-dialog {
        width: min(100% - 24px, 560px);
        max-height: 92vh;
        padding: 20px;
    }

    .task-item {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .assistant-typing-indicator span {
        animation: none;
    }
}
