/* ==========================================================
   Magnolia — The Georgi Family design system
   Quiet, editorial, photo-first. Restraint over decoration.
   ========================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-opsz-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-opsz-italic.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-ext-opsz-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-ext-opsz-italic.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 400 900; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --font-serif: "Newsreader", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --font-sans: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ground: #F4F5F2;
  --surface: #FFFFFF;
  --surface-2: #F8F9F7;
  --ink: #17201C;
  --ink-2: #2E3833;
  --muted: #5B6660;
  --faint: #7F8983;
  --hairline: #E3E6E1;
  --hairline-2: #D3D8D2;

  --leaf: #2D4A3E;
  --leaf-press: #243C32;
  --on-leaf: #FFFFFF;
  --leaf-tint: #E6EDE9;
  --cover: #1F3329;
  --on-cover: #EEF1EA;
  --on-cover-muted: #B6C3BB;

  --brass: #8C6A35;
  --bronze: #6E5226;
  --brass-tint: #F2ECE1;

  --love: #9B3846;
  --love-tint: #F7EAEC;
  --proud: #6E5226;
  --proud-tint: #F2ECE1;

  --shadow-lift: 0 1px 1px rgb(23 32 28 / .04), 0 6px 18px rgb(23 32 28 / .07);
  --shadow-float: 0 1px 2px rgb(23 32 28 / .06), 0 18px 48px rgb(23 32 28 / .16);

  --r-control: 10px;
  --r-card: 16px;
  --r-sheet: 24px;

  --gutter: 20px;
  --maxw: 600px;
  --tabbar-h: 62px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 220ms;

  --person: var(--leaf);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0E1412;
    --surface: #161E1B;
    --surface-2: #1A2320;
    --ink: #ECEFEA;
    --ink-2: #D2D9D4;
    --muted: #9AA59F;
    --faint: #75807A;
    --hairline: #24302B;
    --hairline-2: #303D37;
    --leaf: #9CC2AE;
    --leaf-press: #B1D0BF;
    --on-leaf: #0E1412;
    --leaf-tint: #1C2924;
    --cover: #17261F;
    --on-cover: #ECEFEA;
    --on-cover-muted: #A3B2A9;
    --brass: #C9A66B;
    --bronze: #D7B983;
    --brass-tint: #2A251B;
    --love: #E591A0;
    --love-tint: #2E1D21;
    --proud: #D7B983;
    --proud-tint: #2A251B;
    --shadow-lift: 0 1px 1px rgb(0 0 0 / .3), 0 6px 18px rgb(0 0 0 / .3);
    --shadow-float: 0 1px 2px rgb(0 0 0 / .4), 0 18px 48px rgb(0 0 0 / .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0E1412;
  --surface: #161E1B;
  --surface-2: #1A2320;
  --ink: #ECEFEA;
  --ink-2: #D2D9D4;
  --muted: #9AA59F;
  --faint: #75807A;
  --hairline: #24302B;
  --hairline-2: #303D37;
  --leaf: #9CC2AE;
  --leaf-press: #B1D0BF;
  --on-leaf: #0E1412;
  --leaf-tint: #1C2924;
  --cover: #17261F;
  --on-cover: #ECEFEA;
  --on-cover-muted: #A3B2A9;
  --brass: #C9A66B;
  --bronze: #D7B983;
  --brass-tint: #2A251B;
  --love: #E591A0;
  --love-tint: #2E1D21;
  --proud: #D7B983;
  --proud-tint: #2A251B;
  --shadow-lift: 0 1px 1px rgb(0 0 0 / .3), 0 6px 18px rgb(0 0 0 / .3);
  --shadow-float: 0 1px 2px rgb(0 0 0 / .4), 0 18px 48px rgb(0 0 0 / .5);
}

/* Text size preference */
html[data-text="large"] { font-size: 112.5%; }
html[data-text="larger"] { font-size: 125%; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 64px);
  background: var(--ground);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--ground);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 3px;
  border-radius: 6px;
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.num { font-variant-numeric: lining-nums proportional-nums; }

/* ---------- Page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: var(--dur); animation-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Layout ---------- */
.app {
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 40px);
}
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.stack-xl > * + * { margin-top: 48px; }

