/* ============================================================
   RememberedCards — design system
   Warm paper + ink, postal red signature. Fraunces (display) +
   Hanken Grotesk (body) + Caveat (handwritten accent). Tokens
   below drive every component; pages should not hardcode values.
   ============================================================ */
:root {
  /* ---- color: warm paper canvas, espresso ink, postal-red signature ---- */
  --paper: #f4eee2;       /* main canvas — warm ivory */
  --paper-2: #ede5d6;     /* recessed bands */
  --surface: #fbf7ef;     /* raised paper (cards) */
  --surface-2: #f6f0e5;
  --ink: #2a2722;         /* warm near-black text */
  --ink-soft: #574f43;
  --muted: #8a8170;       /* warm taupe */
  --line: #e3d9c6;        /* hairline */
  --line-2: #d6cab2;      /* stronger hairline */

  --accent: #b8432a;      /* cinnabar / postal red — the one signature color */
  --accent-2: #9b3622;    /* darker (hover/active) */
  --accent-tint: #f0e1d6; /* soft wash */
  --ochre: #c2872f;       /* stamp / date accent, used sparingly */
  --sage: #6c7a4b;        /* success / "chosen" */
  --sage-tint: #e6e6d3;
  --postal-blue: #355b76; /* airmail stripe only */
  --on-accent: #fcf4e8;   /* text on accent */

  /* ---- type ---- */
  --font-display: "Fraunces", "Hoefler Text", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-script: "Caveat", "Segoe Script", cursive;

  --fs-eyebrow: 0.72rem;
  --fs-small: 0.82rem;
  --fs-body: 1.0625rem;            /* ~17px */
  --fs-lead: clamp(1.12rem, 1.4vw, 1.28rem);
  --fs-h4: 1.18rem;
  --fs-h3: clamp(1.3rem, 1.7vw, 1.62rem);
  --fs-h2: clamp(1.95rem, 3.6vw, 3rem);
  --fs-h1: clamp(2.7rem, 5.7vw, 4.6rem);
  --lh-tight: 1.03;
  --lh-snug: 1.16;
  --lh-body: 1.62;
  --tracking-label: 0.14em;

  /* ---- spacing rhythm (4/8 base) ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 88px; --sp-10: 120px;

  /* ---- radius (restrained, paper-like) ---- */
  --r-xs: 3px; --r-s: 6px; --r-m: 10px; --r-l: 16px; --r-pill: 999px;

  /* ---- shadow (grounded, not floating) ---- */
  --sh-1: 0 1px 2px rgba(42,39,34,.07);
  --sh-2: 0 12px 26px -16px rgba(42,39,34,.34);
  --sh-3: 0 26px 54px -26px rgba(42,39,34,.42);

  --maxw: 1140px;
  --ease: cubic-bezier(.2,.7,.2,1);

  /* line-drawn envelope logomark (masked, so it takes the brand color) */
  --logo-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Crect x='3' y='7' width='26' height='18' rx='2.5'/%3E%3Cpath d='M4 9l12 8.4L28 9'/%3E%3C/svg%3E");
  --icon-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M20 14.4A8 8 0 0 1 9.6 4 6.5 6.5 0 1 0 20 14.4Z'/%3E%3C/svg%3E");
  --icon-sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M4.2 4.2l1.5 1.5M18.3 18.3l1.5 1.5M2.5 12h2M19.5 12h2M4.2 19.8l1.5-1.5M18.3 5.7l1.5-1.5'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* ---- warm dark (espresso) — same structure, warmer ink ---- */
html[data-theme="dark"] {
  --paper: #1e1a15;
  --paper-2: #181410;
  --surface: #272219;
  --surface-2: #2f291f;
  --ink: #efe7d7;
  --ink-soft: #cabfa9;
  --muted: #9d917c;
  --line: #3a3328;
  --line-2: #4a4031;

  --accent: #e0664a;
  --accent-2: #c9573d;
  --accent-tint: #382318;
  --ochre: #d6a64a;
  --sage: #9aa86f;
  --sage-tint: #2a2d1d;
  --postal-blue: #5a86a3;
  --on-accent: #1e1a15;

  --sh-1: 0 1px 2px rgba(0,0,0,.45);
  --sh-2: 0 14px 30px -16px rgba(0,0,0,.62);
  --sh-3: 0 30px 60px -24px rgba(0,0,0,.72);
  color-scheme: dark;
}

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* subtle paper grain over the canvas (sits behind all content) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .04; mix-blend-mode: multiply;
}
#landing, #appScreen, #authScreen, #accountScreen { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font-family: inherit; cursor: pointer; color: inherit; }
.hidden { display: none !important; }
img, svg { max-width: 100%; }
::selection { background: var(--accent-tint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ============================================================
   SHARED: eyebrow label, section heads, buttons, brand
   ============================================================ */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-body); font-size: var(--fs-eyebrow); font-weight: 700;
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--sp-4); background: none; padding: 0; border-radius: 0;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; opacity: .6; }

