/* Friend Advent — tool styles (visual direction: Paper Advent Letters) */

[data-theme="gingerbread"] {
  --t-bg: #F1DFC8;
  --t-bg-2: #E7D0B0;
  --t-surface: #FFF8EC;
  --t-ink: #3B2418;
  --t-ink-2: #76523C;
  --t-line: #D9BA96;
  --t-accent: #B23A2E;
  --t-accent-dark: #8C2A21;
  --t-accent-2: #2F6B4F;
  --t-gold: #C99A3F;
  --t-door: #E7C39A;
  --t-door-edge: #FFF8EC;
  --t-on-accent: #FFF8EC;
  --t-on-accent-2: #FFF8EC;
  --t-ok: #3F6B4F;
  --t-danger: #A33A2E;
  --t-seal-cell: 0 0;
  --t-door-texture: var(--art-gingerbread, url("https://img.friend-advent.com/s_123j6r06501070/theme-gingerbread-texture.c1595aa86b.webp"));
  --t-bulb-a: #FFE9B8;
  --t-bulb-b: #B23A2E;
  --t-bulb-c: #2F6B4F;
  --t-snow-count: 40;
  --t-snow-color: #FFF6E4;
  --t-snow-radius: 1.2;
  --t-snow-speed: .45;
}

[data-theme="evergreen"] {
  --t-bg: #0C1A14;
  --t-bg-2: #13241B;
  --t-surface: #15271E;
  --t-ink: #F4EBD8;
  --t-ink-2: #AFC0B2;
  --t-line: #2C4436;
  --t-accent: #C99A3F;
  --t-accent-dark: #A87A2F;
  --t-accent-2: #D96A4A;
  --t-gold: #E3C584;
  --t-door: #1A3227;
  --t-door-edge: #C99A3F;
  --t-on-accent: #0C1A14;
  --t-on-accent-2: #0C1A14;
  --t-ok: #8FBF9F;
  --t-danger: #E08A7A;
  --t-seal-cell: 100% 0;
  --t-door-texture: var(--art-evergreen, url("https://img.friend-advent.com/s_123j6r06501070/theme-evergreen-texture.1a8d7554bc.webp"));
  --t-bulb-a: #E3C584;
  --t-bulb-b: #F4EBD8;
  --t-bulb-c: #D96A4A;
  --t-snow-count: 70;
  --t-snow-color: #F4EBD8;
  --t-snow-radius: 2.2;
  --t-snow-speed: 1;
}

[data-theme="paper"] {
  --t-bg: #F6EFE3;
  --t-bg-2: #EFE3D1;
  --t-surface: #FFFBF3;
  --t-ink: #1F2A24;
  --t-ink-2: #5D6B60;
  --t-line: #D9CBB6;
  --t-accent: #B23A2E;
  --t-accent-dark: #8C2A21;
  --t-accent-2: #2F4A3A;
  --t-gold: #C99A3F;
  --t-door: #EFE3D1;
  --t-door-edge: #D9CBB6;
  --t-on-accent: #FFFFFF;
  --t-on-accent-2: #FFFBF3;
  --t-ok: #3F6B4F;
  --t-danger: #A33A2E;
  --t-seal-cell: 0 0;
  --t-door-texture: none;
  --t-bulb-a: #E7D8BF;
  --t-bulb-b: #C99A3F;
  --t-bulb-c: #D9CBB6;
  --t-snow-count: 0;
  --t-snow-color: #FFFFFF;
  --t-snow-radius: 0;
  --t-snow-speed: 0;
}

.fa,
.fa *,
.fa *::before,
.fa *::after { box-sizing: border-box; }

