:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --bg-elevated: rgba(255, 255, 255, .78);
  --bg-solid: #fff;
  --bg-muted: rgba(118, 118, 128, .11);
  --glass-border: rgba(255, 255, 255, .72);
  --separator: rgba(60, 60, 67, .16);
  --label: #1c1c1e;
  --secondary: #6e6e73;
  --tertiary: #8e8e93;
  --blue: #2477f3;
  --blue-pressed: #0b63d9;
  --green: #2da35f;
  --yellow: #9a7300;
  --orange: #e86f19;
  --red: #d93036;
  --purple: #8e5ad7;
  --pink: #d95d7b;
  --shadow: 0 14px 40px rgba(36, 38, 45, .1);
  --small-shadow: 0 6px 20px rgba(36, 38, 45, .08);
  --radius-xl: 25px;
  --radius-lg: 20px;
  --radius-md: 15px;
  --tap: 46px;
  --page-gutter: 16px;
  --tab-height: 76px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --bg-elevated: rgba(30, 30, 32, .82);
    --bg-solid: #1c1c1e;
    --bg-muted: rgba(118, 118, 128, .2);
    --glass-border: rgba(255, 255, 255, .1);
    --separator: rgba(84, 84, 88, .6);
    --label: #f5f5f7;
    --secondary: #aeaeb2;
    --tertiary: #8e8e93;
    --blue: #4b93ff;
    --blue-pressed: #6ca7ff;
    --green: #43c477;
    --yellow: #e1b83f;
    --orange: #ff8c38;
    --red: #ff575d;
    --purple: #b286ed;
    --pink: #ed7895;
    --shadow: 0 18px 50px rgba(0, 0, 0, .42);
    --small-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

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

button {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent);
  outline-offset: 2px;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.app-shell {
  min-height: 100svh;
  max-width: 760px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
}

.top-bar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: calc(80px + env(safe-area-inset-top));
  margin-top: calc(env(safe-area-inset-top) * -1);
  padding: calc(19px + env(safe-area-inset-top)) var(--page-gutter) 12px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: saturate(170%) blur(22px);
  backdrop-filter: saturate(170%) blur(22px);
}

.top-bar.scrolled {
  border-color: var(--separator);
}

.top-bar h1 {
  margin: 1px 0 0;
  font-size: clamp(28px, 7.8vw, 34px);
  line-height: 1.03;
  letter-spacing: -.8px;
}

.eyebrow {
  margin: 0;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.avatar-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 17px;
  font-weight: 720;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), var(--small-shadow);
}

.member-1 { background-color: #2477f3; }
.member-2 { background-color: #8e5ad7; }
.member-3 { background-color: #e06a86; }

.alert-rail {
  position: relative;
  z-index: 20;
  margin: 4px var(--page-gutter) 8px;
}

.alert-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--orange) 12%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--orange) 22%, var(--glass-border));
  border-radius: 17px;
  color: var(--orange);
  box-shadow: var(--small-shadow);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.alert-card > svg {
  flex: 0 0 auto;
}

.alert-copy {
  min-width: 0;
  flex: 1;
}

.alert-copy strong,
.alert-copy span {
  display: block;
}

.alert-copy strong {
  margin-bottom: 2px;
  font-size: 14px;
}

.alert-copy span {
  color: var(--label);
  font-size: 13px;
  line-height: 1.25;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--bg-muted);
  color: var(--blue);
}

.icon-button.small {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.icon-button.small svg {
  width: 18px;
  height: 18px;
}

.main-content {
  min-height: calc(100svh - 80px);
  padding: 3px var(--page-gutter) calc(var(--tab-height) + env(safe-area-inset-bottom) + 32px);
}

.tab-panel[hidden] {
  display: none;
}

.content-stack {
  display: grid;
  gap: 16px;
}

.glass-panel,
.card,
.section-card {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  box-shadow: var(--small-shadow);
  -webkit-backdrop-filter: saturate(145%) blur(24px);
  backdrop-filter: saturate(145%) blur(24px);
}

.card,
.section-card {
  border-radius: var(--radius-lg);
}

.hero-card {
  position: relative;
  min-height: 185px;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius-xl);
}

.hero-card::after {
  position: absolute;
  right: -18px;
  bottom: -25px;
  width: 120px;
  height: 120px;
  border: 18px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: .045;
}

.hero-card.state-normal { color: var(--blue); }
.hero-card.state-attention { color: var(--yellow); }
.hero-card.state-urgent { color: var(--orange); }
.hero-card.state-critical { color: var(--red); }

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

