:root {
  color-scheme: dark;
  --bg: #070a11;
  --bg-raised: #0b101a;
  --surface: rgba(17, 24, 37, 0.74);
  --surface-strong: rgba(25, 34, 51, 0.86);
  --surface-soft: rgba(42, 55, 78, 0.48);
  --ink: #eff4ff;
  --ink-soft: #b5c0d3;
  --muted: #7d8ba3;
  --line: rgba(184, 207, 240, 0.15);
  --line-strong: rgba(190, 218, 255, 0.26);
  --accent: #7ce7d2;
  --accent-strong: #b1fff0;
  --accent-soft: rgba(86, 222, 194, 0.13);
  --iris: #a9b1ff;
  --iris-soft: rgba(137, 148, 255, 0.14);
  --warm: #ffc486;
  --warm-soft: rgba(255, 181, 108, 0.14);
  --blue: #9bc7ff;
  --blue-soft: rgba(115, 178, 255, 0.14);
  --danger: #ff9fac;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  --shadow-small: 0 12px 34px rgba(0, 0, 0, 0.23);
  --radius: 22px;
  --radius-small: 14px;
  --font-size: 16px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f8;
  --bg-raised: #f7faff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(221, 231, 244, 0.66);
  --ink: #172337;
  --ink-soft: #4e5c72;
  --muted: #748299;
  --line: rgba(54, 78, 111, 0.14);
  --line-strong: rgba(54, 78, 111, 0.24);
  --accent: #087d76;
  --accent-strong: #075c59;
  --accent-soft: rgba(19, 145, 135, 0.12);
  --iris: #5864c5;
  --iris-soft: rgba(94, 105, 205, 0.12);
  --warm: #a85b18;
  --warm-soft: rgba(196, 119, 37, 0.13);
  --blue: #316aaf;
  --blue-soft: rgba(58, 123, 202, 0.12);
  --danger: #b03d53;
  --shadow: 0 24px 60px rgba(46, 66, 95, 0.14);
  --shadow-small: 0 10px 26px rgba(46, 66, 95, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  font-size: var(--font-size);
  scroll-behavior: smooth;
}

html[data-text-size="large"] {
  --font-size: 17px;
}

html[data-text-size="xl"] {
  --font-size: 18px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% -10%, rgba(131, 141, 255, 0.23), transparent 28rem),
    radial-gradient(circle at 4% 24%, rgba(77, 218, 194, 0.1), transparent 25rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--font-size);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  top: -18rem;
  right: -13rem;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(178, 196, 255, 0.17), rgba(109, 132, 255, 0.05) 32%, transparent 67%);
  filter: blur(10px);
  content: "";
  pointer-events: none;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
summary {
  cursor: pointer;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  padding-bottom: 104px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, 900px);
  height: 76px;
  margin: 0 auto;
}

.brand-lockup,
.topbar-actions,
.page-intro,
.section-heading,
.reading-card-top,
.calendar-toolbar,
.preview-block-title,
.modal-header,
.settings-actions,
.dataset-card,
.day-actions,
.accessibility-row,
.switch-row,
.calendar-legend,
.calendar-callout,
.today-summary {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 11px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--accent-strong);
  border: 1px solid rgba(166, 255, 237, 0.28);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(119, 231, 211, 0.2), rgba(124, 139, 255, 0.16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 8px 24px rgba(74, 214, 203, 0.12);
  backdrop-filter: blur(16px);
}

