/* ==========================================================================
   HabitQuest — Componenten
   ========================================================================== */

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5) var(--s-3);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}

.topbar--scrolled {
  border-bottom-color: var(--hairline);
}

.topbar__title {
  font-family: var(--font-display);
  font-size: var(--t-heading);
  font-weight: 620;
  letter-spacing: -0.018em;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  background: transparent;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.icon-btn:active {
  background: var(--surface-sunken);
  transform: scale(0.93);
}

.icon-btn svg {
  width: 21px;
  height: 21px;
}

/* --------------------------------------------------------------------------
   Kaarten (IDEO-stijl: rustig, tactiel, één duidelijke actie)
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s-5);
}

.card--flat {
  box-shadow: none;
  background: var(--surface-2);
}

.card--tint {
  background: var(--accent-tint);
  border-color: transparent;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Knoppen
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 52px;
  padding: 0 var(--s-6);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--t-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease);
  will-change: transform;
}

.btn:active:not(:disabled) {
  transform: scale(0.975);
  background: var(--accent-hover);
}

.btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.btn--block {
  width: 100%;
}

.btn--secondary {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-xs);
}

.btn--secondary:active:not(:disabled) {
  background: var(--surface-sunken);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink-2);
  min-height: 46px;
}

.btn--ghost:active:not(:disabled) {
  background: var(--surface-sunken);
}

.btn--quiet {
  --btn-bg: var(--surface-sunken);
  --btn-fg: var(--ink);
}

.btn--quiet:active:not(:disabled) {
  background: var(--hairline);
}

.btn--danger {
  --btn-bg: transparent;
  --btn-fg: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}

.btn--sm {
  min-height: 40px;
  padding: 0 var(--s-4);
  font-size: var(--t-sub);
  border-radius: var(--r-sm);
}

/* --------------------------------------------------------------------------
   Chips (looptijd, flex-dagen) — alles met één tik
   -------------------------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-2);
  font-size: var(--t-sub);
  font-weight: 550;
  transition: all var(--dur-fast) var(--ease);
}

.chip:active {
  transform: scale(0.95);
}

.chip[aria-pressed='true'],
.chip[data-selected='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chip--day {
  width: 42px;
  padding: 0;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Doelkaart (onboarding, US 2.2 / 2.3)
   -------------------------------------------------------------------------- */
.goal-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  width: 100%;
  text-align: left;
  padding: var(--s-4) var(--s-5) var(--s-4) var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease), background var(--dur-fast) var(--ease);
}

.goal-card:active {
  transform: scale(0.985);
}

.goal-card[data-selected='true'] {
  border-color: var(--accent);
  background: var(--accent-tint);
  box-shadow: var(--shadow-sm);
}

.goal-card__emoji {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 23px;
  border-radius: var(--r-sm);
  background: var(--goal-tint, var(--surface-sunken));
}

/* Veel tekstelementen zijn <span> binnen een flex-item; zonder block gaan
   titel en omschrijving op één regel door elkaar lopen. */
.goal-card__title,
.goal-card__why,
.habit__title,
.habit__anchor,
.list__title,
.list__desc,
.option__title,
.option__desc,
.anchor-card__text,
.stat__value,
.stat__label {
  display: block;
}

.goal-card__title {
  font-size: var(--t-body);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.goal-card__why {
  margin-top: 5px;
  font-size: var(--t-caption);
  line-height: 1.42;
  color: var(--ink-2);
}

.goal-card__check {
  position: absolute;
  top: var(--s-3);
  right: var(--s-3);
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  opacity: 0;
  transform: scale(0.6);
  transition: all var(--dur) var(--ease-out);
}

.goal-card[data-selected='true'] .goal-card__check {
  opacity: 1;
  transform: none;
}

.goal-card__check svg {
  width: 13px;
  height: 13px;
}

/* --------------------------------------------------------------------------
   Ankerkaart (US 2.5)
   -------------------------------------------------------------------------- */
.anchor-card {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  text-align: left;
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  transition: all var(--dur-fast) var(--ease);
}

.anchor-card:active {
  transform: scale(0.985);
}

.anchor-card[data-selected='true'] {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.anchor-card__radio {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--hairline-strong);
  display: grid;
  place-items: center;
  transition: all var(--dur-fast) var(--ease);
}

.anchor-card[data-selected='true'] .anchor-card__radio {
  border-color: var(--accent);
  background: var(--accent);
}

.anchor-card__radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--accent-ink);
  transform: scale(0);
  transition: transform var(--dur) var(--ease-out);
}