.section-head { max-width: 38ch; margin: 0 0 var(--sp-7); }
.section-head h2 { font-weight: 500; font-size: var(--fs-h2); line-height: var(--lh-snug); letter-spacing: -0.01em; margin: 0 0 var(--sp-3); }
.section-head p { color: var(--ink-soft); margin: 0; font-size: var(--fs-lead); }

/* buttons — letterpress, crisp, grounded */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  padding: 11px 20px; border-radius: var(--r-s); font-weight: 600; font-size: var(--fs-small);
  letter-spacing: .01em; transition: transform .12s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { box-shadow: var(--sh-1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-bd: var(--accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); box-shadow: var(--sh-2); }
.btn.ghost { --btn-bg: transparent; --btn-fg: var(--ink-soft); --btn-bd: transparent; }
.btn.ghost:hover { color: var(--accent); background: var(--accent-tint); box-shadow: none; }
.btn.block { width: 100%; }
.btn.big { padding: 15px 28px; font-size: 1rem; }
.btn.danger { color: var(--accent); }

/* brand wordmark + line-drawn envelope mark */
.brand {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-display); font-weight: 600; font-size: 1.32rem; letter-spacing: -0.01em; color: var(--ink);
}
.brand .logo {
  width: 30px; height: 30px; flex: none; display: inline-block; font-size: 0; color: transparent;
  background-color: var(--accent);
  -webkit-mask: var(--logo-mask) center / 26px no-repeat; mask: var(--logo-mask) center / 26px no-repeat;
  border: 0; border-radius: 0; box-shadow: none;
}
.brand small { color: var(--muted); font-weight: 400; font-size: 12px; font-family: var(--font-body); }

/* ============================================================
   LANDING — nav
   ============================================================ */
.lwrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-6); }
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-6); background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.landing-nav-links { display: flex; align-items: center; gap: var(--sp-6); }
.landing-nav-links a { color: var(--ink-soft); font-weight: 600; font-size: var(--fs-small); letter-spacing: .01em; }
.landing-nav-links a:hover { color: var(--accent); text-decoration: none; }
.landing-nav-actions { display: flex; align-items: center; gap: var(--sp-3); }
.nav-right { display: flex; align-items: center; gap: var(--sp-3); }

/* ============================================================
   LANDING — hero (asymmetric, editorial)
   ============================================================ */
