/* RESET app shell.
   Dark, mobile first (375-430 px), system fonts only -- no webfont request
   leaves the device. Colours follow the visual reference; tokens make a light
   theme possible later without touching components. */

:root {
  --bg: #08090a;
  --surface: #141817;
  --surface-raised: #161a19;
  --surface-quiet: #101312;
  --border: #222726;
  --border-soft: #1e2221;

  --text: #f2f4f3;
  --text-muted: #a6afac;
  --text-dim: #7b8481;
  --text-faint: #6e7674;

  --accent: #35c98b;
  --accent-strong: #5fdca6;
  --on-accent: #06251a;
  --danger: #e26a6a;
  /* Amber is for "please double-check", never for judging a habit. */
  --notice: #e0a33c;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 26px;

  /* Bottom navigation height plus the home indicator area. */
  --tabbar-height: 62px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* iOS reports these as 0 outside standalone mode, so they are always safe
     to add. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  /* Prevents the rubber-band scroll from revealing the page background
     behind a standalone PWA. */
  overscroll-behavior-y: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- shell -- */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  max-width: 520px;
  margin: 0 auto;
  padding-left: max(var(--space-5), var(--safe-left));
  padding-right: max(var(--space-5), var(--safe-right));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: calc(var(--space-5) + var(--safe-top));
  padding-bottom: var(--space-4);
}

.app-header__eyebrow {
  font-size: 13px;
  color: var(--text-dim);
}

.app-header__title {
  margin: 2px 0 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom) + var(--space-6));
}

/* ----------------------------------------------------------------- cards -- */

.card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

.card--hero {
  background: linear-gradient(180deg, var(--surface-raised), #121514);
  border-color: var(--border);
}

.card__label {
  font-size: 13px;
  color: var(--text-dim);
}

.card__text {
  margin: var(--space-2) 0 0;
  font-size: 15px;
  color: var(--text-muted);
}

.card__note {
  margin: var(--space-3) 0 0;
  font-size: 13px;
  color: var(--text-faint);
}

.hero__value {
  margin-top: var(--space-1);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* --------------------------------------------------------------- lists --- */

.section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.section__title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-radius: 4px;
}

.list__row:first-child {
  border-radius: var(--radius-md) var(--radius-md) 4px 4px;
}

.list__row:last-child {
  border-radius: 4px 4px var(--radius-md) var(--radius-md);
}

.list__row:only-child {
  border-radius: var(--radius-md);
}

.list__label {
  flex: 1;
  font-size: 15px;
}

.list__value {
  font-size: 14px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.list__row--muted .list__label {
  color: var(--text-dim);
}

/* -------------------------------------------------------------- tabbar --- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  padding-bottom: calc(var(--space-2) + var(--safe-bottom));
  background: rgba(13, 15, 14, 0.94);
  border-top: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
}

.tabbar__item {
  flex: 1;
  min-width: 64px;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
}

.tabbar__item.is-active {
  color: var(--accent);
}

.tabbar__icon {
  font-size: 19px;
  line-height: 1;
}

/* -------------------------------------------------------------- buttons -- */

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: #1a1e1d;
  color: var(--text-dim);
  font-size: 18px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.button--quiet {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ----------------------------------------------------------------- auth -- */

.page-centered {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: calc(var(--space-6) + var(--safe-top)) var(--space-5)
    calc(var(--space-6) + var(--safe-bottom));
  text-align: left;
}

.auth__brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--accent);
}

.auth__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth__claim {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
}

.auth__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-2);
}

.auth__error {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: rgba(226, 106, 106, 0.12);
  border: 1px solid rgba(226, 106, 106, 0.35);
  color: var(--danger);
  font-size: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  /* Grid/flex children default to their content width; without this two
     inputs side by side (.field-pair) overflow narrow phones. */
  min-width: 0;
}

.field__label {
  font-size: 13px;
  color: var(--text-dim);
}

.field__input {
  min-height: 48px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  /* 16px keeps iOS Safari from zooming on focus. */
  font-size: 16px;
  min-width: 0;
  max-width: 100%;
}

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

/* ---------------------------------------------------------- phase 2 ---- */

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