.fa {
  --paper: var(--t-bg, #F1DFC8);
  --paper-2: var(--t-bg-2, #E7D0B0);
  --card: var(--t-surface, #FFF8EC);
  --ink: var(--t-ink, #3B2418);
  --ink-2: var(--t-ink-2, #76523C);
  --line: var(--t-line, #D9BA96);
  --wax: var(--t-accent, #B23A2E);
  --wax-dark: var(--t-accent-dark, #8C2A21);
  --gold: var(--t-gold, #C99A3F);
  --pine: var(--t-accent-2, #2F6B4F);
  --ok: var(--t-ok, #3F6B4F);
  --danger: var(--t-danger, #A33A2E);
  --door: var(--t-door, #E7C39A);
  --door-edge: var(--t-door-edge, #FFF8EC);
  --on-accent: var(--t-on-accent, #FFF8EC);
  --on-accent-2: var(--t-on-accent-2, #FFF8EC);
  --door-texture: var(--t-door-texture, none);
  --seal-cell: var(--t-seal-cell, 0 0);
  --bulb-a: var(--t-bulb-a, #FFE9B8);
  --bulb-b: var(--t-bulb-b, #B23A2E);
  --bulb-c: var(--t-bulb-c, #2F6B4F);
  --sh1: 0 1px 2px rgba(12, 26, 20, .12);
  --sh2: 0 12px 32px rgba(12, 26, 20, .18);
  --container: 1120px;

  position: relative;
  display: block;
  isolation: isolate;
  overflow-x: clip;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper theme keeps the real paper texture; other themes are solid */
.fa::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: none;
}
[data-theme="paper"] .fa::before {
  background-image:
    linear-gradient(rgba(246, 239, 227, .92), rgba(246, 239, 227, .92)),
    var(--art-paper, url("https://img.friend-advent.com/s_123j6r06501070/papers-cream.d6dcfe1816.webp"));
  background-size: auto, 512px;
  background-repeat: repeat;
}

.fa [hidden] { display: none !important; }
.fa img { max-width: 100%; height: auto; }
.fa p { margin: 0; }
.fa ul, .fa ol { margin: 0; padding: 0; list-style: none; }
.fa a { color: inherit; }
.fa button { font: inherit; color: inherit; }
.fa code, .fa kbd { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }

.fa h1, .fa h2, .fa h3,
.fa .fa-h1, .fa .fa-h2, .fa .fa-h3 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.fa :focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.fa .fa-stamp {
  display: block;
  width: 32px;
  height: 32px;
  flex: none;
  background-image: var(--art-stamps, url("https://img.friend-advent.com/s_123j6r06501070/stamps.d4ac186a64.webp"));
  background-size: 400% 200%;
  background-repeat: no-repeat;
}
.fa .fa-stamp--star { background-position: 0 0; }
.fa .fa-stamp--gift { background-position: 33.333% 0; }
.fa .fa-stamp--bell { background-position: 66.666% 0; }
.fa .fa-stamp--tree { background-position: 100% 0; }
.fa .fa-stamp--heart { background-position: 0 100%; }
.fa .fa-stamp--snow { background-position: 33.333% 100%; filter: drop-shadow(0 1px 1px rgba(31, 42, 36, .35)); }
.fa .fa-stamp--cocoa { background-position: 66.666% 100%; }
.fa .fa-stamp--cane { background-position: 100% 100%; }
.fa .fa-sticker .fa-stamp { width: 40px; height: 40px; }
.fa .fa-letter-meta .fa-stamp { width: 24px; height: 24px; }
.fa .fa-sample-meta .fa-stamp { width: 22px; height: 22px; }

/* ---------- shell ---------- */

.fa .fa-wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.fa .fa-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.fa .fa-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 0;
  background: none;
  padding: 4px;
  font-family: Fraunces, Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
}

.fa .fa-brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 46% 54% 48% 52% / 52% 48% 54% 46%;
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--wax) 76%, #FFF8EC) 0 18%, var(--wax) 52%, var(--wax-dark) 100%);
  box-shadow: inset 0 -2px 3px rgba(31, 42, 36, .28), var(--sh1);
  flex: none;
}
.fa .fa-brand-mark::after {
  content: "";
  width: 9px;
  height: 9px;
  background: #FFF6E9;
  opacity: .92;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.fa .fa-nav { display: flex; align-items: center; gap: 6px; }

.fa .fa-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.fa .fa-link:hover { color: var(--ink); background: rgba(31, 42, 36, .05); }

/* ---------- type helpers ---------- */

.fa .fa-eyebrow {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.fa .fa-h1 { font-size: 44px; }
.fa .fa-h2 { font-size: 28px; }
.fa .fa-h3 { font-size: 22px; }
.fa .fa-sub { margin-top: 8px; color: var(--ink-2); font-size: 16px; }
.fa .fa-fine { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.fa .fa-body { color: var(--ink-2); font-size: 17px; max-width: 62ch; }
.fa .fa-mt-12 { margin-top: 12px; }
.fa .fa-mt-16 { margin-top: 16px; }
.fa .fa-grid-full { grid-column: 1 / -1; }
.fa .fa-muted { color: var(--ink-2); }
.fa .fa-tnum { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */

.fa .fa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--wax);
  color: var(--on-accent);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease-out, transform .18s ease-out, box-shadow .18s ease-out;
}
.fa .fa-btn:hover { background: var(--wax-dark); }
.fa .fa-btn:active { transform: translateY(1px); }
.fa .fa-btn:disabled { cursor: default; opacity: .62; transform: none; }

.fa .fa-btn--ghost {
  background: transparent;
  border-color: var(--ink-2);
  color: var(--ink);
}
.fa .fa-btn--ghost:hover { background: rgba(31, 42, 36, .06); }

.fa .fa-btn--quiet {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--sh1);
}
.fa .fa-btn--quiet:hover { background: var(--paper); border-color: var(--ink-2); }

.fa .fa-btn--small { min-height: 44px; padding: 0 16px; font-size: 14px; }
.fa .fa-btn--block { width: 100%; }
.fa .fa-btn--danger { background: transparent; border-color: var(--line); color: var(--danger); }
.fa .fa-btn--danger:hover { background: rgba(163, 58, 46, .07); border-color: var(--danger); }

/* ---------- inputs ---------- */

.fa .fa-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.fa .fa-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  transition: border-color .18s ease-out, box-shadow .18s ease-out;
}
.fa .fa-input:hover { border-color: var(--ink-2); }
.fa .fa-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 154, 63, .22); }
.fa .fa-input[readonly] { background: var(--paper); color: var(--ink-2); }
.fa textarea.fa-input { min-height: 108px; resize: vertical; }
.fa .fa-input::placeholder { color: var(--ink-2); opacity: .66; }

.fa .fa-field { margin-top: 16px; }

.fa .fa-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fa .fa-row > .fa-btn { flex: 1 1 auto; }

/* ---------- cards ---------- */

.fa .fa-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--sh1);
}
.fa .fa-card + .fa-card { margin-top: 16px; }
.fa .fa-card h2 { font-size: 20px; }
.fa .fa-card .fa-h2 { font-size: 20px; }
.fa .fa-card > p { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.fa .fa-card > p + * { margin-top: 12px; }

/* ---------- home hero ---------- */

.fa .fa-home { display: block; }
.fa .fa-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  grid-template-areas:
    "copy media"
    "copy create";
  gap: 24px 48px;
  align-items: start;
  padding: 24px 0 56px;
}

.fa .fa-hero-copy { position: relative; z-index: 2; grid-area: copy; }
.fa .fa-create { grid-area: create; }
.fa .fa-hero-media { grid-area: media; margin: 0; }
.fa .fa-hero-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  box-shadow: var(--sh1);
}
.fa .fa-hero-copy .fa-h1 { max-width: 20ch; }
.fa .fa-hero-copy .fa-body { margin-top: 16px; }
.fa .fa-hero-sub {
  margin-top: 12px;
  max-width: 34ch;
  font-family: Fraunces, Georgia, serif;
  font-size: 21px;
  line-height: 1.4;
  color: var(--ink);
}

.fa .fa-demo-wrap { position: relative; z-index: 1; }

.fa .fa-demo {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  box-shadow: var(--sh2);
}
.fa .fa-demo::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(31, 42, 36, .16);
  border-radius: 9px;
  pointer-events: none;
}
.fa .fa-demo-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.fa .fa-demo-door {
  position: relative;
  transition: transform .18s ease-out, box-shadow .18s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: 6px 4px;
  border: 1px dashed var(--door-edge);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-2);
}
.fa .fa-demo-door .fa-door-num { font-size: 13px; align-self: flex-start; padding-left: 2px; }
.fa .fa-demo-door.is-filled {
  border-style: solid;
  background-color: var(--door);
  background-image: var(--door-texture);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--ink);
  box-shadow: var(--sh1);
}
.fa .fa-demo-door.is-filled:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(31, 42, 36, .10);
}
.fa .fa-demo-door.is-filled .fa-door-num { position: absolute; top: 5px; left: 6px; color: var(--ink-2); }
.fa .fa-demo-door .fa-door-sticker { margin-top: 6px; }
.fa .fa-demo-door .fa-door-from {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  font-size: 12px;
  line-height: 1.2;
}
.fa .fa-demo-door.is-filled { padding-bottom: 12px; }
.fa .fa-demo-door.is-today { box-shadow: 0 0 0 2px var(--gold), var(--sh1); }

/* the demo has 12px floor for names, keep the seal small */
.fa .fa-demo-door .fa-seal { position: absolute; top: -4px; right: -4px; }

.fa .fa-demo-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.fa .fa-intro { padding: 0 0 8px; }

/* create card */

.fa .fa-create {
  position: relative;
  z-index: 3;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--sh2);
}
.fa .fa-create .fa-h2 { font-size: 26px; }
.fa .fa-create > p { margin-top: 8px; color: var(--ink-2); font-size: 15px; }



.fa .fa-recovery-row { display: flex; gap: 8px; align-items: stretch; }
.fa .fa-recovery-row .fa-input { flex: 1 1 auto; min-width: 0; }
.fa .fa-shuffle {
  flex: none;
  width: 48px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 18px;
  cursor: pointer;
}
.fa .fa-shuffle:hover { border-color: var(--ink-2); color: var(--ink); }

.fa .fa-create-cta { margin-top: 20px; }
.fa .fa-create .fa-fine { margin-top: 10px; }
.fa .fa-create form > .fa-fine:last-child { text-align: center; }

.fa .fa-inline-err {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(163, 58, 46, .08);
  color: var(--danger);
  font-size: 14px;
}

/* ---------- home sections ---------- */

.fa .fa-sec {
  padding: 64px 0;
  border-top: 1px solid var(--line);
}
.fa .fa-sec-head { max-width: 46ch; }
.fa .fa-sec-head .fa-body { margin-top: 12px; }

.fa .fa-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 32px;
}
.fa .fa-step { padding-top: 16px; border-top: 2px solid var(--ink); }
.fa .fa-step-num {
  font-family: Fraunces, Georgia, serif;
  font-size: 36px;
  font-weight: 600;
  color: var(--wax);
  line-height: 1;
}
.fa .fa-step h3 { margin-top: 12px; font-size: 22px; }
.fa .fa-step p { margin-top: 8px; color: var(--ink-2); font-size: 16px; }

.fa .fa-sample-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 48px;
  align-items: center;
  margin-top: 32px;
}
.fa .fa-sample {
  position: relative;
  padding: 40px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  box-shadow: var(--sh2);
  transform: rotate(-1.2deg);
}
.fa .fa-sample .fa-seal {
  position: absolute;
  top: -16px;
  left: 50%;
  margin-left: -16px;
  width: 32px;
  height: 32px;
}
.fa .fa-sample-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.fa .fa-sample-text {
  margin-top: 14px;
  font-family: Fraunces, Georgia, serif;
  font-size: 21px;
  line-height: 1.55;
  color: var(--ink);
}
.fa .fa-sample-date { margin-top: 18px; font-size: 13px; color: var(--ink-2); }
.fa .fa-sample-tag {
  position: absolute;
  right: 20px;
  bottom: -12px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12px;
  color: var(--ink-2);
}

.fa .fa-band {
  margin-top: 32px;
  padding: 32px;
  border-radius: 14px;
  background: var(--pine);
  color: var(--on-accent-2);
}
.fa .fa-band .fa-h2 { color: var(--on-accent-2); }
.fa .fa-band p { margin-top: 8px; color: var(--on-accent-2); font-size: 16px; }
.fa .fa-band-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}
.fa .fa-band-code {
  padding: 16px 20px;
  border: 1px dashed color-mix(in srgb, var(--on-accent-2) 38%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--on-accent-2) 7%, transparent);
  font-family: Fraunces, Georgia, serif;
  font-size: 28px;
  letter-spacing: .16em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fa .fa-faq {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 48px;
  align-items: start;
}
.fa .fa-faq-list { border-top: 1px solid var(--line); }
.fa .fa-faq details { border-bottom: 1px solid var(--line); }
.fa .fa-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.fa .fa-faq summary::-webkit-details-marker { display: none; }
.fa .fa-faq summary::after {
  content: "+";
  flex: none;
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  color: var(--ink-2);
}
.fa .fa-faq details[open] summary::after { content: "\2013"; }
.fa .fa-faq details p {
  padding: 0 0 16px;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 62ch;
}

.fa .fa-foot {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
}
.fa .fa-foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
}
.fa .fa-foot-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.fa .fa-foot-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- app ---------- */

.fa .fa-view { display: block; position: relative; z-index: 1; }
.fa .fa-app {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: start;
  padding: 8px 0 64px;
}

.fa .fa-cal-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 16px;
}
.fa .fa-cal-head .fa-h1 { font-size: 36px; }
.fa .fa-cal-head .fa-sub { margin-top: 4px; }

.fa .fa-sheet {
  position: relative;
  padding: 46px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--sh1);
}

