/* Blosta — drop Blosta.woff2 into fonts/ and it takes over automatically. */
@font-face {
  font-family: 'Blosta';
  src: local('Blosta'), url('fonts/Blosta.woff2') format('woff2'), url('fonts/Blosta.otf') format('opentype');
  font-display: swap;
}

:root {
  /* Black, white, brown and mauve. The rest are greys between black and white. */
  --cream:    #F4F3F1;   /* the page */
  --sand:     #ECEAE7;
  --blush:    #E4E2DE;
  --peach:    #D6D2CC;
  --rose:     #A5738A;   /* mauve, sparingly */
  --mauve:    #A5738A;
  --tan:      #8F6350;   /* brown, sparingly */
  --mocha:    #8F6350;
  --cocoa:    #111111;
  --ink:      #111111;
  --muted:    #77736E;
  --line:     rgba(17,17,17,.1);
  --card:     #FFFFFF;
  --fill:     #111111;   /* every primary button and every active state */
  --shadow:   0 1px 2px rgba(0,0,0,.04), 0 12px 32px -20px rgba(0,0,0,.18);
  --radius:   24px;

  --display: 'Urbanist', 'Helvetica Neue', -apple-system, system-ui, sans-serif;
  --body: 'Urbanist', 'Helvetica Neue', -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 12% -8%,  #F4F3F1 0%, transparent 62%),
    radial-gradient(900px 640px at 92% 4%,   #F4F3F1 0%, transparent 58%),
    radial-gradient(1000px 800px at 50% 108%, #F4F3F1 0%, transparent 60%),
    var(--cream);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.06;
  margin: 0;
}
.display em { font-style: italic; color: var(--mauve); }

/* ── top bar ─────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px clamp(18px, 5vw, 56px);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar[hidden] { display: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { width: 30px; height: 30px; }
.mark.big { width: 78px; height: 78px; }
.brandname {
  font-family: var(--display);
  font-size: 21px; letter-spacing: .16em; text-transform: uppercase;
}

.nav-right { display: flex; align-items: center; gap: 14px; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; background: rgba(255,255,255,.55); padding: 5px; border-radius: 999px; border: 1px solid var(--line); }
.tab {
  font-family: var(--body); font-size: 14px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: 9px 20px; border-radius: 999px; transition: .25s;
}
.tab:hover { color: var(--cocoa); }
.tab.is-active { background: var(--fill); color: #fff; }

/* ── layout ──────────────────────────────────────────── */
:root { --topbar: 62px; --vh: 100dvh; }   /* both measured on load, see measureTopbar() */

main { max-width: 1320px; margin: 0 auto; padding: clamp(16px, 2.4vw, 26px) clamp(14px, 3vw, 32px); }
.view { display: none; animation: rise .5s ease both; }
.view.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* Vision, Tasks and Training hold to one screen — no page scroll, nothing cut off. */
.view.fit.is-active {
  display: grid;
  height: calc(var(--vh) - var(--topbar) - clamp(32px, 4.8vw, 52px));
  gap: clamp(10px, 1.4vw, 18px);
}
/* Below the two-column breakpoint there is no honest way to fit a 16-hour day and a
   full session into a phone screen, so those two scroll normally. Vision still fits. */
@media (max-width: 860px) {
  #view-tasks.fit.is-active, #view-training.fit.is-active { height: auto; }
}
.view.fit .section-title { font-size: clamp(15px, 1.5vw, 18px); margin-bottom: 8px; }

.hero { margin-bottom: 34px; }
.eyebrow {
  margin: 0 0 12px; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--mauve);
}
.hero .display { font-size: clamp(40px, 8vw, 74px); }
.affirm {
  margin: 20px 0 0; font-family: var(--display); font-style: italic;
  font-size: clamp(19px, 2.6vw, 26px); color: var(--mocha); max-width: 30ch; line-height: 1.35;
}

.section-title {
  font-family: var(--display); font-weight: 400; font-size: 26px;
  margin: 0 0 18px; color: var(--cocoa);
}

/* ── vision board — one collage, one screen ──────────── */
#view-vision { grid-template-rows: auto minmax(0, 1fr); }

.vision-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.vision-top .display { font-size: clamp(26px, 4vw, 46px); }
.vision-top .eyebrow { margin-bottom: 6px; }

.affirm-strip {
  margin: 0; text-align: right; display: grid; gap: 1px;
  font-family: var(--display); font-style: italic; color: var(--mocha);
  font-size: clamp(11px, 1.15vw, 15px); line-height: 1.32;
}
.affirm-strip { cursor: text; }
.affirm-strip span:last-child { color: var(--mauve); }
.affirm-edit {
  font: italic clamp(11px, 1.15vw, 15px)/1.32 var(--display); color: var(--mocha); text-align: right;
  background: transparent; border: 1px solid var(--line, rgba(0,0,0,.15)); border-radius: 8px;
  padding: 4px 8px; min-width: min(360px, 100%); resize: none;
}
@media (max-width: 620px) { .affirm-strip { text-align: left; font-size: 11px; } }

/* A fine 12-row track so tiles can take two real shapes: `tall` spans 5 rows and lands on a
   portrait ratio (~0.63) that barely crops a standing person, short spans 3 and suits the
   landscape shots. Dense packing closes the gaps. Fixed rows mean it never scrolls. */
.board {
  display: grid; gap: clamp(4px, .55vw, 8px); grid-auto-flow: row dense;
  grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(var(--rows, 12), 1fr);
  padding: clamp(6px, .8vw, 12px);
  border-radius: var(--radius); min-height: 0;
  background: linear-gradient(150deg, rgba(255,255,255,.5), rgba(17,17,17,.32));
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
}
.tile { grid-row: span 3; }
.tile.tall { grid-row: span 5; }
/* one wide block takes the last five cells, so the grid closes with no hole */
.tile.wide { grid-column: span 2; }
@media (max-width: 900px) {
  .board { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(var(--rows-narrow, 21), 1fr); }
  .tile.wide { grid-column: span 1; }
}

.tile { border-radius: clamp(8px, 1vw, 14px); overflow: hidden; min-height: 0; box-shadow: 0 10px 24px -18px rgba(0,0,0,.55); }
.tile-img { background: linear-gradient(150deg, var(--blush), var(--peach)); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s ease; }
.tile-img:hover img { transform: scale(1.06); }
/* change or remove a picture: shown on hover (always on touch screens) */
.tile-img { position: relative; }
.tile-act {
  position: absolute; top: 6px; border: 0; cursor: pointer; opacity: 0; transition: opacity .2s;
  font: 12px var(--body); color: var(--cocoa); background: rgba(255,255,255,.85); border-radius: 999px;
}
.tile-change { left: 6px; padding: 4px 10px; }
.tile-x { right: 6px; width: 24px; height: 24px; font-size: 16px; line-height: 1; }
.tile-img:hover .tile-act { opacity: 1; }
@media (hover: none) { .tile-act { opacity: 1; } }
.tile-add {
  display: grid; place-items: center; cursor: pointer; font-size: 28px; color: var(--mauve);
  border: 1.5px dashed rgba(165,115,138,.5); background: rgba(255,255,255,.35); box-shadow: none;
}

.tile-text { display: grid; align-items: center; padding: clamp(10px, 1.4vw, 20px); }
.tile-text h3 {
  font-family: var(--display); font-weight: 400; font-size: clamp(13px, 1.55vw, 23px);
  margin: 0; line-height: 1.14; color: #fff;
  text-shadow: 0 1px 14px rgba(0,0,0,.35);
}

/* ── today ───────────────────────────────────────────── */
/* ── tasks page — the day column runs the full height ── */
#view-tasks { grid-template-rows: minmax(0, 1fr); }
.tasks-title { min-width: 0; }
.tasks-title .display { font-size: clamp(26px, 3.4vw, 42px); }
.tasks-title .eyebrow { margin-bottom: 5px; }
.daynav { display: flex; align-items: center; gap: 6px; }
.daynav button {
  font: inherit; font-size: 17px; line-height: 1; color: var(--mauve);
  background: rgba(255,255,255,.6); border: 1px solid var(--line);
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; padding: 0;
}
.daynav button:hover:not(:disabled) { background: var(--mauve); color: #fff; border-color: transparent; }
.daynav button:disabled { opacity: .3; cursor: default; }

.streak-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 10px 0 16px; }
.streak-line .progress { width: clamp(70px, 12vw, 150px); flex: none; }
.progress-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.week-dots { display: flex; gap: 6px; }
.week-dots span {
  width: 20px; text-align: center; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.week-dots i {
  display: block; width: 14px; height: 14px; margin: 3px auto 0; border-radius: 50%;
  border: 1.5px solid var(--line); background: rgba(255,255,255,.5);
}
.week-dots i.full { background: var(--fill); border-color: transparent; }
.week-dots i.part { background: linear-gradient(135deg, var(--blush), var(--peach)); border-color: transparent; }

/* ── planner ─────────────────────────────────────────── */
.planner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(14px, 2.2vw, 30px); min-height: 0;
}
@media (max-width: 860px) { .planner { grid-template-columns: 1fr; } }

/* each column scrolls inside itself, so the page holds to one screen. .col-left uses flex (not a
   fixed-count grid-template-rows) specifically because its child count isn't constant — the coach's
   nudge card shows/hides depending on whether there's anything useful to say — so the one flexible/scrollable
   child (#unplanned, via flex:1 below) stays correct regardless of how many siblings exist. */
.col-left { display: flex; flex-direction: column; min-height: 0; }
.col-right { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.col-left > .items { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px; align-content: start; }
.col-left > *:not(.items) { flex-shrink: 0; }
.col-right > .timeline { min-height: 0; }
@media (max-width: 860px) {
  .col-left, .col-right { display: block; }
  .col-left > .items { overflow: visible; }
}

.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.items .empty { font-size: 14px; color: var(--muted); font-style: italic; padding: 14px 4px; }

.item {
  display: flex; align-items: center; gap: 13px; cursor: grab;
  padding: 10px 16px; border-radius: 15px;
  background: var(--card); border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 10px 30px -22px rgba(0,0,0,.5);
  transition: transform .22s, opacity .22s, box-shadow .22s;
}
.item:hover { transform: translateX(3px); }
.item.kind-task { border-left: 3px solid var(--rose); }
/* what another tab planned for the day — the training, the meals, the supplements: a reminder,
   moved like anything else, ticked off where it lives */
.item.kind-plan { border-left: 3px solid var(--peach); padding-left: 14px; }
.item.kind-plan .txt b { font-weight: 400; }
/* her calendar: fixed, read-only, quieter than her own items — dashed, as in the app */
.item.kind-cal { background: rgba(255,255,255,.32); border: 1px dashed rgba(17,17,17,.38); box-shadow: none; cursor: default; }
/* an invitation from Social: dashed like the calendar, in the rose of Social, and it opens */
.item.kind-invite { background: rgba(17,17,17,.16); border: 1px dashed var(--rose); box-shadow: none; cursor: pointer; }
.item.kind-cal:hover { transform: none; }
.item.kind-cal .txt b { font-weight: 400; color: var(--mocha); }
.item.overdue { border-left-color: #B4433F; }
.item.dragging { opacity: .4; cursor: grabbing; }
.item.held { box-shadow: 0 0 0 2px var(--mauve), 0 14px 34px -20px rgba(0,0,0,.6); }

/* The day column, laid out exactly like the app's: an hour holding anything opens up so its
   quarter-hour lines are readable, an empty one stays compact, and a placed item sits at its own
   minute and is as tall as it is long — 09:45 for 45 minutes looks like 09:45 for 45 minutes. */
.timeline { height: 100%; overflow-y: auto; }
@media (max-width: 860px) { .timeline { height: auto; overflow: visible; } .timeline-inner { padding-bottom: 0 !important; } }
/* room after the last hour, so the hour you are in can sit at the top even late in the day */
.timeline-inner { position: relative; box-sizing: content-box; padding-bottom: calc(var(--vh, 100vh) - var(--topbar, 90px) - 120px); }
.slot {
  position: absolute; left: 0; right: 0;
  padding: 0 10px; border-radius: 11px;
  border: 1px dashed transparent; transition: background .2s, border-color .2s;
}
.slot:nth-child(odd) { background: rgba(255,255,255,.34); }
.slot .hour { position: absolute; top: 4px; left: 10px; font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.draw-new { position: absolute; left: 56px; right: 10px; z-index: 3; border-radius: 12px; background: rgba(143,99,80,.18); border: 1px dashed rgba(143,99,80,.6); font-size: 12px; color: var(--muted); padding: 4px 10px; pointer-events: none; }
#timeline .slot { cursor: cell; }
.slot .items { display: block; position: absolute; inset: 0 10px 0 56px; }
.slot .item {
  position: absolute; left: 0; right: 0; z-index: 2;
  align-items: flex-start; padding: 5px 12px; gap: 9px; overflow: hidden;
}
/* the time, the length and the × stay on the right of the first line, the × right beside them */
.slot .item .at, .slot .item .dur, .slot .item .task-del { align-self: flex-start; margin-top: 2px; }
.slot .item .task-del { padding: 0 2px; }
.slot .item .txt b { font-size: 16px; }
.slot .item .box { width: 22px; height: 22px; }
/* Sharing an hour with something else: the name and the time survive, the rest goes. */
.slot .item.is-narrow { padding: 4px 9px; gap: 6px; }
.slot .item.is-narrow .box { width: 17px; height: 17px; }
.slot .item.is-narrow .box svg { width: 10px; height: 10px; }
.slot .item.is-narrow .txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .item.is-narrow .txt span, .slot .item.is-narrow .resize-handle { display: none; }
.slot .item.is-narrow .dur { padding: 1px 7px; font-size: 10px; }
.slot .item.is-narrow .at { font-size: 10px; padding: 1px 0; }
.slot .item .txt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot.over { background: rgba(17,17,17,.24); border-color: var(--mauve); }

/* Quarter-hour guide lines — the four marks inside an hour, as on the app's timeline. An hour
   with something in it shows them all the time (so a 16:30 start is visibly 16:30); an empty one
   only shows them while something is being dragged over it. drop-line is the darker, precise
   indicator of exactly where the item will land, positioned by JS as the drag moves. */
.slot-guides { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s; }
.slot.over .slot-guides, .slot.is-open .slot-guides { opacity: 1; }
.slot-guides .drop-line { display: none; }
.slot.over .slot-guides .drop-line { display: flex; }
.slot-guides .qline { position: absolute; left: 56px; right: 10px; height: 1px; background: rgba(17,17,17,.16); }
.slot-guides .qline[style*="50%"] { background: rgba(17,17,17,.24); }
.slot-guides .drop-line {
  position: absolute; left: 56px; right: 10px; align-items: center; gap: 6px;
  transform: translateY(-50%);
}
.slot-guides .drop-line::after { content: ''; flex: 1; height: 2px; border-radius: 1px; background: var(--mauve); }
.slot-guides .drop-line b { font-size: 10px; font-weight: 700; color: var(--mauve); }

/* Stretching: the chip on a placed item adds an hour per tap, and every hour it
   now covers shows a faint strip so the day reads as blocked out, not free. */
.item .dur {
  margin-left: auto; flex: none; font: inherit; font-size: 11px; letter-spacing: .06em;
  color: var(--muted); background: rgba(255,255,255,.66);
  border: 1px solid rgba(17,17,17,.22); border-radius: 999px;
  padding: 2px 9px; cursor: pointer; transition: color .2s, border-color .2s;
}
.item .dur:hover { color: var(--ink); border-color: var(--mauve); }
.item.done .dur { opacity: .5; }
.item .task-del {
  margin-left: auto; flex: none; font-size: 17px; line-height: 1; color: var(--mocha); opacity: .45;
  background: none; border: 0; cursor: pointer; padding: 0 4px;
}
.item .dur + .task-del { margin-left: 0; }
.item .task-del:hover { opacity: 1; }
/* The same box as the duration pill next to it (padding and border included, just invisible),
   so the two read as one line instead of the time floating a couple of pixels high. */
.item .at {
  margin-left: auto; flex: none; font-size: 11px; letter-spacing: .06em; color: var(--mauve);
  padding: 2px 0; border: 1px solid transparent;
}
.item .at + .dur { margin-left: -2px; }
/* while an item is held, show every slot as a target */
body.placing .slot { border-color: rgba(17,17,17,.22); }
body.placing #unplanned { outline: 1px dashed rgba(17,17,17,.22); outline-offset: 8px; border-radius: 18px; }

/* one row, every control the same height and the same pill shape as Add */
.add-task { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.add-task > * { flex: 1 1 108px; min-width: 0; }
.add-task input, .add-task select, .add-task button { height: 44px; padding-block: 0; }
.add-task select {
  font-family: var(--body); font-size: 15px; color: var(--ink);
  padding: 13px 18px; border-radius: 999px;
  border: 1px solid rgba(17,17,17,.2); background: rgba(255,255,255,.7);
}
.add-task button {
  font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  border-radius: 999px; border: 0; cursor: pointer; color: #fff; padding-inline: 22px;
  background: var(--fill);
}
.add-task button:hover { opacity: .9; }

.box {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid rgba(17,17,17,.35); display: grid; place-items: center;
  transition: .28s;
}
.box svg { width: 15px; height: 15px; opacity: 0; transform: scale(.5); transition: .28s; }
.box svg path { stroke: #fff; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.item .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item .txt b { font-family: var(--display); font-weight: 400; font-size: 19px; transition: .28s; }
.item .txt span { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

.item.done { background: linear-gradient(100deg, rgba(17,17,17,.2), rgba(17,17,17,.18)); }
.item.done .box { background: var(--fill); border-color: transparent; }
.item.done .box svg { opacity: 1; transform: scale(1); }
.item.done .txt b { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(17,17,17,.4); }

.progress-wrap { margin-top: 26px; display: flex; align-items: center; gap: 14px; }
.progress { flex: 1; height: 6px; border-radius: 99px; background: rgba(17,17,17,.14); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--peach), var(--mauve)); transition: width .5s cubic-bezier(.4,0,.2,1); }
.progress-wrap span { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }


/* ── training — a whole session at a glance ──────────── */
#view-training { grid-template-rows: auto minmax(0, 1fr); }
.training-head .eyebrow { margin-bottom: 4px; }
.training-head .display { font-size: clamp(26px, 3.6vw, 42px); margin: 0 0 14px; }

.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (max-width: 640px) { .weekstrip { grid-template-columns: repeat(4, 1fr); } }
.daybtn {
  font-family: var(--body); cursor: pointer; text-align: left;
  padding: 9px 12px; border-radius: 13px; border: 1px solid rgba(255,255,255,.7);
  background: var(--card); color: var(--ink); transition: .28s;
  box-shadow: 0 10px 26px -22px rgba(0,0,0,.5);
}
.daybtn:hover { transform: translateY(-2px); }
.daybtn { text-align: center; }
.daybtn b { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mauve); margin-bottom: 3px; font-weight: 400; }
.daybtn span { display: block; font-family: var(--display); font-size: clamp(18px, 1.8vw, 24px); line-height: 1.1; }
.daybtn.is-today { border-color: var(--tan); }
.daybtn.is-active { background: linear-gradient(140deg, var(--mauve), var(--tan)); border-color: transparent; }
.daybtn.is-active b, .daybtn.is-active span { color: #fff; }


#session { min-height: 0; }
.session {
  height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr);
  padding: clamp(12px, 1.8vw, 22px); border-radius: var(--radius);
  background: var(--card); border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow); animation: rise .4s ease both;
}
.session > header { margin-bottom: 12px; }
/* the day's photo heads the card, the name, subtitle and duration at its top-left like the app */
.session-hero {
  position: relative; min-height: 150px; margin-bottom: 14px; padding: 16px 18px; border-radius: 18px;
  background-size: cover; background-position: center;
}
.session-hero::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,255,255,.85), rgba(255,255,255,0) 60%);
}
.session-hero > * { position: relative; max-width: 70%; }
.duration-chip {
  display: inline-block; margin-top: 6px; padding: 3px 12px; border-radius: 999px; font-size: 13px;
  color: var(--cocoa); border: 1px solid rgba(0,0,0,.35); background: rgba(255,255,255,.55);
}
.session h2 { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3vw, 34px); margin: 0 0 3px; }
.session .meta { margin: 0 0 4px; font-size: 12px; letter-spacing: .13em; text-transform: uppercase; color: var(--mocha); }
/* What to get out before starting — one chip per prop, big enough to read across the room. */
.session .props {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none;
  margin: 0 0 14px; padding: 0 0 12px; border-bottom: 1px solid var(--line);
}
.session .props b {
  font-family: var(--body); font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mauve); margin-right: 2px;
}
.session .props li {
  font-size: 14px; color: var(--cocoa); padding: 6px 14px; border-radius: 999px;
  background: rgba(17,17,17,.14); border: 1px solid rgba(17,17,17,.12);
}
.start-workout-btn {
  display: block; width: 100%; max-width: 320px; height: 52px; border-radius: 999px; border: 0;
  cursor: pointer; color: #fff; font-family: var(--body); font-size: 15px;
  background: #A5738A;   /* the app's Start workout */
}
.start-workout-btn:hover { opacity: .92; }