.anchor-card[data-selected='true'] .anchor-card__radio::after {
  transform: scale(1);
}

.anchor-card__text {
  font-size: var(--t-sub);
  line-height: 1.4;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Uitlegbox (Mom-Test, US 2.4)
   -------------------------------------------------------------------------- */
.explainer {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}

.explainer__icon {
  flex: 0 0 auto;
  font-size: 17px;
  line-height: 1.3;
}

.explainer__body {
  font-size: var(--t-caption);
  line-height: 1.5;
  color: var(--ink-2);
}

.explainer__body strong {
  color: var(--ink);
  font-weight: 620;
}

/* --------------------------------------------------------------------------
   Habit-kaart op het dashboard (US 3.1)
   -------------------------------------------------------------------------- */
.habit {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.habit[data-done='true'] {
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  background: linear-gradient(180deg, var(--accent-tint) 0%, var(--surface) 62%);
}

.habit[data-resting='true'] {
  background: var(--surface-2);
  box-shadow: none;
}

.habit__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
}

.habit__emoji {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border-radius: var(--r-sm);
  background: var(--goal-tint, var(--surface-sunken));
}

.habit__title {
  font-size: var(--t-body);
  font-weight: 620;
  letter-spacing: -0.014em;
  line-height: 1.28;
}

.habit__anchor {
  margin-top: 3px;
  font-size: var(--t-caption);
  line-height: 1.45;
  color: var(--ink-2);
}

.habit__anchor em {
  font-style: normal;
  color: var(--ink);
  font-weight: 560;
}

.habit__menu {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: -4px -6px 0 0;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  color: var(--ink-3);
}

.habit__menu:active {
  background: var(--surface-sunken);
}

/* Vlam-indicator (US 3.5) */
.streak {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--r-pill);
  background: var(--flame-tint);
  color: var(--flame);
  font-size: var(--t-caption);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.streak[data-cold='true'] {
  background: var(--surface-sunken);
  color: var(--ink-3);
}

.streak__flame {
  font-size: 13px;
  display: inline-block;
}

.habit[data-done='true'] .streak__flame {
  animation: flicker 2.6s var(--ease) infinite;
}

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(1.12) rotate(-4deg); }
  65% { transform: scale(0.97) rotate(3deg); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--t-micro);
  font-weight: 620;
  letter-spacing: 0.01em;
}

.badge--frost { background: var(--frost-tint); color: var(--frost); }
.badge--nano { background: var(--nano-tint); color: var(--nano); }
.badge--rest { background: var(--surface-sunken); color: var(--ink-3); }
.badge--accent { background: var(--accent-tint-2); color: var(--accent); }

/* Solidification bar (US 3.6) */
.solid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.solid__track {
  position: relative;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  overflow: hidden;
}

.solid__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 72%, var(--flame)) 100%);
  transition: width var(--dur-slow) var(--ease-out);
}

.solid__meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--t-micro);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* Check-knop (US 3.2 / 3.3 / 3.7) */
.check-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 54px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--t-body);
  font-weight: 620;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  transition: transform 90ms var(--ease), background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

.check-btn:active {
  transform: scale(0.975);
}

.check-btn[data-state='done'] {
  background: var(--accent-tint-2);
  color: var(--accent);
}

.check-btn[data-state='resting'] {
  background: var(--surface-sunken);
  color: var(--ink-3);
}

.check-btn__icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

/* Afgeronde staat: label boven, ontdoe-hint eronder. */
.check-btn__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.25;
}

.check-btn__hint {
  font-size: var(--t-micro);
  font-weight: 500;
  opacity: 0.72;
}

.check-btn__icon svg {
  width: 18px;
  height: 18px;
}

/* Dopamine-puls (US 3.3) */
.pulse-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: var(--r-pill);
  background: currentColor;
  opacity: 0.35;
  transform: scale(0);
  pointer-events: none;
  animation: pulse-out 620ms var(--ease-out) forwards;
}

@keyframes pulse-out {
  0% { transform: scale(0); opacity: 0.4; }
  100% { transform: scale(9); opacity: 0; }
}

@keyframes card-pop {
  0% { transform: scale(1); }
  38% { transform: scale(1.022); }
  100% { transform: scale(1); }
}

.habit--celebrate {
  animation: card-pop 460ms var(--ease-out);
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}