/* Top bar: compact title fades in once the large title scrolls away */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  height: 52px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 0 max(12px, calc((100% - var(--maxw)) / 2 + 12px));
  background: color-mix(in oklab, var(--ground) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.topbar.is-condensed { border-bottom-color: var(--hairline); }
.topbar__title {
  justify-self: center;
  font-weight: 600;
  font-size: .9375rem;
  letter-spacing: .005em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.topbar.is-condensed .topbar__title { opacity: 1; transform: none; }
.topbar__side { display: flex; align-items: center; }
.topbar__side--end { justify-content: flex-end; }
.iconbtn {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  color: var(--ink);
  text-decoration: none;
  background: transparent; border: 0; cursor: pointer;
}
.iconbtn:active { background: var(--hairline); }

/* Monogram: G in a thin brass ring */
.monogram {
  --m: 34px;
  width: var(--m); height: var(--m);
  border-radius: 50%;
  display: inline-grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--brass);
  color: var(--brass);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 450;
  font-size: calc(var(--m) * .56);
  line-height: 1;
  padding-bottom: calc(var(--m) * .04);
  flex: none;
}

/* Masthead + large titles */
.masthead { padding: 8px 0 4px; }
.kicker {
  color: var(--muted);
  font-size: .9375rem;
}
.largetitle {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 2.125rem;
  line-height: 1.08;
  letter-spacing: -.012em;
  margin-top: 4px;
  text-wrap: balance;
}
.subtitle { color: var(--muted); margin-top: 6px; font-size: .9375rem; }

/* Section heads */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 4px;
}
.section-title {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -.005em;
}
.section-link {
  color: var(--leaf);
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
  padding: 10px 0 10px 12px;
}
.section-note { color: var(--muted); font-size: .9375rem; margin-top: 2px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 35;
  padding: 6px max(8px, calc((100% - var(--maxw)) / 2)) calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in oklab, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  backdrop-filter: saturate(1.6) blur(20px);
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tab {
  position: relative;
  min-height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
  border-radius: 12px;
  transition: color var(--dur) var(--ease);
}
.tab svg { transition: transform 160ms var(--ease); }
.tab:active svg { transform: scale(.92); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--brass);
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-user-select: none; user-select: none;
}
.btn:active { transform: scale(.985); }
.btn--primary { background: var(--leaf); color: var(--on-leaf); }
.btn--primary:active { background: var(--leaf-press); }
.btn--secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline-2); }
.btn--quiet { background: transparent; color: var(--leaf); padding: 0 6px; min-height: 44px; }
.btn--block { width: 100%; }
.btn--small { min-height: 44px; padding: 0 16px; font-size: .9375rem; border-radius: 10px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- Avatars ---------- */
.avatar {
  --size: 40px;
  position: relative;
  width: var(--size); height: var(--size);
  flex: none;
  border-radius: 50%;
  background: var(--person);
  color: #FFFFFF;
  display: inline-grid; place-items: center;
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 500;
  font-size: calc(var(--size) * .44);
  line-height: 1;
  overflow: hidden;
  text-decoration: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--empty {
  background: transparent;
  color: var(--faint);
  box-shadow: inset 0 0 0 1.5px var(--hairline-2);
}
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { --size: 30px; box-shadow: 0 0 0 2px var(--ring, var(--surface)); }
.avatar-stack .avatar + .avatar { margin-left: -7px; }
.avatar-stack .avatar--empty { box-shadow: 0 0 0 2px var(--ring, var(--surface)), inset 0 0 0 1.5px var(--hairline-2); }

.person-name { color: color-mix(in oklab, var(--person) 88%, var(--ink)); font-weight: 600; text-decoration: none; }
:root[data-theme="dark"] .person-name { color: color-mix(in oklab, var(--person) 45%, #FFFFFF); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .person-name { color: color-mix(in oklab, var(--person) 45%, #FFFFFF); }
}

/* ---------- The weekly cover ---------- */
.cover {
  position: relative;
  margin-top: 20px;
  border-radius: 20px;
  background: var(--cover);
  color: var(--on-cover);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}
.cover__body { position: relative; padding: 22px; }
.cover::after {
  /* a single hairline frame, like a stationery border */
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, var(--brass) 40%, transparent);
  pointer-events: none;
}
.cover__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cover__week { color: var(--on-cover-muted); font-size: .875rem; }
.cover .monogram { --m: 32px; color: #D4B47C; box-shadow: inset 0 0 0 1px #B8955A; }
.cover__question {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 34px 0 26px;
  text-wrap: balance;
}
.cover__meta { display: flex; align-items: center; gap: 12px; color: var(--on-cover-muted); font-size: .9375rem; }
.cover__meta .avatar-stack { --ring: var(--cover); }
.cover__actions { margin-top: 20px; position: relative; z-index: 1; }
.btn--cover { background: var(--on-cover); color: var(--cover); }
.btn--cover:active { background: #DCE2DA; }


/* Question block (check-in page) */
.question-block { padding: 8px 0 4px; }
.question {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-style: italic;
  font-weight: 400;
  font-size: 1.875rem;
  line-height: 1.14;
  letter-spacing: -.01em;
  margin-top: 10px;
  text-wrap: balance;
}
.meta-line { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--muted); font-size: .9375rem; }
.meta-line .avatar-stack { --ring: var(--ground); }

/* ---------- Answers ---------- */
.answers { margin-top: 8px; }
.answer {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 14px;
  padding: 22px 0 20px;
  border-top: 1px solid var(--hairline);
}
.answer:first-child { border-top: 0; }
.answer__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 40px; }
.answer__head .person-name { font-size: 1rem; text-decoration: none; }
.answer__when { color: var(--faint); font-size: .8125rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.answer__body {
  grid-column: 2;
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
  margin-top: -10px;
}
.answer__photo {
  grid-column: 2;
  margin-top: 14px;
  border-radius: var(--r-card);
  aspect-ratio: 4 / 3;
  background: var(--hairline);
  display: grid; place-items: center;
  color: var(--faint);
  font-size: .875rem;
}
.answer__foot { grid-column: 2; margin-top: 14px; }
.answer__via { grid-column: 2; display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: .8125rem; margin-top: 10px; }

/* Reactions */
.reactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.react {
  appearance: none; border: 0; cursor: pointer;
  min-height: 44px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink-2);
  font-size: .9375rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.react svg { transition: transform 200ms var(--ease); }
.react.is-popping svg { transform: scale(1.22); }
.react--love[aria-pressed="true"] { background: var(--love-tint); color: var(--love); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--love) 28%, transparent); }
.react--love[aria-pressed="true"] svg path { fill: currentColor; }
.react--proud[aria-pressed="true"] { background: var(--proud-tint); color: var(--proud); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--proud) 30%, transparent); }
.react--note { color: var(--muted); }