/* ── training: the week, and the workbook ───────────── */
.training-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.training-head .display { margin: 0; }
.train-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
@media (max-width: 1000px) { .train-board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 620px) { .train-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.train-day {
  display: flex; flex-direction: column; gap: 8px; min-height: 236px; padding: 12px;
  border-radius: 22px; background: var(--card); border: 1px solid rgba(255,255,255,.7); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.train-day.is-today { box-shadow: 0 0 0 1.5px var(--rose), var(--shadow); }
.train-day header b { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--mauve); font-weight: 400; }
.train-day header span { font-family: var(--display); font-size: 26px; line-height: 1.1; color: var(--cocoa); }
/* a workout: its picture, or the colour of its kind, with the name over a soft shade */
.tc-0, .tc--1 { --c1: #8F6350; --c2: #A5738A; }
.tc-1 { --c1: #C9C4BD; --c2: #A5738A; }
.tc-2 { --c1: #B79AB8; --c2: #8E7FA0; }
.tc-3 { --c1: #8F6350; --c2: #111111; }
.tc-4 { --c1: #B9A07E; --c2: #9C7E96; }
.train-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  min-height: 124px; padding: 12px; border: 0; border-radius: 16px; overflow: hidden;
  cursor: pointer; text-align: left; color: #fff; font-family: var(--body);
  background: linear-gradient(180deg, rgba(17,17,17,.05) 20%, rgba(17,17,17,.72)),
              var(--img, none) center / cover, linear-gradient(150deg, var(--c1), var(--c2));
  box-shadow: 0 14px 30px -18px rgba(17,17,17,.65);
  transition: transform .35s cubic-bezier(.2,.9,.3,1.2), box-shadow .35s;
}
.train-card:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -20px rgba(17,17,17,.7); }
.train-card i { font-style: normal; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; opacity: .88; }
.train-card b { font-family: var(--display); font-weight: 400; font-size: 17px; line-height: 1.15; }
.train-card small { font-size: 11px; opacity: .88; }
.train-add {
  margin-top: auto; height: 34px; border-radius: 999px; cursor: pointer; font-size: 18px; line-height: 1;
  color: var(--mocha); background: none; border: 1px dashed rgba(17,17,17,.3); transition: .25s;
}
.train-add:hover { border-color: var(--mauve); background: rgba(255,255,255,.55); }
.train-book .box-head { flex-wrap: wrap; }
.train-book .chips { margin: 0; }
.train-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.train-grid .train-card { min-height: 178px; }
.train-grid .train-card b { font-size: 21px; }
/* the session on glass, and the picker */
.glass-card.train-sheet { width: min(1180px, 100%); position: relative; }
.train-sheet .session { height: auto; padding: 0; background: none; border: 0; box-shadow: none; animation: none; }
/* the photo across the top, then what to get out beside Start workout */
.train-sheet .session > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 18px; margin-bottom: 16px; }
.train-sheet .session-hero { grid-column: 1 / -1; min-height: 190px; margin-right: 52px; }
.train-sheet .session .props { margin: 0; padding: 0; border: 0; }
.train-sheet .start-workout-btn { width: 260px; }
.train-sheet .block { overflow: visible; }
.train-sheet .block h3 { position: static; background: none; }
.train-sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.train-sheet-foot .eyebrow { margin: 0 6px 0 0; }
.train-sheet-foot .chip { padding: 6px 12px; }
.sheet-x {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 0; cursor: pointer; font-size: 24px; line-height: 1; color: var(--mocha); background: rgba(255,255,255,.55);
}
/* the workout being dragged out of the workbook, and the day it would land on */
.train-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: .92; aspect-ratio: auto !important; min-height: 140px; border-radius: 22px !important; }
.train-ghost .pill, .train-ghost em { display: none; }
body.train-dragging { user-select: none; cursor: grabbing; }
.train-day.over { box-shadow: 0 0 0 2px var(--mauve), var(--shadow); transform: translateY(-3px); }
/* a workout on a day, and the × that takes it off */
.train-slot { position: relative; }
.train-slot .train-card { width: 100%; }
.train-del {
  position: absolute; top: 7px; right: 7px; width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 15px; line-height: 1; color: #fff; background: rgba(17,17,17,.38); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s, background .2s;
}
.train-slot:hover .train-del, .train-del:focus-visible { opacity: 1; }
.train-del:hover { background: rgba(17,17,17,.62); }
@media (hover: none) { .train-del { opacity: 1; } }
.train-grid .train-card { cursor: grab; }
.add-form .optional { letter-spacing: normal; text-transform: none; font-size: 12px; color: var(--muted); opacity: .8; }
.sheet-x:hover { background: var(--fill); color: #fff; }
.glass-card.train-pick { position: relative; width: min(520px, 100%); }
.pick-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick-kinds button {
  padding: 26px 12px; border-radius: 20px; cursor: pointer; font-family: var(--display); font-size: 22px; color: var(--cocoa);
  border: 1px solid var(--line); background: rgba(255,255,255,.6); transition: border-color .2s, transform .3s;
}
.pick-kinds button:hover { border-color: var(--mauve); transform: translateY(-2px); }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-height: 360px; overflow-y: auto; padding: 2px; }
.pick-thumb {
  display: flex; flex-direction: column; gap: 4px; padding: 6px 6px 8px; text-align: left; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.6); color: var(--cocoa); font-family: var(--body);
}
.pick-thumb:hover { border-color: var(--mauve); }
.pick-thumb .thumb { aspect-ratio: 4 / 3; border-radius: 10px; background: linear-gradient(150deg, #8F6350, #A5738A) center / cover; }
.pick-thumb b { font-family: var(--display); font-weight: 400; font-size: 14px; line-height: 1.2; }
.pick-thumb small { font-size: 11px; color: var(--muted); }
.pick-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.train-pick .pick-step[hidden], .train-pick .add-form [hidden] { display: none; }

/* ── workout runner overlay ───────────────────────────── */
.workout-card { width: 100%; max-width: 400px; position: relative; }
/* Same head as the app's runner: close on the left, the session's name centred. */
.workout-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.workout-head h3 { flex: 1; margin: 0; text-align: center; font-size: 19px; font-weight: 400; }
.workout-card .workout-x {
  font: inherit; font-size: 15px; line-height: 1; color: var(--mocha); opacity: .6;
  background: none; border: 0; box-shadow: none; cursor: pointer; padding: 2px 4px; width: 26px;
}
.workout-card .workout-x:hover { opacity: 1; }
/* Reps on the left of the divider, the round being worked on the right. */
.workout-reps-pill {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 0 0 16px; padding: 11px 18px; border-radius: 999px;
  background: rgba(17,17,17,.16);
  font-family: var(--display); font-size: 17px; color: var(--mauve);
}
.workout-reps-pill.has-rounds #workout-round {
  font-family: var(--body); font-size: 13px; color: var(--cocoa);
  border-left: 1px solid rgba(17,17,17,.22); padding-left: 14px;
}

/* Confetti — a handful of falling strips, built and thrown away by confetti() in app.js. */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.confetti i {
  position: absolute; top: -14px; width: 7px; height: 12px; border-radius: 1px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(420px) rotate(540deg); opacity: 0; }
}
.workout-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 8px; }
.workout-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(17,17,17,.2); }
.workout-dot.is-done, .workout-dot.is-current { background: var(--mauve); }
.workout-count { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.workout-block-pill {
  display: inline-block; margin: 0 0 18px; padding: 5px 14px; border-radius: 999px;
  background: rgba(17,17,17,.18); color: var(--mauve); font-size: 10px; letter-spacing: .15em;
  font-weight: 700;
}
.workout-sketch { display: block; width: 100%; max-width: 220px; height: auto; margin: 0 auto 14px; }
.workout-sketch[hidden] { display: none; }
.workout-card #workout-name { margin: 0 0 6px; font-size: clamp(24px, 4vw, 30px); }
.workout-card #workout-detail { margin: 0 0 16px; font-size: 14px; color: var(--muted); font-style: normal; }
.workout-actions { display: grid; gap: 10px; margin-bottom: 6px; }
.workout-card .workout-complete-btn {
  width: 100%; height: 52px; padding: 0; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  font-family: var(--body); font-size: 13px; letter-spacing: .2em;
  background: var(--fill);
}
.workout-complete-btn:hover { opacity: .92; }
#workout-finished { text-align: center; position: relative; padding: 18px 0 4px; }
#workout-finished .account-email { font-family: var(--display); font-size: 24px; line-height: 1.25; color: var(--mauve); margin-top: 14px; }
#workout-finished .workout-complete-btn { width: 100%; margin-top: 16px; }

/* blocks side by side — a whole session readable without scrolling */
.blocks {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: clamp(12px, 1.8vw, 26px); min-height: 0;
}
@media (max-width: 900px) {
  .blocks { grid-auto-flow: row; grid-auto-columns: auto; overflow-y: auto; }
}
.block { min-height: 0; overflow-y: auto; padding-right: 4px; }
.block h3 {
  font-family: var(--display); font-weight: 400; font-size: clamp(14px, 1.4vw, 18px);
  margin: 0 0 2px; color: var(--cocoa);
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: linear-gradient(#FFFFFF, #FFFFFF 80%, transparent);
}
.block .blocknote { font-size: 11px; color: var(--muted); margin: 6px 0 0; font-style: italic; line-height: 1.35; }
/* side by side, a title on two lines must not push its list below its neighbours': the titles
   share one row, the notes the next, the lists the third */
@media (min-width: 901px) {
  .blocks { grid-template-rows: auto auto minmax(0, 1fr); row-gap: 0; }
  .block { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 0; }
  .block h3 { grid-row: 1; display: flex; align-items: flex-end; }
  .block .blocknote { grid-row: 2; }
  .block ol { grid-row: 3; }
}
.block ol { list-style: none; margin: 4px 0 0; padding: 0; }
.ex {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid rgba(17,17,17,.08); cursor: pointer;
}
.ex:hover .name { color: var(--mauve); }
.ex .sketch {
  flex: none; width: 30px; height: 26px; object-fit: contain;
  border-radius: 7px; background: rgba(255,255,255,.55);
}
.ex .name { flex: 1; }

/* heading, reps, then the instruction and the tools — no picture; the list already shows it */
.ex-card #ex-instruction, .ex-card #ex-tools-wrap { text-align: left; margin: 0 0 18px; }
.ex-card #ex-instruction[hidden], .ex-card #ex-tools-wrap[hidden] { display: none; }
.ex-card .eyebrow { margin: 0 0 6px; }
.ex-card #ex-detail { margin: 0; font-size: 15px; line-height: 1.5; }
.ex-card #ex-tools { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.ex-card #ex-tools li { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: rgba(17,17,17,.18); color: var(--cocoa); }
.ex-card .display { font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 6px; }
.ex-card .ex-reps {
  font-family: var(--display); font-size: 20px; color: var(--mauve); font-style: normal; margin: 0 0 10px;
}
.ex:last-child { border-bottom: 0; }
.ex .name { font-size: clamp(12px, 1.1vw, 14px); line-height: 1.24; }
.ex .name em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 1px; line-height: 1.28; }
.ex .reps {
  flex: none; font-family: var(--display); font-size: 13px; color: var(--mauve); white-space: nowrap;
}

/* Five blocks means five narrow columns; the cues wrap too far to fit. Tap the exercise
   for the sketch and its cue instead. */
.blocks.dense .ex .name em, .blocks.dense .blocknote { display: none; }

/* On a short screen the coaching cues are the first thing to go — the exercise, the sets
   and the reps always stay. Hover an exercise to read its cue. */
@media (min-width: 861px) and (max-height: 820px) {
  .ex .name em { display: none; }
  .ex { padding: 4px 0; }
  .ex .sketch { width: 26px; height: 22px; }
  .block .blocknote { display: none; }
}

/* ── a tracked debt or savings goal — shown on the Debt and Savings sheets ── */
.empty { color: var(--muted); font-style: italic; padding: 20px 0; }

.debt {
  padding: 13px 20px; border-radius: 17px; margin-bottom: 9px;
  background: var(--card); border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 10px 30px -22px rgba(0,0,0,.5);
}
.debt.cleared { background: linear-gradient(110deg, rgba(17,17,17,.24), rgba(17,17,17,.2)); }
.debt header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.debt h3 { font-family: var(--display); font-weight: 400; font-size: 19px; margin: 0; }
.debt .left { font-family: var(--display); font-size: 19px; color: var(--cocoa); white-space: nowrap; }
.debt .left small { font-family: var(--body); font-size: 12px; color: var(--muted); }
.debt .progress { height: 7px; }
.debt footer { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.debt .pct { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--mauve); }
.debt .cleared-tag { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--mocha); }
.debt .pay { display: flex; gap: 8px; margin-left: auto; }
.debt .remove {
  margin-left: auto; font-size: 22px; line-height: 1; color: var(--muted);
  background: none; border: 0; cursor: pointer; padding: 0 6px;
}
.debt .pay ~ .remove { margin-left: 0; }
.debt .remove:hover { color: var(--mauve); }
/* asking which debt a statement line pays */
.glass-card.pick { width: min(420px, 100%); text-align: left; }
.glass-card.pick .display { font-size: 22px; margin: 2px 0 18px; }
.pick-list { display: grid; gap: 8px; margin-bottom: 16px; }
button.pick {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255,255,255,.5); font-family: var(--body); font-size: 15px; color: var(--ink);
  cursor: pointer; text-align: left;
}
button.pick:hover { border-color: var(--rose); background: rgba(255,255,255,.8); }
button.pick small { font-size: 12px; color: var(--muted); white-space: nowrap; }
/* the ones already paid off: out of the list, one line away */
.debt-done { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
/* what is paid of what is owed, under the name */
.debt .of { margin: 2px 0 10px; font-size: 13px; color: var(--muted); }
.debt .left { font-size: 13px; color: var(--muted); display: inline-flex; align-items: baseline; gap: 3px; }
.debt .left input.num { max-width: none; min-width: 0; text-align: right; font-family: var(--display); font-size: 19px; color: var(--cocoa); }
.debt .pencil { color: var(--muted); }
/* the card picked up to be dragged into a new payoff order */
.debt.sorting { opacity: .55; outline: 2px solid var(--mauve); outline-offset: -2px; cursor: grabbing; }
/* the due date on a line a card stands behind — set, so it reads as text, not a field */
.rows .due { color: var(--muted); }
/* paid this month — a statement line was filed against it */


input[type="text"], input[type="number"], input[type="date"], .add-task input, .add-row input, .debt .pay input,
.add-form input, .add-form select {
  font-family: var(--body); font-size: 15px; color: var(--ink);
  padding: 13px 18px; border-radius: 999px;
  border: 1px solid rgba(17,17,17,.2); background: rgba(255,255,255,.7);
}
.debt .pay input { width: 130px; padding: 9px 16px; font-size: 14px; }
input:focus { outline: 2px solid var(--rose); outline-offset: 1px; }

.debt .pay button {
  font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  padding: 13px 30px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  background: var(--fill);
}
.debt .pay button { padding: 9px 20px; }
.debt .pay button:hover { opacity: .9; }

/* ── finances — a month on one page ──────────────────── */
.bud-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.bud-top .display { font-size: clamp(26px, 3.4vw, 42px); }
.bud-top .eyebrow { margin-bottom: 5px; }

.monthpick { display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.55); border: 1px solid var(--line); }
.monthpick span { font-family: var(--display); font-size: 19px; color: var(--cocoa); min-width: 8.5em; text-align: center; }
.monthpick button {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 21px; line-height: 1; color: var(--mocha); background: rgba(255,255,255,.75);
}
.monthpick button:hover { background: var(--fill); color: #fff; }

/* five cards, one shape: heading, figure, note — the same colour throughout, red only when over */
.bud-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1080px) { .bud-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bud-stats .stat {
  display: block; width: 100%; text-align: left; font-family: var(--body); color: var(--ink);
  padding: 14px 20px; border-radius: 20px;
  background: linear-gradient(130deg, rgba(255,255,255,.72), rgba(17,17,17,.22));
  border: 1px solid rgba(255,255,255,.75); box-shadow: var(--shadow);
}
.bud-stats button.stat { cursor: pointer; }
.bud-stats small { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.bud-stats b { display: block; margin: 2px 0 1px; font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.4vw, 30px); color: var(--cocoa); }
.bud-stats .is-over b { color: #B5654A; }
.bud-stats .planned { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card {
  padding: 20px 22px; border-radius: var(--radius); margin-bottom: 16px;
  background: var(--card); border: 1px solid rgba(255,255,255,.7); box-shadow: var(--shadow);
  min-width: 0;
}
.card .group-title { margin-bottom: 14px; }

/* three columns, two rows: each card's top and bottom line up with its neighbours' */
.bud-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.bud-grid > .card { margin-bottom: 0; display: flex; flex-direction: column; }
@media (max-width: 1080px) { .bud-grid { grid-template-columns: 1fr; } }
/* fills the card so the three end level — but the rings keep their own grid */
.chart-card > div { flex: 1; }
.chart-card > div:not(.wheels) { display: flex; align-items: center; }
.chart-card .wheels { align-content: center; }

.chart { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; width: 100%; }
/* the ten-row legend reads better beside the donut than under it */
.chart.flip { flex-direction: row-reverse; }
.chart.flip .legend { flex: 1 1 170px; }
.pie { width: 148px; height: 148px; flex: none; filter: drop-shadow(0 10px 22px rgba(0,0,0,.18)); }
.pie-mid { font-family: var(--display); font-size: 11px; fill: var(--cocoa); text-anchor: middle; dominant-baseline: middle; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1 1 150px; min-width: 0; }
.legend li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend b { font-weight: 400; font-size: 13px; color: var(--cocoa); }
.legend em { font-style: normal; font-size: 11px; color: var(--muted); width: 3.2em; text-align: right; }
.legend .empty { color: var(--muted); font-style: italic; padding: 6px 0; }
.legend .opens { cursor: pointer; border-radius: 8px; margin: 0 -6px; padding-inline: 6px; transition: background .2s; }
.legend .opens:hover, .legend .opens:focus-visible { background: rgba(255,255,255,.65); outline: none; }
.pie .opens { cursor: pointer; transition: opacity .2s; }
.pie .opens:hover { opacity: .82; }

/* the three lines the wheels do not cover */
.flow { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 6px; }
.flow .track { width: 42%; }
.flow .track .progress { display: block; }

/* a budget that comes from a plan is set, not guessed — it reads as plain text, not as an input */
.from-plan { font-size: 13px; color: var(--ink); }
/* last month's spend was well off this plan — tap for the figure */
.rows.exp .hint-col { width: 18px; padding-inline: 0; text-align: center; }
/* the spend per day so far runs this category past its budget by month end */
.rows.exp tr.is-heading-over { background: rgba(181,101,74,.10); }
.rows.exp tr.is-heading-over:hover { background: rgba(181,101,74,.16); }
.hint-actions { display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; }
.account-card .hint-actions .account-close { display: inline-block; margin: 0; }
#hint-overlay .display { font-size: clamp(22px, 3vw, 28px); }
#hint-overlay #hint-ok { padding: 12px 26px; }
.hint-figs { margin: 4px 0 22px; font-size: 15px; }
.hint-figs tr:last-child th, .hint-figs tr:last-child td { font-weight: 700; border-top: 1px solid var(--line); }
.prev-hint { width: 18px; height: 18px; padding: 0; border-radius: 50%; cursor: pointer;
  font: 700 11px/18px var(--body); color: #fff; background: #B5654A; border: 0; vertical-align: middle;
}
.plan-open {
  font-family: var(--body); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  padding: 5px 13px; border-radius: 999px; cursor: pointer; color: var(--mocha);
  border: 1px solid rgba(17,17,17,.24); background: rgba(255,255,255,.5);
}
.plan-open:hover { background: var(--fill); color: #fff; border-color: transparent; }

/* sortable columns */
th.sorts { cursor: pointer; user-select: none; white-space: nowrap; }
th.sorts:hover { color: var(--cocoa); }
th.sorts.is-sorted { color: var(--mauve); }
th.sorts i { font-style: normal; padding-left: 4px; }

/* ── the wheels: one ring per category ───────────────── */
.wheels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; justify-items: center; }
.wheel svg { width: 100%; max-width: 104px; display: block; margin: 0 auto; }
.wheel-num { font-family: var(--display); font-size: 17px; fill: var(--cocoa); text-anchor: middle; }
.wheel-sub { font-size: 8px; letter-spacing: .18em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; }
.wheel.is-over .wheel-num { fill: #B5654A; }
.wheel p { margin: 4px 0 0; text-align: center; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ── the tables ──────────────────────────────────────── */
.cash, .rows {
  width: 100%; border-collapse: collapse; font-size: 13px;
  font-variant-numeric: tabular-nums;   /* so the columns line up digit by digit */
}
.legend, .bud-stats { font-variant-numeric: tabular-nums; }
.cash th, .cash td, .rows th, .rows td { padding: 6px 7px; text-align: right; vertical-align: middle; }
.cash thead th, .rows thead th {
  font-weight: 400; font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.cash tbody th, .rows tbody th, .cash thead th:first-child, .rows thead th:first-child,
.rows td:first-child, .cash tfoot th, .rows tfoot th { text-align: left; }
/* Budget sits against the category name, leaving air before Actual */
.rows.exp th:nth-child(2), .rows.exp td:nth-child(2), .rows.exp td:nth-child(2) input.num { text-align: left; }
.rows.exp td:nth-child(2) input.num { width: 64px; }
/* a long name gives way before the box scrolls: Transportation reads Transporta… at the narrowest */
.rows.exp tbody th:not([colspan]) { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bud-grid .rows.exp .plan-open { padding: 4px 7px; font-size: 9px; letter-spacing: .06em; }
.cash th, .cash td { padding-inline: 4px; }
.cash thead th { letter-spacing: .1em; }
.cash tbody th, .rows tbody th { font-weight: 400; font-size: 13px; color: var(--cocoa); white-space: nowrap; }
.cash tbody tr, .rows tbody tr { border-bottom: 1px solid rgba(17,17,17,.08); }
.cash .diff { color: var(--mocha); }
.cash .is-over .diff, .rows .is-over .actual { color: #B5654A; }
.cash tfoot th, .cash tfoot td {
  padding-top: 11px; border-top: 1px solid var(--line); white-space: nowrap;
  font-size: 14px; color: var(--cocoa);
}
.rows .actual { color: var(--cocoa); }
.rows tfoot th, .rows tfoot td {
  padding-top: 11px; border-top: 1px solid var(--line); white-space: nowrap;
  font-size: 14px; color: var(--cocoa);
}
.rows .empty { text-align: center; font-style: italic; color: var(--muted); padding: 16px 0; }
/* min widths keep a figure readable when three boxes share the row; the box
   scrolls sideways rather than crushing the name column to nothing */
#bud-income, #bud-debts, #bud-expenses, #bud-cash { overflow-x: auto; }
.rows:not(.tx) td:not(:first-child) { white-space: nowrap; }
/* a line the statements produced, not one she typed */
.rows .derived th, .rows .derived .actual { color: var(--mauve); }
.rows .derived th { font-style: italic; }

.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: baseline; }

/* in a table a figure should read as a figure — no pill, just the row line.
   The underline only appears under the pointer and while typing. */
/* beats the global pill rule for text/number/date inputs further up */
input.num, select.num {
  font-family: var(--body); font-size: 13px; color: var(--ink); width: 100%; max-width: 118px;
  padding: 5px 4px; text-align: right; min-width: 68px;
  border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: none;
  appearance: none; -webkit-appearance: none;
}
input.num:hover, select.num:hover { border-bottom-color: rgba(17,17,17,.28); }
input.num.wide { max-width: none; min-width: 90px; text-align: left; }
input[type="date"].num { min-width: 112px; max-width: 120px; }
input.num.tiny { max-width: 96px; }
/* the N of an every-N-months repeat, beside its dropdown */
input.num.months { width: 34px; min-width: 34px; text-align: center; }
/* Income shares its third of the row with four columns — a slimmer Repeat keeps the N in view */
.rows.inc select.num { width: auto; max-width: 92px; min-width: 0; }
.rows.inc input.num:not(.months):not(.wide) { min-width: 52px; }
/* the spinner arrows steal room the figures need and add nothing here */
.num[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.num[type="number"]::-webkit-outer-spin-button,
.num[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select.num {
  text-align: left; max-width: 124px; color: var(--muted); cursor: pointer; padding-right: 15px;
  /* appearance:none took the native caret; put a quiet one back so it still
     reads as something you can change */
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23907467' stroke-width='1.4' stroke-linecap='round'/></svg>") no-repeat right 2px center / 8px auto;
}
input.num:focus, select.num:focus { outline: 0; border-bottom-color: var(--rose); background: rgba(255,255,255,.55); }
.row-del { font-size: 19px; line-height: 1; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0 4px; }
.row-del:hover { color: var(--mauve); }

/* Income and Debt sit side by side; the ten expense categories read better
   across the full width than squeezed into a third of it */
/* the box title, and the + that opens its form on glass */
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card .box-head .group-title { margin: 0; }
.box-add {
  width: 32px; height: 32px; flex: none; border-radius: 50%; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--mocha);
  border: 1px solid rgba(17,17,17,.24); background: rgba(255,255,255,.55);
}
.box-add:hover { background: var(--fill); color: #fff; border-color: transparent; }
/* Fixed and Variable: the two parts of Expenses, each with what it adds up to */
.rows.exp tr.group th { padding-top: 14px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--mauve); }
.rows.exp tbody tr.group:first-child th { padding-top: 8px; }
.rows.exp tr.group { border-bottom-color: var(--line); }
/* the two parts' totals above the grand total, quieter, so the difference reads at a glance */
.rows.exp tr.part th, .rows.exp tr.part td { font-size: 13px; color: var(--mocha); font-weight: 600; border-top: 1px solid var(--line); }
/* Repeat reads from the left, under its heading, like the dropdown text does */
.rows.inc th:nth-child(3), .rows.inc td:nth-child(3) { text-align: left; }
/* a third of the page is not much, so the cells give up what they can spare */
.bud-grid th, .bud-grid td { padding: 5px 4px; }
/* no side padding, so a typed figure lines up with the printed ones and with its heading */
.bud-grid input.num, .bud-grid select.num { min-width: 0; padding: 5px 0; }
.bud-grid select.num { padding-right: 15px; }
.cash input.num { padding-inline: 0; }
.bud-grid input.num.wide { min-width: 62px; }
.bud-grid input[type="date"].num { min-width: 96px; max-width: 104px; }
.bud-grid select.num { max-width: 82px; }
.bud-grid .plan-open { padding: 4px 8px; letter-spacing: .08em; }
.bud-grid .cat-dot { margin-right: 5px; }

/* ── transactions ────────────────────────────────────── */
/* the list takes what the card has left beside Expenses, the add form stays at the bottom */
.tx-card #bud-tx { flex: 1; min-height: 0; display: flex; flex-direction: column; contain: size; }
.tx-card .tx-scroll { flex: 1; min-height: 0; max-height: none; }
.tx-card .tx-new-note { line-height: 18px; }
.tx-card .import { padding: 8px 16px; font-size: 10px; }
/* the new line on one row: small date, what, small amount, category, add */
.tx-card .add-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 56px 84px auto; gap: 4px; margin-top: 12px; align-items: center; }
.tx-card .add-row input, .tx-card .add-row select { min-width: 0; padding: 8px 9px; font-size: 12px; }
.tx-card .add-row input[name="date"] { font-size: 11px; padding-inline: 6px; color: var(--muted); }
.tx-card .add-row input[name="date"]::-webkit-calendar-picker-indicator { display: none; }
.tx-card .add-row input[name="amount"] { appearance: textfield; -moz-appearance: textfield; }
.tx-card .add-row input[name="amount"]::-webkit-outer-spin-button,
.tx-card .add-row input[name="amount"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tx-card .add-row select { appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 120px; }
.tx-card .add-row button { padding: 6px 11px; font-size: 16px; letter-spacing: 0; }
/* a category in the list is a plain word you click to change, no caret */
.tx-card .tx select.num { background: none; padding-right: 0; }
.tx-card .tx .date { white-space: nowrap; }
.rows .due { display: block; font-size: 11px; }
.rows th input.num.due { display: block; min-width: 0; max-width: 104px; font-size: 11px; color: var(--muted); }
#add-expense .kind-chips { display: flex; gap: 8px; }
#add-expense label[hidden] { display: none; }
.tx-card .tx select.num { width: 110px; max-width: none; }
.tx-card .tx .date { width: 40px; }
.rows th input.num.due { padding: 0; margin-top: 2px; }
#add-expense .kind-chips input { display: none; }
#add-expense .kind-chips .chip { cursor: pointer; }
#add-expense .kind-chips .chip:has(input:checked) { background: var(--fill); color: #fff; border-color: transparent; }
.import {
  font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  padding: 11px 26px; border-radius: 999px; cursor: pointer; color: #fff;
  background: var(--fill);
}
.import:hover { opacity: .9; }
.tx-scroll { max-height: 460px; overflow: auto; padding-right: 6px; }

.tx thead th:nth-child(2) { text-align: left; }
.tx .date { width: 96px; color: var(--muted); font-size: 12px; white-space: nowrap; text-align: left; }
.tx .desc { text-align: left; max-width: 1px; width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .amt { white-space: nowrap; }
.tx .amt.in { color: var(--mauve); }
.tx .is-transfer { opacity: .5; }
/* Just imported and not looked at yet — the category it guessed is still unconfirmed. */
.tx .is-new { background: rgba(192,145,113,.12); box-shadow: inset 3px 0 0 var(--tan); }
.tx-new-note { font-size: 12px; color: var(--muted); margin: 0 0 8px; }

/* The Category column's filter: a ▾ on the header and the tick list it opens. */
.tx-filter-btn {
  font: inherit; font-size: 10px; line-height: 1; color: var(--muted); cursor: pointer;
  background: none; border: 0; padding: 0 2px; margin-left: 4px;
}
.tx-filter-btn:hover, .tx-filter-btn.is-on { color: var(--mauve); }
.tx-filter-btn.is-on::after { content: '•'; margin-left: 2px; }
.tx-filter {
  position: fixed; z-index: 70; width: 200px; max-height: 320px; overflow-y: auto;
  padding: 10px; border-radius: 16px;
  background: rgba(255,255,255,.97); border: 1px solid rgba(17,17,17,.16);
  box-shadow: 0 24px 50px -20px rgba(0,0,0,.5);
}
.tx-filter[hidden] { display: none; }
.tx-filter-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 2px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.tx-filter-head b { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.tx-filter-head button {
  font: inherit; font-size: 11px; color: var(--mauve); background: none; border: 0;
  cursor: pointer; padding: 2px 4px;
}
.tx-filter-head button:hover { text-decoration: underline; }
.tx-filter label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 5px 6px; border-radius: 9px; font-size: 13px;
}
.tx-filter label:hover { background: rgba(17,17,17,.16); }
.tx-filter input { accent-color: var(--mauve); }
.linky { font: inherit; color: var(--mauve); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
/* an expense row is a way into its category, so it says so */
.rows tr.opens { cursor: pointer; }
.rows tr.opens:hover { background: rgba(17,17,17,.12); }

.add-row select, .bar select {
  font-family: var(--body); font-size: 15px; color: var(--ink);
  padding: 13px 18px; border-radius: 999px;
  border: 1px solid rgba(17,17,17,.2); background: rgba(255,255,255,.7);
}


.permonth { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.permonth input { text-align: right; max-width: none; min-width: 0; }
.foot-note { margin: 16px 0 0; font-size: 12px; font-style: italic; color: var(--muted); }
.glass-card .debt { background: rgba(255,255,255,.44); border-color: rgba(255,255,255,.7); }
.glass-card .debt footer { flex-wrap: wrap; }

/* ── the category planner, on glass ──────────────────── */
.glass-scrim {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(14px, 4vw, 44px);
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(3px);
  animation: rise .3s ease both;
}
/* display:flex above outranks the UA rule for [hidden], so say it here */
.glass-scrim[hidden] { display: none; }
/* Near enough to solid (93%) that a table of figures reads straight off it — the blur and the
   last 7% are what keep the page underneath present rather than gone */
.glass-card {
  width: min(860px, 100%); max-height: 100%; overflow-y: auto;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius);
  background: rgba(250,250,249,.97);   /* warm, not white: the sheet is part of the app */
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.55);
}
.glass-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.glass-card .display { font-size: clamp(26px, 3.4vw, 38px); }
.glass-card .eyebrow { margin-bottom: 4px; }
.glass-card .group-title { font-size: 19px; margin: 26px 0 10px; }
#cat-close, #add-close {
  width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--mocha); background: rgba(255,255,255,.55);
}
#cat-close:hover, #add-close:hover { background: var(--fill); color: #fff; }

.cat-figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .cat-figures { grid-template-columns: 1fr; } }
.cat-figures div {
  padding: 13px 18px; border-radius: 18px;
  background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.6);
}
.cat-figures b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(20px, 2.4vw, 27px); color: var(--cocoa); }
.cat-figures small { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.cat-figures .is-over b { color: #B5654A; }

.glass-card .rows tbody tr { border-bottom-color: rgba(17,17,17,.14); }
.glass-card input.num, .glass-card select.num { color: var(--ink); }
.glass-card input.num:focus, .glass-card select.num:focus { background: rgba(255,255,255,.7); }
.glass-card .add-row { margin: 16px 0 0; }
.cat-tx { max-height: 300px; overflow: auto; }

/* adding a line: one form on glass, the fields one under the other */
.glass-card.add-card { width: min(440px, 100%); }
.add-card header { margin-bottom: 14px; }
.add-form { display: grid; gap: 14px; }
.add-form[hidden] { display: none; }
.add-form label { display: grid; gap: 6px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.add-form input, .add-form select { width: 100%; letter-spacing: normal; text-transform: none; }
.add-form select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background: rgba(255,255,255,.7) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23907467' stroke-width='1.4' stroke-linecap='round'/></svg>") no-repeat right 18px center / 9px auto;
}
.add-note { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.add-form button[type="submit"] {
  justify-self: end; font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  padding: 12px 32px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  background: var(--fill);
}
.add-form button[type="submit"]:hover { opacity: .9; }

/* ── notes ───────────────────────────────────────────── */
#view-notes { grid-template-rows: auto minmax(0, 1fr); }
@media (max-width: 860px) { #view-notes.fit.is-active { height: auto; } }
.notes-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.notes-top .display { font-size: clamp(26px, 3.4vw, 42px); }
.notes-top .eyebrow { margin-bottom: 5px; }
#add-note {
  font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  padding: 13px 30px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  background: var(--fill);
}
#add-note:hover { opacity: .9; }

.notes-board {
  position: relative; min-height: 0; overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 1px 1px, rgba(17,17,17,.16) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(150deg, rgba(255,255,255,.5), rgba(17,17,17,.3));
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: var(--shadow);
}
@media (max-width: 860px) { .notes-board { height: 70vh; } }

.note {
  position: absolute; width: clamp(150px, 15vw, 200px); min-height: 130px;
  display: flex; flex-direction: column;
  border-radius: 4px 4px 3px 3px;
  box-shadow: 0 12px 26px -14px rgba(0,0,0,.55);
  transform: rotate(-1deg);
}
.note:nth-child(even) { transform: rotate(1.2deg); }
.note.dragging { transform: rotate(0deg) scale(1.03); box-shadow: 0 22px 44px -16px rgba(0,0,0,.6); z-index: 5; }
/* The app's five note colours. Two of them are dark enough that ink would disappear on them, so
   each tint carries its own text colour — same split the app makes off the colour's luminance. */
.note.tint0, .note-swatch.tint0, .note-edit-text.tint0 { background: #A17B6D; }
.note.tint1, .note-swatch.tint1, .note-edit-text.tint1 { background: #6F524A; }
.note.tint2, .note-swatch.tint2, .note-edit-text.tint2 { background: #F9D6C1; }
.note.tint3, .note-swatch.tint3, .note-edit-text.tint3 { background: #CDA998; }
.note.tint4, .note-swatch.tint4, .note-edit-text.tint4 { background: #A5738A; }
.note.tint0, .note.tint1, .note.tint4, .note-edit-text.tint0, .note-edit-text.tint1, .note-edit-text.tint4 { color: #fff; }
.note.tint2, .note.tint3, .note-edit-text.tint2, .note-edit-text.tint3 { color: #111111; }
.note-edit-text.tint0::placeholder, .note-edit-text.tint1::placeholder, .note-edit-text.tint4::placeholder { color: rgba(255,255,255,.7); }

/* the note editor: colour dots, the note itself to write on, Delete and Save */
.note-edit-colors { display: flex; gap: 10px; margin: -4px 0 14px; }
.note-swatch {
  width: 26px; height: 26px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid rgba(255,255,255,.9); box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.note-swatch.is-active { box-shadow: 0 0 0 2px var(--mauve); }
.overlay .note-edit-text {
  width: 100%; min-height: 180px; resize: vertical; border: 0; border-radius: 6px; padding: 16px 18px;
  font-family: var(--body); font-size: 16px; line-height: 1.5; outline: 0;
  box-shadow: 0 12px 26px -14px rgba(0,0,0,.55);
}
.note-edit-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.overlay-card .note-edit-del { background: none; color: #B4433F; padding: 14px 0; }
.overlay-card .note-swatch { padding: 0; flex: none; width: 26px; height: 26px; }
#note-edit-save { margin-left: auto; }
.note-text { cursor: pointer; }

.note header {
  display: flex; justify-content: space-between; align-items: center;
  height: 22px; padding: 0 4px; flex: none;
  cursor: grab; touch-action: none;              /* pointermove needs the gesture, not a scroll */
  border-radius: 4px 4px 0 0; background: rgba(255,255,255,.28);
}
.note.dragging header { cursor: grabbing; }

.note-text {
  flex: 1; padding: 8px 12px 12px; outline: 0; overflow-y: auto;
  font-family: var(--body); font-size: 14px; line-height: 1.42; color: inherit;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.note-text:empty::before { content: attr(data-placeholder); color: currentColor; opacity: .55; }

/* ── overlay ─────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: rgba(0,0,0,.34); backdrop-filter: blur(14px);
  animation: fade .4s ease both;
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.overlay-card {
  max-width: 520px; text-align: center; padding: clamp(32px, 6vw, 56px);
  border-radius: 34px; animation: pop .55s cubic-bezier(.2,.9,.3,1.3) both;
  background: linear-gradient(150deg, #FFFFFF, #F1F0EE 55%, #EAE8E5);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.6);
}
@keyframes pop { from { opacity: 0; transform: scale(.85) translateY(24px); } }
.overlay-card .display { font-size: clamp(28px, 5vw, 40px); margin: 20px 0 14px; color: var(--cocoa); }
.overlay-card p { margin: 0 0 16px; color: var(--mocha); font-size: 15px; line-height: 1.5; }
#overlay-sub { margin-bottom: 28px; font-style: italic; font-size: 17px; }
.overlay-card button {
  font-family: var(--body); font-size: 13px; letter-spacing: .2em; text-transform: uppercase;
  padding: 14px 38px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  background: var(--fill);
}
.overlay-card button:hover { opacity: .9; }

/* ── wardrobe ────────────────────────────────────────── */
#view-wardrobe .hero { margin-bottom: 20px; }
#view-wardrobe .hero .display { font-size: clamp(30px, 4.4vw, 52px); }

.palette { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); }

.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.subtab {
  font-family: var(--body); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 16px; cursor: pointer; margin-bottom: -1px;
}
.subtab:hover { color: var(--cocoa); }
.subtab.is-active { color: var(--cocoa); border-bottom-color: var(--mauve); }

#view-wardrobe .section { display: none; }
#view-wardrobe .section.is-active { display: block; animation: rise .4s ease both; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  font-family: var(--body); font-size: 13px; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; color: var(--mocha);
  background: rgba(255,255,255,.6); border: 1px solid var(--line);
}
.chip small { margin-left: 7px; opacity: .55; font-size: 11px; }
.chip:hover { border-color: var(--mauve); }
.chip.is-active { background: var(--fill); color: #fff; border-color: transparent; }

/* Every tile is the same box. Garments are trimmed to their subject on import, so `contain`
   now renders them all at the same apparent size instead of at whatever scale the PDF had. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
/* Care products run from wide palettes to long brushes, so a square frame with almost no
   padding gives every shape the most room — the whole product, as large as it can be. */
/* Care and wardrobe share the 4:5 frame — every picture is normalised to it on import,
   so the item sits at a consistent size with its own breathing room built in. */
.grid.care { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.piece {
  position: relative; margin: 0; aspect-ratio: 4/5; border-radius: 16px; overflow: hidden;
  background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 10px 26px -20px rgba(0,0,0,.5);
  display: grid; place-items: center; touch-action: none;
}
.piece img { width: 100%; height: 100%; object-fit: contain; }
.piece.sorting { opacity: .55; outline: 2px solid var(--mauve); outline-offset: -2px; cursor: grabbing; }
.piece .x, .look .x {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; cursor: pointer; font-size: 15px; line-height: 1; color: var(--cocoa);
  background: rgba(255,255,255,.85); opacity: 0; transition: opacity .2s;
}
.piece:hover .x, .look:hover .x { opacity: 1; }
.piece .repic { right: auto; left: 5px; font-size: 13px; }
@media (hover: none) { #wishlist-groups .x { opacity: .85; } }
.piece.pick { cursor: pointer; }
.piece.pick.on { outline: 2px solid var(--mauve); outline-offset: -2px; }

.wish-link a { display: grid; place-items: center; height: 100%; width: 100%; text-decoration: none; }
.wish-link .stub {
  font-family: var(--display); font-size: 15px; color: var(--mocha); padding: 14px; text-align: center;
}
.wish-link figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 7px 10px;
  font-size: 11px; color: var(--cocoa); background: rgba(255,255,255,.82);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.group { margin-bottom: 30px; }
.group-title {
  font-family: var(--display); font-weight: 400; font-size: 21px; margin: 0 0 12px; color: var(--cocoa);
}

.add-row { display: flex; gap: 9px; flex-wrap: wrap; margin: 22px 0; align-items: center; }
/* display:flex outranks the UA rule for [hidden], so say it here */
.add-row[hidden] { display: none; }
.add-row input, .add-row select { flex: 1 1 150px; }
.add-row button, .bar button {
  font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  padding: 13px 26px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  background: var(--fill);
}
.add-row button:hover, .bar button:hover { opacity: .9; }
.bar { margin-bottom: 20px; }

/* pinterest-style board */
.pinboard { columns: 5; column-gap: 12px; }
@media (max-width: 1100px) { .pinboard { columns: 4; } }
@media (max-width: 800px)  { .pinboard { columns: 3; } }
@media (max-width: 520px)  { .pinboard { columns: 2; } }
.look {
  position: relative; break-inside: avoid; margin: 0 0 12px; border-radius: 16px; overflow: hidden;
  cursor: pointer; background: rgba(255,255,255,.5);
  box-shadow: 0 12px 28px -20px rgba(0,0,0,.5); transition: box-shadow .3s;
}
/* a deeper shadow, not a lift: moving a card inside a CSS-columns pinboard makes Chrome and Safari
   repaint it white and flicker, and the lift could slide its edge out from under the pointer */
.look:hover { box-shadow: 0 18px 34px -18px rgba(0,0,0,.62); }
.look img { width: 100%; display: block; }
.look figcaption {
  position: absolute; left: 8px; bottom: 8px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,255,.85); color: var(--cocoa);
}

/* look overlay */
.look-card {
  max-width: 940px; width: 100%; text-align: left; position: relative;
  padding: clamp(20px, 3vw, 34px); border-radius: var(--radius);
  background: linear-gradient(150deg, #FFFFFF, #EFEDEA 60%, #E6E4E1);
}
.look-card .x {
  position: absolute; top: 12px; right: 14px; padding: 4px 8px; border: 0; cursor: pointer;
  font-size: 22px; line-height: 1; letter-spacing: 0; color: var(--cocoa); background: none;
}
.look-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; }
@media (max-width: 720px) { .look-body { grid-template-columns: 1fr; } }
.look-body > img {
  width: 100%; height: 54vh; object-fit: cover; object-position: center top;
  border-radius: 18px; display: block;
}
@media (max-width: 720px) { .look-body > img { height: 40vh; } }
.look-side .display { font-size: clamp(21px, 2.6vw, 27px); margin: 0 0 4px; color: var(--cocoa); }
.look-side .eyebrow { margin-bottom: 14px; }
.look-side .grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.look-side .piece img { padding: 6px; }
.look-hint { font-size: 13px; color: var(--muted); font-style: italic; margin: 8px 0 0; }
#look-edit, #look-save {
  font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  padding: 12px 26px; border-radius: 999px; border: 0; cursor: pointer; color: #fff; margin-top: 16px;
  background: var(--fill);
}
.look-picker { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.look-picker .grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }

/* ── capsule care: rating + note ─────────────────────── */
.piece.rateable { cursor: pointer; }
.piece .has-note {
  position: absolute; right: 8px; bottom: 8px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--mauve);
}

.care-card {
  max-width: 780px; width: 100%; text-align: left; position: relative;
  padding: clamp(20px, 3vw, 32px); border-radius: var(--radius);
  background: linear-gradient(150deg, #FFFFFF, #EFEDEA 60%, #E6E4E1);
}
/* just the ×: `.overlay-card button` padding stretched its bubble into an off-centre oval */
.care-card .x {
  position: absolute; top: 12px; right: 14px; padding: 4px 8px; border: 0; cursor: pointer;
  font-size: 22px; line-height: 1; letter-spacing: 0; color: var(--cocoa); background: none;
}
.care-body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 24px; align-items: start; }
@media (max-width: 640px) { .care-body { grid-template-columns: 1fr; } }
.care-body > img {
  width: 100%; height: 40vh; object-fit: contain; padding: 14px;
  background: rgba(255,255,255,.6); border-radius: 18px;
}
.care-side .display { font-size: clamp(21px, 2.6vw, 27px); margin: 0 0 12px; color: var(--cocoa); }

.stars { display: flex; align-items: center; gap: 3px; margin-bottom: 16px; }
.stars [data-star] {
  font-size: 26px; line-height: 1; background: none; border: 0; cursor: pointer; padding: 0 2px;
  color: rgba(17,17,17,.26); transition: color .15s, transform .15s;
}
.stars [data-star]:hover { transform: scale(1.12); }
.stars [data-star].on { color: var(--tan); }

#care-note {
  width: 100%; font-family: var(--body); font-size: 14px; line-height: 1.5; color: var(--ink);
  padding: 14px 16px; border-radius: 16px; resize: vertical;
  border: 1px solid rgba(17,17,17,.2); background: rgba(255,255,255,.72);
}
#care-note:focus { outline: 2px solid var(--rose); outline-offset: 1px; }

/* a sortable tile must not start a text selection or a native drag */
.piece.rateable { user-select: none; -webkit-user-drag: none; }

/* ── overlay fixes ───────────────────────────────────── */
/* Category chips inside an overlay were inheriting `.overlay-card button`, so every one
   looked selected. Restore the chip look and let only .is-active stand out. */
.overlay-card .chip {
  background: rgba(255,255,255,.62); color: var(--mocha);
  border: 1px solid var(--line); padding: 8px 16px;
  font-size: 13px; letter-spacing: normal; text-transform: none;
}
.overlay-card .chip.is-active {
  background: var(--fill); color: #fff; border-color: transparent;
}

/* The card, not the inner grid, is what scrolls — so a long category is fully reachable
   instead of being cut off at the bottom of the overlay. */
.overlay-card { max-height: 92vh; overflow-y: auto; }
.look-picker .grid { max-height: none; overflow: visible; }

/* ── seasons, packing ────────────────────────────────── */
.bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.chips.seasons { margin-bottom: 0; }

.packing { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(18px, 3vw, 34px); align-items: start; }
@media (max-width: 900px) { .packing { grid-template-columns: 1fr; } }
.packing-right {
  padding: 18px; border-radius: var(--radius);
  background: rgba(255,255,255,.45); border: 1px solid rgba(255,255,255,.7);
}
.packing-right .group-title { margin-bottom: 4px; }
.pinboard.small { columns: 3; column-gap: 10px; }
.pinboard.small .look { margin-bottom: 10px; }
.pinboard.tiny { columns: 4; column-gap: 7px; }
.pinboard.tiny .look { margin-bottom: 7px; border-radius: 10px; }
button.ghost {
  background: none !important; color: var(--muted) !important;
  border: 1px solid var(--line) !important;
}
button.ghost:hover { color: var(--mauve) !important; }

#pack-done {
  font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  padding: 12px 26px; border-radius: 999px; border: 0; cursor: pointer; color: #fff; margin-top: 16px;
  background: var(--fill);
}

/* the rating and the note sit below what the piece is worn with */
#worn-in, #goes-with { margin-bottom: 16px; }
#goes-with .grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 7px; }
.care-side .eyebrow { margin-bottom: 7px; }

.push-right { margin-left: auto; }

.where-card { max-width: 460px; text-align: center; }
.where-card img {
  width: 150px; height: 188px; object-fit: contain; display: block; margin: 16px auto 18px;
  background: rgba(255,255,255,.6); border-radius: 14px;
}
.where-card .chips { justify-content: center; margin-bottom: 14px; }
/* face, body and eyes: a Tools row over a Care row; an empty one still takes a drop */
.care-row-label { margin: 10px 0 6px; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.grid.care { min-height: 90px; border-radius: 16px; }
.grid.care:empty { border: 1px dashed var(--line); }
/* what a pasted link said, to check over before it is kept */
.where-details { display: grid; gap: 8px; margin: 0 auto 16px; max-width: 320px; }
.where-details input[hidden] { display: none; }
.care-info { margin: 0 0 16px; max-width: none; }
.care-info[hidden] { display: none; }
/* brand · size · shop link, under the name — outranks `.overlay-card p` */
.care-side .care-meta { margin: -6px 0 16px; font-size: 14px; line-height: 1.6; color: var(--muted); font-style: normal; }
.care-side .care-meta a { color: var(--mauve); }

.pin-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pin-bar select {
  font-family: var(--body); font-size: 14px; color: var(--ink); height: 42px; padding: 0 16px;
  border-radius: 999px; border: 1px solid rgba(17,17,17,.2); background: rgba(255,255,255,.7);
  max-width: 320px;
}
.pin-bar button {
  font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  height: 42px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  background: var(--fill);
}
.pin-bar .look-hint { margin: 0; }

/* a day that has passed without being filled reads as spent, not as still to come */

/* a day already gone reads a little quieter, so it is obvious you are looking backwards */
#view-tasks.is-past .tasks-title .display { color: var(--muted); }
#view-tasks.is-past .timeline { opacity: .92; }

/* A file input must stay rendered to be clickable — `hidden` (display:none) makes Safari
   refuse to open the picker, which reads as a dead button. Offscreen instead. */
.file-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120;
  max-width: min(90vw, 460px); padding: 14px 24px; border-radius: 999px;
  font-family: var(--body); font-size: 14px; color: #fff; text-align: center;
  background: linear-gradient(135deg, var(--mocha), var(--mauve));
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.7);
  animation: rise .3s ease both;
}
.toast[hidden] { display: none; }

/* ── meals ───────────────────────────────────────────── */
.meal-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.meal-top .display { font-size: clamp(24px, 2.8vw, 34px); }
.meal-top .eyebrow { margin-bottom: 5px; }

.meal-boardhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 2px; }
.meal-boardhead .monthpick { transform: scale(.85); transform-origin: right center; }
.meal-boardhead .section-title { margin: 0; }

/* daily overview: the header's three buttons, today against the goals, then water beside supplements */
.meal-links { display: flex; flex-wrap: wrap; gap: 10px; }
.meal-links button {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; cursor: pointer; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.85); background: rgba(255,255,255,.62); box-shadow: 0 10px 24px -20px rgba(0,0,0,.5);
  font-family: var(--display); font-size: 15px; color: var(--ink);
}
.meal-links button:hover { border-color: var(--mauve); }
.meal-links svg { width: 22px; height: 22px; fill: none; stroke: var(--cocoa); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.goals-card { display: flex; align-items: center; padding: 8px 20px; }
.goals-title { flex: 0 0 auto; margin: 0 22px 0 0; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ink); }
.goal-box { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 2px 8px; border-left: 1px solid var(--line); }
.goal-box:first-of-type { border-left: 0; }
.goal-box span { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--mauve); }
.goal-box b { font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.15; color: var(--ink); }
.goal-box small { font-size: 11px; color: var(--mocha); font-family: var(--display); }
.goal-box.over b { color: #B4544A; }
.goals-edit { flex: 0 0 auto; margin-left: 12px; padding: 0 0 0 18px; border: 0; border-left: 1px solid var(--line); background: none; cursor: pointer;
  font-family: var(--display); font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) {
  .goals-card { flex-wrap: wrap; row-gap: 14px; }
  .goals-title { width: 100%; }
  .goal-box { flex: 1 1 30%; }
  .goal-box:nth-of-type(4) { border-left: 0; }
}

.meal-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; margin-top: 10px; }
@media (max-width: 900px) { .meal-pair { grid-template-columns: 1fr; } }
.card-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ink); }
.water-card, .supp-card { padding: 10px 18px; }
.water-body { display: flex; align-items: center; gap: 16px; margin-top: 2px; }
.water-ring { position: relative; flex: 0 0 auto; width: 96px; height: 96px; }
.water-ring svg { width: 100%; height: 100%; }
.ring-track, .ring-fill { fill: none; stroke-width: 10; }
.ring-track { stroke: rgba(17,17,17,.12); }
.ring-fill { stroke: var(--mauve); stroke-linecap: round; transition: stroke-dasharray .5s; }
.water-count { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.water-count b { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--ink); line-height: 1.1; }
.water-count small { font-family: var(--display); font-size: 10px; color: var(--mocha); }
.water-side { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.water { display: flex; gap: 44px; }
.round { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.75);
  font-size: 20px; line-height: 1; color: var(--ink); cursor: pointer; box-shadow: 0 8px 18px -14px rgba(0,0,0,.5); }
.round:hover { border-color: var(--mauve); }
.water-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.water-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--tan); }
.water-dots i.on { background: var(--fill); border-color: transparent; }
@media (max-width: 480px) { .water-body { flex-direction: column; } .water { gap: 40px; } }

.supp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
/* one column per time of day, a hairline between them */
.supp-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: 4px; }
.supp-cols .supp-group { margin-top: 0; padding: 0 22px; border-left: 1px solid var(--line); }
.supp-cols .supp-group:first-child { padding-left: 0; border-left: 0; }
@media (max-width: 620px) {
  .supp-cols { grid-auto-flow: row; gap: 14px; }
  .supp-cols .supp-group { padding: 0; border-left: 0; }
}
.drink-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.drink-chips .chip { cursor: pointer; }
.drink-log { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.6); border: 1px solid var(--line); cursor: pointer; color: var(--mocha); }
.hint { font-size: 13px; color: var(--muted); font-style: italic; margin: 8px 0; }

/* the board */
.mb-grid { display: grid; grid-template-columns: 92px repeat(7, minmax(140px, 1fr)); gap: 6px; min-width: 1080px; }
#meal-board { overflow-x: auto; padding-bottom: 6px; }
.mb-corner { }
.mb-day { text-align: center; padding: 4px; }
.mb-day b { display: block; font-family: var(--display); font-size: 15px; color: var(--cocoa); }
.mb-day span { font-size: 11px; color: var(--muted); }
.mb-day.is-today b { color: var(--mauve); }
.mb-day.is-today { background: rgba(17,17,17,.14); border-radius: 12px; }
.mb-slot { display: flex; align-items: center; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-right: 6px; }
.mb-cell { min-height: 50px; background: rgba(255,255,255,.5); border: 1px solid var(--line); border-radius: 14px; padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.mb-cell.over { border-color: var(--mauve); background: rgba(17,17,17,.12); }
/* title, then a picture big enough to recognise the dish, then its macros */
.mb-card { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; background: linear-gradient(140deg, #FFFFFF, #EFEDEA); border-radius: 10px; padding: 5px 7px; cursor: grab; font-size: 12.5px; color: var(--cocoa); box-shadow: var(--shadow); }
.mb-card.mb-food { background: rgba(255,255,255,.72); }
.mb-card.dragging { opacity: .45; }
.mb-card img { flex: 1 0 100%; width: 100%; aspect-ratio: 5 / 2; border-radius: 8px; object-fit: cover; }
.mb-title { line-height: 1.25; flex: 1; min-width: 0; font-family: var(--display); font-size: 15px; }
.mb-title small { color: var(--muted); }
.mb-x { flex: 0 0 auto; border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: .5; }
.mb-x:hover { opacity: 1; color: var(--mocha); }
.mb-macros { flex: 1 0 100%; font-size: 11px; color: var(--mauve); letter-spacing: .01em; }
.mb-add { margin-top: auto; align-self: stretch; border: 1px dashed var(--line); background: none; border-radius: 9px; color: var(--muted); cursor: pointer; font-size: 15px; padding: 3px; }
.mb-add:hover { border-color: var(--mauve); color: var(--mauve); }

/* meal overlays */
.meal-card { max-width: 640px; width: 100%; text-align: left; padding: clamp(22px, 4vw, 34px); max-height: 86vh; overflow-y: auto; position: relative; }
.meal-card.wide { max-width: 720px; }
.meal-card .display { font-size: clamp(22px, 3vw, 30px); margin: 0 0 14px; }
.meal-card .x { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; font-size: 0; color: var(--cocoa); background: rgba(255,255,255,.7); padding: 0; }
/* the × is drawn, not typed — a glyph sits on the font's baseline and never centres in the circle */
.meal-card .x::before, .meal-card .x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; background: currentColor; border-radius: 1px; }
.meal-card .x::before { transform: translate(-50%, -50%) rotate(45deg); }
.meal-card .x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.meal-card .ghost { padding: 8px 16px; }

.rp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
/* the cards themselves are the recipe book's (.book-item) */

.re-form { display: grid; gap: 10px; }
.re-link { display: flex; gap: 8px; }
.re-link input { flex: 1; }
.re-row { display: flex; gap: 8px; }
.re-row input[name="title"] { flex: 1; }
.re-row input[name="servings"] { width: 96px; }
.re-row select[name="meal"] { width: 130px; }

/* the recipe book */
.book-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.book-tabs { margin: 0; }
.overlay-card #book-new { padding: 8px 18px; }
.book-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
/* .overlay-card prefix to outrank `.overlay-card button`, which would paint these as pills */
.overlay-card .book-item {
  font-family: var(--body); letter-spacing: normal; text-transform: none;
  display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 10px; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.6); color: var(--cocoa);
}
.overlay-card .book-item:hover { border-color: var(--mauve); opacity: 1; }
.book-item b { font-family: var(--display); font-weight: 400; font-size: 16px; line-height: 1.25; height: 2.5em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.book-item img, .book-noimg { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; object-fit: cover; background: var(--sand); }
.book-item small { font-size: 12px; color: var(--mauve); }
.re-form textarea, .re-form input, .re-form select { font-family: var(--body); font-size: 14px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.7); color: var(--ink); width: 100%; }
.re-form textarea { resize: vertical; line-height: 1.5; }
.re-form select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.re-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.re-label em { color: var(--mocha); }
.re-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.danger { color: var(--mocha) !important; }

.grocery-list { margin: 6px 0 14px; }
.gr-group { margin-bottom: 14px; }
.gr-cat { font-family: var(--body); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--mauve); margin: 0 0 6px; }
.gr-item { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.gr-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--mauve); }
.gr-name { flex: 1; color: var(--cocoa); }
.gr-name small { color: var(--muted); }
.gr-item.checked .gr-name { text-decoration: line-through; color: var(--muted); }
.gr-pantry { font-size: 12px; color: var(--tan); }
.gr-keep { font-size: 11px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.gr-keep.on { background: var(--fill); color: #fff; border-color: transparent; }

.pantry-list { margin: 6px 0 14px; }
.pantry-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--cocoa); }
.pantry-item small { color: var(--muted); }
.pantry-del { border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.meal-card .add-row { display: flex; gap: 8px; margin-top: 6px; }
.meal-card .add-row input { flex: 1; font-family: var(--body); font-size: 14px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.7); }
.meal-card .add-row input[name="qty"], .meal-card .add-row input[name="note"] { flex: 0 0 96px; }
.meal-card .add-row button { padding: 11px 22px; }

/* one goal per row, the box under the one before, so it reads like a list */
#goal-overlay .overlay-card { max-width: 420px; }
.goal-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
.goal-form label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; color: var(--mocha); }
.goal-form input { width: 140px; font-family: var(--body); font-size: 14px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.7); }
.goal-form button { grid-column: 1 / -1; margin-top: 6px; }