.hero { position: relative; overflow: hidden; padding: var(--sp-9) 0 var(--sp-10); background: var(--paper); }
.hero-inner { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: var(--sp-8); align-items: center; }
.hero-copy { animation: rise .7s var(--ease) both; }
.hero-title {
  font-weight: 500; font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.022em;
  margin: 0 0 var(--sp-5); color: var(--ink); font-optical-sizing: auto;
}
.hero-title .accent {
  color: var(--accent); font-style: italic; position: relative; white-space: nowrap; padding: 0 .04em;
}
.hero-title .accent::after {
  content: ""; position: absolute; left: -1%; right: -1%; bottom: -0.16em; height: 0.3em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16' preserveAspectRatio='none'%3E%3Cpath d='M3 11C42 4 80 4 110 8s60 6 87 0' fill='none' stroke='%23b8432a' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.hero-sub { font-size: var(--fs-lead); color: var(--ink-soft); max-width: 32ch; margin: 0 0 var(--sp-6); }
.hero-cta { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero-trust { margin-top: var(--sp-5); color: var(--muted); font-size: var(--fs-small); }

/* hero fanned cards (card art left intact; only the frame/placement restyled) */
.hero-art { position: relative; height: 440px; }
.hero-cards { position: absolute; inset: 0; }
.hero-card {
  position: absolute; left: 50%; top: 50%; width: 214px; aspect-ratio: 360 / 480;
  border-radius: var(--r-m); overflow: hidden; background: var(--surface);
  box-shadow: var(--sh-3); border: 1px solid rgba(42,39,34,.06);
  transition: transform .4s var(--ease);
}
.hero-card svg { width: 100%; height: 100%; display: block; }
.hero-card.pos-1 { transform: translate(-48%, -52%) rotate(-4deg); z-index: 3; }
.hero-card.pos-0 { transform: translate(calc(-50% - 150px), -44%) rotate(-12deg); z-index: 2; }
.hero-card.pos-2 { transform: translate(calc(-50% + 152px), -56%) rotate(11deg); z-index: 1; }
.hero-art:hover .hero-card.pos-1 { transform: translate(-48%, -56%) rotate(-4deg); }
.hero-art:hover .hero-card.pos-0 { transform: translate(calc(-50% - 168px), -44%) rotate(-15deg); }
.hero-art:hover .hero-card.pos-2 { transform: translate(calc(-50% + 170px), -56%) rotate(14deg); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================
   LANDING — steps (numbered editorial sequence, no feature cards)
   ============================================================ */
.steps { padding: var(--sp-9) 0; }
.steps-grid { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-7) var(--sp-6); }
.step {
  counter-increment: step; background: none; border: 0; box-shadow: none; border-radius: 0;
  text-align: left; padding: var(--sp-4) 0 0; border-top: 1px solid var(--line-2); transition: none;
}
.step:hover { transform: none; box-shadow: none; }
/* hide the emoji glyph, show a serif index number in its place */
.step-emoji {
  width: auto; height: auto; margin: 0 0 var(--sp-3); background: none; border-radius: 0;
  display: block; font-size: 0;
}
.step-emoji::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display); font-weight: 500; font-size: 2.5rem; line-height: 1;
  color: var(--accent); font-feature-settings: "lnum" 1;
}
.step h3 { font-weight: 600; font-size: var(--fs-h3); margin: 0 0 var(--sp-2); letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--ink-soft); font-size: 1rem; }

/* ============================================================
   LANDING — showcase (card grid is left intact; only context styled)
   ============================================================ */
