#theme-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--sky-deep);
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(31, 108, 147, 0.08);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

#theme-button svg { width: 18px; height: 18px; }
#theme-button svg, .theme-dialog svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-dialog svg { width: 20px; height: 20px; flex: none; }
.theme-close { display: grid; width: 32px; height: 32px; flex: none; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink-soft); cursor: pointer; }
.theme-close:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
#theme-button:hover { border-color: var(--sky); background: var(--sky-pale); color: var(--sky-deep); }
#theme-button:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }

dialog#theme-dialog.theme-dialog {
  width: min(370px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 22px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #f1f8fc);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 60, 87, 0.24);
  color-scheme: light;
}

.theme-dialog:not([open]) { display: none; }
.theme-dialog::backdrop { background: rgba(18, 42, 60, 0.34); backdrop-filter: blur(5px); }
.theme-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.theme-dialog > header h2 { margin: 0; font-size: 19px; font-weight: 720; letter-spacing: -0.025em; }
.theme-dialog > header p { margin: 0; color: var(--ink-faint); font-size: 12px; line-height: 1.45; }

.theme-options { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.theme-options button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.theme-options button:hover { border-color: var(--line-strong); background: var(--sky-wash); color: var(--ink); }
.theme-options button[aria-pressed="true"] { border-color: var(--sky); background: var(--sky-pale); color: var(--sky-deep); box-shadow: inset 0 0 0 1px rgba(84, 184, 236, 0.15); }
.theme-options button:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.theme-status { min-height: 17px; margin: 14px 1px 0; color: var(--ink-faint); font-size: 11px; line-height: 1.45; }

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d1823;
  --panel: #142534;
  --white: #192e3d;
  --sky: #65bde8;
  --sky-deep: #73c6e9;
  --sky-pale: rgba(101, 189, 232, 0.16);
  --sky-wash: rgba(101, 189, 232, 0.08);
  --ink: #deecf5;
  --ink-soft: #afc2cf;
  --ink-faint: #8198ac;
  --line: #294052;
  --line-strong: #3a5b70;
  --danger: #e38b99;
  --glass: rgba(20, 37, 52, 0.88);
  --glass-solid: #192e3d;
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.27);
  --shadow-soft: 0 18px 48px rgba(0, 0, 0, 0.24);
  --shadow-card: 0 10px 26px rgba(0, 0, 0, 0.2);
  --muted: #91a8b8;
  --blue: #65bde8;
  --teal: #6bc7bb;
  --coral: #ef8b73;
}

html[data-theme="dark"] body:has(.app-shell) {
  background:
    radial-gradient(circle at 93% -7%, rgba(101, 189, 232, 0.1), transparent 29rem),
    radial-gradient(circle at -10% 76%, rgba(92, 190, 179, 0.065), transparent 24rem),
    var(--paper);
  color: var(--ink);
}