/* ── meals: supplements, picker tabs, food search, image upload ── */
/* supplements as today's checklist, by time of day: tap one when it's taken */
.supp-head { align-items: center; }
.supp-plus { width: 30px; height: 30px; font-size: 17px; }
.meal-card.narrow { max-width: 420px; }
#supp-overlay .chip input { display: none; }
#supp-overlay .chip { cursor: pointer; }
#supp-overlay .chip:has(input:checked) { background: var(--fill); color: #fff; border-color: transparent; }
.supp-group { display: grid; gap: 5px; margin-top: 6px; align-content: start; } /* a lone supplement keeps its height */
.supp-time { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mauve); margin-bottom: 4px; }
.supp-row { display: flex; align-items: center; gap: 10px; padding: 5px 11px; border-radius: 14px; cursor: pointer; transition: opacity .2s; }
.when-morning .supp-row { background: #EFEDEA; }
.when-noon .supp-row { background: #EFEDEA; }
.when-evening .supp-row { background: #E6E4E1; }
.when-night .supp-row { background: #D9D5CF; }
.supp-row.taken { opacity: .55; }
.supp-row.taken .supp-name { text-decoration: line-through; }
.supp-check { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(111,82,74,.4); display: grid; place-items: center; font-style: normal; font-size: 12px; color: #fff; background: rgba(255,255,255,.6); }
.supp-row.taken .supp-check { background: var(--mauve); border-color: transparent; }
.supp-name { flex: 1; display: flex; flex-direction: column; font-family: var(--display); font-size: 13px; color: var(--cocoa); }
.supp-name small { font-size: 11px; color: var(--mocha); }
.supp-card .supp-x { flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--mocha); font-size: 16px; cursor: pointer; opacity: 0; }
.supp-row:hover .supp-x, .supp-x:focus { opacity: 1; }
@media (hover: none) { .supp-card .supp-x { opacity: .6; } }

/* the overlay paints buttons as pills; the gap keeps them clear of the line underneath */
.pk-tabs { display: flex; gap: 6px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pk-tab { font-family: var(--body); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 4px; margin-bottom: -1px; cursor: pointer; }
.pk-tab.is-active { color: var(--cocoa); border-bottom-color: var(--mauve); }
.pk-new { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.7); color: var(--cocoa); font-size: 20px; line-height: 1; cursor: pointer; }
.pk-new:hover { color: var(--mauve); }
#pk-foods > input[type="search"] { width: 100%; font-family: var(--body); font-size: 14px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.7); margin-bottom: 10px; }
.food-list { max-height: 46vh; overflow-y: auto; display: grid; gap: 4px; }
.food-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-bottom: 1px solid var(--line); }
.food-name { flex: 1; min-width: 0; color: var(--cocoa); font-size: 14px; }
.food-name small { display: block; color: var(--muted); font-size: 11px; }
.food-g { width: 70px; font-family: var(--body); font-size: 13px; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.7); }
.food-add { padding: 7px 14px; border-radius: 999px; border: 0; cursor: pointer; color: #fff; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; background: var(--fill); }

.re-imgrow { display: flex; gap: 8px; }
.re-imgrow input[name="image"] { flex: 1; }
.re-preview:not(:empty) { margin: 2px 0; }
.re-preview img { max-height: 150px; border-radius: 12px; border: 1px solid var(--line); }

/* ── auth gate ────────────────────────────────────────── */
#auth-gate {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: var(--cream); padding: 24px;
}
#auth-gate[hidden] { display: none; }
.auth-card {
  width: 100%; max-width: 380px; padding: 36px 32px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); text-align: center;
}
.auth-card .eyebrow { margin-bottom: 4px; }
.auth-card h1 { margin-top: 0; margin-bottom: 28px; }
#auth-form, #auth-reset-form, #auth-reset-confirm-form { display: grid; gap: 10px; }
#auth-reset-form[hidden], #auth-reset-confirm-form[hidden] { display: none; }
#auth-form input, #auth-reset-form input, #auth-reset-confirm-form input {
  font-family: var(--body); font-size: 15px; color: var(--ink); height: 46px;
  padding: 0 18px; border-radius: 999px; border: 1px solid rgba(17,17,17,.2);
  background: rgba(255,255,255,.7);
}
#auth-form button, #auth-reset-form button, #auth-reset-confirm-form button {
  font-family: var(--body); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  height: 46px; border-radius: 999px; border: 0; cursor: pointer; color: #fff; margin-top: 4px;
  background: var(--fill);
}
.auth-error { min-height: 1.2em; margin: 0; font-size: 13px; color: #B4433F; }
.auth-switch-line { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--mauve); font-weight: 600; cursor: pointer; font-size: 13px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.auth-divider[hidden] { display: none; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-oauth { display: flex; gap: 10px; }
.auth-oauth[hidden] { display: none; }
.auth-oauth button {
  flex: 1; height: 46px; border-radius: 14px; border: 1px solid rgba(17,17,17,.25);
  background: rgba(255,255,255,.5); font-family: var(--body); font-size: 14px; font-weight: 600;
  color: var(--ink); cursor: pointer;
}
.auth-oauth button:hover { background: rgba(255,255,255,.8); }
.account-avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-family: var(--display); font-size: 16px;
  background: var(--fill);
}
.account-card { width: 100%; max-width: 340px; text-align: left; }
.account-card h2 { font-size: clamp(20px, 4vw, 26px); margin: 4px 0 2px; word-break: break-word; }
/* Scoped under .account-card (not just the bare class) to outrank the more specific pre-existing
   `.overlay-card p` / `.overlay-card button` rules — same reasoning as .account-row above. */
.account-card .account-email { margin: 0 0 20px; font-size: 12px; font-style: normal; color: var(--muted); word-break: break-word; }
.account-card .account-back {
  text-align: left; margin: 0 0 2px; padding: 0; background: none; border: 0; color: var(--mauve);
  font-family: var(--body); font-size: 12px; letter-spacing: normal; text-transform: none; cursor: pointer;
}
/* .account-card .account-row (not just .account-row) to outrank the pre-existing, more specific
   `.overlay-card button` rule, which would otherwise paint these as white-on-gradient pills too. */
.account-card .account-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--body); font-size: 14px; letter-spacing: normal; text-transform: none; color: var(--ink);
  background: rgba(255,255,255,.55); border: 1px solid rgba(17,17,17,.15); border-radius: 14px;
  padding: 14px 18px; margin-bottom: 10px; cursor: pointer; text-align: left;
}
.account-card .account-row:disabled { opacity: .55; cursor: default; }
.account-card .account-row.account-danger { color: #B4433F; }
.account-chevron { color: var(--mauve); }
.account-soon {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  background: rgba(17,17,17,.12); padding: 3px 8px; border-radius: 999px;
}
.account-password-form { display: grid; gap: 10px; margin: -2px 0 12px; }
.account-card .account-help { margin: 0; font-size: 13px; font-style: normal; line-height: 1.5; color: var(--muted); text-align: left; }
.account-card .account-password-form .linky { height: auto; background: none; color: var(--mauve); letter-spacing: normal; text-transform: none; font-size: 13px; }
.account-help b { font-weight: 600; color: var(--mocha); }
.account-password-form[hidden] { display: none; }
.account-password-form input {
  font-family: var(--body); font-size: 14px; color: var(--ink); height: 44px;
  padding: 0 16px; border-radius: 999px; border: 1px solid rgba(17,17,17,.2);
  background: rgba(255,255,255,.7);
}
.account-password-form button {
  font-family: var(--body); font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  height: 44px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  background: var(--fill);
}
.account-card .account-close, .workout-card .account-close {
  display: block; margin: 12px auto 0; padding: 0; background: none; border: 0; color: var(--mauve);
  font-family: var(--body); font-size: 13px; letter-spacing: normal; text-transform: none; cursor: pointer;
}

/* ── habits manager ───────────────────────────────────── */
.new-task-trigger {
  margin-top: 10px; width: 100%; height: 46px; border-radius: 999px; border: 1px dashed rgba(17,17,17,.3);
  background: rgba(255,255,255,.4); color: var(--mauve); font-family: var(--body); font-size: 13px;
  letter-spacing: .08em; cursor: pointer;
}
.new-task-trigger:hover { background: rgba(255,255,255,.7); }
/* No inner scrollbar — the whole card scrolls as one unit on short screens instead (only ever
   kicks in if there are genuinely more habits than fit; normally the card just sizes to content). */
.habits-card { max-width: 820px; max-height: calc(100vh - 48px); overflow-y: auto; }
.habit-edit-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 4px 0 14px; }
/* min-width:0 overrides grid items' default min-width:auto (which refuses to shrink below content
   size) — without it the row's flex-shrink on the name input never actually kicks in, and the row
   overflows the card instead of fitting it. */
