/* Advent Calendar for Friends —— 浅色牛皮纸手工风。日历 = 麻绳上挂的信封 */
:root {
  --paper: #f6efe2;
  --paper-2: #efe4d0;
  --card: #fffaf1;
  --ink: #2d2218;
  --ink-2: #6b5a48;
  --red: #c8414b;
  --red-d: #9b1c2c;
  --pine: #2f6b4f;
  --pine-d: #1f4b37;
  --gold: #e9b949;
  --twine: #a77b4f;
  --line: #e2d4bd;
  --radius: 16px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 10px 30px -12px rgba(74, 51, 32, .35);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font: 17px/1.65 var(--sans); color: var(--ink); background: var(--paper);
  background-image:
    radial-gradient(rgba(167, 123, 79, .08) 1px, transparent 1.2px),
    radial-gradient(rgba(167, 123, 79, .06) 1px, transparent 1.2px);
  background-size: 22px 22px, 31px 31px; background-position: 0 0, 11px 7px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--red-d); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 40px); margin: 0 auto; }
.narrow { width: min(760px, 100% - 40px); margin: 0 auto; }
.small { font-size: .88rem; color: var(--ink-2); }
.hand { font-family: var(--hand); }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: 800 1.05rem/1 var(--sans); color: #fff; background: var(--red); border: 0; border-radius: 999px;
  padding: 1em 1.6em; cursor: pointer; text-decoration: none; box-shadow: 0 4px 0 var(--red-d);
  transition: transform .12s, box-shadow .12s, background .2s;
}
.btn:hover { background: #d24c56; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-d); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn-pine { background: var(--pine); box-shadow: 0 4px 0 var(--pine-d); }
.btn-pine:hover { background: #377a5b; }
.btn-gold { background: linear-gradient(180deg, #f5d77b, #d9a63a); color: #4a2f05; box-shadow: 0 4px 0 #a8791b; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { background: var(--card); }
.btn-small { padding: .65em 1.1em; font-size: .92rem; box-shadow: 0 3px 0 var(--red-d); }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--red-d); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- 顶栏 ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(246, 239, 226, .92); backdrop-filter: blur(8px); border-bottom: 1px dashed var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: .55em; text-decoration: none; color: var(--ink); font: 800 1.08rem/1.1 var(--serif); }
.brand em { font-style: italic; color: var(--red); font-weight: 700; }
.logo-mark { width: 36px; height: 36px; flex: none; }
.nav { display: flex; align-items: center; gap: 1.4em; }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; }
.nav a:not(.btn):hover, .nav a[aria-current] { color: var(--red); }
.menu-btn { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--card); border-bottom: 1px solid var(--line); padding: 8px 20px 18px; }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: .8em 0; border-bottom: 1px dashed var(--line); }
  .nav .btn { margin-top: 12px; }
}

/* ---------- 首页 hero ---------- */
.hero { position: relative; padding: 18px 0 40px; text-align: center; overflow: hidden; }
.hero-garland { height: 150px; margin: 0 auto -6px; max-width: 980px; position: relative; }
.hero-garland svg { width: 100%; height: 100%; overflow: visible; }
.hero-garland .sway { transform-origin: top center; animation: sway 4s ease-in-out infinite; }
.hero-garland .sway:nth-child(2n) { animation-delay: -1.3s; animation-duration: 4.6s; }
.hero-garland .sway:nth-child(3n) { animation-delay: -2.1s; animation-duration: 3.7s; }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.kicker { display: inline-flex; gap: .5em; align-items: center; font-weight: 800; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--pine); background: #e3eee6; border-radius: 999px; padding: .35em .9em; margin-bottom: 14px; }
.hero h1 { margin-bottom: .2em; }
.hero h1 .script { display: block; font-family: var(--hand); font-weight: 600; color: var(--red); font-size: .62em; transform: rotate(-2deg); margin-top: .05em; }
.hero .lede { font-size: 1.18rem; color: var(--ink-2); max-width: 640px; margin: 0 auto 26px; }

