/* Joylection — design system from the Claude Design handoff (petal palette).
   Mobile: single column + bottom tab bar. Desktop ≥1024px: 3 columns
   (sidebar 240 · main · rail 340). British spelling everywhere: colour. */

:root {
  --paper: #F6EFE6;
  --ink: #2B1820;
  --ink-rgb: 43, 24, 32;
  --paper-rgb: 246, 239, 230;
  --mid: #2E7A7A;
  --accent: #D4789A;
  --accent2: #6B3050;
  --soft: #EBE2D5;
  --edge: rgba(43, 24, 32, 0.08);
  --chip: #FFFFFF;
  --display: 'Bricolage Grotesque', 'Inter Tight', system-ui, sans-serif;
  --body: 'Inter Tight', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
}
:root[data-theme="dark"] {
  --paper: #1B1218;
  --ink: #F6EFE6;
  --ink-rgb: 246, 239, 230;
  --paper-rgb: 27, 18, 24;
  --mid: #5AB7B7;
  --accent: #E592AE;
  --accent2: #9B4A72;
  --soft: #251820;
  --edge: rgba(246, 239, 230, 0.10);
  --chip: #241821;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.4;
}
input, button, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ── Type ────────────────────────────────────────────────────────────── */
.h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
}
.eyebrow {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), 0.53);
}
.mono-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(var(--ink-rgb), 0.5);
}
.quiet { color: rgba(var(--ink-rgb), 0.62); }

/* ── App layout ──────────────────────────────────────────────────────── */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar, .rail { display: none; }
.main {
  padding: 18px 20px 120px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 1024px) {
  .app {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 340px;
    height: 100vh;
    overflow: hidden;
  }
  .app.no-rail { grid-template-columns: 240px minmax(0, 1fr); }
  .main {
    overflow-y: auto;
    padding: 28px 36px 40px;
    max-width: none;
    margin: 0;
  }
  .main > .page { max-width: 820px; }
  .sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--edge);
    background: var(--chip);
    padding: 22px 14px;
    overflow-y: auto;
  }
  :root[data-theme="dark"] .sidebar { background: var(--soft); }
  .rail {
    display: block;
    border-left: 1px solid var(--edge);
    padding: 28px 24px;
    overflow-y: auto;
    background: var(--paper);
  }
  :root[data-theme="dark"] .rail { background: var(--soft); }
}

/* ── Sidebar (desktop) ───────────────────────────────────────────────── */
.side-logo {
  width: 32px; height: 32px; border-radius: 16px;
  margin: 4px 10px 22px;
  background: conic-gradient(from 0deg,
    #D4789A 0% 16.6%, #2E7A7A 16.6% 33.3%, #6B3050 33.3% 50%,
    #D4A97A 50% 66.6%, #7AAEC8 66.6% 83.3%, #916A83 83.3% 100%);
  box-shadow: 0 4px 14px rgba(212, 120, 154, 0.33);
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px; border: none;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.69);
  font-size: 13.5px; font-weight: 500; text-align: left;
}
.side-link.active { background: rgba(212, 120, 154, 0.12); color: var(--ink); font-weight: 600; }
.side-link .dot-active { width: 5px; height: 5px; border-radius: 3px; background: var(--accent); margin-left: auto; }
.side-link svg { flex: 0 0 auto; }
.side-new {
  margin-top: 18px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 14px; border: none;
  background: var(--ink); color: var(--paper);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(var(--ink-rgb), 0.2);
}
.side-user {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(var(--ink-rgb), 0.04);
}
.side-user b { font-size: 13px; display: block; }