.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--accent);
  opacity: 0;
  animation: spark-fly 720ms var(--ease-out) forwards;
}

@keyframes spark-fly {
  0% { opacity: 0.9; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) scale(0.3); }
}

/* --------------------------------------------------------------------------
   Tabbar
   -------------------------------------------------------------------------- */
.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 6px var(--s-3) calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--hairline);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 50px;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 560;
  letter-spacing: 0.01em;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.tab:active {
  background: var(--surface-sunken);
}

.tab svg {
  width: 22px;
  height: 22px;
}

.tab[aria-current='page'] {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Bottom sheet
   -------------------------------------------------------------------------- */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(10, 14, 12, 0.34);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade var(--dur) var(--ease) both;
  display: flex;
  align-items: flex-end;
}

.sheet-backdrop[data-closing='true'] {
  animation: fade var(--dur) var(--ease) reverse both;
}

.sheet {
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--s-3) var(--s-5) calc(var(--s-6) + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  animation: sheet-up 340ms var(--ease-out) both;
}

.sheet::-webkit-scrollbar { display: none; }

.sheet-backdrop[data-closing='true'] .sheet {
  animation: sheet-up 240ms var(--ease) reverse both;
}

@keyframes sheet-up {
  from { transform: translate3d(0, 100%, 0); }
  to { transform: none; }
}

.sheet__grabber {
  width: 38px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--hairline-strong);
  margin: 0 auto var(--s-4);
}

.sheet__title {
  font-family: var(--font-display);
  font-size: var(--t-title);
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
}

/* Optielijst in sheets */
.option {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  text-align: left;
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.option:active {
  transform: scale(0.985);
  background: var(--surface-sunken);
}

.option__icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
}

.option--frost .option__icon { background: var(--frost-tint); }
.option--nano .option__icon { background: var(--nano-tint); }

