/* Paint each choice inside its own rounded border; keep the options scrollable. */
.choice-control > summary {
  border-radius: 15px;
  min-width: 0;
}
.choice-control[open] > summary { border-radius: 15px 15px 0 0; }
.choice-control > .choice-options { border-radius: 0 0 15px 15px; }
.choice-caption { flex: 1 1 auto; }
.choice-options > button {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* The old transform and the newer translate used to move the thumb twice. */
.settings-switch > input[type="checkbox"] {
  width: 44px;
  min-width: 44px;
  height: 26px;
  min-height: 26px;
  flex: 0 0 44px;
  margin: 0;
  padding: 0;
}
.settings-switch > input[type="checkbox"]::before {
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  transform: none;
  translate: 0 0;
}
.settings-switch > input[type="checkbox"]:checked::before {
  transform: none;
  translate: 18px 0;
}
.settings-switch > span { min-width: 0; flex: 1; gap: 10px; }
.settings-switch strong { min-width: 0; overflow-wrap: anywhere; }
.settings-time-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Neutral icons follow the current surface. Completion, danger and selected-state colors remain. */
.icon-tile,
.habit-icon-preview,
.icon-option > svg,
.collection-member-icon > svg,
.collection-card > svg,
.collection-heading > svg,
.collection-icon-picker > summary > span:first-child,
.agenda-icon,
.calendar-event-icon,
.stats-entry-icon,
.focus-habit > svg,
.habit-action:not(.done) > svg {
  color: var(--text);
}
.icon-btn:not(.danger):not(.active):not(.ui-icon-control),
.topbar .icon-btn:not(.ui-icon-control),
.sheet-header .icon-btn:not(.ui-icon-control),
.bottom-nav .nav-item:not(.active) > svg,
.settings-switch svg,
.settings-card:not(.reset-all-card) .settings-card-icon,
.view-menu-option > svg:first-child,
.choice-control > summary > svg,
.date-trigger > svg {
  color: var(--text);
}

/* Align the common header with the other pages, keeping the agenda readable. */
#app[data-view="calendar"] { max-width: 1120px; }
#app[data-view="calendar"] > main { max-width: 840px; margin-inline: auto; }

@media (max-width: 560px) {
  /* A list takes one complete board viewport; other lists remain a swipe away. */
  .board { grid-auto-columns: 100%; }
  #app[data-view="calendar"] {
    padding: 0 18px calc(166px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 360px) {
  #app[data-view="calendar"] { padding-inline: 14px; }
}

.habit-week-strip[data-day-strip], .calendar-week-strip[data-day-strip] {
  grid-template-columns: minmax(0, 1fr);
  touch-action: pan-y pinch-zoom;
}
[data-day-strip]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 16px; }
.task-card { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-x pan-y; }
.calendar-week-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 2px 2px 14px; }
.calendar-week-heading h2 { margin: 0; font-size: 17px; }
.calendar-week-heading > span { color: var(--muted); font-size: 13px; }
.calendar-week-day .week-plan-count { font-size: 11px; line-height: 16px; color: var(--muted); }
.calendar-week-day.selected .week-plan-count { color: inherit; }
.calendar-selected-day { margin: 16px 2px 2px; font-size: 13px; color: var(--muted); text-transform: capitalize; }
.calendar-menu-date { display: flex; align-items: flex-end; gap: 12px; margin: 20px 0; }
.calendar-menu-date .field { flex: 1; min-width: 0; margin: 0; }
.calendar-menu-date > .btn { flex: 0 0 auto; }
/* Give the symbol its own ink; palette contrast may still color its parent. */
.icon-tile > svg, .habit-icon-preview > svg { color: var(--text); }
@media (min-width: 561px) and (max-width: 899px) {
  #app[data-view="calendar"] { max-width: 720px; }
}
.calendar-selected-day { text-transform: none; }
.calendar-selected-day::first-letter { text-transform: uppercase; }
