:root {
  color-scheme: light;
  --bg: #f7f8ff;
  --surface: #ffffff;
  --ink: #07184a;
  --muted: #687193;
  --line: #dfe5f6;
  --primary: #2568f4;
  --primary-rgb: 37, 104, 244;
  --primary-strong: #071f68;
  --accent: #e815a8;
  --accent-rgb: 232, 21, 168;
  --warning: #a76c00;
  --blue: #12a9ef;
  --blue-rgb: 18, 169, 239;
  --shadow: 0 22px 60px rgba(7, 24, 74, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(var(--blue-rgb), 0.16), transparent 36%),
    linear-gradient(315deg, rgba(var(--accent-rgb), 0.13), transparent 40%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-width: 0;
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 32px 0;
}

.auth-screen {
  width: 100%;
  min-width: 0;
  min-height: min(760px, calc(100vh - 64px));
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(900px, 100%);
  min-width: 0;
  border: 1px solid rgba(223, 229, 246, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.86fr);
  overflow: hidden;
}

.auth-hero {
  position: relative;
  min-height: 520px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.88) 34%, rgba(var(--primary-rgb), 0.1)),
    linear-gradient(330deg, rgba(var(--accent-rgb), 0.18), transparent 52%);
  display: grid;
  align-content: center;
  gap: 28px;
  min-width: 0;
  padding: 46px;
}

.auth-hero::after {
  position: absolute;
  inset: auto 36px 36px 36px;
  height: 4px;
  border-radius: 999px;
  /* The mark's own gradient: blue -> teal -> green. Was blue -> purple ->
     magenta, left over from the retired logo (2026-08-24). */
  background: linear-gradient(90deg, #1366c8, #29a4af, #3ece83);
  content: "";
}

.auth-copy {
  display: grid;
  gap: 10px;
  max-width: 380px;
  min-width: 0;
}

.auth-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 4.6vw, 4.15rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.auth-copy p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.45;
}

.auth-logo {
  display: block;
  width: min(380px, 100%);
  height: auto;
  border-radius: 8px;
}

.auth-entry {
  align-self: center;
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 46px 40px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(7, 24, 74, 0.16);
  display: block;
  flex: 0 0 54px;
  object-fit: cover;
}

.brand-copy {
  min-width: 0;
}

.brand-title {
  margin: 0;
  max-width: 100%;
  font-size: clamp(2.35rem, 10vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0;
  white-space: nowrap;
}

.topbar .brand-title {
  font-size: clamp(2.1rem, 5vw, 3.35rem);
}

.screen-title {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.provider-stack,
.auth-form,
.settings-actions {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.provider-button {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  padding: 0 16px;
  box-shadow: 0 8px 22px rgba(7, 24, 74, 0.06);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.provider-button:hover {
  border-color: #b7c3e5;
  background: #fbfcff;
  box-shadow: 0 12px 28px rgba(7, 24, 74, 0.09);
  transform: translateY(-1px);
}

.provider-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

.provider-button.google svg path,
.provider-button.apple svg path {
  stroke: none;
}

.provider-button.google .google-blue {
  fill: #4285f4;
}

.provider-button.google .google-green {
  fill: #34a853;
}

.provider-button.google .google-yellow {
  fill: #fbbc05;
}

.provider-button.google .google-red {
  fill: #ea4335;
}

.provider-button.apple {
  background: #111;
  border-color: #111;
  color: #fff;
}

.provider-button.apple:hover {
  background: #2a2d2c;
  border-color: #2a2d2c;
}

.provider-button.apple svg path {
  fill: currentColor;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
  flex: 1;
}

.workspace {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 229, 246, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow-x: clip;
  padding: 28px;
}

.time-tools {
  --indicator-height: 0px;
  --indicator-width: 0px;
  --indicator-x: 0px;
  --indicator-y: 0px;
  --tool-column-count: 6;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--tool-column-count), minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid rgba(223, 229, 246, 0.92);
  border-radius: 8px;
  background: rgba(247, 248, 255, 0.9);
  padding: 6px;
}

.time-tools::before {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--indicator-width);
  height: var(--indicator-height);
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary-strong), #1366c8);
  box-shadow: 0 10px 24px rgba(7, 24, 74, 0.24);
  content: "";
  opacity: 0;
  transform: translate3d(var(--indicator-x), var(--indicator-y), 0);
  transition:
    width 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    height 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 140ms ease;
  will-change: transform, width, height;
}

.time-tools.is-ready::before {
  opacity: 1;
}

.affirmations-heading {
  margin-bottom: 24px;
}

.affirmations-heading h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
}

.affirmations-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.affirmation-recordings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.affirmation-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.affirmation-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.affirmation-card h3 {
  margin: 0;
  font-size: 1.125rem;
}