.hero-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: color-mix(in srgb, currentColor 13%, transparent);
}

.hero-icon svg {
  width: 26px;
  height: 26px;
}

.hero-kicker {
  margin: 0 0 4px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
}

.hero-time {
  margin: 15px 0 3px;
  color: var(--label);
  font-size: clamp(35px, 10.5vw, 48px);
  font-variant-numeric: tabular-nums;
  font-weight: 730;
  letter-spacing: -1.6px;
  line-height: 1;
}

.hero-detail {
  margin: 7px 0 0;
  color: var(--secondary);
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  color: currentColor;
  font-size: 12px;
  font-weight: 680;
}

.section-block {
  display: grid;
  gap: 9px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.section-heading h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.25px;
}

.section-heading .count {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 560;
}

.text-button {
  min-height: 38px;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 610;
}

.text-button.danger {
  color: var(--red);
}

.list-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  box-shadow: var(--small-shadow);
  -webkit-backdrop-filter: saturate(145%) blur(24px);
  backdrop-filter: saturate(145%) blur(24px);
}

.list-row {
  position: relative;
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.list-row + .list-row::before {
  position: absolute;
  top: 0;
  right: 12px;
  left: 58px;
  height: 1px;
  background: var(--separator);
  content: "";
}

button.list-row {
  width: 100%;
  text-align: left;
  border: 0;
  color: inherit;
  background: transparent;
}

button.list-row:active {
  background: var(--bg-muted);
}

.row-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: var(--bg-muted);
  color: var(--blue);
}

.row-icon svg {
  width: 19px;
  height: 19px;
}

.row-icon.cleaning { color: var(--purple); }
.row-icon.event { color: var(--pink); }
.row-icon.shopping { color: var(--green); }
.row-icon.missed { color: var(--red); }

.row-content {
  min-width: 0;
  flex: 1;
}

.row-title-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.row-title {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: var(--label);
  font-size: 15.5px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-title.purchased {
  color: var(--tertiary);
  text-decoration: line-through;
}

.row-time {
  flex: 0 0 auto;
  color: var(--secondary);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.row-subtitle {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 670;
}

.row-status.open { color: var(--secondary); }
.row-status.taken { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.row-status.done { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.row-status.missed { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }

.quick-add {
  display: flex;
  gap: 8px;
  padding: 9px;
  border-radius: var(--radius-lg);
}

.quick-add input {
  min-width: 0;
  height: var(--tap);
  flex: 1;
  padding: 0 13px;
  border: 0;
  border-radius: 13px;
  background: var(--bg-muted);
  outline: 0;
}

.quick-add input::placeholder {
  color: var(--tertiary);
}

.primary-icon {
  display: grid;
  width: var(--tap);
  height: var(--tap);
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: white;
}

.primary-icon:active,
.primary-button:active {
  background: var(--blue-pressed);
  transform: scale(.98);
}

.empty-state {
  padding: 25px 20px;
  text-align: center;
}

.empty-state .row-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 15px;
}

.empty-state strong {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
}

.empty-state p {
  max-width: 290px;
  margin: 0 auto;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.4;
}

.planning-toolbar,
.filter-bar {
  margin: 0 0 16px;
  padding: 9px;
  border-radius: var(--radius-lg);
}

.segmented {
  display: flex;
  padding: 2px;
  border-radius: 11px;
  background: var(--bg-muted);
}

.segmented button {
  min-height: 34px;
  flex: 1;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 630;
}

.segmented button.active {
  background: var(--bg-solid);
  color: var(--label);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .09);
}

.date-stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-top: 6px;
}

.date-stepper button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 620;
}

.date-stepper button:first-child,
.date-stepper button:last-child {
  display: grid;
  place-items: center;
}

.day-group {
  display: grid;
  gap: 8px;
}

.day-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 4px;
}

.day-label strong {
  font-size: 17px;
  text-transform: capitalize;
}

.day-label span {
  color: var(--secondary);
  font-size: 13px;
}

