/* ==========================================================================
   Fill My December — Sunlit Nordic Holiday Design System
   Typography: Fraunces (OFL), Plus Jakarta Sans (OFL), JetBrains Mono (OFL)
   Controls: Unified shadcn/ui-inspired interactive primitives (zero native defaults)
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 600 700;
  font-display: swap;
  src: url("/fonts/fraunces-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces TR";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("/fonts/fraunces-tr.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces TR";
  font-style: italic;
  font-weight: 600 700;
  font-display: swap;
  src: url("/fonts/fraunces-italic-tr.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans TR";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-tr.woff2") format("woff2");
}

:root[lang="tr"] {
  --font-display: "Fraunces TR", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans TR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@font-face {
  font-family: "Fraunces VI";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("/fonts/fraunces-vi.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces VI";
  font-style: italic;
  font-weight: 600 700;
  font-display: swap;
  src: url("/fonts/fraunces-italic-vi.woff2") format("woff2");
}
@font-face {
  font-family: "Plus Jakarta Sans VI";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-vi.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans RU";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/noto-sans-ru.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif RU";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/noto-serif-ru.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/noto-sans-th.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif Thai";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/noto-serif-th.woff2") format("woff2");
}
@font-face {
  font-family: "Noto CJK JP";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/noto-cjk-jp-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Noto CJK JP";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/fonts/noto-cjk-jp-bold.woff2") format("woff2");
}
@font-face {
  font-family: "Noto CJK KR";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/noto-cjk-kr-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Noto CJK KR";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/fonts/noto-cjk-kr-bold.woff2") format("woff2");
}
@font-face {
  font-family: "Noto CJK TC";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/noto-cjk-tc-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Noto CJK TC";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/fonts/noto-cjk-tc-bold.woff2") format("woff2");
}
@font-face {
  font-family: "Noto CJK SC";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/noto-cjk-sc-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Noto CJK SC";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("/fonts/noto-cjk-sc-bold.woff2") format("woff2");
}

:root[lang="vi"] {
  --font-display: "Fraunces VI", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans VI", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[lang="ru"] {
  --font-display: "Noto Serif RU", Georgia, "Times New Roman", serif;
  --font-sans: "Noto Sans RU", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[lang="th"] {
  --font-display: "Noto Serif Thai", "Thonburi", serif;
  --font-sans: "Noto Sans Thai", "Thonburi", sans-serif;
}

:root[lang="ja"] {
  --font-display: "Noto CJK JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-sans: var(--font-display);
  line-break: strict;
}

:root[lang="ko"] {
  --font-display: "Noto CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-sans: var(--font-display);
  line-break: strict;
}

:root[lang="zh-Hant"] {
  --font-display: "Noto CJK TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-sans: var(--font-display);
  line-break: strict;
}

:root[lang="zh-Hans"] {
  --font-display: "Noto CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-sans: var(--font-display);
  line-break: strict;
}

.lang-switch-menu a[lang="ja"] {
  font-family: "Noto CJK JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}

.lang-switch-menu a[lang="ko"] {
  font-family: "Noto CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

.lang-switch-menu a[lang="zh-Hant"] {
  font-family: "Noto CJK TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.lang-switch-menu a[lang="zh-Hans"] {
  font-family: "Noto CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.lang-switch-menu a[lang="ru"] {
  font-family: "Noto Sans RU", sans-serif;
}

.lang-switch-menu a[lang="th"] {
  font-family: "Noto Sans Thai", "Thonburi", sans-serif;
}

.lang-switch-menu a[lang="vi"] {
  font-family: "Plus Jakarta Sans VI", sans-serif;
}

:root:is([lang="ru"], [lang="th"], [lang="ja"], [lang="ko"], [lang|="zh"]) .brand-wordmark[lang="en"] {
  font-family: "Fraunces", Georgia, serif;
}

:root {
  /* Palette — Bright Sunlit Christmas Atelier */
  --bg: #FCFBF7;
  --bg-subtle: #F6F1E7;
  --surface: #FFFFFF;
  --surface-warm: #FFFDF8;
  --surface-hover: #FAF6EE;

  --ink: #1C1917;
  --ink-2: #524B45;
  --ink-muted: #78716C;

  --crimson: #D62839;
  --crimson-hover: #BE1F2F;
  --crimson-soft: #FFF1F2;
  --crimson-border: #F8C9CE;

  --spruce: #136F52;
  --spruce-hover: #0E5A42;
  --spruce-soft: #EAF6F0;
  --spruce-border: #BCE2D1;

  --gold: #D98E10;
  --gold-bright: #F6BC3E;
  --gold-soft: #FFF8E3;
  --gold-border: #F3D993;

  --frost-soft: #EFF7FC;
  --frost-border: #C2DFEE;

  --border: #E8E0D4;
  --border-strong: #D7CCB9;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow-sm: 0 2px 8px -2px rgba(28, 25, 23, 0.07), 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 12px 32px -8px rgba(120, 88, 52, 0.14), 0 2px 8px -2px rgba(28, 25, 23, 0.05);
  --shadow-lg: 0 24px 56px -14px rgba(28, 25, 23, 0.2), 0 4px 14px -4px rgba(28, 25, 23, 0.08);
  --ring: 0 0 0 3px rgba(214, 40, 57, 0.22);
  --ring-spruce: 0 0 0 3px rgba(19, 111, 82, 0.2);

  --icon-check: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 68% 52% at 6% 4%, rgba(254, 236, 198, 0.52), transparent 62%),
    radial-gradient(ellipse 58% 48% at 96% 8%, rgba(210, 241, 229, 0.44), transparent 58%),
    radial-gradient(ellipse 52% 44% at 88% 92%, rgba(252, 226, 229, 0.34), transparent 60%);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img, svg {
  display: block;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Header & Footer
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(252, 251, 247, 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(232, 224, 212, 0.72);
}

.site-header-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
}
.brand:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.brand-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.brand-wordmark em {
  font-style: italic;
  color: var(--crimson);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 2px;
}
.lang-switch-menu {
  position: relative;
}
.lang-switch-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 8px;
  list-style: none;
  border-radius: inherit;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.lang-switch-menu summary::-webkit-details-marker { display: none; }
.lang-switch-menu summary:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.lang-switch-menu summary > svg { width: 17px; height: 17px; }
.language-chevron { display: inline-flex; }
.language-chevron svg { width: 12px; height: 12px; }
.lang-switch-menu[open] .language-chevron { transform: rotate(180deg); }
@media (pointer: coarse) {
  .lang-switch-menu summary { min-height: 44px; }
}
.lang-switch-menu nav {
  position: absolute;
  z-index: 2;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  display: grid;
  width: max-content;
  min-width: 9rem;
  max-width: calc(100vw - 24px);
  max-height: min(60dvh, 28rem);
  overflow: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}