.habit-edit-item { min-width: 0; }
.habit-edit-item > * + * { margin-top: 6px; }
/* Flex, not grid: the name field gets flex:1 1 0 + width:0 so it sizes off the row's actual
   available space, not its own text content — grid's 1fr kept resolving off the nested row's
   intrinsic max-content instead of the space its ancestors actually gave it. */
.account-card .habit-edit-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.account-card .habit-edit-row input {
  min-width: 0; font-family: var(--body); font-size: 13px; color: var(--ink); height: 40px;
  padding: 0 12px; border-radius: 999px; border: 1px solid rgba(17,17,17,.2);
  background: rgba(255,255,255,.7);
}
.account-card .habit-edit-name { flex: 1 1 0; width: 0; min-width: 140px; }
.account-card .habit-edit-time { flex: 0 0 104px; }
.account-card .habit-edit-duration { flex: 0 0 76px; }
/* Column captions — the head is a .habit-edit-row itself, so its columns take the inputs' widths
   and gap exactly; the text starts where the field's text does (inside its 12px padding). */
.account-card .habit-edit-head {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.account-card .habit-edit-head > span:not(.habit-edit-del):not(.habit-edit-weekdays) { padding-left: 13px; }
.account-card .habit-edit-del {
  flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 0; background: none;
  color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1;
}
.account-card .habit-edit-del:hover { color: #B4433F; }
.account-card .habit-edit-weekdays { flex: 0 0 196px; display: flex; gap: 4px; }
.account-card .weekday-toggle {
  width: 24px; height: 24px; padding: 0; flex: none; border-radius: 50%; border: 1px solid rgba(17,17,17,.25);
  background: none; color: var(--muted); font-family: var(--body); font-size: 10px;
  cursor: pointer; line-height: 1;
}
.weekday-toggle.is-active { background: var(--fill); border-color: transparent; color: #fff; }

/* ── new-task overlay ─────────────────────────────────── */
.task-form { display: grid; gap: 10px; }
.task-weekdays { display: flex; gap: 6px; justify-content: center; }
.task-weekdays[hidden] { display: none; }
.account-card .task-weekdays .weekday-toggle { width: 32px; height: 32px; font-size: 12px; }
.account-card .task-form label { display: grid; gap: 4px; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.account-card .task-form input, .account-card .task-form select {
  font-family: var(--body); font-size: 14px; color: var(--ink); height: 44px;
  padding: 0 16px; border-radius: 999px; border: 1px solid rgba(17,17,17,.2);
  background: rgba(255,255,255,.7);
}
/* the repetition box is as round as the others: no native square select, its own little chevron */
.account-card .task-form select {
  -webkit-appearance: none; appearance: none; padding-right: 36px;
  background: rgba(255,255,255,.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A5738A' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 16px center;
}
.account-card .task-form button[type="submit"] {
  font-family: var(--body); font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  height: 44px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  background: var(--fill);
}

/* ── duration slider ──────────────────────────────────── */
.duration-slider { width: 100%; margin: 8px 0 4px; accent-color: var(--mauve); cursor: pointer; }
/* no marks: the bottom edge of a placed item is what you drag to make it longer or shorter */
.resize-handle {
  position: absolute; left: 0; right: 0; bottom: 0; height: 8px; z-index: 1;
  cursor: ns-resize; touch-action: none; user-select: none;
}
.resize-tooltip {
  position: fixed; z-index: 200; pointer-events: none;
  background: var(--cocoa); color: #fff; font-family: var(--body); font-size: 12px;
  padding: 4px 10px; border-radius: 999px; transform: translate(-50%, -130%);
}
.resize-tooltip[hidden] { display: none; }

/* ── coach ───────────────────────────────────────────── */
/* A nudge is a small card on the screen it's about: warm serif title, plain readable body,
   one action and a quiet "Not now". */
.nudge {
  margin-top: 12px; padding: 14px 18px; border-radius: 22px; text-align: left;
  background: linear-gradient(150deg, #FFFFFF, var(--blush)); border: 1px solid var(--line);
  animation: rise .4s ease both;
}
.nudge[hidden] { display: none; }
.vision-top .nudge { flex: 1 1 100%; margin-top: 0; }
#view-training .nudge { margin: 0 0 12px; }
#view-finances .nudge { margin: 0 0 18px; }
.nudge .eyebrow { margin: 0 0 4px; }
.nudge-msg { margin: 0; font-family: var(--body); font-style: normal; font-size: 14px; line-height: 1.5; color: var(--ink); }
.nudge-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.nudge-actions .chips { margin: 0; }
.nudge-act {
  font-family: var(--body); font-size: 13px; padding: 8px 18px; border-radius: 999px; border: 0; cursor: pointer;
  color: #fff; background: var(--fill);
}

.coach-card { max-width: 480px; text-align: left; }
.coach-card .display { font-size: clamp(24px, 3.6vw, 32px); text-align: left; margin: 6px 0 12px; }
.coach-card p { font-style: normal; color: var(--ink); font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
.coach-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
/* the quiet second choice (Close, Back, Edit, Keep my current plan) is a text link, not a pill */
.coach-card .account-close {
  display: block; margin: 14px 0 0; padding: 0; background: none; border: 0; color: var(--mauve);
  font-family: var(--body); font-size: 13px; letter-spacing: normal; text-transform: none; cursor: pointer;
}
.coach-card .coach-actions .account-close { display: inline-block; margin: 0; }
#greet-message { font-size: 17px; }

.weekly-card .eyebrow { margin: 0; }
.weekly-cutoff { font-size: 12px !important; color: var(--muted) !important; margin-top: -6px !important; }
.weekly-facts { margin: 0 0 16px; padding-left: 18px; color: var(--ink); font-size: 15px; line-height: 1.55; }
.weekly-facts li + li { margin-top: 4px; }
.coach-card .weekly-q { font-family: var(--display); font-size: 18px; color: var(--cocoa); margin: 4px 0 10px; }
.weekly-card .chips { margin-bottom: 14px; }
.weekly-card textarea, .weekly-card input {
  display: block; width: 100%; margin: 0 0 10px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,.7); font-family: var(--body); font-size: 14px; color: var(--ink);
}
.weekly-card button:disabled { opacity: .45; cursor: default; }
.weekly-card .link-btn { padding: 0; margin-top: 12px; background: none; color: var(--mauve); letter-spacing: normal; text-transform: none; }
.weekly-status { font-size: 13px !important; color: var(--muted) !important; margin: 10px 0 0 !important; }
.weekly-status:empty { display: none; }

/* "Change my plan" opens the habits card on the habit it's about */
.habit-edit-item.is-focus { background: var(--blush); border-radius: 12px; }

/* a phone: the days drop under the fields rather than squeezing the name to nothing */
@media (max-width: 720px) {
  .account-card .habit-edit-row { flex-wrap: wrap; }
  .account-card .habit-edit-head .habit-edit-weekdays { display: none; }
}

#overlay-sub { white-space: pre-line; }

/* ── crop before keeping ─────────────────────────────── */
.crop-card { max-width: 720px; text-align: center; }
.crop-stage { position: relative; display: inline-block; max-width: 100%; overflow: hidden; border-radius: 12px; touch-action: none; }
.crop-stage img { display: block; max-width: min(640px, 100%); max-height: 60vh; user-select: none; }
/* the dimmed outside is the frame's own huge shadow, clipped by the stage */
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(17,17,17,.45); cursor: move; }
.crop-box i { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.crop-box i[data-h="tl"] { left: -9px; top: -9px; cursor: nwse-resize; }
.crop-box i[data-h="tr"] { right: -9px; top: -9px; cursor: nesw-resize; }
.crop-box i[data-h="bl"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.crop-box i[data-h="br"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.crop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* the shop's pictures, to pick the one with the product alone */
.where-pics { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: -6px 0 12px; }
.overlay-card .where-pic { padding: 0; width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: #fff; border: 2px solid transparent; letter-spacing: 0; }
.overlay-card .where-pic.is-active { border-color: var(--mauve); }
.where-card .where-pic img { width: 100%; height: 100%; object-fit: contain; margin: 0; border-radius: 0; background: none; }
#where-own { margin: 0 auto 14px; display: block; }
#where-own[hidden] { display: none; }

/* ── tracker ─────────────────────────────────────────── */
/* left-aligned like every other page: the flower, the figures and the month on the left, this
   week habit by habit on the right — all of it on one screen */
#view-tracker .display { font-size: clamp(24px, 3vw, 34px); margin: 4px 0 16px; }
.tracker-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .tracker-layout { grid-template-columns: 1fr; } }
.tracker-top { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 14px; }
.tracker-top .stat-tiles { flex: 1; margin-bottom: 0; }
.trophy { position: relative; flex: none; width: 140px; height: 140px; }
.flower-outline { position: absolute; inset: 8%; width: 84%; height: 84%; fill: none; stroke: var(--mauve); stroke-width: 1.4; opacity: .45; }
.trophy img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.trophy .sparkle {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: #fff;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  animation: twinkle 1.6s ease-in-out infinite alternate;
}
.sparkle.s0 { left: 50%; top: 6%; } .sparkle.s1 { left: 85%; top: 28%; } .sparkle.s2 { left: 85%; top: 68%; }
.sparkle.s3 { left: 50%; top: 92%; } .sparkle.s4 { left: 15%; top: 68%; } .sparkle.s5 { left: 15%; top: 28%; }
@keyframes twinkle { from { opacity: .25; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.stat-tile { padding: 12px 10px; border-radius: 18px; background: var(--card); border: 1px solid rgba(255,255,255,.7); }
.stat-tile b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--cocoa); }
.stat-tile span { font-size: 11px; color: var(--muted); }
.tracker-cal { padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid rgba(255,255,255,.7); margin-bottom: 20px; }
.tracker-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--cocoa); }
.tracker-cal-head button { background: none; border: 0; font-size: 22px; color: var(--mauve); cursor: pointer; padding: 0 8px; }
.tracker-cal-head button:disabled { opacity: .25; cursor: default; }
.tracker-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-wd { font-size: 10px; color: var(--muted); padding-bottom: 4px; }
.cal-day { height: clamp(30px, 4.6vh, 42px); display: grid; place-items: center; border-radius: 10px; font-size: 13px; color: var(--ink); background: rgba(255,255,255,.45); }
.cal-day.part { background: linear-gradient(135deg, var(--blush), var(--peach)); }
.cal-day.full { background: var(--fill); color: #fff; }
.cal-day.today { box-shadow: 0 0 0 2px var(--mauve); }
.tracker-cal { margin-bottom: 0; }

/* this week, habit by habit */
.tracker-week { padding: 16px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid rgba(255,255,255,.7); }
.tracker-week .section-title { margin: 0 0 10px; }
.wr-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(7, 18px) 34px; align-items: center; gap: 6px; padding: 7px 0; border-top: 1px solid var(--line); }
.wr-head { border-top: 0; padding-top: 0; }
.wr-day { font-size: 10px; color: var(--muted); text-align: center; }
.wr-name { font-family: var(--display); font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--tan); justify-self: center; }
.wr-dot.on { background: var(--fill); border-color: transparent; }
.wr-dot.today { box-shadow: 0 0 0 2px rgba(171,123,136,.35); }
.wr-dot.ahead { opacity: .45; }
.wr-dot.off { border: 0; width: 4px; height: 4px; background: var(--line); }
.wr-count { font-family: var(--display); font-weight: 400; font-size: 14px; color: var(--cocoa); text-align: right; }
#view-tracker 
/* ── outfit planner ──────────────────────────────────── */
.outfit-place { display: flex; gap: 8px; max-width: 420px; margin-bottom: 18px; }
.outfit-place input {
  flex: 1; min-width: 0; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.7); font-family: var(--body); font-size: 14px; color: var(--ink);
}
.outfit-place button {
  padding: 10px 20px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  font-family: var(--body); font-size: 13px; background: #A5738A;
}
/* all seven days on one line: the chosen day wide, the other six narrow */
.outfit-week { display: flex; gap: 10px; align-items: flex-start; }
.outfit-day { flex: 1 1 0; min-width: 0; }
.outfit-day.is-focus { flex: 3.2 1 0; }
@media (max-width: 900px) {
  .outfit-week { flex-wrap: wrap; }
  .outfit-day.is-focus { flex-basis: 100%; }
  .outfit-day:not(.is-focus) { flex: 1 1 calc(33% - 10px); }
}
/* today — or the day she clicked — is shown big; the rest stay small until clicked */
.outfit-day:not(.is-focus) { cursor: pointer; }
.outfit-day:not(.is-focus) .outfit-board { min-height: 0; }
.outfit-day:not(.is-focus) { padding: 8px; }
.outfit-day:not(.is-focus) header { margin-bottom: 6px; font-size: 11px; }
.outfit-day:not(.is-focus) header b { font-size: 15px; }
.outfit-day {
  padding: 10px; border-radius: 20px; background: var(--card); border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 12px 28px -22px rgba(0,0,0,.5);
}
/* the day on its own line, then the date and the weather */
.outfit-day header { display: flex; flex-direction: column; gap: 2px; margin: 2px 4px 8px; font-size: 12px; color: var(--cocoa); }
.outfit-day header b { font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--cocoa); }
.outfit-day.is-focus header b { font-size: 24px; }
.outfit-day.is-focus header { font-size: 13px; }
/* a little style board, laid out like the body: head, upper, lower, feet down the middle, accessories at the side */
.outfit-board { display: flex; gap: 6px; }
.outfit-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.outfit-row { display: flex; justify-content: center; gap: 4px; }
.outfit-row .piece { flex: 1 1 0; min-width: 0; max-width: 50%; border-radius: 12px; }
.outfit-row.head .piece, .outfit-row.feet .piece { max-width: 36%; aspect-ratio: 1; }
.outfit-row.side { flex: 0 0 26%; flex-direction: column; justify-content: flex-start; }
.outfit-row.side .piece { max-width: none; flex: none; aspect-ratio: 1; }
.outfit-add {
  align-self: center; margin-top: 2px; padding: 7px 16px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  font-family: var(--body); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  background: var(--fill);
}
.outfit-add:hover { opacity: .9; }
#outfit-picker { margin-top: 18px; }

/* one-tap adds under the pantry and grocery forms */
.quick-adds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.quick-label { width: 100%; font-size: 12px; color: var(--muted); }
/* a third bigger than a chip, so they're easy to hit; the overlay prefix outranks its pill buttons */
.overlay-card .quick-add {
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer;
  background: rgba(255,255,255,.7); color: var(--cocoa); font-family: var(--body); font-size: 16px;
  letter-spacing: normal; text-transform: none;
}
.overlay-card .quick-add:hover { border-color: var(--mauve); opacity: 1; }


/* ══ Glass ═══════════════════════════════════════════════
   The look across every screen: frosted surfaces over a slow wash of the palette, a dark glass
   bar to steer by, and things that lift when they can be touched. One layer at the end, so it
   reads as one decision — everything above still holds the layout. Motion stops for anyone who
   has asked their device for less of it. */
:root {
  --card: rgba(255,255,255,.5);
  --glass-edge: rgba(255,255,255,.8);
  --glass-shine: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -1px 0 rgba(255,255,255,.2);
  --shadow: 0 24px 60px -32px rgba(0,0,0,.45), 0 2px 8px -4px rgba(0,0,0,.08);
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --spring: cubic-bezier(.2,.9,.3,1.25);
}

/* the wash: two soft lights drifting behind everything */
body::before, body::after {
  content: ''; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  filter: blur(60px); opacity: .75;
}
body::before {
  width: 48vw; height: 48vw; left: -10vw; top: 6vh;
  background: radial-gradient(circle, #D9D5CF, transparent 66%);
  animation: drift-a 28s ease-in-out infinite alternate;
}
body::after {
  width: 54vw; height: 54vw; right: -14vw; top: 28vh;
  background: radial-gradient(circle, #D9D5CF, transparent 66%);
  animation: drift-b 34s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(20vw, 24vh) scale(1.18); } }
@keyframes drift-b { to { transform: translate(-24vw, -20vh) scale(.88); } }

/* the bar: a glass pill floating over the page, brown fading into the mauve of the buttons */
.topbar {
  background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  padding: 16px clamp(24px, 4vw, 52px);
}
.topbar::before {
  content: ''; position: absolute; z-index: -1; inset: 8px clamp(8px, 1.6vw, 22px); border-radius: 32px;
  background: linear-gradient(100deg, rgba(17,17,17,.9) 0%, rgba(128,88,90,.88) 55%, rgba(165,115,138,.9) 100%);   /* brown into the buttons' mauve */
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 22px 50px -26px rgba(17,17,17,.8), inset 0 1px 0 rgba(255,255,255,.14);
}
.topbar .brandname { color: #F4F3F1; }
.tabs { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); }
.tab { color: rgba(255,255,255,.66); }
.tab:hover { color: #fff; background: rgba(255,255,255,.07); }
.tab.is-active {
  background: rgba(255,255,255,.17); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 6px 16px -10px rgba(0,0,0,.6);
}
.account-avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.16); }
/* a phone: the name on top, then one row of tabs that slides sideways, not a wall of them */
@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 16px 22px 14px; }
  .topbar::before { border-radius: 26px; }
  .nav-right { width: 100%; gap: 10px; }
  .tabs {
    flex: 1; min-width: 0; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; padding: 8px 14px; font-size: 12px; }
  .account-avatar { width: 34px; height: 34px; }
}

/* frosted surfaces, lit along the top edge */
.card, .session, .train-day {
  background: linear-gradient(155deg, rgba(255,255,255,.5), rgba(255,255,255,.14) 45%, rgba(255,255,255,.3)), var(--card);
}
.card, .session, .train-day, .bud-stats > .stat, .monthpick, .cat-figures div, .debt, .item, .daybtn {
  border-color: var(--glass-edge);
  box-shadow: var(--shadow), var(--glass-shine);
}
.card, .session, .bud-stats > .stat {
  backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.overlay-card { border: 1px solid rgba(255,255,255,.6); box-shadow: 0 40px 90px -30px rgba(0,0,0,.6), var(--glass-shine); }
.glass-card { box-shadow: 0 40px 90px -30px rgba(0,0,0,.55), var(--glass-shine); }

/* what can be touched lifts, softly */
button.stat, .train-day, .item, .chip, .plan-open, .box-add, .monthpick button, button.pick {
  transition: transform .45s var(--spring), box-shadow .45s var(--ease-out), background .3s, color .3s, border-color .3s;
}
button.stat:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.55), var(--glass-shine); }
.train-day:hover { transform: translateY(-3px); }
.chip:hover, .box-add:hover, .monthpick button:hover { transform: translateY(-1px); }
.chip:active, .box-add:active, .train-add:active { transform: scale(.96); }
button.pick:hover { transform: translateX(3px); }