/* ── Tab bar (mobile) ────────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(64px + env(safe-area-inset-bottom));
  padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--edge);
  display: flex; align-items: center; justify-content: space-around; gap: 4px;
}
.tab-item {
  width: 46px; height: 46px; border: none; background: transparent;
  color: rgba(var(--ink-rgb), 0.5);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.tab-item.active { color: var(--ink); }
.tab-item.active::after {
  content: ""; position: absolute; bottom: 0;
  width: 14px; height: 3px; border-radius: 2px; background: var(--accent);
}
.tab-add {
  width: 52px; height: 52px; border-radius: 26px; border: none;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(212, 120, 154, 0.33);
  transform: translateY(-8px);
}
:root[data-theme="dark"] .tab-add { color: var(--ink); }
/* mobile-only: must sit AFTER the base .tabbar rule above — same
   specificity, so an earlier display:none would lose to its display:flex
   and the bar would leak across the desktop layout */
@media (min-width: 1024px) { .tabbar { display: none; } }

/* ── Screen chrome header ────────────────────────────────────────────── */
.chrome {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; padding: 0 0 16px;
}
.chrome .h1 { margin-top: 8px; }
@media (min-width: 1024px) { .chrome .h1 { font-size: 46px; letter-spacing: -0.035em; } }
.chrome .mono-meta { margin-top: 8px; }

.circle-btn {
  width: 40px; height: 40px; border-radius: 20px;
  border: 1px solid var(--edge); background: var(--chip); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; padding: 0;
}
.ink-btn {
  border: none; border-radius: 24px; background: var(--ink); color: var(--paper);
  font-size: 13.5px; font-weight: 600; padding: 13px 24px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.ghost-btn {
  border: 1px solid var(--edge); border-radius: 24px; background: transparent;
  color: var(--ink); font-size: 13.5px; font-weight: 500; padding: 13px 24px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.link-danger {
  background: transparent; border: none; color: #6B3050;
  font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px;
}
:root[data-theme="dark"] .link-danger { color: #C98BAB; }

/* ── Chips & dots ────────────────────────────────────────────────────── */
.pill-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 500;
  color: var(--ink); background: transparent;
  border: 1px solid var(--edge); white-space: nowrap;
}
.pill-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.colour-dot {
  display: inline-block; border-radius: 50%; flex: 0 0 auto;
  width: 14px; height: 14px; background: var(--c);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--c) 33%, transparent);
}
.colour-dot.hollow { background: transparent; border: 1.5px solid var(--c); }

.filter-dot {
  width: 24px; height: 24px; border-radius: 12px; border: none; padding: 0;
  background: var(--c); flex: 0 0 auto;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--c) 27%, transparent);
  transition: opacity 0.15s;
}
.filter-dot.dimmed { opacity: 0.4; }
.filter-dot.on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--c); }

/* ── Cards & rows ────────────────────────────────────────────────────── */
.card {
  background: var(--chip); border: 1px solid var(--edge);
  border-radius: 14px;
}
.joy-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--chip); border: 1px solid var(--edge);
}
.joy-row.done { opacity: 0.72; }
.joy-row .title {
  font-family: var(--display); font-size: 17px; font-weight: 500;
  letter-spacing: -0.01em; line-height: 1.2;
}
.joy-row.done .title { text-decoration: line-through; text-decoration-color: rgba(var(--ink-rgb), 0.33); }
.joy-row .meta {
  margin-top: 4px; font-size: 11.5px; color: rgba(var(--ink-rgb), 0.56);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.check-btn {
  width: 28px; height: 28px; border-radius: 14px; flex: 0 0 auto; padding: 0;
  border: 1.5px solid var(--c); background: transparent; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.check-btn.done { background: var(--c); }
.check-btn svg { display: none; }
.check-btn.done svg { display: block; }
.check-btn.small { width: 22px; height: 22px; border-radius: 11px; }

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--edge);
}

/* Today's collected list */
.today-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 0; border-bottom: 1px solid var(--edge);
  background: transparent; border-left: none; border-right: none; border-top: none;
  text-align: left;
}
.today-row:first-child { border-top: 1px solid var(--edge); }
.today-row .title {
  font-family: var(--display); font-size: 19px; font-weight: 500;
  letter-spacing: -0.015em; line-height: 1.25;
}
@media (min-width: 1024px) { .today-row .title { font-size: 22px; } }
.today-row .arrow { color: rgba(var(--ink-rgb), 0.33); margin-left: auto; }