.lang-switch-menu nav a {
  padding-block: 8px;
}
.lang-switch-menu:not([open]) nav {
  display: none;
}
.lang-switch a {
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-2);
  border-radius: 7px;
  transition: background 140ms ease, color 140ms ease;
}
.lang-switch a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

@media (max-width: 480px) {
  .site-nav:has(.lang-switch) > a span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .site-nav .lang-switch a {
    display: grid;
    min-height: 36px;
    padding-inline: 6px;
    place-items: center;
  }
}

@media (max-width: 360px) {
  .site-header-inner:has(.lang-switch) {
    gap: 6px;
  }
  .site-header-inner:has(.lang-switch) .brand {
    gap: 6px;
  }
  .site-header-inner:has(.lang-switch) .brand img {
    width: 28px;
    height: 28px;
  }
  .site-header-inner:has(.lang-switch) .brand-wordmark {
    line-height: 1;
  }
  .site-header-inner:has(.lang-switch) .brand-wordmark em {
    display: block;
  }
  .site-nav:has(.lang-switch) {
    gap: 6px;
  }
  .site-nav .lang-switch a {
    padding-inline: 5px;
  }
}

.site-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: rgba(255, 253, 248, 0.72);
}

.site-footer-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-2);
  text-decoration: none;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  max-inline-size: 100%;
  gap: 8px 20px;
}
.footer-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover {
  color: var(--crimson);
}

/* ==========================================================================
   shadcn/ui-Inspired Core Controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 36px;
  padding: 0 13px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  min-height: 48px;
  padding: 0 22px;
  font-size: 0.975rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--crimson);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08), 0 6px 16px -6px rgba(214, 40, 57, 0.52);
}
.btn-primary:hover:not(:disabled) {
  background: var(--crimson-hover);
  box-shadow: 0 2px 4px rgba(28, 25, 23, 0.08), 0 10px 22px -6px rgba(214, 40, 57, 0.58);
}

.btn-secondary {
  background: var(--spruce);
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.08), 0 6px 16px -6px rgba(19, 111, 82, 0.44);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--spruce-hover);
}
.btn-secondary:focus-visible {
  box-shadow: var(--ring-spruce);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: #C4B7A1;
}

.btn-soft {
  background: var(--bg-subtle);
  color: var(--ink);
}
.btn-soft:hover:not(:disabled) {
  background: #EDE5D7;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--ink);
}

.btn-destructive {
  background: #C61F34;
  color: #FFFFFF;
}
.btn-destructive:hover:not(:disabled) {
  background: #A9172A;
}

.btn-destructive-ghost {
  background: transparent;
  color: #B91C2E;
}
.btn-destructive-ghost:hover:not(:disabled) {
  background: var(--crimson-soft);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}
.icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}
.badge-gold {
  background: var(--gold-soft);
  color: #8F5B05;
  border: 1px solid var(--gold-border);
}
.badge-spruce {
  background: var(--spruce-soft);
  color: #0F5841;
  border: 1px solid var(--spruce-border);
}
.badge-crimson {
  background: var(--crimson-soft);
  color: #A91C2B;
  border: 1px solid var(--crimson-border);
}
.badge-soft {
  background: var(--bg-subtle);
  color: var(--ink-2);
  border: 1px solid var(--border);
}

/* Inputs & Textareas */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.field-error {
  margin: 6px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #B91C2E;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input,
.textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.96rem;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.input::placeholder,
.textarea::placeholder {
  color: #9C948B;
}
.input:hover:not(:disabled),
.textarea:hover:not(:disabled) {
  border-color: #BEB19C;
}
.input:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--crimson);
  box-shadow: var(--ring);
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: #C61F34;
}

.input-mono {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

.char-counter {
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}
.char-counter.warn {
  color: #B46A08;
}
.char-counter.over {
  color: #C61F34;
}

/* Segmented Radio Group (shadcn Tabs / RadioGroup) */
.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.segmented-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.segmented-item input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.segmented-item:has(input:checked) {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.segmented-item:has(input:focus-visible) {
  box-shadow: var(--ring);
}
.segmented-item span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Custom Select / Combobox Popover (Zero native <select>) */
.combobox-wrap,
.custom-select {
  position: relative;
}

.select-trigger {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.select-trigger:hover {
  border-color: #BEB19C;
  background: var(--surface-warm);
}
.select-trigger:focus-visible {
  outline: none;
  border-color: var(--crimson);
  box-shadow: var(--ring);
}
.select-trigger[aria-expanded="true"] {
  border-color: var(--crimson);
  box-shadow: var(--ring);
}

.select-trigger-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-chevron {
  flex-shrink: 0;
  color: var(--ink-muted);
  transition: transform 160ms ease;
}
.select-trigger[aria-expanded="true"] .select-chevron {
  transform: rotate(180deg);
}

.popover-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform-origin: top center;
  animation: popIn 140ms cubic-bezier(0.16, 1, 0.3, 1);
}
.popover-panel.flip-up {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom center;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.combobox-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-muted);
  background: var(--surface-warm);
}

.combobox-search {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
}

.select-list {
  list-style: none;
  margin: 0;
  padding: 5px;
  max-height: 224px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 110ms ease;
}
.select-option:hover,
.select-option.is-active {
  background: var(--bg-subtle);
}
.select-option[aria-selected="true"] {
  background: var(--crimson-soft);
  color: #A91C2B;
  font-weight: 600;
}
.select-option-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.select-option[aria-selected="true"] .select-option-meta {
  color: #B43744;
}
.select-option-check {
  color: var(--crimson);
  flex-shrink: 0;
  display: inline-flex;
}
.select-empty {
  padding: 14px 12px;
  font-size: 0.875rem;
  color: var(--ink-muted);
  text-align: center;
}

/* Custom Checkbox Card (appearance: none + animated SVG mask check) */
.check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  min-height: 48px;
  background: var(--surface-warm);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.check-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}
.check-card:has(input:checked) {
  border-color: var(--crimson-border);
  background: var(--crimson-soft);
}