.badge {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* Messages */

.messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.messages:empty {
  display: none;
}

.message {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.message p {
  margin: 0;
}

.message p + p,
.message ul {
  margin-top: var(--space-2);
}

.message ul {
  margin-bottom: 0;
  padding-left: var(--space-5);
}

.message--ok {
  border-color: rgba(53, 201, 139, 0.35);
  color: var(--text);
}

.message--warn {
  border-color: rgba(224, 163, 60, 0.45);
  color: var(--text);
}

.message--error {
  border-color: rgba(226, 106, 106, 0.4);
  background: rgba(226, 106, 106, 0.1);
  color: var(--text);
}

.message--draft {
  border-style: dashed;
}

.message__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* Focused check-in layout */

.focus-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-left: max(var(--space-5), var(--safe-left));
  padding-right: max(var(--space-5), var(--safe-right));
  padding-bottom: calc(96px + var(--safe-bottom));
}

.focus-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-2);
  padding-top: calc(var(--space-4) + var(--safe-top));
}

.focus-header__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-dim);
  font-size: 15px;
}

.focus-header__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.focus-header__step {
  justify-self: end;
  font-size: 14px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.focus-date {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.focus-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.section-form {
  display: contents;
}

.focus-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  padding: var(--space-3) max(var(--space-5), var(--safe-left));
  padding-bottom: calc(var(--space-3) + var(--safe-bottom));
  background: rgba(8, 9, 10, 0.94);
  border-top: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
}

.focus-actions .button {
  max-width: 480px;
}

/* Blocks inside check-ins and settings */

.block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.block__title {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  font-size: 17px;
  font-weight: 700;
}

.block__summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.block__subtitle {
  margin: var(--space-2) 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.block__hint,
.block__meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.block__more summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

.block__more[open] {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Fields */

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.field__control .field__input {
  flex: 1;
  min-width: 0;
}

.field__suffix {
  position: absolute;
  right: var(--space-4);
  color: var(--text-dim);
  font-size: 15px;
  pointer-events: none;
}

.field__input[type="time"],
.field__input[type="date"] {
  width: 100%;
  min-width: 0;
}

select.field__input {
  appearance: none;
  -webkit-appearance: none;
}

.field__textarea {
  min-height: 88px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
  line-height: 1.4;
}

.field__hint {
  font-size: 12px;
  color: var(--text-dim);
}

.field__error {
  margin: 0;
  font-size: 13px;
  color: var(--danger);
}

.field--invalid .field__input {
  border-color: var(--danger);
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

/* Chips: radio buttons that read as calm choices. */

.chips {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.chips__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}

.chip__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-quiet);
  color: var(--text-muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.chip input:checked + .chip__label {
  border-color: var(--accent);
  background: rgba(53, 201, 139, 0.14);
  color: var(--text);
}

.chip input:focus-visible + .chip__label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip-button {
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-quiet);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

.chip-button:disabled,
.button:disabled {
  opacity: 0.5;
}

/* Lists with actions */

.list__row--stack {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
}

.list__line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.list__note {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  white-space: pre-line;
}

.list__link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
  color: var(--text);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.inline-form {
  display: inline-flex;
  gap: var(--space-1);
  margin: 0;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.child-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
}

.decision {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.decision p {
  margin: 0;
  font-size: 14px;
}

.decision form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.button--small {
  width: auto;
  min-height: 44px;
  font-size: 15px;
}

.icon-button--small {
  width: 44px;
  height: 44px;
  border: 0;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
}

.icon-button--small:disabled {
  opacity: 0.35;
}

.toggle {
  min-width: 64px;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-quiet);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.toggle.is-on {
  border-color: var(--accent);
  color: var(--text);
}

/* Values: "nicht erfasst" is visibly different from any number. */

.value {
  text-align: right;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.value__meta {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
}

.value--missing {
  padding: 2px 8px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
}

.supplement-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.supplement-list__item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.supplement-not-due {
  margin: 0;
  font-size: 13px;
  color: var(--text-faint);
}

/* Today */

.hero__unit {
  font-size: 18px;
  color: var(--text-dim);
  font-weight: 600;
}

.hero__value--missing {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-dim);
}

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--on-accent);
}

.cta:hover {
  color: var(--on-accent);
}

.cta--quiet {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.cta--quiet:hover {
  color: var(--text);
}

.cta__title {
  display: block;
  font-size: 17px;
  font-weight: 700;
}

.cta__subtitle {
  display: block;
  font-size: 13px;
  opacity: 0.75;
}

.cta__arrow {
  font-size: 22px;
  font-weight: 700;
}

.card--quiet {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  color: var(--text-muted);
}

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

/* Week strip */

.week {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.week__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 60px;
  color: var(--text-dim);
  font-size: 20px;
}

.week__arrow--disabled {
  opacity: 0.25;
}

.week__days {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.week__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 60px;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.week__day.is-selected {
  background: var(--surface);
  color: var(--text);
}

.week__weekday {
  font-size: 11px;
  color: var(--text-dim);
}

.week__date {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Status by shape as well as colour: filled, ring, empty. */
.week__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid transparent;
}

.week__day--recorded .week__dot {
  background: var(--accent);
}

.week__day--partial .week__dot {
  border-color: var(--accent);
}

.week__day--not_recorded .week__dot {
  border-color: var(--border);
}

.week__day--future {
  opacity: 0.35;
}

.date-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: end;
}

.date-picker__label {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--text-dim);
}

.status {
  margin: var(--space-1) 0 0;
  font-size: 17px;
  font-weight: 600;
}

.checkbox {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  min-height: 44px;
  font-size: 13px;
  color: var(--text-muted);
}

.checkbox input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: none;
}

/* ---------------------------------------------------------- phase 3 ---- */

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

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface);
}