.option__title {
  font-size: var(--t-body);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.option__desc {
  margin-top: 2px;
  font-size: var(--t-caption);
  line-height: 1.42;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Chaos Path banner (US 4.3)
   -------------------------------------------------------------------------- */
.calm-banner {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  background: var(--frost-tint);
  color: var(--ink-2);
  font-size: var(--t-caption);
  line-height: 1.52;
  border: 1px solid color-mix(in srgb, var(--frost) 18%, transparent);
}

.calm-banner strong {
  display: block;
  color: var(--ink);
  font-size: var(--t-sub);
  font-weight: 620;
  margin-bottom: 3px;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast-root {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--s-3));
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: 0 var(--s-5);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  max-width: 100%;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  color: var(--paper);
  font-size: var(--t-caption);
  line-height: 1.4;
  box-shadow: var(--shadow-md);
  animation: rise var(--dur) var(--ease-out) both;
}

.toast[data-closing='true'] {
  animation: rise var(--dur-fast) var(--ease) reverse both;
}

.toast__action {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 640;
  font-size: var(--t-caption);
  padding: 2px 2px 2px var(--s-2);
}

.toast--warn { background: color-mix(in srgb, var(--warn) 92%, black); color: #fff; }

/* --------------------------------------------------------------------------
   Statusstrip (offline / sync) — US 7.3
   -------------------------------------------------------------------------- */
.statusbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px var(--s-5);
  font-size: var(--t-micro);
  font-weight: 560;
  background: var(--flame-tint);
  color: var(--flame);
}

.statusbar--sync {
  background: var(--accent-tint);
  color: var(--accent);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: currentColor;
  animation: breathe 1.8s var(--ease) infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* --------------------------------------------------------------------------
   Insights (Epic 5)
   -------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

.stat {
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-xs);
}

.stat__value {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 640;
  letter-spacing: -0.026em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  margin-top: 3px;
  font-size: var(--t-micro);
  color: var(--ink-3);
}

.ring {
  display: grid;
  place-items: center;
  position: relative;
}

.ring svg {
  transform: rotate(-90deg);
}

.ring__value {
  position: absolute;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 640;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.ring__track { stroke: var(--surface-sunken); }
.ring__fill {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 700ms var(--ease-out);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.bar-row__label {
  flex: 0 0 92px;
  font-size: var(--t-caption);
  color: var(--ink-2);
}

.bar-row__track {
  flex: 1 1 auto;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  overflow: hidden;
}

.bar-row__fill {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
  transition: width var(--dur-slow) var(--ease-out);
}

.bar-row__value {
  flex: 0 0 38px;
  text-align: right;
  font-size: var(--t-caption);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* Weekgrid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.week-cell {
  aspect-ratio: 1;
  border-radius: 7px;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  font-size: 9.5px;
  color: var(--ink-3);
}

.week-cell[data-level='done'] { background: var(--accent); color: var(--accent-ink); }
.week-cell[data-level='partial'] { background: var(--accent-tint-2); color: var(--accent); }
.week-cell[data-level='freeze'] { background: var(--frost-tint); color: var(--frost); }
.week-cell[data-level='flex'] { background: var(--surface-sunken); color: var(--ink-3); opacity: 0.6; }
.week-cell[data-level='future'] { opacity: 0.35; }

.insight-note {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  font-size: var(--t-caption);
  line-height: 1.5;
  color: var(--ink-2);
}

.insight-note__icon { flex: 0 0 auto; font-size: 16px; }

/* --------------------------------------------------------------------------
   Instellingen
   -------------------------------------------------------------------------- */
.list {
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
  overflow: hidden;
}

.list__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  text-align: left;
  padding: var(--s-4);
  background: transparent;
  border-bottom: 1px solid var(--hairline);
  transition: background var(--dur-fast) var(--ease);
}

.list__item:last-child { border-bottom: none; }
.list__item:active { background: var(--surface-sunken); }

.list__title { font-size: var(--t-sub); font-weight: 560; }
.list__desc { margin-top: 2px; font-size: var(--t-micro); color: var(--ink-3); line-height: 1.4; }
.list__chevron { color: var(--ink-3); flex: 0 0 auto; }
.list__chevron svg { width: 16px; height: 16px; display: block; }

/* Toggle */
.switch {
  flex: 0 0 auto;
  width: 48px;
  height: 29px;
  border-radius: var(--r-pill);
  background: var(--hairline-strong);
  padding: 2.5px;
  transition: background var(--dur) var(--ease);
}

.switch[aria-checked='true'] { background: var(--accent); }

.switch__knob {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  background: #fff;
  box-shadow: var(--shadow-xs);
  transform: translateX(0);
  transition: transform var(--dur) var(--ease-out);
}

.switch[aria-checked='true'] .switch__knob {
  transform: translateX(19px);
}

/* --------------------------------------------------------------------------
   Voortgangsindicator onboarding
   -------------------------------------------------------------------------- */
.steps {
  display: flex;
  gap: 5px;
  align-items: center;
}

.steps__dot {
  height: 4px;
  flex: 1 1 auto;
  border-radius: var(--r-pill);
  background: var(--hairline-strong);
  transition: background var(--dur) var(--ease);
}

.steps__dot[data-active='true'] { background: var(--accent); }

/* --------------------------------------------------------------------------
   Leeg / laden
   -------------------------------------------------------------------------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-8) var(--s-5);
}

.empty__art {
  width: 74px;
  height: 74px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  font-size: 32px;
  background: var(--accent-tint);
  margin-bottom: var(--s-2);
}

.skeleton {
  border-radius: var(--r-lg);
  background: linear-gradient(
    100deg,
    var(--surface-sunken) 30%,
    color-mix(in srgb, var(--surface-sunken) 55%, var(--surface)) 50%,
    var(--surface-sunken) 70%
  );
  background-size: 300% 100%;
  animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
  to { background-position: -300% 0; }
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 700ms linear infinite;
}

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

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--hairline-strong);
  color: var(--ink);
  font-size: var(--t-body);
  -webkit-user-select: text;
  user-select: text;
  transition: border-color var(--dur-fast) var(--ease);
}

.field__input::placeholder { color: var(--ink-3); }
.field__input:focus { outline: none; border-color: var(--accent); }

.field__error {
  font-size: var(--t-caption);
  color: var(--warn);
}

.brandmark {
  width: 62px;
  height: 62px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 62%, var(--flame)) 100%);
  box-shadow: var(--shadow-md);
}

.brandmark svg { width: 32px; height: 32px; color: #fff; }

/* --------------------------------------------------------------------------
   Buddy-weergave (US 7.6)
   -------------------------------------------------------------------------- */
.buddy-habit {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.buddy-habit__state {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  background: var(--surface-sunken);
  color: var(--ink-3);
}

.buddy-habit__state[data-done='true'] {
  background: var(--accent);
  color: var(--accent-ink);
}

.buddy-habit__state svg { width: 16px; height: 16px; }