.fa .fa-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.fa .fa-door {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1;
  min-height: 64px;
  padding: 8px;
  border: 2px dashed var(--door-edge);
  border-radius: 10px;
  background-color: var(--door);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease-out, box-shadow .18s ease-out, border-color .18s ease-out, background-color .18s ease-out;
}
.fa .fa-door:hover { transform: translateY(-1px); border-color: var(--ink-2); box-shadow: var(--sh1); }
.fa .fa-door:active { transform: translateY(0); }

.fa .fa-door-num {
  position: absolute;
  top: 7px;
  left: 8px;
  color: var(--ink);
  font-family: Fraunces, Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.fa .fa-door.is-filled {
  border: 2px solid var(--door-edge);
  border-style: solid;
  background-color: var(--door);
  background-image: var(--door-texture);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--ink);
}
.fa .fa-door.is-filled:hover { border-color: var(--gold); }
.fa .fa-door.is-locked { opacity: .92; }
.fa .fa-door.is-selected { box-shadow: 0 0 0 2px var(--ink); }
.fa .fa-door.is-today {
  border-color: var(--gold);
  border-style: solid;
  box-shadow: 0 0 0 2px var(--gold);
  animation: fa-pulse 3.8s ease-in-out infinite;
}
.fa .fa-door.is-selected.is-today, .fa .fa-door.is-selected:hover { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px rgba(31, 42, 36, .12); }

