:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #182c24;
  background: #f3f6f1;
  --ink: #182c24;
  --muted: #52665b;
  --border: #dfe8df;
  --accent: #1b674d;
  --accent-dark: #124d39;
  --pale: #edf5ef;
  --radius: 19px;
}
* { box-sizing: border-box; }
body { min-width: 280px; margin: 0; }
h1, h2, h3, p, ul, ol { margin: 0; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #4d9276; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.shell { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); }
.bar-inner { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand strong { display: block; font-size: 1.03rem; letter-spacing: -.02em; }
.brand-subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .09em; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: #205a46; display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 10px; }
.brand-mark span { height: 15px; border: 1.5px solid #e8f7ec; border-radius: 5px 2px 2px 3px; transform: skewY(9deg); }
.brand-mark span + span { border-radius: 2px 5px 3px 2px; transform: skewY(-9deg); }
.header-date { color: var(--muted); font-size: .875rem; font-weight: 600; text-align: right; }
.page-heading { padding-block: 41px 26px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
h1 { font-size: clamp(2rem, 4.7vw, 3.25rem); font-weight: 750; letter-spacing: -.065em; line-height: 1.075; }
.page-heading p { margin-top: 10px; color: var(--muted); line-height: 1.45; }
.creator-tag { display: inline-block; margin-top: 9px; padding: 4px 10px; border: 1px solid #d8e8dc; border-radius: 20px; color: #235b46; background: #eaf4ec; font-size: .875rem; font-weight: 650; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: .5rem; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; font-size: .875rem; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.primary { color: #fff; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.secondary { color: #235b46; background: #f4f8f4; border-color: #dce8df; }
.secondary:hover { background: #e6f1e9; }
.compact { min-height: 36px; padding: 7px 10px; }
.plus { width: 13px; height: 13px; display: inline-block; position: relative; flex: none; }
.plus::before, .plus::after { position: absolute; left: 50%; top: 50%; content: ""; background: currentColor; border-radius: 2px; transform: translate(-50%, -50%); width: 12px; height: 2px; }
.plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: 0 2px 5px #263f2f06; min-width: 0; }
.overview { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.metric { position: relative; overflow: hidden; padding: 19px 22px; min-height: 139px; }
.metric h2 { font-size: .9375rem; font-weight: 650; line-height: 1.35; color: #405a4c; }
.metric-value { margin-top: 7px; font-size: clamp(1.85rem, 4vw, 2.5rem); line-height: 1.15; font-weight: 745; letter-spacing: -.065em; overflow-wrap: anywhere; }
.metric-note { margin-top: 8px; font-size: .875rem; line-height: 1.35; color: var(--muted); }
.metric-feature { background: #174f3d; border-color: #174f3d; color: #fff; isolation: isolate; }
.metric-feature::after { position: absolute; content: ""; width: 155px; aspect-ratio: 1; right: -32px; top: -21px; border-radius: 50%; border: 1px solid #9ee6be29; box-shadow: 0 0 0 20px #a3e6bf12, 0 0 0 39px #a3e6bf0e, 0 0 0 59px #a3e6bf08; z-index: -1; }
.metric-feature h2, .metric-feature .metric-note { color: #d7eee1; }
.progress-row { display: flex; align-items: center; gap: 10px; margin-top: 11px; color: var(--muted); font-size: .875rem; }
.progress-row span { flex: none; }
progress { appearance: none; width: 100%; height: 7px; border: 0; border-radius: 50px; overflow: hidden; background: #e7f0e9; color: #348263; }
progress::-webkit-progress-bar { background: #e7f0e9; border-radius: 50px; }
progress::-webkit-progress-value { background: #348263; border-radius: 50px; }
progress::-moz-progress-bar { background: #348263; border-radius: 50px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.side-stack { min-width: 0; display: grid; gap: 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 21px 0; }
.section-head h2 { font-size: 1.23rem; line-height: 1.25; letter-spacing: -.034em; }
.section-head p { color: var(--muted); font-size: .875rem; line-height: 1.4; margin-top: 4px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 21px 14px; border-bottom: 1px solid #edf1ed; }
.segments { display: flex; gap: 1px; padding: 3px; border-radius: 10px; background: #eef3ee; }
.segments button { background: transparent; border: 0; border-radius: 7px; color: var(--muted); min-height: 32px; padding: 5px 10px; font-size: .875rem; font-weight: 650; white-space: nowrap; }
.segments button[aria-pressed="true"] { background: #fff; color: #204f3d; box-shadow: 0 1px 3px #13291e1b; }
.segments button:hover { color: var(--accent-dark); }
select { appearance: none; background: linear-gradient(45deg, transparent 50%, #4c6659 50%) calc(100% - 14px) 52% / 5px 5px no-repeat, linear-gradient(135deg, #4c6659 50%, transparent 50%) calc(100% - 9px) 52% / 5px 5px no-repeat, #fff; }
.subject-filter { min-height: 38px; max-width: 48%; padding: 6px 26px 6px 10px; border: 1px solid #dce7de; border-radius: 9px; color: var(--ink); font-size: .875rem; }
.item-list, .daily-list, .subject-list { list-style: none; padding: 0; }
.item-list:empty { display: none; }
.item-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(76px, auto) auto; align-items: center; gap: 12px; padding: 13px 20px; }
.item-row + .item-row { border-top: 1px solid #edf1ed; }
.item-check-target { display: grid; place-items: center; cursor: pointer; }
.item-check { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.item-name { font-weight: 680; line-height: 1.35; overflow-wrap: anywhere; }
.item-row.is-done .item-name { color: var(--muted); text-decoration: line-through; }
.item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; margin-top: 5px; color: var(--muted); font-size: .875rem; }
.subject-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--subject-color, #5a9478); }
.item-subject { display: inline-flex; align-items: center; min-width: 0; gap: 6px; overflow-wrap: anywhere; }
.item-date { color: var(--muted); font-size: .875rem; line-height: 1.35; }
.item-date.urgent { color: #8a362e; font-weight: 650; }
.item-time { display: block; margin-top: 2px; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.edit-button { min-height: 34px; padding: 5px 9px; color: #275742; }
.empty-state { min-height: 287px; padding: 37px 16px 41px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-icon { display: grid; place-items: center; width: 53px; height: 53px; margin-bottom: 13px; border-radius: 15px; background: #e9f4eb; }
.empty-icon > span { position: relative; width: 19px; height: 23px; border: 1.6px solid #417e62; border-radius: 4px; }
.empty-icon > span::after { position: absolute; content: ""; top: 6px; left: 4px; right: 4px; height: 1.5px; background: #417e62; box-shadow: 0 4px #417e62, 0 8px #417e62; }
.empty-state h3 { font-size: 1.13rem; letter-spacing: -.022em; }
.empty-state p { color: var(--muted); margin: 6px 0 14px; font-size: .9375rem; line-height: 1.45; }
.daily-list { padding: 10px 16px 5px; }
.daily-day { display: grid; grid-template-columns: minmax(94px, 1.15fr) minmax(25px, 1fr) minmax(50px, auto); align-items: center; gap: 9px; min-height: 30px; padding: 4px 7px; color: var(--muted); font-size: .875rem; }
.daily-day.today { border-radius: 8px; background: #eef6ef; color: #21523f; font-weight: 700; }
.daily-day time { white-space: nowrap; }
.daily-day span { text-align: right; white-space: nowrap; }
.daily-day progress { height: 5px; }
.target-details { margin: 0 20px 14px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.target-details summary { color: #275a45; font-weight: 650; }
.target-details p { margin-top: 6px; }
.subject-list { padding: 11px 20px 14px; }
.subject-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 35px; padding-block: 4px; font-size: .875rem; }
.subject-entry + .subject-entry { border-top: 1px solid #edf1ed; }
.subject-name { font-weight: 620; overflow-wrap: anywhere; }
.subject-count { color: var(--muted); text-align: right; }
footer { padding: 19px 1px 24px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .875rem; }
.device-dot { width: 7px; height: 7px; border-radius: 50%; background: #54846c; }
dialog { width: min(460px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 1px solid var(--border); border-radius: 17px; color: var(--ink); box-shadow: 0 18px 65px #0d281c42; }
dialog::backdrop { background: #102c2190; }
.dialog-form { padding: 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.dialog-head h2 { font-size: 1.35rem; letter-spacing: -.04em; }
.close-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; background: #f1f6f2; color: var(--muted); border: 0; border-radius: 8px; font-size: 1.5rem; line-height: 1; }
.close-button:hover { background: #e2eee5; }
.field { display: grid; gap: 6px; margin-top: 12px; color: #294438; font-size: .875rem; font-weight: 650; min-width: 0; }
.field input, .field select { width: 100%; min-width: 0; min-height: 42px; border-radius: 8px; border: 1px solid #cbdace; color: var(--ink); padding: 8px 10px; font-size: 1rem; font-weight: 450; }
.field select { padding-right: 26px; }
.field input::placeholder { color: #607368; }
.optional { font-weight: 450; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dialog-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.danger { color: #8c342e; background: #fff; margin-right: auto; }
.danger:hover { background: #fdf0ee; }
.form-error, .page-error { color: #902f2c; line-height: 1.45; font-size: .875rem; margin-top: 10px; }
.page-error { padding-bottom: 12px; }

@media (max-width: 820px) {
  .shell { width: min(100% - 36px, 1160px); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.36fr) minmax(0, 1fr); gap: 12px; }
  .section-head { padding-inline: 14px; }
  .toolbar { padding-inline: 14px; gap: 7px; }
  .item-row { padding-inline: 14px; gap: 8px; }
  .metric { padding-inline: 16px; }
  .daily-list { padding-inline: 10px; }
  .target-details { margin-inline: 14px; }
  .subject-list { padding-inline: 14px; }
}
@media (max-width: 680px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .bar-inner { min-height: 62px; }
  .page-heading { padding-block: 27px 20px; align-items: flex-start; flex-direction: column; gap: 13px; }
  .overview { gap: 8px; margin-bottom: 12px; }
  .metric { padding: 12px 10px; min-height: 115px; }
  .metric h2 { font-size: .875rem; }
  .metric-value { font-size: 1.6rem; }
  .progress-row { align-items: flex-start; flex-direction: column; gap: 4px; margin-top: 7px; }
  .metric-note, .progress-row { font-size: .8125rem; }
  .daily-day { grid-template-columns: minmax(85px, 1fr) minmax(20px, .75fr) auto; gap: 5px; }
}
@media (max-width: 500px) {
  .side-stack { grid-template-columns: 1fr; }
}
@media (max-width: 365px) {
  .shell { width: calc(100% - 24px); }
}

.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.heading-actions .mobile-exams { display: none; }
.next-exam { padding: 13px 21px 17px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#next-exam-title { font-size: .9375rem; font-weight: 680; line-height: 1.35; }
#next-exam-date { display: block; color: var(--muted); font-size: .875rem; margin-top: 3px; }
.exam-count { display: inline-block; border-radius: 20px; padding: 4px 9px; color: #20523e; background: #eaf5ed; font-size: .875rem; font-weight: 680; white-space: nowrap; }
.exam-count.past { color: var(--muted); background: #f0f3f0; }
.item-start { display: block; margin-top: 2px; font-size: .875rem; line-height: 1.35; color: var(--muted); }
.wide-dialog { width: min(680px, calc(100% - 24px)); }
.dialog-note, .exam-instructions { color: var(--muted); font-size: .9375rem; line-height: 1.45; }
.topic-list { max-height: min(330px, 38vh); overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.topic-group h3 { padding: 8px 12px; color: #20523e; background: #edf5ef; font-size: .875rem; }
.topic-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; }
.topic-row + .topic-row { border-top: 1px solid #edf1ed; }
.topic-row:hover { background: #f7faf7; }
.topic-row:has(:disabled) { cursor: default; }
.topic-description { font-size: .9375rem; font-weight: 620; overflow-wrap: anywhere; }
.topic-description small { display: block; font-weight: 450; font-size: .875rem; color: var(--muted); margin-top: 2px; }
.topic-time { font-size: .875rem; color: var(--muted); white-space: nowrap; }
.syllabus-source { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .875rem; color: var(--muted); margin-top: 6px; }
.syllabus-source:empty { display: none; }
.syllabus-source a, .exam-instructions a { color: var(--accent-dark); }
.syllabus-actions { align-items: center; }
#topic-selection { margin-right: auto; }
.button:disabled { color: #52675a; background: #edf2ee; border-color: #e2e9e3; cursor: default; }
.exam-dialog-body > .dialog-note + .dialog-note { margin-top: 4px; }
.exam-list { list-style: none; display: grid; gap: 8px; padding: 0; margin-block: 15px; }
.exam-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; }
.exam-title { font-size: 1rem; font-weight: 680; line-height: 1.35; overflow-wrap: anywhere; }
.exam-date { display: block; margin-top: 2px; color: var(--muted); font-size: .875rem; }
.exam-gap { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding-top: 8px; border-top: 1px solid #e8efe8; color: var(--muted); font-size: .875rem; }
.exam-gap strong { color: #235b46; font-weight: 680; }
.exam-instructions p + p { margin-top: 4px; }
@media (max-width: 820px) {
  .next-exam { padding-inline: 14px; }
}
@media (min-width: 501px) and (max-width: 680px) {
  .exam-card { grid-column: 1 / -1; }
}
@media (max-width: 430px) {
  .exam-count { padding-inline: 6px; }
  .topic-row, .topic-group h3 { padding-inline: 8px; }
}
.workspace-nav { padding: 12px 21px; border-bottom: 1px solid #edf1ed; }
.workspace-nav .segments { display: inline-flex; }
.workspace-nav .segments button { padding-inline: 15px; }
.workspace-head { padding-top: 16px; }
.chapter-form { padding: 0 21px 19px; }
.chapter-results { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 7px; }
.chapter-results .compact { min-height: 32px; }
.chapter-details { margin-top: 10px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.chapter-details summary { color: #275a45; font-weight: 650; }
.chapter-details .field { margin-top: 5px; }
.chapter-form .topic-list { max-height: min(350px, 43vh); }
.chapter-form .syllabus-source p { flex-basis: 100%; }
.chapter-form .syllabus-actions { margin-top: 13px; }
.no-chapters { padding: 18px 12px; color: var(--muted); font-size: .9375rem; }
@media (max-width: 820px) {
  .workspace-nav, .chapter-form { padding-inline: 14px; }
}
@media (max-width: 680px) {
  .heading-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .heading-actions .mobile-exams { display: inline-flex; }
  .heading-actions .button { padding-inline: 8px; white-space: normal; }
  .button, .chapter-results .compact, .segments button,
  .field input, .field select, .subject-filter { min-height: 44px; }
  .subject-filter { font-size: 1rem; }
  .close-button { width: 44px; height: 44px; flex: 0 0 44px; }
  .topic-row { min-height: 48px; }
  .item-check-target { width: 44px; height: 44px; }
  .workspace-nav .segments { display: flex; }
  .workspace-nav .segments button { flex: 1; }
  .chapter-details summary, .target-details summary { padding-block: 9px; }
  dialog { max-height: calc(100dvh - 20px); }
}
@media (max-width: 520px) {
  .shell { width: calc(100% - 24px); }
  .page-heading { padding-block: 20px 15px; }
  .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 99px; padding: 11px 12px; }
  .metric-feature { grid-column: 1 / -1; min-height: 0; }
  .metric-feature .metric-value { font-size: 1.9rem; }
  .metric-note, .progress-row { font-size: .875rem; }
  .chapter-form .topic-list { max-height: min(420px, 52dvh); }
  .item-row { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 2px; padding-inline: 7px; }
  .item-due { grid-row: 2; grid-column: 2 / -1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
  .item-start, .item-time { margin: 0; }
  .edit-button { grid-column: 3; grid-row: 1; }
  .dialog-form { padding: 14px; }
  .exam-entry { padding-inline: 10px; gap: 7px 8px; }
}
@media (max-width: 420px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .segments button { flex: 1; }
  .subject-filter { width: 100%; max-width: none; }
}

#show-all-chapters[aria-pressed="true"] { border-color: #8daf9b; background: #e7f2e9; }
.subject-capsules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.subject-capsule { display: grid; align-content: center; gap: 3px; min-height: 65px; min-width: 0; padding: 8px 12px; border: 1px solid #dbe8dd; border-radius: 26px; background: #f2f8f3; color: #204f3d; text-align: center; }
.subject-capsule-name { font-size: .875rem; font-weight: 680; line-height: 1.25; overflow-wrap: anywhere; }
.subject-capsule-target { font-size: .875rem; color: #52665b; line-height: 1.25; }
.subject-capsule:hover { background: #e7f2e8; border-color: #8daf9b; }
.subject-capsule[aria-pressed="true"] { border-color: #174f3d; background: #174f3d; color: #fff; }
.subject-capsule[aria-pressed="true"] .subject-capsule-target { color: #d7eee1; }

.calendar-body { padding: 12px 21px 20px; }
.calendar-shortcuts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.calendar-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; }
#calendar-month { font-size: 1.08rem; line-height: 1.25; text-align: center; }
.calendar-table { width: 100%; table-layout: fixed; border-spacing: 3px; margin-top: 7px; }
.calendar-table th { color: var(--muted); font-size: .875rem; font-weight: 650; padding: 4px 0; }
.calendar-table td { padding: 0; }
.calendar-day { display: grid; grid-template-rows: 1fr 4px; place-items: center; gap: 3px; width: 100%; min-height: 48px; padding: 4px 0; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--ink); font-size: .9375rem; font-weight: 650; }
.calendar-day:hover { background: #eaf4ed; }
.calendar-day.other-month { background: #f4f7f4; color: #586b62; }
.calendar-day[aria-current="date"] { border-color: #53876e; color: var(--accent-dark); }
.calendar-day[aria-pressed="true"] { border-color: #53876e; background: #deefe3; color: var(--accent-dark); }
.calendar-day:focus-visible { outline-offset: 1px; }
.calendar-marks { display: flex; flex-wrap: nowrap; gap: 2px; }
.calendar-marker { display: inline-block; width: 8px; height: 4px; flex: none; border-radius: 8px; }
.calendar-marker.exam { background: #93601d; }
.calendar-marker.start { background: #2c696a; }
.calendar-marker.due { background: #925376; }
.calendar-key { display: flex; flex-wrap: wrap; gap: 4px 13px; margin: 9px 0 13px; padding: 0; list-style: none; color: var(--muted); font-size: .875rem; }
.calendar-key li { display: flex; align-items: center; gap: 5px; }
.calendar-agenda { padding-top: 11px; border-top: 1px solid var(--border); }
.calendar-agenda-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; }
#calendar-date { font-size: 1rem; line-height: 1.35; }
.calendar-events { display: grid; gap: 7px; list-style: none; padding: 0; }
.calendar-events:not(:empty), #calendar-empty { margin-top: 9px; }
.calendar-event { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.calendar-event-details { min-width: 0; }
.calendar-event-title { font-weight: 650; overflow-wrap: anywhere; }
.calendar-event-note, .calendar-label { font-size: .875rem; color: var(--muted); }
.calendar-label { display: inline-block; font-weight: 670; }
.calendar-label.exam { color: #795019; }
.calendar-label.start { color: #245e5f; }
.calendar-label.due { color: #824567; }

@media (max-width: 820px) {
  .calendar-body { padding-inline: 12px; }
}
@media (max-width: 680px) {
  .workspace-nav .segments button { padding-inline: 6px; min-width: 0; white-space: normal; }
}
@media (max-width: 520px) {
  .subject-capsules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-body { padding-inline: 8px; }
  .calendar-table { border-spacing: 2px; }
  .calendar-day { min-height: 44px; }
}

.focus-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; margin-top: 12px; padding: 6px 8px; color: #fff; background: #ffffff16; border: 1px solid #c6edd23b; border-radius: 9px; font-size: .875rem; font-weight: 670; text-align: left; }
.focus-entry:hover { background: #ffffff28; }
.focus-entry:focus-visible { outline-color: #d7eee1; }
#focus-dashboard-time { color: #d7eee1; font-weight: 500; overflow-wrap: anywhere; }
.focus-clock-icon { position: relative; width: 15px; height: 15px; flex: none; border: 1.5px solid currentColor; border-radius: 50%; }
.focus-clock-icon::before { position: absolute; top: 2px; left: 5px; width: 3px; height: 5px; border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; content: ""; }
.focus-dialog { width: min(540px, calc(100% - 24px)); }
.focus-timer-card { padding: 14px 12px; text-align: center; background: #eaf5ed; border-radius: 13px; }
#focus-phase { color: #235b46; font-size: .9375rem; font-weight: 650; }
#focus-countdown { margin-block: 3px 9px; font-size: clamp(2.35rem, 9vw, 3.6rem); font-weight: 730; font-variant-numeric: tabular-nums; letter-spacing: -.05em; line-height: 1.05; }
.focus-controls, .focus-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.focus-controls { justify-content: center; }
.focus-actions { margin-top: 9px; }
.focus-rewards { margin-top: 13px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; }
.focus-goal-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; font-size: .875rem; }
.focus-goal-header h3 { font-size: .9375rem; }
.focus-reward { margin: 5px 0 2px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.focus-reward.unlocked { color: var(--accent-dark); font-weight: 700; }
.focus-details { margin-top: 5px; border-bottom: 1px solid var(--border); }
.focus-details summary { padding-block: 9px; color: var(--accent-dark); font-weight: 680; font-size: .9375rem; }
.focus-details form { padding-bottom: 11px; }
.focus-details .field { margin-top: 7px; }
.focus-setting-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.focus-help { margin-top: 7px; }
@media (max-width: 680px) {
  .focus-details summary { min-height: 44px; padding-block: 11px; }
}
@media (max-width: 365px) {
  .focus-entry { width: 100%; }
  .focus-setting-fields { gap: 5px; }
}

.study-profile { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 10px 21px; border-bottom: 1px solid var(--border); background: #f5f9f5; }
.profile-label { color: var(--muted); font-weight: 550; font-size: .875rem; }
#profile-label { display: block; margin-top: 2px; color: var(--accent-dark); font-size: .9375rem; }
.active-syllabus-link { margin-top: 10px; font-size: .875rem; }
.active-syllabus-link a { color: var(--accent-dark); }
.track-fieldset { min-width: 0; padding: 0; margin: 12px 0 0; border: 0; }
.track-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.track-option { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 11px; color: var(--ink); background: #f5f9f5; cursor: pointer; font-size: .9375rem; font-weight: 640; }
.track-option:has(input:checked) { color: var(--accent-dark); border-color: #7fa991; background: #e9f5ec; }
.track-option input { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--accent); }
@media (max-width: 820px) {
  .study-profile { padding-inline: 14px; }
}
@media (max-width: 380px) {
  .track-options { grid-template-columns: 1fr; }
}

.header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 7px; }
#theme-toggle[aria-pressed="true"] { border-color: #80ad93; }
.guide-steps { display: grid; gap: 10px; padding-left: 22px; margin-bottom: 14px; line-height: 1.55; }

:root[data-theme="dark"] {
  color-scheme: dark;
  color: #e6f1e9;
  background: #111b17;
  --ink: #e6f1e9;
  --muted: #b0c5b9;
  --border: #3a5146;
  --accent: #28765a;
  --accent-dark: #a6dfbd;
  --pale: #263f34;
}
[data-theme="dark"] :is(.topbar, .card, dialog) { background: #1a2a23; }
[data-theme="dark"] :is(.metric-feature, .subject-capsule[aria-pressed="true"]) { background: #205940; }
[data-theme="dark"] :is(.metric h2, .calendar-day.other-month, .subject-capsule-target, .field input::placeholder) { color: var(--muted); }
[data-theme="dark"] .metric-feature h2 { color: #e3f3e8; }
[data-theme="dark"] :is(.secondary, .segments, .close-button, .empty-icon, .subject-capsule, .topic-group h3, .study-profile, .track-option, .focus-timer-card, .exam-count, .daily-day.today, .creator-tag) {
  background: #263f34;
  border-color: var(--border);
  color: var(--ink);
}
[data-theme="dark"] :is(.secondary:hover, .close-button:hover, .subject-capsule:hover, .topic-row:hover, .segments button[aria-pressed="true"], #show-all-chapters[aria-pressed="true"], .track-option:has(input:checked), .calendar-day[aria-pressed="true"]) {
  background: #345645;
  border-color: #80ad93;
  color: #eff9f2;
}
[data-theme="dark"] :is(.field input, .field select, .subject-filter, .calendar-day, .calendar-day.other-month) {
  background-color: #14251d;
  color: var(--ink);
  border-color: var(--border);
}
[data-theme="dark"] select { background-image: linear-gradient(45deg, transparent 50%, #b0c5b9 50%), linear-gradient(135deg, #b0c5b9 50%, transparent 50%); }
[data-theme="dark"] :is(.field, .target-details summary, .chapter-details summary, #focus-phase, .exam-gap strong) { color: var(--accent-dark); }
[data-theme="dark"] :is(.workspace-nav, .toolbar, .item-row, .subject-entry, .topic-row, .exam-gap) { border-color: var(--border); }
[data-theme="dark"] .primary:hover { background: #24694e; }
[data-theme="dark"] :is(progress, progress::-webkit-progress-bar) { background: #30483c; }
[data-theme="dark"] .exam-count.past { color: var(--muted); background: #293a32; }
[data-theme="dark"] :is(.form-error, .page-error, .item-date.urgent, .danger) { color: #ffafa3; }
[data-theme="dark"] .danger { background: #332522; }
[data-theme="dark"] .button:disabled { color: #b0c5b9; background: #273b31; border-color: var(--border); }
[data-theme="dark"] .calendar-label.exam { color: #f4c583; }
[data-theme="dark"] .calendar-label.start { color: #95d9d9; }
[data-theme="dark"] .calendar-label.due { color: #e8afd0; }
@media (max-width: 520px) {
  .bar-inner { flex-wrap: wrap; gap: 7px; padding-block: 9px; }
  .header-actions { justify-content: flex-start; }
}