.showcase { padding: var(--sp-9) 0; background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ============================================================
   LANDING — feature (reminders in action)
   ============================================================ */
.feature { padding: var(--sp-9) 0; }
.feature-inner { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: var(--sp-8); align-items: center; }
.feature-copy h2 { font-weight: 500; font-size: var(--fs-h2); line-height: var(--lh-snug); letter-spacing: -0.01em; margin: 0 0 var(--sp-4); }
.feature-copy p { color: var(--ink-soft); font-size: var(--fs-lead); margin: 0 0 var(--sp-4); max-width: 40ch; }
.feature-list { list-style: none; padding: 0; margin: var(--sp-5) 0 0; display: grid; gap: var(--sp-3); }
.feature-list li { display: flex; gap: var(--sp-3); align-items: flex-start; color: var(--ink-soft); }
/* hand-drawn ink check (no glyph/emoji) */
.feature-list .tick { flex: none; position: relative; width: 15px; height: 1.6em; }
.feature-list .tick::before { content: ""; position: absolute; left: 3px; top: 0.42em; width: 6px; height: 11px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.feature-art {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: var(--sp-5); box-shadow: var(--sh-2); display: grid; gap: var(--sp-3);
}

/* postal reminder slips (mock notifications) */
.mock-notif {
  display: flex; align-items: center; gap: var(--sp-4); background: var(--surface-2);
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r-s); padding: var(--sp-3) var(--sp-4);
}
.mock-notif.holiday { border-left-color: var(--ochre); }
.mock-notif .m-emoji { font-size: 24px; flex: none; }
.mock-notif .m-grow { flex: 1; min-width: 0; }
.mock-notif .m-title { font-weight: 700; font-size: 0.96rem; }
.mock-notif .m-sub { color: var(--muted); font-size: var(--fs-small); }
.mock-notif .m-sub.chosen { color: var(--sage); font-weight: 600; }
.mock-notif .m-pill {
  font-size: 0.72rem; font-weight: 700; letter-spacing: .02em; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-soft); white-space: nowrap;
}
.mock-notif .m-pill.today { color: var(--accent); border-color: var(--accent); }
.mock-notif .m-pill.soon { color: var(--accent); border-color: var(--accent); }
.mock-notif .m-pill.chosen { color: var(--sage); border-color: var(--sage); }
.mock-notif .m-cta { padding: 8px 13px; font-size: var(--fs-small); white-space: nowrap; }

/* ============================================================
   LANDING — CTA band (espresso block, airmail edge) + footer
   ============================================================ */
.cta-band {
  position: relative; overflow: hidden; padding: var(--sp-9) var(--sp-6); margin: 0 var(--sp-6) var(--sp-6);
  text-align: center; background: var(--ink); color: var(--paper); border-radius: var(--r-l); box-shadow: var(--sh-2);
}
.cta-band::before, .cta-band::after {
  content: ""; position: absolute; left: 0; right: 0; height: 6px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 9px, transparent 9px 18px, var(--postal-blue) 18px 27px, transparent 27px 36px);
  opacity: .9;
}
.cta-band::before { top: 0; } .cta-band::after { bottom: 0; }
.cta-band h2 { font-weight: 500; color: var(--paper); font-size: var(--fs-h2); margin: 0 0 var(--sp-3); }
.cta-band p { margin: 0 0 var(--sp-6); font-size: var(--fs-lead); opacity: .82; }
.cta-band .btn { --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-bd: var(--paper); }
.cta-band .btn:hover { --btn-bg: var(--surface); box-shadow: 0 14px 30px rgba(0,0,0,.28); }

.landing-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3);
  max-width: var(--maxw); margin: 0 auto; padding: var(--sp-7) var(--sp-6) var(--sp-9); color: var(--muted);
}
.footer-brand .logo { width: 26px; height: 26px; }
.landing-foot .muted { color: var(--muted); font-size: var(--fs-small); }

/* ============================================================
   AUTH
   ============================================================ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-5); background: var(--paper); }
.auth-box { display: flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 440px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.auth-top .link-back { padding-bottom: 0; }
.link-back { align-self: flex-start; background: none; border: none; color: var(--accent); font-weight: 600; font-size: var(--fs-small); padding: 0; }
.auth-hero { text-align: center; margin-bottom: var(--sp-5); }
.auth-hero .brand { justify-content: center; font-size: 1.6rem; }
.auth-sub { text-align: center; color: var(--muted); margin: var(--sp-2) 0 0; }
#clerk-signin, #clerk-userprofile { display: flex; justify-content: center; width: 100%; }
.signin-status { color: var(--muted); padding: var(--sp-6); font-size: var(--fs-small); }
.error {
  background: var(--accent-tint); color: var(--accent-2); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-s); border: 1px solid var(--line-2); font-size: var(--fs-small); line-height: 1.5;
}
/* blend Clerk's widget into the paper look */
#clerk-signin .cl-card, #clerk-userprofile .cl-card {
  box-shadow: var(--sh-2) !important; border: 1px solid var(--line) !important; border-radius: var(--r-l) !important; background: var(--surface) !important;
}
.cl-logoBox, .cl-logoImage, .cl-badge { display: none !important; }
.cl-footer a[href*="clerk.com"], .cl-internal-1fcj7sw, .cl-poweredByClerk { display: none !important; }
.cl-footer { background: transparent !important; }

