/* ================= tokens ================= */
:root {
  /* warm neutral canvas, one vivid colour per person, violet when it's both of you */
  --paper: #F5F4F0;
  --surface: #FFFFFF;
  --surface-2: #EEECE6;
  --ink: #17161C;
  --on-ink: #FFFFFF;
  --muted: #6E6C77;
  --line: #E7E4DD;
  /* each person keeps one colour on both phones: --p1 = first member, --p2 = second */
  --p1: #4C6BFF;
  --p2: #F2557E;
  --me: var(--p1);
  --partner: var(--p2);
  --joint: #8B5CF6;
  --gold: #F2A20C;
  --slip: #E5484D;
  --free: #0FA37F;
  --now: #FF3B30;
  --accent: var(--me);
  --grid: #ECE9E3;
  --grid-half: #F3F1EC;
  --past: rgba(23, 22, 28, .03);

  --display: 'Unbounded', 'Golos Text', system-ui, sans-serif;
  --body: 'Golos Text', system-ui, -apple-system, sans-serif;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 22, 28, .04), 0 2px 10px rgba(23, 22, 28, .04);
  --shadow-md: 0 2px 6px rgba(23, 22, 28, .05), 0 10px 30px rgba(23, 22, 28, .08);
  --shadow-lg: 0 20px 60px rgba(23, 22, 28, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --top-h: 62px;
  --tabs-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0E0E12;
    --surface: #18181E;
    --surface-2: #23232B;
    --ink: #F2F2F5;
    --on-ink: #0E0E12;
    --muted: #9C9AA7;
    --line: #2A2A33;
    --p1: #7C93FF;
    --p2: #FF7C9E;
    --joint: #A98BFF;
    --gold: #FFB547;
    --slip: #FF6369;
    --free: #34D399;
    --grid: #22222A;
    --grid-half: #1C1C23;
    --past: rgba(0, 0, 0, .2);
    --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ================= base ================= */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* the page never moves sideways on a phone */
  /* no sideways drift on phones, without turning html/body into scroll boxes (that breaks scrolling in Safari and some Chrome builds) */
  overflow-x: clip; overscroll-behavior-x: none;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--body);
  min-height: 100dvh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  overflow-x: clip; overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img, svg { max-width: 100%; }

/* ---- top: person switch with a sliding thumb ---- */
.top {
  position: sticky; top: 0; z-index: 5;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
}
.who {
  --k: 0;
  position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  max-width: 560px; margin: 0 auto;
  background: var(--surface-2); border-radius: 999px; padding: 4px;
}
.who::before {
  content: ''; position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc((100% - 16px) / 3); border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-sm);
  transform: translateX(calc(var(--k) * (100% + 4px)));
  transition: transform .45s var(--spring);
}
.who button {
  position: relative; z-index: 1;
  border: 0; background: none; border-radius: 999px; padding: 9px 6px;
  font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--muted); transition: color .25s;
  min-width: 0; white-space: nowrap;
}
.who button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c); }
.dot.pair { width: 15px; background: linear-gradient(90deg, var(--p1) 50%, var(--p2) 50%); border-radius: 5px; }

main { max-width: 560px; margin: 0 auto; padding: 8px 16px 24px; outline: none; }
.loading, .empty { color: var(--muted); }
.empty { text-align: center; padding: 28px 12px; line-height: 1.5; }

/* ---- section head ---- */
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 14px; }
.head h1 { font: 700 24px/1.15 var(--display); margin: 0; letter-spacing: -0.02em; }
.head .sub { color: var(--muted); font-size: 14px; margin: 3px 0 0; }

.btn {
  border: 0; background: var(--surface); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line);
  padding: 10px 18px; font-weight: 600; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s, box-shadow .2s, opacity .2s;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.primary {
  background: var(--accent); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn.ghost { background: none; }
.btn.danger { color: var(--slip); }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ================= goals ================= */
.goals { display: grid; gap: 12px; }
.goal {
  background: var(--surface); border-radius: var(--r-lg); padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
}
.goal.joint { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px color-mix(in srgb, var(--joint) 40%, transparent); }
.goal-top { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.goal-title { margin: 0; font-weight: 600; font-size: 17px; line-height: 1.3; }
.goal-title button { all: unset; cursor: pointer; }
.goal-title button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.goal-kind { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.streak { text-align: right; line-height: 1; }
.streak b {
  display: block; font: 700 34px/1 var(--display); letter-spacing: -0.03em;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--partner)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.streak span { color: var(--muted); font-size: 12px; }

/* thread of days — one row per participant */
.thread { margin: 16px 0 4px; display: grid; gap: 7px; }
.row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; }
.row-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beads { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.bead {
  aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0;
  background: var(--surface-2); position: relative; max-width: 22px; justify-self: center; width: 100%;
  transition: transform .2s var(--spring);
}
.bead[data-s="done"], .bead[data-s="ok"] { background: var(--c); }
.bead[data-s="ok"] { opacity: .45; }
.bead[data-s="covered"] { background: none; box-shadow: inset 0 0 0 3px var(--c); }
.bead[data-s="slip"] { background: var(--slip); }
.bead[data-s="missed"] { background: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--muted) 60%, transparent); }
.bead[data-s="pending"] { background: none; box-shadow: inset 0 0 0 1.5px var(--c); }
.bead[data-s="off"], .bead[data-s="before"] { background: none; }
.bead[data-s="off"]::after { content: ''; position: absolute; inset: 45% 30%; background: var(--line); border-radius: 2px; }
.bead.joker::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px dashed var(--gold);
}
.bead.tap { cursor: pointer; }
.bead.tap:active { transform: scale(.8); }
.bead.today { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.thread-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding-left: 60px; }