.affirmation-card-heading span {
  color: var(--muted);
  font-size: 0.875rem;
}

.affirmation-card audio {
  display: block;
  width: 100%;
  min-width: 0;
}

.affirmation-card audio:focus-visible {
  outline: 3px solid rgba(var(--primary-rgb), 0.28);
  outline-offset: 3px;
  border-radius: 6px;
}

.affirmation-error {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  line-height: 0.95;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.profile-chip {
  min-height: 46px;
  max-width: min(260px, 42vw);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  min-width: 0;
  padding: 4px 12px 4px 4px;
}

.profile-chip:hover {
  border-color: #b7c3e5;
  background: #f8faff;
}

.profile-photo,
.settings-photo {
  border-radius: 50%;
  background: #eef3ff;
  object-fit: cover;
}

.profile-photo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.profile-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 10px;
}

.planner-tab {
  --planner-accent: var(--primary);
  --planner-tint: rgba(var(--primary-rgb), 0.1);
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px;
  text-align: left;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.planner-tab[data-planner="shopping"] {
  --planner-accent: var(--blue);
  --planner-tint: rgba(var(--blue-rgb), 0.12);
}

.planner-tab[data-planner="housework"] {
  --planner-accent: var(--warning);
  --planner-tint: rgba(190, 122, 0, 0.12);
}

.planner-tab[data-planner="ayurveda"] {
  --planner-accent: var(--accent);
  --planner-tint: rgba(var(--accent-rgb), 0.1);
}

.planner-tab:hover {
  border-color: rgba(183, 195, 229, 0.95);
  background: #fbfcff;
  transform: translateY(-1px);
}

.planner-tab.active {
  border-color: rgba(var(--primary-rgb), 0.32);
  background: var(--planner-tint);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.08);
}

.planner-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--planner-tint);
  color: var(--planner-accent);
  display: grid;
  flex: 0 0 40px;
  place-items: center;
}

.planner-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.planner-copy strong,
.planner-copy small {
  display: block;
}

.planner-copy strong {
  font-size: 0.96rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.planner-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.planner-suggestions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.suggestion-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.suggestion-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #43514b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  padding: 0 12px;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.suggestion-chip:hover {
  border-color: #b7c3e5;
  background: #f8faff;
  transform: translateY(-1px);
}

.task-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.62fr) minmax(160px, 0.48fr) auto auto;
  gap: 12px;
  align-items: end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

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

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}