.brand-name {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.topbar-actions {
  gap: 8px;
}

.main-content {
  width: min(100% - 32px, 900px);
  margin: 0 auto;
  padding: 28px 0 38px;
}

.page-intro {
  justify-content: space-between;
  gap: 20px;
  margin: 8px 0 26px;
}

.compact-intro {
  margin-bottom: 22px;
}

.eyebrow,
.metric-label,
.field-label,
.field > span,
.reading-meta,
.calendar-legend,
.mini-date small,
.mini-summary small,
.preview-metrics span,
.example-day > span:last-child,
.test-line,
.switch-row small,
.dataset-card span,
.summary-time,
.subtle-status,
.track-complete-copy,
.move-note,
.unit-note,
.stream-progress-row > div:first-child span {
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.02em;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 760;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.045em;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.05rem);
  font-weight: 760;
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 710;
  line-height: 1.1;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 690;
  line-height: 1.25;
}

p {
  color: var(--ink-soft);
}

.muted {
  color: var(--muted);
}

.muted-separator {
  color: var(--muted);
  padding: 0 2px;
}

.progress-pill,
.button,
.icon-button,
.circle-button,
.check-toggle,
.bottom-nav,
.reading-card,
.metric-card,
.mini-day,
.calendar-card,
.calendar-callout,
.settings-section,
.dataset-card,
.progress-hero,
.stream-progress-list,
.empty-card,
.notice,
.preview-modal {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.01)), var(--surface);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(22px) saturate(125%);
}

.reading-card,
.metric-card,
.mini-day,
.calendar-card,
.calendar-callout,
.settings-section,
.dataset-card,
.progress-hero,
.stream-progress-list,
.empty-card,
.notice,
.preview-modal {
  position: relative;
  overflow: hidden;
}

.reading-card::before,
.metric-card::before,
.settings-section::before,
.progress-hero::before,
.preview-modal::before {
  position: absolute;
  top: -48px;
  left: 9%;
  width: 52%;
  height: 90px;
  border-radius: 50%;
  background: rgba(172, 200, 255, 0.12);
  filter: blur(24px);
  content: "";
  pointer-events: none;
}

.button,
.icon-button,
.circle-button,
.check-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 13px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button {
  min-height: 40px;
  padding: 9px 14px;
  border-color: var(--line-strong);
  font-size: 0.82rem;
  font-weight: 680;
}

.button:hover,
.icon-button:hover,
.circle-button:hover,
.check-toggle:hover,
.mini-day:hover {
  color: var(--ink);
  border-color: rgba(168, 235, 227, 0.42);
  background-color: var(--surface-strong);
  transform: translateY(-1px);
}

.button-primary {
  color: #07151a;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-strong), #99b5ff);
  box-shadow: 0 10px 26px rgba(95, 205, 194, 0.17);
}

.button-primary:hover {
  color: #07151a;
  border-color: transparent;
  background: linear-gradient(135deg, #c0fff2, #adbbff);
  box-shadow: 0 13px 32px rgba(95, 205, 194, 0.24);
}

.button-quiet {
  background: rgba(255, 255, 255, 0.035);
}

.button-small {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 11px;
  font-size: 0.75rem;
}

.button-large {
  min-height: 46px;
  padding: 11px 18px;
}

.icon-button,
.circle-button {
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.045);
}

.circle-button {
  border-radius: 50%;
}

.icon {
  flex: 0 0 auto;
}

.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  white-space: nowrap;
}

.progress-dot,
.section-bullet,
.legend-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 15px rgba(124, 231, 210, 0.48);
}

.day-switcher {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 4px;
}

.day-title {
  min-width: 0;
  text-align: center;
}

.day-title strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-summary {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(255, 255, 255, 0.035);
}

.today-summary strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
}

.summary-time {
  color: var(--accent-strong);
  font-weight: 700;
  white-space: nowrap;
}

.stacked-cards,
.schedule-list,
.settings-form,
.warning-list,
.example-days,
.stream-progress-list {
  display: grid;
  gap: 12px;
}

.reading-card {
  padding: 18px;
  border-radius: var(--radius);
}

.reading-card.is-complete {
  border-color: rgba(124, 231, 210, 0.34);
  background: linear-gradient(145deg, rgba(124, 231, 210, 0.1), rgba(255, 255, 255, 0.02)), var(--surface);
}