/* Notes under an answer */
.notes { grid-column: 2; margin-top: 14px; display: grid; gap: 10px; }
.note {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: .9375rem; line-height: 1.45;
}
.note .avatar { --size: 24px; margin-top: 1px; }
.note p { color: var(--ink-2); }
.note .person-name { font-size: .9375rem; margin-right: 4px; }

/* ---------- Agenda (Coming up) ---------- */
.agenda { margin-top: 6px; }
.agenda-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
}
.agenda-row:first-child { border-top: 0; }
.datetile { text-align: center; line-height: 1; }
.datetile__m { display: block; color: var(--bronze); font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.datetile__d { display: block; font-family: var(--font-serif); font-optical-sizing: auto; font-size: 1.75rem; font-weight: 500; margin-top: 4px; font-variant-numeric: lining-nums tabular-nums; }
.agenda-row__title { font-weight: 600; font-size: 1rem; line-height: 1.3; }
.agenda-row__sub { color: var(--muted); font-size: .875rem; margin-top: 2px; }
.agenda-row__when { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.agenda-row--holiday .agenda-row__title { font-family: var(--font-serif); font-size: 1.1875rem; font-weight: 500; }
.agenda-row .avatar { --size: 32px; justify-self: center; }

/* ---------- Stationery card (gifts, exchange) ---------- */
.stationery {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  padding: 24px 22px 22px;
  box-shadow: inset 0 0 0 1px var(--hairline), var(--shadow-lift);
}
.stationery::after {
  content: "";
  position: absolute; inset: 7px;
  border-radius: 13px;
  border: 1px solid color-mix(in oklab, var(--brass) 28%, transparent);
  pointer-events: none;
}
.stationery__head { display: flex; align-items: center; gap: 14px; }
.stationery__title { font-family: var(--font-serif); font-optical-sizing: auto; font-size: 1.375rem; font-weight: 500; line-height: 1.2; }
.stationery__sub { color: var(--muted); font-size: .9375rem; margin-top: 2px; }
.stationery__body { margin-top: 18px; color: var(--ink-2); }
.stationery__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.fact__label { color: var(--muted); font-size: .8125rem; }
.fact__value { font-weight: 600; margin-top: 2px; font-variant-numeric: lining-nums; }
.stationery__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }

/* ---------- Lists (rows) ---------- */
.rows { margin-top: 6px; }
.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
}
.row:first-child { border-top: 0; }
.row--plain { grid-template-columns: 1fr auto; }
.row__title { font-weight: 600; line-height: 1.3; }
.row__sub { color: var(--muted); font-size: .875rem; margin-top: 2px; }
.row__end { color: var(--faint); display: flex; align-items: center; gap: 6px; font-size: .875rem; font-variant-numeric: tabular-nums; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 600; letter-spacing: .01em;
  color: var(--bronze);
}
.tag--claimed { color: var(--leaf); }
.lock-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .875rem; margin-top: 4px; }

/* Grouped settings lists */
.group {
  margin-top: 10px;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: inset 0 0 0 1px var(--hairline);
  overflow: hidden;
}
.group .row { padding: 12px 16px; min-height: 56px; border-top-color: var(--hairline); }
.group .row:first-child { border-top: 0; }
.group-label { color: var(--muted); font-size: .875rem; margin: 30px 4px 0; }
.group-note { color: var(--faint); font-size: .8125rem; margin: 8px 4px 0; line-height: 1.45; }

/* Segmented control */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 3px;
  background: var(--ground);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.segmented button {
  appearance: none; border: 0; cursor: pointer;
  min-height: 40px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: .9375rem;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(23 32 28 / .08), 0 0 0 1px var(--hairline); }
.setting { padding: 16px; display: grid; gap: 12px; }
.setting + .setting { border-top: 1px solid var(--hairline); }
.setting__label { font-weight: 600; font-size: .9375rem; }