/* ── Prompt card ─────────────────────────────────────────────────────── */
.prompt-card {
  padding: 18px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
}
.prompt-card .eyebrow { color: rgba(255, 255, 255, 0.85); }
.prompt-card .q {
  font-family: var(--display); font-size: 22px; font-weight: 500;
  line-height: 1.2; letter-spacing: -0.02em; margin-top: 6px;
}
.prompt-card .cta {
  margin-top: 14px; padding: 8px 16px; border-radius: 99px; border: none;
  background: #fff; color: #2B1820; font-size: 12.5px; font-weight: 600;
}

/* ── Insight card ────────────────────────────────────────────────────── */
.insight-card {
  border-radius: 22px; overflow: hidden; color: #fff;
  padding: 26px 24px 22px;
  background: linear-gradient(160deg, var(--c, var(--accent)) 0%, var(--accent2) 100%);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--c, var(--accent)) 27%, transparent);
}
.insight-card .line {
  font-family: var(--display); font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.25; text-wrap: pretty;
}
.insight-card .cta {
  padding: 12px 20px; border-radius: 24px; border: none;
  background: #fff; color: var(--c, var(--accent2));
  font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}

/* ── Heatmap ─────────────────────────────────────────────────────────── */
/* Every grid (profile, year report) carries six months = 26 columns.
   Desktop cells are 15px (26×15 + 25×4 = 490px); the rail variant is
   smaller (its card content is 264px — 26×8 + 25×2 = 258px); phones
   shrink the standard grid to 8px cells (258px) so it never scrolls. */
.heatmap-wrap { padding: 14px; overflow-x: auto; }
.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 15px);
  grid-auto-flow: column;
  grid-auto-columns: 15px;
  gap: 4px;
  /* centre the columns when the grid is narrower than its card;
     `safe` keeps left alignment if it ever overflows */
  justify-content: safe center;
}
.heatmap span { border-radius: 3px; background: rgba(var(--ink-rgb), 0.05); }
.heatmap.small {
  grid-template-rows: repeat(7, 8px);
  grid-auto-columns: 8px;
  gap: 2px;
}
.heatmap.small span { border-radius: 2px; }
@media (max-width: 1023px) {
  .heatmap { grid-template-rows: repeat(7, 8px); grid-auto-columns: 8px; gap: 2px; }
  .heatmap span { border-radius: 2px; }
}

/* ── Calendar ────────────────────────────────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (min-width: 1024px) { .cal-grid { gap: 8px; } }
.cal-dow {
  text-align: center; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; color: rgba(var(--ink-rgb), 0.44);
  padding: 4px 0; text-transform: uppercase;
}
.cal-day {
  aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--edge);
  background: transparent; color: rgba(var(--ink-rgb), 0.53);
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 500; padding: 0;
}
@media (min-width: 1024px) { .cal-day { font-size: 15px; } }
.cal-day.filled { border: none; color: #fff; text-shadow: 0 0 8px rgba(0, 0, 0, 0.25); }
.cal-day.today { border: 1.5px solid var(--ink); font-weight: 700; }
.cal-day.selected {
  border: 2px solid var(--ink); font-weight: 700;
  outline: 2px solid var(--paper); outline-offset: -4px;
}
.cal-day.blank { border: none; background: transparent; }

/* ── Modals ──────────────────────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 12, 16, 0.5);
  backdrop-filter: blur(2px);
  display: none; justify-content: center; align-items: center;
  padding: 24px;
}
.scrim.open { display: flex; }
.scrim.bottom { align-items: flex-end; padding: 0; }
@media (min-width: 1024px) { .scrim.bottom { align-items: center; padding: 24px; } }
.modal {
  width: 100%; max-width: 360px; max-height: 90vh; overflow-y: auto;
  background: var(--paper); color: var(--ink);
  border-radius: 22px; padding: 26px 24px 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}
.modal.wide { max-width: 520px; }
.scrim.bottom .modal {
  max-width: 100%; border-radius: 26px 26px 0 0; padding: 12px 22px 30px;
}
@media (min-width: 1024px) {
  .scrim.bottom .modal { max-width: 520px; border-radius: 22px; padding: 26px 24px 22px; }
}
.modal .grabber {
  width: 40px; height: 4px; border-radius: 2px;
  background: rgba(var(--ink-rgb), 0.13); margin: 0 auto 16px;
}
@media (min-width: 1024px) { .modal .grabber { display: none; } }
.modal h2 {
  font-family: var(--display); font-size: 25px; font-weight: 500;
  letter-spacing: -0.02em; margin: 0; line-height: 1.2;
}
.modal .body-text { font-size: 14.5px; color: rgba(var(--ink-rgb), 0.62); margin-top: 10px; line-height: 1.55; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions > * { flex: 1; }
.modal-actions > .primary { flex: 2; }

/* ── Fields ──────────────────────────────────────────────────────────── */
.field {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--chip); border: 1px solid var(--edge); outline: none;
  font-size: 16px; color: var(--ink);
}
.field:focus { border-color: rgba(var(--ink-rgb), 0.25); }
.field.display-font { font-family: var(--display); font-size: 19px; letter-spacing: -0.015em; }
.field-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(var(--ink-rgb), 0.5);
  margin-bottom: 6px;
}