/* 建日历卡片 */
.maker { max-width: 760px; margin: 0 auto; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 26px; text-align: left; position: relative; border: 1px solid #eadcc4; }
.maker::before { content: ""; position: absolute; inset: 8px; border: 2px dashed #ecdcc2; border-radius: 16px; pointer-events: none; }
.maker > * { position: relative; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.mode { display: flex; gap: 12px; align-items: center; text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 14px; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, transform .15s; }
.mode:hover { transform: translateY(-1px); }
.mode[aria-pressed="true"] { border-color: var(--red); background: #fff4f2; box-shadow: 0 0 0 3px rgba(200, 65, 75, .12); }
.mode b { display: block; font-size: 1.02rem; }
.mode span { font-size: .86rem; color: var(--ink-2); }
.mode i { font-style: normal; font-size: 1.9rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fields .full { grid-column: 1 / -1; }
label.f { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 6px; }
input[type=text], textarea {
  width: 100%; font: 600 1.05rem var(--sans); color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .75em .9em; outline: none; transition: border-color .15s;
}
input[type=text]:focus, textarea:focus { border-color: var(--pine); }
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { display: inline-flex; align-items: center; gap: .45em; border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: .4em .85em .4em .45em; font: 700 .9rem var(--sans); cursor: pointer; color: var(--ink); }
.sw[aria-pressed="true"] { border-color: var(--ink); }
.sw .dot { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08); }
.maker-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.maker-foot .small { margin: 0; }
.err { color: var(--red-d); font-weight: 700; font-size: .92rem; min-height: 1.2em; margin: 8px 0 0; }
@media (max-width: 640px) {
  .modes, .fields { grid-template-columns: 1fr; }
  .maker { padding: 18px; }
  .maker-foot .btn { width: 100%; }
}

/* ---------- 通用版块 ---------- */
.sec { padding: 64px 0; }
.sec-alt { background: var(--paper-2); border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 34px; }
.sec-head p { color: var(--ink-2); font-size: 1.08rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step { background: var(--card); border-radius: var(--radius); padding: 24px 22px 20px; box-shadow: var(--shadow); position: relative; }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: -16px; left: 20px; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; font: 800 1.25rem/40px var(--serif); text-align: center; box-shadow: 0 0 0 4px var(--paper); }
.step h3 { margin-top: 10px; }
.step p { margin: 0; color: var(--ink-2); }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; gap: 30px; } }
.prose { font-size: 1.06rem; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose figure { margin: 28px 0; }
.prose figcaption { font-size: .9rem; color: var(--ink-2); text-align: center; margin-top: 8px; }
.prose figure img { border-radius: 14px; box-shadow: var(--shadow); display: block; margin: 0 auto; }
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; background: var(--card); border-radius: 12px; overflow: hidden; font-size: .96rem; }
.prose th, .prose td { padding: .7em .9em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: #efe2cb; font-family: var(--serif); }
.callout { background: var(--card); border-left: 5px solid var(--pine); border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 22px 0; }
.cta-strip { background: var(--pine); color: #fff; border-radius: 22px; padding: 30px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 34px 0; }
.cta-strip h3 { margin: 0 0 4px; color: #fff; }
.cta-strip p { margin: 0; opacity: .9; }
.cta-strip .btn { background: #fff; color: var(--pine-d); box-shadow: 0 4px 0 #b9d4c4; }
.next-reads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.next-reads a { display: block; background: var(--card); border-radius: 14px; padding: 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border: 1px solid #eadcc4; }
.next-reads a b { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: 4px; }
.next-reads a span { font-size: .92rem; color: var(--ink-2); }
.next-reads a:hover { border-color: var(--red); }
@media (max-width: 800px) { .next-reads { grid-template-columns: 1fr; } }

/* 免费 vs 豪华 */
.compare { display: grid; grid-template-columns: 1fr 1.15fr; gap: 22px; align-items: stretch; }
.tier { background: var(--card); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); border: 1px solid #eadcc4; }
.tier h3 { display: flex; align-items: center; gap: .4em; }
.tier ul { list-style: none; padding: 0; margin: 14px 0 0; }
.tier li { padding: .45em 0 .45em 1.7em; position: relative; border-bottom: 1px dashed var(--line); }
.tier li::before { content: "✓"; position: absolute; left: 0; color: var(--pine); font-weight: 800; }
.tier-deluxe { background: linear-gradient(160deg, #fff8e6, #fdeccb); border-color: #efd18c; position: relative; overflow: hidden; }
.tier-deluxe li::before { content: "★"; color: #c99a2e; }
.tier .price { font: 800 2rem var(--serif); }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.pack { position: relative; background: #fff; border: 2px solid #efd18c; border-radius: 14px; padding: 14px 10px 12px; text-align: center; cursor: pointer; font: inherit; color: var(--ink); transition: transform .15s, border-color .15s; }
.pack:hover { transform: translateY(-2px); }
.pack[aria-pressed="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200, 65, 75, .15); }
.pack .n { font: 800 1.9rem/1 var(--serif); display: block; }
.pack .u { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.pack .p { display: block; font-weight: 800; font-size: 1.12rem; margin-top: 6px; }
.pack .e { display: block; font-size: .78rem; color: var(--ink-2); }
.pack .tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--red); color: #fff; font-size: .68rem; font-weight: 800; padding: .2em .6em; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 800px) { .compare { grid-template-columns: 1fr; } }

/* FAQ */
.faq details { background: var(--card); border-radius: 14px; margin-bottom: 10px; border: 1px solid #eadcc4; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 800; list-style: none; position: relative; padding-right: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--red); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 20px 16px; color: var(--ink-2); }

/* ---------- 日历：麻绳 + 信封 ---------- */
.cal-page { padding: 26px 0 60px; }
.cal-head { text-align: center; margin-bottom: 8px; }
.cal-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .1em; }
.cal-head .sub { color: var(--ink-2); font-size: 1.05rem; margin: 0 auto; max-width: 620px; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin: 18px auto 6px; }
.chip { display: inline-flex; align-items: center; gap: .4em; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .45em .9em; font-weight: 700; font-size: .9rem; color: var(--ink); text-decoration: none; cursor: pointer; font-family: var(--sans); }
.chip-gold { background: linear-gradient(180deg, #fff3cc, #fde3a0); border-color: #efd18c; }
.share-card { max-width: 720px; margin: 18px auto 8px; background: var(--card); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow); border: 1px solid #eadcc4; }
.share-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-row input { flex: 1 1 260px; font-size: .95rem; }
.share-row .btn { padding: .8em 1.1em; font-size: .95rem; }
.progress { height: 10px; background: #eadcc4; border-radius: 999px; overflow: hidden; margin: 10px 0 4px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--pine), #5aa37f); border-radius: 999px; transition: width .5s; }

.wall { --twine: #a77b4f; --bg: transparent; position: relative; padding: 30px 10px 20px; margin: 10px auto 0; max-width: 1060px; border-radius: 26px; }
.wall.g-nordic { background: #1f2a3d; --twine: #d9c7a3; color: #f3ead8; }
.wall.g-berry { background: #fbeff0; --twine: #9b2c3a; }
.wall.g-mint { background: #eaf6f1; --twine: #d0505c; }
.wall.g-twine { background: rgba(255, 250, 241, .55); }
.line { position: relative; display: grid; grid-template-columns: repeat(var(--per, 6), 1fr); gap: 14px; padding: 34px 6px 22px; }
.line::before { content: ""; position: absolute; left: -6px; right: -6px; top: -4px; height: 34px; border-bottom: 3px solid var(--twine); border-radius: 0 0 50% 50% / 0 0 34px 34px; pointer-events: none; }
.line::after { content: ""; position: absolute; left: -10px; right: -10px; top: 22px; height: 10px; background: radial-gradient(circle at 6px 5px, #2f6b4f 4px, transparent 5px) 0 0 / 36px 10px repeat-x; opacity: .0; }
.slot { position: relative; transform: translateY(var(--dy, 0)); }
.pin { position: absolute; top: -18px; left: 50%; width: 12px; height: 26px; margin-left: -6px; background: linear-gradient(90deg, #c9a274, #e6c79d 50%, #b48a5c); border-radius: 3px; z-index: 3; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.pin::after { content: ""; position: absolute; left: 2px; right: 2px; top: 11px; height: 3px; background: rgba(0, 0, 0, .25); border-radius: 2px; }

.env {
  --p0: #d7b48a; --p1: #c49a6c; --pt: #4a3320;
  position: relative; display: block; width: 100%; aspect-ratio: 5 / 4; border: 0; padding: 0; cursor: pointer; background: var(--p0);
  border-radius: 7px; box-shadow: 0 8px 14px -8px rgba(40, 25, 10, .55), inset 0 -2px 0 rgba(0, 0, 0, .08); font: inherit; color: var(--pt);
  transform-origin: 50% -14px; transition: transform .2s;
}
.env:hover { transform: rotate(-2deg) translateY(-2px); }
.env::before { /* 封舌 */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 58%; background: var(--p1); clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 7px 7px 0 0; z-index: 1; transition: transform .5s; transform-origin: top;
}
.env::after { /* 信封下半两条斜线 */
  content: ""; position: absolute; inset: 0; background:
    linear-gradient(to top right, transparent calc(50% - 1px), rgba(0, 0, 0, .07) 50%, transparent calc(50% + 1px)) left bottom / 50% 60% no-repeat,
    linear-gradient(to top left, transparent calc(50% - 1px), rgba(0, 0, 0, .07) 50%, transparent calc(50% + 1px)) right bottom / 50% 60% no-repeat;
  border-radius: 7px; pointer-events: none;
}
.env .num { position: absolute; left: 7px; bottom: 5px; font: 800 clamp(1rem, 2.4vw, 1.5rem)/1 var(--serif); z-index: 2; }
.env .seal { position: absolute; left: 50%; top: 58%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e05a63, #9b1c2c 70%); color: #fff6ec; display: grid; place-items: center; font: 800 clamp(.7rem, 1.6vw, 1rem) var(--serif); z-index: 2; box-shadow: 0 2px 3px rgba(0, 0, 0, .3); }
.env .stamp { position: absolute; right: 6px; top: 6px; width: 24%; aspect-ratio: 4 / 5; background: #fff; display: grid; place-items: center; font-size: clamp(.8rem, 1.8vw, 1.2rem); z-index: 2; border-radius: 2px;
  -webkit-mask: radial-gradient(circle 2.2px at 2.2px 2.2px, transparent 98%, #000) -2.2px -2.2px / 6px 6px; mask: radial-gradient(circle 2.2px at 2.2px 2.2px, transparent 98%, #000) -2.2px -2.2px / 6px 6px; }
.env .who { position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; font: 600 1.05rem/1 var(--hand); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-nordic .env .who { color: #f3ead8; }
.env .lock { position: absolute; right: 7px; bottom: 5px; font-size: .8rem; z-index: 2; opacity: .8; }

/* 空信封：虚线 */
.env.empty { background: rgba(255, 255, 255, .5); box-shadow: none; outline: 2px dashed rgba(120, 90, 60, .45); outline-offset: -2px; color: var(--ink-2); }
.g-nordic .env.empty { background: rgba(255, 255, 255, .06); outline-color: rgba(243, 234, 216, .4); color: #d9c7a3; }
.env.empty::before { background: transparent; border-bottom: 0; clip-path: none; height: 0; }
.env.empty::after { display: none; }
.env.empty .plus { position: absolute; inset: 0; display: grid; place-items: center; font: 600 clamp(1.1rem, 2.6vw, 1.6rem) var(--hand); z-index: 2; }
.env.empty.can-fill:hover { background: #fff; outline-color: var(--red); color: var(--red); }
.env.empty.no-fill { cursor: default; }
.env.empty.no-fill:hover { transform: none; }

/* 豪华格：金箔礼盒 */
.env.deluxe { --b0: #f5d77b; --b1: #c99a2e; --rb: #9b1c2c; background: linear-gradient(135deg, var(--b0), var(--b1)); overflow: hidden; }
.env.deluxe::before { clip-path: none; height: 100%; border-radius: 7px; background:
  linear-gradient(90deg, transparent 44%, var(--rb) 44%, var(--rb) 56%, transparent 56%),
  linear-gradient(0deg, transparent 44%, var(--rb) 44%, var(--rb) 56%, transparent 56%); opacity: .95; }
.env.deluxe::after { background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 45%, transparent 60%) -150% 0 / 250% 100% no-repeat; animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 40% { background-position: -150% 0; } 100% { background-position: 150% 0; } }
.env.deluxe .bow { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -62%); font-size: clamp(1.2rem, 3vw, 2rem); z-index: 3; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.env.deluxe .num { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.env.deluxe .tagd { position: absolute; right: 5px; top: 5px; z-index: 3; background: rgba(255, 255, 255, .9); color: #7a4c00; font: 800 .58rem/1 var(--sans); text-transform: uppercase; letter-spacing: .05em; padding: .3em .45em; border-radius: 4px; }

/* 已拆：封舌掀开、信纸露出 */
.env.opened::before { transform: rotateX(180deg) translateY(-100%); opacity: .55; }
.env.opened .seal { display: none; }
.env.opened .peek { position: absolute; left: 12%; right: 12%; top: -16%; height: 60%; background: #fffdf7; border-radius: 3px; z-index: 0; box-shadow: 0 -1px 3px rgba(0, 0, 0, .15); background-image: repeating-linear-gradient(#fffdf7 0 7px, #e8e0cf 7px 8px); }
.env.opened.deluxe::before { opacity: .25; }
.env .react { position: absolute; left: -6px; top: -8px; font-size: 1.1rem; z-index: 4; }

/* 今天能拆 */
.env.ready { animation: wiggle 2.6s ease-in-out infinite; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--gold), 0 10px 22px -6px rgba(201, 154, 46, .8); }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-4deg); } 90% { transform: rotate(4deg); } 95% { transform: rotate(-2deg); } }
.env.mine { box-shadow: 0 0 0 3px var(--pine), 0 8px 14px -8px rgba(40, 25, 10, .55); }
.today-label { position: absolute; left: 50%; bottom: -46px; transform: translateX(-50%); background: var(--gold); color: #4a2f05; font: 800 .7rem/1 var(--sans); text-transform: uppercase; padding: .35em .6em; border-radius: 999px; white-space: nowrap; z-index: 4; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; font-size: .86rem; color: var(--ink-2); margin: 26px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: .4em; }
.legend i { width: 16px; height: 13px; border-radius: 3px; display: inline-block; }

/* ---------- 弹窗 ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: min(560px, 100% - 24px); width: 100%; max-height: calc(100% - 24px); overflow: visible; }
dialog::backdrop { background: rgba(40, 28, 16, .55); backdrop-filter: blur(3px); }
.sheet { background: var(--card); border-radius: 22px; padding: 24px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); position: relative; max-height: calc(100vh - 40px); overflow: auto; }
.sheet h2 { font-size: 1.6rem; margin-right: 34px; }
.x { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #efe4d0; font-size: 1.2rem; cursor: pointer; color: var(--ink); z-index: 2; }
.kind { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
.kind button { text-align: left; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 12px; cursor: pointer; font: inherit; color: var(--ink); }
.kind button b { display: block; }
.kind button span { font-size: .84rem; color: var(--ink-2); }
.kind button[aria-pressed="true"] { border-color: var(--pine); background: #f1f8f3; }
.kind button.k-deluxe[aria-pressed="true"] { border-color: #c99a2e; background: #fff6dc; }
.row { margin-bottom: 14px; }
.row-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.count { font-size: .8rem; color: var(--ink-2); text-align: right; margin-top: 3px; }
.stamps { display: flex; flex-wrap: wrap; gap: 6px; }
.stamps button { width: 42px; height: 42px; font-size: 1.3rem; border: 2px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.stamps button[aria-pressed="true"] { border-color: var(--ink); background: #fff4e0; }
.papers { display: flex; flex-wrap: wrap; gap: 8px; }
.papers button { width: 46px; height: 36px; border-radius: 6px; border: 3px solid transparent; cursor: pointer; position: relative; box-shadow: 0 2px 4px rgba(0, 0, 0, .15); }
.papers button::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 55%; clip-path: polygon(0 0, 100% 0, 50% 100%); background: rgba(0, 0, 0, .12); }
.papers button[aria-pressed="true"] { border-color: var(--ink); }
.photo-drop { display: flex; align-items: center; gap: 12px; border: 2px dashed #e3c57a; background: #fffaf0; border-radius: 14px; padding: 12px; cursor: pointer; }
.photo-drop img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.deluxe-only { display: none; }
.is-deluxe .deluxe-only { display: block; }
.is-deluxe .free-only { display: none; }
.check { display: inline-flex; align-items: center; gap: .5em; font-weight: 700; font-size: .92rem; cursor: pointer; }
.pay-note { background: #fff6dc; border: 1px solid #efd18c; border-radius: 12px; padding: 10px 12px; font-size: .9rem; margin: 10px 0 0; }

/* 拆开的信 */
.letter { background: #fffdf7; border-radius: 6px; padding: 26px 24px 22px; position: relative; box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .6);
  background-image: repeating-linear-gradient(transparent 0 33px, #ece3d0 33px 34px); background-position: 0 70px; animation: rise .6s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes rise { from { transform: translateY(60px) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
.letter .day { font: 800 .85rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--red); }
.letter .lt { font: 600 1.55rem/34px var(--hand); white-space: pre-wrap; word-wrap: break-word; margin: 10px 0 16px; color: #26313f; }
.letter .from { font: 600 1.4rem var(--hand); text-align: right; color: var(--red-d); }
.letter .stamp-big { position: absolute; right: 18px; top: 16px; width: 54px; height: 64px; background: #fff; display: grid; place-items: center; font-size: 1.8rem; transform: rotate(6deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  -webkit-mask: radial-gradient(circle 3px at 3px 3px, transparent 98%, #000) -3px -3px / 8px 8px; mask: radial-gradient(circle 3px at 3px 3px, transparent 98%, #000) -3px -3px / 8px 8px; }
.letter.deluxe { background-color: #fffaf0; border: 3px solid #e9c46a; }
.polaroid { background: #fff; padding: 10px 10px 30px; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .45); transform: rotate(-2.5deg); margin: 8px auto 16px; max-width: 320px; }
.polaroid img { display: block; width: 100%; border-radius: 2px; }
.reacts { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.reacts button { font-size: 1.4rem; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: #fff; cursor: pointer; }
.reacts button[aria-pressed="true"] { border-color: var(--red); background: #fff1f1; }
.spark { position: fixed; pointer-events: none; z-index: 9999; font-size: 18px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--dx), 70vh) rotate(var(--rot)); opacity: 0; } }

/* 吐司 */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: .8em 1.2em; border-radius: 12px; font-weight: 700; opacity: 0; transition: .25s; z-index: 10000; max-width: calc(100% - 30px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* 首页演示墙 */
.demo { max-width: 860px; margin: 0 auto; }
.demo-note { text-align: center; color: var(--ink-2); margin-top: 14px; font-size: .95rem; }

/* 我的日历 */
.mycals { display: grid; gap: 10px; margin-top: 14px; }
.mycals a { display: flex; justify-content: space-between; align-items: center; background: var(--card); padding: 14px 16px; border-radius: 12px; text-decoration: none; color: var(--ink); border: 1px solid #eadcc4; font-weight: 700; }
.code-form { display: flex; gap: 10px; max-width: 520px; margin: 0 auto; }
.code-form input { flex: 1; font-size: 1.2rem; letter-spacing: .1em; text-align: center; }

/* 页脚 */
.foot { background: #2d2218; color: #e9dcc5; padding: 50px 0 24px; margin-top: 40px; }
.foot a { color: #e9dcc5; text-decoration: none; display: block; padding: .2em 0; font-size: .95rem; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot .brand { color: #fff; display: flex; margin-bottom: 10px; }
.foot .brand em { color: #f0a3a8; }
.foot h4 { color: #fff; font-size: 1rem; margin-bottom: .6em; }
.foot p { font-size: .92rem; opacity: .85; }
.foot .small { color: #bfae93; }
.foot-in { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 26px; }
.foot-base { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 30px; padding-top: 18px; font-size: .85rem; opacity: .7; }
@media (max-width: 800px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* 法律页 */
.legal { padding: 40px 0 20px; }
.legal h1 { font-size: 2.4rem; }
.legal h2 { font-size: 1.35rem; margin-top: 1.6em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Keep photo selection keyboard-accessible and use the same text as the form. */
button.photo-drop { width: 100%; font: inherit; color: inherit; }
:where(button, a, input, textarea, select, summary, [tabindex]):focus-visible { outline: 2px solid #42658a; outline-offset: 3px; }
dialog:focus, dialog:focus-visible { outline: none; }

/* The interactive calendar is part of the opening screen. */
.hero { padding: 28px 0 36px; text-align: left; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); grid-template-areas: "calendar copy" "calendar maker"; column-gap: 36px; row-gap: 16px; align-items: start; }
.hero-copy { grid-area: copy; }
.hero-copy h1 { font-size: clamp(2rem, 3.5vw, 3rem); line-height: 1.08; margin-bottom: 12px; }
.hero-copy h1 > span { color: var(--red); }
.hero-copy .lede { font-size: 1.05rem; line-height: 1.5; margin: 0; max-width: 440px; }
.hero-copy .kicker { font-size: .82rem; margin-bottom: 12px; }
.hero-calendar { grid-area: calendar; align-self: center; min-width: 0; padding: 20px 16px 14px; border: 1px solid #ddc9a9; border-radius: 24px; background: #fffaf1; box-shadow: var(--shadow); }
.preview-heading { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 0 4px 12px; }
.preview-heading .hand { font-size: 1.55rem; color: var(--pine-d); line-height: 1.1; }
.preview-badge { font-size: .88rem; color: var(--red-d); white-space: nowrap; font-weight: 800; }
.arrangement-switch { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line); background: #f1e7d7; border-radius: 12px; width: fit-content; margin: 0 auto 8px; }
.arrangement-switch button { background: transparent; color: var(--ink-2); border: 0; border-radius: 8px; padding: 9px 14px; min-height: 40px; font: 800 .9rem var(--sans); cursor: pointer; }
.arrangement-switch button[aria-pressed="true"] { background: var(--pine); color: #fff; box-shadow: 0 2px 4px #153c2b24; }
.preview-caption { font-size: .88rem; line-height: 1.45; color: var(--ink-2); margin: 12px 0 0; text-align: center; }
.preview-caption span { display: block; }
.hero-mobile-cta { display: none; }
.hero .maker { grid-area: maker; width: 100%; padding: 20px; margin: 0; }
.maker-title { font-size: 1.2rem; margin: 0 0 14px; }
.maker-anchor { scroll-margin-top: 90px; }
.hero .modes { gap: 8px; margin-bottom: 14px; }
.hero .mode { gap: 8px; padding: 10px; }
.hero .mode b { font-size: .95rem; }
.hero .mode span { font-size: .85rem; line-height: 1.35; display: block; }
.hero .mode i { font-size: 1.5rem; }
.hero .fields { gap: 10px; }
.hero .sw { font-size: .85rem; padding: 6px 8px; }
.hero .sw .dot { width: 16px; height: 16px; }
.hero .maker-foot { margin-top: 14px; gap: 12px; }
.hero .maker-foot .btn { width: 100%; padding: 14px; }
.hero .maker .err:empty { min-height: 0; margin: 0; }
.wall-compact { padding: 8px 0 4px; margin: 0; background: transparent; }
.wall-compact .line { gap: 9px; padding: 24px 0 13px; }
.wall-compact .line::before { left: -3px; right: -3px; top: -3px; height: 26px; border-bottom-width: 2px; }
.wall-compact .env { min-height: 44px; }
.wall-compact .env .num { font-size: 1rem; bottom: 4px; left: 5px; }
.wall-compact .env .who, .wall-compact .today-label, .wall-compact .tagd, .wall-compact .empty .plus { display: none; }
.wall-compact .env .stamp { right: 4px; top: 4px; font-size: .9rem; }
.wall-compact .env .seal { font-size: .75rem; }
.wall-compact .env .bow { font-size: 1.4rem; }
.wall-compact .pin { width: 8px; height: 21px; top: -15px; margin-left: -4px; }
.wall-compact .env.ready { animation: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold); }

/* Every pack names the benefits delivered by each credit. */
.pack { display: block; text-decoration: none; min-width: 0; }
.pack .u { display: block; font-size: .88rem; text-transform: none; letter-spacing: 0; margin-top: 4px; }
.pack .e { font-size: .88rem; line-height: 1.4; }
.pack .tag { font-size: .75rem; text-transform: none; letter-spacing: 0; }
.pack-perks { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; text-align: left; font-size: .88rem; line-height: 1.4; }
.pack-perks > span { display: block; }
.pack-foot { display: block; font-size: .88rem; line-height: 1.4; font-weight: 800; color: var(--pine-d); margin-top: 10px; }

/* Wide writing panel: benefits at left, the letter at right. */
dialog.composer-dialog { max-width: min(1160px, 100% - 32px); }
.composer-sheet { padding: 24px; }
.composer-heading { padding-right: 36px; margin-bottom: 20px; }
.composer-heading h2 { margin: 0 0 5px; }
.composer-heading p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 26px; align-items: start; }
.composer-benefits, .composer-editor { min-width: 0; }
.composer-benefits .kind { margin: 0; gap: 10px; align-items: stretch; }
.composer-benefits .kind button { padding: 12px; }
.composer-benefits .kind button b { font-size: 1rem; line-height: 1.3; }
.benefit-list { display: grid; gap: 6px; margin-top: 10px; font-size: .88rem; line-height: 1.4; }
.benefit-list > span { display: block; }
.composer-packs { margin-top: 20px; }
.composer-packs h3 { font: 800 .95rem var(--sans); margin: 0 0 16px; }
.composer-packs .packs { margin-top: 0; gap: 8px; }
.composer-packs .pack { padding: 16px 8px 12px; }
.composer-packs .pack .n { font-size: 1.6rem; }
.composer-packs .pack .u { font-size: .88rem; }
.composer-packs .pack-perks { gap: 7px; }
.composer-editor { border-left: 1px solid var(--line); padding-left: 26px; }
.composer-editor textarea { min-height: 150px; font-weight: 400; }
.composer-editor .row { margin-bottom: 14px; }
.composer-submit .err:empty { min-height: 0; margin: 0; }
.composer-submit .btn { margin-top: 10px; min-height: 46px; }
.credit-notice { padding: 12px; margin: 14px 0 0; background: #e7f0e6; border-radius: 12px; color: var(--pine-d); font-size: .95rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; grid-template-areas: "copy" "calendar" "maker"; max-width: 600px; row-gap: 18px; }
  .hero-copy { text-align: center; }
  .hero-copy .lede { margin: 0 auto; }
  .hero-calendar { width: 100%; }
  .hero-mobile-cta { display: block; text-align: center; font-size: .95rem; font-weight: 800; color: var(--red-d); margin-top: 10px; }
  .composer-grid { grid-template-columns: 1fr; gap: 22px; }
  .composer-editor { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
  dialog.composer-dialog { max-width: min(600px, 100% - 20px); }
}
@media (max-width: 480px) {
  .hero { padding-top: 16px; }
  .hero-grid { width: calc(100% - 24px); gap: 14px; }
  .hero-copy h1 { font-size: 1.9rem; margin-bottom: 8px; }
  .hero-copy .kicker { font-size: .88rem; letter-spacing: 0; padding: 4px 10px; margin-bottom: 8px; }
  .hero-copy .lede { font-size: 1rem; line-height: 1.4; }
  .hero-calendar { padding: 14px 10px 10px; border-radius: 18px; }
  .preview-heading { margin-bottom: 10px; }
  .preview-heading .hand { font-size: 1.25rem; }
  .arrangement-switch button { padding: 9px 12px; font-size: .88rem; }
  .wall-compact .line { gap: 6px; padding-top: 17px; padding-bottom: 7px; }
  .wall-compact .line::before { height: 20px; }
  .wall-compact .env .stamp { width: 22%; font-size: .7rem; }
  .wall-compact .env .seal { width: 26%; font-size: .65rem; }
  .wall-compact .env .bow { font-size: 1.1rem; }
  .wall-compact .env .lock { right: 3px; bottom: 3px; font-size: .65rem; }
  .preview-caption { font-size: .88rem; margin-top: 10px; }
  .hero .maker { padding: 18px; }
  .hero .modes { grid-template-columns: 1fr 1fr; }
  .hero .mode { display: block; }
  .hero .mode i { display: none; }
  .hero .fields { grid-template-columns: 1fr; }
  .composer-sheet { padding: 18px; }
  .composer-heading h2 { font-size: 1.35rem; }
  .composer-benefits .kind { gap: 8px; }
  .composer-benefits .kind button { padding: 10px; }
  .composer-packs .pack { padding-left: 6px; padding-right: 6px; }
  .composer-packs .pack .u { display: none; }
  .composer-packs .pack .tag { font-size: .75rem; max-width: calc(100% + 10px); }
  .composer-packs .pack .e { min-height: 40px; }
}

/* Prevent intrinsic button widths from pushing the sixth date outside the card. */
.wall-compact .line { grid-template-columns: repeat(var(--per, 6), minmax(0, 1fr)); }
.wall-compact .slot { min-width: 0; }
.hero .fields:has(#f-from-wrap[hidden]) > div:first-child { grid-column: 1 / -1; }
@media (max-width: 480px) and (max-height: 720px) {
  .hero-grid { row-gap: 10px; }
  .hero-copy h1 { font-size: 1.75rem; }
  .hero-copy .lede { font-size: .95rem; }
  .hero-calendar { padding-top: 10px; }
  .preview-heading { margin-bottom: 6px; }
  .arrangement-switch button { min-height: 36px; padding-top: 7px; padding-bottom: 7px; }
  .wall-compact .line { padding-top: 15px; padding-bottom: 5px; }
}

/* Both envelope modes share one fixed frame; only the content panes scroll. */
dialog.composer-dialog {
  width: calc(100% - 32px);
  max-width: 1220px;
  height: min(800px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border-radius: 24px;
}
.composer-sheet { height: 100%; max-height: none; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.composer-heading { flex: 0 0 auto; margin-bottom: 18px; }
.composer-grid { flex: 1 1 auto; min-height: 0; align-items: stretch; overflow: hidden; }
.composer-benefits, .composer-editor { min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.composer-benefits { padding: 2px 12px 12px 2px; }
.composer-editor { padding-right: 10px; padding-bottom: 10px; }
.composer-benefits .kind { grid-auto-rows: 1fr; }
.composer-benefits .kind button { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 206px; }
.composer-benefits .kind button b { min-height: 42px; }
.composer-editor textarea { height: 150px; min-height: 150px; max-height: 150px; resize: none; overflow-y: auto; }
.composer-submit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); column-gap: 26px; align-items: center; flex: 0 0 auto; min-height: 68px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); background: var(--card); }
.composer-submit .btn { grid-column: 2; grid-row: 2; margin: 0; }
.composer-submit .err { grid-column: 2; grid-row: 1; margin: 0 0 8px; }
.composer-submit .err:empty { display: none; }
.composer-footer-note { grid-column: 1; grid-row: 1 / 3; color: var(--ink-2); font-size: .95rem; }

/* A full-size wrap preview and six illustrated, labelled finishes. */
.gift-preview { display: flex; align-items: center; gap: 14px; min-height: 190px; padding: 14px 18px; margin: 8px 0 16px; border: 1px solid #e3cf9e; border-radius: 18px; background: radial-gradient(ellipse at 25% 30%, #fffdf6, transparent 65%), linear-gradient(135deg, #f6ebd0, #fff8e9); box-shadow: inset 0 1px 0 #fff; }
.gift-preview-art { flex: 0 0 178px; width: 178px; line-height: 0; filter: drop-shadow(0 8px 7px #6b4e2526); }
.gift-preview-art svg { display: block; width: 100%; }
.gift-preview-copy { min-width: 0; }
.gift-eyebrow { display: block; color: #7e5b24; font-size: .88rem; font-weight: 800; margin-bottom: 6px; }
.gift-preview-copy h3 { font-size: 1.35rem; margin: 0 0 8px; }
.gift-preview-copy p { font-size: .95rem; color: var(--ink-2); line-height: 1.45; margin: 0 0 10px; }
.gift-preview-caption { font-size: .88rem; font-weight: 800; color: var(--pine-d); }
.gift-style-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gift-style { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 8px 8px 12px; min-height: 148px; border: 2px solid #e5dac8; border-radius: 15px; background: linear-gradient(155deg, #fffefa, #f6efe3); cursor: pointer; font: inherit; color: var(--ink); transition: border-color .16s, box-shadow .16s, background .16s; }
.gift-style:hover { border-color: #c9a452; box-shadow: 0 5px 14px #664d2020; }
.gift-style[aria-pressed="true"] { border-color: #b58a2d; background: linear-gradient(145deg, #fff9df, #f5e3ad); box-shadow: 0 0 0 3px #d9b65a33, inset 0 1px 0 #fff; }
.gift-style-art { display: block; width: min(100%, 120px); line-height: 0; }
.gift-style-art svg { display: block; width: 100%; }
.gift-style-name { font-size: .9rem; font-weight: 800; line-height: 1.3; text-align: center; margin-top: 1px; }
.gift-style-check { position: absolute; display: none; top: 7px; right: 7px; width: 21px; height: 21px; border-radius: 50%; background: #8c681d; color: #fff; font: 800 14px/21px var(--sans); text-align: center; }
.gift-style[aria-pressed="true"] .gift-style-check { display: block; }
.env.deluxe { background: transparent; overflow: visible; box-shadow: none; }
.env.deluxe::before, .env.deluxe::after { display: none; }
.calendar-gift { position: absolute; inset: auto; left: 50%; bottom: -10%; width: 146%; aspect-ratio: 220 / 210; transform: translateX(-50%); pointer-events: none; }
.calendar-gift svg { display: block; width: 100%; height: 100%; }
.env.deluxe .num { color: #4c3511; background: #fff7de; border: 1px solid #d2b877; border-radius: 4px; padding: 2px 4px; text-shadow: none; left: 10%; bottom: 4%; }
.env.deluxe .tagd { top: 6%; right: 8%; background: #fff9e8ed; color: #6e4c0a; }
.env.deluxe .lock { right: 11%; bottom: 7%; }
.env.deluxe.mine { box-shadow: none; outline: 2px solid var(--pine); outline-offset: 3px; }
.wall-compact .calendar-gift { inset: auto; left: 50%; bottom: -10%; width: 146%; }
.wall-compact .env.deluxe .num { font-size: .88rem; padding: 1px 3px; }

@media (max-width: 900px) {
  dialog.composer-dialog { width: calc(100% - 20px); max-width: 620px; height: min(860px, calc(100dvh - 20px)); max-height: calc(100dvh - 20px); }
  .composer-grid { display: block; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .composer-benefits, .composer-editor { height: auto; overflow: visible; scrollbar-gutter: auto; padding-right: 0; }
  .composer-benefits { padding-bottom: 20px; }
  .composer-editor { padding-top: 20px; }
  .composer-submit { grid-template-columns: 1fr; column-gap: 0; min-height: 58px; margin-top: 10px; padding-top: 10px; }
  .composer-submit .err, .composer-submit .btn { grid-column: 1; }
  .composer-footer-note { display: none; }
}
@media (max-width: 480px) {
  .composer-heading p { font-size: .9rem; }
  .composer-benefits .kind button { min-height: 238px; }
  .composer-benefits .kind button b { min-height: 62px; }
  .gift-preview { padding: 10px; gap: 8px; min-height: 150px; }
  .gift-preview-art { flex-basis: 132px; width: 132px; }
  .gift-eyebrow { font-size: .88rem; }
  .gift-preview-copy h3 { font-size: 1.1rem; }
  .gift-preview-copy p { font-size: .88rem; }
  .gift-preview-caption { display: none; }
  .gift-style-picker { gap: 8px; }
  .gift-style { min-height: 130px; padding: 6px 4px 10px; }
  .gift-style-name { font-size: .88rem; }
}

/* Four illustrated settings, shared by the live preview and saved calendars. */
.wall.g-twine { background-color: #f1e6ce; background-image: url('/img/themes/twine.svg'), radial-gradient(#a1844520 .75px, transparent .85px), linear-gradient(115deg, #fff8e7, #eaddbe); background-size: 100% 100%, 11px 11px, 100% 100%; border: 1px solid #c7ad7c; box-shadow: inset 0 0 0 5px #fff8e452, 0 10px 24px -18px #664c2a77; }
.wall.g-berry { background-color: #f4dfe3; background-image: url('/img/themes/berry.svg'), repeating-linear-gradient(0deg, transparent 0 8px, #b67d8c07 8px 9px), linear-gradient(135deg, #fff7f2, #edcfd8); background-size: 100% 100%, 100% 100%, 100% 100%; border: 1px solid #c99ba7; box-shadow: inset 0 0 0 5px #fff6ed50, 0 10px 24px -18px #77444f77; }
.wall.g-nordic { background-color: #152a42; background-image: url('/img/themes/nordic.svg'), radial-gradient(ellipse at 75% 20%, #41627a80, transparent 65%), linear-gradient(160deg, #13243b, #273c4d); background-size: 100% 100%, 100% 100%, 100% 100%; border: 1px solid #8099a2; box-shadow: inset 0 0 0 5px #c4d3cf12, 0 10px 24px -18px #10203299; }
.wall.g-mint { background-color: #e0f0e6; background-image: url('/img/themes/mint.svg'), repeating-linear-gradient(135deg, #ffffff45 0 9px, transparent 9px 25px), linear-gradient(140deg, #f0faf0, #cfe6dd); background-size: 100% 100%, 100% 100%, 100% 100%; border: 1px solid #9ab9aa; box-shadow: inset 0 0 0 5px #fffdf16b, 0 10px 24px -18px #28544266; }
.g-twine .env.empty { background: linear-gradient(135deg, #fffbf2e8, #f6eddae0); outline-color: #a68c62a1; }
.g-berry .env.empty { background: linear-gradient(145deg, #fff9f6e8, #f4e3e8db); outline-color: #b57a8a9e; }
.g-nordic .env.empty { background: linear-gradient(145deg, #a3bdcc20, #d6e2e310); outline-color: #c1d0d28a; color: #eee5c9; }
.g-mint .env.empty { background: repeating-linear-gradient(135deg, #ffffffd9 0 9px, #e7f3e8d9 9px 18px); outline-color: #5b93818a; }
.g-berry .line::before { border-color: #a24c60; }
.g-nordic .line::before { border-color: #d3c7a2; }
.g-mint .line::before { border-color: #b76470; border-bottom-style: dashed; }

/* Show a miniature decorated setting instead of an uninformative colour dot. */
.hero #f-garland { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.hero .sw.theme-swatch { min-width: 0; width: 100%; display: flex; flex-direction: column; gap: 5px; border-radius: 11px; padding: 6px; }
.theme-swatch-art { position: relative; display: flex; align-items: center; justify-content: space-around; gap: 3px; width: 100%; height: 38px; padding: 10px 7px 4px; border-radius: 5px; background-size: 100% 100%; border: 1px solid #c5b48f66; }
.theme-swatch-art::before { content: ''; position: absolute; top: 11px; left: 5px; right: 5px; height: 5px; border-bottom: 1px solid #a08257; border-radius: 0 0 50% 50%; }
.theme-swatch-art i { display: block; position: relative; width: 20px; height: 15px; background: #d2ab7c; border-radius: 2px; box-shadow: 0 2px 3px #34281920; }
.theme-swatch-art i:nth-child(2) { background: #b64b59; transform: translateY(3px); }
.theme-swatch-art i:nth-child(3) { background: #52795c; }
.theme-twine { background-color: #f6ebd1; background-image: url('/img/themes/twine.svg'); }
.theme-berry { background-color: #f5dfe5; background-image: url('/img/themes/berry.svg'); }
.theme-nordic { background-color: #1b3047; background-image: url('/img/themes/nordic.svg'); }
.theme-mint { background-color: #deefe6; background-image: url('/img/themes/mint.svg'); }
.theme-swatch-name { font-size: .88rem; line-height: 1.2; min-height: 34px; display: flex; align-items: center; justify-content: center; text-align: center; }

/* Keep the actual 24/25-day calendar inside the available screen height. */
.calendar-view .cal-page { padding: 16px 0 32px; }
.calendar-view .cal-head { margin-bottom: 6px; }
.calendar-view .cal-head h1 { font-size: clamp(1.65rem, 3.2vw, 2.35rem); }
.calendar-view .cal-head .sub { font-size: 1rem; line-height: 1.4; }
.calendar-view .bar { margin: 10px auto 14px; gap: 8px; }
.calendar-view .chip { padding: 5px 10px; }
.calendar-layout { display: block; }
.calendar-layout.has-share { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 24px; align-items: start; }
#cal-root { min-width: 0; }
#cal-extra:empty { display: none; }
.share-panel summary { color: var(--pine-d); font-weight: 800; font-size: 1rem; cursor: pointer; padding: 10px 0; }
.calendar-view .share-card { margin: 0; padding: 16px; box-shadow: none; }
.calendar-view .share-card h3 { font-size: 1.05rem; }
.calendar-view .share-row input { min-width: 0; flex-basis: 100%; }
.calendar-view .share-row .btn { padding: 11px 12px; font-size: .9rem; }
.wall-fitted { padding: 16px; margin: 0 auto; max-width: 760px; }
.wall-fitted .line { grid-template-columns: repeat(var(--per, 6), minmax(0, 1fr)); gap: var(--fit-gap, 12px); padding: 18px 0; }
.wall-fitted .line::before { top: 0; left: -3px; right: -3px; height: 22px; border-bottom-width: 2px; }
.wall-fitted .slot { min-width: 0; }
.wall-fitted .env { min-height: 44px; }
.wall-fitted .pin { top: -14px; width: 9px; height: 21px; margin-left: -4.5px; }
.wall-fitted .env .num { font-size: 1.1rem; }
.wall-fitted .env.empty .plus { display: none; }
.wall-fitted .env.empty .num { inset: 0; display: grid; place-items: center; font-size: 1.35rem; color: inherit; }
.wall-fitted .env .who { bottom: -18px; font-size: .88rem; line-height: 1.15; font-family: var(--sans); }
.wall-fitted .tagd { display: none; }
.wall-fitted .today-label { bottom: -20px; font-size: .75rem; padding: 3px 5px; }
.wall-fitted .env .lock { font-size: .75rem; }
.wall-fitted .env .stamp { font-size: 1rem; }
.wall-tight .line { padding-top: 18px; padding-bottom: 6px; }
.wall-tight .env .who, .wall-tight .today-label { display: none; }
.calendar-view .legend { margin-top: 12px; gap: 12px; }
.calendar-view .cta-strip { padding: 18px 22px; margin-top: 22px !important; }
.wall-compact[data-days="25"] .line { padding-top: 16px; padding-bottom: 6px; }
@media (max-width: 900px) {
  .calendar-layout.has-share { display: block; }
  .calendar-view .share-panel { margin: 12px auto 0; max-width: 520px; }
  .calendar-view .share-panel summary { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 12px; }
}
@media (max-width: 480px) {
  .calendar-view .cal-page { padding-top: 12px; }
  .calendar-view .cal-page > .wrap { width: calc(100% - 24px); }
  .calendar-view .cal-head h1 { font-size: 1.65rem; }
  .calendar-view .cal-head .sub { font-size: .95rem; }
  .calendar-view .bar { gap: 6px; margin-top: 8px; margin-bottom: 12px; }
  .calendar-view .chip { font-size: .88rem; padding: 4px 8px; }
  .wall-fitted .env .stamp { font-size: .75rem; right: 4px; top: 4px; }
  .wall-fitted .env .seal { font-size: .7rem; }
  .wall-fitted .env.deluxe .num { font-size: .88rem; padding: 1px 3px; }
  .wall-fitted .env .who { font-size: .88rem; }
}
@media (max-height: 720px) {
  .calendar-view .cal-page { padding-top: 10px; }
  .calendar-view .cal-head h1 { font-size: 1.6rem; }
  .calendar-view .cal-head .sub { font-size: .92rem; }
  .calendar-view .bar { margin-top: 8px; margin-bottom: 10px; }
}

@media (max-width: 480px) and (max-height: 620px) {
  .calendar-view .cal-head .sub { display: none; }
  .calendar-view .cal-head h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.4rem; }
  .calendar-view .bar { gap: 4px; margin-top: 6px; margin-bottom: 6px; }
  .calendar-view .chip { padding: 3px 6px; }
}

/* Sharing, calendar management and wallet recovery have distinct labels. */
.sharing-link-card, .recovery-card { padding: 18px; border: 1px solid var(--line); border-radius: 15px; margin: 16px 0; }
.sharing-link-card { background: #edf5ed; border-color: #b9cbb8; }
.recovery-card { background: #fff6df; border-color: #e0c78f; }
.sharing-link-card h3, .recovery-card h3 { font: 800 1.05rem var(--sans); margin: 0 0 9px; }
.sharing-link-card p, .recovery-card p { font-size: .95rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 12px; }
.sharing-link-card > .btn { margin-top: 12px; }
.recovery-card input[type=text], .sharing-link-card input[type=text] { min-width: 0; font-size: .9rem; font-weight: 600; }
.recovery-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.recovery-actions .btn { font-size: .9rem; padding: 12px 14px; }
.recovery-check { margin-top: 14px; font-size: .9rem; align-items: flex-start; }
.recovery-check input { flex: none; margin-top: 5px; }
.recovery-card.recovery-invalid { border-color: #b52332; box-shadow: 0 0 0 2px #b5233226; }
.recovery-invalid .recovery-check { color: #a7192a; }
.recovery-card .recovery-error { color: #a7192a; font-weight: 700; margin: 10px 0 0; }
.recovery-error:empty { display: none; }
.recovery-card .recovery-status { font-size: .82rem; margin: 12px 0 0; }
.sheet .btn[aria-disabled="true"] { opacity: .65; }
.recovery-sheet > h3 { font: 800 1rem var(--sans); margin-top: 20px; }
.wallet-balance { font: 800 1.45rem var(--serif); color: var(--pine-d); margin: 12px 0; }
.wallet-hub { padding: 36px 0; background: linear-gradient(135deg, #f5efdf, #e9f1e5); border-bottom: 1px solid var(--line); }
.wallet-hub h1 { font-size: clamp(2rem, 4vw, 3rem); }
.wallet-hub-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: start; }
.wallet-open-card { padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.wallet-open-card h2 { font-size: 1.45rem; }
.wallet-open-card > p { font-size: .95rem; color: var(--ink-2); }
.wallet-save-details > summary { font-weight: 800; color: var(--red-d); cursor: pointer; padding: 10px 0; }
.wallet-save-details .recovery-card { margin-top: 4px; }
.friend-calendar-form input { margin-top: 8px; font-weight: 400; font-size: 1rem; }
.friend-calendar-form .btn { width: 100%; margin-top: 6px; min-height: 44px; }
.friend-calendar-form .err:empty { min-height: 0; margin: 0; }
.recent-calendars { margin-top: 22px; }
.recent-calendars h3 { font: 800 .95rem var(--sans); margin-bottom: 10px; }
.recent-calendars a { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf7; color: var(--ink); text-decoration: none; margin-bottom: 7px; font-size: .95rem; }
.recent-calendars a span { color: var(--ink-2); font-size: .88rem; }
.owner-backup-reminder { margin: 12px 0 0; padding: 10px; background: #fff0ce; color: #6a4a16; border-radius: 10px; font-size: .9rem; line-height: 1.4; }
.recovery-reminder { max-width: 760px; margin: 14px auto; padding: 12px 16px; background: #fff4d7; border: 1px solid #ddc585; border-radius: 12px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: .95rem; }
.previous-wallet { margin-top: 12px; font-size: .9rem; }
.previous-wallet summary { cursor: pointer; font-weight: 800; }
.previous-wallet p { margin-top: 10px; }
@media (max-width: 800px) {
  .wallet-hub-grid { grid-template-columns: 1fr; gap: 20px; }
  .wallet-open-card { padding: 20px; }
}
@media (max-width: 480px) {
  .wallet-hub { padding-top: 24px; }
  .sharing-link-card, .recovery-card { padding: 14px; }
  .recovery-actions { flex-direction: column; }
  .recovery-actions .btn { width: 100%; }
  .code-form { flex-direction: column; }
  .code-form input { flex: auto; }
}
#wallet { scroll-margin-top: 82px; }
#wallet-status { font-weight: 800; color: var(--pine-d); }