.checkbox-custom {
  flex-shrink: 0;
  appearance: none;
  display: inline-grid;
  place-content: center;
  inline-size: 20px;
  block-size: 20px;
  margin: 2px 0 0;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.checkbox-custom::before {
  content: "";
  inline-size: 13px;
  block-size: 13px;
  background-color: #FFFFFF;
  mask: var(--icon-check) no-repeat center / contain;
  -webkit-mask: var(--icon-check) no-repeat center / contain;
  transform: scale(0);
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}
.checkbox-custom:checked {
  background-color: var(--crimson);
  border-color: var(--crimson);
}
.checkbox-custom:checked::before {
  transform: scale(1);
}
.checkbox-custom:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.check-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.check-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.check-desc {
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

/* Custom Radio List (Report Reasons) */
.radio-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.radio-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}
.radio-card:has(input:checked) {
  border-color: var(--crimson);
  background: var(--crimson-soft);
  color: #981625;
  font-weight: 600;
}
.radio-custom {
  appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: border-color 140ms ease;
}
.radio-custom::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crimson);
  transform: scale(0);
  transition: transform 140ms ease;
}
.radio-custom:checked {
  border-color: var(--crimson);
}
.radio-custom:checked::before {
  transform: scale(1);
}
.radio-custom:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ==========================================================================
   Homepage Hero — Ultra Clean, One Form, Immediate Clarity
   ========================================================================== */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: 52px;
  padding: 18px 0 36px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.55rem, 4.4vw, 4.05rem);
  line-height: 1.03;
  letter-spacing: -0.028em;
  color: var(--ink);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.hero-title em {
  font-style: italic;
  font-weight: 700;
  color: var(--crimson);
}

.hero-lead {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 46ch;
}

/* Single Create Form Bar */
.create-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}

.create-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 2px 6px rgba(28, 25, 23, 0.04), 0 14px 32px -12px rgba(214, 40, 57, 0.16);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.create-bar:focus-within {
  border-color: var(--crimson);
  box-shadow: var(--ring), 0 14px 32px -12px rgba(214, 40, 57, 0.18);
}

.create-input {
  flex: 1;
  min-width: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 500;
}
.create-input:focus-visible {
  box-shadow: none;
  border-color: transparent;
}

.create-submit {
  flex-shrink: 0;
  border-radius: 13px;
}

.create-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0 4px;
}

.meta-note {
  font-size: 0.83rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.options-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--spruce);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.options-trigger:hover {
  background: var(--spruce-soft);
}
.options-trigger:focus-visible {
  outline: none;
  box-shadow: var(--ring-spruce);
}
.options-chevron {
  display: inline-flex;
  transition: transform 160ms ease;
}
.options-trigger[aria-expanded="true"] .options-chevron {
  transform: rotate(180deg);
}

.options-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: popIn 160ms ease;
}
.option-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ==========================================================================
   The Showstopper: Sunlit Festive 24-Day Advent Calendar Board
   ========================================================================== */

.board-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.board-crown {
  position: relative;
  z-index: 3;
  margin-bottom: -24px;
  filter: drop-shadow(0 6px 10px rgba(28, 25, 23, 0.12));
  pointer-events: none;
}

.board {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 20px 20px;
  box-shadow:
    0 2px 4px rgba(28, 25, 23, 0.04),
    0 20px 48px -16px rgba(132, 92, 54, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

/* Subtle festive candy-ribbon top trim inside the folio card */
.board::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    -55deg,
    #D62839 0 12px,
    #FFFDF8 12px 20px,
    #136F52 20px 32px,
    #FFFDF8 32px 40px
  );
  opacity: 0.92;
}

.board-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid #F1EAE0;
}

.board-head .badge {
  flex-shrink: 0;
  white-space: nowrap;
}

.board-head > div {
  min-width: 0;
}

.board-month {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--spruce);
  margin-bottom: 2px;
}

.board-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.38rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.board-foot {
  margin: 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.board-foot svg {
  color: var(--gold);
}

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

.door {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  aspect-ratio: 0.88;
  padding: 7px 6px 6px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface-warm);
  cursor: pointer;
  text-align: center;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 160ms ease, border-color 150ms ease, background 150ms ease;
}
.door:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -6px rgba(28, 25, 23, 0.14);
}
.door:active {
  transform: translateY(0) scale(0.97);
}
.door:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  z-index: 2;
}

.door-top {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
}

.door-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* Empty open door */
.door-empty {
  border-style: dashed;
  border-color: #DCD2C2;
  background: #FDFBF7;
  justify-content: center;
  gap: 4px;
}
.door-empty .door-num {
  font-size: 1.1rem;
  color: #6B6258;
}
.door-plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--crimson);
  background: var(--crimson-soft);
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 150ms ease, transform 150ms ease;
}
.door-empty:hover .door-plus,
.door-empty:focus-visible .door-plus {
  opacity: 1;
  transform: scale(1);
}
.door-empty:hover {
  border-style: solid;
  border-color: var(--crimson-border);
  background: #FFF7F8;
}
.door-empty.door-owner-empty .door-plus {
  display: none;
}

/* Filled doors — 4 coordinated daylight festive wrapping papers */
.door-filled.wrap-crimson {
  background: linear-gradient(155deg, #FFF5F6 0%, #FFE8EB 100%);
  border-color: #F4C3C9;
}
.door-filled.wrap-spruce {
  background: linear-gradient(155deg, #F1FAF5 0%, #E2F4EB 100%);
  border-color: #B8DEC9;
}
.door-filled.wrap-frost {
  background: linear-gradient(155deg, #F3FAFD 0%, #E4F3FA 100%);
  border-color: #BBDCEE;
}
.door-filled.wrap-gold {
  background: linear-gradient(155deg, #FFFBF0 0%, #FEF2CE 100%);
  border-color: #EFD58D;
}

.door-sticker {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.door-sticker svg {
  width: 100%;
  height: 100%;
}
.door:hover .door-sticker {
  transform: scale(1.1) rotate(-3deg);
}

.door-who {
  width: 100%;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

/* Ready to Open (Owner, unlocked!) */
.door-ready {
  background: linear-gradient(160deg, #FFFDF2 0%, #FFEBB3 100%);
  border-color: #E5A017 !important;
  box-shadow: 0 4px 14px -4px rgba(229, 159, 23, 0.42);
}
.door-ready .door-num {
  color: #8A5303;
}
.door-pill {
  padding: 2px 5px;
  border-radius: var(--radius-pill);
  background: var(--crimson);
  color: #FFFFFF;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.1;
}
.door-pill-spruce {
  background: var(--spruce);
  white-space: nowrap;
}
@media (max-width: 360px) {
  .door-pill-spruce {
    padding-inline: 4px;
    letter-spacing: 0;
  }
}

/* Opened / Read */
.door-opened {
  background: #FFFFFF !important;
  border-color: #BCE2D1 !important;
}
.door-opened .door-num {
  color: var(--spruce);
}

/* Friend's own filled door */
.door-mine {
  border-color: var(--spruce) !important;
  box-shadow: 0 0 0 1px rgba(19, 111, 82, 0.16);
}

/* Today highlight */
.door-today {
  box-shadow: 0 0 0 2px var(--crimson), 0 6px 16px -6px rgba(214, 40, 57, 0.35);
}

.door-lock-dot {
  color: var(--ink-muted);
  display: inline-flex;
  opacity: 0.72;
}

/* ==========================================================================
   Below the fold — Minimal How It Works + Saved Calendars
   ========================================================================== */

.saved-strip {
  margin-top: 8px;
  margin-bottom: 32px;
}

.saved-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
}
.saved-inner h2 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.saved-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.saved-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-warm);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 140ms ease, background 140ms ease;
}
.saved-list a:hover {
  border-color: var(--crimson-border);
  background: var(--crimson-soft);
}
.saved-role {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--ink-2);
}

.how-section {
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.section-head {
  margin-bottom: 20px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.step-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--crimson-soft);
  color: var(--crimson);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.step-card:nth-child(2) .step-icon {
  background: var(--spruce-soft);
  color: var(--spruce);
}
.step-card:nth-child(3) .step-icon {
  background: var(--gold-soft);
  color: var(--gold);
}

.step-num {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: #BDB3A5;
}

.step-card h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
}
.step-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ==========================================================================
   Centered Pages (/open, /create, /privacy, 404)
   ========================================================================== */

.center-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 62vh;
  padding: 20px 0;
}

.surface-card {
  width: min(620px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.surface-narrow {
  width: min(480px, 100%);
}

.card-badge {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--crimson-soft);
  color: var(--crimson);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 8px;
}

.page-title {
  margin: 0 0 10px;
  hyphens: auto;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.page-title em {
  font-style: italic;
  color: var(--crimson);
}

.page-lead {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 0.97rem;
}

.prose {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.68;
}

.card-foot {
  margin-top: 24px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   Calendar Workspace (/c/:code)
   ========================================================================== */

.cal-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Post-Creation Share & Recovery Spotlight Banner */
.welcome-banner {
  background: var(--surface);
  border: 1.5px solid var(--crimson-border);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.welcome-banner::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--crimson), var(--gold-bright), var(--spruce));
}

.welcome-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: start;
}

.welcome-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.welcome-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.welcome-lead {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-2);
}

.recovery-panel {
  background: var(--gold-soft);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.recovery-panel h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #7D4C03;
  display: flex;
  align-items: center;
  gap: 7px;
}
.recovery-code-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid #EAD18C;
  border-radius: var(--radius-sm);
}
.recovery-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
  letter-spacing: 0.04em;
}
.recovery-panel p {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.48;
  color: #6B4D18;
}