/* ============================================================
   DASHBOARD — topbar + tabs
   ============================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-6); background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { cursor: pointer; }
.topnav { display: flex; align-items: center; gap: var(--sp-3); }
.topnav .who, .landing-nav-actions .who {
  font-family: var(--font-script); font-size: 1.35rem; color: var(--ink-soft); line-height: 1; margin-right: var(--sp-1);
}
.nav-who { font-family: var(--font-script); font-size: 1.35rem; color: var(--ink-soft); }

.apptabs { display: flex; gap: var(--sp-4); }
.apptab {
  background: none; border: 0; padding: var(--sp-2) 2px; border-radius: 0; position: relative;
  font-weight: 600; font-size: var(--fs-small); letter-spacing: .01em; color: var(--muted);
}
.apptab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.apptab:hover { color: var(--ink); }
.apptab.is-active { color: var(--ink); }
.apptab.is-active::after { transform: scaleX(1); }

/* signed-in home header mirrors the dashboard topbar; both center the tabs */
#appScreen .topbar, .landing-nav.signed-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
#appScreen .topbar > .brand, .landing-nav.signed-in > .brand { justify-self: start; }
#appScreen .topbar > .apptabs, .landing-nav.signed-in > #navLinks { justify-self: center; }
#appScreen .topbar > .topnav, .landing-nav.signed-in > .nav-right { justify-self: end; }
.landing-nav.signed-in { background: var(--paper); padding: var(--sp-3) var(--sp-6); }
.landing-nav.signed-in > #navLinks { gap: var(--sp-4); }

.navlink-btn { background: none; border: none; font-family: inherit; font-size: var(--fs-small); font-weight: 600; color: var(--ink-soft); padding: 4px 2px; }
.navlink-btn:hover { color: var(--accent); }
.hiw-feature { margin-top: var(--sp-7); }

.app { max-width: var(--maxw); margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-9); }
.section-title {
  font-size: var(--fs-eyebrow); text-transform: uppercase; letter-spacing: var(--tracking-label);
  color: var(--muted); font-weight: 700; margin: var(--sp-6) 0 var(--sp-4); display: flex; align-items: center; gap: var(--sp-3);
}
.section-title::before { content: ""; width: 22px; height: 1px; background: var(--line-2); flex: none; }
.grid { display: grid; gap: var(--sp-4); }
.notif-strip { display: flex; flex-direction: column; gap: var(--sp-3); }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-m); padding: var(--sp-5); text-align: center; }

/* dashboard 3-col layout */
#appScreen .app { max-width: 1360px; }
.dash-cols { display: grid; grid-template-columns: 360px minmax(0, 1fr) 300px; gap: var(--sp-7); align-items: start; }
.dash-side, .dash-right { position: sticky; top: 84px; }
@media (max-width: 1100px) {
  .dash-cols { grid-template-columns: 1fr; }
  .dash-side, .dash-right { position: static; }
  .calendar { max-width: 520px; margin: 0 auto; }
}

/* ============================================================
   DASHBOARD — calendar
   ============================================================ */