.event-stripe {
  width: 4px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 2px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.filter-bar label span {
  display: block;
  margin: 0 0 4px 4px;
  color: var(--secondary);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.filter-bar select {
  width: 100%;
  height: 38px;
  padding: 0 7px;
  border: 0;
  border-radius: 10px;
  background: var(--bg-muted);
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.stat-card {
  display: grid;
  min-width: 0;
  min-height: 70px;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 18px;
  text-align: left;
}

.stat-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 13px;
  font-weight: 720;
}

.stat-identity {
  min-width: 0;
}

.stat-identity strong,
.stat-identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-identity strong {
  font-size: 15px;
}

.stat-identity span {
  margin-top: 3px;
  color: var(--secondary);
  font-size: 11px;
}

.stat-counts {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  text-align: center;
}

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

.stat-counts b {
  display: block;
  color: var(--label);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.stats-block {
  margin-bottom: 18px;
}

.stats-segmented {
  margin-bottom: 1px;
}

.history-date {
  margin: 3px 4px -3px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 650;
  text-transform: capitalize;
}

#history-content .row-subtitle {
  overflow: visible;
  white-space: normal;
}

.settings-group {
  display: grid;
  gap: 8px;
}

.settings-group > h2 {
  margin: 3px 4px 0;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 620;
  text-transform: uppercase;
}

.settings-form {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.settings-row {
  position: relative;
  display: grid;
  min-height: 55px;
  grid-template-columns: 1fr minmax(80px, 40%);
  align-items: center;
  gap: 14px;
  padding: 7px 13px;
}

.settings-row + .settings-row::before {
  position: absolute;
  top: 0;
  right: 12px;
  left: 13px;
  height: 1px;
  background: var(--separator);
  content: "";
}

.settings-row span {
  font-size: 14px;
  font-weight: 540;
}

.settings-row input,
.settings-row select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: var(--bg-muted);
  text-align: right;
}

.settings-footer {
  padding: 9px 12px 12px;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.4;
}

.full-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  padding: 8px 13px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--label);
  box-shadow: var(--small-shadow);
  text-align: left;
}

.full-button svg {
  color: var(--blue);
}

.full-button span {
  flex: 1;
  font-weight: 570;
}

.full-button.danger,
.full-button.danger svg {
  color: var(--red);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 50px;
  padding: 10px 17px;
  border: 0;
  border-radius: 15px;
  font-weight: 660;
}

.primary-button {
  background: var(--blue);
  color: white;
}

.secondary-button {
  background: var(--bg-muted);
  color: var(--blue);
}

.danger-button {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  color: var(--red);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.button-row.single {
  grid-template-columns: 1fr;
}

.button-row.three {
  grid-template-columns: repeat(3, 1fr);
}

.tab-bar {
  position: fixed;
  z-index: 40;
  right: max(var(--page-gutter), calc((100vw - 728px) / 2));
  bottom: max(9px, env(safe-area-inset-bottom));
  left: max(var(--page-gutter), calc((100vw - 728px) / 2));
  display: grid;
  height: var(--tab-height);
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
}

.tab-bar > button {
  display: flex;
  min-width: 0;
  height: 62px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--tertiary);
}

.tab-bar > button svg {
  width: 23px;
  height: 23px;
}

.tab-bar > button span:last-child {
  overflow: hidden;
  max-width: 100%;
  font-size: 9.5px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-bar > button.active {
  color: var(--blue);
}

.tab-bar .add-tab {
  color: var(--blue);
}

.add-circle {
  display: grid;
  width: 42px;
  height: 42px;
  margin-top: -15px;
  place-items: center;
  border-radius: 15px;
  background: var(--blue);
  color: white;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--blue) 28%, transparent);
}

.add-circle svg {
  width: 24px !important;
  height: 24px !important;
  stroke-width: 2.2;
}

.modal-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
}

.modal-layer[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(0, 0, 0, .25);
  animation: fade-in .18s ease-out;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.bottom-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-width: 760px;
  max-height: min(88svh, 820px);
  margin: 0 auto;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px var(--page-gutter) calc(18px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-solid) 91%, transparent);
  border: 1px solid var(--glass-border);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -15px 50px rgba(0, 0, 0, .18);
  animation: sheet-in .25s cubic-bezier(.22, .85, .3, 1);
  -webkit-backdrop-filter: saturate(170%) blur(28px);
  backdrop-filter: saturate(170%) blur(28px);
}

.sheet-grabber {
  width: 38px;
  height: 5px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--separator);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.sheet-header h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -.45px;
}