.reading-card.track-complete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
}

.reading-card-top {
  justify-content: space-between;
  gap: 12px;
}

.section-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-kicker .muted {
  box-shadow: none;
  opacity: 0.45;
}

.check-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  color: transparent;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
}

.check-toggle.checked {
  color: #07151a;
  border-color: transparent;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 5px 18px rgba(124, 231, 210, 0.22);
}

.check-toggle.partial {
  color: var(--warm);
  border-color: rgba(255, 196, 134, 0.46);
  background: var(--warm-soft);
}

.reading-reference {
  margin: 17px 0 10px;
  color: var(--ink);
  font-size: clamp(1.22rem, 4vw, 1.72rem);
  font-weight: 720;
  letter-spacing: -0.05em;
}

.reading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.reading-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.reading-meta .icon {
  color: var(--accent);
}

.unit-note,
.move-note {
  margin-top: 12px;
  line-height: 1.35;
}

.move-note {
  color: var(--warm);
}

.reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.more-ranges {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.more-ranges summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  list-style: none;
}

.more-ranges summary::-webkit-details-marker {
  display: none;
}

.range-list {
  display: grid;
  gap: 8px;
  padding: 12px 0 2px;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.range-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.range-row a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.review-tag {
  padding: 3px 7px;
  color: var(--iris);
  border: 1px solid rgba(169, 177, 255, 0.25);
  border-radius: 999px;
  background: var(--iris-soft);
  font-size: 0.61rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.day-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.day-tools {
  position: relative;
}

.day-tools summary {
  list-style: none;
}

.day-tools summary::-webkit-details-marker {
  display: none;
}

.move-menu {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.move-menu button {
  padding: 9px 10px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  font-size: 0.75rem;
}

.move-menu button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: var(--radius-small);
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.notice strong {
  color: var(--ink);
  margin-right: auto;
}

.notice-warm {
  border-color: rgba(255, 196, 134, 0.28);
  background: linear-gradient(145deg, var(--warm-soft), rgba(255, 255, 255, 0.02)), var(--surface);
}

.notice-soft {
  border-color: rgba(155, 199, 255, 0.28);
  background: linear-gradient(145deg, var(--blue-soft), rgba(255, 255, 255, 0.02)), var(--surface);
}

.notice-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--warm);
  border-radius: 10px;
  background: var(--warm-soft);
}

.empty-card {
  padding: 42px 20px;
  border-radius: var(--radius);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 16px;
  color: var(--accent);
  border: 1px solid rgba(124, 231, 210, 0.24);
  border-radius: 16px;
  background: var(--accent-soft);
}

.empty-card h3 {
  margin-bottom: 5px;
}

.empty-card p {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 14px;
}

.subtle-status {
  color: var(--accent-strong);
  font-weight: 720;
}

.metric-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 30px;
}

.metric-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  min-height: 104px;
  padding: 15px;
  border-radius: var(--radius-small);
}

.metric-card strong,
.metric-card > span:last-child {
  display: block;
}

.metric-card strong {
  margin: 8px 0 1px;
  color: var(--ink);
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 730;
  letter-spacing: -0.06em;
}

.metric-card > span:last-child {
  color: var(--muted);
  font-size: 0.7rem;
}

.mini-day {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 24px;
  gap: 13px;
  align-items: center;
  width: 100%;
  padding: 13px 14px;
  color: var(--ink);
  border-radius: var(--radius-small);
  text-align: left;
}

.mini-day.complete {
  border-color: rgba(124, 231, 210, 0.26);
}

.mini-date strong,
.mini-date small,
.mini-summary strong,
.mini-summary small {
  display: block;
}

.mini-date strong {
  color: var(--ink);
  font-size: 0.83rem;
}

.mini-date small {
  margin-top: 2px;
}

.mini-summary {
  min-width: 0;
}

.mini-summary strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-summary small {
  margin-top: 3px;
}