/* Calendar 2-Column Layout */
.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 390px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.cal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.board-name,
.cal-title,
.cal-lead,
.welcome-title,
.welcome-lead,
.modal-title {
  overflow-wrap: anywhere;
}

.cal-intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.cal-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.024em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.cal-lead {
  margin: 0 0 16px;
  font-size: 0.94rem;
  color: var(--ink-2);
  line-height: 1.55;
}

.cal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.cal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.quick-share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quick-share-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.quick-share-head h2 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}
.code-pill {
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--ink);
}

.cal-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 0 6px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 140ms ease;
}
.link-btn:hover {
  color: var(--ink);
}
.link-btn.danger:hover {
  color: #B91C2E;
}
.link-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--ink-muted);
  font-weight: 500;
}

/* ==========================================================================
   Social Share Grid — Real Brand Icons (simple-icons CC0)
   ========================================================================== */

.share-link-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 12px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
}
.share-link-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink);
  outline: none;
}

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

.share-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.share-tile:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  background: var(--surface-warm);
}
.share-tile:active {
  transform: scale(0.97);
}
.share-tile:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.share-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-bg);
  color: var(--brand-fg);
  box-shadow: 0 3px 10px -3px rgba(28, 25, 23, 0.2);
}
/* Crisp subtle ring for Snapchat's bright yellow tile on light surfaces */
.share-tile[data-channel="snapchat"] .share-tile-icon {
  border: 1.5px solid rgba(24, 24, 27, 0.16);
}
.share-tile[data-channel="instagram"] .share-tile-icon {
  background: radial-gradient(circle at 30% 107%, #FDF497 0%, #FDF497 5%, #FD5949 45%, #D6249F 60%, #285AEB 90%);
}
.share-tile[data-channel="copy"] .share-tile-icon {
  border: 1px solid var(--crimson-border);
  box-shadow: none;
}
.share-tile[data-channel="system"] .share-tile-icon {
  border: 1px solid var(--spruce-border);
  box-shadow: none;
}

.share-tile-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--ink-2);
}

/* ==========================================================================
   Sticker Picker Grid (12 Original Illustrated Holiday SVGs)
   ========================================================================== */

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