/* Switch */
.switch {
  appearance: none; border: 0; cursor: pointer; flex: none;
  width: 51px; height: 31px; border-radius: 999px;
  background: var(--hairline-2);
  position: relative;
  transition: background-color var(--dur) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgb(0 0 0 / .18);
  transition: transform var(--dur) var(--ease);
}
.switch[aria-checked="true"] { background: var(--leaf); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* Color swatches */
.swatches { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.swatch {
  appearance: none; border: 0; cursor: pointer;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sw);
  position: relative;
  transition: transform 160ms var(--ease);
}
.swatch:active { transform: scale(.92); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.swatch[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 30%; height: 16%;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: translateY(-15%) rotate(-45deg);
}

/* Drag rows for Today layout */
.handle { color: var(--faint); cursor: grab; }

/* ---------- Family directory ---------- */
.people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 16px;
  margin-top: 26px;
}
.portrait {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  text-decoration: none; color: inherit;
  padding: 4px 4px 0;
  border-radius: 16px;
}
.portrait .avatar { --size: 108px; box-shadow: 0 0 0 1px color-mix(in oklab, var(--person) 20%, transparent); transition: transform 200ms var(--ease); }
.portrait:active .avatar { transform: scale(.97); }
.portrait__name { font-family: var(--font-serif); font-optical-sizing: auto; font-weight: 500; font-size: 1.3125rem; margin-top: 14px; line-height: 1.2; }
.portrait__line { color: var(--muted); font-size: .875rem; margin-top: 4px; line-height: 1.35; max-width: 18ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.portrait__soon { color: var(--bronze); font-size: .8125rem; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------- Person card ---------- */
.card-head {
  margin: 0 calc(var(--gutter) * -1);
  padding: 18px var(--gutter) 28px;
  background: color-mix(in oklab, var(--person) 9%, var(--ground));
  border-bottom: 1px solid color-mix(in oklab, var(--person) 14%, var(--hairline));
}
.card-head .avatar { --size: 96px; }
.card-head__name { font-family: var(--font-serif); font-optical-sizing: auto; font-weight: 500; font-size: 2.375rem; line-height: 1.05; letter-spacing: -.012em; margin-top: 18px; }
.card-head__meta { color: var(--muted); margin-top: 6px; font-size: .9375rem; }
.now {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.4;
  margin-top: 16px;
  color: var(--ink);
  text-wrap: pretty;
}
.now--empty { color: var(--faint); font-size: 1.0625rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: .9375rem;
  color: var(--ink-2);
}
.chip svg { color: color-mix(in oklab, var(--person) 70%, var(--muted)); flex: none; }
.reach { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.reach .btn { flex-direction: column; gap: 4px; min-height: 64px; padding: 8px; font-size: .8125rem; border-radius: 14px; }
.updated { color: var(--faint); font-size: .8125rem; margin-top: 18px; }

.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 0 16px; margin-top: 8px; }
.kv dt, .kv dd { margin: 0; padding: 12px 0; border-top: 1px solid var(--hairline); }
.kv dt { color: var(--muted); font-size: .9375rem; }
.kv dd { font-size: .9375rem; color: var(--ink); }
.kv dt:first-of-type, .kv dd:first-of-type { border-top: 0; }
.prose { font-family: var(--font-serif); font-optical-sizing: auto; font-size: 1.1875rem; line-height: 1.5; margin-top: 10px; text-wrap: pretty; }

/* ---------- Empty states ---------- */
.empty {
  padding: 22px 0 6px;
  color: var(--muted);
  font-size: .9375rem;
}
.empty p + * { margin-top: 12px; }
.more-soon { color: var(--faint); font-size: .9375rem; font-family: var(--font-serif); font-style: italic; margin-top: 8px; }

/* ---------- Sheet (dialog) ---------- */
dialog.sheet {
  border: 0;
  padding: 0;
  margin: auto auto 0;
  width: min(100%, var(--maxw));
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: var(--shadow-float);
  overflow: auto;
}
dialog.sheet[open] { animation: sheet-in 280ms var(--ease); }
dialog.sheet::backdrop { background: rgb(14 20 18 / .38); animation: fade-in 220ms var(--ease); }
@keyframes sheet-in { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }
.sheet__inner { padding: 10px 22px calc(22px + env(safe-area-inset-bottom, 0px)); }
.sheet__grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--hairline-2); margin: 0 auto 14px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet__title { font-weight: 600; font-size: 1rem; }
.sheet__question { font-family: var(--font-serif); font-optical-sizing: auto; font-style: italic; font-size: 1.375rem; line-height: 1.25; margin-top: 18px; text-wrap: balance; }
.composer {
  display: block;
  width: 100%;
  min-height: 168px;
  margin-top: 16px;
  padding: 16px;
  border: 0;
  border-radius: var(--r-card);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--ink);
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: 1.1875rem;
  line-height: 1.5;
  resize: none;
  field-sizing: content;
}
.composer:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--leaf); }
.composer::placeholder { color: var(--faint); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.saved { color: var(--faint); font-size: .8125rem; }

/* ---------- Design page ---------- */
.token-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.token { border-radius: 14px; box-shadow: inset 0 0 0 1px var(--hairline); overflow: hidden; background: var(--surface); }
.token__chip { height: 56px; background: var(--c); }
.token__name { padding: 10px 12px; font-size: .8125rem; }
.token__name span { display: block; color: var(--muted); font-variant-numeric: tabular-nums; }
.type-sample + .type-sample { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.type-sample small { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 4px; font-family: var(--font-sans); font-style: normal; }

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  :root { --gutter: 28px; }
  .people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .largetitle { font-size: 2.5rem; }
  .cover__question { font-size: 2.375rem; }
}

/* Chip icons lift a little on dark grounds */
:root[data-theme="dark"] .chip svg { color: color-mix(in oklab, var(--person) 45%, #FFFFFF); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip svg { color: color-mix(in oklab, var(--person) 45%, #FFFFFF); }
}

/* ==========================================================
   Build 2: motion, photos, editing, gifts, welcome, admin
   ========================================================== */

/* ---------- Your color as the accent ---------- */
html[data-accent="mine"] { --leaf: var(--mine); --leaf-press: color-mix(in oklab, var(--mine) 82%, #000); --leaf-tint: color-mix(in oklab, var(--mine) 12%, var(--surface)); }
:root[data-theme="dark"][data-accent="mine"] { --leaf: color-mix(in oklab, var(--mine) 50%, #fff); --leaf-press: color-mix(in oklab, var(--mine) 40%, #fff); --on-leaf: #0E1412; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-accent="mine"] { --leaf: color-mix(in oklab, var(--mine) 50%, #fff); --leaf-press: color-mix(in oklab, var(--mine) 40%, #fff); --on-leaf: #0E1412; }
}

/* ---------- The page recedes when a sheet rises ---------- */
.app {
  transform-origin: 50% 0;
  transition: transform 420ms var(--ease), border-radius 420ms var(--ease), filter 420ms var(--ease);
}
html.sheet-open { overflow: hidden; }
html.sheet-open .app {
  transform: scale(.94) translateY(calc(env(safe-area-inset-top, 0px) + 10px));
  border-radius: 18px;
  overflow: hidden;
  filter: brightness(.94) saturate(.92);
}
.tabbar { transition: transform 360ms var(--ease), opacity 360ms var(--ease); }
html.sheet-open .tabbar { transform: translateY(110%); opacity: 0; }

dialog.sheet { transition: transform 260ms var(--ease); touch-action: pan-y; }
dialog.sheet.is-closing { animation: sheet-out 230ms var(--ease) forwards; }
dialog.sheet.is-closing::backdrop { animation: fade-out 230ms var(--ease) forwards; }
@keyframes sheet-out { to { transform: translateY(40px); opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet__grabber { cursor: grab; touch-action: none; padding: 6px 0; margin-top: -6px; background-clip: content-box; height: 17px; box-sizing: border-box; }
.sheet__head { touch-action: none; }
.sheet--compact .sheet__inner { padding-top: 10px; }
.btn--strong { font-weight: 700; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px);
  z-index: 60;
  display: grid; justify-items: center; gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 14px;
  max-width: min(92vw, 520px);
  padding: 12px 14px 12px 18px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--ink) 92%, transparent);
  color: var(--ground);
  font-size: .9375rem; font-weight: 500; line-height: 1.35;
  box-shadow: 0 10px 30px rgb(0 0 0 / .18);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transform: translateY(14px) scale(.98);
  opacity: 0;
  transition: transform 260ms var(--ease), opacity 260ms var(--ease);
}
.toast.is-in { transform: none; opacity: 1; }
.toast--error { background: color-mix(in oklab, var(--love) 94%, #000); color: #fff; }
.toast__action {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: inherit; font-weight: 700; font-size: .9375rem; padding: 6px 4px; opacity: .9;
}

/* ---------- Press feel ---------- */
a.row, .portrait, .wish, .linkrow { -webkit-tap-highlight-color: transparent; }
a.row:active, .linkrow:active { background: color-mix(in oklab, var(--ink) 4%, transparent); }
.group a.row:active { background: color-mix(in oklab, var(--ink) 5%, var(--surface)); }

/* ---------- Topbar text action ---------- */
.topbar__action { color: var(--leaf); font-weight: 600; font-size: 1rem; text-decoration: none; padding: 10px 4px; white-space: nowrap; }

/* ---------- Photo avatars ---------- */
.avatar--photo { background-color: var(--person); background-size: cover; background-position: center; }
.avatar--photo img { opacity: 0; transition: opacity 320ms var(--ease); }
.avatar--photo img.is-loaded { opacity: 1; }
.avatar { -webkit-user-select: none; user-select: none; }

/* ---------- Cover with a family photo ---------- */
.cover__image {
  position: relative;
  aspect-ratio: 4 / 3;
  background-color: color-mix(in oklab, var(--cover) 70%, #000);
  background-size: cover; background-position: center;
}
.cover__image img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 500ms var(--ease); }
.cover__image img.is-loaded { opacity: 1; }
.cover--photo::after { inset: 8px; }
.cover--photo .cover__body { padding-top: 20px; }
.cover--photo .cover__question { margin-top: 18px; }
.cover__mine {
  margin: -6px 0 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--on-cover) 9%, transparent);
}
.cover__mine-label { font-size: .8125rem; color: var(--on-cover-muted); }
.cover__mine-text { font-family: var(--font-serif); font-size: 1.0625rem; line-height: 1.45; margin-top: 4px; }
.cover__note { color: var(--on-cover-muted); margin-top: -10px; font-size: .9375rem; }
.cover__actions { display: flex; gap: 10px; }
.cover__actions .btn { flex: 1; padding: 0 12px; font-size: .9375rem; white-space: nowrap; }
.btn--cover-ghost { background: transparent; color: var(--on-cover); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--on-cover) 35%, transparent); }

/* ---------- Photos in answers ---------- */
.answer__q { grid-column: 2; font-family: var(--font-serif); font-style: italic; color: var(--muted); font-size: .9375rem; margin: -8px 0 12px; }
.answer__media { grid-column: 2; }
.photos { display: grid; gap: 6px; margin-top: 14px; border-radius: var(--r-card); overflow: hidden; }
.photos--1 { grid-template-columns: 1fr; }
.photos--2 { grid-template-columns: 1fr 1fr; }
.photos--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.photos--3 .photo:first-child { grid-row: span 2; }
.photos--4 { grid-template-columns: 1fr 1fr; }
.photo {
  appearance: none; border: 0; padding: 0; cursor: zoom-in;
  display: block; width: 100%;
  aspect-ratio: 1;
  background-color: var(--hairline);
  background-size: cover; background-position: center;
  overflow: hidden;
}
.photos--1 .photo { aspect-ratio: 4 / 3; }
.photos--3 .photo:first-child { aspect-ratio: auto; height: 100%; }
.photo img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 400ms var(--ease), transform 600ms var(--ease); }
.photo img.is-loaded { opacity: 1; }
.photo:active img { transform: scale(.985); }

/* Lightbox */
dialog.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: rgb(8 10 9 / .96);
  display: grid; place-items: center;
}
dialog.lightbox:not([open]) { display: none; }
dialog.lightbox::backdrop { background: transparent; }
dialog.lightbox[open] { animation: fade-in 220ms var(--ease); }
dialog.lightbox img { max-width: 100%; max-height: 100dvh; object-fit: contain; }
.lightbox__close { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 12px; color: #fff; background: rgb(255 255 255 / .08); z-index: 2; }

/* ---------- Reactions: a soft pulse, never confetti ---------- */
.react { position: relative; }
.react::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 color-mix(in oklab, currentColor 40%, transparent);
  opacity: 0; pointer-events: none;
}
.react.is-popping::after { animation: pulse 520ms var(--ease); }
@keyframes pulse { 0% { opacity: .9; box-shadow: 0 0 0 0 color-mix(in oklab, currentColor 35%, transparent); } 100% { opacity: 0; box-shadow: 0 0 0 10px color-mix(in oklab, currentColor 0%, transparent); } }
.react__n { display: inline-block; min-width: .6em; }
.react__n.is-rolling { animation: roll 260ms var(--ease); }
@keyframes roll { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Notes ---------- */
.note { position: relative; }
.note__del { width: 32px; height: 32px; margin: -6px -8px 0 auto; color: var(--faint); flex: none; }
.note-form {
  grid-column: 2;
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px;
  padding: 4px 4px 4px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline-2);
}
.note-form[hidden] { display: none; }
.note-form:focus-within { box-shadow: inset 0 0 0 1.5px var(--leaf); }
.note-form__input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; padding: 10px 0; }
.note-form__send { color: var(--leaf); }

