:root {
    color-scheme: light;
    --paper: #f5f4f6;
    --card: #fff;
    --ink: #24212a;
    --muted: #77737f;
    --line: #e8e5eb;
    --green: #45434e;
    --green-hover: #34323d;
    --mint: #ecebf0;
    --lime: #e5e3ea;
    --amber: #fff1d9;
    --rose: #f9e7e4;
    --blue: #e8effa;
    --shadow: 0 12px 36px rgba(23, 44, 37, .055);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
    text-transform: lowercase
}

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

button {
    cursor: pointer
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--green, #174b3a);
    outline-offset: 2px
}

a {
    color: inherit
}

.shell {
    max-width: 1440px;
    margin: auto;
    padding: 0 34px
}

.topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line)
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 15px;
    font-weight: 750;
    letter-spacing: -.04em
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 11px;
    background: var(--green);
    color: var(--lime);
    font-size: 19px;
    font-weight: 800
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px
}

.local-pill {
    display: flex;
    gap: 7px;
    align-items: center;
    color: #6b756e;
    font-size: 11px
}

.local-pill:before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #85b888
}

.quiet-button,
.backup-button {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 12px;
    background: #fff;
    font-size: 12px
}

.quiet-button:hover,
.backup-button:hover {
    border-color: #bbc8bd
}

.page {
    padding: 30px 0 60px
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 25px
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .1em
}

.welcome h1 {
    margin: 0;
    font-size: clamp(26px, 3.3vw, 39px);
    line-height: 1.08;
    letter-spacing: -.055em;
    font-weight: 680
}

.welcome p:last-child {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px
}

.quick-stats {
    display: flex;
    gap: 9px
}

.stat {
    min-width: 102px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .68)
}

.stat strong {
    display: block;
    font-size: 20px;
    letter-spacing: -.05em
}

.stat span {
    font-size: 10px;
    color: var(--muted)
}

.people {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 16px;
    scrollbar-width: none
}

.people::-webkit-scrollbar {
    display: none
}

.person {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: #66716a;
    font-size: 12px
}

.person:hover {
    background: #fff
}

.person.active {
    background: var(--green);
    border-color: var(--green);
    color: #fff
}

.avatar {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--mint);
    color: var(--green);
    font-size: 10px;
    font-weight: 750
}

.person.active .avatar {
    background: var(--lime)
}

.overview {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, .85fr);
    gap: 15px;
    margin-bottom: 26px
}

.progress-card,
.next-card,
.course-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow)
}

.progress-card {
    padding: 20px 22px
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px
}

.card-head h2,
.section-title {
    margin: 0;
    font-size: 14px;
    font-weight: 680;
    letter-spacing: -.02em
}

.small-muted {
    color: var(--muted);
    font-size: 11px
}

.progress-number {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 18px 0 12px
}

.progress-number strong {
    font-size: 31px;
    letter-spacing: -.06em;
    font-weight: 670
}

.progress-number span {
    color: var(--muted);
    font-size: 12px
}

.progress-track {
    height: 7px;
    overflow: hidden;
    border-radius: 8px;
    background: #eef0eb
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: 8px;
    background: var(--green);
    transition: width .25s
}

.status-breakdown {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 13px;
    color: var(--muted);
    font-size: 10px
}

.status-breakdown span:before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--dot, #9ba79e)
}

.next-card {
    padding: 19px 20px;
    background: #eef3e9
}

.next-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 11px
}

.next-title h2 {
    margin: 0;
    font-size: 13px
}

.next-title span {
    font-size: 10px;
    color: var(--muted)
}

.exam-list {
    display: grid;
    gap: 8px
}

.exam-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(23, 44, 37, .1)
}

.exam-name {
    min-width: 0
}

.exam-name strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 620
}

.exam-name span,
.exam-date {
    color: var(--muted);
    font-size: 10px
}

.exam-date {
    white-space: nowrap
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 15px
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px
}

.search {
    width: min(260px, 38vw);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    font-size: 12px
}

.filter-select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 30px 10px 12px;
    background: #fff;
    font-size: 12px
}

.backup-button {
    font-size: 11px
}

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

.course-card {
    padding: 16px 17px;
    box-shadow: none;
    transition: border-color .16s, transform .16s
}

.course-card:hover {
    border-color: #c9d4c8;
    transform: translateY(-1px)
}

.course-card.passed {
    background: #edf6ef;
    border-color: #d4e8d8
}

.course-card.passed .course-name {
    color: #245b3d
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8f9f6;
    color: #626e65;
    font-size: 10px
}

.passed .status-pill {
    border-color: #c9e2d0;
    background: #e0f0e3;
    color: #286342
}

.edit-button {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    margin-top: -5px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    color: #526459
}

.edit-button:hover {
    border-color: #9bb9a1;
    color: var(--green)
}

.edit-button svg {
    width: 15px;
    height: 15px
}

.read-only-tag {
    color: var(--muted);
    font-size: 10px
}

.edit-dialog {
    width: min(420px, calc(100% - 30px));
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 25px 80px rgba(13, 34, 24, .2)
}

.edit-dialog::backdrop {
    background: rgba(21, 43, 34, .4);
    backdrop-filter: blur(4px)
}

.edit-form {
    display: grid;
    gap: 13px;
    padding: 22px
}

.edit-form h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.04em
}

.edit-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 11px
}

.edit-form select,
.edit-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px;
    background: #fff;
    color: var(--ink);
    font-size: 13px
}

.edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px
}

.edit-actions button {
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    font-size: 12px
}

.edit-actions button[type=submit] {
    border-color: var(--green);
    background: var(--green);
    color: white
}

.gate-login {
    flex-wrap: wrap
}

.gate-login select {
    flex: 0 0 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff
}

.gate-login input {
    flex: 1;
    max-width: 220px;
    min-width: 0
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 4px;
    margin: 0 0 13px;
    border-radius: 11px;
    background: #e9ebe5
}

.auth-tab {
    border: 0;
    border-radius: 8px;
    padding: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 12px
}

.auth-tab.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 4px #152b2212
}

.auth-form,
.profile-claim {
    display: grid;
    gap: 8px
}

.auth-form label,
.profile-claim label {
    color: var(--muted);
    font-size: 11px
}

.auth-form input,
.auth-form select,
.profile-claim input,
.profile-claim select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff
}

.profile-claim {
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--line)
}

.profile-claim label span {
    color: #969f98
}

.auth-submit {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--green);
    color: #fff;
    font-size: 12px
}

.auth-submit:hover {
    background: var(--green-hover, var(--green))
}

.email-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.auth-secondary {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    background: #fff;
    font-size: 12px
}

.text-button {
    justify-self: start;
    border: 0;
    padding: 3px 0;
    background: transparent;
    color: var(--profile-accent, var(--green));
    font-size: 11px;
    text-decoration: underline;
    text-underline-offset: 3px
}

#recaptcha-container {
    display: flex;
    justify-content: center;
    overflow: hidden
}

.course-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px
}

.course-name {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 640;
    letter-spacing: -.025em
}

.year-tag {
    flex: none;
    color: #7e8981;
    font-size: 10px
}

.course-dates {
    display: flex;
    gap: 6px;
    align-items: center;
    min-height: 21px;
    margin: 8px 0 12px;
    color: var(--muted);
    font-size: 10px
}

.next-tag {
    padding: 3px 7px;
    border-radius: 99px;
    background: #eff3e8;
    color: #526751
}

.past-tag {
    padding: 3px 7px;
    border-radius: 99px;
    background: #f0f1ed;
    color: #78817a
}

.course-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px
}

.course-actions select,
.grade-input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 9px 9px;
    background: #fff;
    font-size: 11px
}

.course-actions select {
    cursor: pointer
}

.grade-input {
    padding: 8px 9px
}

.scheduled-date,
.grade-wrap {
    margin-top: 8px
}

.scheduled-date select {
    font-size: 10px;
    padding: 8px
}

.empty {
    grid-column: 1/-1;
    padding: 38px 20px;
    text-align: center;
    border: 1px dashed #cfd6ce;
    border-radius: 16px;
    color: var(--muted)
}

.empty strong {
    display: block;
    margin-bottom: 5px;
    color: var(--ink);
    font-size: 13px
}

.footer-note {
    margin: 17px 2px;
    color: var(--muted);
    font-size: 10px
}

.gate {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(21, 43, 34, .38);
    backdrop-filter: blur(5px)
}

.gate-card {
    width: min(390px, 100%);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 29px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: 0 25px 80px rgba(13, 34, 24, .19)
}

.gate-card .brand {
    margin-bottom: 28px
}

.gate-card h1 {
    margin: 0 0 7px;
    font-size: 26px;
    letter-spacing: -.05em
}

.gate-card p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 12px
}

.gate-form {
    display: flex;
    gap: 8px
}

.gate-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    background: #fff
}

.gate-form button {
    border: 0;
    border-radius: 10px;
    padding: 0 15px;
    background: var(--green);
    color: white;
    font-size: 12px
}

.gate-error {
    min-height: 18px;
    margin-top: 8px;
    color: #a1443b;
    font-size: 11px
}

.gate-disclaimer {
    padding-top: 13px;
    border-top: 1px solid var(--line);
    font-size: 10px !important
}

.hidden {
    display: none !important
}

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

.file-input {
    display: none
}

.overview {
    grid-template-columns: 1fr;
    margin-bottom: 18px
}

.view-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    gap: 5px;
    width: max-content;
    max-width: 100%;
    margin: 0 0 24px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(245, 245, 240, .92);
    backdrop-filter: blur(10px)
}

.view-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    background: transparent;
    color: var(--muted);
    font-size: 12px
}

.view-tab.active {
    background: var(--green);
    color: white
}

.tab-count {
    font-size: 10px;
    opacity: .72
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin: 0 0 15px
}

.section-kicker {
    margin: 0 0 4px;
    color: #8a948d;
    font-size: 9px;
    letter-spacing: .12em;
    text-transform: uppercase
}

.section-heading .section-title {
    font-size: 22px;
    letter-spacing: -.045em
}

.toolbar {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .5)
}

.course-sections {
    display: grid;
    gap: 14px
}

.course-section {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff
}

.group-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 13px 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fafbf8;
    text-align: left;
    font-size: 12px;
    font-weight: 650
}

.group-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #aeb8ae
}

.status-scheduled .group-indicator {
    background: #718fbd
}

.status-studying .group-indicator {
    background: #d19d3c
}

.status-try .group-indicator {
    background: #c57868
}

.status-partial .group-indicator {
    background: #5ea578
}

.status-passed .group-indicator {
    background: #4b9971
}

.status-later .group-indicator {
    background: #9ba39a
}

.group-count {
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 99px;
    background: #ecefe9;
    color: #66716a;
    font-size: 10px
}

.group-chevron {
    margin-left: auto;
    color: #8a948d;
    transition: transform .16s
}

.group-heading[aria-expanded="false"] .group-chevron {
    transform: rotate(-90deg)
}

.course-grid.collapsed {
    display: none
}

.course-section .course-grid {
    padding: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px
}

.course-section .course-card {
    border-radius: 12px;
    background: #fcfcfa
}

.course-section .course-card.passed,
.course-section .course-card.status-passed {
    background: #edf6ef;
    border-color: #d4e8d8
}

.course-section .course-card.status-partial {
    background: #e8f4ed;
    border-color: #c4e3d1
}

.course-section .course-card.status-partial .status-pill {
    border-color: #c4e3d1;
    background: #dcefe3;
    color: #286342
}

.course-section .course-card.status-scheduled {
    background: #f1f5fa;
    border-color: #dce5f0
}

.course-section .course-card.status-studying {
    background: #fffaf0;
    border-color: #f0e6ce
}

.course-section .course-card.status-try {
    background: #fff8f6;
    border-color: #f0e1dc
}

.course-section .course-card.status-later {
    background: #f7f7f4
}

.course-section .course-card .course-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 18px;
    margin: 5px 0 8px
}

.course-section .course-credits {
    margin-left: 0
}

.course-section .status-pill {
    padding: 5px 8px;
    background: rgba(255, 255, 255, .74)
}

.elective-tag {
    flex: none;
    padding: 3px 7px;
    border-radius: 99px;
    background: #edf3ed;
    color: #5b705f;
    font-size: 9px
}

.calendar-attendance {
    margin: 0 0 14px;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--profile-wash, #f7f7f8) 12%, var(--card))
}

.calendar-attendance-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px
}

.calendar-attendance-heading .section-kicker {
    margin-bottom: 2px
}

.calendar-attendance-heading h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: -.02em
}

.attendance-summaries {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px
}

.attendance-summaries .attendance-summary {
    width: 100%;
    max-width: none;
    margin: 0;
    background: var(--card)
}

.attendance-summary-meta {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 9px
}

.attendance-empty {
    margin: 0;
    padding: 8px 0;
    color: var(--muted);
    font-size: 11px
}

:root[data-theme="dark"] .calendar-attendance {
    border-color: var(--line);
    background: var(--card)
}

:root[data-theme="dark"] .attendance-summaries .attendance-summary {
    background: var(--card)
}

.calendar-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, .7fr);
    gap: 12px;
    align-items: start
}

.calendar-card,
.day-card,
.agenda-card {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 17px
}

.calendar-toolbar h3 {
    flex: 1;
    margin: 0;
    text-align: center;
    font-size: 16px;
    font-weight: 660;
    letter-spacing: -.03em;
    text-transform: capitalize
}

.calendar-nav,
.today-button {
    display: grid;
    place-items: center;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff
}

.calendar-nav {
    width: 34px;
    font-size: 17px
}

.today-button {
    padding: 0 10px;
    font-size: 10px
}

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

.calendar-weekdays {
    margin-bottom: 6px;
    text-align: center;
    color: #909991;
    font-size: 9px;
    text-transform: uppercase
}

.calendar-cell {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 64px;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 2px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #fafbf8;
    color: var(--ink)
}

button.calendar-cell:hover {
    border-color: #ccd7cc;
    background: #f2f6f0
}

.calendar-cell.selected {
    border-color: var(--green);
    background: #edf4ee
}

.calendar-cell.today .calendar-number {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--green);
    color: #fff
}

.calendar-cell.blank {
    background: transparent
}

.calendar-number {
    font-size: 11px
}

.calendar-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    min-height: 7px
}

.calendar-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--profile-accent, #78987e)
}

.calendar-dots .dot-ar,
.calendar-dots .dot-ari {
    background: #8599b1
}

.calendar-dots .dot-fc {
    background: #c08362
}

.calendar-dots .dot-i {
    background: #d1a942
}

.calendar-dots b {
    color: #818a82;
    font-size: 8px;
    font-weight: 500
}

.calendar-day-names {
    display: block;
    width: 100%;
    overflow: hidden;
    color: #68766c;
    font-size: 7px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap
}

.day-card .section-heading {
    align-items: center;
    margin-bottom: 12px
}

.day-card .section-heading h3 {
    margin: 0;
    font-size: 14px;
    text-transform: capitalize
}

.day-events,
.agenda-list {
    display: grid;
    gap: 7px
}

.general-notes {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid var(--line)
}

.general-notes-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px
}

.general-notes-heading h4 {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .07em;
    text-transform: uppercase
}

.general-notes-heading .note-save-status {
    min-height: 0;
    text-align: right
}

.general-notes textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: #fafbf8;
    color: var(--ink);
    font: inherit;
    font-size: 11px;
    line-height: 1.5;
    text-transform: none
}

.general-notes textarea:focus {
    border-color: #bfcfc2;
    box-shadow: 0 0 0 2px rgba(76, 128, 88, .08)
}

.general-notes textarea::placeholder {
    color: #9ba39d
}

.general-notes textarea[readonly] {
    cursor: default
}

.agenda-event {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #edf0eb;
    border-radius: 10px;
    background: #fcfcfa
}

.agenda-event.event-planned {
    border-color: #d8e4f1;
    background: #f2f6fb
}

.agenda-event.event-passed {
    opacity: .68
}

.event-day {
    flex: none;
    min-width: 40px;
    color: #68736b;
    font-size: 10px;
    font-variant-numeric: tabular-nums
}

.event-copy {
    display: grid;
    min-width: 0;
    gap: 2px
}

.event-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 630
}

.event-copy span {
    color: var(--muted);
    font-size: 9px
}

.event-kind {
    margin-left: auto;
    color: #879087;
    font-size: 9px
}

.day-events .event-day {
    display: none
}

.agenda-card {
    margin-top: 13px
}

.agenda-card .section-heading {
    margin-bottom: 11px
}

.agenda-card .section-title {
    font-size: 16px
}

.agenda-date-group {
    overflow: hidden;
    border: 1px solid #edf0eb;
    border-radius: 12px
}

.agenda-date-group summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 13px;
    background: #fafbf8;
    cursor: pointer;
    list-style: none
}

.agenda-date-group summary::-webkit-details-marker {
    display: none
}

.agenda-date-group summary strong {
    font-size: 11px;
    font-weight: 650
}

.agenda-date-group summary span {
    color: var(--muted);
    font-size: 10px
}

.agenda-date-group summary b {
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    margin-left: auto;
    border-radius: 50%;
    background: #eef0eb;
    color: #657168;
    font-size: 9px;
    transition: transform .16s
}

.agenda-date-group[open] summary b {
    transform: rotate(180deg)
}

.agenda-date-events {
    display: grid;
    gap: 6px;
    padding: 8px
}

.past-agenda {
    margin-top: 10px;
    padding: 0;
    overflow: hidden;
    border-radius: 13px;
    background: #fff
}

.past-heading {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    transition: background .16s ease
}

.past-heading:hover {
    background: #f7f9f5
}

.past-heading:focus-visible {
    outline: 2px solid var(--profile-accent, var(--green));
    outline-offset: -3px
}

.past-heading>span:first-child {
    display: grid;
    gap: 3px
}

.past-title {
    font-size: 13px;
    font-weight: 640;
    letter-spacing: -.01em
}

.past-heading .group-chevron {
    margin-left: auto;
    border-radius: 50%;
    transition: transform .16s ease, background .16s ease
}

.past-heading:hover .group-chevron {
    background: #eef2ec
}

.past-heading[aria-expanded="true"] .group-chevron {
    transform: rotate(180deg)
}

.past-agenda .agenda-list {
    gap: 8px;
    padding: 0 14px 13px
}

.past-agenda .agenda-date-group {
    border-color: #e8ece6;
    border-radius: 10px
}

.past-agenda .agenda-date-group summary {
    padding: 9px 11px;
    background: #fafbf8
}

.past-agenda .agenda-date-events {
    padding: 7px
}

.agenda-event.event-past {
    background: #f5f6f3;
    border-color: #e5e8e2;
    opacity: .75
}

.agenda-event.event-course-passed {
    border-color: #d4e8d8
}

.agenda-event.event-course-passed .event-copy span {
    color: #4b805c
}

.empty-state {
    padding: 18px 12px;
    border: 1px dashed #dce1da;
    border-radius: 11px;
    color: #88928a;
    text-align: center;
    font-size: 11px
}

.view-panel {
    min-width: 0
}

.toolbar-left,
.toolbar-right {
    flex-wrap: wrap
}

.toolbar-right {
    justify-content: flex-end
}

.people-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: -5px 0 18px
}

.group-people {
    display: flex;
    gap: 7px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none
}

.group-people::-webkit-scrollbar {
    display: none
}

.person {
    font-size: 11px;
    padding: 6px 10px
}

.profile-select {
    max-width: 170px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px 24px 8px 10px;
    background: #fff;
    font-size: 11px
}

.profile-view {
    color: #7a857d;
    font-size: 10px;
    white-space: nowrap
}