.mini-status {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.mini-day.complete .mini-status {
  color: var(--accent);
}

.calendar-card {
  padding: 18px;
  border-radius: var(--radius);
}

.calendar-toolbar {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.calendar-toolbar strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
}

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

.weekday-row {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.calendar-cell {
  position: relative;
  min-height: 50px;
  padding: 8px 3px;
  color: var(--ink-soft);
  border: 1px solid transparent;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.78rem;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.calendar-cell:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.calendar-cell.blank {
  pointer-events: none;
  opacity: 0;
}

.calendar-cell.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.calendar-cell.complete {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.calendar-cell.partial {
  color: var(--warm);
  background: var(--warm-soft);
}

.calendar-cell.open {
  color: var(--blue);
}

.calendar-cell i {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.calendar-legend {
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 18px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
}

.legend-dot {
  width: 7px;
  height: 7px;
  box-shadow: none;
}

.legend-dot.partial {
  background: var(--warm);
}

.legend-dot.open {
  background: var(--blue);
}

.calendar-callout {
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-small);
}

.callout-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--iris);
  border-radius: 12px;
  background: var(--iris-soft);
}

.calendar-callout strong,
.calendar-callout span {
  display: block;
}

.calendar-callout strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.calendar-callout span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.progress-hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 14px;
  padding: 22px;
  border-radius: var(--radius);
}

.progress-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress), rgba(255, 255, 255, 0.08) 0deg);
  box-shadow: 0 0 34px rgba(105, 220, 204, 0.13);
}

.progress-ring::after {
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  background: var(--bg-raised);
  content: "";
}

.progress-ring > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.progress-ring strong,
.progress-ring span {
  display: block;
}

.progress-ring strong {
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 760;
  letter-spacing: -0.06em;
}

.progress-ring span {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.progress-hero-copy {
  min-width: 0;
}

.progress-hero-copy h2 {
  margin-bottom: 7px;
}

.progress-hero-copy p {
  margin-bottom: 16px;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.stream-progress-list {
  padding: 17px;
  border-radius: var(--radius);
}

.stream-progress-row {
  display: grid;
  gap: 8px;
}

.stream-progress-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.stream-progress-row > div:first-child strong {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.bar {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--iris));
  box-shadow: 0 0 14px rgba(124, 231, 210, 0.28);
}

.settings-view .page-intro {
  margin-bottom: 24px;
}

.settings-section {
  padding: 19px;
  border-radius: var(--radius);
}

.settings-section .section-heading {
  margin: 0 0 16px;
}

.form-grid,
.track-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.field-wide {
  grid-column: 1 / -1;
}

.field > span,
.field-label {
  font-weight: 680;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 255, 255, 0.045);
}

.field input::placeholder {
  color: var(--muted);
}

.field input:hover,
.field select:hover {
  border-color: rgba(168, 235, 227, 0.4);
}

.weekday-picker {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.weekday-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.weekday-option {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 38px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.weekday-option:has(input:checked) {
  color: var(--accent-strong);
  border-color: rgba(124, 231, 210, 0.42);
  background: var(--accent-soft);
}

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

.choice-grid {
  display: grid;
  gap: 9px;
}

.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 13px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.choice-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.choice-card.selected {
  border-color: rgba(124, 231, 210, 0.4);
  background: var(--accent-soft);
}

.choice-card input {
  position: absolute;
  opacity: 0;
}

.choice-card-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.choice-card-copy strong {
  color: var(--ink);
  font-size: 0.81rem;
  font-weight: 680;
}

.choice-card-copy small {
  color: var(--muted);
  font-size: 0.7rem;
}

.radio-indicator {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.choice-card.selected .radio-indicator {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--surface-strong);
  background: var(--accent);
}

.accessibility-row {
  justify-content: space-between;
  gap: 16px;
}

.switch-row {
  gap: 11px;
  min-width: 0;
}

.switch-row > span {
  display: grid;
  gap: 2px;
}

.switch-row strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch {
  position: relative;
  order: -1;
  width: 42px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 160ms ease, border-color 160ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.switch-row input:checked + .switch {
  border-color: rgba(124, 231, 210, 0.45);
  background: var(--accent-soft);
}

.switch-row input:checked + .switch::after {
  background: var(--accent);
  transform: translateX(18px);
}

.compact-field {
  width: min(190px, 45%);
}

.settings-actions {
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 2px;
}

.dataset-card {
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-small);
}

.dataset-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
}

.dataset-card > div:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin-right: auto;
}