.segmented__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
}

.segmented__item.is-active {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--border);
}

.period-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: var(--space-2);
}

.period-nav__label {
  text-align: center;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.icon-button--disabled {
  opacity: 0.3;
}

.trend-nav {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
}

.trend-nav .chip-button {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--text-muted);
}

.trend p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.trend .trend__headline {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.trend__headline--missing {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-dim);
}

.trend__sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dim);
}

.trend .trend__fact {
  color: var(--text);
}

.trend .trend__delta {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.basis,
.trend .basis {
  font-size: 12px;
  color: var(--text-dim);
}

.chart {
  margin: var(--space-2) 0 0;
}

.chart__svg {
  display: block;
  width: 100%;
  height: 120px;
}

.chart__axis {
  stroke: var(--border);
  stroke-width: 1;
}

.chart__bar {
  fill: var(--accent);
  opacity: 0.75;
}

.chart__band {
  fill: var(--text);
  opacity: 0.08;
}

.chart__goal {
  stroke: var(--text);
  stroke-width: 1.5;
  opacity: 0.55;
}

.chart__gap {
  fill: var(--text-faint);
}

.chart__future {
  fill: var(--border);
}

.chart__label {
  fill: var(--text-dim);
  font-size: 9px;
  font-family: var(--font);
}

.chart__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.chart__point {
  fill: var(--text);
  opacity: 0.8;
}

.chart__caption {
  margin-top: var(--space-1);
  font-size: 11px;
  color: var(--text-dim);
}

.chart__data summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-strip__day {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
}

.status-strip__day--consumed {
  background: var(--text-muted);
}

.status-strip__day--free {
  border-color: var(--text-muted);
}

.status-strip__day--missing {
  border: 1.5px dashed var(--border);
}

.status-strip__day--future {
  background: var(--surface-quiet);
}

.milestones {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.milestones__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: var(--space-3);
  color: var(--text-muted);
}

.milestones__item.is-next .milestones__target {
  color: var(--text);
}

.milestones__target {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.milestones__kind,
.milestones__status {
  font-size: 13px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin-top: var(--space-2);
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.value__goal {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
}

/* ------------------------------------------------------------ responsive -- */

@media (min-width: 720px) {
  .app-shell {
    max-width: 640px;
  }

  .tabbar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 640px;
    border-left: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

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

/* Phase 4: insights and forecast */
.insight__values {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-2) 0 0;
}

.insight__values dt {
  font-size: 12px;
  color: var(--text-dim);
}

.insight__values dd {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.insight--pending .list__label {
  color: var(--text-muted);
}

.forecast a {
  color: var(--accent);
}

/* Phase 5: data & backup */
.button--danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.restore-warning p {
  margin: 0 0 var(--space-2);
  color: var(--text-muted);
}

.block__hint code,
.list__note code {
  font-size: 0.95em;
  color: var(--text);
}

.backup .row-actions {
  gap: var(--space-4);
}