@media(max-width:760px) {
    .people-tools {
        align-items: flex-start;
        flex-direction: column
    }

    .profile-select {
        max-width: none;
        width: 100%
    }

    .calendar-layout {
        grid-template-columns: 1fr
    }

    .calendar-cell {
        min-height: 52px
    }

    .course-section .course-grid {
        grid-template-columns: 1fr
    }

    .calendar-card,
    .day-card,
    .agenda-card {
        padding: 13px
    }

    .general-notes textarea {
        min-height: 100px
    }

    .section-heading .section-title {
        font-size: 19px
    }

    .view-tabs {
        top: 0
    }

    .toolbar {
        gap: 9px
    }

    .toolbar-right {
        justify-content: flex-start
    }

    .course-section .course-card {
        padding: 13px
    }

    .topbar {
        height: 64px
    }

    .local-pill {
        font-size: 0
    }

    .local-pill:before {
        width: 8px;
        height: 8px
    }

    .welcome {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 18px
    }

    .quick-stats {
        width: 100%
    }

    .stat {
        flex: 1;
        min-width: 0;
        padding: 10px 12px
    }

    .overview {
        grid-template-columns: 1fr;
        gap: 10px
    }

    .progress-card {
        padding: 17px
    }

    .next-card {
        padding: 16px 17px
    }

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

    .toolbar-left,
    .toolbar-right {
        width: 100%
    }

    .search {
        width: 100%;
        flex: 1
    }

    .filter-select {
        flex: 1
    }

    .backup-button {
        white-space: nowrap
    }

    .course-grid {
        grid-template-columns: 1fr
    }

    .course-card {
        padding: 15px
    }

    .page {
        padding-top: 24px
    }
}

@media(max-width:390px) {
    .shell {
        padding: 0 13px
    }

    .brand {
        font-size: 13px
    }

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

    .calendar-cell {
        min-height: 47px;
        border-radius: 7px;
        padding: 4px 1px;
        gap: 3px
    }

    .calendar-number {
        font-size: 10px
    }

    .calendar-day-names {
        font-size: 6px
    }

    .calendar-dots {
        gap: 2px
    }

    .calendar-dots i {
        width: 4px;
        height: 4px
    }

    .calendar-dots b {
        font-size: 7px
    }

    .today-button {
        padding: 0 7px
    }

    .calendar-toolbar {
        gap: 5px
    }

    .quiet-button {
        padding: 8px
    }

    .stat strong {
        font-size: 18px
    }

    .stat span {
        font-size: 9px
    }

    .course-actions {
        grid-template-columns: 1fr
    }

    .gate-card {
        padding: 23px
    }
}

@media(prefers-reduced-motion:reduce) {

    *,
    *:before,
    *:after {
        scroll-behavior: auto !important;
        transition: none !important
    }
}

.electives-header {
    display: grid;
    gap: 4px;
    margin-bottom: 4px;
}

.electives-header h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.04em;
}

.electives-header p {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.3;
}

.electives-search-label {
    color: var(--muted);
    font-size: 11px;
}

#electives-search {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    font-size: 12px;
}

.electives-counter {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 99px;
    background: #e8f4ed;
    color: #286342;
    font-size: 11px;
    font-weight: 600;
    width: max-content;
    transition: all .2s;
}

.electives-counter.full {
    background: #edf1ee;
    color: #52645a;
}

.electives-counter.limit {
    background: #fff1d9;
    color: #9c6508;
}

.electives-error {
    min-height: 0;
    margin: 0;
    color: #a1443b;
    font-size: 11px;
}

.electives-error:empty {
    display: none;
}

.backup-button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.electives-list {
    display: grid;
    gap: 6px;
    max-height: 45vh;
    overflow-y: auto;
    margin: 4px -8px;
    padding: 4px 8px;
}

.electives-empty {
    padding: 14px 10px;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}

.elective-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    transition: all .15s;
}

.elective-item:hover {
    border-color: #bbc8bd;
    background: #f9faf7;
}

.elective-item:focus-within {
    outline: 3px solid var(--green, #174b3a);
    outline-offset: 2px;
}

.elective-item:has(input:checked) {
    border-color: var(--green);
    background: #f1f5f3;
}

.elective-item:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

.elective-item input {
    accent-color: var(--green);
    cursor: pointer;
    margin: 0;
    width: 16px;
    height: 16px;
    flex: none;
}

.elective-info {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.elective-info strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.elective-info em {
    color: #526751;
    font-size: 10px;
    font-style: normal;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.elective-info span {
    font-size: 10px;
    color: var(--muted);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* soft, group-first profile themes */
:root {
    --paper: #f5f4f6;
    --card: #fff;
    --ink: #24212a;
    --muted: #77737f;
    --line: #e8e5eb;
    --green: #45434e;
    --green-hover: #34323d;
    --mint: #ecebf0;
    --lime: #e5e3ea;
    --shadow: 0 1px 3px rgba(24, 21, 31, .04);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif
}

body {
    text-transform: lowercase;
    font-size: 14px;
    line-height: 1.5
}

.shell {
    max-width: 1080px;
    padding: 0 32px
}

.topbar {
    height: 64px
}

.brand {
    gap: 9px;
    font-size: 14px;
    letter-spacing: -.02em
}

.local-pill {
    font-size: 11px
}

.page {
    padding: 34px 0 72px
}

.welcome {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px 28px;
    margin-bottom: 24px
}

.welcome-title .eyebrow {
    display: none
}

.welcome-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px
}

.welcome h1 {
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -.045em
}

.rename-profile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--card);
    color: var(--muted);
    font-size: 10px;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s
}

.rename-profile-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

.rename-profile-button:hover {
    border-color: var(--profile-line, var(--line));
    background: var(--profile-wash, #f7f7f8);
    color: var(--ink)
}

.profile-name {
    text-transform: none
}

.profile-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 12px
}

.profile-picker select {
    min-width: 130px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 7px 28px 7px 9px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 550
}

.profile-picker select:hover {
    border-color: var(--line);
    background: #fff
}

.profile-picker select:focus-visible {
    border-color: #aeb5bf;
    background: #fff
}

.overview {
    margin: 0 0 25px
}

.progress-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none
}

.progress-summary {
    display: flex;
    align-items: baseline;
    gap: 13px;
    margin-bottom: 9px
}

.progress-number {
    margin: 0;
    gap: 7px
}

.progress-number strong {
    font-size: 23px;
    font-weight: 620;
    letter-spacing: -.04em
}

.progress-number span {
    font-size: 12px
}

#progress-caption {
    font-size: 11px;
    white-space: nowrap
}

.progress-unit {
    font-size: inherit
}

.progress-track {
    max-width: 480px;
    height: 5px;
    background: #e5e6e9
}

.progress-fill {
    background: var(--green)
}

.view-tabs {
    position: static;
    width: auto;
    gap: 23px;
    margin: 0 0 25px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    backdrop-filter: none
}

.view-tab {
    position: relative;
    padding: 0 0 11px;
    border-radius: 0;
    color: #777b83;
    font-size: 13px
}

.view-tab.active {
    background: transparent;
    color: var(--ink);
    font-weight: 600
}

.view-tab.active:after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    content: ""
}

.section-heading {
    align-items: center;
    margin-bottom: 12px
}

#subjects-view .section-heading .section-title {
    font-size: 23px;
    font-weight: 630;
    letter-spacing: -.04em
}

.course-count {
    min-width: 36px;
    text-align: right
}

.toolbar {
    display: grid;
    gap: 0;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent
}

.toolbar-main {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(420px, 100%);
    min-width: 0;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #eceef1;
    color: #747983
}

.search-wrap>span {
    font-size: 17px;
    line-height: 1
}

.search {
    width: 100%;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    outline: none
}

.search:focus-visible {
    outline: none
}

.search-wrap:focus-within {
    border-color: var(--profile-accent, #aeb5bf);
    background: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--profile-accent, #205b46) 11%, transparent)
}

.search::placeholder {
    color: #7d828b
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #454951;
    font-size: 12px
}

.filter-toggle:hover,
.course-tools summary:hover {
    background: #f1f2f4
}

.filter-toggle[aria-expanded="true"] {
    border-color: #aeb5bf;
    background: #f7f8f9
}

.filter-count {
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 10px
}

.course-tools {
    position: relative;
    margin-left: auto
}

.course-tools summary {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #565b63;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    list-style: none
}

.course-tools summary::-webkit-details-marker {
    display: none
}

.course-tools-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 4;
    display: grid;
    min-width: 180px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(20, 24, 28, .12)
}

.course-tools-menu button,
.course-tools-menu label {
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    font-size: 12px;
    cursor: pointer
}

.course-tools-menu button:hover,
.course-tools-menu label:hover {
    background: #f3f4f5
}

.course-tools-menu [aria-disabled="true"] {
    opacity: .45;
    pointer-events: none
}

.course-tools-divider {
    height: 1px;
    margin: 4px 6px;
    background: var(--line)
}

.course-tools-menu button:disabled {
    color: #999da4;
    cursor: not-allowed
}

#manage-electives {
    display: flex;
    justify-content: space-between;
    gap: 16px
}

#manage-electives:disabled {
    color: #9a9da3;
    cursor: not-allowed
}

#elective-count {
    color: var(--muted);
    font-variant-numeric: tabular-nums
}

.course-filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 13px 0 2px
}

.course-filters>label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 10px
}

.course-filters .filter-select {
    min-width: 130px;
    padding: 8px 30px 8px 10px;
    border-radius: 8px;
    font-size: 12px
}

.clear-filters {
    height: 35px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--green);
    font-size: 11px
}

.course-count {
    font-variant-numeric: tabular-nums
}

.empty-state .clear-filters {
    margin-top: 7px
}

.course-sections {
    gap: 16px
}

.course-section {
    border-color: #e8e9ec;
    border-radius: 13px;
    box-shadow: 0 1px 2px rgba(20, 24, 28, .025)
}

.group-heading {
    gap: 8px;
    padding: 11px 14px;
    border-bottom-color: #eceef0;
    background: #fff;
    color: #36393f;
    font-size: 12px
}

.group-indicator {
    width: 7px;
    height: 7px
}

.group-count {
    min-width: 20px;
    height: 18px;
    background: #f1f2f4;
    color: #666b73;
    font-variant-numeric: tabular-nums
}

.course-section .course-grid {
    padding: 8px;
    gap: 7px
}

.course-section .course-card {
    padding: 13px 14px;
    border-color: #eceef0;
    border-radius: 10px;
    background: #fff;
    transition: background .15s, border-color .15s
}

.course-credits {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    padding: 2px 6px;
    border: 1px solid #eceef0;
    border-radius: 7px;
    color: #737780;
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap
}

.course-section .course-card .course-credits {
    background: rgba(255, 255, 255, .7)
}

.elective-info em.credits-note {
    color: #737780;
    font-size: 9px;
    font-style: normal
}

.course-section .course-card:hover {
    transform: none;
    border-color: #c9cdd3;
    background: #fcfcfd
}

.course-section .course-card.status-passed,
.course-section .course-card.passed {
    background: #f4f8f4;
    border-color: #e2ebe3
}

.course-section .course-card.status-partial {
    background: #f3f8f4;
    border-color: #e0ebe3
}

.course-section .course-card.status-scheduled {
    background: #f7f9fc;
    border-color: #e7ebf1
}

.course-section .course-card.status-studying,
.course-section .course-card.status-try {
    background: #fffdfa;
    border-color: #efede7
}

.course-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    min-width: 0
}

.course-title-row .course-name {
    min-width: 0
}

.course-title-row .course-credits {
    flex: none;
    margin-top: 1px
}

.course-name {
    font-size: 13px;
    font-weight: 590;
    letter-spacing: -.012em
}

.course-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    min-height: 18px;
    margin: 5px 0 7px;
    font-size: 10px
}

.year-tag {
    color: #8a8e96;
    font-variant-numeric: tabular-nums
}

.elective-tag {
    padding: 2px 6px;
    background: #f1f2f3;
    color: #686d75;
    font-size: 9px
}

.next-tag,
.past-tag {
    padding: 2px 7px;
    background: #f0f2f3;
    color: #646b72;
    font-variant-numeric: tabular-nums
}

.status-pill {
    padding: 4px 7px;
    border-color: transparent;
    border-radius: 7px;
    background: #f3f4f5;
    color: #656a72;
    font-size: 10px
}

.course-section .course-card.status-passed .status-pill,
.course-section .course-card.status-partial .status-pill {
    border-color: transparent;
    background: #eaf2eb;
    color: #3d694b
}

.edit-button {
    width: 29px;
    height: 29px;
    border-color: transparent;
    background: transparent;
    color: #777c84
}

.edit-button:hover {
    border-color: #e4e6e9;
    background: #f4f5f6;
    color: var(--ink)
}

.read-only-tag {
    font-size: 10px
}

.electives-header {
    gap: 5px
}

.electives-header h2 {
    font-size: 17px;
    font-weight: 620
}

.electives-header p {
    font-size: 11px
}

.electives-list {
    max-height: min(48vh, 420px);
    gap: 5px;
    margin: 3px -5px;
    padding: 4px 5px
}

.elective-item {
    gap: 9px;
    padding: 9px 10px;
    border-color: #eceef0;
    border-radius: 9px
}

.elective-item:hover {
    border-color: #d2d5da;
    background: #fafafa
}

.elective-item:has(input:checked) {
    border-color: #c7d8cc;
    background: #f5f8f5
}

.elective-item:has(input:disabled) {
    opacity: .42
}

.elective-info {
    gap: 2px
}

.elective-info strong {
    font-size: 11px;
    font-weight: 590
}

.elective-info em,
.elective-info span {
    font-size: 9px
}

.edit-form {
    gap: 11px;
    padding: 20px
}

.edit-form h2 {
    font-size: 17px;
    font-weight: 620
}

.edit-form label {
    font-size: 11px
}

.edit-form select,
.edit-form input {
    padding: 10px;
    border-radius: 9px;
    font-size: 13px
}

.edit-actions button {
    border-radius: 8px
}

#connection-status {
    font-size: 0
}

#connection-status:before {
    width: 7px;
    height: 7px
}

#lock-button {
    width: 30px;
    height: 30px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0
}

#lock-button:after {
    color: #525861;
    font-size: 13px;
    content: "↗"
}

.profile-picker {
    position: relative
}

.profile-picker>span:not(.visually-hidden) {
    color: var(--muted);
    font-size: 11px
}

.search-wrap>svg,
.filter-toggle>svg {
    width: 15px;
    height: 15px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round
}

@media(max-width:760px) {
    .shell {
        padding: 0 20px
    }

    .page {
        padding: 27px 0 56px
    }

    .welcome {
        align-items: center;
        flex-direction: row;
        gap: 12px;
        margin-bottom: 20px
    }

    .welcome h1 {
        font-size: 27px
    }

    .profile-picker {
        gap: 7px
    }

    .profile-picker select {
        min-width: 130px;
        max-width: 56vw
    }

    .overview {
        margin-bottom: 21px
    }

    .view-tabs {
        margin-bottom: 21px
    }

    .toolbar {
        align-items: stretch
    }

    .toolbar-main {
        width: 100%
    }

    .search-wrap {
        flex: 1;
        width: auto
    }

    .toolbar-right {
        display: none
    }

    .course-filters {
        align-items: stretch
    }

    .course-filters>label {
        flex: 1;
        min-width: 0
    }

    .course-filters .filter-select {
        width: 100%;
        min-width: 0
    }

    .course-section .course-grid {
        grid-template-columns: 1fr
    }

    #subjects-view .section-heading .section-title {
        font-size: 21px
    }

    .electives-list {
        max-height: 43vh
    }
}

@media(max-width:430px) {
    .shell {
        padding: 0 16px
    }

    .welcome h1 {
        font-size: 25px
    }

    .profile-picker {
        gap: 5px;
        font-size: 10px
    }

    .profile-picker select {
        min-width: 0;
        max-width: 58vw;
        padding: 8px 25px 8px 8px;
        font-size: 12px
    }

    .course-filters {
        flex-wrap: wrap
    }

    .course-filters>label {
        flex: 1 1 38%
    }

    .clear-filters {
        margin-left: auto
    }

    .course-section .course-card {
        padding: 12px
    }

    .course-name {
        font-size: 12px
    }

    .course-dates {
        flex-wrap: wrap
    }
}

:root {
    --line: #e7e5e6;
    --shadow: 0 2px 10px rgba(29, 29, 31, .035)
}

body {
    text-transform: lowercase
}

.brand {
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -.035em
}

.welcome {
    display: grid;
    grid-template-columns: minmax(170px, .35fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px 28px;
    margin-bottom: 20px
}

.welcome-title {
    display: flex;
    align-items: center;
    gap: 10px
}

.welcome h1 {
    font-size: 28px;
    font-weight: 620;
    letter-spacing: -.04em;
    text-transform: lowercase
}

.profile-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: none
}

.profile-chip {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 8px;
    align-items: center;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 18px;
    background: transparent;
    color: #5e626a;
    text-align: left;
    transition: background .15s, border-color .15s, color .15s
}

.profile-chip:hover {
    background: var(--profile-wash, #f7f7f8);
    border-color: var(--profile-line, #e3e4e5)
}

.profile-chip.active {
    background: var(--profile-wash, #f0f1f2);
    border-color: var(--profile-line, #e3e4e5);
    color: var(--ink)
}

.profile-dot {
    grid-row: 1/4;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--profile-accent, #858b94)
}

.profile-name {
    overflow: hidden;
    font-size: 12px;
    font-weight: 560;
    text-overflow: ellipsis
}

.profile-progress {
    color: var(--muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums
}

.profile-chip.active .profile-name {
    color: var(--profile-accent, var(--ink))
}

.profile-credits {
    color: var(--muted);
    font-size: 9px;
    font-variant-numeric: tabular-nums
}

.profile-chip.active .profile-credits {
    color: var(--profile-accent, #60656e)
}

.profile-chip.active .profile-progress {
    color: var(--profile-accent, #60656e)
}

.profile-chip[data-profile="samir"] {
    --profile-accent: #b94776;
    --profile-wash: #fff0f5;
    --profile-line: #f0cdda
}

.profile-chip[data-profile="giulia"] {
    --profile-accent: #7653b5;
    --profile-wash: #f3effb;
    --profile-line: #dfd5f0
}

.profile-chip[data-profile="ciofy"] {
    --profile-accent: #4f84b8;
    --profile-wash: #eef5fb;
    --profile-line: #d7e5f1
}

.profile-chip[data-profile="claudia"] {
    --profile-accent: #c65c5c;
    --profile-wash: #fbf0ef;
    --profile-line: #efd9d7
}

.profile-chip[data-profile="momo"] {
    --profile-accent: #b68f22;
    --profile-wash: #faf6e9;
    --profile-line: #eee5c5
}

.profile-chip[data-profile="loreta"] {
    --profile-accent: #548b65;
    --profile-wash: #eef6ef;
    --profile-line: #d8e9da
}

body[data-profile="samir"] {
    --profile-accent: #b94776;
    --profile-wash: #fff0f5;
    --profile-line: #f0cdda
}

body[data-profile="giulia"] {
    --profile-accent: #7653b5;
    --profile-wash: #f3effb;
    --profile-line: #dfd5f0
}

body[data-profile="ciofy"] {
    --profile-accent: #4f84b8;
    --profile-wash: #eef5fb;
    --profile-line: #d7e5f1
}

body[data-profile="claudia"] {
    --profile-accent: #c65c5c;
    --profile-wash: #fbf0ef;
    --profile-line: #efd9d7
}

body[data-profile="momo"] {
    --profile-accent: #b68f22;
    --profile-wash: #faf6e9;
    --profile-line: #eee5c5
}

body[data-profile="loreta"] {
    --profile-accent: #548b65;
    --profile-wash: #eef6ef;
    --profile-line: #d8e9da
}

.progress-fill {
    background: var(--profile-accent, var(--green))
}

.progress-unit {
    color: var(--muted);
    font-size: 11px
}

.profile-progress {
    font-variant-numeric: tabular-nums
}

.view-tab.active:after {
    background: var(--profile-accent, var(--ink))
}

.calendar-cell.today .calendar-number {
    background: var(--profile-accent, var(--green))
}

.calendar-cell.selected {
    border-color: var(--profile-accent, var(--green));
    background: var(--profile-wash, #edf4ee)
}

.section-kicker,
.calendar-weekdays,
.calendar-toolbar h3,
.day-card .section-heading h3 {
    text-transform: lowercase
}

.course-name,
.event-copy strong,
.elective-info strong {
    text-transform: lowercase
}

.top-actions {
    gap: 8px
}

.profile-picker {
    display: none
}

.local-pill:before {
    display: none
}

.profile-chip:focus-visible {
    outline: 2px solid var(--profile-accent, #8a8e96);
    outline-offset: 2px
}

.profile-chip.active .profile-dot {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--profile-accent) 16%, transparent)
}

.course-section {
    border-radius: 19px
}

.course-section .course-card {
    border-radius: 16px
}

.group-heading {
    border-radius: 0
}

.search-wrap,
.filter-toggle,
.course-tools summary {
    border-radius: 16px
}

.course-tools-menu {
    border-radius: 18px
}

.edit-dialog {
    border-radius: 24px
}

.elective-item {
    border-radius: 15px
}

.calendar-card,
.day-card,
.agenda-card {
    border-radius: 19px
}

.status-pill {
    border-radius: 10px
}

.course-section .course-card {
    box-shadow: 0 1px 2px rgba(29, 29, 31, .025)
}

.elective-item:has(input:checked) {
    border-color: var(--profile-line, #c7d8cc);
    background: var(--profile-wash, #f5f8f5)
}

#lock-button {
    width: auto;
    height: auto;
    padding: 8px 10px;
    color: var(--ink);
    font-size: 12px
}

#lock-button:after {
    content: none
}

@media(min-width:761px) {
    .profile-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }
}

@media(max-width:760px) {
    .welcome {
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 10px
    }

    .profile-tabs {
        grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
        gap: 5px
    }

    .profile-chip {
        padding: 7px 8px;
        border-radius: 12px
    }
}

@media(max-width:520px) {
    .profile-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .profile-chip {
        grid-template-columns: 7px minmax(0, 1fr);
        column-gap: 6px;
        padding: 7px 9px
    }

    .profile-name {
        font-size: 12px
    }

    .profile-progress {
        font-size: 9px
    }
}

@media(max-width:350px) {
    .profile-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

.study-intro {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px
}

.study-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 14px
}

.study-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

.study-add-primary,.study-settings-button {
    display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 6px; padding: 0 12px;
    border: 1px solid var(--surface-line, var(--line)); border-radius: 10px; background: var(--surface-raised, var(--card));
    color: var(--ink); font-size: 11px; font-weight: 580; transition: background .16s ease, border-color .16s ease, transform .16s ease
}
.study-add-primary svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round }
.study-add-primary:hover,.study-settings-button:hover { border-color: color-mix(in srgb, var(--profile-accent, var(--ink)) 30%, var(--surface-line, var(--line))); background: var(--surface-hover, var(--card)) }
.study-toolbar-actions .study-add-primary:disabled,.study-toolbar-actions .study-settings-button:disabled { cursor: not-allowed; opacity: .55 }
.study-week-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.study-week-nav .study-week-today { font-weight: 600 }

.study-suggest-button {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--surface-line, var(--line));
    border-radius: 10px;
    background: var(--surface-raised, var(--card));
    color: var(--ink);
    font-size: 11px;
    transition: border-color .16s ease, background .16s ease, color .16s ease
}

.study-suggest-button:hover {
    border-color: color-mix(in srgb, var(--profile-accent, var(--ink)) 30%, var(--surface-line, var(--line)));
    background: var(--surface-hover, var(--card))
}

.study-suggest-button:focus-visible,
.study-suggestion-item input:focus-visible {
    outline: 2px solid var(--profile-accent, var(--ink));
    outline-offset: 2px
}

.study-suggestion {
    display: grid;
    gap: 11px;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid var(--surface-line, var(--line));
    border-radius: 14px;
    background: var(--surface-base, var(--card))
}

.study-suggestion-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px
}

.study-suggestion-heading h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: -.02em
}

.study-suggestion-heading p {
    max-width: 620px;
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px
}

.study-suggestion-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr));
    gap: 7px
}