.sticker-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 3px 6px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-warm);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}
.sticker-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.sticker-option:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  transform: translateY(-1px);
}
.sticker-option:has(input:checked) {
  border-color: var(--crimson);
  background: var(--crimson-soft);
  box-shadow: 0 0 0 1px var(--crimson);
}
.sticker-option:has(input:focus-visible) {
  box-shadow: var(--ring);
}
.sticker-option-art {
  width: 32px;
  height: 32px;
}
.sticker-option-art svg {
  width: 100%;
  height: 100%;
}
.sticker-option-name {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.12;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.sticker-option:has(input:checked) .sticker-option-name {
  color: #9F1B2A;
}

/* ==========================================================================
   Modal Dialogs (Native <dialog> following Modern Web Guidance)
   ========================================================================== */

dialog.modal {
  padding: 0;
  border: 0;
  background: transparent;
  width: min(560px, calc(100vw - 24px));
  max-height: min(92dvh, 840px);
  overflow: visible;
  color: var(--ink);
  margin: auto;
}
dialog.modal-sm {
  width: min(420px, calc(100vw - 24px));
}

dialog.modal:modal {
  overscroll-behavior: contain;
}

dialog.modal::backdrop {
  background: rgba(28, 25, 23, 0.44);
  backdrop-filter: blur(5px);
  overflow: hidden;
  overscroll-behavior: contain;
}

dialog.modal[open] {
  display: flex;
  flex-direction: column;
  animation: modalIn 190ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-surface {
  display: flex;
  flex-direction: column;
  max-height: min(92dvh, 840px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px 24px;
  border-bottom: 1px solid #F1EAE0;
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.32rem;
  line-height: 1.18;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.modal-close-form {
  margin: 0;
}

.modal-body {
  padding: 16px 24px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* Reveal & Unwrap Greeting Card */
.unwrap-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 22px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #FFFDF5 0%, #FFF4D6 100%);
  border: 1.5px solid var(--gold-border);
}

.unwrap-seal {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: var(--surface);
  border: 1.5px solid var(--gold-border);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px -8px rgba(217, 142, 16, 0.35);
  animation: gentleFloat 2.6s ease-in-out infinite;
}
.unwrap-seal svg {
  width: 58px;
  height: 58px;
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

.reveal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 26px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, #FFFDF8 0%, #FFF6E8 100%);
  border: 1.5px solid #F0DFC2;
  box-shadow: inset 0 1px 0 #FFFFFF;
}

.reveal-ornament {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  background: var(--surface);
  border: 1.5px solid #F0DFC2;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  animation: popReveal 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-ornament svg {
  width: 54px;
  height: 54px;
}

@keyframes popReveal {
  0% { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  70% { transform: scale(1.07) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.reveal-sticker-name {
  margin: -4px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--spruce);
}

.reveal-quote {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.24rem;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  font-variation-settings: "SOFT" 100;
}

.reveal-from {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--crimson);
}

.owner-mod-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #F1EAE0;
}

.owner-mod-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Fill-back card inside success dialog */
.fillback-card {
  background: var(--spruce-soft);
  border: 1.5px solid var(--spruce-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fillback-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: #0E4D39;
}
.fillback-card p {
  margin: 0;
  font-size: 0.87rem;
  color: #1F5C49;
}
.fillback-row {
  display: flex;
  gap: 8px;
}

/* Story Preview Modal */
.story-preview-wrap {
  display: flex;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
}
.story-preview-img {
  width: min(260px, 100%);
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  object-fit: cover;
}
.story-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ==========================================================================
   Toast Notifications (shadcn Sonner-style stack)
   ========================================================================== */

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(370px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  animation: toastIn 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--spruce-soft);
  color: var(--spruce);
}
.toast.toast-error .toast-icon {
  background: var(--crimson-soft);
  color: var(--crimson);
}
.toast-msg {
  flex: 1;
  line-height: 1.35;
}
.toast-close {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Responsive Design — Tablet & Mobile (390×844 Optimized)
   ========================================================================== */

@media (max-width: 1020px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 10px 0 28px;
  }
  .create-form {
    max-width: 100%;
  }
  .cal-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .welcome-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 720px) {
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 420px) {
  .welcome-grid .recovery-code-box {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .site-header-inner {
    width: calc(100% - 24px);
    height: 56px;
  }
  .brand-wordmark {
    font-size: 1.04rem;
  }
  .site-main {
    width: calc(100% - 24px);
    padding: 14px 0 48px;
  }
  .site-footer-inner {
    width: calc(100% - 24px);
  }

  .hero {
    gap: 20px;
    padding: 6px 0 20px;
  }
  .hero-copy {
    gap: 14px;
  }
  .hero-title {
    font-size: 2.28rem;
  }
  .hero-lead {
    font-size: 0.96rem;
  }

  .create-bar {
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
  }
  .create-input {
    padding: 11px 12px;
  }
  .create-submit {
    width: 100%;
    min-height: 46px;
  }

  .board-crown {
    width: 210px;
    height: auto;
    margin-bottom: -18px;
  }
  .board {
    padding: 22px 12px 14px;
    border-radius: 22px;
  }
  .board-name {
    font-size: 1.18rem;
  }

  .door-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }
  .door {
    aspect-ratio: 0.86;
    padding: 6px 4px 5px;
    border-radius: 12px;
  }
  .door-sticker {
    width: 31px;
    height: 31px;
  }
  .door-num {
    font-size: 0.86rem;
  }
  .door-who {
    font-size: 0.63rem;
  }

  .welcome-banner {
    padding: 20px 16px;
    border-radius: 20px;
  }
  .cal-intro-card,
  .quick-share-card {
    padding: 18px 16px;
    border-radius: 20px;
  }
  .surface-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .share-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }
  .share-tile {
    padding: 8px 3px;
  }
  .share-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .share-tile-label {
    font-size: 0.67rem;
  }

  .sticker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .sticker-option {
    padding: 6px 2px 5px;
  }
  .sticker-option-art {
    width: 28px;
    height: 28px;
  }
  .sticker-option-name {
    font-size: 0.61rem;
  }

  /* Mobile bottom-sheet dialog presentation */
  dialog.modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    margin: auto 0 0 0;
  }
  .modal-surface {
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
  }
  .modal-head {
    padding: 16px 16px 12px 18px;
  }
  .modal-body {
    padding: 16px 18px 22px;
  }

  .fillback-row {
    flex-direction: column;
  }
  .story-actions {
    grid-template-columns: 1fr;
  }

  .toast-region {
    left: 12px;
    right: 12px;
    bottom: 14px;
    width: auto;
  }
}

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

.guide-page {
  width: min(100%, 48rem);
  margin: 3rem auto;
}

.guide-page > section,
.guide-page > footer {
  margin-block-start: 2rem;
}

.guide-page header .btn {
  margin-block-start: 1rem;
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.guide-page li + li {
  margin-block-start: .5rem;
}

.guide-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2rem;
  justify-content: center;
  list-style: none;
  padding: 0;
  text-align: center;
}

.guide-page footer a,
.guide-links a {
  text-decoration: underline;
  text-underline-offset: .2em;
}

/* 互动预览与可选日历外观 */
[data-appearance="spruce"] {
  --folio: #183f37;
  --folio-light: #245246;
  --folio-ink: #ffefd3;
  --folio-border: #416b56;
  --folio-ribbon: #d7a458;
}
[data-appearance="cinnamon"] {
  --folio: #763a2a;
  --folio-light: #8d4935;
  --folio-ink: #fff2dd;
  --folio-border: #ac6649;
  --folio-ribbon: #e5bd78;
}
[data-appearance="frost"] {
  --folio: #314e68;
  --folio-light: #42657f;
  --folio-ink: #f2f8ff;
  --folio-border: #648ba4;
  --folio-ribbon: #b9dbea;
}
.hero-experience {
  gap: clamp(26px, 4vw, 64px);
}
.hero-experience .hero-copy {
  gap: 14px;
}
.hero-experience .hero-title {
  font-size: clamp(2.3rem, 4.2vw, 3.95rem);
}
.hero-experience .hero-lead {
  max-width: 49ch;
}
.hero-experience .hero-stage {
  min-width: 0;
}
.hero-entry-links {
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
}
.hero-entry-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  color: var(--spruce);
  font-size: .84rem;
  font-weight: 700;
  text-underline-offset: 3px;
}
.appearance-picker {
  padding: 0;
  margin: 0 0 2px;
  border: 0;
  min-width: 0;
}
.appearance-picker legend {
  margin-bottom: 5px;
  font-size: .78rem;
  font-weight: 700;
}
.appearance-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.appearance-option {
  position: relative;
  cursor: pointer;
}
.appearance-option input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.appearance-choice {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  min-height: 34px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}
.appearance-option input:checked + .appearance-choice {
  border-color: var(--spruce);
  box-shadow: inset 0 0 0 1px var(--spruce);
  background: var(--spruce-soft);
}
.appearance-option input:focus-visible + .appearance-choice {
  box-shadow: var(--ring);
}
.appearance-swatch {
  width: 14px;
  height: 14px;
  border: 1px solid var(--folio-border);
  border-radius: 4px;
  background: linear-gradient(135deg, var(--folio) 43%, var(--folio-ribbon) 43% 55%, var(--folio-light) 55%);
}
#calendar-preview,
.hero-experience #create-form {
  scroll-margin-top: 74px;
}
.experience-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.preview-step {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.preview-step img {
  width: 100%;
  height: auto;
  aspect-ratio: 440 / 298;
  object-fit: cover;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.preview-step-copy {
  padding: 15px;
}
.preview-step h3 {
  margin: 0 0 7px;
  font-size: .96rem;
}
.preview-step h3 a {
  color: var(--spruce);
  text-underline-offset: 3px;
}
.preview-step p {
  margin: 0;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--ink-2);
}

@media (max-width: 1020px) {
  .hero-experience {
    gap: 12px;
  }
  .experience-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .hero-experience .hero-copy {
    gap: 8px;
  }
  .hero-experience .hero-title {
    font-size: clamp(1.78rem, 7.8vw, 2.45rem);
  }
  .hero-experience .hero-lead {
    font-size: .85rem;
    line-height: 1.45;
  }
  .hero-experience .create-bar {
    flex-direction: row;
    padding: 3px;
  }
  .hero-experience .create-input {
    min-width: 0;
    font-size: .86rem;
    padding-inline: 8px;
  }
  .hero-experience .create-submit {
    width: auto;
    min-height: 40px;
    padding-inline: 10px;
    font-size: .8rem;
  }
  .hero-experience .create-meta {
    gap: 5px;
  }
  .hero-experience .meta-note, .hero-experience .options-trigger {
    font-size: .7rem;
  }
  .hero-experience .options-trigger {
    padding-inline: 4px;
  }
  .hero-experience .hero-entry-links a {
    min-height: 31px;
    font-size: .75rem;
  }
  .hero-experience .board-crown {
    display: none;
  }
  .hero-experience .board-demo {
    padding: 17px 10px 11px;
  }
  .hero-experience .board-head {
    gap: 4px;
    margin-bottom: 8px;
    padding-bottom: 7px;
  }
  .hero-experience .board-name {
    font-size: 1.03rem;
  }
  .hero-experience .board-month {
    font-size: .62rem;
  }
  .hero-experience .door-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }
  .hero-experience .door {
    min-width: 0;
    min-height: 42px;
    aspect-ratio: .98;
    padding: 4px 2px 3px;
    border-radius: 8px;
  }
  .hero-experience .door :is(.door-pill, .door-who) {
    display: none;
  }
  .hero-experience .door-ready .door-top::after {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #a76813;
  }
  .hero-experience .door-plus {
    width: 13px;
    height: 13px;
  }
  .hero-experience .door-sticker svg {
    width: 19px;
    height: 19px;
  }
  .hero-experience .door-num {
    font-size: .72rem;
  }
  .hero-experience .board-foot {
    align-items: flex-start;
    text-align: center;
    margin-top: 9px;
    font-size: .7rem;
  }
  .hero-experience .board-foot svg {
    flex-shrink: 0;
    width: 13px;
  }
}

