:root {
  color-scheme: light;
  font: 16px/1.45 "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #203f34;
  background: #fbf6ea;
  --paper: #fbf6ea;
  --surface: #fffdf5;
  --pine: #203f34;
  --muted: #5b675b;
  --berry: #993e38;
  --border: #d7d5c3;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; }
button, select, textarea { font: inherit; color: inherit; }
button, a, label.upload { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:where(button, select, textarea, input, a):focus-visible { outline: 3px solid #a44b35; outline-offset: 3px; }
h1, h2, p, figure { margin: 0; }
h1, h2, .brand { font-family: var(--serif); }
h1 { font-weight: 500; font-size: clamp(34px, 8.4vw, 54px); line-height: 1.04; letter-spacing: -.042em; text-wrap: balance; }
h1 em { display: block; color: var(--berry); font-weight: 400; }
h1:focus { outline: none; }
h2 { font-size: 23px; line-height: 1.2; font-weight: 600; letter-spacing: -.025em; }
.shell { max-width: 980px; margin: auto; padding: max(8px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.masthead { display: flex; align-items: center; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 25px; font-weight: 700; letter-spacing: -.045em; }
.mark { width: 40px; height: 40px; object-fit: contain; }
#motion { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; }
#motion span { display: grid; place-items: center; border: 1px solid #abbba9; border-radius: 50%; width: 32px; height: 32px; background: #edf0e4; color: #395a46; font: 20px/1 var(--serif); position: relative; }
#motion[aria-pressed=false] span { background: transparent; color: #627061; }
#motion[aria-pressed=false] span::after { content: ''; position: absolute; height: 1px; width: 24px; background: currentColor; transform: rotate(-45deg); }
.progress { display: flex; align-items: center; list-style: none; padding: 0; margin: 9px 0 13px; gap: 8px; }
.progress li { display: flex; align-items: center; gap: 8px; }
.progress li + li::before { content: ''; width: 14px; height: 1px; background: #b8beac; }
.progress button { min-height: 38px; border: 0; background: transparent; padding: 0 2px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.progress button::before { content: ''; width: 6px; height: 6px; border: 1px solid #aab5a5; border-radius: 50%; }
.progress button[aria-current] { color: var(--berry); font-weight: 700; }
.progress button[aria-current]::before { background: var(--berry); border-color: var(--berry); }
.progress .done::before { background: #62816b; border-color: #62816b; }
.intro { font-size: 15px; line-height: 1.45; color: var(--muted); margin: 9px 0 17px; }
.workshop { display: grid; grid-template-areas: "heading" "art" "picker" "actions"; }
.workshop-heading { grid-area: heading; }
.showcase {
  grid-area: art; position: relative; isolation: isolate; justify-self: center; align-self: center;
  width: min(100%, clamp(180px, 28vh, 260px)); width: min(100%, clamp(180px, 28svh, 260px));
  aspect-ratio: 2 / 3; margin: 0 0 17px;
}
.showcase::before { content: ''; position: absolute; inset: 4px -1px -1px 1px; transform: rotate(2.2deg); background: #e7dfc7; border: 1px solid #cabea1; box-shadow: 1px 3px 5px #473e2b18; z-index: -1; }
.postcard { overflow: hidden; position: relative; background: #fffdf4; outline: 1px solid #d5c8af; box-shadow: 0 4px 13px #38321b24; }
.postcard img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: contain; }
.postcard .snow { bottom: 15%; }
.style-picker { grid-area: picker; min-width: 0; }
.style-picker h2 { margin-bottom: 9px; }
.style-actions { grid-area: actions; }
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.style { min-width: 0; min-height: 43px; position: relative; display: flex; align-items: center; gap: 7px; padding: 5px 8px 5px 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; text-align: left; }
.style img { width: 32px; height: 32px; flex: none; border-radius: 4px; object-fit: cover; }
.style-name { min-width: 0; font-size: clamp(12px, 3.5vw, 15px); font-weight: 600; line-height: 1.15; overflow-wrap: break-word; }
.style[aria-checked=true] { background: #e7eddf; border-color: #436b53; box-shadow: inset 0 0 0 1px #436b53; }
.tick { display: none; margin-left: auto; color: #31583e; font-size: 12px; }
.style[aria-checked=true] .tick { display: block; }
.primary, .secondary { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 49px; padding: 11px 14px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; line-height: 1.35; }
.primary { background: var(--berry); color: #fffaf1; box-shadow: 0 2px 3px #67312418; }
.primary:disabled { background: #e4dece; color: #686352; box-shadow: none; }
.secondary { background: var(--surface); border-color: #abb9a7; }
.next, .actions { margin-top: 15px; }
.primary span { font-size: 20px; line-height: 1; }
.under-action { color: var(--muted); text-align: center; font-size: 13px; margin: 7px 0 0; }
.text-button { min-height: 44px; border: 0; background: transparent; padding: 5px 3px; color: #405f4d; font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: #a9b6a3; text-underline-offset: 3px; }
.text-button:disabled { opacity: .55; }
.footer { margin-top: 9px; text-align: center; }
.footer button { color: #667061; font-size: 12px; font-weight: 500; }
[data-screen="1"], [data-screen="2"] { max-width: 540px; margin-inline: auto; }
.chosen-style { display: flex; align-items: center; gap: 9px; margin: 0 0 15px; padding: 4px 10px 4px 4px; min-height: 44px; background: #eeefe3; border: 1px solid #cbd3bd; border-radius: 24px; font-size: 13px; font-weight: 650; }
.chosen-style img { width: 33px; height: 33px; border-radius: 50%; object-fit: cover; }
button.chosen-style::after { content: '›'; font-size: 19px; padding-inline: 2px; font-weight: 400; }
.upload { position: relative; cursor: pointer; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 150px; border: 1.5px dashed #8f9f82; border-radius: 12px; background: #f1f2e6; }
.upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload:focus-within { outline: 3px solid #a44b35; outline-offset: 2px; }
.upload-icon { display: grid; place-items: center; width: 38px; height: 38px; color: #35573e; background: #dee6d2; border-radius: 50%; font-size: 25px; margin-bottom: 3px; }
.upload small, .photo-note, .input-meta { font-size: 12px; color: var(--muted); }
.photo-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 8px; min-height: 37px; }
.photo-note .text-button { font-size: 12px; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.photo { position: relative; width: calc((100% - 16px) / 3); }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 1.3; object-fit: cover; border-radius: 7px; }
.photo button { position: absolute; top: 0; right: 0; width: 40px; height: 40px; padding: 0; border: 0; background: radial-gradient(circle, #294b3e 12px, #fff9e9 13px, transparent 14px); color: white; font-size: 18px; }
.photos:not([hidden]) + .upload { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.photos:not([hidden]) + .upload .upload-icon, .photos:not([hidden]) + .upload small { display: none; }
.caption-field { margin-top: 12px; }
.field-label, .caption-field > span { display: block; margin: 12px 0 5px; font-size: 13px; font-weight: 650; }
#edit-caption { width: 100%; min-height: 45px; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-family: var(--serif); font-size: 18px; font-style: italic; }
#caption-value { overflow-wrap: anywhere; }
.status, #caption-error { font-size: 13px; color: #8b3333; }
.status { margin-top: 5px; }
.status:empty { display: none; }
.result { position: relative; overflow: hidden; display: grid; place-items: center; padding: 17px; border: 1px solid #c0c8ac; background: radial-gradient(ellipse at 35% 4%, #4e6b53, #284739 86%); border-radius: 12px; }
#card, .magic { width: min(100%, clamp(160px, calc((100dvh - 365px) * .66), 300px)); aspect-ratio: 2 / 3; }
#card { display: block; height: auto; box-shadow: 0 6px 12px #12201852; }
.result-actions { text-align: center; }
.result-actions .secondary { margin-top: 10px; }
.result.working { background: radial-gradient(ellipse at center, #a16541, #763a34 77%); }
.magic { display: grid; place-items: center; }
.magic-seal { isolation: isolate; position: relative; display: grid; place-items: center; width: min(75%,145px); aspect-ratio: 1; border: 1px solid #ebbf77; border-radius: 50%; outline: 1px dashed #e9b576; outline-offset: 5px; background: #fff0d1; }
.magic-seal img { width: 85%; height: auto; animation: affix-seal 1.6s ease-in-out infinite alternate; }
.magic-seal i { position: absolute; left: 50%; top: 50%; font: 23px/1 var(--serif); color: #ffe3a8; animation: stardust 1.3s ease-out infinite; }
.magic-seal i:nth-of-type(1) { --x: -75px; --y: -55px; }.magic-seal i:nth-of-type(2) { --x: 69px; --y: -64px; animation-delay: -.35s; }.magic-seal i:nth-of-type(3) { --x: 80px; --y: 25px; animation-delay: -.7s; }.magic-seal i:nth-of-type(4) { --x: -70px; --y: 40px; animation-delay: -.9s; }
@keyframes affix-seal { from { transform: rotate(-4deg) translateY(-2px); } to { transform: rotate(3deg) translateY(2px); } }
@keyframes stardust { from { opacity: 0; transform: scale(.2); } 35% { opacity: 1; } to { opacity: 0; transform: translate(var(--x),var(--y)) scale(.8); } }
.snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.snow i { position: absolute; top: -6px; left: var(--left); width: var(--size, 3px); height: var(--size, 3px); background: #fffae9; border-radius: 50%; box-shadow: 0 0 2px #fff8dc; animation: snowfall var(--time, 6s) linear var(--delay, -2s) infinite; }
.snow i:nth-child(1) { --left: 9%; --delay: -5s; }.snow i:nth-child(2) { --left: 21%; --size: 2px; --time: 7s; }.snow i:nth-child(3) { --left: 34%; --delay: -1s; }.snow i:nth-child(4) { --left: 45%; --size: 4px; --time: 8s; --delay: -5s; }.snow i:nth-child(5) { --left: 58%; --delay: -4s; }.snow i:nth-child(6) { --left: 70%; --size: 2px; --time: 5s; }.snow i:nth-child(7) { --left: 84%; --delay: -.5s; }.snow i:nth-child(8) { --left: 94%; --size: 4px; --delay: -3s; }
@keyframes snowfall { 0% { opacity: 0; transform: translate(0,0); } 15%, 75% { opacity: .82; } 100% { opacity: 0; transform: translate(-24px, min(48vh, 405px)); } }
.still .snow, .still .magic-seal i { display: none; }.still .magic-seal img { animation: none; }
dialog { width: min(100%, 460px); max-width: 100%; max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; margin: auto auto 0; padding: 21px 20px max(15px, env(safe-area-inset-bottom)); background: var(--surface); border: 1px solid #d2c6ac; color: var(--pine); border-radius: 18px 18px 0 0; box-shadow: 0 12px 55px #17362838; }
dialog::backdrop { background: #1d352b69; }
dialog p { font-size: 14px; line-height: 1.48; margin: 9px 0; color: #425244; }
dialog h2 { font-size: 25px; }
.sheet-heading, .legal-heading { display: flex; align-items: center; gap: 10px; }
.legal-heading { justify-content: space-between; }
.sheet-heading img { object-fit: contain; }
.drag-hint { width: 33px; height: 3px; border-radius: 3px; background: #cdcebd; margin: -10px auto 13px; }
.permissions { border: 0; padding: 0; margin: 6px 0 0; min-width: 0; }
.permission { display: grid; grid-template-columns: 21px 1fr; padding: 8px 0; gap: 10px; align-items: start; cursor: pointer; font-size: 14px; line-height: 1.35; }
.permission input { margin: 1px 0 0; width: 19px; height: 19px; accent-color: #31573c; }
.legal-links { display: flex; gap: 14px; flex-wrap: wrap; }
.legal-links .text-button { font-size: 13px; }
.sheet-actions { text-align: center; margin-top: 8px; }
.sheet-actions .text-button { margin-inline: 3px; }
.danger { color: var(--berry); }
#personal-restore { display: block; margin: auto; }
#send-photo .chosen-style { margin-top: 14px; }
#caption-sheet :where(select, textarea) { display: block; width: 100%; padding: 10px 12px; min-height: 44px; border: 1px solid #aaaF9e; border-radius: 8px; background: #fffef8; }
#caption-sheet textarea { resize: vertical; }
#preview-file-image { display: block; width: auto; max-width: 100%; height: min(39vh, 310px); object-fit: contain; margin: 10px auto; box-shadow: 0 3px 8px #302b211a; }
#preview-download { text-decoration: none; }
#suggest-caption { font-size: 13px; }
.input-meta { display: flex; justify-content: space-between; gap: 8px; padding-top: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (hover: hover) { .primary:hover:not(:disabled) { background: #80302e; }.style:hover, .secondary:hover, .upload:hover { border-color: #64836b; } }
@media (max-width: 360px) { .shell { padding-inline: max(14px, env(safe-area-inset-left)); }.style { gap: 5px; }.style img { width: 26px; height: 30px; }.style-name { font-size: 12px; } }
@media (min-width: 560px) { .shell { padding-inline: 36px; }.workshop { max-width: 500px; margin: auto; }dialog { margin: auto; border-radius: 16px; }.progress { margin-bottom: 20px; } }
@media (max-width: 779px) and (max-height: 800px), (max-width: 359px) {
  .workshop { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "heading heading" "art picker" "actions actions"; column-gap: 13px; }
  main:has(.workshop:not([hidden])) .progress { margin-block: 3px 5px; }
  .workshop-heading h1 { font-size: clamp(27px, 7.4vw, 36px); }
  .workshop-heading .intro { font-size: 14px; margin: 6px 0 12px; }
  .showcase { width: min(100%, 195px); margin: 0; }
  .style-picker { align-self: center; }
  .style-picker h2 { font-size: 19px; }
  .style-grid { grid-template-columns: 1fr; gap: 5px; }
  .style { min-height: 42px; gap: 5px; }
  .style img { width: 26px; height: 30px; }
  .style-name { font-size: 12px; }
  .style-actions .next { margin-top: 12px; }
}
@media (min-width: 780px) {
  .shell { padding-top: 20px; }.masthead { padding-bottom: 12px; }.brand { font-size: 28px; }.mark { width: 46px; height: 46px; }
  .progress { margin-block: 14px 28px; }
  .workshop { max-width: none; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-areas: "heading art" "picker art" "actions art"; align-content: center; align-items: start; column-gap: clamp(38px, 5vw, 76px); padding-block: 18px; }
  .workshop-heading { align-self: end; }.workshop-heading .intro { margin: 14px 0 25px; }.showcase { width: min(100%, clamp(220px, 43vh, 335px)); margin: 0; }
  .footer { margin-top: 21px; }.style { min-height: 49px; }.style img { width: 36px; height: 36px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .shell:has(.workshop:not([hidden])) { padding-top: max(3px, env(safe-area-inset-top)); }
  main:has(.workshop:not([hidden])) .progress { margin-block: 0 4px; }
  .workshop { max-width: 760px; margin: auto; padding: 0; column-gap: 18px; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); grid-template-areas: "heading art" "picker art" "actions art"; }
  .workshop-heading h1 { font-size: 27px; }
  .workshop-heading h1 em { display: inline; }
  .workshop-heading .intro { margin: 3px 0 7px; font-size: 13px; }
  .showcase { width: min(100%, 42vh); margin: 0; }
  .style-picker h2 { margin-bottom: 4px; font-size: 18px; }
  .style-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
  .style { min-height: 38px; padding-block: 2px; }
  .style img { width: 28px; height: 28px; }
  .style-actions .next { margin-top: 7px; min-height: 44px; }
}