.goal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.next { font-size: 14px; color: var(--muted); margin: 0; }
.next strong { color: var(--ink); font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check {
  border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600;
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .15s var(--ease), background-color .25s, color .25s, box-shadow .25s;
}
.check:active { transform: scale(.95); }
.check.is-done { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); box-shadow: none; }
.check.slip { background: none; color: var(--slip); box-shadow: inset 0 0 0 1.5px currentColor; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ================= wishes ================= */
.wish {
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: 14px; margin-bottom: 10px; display: grid; gap: 10px;
}
.wish.earned { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--gold); }
.wish.received { opacity: .6; }
.wish-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.wish-icon {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 21px;
  background: var(--surface-2);
}
.wish-main { min-width: 0; }
.wish h3 { margin: 1px 0 0; font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.wish h3 a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }
.wish-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.wish-meta .sep { opacity: .5; }
.wish-info { font-size: 13px; color: var(--muted); margin: 0; }
.price { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; background: var(--surface-2); white-space: nowrap; }
.chip.earned { background: var(--gold); color: #fff; }
.chip.planned { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); }
.wish-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ledger { list-style: none; padding: 4px 14px; margin: 0 0 18px; font-size: 14px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.ledger li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ledger li:last-child { border-bottom: 0; }
.lg-reason { flex: 1; min-width: 0; }
.lg-del, .lg-del-space { width: 28px; height: 28px; flex: none; }
.lg-del { border: 0; background: none; border-radius: 50%; color: var(--muted); font-size: 18px; line-height: 1; padding: 0; }
.lg-del:hover { background: var(--surface-2); color: var(--slip); }
.ledger .plus { color: var(--free); font-weight: 600; }
.ledger .minus { color: var(--slip); font-weight: 600; }

/* ================= tab bar ================= */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 5;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
}
.tabs button {
  border: 0; background: none; padding: 4px 4px 2px; font-size: 12px; font-weight: 600; color: var(--muted);
  display: grid; justify-items: center; gap: 3px; transition: color .25s;
}
.tabs svg {
  width: 52px; height: 30px; padding: 4px 15px; border-radius: 999px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: background-color .3s var(--ease), transform .3s var(--spring);
}
.tabs button[aria-current="page"] { color: var(--ink); }
.tabs button[aria-current="page"] svg { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tabs button:active svg { transform: scale(.9); }

/* ================= sheet ================= */
.sheet {
  border: 0; padding: 0; width: min(560px, 100%); max-width: 100%; max-height: 92dvh;
  margin: auto auto 0; border-radius: 28px 28px 0 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
  overflow-x: hidden; overscroll-behavior: contain;
}
/* grab bar: a real element so it can be dragged; the touch area is taller than the bar itself */
.sheet-grab { position: sticky; top: 0; z-index: 2; height: 22px; background: var(--surface); display: grid; place-items: center; cursor: grab; touch-action: none; }
.sheet-grab i { width: 40px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 45%, transparent); }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 28px; } .sheet-grab { display: none; } }
.sheet::backdrop { background: rgba(14, 14, 18, .42); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
#sheet-body { padding: 4px 20px calc(22px + env(safe-area-inset-bottom)); }
.sheet h2 { font: 700 19px/1.25 var(--display); margin: 0 0 16px; letter-spacing: -0.01em; }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.close {
  border: 0; background: var(--surface-2); border-radius: 50%; width: 34px; height: 34px; font-size: 18px; flex: none;
  transition: transform .15s var(--ease);
}
.close:active { transform: scale(.9); }

form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; margin: 0; }
input, select, textarea {
  border: 0; border-radius: 12px; background: var(--surface-2);
  padding: 11px 13px; font-size: 16px; width: 100%;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s, background-color .2s;
}
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
textarea { min-height: 70px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
input, select, textarea { min-width: 0; max-width: 100%; }
input[type=time], input[type=date] { -webkit-appearance: none; appearance: none; min-height: 46px; text-align: left; }
input[type=time]::-webkit-date-and-time-value, input[type=date]::-webkit-date-and-time-value { text-align: left; }

/* segmented choices */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 1px;
  text-align: center; padding: 9px 4px; border-radius: 10px; font-weight: 500; cursor: pointer; color: var(--muted);
  transition: background-color .25s var(--ease), color .2s, box-shadow .25s, transform .15s var(--ease);
}
.seg label:active { transform: scale(.96); }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg small { font-size: 11px; font-weight: 500; color: var(--muted); line-height: 1.2; }
.weekdays { grid-template-columns: repeat(7, 1fr); grid-auto-flow: row; }
.weekdays label { padding: 9px 0; }
.weekdays label:has(input:checked) { background: var(--accent); color: #fff; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 6px; }

/* category chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat { display: block; position: relative; }
.cat input, .seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; padding: 0; left: 0; top: 0; }
.cat span {
  display: inline-block; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background-color .2s, color .2s, transform .15s var(--ease); white-space: nowrap;
}
.cat:active span { transform: scale(.95); }
.cat input:checked + span { background: var(--ink); color: var(--on-ink); }
.cat input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* amount + currency */
.money-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.money-in input { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.money-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }

/* "Free skips  [− 2 +] / month" */
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.field-row b { display: block; font-size: 14px; font-weight: 500; }
.field-row .per { font-size: 14px; color: var(--muted); }
.stepper { display: grid; grid-template-columns: 36px 44px 36px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.stepper button {
  border: 0; background: var(--surface); width: 36px; height: 36px; border-radius: 9px; font-size: 18px; font-weight: 600;
  box-shadow: var(--shadow-sm); transition: transform .15s var(--ease);
}
.stepper button:active { transform: scale(.88); }
.stepper input {
  background: none; padding: 0; text-align: center; font-weight: 600; box-shadow: none !important;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.rewards { gap: 10px; }
.reward { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.reward select, .reward input { background: var(--surface); }
.reward-days { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.reward-days input[type=number] { width: 72px; flex: none; padding: 8px; text-align: center; }
.reward-days .close { margin-left: auto; background: var(--surface); }
.reward-got { margin-left: auto; color: var(--gold); font-weight: 600; }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 600; text-align: left; justify-self: start; }
.form-actions { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 4px; }
.form-actions .btn.primary { min-width: 120px; }

/* goal month view */
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-nav b { font-weight: 600; text-transform: capitalize; }
.gcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; font-size: 13px; }
.gcal .wd { color: var(--muted); font-size: 12px; padding-bottom: 4px; }
.gcal .d {
  aspect-ratio: 1; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
}
.gcal .d[data-s="ok"] { background: var(--accent); color: #fff; }
.gcal .d[data-s="joker"] { background: none; box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--ink); }
.gcal .d[data-s="reset"] { background: var(--slip); color: #fff; }
.gcal .d[data-s="pending"] { background: none; box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--ink); }
.gcal .d[data-s="off"] { background: none; }
.gcal .d.blank { background: none; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin: 12px 0 18px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.ms-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.ms-list li { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 14px; }
.ms-list li b { font-family: var(--display); font-weight: 500; font-size: 13px; }
.ms-list li.got { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }

/* ================= toast ================= */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 24px) scale(.96);
  background: var(--ink); color: var(--on-ink); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .45s var(--spring); max-width: calc(100% - 32px); z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding-right: 8px; }
.toast button { border: 0; background: color-mix(in srgb, var(--on-ink) 16%, transparent); color: inherit; border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 13px; }
.toast.celebrate { background: linear-gradient(135deg, var(--gold), color-mix(in srgb, var(--gold) 50%, var(--partner))); color: #fff; }

/* ================= calendar: ежедневник ================= */

main.wide { max-width: 620px; padding-bottom: 0; }
.day {
  position: relative; display: flex; flex-direction: column;
  height: calc(100dvh - var(--top-h) - var(--tabs-h) - 8px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}
.day.two { --lanes: 2; }
main.wide:has(.day.two) { max-width: 760px; }

.day-top { flex: none; padding: 2px 0 8px; }
.tl-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; margin: 0 -16px; padding: 10px 16px 90px;
  border-top: 1px solid var(--line);
}
.day-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
.day-head h1 { font: 700 26px/1.1 var(--display); margin: 0; letter-spacing: -0.02em; }
.day-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.strip { display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; gap: 4px; }
.strip-arrow { border: 0; background: none; height: 56px; border-radius: 10px; color: var(--muted); padding: 0; display: grid; place-items: center; }
.strip-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.strip-arrow:hover { background: var(--surface); color: var(--ink); }
.pills { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pill {
  border: 0; background: none; border-radius: 14px; padding: 6px 0 5px; display: grid; justify-items: center; gap: 1px; color: var(--ink);
}
.pill:hover { background: var(--surface); }
.pill-wd { font-size: 12px; color: var(--muted); }
.pill-n { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill.today .pill-n { color: var(--now); }
.pill.on { background: var(--ink); color: var(--paper); }
.pill.on .pill-wd { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.pill.on.today .pill-n { color: var(--paper); }
.pill-dots { display: flex; gap: 3px; height: 5px; }
.pill-dots i { width: 5px; height: 5px; border-radius: 50%; }
.pill.drop-on { box-shadow: inset 0 0 0 2px var(--accent); }

.upnext {
  flex: none; display: block; width: 100%; text-align: left; border: 0; margin: 4px 0 12px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); color: var(--muted); font-size: 15px; box-shadow: inset 3px 0 0 var(--c), var(--shadow-sm);
}
.upnext b { color: var(--ink); font-weight: 600; }
.upnext { margin-top: 0; }

/* без времени */
.untimed { flex: none; display: grid; gap: 6px; margin: 0 0 10px; padding: 2px; border-radius: var(--r-md); max-height: 30vh; overflow-y: auto; }
.untimed.drop-on { box-shadow: 0 0 0 2px var(--accent); }
.ut-row {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 11px 12px;
  box-shadow: var(--shadow-sm); touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.ut-title { all: unset; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-weight: 500; }
.ut-title:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.ut-who { font-size: 12px; color: var(--muted); }
.ut-row.done .ut-title { color: var(--muted); text-decoration: line-through; }
.tag-day { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }

.tick, .ring {
  width: 22px; height: 22px; flex: none; border: 2px solid var(--c); background: none; padding: 0; position: relative; cursor: pointer;
}
.tick { border-radius: 7px; }
.ring { border-radius: 50%; }
.tick.on, .ring.on { background: var(--c); }
.tick.on::after, .ring.on::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.tick:disabled, .ring:disabled { opacity: .45; cursor: default; }
.gpair { display: inline-flex; gap: 3px; margin-left: -4px; }
.gpair i { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--c); }
.gpair i.on { background: var(--c); }

/* лента дня */
.lane-heads { display: grid; grid-template-columns: 48px 1fr 1fr; gap: 0 6px; margin-top: 8px; }
.lane-heads::before { content: ''; }
.lane-heads span { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 4px; }
.tl { position: relative; display: grid; grid-template-columns: 48px 1fr; }
.tl-hours { position: relative; }
.tl-hours span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-lanes {
  position: relative; display: grid; grid-template-columns: repeat(var(--lanes, 1), minmax(0, 1fr)); gap: 0 6px;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% 56px; background-position: 0 56px; cursor: cell;
}
.lane { position: relative; min-width: 0; }
.now { position: absolute; left: -6px; right: 0; height: 2px; background: var(--now); z-index: 4; pointer-events: none; }
.now::before { content: ''; position: absolute; left: 0; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }
.now b { position: absolute; right: calc(100% + 8px); top: -9px; font-size: 11px; color: #fff; background: var(--now); border-radius: 6px; padding: 1px 5px; font-variant-numeric: tabular-nums; }
.day-empty { color: var(--muted); margin: 0 0 12px; text-align: center; font-size: 14px; }

.blk {
  position: absolute; display: flex; align-items: flex-start; gap: 8px; padding: 7px 9px; border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); box-shadow: inset 3px 0 0 var(--c);
  z-index: 2; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-y;
}
.blk:focus-visible { outline: 2px solid var(--c); outline-offset: 1px; }
.blk.short { align-items: center; padding-top: 2px; padding-bottom: 2px; }
.blk-text { min-width: 0; display: flex; flex-direction: column; }
.blk-title { font-weight: 600; font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.blk-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.blk.short .blk-text { flex-direction: row; gap: 8px; align-items: baseline; }
.blk.short .blk-title { -webkit-line-clamp: 1; white-space: nowrap; display: block; }
.blk.t-goal { background: color-mix(in srgb, var(--c) 8%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 45%, transparent); }
.blk.done { opacity: .6; }
.blk.done .blk-title { text-decoration: line-through; }
.blk.busy { --c: var(--muted); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 14%, var(--surface)) 0 6px, var(--surface) 6px 12px); }
.blk.movable { cursor: grab; }
.blk .tick, .blk .ring { width: 18px; height: 18px; margin-top: 1px; }
.blk .tick.on::after, .blk .ring.on::after { left: 4.5px; top: 1px; width: 4px; height: 8px; }
.blk.short .tick, .blk.short .ring { margin-top: 0; }
.grip { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize; }
.grip::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: var(--c); opacity: 0; }
.blk:hover .grip::after { opacity: .5; }
.lifted { opacity: .35; }
.drag-ghost {
  position: absolute; left: 2px; right: 4px; z-index: 6; pointer-events: none; border-radius: 12px;
  background: color-mix(in srgb, var(--c) 28%, var(--surface)); box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 0 0 1.5px var(--c);
  padding: 6px 9px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.day.two .drag-ghost { right: 4px; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

.free {
  position: absolute; left: 0; right: 0; z-index: 1; border: 0; padding: 0; text-align: left; cursor: copy;
  background: color-mix(in srgb, var(--free) 8%, transparent); border-radius: 10px;
}
.free span { display: block; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--free); }
.free:hover { background: color-mix(in srgb, var(--free) 14%, transparent); }

/* шиты */
.ed { gap: 14px; }
.ed-title { font-size: 20px; font-weight: 600; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; padding: 6px 2px 8px; background: none; }
.ed-title:focus { outline: none; border-bottom-color: var(--accent); }
.ed-when { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ed-when input[type=date] { width: auto; flex: 1 1 150px; }
.ed-times { display: flex; align-items: center; gap: 6px; flex: 1 1 200px; }
.ed-times input { width: auto; flex: 1; min-width: 0; }
.ed-times[hidden] { display: none; }
.sw { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.sw input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.ed-repeat { display: grid; gap: 8px; }
.ed-repeat[hidden], .ed-days[hidden] { display: none; }
.ed textarea { min-height: 0; }
.choice { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.choice .btn { flex: 1; padding: 12px 16px; }
.choice.col { flex-direction: column; }
.ro-when { margin: -8px 0 10px; color: var(--muted); }
.ro-notes { white-space: pre-wrap; }
.g-status { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.g-status li { display: flex; align-items: center; gap: 8px; }
.gtime { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin: 4px 0 6px; }

.fab {
  position: fixed; right: max(16px, calc(50vw - 380px + 16px)); bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom)); z-index: 8;
  width: 58px; height: 58px; border-radius: 20px; border: 0; background: var(--accent); color: #fff;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform .2s var(--spring), border-radius .3s var(--ease); font-size: 28px; line-height: 1; display: grid; place-items: center;
}

@media (max-width: 480px) {
  .day-head h1 { font-size: 24px; }
  .tl, .lane-heads { grid-template-columns: 42px 1fr; }
  .lane-heads { grid-template-columns: 42px 1fr 1fr; }
  .tl-hours span { right: 6px; font-size: 11px; }
  .blk { padding: 6px 7px; gap: 6px; }
  .blk-title { font-size: 13px; }
  .day.two .blk.short .blk-time { display: none; }
}


/* ================= motion ================= */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fill { from { width: 0; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-3deg); } 100% { transform: scale(1); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes zoom-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes zoom-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes burst {
  0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(.6); opacity: 0; }
}

/* screens and cards slide in, one after another */
main.enter > *, main.enter .goals > * { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.fab { animation: zoom-in .4s var(--spring) both .15s; }
.fab:active { transform: scale(.92); }

/* the bottom sheet slides up and away */
.sheet[open] { animation: sheet-up .45s var(--ease); }
.sheet[open]::backdrop { animation: fade-in .3s ease; }
.sheet.closing { animation: sheet-down .26s cubic-bezier(.4, 0, 1, 1) forwards; }
.sheet.closing::backdrop { animation: fade-out .26s ease forwards; }
@media (min-width: 640px) {
  .sheet[open] { animation: zoom-in .3s var(--ease); }
  .sheet.closing { animation: zoom-out .2s ease forwards; }
}
#sheet-body > * { animation: fade-in .25s ease both; }

/* check-in feedback */
.goal.just-done .streak b { animation: bump .55s var(--spring); }
.goal.just-done .bead.today { animation: pop .5s var(--spring); }
.wish.just-earned { animation: bump .6s var(--spring); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i {
  position: absolute; left: var(--sx); top: var(--sy); width: 8px; height: 12px; border-radius: 2px; background: var(--c);
  animation: burst var(--d) cubic-bezier(.15, .7, .3, 1) forwards;
}
.confetti i:nth-child(3n) { border-radius: 50%; width: 9px; height: 9px; }

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

/* dark theme: component tweaks (at the end so they win) */
@media (prefers-color-scheme: dark) {
  .btn.primary, .check { box-shadow: none; }
  /* light accents need dark text to stay readable */
  .btn.primary, .check:not(.is-done):not(.slip), .fab, .weekdays label:has(input:checked), .gcal .d[data-s="ok"] { color: var(--on-ink); }
  .check.is-done { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
}


/* ================= shell pieces (phones: the sidebar dissolves into top bar + tab bar) ================= */
.side { display: contents; }
.brand, .side-new, .side-extra, .side-label, .tabs kbd, .stats { display: none; }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes drawer-out { to { transform: translateX(100%); } }

/* ================= desktop ================= */
@media (min-width: 1024px) {
  :root { --side-w: 248px; }
  body { padding: 0 0 0 var(--side-w); }

  /* sidebar: brand, create, sections, whose plans, context */
  .side {
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 6;
    padding: 18px 14px 16px; overflow-y: auto;
    background: color-mix(in srgb, var(--surface-2) 45%, var(--paper));
    border-right: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
  .brand img { border-radius: 8px; }
  .brand b { font: 700 16px/1 var(--display); letter-spacing: -0.01em; }
  .side-new { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 14px; margin-bottom: 18px; }
  .side-new kbd { color: rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
  kbd {
    display: inline-block; margin-left: auto; font: 500 11px/1.5 var(--body); color: var(--muted);
    padding: 0 6px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line);
  }
  .side-label {
    display: block; margin: 0 0 6px; padding: 0 10px;
    font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
  }
  .tabs {
    order: 1; position: static; display: grid; grid-template-columns: 1fr; gap: 2px; margin-bottom: 22px;
    padding: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tabs button {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
    font-size: 14px; font-weight: 500; color: var(--muted); transition: background-color .15s, color .15s;
  }
  .tabs kbd { display: inline-block; opacity: 0; transition: opacity .15s; }
  .tabs button:hover kbd, .tabs button[aria-current="page"] kbd { opacity: 1; }
  .tabs svg { width: 20px; height: 20px; padding: 0; border-radius: 0; background: none !important; }
  .tabs button:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
  .tabs button[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
  .tabs button[aria-current="page"] svg { color: var(--accent); }
  .tabs button:active svg { transform: none; }

  .top { order: 2; position: static; padding: 0; margin-bottom: 22px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .who { grid-template-columns: 1fr; gap: 2px; padding: 0; background: none; border-radius: 0; max-width: none; }
  .who::before { top: 0; bottom: auto; left: 0; width: 100%; height: 38px; border-radius: 10px; transform: translateY(calc(var(--k) * 40px)); }
  .who button { justify-content: flex-start; height: 38px; padding: 0 10px; border-radius: 10px; font-size: 14px; }
  .who button:hover { color: var(--ink); }
  .side-extra { order: 3; display: block; }
  .side-hint { font-size: 12px; color: var(--muted); padding: 0 10px; margin: 14px 0 0; line-height: 1.45; }
  .side .upnext { margin: 0 0 6px; font-size: 13px; padding: 10px 12px; }
  .side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .side-list button {
    all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 10px; font-size: 14px; cursor: pointer;
  }
  .side-list button:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
  .side-list button:focus-visible { outline: 2px solid var(--accent); }
  .side-goal { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-list b { font: 600 12px/1 var(--body); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 4px 8px; border-radius: 99px; }

  /* mini month */
  .mm { background: var(--surface); border-radius: 14px; padding: 10px 8px 8px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
  .mm-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px 6px; font-size: 13px; }
  .mm-head button { border: 0; background: none; width: 26px; height: 26px; border-radius: 7px; color: var(--muted); font-size: 16px; padding: 0; }
  .mm-head button:hover { background: var(--surface-2); color: var(--ink); }
  .mm-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; text-align: center; }
  .mm-grid > span { font-size: 10px; font-weight: 600; color: var(--muted); padding-bottom: 4px; }
  .mm-d { border: 0; background: none; height: 28px; padding: 0; font-size: 12px; font-variant-numeric: tabular-nums; border-radius: 8px; color: var(--ink); }
  .mm-d:hover { background: var(--surface-2); }
  .mm-d.out { color: color-mix(in srgb, var(--muted) 60%, transparent); }
  .mm-d.wk { background: color-mix(in srgb, var(--accent) 11%, transparent); border-radius: 0; }
  .mm-grid > .wk:nth-child(7n + 1) { border-radius: 8px 0 0 8px; }
  .mm-grid > .wk:nth-child(7n) { border-radius: 0 8px 8px 0; }
  .mm-d.today { color: var(--now); font-weight: 700; }
  .mm-d.on { background: var(--ink); color: var(--on-ink); border-radius: 8px; font-weight: 600; }

  /* content area */
  main { max-width: 1180px; padding: 30px 40px 56px; }
  main.wide { max-width: none; padding: 18px 28px 0; }
  main.wide:has(.day.two) { max-width: none; }
  .head { margin: 0 0 22px; }
  .head > .btn.primary, .head-acts > .btn.primary, .head-acts > .archive-btn { display: none; } /* the sidebar has “New …” and “Archived” */
  .head h1 { font-size: 28px; }
  .toast { left: calc(50% + var(--side-w) / 2); bottom: 28px; }
  .fab { display: none; }
  .goal, .wish { transition: box-shadow .2s var(--ease); }
  .goal:hover, .wish:hover { box-shadow: var(--shadow-md); }

  /* goals: today at a glance + a grid of cards */
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
  .stat { background: var(--surface); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow-sm); }
  .stat b { display: block; font: 700 30px/1 var(--display); letter-spacing: -0.02em; }
  .stat small { font-size: 17px; color: var(--muted); font-weight: 500; }
  .stat span { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
  .goals { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }

  /* wishlist: a grid of cards */
  .wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
  .wish { margin-bottom: 0; }

  /* forms open as a panel on the right, so the page stays visible */
  .sheet { margin: 0 0 0 auto; width: 460px; height: 100dvh; max-height: 100dvh; border-radius: 24px 0 0 24px; }
  .sheet[open] { animation: drawer-in .38s var(--ease); }
  .sheet.closing { animation: drawer-out .22s cubic-bezier(.4, 0, 1, 1) forwards; }
  .sheet::backdrop { background: rgba(14, 14, 18, .2); backdrop-filter: none; -webkit-backdrop-filter: none; }
  #sheet-body { padding: 26px 28px 32px; }

  /* calendar toolbar */
  .day { height: calc(100dvh - 18px); }
  .day-top { padding: 0; }
  .tl-scroll { margin: 0; padding: 10px 0 48px; border-top: 0; }
  .cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 4px 0 14px; }
  .cal-bar h1 { font: 700 24px/1.2 var(--display); letter-spacing: -0.02em; margin: 0; display: flex; align-items: center; gap: 10px; }
  .tag { font: 600 12px/1 var(--body); color: var(--now); background: color-mix(in srgb, var(--now) 12%, transparent); padding: 5px 9px; border-radius: 99px; letter-spacing: 0; }
  .cal-ctrl { display: flex; align-items: center; gap: 10px; }
  .arrows { display: flex; gap: 2px; }
  .arrows button { border: 0; background: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink); }
  .arrows button:hover { background: var(--surface-2); }
  .arrows svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mode-seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
  .mode-seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); transition: background-color .2s, color .2s; }
  .mode-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
  .untimed { max-height: 22vh; }
  .lane-heads { margin-bottom: 4px; }

  /* week view */
  .wk-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
  .week .tl { grid-template-columns: 56px 1fr; }
  .week .tl-hours span { right: 10px; }
  .week .tl-lanes { gap: 0; cursor: cell; }
  .week .lane { border-left: 1px solid var(--line); }
  .week .lane.today { background: color-mix(in srgb, var(--accent) 4%, transparent); }
  .wk-head { padding-bottom: 6px; }
  .wk-day {
    border: 0; background: none; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 0; border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 500;
  }
  .wk-day b { font: 600 18px/1 var(--body); color: var(--ink); min-width: 30px; padding: 5px 6px; border-radius: 99px; font-variant-numeric: tabular-nums; }
  .wk-day:hover { background: var(--surface-2); }
  .wk-day.past b { color: var(--muted); }
  .wk-day.today { color: var(--now); }
  .wk-day.today b { background: var(--now); color: #fff; }
  .wk-allday { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .wk-gutter { font-size: 11px; color: var(--muted); align-self: center; text-align: right; padding-right: 10px; }
  .wk-cell {
    border-left: 1px solid var(--line); padding: 4px; display: grid; gap: 3px; align-content: start;
    min-height: 36px; max-height: 116px; overflow-y: auto; min-width: 0;
  }
  .wk-cell.today { background: color-mix(in srgb, var(--accent) 4%, transparent); }
  .wk-cell.drop-on { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 6px; }
  .ad-item {
    display: flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 7px; min-width: 0;
    background: color-mix(in srgb, var(--c) 14%, var(--surface)); user-select: none; -webkit-user-select: none; cursor: grab;
  }
  .ad-item.t-event { box-shadow: inset 3px 0 0 var(--c); }
  .ad-item.busy { --c: var(--muted); }
  .ad-item .ut-title { font-size: 12px; font-weight: 600; }
  .ad-item.done .ut-title { text-decoration: line-through; color: var(--muted); }
  .ad-item .tick, .ad-item .ring { width: 14px; height: 14px; border-width: 1.5px; }
  .ad-item .tick.on::after, .ad-item .ring.on::after { left: 3.5px; top: .5px; width: 3px; height: 7px; border-width: 0 1.5px 1.5px 0; }
  .ad-item .gpair { margin-left: -2px; }
  .ad-item .gpair i { width: 5px; height: 5px; }
  .week .blk { border-radius: 8px; padding: 5px 7px; gap: 6px; }
  .week .blk-title { font-size: 13px; }
  .week .blk .tick, .week .blk .ring { width: 15px; height: 15px; }
  .week .blk .tick.on::after, .week .blk .ring.on::after { left: 3.5px; top: .5px; width: 3.5px; height: 7px; }
  .week .blk.short .blk-time { display: none; }
  .week .free span { font-size: 11px; padding: 4px 7px; }
  .week .now { left: 0; }
  .week .now::before { left: -5px; }
  .week .now b { display: none; }
  .week .drag-ghost { left: 2px; right: 3px; font-size: 12px; }
}
@media (min-width: 1024px) and (prefers-color-scheme: dark) {
  .side { background: #121217; }
  .side-new kbd { color: rgba(14, 14, 18, .7); box-shadow: inset 0 0 0 1px rgba(14, 14, 18, .25); }
}

/* items with no set length: a slim pill at their start time */
.sw[hidden] { display: none; }
.blk.point { border-radius: 999px; padding: 2px 10px 2px 8px; align-items: center; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); }
.blk.point .blk-text { flex-direction: row; gap: 8px; align-items: baseline; }
.blk.point .blk-title { -webkit-line-clamp: 1; white-space: nowrap; display: block; }
.blk.point .tick, .blk.point .ring { margin-top: 0; }


/* selects: one chevron, inset like the other icons, same height as inputs */
select {
  -webkit-appearance: none; appearance: none; min-height: 46px; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236E6C77' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
  text-overflow: ellipsis;
}
@media (prefers-color-scheme: dark) {
  select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%239C9AA7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
/* time/date pickers: the native icon gets the same inset as the select chevron */
input[type=time], input[type=date] { padding-right: 12px; }
input[type=time]::-webkit-calendar-picker-indicator, input[type=date]::-webkit-calendar-picker-indicator { margin-right: 2px; opacity: .6; cursor: pointer; }
@media (prefers-color-scheme: dark) {
  input[type=time]::-webkit-calendar-picker-indicator, input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); }
}
/* number fields: no spinner arrows (they squeeze the value on phones) */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.reward-days input[type=number] { min-height: 40px; }
/* the big title field in the plan editor is underlined, not boxed */
.ed-title, .ed-title:focus, .ed-title:focus-visible { background: none; box-shadow: none; outline: none; border-radius: 0; }
.ed-title:focus { border-bottom-color: var(--accent); }
.side-new[hidden] { display: none !important; }

/* sidebar counters next to Kirill / Nastya / Together, with a caption saying what they count */
@media (min-width: 1024px) { .who-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } }
.who-cap { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 500; color: var(--muted); opacity: .85; }
.who-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1024px) {
  .who button .who-name { flex: 1; text-align: left; }
  .cnt {
    min-width: 24px; padding: 2px 7px; border-radius: 999px; text-align: center;
    font: 600 12px/1.3 var(--body); font-variant-numeric: tabular-nums; color: var(--muted);
    background: color-mix(in srgb, var(--ink) 7%, transparent);
    transition: background-color .25s, color .25s;
  }
  .cnt.zero { background: none; }
  .who button[aria-pressed="true"] .cnt:not(.zero) { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
}

/* ================= goals: list header ================= */
.gl-progress { display: grid; gap: 8px; margin: -6px 0 18px; font-size: 14px; color: var(--muted); }
.gl-progress .bar, .g-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.gl-progress .bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }
.gl { margin-bottom: 22px; }
.gl-head { font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fl { color: var(--gold); stroke-width: 2; }
.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--partner); margin-right: 6px; vertical-align: 1px; }

/* ================= goal card: streak week + road to the reward ================= */
.gcard { display: grid; gap: 16px; padding: 18px 18px 16px; }
.g-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.g-title { all: unset; cursor: pointer; display: grid; gap: 3px; min-width: 0; }
.g-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.g-name { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.g-sub { font-size: 13px; color: var(--muted); }
.g-streak { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 6px; justify-items: end; flex: none; }
.g-streak .ic { width: 22px; height: 22px; }
.g-streak b { font: 700 28px/1 var(--display); letter-spacing: -0.02em; }
.g-streak span { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: 4px; }
.g-streak.zero .ic { color: var(--muted); opacity: .6; }
.g-streak.zero b { color: var(--muted); }
.g-starts { flex: none; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }

.g-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wk-d { display: grid; justify-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.wk-d.is-today span { color: var(--ink); font-weight: 700; }
.wk-c {
  width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  background: var(--surface-2); color: #fff; transition: transform .2s var(--spring), background-color .25s;
}
.wk-c svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
button.wk-c { cursor: pointer; }
button.wk-c:active { transform: scale(.88); }
.wk-c.s-done { background: var(--accent); }
.wk-c.s-today { background: none; box-shadow: inset 0 0 0 2px var(--accent); }
.wk-c.s-half { background: linear-gradient(90deg, var(--accent) 50%, var(--surface-2) 50%); }
.wk-c.s-miss { background: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--slip) 70%, transparent); }
.wk-c.s-skip { background: none; box-shadow: inset 0 0 0 2px var(--gold); }
.wk-c.s-off, .wk-c.s-before { background: none; box-shadow: inset 0 0 0 1.5px var(--line); }
.wk-c.s-future { background: var(--surface-2); }

.g-rw { display: grid; gap: 8px; }
.g-rw-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.g-rw-top .ic { color: var(--gold); }
.g-rw-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-rw-left { margin-left: auto; color: var(--muted); white-space: nowrap; }
.g-rw.close .g-rw-left { color: var(--gold); font-weight: 600; }
.g-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--joint))); animation: fill .9s var(--ease) both; }
.g-rw-nums { font-size: 12px; color: var(--muted); }
.g-rw-all { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--muted); }
.g-addrw {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border: 0; border-radius: 14px;
  background: none; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); font-size: 14px; font-weight: 500; text-align: left;
}
.g-addrw:hover { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.g-addrw .ic { color: var(--gold); }

.g-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.g-note { margin: 0; font-size: 13px; color: var(--muted); }
.g-foot .actions { margin-left: auto; }
.check svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; margin-right: 6px; vertical-align: -2px; }
.gcard.just-done .g-streak b { animation: bump .55s var(--spring); }
.gcard.just-done .wk-d.is-today .wk-c { animation: pop .5s var(--spring); }

/* ================= goal details sheet ================= */
.gd-sub { margin: -8px 0 16px; color: var(--muted); font-size: 14px; }
.gd-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.gd-tile { background: var(--surface-2); border-radius: 14px; padding: 12px; }
.gd-tile b { display: block; font: 700 22px/1 var(--display); }
.gd-tile span { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.gcal button.d { border: 0; font: inherit; cursor: pointer; }
.gcal .d.today { outline: 2px solid var(--ink); outline-offset: 1px; }
.gd-hint { margin: -8px 0 16px; }
.gd-rewards { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.gd-rewards li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.gd-rewards li .ic { color: var(--gold); }
.gd-rewards li.got { background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
.gd-rw-t { display: grid; gap: 2px; min-width: 0; }
.gd-rw-t small { color: var(--muted); font-size: 12px; }
.gd-rw-s { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.gd-add { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; margin-bottom: 18px; border: 0; border-radius: 12px; background: none; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); font-size: 14px; text-align: left; }
.gd-add .ic { color: var(--gold); }
.gd-extra { display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 1024px) { .goals { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); } }
@media (prefers-color-scheme: dark) {
  .wk-c { color: var(--on-ink); }
}

/* "New" in the partner's view: same place and size, but plainly locked */
.side-new.locked, .side-new.locked:disabled {
  opacity: 1; cursor: not-allowed; background: none; color: var(--muted);
  box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 500;
}
.side-new.locked .ic { width: 16px; height: 16px; }
.side-new { transition: background-color .25s, color .25s, box-shadow .25s; }

/* ================= in-app confirm / prompt ================= */
.ask {
  border: 0; padding: 0; width: min(400px, calc(100% - 32px)); border-radius: 22px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.ask::backdrop { background: rgba(14, 14, 18, .45); }
.ask[open] { animation: zoom-in .25s var(--ease); }
.ask-body { padding: 22px 22px 18px; display: grid; gap: 12px; }
.ask-body h2 { margin: 0; font: 700 18px/1.3 var(--display); letter-spacing: -0.01em; }
.ask-body p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.ask-actions .btn { min-width: 96px; }
.btn.danger-fill { background: var(--slip); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--slip) 35%, transparent); }
@media (max-width: 639px) {
  .ask { margin: auto auto calc(12px + env(safe-area-inset-bottom)); width: calc(100% - 24px); }
  .ask-actions .btn { flex: 1; }
}

/* ================= checkboxes in the app's own style ================= */
input[type=checkbox]:not(.seg input):not(.weekdays input) {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; flex: none; margin: 0; padding: 0;
  border-radius: 7px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--muted) 45%, transparent);
  display: inline-grid; place-items: center; cursor: pointer; transition: background-color .15s, box-shadow .15s;
}
input[type=checkbox]:not(.seg input):not(.weekdays input)::after {
  content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); margin-top: -2px;
  transition: transform .2s var(--spring);
}
input[type=checkbox]:not(.seg input):not(.weekdays input):checked { background: var(--accent); box-shadow: none; }
input[type=checkbox]:not(.seg input):not(.weekdays input):checked::after { transform: rotate(45deg) scale(1); }
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw { min-height: 32px; }
/* native dropdown lists follow the theme */
select option { background: var(--surface); color: var(--ink); }
input[type=date], input[type=time] { color-scheme: inherit; }
@media (prefers-color-scheme: dark) { input[type=checkbox]:not(.seg input):not(.weekdays input):checked::after { border-color: var(--on-ink); } }