/* ---------- Composer uploads ---------- */
.uploads { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.uploads:empty { display: none; }
.upload {
  position: relative;
  width: 76px; height: 76px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--hairline) center / cover;
}
.upload img { width: 100%; height: 100%; object-fit: cover; }
.upload.is-uploading img { filter: saturate(.6) brightness(.85); }
.upload.is-uploading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .35) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: shimmer 1.1s linear infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.upload__remove {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: rgb(0 0 0 / .55); color: #fff;
}

/* ---------- Buttons, links, tags ---------- */
.btn--danger { background: var(--love); color: #fff; }
.btn--danger-text { color: var(--love); }
.linkbtn { appearance: none; border: 0; background: none; color: var(--leaf); font: inherit; font-weight: 600; cursor: pointer; padding: 10px 6px; }
.linkrow { appearance: none; border: 0; background: none; color: var(--leaf); font: inherit; font-weight: 600; text-align: left; padding: 0; cursor: pointer; }
.linkrow--danger { color: var(--love); }
.tag--muted { color: var(--faint); }
.tag--danger { color: var(--love); }
.badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--leaf-tint); color: var(--leaf); font-size: .75rem; font-weight: 600; vertical-align: 2px; }
.badge--soft { background: var(--brass-tint); color: var(--bronze); }
.row__icon { color: var(--muted); display: inline-grid; }
.row__title--serif { font-family: var(--font-serif); font-weight: 500; font-size: 1.0625rem; }
.row__title--soft { font-weight: 400; }
.issue-no { width: 40px; text-align: center; font-family: var(--font-serif); font-size: 1.5rem; color: var(--bronze); }
.section-headwrap { margin-bottom: 2px; }