.study-suggestion-item {
    display: grid;
    grid-template-columns: auto minmax(62px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--surface-line, var(--line));
    border-radius: 10px;
    background: var(--surface-raised, var(--card));
    cursor: pointer
}

.study-suggestion-item:has(input:not(:checked)) {
    opacity: .58
}

.study-suggestion-item input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--profile-accent, #667085)
}

.study-suggestion-date {
    color: var(--profile-accent, var(--muted));
    font-size: 10px;
    font-weight: 620;
    white-space: nowrap
}

.study-suggestion-copy {
    display: grid;
    min-width: 0;
    gap: 2px
}

.study-suggestion-copy strong,
.study-suggestion-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.study-suggestion-copy strong {
    font-size: 10px;
    font-weight: 620
}

.study-suggestion-copy span {
    color: var(--muted);
    font-size: 9px
}

.study-suggestion-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.study-suggestion-actions [role="status"] {
    color: var(--muted);
    font-size: 10px
}

.study-suggestion-actions>div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    margin-left: auto
}

.study-suggestion-actions button {
    min-height: 36px
}

.study-suggestion-actions .auth-secondary {
    padding: 0 11px
}

.study-suggestion-actions .auth-submit {
    padding: 0 13px
}

.study-suggestion-actions button:disabled {
    cursor: not-allowed;
    opacity: .48
}

@media(max-width:430px) {
    .study-toolbar {
        width: 100%
    }

    .study-toolbar-actions {
        width: 100%;
        flex-wrap: wrap
    }

    .study-toolbar-actions button {
        flex: 1
    }

    .study-suggestion {
        padding: 11px
    }

    .study-suggestion-actions {
        align-items: flex-start;
        flex-direction: column
    }

    .study-suggestion-actions>div {
        width: 100%
    }

    .study-suggestion-actions>div button {
        flex: 1
    }
}

@media(max-width:360px) {
    .study-week-nav {
        flex-wrap: nowrap;
        justify-content: space-between
    }

    #study-week-label {
        width: auto;
        text-align: center
    }
}

.study-week-nav {
    display: flex;
    align-items: center;
    gap: 6px
}

.study-week-nav button,
.study-form-panel>summary {
    min-height: 34px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    font-size: 11px
}

.study-week-nav button:hover,
.study-form-panel>summary:hover {
    background: #f6f6f7
}

#study-week-label {
    min-width: 145px;
    text-align: center;
    color: var(--muted);
    font-size: 11px
}

.study-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 12px
}

.study-metric {
    display: grid;
    min-width: 0;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--card);
    color: var(--muted);
    font-size: 10px;
    line-height: 1.3
}

.study-metric strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap
}

.study-metric strong small { color: var(--muted); font-size: 10px; font-weight: 500 }
.study-metric>span { overflow-wrap: anywhere }

.study-layout {
    display: grid;
    gap: 10px;
    align-items: start
}

.study-form-panel,
.study-sessions {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff
}

.study-form-panel>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none
}

.study-form-panel>summary::-webkit-details-marker {
    display: none
}

.study-form-panel[open]>summary {
    margin-bottom: 10px;
    background: #fafafa
}

.study-form-panel[open]>summary:after {
    content: 'chiudi';
    color: var(--muted);
    font-size: 10px
}

.study-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    align-items: end
}

.study-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 10px
}

.study-form label:nth-of-type(1) {
    grid-column: span 2
}

.study-form label:nth-of-type(n+2) {
    grid-column: span 1
}

.study-form input,
.study-form select {
    width: 100%;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px;
    background: #fff;
    font-size: 12px
}

.study-form .auth-submit {
    grid-column: span 2;
    min-height: 36px
}

.study-form .study-cancel-edit {
    height: 36px;
    grid-column: span 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 11px
}

.study-form :disabled {
    cursor: not-allowed;
    opacity: .55
}

.study-message {
    grid-column: 1/-1;
    min-height: 0;
    margin: 0;
    color: var(--muted);
    font-size: 10px
}

.study-week-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start
}

.study-list-group {
    display: grid;
    gap: 6px
}

.study-list-group>h3 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 1px 2px 2px;
    color: #4c525a;
    font-size: 11px;
    font-weight: 620
}

.study-list-group>h3 span {
    color: var(--muted);
    font-weight: 450
}

.study-form-panel:not([open]) .study-form {
    display: none
}

.study-day {
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff
}

.study-day.is-today {
    border-color: var(--profile-line, #c9d8ce);
    background: var(--profile-wash, #fafafa)
}

.study-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px
}

.study-day-title,
.study-day-tools {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px
}

.study-day-head strong {
    font-size: 11px;
    font-weight: 620
}

.study-day-head span,
.study-day-head small {
    color: var(--muted);
    font-size: 9px
}

.study-day-tools small {
    white-space: nowrap
}

.study-day-add {
    min-height: 27px;
    padding: 4px 8px;
    border: 1px solid var(--profile-line, var(--line));
    border-radius: 7px;
    background: var(--card);
    color: var(--profile-accent, var(--ink));
    font: inherit;
    font-size: 10px;
    font-weight: 560;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease
}

.study-day-add:hover {
    border-color: var(--profile-accent, var(--line));
    background: var(--profile-wash, #f7f7f8)
}

.study-day-add:disabled {
    cursor: not-allowed;
    opacity: .55
}

:root[data-theme="dark"] .study-day-add {
    border-color: var(--line);
    background: var(--card);
    color: var(--ink)
}

:root[data-theme="dark"] .study-day-add:hover {
    border-color: var(--profile-accent, var(--line));
    background: var(--profile-wash, #272d29)
}

.study-day-list {
    display: grid;
    gap: 5px
}

.study-session {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    padding: 8px;
    border: 1px solid #efeff1;
    border-radius: 9px;
    background: #fff
}

.study-session.is-done {
    background: #fafafa;
    opacity: .72
}

.study-session.is-pending-today {
    border-color: #e8c2bd;
    background: #fff2f0
}

.study-session.is-pending-today .study-session-copy strong {
    color: #8f4540
}

.study-session.is-pending-today .study-session-actions button {
    border-color: #e6c4bf;
    background: #fff9f8
}

.study-session.is-pending-today .study-session-actions button:hover {
    background: #fae7e3
}

.study-session-copy {
    display: grid;
    gap: 3px;
    min-width: 0
}

.study-session-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 590
}

.study-session-copy span {
    color: var(--muted);
    font-size: 9px
}

.study-session-copy em {
    overflow-wrap: anywhere;
    color: #626a72;
    font-size: 10px;
    font-style: normal
}

.study-session-actions {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    align-items: center
}

.study-session-actions button {
    min-height: 27px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    font-size: 9px
}

.study-session-actions button:hover {
    background: #f6f6f7
}

.study-session-actions .study-delete {
    color: #9b4b46
}

.study-day-empty {
    padding: 5px 0;
    color: #a0a5aa;
    font-size: 9px
}

.study-recovery-list .study-session-actions,
.study-archive .study-session-actions {
    grid-auto-flow: column
}

.study-recovery,
.study-archive {
    margin-top: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff
}

.study-recovery h3,
.study-archive>summary {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #4c525a;
    font-size: 11px;
    font-weight: 620
}

.study-recovery h3 span {
    color: var(--muted);
    font-weight: 450
}

.study-recovery-list {
    display: grid;
    gap: 5px;
    margin-top: 8px
}

.study-archive>summary {
    cursor: pointer;
    list-style: none
}

.study-archive>summary::-webkit-details-marker {
    display: none
}

.study-archive>summary span {
    margin-left: auto;
    color: var(--muted);
    font-size: 10px;
    font-weight: 450
}

@media(max-width:760px) {
    .view-tabs {
        gap: 16px;
        overflow-x: auto
    }

    .study-week-grid {
        grid-template-columns: 1fr
    }

    .study-form-panel,
    .study-sessions {
        padding: 10px
    }

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

    .study-form label:nth-of-type(n) {
        grid-column: span 1
    }

    .study-form label:nth-of-type(1),
    .study-form label:nth-of-type(5) {
        grid-column: 1/-1
    }

    .study-form .auth-submit {
        grid-column: span 1
    }
}

@media(max-width:430px) {
    #study-view .section-heading { margin-bottom: 8px }
    #study-view .study-intro { max-width: 34ch; font-size: 11px; line-height: 1.4 }
    .view-tabs {
        width: 100%;
        gap: 13px
    }

    .view-tab {
        flex: none;
        font-size: 12px
    }

    .study-toolbar {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 10px;
        padding: 8px;
        border: 1px solid var(--surface-line, var(--line));
        border-radius: 16px;
        background: var(--surface-base, var(--card))
    }

    .study-week-nav {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 44px;
        justify-content: space-between;
        gap: 6px;
        padding: 4px;
        border: 1px solid var(--surface-line, var(--line));
        border-radius: 13px;
        background: var(--surface-raised, var(--paper))
    }

    .study-week-nav #study-week-label {
        min-width: 0;
        flex: 1;
        overflow: hidden;
        color: var(--ink);
        font-size: 11px;
        font-weight: 620;
        text-overflow: ellipsis;
        white-space: nowrap
    }

    .study-week-nav .study-week-arrow {
        width: 42px;
        min-width: 42px;
        min-height: 44px;
        padding: 9px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--profile-accent, var(--ink))
    }

    .study-week-arrow svg,.study-add-primary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
    .study-week-nav .study-week-today { min-height: 44px; padding: 0 10px; border: 0; border-radius: 9px; background: color-mix(in srgb, var(--profile-accent, #718d73) 11%, var(--card)); color: var(--profile-accent, var(--ink)); font-size: 10px; font-weight: 650 }
    .study-toolbar-actions { box-sizing: border-box; display: grid; width: 100%; max-width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px }
    .study-toolbar-actions button { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; min-height: 44px; justify-content: center; margin: 0; padding: 7px 8px; border-radius: 10px; font-size: 10px; font-weight: 620; line-height: 1.25; text-align: center; white-space: normal; overflow-wrap: anywhere }
    .study-toolbar-actions .study-add-primary { grid-column: 1 / -1; min-height: 46px; gap: 7px; border: 0; border-radius: 10px; background: var(--ink); color: #fff; font-size: 11px; box-shadow: none }
    .study-toolbar-actions .study-suggest-button,.study-toolbar-actions .study-settings-button { border: 1px solid var(--surface-line, var(--line)); background: var(--surface-raised, var(--card)); color: var(--ink) }
    .study-toolbar-actions .study-settings-button { display: inline-flex; align-items: center }
    .study-toolbar-actions:has(#study-suggest-button.hidden) .study-settings-button { grid-column: 1 / -1 }
    .study-toolbar-actions button:active { transform: scale(.985) }
    .study-toolbar-actions button:focus-visible,.study-week-nav button:focus-visible { outline-offset: 2px }

    .study-week-grid {
        gap: 6px
    }

    .study-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
        margin-bottom: 8px
    }

    .study-metric { min-height: 0; gap: 1px; padding: 6px 8px; border-radius: 8px; font-size: 9px }
    .study-metric strong { font-size: 12px }

    .study-layout,#study-sessions,.study-week-grid,.study-day-list,.study-session-copy { min-width: 0 }
    .study-layout { gap: 7px }
    .study-form-panel,.study-sessions { padding: 7px; border-radius: 11px }
    .study-week-grid { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--surface-line, var(--line)); border-radius: 12px; background: var(--surface-base, var(--card)) }
    .study-day { min-width: 0; padding: 6px 9px; border: 0; border-bottom: 1px solid var(--surface-line, var(--line)); border-radius: 0; background: transparent }
    .study-day:last-child { border-bottom: 0 }
    .study-day.is-today { border-color: var(--surface-line, var(--line)); background: color-mix(in srgb, var(--profile-accent, #718d73) 6%, var(--card)) }
    .study-day:has(.study-day-empty) .study-day-list { display: none }
    .study-day-head { align-items: center; gap: 6px; margin: 0 }
    .study-day-head strong { font-size: 10px }
    .study-day-tools small { font-size: 9px }
    .study-day-title small { padding: 1px 5px; border-radius: 99px; background: color-mix(in srgb, var(--profile-accent, #718d73) 10%, var(--card)); font-size: 8px }

    .study-day-title {
        flex: 1;
        flex-wrap: wrap;
        gap: 3px 5px
    }

    .study-day-title strong { font-size: 10px }
    .study-day-title span { font-size: 8px }
    .study-day-tools {
        flex: none;
        gap: 4px
    }

    .study-day-add {
        min-height: 32px;
        padding: 4px 6px;
        font-size: 9px
    }

    .study-session {
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        padding: 8px
    }

    .study-session-copy { min-width: 0 }
    .study-session-copy strong { white-space: normal; overflow-wrap: anywhere }
    .study-session-copy span { overflow-wrap: anywhere }
    .study-session-actions {
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        gap: 5px
    }
    .study-session-actions button { min-width: 0; min-height: 38px; padding: 5px 6px; font-size: 9px; white-space: normal }
    .study-recovery-list .study-session-actions,.study-archive .study-session-actions { grid-auto-flow: row }

    .study-recovery,.study-archive { margin-top: 7px; padding: 8px }
    .study-recovery-list { gap: 5px }
    .study-week-nav { gap: 3px; padding: 3px }
    .study-week-nav #study-week-label { font-size: 10px }

    .study-form {
        grid-template-columns: 1fr 1fr
    }

    .study-form label:nth-of-type(1),
    .study-form label:nth-of-type(5) {
        grid-column: 1/-1
    }

    .study-form .auth-submit {
        grid-column: 1/-1
    }
}

.calendar-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -10px 0 14px
}

.calendar-controls p {
    margin: 0;
    color: var(--muted);
    font-size: 11px
}

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

.calendar-filter {
    min-height: 36px;
    padding: 7px 30px 7px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    font-size: 11px
}

.lesson-settings-dialog {
    width: min(620px, calc(100% - 24px))
}

.lesson-settings-intro {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45
}

.lesson-settings-groups {
    display: grid;
    gap: 12px;
    max-height: min(60dvh, 590px);
    overflow: auto;
    padding: 2px
}

.lesson-year-group {
    display: grid;
    gap: 8px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card)
}

.lesson-year-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px
}

.lesson-year-head h3 {
    margin: 0;
    font-size: 13px
}

.lesson-year-head label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 10px
}

.lesson-year-head select {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 24px 7px 8px;
    background: var(--paper);
    color: var(--ink);
    font-size: 11px
}

.lesson-course-list {
    display: grid;
    gap: 6px
}

.lesson-choice {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--paper);
    cursor: pointer
}

.lesson-choice:has(input:checked) {
    border-color: var(--profile-line, #bdcbbf);
    background: var(--profile-wash, #f3f7f3)
}

.lesson-choice input {
    margin: 2px 0 0;
    accent-color: var(--green)
}

.lesson-choice-copy {
    display: grid;
    gap: 3px;
    min-width: 0
}

.lesson-choice-copy strong {
    font-size: 11px;
    font-weight: 600
}

.lesson-choice-copy span {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.4
}

.lesson-settings-message {
    min-height: 14px;
    margin: 0;
    color: var(--muted);
    font-size: 10px
}

.agenda-event.event-lesson {
    border-color: #d9e1e8;
    background: #f3f6f9
}

.dot-lesson {
    background: #71869c !important
}

.calendar-day-names .lesson-day-name {
    color: #61798f
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #151519;
    --card: #212127;
    --ink: #eeedf2;
    --muted: #aaa6b1;
    --line: #393740;
    --green: #bcb7c7;
    --green-hover: #d0cadb;
    --mint: #2b2a31;
    --lime: #34323c;
    --profile-surface: #292830;
    --profile-surface-raised: #302f36;
    --profile-surface-soft: #24232a;
    --profile-surface-input: #19181e;
    --amber: #403521;
    --rose: #402d2b;
    --blue: #293747;
    --shadow: 0 8px 28px rgba(0, 0, 0, .22)
}

:root[data-theme="dark"] body {
    background: var(--paper);
    color: var(--ink)
}

:root[data-theme="dark"] .edit-dialog,
:root[data-theme="dark"] .gate-card {
    background: color-mix(in srgb, var(--paper) 84%, var(--card));
    border-color: color-mix(in srgb, var(--profile-accent, var(--line)) 12%, var(--line))
}

:root[data-theme="dark"] .local-pill,
:root[data-theme="dark"] .profile-chip,
:root[data-theme="dark"] .year-tag,
:root[data-theme="dark"] .group-heading {
    color: var(--muted)
}

:root[data-theme="dark"] .stat,
:root[data-theme="dark"] .progress-card,
:root[data-theme="dark"] .course-section,
:root[data-theme="dark"] .course-section .course-card,
:root[data-theme="dark"] .calendar-card,
:root[data-theme="dark"] .day-card,
:root[data-theme="dark"] .agenda-card,
:root[data-theme="dark"] .study-metric,
:root[data-theme="dark"] .study-form-panel,
:root[data-theme="dark"] .study-sessions,
:root[data-theme="dark"] .study-day,
:root[data-theme="dark"] .study-session,
:root[data-theme="dark"] .study-recovery,
:root[data-theme="dark"] .study-archive {
    background: var(--card);
    border-color: var(--line);
    color: var(--ink)
}

:root[data-theme="dark"] .next-card {
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 20%, var(--card))
}

:root[data-theme="dark"] .view-tabs {
    background: rgba(21, 24, 22, .94)
}

:root[data-theme="dark"] .view-tab.active {
    color: var(--ink)
}

:root[data-theme="dark"] .toolbar,
:root[data-theme="dark"] .search-wrap {
    background: var(--card);
    border-color: var(--line)
}

:root[data-theme="dark"] .search,
:root[data-theme="dark"] .filter-select,
:root[data-theme="dark"] .course-actions select,
:root[data-theme="dark"] .grade-input,
:root[data-theme="dark"] .edit-form select,
:root[data-theme="dark"] .edit-form input,
:root[data-theme="dark"] .gate-login select,
:root[data-theme="dark"] .auth-form input,
:root[data-theme="dark"] .auth-form select,
:root[data-theme="dark"] .profile-claim input,
:root[data-theme="dark"] .profile-claim select,
:root[data-theme="dark"] .gate-form input,
:root[data-theme="dark"] .study-form input,
:root[data-theme="dark"] .study-form select,
:root[data-theme="dark"] #electives-search {
    border-color: var(--line);
    background: color-mix(in srgb, var(--paper) 34%, var(--card));
    color: var(--ink)
}

:root[data-theme="dark"] .course-section .course-card .course-credits,
:root[data-theme="dark"] .course-section .course-card .course-note-panel,
:root[data-theme="dark"] .course-section .course-card .edit-button {
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 18%, var(--card))
}

:root[data-theme="dark"] .calendar-card,
:root[data-theme="dark"] .day-card,
:root[data-theme="dark"] .agenda-card,
:root[data-theme="dark"] .study-form-panel,
:root[data-theme="dark"] .study-day,
:root[data-theme="dark"] .study-recovery,
:root[data-theme="dark"] .study-archive {
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 8%, var(--card))
}

:root[data-theme="dark"] .calendar-cell {
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 10%, var(--card))
}

:root[data-theme="dark"] button.calendar-cell:hover,
:root[data-theme="dark"] .calendar-nav:hover,
:root[data-theme="dark"] .today-button:hover,
:root[data-theme="dark"] .filter-toggle:hover,
:root[data-theme="dark"] .course-tools summary:hover,
:root[data-theme="dark"] .study-week-nav button:hover,
:root[data-theme="dark"] .study-session-actions button:hover {
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 24%, var(--card))
}