/* ================= peek sheets: an item's details from the calendar ================= */
.pk-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.pk-kind { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.pk-title { font: 700 22px/1.25 var(--display); letter-spacing: -0.015em; margin: 0 0 16px; overflow-wrap: anywhere; }
.pk-rows { display: grid; gap: 10px; margin-bottom: 18px; }
.pk-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 15px; }
.pk-row .ic { width: 18px; height: 18px; color: var(--muted); margin-top: 2px; }
.pk-notes { white-space: pre-wrap; color: var(--muted); }
.pk-foot-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.pk-progress { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); margin-bottom: 14px; }
.pk-stat { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 6px; padding-right: 16px; border-right: 1px solid var(--line); }
.pk-stat .ic { width: 20px; height: 20px; }
.pk-stat b { font: 700 24px/1 var(--display); }
.pk-stat span { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: 4px; }
.pk-rw { display: grid; gap: 8px; min-width: 0; }
.pk-rw-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pk-rw-top .ic { color: var(--gold); }
.pk-rw-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-rw-left { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pk-rw-none { margin: 0; font-size: 14px; color: var(--muted); }
.pk-progress .g-bar { background: var(--surface); }

.pk-status { display: grid; gap: 10px; margin-bottom: 18px; }
.pk-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pk-person { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.pk-person b { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 13px; }
.pk-person.on b { color: var(--free); }
.pk-check {
  width: 100%; border: 0; border-radius: 14px; padding: 14px 16px; font-weight: 600; font-size: 15px;
  background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s var(--ease), background-color .2s;
}
.pk-check:active { transform: scale(.98); }
.pk-check svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pk-check.on { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.pk-check.slip { background: color-mix(in srgb, var(--slip) 12%, var(--surface)); color: var(--slip); }
.pk-two { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.pk-info { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; color: var(--muted); }
.pk-info .ic { width: 18px; height: 18px; }

.pk-time { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.pk-h { margin: 0; font-size: 14px; font-weight: 600; }
.pk-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 20px; }
.pk-actions .btn.primary { min-width: 130px; }
@media (min-width: 1024px) {
  /* the side panel's content sits at the top; the actions stay pinned at the bottom */
  #sheet-body:has(.pk-actions) { min-height: 100%; display: flex; flex-direction: column; box-sizing: border-box; }
  #sheet-body:has(.pk-actions) .pk-actions { margin-top: auto; padding-top: 20px; }
}
@media (prefers-color-scheme: dark) { .pk-check:not(.on):not(.slip) { color: var(--on-ink); } }
#sheet-body:focus { outline: none; }

/* goal month view: browsing arrows, planned and pre-start days */
.cal-nav .btn { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; font-size: 20px; line-height: 1; box-shadow: inset 0 0 0 1px var(--line); }
.cal-nav .btn:hover:not(:disabled) { background: var(--surface-2); }
.cal-nav .btn:disabled { opacity: .25; box-shadow: none; }
.gcal .d.plan { background: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--muted) 55%, transparent); color: var(--ink); }
.gcal .d.pre { opacity: .35; }
.gcal .d.start { position: relative; }
.gcal .d.start::after { content: ''; position: absolute; bottom: 6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.mm-head button:disabled { opacity: .3; }

/* ================= our date picker ================= */
.dp-wrap, .tp-wrap { position: relative; min-width: 0; }
.dp-btn {
  width: 100%; min-height: 46px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink);
  padding: 11px 13px; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left;
  transition: box-shadow .2s, background-color .2s;
}
.dp-btn[aria-expanded="true"], .dp-btn:focus-visible { outline: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.dp-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-ic, .tp-ic svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dp-pop, .tp-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
  animation: zoom-in .18s var(--ease);
}
.dp-pop { width: min(320px, calc(100vw - 48px)); padding: 12px; }
.dp-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 2px 10px 6px; }
.dp-head b { font-size: 15px; font-weight: 600; }
.dp-nav { border: 0; background: none; width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--ink); }
.dp-nav:hover { background: var(--surface-2); }
.dp-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.dp-grid > span { font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0 6px; }
.dp-d { border: 0; background: none; height: 38px; border-radius: 10px; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); padding: 0; transition: background-color .15s; }
.dp-d:hover { background: var(--surface-2); }
.dp-d.out { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.dp-d.today { color: var(--accent); font-weight: 700; }
.dp-d.on { background: var(--accent); color: #fff; font-weight: 600; }
.dp-d:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.dp-foot { display: flex; justify-content: flex-end; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--line); }
.dp-today { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.dp-today:hover { background: var(--surface-2); }

/* ================= our time picker: type it or pick from the list ================= */
.tp-input { padding-right: 40px; font-variant-numeric: tabular-nums; }
.tp-input.bad { box-shadow: inset 0 0 0 2px var(--slip) !important; }
.tp-ic { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; display: grid; }
.tp-pop { width: 100%; min-width: 140px; max-height: 240px; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.tp-o { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 10px; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); }
.tp-o:hover { background: var(--surface-2); }
.tp-o.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 600; }
.tp-clear { color: var(--muted); border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; margin-bottom: 4px; }
.ed-times .tp-wrap { flex: 1; }
.ed-times .tp-wrap[hidden], .tp-wrap[hidden] { display: none; }
.ed-when .dp-wrap { flex: 1 1 170px; }
@media (prefers-color-scheme: dark) { .dp-d.on { color: var(--on-ink); } }
.brand { color: inherit; text-decoration: none; border-radius: 12px; transition: opacity .15s; }
.brand:hover { opacity: .8; }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.ed-times .tp-input, .tp-wrap .tp-input { width: 100%; min-width: 0; }

/* ================= our dropdown ================= */
.sl-wrap { position: relative; min-width: 0; }
select.sl-native { display: none !important; }
.sl-btn {
  width: 100%; min-height: 46px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink);
  padding: 11px 13px; font-size: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left;
  transition: box-shadow .2s, background-color .2s;
}
.sl-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-btn span.ph { color: var(--muted); }
.sl-btn[aria-expanded="true"], .sl-btn:focus-visible { outline: none; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.sl-btn:disabled { opacity: .6; cursor: default; }
.sl-ic { width: 12px; height: 12px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.sl-btn[aria-expanded="true"] .sl-ic { transform: rotate(180deg); }
.sl-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 100%; max-height: 280px; overflow-y: auto; padding: 6px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line); overscroll-behavior: contain;
  animation: zoom-in .18s var(--ease);
}
.sl-o { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 15px; color: var(--ink); }
.sl-o:hover, .sl-o:focus-visible { background: var(--surface-2); outline: none; }
.sl-o span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-chk { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.sl-o.on { color: var(--accent); font-weight: 600; }
.sl-o.on .sl-chk { visibility: visible; }
.sl-o.act { color: var(--accent); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }
.reward .sl-btn { background: var(--surface); }

/* long names in the sidebar get an ellipsis instead of pushing the panel wider */
.side > *, .side-extra, .side-list, .side-list li { min-width: 0; }
.side-list button { max-width: 100%; }

/* side-by-side blocks: drop the time so the title stays readable */
.blk.narrow .blk-time { display: none; }
.blk.narrow { padding-left: 7px; padding-right: 6px; gap: 6px; }
.blk.narrow .gpair { display: none; }
.blk.narrow:not(.short) .blk-title { -webkit-line-clamp: 3; }
.grid-span { grid-column: 1 / -1; margin-top: -4px; }

/* quit habit: a day without a slip counts (light), a confirmed day also earned points (full with a tick) */
.wk-c.s-held { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }

/* archive */
.archive-link { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 8px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 8px 4px; border-radius: 10px; }
.archive-link:hover { color: var(--ink); }
.ar-hint { margin: -8px 0 14px; }
.ar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ar-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.ar-t { display: grid; gap: 2px; min-width: 0; flex: 1; }
.ar-t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-t span { font-size: 13px; color: var(--muted); }
.ar-a { display: flex; gap: 6px; flex: none; }

/* received gifts: a folded section at the end of the wishlist */
.rcv { margin-top: 26px; }
.rcv-head { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 10px 2px; font: 600 15px/1 var(--display); color: var(--ink); text-align: left; border-top: 1px solid var(--line); padding-top: 18px; }
.rcv-head .sl-ic { margin-left: auto; width: 14px; height: 14px; }
.rcv-head[aria-expanded="true"] .sl-ic { transform: rotate(180deg); }
.cnt-pill { font: 600 12px/1 var(--body); color: var(--muted); background: var(--surface-2); padding: 4px 8px; border-radius: 99px; }
.rcv .wish-grid { margin-top: 10px; }
.rcv .wish { opacity: .85; }


/* ================= how much you want it: spark → heart → heart on fire ================= */
:root { --d1: #8B6CFF; --d2: #F43F6E; --d3: #FF5A1F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --d1: #A996FF; --d2: #FF6B8E; --d3: #FF7A3D; } }
.dz { width: 1em; height: 1em; display: block; overflow: visible; }
.dz-a, .dz-b { fill: currentColor; }
.d1 { --dc: var(--d1); } .d2 { --dc: var(--d2); } .d3 { --dc: var(--d3); }

/* the picker in the wish form: three tiles, the chosen one comes alive */
.desire-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dz-opt {
  position: relative; display: grid; justify-items: center; gap: 3px; text-align: center; cursor: pointer;
  padding: 14px 6px 12px; border-radius: 16px; background: var(--surface-2); color: var(--muted);
  transition: background-color .2s var(--ease), color .2s, box-shadow .2s, transform .15s var(--ease);
}
.dz-opt input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.dz-opt:active { transform: scale(.96); }
.dz-opt .dz-ic { font-size: 30px; color: var(--muted); filter: grayscale(1); opacity: .55; transition: opacity .2s, filter .2s, color .2s; }
.dz-opt b { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.dz-opt small { font-size: 11px; line-height: 1.25; }
.dz-opt:hover .dz-ic { opacity: .8; }
.dz-opt:has(input:checked) {
  background: color-mix(in srgb, var(--dc) 12%, var(--surface)); color: color-mix(in srgb, var(--dc) 70%, var(--ink));
  box-shadow: inset 0 0 0 1.5px var(--dc);
}
.dz-opt:has(input:checked) .dz-ic { color: var(--dc); filter: none; opacity: 1; }
.dz-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.dz-opt.d1:has(input:checked) .dz { animation: dz-twinkle .7s var(--spring); }
.dz-opt.d2:has(input:checked) .dz { animation: dz-beat .9s var(--ease); }
.dz-opt.d3:has(input:checked) .dz { animation: dz-beat .9s var(--ease); }
.dz-opt.d3:has(input:checked) .dz-fl { animation: dz-ignite .5s var(--spring), dz-flicker 1.4s ease-in-out .5s infinite; }
.dz-fl { transform-origin: 50% 70%; transform-box: fill-box; }
.dz-opt.d3:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--dc), 0 6px 18px color-mix(in srgb, var(--d3) 28%, transparent); }

/* on the card */
.wish-icon { font-size: 24px; color: var(--dc); background: color-mix(in srgb, var(--dc) 12%, var(--surface)); }
.wish-icon.d3 .dz-fl { animation: dz-flicker 1.8s ease-in-out infinite; }
.dz-word { color: color-mix(in srgb, var(--dc) 80%, var(--ink)); font-weight: 600; }
.wish.d3:not(.received) { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px color-mix(in srgb, var(--d3) 45%, transparent); background:
  linear-gradient(160deg, color-mix(in srgb, var(--d3) 7%, var(--surface)), var(--surface) 55%); }
.wish.earned { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--gold); }
.wish-goal {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; border: 0; margin: 0;
  background: var(--surface-2); color: var(--muted); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.3;
}
.wish-goal b { color: var(--ink); font-weight: 600; }
.wish-goal .ic { width: 15px; height: 15px; flex: none; color: var(--gold); }
button.wish-goal:hover { color: var(--ink); }
.wish-goal.none { background: none; padding: 0; font-size: 12px; }