/* screens arrive in a short cascade rather than all at once */
.view.is-active .card, .view.is-active .bud-stats > .stat {
  animation: rise .7s var(--ease-out) both;
}
.view.is-active .bud-stats > .stat:nth-child(2), .view.is-active .bud-grid > .card:nth-child(2) { animation-delay: 0.06s; }
.view.is-active .bud-stats > .stat:nth-child(3), .view.is-active .bud-grid > .card:nth-child(3) { animation-delay: 0.12s; }
.view.is-active .bud-stats > .stat:nth-child(4), .view.is-active .bud-grid > .card:nth-child(4) { animation-delay: 0.18s; }
.view.is-active .bud-stats > .stat:nth-child(5), .view.is-active .bud-grid > .card:nth-child(5) { animation-delay: 0.24s; }
.view.is-active .bud-stats > .stat:nth-child(6), .view.is-active .bud-grid > .card:nth-child(6) { animation-delay: 0.30s; }

/* the main buttons: a little depth, and a light that passes across on hover */
.start-workout-btn, .add-form button[type="submit"], .import, .add-row button, .debt .pay button,
.workout-complete-btn, .account-password-form button[type="submit"] {
  position: relative; overflow: hidden; isolation: isolate;
  box-shadow: 0 12px 26px -14px rgba(17,17,17,.85), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .35s var(--spring), box-shadow .35s var(--ease-out), opacity .2s;
}
:is(.start-workout-btn, .add-form button[type="submit"], .import, .add-row button, .debt .pay button,
    .workout-complete-btn, .account-password-form button[type="submit"])::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.42) 48%, transparent 66%);
  transform: translateX(-120%); transition: transform .9s var(--ease-out);
}
:is(.start-workout-btn, .add-form button[type="submit"], .import, .add-row button, .debt .pay button,
    .workout-complete-btn, .account-password-form button[type="submit"]):hover {
  opacity: 1; transform: translateY(-1px); box-shadow: 0 18px 32px -16px rgba(17,17,17,.9), inset 0 1px 0 rgba(255,255,255,.3);
}
:is(.start-workout-btn, .add-form button[type="submit"], .import, .add-row button, .debt .pay button,
    .workout-complete-btn, .account-password-form button[type="submit"]):hover::after { transform: translateX(120%); }