/* colour picker in add/edit */
.colour-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.colour-pick {
  border: none; padding: 0; background: transparent; width: 52px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.colour-pick .swatch {
  width: 36px; height: 36px; border-radius: 18px; background: var(--c);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--c) 20%, transparent);
}
.colour-pick.on .swatch {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--c),
              0 6px 14px color-mix(in srgb, var(--c) 33%, transparent);
}
.colour-pick .label {
  font-size: 9.5px; letter-spacing: 0.04em; text-align: center;
  color: rgba(var(--ink-rgb), 0.53); line-height: 1.2;
}
.colour-pick.on .label { color: var(--ink); font-weight: 600; }
.colour-pick .swatch.new {
  background: transparent; border: 1.5px dashed rgba(var(--ink-rgb), 0.33);
  display: flex; align-items: center; justify-content: center;
  color: rgba(var(--ink-rgb), 0.5); box-shadow: none;
}

.swatch-pick {
  width: 28px; height: 28px; border-radius: 14px; border: none; padding: 0;
  background: var(--c);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--c) 33%, transparent);
}
.swatch-pick.on { box-shadow: 0 0 0 2px var(--chip), 0 0 0 3.5px var(--ink); }

/* per-detail colour dots — the dashed dot means "same colour as the joy" */
.dot-strip { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.dot-pick {
  width: 18px; height: 18px; border-radius: 9px; border: none; padding: 0;
  background: var(--c);
}
.dot-pick.inherit {
  background: transparent; border: 1.5px dashed rgba(var(--ink-rgb), 0.33);
}
.dot-pick.on { box-shadow: 0 0 0 2px var(--chip), 0 0 0 3.5px var(--ink); }

/* ── Sections ────────────────────────────────────────────────────────── */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 24px 0 10px;
}
.section-head:first-child { margin-top: 0; }

/* year strip */
.year-strip { display: flex; height: 56px; border-radius: 10px; overflow: hidden; }
@media (min-width: 1024px) { .year-strip { height: 72px; border-radius: 12px; } }
.year-strip > div { min-width: 36px; position: relative; }
.year-strip .strip-label {
  position: absolute; left: 10px; bottom: 10px; color: #fff;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; opacity: 0.9;
}

/* quarter bars */
.quarter-bars { display: flex; align-items: flex-end; gap: 4px; height: 64px; }
@media (min-width: 1024px) { .quarter-bars { height: 88px; gap: 6px; } }
.quarter-bars > div { flex: 1; border-radius: 3px; opacity: 0.85; min-height: 6px; }