.calendar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--sp-4) var(--sp-4) var(--sp-5); box-shadow: var(--sh-1); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.cal-title { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; }
.cal-nav { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-soft); width: 30px; height: 30px; border-radius: var(--r-s); font-size: 18px; line-height: 1; display: grid; place-items: center; padding: 0; }
.cal-nav:hover { border-color: var(--accent); color: var(--accent); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: 0.68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: var(--sp-1); }
.cal-day { aspect-ratio: 1 / 1; border-radius: var(--r-s); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.95rem; color: var(--ink-soft); }
.cal-day.blank { visibility: hidden; }
.cal-day.has-events { background: var(--accent-tint); color: var(--ink); font-weight: 700; }
.cal-day.is-today { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: var(--sh-1); }
.cal-day .cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 4px; }
.cal-day.is-today .cal-dot { background: var(--on-accent); }

/* calendar hover tooltip */
.cal-tip { position: fixed; z-index: 90; max-width: 240px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); box-shadow: var(--sh-3); padding: var(--sp-3) var(--sp-4); pointer-events: none; display: grid; gap: var(--sp-2); }
.cal-tip .ct-row { display: flex; gap: var(--sp-2); align-items: flex-start; }
.cal-tip .ct-emoji { font-size: 15px; line-height: 1.3; }
.cal-tip .ct-title { font-weight: 700; font-size: 0.84rem; line-height: 1.3; }
.cal-tip .ct-sub { color: var(--muted); font-size: 0.78rem; }

/* ============================================================
   DASHBOARD — reminder recs (right column, one block per event)
   ============================================================ */
.reminder-cards { display: flex; flex-direction: column; gap: var(--sp-5); }
.rc-event-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.rc-ev-emoji { font-size: 14px; }
.rc-ev-title { font-weight: 700; font-size: 0.84rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-ev-days { font-size: 0.7rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.rc-ev-days.chosen { color: var(--sage); }
.rc-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.rc-card { cursor: pointer; transition: transform .15s var(--ease); }
.rc-card:hover { transform: translateY(-3px); }
.rc-card.is-chosen .rc-front { outline: 2px solid var(--sage); outline-offset: 2px; }
.rc-front { aspect-ratio: 360 / 480; border-radius: var(--r-s); overflow: hidden; box-shadow: var(--sh-1); background: var(--surface); }
.rc-front svg { width: 100%; height: 100%; display: block; }

/* ============================================================
   DASHBOARD — people (contact slips)
   ============================================================ */
.people-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.person-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--sp-4); box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: var(--sp-2); }
.person-card .pc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.person-card .pc-name { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; }
.person-card .pc-del { border: none; background: transparent; color: var(--muted); font-size: 14px; line-height: 1; padding: 5px 7px; border-radius: var(--r-s); }
.person-card .pc-del:hover { background: var(--accent-tint); color: var(--accent); }
.person-card .pc-meta { color: var(--muted); font-size: var(--fs-small); }
.person-card .pc-bday { font-size: var(--fs-small); font-weight: 600; color: var(--ink-soft); }
.person-card.editable { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.person-card.editable:hover { border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.add-tile { align-items: center; justify-content: center; gap: var(--sp-1); min-height: 116px; border: 1px dashed var(--line-2); background: var(--surface-2); color: var(--accent); font-family: inherit; }
.add-tile:hover { border-color: var(--accent); background: var(--accent-tint); transform: none; box-shadow: none; }
.add-tile .add-plus { font-size: 24px; line-height: 1; }
.add-tile .add-label { font-weight: 600; font-size: var(--fs-small); color: var(--ink-soft); }
.add-tile .cycle-word { font-weight: 700; color: var(--accent); }
.add-tile .add-particles { display: none; } /* calm: no constant confetti */

/* holiday chips on a person card */
.pc-holidays { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-1); }
.pc-hol { font-size: 0.68rem; font-weight: 600; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px 8px; white-space: nowrap; }

/* ============================================================
   DASHBOARD — browse (banner, search, filters)
   ============================================================ */
.cards-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-5); font-size: var(--fs-small); }
.cards-banner.active { border-color: var(--accent); background: var(--accent-tint); }
.cards-banner .cb-text { font-weight: 600; }
.cards-banner .cb-text.muted { color: var(--muted); font-weight: 400; }
#gallery .pick { display: none; }
#gallery.choosing .pick { display: block; }