:root[data-theme="dark"] .search::placeholder,
:root[data-theme="dark"] input::placeholder {
    color: #89958d
}

:root[data-theme="dark"] .quiet-button,
:root[data-theme="dark"] .backup-button,
:root[data-theme="dark"] .filter-toggle,
:root[data-theme="dark"] .course-tools summary,
:root[data-theme="dark"] .course-tools-menu,
:root[data-theme="dark"] .calendar-nav,
:root[data-theme="dark"] .today-button,
:root[data-theme="dark"] .study-week-nav button,
:root[data-theme="dark"] .study-form-panel>summary,
:root[data-theme="dark"] .study-session-actions button,
:root[data-theme="dark"] .study-form .study-cancel-edit,
:root[data-theme="dark"] .auth-secondary,
:root[data-theme="dark"] .edit-actions button,
:root[data-theme="dark"] .elective-item {
    border-color: var(--line);
    background: var(--card);
    color: var(--ink)
}

:root[data-theme="dark"] .course-tools-menu button,
:root[data-theme="dark"] .course-tools-menu label,
:root[data-theme="dark"] .group-heading,
:root[data-theme="dark"] .past-heading {
    color: var(--ink)
}

:root[data-theme="dark"] .course-tools-menu button:hover,
:root[data-theme="dark"] .course-tools-menu label:hover,
:root[data-theme="dark"] .study-form-panel>summary:hover {
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 24%, var(--card))
}

:root[data-theme="dark"] .course-tools-divider {
    background: var(--line)
}

:root[data-theme="dark"] .group-heading,
:root[data-theme="dark"] .past-heading,
:root[data-theme="dark"] .agenda-date-group summary {
    border-color: var(--line);
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 16%, var(--card));
    color: var(--ink)
}

:root[data-theme="dark"] .group-count,
:root[data-theme="dark"] .agenda-date-group summary b {
    background: #343c36;
    color: #c3ccc5
}

:root[data-theme="dark"] .course-section .course-card.status-passed,
:root[data-theme="dark"] .course-section .course-card.passed {
    background: #23372a;
    border-color: #355640
}

:root[data-theme="dark"] .course-section .course-card.status-passed .course-name,
:root[data-theme="dark"] .course-section .course-card.passed .course-name {
    color: #a8d5b5
}

:root[data-theme="dark"] .course-section .course-card.status-partial {
    background: #24372e;
    border-color: #355944
}

:root[data-theme="dark"] .course-section .course-card.status-scheduled {
    background: #242e3a;
    border-color: #38495b
}

:root[data-theme="dark"] .course-section .course-card.status-studying {
    background: #383122;
    border-color: #51452c
}

:root[data-theme="dark"] .course-section .course-card.status-try {
    background: #392c29;
    border-color: #523a35
}

:root[data-theme="dark"] .course-section .course-card.status-later {
    background: #292d2a;
    border-color: #3c423d
}

:root[data-theme="dark"] .status-pill {
    border-color: var(--line);
    background: #303732;
    color: #d0d8d2
}

:root[data-theme="dark"] .course-section .status-pill {
    background: rgba(17, 21, 18, .35)
}

:root[data-theme="dark"] .passed .status-pill,
:root[data-theme="dark"] .course-section .course-card.status-partial .status-pill {
    border-color: #41674d;
    background: #2a4833;
    color: #b6dfbf
}

:root[data-theme="dark"] .next-tag,
:root[data-theme="dark"] .elective-tag {
    background: #303b31;
    color: #b8cfb5
}

:root[data-theme="dark"] .past-tag {
    background: #333834;
    color: #bbc4bd
}

:root[data-theme="dark"] .course-credits {
    border-color: var(--line);
    color: var(--muted)
}

:root[data-theme="dark"] .calendar-cell {
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 10%, var(--card));
    color: var(--ink)
}

:root[data-theme="dark"] .calendar-cell.blank {
    background: transparent
}

:root[data-theme="dark"] button.calendar-cell:hover {
    border-color: var(--profile-line, #56645a);
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 24%, var(--card))
}

:root[data-theme="dark"] .calendar-cell.selected {
    border-color: var(--profile-accent, var(--green));
    background: var(--profile-wash, #2c3830)
}

:root[data-theme="dark"] .calendar-cell.today .calendar-number {
    color: #111713
}

:root[data-theme="dark"] .agenda-event,
:root[data-theme="dark"] .agenda-event.event-past {
    border-color: var(--line);
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 10%, var(--card));
    color: var(--ink)
}

:root[data-theme="dark"] .agenda-event.event-planned {
    border-color: #3e5061;
    background: #26323e
}

:root[data-theme="dark"] .agenda-date-group {
    border-color: var(--line)
}

:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .empty {
    border-color: #465149;
    color: var(--muted)
}

:root[data-theme="dark"] .edit-dialog,
:root[data-theme="dark"] .gate-card {
    border-color: var(--line);
    background: var(--paper);
    color: var(--ink)
}

:root[data-theme="dark"] .edit-dialog::backdrop {
    background: rgba(0, 0, 0, .65)
}

:root[data-theme="dark"] .gate {
    background: rgba(0, 0, 0, .58)
}

:root[data-theme="dark"] .gate-card {
    box-shadow: 0 25px 80px rgba(0, 0, 0, .48)
}

:root[data-theme="dark"] .auth-tabs {
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 22%, var(--card))
}

:root[data-theme="dark"] .auth-tab.active {
    background: var(--card);
    color: var(--profile-accent, var(--ink));
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2)
}