.dataset-card strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: 16px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 16px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 7px;
  border-radius: 20px;
  background: rgba(12, 17, 27, 0.82);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(24px) saturate(150%);
}

:root[data-theme="light"] .bottom-nav {
  background: rgba(247, 250, 255, 0.84);
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 53px;
  padding: 5px 2px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  font-size: 0.62rem;
  font-weight: 680;
}

.nav-item:hover {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: var(--accent-strong);
  border-color: rgba(124, 231, 210, 0.19);
  background: var(--accent-soft);
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 4, 8, 0.72);
  backdrop-filter: blur(10px);
}

.preview-modal {
  width: min(100%, 640px);
  max-height: min(820px, calc(100svh - 36px));
  overflow: auto;
  padding: 20px;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.modal-header {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.modal-header h2 {
  margin-bottom: 5px;
}

.modal-header p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 15px;
}

.preview-metrics > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.03);
}

.preview-metrics strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-block {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.preview-block-title {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.preview-block-title strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.preview-block-title > span {
  color: var(--muted);
  font-size: 0.7rem;
}

.example-day {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.example-day strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-day .eyebrow {
  margin: 0;
}

.example-day > span:last-child {
  white-space: nowrap;
}

.test-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.test-status.pass {
  color: var(--accent-strong);
}

.test-status.fail {
  color: var(--danger);
}

.test-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.test-line code {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: 92px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: auto;
  padding: 11px 14px;
  color: var(--ink);
  border: 1px solid rgba(124, 231, 210, 0.35);
  border-radius: 13px;
  background: rgba(19, 39, 43, 0.94);
  box-shadow: var(--shadow-small);
  font-size: 0.78rem;
  backdrop-filter: blur(18px);
}

.toast .icon {
  color: var(--accent);
}

@media (min-width: 620px) {
  .stacked-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reading-card.track-complete {
    grid-column: 1 / -1;
  }

  .toast {
    bottom: 96px;
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding-bottom: 126px;
  }

  .topbar {
    height: 86px;
  }

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

  .bottom-nav {
    right: auto;
    left: 50%;
    width: min(calc(100% - 32px), 520px);
    transform: translateX(-50%);
  }

  .toast {
    right: 22px;
    left: auto;
    margin: 0;
  }
}

@media (max-width: 520px) {
  .page-intro:not(.compact-intro) {
    align-items: flex-start;
  }

  .page-intro > .button {
    margin-top: 4px;
  }

  .metric-grid.three {
    gap: 7px;
  }

  .metric-card {
    padding: 12px 10px;
  }

  .metric-card strong {
    font-size: 1.35rem;
  }

  .progress-hero {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 15px;
    padding: 16px;
  }

  .progress-ring {
    width: 92px;
    height: 92px;
  }

  .progress-ring::after {
    inset: 7px;
  }

  .progress-ring strong {
    font-size: 1.05rem;
  }

  .progress-hero-copy h2 {
    font-size: 1.05rem;
  }

  .progress-hero-copy p {
    margin-bottom: 11px;
    font-size: 0.72rem;
  }

  .form-grid,
  .track-mode-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .accessibility-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .compact-field {
    width: 100%;
  }

  .preview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .example-day {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .example-day > span:last-child {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