.fa .fa-door.is-opened {
  clip-path: polygon(0 0, 100% 0, 100% 88%, 92% 99%, 84% 88%, 76% 99%, 68% 88%, 60% 99%, 52% 88%, 44% 99%, 36% 88%, 28% 99%, 20% 88%, 12% 99%, 4% 88%, 0 97%);
}

.fa .fa-door .fa-seal {
  position: absolute;
  top: -5px;
  right: -5px;
}
.fa .fa-door-sticker {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wax);
}
.fa .fa-door .fa-door-sticker {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.fa .fa-door-from {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.fa .fa-door.is-opened .fa-door-from { bottom: 18px; }
.fa .fa-door.is-opened .fa-door-sticker { top: 40%; }

.fa .fa-cal-note {
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 13px;
}
.fa .fa-link--inline {
  min-height: 44px;
  padding: 0;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fa .fa-panel { min-width: 0; }
.fa .fa-panel .fa-card:first-child { margin-top: 0; }

.fa .fa-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.fa .fa-code {
  display: block;
  padding: 14px 8px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-family: Fraunces, Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .07em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  user-select: all;
}
.fa .fa-code--sm { font-size: 20px; padding: 10px 8px; }

.fa .fa-secret {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.fa .fa-secret code { flex: 1 1 auto; min-width: 0; font-size: 15px; letter-spacing: .02em; color: var(--ink); }
.fa .fa-secret .fa-btn { flex: none; }

.fa .fa-ticks { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; margin-top: 12px; }
.fa .fa-tick { height: 8px; border-radius: 2px; background: var(--line); }
.fa .fa-tick.is-filled { background: var(--wax); }
.fa .fa-tick.is-today { background: var(--gold); }

.fa .fa-saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-size: 14px;
  font-weight: 600;
}

.fa .fa-quiet { background: var(--paper); box-shadow: none; }

/* ---------- fill ---------- */

.fa .fa-fillcard {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--sh2);
}
.fa .fa-grab { display: none; }
.fa .fa-fillhead .fa-h2 { font-size: 24px; }
.fa .fa-fillhead .fa-x { display: none; }
.fa .fa-fillhead .fa-sub { font-size: 14px; }

.fa .fa-stickers {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.fa .fa-sticker {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .18s ease-out, color .18s ease-out, background-color .18s ease-out, transform .18s ease-out;
}
.fa .fa-sticker:hover { border-color: var(--ink-2); color: var(--ink); }
.fa .fa-sticker[aria-pressed="true"] {
  border-color: var(--wax);
  color: var(--wax);
  background: rgba(178, 58, 46, .07);
  box-shadow: inset 0 0 0 1px var(--wax);
}

.fa .fa-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fa .fa-idea {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.fa .fa-idea:hover { border-color: var(--ink-2); color: var(--ink); }

.fa .fa-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 8px 0;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.fa .fa-check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--wax);
}
.fa .fa-check span { display: block; }
.fa .fa-check small { display: block; color: var(--ink-2); font-size: 13px; line-height: 1.45; }

.fa .fa-counter { margin-top: 4px; color: var(--ink-2); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.fa .fa-counter.is-over { color: var(--danger); }

.fa .fa-fillfoot { margin-top: 16px; }
.fa .fa-fillfoot .fa-btn { width: 100%; }
.fa .fa-fillerr { margin-top: 8px; color: var(--danger); font-size: 14px; }

.fa .fa-done { text-align: left; }
.fa .fa-done .fa-h2 { font-size: 24px; }
.fa .fa-done p { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.fa .fa-done .fa-row .fa-btn { flex: 1 1 100%; }
.fa .fa-done-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: rgba(63, 107, 79, .12);
  color: var(--ok);
  font-size: 24px;
}

/* ---------- modal / sheet ---------- */

.fa .fa-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fa .fa-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(31, 42, 36, .45);
  cursor: pointer;
}
.fa .fa-sheetbox {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--sh2);
}
.fa .fa-sheetbox .fa-h2 { font-size: 24px; }
.fa .fa-sheetbox:focus,
.fa .fa-sheetbox:focus-visible { outline: none; }
.fa .fa-sheetbox > p { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.fa .fa-sheetbox > .fa-eyebrow { margin-top: 0; margin-bottom: 4px; }
.fa .fa-sheet-head .fa-eyebrow { margin: 0; }
.fa .fa-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fa .fa-x {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -8px -8px 0 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.fa .fa-x:hover { background: var(--paper); color: var(--ink); }
.fa .fa-sheetbox .fa-code { margin-top: 12px; }
.fa .fa-sheetbox .fa-secret { margin-top: 8px; }

.fa .fa-storybox { max-width: 520px; }
.fa .fa-story-frame {
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  margin: 12px auto 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  overflow: hidden;
}
.fa .fa-story-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fa .fa-story-status { margin-top: 12px; color: var(--ink-2); font-size: 14px; }
.fa .fa-storybox .fa-row .fa-btn { flex: 1 1 auto; }

.fa .fa-modal[data-modal="note"] .fa-sheetbox {
  max-width: 520px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

/* letter */

.fa .fa-letter {
  position: relative;
  padding: 44px 28px 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  box-shadow: var(--sh2);
  transform-origin: top center;
  animation: fa-unfold .18s ease-out;
}
.fa .fa-letter::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(217, 203, 182, .5);
  pointer-events: none;
}
.fa .fa-letter .fa-letter-seal {
  position: absolute;
  top: -28px;
  left: 50%;
  margin-left: -28px;
  width: 56px;
  height: 56px;
  border-radius: 0;
  background-image: var(--art-seals, url("https://img.friend-advent.com/s_123j6r06501070/seals.981d047d4c.webp"));
  background-size: 300% 200%;
  background-position: var(--seal-cell, 0 0);
  background-repeat: no-repeat;
  animation: fa-crack .42s ease-in forwards;
}
.fa .fa-seal-crack {
  position: absolute;
  inset: 20%;
  opacity: 0;
  transition: opacity .2s ease-out;
  background: linear-gradient(112deg, transparent 44%, rgba(31, 42, 36, .6) 46%, rgba(255, 246, 233, .5) 49%, transparent 51%);
}
.fa .fa-letter-seal.is-cracked .fa-seal-crack { opacity: 1; }
.fa .fa-letter-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
}
.fa .fa-letter-text {
  position: relative;
  margin-top: 18px;
  font-family: Fraunces, Georgia, serif;
  font-size: 20px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fa .fa-letter-media { display: block; margin-top: 18px; border-radius: 6px; border: 1px solid var(--line); }
.fa .fa-letter-date {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.fa .fa-letter-x { position: absolute; top: 8px; right: 8px; z-index: 2; }
.fa .fa-letter.is-sealed .fa-letter-seal { animation: none; opacity: 1; }
.fa .fa-letter-empty { color: var(--ink-2); font-size: 16px; }

/* ---------- code view ---------- */

.fa .fa-center { max-width: 480px; margin: 48px auto 64px; }
.fa .fa-center .fa-h1 { font-size: 36px; }
.fa .fa-center .fa-body { margin-top: 12px; }
.fa .fa-codeform { margin-top: 24px; }
.fa .fa-codeinput {
  width: 100%;
  height: 64px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-family: Fraunces, Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .16em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.fa .fa-codeinput:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 154, 63, .22); }
.fa .fa-codeinput::placeholder { color: var(--ink-2); opacity: .6; letter-spacing: .16em; }
.fa .fa-codeform .fa-btn { width: 100%; margin-top: 16px; }
.fa .fa-codehelp { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.fa .fa-codehelp .fa-h3 { font-size: 20px; }
.fa .fa-codehelp p { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.fa .fa-codehelp a { text-decoration: underline; text-underline-offset: 3px; }
.fa .fa-back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; color: var(--ink-2); font-size: 14px; text-decoration: none; }

/* ---------- my calendars ---------- */

.fa .fa-cals { max-width: 720px; margin: 24px auto 64px; }
.fa .fa-cal-item {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--sh1);
  margin-top: 12px;
}
.fa .fa-cal-item h3 { font-size: 20px; }
.fa .fa-cal-item p { margin-top: 2px; color: var(--ink-2); font-size: 13px; }
.fa .fa-cal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fa .fa-empty-state {
  margin-top: 24px;
  padding: 32px 24px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  color: var(--ink-2);
}

/* ---------- bottom bar + toast ---------- */

.fa .fa-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: none;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 -1px 2px rgba(31, 42, 36, .05);
}
.fa .fa-bar .fa-btn { flex: 1 1 0; min-width: 0; padding: 0 12px; font-size: 15px; }
.fa .fa-bar .fa-btn--ghost { flex: 0 1 auto; }

.fa .fa-toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  width: max-content;
  max-width: min(92vw, 400px);
  transform: translate(-50%, 8px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: var(--sh2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease-out, transform .18s ease-out;
}
.fa .fa-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fa .fa-toast .fa-btn { margin-top: 8px; color: var(--ink); }

/* ---------- backdrop for mobile fill ---------- */

.fa .fa-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  border: 0;
  padding: 0;
  background: rgba(31, 42, 36, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease-out;
}
.fa .fa-backdrop.is-on { opacity: 1; pointer-events: auto; }

/* ---------- keyframes ---------- */

@keyframes fa-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--gold); }
  50% { box-shadow: 0 0 0 4px rgba(201, 154, 63, .3); }
}