.sheet-header .text-button {
  margin-right: -4px;
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-tile {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 13px;
  padding: 10px 13px;
  border: 0;
  border-radius: 18px;
  background: var(--bg-muted);
  text-align: left;
}

.action-tile .row-icon {
  background: var(--bg-solid);
}

.action-tile div:not(.row-icon) {
  min-width: 0;
  flex: 1;
}

.action-tile strong,
.action-tile span {
  display: block;
}

.action-tile strong {
  font-size: 15.5px;
}

.action-tile span {
  margin-top: 3px;
  color: var(--secondary);
  font-size: 12.5px;
}

.form-stack {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span,
.field legend {
  color: var(--secondary);
  font-size: 12px;
  font-weight: 620;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 49px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--bg-muted);
  outline: 0;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: color-mix(in srgb, var(--blue) 40%, transparent);
  background: color-mix(in srgb, var(--bg-muted) 70%, var(--bg-solid));
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

fieldset.field {
  padding: 0;
  border: 0;
}

.toggle-row {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--bg-muted);
}

.toggle-row span {
  font-size: 14px;
  font-weight: 550;
}

.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tertiary) 40%, transparent);
  transition: background .16s;
}

.switch i::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
  content: "";
  transition: transform .18s cubic-bezier(.25, .8, .3, 1);
}

.switch input:checked + i {
  background: var(--green);
}

.switch input:checked + i::after {
  transform: translateX(20px);
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.weekday-picker label {
  position: relative;
}

.weekday-picker input {
  position: absolute;
  opacity: 0;
}

.weekday-picker span {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 650;
}

.weekday-picker input:checked + span {
  background: var(--blue);
  color: white;
}

.form-help {
  margin: -4px 2px 0;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.4;
}

.profile-gate {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: calc(30px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom));
  background: var(--bg);
}

.profile-gate[hidden] {
  display: none;
}

.profile-card {
  width: 100%;
  max-width: 390px;
  padding: 30px 22px 22px;
  border-radius: 30px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  text-align: center;
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
}

.app-mark {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 19px;
  background: var(--blue);
  color: white;
  font-size: 30px;
  font-weight: 760;
  box-shadow: 0 10px 25px color-mix(in srgb, var(--blue) 25%, transparent);
}

.profile-card h1,
.setup-card h1 {
  margin: 5px 0 9px;
  font-size: 29px;
  letter-spacing: -.7px;
}

.profile-card > p:not(.eyebrow),
.setup-card > p:not(.eyebrow) {
  margin: 0 auto 24px;
  color: var(--secondary);
  line-height: 1.45;
}

.profile-choices {
  display: grid;
  gap: 10px;
}

.profile-choice {
  display: flex;
  min-height: 61px;
  align-items: center;
  gap: 13px;
  padding: 8px 13px;
  border: 0;
  border-radius: 18px;
  background: var(--bg-muted);
  text-align: left;
}

.profile-choice b {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: white;
}

.profile-choice span {
  flex: 1;
  font-size: 17px;
  font-weight: 620;
}

.profile-choice svg {
  color: var(--tertiary);
}

.toast {
  position: fixed;
  z-index: 300;
  right: 20px;
  bottom: calc(var(--tab-height) + env(safe-area-inset-bottom) + 20px);
  left: 20px;
  max-width: 420px;
  min-height: 48px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--label) 90%, transparent);
  color: var(--bg-solid);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 570;
  text-align: center;
  animation: toast-in .22s ease-out;
}

.toast.error {
  background: color-mix(in srgb, var(--red) 92%, #000);
  color: white;
}

.loading-cover {
  position: fixed;
  z-index: 250;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .08);
}

.loading-cover[hidden] {
  display: none;
}

.loading-cover > span:first-child {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(128, 128, 128, .25);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.skeleton {
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
  animation: pulse 1.1s ease-in-out infinite alternate;
}

.hero-skeleton { height: 185px; border-radius: var(--radius-xl); }
.card-skeleton { height: 130px; }

.setup-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.setup-card {
  width: min(100%, 420px);
  padding: 30px 24px;
  border-radius: 28px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  text-align: center;
}

.setup-card .secondary {
  margin-bottom: 0 !important;
  font-size: 13px;
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  from { opacity: .45; }
  to { opacity: .82; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 370px) {
  :root {
    --page-gutter: 12px;
  }

  .top-bar h1 {
    font-size: 28px;
  }

  .hero-card {
    min-height: 170px;
    padding: 17px;
  }

  .hero-time {
    font-size: 34px;
  }

  .tab-bar > button span:last-child {
    font-size: 8.5px;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .filter-bar label:last-child {
    grid-column: 1 / -1;
  }

  .button-row.three {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 600px) {
  :root {
    --page-gutter: 24px;
  }

  .main-content {
    padding-top: 12px;
  }

  .content-stack {
    gap: 19px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .top-bar {
    position: relative;
  }

  .bottom-sheet {
    max-height: 96svh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