/* pattern lines */
.pattern-line {
  padding: 14px 0; border-bottom: 1px solid var(--edge);
  font-family: var(--display); font-size: 15px; line-height: 1.45;
  letter-spacing: -0.005em;
}
.pattern-line:last-child { border-bottom: none; }
.pattern-line .when {
  margin-top: 6px; font-family: var(--mono); font-size: 10px;
  color: rgba(var(--ink-rgb), 0.44); letter-spacing: 0.1em; text-transform: uppercase;
}

/* ── Empty states ────────────────────────────────────────────────────── */
.empty-block {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 60px 40px; gap: 4px;
}
.empty-block .glyph {
  width: 56px; height: 56px; border-radius: 28px; margin-bottom: 18px;
  background: rgba(212, 120, 154, 0.1);
  display: flex; align-items: center; justify-content: center;
}
.empty-block .glyph span {
  width: 16px; height: 16px; border-radius: 8px; background: var(--accent); opacity: 0.9;
}
.empty-block .title {
  font-family: var(--display); font-size: 24px; font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.2; text-wrap: pretty;
}
.empty-block .body { font-size: 14.5px; color: rgba(var(--ink-rgb), 0.62); line-height: 1.55; margin-top: 10px; }

/* ── Onboarding ──────────────────────────────────────────────────────── */
.onboard-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 480px; margin: 0 auto; padding: 24px 30px 40px;
  position: relative;
}
.onboard-step { display: none; flex: 1; flex-direction: column; }
.onboard-step.active { display: flex; }
.onboard-big {
  font-family: var(--display); font-weight: 400;
  font-size: 28px; line-height: 1.3; letter-spacing: -0.02em; text-wrap: pretty;
}
.onboard-head {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 54px; margin-bottom: 10px;
}
.onboard-dots { display: flex; gap: 6px; justify-content: center; }
.onboard-dots span {
  width: 5px; height: 5px; border-radius: 3px;
  background: rgba(var(--ink-rgb), 0.18); transition: all 0.3s;
}
.onboard-dots span.on { width: 16px; background: var(--ink); }
.onboard-cta {
  width: 100%; height: 54px; border-radius: 27px; border: none;
  background: var(--ink); color: var(--paper);
  font-size: 14.5px; font-weight: 500; letter-spacing: 0.01em;
  transition: background 0.2s, color 0.2s;
}
.onboard-cta:disabled { background: rgba(var(--ink-rgb), 0.09); color: rgba(var(--ink-rgb), 0.33); cursor: not-allowed; }
.onboard-cta.accent { background: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(212, 120, 154, 0.27); }
.onboard-foot { padding-top: 24px; }
.colour-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 22px; }
.colour-cell {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--chip); border: 1.5px solid var(--edge); border-radius: 14px;
  text-align: left; transition: all 0.18s;
}
.colour-cell .ring {
  width: 22px; height: 22px; border-radius: 11px; flex: 0 0 auto;
  border: 1.5px solid rgba(var(--ink-rgb), 0.2); transition: all 0.2s;
}
.colour-cell.on { background: color-mix(in srgb, var(--c) 8%, var(--chip)); border-color: var(--c); }
.colour-cell.on .ring {
  border: none; background: var(--c);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 40%, transparent);
}
.colour-cell .name { font-size: 14.5px; font-weight: 500; }
.pill-choice {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 99px; border: 1.5px solid transparent;
  background: color-mix(in srgb, var(--c) 9%, transparent);
  color: var(--ink); font-size: 13.5px; font-weight: 500; transition: all 0.15s;
}
.pill-choice .mini { width: 10px; height: 10px; border-radius: 5px; background: var(--c); }
.pill-choice.on { background: var(--c); color: #fff; border-color: var(--c); }
.pill-choice.on .mini { background: rgba(255, 255, 255, 0.9); }

@keyframes onbPop {
  0% { transform: scale(0); opacity: 0; }
  55% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.saving-overlay {
  position: fixed; inset: 0; background: var(--paper); z-index: 60;
  display: none; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px;
}
.saving-overlay.open { display: flex; }
.saving-overlay .dot {
  width: 26px; height: 26px; border-radius: 13px; background: var(--c, var(--accent));
  animation: onbPop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3) forwards;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--c, var(--accent)) 40%, transparent);
}
.saving-overlay .word {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(var(--ink-rgb), 0.44);
}