/* ---------- Person card extras ---------- */
.card-head--cover { padding-top: 0; }
.card-head__cover {
  margin: 0 calc(var(--gutter) * -1) -48px;
  aspect-ratio: 16 / 8;
  background: color-mix(in oklab, var(--person) 30%, var(--ground)) center / cover;
  overflow: hidden;
}
.card-head__cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 500ms var(--ease); }
.card-head__cover img.is-loaded { opacity: 1; }
.card-head--cover .avatar { position: relative; box-shadow: 0 0 0 4px color-mix(in oklab, var(--person) 9%, var(--ground)); }
.address { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: .9375rem; color: var(--ink-2); }
.address a { color: inherit; text-underline-offset: 3px; }
.card-head__edit { margin-top: 16px; }

/* Inline add (private notes) */
.inline-add { display: flex; gap: 8px; margin-top: 12px; }
.inline-add__input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border: 0; border-radius: 12px; background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline-2); font: inherit; font-size: 1rem;
}
.inline-add__input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--leaf); }

/* ---------- Wishes ---------- */
.wishes { margin-top: 6px; }
.wish {
  display: grid;
  grid-template-columns: auto 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  background: var(--ground);
  position: relative;
}
.wish:first-child { border-top: 0; }
.wishes:not([data-reorder]) .wish { grid-template-columns: 56px 1fr auto; }
.wish.is-dragging { z-index: 5; box-shadow: var(--shadow-float); border-radius: 14px; background: var(--surface); transition: box-shadow 200ms; }
.handle { touch-action: none; display: inline-grid; place-items: center; width: 28px; height: 44px; cursor: grab; }
.wish__img {
  width: 56px; height: 56px; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--surface) center / cover;
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--faint);
}
.wish__img img { width: 100%; height: 100%; object-fit: cover; }
.wish__main { min-width: 0; }
.wish__title { font-weight: 600; line-height: 1.3; }
.wish__meta { color: var(--muted); font-size: .875rem; margin-top: 2px; }
.wish__main .tag { margin-top: 6px; }
.wish__end { display: flex; align-items: center; gap: 2px; }
.wish--mine .wish__title { color: var(--leaf); }
.claim { display: flex; align-items: center; gap: 2px; }
.chip--claimed { appearance: none; border: 0; cursor: pointer; color: var(--leaf); background: var(--leaf-tint); box-shadow: none; font-weight: 600; min-height: 36px; padding: 0 12px 0 10px; }
.chip--claimed[aria-pressed="true"] { background: var(--leaf); color: var(--on-leaf); }