.cal-actions .btn,
.story-actions .btn {
  white-space: normal;
  text-align: center;
}
.cal-board-col {
  min-width: 0;
}
.board .door-who {
  text-overflow: ellipsis;
  overflow: hidden;
}
.modal .reveal-quote {
  overflow-wrap: anywhere;
}
.reveal-card {
  border-top: 4px solid #d9b46d;
  background: repeating-linear-gradient(130deg, transparent 0 18px, #f4e2c83a 19px 20px, transparent 21px 36px),
    linear-gradient(170deg, #fffdf8, #fff6e8);
}
.note-composer {
  gap: 12px;
}
.compose-actions {
  background: var(--surface);
}
@media (max-width: 480px) {
  .cal-layout {
    gap: 15px;
  }
  .cal-intro-card .cal-title {
    line-height: 1.1;
  }
  .compose-actions {
    position: sticky;
    bottom: -22px;
    z-index: 2;
    border-top: 1px solid var(--border);
    padding: 8px 0 max(6px, env(safe-area-inset-bottom));
  }
  .note-composer .sticker-grid {
    gap: 4px;
  }
  .note-composer .sticker-option {
    padding-block: 4px;
  }
}
@media (max-width: 370px) {
  .hero-experience .appearance-choice {
    padding-inline: 6px;
  }
  .experience-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 日历工作区采用奶油色纸张、松枝绿与朱红色礼物包装。 */
body {
  --bg: #fff5e5;
  --surface-warm: #fffaf2;
  --border: #e5d0b5;
  --crimson: #b82935;
  --crimson-hover: #a41f2d;
  background-image: radial-gradient(ellipse at 15% 8%, #ffe6be 0, transparent 48%),
    radial-gradient(ellipse at 87% 36%, #ffedce 0, transparent 40%);
}

.hero-experience {
  max-width: 1120px;
  margin-inline: auto;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  grid-template-areas: "title title" "board copy";
  align-items: center;
  gap: 20px clamp(24px, 4vw, 50px);
  padding-block: 4px 34px;
}
.hero-experience > .hero-title { grid-area: title; }
.hero-experience .hero-copy {
  grid-area: copy;
  padding: clamp(16px, 2.7vw, 30px);
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fffcf4;
  box-shadow: 0 5px 0 #ead5b9, 0 20px 40px -24px #8650326b;
}
.hero-experience .hero-stage { grid-area: board; }
.hero-experience .create-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  gap: 8px;
  border: 0;
  background: none;
  box-shadow: none;
}
.hero-experience .create-input {
  background: var(--surface);
  border: 1px solid var(--border);
}
.hero-experience .create-submit { width: 100%; }
.hero-entry-links .code-entry {
  font-weight: 800;
  text-decoration: underline;
}
.parcel-art {
  display: block;
  width: 100%;
  max-height: 145px;
  object-fit: cover;
  object-position: center 46%;
  border-radius: 13px;
}
.step-icon {
  display: block;
  width: 52px;
  margin: 14px 15px 0;
}
.guide-art { margin-inline: 0; }
.guide-art img { display: block; max-width: 100%; height: auto; border-radius: 14px; }

.board[data-appearance] {
  --board-paper: #fff0d5;
  --board-line: #e5c597;
  --board-ink: #4c2e23;
  background: repeating-linear-gradient(140deg, transparent 0 8px, #916b3220 9px, transparent 10px 17px),
    var(--board-paper);
  border: 1px solid var(--board-line);
  box-shadow: inset 0 0 0 5px var(--board-paper), inset 0 0 0 6px var(--board-line), 0 7px 0 #bc825e60, var(--shadow-md);
  padding: clamp(10px, 2vw, 22px);
}
.board[data-appearance="spruce"] { --board-paper: #e2edda; --board-line: #9db68e; --board-ink: #214536; }
.board[data-appearance="cinnamon"] { --board-paper: #ffdec7; --board-line: #cf9d7e; --board-ink: #662e26; }
.board[data-appearance="frost"] { --board-paper: #e1eff9; --board-line: #9abbd0; --board-ink: #283f61; }
.board[data-appearance]::before { content: none; }
.board[data-appearance] :is(.board-name, .board-month, .board-foot) { color: var(--board-ink); }
.board[data-appearance] .board-head { border-bottom-color: var(--board-line); }
.board[data-appearance] .board-foot svg { color: var(--board-ink); }
.board .door-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(5px, .85vw, 11px); }
.board .door {
  min-width: 0;
  min-height: 44px;
  aspect-ratio: 1 / 1;
  border-radius: clamp(5px, 1vw, 12px);
  padding: clamp(3px, .6vw, 8px);
}
.board[data-appearance] .door-empty {
  background: #ffffff54;
  border: 1px dashed var(--board-line);
  box-shadow: none;
}
.board[data-appearance] .door-empty[aria-pressed="true"] {
  background: #fff9e8;
  border: 2px solid var(--crimson);
  box-shadow: 0 0 0 2px #fff9e8;
}
.board[data-appearance] .door-empty .door-num { color: var(--board-ink); }
.board[data-appearance] .door-empty .door-plus { color: var(--board-ink); display: none; }
.board[data-appearance] :is(.door-filled, .demo-door) {
  --paper: #dc765e;
  --ribbon: #ffebaf;
  --pattern: repeating-linear-gradient(135deg, transparent 0 6px, #fff5 7px 9px, transparent 10px 15px);
  background:
    linear-gradient(90deg, transparent 44%, var(--ribbon) 45% 54%, transparent 55%),
    linear-gradient(transparent 55%, var(--ribbon) 56% 64%, transparent 65%),
    var(--pattern), var(--paper);
  border: 1px solid #763d3455;
  box-shadow: inset 0 -5px #5225141f, 0 3px 0 #603b3440;
}
.board[data-appearance] :is(.wrap-spruce, .demo-door:nth-child(4n + 1)) {
  --paper: #72a17d;
  --pattern: repeating-linear-gradient(45deg, transparent 0 5px, #f3ffd34a 6px 8px, transparent 9px 13px);
}
.board[data-appearance] :is(.wrap-frost, .demo-door:nth-child(4n + 2)) {
  --paper: #7bb1cf;
  --ribbon: #f8e4ca;
  --pattern: radial-gradient(circle, #fff9 0 1.2px, transparent 1.6px) 0 0 / 10px 10px;
}
.board[data-appearance] :is(.wrap-gold, .demo-door:nth-child(4n + 3)) {
  --paper: #edba63;
  --ribbon: #9e3a49;
  --pattern: repeating-linear-gradient(90deg, transparent 0 7px, #fff7 8px 9px, transparent 10px 14px);
}
.board .door-filled::before, .board .demo-door::before {
  content: "";
  position: absolute;
  top: -7%;
  left: 29%;
  width: 42%;
  height: 20%;
  background: radial-gradient(ellipse at 25% 50%, var(--ribbon) 0 64%, transparent 68%) left / 51% 100% no-repeat,
    radial-gradient(ellipse at 75% 50%, var(--ribbon) 0 64%, transparent 68%) right / 51% 100% no-repeat;
  filter: drop-shadow(0 2px 1px #49282850);
  pointer-events: none;
}
.board .door-filled .door-num, .board .demo-door .door-num {
  display: inline-block;
  padding: 3px 5px;
  border-radius: 3px;
  background: #fff8e6;
  color: #65252b;
  transform: rotate(-5deg);
  box-shadow: 1px 2px 0 #7d48473a;
}
.board .demo-door.door-empty { justify-content: center; }
.board .demo-door.door-empty .door-num { color: #65252b; }
.board .door-filled .door-who { background: #fff8e9; border-radius: 4px; padding-inline: 3px; }
.board .door:focus-visible { outline: 2px solid var(--crimson); outline-offset: 1px; }
.board .door-opened { opacity: .88; }
.board .door-ready { outline: 2px solid #a2323f; outline-offset: -1px; }

.cal-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  grid-template-areas: "board sidebar";
  gap: 25px;
}
.cal-sidebar { grid-area: sidebar; }
.cal-board-col { grid-area: board; min-width: 0; }
.cal-intro-card { background: #fffcf4; }
.cal-intro-card .eyebrow:empty { display: none; }
.cal-actions > .btn-primary { width: 100%; }
.guest-composer { margin-top: 20px; }
.guest-composer > .page-title { font-size: clamp(1.3rem, 4vw, 1.8rem); margin-bottom: 14px; }
.guest-composer .compose-actions { position: static; background: transparent; }
.guest-composer .link-btn { align-self: start; }
.return-options { margin-top: 8px; }
.share-public-code { margin: 4px 0; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .hero-experience {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "board" "copy";
    gap: 13px;
  }
  body[data-page="create"] .hero-experience { grid-template-areas: "title" "copy" "board"; }
  .hero-experience .hero-copy { gap: 10px; }
  .hero-experience .parcel-art { display: none; }
  .cal-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "sidebar" "board";
    gap: 15px;
  }
  .cal-intro-card { grid-area: sidebar; padding: 14px; }
  .hero-experience .door { aspect-ratio: 1.1; }
  .cal-lead { margin-bottom: 8px; }
  .cal-stats { margin-bottom: 8px; }
  .cal-sidebar { display: contents; }
  .cal-manage { grid-row: 3; }
  .cal-layout .board[data-appearance] .door-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .board .door-sticker { width: 76%; }
  .board .door-who { font-size: .55rem; }
  .board .door-pill { display: none; }
}
@media (max-width: 360px) {
  .board .door .door-num { font-size: .78rem; }
  .board .door-sticker { width: 65%; }
}

.write-inspiration summary {
  width: fit-content;
  color: var(--spruce);
  font-size: .86rem;
  font-weight: 750;
  cursor: pointer;
}
.prompt-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.prompt-list .btn {
  white-space: normal;
  text-align: start;
}
.gift-wrap-picker .appearance-swatch {
  width: 22px;
  height: 22px;
}
.unwrap-stage[data-appearance] .unwrap-seal,
.unwrap-seal[data-appearance] {
  background: linear-gradient(90deg, transparent 45%, var(--folio-ribbon, #f3b572) 45% 55%, transparent 55%),
    linear-gradient(transparent 57%, var(--folio-ribbon, #f3b572) 57% 66%, transparent 66%),
    repeating-linear-gradient(135deg, var(--folio-light, #f6dfac) 0 8px, var(--folio, #fae6b4) 8px 17px);
}

.cal-shell[data-role="guest"] .cal-sidebar { display: contents; }
.cal-shell[data-role="guest"] .cal-layout {
  grid-template-areas: "board sidebar" "board composer" "manage composer";
  grid-template-rows: auto auto 1fr;
  row-gap: 12px;
}
.cal-shell[data-role="guest"] .cal-intro-card { grid-area: sidebar; padding: 15px 17px; }
.cal-shell[data-role="guest"] .cal-lead { margin-bottom: 8px; }
.cal-shell[data-role="guest"] .cal-stats { margin-bottom: 0; }
.cal-shell[data-role="guest"] .cal-title { font-size: clamp(1.35rem, 2.4vw, 2.05rem); }
.cal-shell[data-role="guest"] .cal-actions:not(:empty) { margin-top: 8px; }
.cal-shell[data-role="guest"] .cal-actions > .btn-primary { width: auto; min-height: 42px; }
.cal-shell[data-role="guest"] .cal-manage { grid-area: manage; }
.cal-shell[data-role="guest"] .guest-composer {
  grid-area: composer;
  padding: clamp(14px, 2vw, 24px);
  margin: 0;
  min-width: 0;
}
@media (max-width: 760px) {
  .cal-shell[data-role="guest"] .cal-layout {
    grid-template-areas: "sidebar" "board" "composer" "manage";
    grid-template-rows: auto;
  }
}

/* 礼物盘及双角色页面在首屏优先显示主要操作。 */
.hero-experience .board .door { aspect-ratio: 1.14; }
.hero-experience .parcel-art { max-height: 90px; }
.hero-experience .hero-title { font-size: clamp(1.75rem, 4.05vw, 3.65rem); }
.hero-experience .hero-entry-links { gap: 0 15px; }
.hero-experience .hero-entry-links a { min-height: 32px; }
.hero-experience .board-head { padding-bottom: 6px; margin-bottom: 8px; }
.hero-experience .board-foot { padding-top: 6px; margin-top: 8px; }
.board .door {
  min-height: 44px;
  min-width: 44px;
}
.board .door-today {
  outline: 2px solid var(--board-ink);
  outline-offset: -3px;
}
.board .door-opened {
  opacity: 1;
  background: repeating-linear-gradient(#fffdf4 0 8px, #ead9b8 9px, #fffdf4 10px 13px) !important;
}
.board .door-opened::before { content: none; }
.board .door-who { flex-shrink: 0; }
.board .door-plus { display: none; }

.cal-shell .btn,
.modal .btn {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.25;
}
.cal-shell .btn > svg,
.modal .btn > svg { flex-shrink: 0; }
.owner-tools {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fffcf4;
}
#inline-share { display: grid; gap: 8px; min-width: 0; }
#inline-share .share-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#inline-share .share-tile { min-width: 0; }
.share-public-code {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
}
.recovery-panel summary {
  color: var(--spruce);
  font-weight: 750;
  cursor: pointer;
}
.recovery-panel summary svg { display: inline-block; width: 14px; height: 14px; margin-inline: 3px 5px; vertical-align: -.15em; }
.recovery-panel[open] summary { margin-bottom: 10px; }
.recovery-code-box > code { overflow-wrap: anywhere; white-space: normal; }
.recovery-code-box > .btn { flex: none; white-space: nowrap; overflow-wrap: normal; }
.composer-date { margin: -8px 0 0; font-weight: 750; color: var(--spruce); scroll-margin-top: 90px; }
.return-choices { display: grid; gap: 5px; }
.return-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.return-choice input { accent-color: var(--spruce); }
.guest-composer:has(#fill-success) { display: grid; gap: 12px; }
#fill-success { scroll-margin-top: 82px; margin: 0; }
.cal-shell[data-role="gift-creator"] .cal-layout {
  grid-template-areas: "board sidebar" "composer sidebar";
}
.cal-shell[data-role="gift-creator"] .guest-composer {
  grid-area: composer;
  margin: 0;
  min-width: 0;
}
@media (min-width: 761px) {
  .cal-shell:is([data-role="owner"], [data-role="gift-creator"]) .cal-intro-card { padding: 17px; }
  .cal-shell:is([data-role="owner"], [data-role="gift-creator"]) :is(.cal-lead, .cal-stats) { margin-bottom: 10px; }
}
@media (min-width: 1100px) and (max-height: 850px) {
  body[data-page="home"] .hero-experience { row-gap: 12px; }
  body[data-page="home"] .hero-experience .hero-title { font-size: clamp(2.35rem, 3.35vw, 3.05rem); }
  body[data-page="home"] .hero-experience .hero-copy { gap: 9px; padding: 19px 24px; }
  body[data-page="home"] .hero-experience .parcel-art { max-height: 68px; }
  body[data-page="home"] .hero-experience .appearance-choice { padding-inline: 6px; }
}
@media (max-width: 760px) {
  .cal-layout .board .door-filled {
    display: grid;
    grid-template-rows: min-content minmax(12px, 1fr) min-content;
    min-height: 58px;
    justify-content: stretch;
    justify-items: center;
  }
  .cal-layout .board .door-sticker {
    width: 100%;
    height: 100%;
    max-height: 24px;
    min-height: 0;
  }
  .cal-layout .board .door-top { gap: 0 1px; }
  .cal-layout .board .door-num { font-size: .73rem; }
  .cal-layout .board .door-filled .door-num { padding: 2px 3px; }
  .cal-layout .board .door-pill {
    display: inline-block;
    padding: 2px;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: .44rem;
  }
  .cal-layout .board .door-who { min-width: 0; min-height: 1em; line-height: 1.15; }
  .cal-shell[data-role="owner"] .cal-layout {
    grid-template-areas: "sidebar" "board" "tools" "manage";
  }
  .cal-shell[data-role="gift-creator"] .cal-layout {
    grid-template-areas: "sidebar" "tools" "board" "composer" "manage";
  }
  .cal-shell:is([data-role="owner"], [data-role="gift-creator"]) .cal-manage { grid-area: manage; }
  .cal-shell[data-role="guest"] .cal-layout {
    grid-template-areas: "sidebar" "board" "composer" "tools" "manage";
    row-gap: 9px;
  }
  .owner-tools { grid-area: tools; }
  .cal-shell[data-role="guest"] .cal-intro-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 3px 2px;
    background: transparent;
  }
  .cal-shell[data-role="guest"] .cal-title { margin-bottom: 5px; }
  .cal-shell[data-role="guest"] .cal-lead { display: none; }
  .cal-shell[data-role="guest"] .cal-actions:not(:empty) { margin-top: 4px; }
  .cal-shell[data-role="guest"] .cal-actions > .btn-primary {
    min-height: 44px;
    padding: 5px 10px;
    background: #fff8e9;
    color: var(--spruce);
    border-color: var(--spruce);
    box-shadow: none;
  }
  .cal-shell[data-role="guest"] .board-head { display: none; }
}
@media (max-width: 359px) {
  .hero-experience .board .door-grid,
  .cal-layout .board[data-appearance] .door-grid {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }
}