/* dot-lands micro-delight on save */
@keyframes dotLand {
  0% { transform: scale(0) translateY(-6px); opacity: 0; }
  60% { transform: scale(1.2) translateY(0); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.dot-land { animation: dotLand 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3); }

/* ── Joy detail hero ─────────────────────────────────────────────────── */
.joy-hero {
  border-radius: 20px; background: var(--c); color: #fff;
  padding: 28px 24px;
  box-shadow: 0 18px 44px color-mix(in srgb, var(--c) 27%, transparent);
}
.joy-hero .name {
  font-family: var(--display); font-size: 32px; font-weight: 600;
  letter-spacing: -0.025em; line-height: 1.1; margin-top: 10px;
}
@media (min-width: 1024px) { .joy-hero .name { font-size: 40px; } }
.joy-hero .eyebrow { color: rgba(255, 255, 255, 0.85); }
.joy-hero .mono-meta { color: rgba(255, 255, 255, 0.85); margin-top: 14px; }

/* ── Share card ──────────────────────────────────────────────────────── */
.share-card {
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  display: flex; flex-direction: column;
  background: #FAF5EF; color: #2C2320;
  transition: width 0.25s, height 0.25s;
  margin: 0 auto;
}
.share-card .bars { flex: 1; display: flex; }
.share-card .foot { padding: 12px 16px; text-align: left; }
.share-card .foot b { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.share-card .foot .sub {
  font-family: var(--mono); font-size: 9px; color: #A07060;
  letter-spacing: 0.12em; text-transform: uppercase; margin-top: 4px;
}

/* ── Settings rows ───────────────────────────────────────────────────── */
.settings-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--edge);
}
.settings-row .hint { font-size: 11.5px; color: rgba(var(--ink-rgb), 0.5); margin-top: 2px; }
.toggle { position: relative; width: 36px; height: 22px; flex: 0 0 auto; }
.toggle input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.toggle .track {
  position: absolute; inset: 0; border-radius: 11px;
  background: rgba(var(--ink-rgb), 0.13); transition: background 0.15s;
}
.toggle .thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 9px; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); transition: left 0.15s;
}
.toggle input:checked ~ .track { background: var(--accent); }
.toggle input:checked ~ .thumb { left: 16px; }

.avatar {
  border-radius: 50%; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; letter-spacing: 0.02em; flex: 0 0 auto;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent2);
  text-transform: uppercase;
}
:root[data-theme="dark"] .avatar { color: var(--ink); }

/* stats row (desktop profile) */
.stats-row {
  display: flex; padding: 18px 0; margin: 20px 0 28px;
  border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge);
}
.stats-row > div { flex: 1; text-align: center; }
.stats-row > div + div { border-left: 1px solid var(--edge); }
.stats-row .num {
  font-family: var(--display); font-size: 28px; font-weight: 600;
  line-height: 1; letter-spacing: -0.025em;
}
.stats-row .key {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: rgba(var(--ink-rgb), 0.5); margin-top: 6px; text-transform: uppercase;
}

/* flash / inline error */
.inline-error {
  padding: 14px 16px; border-radius: 14px; margin-top: 12px;
  background: var(--chip); border: 1px solid var(--edge); font-size: 13.5px;
}

/* utility */
.row { display: flex; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 22px; } .mt-4 { margin-top: 28px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.hide-mobile { display: none; }
@media (min-width: 1024px) {
  .hide-mobile { display: revert; }
  .hide-desktop { display: none; }
}

@media print {
  .sidebar, .rail, .tabbar, .no-print { display: none !important; }
  .main { overflow: visible; padding: 0; }
  body { background: #fff; }
}
