:root {
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  color: #1d2943;
  background: #f5f7fc;
  --ink: #1d2943;
  --muted: #5c6880;
  --quiet: #69758c;
  --line: #e1e6f1;
  --blue: #3452b9;
  --blue-dark: #263e99;
  --blue-soft: #eaf0ff;
  --panel: #fff;
  --shadow: 0 4px 14px #1c305b08;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
main:focus { outline: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .54; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible {
  outline: 3px solid #8196f3;
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
label { font-weight: 600; font-size: 14px; display: grid; gap: 8px; }
input:not([type="checkbox"], [type="radio"]), textarea, select {
  background: #fbfcff;
  border: 1px solid #dbe2f0;
  border-radius: 11px;
  min-height: 44px;
  color: var(--ink);
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 400;
}
input::placeholder, textarea::placeholder { color: #6e7990; }
textarea { resize: vertical; line-height: 1.6; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); width: 18px; height: 18px; margin: 0; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.65; }
.loading { max-width: 560px; margin: 20vh auto; text-align: center; padding: 24px; color: var(--muted); }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }

.icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background: currentColor;
  mask: url("/icons/ui.png") calc(-24px * var(--tile)) 0 / 528px 24px no-repeat;
  -webkit-mask: url("/icons/ui.png") calc(-24px * var(--tile)) 0 / 528px 24px no-repeat;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 24px; font-weight: 760; letter-spacing: .04em; }
.brand img { flex: 0 0 auto; }
.button, .icon-button, .text-button, .focus-link, .sync-pill, .filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 650;
  font-size: 14px;
  min-height: 42px;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.button { padding: 0 15px; }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 3px 7px #233d9624; }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { background: #f5f7fd; border-color: var(--line); color: var(--blue-dark); }
.button.secondary:hover, .icon-button:hover, .text-button:hover { background: var(--blue-soft); }
.button.wide { width: 100%; min-height: 46px; }
.text-button { color: var(--blue-dark); padding: 0 9px; }
.danger { color: #9d353c; }
.icon-button { width: 42px; padding: 0; color: var(--muted); }

#app:has(.sidebar) { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 28px 17px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #fff;
  border-right: 1px solid var(--line);
}
.sidebar .brand { margin: 0 12px 40px; align-self: start; }
.nav { display: grid; gap: 7px; }
.nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  width: 100%;
  font-weight: 630;
  font-size: 15px;
  min-height: 45px;
  padding: 0 12px;
  text-align: left;
}
.nav-link:hover { background: #f2f5fb; }
.nav-link.selected { background: #eaf0ff; color: #2d469e; }
.sidebar-bottom { margin-top: auto; }
.account-chip { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 16px 6px 3px; margin-top: 16px; }
.account-chip > span:last-child { display: grid; gap: 4px; min-width: 0; }
.account-chip b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.account-chip small { color: var(--muted); font-size: 12px; }
.avatar { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 11px; background: #eaf0ff; color: var(--blue-dark); font-weight: 700; }
.main-area { min-width: 0; }
.topbar { display: flex; justify-content: flex-end; align-items: center; min-height: 65px; padding: 0 clamp(22px, 4vw, 54px); border-bottom: 1px solid var(--line); background: #fbfcff; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.sync-pill { font-weight: 610; min-height: 38px; padding: 0 11px; color: var(--muted); background: #fff; border-color: var(--line); border-radius: 999px; font-size: 13px; }
.sync-pill:hover { border-color: #9cabd0; }
.sync-pill[data-status="synced"] { color: #24604f; background: #f2faf6; border-color: #d4e9e0; }
.sync-pill[data-status="offline"], .sync-pill[data-status="failed"], .conflict-button { color: #8a532c; background: #fff7eb; border-color: #f2dfc3; }
.sync-pill[data-status="saving"] { color: var(--blue-dark); background: var(--blue-soft); }
.conflict-button { width: auto; min-width: 42px; padding: 0 7px; gap: 3px; }
.conflict-label { margin-right: 3px; font-size: 13px; }
.mobile-brand, .mobile-settings, .mobile-nav { display: none; }
#workspace { width: 100%; max-width: 1440px; padding: 32px clamp(22px, 4vw, 54px) 48px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 25px; }
.page-heading h1 { font-weight: 760; font-size: clamp(28px, 3vw, 40px); letter-spacing: .015em; }
.page-heading p { font-size: 14px; color: var(--muted); margin-top: 7px; line-height: 1.6; }
.heading-actions { display: flex; align-items: center; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.63fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.main-column, .secondary-column { display: grid; align-content: start; gap: 16px; min-width: 0; }
.main-column { gap: 13px; }
.focus-card {
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  min-height: 244px;
  padding: 26px;
  border: 1px solid #354e92;
  border-radius: 21px;
  background: linear-gradient(115deg, #202e56 8%, #2a3e76 62%, #3c518d);
  box-shadow: 0 10px 22px #1d326622;
  color: #fff;
}
.focus-copy { max-width: 100%; z-index: 1; min-width: 0; position: relative; }
.focus-label { color: #e4ebff; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 620; }
.focus-label span { width: 8px; height: 8px; border-radius: 50%; background: #a9c1ff; box-shadow: 0 0 0 4px #a9c1ff30; }
.focus-card h2 { font-size: clamp(24px, 2.35vw, 34px); font-weight: 750; line-height: 1.3; margin-top: 12px; overflow-wrap: anywhere; max-width: 82%; }
.focus-card p { color: #e0e9ff; margin-top: 9px; font-size: 14px; line-height: 1.65; max-width: min(84%, 460px); overflow-wrap: anywhere; }
.focus-card p small { display: inline-flex; padding: 1px 7px; background: #d5dfff25; border-radius: 6px; margin-right: 4px; font-size: 11px; color: #fff; }
.focus-link { color: #e0e9ff; min-height: 34px; justify-content: flex-start; padding: 0; }
.focus-link:hover { color: #fff; text-decoration: underline; }
.focus-actions { margin-top: 23px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button.light { background: #f7f9ff; color: #253b85; min-height: 44px; }
.button.light:hover { background: #e5edff; }
.button.glass { color: #fff; border-color: #b6c6fa77; background: #e5ebff12; min-height: 44px; }
.button.glass:hover { background: #e5ebff30; }
.hero-dial {
  position: absolute;
  right: -14px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 205px;
  height: 205px;
  border: 1px solid #b3c5ff48;
  border-radius: 50%;
  pointer-events: none;
}
.hero-dial::before, .hero-dial::after { content: ""; position: absolute; inset: -25px; border: 1px solid #b3c5ff2b; border-radius: 50%; }
.hero-dial::after { inset: -51px; border-color: #b3c5ff20; }
.hero-dial.decorative { opacity: .7; }
.dial-tick { position: absolute; inset: 13px; border: 1px dashed #cdd9ff67; border-radius: 50%; }
.dial-inner { display: grid; place-content: center; justify-items: center; width: 64%; aspect-ratio: 1; border: 1px solid #cdd9ff50; border-radius: 50%; color: #e4ecff; background: #6c89d037; }
.decorative .dial-inner .icon { opacity: .68; scale: 1.6; }
.hero-dial.live { width: 152px; height: 152px; right: 23px; border-color: #c0d0ff9c; border-right-color: #eff5ff; }
.hero-dial.live .dial-tick { inset: 8px; }
.hero-dial.live .dial-inner { width: 82%; }
.dial-inner output { font-size: clamp(23px, 3vw, 34px); letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: #fff; font-weight: 650; }
.dial-inner small { color: #e4ecff; margin-top: 4px; font-size: 12px; }
.active-timer .focus-copy { max-width: calc(100% - 147px); }
.active-timer .focus-copy h2, .active-timer .focus-copy p { max-width: 100%; }
.restart-line { display: flex; justify-content: flex-end; margin-top: -2px; }
.restart-line .text-button { min-height: 39px; }

.panel { border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.section-title { display: flex; align-items: center; gap: 11px; padding: 16px 16px 13px; }
.section-title > div:nth-child(2) { flex: 1; min-width: 0; }
.section-title h2, .group > h2 { font-size: 17px; font-weight: 730; }
.section-title p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.section-icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; display: grid; place-items: center; background: #eef2fa; color: #445986; }
.section-icon.blue { background: #eaf0ff; color: #3851a8; }
.section-icon.violet { background: #f0ecfc; color: #6651a0; }
.section-icon.green { background: #e8f4ed; color: #3b6456; }
.empty-inline { color: var(--muted); font-size: 14px; padding: 4px 17px 19px; line-height: 1.6; }
.empty-block { padding: 23px 17px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.empty-block > p:first-child { font-weight: 630; color: #34415e; }
.empty-block .text-button { padding-left: 0; margin: 7px 0 -10px; }
.notice { margin: 0 16px 9px; padding: 9px 11px; border-radius: 9px; color: #7c4c2b; background: #fff5e7; font-size: 13px; line-height: 1.65; }
.notice p + p { margin-top: 3px; }
.availability-link { min-height: 34px; margin-left: -7px; padding-inline: 7px; color: #7c4c2b; text-decoration: underline; }
.timeline { list-style: none; padding: 0 16px; margin: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 42px 16px minmax(0, 1fr) auto; align-items: center; gap: 5px; min-height: 65px; --dot: #4465d3; }
.timeline .course { --dot: #7760bf; }
.timeline .life { --dot: #ab663d; }
.timeline .rest { --dot: #4c846e; }
.timeline li::after { content: ""; position: absolute; height: 100%; top: 50%; left: 54px; border-left: 1px solid #e0e6f1; z-index: 0; }
.timeline li:last-child::after { content: none; }
.timeline li.current { background: #f4f7ff; border-radius: 11px; }
.timeline li time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.timeline-dot { width: 9px; height: 9px; place-self: center; border-radius: 50%; background: var(--dot); z-index: 1; }
.plan-entry { display: grid; gap: 4px; align-content: center; text-align: left; width: 100%; min-width: 0; min-height: 48px; background: transparent; border: 0; padding: 5px 3px; color: var(--ink); border-radius: 7px; }
.plan-entry:hover { background: #eef2fa; }
.plan-entry strong { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.plan-entry small { font-size: 12px; color: var(--muted); }
.tag { white-space: nowrap; border-radius: 6px; padding: 4px 6px; font-size: 11px; font-weight: 650; }
.tag.study { color: #3a51a5; background: #eaf0ff; }
.tag.course { color: #65439c; background: #f1edfd; }
.tag.life { color: #885334; background: #faf0e7; }
.tag.rest { color: #32624f; background: #e7f3ec; }
.schedule-total { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 13px 16px; }
.schedule-total strong { color: var(--ink); }
.schedule-controls { display: flex; align-items: center; gap: 9px; }
.timetable-grid { display: grid; grid-template-columns: 54px repeat(7, minmax(0, 1fr)); }
.timetable-time-head, .timetable-day-head {
  display: flex;
  align-items: center;
  min-height: 60px;
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
}
.timetable-time-head { justify-content: center; color: var(--muted); font-size: 12px; }
.timetable-day-head { justify-content: space-between; gap: 2px; border-left: 1px solid var(--line); }
.timetable-day-head > div { display: grid; gap: 4px; min-width: 0; }
.timetable-day-head strong { font-size: 14px; }
.timetable-day-head time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.timetable-day-head.is-today { background: #eaf0ff; color: var(--blue-dark); }
.timetable-day-head .icon-button { width: 28px; min-height: 34px; flex: 0 0 28px; }
.timetable-day-head .icon { scale: .8; }
.timetable-rail, .timetable-track { position: relative; height: var(--track-height); min-width: 0; }
.timetable-rail { background: #fbfcff; }
.timetable-rail span { position: absolute; top: calc(var(--top) + 4px); width: 100%; text-align: center; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.timetable-track {
  border-left: 1px solid var(--line);
  background-image: linear-gradient(to bottom, #edf0f8 1px, transparent 1px);
  background-size: 100% var(--hour-height);
}
.timetable-track.is-today { background-color: #f8faff; }
.timetable-slot {
  position: absolute;
  top: calc(var(--top) + 1px);
  left: calc(var(--left) + 2px);
  width: max(5px, calc(var(--width) - 4px));
  height: var(--height);
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 3px;
  color: #29458e;
  background: #eaf0ff;
  border: 1px solid transparent;
  border-inline-start: 2px solid #718be2;
  border-radius: 6px;
  padding: 4px 5px;
  overflow: hidden;
  text-align: left;
}
.timetable-slot.course { color: #624391; background: #f1edfc; border-inline-start-color: #a082d6; }
.timetable-slot.life { color: #875331; background: #faf0e7; border-inline-start-color: #bd8b62; }
.timetable-slot.rest { color: #315e4c; background: #e7f3ec; border-inline-start-color: #6eaa8b; }
.timetable-slot:hover { border-color: currentColor; z-index: 1; }
.timetable-slot.overlap { border-top-color: #bd7943; }
.timetable-slot.outside-hours { border-inline-end: 2px solid #ba814f; }
.timetable-slot.recorded { padding-inline-end: 17px; }
.timetable-slot.recorded::after { content: "✓"; position: absolute; inset: 2px 3px auto auto; font-size: 12px; font-weight: 750; }
.timetable-slot strong, .timetable-slot small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.timetable-slot strong { font-size: 12px; }
.timetable-slot small { font-size: 11px; font-variant-numeric: tabular-nums; }
.timetable-slot.short { align-content: center; padding-block: 1px; }
.timetable-slot.short small { display: none; }
.timetable-foot-label, .timetable-day-foot { display: grid; place-items: center; min-width: 0; border-top: 1px solid var(--line); padding: 4px; }
.timetable-foot-label { color: var(--muted); font-size: 12px; }
.timetable-desktop .timetable-day-foot { border-left: 1px solid var(--line); }
.day-summary-button { padding-inline: 4px; gap: 1px; font-size: 12px; min-height: 44px; width: 100%; }
.day-summary-button .icon { scale: .75; width: 24px; }
.schedule-notice { margin: 12px; }
.timetable-mobile { display: none; }
.schedule-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); }
.schedule-day { display: grid; justify-items: center; align-content: center; grid-template-rows: auto auto 6px; gap: 3px; border: 1px solid transparent; border-radius: 9px; padding: 5px 1px; min-height: 59px; color: var(--muted); background: transparent; font-size: 12px; }
.schedule-day time { font-size: 11px; font-variant-numeric: tabular-nums; }
.schedule-day.is-today { color: var(--blue-dark); }
.schedule-day:hover, .schedule-day[aria-pressed="true"] { background: #eaf0ff; color: var(--blue-dark); border-color: #d9e4ff; }
.schedule-day[aria-pressed="true"] { font-weight: 700; }
.schedule-day-dot { width: 5px; height: 5px; border-radius: 50%; background: #6b83c8; }
.schedule-day-dot.overlap { background: #a96839; }
.repeat-fields { padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #f7f9fe; }
.weekday-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.weekday-field legend { margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 5px; }
.weekday-picker label { display: flex; position: relative; cursor: pointer; }
.weekday-picker input { position: absolute; opacity: 0; }
.weekday-picker span { display: grid; place-items: center; padding-inline: 7px; min-height: 40px; background: white; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.weekday-picker input:checked + span { border-color: #b6c7f0; color: var(--blue-dark); background: #eaf0ff; }
.weekday-picker input:focus-visible + span { outline: 3px solid #8196f3; outline-offset: 2px; }
.repeat-end { align-items: end; grid-template-columns: minmax(0, 1fr) auto; }
.repeat-end .button { min-height: 44px; }
.skipped-days { color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.skipped-days summary { cursor: pointer; min-height: 25px; }
.skipped-days ul { padding: 3px 0 0; margin: 0; list-style: none; max-height: 175px; overflow: auto; }
.skipped-days li { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.quick-links { padding: 3px 14px; }
.quick-link { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--ink); text-align: left; min-height: 65px; padding: 9px 1px; }
.quick-link + .quick-link { border-top: 1px solid var(--line); }
.quick-link > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 5px; }
.quick-link > .icon:last-child { color: var(--quiet); }
.quick-link:hover strong { color: var(--blue); }
.quick-link strong { font-size: 14px; }
.quick-link small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.past-link { justify-content: flex-start; justify-self: start; white-space: normal; text-align: left; }

.task-row { display: flex; gap: 11px; min-height: 61px; align-items: center; padding: 4px 12px; border-top: 1px solid #edf0f8; }
.task-row:hover { background: #fafbff; }
.task-row.done .task-name strong { text-decoration: line-through; color: var(--muted); }
.check-button { display: grid; place-items: center; border: 0; background: transparent; color: var(--blue); padding: 0; width: 32px; height: 42px; flex: 0 0 32px; border-radius: 7px; position: relative; }
.check-button::before { content: ""; position: absolute; width: 20px; height: 20px; border: 1px solid #a3b0cc; border-radius: 6px; }
.check-button.checked::before { background: #e9efff; border-color: #8798d9; }
.check-button .icon { scale: .84; z-index: 1; }
.check-button:hover { background: #eef2ff; }
.cancelled-point { width: 11px; height: 11px; border-radius: 50%; background: #c0c8da; margin: 0 10px; flex: 0 0 11px; }
.task-name { display: grid; align-content: center; text-align: left; gap: 4px; flex: 1; min-width: 0; min-height: 48px; border: 0; color: var(--ink); background: transparent; padding: 6px 0; }
.task-name strong { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.task-name span, .task-name small { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.task-name small { font-size: 12px; }
.task-actions { display: flex; align-items: center; gap: 3px; }
.task-actions .icon-button { width: 37px; }
.row-start { background: #f2f5fe; font-size: 12px; padding-inline: 8px; }
.filter-bar { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 17px; }
.filter { padding: 0 13px; color: var(--muted); background: #fff; border-color: var(--line); }
.filter.selected { color: var(--blue-dark); background: #eaf0ff; border-color: #c9d6f8; }
.filter:hover { border-color: #9eafd8; }
.group + .group { margin-top: 12px; }
.group > h2 { padding: 13px 16px 4px; }
.group .timeline { padding-bottom: 8px; }

dt { color: var(--muted); }
dd { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { padding: 17px; display: grid; gap: 8px; }
.metric span, .metric small { color: var(--muted); font-size: 13px; }
.metric strong { font-weight: 740; font-size: clamp(21px, 2.5vw, 29px); }
.period-controls { display: flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.chart-panel, .table-panel { margin-bottom: 16px; }
.week-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 4px 14px 16px; gap: 5px; }
.bar-column { display: grid; justify-items: center; min-width: 0; color: var(--muted); font-size: 12px; gap: 5px; }
.bar-track { height: 92px; width: clamp(12px, 3.6vw, 31px); border-radius: 7px; background: #eff2fb; display: flex; align-items: flex-end; }
.bar { width: 100%; height: max(3px, var(--height)); background: #526dce; border-radius: 7px; }
.bar.missing { height: 0; }
.table-scroll { overflow: auto; margin: 0 10px 10px; }
table { border-collapse: collapse; width: 100%; min-width: 710px; font-size: 13px; }
th, td { padding: 11px 7px; text-align: left; border-bottom: 1px solid #edf0f8; white-space: nowrap; }
thead th { background: #f5f7fc; color: #536079; font-weight: 650; }
tbody td { color: var(--muted); }
tbody th { font-weight: 640; }
.session-row { border-top: 1px solid #edf0f8; padding: 12px 16px; }
.session-row div { display: grid; gap: 5px; }
.session-row small, .session-row p { font-size: 13px; color: var(--muted); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

.auth-shell { display: grid; grid-template-columns: 1.13fr 1fr; width: min(1010px, calc(100% - 56px)); min-height: 610px; margin: max(35px, 7vh) auto; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: 0 18px 55px #23345d14; }
.auth-brand { background: linear-gradient(150deg, #1f2e57 8%, #344783 70%, #435ca2); color: #fff; padding: 31px; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.auth-brand .brand { color: #fff; }
.auth-intro { align-self: center; text-align: center; padding: 26px 0; position: relative; }
.auth-intro h1 { font-size: 46px; font-weight: 740; letter-spacing: .12em; margin: 25px 0 11px; }
.auth-intro p { font-size: 16px; color: #e5edff; line-height: 1.75; letter-spacing: .035em; }
.cover-dial { width: 172px; height: 172px; border-radius: 50%; border: 1px solid #bbcaff85; margin: auto; display: grid; place-items: center; position: relative; }
.cover-dial::before, .cover-dial::after { content: ""; position: absolute; inset: -19px; border: 1px solid #b0c3ff35; border-radius: 50%; }
.cover-dial::after { inset: -40px; border-color: #b0c3ff25; }
.cover-dial div { width: 123px; height: 123px; border-radius: 50%; background: #94abf02d; border: 1px dashed #b9ccff83; position: relative; }
.cover-dial div::before { content: ""; position: absolute; bottom: 49%; left: 49%; width: 3px; height: 36px; border-radius: 4px; background: #e7efff; transform: rotate(36deg); transform-origin: bottom; }
.cover-dial div::after { content: ""; position: absolute; top: 48%; left: 48%; width: 8px; height: 8px; border-radius: 50%; background: #e7efff; box-shadow: 0 0 0 7px #dbe6ff30; }
.auth-content { align-self: center; padding: 40px clamp(23px, 4vw, 53px); }
.auth-form { display: grid; gap: 17px; }
.auth-form h2 { font-size: 29px; font-weight: 740; margin-bottom: 7px; }
.auth-form .text-button { justify-self: center; }
.compact-brand { display: none; }
.auth-password { display: grid; gap: 8px; }
.inline-field { display: flex; gap: 7px; }
.form-error { color: #9e303a; font-size: 14px; line-height: 1.5; }

dialog {
  width: min(590px, calc(100% - 32px));
  max-width: none;
  max-height: min(790px, calc(100dvh - 42px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 85px #14204142;
  overscroll-behavior: contain;
}
dialog::backdrop { background: #18284966; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 64px; padding: 7px 16px 7px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 20px; }
.modal-notice { margin: 12px 16px 0; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #f6f8fe; font-size: 14px; line-height: 1.55; }
#close-modal { font-size: 25px; font-weight: 500; }
#modal-body { padding: 18px 20px 21px; }
#modal-body > p:first-child:not(:last-child) { margin-bottom: 15px; }
.stacked { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.end-clock { display: grid; min-width: 0; gap: 8px; }
.end-of-day { min-height: 44px; font-size: 12px; padding-inline: 8px; }
.full-day-hours { justify-self: start; min-height: 33px; margin-top: -5px; }
.log-times { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; margin: 0; }
.log-times legend { color: var(--muted); font-size: 13px; padding-inline: 4px; }
.log-times label { font-size: 13px; font-weight: 500; }
.day-log-details { border-top: 1px solid var(--line); padding: 9px 0 3px; margin-top: 9px; font-size: 14px; }
.day-log-details summary { cursor: pointer; min-height: 32px; color: var(--muted); }
.day-log-details p { margin: 7px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.day-log-link { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; gap: 5px; width: 100%; min-height: 42px; padding: 4px 5px; color: var(--ink); text-align: left; border: 0; border-radius: 8px; background: transparent; }
.day-log-link:hover { background: var(--blue-soft); }
.day-log-link strong { overflow-wrap: anywhere; }
.day-log-link small { color: var(--muted); }
.day-summary-tools { border-top: 1px solid var(--line); margin-top: 9px; }
.day-summary-tools .text-button { padding-left: 3px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 5px; }
.form-actions.with-extra { justify-content: space-between; }
.form-note { font-size: 12px; }
.editor-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-height: 38px; border-top: 1px solid var(--line); }
.editor-tools .text-button { min-height: 38px; }
.duration-form { display: grid; align-items: end; grid-template-columns: 1fr auto; gap: 10px; }
.timer-task { border: 1px solid var(--line); border-radius: 11px; background: #f6f8fe; padding: 13px; }
.timer-task + .timer-task { margin-top: 10px; }
.timer-task strong { font-size: 15px; overflow-wrap: anywhere; }
.timer-task p { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 6px; overflow-wrap: anywhere; }
.choice-list { max-height: 240px; overflow: auto; display: grid; gap: 6px; padding: 3px; }
.task-choice { display: flex; align-items: center; gap: 9px; min-height: 51px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.task-choice:has(input:checked) { border-color: #aabbef; background: #f1f5ff; }
.task-choice span { display: grid; gap: 5px; overflow-wrap: anywhere; min-width: 0; }
.task-choice input { flex: 0 0 18px; }
.task-choice small { color: var(--muted); font-size: 12px; font-weight: 500; }
.settings-links { margin-top: 18px; border-top: 1px solid var(--line); }
.settings-links .quick-link { min-height: 57px; padding: 8px 6px; }
.file-name { color: var(--blue-dark); font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.preview { margin: 0 0 14px; padding: 13px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; border: 1px solid var(--line); border-radius: 11px; background: #f6f8fe; color: var(--ink); max-height: 52dvh; overflow: auto; }
.conflict-item { border: 1px solid var(--line); border-radius: 11px; padding: 12px; margin-top: 9px; }
.conflict-item > summary { cursor: pointer; font-weight: 650; font-size: 14px; overflow-wrap: anywhere; }
.conflict-item summary small { color: var(--muted); margin-left: 5px; font-weight: 500; }
.conflict-versions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 12px 0; }
.conflict-versions section { border-radius: 9px; background: #f6f8fe; padding: 8px; min-width: 0; }
.conflict-versions h3 { font-size: 13px; margin-bottom: 5px; }
.version-values { padding: 0; margin: 0; font-size: 12px; line-height: 1.5; }
.version-values div { margin: 5px 0; overflow-wrap: anywhere; }
.version-values dd { white-space: pre-wrap; }
.previous-version { color: var(--muted); font-size: 13px; margin: 10px 0; }
.toast { position: fixed; z-index: 10; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; width: max-content; max-width: calc(100% - 32px); padding: 12px 17px; border-radius: 12px; color: #fff; background: #253454; box-shadow: 0 10px 29px #1725473b; font-size: 14px; line-height: 1.6; pointer-events: none; }

@media (max-width: 1050px) {
  #app:has(.sidebar) { grid-template-columns: 180px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .today-grid { gap: 14px; grid-template-columns: minmax(0, 1.24fr) minmax(253px, 1fr); }
  .focus-card { padding: 20px; }
  .hero-dial.decorative { right: -63px; opacity: .53; }
  .hero-dial.live { width: 120px; height: 120px; right: 13px; }
  .active-timer .focus-copy { max-width: calc(100% - 102px); }
}
@media (max-width: 1000px) {
  .timetable-desktop { display: none; }
  .timetable-mobile { display: block; }
}
@media (max-width: 850px) {
  #app:has(.sidebar) { display: block; }
  .sidebar, .conflict-label { display: none; }
  .topbar { min-height: 58px; justify-content: space-between; padding-inline: 17px; }
  .mobile-brand { display: block; }
  .mobile-brand .brand { font-size: 20px; gap: 8px; }
  .mobile-brand img { width: 32px; height: 32px; }
  .mobile-settings { display: inline-flex; }
  #workspace { padding: 25px 17px calc(86px + env(safe-area-inset-bottom)); }
  .mobile-nav { position: fixed; z-index: 3; bottom: 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 5px 9px max(5px, env(safe-area-inset-bottom)); background: #fffffffa; border-top: 1px solid var(--line); }
  .mobile-nav .nav-link { display: grid; justify-items: center; justify-content: center; text-align: center; gap: 1px; margin: 0 auto; padding: 3px 5px; width: min(96px, 100%); min-height: 49px; color: #56647e; font-size: 12px; }
  .mobile-nav .nav-link.selected { color: #2d469e; }
  .toast { bottom: calc(68px + env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .page-heading { margin-bottom: 17px; }
  .page-heading p { font-size: 13px; margin-top: 4px; }
  .schedule-page .page-heading { align-items: stretch; flex-direction: column; gap: 10px; }
  .schedule-controls { width: 100%; justify-content: space-between; }
  .button { padding-inline: 10px; }
  .focus-card { border-radius: 17px; padding: 18px; min-height: 226px; }
  .focus-card h2 { font-size: 25px; }
  .focus-card p { max-width: 90%; }
  .main-column, .secondary-column { gap: 11px; }
  .section-title { padding: 12px 11px 10px; gap: 8px; }
  .section-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .section-title h2 { font-size: 16px; }
  .task-row { padding-inline: 7px; gap: 6px; }
  .task-actions .row-edit { display: none; }
  .task-actions > .tag { display: none; }
  .auth-shell { display: block; width: min(470px, calc(100% - 26px)); min-height: 0; margin: max(28px, 7vh) auto; border-radius: 18px; }
  .auth-brand { display: none; }
  .auth-content { padding: 23px 20px 20px; }
  .compact-brand { display: block; margin-bottom: 22px; }
  .compact-brand .brand { font-size: 21px; }
  .focus-actions { margin-top: 16px; }
  .metrics { gap: 7px; }
  .metric { padding: 10px; gap: 5px; border-radius: 12px; }
  .metric span, .metric small { font-size: 11px; }
  .metric strong { font-size: 17px; line-height: 1.4; }
  dialog { margin: auto auto 0; border-radius: 17px 17px 0 0; width: 100%; max-height: calc(100dvh - 12px); }
  #modal-body { padding: 14px 14px max(17px, env(safe-area-inset-bottom)); }
  .dialog-head { padding-inline: 14px; min-height: 54px; }
  .toast { padding: 9px 12px; }
}
@media (max-width: 370px) {
  .hero-dial.live { width: 98px; height: 98px; right: 10px; }
  .active-timer .focus-copy { max-width: calc(100% - 81px); }
  .dial-inner small { font-size: 10px; }
  .focus-actions .icon { display: none; }
  .top-actions { gap: 5px; }
  .sync-pill { padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