:is(.start-workout-btn, .add-form button[type="submit"], .import, .add-row button, .debt .pay button,
    .workout-complete-btn, .account-password-form button[type="submit"]):active { transform: scale(.97); }
.chip.is-active { box-shadow: 0 8px 18px -10px rgba(17,17,17,.8), inset 0 1px 0 rgba(255,255,255,.3); }

/* pill fields glow instead of outlining */
input:not(.num):focus, select:not(.num):focus, textarea:focus {
  outline: 0; border-color: var(--rose); box-shadow: 0 0 0 4px rgba(17,17,17,.26);
}

/* the workbook: tall capsules, the photo dimmed toward the name */
.train-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.train-grid .train-card {
  min-height: 0; aspect-ratio: 3 / 4.3; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 24px 18px 26px; text-align: center; border-radius: 999px 999px 46px 46px;
  background:
    radial-gradient(120% 60% at 50% 14%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(180deg, rgba(17,17,17,.06) 28%, rgba(17,17,17,.8)),
    var(--img, none) center / cover,
    linear-gradient(170deg, var(--c1), var(--c2));
  box-shadow: 0 30px 50px -28px rgba(17,17,17,.75), inset 0 1px 0 rgba(255,255,255,.25);
  animation: rise .7s var(--ease-out) both;
}
.train-grid .train-card:nth-child(2) { animation-delay: .06s; } .train-grid .train-card:nth-child(3) { animation-delay: .12s; }
.train-grid .train-card:nth-child(4) { animation-delay: .18s; } .train-grid .train-card:nth-child(5) { animation-delay: .24s; }
.train-grid .train-card:nth-child(6) { animation-delay: .3s; }
.train-grid .train-card:hover { transform: translateY(-6px); box-shadow: 0 40px 60px -30px rgba(17,17,17,.85), inset 0 1px 0 rgba(255,255,255,.25); }
.train-grid .train-card i { font-size: 10.5px; letter-spacing: .3em; }
.train-grid .train-card b { font-size: clamp(19px, 1.8vw, 23px); letter-spacing: .12em; text-transform: uppercase; line-height: 1.2; }
.train-grid .train-card em { font-style: normal; font-size: 14px; opacity: .86; }
.train-grid .train-card .pill {
  margin-top: 10px; padding: 9px 20px; border-radius: 999px; background: #fff; color: var(--cocoa);
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; box-shadow: 0 10px 22px -12px rgba(0,0,0,.55);
  transition: background .3s, color .3s;
}
.train-grid .train-card:hover .pill { background: var(--fill); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}


/* ── the profile, as in the app ──────────────────────── */
.account-card.profile-card { position: relative; max-width: 400px; padding: clamp(26px, 5vw, 40px); }
.account-card .sheet-x {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  font-size: 22px; letter-spacing: normal; color: var(--mocha); background: rgba(255,255,255,.6);
}
.account-card .sheet-x:hover { background: var(--fill); color: #fff; }
.profile-head { display: grid; justify-items: center; text-align: center; margin-bottom: 22px; }
.profile-photo {
  width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px;
  font-family: var(--display); font-size: 36px; color: #fff;
  background: var(--fill);
  box-shadow: 0 0 0 4px rgba(255,255,255,.7), 0 18px 36px -18px rgba(0,0,0,.7);
}
.profile-card .profile-head h2 { margin: 0 0 2px; }
.profile-card .profile-head .account-email { margin: 0; }
.profile-label { margin: 0 0 8px 4px; }
/* rows grouped in one rounded block, a hairline between them, like the app's settings */
.account-section { border-radius: 18px; overflow: hidden; margin-bottom: 14px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.75); box-shadow: var(--glass-shine); }
.account-card .account-section .account-row {
  margin: 0; border: 0; border-radius: 0; background: none; border-bottom: 1px solid var(--line);
}
.account-card .account-section .account-row:last-child { border-bottom: 0; }
.account-card .account-section .account-row:not(:disabled):hover { background: rgba(255,255,255,.5); }
.account-card .account-row small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.account-section .account-password-form { margin: 0; padding: 12px 16px 16px; border-bottom: 1px solid var(--line); }
.app-qr { display: grid; place-items: center; }
.app-qr svg { width: 190px; height: 190px; padding: 10px; border-radius: 16px; background: #fff; }
.app-qr:empty { display: none; }
.app-link-form { display: flex; gap: 8px; }
.app-link-form input { flex: 1; min-width: 0; }
.account-card .app-link-form button { padding: 0 16px; }
.profile-card .profile-label { font-style: normal; font-family: var(--body); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--mauve); }

/* ── social ──────────────────────────────────────────── */
#view-social .display { margin: 4px 0 16px; }
.soc-avatar { flex: none; display: grid; place-items: center; border-radius: 50%; object-fit: cover; font-family: var(--display); font-size: 18px; color: #fff; background: var(--fill); }
.soc-invite { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 12px; }
.soc-invite-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.soc-invite-text b { font-family: var(--display); font-weight: 400; font-size: 19px; color: var(--ink); }
.soc-invite-text span { font-size: 13px; color: var(--muted); }
.soc-invite-text em { font-family: var(--display); font-size: 14px; color: var(--mocha); }
.soc-invite-text em.is-clash { color: #B4544A; }
.soc-actions { display: flex; gap: 8px; }
.soc-actions button, .soc-row button { padding: 8px 16px; }
.soc-list { padding: 6px 20px; margin-bottom: 18px; }
.soc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.soc-row:last-child { border-bottom: 0; }
.soc-row-name { flex: 1; display: flex; flex-direction: column; font-family: var(--display); font-size: 17px; color: var(--ink); }
.soc-row-name small { font-family: var(--body); font-size: 12px; color: var(--muted); }
.soc-find { margin-bottom: 16px; }
.soc-empty { font-family: var(--display); font-style: italic; color: var(--muted); }
.soc-profile { display: grid; gap: 12px; max-width: 560px; }
.soc-profile label { display: grid; gap: 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mauve); }
.soc-profile input:not([type=checkbox]), .soc-profile textarea, .soc-profile select {
  font-family: var(--body); font-size: 15px; letter-spacing: normal; text-transform: none; color: var(--ink);
  padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.7);
}
.soc-profile .soc-check { display: flex; align-items: center; gap: 10px; font-size: 14px; letter-spacing: normal; text-transform: none; color: var(--ink); }
.soc-photo { display: flex; align-items: center; gap: 16px; }
.soc-photo .soc-avatar { font-size: 34px; }
#view-social button, #view-profile .soc-zone button {
  font-family: var(--body); font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  padding: 10px 20px; border-radius: 999px; border: 0; cursor: pointer; color: #fff;
  background: var(--fill);
}
#view-social button.ghost, #view-profile .soc-zone button.ghost { color: var(--mocha); background: rgba(255,255,255,.6); border: 1px solid var(--line); }
.soc-profile button[type=submit] { justify-self: start; padding: 12px 30px; }