@keyframes fa-unfold {
  from { opacity: 0; transform: scaleY(.94); }
  to { opacity: 1; transform: scaleY(1); }
}

@keyframes fa-crack {
  0% { transform: scale(1) rotate(0); opacity: 1; }
  55% { transform: scale(1.16) rotate(-5deg); opacity: 1; }
  100% { transform: scale(1.05) rotate(4deg); opacity: .95; }
}

/* ---------- seal ---------- */

.fa .fa-seal {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 0;
  background-image: var(--art-seals, url("https://img.friend-advent.com/s_123j6r06501070/seals.981d047d4c.webp"));
  background-size: 300% 200%;
  background-position: var(--seal-cell, 0 0);
  background-repeat: no-repeat;
}

/* the wax seal is a photograph now; the crack line is the only overlay */

/* ---------- atmosphere, themes, play layer ---------- */

.fa .fa-snow {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fa .fa-garland {
  position: absolute;
  top: 2px;
  left: 8px;
  right: 8px;
  z-index: 2;
  height: 40px;
  pointer-events: none;
}
.fa .fa-garland svg { display: block; width: 100%; height: 100%; }
.fa .fa-wire { fill: none; stroke: var(--line); stroke-width: 1.4; }
.fa .fa-bulb rect { fill: var(--ink-2); opacity: .55; }
.fa .fa-bulb circle { animation: fa-twinkle 3.4s ease-in-out infinite; filter: drop-shadow(0 0 4px rgba(255, 230, 170, .45)); }
.fa .fa-bulb:nth-child(3n+1) circle { fill: var(--bulb-a); }
.fa .fa-bulb:nth-child(3n+2) circle { fill: var(--bulb-b); }
.fa .fa-bulb:nth-child(3n) circle { fill: var(--bulb-c); }
.fa .fa-bulb:nth-child(2n) circle { animation-delay: .7s; }
.fa .fa-bulb:nth-child(3n) circle { animation-delay: 1.3s; }

@keyframes fa-twinkle {
  0%, 100% { opacity: .58; }
  50% { opacity: 1; }
}

.fa .fa-streak {
  min-height: 1.3em;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 13px;
}

.fa .fa-cal-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; min-height: 44px; }