:root[data-theme="dark"] .auth-submit,
:root[data-theme="dark"] .edit-actions button[type=submit],
:root[data-theme="dark"] .gate-form button {
    background: var(--green, #347456);
    color: #fff
}

:root[data-theme="dark"] .text-button {
    color: color-mix(in srgb, var(--profile-accent, #9bd0ae) 64%, var(--ink))
}

:root[data-theme="dark"] .gate-error,
:root[data-theme="dark"] .electives-error {
    color: #f19a90
}

:root[data-theme="dark"] .electives-counter {
    background: #263d2d;
    color: #b6dfbf
}

:root[data-theme="dark"] .electives-counter.full {
    background: #303732;
    color: #c2cbc4
}

:root[data-theme="dark"] .electives-counter.limit {
    background: #463921;
    color: #f2d18d
}

:root[data-theme="dark"] .elective-item:hover,
:root[data-theme="dark"] .elective-item:has(input:checked) {
    border-color: var(--profile-line, #526359);
    background: color-mix(in srgb, var(--profile-wash, var(--card)) 38%, var(--card))
}

:root[data-theme="dark"] .elective-item:has(input:disabled) {
    opacity: .48
}

:root[data-theme="dark"] .elective-info em,
:root[data-theme="dark"] .study-session-copy em,
:root[data-theme="dark"] .study-list-group>h3,
:root[data-theme="dark"] .study-recovery h3,
:root[data-theme="dark"] .study-archive>summary {
    color: #c7d0c9
}

:root[data-theme="dark"] .study-form-panel[open]>summary {
    background: #252b27
}

:root[data-theme="dark"] .study-session {
    border-color: #39413b
}

:root[data-theme="dark"] .study-session.is-done {
    background: #252a26
}

:root[data-theme="dark"] .study-session.is-pending-today {
    border-color: #70453f;
    background: #3a2927
}

:root[data-theme="dark"] .study-session.is-pending-today .study-session-copy strong {
    color: #e2a79e
}

:root[data-theme="dark"] .study-session.is-pending-today .study-session-actions button {
    border-color: #70453f;
    background: #302523
}

:root[data-theme="dark"] .study-session.is-pending-today .study-session-actions button:hover {
    background: #48302d
}

:root[data-theme="dark"] .study-day.is-today {
    border-color: var(--profile-line, #526359);
    background: color-mix(in srgb, var(--profile-wash, #252b27) 38%, var(--card))
}

:root[data-theme="dark"] .profile-chip {
    color: #bbc5bd;
    --profile-wash: #292f2b;
    --profile-line: #414943
}

:root[data-theme="dark"] .profile-chip.active {
    color: var(--ink)
}

:root[data-theme="dark"] body[data-profile="samir"] {
    --profile-accent: #e88fb1;
    --profile-wash: #3b2932;
    --profile-line: #684454;
    --profile-surface: #2d252b;
    --profile-surface-raised: #352a32;
    --profile-surface-soft: #2a2329;
    --profile-surface-input: #1c191d
}

:root[data-theme="dark"] body[data-profile="giulia"] {
    --profile-accent: #b69be8;
    --profile-wash: #302a3b;
    --profile-line: #4c4061;
    --profile-surface: #292630;
    --profile-surface-raised: #302b39;
    --profile-surface-soft: #25222c;
    --profile-surface-input: #1b191f
}

:root[data-theme="dark"] body[data-profile="ciofy"] {
    --profile-accent: #8ab7e2;
    --profile-wash: #29343f;
    --profile-line: #3e566b;
    --profile-surface: #252a30;
    --profile-surface-raised: #2b3239;
    --profile-surface-soft: #22272d;
    --profile-surface-input: #191c20
}

:root[data-theme="dark"] body[data-profile="claudia"] {
    --profile-accent: #ed9292;
    --profile-wash: #392b2b;
    --profile-line: #594040;
    --profile-surface: #2d2626;
    --profile-surface-raised: #342a2a;
    --profile-surface-soft: #292222;
    --profile-surface-input: #1d1919
}

:root[data-theme="dark"] body[data-profile="momo"] {
    --profile-accent: #e3c46a;
    --profile-wash: #373326;
    --profile-line: #554c32;
    --profile-surface: #2c2a24;
    --profile-surface-raised: #343127;
    --profile-surface-soft: #28261f;
    --profile-surface-input: #1b1a16
}

:root[data-theme="dark"] body[data-profile="loreta"] {
    --profile-accent: #91c59c;
    --profile-wash: #29372d;
    --profile-line: #3d5944;
    --profile-surface: #252b27;
    --profile-surface-raised: #2b332d;
    --profile-surface-soft: #212722;
    --profile-surface-input: #191c19
}

:root[data-theme="dark"] .profile-chip[data-profile="samir"] {
    --profile-accent: #e88fb1;
    --profile-wash: #3b2932;
    --profile-line: #684454
}

:root[data-theme="dark"] .profile-chip[data-profile="giulia"] {
    --profile-accent: #b69be8;
    --profile-wash: #302a3b;
    --profile-line: #4c4061
}

:root[data-theme="dark"] .profile-chip[data-profile="ciofy"] {
    --profile-accent: #8ab7e2;
    --profile-wash: #29343f;
    --profile-line: #3e566b
}

:root[data-theme="dark"] .profile-chip[data-profile="claudia"] {
    --profile-accent: #ed9292;
    --profile-wash: #392b2b;
    --profile-line: #594040
}

:root[data-theme="dark"] .profile-chip[data-profile="momo"] {
    --profile-accent: #e3c46a;
    --profile-wash: #373326;
    --profile-line: #554c32
}

:root[data-theme="dark"] .profile-chip[data-profile="loreta"] {
    --profile-accent: #91c59c;
    --profile-wash: #29372d;
    --profile-line: #3d5944
}

:root[data-theme="dark"] .calendar-filter,
:root[data-theme="dark"] .lesson-year-head select {
    border-color: var(--line);
    background: #252b27;
    color: var(--ink)
}

:root[data-theme="dark"] .lesson-year-group,
:root[data-theme="dark"] .lesson-choice {
    border-color: var(--line);
    background: var(--card);
    color: var(--ink)
}

:root[data-theme="dark"] .lesson-choice:has(input:checked) {
    border-color: var(--profile-line, #526359);
    background: var(--profile-wash, #29332b)
}

:root[data-theme="dark"] .agenda-event.event-lesson {
    border-color: #3c4a55;
    background: #252e36
}

:root[data-theme="dark"] .dot-lesson {
    background: #91a8bd !important
}

:root[data-theme="dark"] .calendar-day-names .lesson-day-name {
    color: #a6bacb
}

:root[data-theme="dark"] .progress-track {
    background: #343b36
}

:root[data-theme="dark"] .edit-button {
    border-color: var(--line);
    background: #252b27;
    color: #c5d0c8
}

:root[data-theme="dark"] .calendar-day-names,
:root[data-theme="dark"] .calendar-dots b,
:root[data-theme="dark"] .study-day-empty {
    color: #a1ada5
}

:root[data-theme="dark"] .exam-row {
    border-top-color: rgba(231, 236, 232, .12)
}

:root[data-theme="dark"] .theme-toggle {
    min-width: 96px
}

.theme-icon {
    width: 16px;
    height: 16px;
    flex: none
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    line-height: 1
}

.theme-toggle svg {
    display: block;
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round
}

.notifications-toggle {
    position: relative;
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px
}

.notifications-toggle svg {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round
}

.useful-links {
    margin-top: 34px
}

.useful-links .section-heading {
    margin-bottom: 13px
}

.useful-links .section-title {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    font-weight: 630;
    letter-spacing: -.04em
}

.useful-links-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px
}

.useful-link-card {
    display: flex;
    min-width: 0;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease
}

.useful-link-card:hover {
    transform: translateY(-2px);
    border-color: #bdc9bf;
    box-shadow: var(--shadow)
}

.useful-link-card:focus-visible {
    outline: 2px solid var(--profile-accent, var(--green));
    outline-offset: 3px
}

.useful-link-copy {
    display: grid;
    min-width: 0;
    gap: 4px
}

.useful-link-copy strong {
    font-size: 12px;
    font-weight: 650
}

.useful-link-copy span {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4
}

.useful-link-arrow {
    flex: none;
    color: var(--muted);
    font-size: 17px
}

:root[data-theme="dark"] .useful-link-card:hover {
    border-color: #56655a
}

@media(max-width:680px) {
    .useful-links {
        margin-top: 27px
    }

    .useful-links-grid {
        grid-template-columns: 1fr;
        gap: 8px
    }

    .useful-link-card {
        min-height: 64px;
        padding: 12px 13px
    }
}

.notifications-badge {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 99px;
    background: #bf514d;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1
}

.notifications-dialog {
    width: min(560px, calc(100% - 28px));
    max-height: min(86dvh, 820px);
    overflow: hidden
}

.notifications-panel {
    display: grid;
    max-height: min(86dvh, 820px);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 12px;
    padding: 20px
}

.notifications-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px
}

.notifications-heading h2,
.announcement-form h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -.03em
}

.notifications-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px
}

.notifications-close {
    display: grid;
    width: 32px;
    height: 32px;
    flex: none;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--card);
    color: var(--muted);
    font-size: 21px;
    line-height: 1
}

.notifications-list {
    display: grid;
    min-height: 100px;
    max-height: 48dvh;
    align-content: start;
    gap: 8px;
    overflow: auto;
    padding: 2px
}

.announcement-card {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card)
}

.announcement-card.is-unread {
    border-color: color-mix(in srgb, var(--profile-accent, #64736a) 34%, var(--line));
    background: color-mix(in srgb, var(--profile-wash, #f7f7f8) 32%, var(--card))
}

.announcement-card-head,
.announcement-card-head>div,
.announcement-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

.announcement-card-head {
    justify-content: space-between
}

.announcement-card-head>div {
    flex-wrap: wrap
}

.announcement-author {
    color: var(--ink);
    font-size: 10px;
    font-weight: 650
}

.announcement-card time,
.announcement-read-state {
    color: var(--muted);
    font-size: 9px
}

.announcement-new {
    padding: 3px 7px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--profile-accent, #64736a) 15%, var(--card));
    color: var(--profile-accent, var(--ink));
    font-size: 9px;
    font-weight: 650
}

.announcement-card h3 {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 650
}

.announcement-card p {
    margin: 0;
    color: var(--ink);
    font-size: 11px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap
}

.announcement-actions {
    justify-content: flex-end
}

.announcement-actions button,
.notifications-read-all {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    color: var(--ink);
    font-size: 10px
}

.announcement-actions button:hover,
.notifications-read-all:hover {
    border-color: var(--profile-line, #c9d8ce);
    background: var(--profile-wash, #f7f7f8)
}

.announcement-delete {
    color: #a54e46 !important
}

.notifications-empty,
.notifications-error {
    margin: 0;
    padding: 12px;
    color: var(--muted);
    font-size: 11px;
    text-align: center
}

.notifications-error {
    color: #a54e46
}

.notifications-read-all {
    justify-self: end
}

.announcement-form {
    display: grid;
    gap: 9px;
    padding-top: 12px;
    border-top: 1px solid var(--line)
}

.announcement-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 10px
}

.announcement-audience {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 12px;
    min-width: 0;
    margin: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 9px
}

.announcement-audience legend {
    padding: 0 4px;
    color: var(--muted);
    font-size: 10px
}

.announcement-audience-option,
.announcement-recipient-list label {
    display: inline-flex !important;
    align-items: center;
    gap: 6px !important;
    color: var(--ink) !important;
    font-size: 10px !important;
    cursor: pointer
}

.announcement-audience input,
.announcement-recipient-list input {
    width: 14px !important;
    height: 14px;
    margin: 0;
    accent-color: var(--profile-accent, var(--green))
}

.announcement-recipient-list {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    padding-top: 6px
}

.announcement-form input:not([type="radio"]):not([type="checkbox"]),
.announcement-form textarea {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--paper);
    color: var(--ink);
    font-size: 12px
}

.announcement-form textarea {
    min-height: 78px;
    resize: vertical
}

.announcement-message {
    min-height: 0;
    margin: 0;
    color: var(--muted);
    font-size: 10px
}

:root[data-theme="dark"] .notifications-close,
:root[data-theme="dark"] .announcement-actions button,
:root[data-theme="dark"] .notifications-read-all {
    border-color: var(--line);
    background: #252b27;
    color: var(--ink)
}

:root[data-theme="dark"] .announcement-audience {
    border-color: var(--line);
    background: #191e1b
}

:root[data-theme="dark"] .announcement-form input,
:root[data-theme="dark"] .announcement-form textarea {
    border-color: var(--line);
    background: #191e1b;
    color: var(--ink)
}

.theme-icon-sun {
    display: none
}

:root[data-theme="dark"] .theme-icon-moon {
    display: none
}

:root[data-theme="dark"] .theme-icon-sun {
    display: block
}

:root[data-theme="dark"] .general-notes {
    border-top-color: var(--line)
}

:root[data-theme="dark"] .general-notes textarea {
    border-color: var(--line);
    background: #191e1b;
    color: var(--ink)
}

:root[data-theme="dark"] .general-notes textarea::placeholder {
    color: #89958d
}

.course-note-add {
    display: inline-flex;
    width: fit-content;
    align-self: start;
    justify-self: start;
    margin-top: 2px;
    align-items: center;
    gap: 5px;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: #879188;
    font: inherit;
    font-size: 10px;
    cursor: pointer
}

.course-note-add:hover {
    color: var(--profile-accent, #60656e)
}

@media(min-width:761px) {
    .course-note-add {
        min-height: 32px;
        padding: 5px 8px;
        border: 1px dashed var(--profile-line, #dfe5de);
        border-radius: 8px;
        background: rgba(255, 255, 255, .42)
    }

    .course-note-add:hover {
        border-color: var(--profile-accent, #60656e);
        background: var(--profile-wash, #f8f9f6)
    }
}

.course-note-add svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round
}

:root[data-theme="dark"] .course-note-add {
    color: #a1ada5
}

@media(min-width:761px) {
    :root[data-theme="dark"] .course-note-add {
        border-color: var(--profile-line, var(--line));
        background: rgba(25, 30, 27, .5)
    }

    :root[data-theme="dark"] .course-note-add:hover {
        border-color: var(--profile-accent, #a1ada5);
        background: var(--profile-wash, #252b27)
    }
}

:root[data-theme="dark"] .progress-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none
}

:root[data-theme="dark"] .toolbar {
    background: transparent;
    border: 0;
    border-radius: 0
}

:root[data-theme="dark"] .search-wrap {
    border-color: var(--line);
    border-radius: 16px;
    background: #252b27
}

:root[data-theme="dark"] .search-wrap:focus-within {
    border-color: #56645a;
    background: #252b27;
    box-shadow: 0 0 0 3px rgba(120, 176, 146, .13)
}

:root[data-theme="dark"] .search-wrap .search,
:root[data-theme="dark"] .search-wrap .search:focus {
    border: 0;
    background: transparent;
    box-shadow: none
}

:root[data-theme="dark"] .agenda-card.past-agenda {
    background: var(--card)
}

:root[data-theme="dark"] .past-agenda .past-heading {
    border: 0;
    background: transparent;
    box-shadow: none
}

:root[data-theme="dark"] .past-agenda .past-heading:hover {
    background: #252b27
}

:root[data-theme="dark"] .past-agenda .agenda-date-group {
    border-color: var(--line)
}

:root[data-theme="dark"] .past-agenda .agenda-date-group summary {
    background: #202521
}

:root[data-theme="dark"] .past-heading:hover .group-chevron {
    background: #343c36
}

:root[data-theme="dark"] .course-title-row .course-credits {
    border-color: #414943;
    border-radius: 8px;
    background: #303732;
    color: #c5d0c8
}

.course-card-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 16px;
    align-items: start
}

.course-card-layout.has-split-modules {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px
}

.course-card-layout.has-note-action {
    grid-template-columns: minmax(0, 1.1fr) minmax(100px, .9fr);
    gap: 12px;
    align-items: center
}

.course-card-layout.has-split-modules .course-status-row {
    margin-top: 8px;
    padding-top: 0
}

.course-card-layout.has-split-modules .course-components {
    margin-top: 8px
}

.course-card-layout.has-split-modules.has-note-action .course-note-add {
    grid-column: 1;
    justify-self: end;
    align-self: end;
    width: fit-content;
    min-height: 0;
    margin-top: 0;
    padding: 4px 8px
}

.course-components {
    gap: 6px
}

.course-card-layout.has-note-action .course-status-row {
    margin-top: 8px
}

.course-card-layout.has-note-action .course-note-add {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: end;
    width: fit-content;
    min-height: 0;
    margin: 0;
    padding: 4px 8px
}

.course-card-layout.has-split-modules.has-note-action {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px
}

.course-card-layout.has-split-modules.has-note-action .course-note-add {
    grid-column: 1;
    grid-row: auto;
    justify-self: end;
    align-self: end
}

.course-card-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start
}

.course-card-head {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px
}

.course-card-head>div {
    min-width: 0
}

.course-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 10px
}

.course-status-row .edit-button {
    margin: 0
}

.attendance-summary {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 4px 8px;
    width: min(100%, 260px);
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid color-mix(in srgb, var(--profile-accent, #668f7a) 17%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--profile-wash, #f5f7f3) 45%, var(--card));
    font-variant-numeric: tabular-nums
}

.attendance-summary-label {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .04em;
    text-transform: uppercase
}

.attendance-summary>strong {
    color: var(--ink);
    font-size: 12px;
    font-weight: 680
}

.attendance-summary>strong span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500
}

.attendance-summary-percent {
    color: var(--profile-accent, #668f7a);
    font-size: 12px;
    font-weight: 700
}

.attendance-summary-track {
    grid-column: 1 / -1;
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: color-mix(in srgb, var(--profile-accent, #668f7a) 12%, var(--line))
}

.attendance-summary-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--profile-accent, #668f7a);
    transition: width .2s ease
}

.day-lesson-attendance {
    display: grid;
    gap: 5px
}

.day-lesson-attendance .agenda-event {
    border-color: color-mix(in srgb, var(--profile-accent, #71869c) 12%, var(--line));
    background: color-mix(in srgb, var(--profile-accent, #71869c) 5%, var(--card))
}

.day-attendance-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding-left: 8px
}

.day-attendance-controls button,
.day-attendance-status {
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--card);
    color: var(--muted);
    font-size: 9px;
    line-height: 1.2
}

.day-attendance-controls button:hover {
    border-color: var(--profile-line, #a8c3ae);
    color: var(--profile-accent, var(--green))
}

.day-attendance-controls button.is-present,
.day-attendance-status.is-present {
    border-color: #c8e1ce;
    background: #eaf5ec;
    color: #286342
}

.day-attendance-controls button.is-absent,
.day-attendance-status.is-absent {
    border-color: #efd8d3;
    background: #fbefed;
    color: #9b5148
}

.day-attendance-controls .attendance-clear {
    border-color: transparent;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 2px
}

.day-attendance-status {
    justify-self: start;
    margin-left: 8px
}

.course-components {
    display: grid;
    width: 100%;
    gap: 8px;
    margin-top: 12px
}

.course-component {
    --module-accent: var(--profile-accent, #78847a);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(138px, .72fr);
    align-items: center;
    gap: 7px 12px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--module-accent) 13%, var(--line));
    border-left: 2px solid color-mix(in srgb, var(--module-accent) 52%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--profile-wash, #f5f7f3) 35%, var(--card));
    transition: background .16s ease, border-color .16s ease
}

.course-component[data-module-state="passed"] {
    border-color: #d5e5d8;
    border-left-color: #73a681;
    background: #f4f8f4
}

.course-component[data-module-state="scheduled"] {
    border-color: #dce5f0;
    border-left-color: #8299bb;
    background: #f7f9fc
}

.course-component[data-module-state="studying"] {
    border-color: #e8ddc8;
    border-left-color: #c19a58;
    background: #fbf8f1
}

.course-component[data-module-state="partial"] {
    border-color: #d5e5d8;
    border-left-color: #73a681;
    background: #f4f8f4
}

.course-component-heading {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 7px
}

.course-component-heading strong {
    min-width: 0;
    font-size: 11px;
    font-weight: 620;
    line-height: 1.35
}

.course-component-heading span {
    flex: none;
    color: color-mix(in srgb, var(--module-accent) 78%, var(--muted));
    font-size: 9px;
    font-weight: 600;
    font-variant-numeric: tabular-nums
}

.course-component-state {
    grid-column: 2;
    color: var(--muted);
    font-size: 10px;
    text-align: right
}

.course-component-status,
.course-component-date,
.course-component-grade {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 9px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 10px
}

.course-component-date,
.course-component-grade {
    grid-column: 2
}

:root[data-theme="dark"] .course-component {
    border-color: color-mix(in srgb, var(--module-accent) 24%, var(--line));
    border-left-color: color-mix(in srgb, var(--module-accent) 68%, var(--line));
    background: color-mix(in srgb, var(--card) 88%, var(--profile-wash, #252b27));
    box-shadow: none
}

:root[data-theme="dark"] .course-component[data-module-state="passed"],
:root[data-theme="dark"] .course-component[data-module-state="partial"] {
    border-color: #355640;
    border-left-color: #79ac86;
    background: #202d24
}

:root[data-theme="dark"] .course-component[data-module-state="scheduled"] {
    border-color: #38495b;
    border-left-color: #8299bb;
    background: #202832
}

:root[data-theme="dark"] .course-component[data-module-state="studying"] {
    border-color: #514735;
    border-left-color: #c19a58;
    background: #2b2820
}

:root[data-theme="dark"] .course-component-status,
:root[data-theme="dark"] .course-component-date,
:root[data-theme="dark"] .course-component-grade {
    border-color: var(--line);
    background: #191e1b;
    color: var(--ink)
}

.course-note-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    padding: 10px 11px;
    border: 1px solid #e8ebe6;
    border-radius: 10px;
    background: rgba(255, 255, 255, .68)
}

.course-note-panel label {
    color: #7c877f;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .08em
}

.course-note-panel textarea {
    width: 100%;
    min-height: 32px;
    overflow: hidden;
    resize: none;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 11px;
    line-height: 1.45;
    text-transform: none
}

.course-note-panel textarea::placeholder {
    color: #9ba39d
}

.course-note-panel textarea[readonly] {
    cursor: default
}

.note-save-status {
    min-height: 12px;
    color: #879188;
    font-size: 9px
}

.status-custom .group-indicator {
    background: var(--custom-status-color, #789)
}

.course-section.status-custom .course-card {
    border-left: 2px solid var(--custom-status-color, #789)
}

.course-section.status-custom .status-pill {
    background: color-mix(in srgb, var(--custom-status-color, #789) 12%, white);
    color: var(--ink)
}

.custom-status-list {
    display: grid;
    gap: 7px
}

.custom-status-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--card)
}

.custom-status-swatch {
    width: 12px;
    height: 12px;
    flex: none;
    border-radius: 50%;
    background: var(--custom-status-color)
}

.custom-status-item strong {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 550
}

.custom-status-item button {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 5px 8px;
    background: var(--card);
    color: var(--muted);
    font-size: 10px
}

.custom-status-item input[type=color] {
    width: 32px;
    flex: none;
    padding: 3px
}

.custom-status-item input[type=text] {
    min-width: 0;
    flex: 1;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-size: 11px
}

.statuses-intro {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5
}

.edit-form input[type=color] {
    width: 64px;
    height: 38px;
    padding: 4px
}

.course-note-panel:focus-within {
    border-color: #bfcfc2;
    box-shadow: 0 0 0 2px rgba(76, 128, 88, .08)
}

:root[data-theme="dark"] .attendance-summary {
    border-color: #38443b;
    background: #222923
}

:root[data-theme="dark"] .attendance-summary-track {
    background: #38443b
}

:root[data-theme="dark"] .day-lesson-attendance .agenda-event {
    border-color: color-mix(in srgb, var(--profile-accent, #91a8bd) 22%, var(--line));
    background: color-mix(in srgb, var(--profile-accent, #91a8bd) 9%, var(--card))
}

:root[data-theme="dark"] .day-attendance-controls button,
:root[data-theme="dark"] .day-attendance-status {
    border-color: var(--line);
    background: #262d28;
    color: #c5cec7
}

:root[data-theme="dark"] .day-attendance-controls button.is-present,
:root[data-theme="dark"] .day-attendance-status.is-present {
    border-color: #3e6749;
    background: #26392c;
    color: #a8d2af
}

:root[data-theme="dark"] .day-attendance-controls button.is-absent,
:root[data-theme="dark"] .day-attendance-status.is-absent {
    border-color: #70453f;
    background: #3a2927;
    color: #e2a79e
}

:root[data-theme="dark"] .course-note-panel {
    border-color: #39413b;
    background: #252b27
}

:root[data-theme="dark"] .course-note-panel label,
:root[data-theme="dark"] .course-note-panel textarea::placeholder,
:root[data-theme="dark"] .note-save-status {
    color: #a1ada5
}

:root[data-theme="dark"] .custom-status-item {
    border-color: var(--line);
    background: #252b27
}

:root[data-theme="dark"] .custom-status-item button {
    border-color: var(--line);
    background: #191e1b;
    color: var(--ink)
}

@media(max-width:760px) {
    .course-card-layout {
        grid-template-columns: 1fr;
        gap: 10px
    }

    .course-card-layout.has-note-action {
        grid-template-columns: 1fr;
        gap: 10px
    }

    .course-card-layout.has-note-action .course-note-add {
        grid-column: 1;
        grid-row: auto;
        justify-self: end;
        align-self: end;
        margin: 0
    }

    .course-card-layout.has-split-modules.has-note-action {
        grid-template-columns: 1fr
    }

    .course-component {
        grid-template-columns: minmax(0, 1fr) minmax(120px, .85fr);
        gap: 7px 9px;
        padding: 9px 10px
    }

    .course-status-row {
        margin-top: 8px;
        padding-top: 0
    }

    .course-note-panel {
        padding: 9px
    }

    .course-note-panel textarea {
        min-height: 0
    }
}

/* Refined subject cards: calm surfaces, resilient layouts, and clearer reading order. */
.course-section .course-grid {
    align-items: stretch;
    gap: 10px;
    padding: 10px
}

.course-section .course-card {
    --card-accent: color-mix(in srgb, var(--profile-accent, #64736a) 38%, var(--muted));
    position: relative;
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid color-mix(in srgb, var(--card-accent) 11%, var(--line));
    border-radius: 15px;
    background: var(--card);
    box-shadow: 0 1px 2px rgba(25, 35, 29, .025);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease
}

.course-section .course-card:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--card-accent) 22%, var(--line));
    background: color-mix(in srgb, var(--profile-wash, #f7f7f8) 8%, var(--card));
    box-shadow: 0 4px 14px rgba(25, 35, 29, .055)
}

.course-card-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 16px;
    align-items: stretch
}

.course-card-layout.has-split-modules {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px
}

.course-card-layout.has-note-action {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: stretch
}

.course-card-layout.has-note-panel {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 16px;
    align-items: stretch
}

.course-card-layout.has-split-modules.has-note-panel {
    grid-template-columns: minmax(0, 1fr)
}

.course-card-layout.has-split-modules.has-note-action {
    grid-template-columns: minmax(0, 1fr) minmax(110px, .35fr)
}

.course-card-layout.is-info-only {
    grid-template-columns: minmax(0, 1fr)
}

.course-card-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0
}

.course-card-head {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px
}

.course-card-head>div {
    flex: 1;
    min-width: 0
}

.course-card-head .edit-button {
    position: absolute;
    z-index: 1;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--card-accent) 14%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--profile-wash, #f7f7f8) 32%, var(--card));
    color: var(--muted);
    transition: border-color .16s ease, background .16s ease, color .16s ease
}

.course-card-head .edit-button:hover {
    border-color: color-mix(in srgb, var(--card-accent) 42%, var(--line));
    background: var(--profile-wash, #f7f7f8);
    color: var(--card-accent)
}

.course-card-layout.has-edit-button .course-card-head > div {
    padding-right: 38px
}

.course-card-layout.has-note-panel .course-note-slot {
    align-self: start;
    height: fit-content
}

.course-title-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    min-width: 0
}

.course-title-row .course-name {
    flex: 0 1 auto;
    width: fit-content;
    min-width: 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 620;
    line-height: 1.4;
    letter-spacing: -.018em;
    overflow-wrap: anywhere
}

.course-title-row .course-credits {
    flex: none;
    margin-top: 0;
    padding: 2px 8px;
    border-color: color-mix(in srgb, var(--card-accent) 13%, var(--line));
    border-radius: 99px;
    background: color-mix(in srgb, var(--profile-wash, #f7f7f8) 55%, var(--card));
    color: var(--muted);
    font-size: 9px;
    font-weight: 560
}

.course-section .course-card .course-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    min-height: 18px;
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35
}

.course-section .course-card .year-tag {
    flex: none;
    color: var(--muted);
    font-size: 9px;
    font-variant-numeric: tabular-nums
}

.course-section .course-card .elective-tag,
.course-section .course-card .next-tag,
.course-section .course-card .past-tag {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 99px;
    font-size: 9px;
    line-height: 1.2;
    overflow-wrap: anywhere
}

.course-section .course-card .elective-tag {
    background: color-mix(in srgb, var(--card-accent) 8%, var(--card));
    color: var(--muted)
}

.course-section .course-card .next-tag {
    background: color-mix(in srgb, var(--card-accent) 10%, var(--card));
    color: color-mix(in srgb, var(--card-accent) 82%, var(--ink))
}

.course-section .course-card .past-tag {
    background: color-mix(in srgb, var(--muted) 8%, var(--card));
    color: var(--muted)
}

.course-status-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 7px;
    margin-top: auto;
    padding-top: 14px
}

.course-status-row .course-note-add {
    flex: none;
    min-height: 32px;
    margin: 0 0 0 auto;
    padding: 4px 0 4px 8px;
    white-space: nowrap
}

.course-note-slot {
    display: flex;
    min-width: 0;
    align-items: flex-end;
    justify-content: flex-end;
    align-self: end;
    padding-bottom: 2px
}

.course-card-layout.has-note-action .course-note-slot .course-note-add,
.course-card-layout.has-split-modules.has-note-action .course-note-slot .course-note-add {
    display: inline-flex;
    width: auto;
    min-height: 32px;
    justify-self: auto;
    align-self: auto;
    grid-column: auto;
    grid-row: auto;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 0;
    padding: 4px 0 4px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 10px;
    transition: color .16s ease, background-color .16s ease
}

.course-note-slot .course-note-add:hover {
    background: color-mix(in srgb, var(--profile-wash, #f7f7f8) 58%, transparent);
    color: var(--card-accent)
}

.course-note-slot .course-note-add span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: nowrap
}

.course-note-slot .course-note-add svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.8
}

.course-status-row .edit-button {
    margin: 0;
    border-radius: 9px
}

.course-status-row .status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 25px;
    padding: 4px 9px;
    border: 1px solid color-mix(in srgb, var(--card-accent) 10%, var(--line));
    border-radius: 99px;
    background: color-mix(in srgb, var(--muted) 5%, var(--card));
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
    overflow-wrap: anywhere
}

.course-section .course-card.status-passed .course-status-row .status-pill,
.course-section .course-card.status-partial .course-status-row .status-pill {
    border-color: color-mix(in srgb, #55936b 20%, var(--line));
    background: color-mix(in srgb, #55936b 9%, var(--card));
    color: color-mix(in srgb, #347248 82%, var(--ink))
}

.course-section .course-card.status-scheduled .course-status-row .status-pill {
    border-color: color-mix(in srgb, #7892b2 20%, var(--line));
    background: color-mix(in srgb, #7892b2 8%, var(--card));
    color: color-mix(in srgb, #58769b 85%, var(--ink))
}

.course-section .course-card.status-studying .course-status-row .status-pill {
    border-color: color-mix(in srgb, #bf995c 20%, var(--line));
    background: color-mix(in srgb, #bf995c 8%, var(--card));
    color: color-mix(in srgb, #8a6428 82%, var(--ink))
}

.course-section .course-card.status-try .course-status-row .status-pill {
    border-color: color-mix(in srgb, #c27969 20%, var(--line));
    background: color-mix(in srgb, #c27969 8%, var(--card));
    color: color-mix(in srgb, #8c5144 82%, var(--ink))
}

.course-section .course-card.status-later .course-status-row .status-pill {
    background: color-mix(in srgb, var(--muted) 7%, var(--card))
}

.course-card-layout.has-note-action .course-status-row {
    margin-top: auto
}

.course-card-layout.has-note-action,
.course-card-layout.has-split-modules.has-note-action {
    grid-template-columns: minmax(0, 1fr)
}

.course-card-layout.has-note-action .course-status-row .course-note-add {
    align-self: center
}

.course-card-layout.has-note-action .course-note-slot {
    display: none
}

.course-card-layout.has-note-panel .course-status-row {
    margin-top: auto
}

.course-card-layout.has-split-modules .course-status-row {
    margin-top: auto;
    padding-top: 12px
}

.course-card-layout.has-split-modules .course-components {
    margin-top: 8px
}

.course-component {
    grid-template-columns: minmax(0, 1fr) minmax(112px, .72fr);
    gap: 8px 12px;
    padding: 11px 12px;
    border-radius: 12px
}

.course-component-heading strong {
    overflow-wrap: anywhere
}

.course-note-panel {
    width: 100%;
    height: fit-content;
    min-height: 0;
    align-self: start;
    padding: 10px 12px;
    border-color: color-mix(in srgb, var(--card-accent) 8%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--profile-wash, #f7f7f8) 10%, var(--card));
    transition: border-color .16s ease, box-shadow .16s ease
}

.course-note-panel:focus-within {
    border-color: color-mix(in srgb, var(--card-accent) 42%, var(--line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-accent) 10%, transparent)
}

.course-note-panel label {
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .08em;
    text-transform: uppercase
}

.course-note-panel textarea {
    display: block;
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-transform: lowercase
}

.course-note-panel .note-save-status {
    min-height: 0;
    margin-top: 0
}

.course-section.status-custom .course-card {
    border-left: 3px solid var(--custom-status-color, #789);
    padding-left: 14px
}

.course-section.status-custom .status-pill {
    background: color-mix(in srgb, var(--custom-status-color, #789) 10%, var(--card));
    color: var(--ink)
}

:root[data-theme="dark"] .course-card-head .edit-button {
    border-color: color-mix(in srgb, var(--card-accent) 26%, var(--line));
    background: color-mix(in srgb, var(--profile-wash, #252b27) 28%, var(--card));
    color: var(--ink)
}

:root[data-theme="dark"] .course-card-head .edit-button:hover {
    border-color: color-mix(in srgb, var(--card-accent) 48%, var(--line));
    background: color-mix(in srgb, var(--profile-wash, #252b27) 46%, var(--card));
    color: var(--card-accent)
}

:root[data-theme="dark"] .course-note-slot .course-note-add {
    color: var(--muted)
}

:root[data-theme="dark"] .course-note-slot .course-note-add:hover {
    background: color-mix(in srgb, var(--profile-wash, #252b27) 58%, transparent);
    color: var(--card-accent)
}

:root[data-theme="dark"] .course-section .course-card {
    --card-accent: color-mix(in srgb, var(--profile-accent, #9ba99f) 38%, var(--muted));
    border-color: color-mix(in srgb, var(--card-accent) 16%, var(--line));
    background: var(--card);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .12)
}

:root[data-theme="dark"] .course-section .course-card:hover {
    border-color: color-mix(in srgb, var(--card-accent) 38%, var(--line));
    background: color-mix(in srgb, var(--profile-wash, #252b27) 18%, var(--card));
    box-shadow: 0 5px 16px rgba(0, 0, 0, .2)
}

:root[data-theme="dark"] .course-title-row .course-name {
    color: var(--ink)
}

:root[data-theme="dark"] .course-section .course-card .course-credits {
    border-color: color-mix(in srgb, var(--card-accent) 20%, var(--line));
    background: color-mix(in srgb, var(--profile-wash, #252b27) 42%, var(--card));
    color: var(--muted)
}

:root[data-theme="dark"] .course-section .course-card .next-tag {
    background: color-mix(in srgb, #7892b2 17%, var(--card));
    color: #c0d1e6
}

:root[data-theme="dark"] .course-section .course-card .past-tag,
:root[data-theme="dark"] .course-section .course-card .elective-tag {
    background: color-mix(in srgb, var(--muted) 12%, var(--card));
    color: var(--muted)
}

:root[data-theme="dark"] .course-section .course-card .status-pill {
    border-color: color-mix(in srgb, var(--card-accent) 18%, var(--line));
    background: color-mix(in srgb, var(--muted) 9%, var(--card));
    color: var(--ink)
}

:root[data-theme="dark"] .course-section .course-card.status-passed .course-status-row .status-pill,
:root[data-theme="dark"] .course-section .course-card.status-partial .course-status-row .status-pill {
    border-color: #41674d;
    background: #2a4833;
    color: #b6dfbf
}

:root[data-theme="dark"] .course-section .course-card.status-scheduled .course-status-row .status-pill {
    border-color: #38495b;
    background: #2b3745;
    color: #c0d1e6
}

:root[data-theme="dark"] .course-section .course-card.status-studying .course-status-row .status-pill {
    border-color: #514735;
    background: #383122;
    color: #e0c487
}

:root[data-theme="dark"] .course-section .course-card.status-try .course-status-row .status-pill {
    border-color: #523a35;
    background: #392c29;
    color: #e4aaa0
}

:root[data-theme="dark"] .course-section .course-card.status-later .course-status-row .status-pill {
    background: #303531;
    color: #c1c9c3
}

:root[data-theme="dark"] .course-section.status-custom .course-card {
    border-left-color: var(--custom-status-color, #789);
    background: color-mix(in srgb, var(--custom-status-color, #789) 6%, var(--card))
}

:root[data-theme="dark"] .course-section.status-custom .status-pill {
    background: color-mix(in srgb, var(--custom-status-color, #789) 16%, var(--card));
    color: var(--ink)
}

:root[data-theme="dark"] .course-note-panel {
    border-color: var(--line);
    background: color-mix(in srgb, var(--profile-wash, #252b27) 22%, var(--card))
}

@media(max-width:900px) {
    .course-section .course-grid {
        grid-template-columns: minmax(0, 1fr)
    }
}

@media(max-width:760px) {
    .course-card-layout,
    .course-card-layout.has-note-action,
    .course-card-layout.has-note-panel,
    .course-card-layout.has-split-modules.has-note-action {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px
    }

    .course-card-layout.has-note-panel .course-note-slot,
    .course-card-layout.has-note-panel .course-note-panel {
        align-self: start;
        height: fit-content
    }

    .course-card-layout.has-split-modules,
    .course-card-layout.has-split-modules.has-note-action {
        grid-template-columns: minmax(0, 1fr)
    }

    .course-note-slot {
        align-self: start;
        justify-content: flex-end;
        padding: 0
    }

    .course-status-row {
        justify-content: space-between;
        flex-wrap: nowrap
    }

    .course-status-row .status-pill {
        min-width: 0
    }

    .course-section .course-card {
        padding: 14px
    }

    .course-section.status-custom .course-card {
        padding-left: 12px
    }

    .course-component {
        grid-template-columns: minmax(0, 1fr) minmax(118px, .8fr);
        gap: 8px 10px
    }
}

@media(max-width:520px) {
    .course-section .course-grid {
        padding: 7px;
        gap: 7px
    }

    .course-section .course-card {
        padding: 13px
    }

    .course-section.status-custom .course-card {
        padding-left: 11px
    }

    .course-title-row {
        flex-wrap: nowrap
    }

    .course-card-head {
        gap: 4px
    }

    .course-component {
        grid-template-columns: minmax(0, 1fr) minmax(106px, .72fr);
        gap: 7px
    }

    .course-component-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px
    }
}

.course-section .course-card.status-passed,
.course-section .course-card.passed {
    background: color-mix(in srgb, #55936b 5%, var(--card));
    border-color: color-mix(in srgb, #55936b 18%, var(--line))
}

.course-section .course-card.status-partial {
    background: color-mix(in srgb, #55936b 7%, var(--card));
    border-color: color-mix(in srgb, #55936b 21%, var(--line))
}

.course-section .course-card.status-scheduled {
    background: color-mix(in srgb, #7892b2 6%, var(--card));
    border-color: color-mix(in srgb, #7892b2 19%, var(--line))
}

.course-section .course-card.status-studying {
    background: color-mix(in srgb, #bf995c 7%, var(--card));
    border-color: color-mix(in srgb, #bf995c 20%, var(--line))
}

.course-section .course-card.status-try {
    background: color-mix(in srgb, #c27969 6%, var(--card));
    border-color: color-mix(in srgb, #c27969 18%, var(--line))
}

.course-section .course-card.status-later {
    background: color-mix(in srgb, var(--muted) 5%, var(--card));
    border-color: color-mix(in srgb, var(--muted) 16%, var(--line))
}

:root[data-theme="dark"] .course-section .course-card.status-passed,
:root[data-theme="dark"] .course-section .course-card.passed {
    background: color-mix(in srgb, #55936b 18%, var(--card));
    border-color: #355640
}

:root[data-theme="dark"] .course-section .course-card.status-partial {
    background: color-mix(in srgb, #55936b 20%, var(--card));
    border-color: #355944
}

:root[data-theme="dark"] .course-section .course-card.status-scheduled {
    background: color-mix(in srgb, #7892b2 20%, var(--card));
    border-color: #38495b
}

:root[data-theme="dark"] .course-section .course-card.status-studying {
    background: color-mix(in srgb, #bf995c 20%, var(--card));
    border-color: #51452c
}

:root[data-theme="dark"] .course-section .course-card.status-try {
    background: color-mix(in srgb, #c27969 18%, var(--card));
    border-color: #523a35
}

:root[data-theme="dark"] .course-section .course-card.status-later {
    background: color-mix(in srgb, var(--muted) 12%, var(--card));
    border-color: #3c423d
}

@media(max-width:430px) {
    .notifications-toggle {
        width: 36px;
        min-width: 36px;
        padding: 8px
    }

    .notifications-toggle>span:not(.notifications-badge) {
        display: none
    }

    .notifications-dialog {
        width: calc(100% - 20px)
    }

    .notifications-panel {
        padding: 14px
    }

    .course-card-layout {
        grid-template-columns: 1fr
    }

    .course-component {
        grid-template-columns: minmax(0, 1fr) minmax(112px, .8fr);
        gap: 7px;
        padding: 9px
    }

    .course-component-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px
    }

    .course-component-heading strong {
        overflow-wrap: anywhere
    }

    .course-component-status,
    .course-component-date,
    .course-component-grade {
        padding: 7px
    }

    .course-note-panel textarea {
        min-height: 32px
    }
}

/* Profile-aware accents unify actions and navigation; status colors stay semantic. */
body[data-profile] {
    --green: color-mix(in srgb, var(--profile-accent) 68%, var(--ink));
    --green-hover: color-mix(in srgb, var(--green) 88%, var(--ink));
    --mint: color-mix(in srgb, var(--profile-wash) 74%, var(--card));
    --lime: color-mix(in srgb, var(--profile-accent) 12%, var(--card))
}

:root[data-theme="dark"] body[data-profile] {
    --green: color-mix(in srgb, var(--profile-accent) 46%, var(--paper));
    --green-hover: color-mix(in srgb, var(--green) 88%, var(--paper));
    --mint: color-mix(in srgb, var(--profile-wash) 74%, var(--card));
    --lime: color-mix(in srgb, var(--profile-accent) 24%, var(--card))
}

/* Keep the profile identity subtle in subjects, where status colors carry the meaning. */
body[data-profile] .course-section {
    border-color: color-mix(in srgb, var(--profile-accent) 8%, var(--line))
}

body[data-profile] .course-section .group-heading {
    border-bottom-color: color-mix(in srgb, var(--profile-accent) 7%, var(--line));
    background: color-mix(in srgb, var(--profile-wash) 22%, var(--card))
}

body[data-profile] .course-section .group-count {
    background: color-mix(in srgb, var(--profile-accent) 6%, var(--card));
    color: var(--muted)
}

body[data-profile] .view-tab.active:after {
    background: color-mix(in srgb, var(--profile-accent) 62%, var(--ink))
}

body[data-profile] .calendar-cell.selected {
    background: color-mix(in srgb, var(--profile-wash) 34%, var(--card))
}

body[data-profile] .calendar-cell.today .calendar-number {
    color: #fff
}

body[data-profile] .auth-submit,
body[data-profile] .edit-actions button[type=submit],
body[data-profile] .gate-form button,
body[data-profile] .view-tab.active:not(:focus-visible) {
    box-shadow: 0 2px 7px color-mix(in srgb, var(--profile-accent) 16%, transparent)
}

:root[data-theme="dark"] body[data-profile] .view-tab.active:after {
    background: color-mix(in srgb, var(--profile-accent) 70%, var(--ink))
}

:root[data-theme="dark"] body[data-profile] .calendar-cell.selected {
    background: color-mix(in srgb, var(--profile-wash) 55%, var(--card))
}

body[data-profile] .study-metric {
    border-color: color-mix(in srgb, var(--profile-accent) 18%, var(--line));
    background: color-mix(in srgb, var(--profile-wash) 58%, var(--card))
}

:root[data-theme="dark"] body[data-profile] .course-section .group-heading {
    background: color-mix(in srgb, var(--profile-wash) 22%, var(--card))
}

:root[data-theme="dark"] body[data-profile] .course-section .group-count {
    background: color-mix(in srgb, var(--profile-accent) 12%, var(--card));
    color: var(--muted)
}

:root[data-theme="dark"] body[data-profile] .study-metric {
    background: color-mix(in srgb, var(--profile-wash) 58%, var(--card))
}

/* A restrained neutral surface system keeps profile color present without tinting every panel green. */
body[data-profile] {
    --surface-base: var(--profile-surface, color-mix(in srgb, var(--profile-wash) 4%, var(--card)));
    --surface-raised: var(--profile-surface-raised, color-mix(in srgb, var(--profile-wash) 7%, var(--card)));
    --surface-soft: var(--profile-surface-soft, color-mix(in srgb, var(--profile-wash) 15%, #f7f6f8));
    --surface-hover: color-mix(in srgb, var(--profile-wash) 28%, #f4f2f6);
    --surface-input: var(--profile-surface-input, color-mix(in srgb, var(--profile-wash) 5%, #fff));
    --surface-line: color-mix(in srgb, var(--profile-accent) 13%, var(--line))
}

:root[data-theme="dark"] body[data-profile] {
    --surface-base: var(--profile-surface, color-mix(in srgb, var(--profile-wash) 5%, var(--card)));
    --surface-raised: var(--profile-surface-raised, color-mix(in srgb, var(--profile-wash) 10%, #24232a));
    --surface-soft: var(--profile-surface-soft, color-mix(in srgb, var(--profile-wash) 16%, #24232a));
    --surface-hover: color-mix(in srgb, var(--profile-wash) 25%, #292830);
    --surface-input: var(--profile-surface-input, color-mix(in srgb, var(--profile-wash) 6%, #1a191f));
    --surface-line: color-mix(in srgb, var(--profile-accent) 17%, var(--line))
}

body[data-profile] .quiet-button,
body[data-profile] .backup-button,
body[data-profile] .filter-toggle,
body[data-profile] .course-tools summary,
body[data-profile] .course-tools-menu,
body[data-profile] .course-tools-menu button,
body[data-profile] .calendar-nav,
body[data-profile] .today-button,
body[data-profile] .study-week-nav button,
body[data-profile] .study-form-panel > summary,
body[data-profile] .study-session-actions button,
body[data-profile] .study-form .study-cancel-edit,
body[data-profile] .auth-secondary,
body[data-profile] .edit-actions button,
body[data-profile] .elective-item,
body[data-profile] .calendar-filter,
body[data-profile] .lesson-year-head select,
body[data-profile] .profile-picker select {
    border-color: var(--surface-line);
    background: var(--surface-raised)
}

body[data-profile] .course-tools-menu button:hover,
body[data-profile] .course-tools-menu label:hover,
body[data-profile] .filter-toggle:hover,
body[data-profile] .course-tools summary:hover,
body[data-profile] .calendar-nav:hover,
body[data-profile] .today-button:hover,
body[data-profile] .study-week-nav button:hover,
body[data-profile] .study-session-actions button:hover,
body[data-profile] .profile-picker select:hover {
    border-color: var(--profile-line);
    background: var(--surface-hover)
}

body[data-profile] .auth-form input,
body[data-profile] .auth-form select,
body[data-profile] .profile-claim input,
body[data-profile] .profile-claim select,
body[data-profile] .gate-form input,
body[data-profile] .edit-form select,
body[data-profile] .edit-form input,
body[data-profile] .study-form input,
body[data-profile] .study-form select,
body[data-profile] .course-actions select,
body[data-profile] .grade-input,
body[data-profile] .filter-select,
body[data-profile] .calendar-filter,
body[data-profile] .general-notes textarea,
body[data-profile] .course-note-panel textarea,
body[data-profile] #electives-search,
body[data-profile] .announcement-form input:not([type="radio"]):not([type="checkbox"]),
body[data-profile] .announcement-form textarea {
    border-color: var(--surface-line);
    background: var(--surface-input)
}

body[data-profile] .toolbar,
body[data-profile] .search-wrap {
    background: var(--surface-soft)
}

body[data-profile] .course-section,
body[data-profile] .course-section .group-heading,
body[data-profile] .calendar-card,
body[data-profile] .day-card,
body[data-profile] .agenda-card,
body[data-profile] .calendar-attendance,
body[data-profile] .study-form-panel,
body[data-profile] .study-day,
body[data-profile] .study-session:not(.is-pending-today),
body[data-profile] .study-recovery,
body[data-profile] .study-archive,
body[data-profile] .study-metric,
body[data-profile] .course-tools-menu {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

body[data-profile] .course-section .group-heading {
    background: var(--surface-soft)
}

body[data-profile] .course-section .course-card {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

body[data-profile] .course-section .course-card .course-name,
body[data-profile] .course-section .course-card.status-passed .course-name,
body[data-profile] .course-section .course-card.status-partial .course-name {
    color: var(--ink)
}

body[data-profile] .course-section .course-card .course-credits,
body[data-profile] .course-section .course-card .edit-button,
body[data-profile] .course-section .course-card .course-note-panel {
    border-color: var(--surface-line);
    background: var(--surface-soft)
}

body[data-profile] .course-section .course-card .status-pill {
    background: var(--surface-soft)
}

body[data-profile] .course-section .course-card.status-passed .course-status-row .status-pill,
body[data-profile] .course-section .course-card.status-partial .course-status-row .status-pill {
    border-color: color-mix(in srgb, #55936b 20%, var(--line));
    background: color-mix(in srgb, #55936b 9%, var(--card));
    color: color-mix(in srgb, #347248 82%, var(--ink))
}

body[data-profile] .course-section .course-card.status-scheduled .course-status-row .status-pill {
    border-color: color-mix(in srgb, #7892b2 20%, var(--line));
    background: color-mix(in srgb, #7892b2 8%, var(--card));
    color: color-mix(in srgb, #58769b 85%, var(--ink))
}

body[data-profile] .course-section .course-card.status-studying .course-status-row .status-pill {
    border-color: color-mix(in srgb, #bf995c 20%, var(--line));
    background: color-mix(in srgb, #bf995c 8%, var(--card));
    color: color-mix(in srgb, #8a6428 82%, var(--ink))
}

body[data-profile] .course-section .course-card.status-try .course-status-row .status-pill {
    border-color: color-mix(in srgb, #c27969 20%, var(--line));
    background: color-mix(in srgb, #c27969 8%, var(--card));
    color: color-mix(in srgb, #8c5144 82%, var(--ink))
}

body[data-profile] .calendar-cell,
body[data-profile] .calendar-cell:hover,
body[data-profile] .calendar-cell.selected {
    background: var(--surface-base)
}

body[data-profile] .calendar-cell.selected {
    border-color: var(--profile-accent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--profile-accent) 12%, transparent)
}

body[data-profile] .calendar-cell.today .calendar-number {
    background: var(--green);
    color: #fff
}

body[data-profile] .general-notes textarea,
body[data-profile] .course-note-panel textarea {
    color: var(--ink)
}

:root[data-theme="dark"] body[data-profile] .course-section .course-card.status-passed,
:root[data-theme="dark"] body[data-profile] .course-section .course-card.passed,
:root[data-theme="dark"] body[data-profile] .course-section .course-card.status-partial,
:root[data-theme="dark"] body[data-profile] .course-section .course-card.status-scheduled,
:root[data-theme="dark"] body[data-profile] .course-section .course-card.status-studying,
:root[data-theme="dark"] body[data-profile] .course-section .course-card.status-try,
:root[data-theme="dark"] body[data-profile] .course-section .course-card.status-later,
:root[data-theme="dark"] body[data-profile] .course-section .course-card {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

:root[data-theme="dark"] body[data-profile] .course-section .course-card .course-note-panel,
:root[data-theme="dark"] body[data-profile] .course-section .course-card .course-credits,
:root[data-theme="dark"] body[data-profile] .course-section .course-card .edit-button {
    background: var(--surface-soft)
}

:root[data-theme="dark"] body[data-profile] .course-section .course-card .next-tag,
:root[data-theme="dark"] body[data-profile] .course-section .course-card .elective-tag,
:root[data-theme="dark"] body[data-profile] .course-section .course-card .past-tag {
    background: var(--surface-soft);
    color: var(--muted)
}

:root[data-theme="dark"] body[data-profile] .calendar-cell {
    background: var(--surface-base)
}

:root[data-theme="dark"] body[data-profile] .calendar-cell.selected {
    background: color-mix(in srgb, var(--profile-wash) 42%, var(--card))
}

:root[data-theme="dark"] body[data-profile] .agenda-event:not(.event-planned),
:root[data-theme="dark"] body[data-profile] .agenda-date-group,
:root[data-theme="dark"] body[data-profile] .agenda-date-group summary {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

:root[data-theme="dark"] body[data-profile] .study-session:not(.is-pending-today),
:root[data-theme="dark"] body[data-profile] .study-day,
:root[data-theme="dark"] body[data-profile] .study-form-panel,
:root[data-theme="dark"] body[data-profile] .study-recovery,
:root[data-theme="dark"] body[data-profile] .study-archive,
:root[data-theme="dark"] body[data-profile] .calendar-card,
:root[data-theme="dark"] body[data-profile] .day-card,
:root[data-theme="dark"] body[data-profile] .agenda-card,
:root[data-theme="dark"] body[data-profile] .calendar-attendance,
:root[data-theme="dark"] body[data-profile] .study-metric {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

:root[data-theme="dark"] body[data-profile] .study-day.is-today {
    background: color-mix(in srgb, var(--profile-wash) 34%, var(--card))
}

:root[data-theme="dark"] body[data-profile] .calendar-nav,
:root[data-theme="dark"] body[data-profile] .today-button,
:root[data-theme="dark"] body[data-profile] .filter-toggle,
:root[data-theme="dark"] body[data-profile] .course-tools summary,
:root[data-theme="dark"] body[data-profile] .study-week-nav button,
:root[data-theme="dark"] body[data-profile] .study-session-actions button,
:root[data-theme="dark"] body[data-profile] .edit-actions button,
:root[data-theme="dark"] body[data-profile] .auth-secondary,
:root[data-theme="dark"] body[data-profile] .elective-item,
:root[data-theme="dark"] body[data-profile] .course-tools-menu {
    border-color: var(--surface-line);
    background: var(--surface-raised)
}

:root[data-theme="dark"] body[data-profile] .auth-form input,
:root[data-theme="dark"] body[data-profile] .auth-form select,
:root[data-theme="dark"] body[data-profile] .profile-claim input,
:root[data-theme="dark"] body[data-profile] .profile-claim select,
:root[data-theme="dark"] body[data-profile] .gate-form input,
:root[data-theme="dark"] body[data-profile] .edit-form select,
:root[data-theme="dark"] body[data-profile] .edit-form input,
:root[data-theme="dark"] body[data-profile] .study-form input,
:root[data-theme="dark"] body[data-profile] .study-form select,
:root[data-theme="dark"] body[data-profile] .course-actions select,
:root[data-theme="dark"] body[data-profile] .grade-input,
:root[data-theme="dark"] body[data-profile] .filter-select,
:root[data-theme="dark"] body[data-profile] .calendar-filter,
:root[data-theme="dark"] body[data-profile] .general-notes textarea,
:root[data-theme="dark"] body[data-profile] .course-note-panel textarea,
:root[data-theme="dark"] body[data-profile] #electives-search {
    border-color: var(--surface-line);
    background: var(--surface-input)
}

:root[data-theme="dark"] body[data-profile] .toolbar,
:root[data-theme="dark"] body[data-profile] .search-wrap {
    background: var(--surface-soft)
}

:root[data-theme="dark"] body[data-profile] .search-wrap:focus-within,
:root[data-theme="dark"] body[data-profile] .course-section .course-card .course-note-panel:focus-within {
    border-color: var(--profile-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--profile-accent) 15%, transparent)
}

:root[data-theme="dark"] body[data-profile] .calendar-nav:hover,
:root[data-theme="dark"] body[data-profile] .today-button:hover,
:root[data-theme="dark"] body[data-profile] .filter-toggle:hover,
:root[data-theme="dark"] body[data-profile] .course-tools summary:hover,
:root[data-theme="dark"] body[data-profile] .study-week-nav button:hover,
:root[data-theme="dark"] body[data-profile] .study-session-actions button:hover,
:root[data-theme="dark"] body[data-profile] .elective-item:hover,
:root[data-theme="dark"] body[data-profile] .elective-item:has(input:checked) {
    background: var(--surface-hover)
}

:root[data-theme="dark"] body[data-profile] .auth-tabs,
:root[data-theme="dark"] body[data-profile] .lesson-year-group,
:root[data-theme="dark"] body[data-profile] .lesson-choice,
:root[data-theme="dark"] body[data-profile] .profile-picker select {
    border-color: var(--surface-line);
    background: var(--surface-soft)
}

:root[data-theme="dark"] body[data-profile] .auth-tab.active {
    background: var(--surface-raised);
    color: var(--profile-accent)
}

:root[data-theme="dark"] body[data-profile] .agenda-event.event-lesson,
:root[data-theme="dark"] body[data-profile] .day-lesson-attendance .agenda-event {
    border-color: color-mix(in srgb, var(--profile-accent) 25%, var(--line));
    background: color-mix(in srgb, var(--profile-accent) 8%, var(--card))
}

:root[data-theme="dark"] body[data-profile] .course-component {
    background: color-mix(in srgb, var(--profile-wash) 16%, var(--card))
}

:root[data-theme="dark"] body[data-profile] .course-component-status,
:root[data-theme="dark"] body[data-profile] .course-component-date,
:root[data-theme="dark"] body[data-profile] .course-component-grade {
    border-color: var(--surface-line);
    background: var(--surface-input)
}

:root[data-theme="dark"] body[data-profile] .announcement-audience,
:root[data-theme="dark"] body[data-profile] .announcement-form input:not([type="radio"]):not([type="checkbox"]),
:root[data-theme="dark"] body[data-profile] .announcement-form textarea {
    border-color: var(--surface-line);
    background: var(--surface-input)
}

:root[data-theme="dark"] body[data-profile] .notifications-close,
:root[data-theme="dark"] body[data-profile] .announcement-actions button,
:root[data-theme="dark"] body[data-profile] .notifications-read-all {
    border-color: var(--surface-line);
    background: var(--surface-raised)
}

:root[data-theme="dark"] body[data-profile] .announcement-card {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

:root[data-theme="dark"] body[data-profile] .announcement-card.is-unread {
    border-color: color-mix(in srgb, var(--profile-accent) 28%, var(--line));
    background: color-mix(in srgb, var(--profile-wash) 24%, var(--card))
}

body[data-profile] .study-day.is-today {
    background: color-mix(in srgb, var(--profile-wash) 28%, var(--card))
}

body[data-profile] .course-component {
    background: color-mix(in srgb, var(--profile-wash) 12%, var(--card))
}

body[data-profile] .course-component-status,
body[data-profile] .course-component-date,
body[data-profile] .course-component-grade {
    border-color: var(--surface-line);
    background: var(--surface-input)
}

body[data-profile] .lesson-year-group,
body[data-profile] .lesson-choice {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

body[data-profile] .lesson-choice:has(input:checked) {
    border-color: var(--profile-line);
    background: color-mix(in srgb, var(--profile-wash) 36%, var(--card))
}

body[data-profile] .announcement-card {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

body[data-profile] .announcement-card.is-unread {
    border-color: color-mix(in srgb, var(--profile-accent) 25%, var(--line));
    background: color-mix(in srgb, var(--profile-wash) 28%, var(--card))
}

body[data-profile] .notifications-close,
body[data-profile] .announcement-actions button,
body[data-profile] .notifications-read-all {
    border-color: var(--surface-line);
    background: var(--surface-raised)
}

body[data-profile] .announcement-audience {
    border-color: var(--surface-line);
    background: var(--surface-soft)
}

body[data-profile] .calendar-nav,
body[data-profile] .today-button,
body[data-profile] .study-week-nav button,
body[data-profile] .study-session-actions button,
body[data-profile] .study-suggestion,
body[data-profile] .study-suggestion-item {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

:root[data-theme="dark"] body[data-profile] .study-suggestion {
    background: var(--surface-base)
}

:root[data-theme="dark"] body[data-profile] .study-suggestion-item {
    background: var(--surface-raised)
}

body[data-profile] .study-suggestion-item:has(input:not(:checked)) {
    opacity: .58
}

body[data-profile] .study-suggestion-item:hover {
    border-color: color-mix(in srgb, var(--profile-accent) 28%, var(--surface-line));
    background: var(--surface-raised)
}

:root[data-theme="dark"] body[data-profile] .study-suggestion-item:has(input:checked) {
    border-color: color-mix(in srgb, var(--profile-accent) 22%, var(--surface-line))
}

:root[data-theme="dark"] body[data-profile] .notifications-panel,
:root[data-theme="dark"] body[data-profile] .notifications-dialog {
    background: color-mix(in srgb, var(--paper) 86%, var(--profile-wash))
}

:root[data-theme="dark"] body[data-profile] .notifications-panel input,
:root[data-theme="dark"] body[data-profile] .notifications-panel textarea {
    background: var(--surface-input)
}

/* Final palette pass: shared components use calm surfaces; profile color stays an accent. */
body[data-profile] .elective-item,
body[data-profile] .calendar-attendance,
body[data-profile] .attendance-summary,
body[data-profile] .calendar-card,
body[data-profile] .day-card,
body[data-profile] .agenda-card,
body[data-profile] .agenda-date-group,
body[data-profile] .past-agenda,
body[data-profile] .course-section .course-card .course-note-panel,
body[data-profile] .course-component:not([data-module-state]),
body[data-profile] .useful-link-card {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

body[data-profile] .attendance-summary-track {
    background: var(--surface-line)
}

body[data-profile] .attendance-summary-track i {
    background: var(--profile-accent)
}

body[data-profile] #electives-search,
body[data-profile] .general-notes textarea,
body[data-profile] .day-attendance-controls button,
body[data-profile] .day-attendance-status {
    border-color: var(--surface-line);
    background: var(--surface-input)
}

body[data-profile] #electives-search:focus,
body[data-profile] .general-notes textarea:focus,
body[data-profile] .course-section .course-card .course-note-panel:focus-within {
    border-color: var(--profile-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--profile-accent) 14%, transparent)
}

body[data-profile] .elective-item:hover,
body[data-profile] .agenda-date-group summary:hover,
body[data-profile] .agenda-event:hover,
body[data-profile] .past-agenda .past-heading:hover,
body[data-profile] .past-heading:hover .group-chevron,
body[data-profile] .useful-link-card:hover,
body[data-profile] .calendar-nav:hover,
body[data-profile] .today-button:hover,
body[data-profile] button.calendar-cell:hover {
    border-color: color-mix(in srgb, var(--profile-accent) 30%, var(--surface-line));
    background: var(--surface-hover)
}

body[data-profile] .elective-item:has(input:checked) {
    border-color: color-mix(in srgb, var(--profile-accent) 40%, var(--surface-line));
    background: color-mix(in srgb, var(--profile-accent) 7%, var(--surface-base))
}

body[data-profile] .elective-item input {
    accent-color: var(--profile-accent)
}

body[data-profile] .electives-counter {
    border: 1px solid var(--surface-line);
    background: var(--surface-soft);
    color: color-mix(in srgb, var(--profile-accent) 72%, var(--ink))
}

body[data-profile] .electives-counter.full {
    background: var(--surface-raised);
    color: var(--muted)
}

body[data-profile] .electives-counter.limit {
    border-color: color-mix(in srgb, #bf995c 24%, var(--line));
    background: color-mix(in srgb, #bf995c 9%, var(--surface-base));
    color: color-mix(in srgb, #8a6428 82%, var(--ink))
}

body[data-profile] .calendar-weekdays,
body[data-profile] .calendar-day-names,
body[data-profile] .event-day,
body[data-profile] .elective-info em {
    color: var(--muted)
}

body[data-profile] .calendar-cell {
    border-color: transparent;
    background: var(--surface-soft)
}

body[data-profile] .calendar-cell.blank {
    background: transparent
}

body[data-profile] .calendar-cell.selected {
    border-color: var(--profile-accent);
    background: color-mix(in srgb, var(--profile-accent) 7%, var(--surface-base));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--profile-accent) 10%, transparent)
}

body[data-profile] button.calendar-cell.selected:hover {
    background: color-mix(in srgb, var(--profile-accent) 11%, var(--surface-base))
}    :root[data-theme="dark"] body[data-profile] button.calendar-cell.selected:hover {
        background: color-mix(in srgb, var(--profile-accent) 18%, var(--surface-base))
    }


body[data-profile] .calendar-cell.today .calendar-number {
    background: var(--green);
    color: #fff
}

body[data-profile] .agenda-event:not(.event-planned),
body[data-profile] .agenda-event.event-past,
body[data-profile] .agenda-date-group summary,
body[data-profile] .past-agenda .agenda-date-group summary {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

body[data-profile] .agenda-event.event-past:hover {
    opacity: 1
}

body[data-profile] .useful-link-card:hover {
    box-shadow: 0 8px 20px color-mix(in srgb, var(--profile-accent) 9%, transparent)
}

body[data-profile] .course-section .course-card .course-note-panel label,
body[data-profile] .course-section .course-card .course-note-panel textarea::placeholder,
body[data-profile] .general-notes textarea::placeholder {
    color: var(--muted)
}

:root[data-theme="dark"] body[data-profile] .elective-item,
:root[data-theme="dark"] body[data-profile] .calendar-attendance,
:root[data-theme="dark"] body[data-profile] .attendance-summary,
:root[data-theme="dark"] body[data-profile] .calendar-card,
:root[data-theme="dark"] body[data-profile] .day-card,
:root[data-theme="dark"] body[data-profile] .agenda-card,
:root[data-theme="dark"] body[data-profile] .agenda-date-group,
:root[data-theme="dark"] body[data-profile] .past-agenda,
:root[data-theme="dark"] body[data-profile] .course-section .course-card .course-note-panel,
:root[data-theme="dark"] body[data-profile] .course-component:not([data-module-state]),
:root[data-theme="dark"] body[data-profile] .useful-link-card {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

:root[data-theme="dark"] body[data-profile] .attendance-summary-track {
    background: var(--surface-line)
}

:root[data-theme="dark"] body[data-profile] #electives-search,
:root[data-theme="dark"] body[data-profile] .general-notes textarea,
:root[data-theme="dark"] body[data-profile] .day-attendance-controls button,
:root[data-theme="dark"] body[data-profile] .day-attendance-status {
    border-color: var(--surface-line);
    background: var(--surface-input)
}

:root[data-theme="dark"] body[data-profile] .elective-item:hover,
:root[data-theme="dark"] body[data-profile] .agenda-date-group summary:hover,
:root[data-theme="dark"] body[data-profile] .agenda-event:hover,
:root[data-theme="dark"] body[data-profile] .past-agenda .past-heading:hover,
:root[data-theme="dark"] body[data-profile] .past-heading:hover .group-chevron,
:root[data-theme="dark"] body[data-profile] .useful-link-card:hover,
:root[data-theme="dark"] body[data-profile] .calendar-nav:hover,
:root[data-theme="dark"] body[data-profile] .today-button:hover,
:root[data-theme="dark"] body[data-profile] button.calendar-cell:hover {
    border-color: color-mix(in srgb, var(--profile-accent) 36%, var(--surface-line));
    background: var(--surface-hover)
}

:root[data-theme="dark"] body[data-profile] .elective-item:has(input:checked) {
    border-color: color-mix(in srgb, var(--profile-accent) 45%, var(--surface-line));
    background: color-mix(in srgb, var(--profile-accent) 12%, var(--surface-base))
}

:root[data-theme="dark"] body[data-profile] .elective-item input {
    accent-color: var(--profile-accent)
}

:root[data-theme="dark"] body[data-profile] .electives-counter {
    border-color: var(--surface-line);
    background: var(--surface-soft);
    color: var(--profile-accent)
}

:root[data-theme="dark"] body[data-profile] .electives-counter.full {
    background: var(--surface-raised);
    color: var(--muted)
}

:root[data-theme="dark"] body[data-profile] .calendar-cell {
    border-color: transparent;
    background: var(--surface-soft)
}

:root[data-theme="dark"] body[data-profile] .calendar-cell.blank {
    background: transparent
}

:root[data-theme="dark"] body[data-profile] .calendar-cell.selected {
    border-color: var(--profile-accent);
    background: color-mix(in srgb, var(--profile-accent) 14%, var(--surface-base))
}

:root[data-theme="dark"] body[data-profile] .calendar-cell.today .calendar-number {
    background: var(--green);
    color: #fff
}

:root[data-theme="dark"] body[data-profile] .agenda-event:not(.event-planned),
:root[data-theme="dark"] body[data-profile] .agenda-event.event-past,
:root[data-theme="dark"] body[data-profile] .agenda-date-group summary,
:root[data-theme="dark"] body[data-profile] .past-agenda .agenda-date-group summary {
    border-color: var(--surface-line);
    background: var(--surface-base)
}

:root[data-theme="dark"] body[data-profile] .agenda-event.event-past:hover {
    opacity: 1
}

:root[data-theme="dark"] body[data-profile] .useful-link-card:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24)
}

:root[data-theme="dark"] body[data-profile] .day-attendance-controls button.is-present,
:root[data-theme="dark"] body[data-profile] .day-attendance-status.is-present {
    border-color: #3e6749;
    background: #26392c;
    color: #a8d2af
}

:root[data-theme="dark"] body[data-profile] .day-attendance-controls button.is-absent,
:root[data-theme="dark"] body[data-profile] .day-attendance-status.is-absent {
    border-color: #70453f;
    background: #3a2927;
    color: #e2a79e
}

:root[data-theme="dark"] body[data-profile] .day-attendance-controls button.is-present:hover,
:root[data-theme="dark"] body[data-profile] .day-attendance-controls button.is-absent:hover {
    filter: brightness(1.12)
}

body[data-profile] .day-attendance-controls button.is-present,
body[data-profile] .day-attendance-status.is-present {
    border-color: #c8e1ce;
    background: #eaf5ec;
    color: #286342
}

body[data-profile] .day-attendance-controls button.is-absent,
body[data-profile] .day-attendance-status.is-absent {
    border-color: #efd8d3;
    background: #fbefed;
    color: #9b5148
}

/* A compact segmented switch makes the main views feel like one deliberate control. */
body[data-profile] .view-tabs {
    position: relative;
    display: flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 3px;
    margin: 0 0 25px;
    padding: 4px;
    border: 1px solid var(--surface-line);
    border-radius: 15px;
    background: var(--surface-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .48);
    backdrop-filter: none
}

body[data-profile] .view-tab {
    position: relative;
    display: inline-flex;
    min-height: 37px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 550;
    line-height: 1.2;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease
}

body[data-profile] .view-tab:hover:not(.active) {
    background: color-mix(in srgb, var(--profile-accent) 5%, var(--surface-base));
    color: var(--ink)
}

body[data-profile] .view-tab.active {
    background: color-mix(in srgb, var(--profile-accent) 9%, var(--surface-base));
    box-shadow: 0 1px 3px rgba(28, 24, 35, .08), inset 0 0 0 1px color-mix(in srgb, var(--profile-accent) 14%, transparent);
    color: color-mix(in srgb, var(--profile-accent) 76%, var(--ink));
    font-weight: 650
}

body[data-profile] .view-tab.active:after {
    display: none;
    content: none
}

body[data-profile] .view-tab:focus-visible {
    z-index: 1;
    outline: 2px solid var(--profile-accent);
    outline-offset: 2px
}

body[data-profile] .view-tab .tab-count {
    display: inline-flex;
    min-width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 99px;
    background: var(--surface-raised);
    color: var(--muted);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    font-weight: 600
}

body[data-profile] .view-tab.active .tab-count {
    background: color-mix(in srgb, var(--profile-accent) 13%, var(--surface-base));
    color: var(--profile-accent)
}

:root[data-theme="dark"] body[data-profile] .view-tabs {
    background: var(--surface-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035)
}

:root[data-theme="dark"] body[data-profile] .view-tab.active {
    background: color-mix(in srgb, var(--profile-accent) 15%, var(--surface-raised));
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18), inset 0 0 0 1px color-mix(in srgb, var(--profile-accent) 21%, transparent);
    color: var(--profile-accent)
}

:root[data-theme="dark"] body[data-profile] .view-tab.active .tab-count {
    background: color-mix(in srgb, var(--profile-accent) 20%, var(--surface-base));
    color: var(--profile-accent)
}

/* Light mode uses restrained semantic washes to distinguish course sections. */
:root:not([data-theme="dark"]) body[data-profile] .course-section .course-card.status-passed,
:root:not([data-theme="dark"]) body[data-profile] .course-section .course-card.passed {
    border-color: color-mix(in srgb, #55936b 18%, var(--line));
    background: color-mix(in srgb, #55936b 5%, var(--card))
}

:root:not([data-theme="dark"]) body[data-profile] .course-section .course-card.status-partial {
    border-color: color-mix(in srgb, #55936b 21%, var(--line));
    background: color-mix(in srgb, #55936b 7%, var(--card))
}

:root:not([data-theme="dark"]) body[data-profile] .course-section .course-card.status-scheduled {
    border-color: color-mix(in srgb, #7892b2 19%, var(--line));
    background: color-mix(in srgb, #7892b2 6%, var(--card))
}

:root:not([data-theme="dark"]) body[data-profile] .course-section .course-card.status-studying {
    border-color: color-mix(in srgb, #bf995c 20%, var(--line));
    background: color-mix(in srgb, #bf995c 7%, var(--card))
}

:root:not([data-theme="dark"]) body[data-profile] .course-section .course-card.status-try {
    border-color: color-mix(in srgb, #c27969 18%, var(--line));
    background: color-mix(in srgb, #c27969 6%, var(--card))
}

:root:not([data-theme="dark"]) body[data-profile] .course-section .course-card.status-later {
    border-color: color-mix(in srgb, var(--muted) 16%, var(--line));
    background: color-mix(in srgb, var(--muted) 5%, var(--card))
}

/* Notes share their panel surface; a separately tinted textarea caused a dark inset block. */
body[data-profile] .course-section .course-card .course-note-panel textarea,
:root[data-theme="dark"] body[data-profile] .course-section .course-card .course-note-panel textarea {
    border: 0;
    background: transparent;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none
}

@media(max-width:520px) {
    body[data-profile] .view-tabs {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3px;
        overflow-x: visible;
        padding: 3px;
        margin-bottom: 21px
    }

    body[data-profile] .view-tab {
        min-width: 0;
        min-height: 40px;
        gap: 4px;
        padding: 0 6px;
        font-size: 11px;
        line-height: 1.2;
        white-space: normal
    }

    body[data-profile] .view-tab .tab-count {
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        font-size: 8px
    }
}

/* Keep the subjects toolbar on the same calm surface as the page in both themes. */
body[data-profile] #subjects-view .toolbar {
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--surface-line);
    border-radius: 16px;
    background: var(--card)
}

body[data-profile] #subjects-view .search-wrap {
    border-radius: 12px;
    background: var(--card)
}

body[data-profile] #subjects-view .search-wrap:focus-within {
    background: var(--card)
}

body[data-profile] #subjects-view .filter-toggle,
body[data-profile] #subjects-view .course-tools summary {
    border-color: var(--surface-line);
    background: var(--card)
}

body[data-profile] #subjects-view .filter-toggle:hover,
body[data-profile] #subjects-view .course-tools summary:hover {
    background: var(--surface-hover)
}

/* Give the attendance summary a clear, comfortable pause after the calendar cards. */
body[data-profile] #calendar-attendance {
    margin-top: 20px
}

.exam-reminders {
    display: grid;
    gap: 10px;
    margin: 12px 0 20px;
    padding: 15px;
    border: 1px solid var(--surface-line);
    border-radius: 16px;
    background: var(--card)
}

.exam-reminders-heading,
.exam-reminder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.exam-reminders-heading h2 { margin: 3px 0 0; font-size: 14px; font-weight: 650 }
.exam-reminder-setting { color: var(--muted); font-size: 10px }
.exam-reminders-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px }
.exam-reminder { min-width: 0; justify-content: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-hover) }
.exam-reminder-count { flex: none; min-width: 74px; color: var(--profile-accent, #68836e); font-size: 12px; font-weight: 720 }
.exam-reminder>div { display: grid; min-width: 0; gap: 3px }
.exam-reminder strong,.exam-reminder>div>span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.exam-reminder strong { font-size: 11px }
.exam-reminder>div>span { color: var(--muted); font-size: 10px }
.exam-reminder.is-soon { border-color: color-mix(in srgb, #bf995c 36%, var(--line)) }
.exam-reminder.is-soon .exam-reminder-count { color: #99702f }
.exam-reminder.is-urgent { border-color: color-mix(in srgb, #bd7464 38%, var(--line)); background: color-mix(in srgb, #bd7464 9%, var(--card)) }
.exam-reminder.is-urgent .exam-reminder-count { color: #a15344 }

.study-settings-dialog { width: min(680px, calc(100vw - 28px)); max-height: min(88vh, 850px); overflow-y: auto }
.study-settings-dialog .edit-form { gap: 14px }
.planner-days,.planner-priorities,.planner-reminders { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px }
.planner-days legend,.planner-priorities legend,.planner-reminders legend { padding: 0 5px; font-size: 11px; font-weight: 650 }
.planner-priorities legend span { color: var(--muted); font-weight: 400 }
.planner-priority-help { margin: 0 0 7px; color: var(--muted); font-size: 10px }
.planner-day-options,.planner-time-range,.planner-reminder-days { display: flex; flex-wrap: wrap; align-items: end; gap: 10px }
.planner-day-options label,.planner-reminder-days label,.planner-reminder-toggle { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; color: var(--ink); font-size: 11px }
.planner-day-options input,.planner-reminder-days input,.planner-reminder-toggle input,.planner-priority-options input { accent-color: var(--profile-accent, #718d73) }
.planner-time-range>label { display: grid; flex: 1; min-width: 120px; gap: 5px; color: var(--muted); font-size: 10px }
.planner-time-range input,.planner-time-range select { min-width: 0; min-height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit }
.planner-priority-options { display: grid; max-height: 210px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: 5px; overflow-y: auto }
.planner-priority-options label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 3px 7px; padding: 7px; border-radius: 8px; font-size: 10px }
.planner-priority-options label:hover { background: var(--surface-hover) }
.planner-priority-options input { grid-row: span 2 }
.planner-priority-options span { overflow: hidden; text-overflow: ellipsis }
.planner-priority-options small { color: var(--muted); font-size: 9px }
.planner-reminders { display: grid; gap: 9px }
.planner-reminder-days>span { margin-right: 5px; color: var(--muted); font-size: 10px }
.planner-reminder-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5 }

.course-goals { display: grid; gap: 8px; margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line) }
.course-goals>summary { display: flex; width: fit-content; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); font-size: 10px; font-weight: 600; list-style: none }
.course-goals>summary::-webkit-details-marker { display: none }
.course-goals>summary:before { content: '＋'; color: var(--profile-accent, #718d73); font-size: 12px }
.course-goals[open]>summary:before { content: '−' }
.course-goals>summary span { color: var(--profile-accent, #718d73) }
.course-goal-empty { margin: 0; color: var(--muted); font-size: 10px }
.course-goal-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none }
.course-goal { display: flex; min-width: 0; align-items: center; gap: 6px; font-size: 10px }
.course-goal>label { display: flex; min-width: 0; flex: 1; align-items: center; gap: 7px }
.course-goal>label input { flex: none; accent-color: var(--profile-accent, #718d73) }
.course-goal>label span,.course-goal>span { overflow-wrap: anywhere }
.course-goal.is-done>label span { color: var(--muted); text-decoration: line-through }
.course-goal.needs-review>label span { color: #9a7136 }
.course-goal button { flex: none; padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--muted); font: inherit; font-size: 9px; cursor: pointer }
.course-goal button[aria-pressed="true"],.goal-review-label { color: #9a7136 }
.course-goal .goal-delete { min-width: 25px; padding: 2px; font-size: 13px }
.course-goal-form { display: flex; gap: 6px }
.course-goal-form input { min-width: 0; flex: 1; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 10px }
.course-goal-form button { flex: none; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-hover); color: var(--ink); font: inherit; font-size: 10px; cursor: pointer }
.goal-review-label { font-size: 9px }

:root[data-theme="dark"] .exam-reminder.is-urgent { background: color-mix(in srgb, #bd7464 12%, var(--card)) }
:root[data-theme="dark"] .exam-reminder.is-urgent .exam-reminder-count { color: #e29a8a }
:root[data-theme="dark"] .exam-reminder.is-soon .exam-reminder-count,:root[data-theme="dark"] .course-goal.needs-review>label span,:root[data-theme="dark"] .course-goal button[aria-pressed="true"],:root[data-theme="dark"] .goal-review-label { color: #e2bc79 }

@media(max-width:560px) {
    .exam-reminders { padding: 12px }
    .exam-reminder { align-items: flex-start; flex-direction: column; gap: 4px }
    .exam-reminder-count { min-width: 0 }
    .planner-day-options { justify-content: space-between; gap: 5px }
    .planner-day-options label { font-size: 10px }
    .planner-reminder-days { align-items: flex-start; gap: 4px 8px }
    .planner-reminder-days>span { width: 100% }
}

@media(max-width:430px) {
    .course-goal-form button { padding-inline: 7px }
    .planner-time-range>label { min-width: calc(50% - 8px) }
}

.study-settings-dialog {
    width: min(620px, calc(100vw - 24px));
    max-height: min(90dvh, 820px);
    border-radius: 22px;
    scrollbar-width: thin
}

.study-settings-dialog[open] { display: block }
.study-settings-dialog .planner-form { gap: 12px; padding: 22px }
.planner-dialog-header { display: grid; gap: 5px; padding: 0 0 2px }
.planner-dialog-header .section-kicker { margin: 0; color: var(--profile-accent, #718d73); font-weight: 700 }
.planner-dialog-header h2 { font-size: clamp(21px, 4vw, 25px); letter-spacing: -.045em; text-transform: none }
.planner-dialog-header .lesson-settings-intro { max-width: 52ch; font-size: 11px; line-height: 1.45 }
.planner-days,.planner-priorities,.planner-reminders,.planner-time-section {
    min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--card)
}
.planner-days legend,.planner-priorities legend,.planner-reminders legend { padding: 0 6px; color: var(--ink); font-size: 12px; font-weight: 680 }
.planner-priorities legend span { margin-left: 5px; color: var(--muted); font-size: 10px; font-weight: 500 }
.planner-section-help { margin: 0 0 8px; color: var(--muted); font-size: 10px; line-height: 1.4 }
.planner-day-options { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px }
.planner-day-options label {
    display: flex; min-height: 40px; align-items: center; justify-content: center; gap: 0; padding: 5px 2px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink);
    font-size: 11px; font-weight: 650; cursor: pointer; transition: border-color .15s, background .15s, color .15s
}
.planner-day-options label:has(input:checked) { border-color: color-mix(in srgb, var(--profile-accent, #718d73) 52%, var(--line)); background: color-mix(in srgb, var(--profile-accent, #718d73) 12%, var(--card)); color: var(--profile-accent, #526d58) }
.planner-day-options label:focus-within { outline: 2px solid var(--profile-accent, #718d73); outline-offset: 2px }
.planner-day-options input,.planner-reminder-days input,.planner-reminder-toggle input,.planner-priority-options input {
    width: auto; flex: none; margin: 0; padding: 0; border: 0; background: transparent; accent-color: var(--profile-accent, #718d73)
}
.planner-day-options input { position: absolute; width: 1px; height: 1px; opacity: 0 }
.planner-time-section { display: grid; gap: 9px }
.planner-section-title { display: grid; gap: 3px }
.planner-section-title strong { font-size: 12px }
.planner-section-title span { color: var(--muted); font-size: 10px; line-height: 1.4 }
.planner-time-range { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 7px }
.planner-time-range>label { display: grid; min-width: 0; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 600 }
.planner-time-range input,.planner-time-range select {
    width: 100%; min-width: 0; min-height: 40px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--paper); color: var(--ink); font: inherit; font-size: 13px
}
.planner-time-range input:focus-visible,.planner-time-range select:focus-visible { outline-color: var(--profile-accent, #718d73); border-color: var(--profile-accent, #718d73) }
.planner-priority-help { margin: 0 0 8px; color: var(--muted); font-size: 10px; line-height: 1.4 }
.planner-priority-options { display: grid; max-height: 160px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; overflow-y: auto; padding: 2px; scrollbar-width: thin }
.planner-priority-options label {
    display: grid; min-width: 0; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 3px 8px;
    padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink);
    font-size: 11px; cursor: pointer; transition: border-color .15s, background .15s
}
.planner-priority-options label:has(input:checked) { border-color: color-mix(in srgb, var(--profile-accent, #718d73) 48%, var(--line)); background: color-mix(in srgb, var(--profile-accent, #718d73) 8%, var(--card)) }
.planner-priority-options label:focus-within { outline: 2px solid var(--profile-accent, #718d73); outline-offset: 1px }
.planner-priority-options input { grid-row: span 2; width: 16px; height: 16px }
.planner-priority-options span { overflow: hidden; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap }
.planner-priority-options small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap }
.planner-reminders { display: grid; gap: 9px }
.study-settings-dialog .planner-reminder-toggle {
    display: flex; align-items: flex-start; gap: 9px; min-width: 0; min-height: 0; padding: 9px 10px; border: 1px solid var(--line);
    border-radius: 11px; background: var(--paper); color: var(--ink); cursor: pointer
}
.study-settings-dialog .planner-reminder-toggle input { width: 17px; height: 17px; margin-top: 1px }
.study-settings-dialog .planner-reminder-toggle>span { display: grid; min-width: 0; gap: 3px }
.study-settings-dialog .planner-reminder-toggle strong { font-size: 11px }
.study-settings-dialog .planner-reminder-toggle small { color: var(--muted); font-size: 10px; line-height: 1.4 }
.planner-reminder-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px }
.planner-reminder-days>span { width: 100%; color: var(--muted); font-size: 10px; font-weight: 600 }
.planner-reminder-days label {
    display: inline-flex; min-height: 34px; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line);
    border-radius: 9px; background: var(--paper); color: var(--ink); font-size: 10px; cursor: pointer
}
.planner-reminder-days label:has(input:checked) { border-color: color-mix(in srgb, var(--profile-accent, #718d73) 48%, var(--line)); background: color-mix(in srgb, var(--profile-accent, #718d73) 9%, var(--card)) }
.planner-notification-permission { display: grid; gap: 6px; padding-top: 9px; border-top: 1px solid var(--line) }
.planner-notification-permission .filter-toggle { justify-self: start; min-height: 38px; padding: 8px 11px; font-size: 10px }
.planner-reminder-note { max-width: 58ch; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5 }
.planner-form-actions {
    position: sticky; bottom: -22px; z-index: 1; justify-content: space-between; margin: 0 -22px -22px; padding: 10px 22px;
    border-top: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(12px)
}
.planner-form-actions button { min-height: 42px; padding-inline: 16px; cursor: pointer }
.planner-form-actions button[type=submit] { min-width: 180px; border: 0; border-radius: 10px; font-weight: 650 }
.planner-form-actions button:disabled { cursor: wait; opacity: .65 }
#study-settings-message:empty { display: none }
#study-settings-message { margin: 0; font-size: 11px }

:root[data-theme="dark"] .planner-days,
:root[data-theme="dark"] .planner-priorities,
:root[data-theme="dark"] .planner-reminders,
:root[data-theme="dark"] .planner-time-section { border-color: var(--line); background: color-mix(in srgb, var(--paper) 45%, var(--card)) }
:root[data-theme="dark"] .planner-day-options label,
:root[data-theme="dark"] .planner-priority-options label,
:root[data-theme="dark"] .planner-reminder-toggle,
:root[data-theme="dark"] .planner-reminder-days label,
:root[data-theme="dark"] .planner-time-range input,
:root[data-theme="dark"] .planner-time-range select { border-color: var(--line); background: color-mix(in srgb, var(--paper) 28%, var(--card)); color: var(--ink) }
:root[data-theme="dark"] .planner-day-options label:has(input:checked),
:root[data-theme="dark"] .planner-priority-options label:has(input:checked),
:root[data-theme="dark"] .planner-reminder-days label:has(input:checked) { border-color: color-mix(in srgb, var(--profile-accent, #9bc6a4) 55%, var(--line)); background: color-mix(in srgb, var(--profile-accent, #9bc6a4) 18%, var(--card)) }
:root[data-theme="dark"] .planner-form-actions { border-color: var(--line); background: color-mix(in srgb, var(--paper) 90%, transparent) }
:root[data-theme="dark"] body[data-profile] .study-toolbar { border-color: var(--surface-line); background: var(--surface-base) }
:root[data-theme="dark"] body[data-profile] .study-week-nav { border-color: var(--surface-line); background: var(--surface-raised) }
:root[data-theme="dark"] body[data-profile] .study-toolbar-actions .study-suggest-button,
:root[data-theme="dark"] body[data-profile] .study-toolbar-actions .study-settings-button { border-color: var(--surface-line); background: var(--surface-raised); color: var(--ink) }

@media(max-width:560px) {
    .study-settings-dialog { width: calc(100vw - 16px); max-height: min(76dvh, 660px); border-radius: 18px; overscroll-behavior: contain }
    .study-settings-dialog .planner-form { gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) }
    .planner-dialog-header { gap: 3px }
    .planner-dialog-header .section-kicker { font-size: 8px }
    .planner-dialog-header h2 { font-size: 20px }
    .planner-dialog-header .lesson-settings-intro { font-size: 10px; line-height: 1.35 }
    .planner-days,.planner-priorities,.planner-reminders,.planner-time-section { padding: 9px; border-radius: 11px }
    .planner-days legend,.planner-priorities legend,.planner-reminders legend { font-size: 11px }
    .planner-section-help { margin-bottom: 6px; font-size: 9px }
    .planner-day-options { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px }
    .planner-day-options label { min-height: 40px; font-size: 9px }
    .planner-time-range { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px }
    .planner-time-range>label { font-size: 9px }
    .planner-time-range>label:last-child { grid-column: auto }
    .planner-time-range input,.planner-time-range select { min-height: 38px; font-size: 12px }
    .planner-priority-help { margin-bottom: 6px; font-size: 9px }
    .planner-priority-options { grid-template-columns: 1fr; max-height: 112px; gap: 4px }
    .planner-priority-options label { padding: 6px 7px }
    .planner-reminders { gap: 7px }
    .study-settings-dialog .planner-reminder-toggle { gap: 8px; padding: 8px }
    .study-settings-dialog .planner-reminder-toggle strong { font-size: 10px }
    .study-settings-dialog .planner-reminder-toggle small { font-size: 9px; line-height: 1.3 }
    .planner-reminder-days { gap: 5px }
    .planner-reminder-days label { min-height: 40px; padding: 5px 7px; font-size: 9px }
    .planner-notification-permission { gap: 5px; padding-top: 7px }
    .planner-notification-permission .filter-toggle { min-height: 40px; padding: 7px 9px; font-size: 9px }
    .planner-reminder-note { font-size: 9px; line-height: 1.35 }
    .planner-form-actions { bottom: 0; margin: 0 -14px calc(-12px - env(safe-area-inset-bottom)); padding: 8px 14px calc(8px + env(safe-area-inset-bottom)) }
    .planner-form-actions button { min-height: 44px }
    .planner-form-actions button[type=submit] { min-width: 0; flex: 1 }
}

@media(max-width:360px) {
    .study-settings-dialog .planner-form { padding-inline: 11px }
    .planner-days,.planner-priorities,.planner-reminders,.planner-time-section { padding: 8px }
    .planner-day-options { gap: 4px }
    .planner-day-options label { min-height: 40px; font-size: 8px }
    .planner-form-actions { margin-inline: -11px; padding-inline: 11px }
}