/* ---------- Envelope: Secret Santa reveal ---------- */
dialog.sheet.sheet--reveal { background: var(--cover); color: var(--on-cover); }
.sheet--reveal .sheet__grabber { background-color: color-mix(in oklab, var(--on-cover) 30%, transparent); }
.envelope { position: relative; min-height: 440px; display: grid; place-items: center; padding: 8px 0 12px; }
.envelope__card {
  width: 100%;
  text-align: center;
  opacity: 0;
  transform: translateY(24px) scale(.98);
  transition: opacity 600ms var(--ease) 260ms, transform 700ms var(--ease) 260ms;
  display: grid; gap: 12px; justify-items: center;
}
.envelope__kicker { color: var(--on-cover-muted); font-size: .875rem; }
.envelope__title { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.75rem; }
.envelope__who { display: grid; justify-items: center; gap: 14px; margin: 10px 0 6px; }
.envelope__who .avatar { box-shadow: 0 0 0 1px #B8955A, 0 0 0 7px var(--cover), 0 0 0 8px rgb(184 149 90 / .5); }
.envelope__name { font-family: var(--font-serif); font-size: 2.75rem; font-weight: 500; line-height: 1; letter-spacing: -.01em; }
.envelope__note { color: var(--on-cover-muted); font-size: .9375rem; margin-bottom: 8px; }
.envelope__card .btn--primary { background: var(--on-cover); color: var(--cover); }
.envelope__seal {
  position: absolute; inset: 0;
  appearance: none; border: 0; background: none; cursor: pointer; color: inherit;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  transition: opacity 420ms var(--ease), transform 600ms var(--ease);
}
.envelope__seal .monogram { color: #D4B47C; box-shadow: inset 0 0 0 1px #B8955A, 0 0 0 10px rgb(184 149 90 / .12), 0 0 0 22px rgb(184 149 90 / .06); }
.envelope__hint { color: var(--on-cover-muted); font-size: .9375rem; }
.envelope.is-open .envelope__seal { opacity: 0; transform: scale(1.35); pointer-events: none; }
.envelope.is-open .envelope__card { opacity: 1; transform: none; }

/* ---------- Grouped form fields (autosave) ---------- */
.field {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 10px 44px 10px 16px;
  border-top: 1px solid var(--hairline);
}
.group > .field:first-child, .group > .field-pair:first-child .field:first-child { border-top: 0; }
.field__label { font-size: .8125rem; color: var(--muted); }
.field__input {
  appearance: none; border: 0; outline: none; background: transparent;
  color: var(--ink); font: inherit; font-size: 1.0625rem; line-height: 1.4;
  padding: 2px 0; min-height: 30px; width: 100%;
}
.field__input::placeholder { color: var(--faint); }
textarea.field__input { resize: none; min-height: 56px; field-sizing: content; }
.field:focus-within { background: color-mix(in oklab, var(--leaf) 4%, var(--surface)); }
.field__tick {
  position: absolute; right: 16px; top: 50%; translate: 0 -50%;
  color: var(--leaf); opacity: 0; transform: scale(.6);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.field.is-saved .field__tick { opacity: 1; transform: none; }
.field.is-saving .field__tick { opacity: .35; transform: scale(.85); }
.field__hint { font-size: .75rem; color: var(--faint); }
.field__select { cursor: pointer; }
.field-pair { display: grid; grid-template-columns: 1fr 1.3fr; border-top: 1px solid var(--hairline); }
.group > .field-pair:first-child { border-top: 0; }
.field-pair .field { border-top: 0; }
.field-pair .field + .field { border-left: 1px solid var(--hairline); }
.check { width: 22px; height: 22px; accent-color: var(--leaf); }
.pair-form { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--hairline); flex-wrap: wrap; color: var(--muted); }
.pair-form select { flex: 1; min-width: 110px; height: 44px; border-radius: 10px; border: 0; padding: 0 10px; background: var(--ground); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline-2); font: inherit; }
.group .setting:first-child { border-top: 0; }
.cover-pick { aspect-ratio: 16 / 9; background: var(--hairline) center / cover; display: grid; place-items: center; overflow: hidden; }
.cover-pick img { width: 100%; height: 100%; object-fit: cover; }
.cover-pick__empty { color: var(--muted); font-size: .9375rem; padding: 0 24px; text-align: center; }
.cover-pick.is-uploading, .editor-cover.is-uploading, .editor-avatar.is-uploading .avatar, .welcome__photo.is-uploading .avatar { animation: breathe 1.2s var(--ease) infinite alternate; }
@keyframes breathe { from { opacity: 1; } to { opacity: .55; } }

/* ---------- Card editor header ---------- */
.editor-head { position: relative; margin: 6px 0 4px; text-align: center; }
.editor-cover {
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  aspect-ratio: 16 / 7;
  background: color-mix(in oklab, var(--person) 16%, var(--ground)) center / cover;
  overflow: hidden;
}
.editor-cover img { width: 100%; height: 100%; object-fit: cover; }
.editor-cover__btn { position: absolute; right: 14px; top: 14px; }
.editor-avatar { position: relative; display: inline-block; margin-top: -52px; cursor: pointer; border-radius: 50%; box-shadow: 0 0 0 4px var(--ground); }
.editor-avatar__badge, .welcome__photo-badge {
  position: absolute; right: 2px; bottom: 2px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 2px 8px rgb(0 0 0 / .18), inset 0 0 0 1px var(--hairline);
}
.editor-hint { color: var(--faint); font-size: .8125rem; margin-top: 10px; }

/* ---------- You ---------- */
.you-head { display: flex; align-items: center; gap: 16px; padding-top: 12px; }
.you-head__links { display: flex; gap: 14px; }
.you-head__links .section-link { padding: 6px 0; }
.you-foot { text-align: center; color: var(--faint); font-size: .8125rem; margin: 30px 0 8px; line-height: 1.8; font-family: var(--font-serif); font-style: italic; }
.you-foot a { color: inherit; font-family: var(--font-sans); font-style: normal; }
.swatches--loose { padding: 0; gap: 12px; margin-top: 24px; }

/* ---------- Welcome ---------- */
.welcome {
  min-height: 100dvh;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 12px var(--gutter) calc(20px + env(safe-area-inset-bottom, 0px));
}
.welcome__top { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.dots { display: flex; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline-2); transition: background 300ms var(--ease), width 300ms var(--ease); }
.dot.is-done { background: color-mix(in oklab, var(--person) 50%, var(--hairline-2)); }
.dot.is-on { width: 22px; border-radius: 4px; background: var(--person); }
.welcome__body { padding-top: 6vh; animation: rise 520ms var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.welcome__title { font-family: var(--font-serif); font-weight: 500; font-size: 2.5rem; line-height: 1.05; letter-spacing: -.015em; text-wrap: balance; }
.welcome__lead { color: var(--muted); font-size: 1.0625rem; margin: 14px 0 28px; max-width: 36ch; }
.welcome__photo { position: relative; display: block; width: max-content; margin: 18px auto 0; cursor: pointer; border-radius: 50%; }
.welcome__photo .avatar { font-size: 4.5rem; }
.welcome__hint { text-align: center; color: var(--faint); font-size: .9375rem; margin-top: 18px; }
.welcome__preview { display: grid; place-items: center; margin: 8px 0 4px; }
.welcome__preview .avatar { transition: background-color 400ms var(--ease); }
.welcome__foot { display: grid; gap: 4px; padding-top: 18px; }

/* ---------- Plain pages (sign in) ---------- */
.plain { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px)); }
.plain__inner { width: 100%; max-width: 400px; display: grid; justify-items: center; text-align: center; gap: 14px; animation: rise 520ms var(--ease) both; }
.plain__family { font-family: var(--font-serif); color: var(--muted); font-size: 1.0625rem; margin-top: -2px; }
.plain__title { font-family: var(--font-serif); font-weight: 500; font-size: 2.125rem; line-height: 1.1; margin-top: 18px; letter-spacing: -.01em; }
.plain__lead { color: var(--muted); max-width: 34ch; }
.plain__form { display: grid; gap: 10px; width: 100%; margin-top: 8px; }
.plain__input {
  height: 54px; border: 0; border-radius: 14px; padding: 0 16px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1.0625rem; text-align: center;
  box-shadow: inset 0 0 0 1px var(--hairline-2);
}
.plain__input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--leaf); }
.plain__fine { color: var(--faint); font-size: .8125rem; max-width: 32ch; margin-top: 6px; }
.plain__error { color: var(--love); font-weight: 500; }
.plain__who { margin-top: 10px; }
.plain .btn--block { width: 100%; }

