/* Layout: one iOS-style column — large title, grouped inset lists, frosted tab bar, bottom sheet for details. */
:root {
  --bg: #F5F3FA;
  --surface: #FFFFFF;
  --surface-2: #F1EDF9;
  --label: #1C1924;
  --label-2: #6A6478;
  --label-3: #A39DB1;
  --separator: rgba(64, 48, 110, 0.12);
  --accent: #8458EE;
  --accent-ink: #6A3DD9;
  --accent-soft: #EEE7FE;
  --on-accent: #FFFFFF;
  --spicy: #DD4E93;
  --spicy-soft: #FCE8F2;
  --ok: #2FB866;
  --bar: rgba(247, 245, 252, 0.78);
  --shadow: 0 1px 2px rgba(40, 20, 90, 0.05), 0 8px 24px rgba(40, 20, 90, 0.06);
  --sheet-shadow: 0 -10px 40px rgba(30, 10, 70, 0.18);
  --backdrop: rgba(22, 12, 44, 0.32);

  --fig-bg: #F3EEFC;
  --fig-floor: #DED5EE;
  --fig-shadow: #D9CEEB;
  --fig-prop: #CBC3DB;
  --fig-prop2: #9389A8;
  --fig-metal: #6E6584;
  --fig-ball: #D9C6F7;
  --fig-mat: #E2D9F3;
  --fig-breath: #9C7AE8;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --radius-lg: 22px;
  --spring: cubic-bezier(0.34, 1.45, 0.5, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --sheet-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --tabbar-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0C13;
    --surface: #1B1823;
    --surface-2: #26222F;
    --label: #F5F2FB;
    --label-2: #ABA4BA;
    --label-3: #6F687E;
    --separator: rgba(220, 205, 255, 0.12);
    --accent: #B497FF;
    --accent-ink: #C7B1FF;
    --accent-soft: rgba(170, 135, 255, 0.16);
    --on-accent: #1A1030;
    --spicy: #FF7DB8;
    --spicy-soft: rgba(255, 110, 175, 0.15);
    --ok: #4CD787;
    --bar: rgba(22, 19, 30, 0.78);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    --backdrop: rgba(0, 0, 0, 0.5);
    --fig-bg: #231F2E;
    --fig-floor: #3A3448;
    --fig-shadow: #17141F;
    --fig-prop: #4A4359;
    --fig-prop2: #6B6380;
    --fig-metal: #8E86A3;
    --fig-ball: #45396A;
    --fig-mat: #312A40;
    --fig-breath: #B497FF;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0E0C13;
  --surface: #1B1823;
  --surface-2: #26222F;
  --label: #F5F2FB;
  --label-2: #ABA4BA;
  --label-3: #6F687E;
  --separator: rgba(220, 205, 255, 0.12);
  --accent: #B497FF;
  --accent-ink: #C7B1FF;
  --accent-soft: rgba(170, 135, 255, 0.16);
  --on-accent: #1A1030;
  --spicy: #FF7DB8;
  --spicy-soft: rgba(255, 110, 175, 0.15);
  --ok: #4CD787;
  --bar: rgba(22, 19, 30, 0.78);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sheet-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  --backdrop: rgba(0, 0, 0, 0.5);
  --fig-bg: #231F2E;
  --fig-floor: #3A3448;
  --fig-shadow: #17141F;
  --fig-prop: #4A4359;
  --fig-prop2: #6B6380;
  --fig-metal: #8E86A3;
  --fig-ball: #45396A;
  --fig-mat: #312A40;
  --fig-breath: #B497FF;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
body.sheet-open { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button:focus { outline: none; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }

/* Press feedback: quick shrink, springy release. */
.pressable { transition: transform 0.45s var(--spring), background-color 0.2s ease, opacity 0.2s ease; will-change: transform; }
.pressable.is-pressed { transform: scale(0.96); transition: transform 0.12s ease-out, background-color 0.1s ease; }
.row.pressable.is-pressed { transform: scale(0.985); background-color: var(--surface-2); }

/* ---------------------------------------------------------------- frame */
.app {
  max-width: 640px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 8px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 32px);
}

.navbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border-bottom: 0.5px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.navbar.is-solid {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--separator);
}
.navbar-title {
  font-weight: 600;
  font-size: 17px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.35s var(--ease-out);
}
.navbar.is-solid .navbar-title { opacity: 1; transform: none; }

.view { animation: view-in 0.45s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

.title-block { margin: -36px 0 14px; padding-top: 4px; }
.eyebrow { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-ink); margin-bottom: 2px; }
.large-title { font-family: var(--font-display); font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: 0.01em; }
.lead { color: var(--label-2); font-size: 16px; margin: 0 0 20px; max-width: 60ch; }

/* ---------------------------------------------------------------- segmented control */
.segmented {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 2px;
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 18px;
}
.segmented-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / 3);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 3px 8px rgba(30, 10, 70, 0.12), 0 1px 1px rgba(30, 10, 70, 0.06);
  transition: transform 0.5s var(--spring);
}
.segment {
  position: relative;
  z-index: 1;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--label-2);
  transition: color 0.2s ease;
}
.segment[aria-selected="true"] { color: var(--label); font-weight: 600; }
.segment .today-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------------------------------------------------------------- day summary */
.day-content { display: grid; gap: 22px; }
.day-content.is-swapping { animation: swap-in 0.4s var(--ease-out); }
@keyframes swap-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } }

.summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, var(--accent-soft), var(--surface) 70%);
  box-shadow: var(--shadow);
}
.summary h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: 0.005em; }
.summary .focus { color: var(--label-2); font-size: 15px; margin-top: 2px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.stat { display: grid; }
.stat b { font-family: var(--font-rounded); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--label-2); }

.ring { width: 76px; height: 76px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--separator); }
.ring .value { stroke: var(--accent); transition: stroke-dashoffset 0.7s var(--ease-out); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-family: var(--font-rounded); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 11px; color: var(--label-2); }

/* ---------------------------------------------------------------- grouped lists */
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px 7px; }
.group-head h3 { font-size: 20px; font-weight: 700; font-family: var(--font-display); display: flex; align-items: center; gap: 8px; }
.group-head .meta { font-size: 13px; color: var(--label-2); white-space: nowrap; }
.group-note { font-size: 13px; color: var(--label-2); padding: 7px 4px 0; }

.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row {
  width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 9px 9px;
  text-align: left;
  position: relative;
  background: var(--surface);
}
.row + .row::before, .row-wrap + .row-wrap::before { content: ""; position: absolute; top: 0; left: 79px; right: 0; border-top: 0.5px solid var(--separator); z-index: 1; }
.row-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; background: var(--surface); }
.row-wrap .row { grid-template-columns: 58px minmax(0, 1fr); padding-right: 4px; }
.quick { display: flex; align-items: center; gap: 6px; padding-right: 10px; }
.q-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-ink); }
.q-btn svg { width: 13px; height: 13px; }
.q-btn.add { background: var(--accent); color: var(--on-accent); }
.q-btn:disabled { opacity: 0.35; cursor: default; }
.quick .done-pill { min-width: 38px; text-align: center; }
.done-pill.pop { animation: pop 0.5s var(--spring); }
.thumb { width: 58px; height: 58px; border-radius: 12px; background: var(--fig-bg); overflow: hidden; }
.thumb svg { width: 100%; height: 100%; }
.pic { display: block; width: 100%; height: 100%; position: relative; }
.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pic.has-photo svg { visibility: hidden; }
.row-text { min-width: 0; display: grid; gap: 2px; }
.row-title { font-size: 16px; font-weight: 600; line-height: 1.25; }
.row-meta { font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.row-end { display: flex; align-items: center; gap: 8px; color: var(--label-3); }
.row-end .chev { width: 8px; height: 14px; }
.done-pill {
  font-family: var(--font-rounded);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--label-2);
  transition: background-color 0.3s ease, color 0.3s ease;
}
.done-pill.is-done { background: var(--accent); color: var(--on-accent); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.chip.spicy { background: var(--spicy-soft); color: var(--spicy); }
.chip svg { width: 12px; height: 12px; }


/* ---------------------------------------------------------------- info cards */
.cards { display: grid; gap: 22px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h3 { font-size: 17px; font-weight: 650; margin-bottom: 8px; }
.card p, .card li { font-size: 15px; color: var(--label-2); }
.card p + p { margin-top: 8px; }
.card ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.profile { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 16px 0; }
.profile div + div { border-left: 0.5px solid var(--separator); }
.profile b { display: block; font-family: var(--font-rounded); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--label); }
.profile span { font-size: 12px; color: var(--label-2); }
.weeks { display: grid; gap: 10px; }
.weeks div { display: grid; grid-template-columns: 74px 1fr; gap: 10px; font-size: 15px; color: var(--label-2); }
.weeks b { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.weeks .is-now { background: var(--accent-soft); color: var(--label); border-radius: 10px; padding: 8px 10px; margin: 0 -10px; }

.add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.add-btn svg, .link svg { width: 13px; height: 13px; }
.primary { display: block; width: 100%; margin-top: 18px; padding: 15px; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 600; }
.day-card { display: grid; gap: 12px; padding: 16px; margin-bottom: 12px; border-radius: var(--radius-lg); background: linear-gradient(140deg, var(--accent-soft), var(--surface) 70%); box-shadow: var(--shadow); }
.day-card .stats { margin-top: 0; }
.day-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.day-card-top b { display: block; font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.day-card-top span:not(.chip) { font-size: 14px; color: var(--label-2); }
.chip.done { background: var(--accent); color: var(--on-accent); }
.chip.done svg { width: 13px; height: 13px; }
.bar { height: 8px; border-radius: 99px; background: var(--separator); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.7s var(--ease-out); }
.done-msg { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.done-msg svg { width: 16px; height: 16px; }
.card.empty { font-size: 15px; color: var(--label-2); text-align: center; padding: 20px 16px; }

/* ---------------------------------------------------------------- journal */
.calendar { padding: 12px 12px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h3 { margin: 0; font-size: 17px; font-weight: 650; }
.cal-head h3::first-letter { text-transform: uppercase; }
.cal-nav { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--accent-ink); }
.cal-nav svg { width: 8px; height: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-week span { text-align: center; font-size: 12px; font-weight: 600; color: var(--label-3); padding-bottom: 4px; }
.cal-day {
  position: relative;
  aspect-ratio: 1;
  max-width: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--label);
}
.cal-day span { position: relative; z-index: 1; }
.cal-day i { position: absolute; bottom: 12%; width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.cal-day.is-plan { color: var(--accent-ink); font-weight: 600; }
.cal-day.has-log i { background: var(--accent); }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.is-selected { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cal-day.is-selected i { background: var(--on-accent); }
.cal-day.is-complete { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.cal-day.is-complete.is-selected { background: var(--accent); color: var(--on-accent); }
.cal-sum { font-size: 13px; color: var(--label-2); text-align: center; margin-top: 10px; }
.note-field {
  width: 100%;
  display: block;
  resize: vertical;
  min-height: 84px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--label);
  font: 16px/1.4 var(--font);
}
.note-field:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.note-field::placeholder { color: var(--label-3); }
.hist-row { display: grid; grid-template-columns: 1fr auto 52px; align-items: baseline; gap: 10px; padding: 12px 14px; font-size: 15px; }
.hist-row + .hist-row { border-top: 0.5px solid var(--separator); }
.hist-row span { color: var(--label-2); min-width: 0; }
.hist-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.hist-row small { text-align: right; font-size: 13px; color: var(--label-2); font-variant-numeric: tabular-nums; }

.form { display: grid; }
.field { display: grid; grid-template-columns: 1fr 92px 54px; align-items: center; gap: 8px; padding: 6px 14px; min-height: 52px; }
.field + .field { border-top: 0.5px solid var(--separator); }
.field input[type="date"] { grid-column: 2 / 4; font-size: 15px; padding: 0 8px; }
.field input::placeholder { color: var(--label-3); }
.field span { font-size: 16px; }
.field em { font-style: normal; font-size: 14px; color: var(--label-2); }
.field.wide { grid-template-columns: 64px 1fr; gap: 10px; }
.field.wide input { text-align: left; padding: 0 12px; font: 500 16px var(--font); }
.primary:disabled { opacity: 0.6; }

/* Login: the only screen until she is signed in. */
body.locked > :not(.gate) { display: none !important; }
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: max(32px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(32px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.gate-card { width: 100%; max-width: 380px; text-align: center; }
.gate-icon { display: block; margin: 0 auto 20px; filter: drop-shadow(0 8px 20px rgba(116, 68, 214, 0.28)); }
.gate .large-title { margin-bottom: 8px; }
.gate .lead { margin: 0 auto 28px; }
.gate .form { text-align: left; }
.login-error { min-height: 20px; margin: 10px 4px 0; font-size: 14px; color: var(--spicy); text-align: left; }
.gate .primary { margin-top: 8px; }
.field input, .num input {
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--label);
  text-align: center;
  font: 600 16px var(--font-rounded);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button,
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------------------------------------------------------------- tab bar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px max(16px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
}
.tab { display: grid; justify-items: center; gap: 1px; padding: 2px 0; color: var(--label-3); font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; }
.tab svg { width: 28px; height: 28px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab.bounce svg { animation: bounce 0.5s var(--spring); }
@keyframes bounce { 40% { transform: scale(0.82); } }

/* ---------------------------------------------------------------- sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--backdrop);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.sheet-backdrop.is-open { opacity: 1; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  max-width: 640px;
  margin: 0 auto;
  height: calc(100% - env(safe-area-inset-top, 0px) - 12px);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  box-shadow: var(--sheet-shadow);
  transform: translateY(100%);
  transition: transform 0.5s var(--sheet-ease);
}
.sheet.is-open { transform: translateY(0); }
.sheet.is-dragging { transition: none; }
.sheet-handle { flex: none; height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--label-3); opacity: 0.6; }
.sheet-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(28px + env(safe-area-inset-bottom, 0px));
}
.sheet-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 4px 0 14px; }
.sheet-top h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.15; }
.sheet-top .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.close {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--label-2);
}
.close svg { width: 12px; height: 12px; }

.poses { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pose { width: 100%; border-radius: 16px; overflow: hidden; background: var(--fig-bg); aspect-ratio: 1; max-width: 100%; }
.pose svg { width: 100%; height: 100%; }
.pose-wrap { margin: 0; display: grid; gap: 7px; justify-items: center; }
.pose-wrap figcaption {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--label-2);
}
.pose-wrap.active figcaption { background: var(--accent); color: var(--on-accent); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 16px; }
.fact { padding: 12px 14px; display: grid; gap: 2px; }
.fact:nth-child(odd) { border-right: 0.5px solid var(--separator); }
.fact:nth-child(n+3) { border-top: 0.5px solid var(--separator); }
.fact span { font-size: 12px; color: var(--label-2); }
.fact b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }

.section-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--label-2); margin: 22px 4px 8px; }

.tracker { padding: 6px 14px 12px; display: grid; gap: 8px; }
.set-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 92px 82px; align-items: center; gap: 8px; padding: 6px 0; }
.set-row + .set-row { border-top: 0.5px solid var(--separator); }
.set-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-rounded);
  font-weight: 700;
  font-size: 16px;
  background: var(--surface-2);
  color: var(--label-2);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.45s var(--spring);
}
.set svg { width: 18px; height: 18px; }
.set svg path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.set.is-done { background: var(--accent); color: var(--on-accent); }
.set.is-done svg path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.35s 0.08s var(--ease-out); }
.set.pop { animation: pop 0.5s var(--spring); }
@keyframes pop { 30% { transform: scale(0.82); } 65% { transform: scale(1.1); } }
.num { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px; }
.num span { font-size: 12px; color: var(--label-2); }
.tracker-actions { display: flex; gap: 18px; padding-top: 4px; border-top: 0.5px solid var(--separator); }
.link { display: inline-flex; align-items: center; gap: 5px; padding: 8px 2px; color: var(--accent-ink); font-size: 15px; font-weight: 600; }
.tracker-note { font-size: 13px; color: var(--label-2); }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 11px 14px; font-size: 15px; line-height: 1.4; }
.steps li + li { border-top: 0.5px solid var(--separator); }
.steps li::before {
  content: counter(step);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 13px var(--font-rounded);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.note { border-radius: var(--radius); padding: 12px 14px; font-size: 15px; line-height: 1.4; display: grid; grid-template-columns: 22px 1fr; gap: 8px; margin-top: 10px; }
.note svg { width: 20px; height: 20px; margin-top: 1px; }
.note.tip { background: var(--accent-soft); color: var(--label); }
.note.tip svg { color: var(--accent-ink); }

@media (min-width: 560px) {
  .large-title { font-size: 40px; }
}

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