.browse-controls { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-5); }
#cardSearch { flex: 0 1 300px; min-width: 200px; padding: 10px 16px; border: 1px solid var(--line-2); border-radius: var(--r-pill); font-size: var(--fs-small); font-family: inherit; background: var(--surface); color: inherit; }
#cardSearch:focus { outline: none; border-color: var(--accent); }
.card-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.filter-chip { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-soft); padding: 6px 13px; border-radius: var(--r-pill); font-size: var(--fs-small); font-weight: 600; }
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.card-group { margin-bottom: var(--sp-7); }
.cg-head { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; margin: 0 0 var(--sp-4); color: var(--ink); }
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--sp-5); }

/* ============================================================
   CARD GALLERY — components left intact; only frame/labels touched
   ============================================================ */
.gallery { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-6); }
.card-tile { display: flex; flex-direction: column; }
.flip { perspective: 1500px; cursor: pointer; }
.flip-inner { position: relative; width: 100%; aspect-ratio: 360 / 480; transition: transform .7s var(--ease); transform-style: preserve-3d; }
.flip:hover .flip-inner, .flip.open .flip-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r-m); overflow: hidden; box-shadow: var(--sh-2); background: var(--surface); border: 1px solid rgba(42,39,34,.06); }
.face svg { width: 100%; height: 100%; display: block; }
.face.back { transform: rotateY(180deg); }
.card-label { margin-top: var(--sp-3); display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.card-label .cname { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; }
.card-label .hint { color: var(--muted); font-size: 0.72rem; }
.card-tile .pick { margin-top: var(--sp-3); }

/* ============================================================
   MODALS + form fields
   ============================================================ */
.modal-back { position: fixed; inset: 0; background: rgba(26,22,17,.5); display: grid; place-items: center; padding: var(--sp-5); z-index: 50; }
.modal { background: var(--surface); border-radius: var(--r-l); width: 100%; max-width: 460px; padding: var(--sp-6); box-shadow: var(--sh-3); border: 1px solid var(--line); max-height: 88vh; overflow-y: auto; }
.modal h3 { font-weight: 600; margin: 0 0 var(--sp-1); font-size: 1.5rem; }
.modal .sub { color: var(--muted); margin: 0 0 var(--sp-5); font-size: var(--fs-small); }
.modal-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.modal-actions .danger { color: var(--accent); }
.modal-actions #deletePerson { margin-right: auto; }
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: var(--fs-small); font-weight: 600; margin-bottom: var(--sp-2); color: var(--ink-soft); }
.field input, .field select { width: 100%; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--r-s); font-size: 1rem; background: var(--surface-2); font-family: inherit; color: inherit; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--sp-4); min-width: 0; }
fieldset.field legend { padding: 0; font-size: var(--fs-small); font-weight: 600; color: var(--ink-soft); margin-bottom: var(--sp-2); }
.field-hint { font-size: 0.78rem; color: var(--muted); margin: 0 0 var(--sp-3); line-height: 1.4; }
.opt { font-weight: 400; color: var(--muted); }
.dob-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: var(--sp-2); }
.dob-part label { font-size: 0.72rem; font-weight: 600; color: var(--muted); margin-bottom: var(--sp-1); }
.dob-part input { text-align: center; letter-spacing: .04em; }
.dob-year input { text-align: left; letter-spacing: normal; }