/* ---------- The Georgi Weekly, as a magazine ---------- */
.issue-mast { text-align: center; padding: 18px 0 30px; border-bottom: 1px solid var(--hairline); }
.issue-mast__kicker { color: var(--bronze); font-size: .875rem; font-weight: 600; }
.issue-mast__title { font-size: 2.75rem; margin-top: 10px; }
.issue-mast__q { font-family: var(--font-serif); font-style: italic; font-size: 1.375rem; line-height: 1.3; margin: 18px auto 0; max-width: 28ch; color: var(--ink-2); text-wrap: balance; }
.issue-body { padding-top: 10px; }
.letter { padding: 32px 0; border-bottom: 1px solid var(--hairline); }
.letter__by { display: flex; align-items: center; gap: 10px; }
.letter__text { font-family: var(--font-serif); font-optical-sizing: auto; font-size: 1.3125rem; line-height: 1.55; margin-top: 14px; text-wrap: pretty; hanging-punctuation: first; }
.letter__notes { margin-top: 14px; display: grid; gap: 6px; color: var(--ink-2); font-size: .9375rem; }
.issue-updates { padding: 32px 0 8px; }
.issue-update { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--ink-2); }
.issue-nav { display: flex; justify-content: space-between; padding: 30px 0 8px; }

/* ---------- Admin ---------- */
.person-row { border-top: 1px solid var(--hairline); padding-bottom: 12px; }
.person-row:first-child { border-top: 0; }
.person-row .row { border-top: 0; }
.person-row__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 58px; }
.person-row__actions form { display: contents; }
.qr { text-align: center; display: grid; gap: 12px; justify-items: center; }
.qr__title { font-family: var(--font-serif); font-weight: 500; font-size: 1.75rem; margin-top: 4px; touch-action: none; }
.qr__sub { color: var(--muted); max-width: 30ch; }
.qr__code { width: min(78vw, 320px); aspect-ratio: 1; background: #fff; border-radius: 18px; padding: 14px; box-shadow: var(--shadow-lift); margin: 8px 0 14px; }
.qr__code svg { width: 100%; height: 100%; display: block; }

/* Confirm */
.confirm__title { font-family: var(--font-serif); font-weight: 500; font-size: 1.5rem; text-align: center; }
.confirm__body { color: var(--muted); text-align: center; margin: 8px auto 20px; max-width: 34ch; }
.confirm__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Scroll-linked large titles where supported ---------- */
@supports (animation-timeline: scroll()) {
  .masthead .largetitle { animation: title-fade linear both; animation-timeline: scroll(); animation-range: 0 120px; transform-origin: 0 100%; }
  @keyframes title-fade { to { opacity: .2; transform: scale(.96); } }
}
@media (prefers-reduced-motion: reduce) {
  html.sheet-open .app { transform: none; filter: none; }
}

/* Preview only: screens without the tab bar */
html.no-tabs .tabbar { display: none; }
