:root {
  color-scheme: light;
  --paper: #fffaf0;
  --background: #eeeee4;
  --ink: #263d33;
  --muted: #4a6054;
  --accent: #873e3e;
  --line: #d7cebe;
  font: 16px/1.55 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 10% 0, #f8e8d2, transparent 70%) no-repeat, var(--background); }
.wrap { width: min(100% - 32px, 1180px); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-inner, .top-links, .switches, .home-switch, .qr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.15rem; }
.top-inner { justify-content: space-between; padding-block: 1rem; }
.wordmark { font: 1.45rem Georgia, serif; text-decoration: none; }
.wordmark span, .eyebrow, .year { color: var(--accent); }
a { color: inherit; text-underline-offset: .22em; }
h1, h2, h3 { font-family: Georgia, serif; font-weight: 400; line-height: 1.15; margin: 0 0 .65rem; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.2rem, 5vw, 4.1rem); }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.4rem; }
p { margin: 0 0 .85rem; overflow-wrap: anywhere; }
.heading { margin: 2rem 0 1.2rem; }
.eyebrow, .year { font-size: .79rem; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; }
.landing { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.2rem; align-items: center; margin: clamp(1.5rem, 6vw, 4rem) 0; }
.envelope { text-align: center; position: relative; border: 1px solid var(--line); background: var(--paper); padding: clamp(2rem, 7vw, 4.75rem) clamp(1rem, 5vw, 3rem); box-shadow: 0 18px 40px #2b3d2c17; }
.envelope::before { content: ''; position: absolute; inset: .6rem; border: 1px dashed #bda89a; pointer-events: none; }
.seal { display: grid; place-items: center; border-radius: 50%; width: 58px; height: 58px; background: var(--accent); color: white; margin: 0 auto 1.15rem; font-size: 1.7rem; }
.envelope p { max-width: 39ch; margin-inline: auto; }
.cover-note { color: var(--muted); border-top: 1px solid var(--line); padding-top: .75rem; margin-top: 1rem; font-size: .92rem; }
.cover-photo { display: block; width: min(100%, 36rem); max-height: 23rem; object-fit: cover; margin: 1rem auto; border-radius: 5px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: .55rem; padding: 1.2rem; min-width: 0; }
.dashboard { display: grid; grid-template-columns: minmax(10rem, 12.5rem) minmax(0,1fr); gap: 1.35rem; }
.tabs { display: flex; flex-direction: column; align-self: start; gap: .45rem; }
.tabs a, .home-switch a { text-decoration: none; padding: .65rem .85rem; border-radius: .45rem; background: #fcf8ee; border: 1px solid var(--line); }
[aria-current="page"] { color: white !important; background: var(--ink) !important; }
.split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 1rem; }
.preview h1 { font-size: clamp(1.7rem, 4vw, 3rem); }
.preview .envelope { padding: 2rem 1rem; }
.editor { display: grid; gap: .9rem; }
label { display: grid; gap: .3rem; font-weight: 600; }
input, textarea, select, button, .button { font: inherit; }
input:not([type=checkbox]), textarea, select { width: 100%; min-width: 0; max-width: 100%; background: #fffdf7; border: 1px solid #aaad9d; color: var(--ink); padding: .48rem .6rem; border-radius: .35rem; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: .35rem; margin: 0; min-width: 0; }
.check { display: flex; align-items: flex-start; font-weight: 400; }
.check input { accent-color: var(--ink); margin-top: .4em; }
.checks { display: grid; grid-template-columns: repeat(auto-fit,minmax(8rem,1fr)); gap: .3rem .6rem; }
button, .button { display: inline-block; cursor: pointer; border: 1px solid var(--ink); color: var(--ink); border-radius: .36rem; background: transparent; padding: .48rem .8rem; text-decoration: none; width: max-content; max-width: 100%; }
.primary, .button { background: var(--ink); color: white; }
button:disabled { cursor: default; opacity: .63; }
.link { border: 0; padding: 0; text-decoration: underline; }
summary { cursor: pointer; font-weight: 650; }
.editor-card { margin-bottom: .65rem; }
.editor-card[open] summary { margin-bottom: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,16rem),1fr)); gap: .8rem; }
.family-section, .home-switch, .switches { margin-top: 1.5rem; }
.switches small { flex-basis: 100%; }
.muted, small, footer { color: var(--muted); }
.prose { white-space: pre-wrap; }
.notice, .alert { padding: .8rem 1rem; border: 1px solid #b5c5b2; border-radius: .4rem; background: #e8f0e2; margin-top: 1rem; }
.alert { color: #752f37; background: #fff0ed; border-color: #dfbbb6; }
.qr-tools { margin-top: 1rem; }
.qr-result { display: grid; flex-basis: 100%; gap: .5rem; justify-items: start; }
canvas { width: 180px; height: 180px; image-rendering: pixelated; }
footer { padding: 2.2rem 0; font-size: .85rem; }
@media (max-width: 780px) {
  .landing, .split, .dashboard { grid-template-columns: 1fr; }
  .tabs { flex-direction: row; flex-wrap: wrap; }
}