/* quick reward sizes in the goal form */
.rw-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rw-chip {
  border: 0; border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 600;
  background: var(--surface); color: var(--muted); transition: background-color .2s, color .2s, transform .15s var(--ease);
}
.rw-chip:active { transform: scale(.95); }
.rw-chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

@keyframes dz-beat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.25); } 40% { transform: scale(.95); } 60% { transform: scale(1.12); } }
@keyframes dz-twinkle { 0% { transform: scale(.4) rotate(-40deg); } 70% { transform: scale(1.15) rotate(8deg); } 100% { transform: none; } }
@keyframes dz-ignite { 0% { transform: scale(.3) translateY(6px); } 100% { transform: none; } }
@keyframes dz-flicker { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.04, .97) rotate(-2deg); } 50% { transform: scale(.98, 1.05) rotate(1.5deg); } 75% { transform: scale(1.03, .98) rotate(-1deg); } }

/* swiping between days / weeks */
.day { touch-action: pan-y; }
.wk-head, .wk-allday { overflow: hidden; }
.wk-gutter { position: relative; z-index: 1; background: var(--paper); }
body.paging .day { user-select: none; -webkit-user-select: none; }

/* the whole goal card is tappable */
.gcard { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: box-shadow .2s var(--ease), transform .15s var(--ease); }
.gcard:active:not(:has(button:active, a:active)) { transform: scale(.985); }
.gcard .g-week, .gcard .g-foot .actions { cursor: default; }
.gcard button, .gcard a { cursor: pointer; }
@media (hover: hover) {
  .gcard:hover { box-shadow: var(--shadow-md), inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
  .gcard:hover .g-name { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }
}

/* archive: header icon on phones, sidebar row on desktop */
.head-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); transition: background-color .2s, color .2s, transform .15s var(--ease);
}
.icon-btn:hover { color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ic { width: 20px; height: 20px; }
.ib-badge {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  font: 600 11px/18px var(--body); text-align: center; background: var(--ink); color: var(--on-ink); box-shadow: 0 0 0 2px var(--paper);
}
.side-arch { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.side-arch button { color: var(--muted); }
.side-arch .ic { width: 16px; height: 16px; flex: none; }
.side-arch i { font: 500 12px/1 var(--body); font-style: normal; color: var(--muted); padding: 4px 8px; }

/* ================= accounts ================= */
.av { display: inline-grid; place-items: center; border-radius: 50%; flex: none; object-fit: cover; background: color-mix(in srgb, var(--me) 18%, var(--surface)); color: var(--me); font: 600 13px/1 var(--body); }
img.av { background: var(--surface-2); }

/* account button: round avatar next to the switch on phones, a row at the bottom of the sidebar on desktop */
.top { display: flex; align-items: center; gap: 10px; }
.top .who { flex: 1; margin: 0; }
.acct { border: 0; padding: 0; background: none; border-radius: 50%; flex: none; display: grid; }
.acct .av { width: 40px; height: 40px; }
.acct-side { display: none; }
@media (min-width: 1024px) {
  .top { display: block; }
  .acct-top { display: none; }
  .acct-side {
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; text-align: left;
    order: 10; margin-top: auto; padding: 10px; border: 0; border-radius: 12px; background: none; color: var(--ink);
  }
  .acct-side:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
  .acct-side .av { grid-row: span 2; }
  .acct-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .acct-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* on your own: you + "Invite partner" */
.who.solo { grid-template-columns: repeat(2, 1fr); }
.who.solo::before { width: calc((100% - 12px) / 2); }
.who-invite {
  position: relative; z-index: 1; border: 0; background: none; border-radius: 999px; padding: 9px 6px;
  display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; color: var(--accent); white-space: nowrap;
}
@media (min-width: 1024px) {
  .who.solo { grid-template-columns: 1fr; }
  .who.solo::before { width: 100%; }
  .who-invite { justify-content: flex-start; height: 38px; padding: 0 10px; border-radius: 10px; font-size: 14px; }
  .who-invite:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
}

.invite-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.invite-link input { font-size: 14px; background: var(--surface); }

/* ================= sign in ================= */
body.signed-out { padding-left: 0; }
body.signed-out .side { display: none; }
body.signed-out main { max-width: 420px; }
.signin { min-height: calc(100dvh - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 0; }
.signin-logo { border-radius: 16px; box-shadow: 0 12px 30px color-mix(in srgb, #3D5AFE 30%, transparent); margin-bottom: 18px; }
.signin h1 { font: 700 30px/1.1 var(--display); letter-spacing: -0.02em; margin: 0 0 8px; }
.signin-lead { margin: 0 0 22px; color: var(--muted); font-size: 17px; }
.signin-invite { margin: -8px 0 18px; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); font-weight: 600; font-size: 14px; }
.signin-card { width: 100%; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 20px; display: grid; gap: 12px; text-align: left; }
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); text-decoration: none; font-weight: 600; }
.btn.google:hover { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 30%, transparent); }
.signin-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.signin-or::before, .signin-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#signin-form { display: grid; gap: 10px; }
#signin-form .btn { width: 100%; }
.signin-err { margin: 0; min-height: 1em; color: var(--slip); font-size: 14px; }
.signin-err:empty { display: none; }
.signin-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.signin-sent { text-align: center; padding: 8px 4px; }
.signin-sent h2 { margin: 6px 0 8px; font-size: 20px; }
.signin-sent p { margin: 0 0 12px; color: var(--muted); line-height: 1.5; }
.signin-mail { font-size: 34px; color: var(--accent); }

/* ================= public wishlist ================= */
body.public main { max-width: 760px; }
.pub { padding: 20px 0 40px; }
.pub-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 16px/1 var(--display); margin-bottom: 26px; }
.pub-brand img { border-radius: 8px; }
.pub-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.pub-head .av { width: 56px; height: 56px; font-size: 20px; }
.pub-head h1 { font: 700 26px/1.15 var(--display); letter-spacing: -0.02em; margin: 0 0 6px; }
.pub-head p { margin: 0; color: var(--muted); line-height: 1.45; }
.pub .wish-grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .pub .wish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pub .wish { margin: 0; }
.pub .wish.taken { opacity: .7; }
.pub-act { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.pub-act .ic, .pub-act svg { width: 16px; height: 16px; }
.pub-act.mine { color: var(--free); font-weight: 600; justify-content: space-between; width: 100%; }
.pub-act.mine span { display: inline-flex; align-items: center; gap: 6px; }
.pub-act.mine svg path { stroke: currentColor; stroke-width: 2.4; fill: none; }
.pub-cta {
  display: flex; align-items: center; gap: 14px; margin-top: 28px; padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none;
}
.pub-cta img { border-radius: 10px; flex: none; }
.pub-cta span { flex: 1; color: var(--muted); font-size: 14px; }
.pub-cta b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.pub-cta .ic { width: 20px; height: 20px; color: var(--muted); }
.wish-claimed { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; color: var(--free); font-weight: 600; }
.wish-claimed .ic { width: 15px; height: 15px; flex: none; }
.share-more { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; }
.share-more a { text-decoration: none; }
.danger-link { color: var(--slip) !important; }

/* account sheet: a card per block */
.acct-sec { background: var(--surface-2); border-radius: var(--r-md); padding: 16px; margin-bottom: 12px; display: grid; gap: 14px; }
.acct-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-who { flex: 1; min-width: 0; }
.acct-who b { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who span { display: block; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-label { margin: 0 0 -4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.acct-name-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.acct-name-form input { background: var(--surface); }
.acct-empty { justify-items: center; text-align: center; gap: 10px; padding: 22px 18px 18px; }
.acct-empty h3 { margin: 4px 0 0; font-size: 17px; }
.acct-empty p { margin: 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 340px; }
.acct-empty .btn { width: 100%; }
.acct-duo { display: flex; }
.acct-duo .av { width: 44px; height: 44px; box-shadow: 0 0 0 3px var(--surface-2); }
.acct-duo .add { margin-left: -10px; background: var(--surface); color: var(--accent); font-size: 20px; box-shadow: 0 0 0 3px var(--surface-2), inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); }
.acct-out {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 4px; padding: 13px;
  border: 0; border-radius: var(--r-md); background: none; color: var(--muted); font-weight: 600; font-size: 15px;
}
.acct-out:hover { background: var(--surface-2); color: var(--slip); }
.acct-out .ic { width: 18px; height: 18px; }

.btn.wide { width: 100%; }
.empty-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 16%, var(--surface)); color: var(--gold); }
.empty-ic .ic { width: 26px; height: 26px; }
.share-steps { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 10px; text-align: left; width: 100%; max-width: 360px; }
.share-steps li { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.4; }
.share-steps b { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent); font-size: 12px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent); }
.share-steps span { padding-top: 2px; }
.share-note { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.share-foot { margin: 4px 2px 0; }
.acct-list { padding: 6px; gap: 0; }
.acct-item {
  display: grid; grid-template-columns: 20px 1fr; column-gap: 12px; align-items: center; text-align: left; width: 100%;
  padding: 12px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none;
}
.acct-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.acct-item .ic { width: 20px; height: 20px; color: var(--muted); }
.acct-item small { grid-column: 2; font-size: 12px; color: var(--muted); font-weight: 400; }
.acct-item.danger, .acct-item.danger .ic { color: var(--slip); }

/* ================= welcome cards ================= */
.welcome {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 22px 0 20px; border: 0; border-radius: 28px;
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); overflow: hidden;
  animation: wl-in .32s var(--spring);
}
.welcome::backdrop { background: rgba(12, 12, 18, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.welcome.closing { animation: wl-out .2s ease forwards; }
.wl-x { position: absolute; top: 14px; right: 14px; z-index: 2; }
.wl-brand { display: flex; align-items: center; gap: 10px; padding: 0 24px; font: 700 16px/1 var(--display); }
.wl-brand img { border-radius: 10px; }
.wl-h { margin: 18px 24px 8px; font: 700 26px/1.12 var(--display); letter-spacing: -0.02em; }
.wl-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 24px 16px; font-size: 12px; color: var(--muted); }
.wl-chain span { padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 600; }
.wl-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; outline: none; }
.wl-track::-webkit-scrollbar { display: none; }
.wl-slide { flex: 0 0 100%; scroll-snap-align: center; padding: 0 24px; box-sizing: border-box; }
.wl-art { height: 172px; border-radius: 20px; background: var(--surface-2); display: grid; place-items: center; padding: 16px; margin-bottom: 16px; overflow: hidden; }
.wl-tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.wl-slide h3 { margin: 4px 0 6px; font: 700 20px/1.2 var(--display); }
.wl-slide p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 15px; min-height: 4.5em; }
.wl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px 0; }
.wl-dots { display: flex; gap: 6px; }
.wl-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: var(--line); transition: width .25s var(--ease), background-color .25s; }
.wl-dots button[aria-selected="true"] { width: 22px; background: var(--accent); }
.wl-next { min-width: 128px; }
@keyframes wl-in { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes wl-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }

/* tiny illustrations inside the cards */
.wa-cal { width: 100%; display: grid; gap: 6px; }
.wa-hour { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.wa-blk { font-style: normal; display: block; padding: 5px 10px; border-radius: 10px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); color: var(--ink); font-size: 13px; font-weight: 600; }
.wa-blk b { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.wa-goal, .wa-wish { width: 100%; background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-sm); }
.wa-goal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 15px; }
.wa-flame { font-weight: 700; font-size: 15px; }
.wa-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 10px; color: var(--muted); }
.wa-week i { display: grid; place-items: center; width: 26px; height: 26px; margin: 0 auto 4px; border-radius: 50%; background: var(--surface-2); font-style: normal; color: #fff; font-size: 12px; font-weight: 700; }
.wa-week .wd-done i { background: var(--me); }
.wa-week .wd-today i { box-shadow: inset 0 0 0 2px var(--me); background: none; }
.wa-wish-top { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.wa-gift { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 18%, var(--surface)); flex: none; }
.wa-wish b { display: block; font-size: 14px; }
.wa-wish small { color: var(--muted); font-size: 12px; }
.wa-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.wa-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--me), var(--partner)); }
.wa-nums { display: block; margin-top: 6px; }
.wa-pair { display: grid; justify-items: center; gap: 14px; }
.wa-avs { display: flex; }
.wa-avs span { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 20px/1 var(--display); background: var(--c); box-shadow: 0 0 0 4px var(--surface-2); }
.wa-avs span + span { margin-left: -12px; }
.wa-chip { padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; color: var(--free); }
.signin-how { margin-top: 14px; justify-self: center; align-self: center; }

/* ================= tour ================= */
.tour { position: fixed; inset: 0; z-index: 60; animation: fade-in .2s ease; }
.tour.closing { animation: wl-out .2s ease forwards; }
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(10, 10, 16, .55), 0 0 0 2px color-mix(in srgb, var(--accent) 70%, #fff);
  transition: left .3s var(--ease), top .3s var(--ease), width .3s var(--ease), height .3s var(--ease);
}
.tour-tip {
  position: fixed; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 16px 16px 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3); transition: top .3s var(--ease), left .3s var(--ease);
}
.tour-n { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--accent); }
.tour-tip h3 { margin: 0 0 6px; font-size: 17px; }
.tour-text { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.tour-acts { display: flex; justify-content: space-between; align-items: center; }
.tour-skip { color: var(--muted); }

.legal { text-align: center; margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.legal a, .signin-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ts:empty { display: none; }
.ts { display: flex; justify-content: center; }