.fa .fa-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.fa .fa-theme-grid--sheet { margin-top: 16px; }
.fa .fa-theme-option {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  min-height: 44px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease-out, box-shadow .18s ease-out, color .18s ease-out;
}
.fa .fa-theme-option:hover { border-color: var(--ink-2); color: var(--ink); }
.fa .fa-theme-option[aria-checked="true"] {
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.fa .fa-theme-swatch {
  position: relative;
  display: block;
  height: 38px;
  border: 1px solid var(--t-line);
  border-radius: 6px;
  background: var(--t-bg);
  overflow: hidden;
}
.fa .fa-theme-door {
  position: absolute;
  left: 8px;
  top: 7px;
  width: 17px;
  height: 23px;
  border: 2px solid var(--t-door-edge);
  border-radius: 3px;
  background: var(--t-door);
}
.fa .fa-theme-seal {
  position: absolute;
  right: 9px;
  top: 12px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--t-accent);
}
.fa .fa-theme-name { display: block; line-height: 1.25; }
.fa .fa-theme-status { min-height: 1.4em; margin-top: 10px; color: var(--ink-2); font-size: 13px; }
.fa .fa-theme-status.is-error { color: var(--danger); }

.fa .fa-sound {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
}
.fa .fa-sound input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--wax); }
.fa .fa-sound small { display: block; color: var(--ink-2); font-size: 12px; line-height: 1.4; }