.soc-chats { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .soc-chats { grid-template-columns: 1fr; } }
.soc-threads { padding: 8px; }
.soc-zone .soc-thread {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 16px; text-align: left;
  background: none; color: var(--ink); letter-spacing: normal; text-transform: none; font-size: 14px;
}
.soc-zone .soc-thread.is-open, .soc-zone .soc-thread:hover { background: rgba(17,17,17,.16); }
.soc-thread .soc-row-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.soc-chat { display: flex; flex-direction: column; height: calc(var(--vh) - var(--topbar) - 260px); min-height: 360px; }
.soc-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 12px; }
.soc-msg { align-self: flex-start; max-width: 75%; display: flex; flex-direction: column; gap: 2px; }
.soc-msg span { padding: 9px 14px; border-radius: 18px 18px 18px 6px; background: rgba(255,255,255,.8); font-size: 14px; color: var(--ink); }
.soc-msg small { font-size: 11px; color: var(--muted); padding-left: 6px; }
.soc-msg.mine { align-self: flex-end; }
.soc-msg.mine span { border-radius: 18px 18px 6px 18px; color: #fff; background: var(--fill); }
.soc-row button + button { margin-left: 6px; }

.soc-card { max-width: 420px; margin: 10px auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 28px; text-align: center; }
.soc-card .soc-avatar { font-size: 38px; margin-bottom: 8px; color: #fff; }
.soc-card b { font-family: var(--display); font-weight: 400; font-size: 30px; color: var(--ink); }
.soc-card span { font-size: 14px; color: var(--muted); }
.soc-card em { font-family: var(--display); font-size: 15px; color: var(--mauve); margin: 6px 0 14px; }

/* rooms: the workbook's arches (.train-grid .train-card), in the rooms' own colours */
.soc-zone .soc-room { --c1: #A5738A; --c2: #A5738A; letter-spacing: normal; text-transform: none; padding: 24px 18px 26px; border-radius: 999px 999px 46px 46px; }
.soc-rooms { margin-bottom: 22px; }
/* Discover: a round ✕ and a round ✓ */
.soc-zone .soc-round { width: 58px; height: 58px; padding: 0; border-radius: 50%; font-size: 22px; letter-spacing: 0; display: grid; place-items: center; }
.soc-zone .soc-round.ghost { color: #B4544A; }
.soc-card .soc-actions { gap: 22px; }

/* Social, as one page: Discover's card on a little stack, then her rooms */
#view-social .display { margin: 4px 0 18px; }
.soc-stack { position: relative; max-width: 420px; margin: 6px auto 30px; }
.soc-stack .soc-card { position: relative; z-index: 2; margin: 0; background: rgba(255,255,255,.58); border-color: rgba(255,255,255,.9); }
.soc-behind { position: absolute; inset: 0; border-radius: var(--radius); background: rgba(255,255,255,.34); border: 1px solid rgba(255,255,255,.7); transform: rotate(3deg) scale(.97); box-shadow: var(--shadow); }
.soc-behind.two { transform: rotate(-4deg) scale(.95); background: rgba(255,255,255,.22); }
.soc-discover-empty { text-align: center; margin: 10px 0 26px; }
.soc-rooms-head { margin-top: 8px; }
.soc-room-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.soc-room-tools > input { flex: 1 1 220px; font-family: var(--body); font-size: 14px; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.7); }
.soc-room-tools .add-row { flex: 1 1 320px; margin: 0; }
#soc-more-rooms { padding: 9px 18px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; border-radius: 999px; cursor: pointer; }

/* the chat: a bubble in the corner of every page, a glass panel above it */
.soc-widget { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.soc-widget[hidden] { display: none; }
.soc-bubble { width: 58px; height: 58px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); cursor: pointer; display: grid; place-items: center; position: relative;
  background: linear-gradient(135deg, rgba(17,17,17,.92), rgba(165,115,138,.92)); box-shadow: 0 18px 40px -16px rgba(17,17,17,.7); }
.soc-bubble svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.soc-panel { width: min(360px, calc(100vw - 44px)); height: min(500px, calc(100vh - 140px)); margin: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,.82), rgba(255,255,255,.78)); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.soc-panel[hidden] { display: none; }
.soc-panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.soc-panel-head b { flex: 1; font-family: var(--display); font-weight: 400; font-size: 19px; color: var(--ink); }
.soc-back { border: 0; background: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--mocha); padding: 0 4px; }
.soc-panel .soc-threads { overflow-y: auto; padding: 8px; }
.soc-panel .soc-thread { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: 14px; background: none; cursor: pointer; text-align: left; }
.soc-panel .soc-thread:hover { background: rgba(17,17,17,.16); }
.soc-panel .soc-log { flex: 1; overflow-y: auto; padding: 12px 14px; }
.soc-send { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.soc-send input { flex: 1; font-family: var(--body); font-size: 14px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.8); }
.soc-send button { width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; font-size: 17px; background: var(--fill); }

/* her profile as a page */
#view-profile .profile-page { max-width: 720px; margin: 0 auto; }
#view-profile .profile-page.account-card { max-width: 720px; }
#view-profile .soc-profile { max-width: none; }
.invite-fit { font-family: var(--display); font-style: italic; color: var(--mocha); }
.invite-fit.is-clash { color: #B4544A; }

/* ── social: one room (rooms.js) — the app's room, on the site ── */
#view-social.in-room > :not(#social-room) { display: none; }
/* the site styles every Social button; the room's own buttons start from plain */
:is(#social-room, #post-overlay, #compose-overlay) button:where(:not(.x)) { background: none; border: 0; box-shadow: none; text-transform: none; letter-spacing: normal; color: inherit; padding: 0; min-height: 0; }
:is(#social-room, #post-overlay, #compose-overlay) .room-compose > button[type=submit] { padding: 12px 34px; border-radius: 999px; background: var(--fill); color: #fff; font: 13px var(--body); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-compose [hidden] { display: none !important; }

#social-room { max-width: 760px; margin: 0 auto; width: 100%; }
:is(#social-room, #post-overlay, #compose-overlay) .room-back { border: 0; background: none; padding: 0; font: 15px var(--body); color: var(--cocoa); cursor: pointer; margin-bottom: 14px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-blurb { margin: -4px 0 4px; font-size: 16px; color: var(--mocha); }
:is(#social-room, #post-overlay, #compose-overlay) .room-members { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
:is(#social-room, #post-overlay, #compose-overlay) .room-title-row { display: flex; align-items: center; gap: 14px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-title-row .display { flex: 1; }
:is(#social-room, #post-overlay, #compose-overlay) .room-col { display: grid; gap: 12px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-search { font: 16px var(--body); padding: 12px 20px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.65); color: var(--ink); }
:is(#social-room, #post-overlay, #compose-overlay) .room-tabs { display: flex; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.55); border: 1px solid var(--line); }
:is(#social-room, #post-overlay, #compose-overlay) .room-tabs button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 999px; font: 17px var(--display); color: var(--cocoa); cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-tabs button.on { background: var(--mauve); color: #fff; }
:is(#social-room, #post-overlay, #compose-overlay) .room-composer { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 20px; border-radius: 999px; cursor: pointer; text-align: left; font: 15px var(--body); color: var(--muted); }
:is(#social-room, #post-overlay, #compose-overlay) .room-composer span { flex: 1; }
:is(#social-room, #post-overlay, #compose-overlay) .room-composer i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--cocoa); color: #fff; font-style: normal; font-size: 20px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-post { display: grid; gap: 10px; padding: 18px 20px; text-align: left; }
:is(#social-room, #post-overlay, #compose-overlay) .room-post[data-room-open] { cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-post header { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--cocoa); }
:is(#social-room, #post-overlay, #compose-overlay) .room-post header span:not(.soc-avatar) { flex: 1; }
:is(#social-room, #post-overlay, #compose-overlay) .room-kind { font-style: normal; font-size: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(165,115,138,.16); color: var(--cocoa); }
:is(#social-room, #post-overlay, #compose-overlay) .room-kind.celebrate { background: rgba(143,99,80,.25); }
:is(#social-room, #post-overlay, #compose-overlay) .room-post h3 { margin: 0; font: 400 21px/1.2 var(--display); color: var(--ink); }
:is(#social-room, #post-overlay, #compose-overlay) .room-post p { font-style: normal; margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); white-space: pre-line; }
:is(#social-room, #post-overlay, #compose-overlay) .room-clip { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
:is(#social-room, #post-overlay, #compose-overlay) .room-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-box { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.6); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
:is(#social-room, #post-overlay, #compose-overlay) .room-box small { font-size: 10px; letter-spacing: .16em; color: var(--mauve); }
:is(#social-room, #post-overlay, #compose-overlay) .room-box b { font: 400 17px var(--display); color: var(--ink); }
:is(#social-room, #post-overlay, #compose-overlay) .room-box a { color: var(--mauve); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(#social-room, #post-overlay, #compose-overlay) .room-row { grid-template-columns: 1fr auto; align-items: center; }
:is(#social-room, #post-overlay, #compose-overlay) .room-row > span { display: grid; gap: 3px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-row button { border: 0; padding: 8px 18px; border-radius: 999px; background: var(--mauve); color: #fff; font: 13px var(--body); cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-row em { font-style: normal; color: var(--mauve); }
:is(#social-room, #post-overlay, #compose-overlay) .room-tags { display: flex; flex-wrap: wrap; gap: 6px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-tags button, :is(#social-room, #post-overlay, #compose-overlay) .room-topics button {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.7);
  font: 13px var(--body); color: var(--cocoa); cursor: pointer;
}
:is(#social-room, #post-overlay, #compose-overlay) .room-topics { display: flex; flex-wrap: wrap; gap: 8px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-topics button { font-size: 15px; padding: 9px 16px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-topics button.on { border-color: var(--mauve); }
:is(#social-room, #post-overlay, #compose-overlay) .room-post footer { display: flex; align-items: center; gap: 22px; padding-top: 10px; border-top: 1px solid var(--line); }
:is(#social-room, #post-overlay, #compose-overlay) .room-act { border: 0; background: none; padding: 0; font: 13px var(--body); color: var(--muted); cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-act.on { color: var(--mauve); }
:is(#social-room, #post-overlay, #compose-overlay) .room-save { margin-left: auto; }
:is(#social-room, #post-overlay, #compose-overlay) .room-follow, :is(#social-room, #post-overlay, #compose-overlay) .room-cta { border: 1px solid var(--mauve); border-radius: 999px; background: none; color: var(--mauve); padding: 8px 18px; font: 14px var(--body); cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-follow.on, :is(#social-room, #post-overlay, #compose-overlay) .room-cta { background: var(--mauve); color: #fff; }
:is(#social-room, #post-overlay, #compose-overlay) .room-cta { padding: 14px; font: 18px var(--display); }
:is(#social-room, #post-overlay, #compose-overlay) .room-hit { display: grid; gap: 2px; padding: 14px 18px; text-align: left; cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-hit b { font: 400 17px var(--display); color: var(--ink); }
:is(#social-room, #post-overlay, #compose-overlay) .room-hit span { font-size: 13px; color: var(--muted); }
:is(#social-room, #post-overlay, #compose-overlay) .room-scope { margin: 0; }
/* the post overlay: the post, its replies, a box to answer */
#post-body { display: grid; gap: 12px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-delete { justify-self: start; border: 0; background: none; padding: 0; font: 13px var(--body); color: #B4544A; cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-replies { display: grid; gap: 12px; padding: 4px 6px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-reply { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; color: var(--ink); }
:is(#social-room, #post-overlay, #compose-overlay) .room-reply > span:not(.soc-avatar) { flex: 1; display: grid; gap: 2px; padding: 10px 14px; border-radius: 18px; background: rgba(255,255,255,.7); border: 1px solid var(--line); }
:is(#social-room, #post-overlay, #compose-overlay) .room-reply small { font-size: 12px; color: var(--muted); }
:is(#social-room, #post-overlay, #compose-overlay) .room-x { border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-reply-form { display: grid; gap: 8px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-reply-row { display: flex; gap: 8px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-reply-row input { flex: 1; font: 15px var(--body); padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.75); }
:is(#social-room, #post-overlay, #compose-overlay) .room-reply-row button { border: 0; border-radius: 999px; padding: 0 18px; background: var(--cocoa); color: #fff; font: 15px var(--body); cursor: pointer; }
/* writing a post */
:is(#social-room, #post-overlay, #compose-overlay) .room-compose { display: grid; gap: 12px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-compose .chips { margin: 0; }
:is(#social-room, #post-overlay, #compose-overlay) .room-compose .chip { cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-in { font: 15px var(--body); padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.75); color: var(--ink); resize: vertical; }
:is(#social-room, #post-overlay, #compose-overlay) .room-in-title { font: 19px var(--display); }
:is(#social-room, #post-overlay, #compose-overlay) .room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-grid select, :is(#social-room, #post-overlay, #compose-overlay) .room-grid input { font: 14px var(--body); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.75); }
:is(#social-room, #post-overlay, #compose-overlay) .room-wide { grid-column: 1 / -1; }
:is(#social-room, #post-overlay, #compose-overlay) .room-related { display: grid; gap: 4px; }
:is(#social-room, #post-overlay, #compose-overlay) .room-related:empty { display: none; }
:is(#social-room, #post-overlay, #compose-overlay) .room-related small { font-size: 11px; letter-spacing: .14em; color: var(--mauve); }
:is(#social-room, #post-overlay, #compose-overlay) .room-related button { text-align: left; border: 0; background: none; padding: 4px 0; font: 16px var(--display); color: var(--ink); cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-photo-pick { text-align: center; padding: 12px; border-radius: 14px; border: 1.5px dashed rgba(17,17,17,.6); color: var(--mauve); cursor: pointer; }
:is(#social-room, #post-overlay, #compose-overlay) .room-compose > button[type=submit] { justify-self: end; }
:is(#social-room, #post-overlay, #compose-overlay) .room-compose .eyebrow { margin: 4px 0 0; }
/* buttons that are cards keep their glass */
:is(#social-room, #post-overlay, #compose-overlay) button.room-composer, :is(#social-room, #post-overlay, #compose-overlay) button.room-hit { background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.75); box-shadow: 0 10px 24px -18px rgba(0,0,0,.45); }

/* ── pop-ups: one design ──────────────────────────────────
   Every pop-up is the same card on the same dimmed page: left-aligned, one size of title, a round
   × in the top right corner, and on a phone a sheet that rises from the bottom. The two older
   families (.overlay > .overlay-card and .glass-scrim > .glass-card) both land here; what a card
   holds is still styled where it always was. */
.overlay, .glass-scrim {
  background: rgba(0,0,0,.38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: clamp(14px, 3vw, 32px); animation: fade .2s ease both;
}
.overlay > .overlay-card, .glass-scrim > .glass-card {
  position: relative; max-height: calc(var(--vh, 100vh) - 40px); overflow-y: auto;
  padding: clamp(22px, 3vw, 32px); border-radius: 28px; text-align: left;
  background: linear-gradient(165deg, #FFFFFF, #F7F6F4 70%, #EFEDEA);
  border: 1px solid rgba(255,255,255,.7); box-shadow: 0 30px 80px -28px rgba(0,0,0,.55);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  animation: pop-in .26s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.overlay > .overlay-card { width: 100%; max-width: 460px; }
.overlay > .meal-card { max-width: 600px; }
.overlay > .meal-card.wide { max-width: 720px; }
.overlay > .meal-card.narrow { max-width: 420px; }
.overlay > .habits-card { max-width: 820px; }
.overlay > .workout-card { max-width: 440px; }

.overlay > .overlay-card .display, .glass-scrim > .glass-card:not(.train-sheet) .display {
  font-size: clamp(22px, 2.6vw, 28px); line-height: 1.15; margin: 0 0 16px; padding-right: 40px;
  color: var(--cocoa); text-align: left;
}
.glass-scrim > .glass-card header .display { margin: 0; }
/* the two that are a moment, not a form: the celebration and the workout */
#overlay > .overlay-card, .overlay > .workout-card { text-align: center; }
#overlay > .overlay-card .display, .overlay > .workout-card .display { text-align: center; padding-right: 0; }
#overlay > .overlay-card .display { font-size: clamp(26px, 4vw, 36px); margin: 16px 0 12px; }

/* the one way to close */
:is(.overlay-card, .glass-card) :is(.pop-x, button.x, .sheet-x, .workout-x), #cat-close, #add-close {
  position: absolute; top: 14px; right: 14px; left: auto; z-index: 3; display: block;
  width: 34px; height: 34px; padding: 0; margin: 0; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 0; letter-spacing: 0; color: var(--cocoa); opacity: 1;
  background: rgba(255,255,255,.75); box-shadow: 0 1px 4px rgba(0,0,0,.12);
  transition: background .15s, color .15s;
}
:is(.overlay-card, .glass-card) :is(.pop-x, button.x, .sheet-x, .workout-x)::before,
:is(.overlay-card, .glass-card) :is(.pop-x, button.x, .sheet-x, .workout-x)::after,
:is(#cat-close, #add-close)::before, :is(#cat-close, #add-close)::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 13px; height: 1.5px; border-radius: 1px;
  background: currentColor; transform: translate(-50%, -50%) rotate(45deg);
}
:is(.overlay-card, .glass-card) :is(.pop-x, button.x, .sheet-x, .workout-x)::after,
:is(#cat-close, #add-close)::after { transform: translate(-50%, -50%) rotate(-45deg); }
:is(.overlay-card, .glass-card) :is(.pop-x, button.x, .sheet-x, .workout-x):hover, #cat-close:hover, #add-close:hover {
  background: var(--fill); color: #fff; opacity: 1;
}

/* fields are the same soft rectangle in every pop-up, and a number is typed, not stepped */
:is(.overlay, .glass-scrim) :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], .num), select:not(.num), textarea) { border-radius: 14px; }
:is(.overlay, .glass-scrim) input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
:is(.overlay, .glass-scrim) input[type="number"]::-webkit-outer-spin-button,
:is(.overlay, .glass-scrim) input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* on a phone, a sheet from the bottom edge */
@media (max-width: 620px) {
  .overlay, .glass-scrim { align-items: end; justify-items: center; padding: 0; }
  .overlay > .overlay-card, .glass-scrim > .glass-card {
    width: 100%; max-width: none; max-height: calc(var(--vh, 100vh) - 28px);
    border-radius: 26px 26px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom));
    animation: sheet-up .28s cubic-bezier(.2,.8,.3,1) both;
  }
}
@keyframes sheet-up { from { opacity: 0; transform: translateY(40px); } }

/* Add / Edit task: a title in proportion to the form, labels you can read, fields to match */
#add-task-overlay > .overlay-card { max-width: 440px; }
#add-task-overlay .display { font-size: 24px; margin-bottom: 18px; }
#add-task-overlay .task-form { gap: 14px; }
#add-task-overlay .task-form label { font-size: 13px; letter-spacing: .02em; color: var(--mocha); gap: 6px; }
#add-task-overlay .task-form input, #add-task-overlay .task-form select { height: 46px; font-size: 15px; border-radius: 14px; padding: 0 14px; }
#add-task-overlay .task-form select { padding-right: 36px; }
#add-task-overlay .task-form button[type="submit"] { height: 48px; margin-top: 4px; font-size: 12px; }

/* ── training: one typeface for the words, one colour ───────
   The serif is for names (the session, the exercise); everything else is the body face, ink on
   the card, with a lighter ink for what is secondary. No mauve, no italics, no spaced capitals
   in the training sheet, the exercise and the workout. */
.train-sheet, .ex-card, .workout-card { --tx: var(--ink); --tx2: rgba(17,17,17,.58); }
:where(.train-sheet, .ex-card, .workout-card) :where(p, li, span, small, b, em, .eyebrow, .meta, .reps) {
  font-family: var(--body); font-style: normal; color: var(--tx2);
}
.workout-card :is(.workout-count, #workout-detail, #workout-round) { font-family: var(--body); font-style: normal; color: var(--tx2); }
.workout-card #workout-reps { font-family: var(--body); }
:is(.train-sheet, .ex-card, .workout-card) :is(h2, h3, .ex .name, #workout-name) { color: var(--tx); }
.train-sheet .session h2, .workout-card #workout-name, .ex-card .display { font-family: var(--display); }
.train-sheet .session-hero .meta { letter-spacing: .04em; text-transform: none; font-size: 14px; color: var(--tx); }
.train-sheet .session .props b, :is(.ex-card, .workout-card) .eyebrow { font-size: 12px; letter-spacing: .04em; text-transform: none; color: var(--tx2); }
.train-sheet .session .props li, .ex-card #ex-tools li { color: var(--tx); background: rgba(255,255,255,.6); border: 1px solid rgba(17,17,17,.12); }
.train-sheet .duration-chip { color: var(--tx); border-color: rgba(17,17,17,.25); }
.train-sheet .block h3 { font-family: var(--display); color: var(--tx); }
.train-sheet .ex .reps { font-size: 13px; color: var(--tx2); }
.train-sheet .ex:hover .name { color: var(--tx); text-decoration: underline; text-decoration-color: rgba(17,17,17,.3); text-underline-offset: 3px; }
/* the list is the exercises: no cue under each, no setup note, no box behind the drawing */
.train-sheet .blocknote { display: none; }
.ex .sketch { background: none; border-radius: 0; }
/* the photo runs the full width, level with Start workout; the × sits in the corner beside it */
.glass-scrim > .glass-card.train-sheet { padding: 48px 48px 32px; }
.train-sheet .session-hero { margin-right: 0; }
.glass-card.train-sheet > .sheet-x { top: 8px; right: 8px; }
.workout-card .workout-block-pill { background: none; padding: 0; font-size: 12px; letter-spacing: .04em; text-transform: none; color: var(--tx2); }
.workout-card .workout-reps-pill { background: rgba(17,17,17,.06); }
.workout-card .workout-reps-pill #workout-reps { font-size: 17px; color: var(--tx); }
.workout-card .workout-dot.is-done, .workout-card .workout-dot.is-current { background: var(--tx); }
.workout-card .workout-dot { background: rgba(17,17,17,.15); }

/* an exercise: the drawing on the left; the instruction, the tools and the repetitions beside it */
.ex-card { max-width: 520px; }
.ex-body { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 22px; align-items: start; }
.ex-body:has(.ex-sketch[hidden]) { grid-template-columns: 1fr; }
.ex-sketch { width: 140px; height: 140px; object-fit: contain; }
.ex-sketch[hidden] { display: none; }
.ex-card .ex-body > div > div { margin: 0 0 16px; text-align: left; }
.ex-card .ex-reps { font-family: var(--body); font-size: 16px; color: var(--tx); margin: 0; }
.ex-card #ex-detail { color: var(--tx); }
@media (max-width: 520px) { .ex-body { grid-template-columns: 90px minmax(0, 1fr); gap: 14px; } .ex-sketch { width: 90px; height: 90px; } }

/* meals: the words for what is counted in mauve, every figure in ink */
.goal-box b, .goal-box small { color: var(--ink); }
.goal-box small { font-family: var(--body); }
.macro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; text-align: center; }
.macro-grid span { display: flex; flex-direction: column; gap: 1px; padding: 6px 2px; border-radius: 10px; background: rgba(255,255,255,.65); }
.book-item .macro-grid b { display: block; height: auto; overflow: visible; font-family: var(--body); font-weight: 600; font-size: 14px; line-height: 1.2; color: var(--ink); }
.macro-grid i { font-style: normal; font-size: 10px; letter-spacing: .04em; color: var(--mauve); }

/* ── neutral ──────────────────────────────────────────────
   Black on a pale warm grey, white cards, one clean sans. Brown and mauve only where something
   needs a quiet accent. Last in the file, so it is the one decision about how the app looks. */

.display { font-weight: 600; letter-spacing: -.025em; line-height: 1.02; }
.display em { font-style: normal; color: var(--muted); }
h1, h2, h3 { letter-spacing: -.01em; }
.eyebrow { font-family: var(--body); font-weight: 600; letter-spacing: .14em; color: var(--muted); }


/* surfaces: plain white, a hairline, a soft shadow — no frost, no gradient */
.card, .session, .train-day {
  background: #fff;
}
.card, .session, .train-day, .bud-stats > .stat, .monthpick, .cat-figures div, .debt, .item, .daybtn {
  border-color: rgba(17,17,17,.07);
  box-shadow: var(--shadow);
}
.card, .session, .bud-stats > .stat { backdrop-filter: none; -webkit-backdrop-filter: none; }
.item { background: #fff; }
.item.done { background: #F7F6F4; }

/* buttons: black and white */
button.ghost, .ghost { color: var(--ink) !important; background: #fff !important; border: 1px solid rgba(17,17,17,.14) !important; }
.chip { color: var(--ink); background: #fff; border-color: rgba(17,17,17,.12); }
.chip.is-active { background: #111; color: #fff; border-color: #111; }
.start-workout-btn { background: #111; }

/* pop-ups: white */
.overlay, .glass-scrim { background: rgba(17,17,17,.38); }
.overlay > .overlay-card, .glass-scrim > .glass-card { background: #fff; border: 1px solid rgba(17,17,17,.06); box-shadow: 0 30px 80px -30px rgba(0,0,0,.45); }
:is(.overlay-card, .glass-card) :is(.pop-x, button.x, .sheet-x, .workout-x), #cat-close, #add-close { background: #F1F0EE; box-shadow: none; color: #111; }
:is(.overlay-card, .glass-card) :is(.pop-x, button.x, .sheet-x, .workout-x):hover, #cat-close:hover, #add-close:hover { background: #111; color: #fff; }

/* a tick is black; the progress through the day is black on grey */
.item.done .box, .box.on { background: #111; border-color: #111; }
.progress { background: rgba(17,17,17,.08); }
.progress i { background: #111; }

/* the quiet accents that stay: today's ring in brown, the words for macros in mauve */
.ring-fill { stroke: var(--tan); }

/* the last warm touches: a white mark on the bar, today outlined in black, the affirmation upright */
.train-day.is-today { box-shadow: 0 0 0 1.5px #111, var(--shadow); }
.cal-day.today { box-shadow: 0 0 0 2px #111; }
.wr-dot.today { box-shadow: 0 0 0 2px rgba(17,17,17,.25); }
.affirm-strip { font-family: var(--body); font-style: normal; color: var(--muted); font-weight: 500; }
.affirm-strip span:last-child { color: var(--ink); }
.item .txt b, .slot .item .txt b { font-family: var(--body); font-weight: 500; }
/* the board, the notes pinboard and the money tiles: flat, not a grey wash */
.bud-stats .stat, .bud-stats > .stat { background: #fff; }
#board.board { background: #fff; }
.notes-board { background: radial-gradient(circle at 1px 1px, rgba(17,17,17,.12) 1px, transparent 0) 0 0 / 22px 22px, #fff; }
#add-task-overlay .task-form label, .account-card .task-form label { color: var(--muted); }

/* Version 3: the black and white of version 1, with depth — the bar fades from black into a
   graphite grey, and the page has a slow grey fade behind it where the warm one used to be. */
body {
  background:
    radial-gradient(1100px 700px at 10% -10%, #E4E2DF 0%, transparent 62%),
    radial-gradient(900px 640px at 95% 0%,    #DCDAD7 0%, transparent 58%),
    radial-gradient(1000px 800px at 50% 110%, #E1DFDC 0%, transparent 60%),
    #F3F2F0;
  background-attachment: fixed;
}
body::before { background: radial-gradient(circle, #D4D1CD, transparent 66%); opacity: .7; }
body::after { background: radial-gradient(circle, #CBC8C4, transparent 66%); opacity: .6; }
.topbar::before {
  background: linear-gradient(100deg, #0E0E0E 0%, #1F1F1F 45%, #4A4847 100%);
  border: 1px solid rgba(255,255,255,.08); backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 20px 44px -24px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
}
.topbar .brandname { color: #fff; font-family: var(--display); font-weight: 600; letter-spacing: .22em; }
.topbar .mark { filter: grayscale(1) brightness(3); }
.tabs { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
.tab { font-weight: 500; letter-spacing: .08em; color: rgba(255,255,255,.62); }
.tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.tab.is-active { background: #fff; color: #111; box-shadow: none; }
.topbar .account-avatar { background: #fff; color: #111; box-shadow: none; }

/* ── version 4: black and grey ─────────────────────────────
   Every accent the app used to tint mauve or brown is a dark grey now. Colour is kept only where
   it is the content: the vision board's tiles, the categories in Where it goes and beside each
   expense, the sticky notes — and one mauve mark on a habit in the day. */
:root {
  --mauve: #3C3C3C; --rose: #3C3C3C;
  --tan: #5A5A5A;   --mocha: #5A5A5A;
  --peach: #CFCFCF;
}

/* the bar: just the tabs, no box around them */
.tabs { background: none; border: 0; padding: 0; }

/* rooms and the workbook: rounded cards like the week's, not arches; grey, not brown */
.train-grid .train-card {
  aspect-ratio: 4 / 5; border-radius: 22px;
  --c1: #3A3A3A; --c2: #111;
}
.train-grid .train-card b { letter-spacing: .06em; }

/* the day: a habit carries the mauve mark, a task none, what another tab planned a grey one */
.item.kind-habit { border-left: 3px solid #A5738A; }
.item.kind-task { border-left: 1px solid rgba(17,17,17,.07); }
.item.kind-plan { border-left: 3px solid #BDBDBD; }
.item.overdue { border-left: 3px solid #111; }

/* finances: grey wheels, grey highlights, figures in ink — the warning brown goes */
.wheel svg circle + circle { stroke: #6B6B6B; }
.wheel.is-over svg circle + circle { stroke: #111; }
.wheel.is-over .wheel-num, .bud-stats .is-over b, .cash .is-over .diff, .rows .is-over .actual,
.cat-figures .is-over b, .goal-box.over b { color: #111; fill: #111; }
.prev-hint { background: #6B6B6B; }
.linky { color: var(--muted); }
.tx .is-new { background: rgba(17,17,17,.05); box-shadow: inset 3px 0 0 #9A9A9A; }
/* a total in bold has its figures in bold */
.cash tfoot td, .rows tfoot td, .rows.exp tr.part td { font-weight: 600; color: var(--ink); }
.rows.exp tr.part th { color: var(--ink); }
/* the new line's date fits whole */
.tx-card .add-row { grid-template-columns: 88px minmax(0, 1fr) 56px 84px auto; }

/* the month as a sheet: habits down the side, days across, a tick per habit per day */
.month-grid { margin-top: 22px; padding: 16px 18px; border-radius: var(--radius); background: #fff; border: 1px solid rgba(17,17,17,.07); box-shadow: var(--shadow); }
.month-grid .section-title { margin: 0 0 12px; }
.mg-scroll { overflow-x: auto; }
.mg { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 11px; color: var(--muted); }
.mg th { font-weight: 500; }
.mg thead th { text-align: center; min-width: 22px; color: var(--ink); line-height: 1.2; }
.mg thead th span { display: block; font-size: 9px; color: var(--muted); }
.mg thead th.is-today { color: #fff; background: #111; border-radius: 6px; }
.mg thead th.is-today span { color: rgba(255,255,255,.7); }
.mg tbody th, .mg tfoot th { text-align: left; white-space: nowrap; padding-right: 10px; font-size: 13px; color: var(--ink); position: sticky; left: 0; background: #fff; }
.mg td { text-align: center; }
.mg-cell { width: 20px; height: 20px; padding: 0; border-radius: 5px; border: 1.5px solid rgba(17,17,17,.22); background: none; cursor: pointer; transition: background .15s; }
.mg-cell:hover:not(:disabled) { border-color: #111; }
.mg-cell.on { background: #111; border-color: #111; }
.mg-cell:disabled { opacity: .3; cursor: default; }
.mg td.off::after { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: rgba(17,17,17,.15); }
.mg .mg-sum { padding-left: 10px; white-space: nowrap; color: var(--ink); font-weight: 600; }
.mg tfoot td { padding-top: 4px; color: var(--muted); }