.primary-button,
.ghost-button,
.icon-text-button,
.icon-button,
.tool-tab,
.segment {
  border: 0;
  min-height: 44px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.tool-tab {
  position: relative;
  z-index: 1;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  padding: 0 14px;
  isolation: isolate;
  min-width: 0;
}

.tool-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-tab svg {
  transition: transform 180ms ease;
}

.primary-button svg,
.ghost-button svg,
.icon-text-button svg,
.tool-tab svg {
  flex: 0 0 auto;
}

.primary-button span,
.ghost-button span,
.icon-text-button span,
.tool-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-tab.active {
  border-color: transparent;
  background: transparent;
  color: #fff;
}

.tool-tab:not(.active):hover {
  border-color: rgba(183, 195, 229, 0.86);
  background: rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}

.tool-tab:not(.active):hover svg {
  transform: translateY(-1px) scale(1.05);
}

.tool-tab.active svg {
  animation: tabIconPop 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tool-tab:active {
  transform: scale(0.98);
}

.tool-tab:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.icon-text-button:focus-visible,
.icon-button:focus-visible,
.profile-chip:focus-visible,
.provider-button:focus-visible,
.planner-tab:focus-visible,
.suggestion-chip:focus-visible,
.segment:focus-visible {
  outline: 3px solid rgba(var(--primary-rgb), 0.28);
  outline-offset: 2px;
}

.primary-button {
  height: 46px;
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.ghost-button,
.icon-text-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 750;
  padding: 0 14px;
}

.ghost-button:hover,
.icon-text-button:hover,
.icon-button:hover {
  border-color: #b7c3e5;
  background: #f8faff;
}

.ghost-button:disabled,
.icon-text-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

.icon-button {
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  flex: 0 0 44px;
}

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

.hidden {
  display: none !important;
}

.tool-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.tool-panel-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

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

.tool-panel.is-entering {
  animation: panelSlideIn 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.time-tool-form,
.timer-form {
  display: grid;
  gap: 12px;
  align-items: end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.time-tool-form {
  grid-template-columns: minmax(160px, 0.4fr) minmax(220px, 1fr) auto auto;
}

.timer-panel {
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr);
  align-items: end;
}

.timer-form {
  grid-template-columns: repeat(3, minmax(90px, 1fr)) auto auto auto;
}

.timer-readout {
  display: grid;
  min-height: 118px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: 0;
}

.water-panel {
  gap: 14px;
}

.water-card {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
}

.water-progress-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.water-progress-copy strong {
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.water-progress-copy span:last-child {
  color: var(--muted);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.water-ring {
  --water-progress: 0%;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(var(--blue) var(--water-progress), #dfe8fb 0);
  display: grid;
  flex: 0 0 104px;
  place-items: center;
}

.water-ring span {
  color: var(--ink);
  font-weight: 850;
}

.water-progress-track {
  height: 12px;
  border-radius: 999px;
  background: #dfe8fb;
  overflow: hidden;
}

.water-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition:
    width 220ms ease,
    background-color 220ms ease;
}

.water-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.tool-status {
  min-height: 76px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--muted);
  font-weight: 750;
  padding: 14px;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 14px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.segment {
  min-height: 42px;
  border-radius: 0;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  padding: 0 12px;
}

.segment + .segment {
  border-left: 1px solid var(--line);
}

.segment.active {
  background: var(--ink);
  color: #fff;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary div {
  min-height: 76px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.summary strong,
.summary span {
  display: block;
}

.summary strong {
  font-size: 1.6rem;
}

.summary span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.task-list {
  display: grid;
  gap: 10px;
  min-height: 142px;
  min-width: 0;
}

.task-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.task-card.done {
  background: #f7f8ff;
}

.check-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}

.task-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-wrap span {
  width: 26px;
  height: 26px;
  border: 2px solid #94a1c7;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.task-check:checked + span {
  border-color: var(--primary);
  background: var(--primary);
}

.task-check:checked + span::after {
  width: 10px;
  height: 6px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  content: "";
  transform: rotate(-45deg);
}

.task-content {
  min-width: 0;
}

.task-name {
  margin: 0 0 7px;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.task-card.done .task-name {
  color: var(--muted);
  text-decoration: line-through;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 24px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  border-radius: 999px;
  background: #eef3ff;
  color: #3e4a75;
  font-size: 0.78rem;
  font-weight: 750;
  padding: 4px 9px;
}

.meta-pill.due-now {
  background: rgba(var(--accent-rgb), 0.12);
  color: #a40d76;
}

.meta-pill.today {
  background: rgba(var(--primary-rgb), 0.12);
  color: #174ba9;
}

.meta-pill.reminder {
  background: rgba(190, 122, 0, 0.13);
  color: #875800;
}

.task-actions {
  display: flex;
  gap: 8px;
}

.empty-state {
  min-height: 142px;
  display: grid;
  place-items: center;
  border: 1px dashed #bcc6e4;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
  padding: 24px;
}

.settings-panel {
  gap: 18px;
}

.settings-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.settings-section-heading h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.widget-toggle-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.widget-toggle {
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
}

.widget-toggle-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.widget-toggle-copy strong,
.widget-toggle-copy span {
  overflow-wrap: anywhere;
}

.widget-toggle-copy strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.widget-toggle-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.widget-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.widget-switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #cbd5ee;
  flex: 0 0 48px;
  transition:
    background 160ms ease,
    opacity 160ms ease;
}

.widget-switch::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(7, 24, 74, 0.22);
  content: "";
  transition: transform 180ms ease;
}

.widget-toggle-input:checked + .widget-switch {
  background: var(--primary);
}

.widget-toggle-input:checked + .widget-switch::before {
  transform: translateX(20px);
}

.widget-toggle-input:focus-visible + .widget-switch {
  outline: 3px solid rgba(var(--primary-rgb), 0.28);
  outline-offset: 2px;
}

.widget-toggle-input:disabled + .widget-switch {
  opacity: 0.64;
}

.profile-panel {
  min-width: 0;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}

.settings-photo {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
}

.settings-profile-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.settings-profile-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.15rem;
}

.settings-profile-copy span {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-weight: 750;
}

.sign-out-button {
  justify-self: start;
}

.water-feature-screen,
.water-feature,
.water-screen {
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.water-feature-screen *,
.water-feature *,
.water-screen * {
  max-width: 100%;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  padding: 14px 16px;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@keyframes tabIconPop {
  0% {
    transform: scale(0.86);
  }

  60% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .time-tools {
    grid-template-columns: repeat(min(3, var(--tool-column-count)), minmax(0, 1fr));
  }

  .app-shell {
    align-items: start;
  }

  .auth-panel {
    width: min(520px, 100%);
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: auto;
    gap: 18px;
    padding: 34px 30px 38px;
  }

  .auth-hero::after {
    inset: auto 30px 26px 30px;
  }

  .auth-logo {
    width: min(300px, 100%);
  }

  .auth-entry {
    padding: 30px;
  }

  .task-form,
  .time-tool-form,
  .timer-form,
  .water-form {
    grid-template-columns: 1fr 1fr;
  }

  .planner-suggestions {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .timer-panel {
    grid-template-columns: 1fr;
  }

  .task-title-field,
  .tool-label-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 10px 0;
  }

  .workspace {
    padding: 18px;
  }

  .brand-title {
    font-size: clamp(2.35rem, 12vw, 3.15rem);
  }

  .topbar,
  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .profile-chip {
    max-width: 100%;
    padding-right: 10px;
  }

  .time-tools {
    gap: 4px;
    margin-bottom: 18px;
    padding: 4px;
  }

  .tool-tab {
    flex-direction: column;
    gap: 4px;
    min-height: 60px;
    padding: 6px 3px;
    font-size: 0.875rem;
    line-height: 1.05;
  }

  .tool-tab svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  .task-form,
  .time-tool-form,
  .timer-form,
  .water-form,
  .affirmation-recordings,
  .summary {
    grid-template-columns: 1fr;
  }

  .water-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .planner-tabs {
    gap: 8px;
  }

  .planner-tab {
    min-height: 68px;
    padding: 10px;
  }

  .primary-button,
  .ghost-button,
  .icon-text-button {
    width: 100%;
  }

  .segmented {
    width: 100%;
  }

  .task-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 420px) {
  .time-tools {
    grid-template-columns: repeat(min(2, var(--tool-column-count)), minmax(0, 1fr));
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .auth-screen {
    min-height: 100vh;
  }

  .workspace {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    padding: 18px;
  }

  .auth-panel {
    min-height: 100vh;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .auth-hero {
    padding: 28px 18px 34px;
  }

  .auth-hero::after {
    inset: auto 18px 22px 18px;
  }

  .auth-entry {
    padding: 22px 18px 28px;
  }

  .auth-copy h1 {
    font-size: clamp(2rem, 12vw, 2.75rem);
  }

  .auth-copy p:last-child {
    font-size: 0.95rem;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .brand-title {
    font-size: clamp(2.25rem, 12vw, 3rem);
  }

  .auth-panel .brand-title {
    font-size: clamp(2rem, 11vw, 2.75rem);
  }

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

  .topbar-actions .icon-text-button,
  .topbar-actions .profile-chip {
    font-size: 0.9rem;
  }

}

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

/* New controls use the existing design, typography and colour tokens. */
.time-tools::before { display: none; }
.tool-tab.active { background: linear-gradient(135deg, var(--primary-strong), #1366c8); }
.field small { font: inherit; font-weight: 400; color: var(--muted); }
.workspace-note { margin: 0 0 20px; color: var(--muted); font-size: .875rem; }
.planner-progress { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0; font-size: .875rem; color: var(--muted); }
.planner-progress progress { width: 100px; flex: 0 0 100px; accent-color: var(--primary); }
.controls { flex-wrap: wrap; gap: 10px; }
.segmented { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.segment { min-height: 44px; }
.search-field { margin-left: auto; min-width: 0; max-width: 280px; }
.search-field input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: var(--surface); color: var(--ink); }
.task-name { overflow-wrap: anywhere; }
.meta-pill.due-now { background: #fff0ed; color: #a42e19; }
.task-check:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 4px; }
.empty-state h2 { margin: 0 0 8px; font-size: 1.125rem; color: var(--ink); }
.empty-state p { margin: 0; }
.empty-state button { margin-top: 12px; }
.timer-readout { font-variant-numeric: tabular-nums; }
.timer-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 24px; }
.data-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 20; background: var(--surface); padding: 12px 16px; border-radius: 6px; color: var(--primary-strong); }
.skip-link:focus { top: 16px; }
.storage-warning { position: sticky; top: 0; z-index: 30; padding: 12px 20px; color: #76280e; background: #fff0d6; font-size: .875rem; }
.toast { z-index: 40; bottom: max(82px, calc(env(safe-area-inset-bottom) + 82px)); line-height: 1.5; }
.undo-bar { position: fixed; z-index: 35; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 18px; max-width: calc(100% - 24px); border-radius: 6px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: .875rem; }
.undo-bar button { border: 0; background: transparent; color: #fff; min-height: 44px; min-width: 44px; }
.undo-bar button:focus-visible { outline-color: #fff; }
@media (max-width: 640px) {
  .controls { flex-direction: row; }
  .segmented { width: calc(100% - 52px); }
  .segment { padding: 0 6px; }
  .search-field { order: 2; flex-basis: 100%; max-width: 100%; }
}
@media (forced-colors: active) {
  .tool-tab.active, .planner-tab.active, .segment.active { outline: 2px solid Highlight; }
  .task-check:checked + span { background: Highlight; }
  .task-check:checked + span::after { border-color: HighlightText; }
}