/* game */

.fa .fa-game {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--sh1);
}
.fa .fa-game-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fa .fa-game-title { margin-top: 2px; font-size: 18px; }
.fa .fa-game-body { margin-top: 12px; }
.fa .fa-game-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 32 / 21;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  cursor: pointer;
  touch-action: manipulation;
}
.fa .fa-game-hud {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.fa .fa-game-hud b { color: var(--ink); font-weight: 600; }
.fa .fa-game-msg { margin-top: 6px; color: var(--ink-2); font-size: 13px; }

/* scratch + open fx */

.fa .fa-letter-foot {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.fa .fa-scratch {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  touch-action: none;
  cursor: crosshair;
  transition: opacity .18s ease-out;
}
.fa .fa-scratch.is-cleared { opacity: 0; pointer-events: none; }
.fa .fa-confetti {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.fa .fa-note-sample {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 6;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: .02em;
}
.fa .fa-letter-x { z-index: 7; }
.fa .fa-letter-seal { z-index: 3; }

/* ---------- responsive ---------- */

@media (max-width: 959px) {
  .fa .fa-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "create" "media";
    gap: 24px;
  }
  .fa .fa-app { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 96px; }
  .fa .fa-sample-grid,
  .fa .fa-faq { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .fa .fa-steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .fa .fa-band-inner { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .fa .fa-bar { display: flex; }
}

@media (max-width: 719px) {
  .fa .fa-wrap { padding: 0 16px; }
  .fa .fa-h1 { font-size: 30px; }
  .fa .fa-h2 { font-size: 24px; }
  .fa .fa-hero { padding: 8px 0 40px; gap: 24px; }
  .fa .fa-hero-copy .fa-h1 { max-width: none; }
  .fa .fa-hero-sub { margin-top: 10px; font-size: 18px; max-width: none; }
  .fa .fa-hero-media { margin-top: 48px; }
  .fa .fa-hero-copy .fa-body { display: none; }
  .fa .fa-nav .fa-link--wide { display: none; }

  /* demo sits behind the create card on phones */
  .fa .fa-demo-wrap {
    position: absolute;
    top: 16px;
    right: -28px;
    left: 28px;
    z-index: -1;
    order: 0;
    opacity: .14;
    transform: rotate(-2deg);
    filter: blur(1.4px);
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0 44%, transparent 78%);
    mask-image: linear-gradient(to bottom, #000 0 44%, transparent 78%);
  }
  .fa .fa-demo { box-shadow: none; padding: 10px; border-color: rgba(217, 203, 182, .8); }
  .fa .fa-demo-grid { gap: 4px; }
  .fa .fa-demo-cap { display: none; }
  .fa .fa-demo-door .fa-door-from,
  .fa .fa-demo-door .fa-seal { display: none; }
  .fa .fa-demo-door .fa-door-num { visibility: hidden; }
  .fa .fa-demo-door .fa-stamp,
  .fa .fa-demo-door .fa-seal { display: none; }
  .fa .fa-demo.is-live .fa-demo-door .fa-stamp {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .fa .fa-demo.is-live .fa-demo-door .fa-seal { display: block; }
  .fa .fa-hero-copy, .fa .fa-create { position: relative; z-index: 2; }

  .fa .fa-create { padding: 18px; }
  .fa .fa-theme-swatch { height: 30px; }
  .fa .fa-theme-option { padding: 5px; gap: 5px; }
  .fa .fa-theme-name { font-size: 12px; }
  .fa .fa-create > p { display: none; }

  .fa .fa-sec { padding: 40px 0; }
  .fa .fa-sample { transform: none; padding: 32px 20px 24px; }
  .fa .fa-sample-text { font-size: 19px; }
  .fa .fa-band { padding: 24px; }
  .fa .fa-band-code { font-size: 24px; letter-spacing: .12em; }

  .fa .fa-cal-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .fa .fa-cal-head .fa-h1 { font-size: 30px; }
  .fa .fa-cal-head .fa-btn { align-self: stretch; }
  .fa .fa-cal-head [data-el="shareBtn"] { display: none; }

  .fa .fa-sheet { padding: 46px 12px 12px; }
  .fa .fa-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .fa .fa-door { padding: 7px; min-height: 64px; }

  .fa .fa-stickers { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .fa .fa-sticker { aspect-ratio: auto; height: 48px; }

  /* fill panel becomes a bottom sheet */
  .fa .fa-fillpanel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    max-height: 88vh;
    overflow-y: auto;
    padding: 0;
    transform: translateY(102%);
    transition: transform .18s ease-out;
    -webkit-overflow-scrolling: touch;
  }
  .fa .fa-fillpanel.is-open { transform: translateY(0); }
  .fa .fa-fillpanel .fa-fillcard {
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--sh2);
    max-height: 88vh;
  }
  .fa .fa-grab {
    display: block;
    width: 44px;
    height: 4px;
    margin: 6px auto 12px;
    border-radius: 999px;
    background: var(--line);
  }
  .fa .fa-fillhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .fa .fa-fillhead .fa-x { display: block; }
  .fa .fa-fillhead .fa-x { margin: -6px -8px 0 0; }
  .fa .fa-fillhead > div { flex: 1 1 auto; min-width: 0; }
  .fa .fa-fillfoot {
    position: sticky;
    bottom: 0;
    padding-top: 12px;
    background: var(--card);
    border-top: 1px solid var(--line);
    margin-top: 12px;
  }

  .fa .fa-modal { padding: 0; align-items: flex-end; }
  .fa .fa-sheetbox {
    max-width: none;
    max-height: 88vh;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }
  .fa .fa-sheetbox .fa-h2 { font-size: 22px; }
  .fa .fa-modal[data-modal="note"] { align-items: center; padding: 16px; }
  .fa .fa-storybox { max-width: 520px; }
.fa .fa-story-frame {
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  margin: 12px auto 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  overflow: hidden;
}
.fa .fa-story-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fa .fa-story-status { margin-top: 12px; color: var(--ink-2); font-size: 14px; }
.fa .fa-storybox .fa-row .fa-btn { flex: 1 1 auto; }

.fa .fa-modal[data-modal="note"] .fa-sheetbox { max-height: 92vh; padding: 0; background: transparent; }
  .fa .fa-letter { padding: 40px 20px 22px; }
  .fa .fa-letter-text { font-size: 18px; }

  .fa .fa-code { font-size: 22px; letter-spacing: .1em; }
  .fa .fa-codeinput { font-size: 24px; height: 60px; }
  .fa .fa-center { margin: 28px auto 48px; }
  .fa .fa-center .fa-h1 { font-size: 30px; }

  .fa .fa-toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); font-size: 14px; }
}

@media (min-width: 720px) {
  .fa .fa-grab { display: none; }
}

/* short phones: tighten the home hero so the CTA stays above the fold */
@media (max-width: 719px) and (max-height: 760px) {
  .fa .fa-hero-copy .fa-body { display: none; }
  .fa .fa-create .fa-eyebrow { display: none; }
  .fa .fa-create { padding-top: 16px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .fa *,
  .fa *::before,
  .fa *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .fa .fa-door.is-today { animation: none; box-shadow: 0 0 0 2px var(--gold); }
  .fa .fa-letter { animation: none; }
  .fa .fa-letter-seal { animation: none; opacity: 1; }
}