/* per-person holiday checklist */
.holiday-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.holiday-grid .holiday-chip { display: flex; align-items: center; gap: var(--sp-2); margin: 0; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface-2); cursor: pointer; font-size: var(--fs-small); font-weight: 500; color: inherit; user-select: none; }
.holiday-grid .holiday-chip:hover { border-color: var(--accent); }
.holiday-grid .holiday-chip input { width: auto; margin: 0; accent-color: var(--accent); flex: none; }
.holiday-grid .holiday-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.holiday-grid .holiday-chip .hc-emoji { font-size: 15px; line-height: 1; }
.holiday-grid .holiday-chip.is-fixed { cursor: default; border-style: dashed; background: var(--surface-2); }
/* relationship-based "Suggested" highlight (a hint, not a selection) */
.holiday-grid .holiday-chip .hc-suggest { display: none; margin-left: auto; flex: none; font-size: 0.6rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ochre); background: var(--surface); border: 1px solid var(--line-2); padding: 2px 6px; border-radius: var(--r-pill); }
.holiday-grid .holiday-chip.is-suggested { border-color: var(--ochre); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ochre) 18%, transparent); }
.holiday-grid .holiday-chip.is-suggested .hc-suggest { display: inline-block; }
.holiday-grid .holiday-chip.is-suggested:has(input:checked) { box-shadow: none; }
.holiday-grid .holiday-chip.is-suggested:has(input:checked) .hc-suggest { display: none; }

/* ============================================================
   TOAST + theme toggle
   ============================================================ */
.toast { position: fixed; bottom: var(--sp-5); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-s); font-size: var(--fs-small); box-shadow: var(--sh-3); z-index: 80; }

.theme-toggle { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); width: 36px; height: 36px; border-radius: var(--r-s); padding: 0; flex: none; font-size: 15px; line-height: 1; display: inline-grid; place-items: center; transition: transform .12s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.theme-toggle:active { transform: translateY(0); }
.theme-toggle::after { content: ""; display: block; width: 17px; height: 17px; background-color: currentColor;
  -webkit-mask: var(--icon-moon) center / contain no-repeat; mask: var(--icon-moon) center / contain no-repeat; }
html[data-theme="dark"] .theme-toggle::after { -webkit-mask-image: var(--icon-sun); mask-image: var(--icon-sun); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero { padding: var(--sp-7) 0 var(--sp-8); }
  .hero-inner { grid-template-columns: 1fr; gap: var(--sp-6); }
  .hero-sub { max-width: none; }
  .hero-art { height: 360px; order: -1; }
  .feature-inner { grid-template-columns: 1fr; gap: var(--sp-6); }
  .steps-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .landing-nav-links { display: none; }
  .landing-nav.signed-in > #navLinks { display: flex; }
}
@media (max-width: 760px) {
  .cta-band { margin: 0 var(--sp-4) var(--sp-4); padding: var(--sp-8) var(--sp-5); }
  .app { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
  .topbar { padding: var(--sp-3) var(--sp-4); flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); }
  #appScreen .topbar, .landing-nav.signed-in { display: flex; }
  .landing-nav.signed-in { padding: var(--sp-3) var(--sp-4); }
  .apptabs, .landing-nav.signed-in > #navLinks { order: 3; width: 100%; justify-content: center; }
  .calendar { max-width: 440px; }
  .mock-notif { flex-wrap: wrap; }
  .mock-notif .m-cta { margin-left: auto; }
}
@media (max-width: 480px) {
  .lwrap { padding: 0 var(--sp-4); }
  .hero-card { width: 168px; }
  .hero-card.pos-0 { transform: translate(calc(-50% - 116px), -44%) rotate(-12deg); }
  .hero-card.pos-2 { transform: translate(calc(-50% + 118px), -56%) rotate(11deg); }
  .row2 { grid-template-columns: 1fr; }
  .holiday-grid { grid-template-columns: 1fr; }
  .modal { padding: var(--sp-5) var(--sp-4); }
  .topnav .who { display: none; }
}
