:root {
  color-scheme: light;
  --ground: #f9f4e8;
  --surface: #fffcf6;
  --ink: #331e19;
  --quiet: #6b5349;
  --wine: #8d2924;
  --deep-wine: #6d1d1b;
  --soft-red: #f3e5db;
  --line: #e3d3c3;
  --spruce: #204c3e;
  --dark-spruce: #15382e;
  --focus: #3c6b55;
  --focus-halo: #3c6b552b;
  --serif: Georgia, 'Times New Roman', serif;
  font: 16px/1.5 system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: var(--ground); color: var(--ink); }
.editor-page { background: radial-gradient(ellipse at 8% 7%, #fffaf0, transparent 56%), var(--ground); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
button, input, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(1120px, calc(100% - 88px)); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar .shell { min-height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font: bold 1.33rem/1 var(--serif); }
.brand-mark { display: block; flex: 0 0 36px; width: 36px; height: 36px; }
.jump { color: var(--wine); font-size: .9rem; font-weight: 720; text-underline-offset: .24em; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .92fr); gap: clamp(32px, 6vw, 88px); align-items: start; padding-block: 35px 53px; }
.intro { padding-top: 21px; }
.year-label { color: var(--wine); font-size: .87rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; }
.editor-page .year-label { color: var(--spruce); }
.editor-page .year-label::before { content: ''; display: inline-block; width: .9em; height: 1px; margin-right: .55em; vertical-align: .28em; background: #ad7549; }
h1 { font: bold clamp(3.35rem, 6.7vw, 6.15rem)/.87 var(--serif); letter-spacing: -.075em; margin: 0; }
h1 span { color: var(--wine); display: block; }
.lede { max-width: 39ch; margin: 19px 0 26px; font-size: 1.04rem; color: var(--quiet); }
.editor { padding-top: 17px; border-top: 1px solid var(--line); }
.name-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.name-line label, .column-labels { font-size: .9rem; font-weight: 730; }
.name-line input { width: min(60%, 270px); }
.field { width: 100%; min-width: 0; height: 46px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); padding: 8px 11px; caret-color: var(--spruce); }
.field::placeholder { color: #806b61; opacity: 1; }
.field:not(:focus):hover { border-color: #bda795; }
.field:focus { outline: 0 solid transparent; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-halo); }
.field::selection { color: var(--dark-spruce); background: #d7e7d8; }
.examples-row { min-height: 38px; display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--quiet); font-size: .85rem; }
.plain-button { min-height: 44px; margin: 0; padding: 5px 0; border: 0; color: var(--wine); background: none; text-decoration: underline; text-underline-offset: .23em; font-weight: 700; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 64px 44px; gap: 7px; align-items: center; }
.column-labels { margin: 4px 0 7px; color: var(--quiet); }
.column-labels span:nth-child(2) { text-align: center; }
.row + .row { margin-top: 7px; }
.quantity { text-align: center; padding-inline: 5px; }
.remove { position: relative; width: 44px; height: 44px; border: 0; padding: 0; background: transparent; color: var(--quiet); border-radius: 8px; }
.remove::before, .remove::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 14px; height: 2px;
  border-radius: 1px; background: currentColor;
}
.remove::before { transform: translate(-50%, -50%) rotate(45deg); }
.remove::after { transform: translate(-50%, -50%) rotate(-45deg); }
.remove:hover { color: var(--wine); background: var(--soft-red); }
.editor-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.wish-line { margin-top: 16px; padding: 11px 12px 12px; border: 1px solid #d5dac8; border-radius: 9px; background: #eef0e5; }
.wish-line label { display: block; margin-bottom: 5px; font-size: .9rem; font-weight: 760; color: var(--dark-spruce); }
.wish-line input:not(:focus):not(:hover) { border-color: #d3d9c9; }
.small-button { min-height: 44px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 12px; font-size: .91rem; font-weight: 720; color: var(--wine); background: transparent; }
.small-button:hover:not(:disabled) { background: var(--soft-red); border-color: #d3b4a2; }
.preview { margin: 0; min-width: 0; scroll-margin-top: 12px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px; }
.preview-bar h2 { margin: 0; font-size: .9rem; font-weight: 740; }
.editor-page .preview-bar h2 { color: var(--dark-spruce); }
.formats { border: 1px solid var(--line); border-radius: 8px; display: inline-flex; gap: 2px; padding: 3px; background: #f2e8dc; }
.formats label { position: relative; cursor: pointer; }
.formats input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.formats label > span { min-height: 40px; display: grid; place-items: center; padding: 3px 13px; border-radius: 5px; font-size: .88rem; font-weight: 720; color: var(--quiet); }
.formats input:checked + span { background: var(--surface); color: var(--spruce); box-shadow: 0 1px 3px #491d171c; }
.formats input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.stage { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--dark-spruce); box-shadow: 0 8px 24px #47351b19; }
#receipt { display: block; width: 100%; height: auto; }
.stage[data-format='stories'] #receipt { width: 70.3125%; box-shadow: 0 0 28px #051c17a0; }
.export-actions { display: flex; gap: 8px; margin-top: 10px; }
.action { min-height: 49px; border: 1px solid var(--wine); border-radius: 7px; padding: 9px 14px; font-weight: 750; }
.primary { flex: 1; background: var(--wine); color: #fff9ee; }
.primary:hover:not(:disabled) { background: var(--deep-wine); }
.editor-page .primary { background: var(--spruce); border-color: var(--spruce); }
.editor-page .primary:hover:not(:disabled) { background: var(--dark-spruce); }
.secondary { background: transparent; color: var(--wine); }
.secondary:hover:not(:disabled) { background: var(--soft-red); }
.privacy, .status { margin: 8px 0 0; color: var(--quiet); font-size: .88rem; }
.status:empty { margin: 0; }
.screen-reader { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
dialog { width: min(100% - 28px, 465px); max-height: calc(100% - 28px); overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 21px; background: var(--surface); color: var(--ink); box-shadow: 0 14px 60px #32151038; }
dialog::backdrop { background: #2a170fa8; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-head h2 { margin: 0; font: bold 1.8rem/1.05 var(--serif); letter-spacing: -.04em; }
.share-guide { color: var(--quiet); margin: 7px 0 16px; }
.share-buttons { display: flex; flex-direction: column; gap: 7px; }
.caption-label { display: block; margin-top: 16px; margin-bottom: 6px; font-size: .9rem; font-weight: 720; }
.caption { display: block; height: auto; min-height: 76px; resize: vertical; font-size: .88rem; overflow-wrap: anywhere; }
#copy-caption { margin-top: 6px; }
@media (max-width: 850px) {
  .shell { width: calc(100% - 48px); }
  .layout { gap: 26px; grid-template-columns: minmax(0, 1fr) minmax(292px, .95fr); }
  h1 { font-size: clamp(3.1rem, 7.8vw, 4.5rem); }
}
@media (max-width: 670px) {
  .shell { width: min(480px, calc(100% - 36px)); }
  .topbar .shell { min-height: 60px; }
  .layout { display: block; padding-block: 23px 34px; }
  .intro { padding-top: 0; }
  h1 { font-size: clamp(3.25rem, 12.8vw, 5.2rem); }
  .lede { margin-block: 14px 19px; }
  .preview { margin-top: 25px; }
  .stage[data-format='stories'] { aspect-ratio: 9 / 16; }
  .stage[data-format='stories'] #receipt { width: 100%; }
  .columns { grid-template-columns: minmax(0, 1fr) 58px 44px; gap: 5px; }
}
@media (max-width: 350px) {
  .examples-row { align-items: flex-start; flex-direction: column; gap: 0; }
  .name-line { display: block; }
  .name-line input { width: 100%; margin-top: 5px; }
  .export-actions { flex-wrap: wrap; }
}
.top-links { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 21px; }
.top-links .jump { display: inline-flex; align-items: center; min-height: 44px; }
.top-links .preview-jump { color: var(--dark-spruce); }
.top-links .donate-jump { text-decoration: none; border: 1px solid var(--line); border-radius: 7px; padding-inline: 12px; }
.top-links .donate-jump:hover { background: var(--soft-red); }
.top-links .tree-jump { color: var(--dark-spruce); }
.hang-button { width: 100%; margin-top: 8px; border-color: var(--dark-spruce); color: var(--dark-spruce); background: #e8eee1; }
.hang-button:hover:not(:disabled) { background: #dce8d4; }
.published-link { display: inline-flex; align-items: center; text-decoration: none; }
@media (max-width: 550px) {
  .has-tree .preview-jump { display: none; }
}
@media (max-width: 470px) {
  .topbar .shell { gap: 9px; }
  .top-links { gap: 3px 11px; }
  .top-links .donate-jump { padding-inline: 8px; }
  .brand { white-space: nowrap; font-size: 1.14rem; gap: 6px; }
  .brand-mark { flex-basis: 31px; width: 31px; height: 31px; }
}
@media (forced-colors: active) {
  .field:focus { outline: 2px solid Highlight; box-shadow: none; }
  .remove::before, .remove::after { forced-color-adjust: none; background: ButtonText; }
}