html[data-theme="dark"] .brand-mark { background: linear-gradient(145deg, #1c3a4d, #173042); }
html[data-theme="dark"] #account-button { background: #192e3d; border-color: var(--line-strong); color: var(--ink); }
html[data-theme="dark"] .button-primary { background: #65bde8; color: #0d2637; }
html[data-theme="dark"] .clock-hand-hour { background: #79b8e5; }
html[data-theme="dark"] .clock-hand-minute { background: #56c6bf; }
html[data-theme="dark"] .clock-hand-second { background: #f0987f; }
html[data-theme="dark"] .view-switch,
html[data-theme="dark"] .mobile-view-switch { background: rgba(17, 33, 46, 0.86); }
html[data-theme="dark"] .view-switch button[aria-pressed="true"] { background: var(--glass-solid); }
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .week-nav .icon-button { border-color: var(--line); background: rgba(25, 46, 61, 0.86); color: var(--ink-soft); }
html[data-theme="dark"] .icon-button:hover { border-color: var(--sky); background: var(--sky-pale); color: var(--sky); }
html[data-theme="dark"] .week-day:hover { background: rgba(101, 189, 232, 0.08); }
html[data-theme="dark"] .week-day.is-selected { border-color: var(--line); border-bottom-color: var(--panel); background: var(--glass-solid); }

html[data-theme="dark"] .panel,
html[data-theme="dark"] .detail-panel,
html[data-theme="dark"] .recent-panel {
  border-color: var(--line);
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  color: var(--ink);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

html[data-theme="dark"] .panel-header { border-bottom-color: rgba(129, 152, 172, 0.16); background: linear-gradient(180deg, rgba(222, 236, 245, 0.035), transparent); }
html[data-theme="dark"] .timeline-card,
html[data-theme="dark"] .task-row,
html[data-theme="dark"] .week-task,
html[data-theme="dark"] .recent-item {
  border-color: var(--line);
  background: #172a39;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

@supports (background: color-mix(in srgb, #000, #fff)) {
  html[data-theme="dark"] .timeline-card,
  html[data-theme="dark"] .task-row,
  html[data-theme="dark"] .week-task,
  html[data-theme="dark"] .recent-item {
    background: linear-gradient(145deg,
      color-mix(in srgb, var(--task-color, var(--sky)) 9%, var(--panel)),
      color-mix(in srgb, var(--task-color, var(--sky)) 4%, var(--paper)));
    border-color: color-mix(in srgb, var(--task-color, var(--sky)) 29%, var(--line));
  }
}

html[data-theme="dark"] .timeline-card,
html[data-theme="dark"] .task-row,
html[data-theme="dark"] .week-task { border-left-color: var(--task-color, var(--sky)); }
html[data-theme="dark"] .timeline-card:hover,
html[data-theme="dark"] .task-row:hover,
html[data-theme="dark"] .week-task:hover,
html[data-theme="dark"] .recent-item:hover { box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24); }
html[data-theme="dark"] .timeline-card.is-complete { background: rgba(21, 37, 51, 0.74); }
html[data-theme="dark"] .timeline-card.is-complete strong,
html[data-theme="dark"] .task-row.is-complete .task-name { color: var(--ink-faint); }
html[data-theme="dark"] .task-check { border-color: var(--line-strong); background: #10202c; color: #ffffff; }
html[data-theme="dark"] .color-picker { border-color: var(--line); background: rgba(16, 32, 44, 0.82); color: var(--ink); box-shadow: inset 0 1px 0 rgba(222, 236, 245, 0.035); }
html[data-theme="dark"] .custom-color-label { border-color: var(--line); background: rgba(101, 189, 232, 0.08); color: var(--ink-soft); }
html[data-theme="dark"] .custom-color-label:hover { border-color: var(--sky); background: rgba(101, 189, 232, 0.14); color: var(--ink); }
html[data-theme="dark"] .color-picker-preview { border-color: var(--panel); box-shadow: 0 0 0 1px var(--line-strong); }
html[data-theme="dark"] .week-column { border-color: var(--line); background: rgba(19, 36, 50, 0.72); }
html[data-theme="dark"] .week-column.is-selected { border-color: rgba(101, 189, 232, 0.56); background: rgba(24, 45, 60, 0.94); }
html[data-theme="dark"] .week-column.is-today .week-column-head { background: rgba(101, 189, 232, 0.08); }
html[data-theme="dark"] .detail-backdrop { background: rgba(3, 9, 15, 0.76); }
html[data-theme="dark"] .detail-panel { border-color: var(--line); background: linear-gradient(155deg, #162a39, #122330); }
html[data-theme="dark"] .detail-notes { background: rgba(101, 189, 232, 0.075); }
html[data-theme="dark"] .detail-section-heading span { border-color: var(--line); background: #192e3d; color: var(--ink-soft); }
html[data-theme="dark"] .progress-track { background: rgba(101, 189, 232, 0.14); }

html[data-theme="dark"] .task-dialog,
html[data-theme="dark"] .account-dialog,
html[data-theme="dark"] .solar-dialog,
html[data-theme="dark"] .desktop-settings-dialog,
html[data-theme="dark"] dialog#theme-dialog.theme-dialog {
  border-color: var(--line);
  background: linear-gradient(145deg, #162a39, #122330);
  color: var(--ink);
  color-scheme: dark;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .task-dialog::backdrop,
html[data-theme="dark"] .account-dialog::backdrop,
html[data-theme="dark"] .solar-dialog::backdrop,
html[data-theme="dark"] .desktop-settings-dialog::backdrop,
html[data-theme="dark"] .theme-dialog::backdrop { background: rgba(2, 8, 13, 0.68); }
html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field textarea,
html[data-theme="dark"] .form-repeat select,
html[data-theme="dark"] .solar-field select,
html[data-theme="dark"] .solar-field input { border-color: var(--line-strong); background: #10212e; color: var(--ink); color-scheme: dark; }
html[data-theme="dark"] .form-field input:focus,
html[data-theme="dark"] .form-field textarea:focus,
html[data-theme="dark"] .solar-field select:focus,
html[data-theme="dark"] .solar-field input:focus { border-color: var(--sky); background: #132838; }
html[data-theme="dark"] .weekday-options span { border-color: var(--line); background: #162a39; color: var(--ink-soft); }
html[data-theme="dark"] .weekday-options input:checked + span { border-color: var(--sky); background: #347d9d; color: #f2fbff; }
html[data-theme="dark"] .task-dialog::backdrop { backdrop-filter: blur(5px); }

html[data-theme="dark"] #theme-button { border-color: var(--line-strong); background: #192e3d; color: var(--sky); box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22); }
html[data-theme="dark"] #theme-button:hover { border-color: var(--sky); background: rgba(101, 189, 232, 0.15); color: #9bdef7; }
html[data-theme="dark"] .theme-dialog > header p,
html[data-theme="dark"] .theme-status { color: var(--ink-faint); }
html[data-theme="dark"] .theme-options button { border-color: var(--line); background: #10212e; color: var(--ink-soft); }
html[data-theme="dark"] .theme-options button:hover { border-color: var(--line-strong); background: #1a3040; color: var(--ink); }
html[data-theme="dark"] .theme-options button[aria-pressed="true"] { border-color: var(--sky); background: rgba(101, 189, 232, 0.15); color: #a4e2f7; box-shadow: inset 0 0 0 1px rgba(101, 189, 232, 0.16); }

html[data-theme="dark"] .account-head { border-bottom-color: rgba(129, 152, 172, 0.18); }
html[data-theme="dark"] .account-close-button { border-color: var(--line); background: #1a3040; color: var(--ink-soft); }
html[data-theme="dark"] .account-close-button:hover { border-color: var(--sky); background: #20394b; color: var(--sky); }
html[data-theme="dark"] .account-modes { border-color: var(--line); background: #10212e; }
html[data-theme="dark"] .account-modes::before { border-color: rgba(101, 189, 232, 0.3); background: #20394b; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
html[data-theme="dark"] .account-modes button[aria-pressed="true"] { color: #a4e2f7; }
html[data-theme="dark"] #account-form .field-label { color: #b8ccd8; }
html[data-theme="dark"] #account-form .form-field input { border-color: var(--line); background: #10212e; color: var(--ink); }
html[data-theme="dark"] #account-form .form-field input:focus { border-color: var(--sky); background: #132838; }
html[data-theme="dark"] #account-form .form-field input:-webkit-autofill,
html[data-theme="dark"] #account-form .form-field input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px #10212e inset; -webkit-text-fill-color: var(--ink); }
html[data-theme="dark"] #account-form .form-field.is-invalid input,
html[data-theme="dark"] #account-form .form-field input[aria-invalid="true"] { border-color: #ca7584; background: rgba(122, 47, 62, 0.25); }
html[data-theme="dark"] #account-form .field-error { color: #f09ba8; }
html[data-theme="dark"] .account-checkmark { border-color: var(--line-strong); background: #10212e; }
html[data-theme="dark"] .account-profile-mark { border-color: var(--line); background: linear-gradient(145deg, #1b3547, #152938); }
html[data-theme="dark"] #account-logout { border-color: var(--line-strong); background: #172c3b; color: var(--ink-soft); }
html[data-theme="dark"] #account-logout:hover { border-color: var(--sky); background: #1b3547; }

html[data-theme="dark"] .solar-dialog { background: #142534; }
html[data-theme="dark"] .solar-dialog-actions button,
html[data-theme="dark"] .solar-field select,
html[data-theme="dark"] .solar-field input { border-color: var(--line-strong); background: #10212e; color: var(--ink); }
html[data-theme="dark"] .solar-dialog-actions button[type="submit"] { border-color: #3485a7; background: #286b87; color: #f3fbff; }
html[data-theme="dark"] .solar-dialog-head button:hover { background: rgba(101, 189, 232, 0.13); }

html[data-theme="dark"] sky-time-picker .time-entry { border-color: var(--line-strong); background: #10212e; color: var(--ink); color-scheme: dark; }
html[data-theme="dark"] sky-time-picker .time-entry:focus { border-color: var(--sky); background: #132838; }
html[data-theme="dark"] sky-time-picker .time-popup { border-color: var(--line); background: #142534; box-shadow: 0 20px 42px rgba(0, 0, 0, 0.38); color: var(--ink); color-scheme: dark; }
html[data-theme="dark"] sky-time-picker .time-option { color: var(--ink-soft); }
html[data-theme="dark"] sky-time-picker .time-option:hover { background: rgba(101, 189, 232, 0.11); color: #a4e2f7; }
html[data-theme="dark"] sky-time-picker .time-option.is-selected { background: rgba(101, 189, 232, 0.2); color: #b8ebfb; }
html[data-theme="dark"] sky-time-picker .time-column-heading { color: var(--ink-faint); }
html[data-theme="dark"] sky-time-picker .time-colon { color: #7397ac; }
html[data-theme="dark"] sky-time-picker .time-options { scrollbar-color: #3b6075 transparent; }
html[data-theme="dark"] sky-time-picker .time-toggle { color: #8fcfe8; }
html[data-theme="dark"] sky-time-picker .time-toggle:hover { background: rgba(101, 189, 232, 0.13); color: #b4e8f8; }

html[data-theme="dark"] .date-wheel,
html[data-theme="dark"] sky-date-dial.date-wheel {
  border-color: #29485b;
  background: radial-gradient(circle at 50% 42%, rgba(101, 189, 232, 0.09), rgba(22, 42, 57, 0.2) 58%, rgba(101, 189, 232, 0.035)), #0f1e2a;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3), inset 0 0 0 6px rgba(222, 236, 245, 0.025);
}
html[data-theme="dark"] .wheel-track,
html[data-theme="dark"] sky-date-dial .wheel-track { border-color: rgba(111, 165, 191, 0.26); box-shadow: 0 0 0 1px rgba(222, 236, 245, 0.035), inset 0 0 22px rgba(101, 189, 232, 0.045); }
html[data-theme="dark"] .wheel-track::after,
html[data-theme="dark"] sky-date-dial .wheel-track::after { border-color: rgba(111, 165, 191, 0.18); }
html[data-theme="dark"] .wheel-sector,
html[data-theme="dark"] .wheel-sector:nth-of-type(even),
html[data-theme="dark"] sky-date-dial .wheel-sector,
html[data-theme="dark"] sky-date-dial .wheel-sector:nth-of-type(even) {
  background: #1a2b39;
  color: #abc0ce;
}
html[data-theme="dark"] .wheel-sector:hover,
html[data-theme="dark"] sky-date-dial .wheel-sector:hover { background: #223a4b; color: #e1f2fa; }
html[data-theme="dark"] .wheel-sector.is-selected,
html[data-theme="dark"] .wheel-sector.is-selected:hover,
html[data-theme="dark"] sky-date-dial .wheel-sector.is-selected,
html[data-theme="dark"] sky-date-dial .wheel-sector.is-selected:hover { background: linear-gradient(145deg, rgba(101, 189, 232, 0.34), rgba(67, 145, 169, 0.27)); color: #b8eafa; }
html[data-theme="dark"] .wheel-sector-label,
html[data-theme="dark"] .wheel-sector-label strong,
html[data-theme="dark"] .wheel-sector-label span { color: #afc4d1; }
html[data-theme="dark"] sky-date-dial .wheel-sector-label .wheel-sector-weekday,
html[data-theme="dark"] sky-date-dial .wheel-sector-label .wheel-sector-month,
html[data-theme="dark"] sky-date-dial .wheel-sector-label .wheel-sector-day { color: #afc4d1; }
html[data-theme="dark"] .wheel-sector.is-selected .wheel-sector-label,
html[data-theme="dark"] .wheel-sector.is-selected .wheel-sector-label strong,
html[data-theme="dark"] .wheel-sector.is-selected .wheel-sector-label span { color: #c1effb; }
html[data-theme="dark"] sky-date-dial .wheel-sector.is-selected .wheel-sector-label .wheel-sector-weekday,
html[data-theme="dark"] sky-date-dial .wheel-sector.is-selected .wheel-sector-label .wheel-sector-month,
html[data-theme="dark"] sky-date-dial .wheel-sector.is-selected .wheel-sector-label .wheel-sector-day { color: #c1effb; }
html[data-theme="dark"] .wheel-center,
html[data-theme="dark"] sky-date-dial .wheel-center { border-color: rgba(129, 177, 198, 0.28); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.28), 0 0 0 5px rgba(101, 189, 232, 0.09); }
html[data-theme="dark"] .wheel-center::before,
html[data-theme="dark"] sky-date-dial .wheel-center::before { background: #142534; }
html[data-theme="dark"] .wheel-center h1,
html[data-theme="dark"] sky-date-dial .wheel-center h1 { color: var(--ink); }
html[data-theme="dark"] .wheel-center .date-subheading,
html[data-theme="dark"] sky-date-dial .wheel-center .date-subheading { color: var(--ink-faint); }
html[data-theme="dark"] .wheel-mode,
html[data-theme="dark"] sky-date-dial .wheel-mode { color: #8bd6ef; }
html[data-theme="dark"] sky-solar-strip.solar-status { color: var(--ink-faint); }
html[data-theme="dark"] sky-solar-strip .solar-time strong { color: #bfd5e0; }
html[data-theme="dark"] sky-solar-strip .solar-time-divider { background: #355366; }
html[data-theme="dark"] sky-solar-strip .solar-place,
html[data-theme="dark"] .solar-place { border-color: var(--line-strong); background: #192e3d; color: #9bd9ee; }
html[data-theme="dark"] sky-solar-strip .solar-place:hover,
html[data-theme="dark"] .solar-place:hover { border-color: var(--sky); background: #20394b; }
html[data-theme="dark"] .wheel-time-detail,
html[data-theme="dark"] sky-day-panel.wheel-time-detail { border-color: var(--line); background: #142534; color: var(--ink-soft); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); }
html[data-theme="dark"] sky-day-panel .wheel-time-detail-head { border-bottom-color: var(--line); }
html[data-theme="dark"] sky-day-panel .wheel-time-detail-head strong,
html[data-theme="dark"] sky-day-panel .wheel-time-detail-row :is(strong, span:last-child) { color: var(--ink); }
html[data-theme="dark"] sky-day-panel .wheel-time-detail-head [data-wheel-detail-close] { color: var(--ink-faint); }
html[data-theme="dark"] sky-day-panel .wheel-time-detail-head [data-wheel-detail-close]:hover { background: #1b3445; color: var(--ink); }
html[data-theme="dark"] sky-day-panel .wheel-date-strip { border-bottom-color: var(--line); }
html[data-theme="dark"] sky-day-panel .wheel-date-chip { color: var(--ink-faint); }
html[data-theme="dark"] sky-day-panel .wheel-date-chip:hover { background: rgba(101, 189, 232, 0.1); color: var(--ink); }
html[data-theme="dark"] sky-day-panel .wheel-date-day { color: var(--ink-soft); }
html[data-theme="dark"] sky-day-panel .wheel-time-detail-row + .wheel-time-detail-row { border-top-color: var(--line); }
html[data-theme="dark"] sky-day-panel .wheel-time-detail-row:hover { background: rgba(101, 189, 232, 0.075); }
html[data-theme="dark"] sky-day-panel .wheel-time-detail-row time,
html[data-theme="dark"] sky-day-panel .wheel-time-detail-empty { color: var(--ink-faint); }

html[data-theme="dark"] .recent-item { border-color: var(--line); }
html[data-theme="dark"] .recent-open-all:hover,
html[data-theme="dark"] .recent-open-all:focus-visible { background: rgba(101, 189, 232, 0.08); }
html[data-theme="dark"] .mobile-pages { border-color: var(--line-strong); background: rgba(17, 33, 46, 0.96); box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34), inset 0 1px rgba(222, 236, 245, 0.035); }
html[data-theme="dark"] .mobile-pages button[aria-current="page"],
html[data-theme="dark"] .mobile-view-switch button[aria-pressed="true"] { background: #20394b; color: #9bd9ee; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22); }
html[data-theme="dark"] .mobile-date-field input { border-color: var(--line); background: #142534; color: var(--ink); color-scheme: dark; }

html[data-theme="dark"] .desktop-settings-trigger { border-color: var(--line); background: linear-gradient(145deg, #1b3547, #142b3a); color: #a5def3; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.23); }
html[data-theme="dark"] .desktop-settings-trigger:hover { background: #20394b; color: #d5f2fc; }
html[data-theme="dark"] .desktop-settings-close { border-color: var(--line); background: #1a3040; color: var(--ink-soft); }
html[data-theme="dark"] .desktop-settings-status,
html[data-theme="dark"] .desktop-settings-minutes span { color: var(--ink-faint); }
html[data-theme="dark"] .desktop-settings-options { border-color: var(--line); background: rgba(12, 26, 37, 0.62); }
html[data-theme="dark"] .desktop-settings-options legend { color: var(--ink-faint); }
html[data-theme="dark"] .desktop-settings-options label,
html[data-theme="dark"] .desktop-settings-minutes { color: var(--ink-soft); }
html[data-theme="dark"] .desktop-settings-minutes input { border-color: var(--line-strong); background: #10212e; color: var(--ink); color-scheme: dark; }
html[data-theme="dark"] .desktop-settings-actions button { border-color: var(--line); background: #192e3d; color: var(--ink-soft); }
html[data-theme="dark"] .desktop-settings-actions button:hover { background: #20394b; color: var(--ink); }
html[data-theme="dark"] .desktop-settings-actions .desktop-settings-save { border-color: #3485a7; background: #286b87; color: #f3fbff; }

html[data-theme="dark"] .widget--clock,
html[data-theme="dark"] .widget--todo {
  border-color: var(--line);
  background: linear-gradient(152deg, rgba(20, 37, 52, 0.98), rgba(14, 27, 39, 0.97));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(222, 236, 245, 0.035);
  color: var(--ink);
  color-scheme: dark;
}
html[data-theme="dark"] .widget--clock .widget-kicker,
html[data-theme="dark"] .widget--todo .widget-kicker { color: var(--ink-faint); }
html[data-theme="dark"] .widget--clock .icon-button,
html[data-theme="dark"] .widget--todo .icon-button { border-color: var(--line); background: #1a3040; color: var(--ink-soft); }
html[data-theme="dark"] .widget--clock .icon-button:hover,
html[data-theme="dark"] .widget--todo .icon-button:hover { background: #20394b; color: var(--ink); }
html[data-theme="dark"] .widget--clock .clock-dial { border-color: rgba(129, 177, 198, 0.25); background: radial-gradient(circle at 45% 38%, #1f384a 0 59%, #142534 60% 100%); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24), inset 0 0 0 5px rgba(222, 236, 245, 0.035); }
html[data-theme="dark"] .widget--clock .dial-mark::before { background: #668399; }
html[data-theme="dark"] .widget--clock .dial-mark.is-hour::before { background: #9bb8c8; }
html[data-theme="dark"] .widget--clock .dial-number { color: #bfd2dd; }
html[data-theme="dark"] .widget--clock .dial-pin { border-color: #142534; background: #deecf5; }
html[data-theme="dark"] .widget--clock .digital-time { color: var(--ink); }
html[data-theme="dark"] .widget--clock .clock-task { color: #b9d1de; }
html[data-theme="dark"] .widget--todo .todo-summary p { color: #c8dbe5; }
html[data-theme="dark"] .widget--todo .sync-state,
html[data-theme="dark"] .widget--todo .task-meta,
html[data-theme="dark"] .widget--todo .task-progress,
html[data-theme="dark"] .widget--todo .empty-state { color: var(--ink-faint); }
html[data-theme="dark"] .widget--todo .task-row { border-color: var(--line); background: rgba(25, 46, 61, 0.8); }
html[data-theme="dark"] .widget--todo .task-open { color: var(--ink); }
html[data-theme="dark"] .widget--todo .task-row.is-complete .task-title { color: var(--ink-faint); }

@media (max-width: 760px) {
  #theme-button { width: 34px; height: 34px; border-radius: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  #theme-button,
  .theme-options button,
  .panel,
  .detail-panel,
  .recent-panel,
  .timeline-card,
  .task-row,
  .week-task,
  .recent-item { transition: none; }
  .theme-dialog[open] { animation: none; }
}
