:root {
  color-scheme: light;
  --ground: #fbfaf8;
  --ink: #28241f;
  --muted: #746f67;
  --line: #e3dfd9;
  --paper-texture: none;
  --serif: Georgia, 'Songti SC', 'STSong', 'SimSun', serif;
  --sans: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font: 16px var(--sans);
  color: var(--ink);
  background: var(--ground);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid #86683b;
  outline-offset: 4px;
}
button {
  border: 0;
  background: none;
}
button svg,
i[data-icon] svg,
.ico svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
h1,
h2,
h3,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
.gallery,
#studio,
#pack,
.recipient {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 410px;
  overflow: hidden;
  background: var(--ground);
}
.gallery-head,
.work-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gallery-head {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  padding: clamp(16px, 2.7vw, 38px);
  pointer-events: none;
}
.gallery-head > * {
  pointer-events: auto;
}
.wordmark {
  display: flex;
  gap: 10px;
  align-items: center;
  font:
    italic 500 clamp(30px, 3.1vw, 45px) / 1 'Baskerville',
    'Palatino Linotype',
    Georgia,
    serif;
  letter-spacing: -0.085em;
  color: #322b25;
}
.wordmark small {
  font: 500 0.86rem var(--serif);
  letter-spacing: 0.12em;
  align-self: flex-end;
  margin-bottom: 4px;
}
.brand-fold {
  position: relative;
  width: 28px;
  height: 32px;
  transform: rotate(-7deg);
  filter: drop-shadow(1px 2px 1px #59473824);
}
.brand-fold:before,
.brand-fold i {
  content: '';
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 55%;
  background: linear-gradient(90deg, #c4b690, #e5dbb6);
  border: 1px solid #a48b58;
}
.brand-fold:before {
  left: 0;
  transform: skewY(12deg);
  background: linear-gradient(135deg, #c4cab4, #758e7b);
}
.brand-fold i {
  right: 0;
  transform: skewY(-15deg);
  background:
    radial-gradient(ellipse at 50% 45%, #e9cc86 0 13%, transparent 15%),
    linear-gradient(140deg, #b16c59, #8f3b2d);
  box-shadow: inset 0 0 0 2px #ecdabe;
}
.quiet,
.back,
.primary,
.secondary,
.icon-btn,
.tool,
.choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.quiet,
.back {
  padding: 8px 10px;
  color: #666057;
  font-size: 0.89rem;
}
.quiet:hover,
.back:hover,
.icon-btn:hover {
  background: #ebe7e07d;
  border-radius: 8px;
}
.primary,
.secondary {
  border-radius: 9px;
  min-height: 40px;
  padding: 9px 16px;
  font-size: 0.91rem;
  font-weight: 550;
  white-space: nowrap;
}
.primary {
  background: #28251f;
  color: white;
}
.primary:hover {
  background: #494137;
}
.secondary {
  border: 1px solid var(--line);
  background: #fffdf9;
}
.icon-btn {
  width: 39px;
  height: 39px;
  border-radius: 8px;
}
.fan-area {
  position: absolute;
  inset: 0 0 11svh;
  display: grid;
  place-items: center;
  perspective: 1300px;
  touch-action: pan-y;
}
.fan {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  isolation: isolate;
  --card-w: min(25vw, 34.2svh, 365px);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}
.fan.dragging,
.fan.dragging .fan-item {
  cursor: grabbing;
}
.fan-help {
  position: absolute;
  bottom: max(12px, calc(97px - 11svh));
  left: 0;
  right: 0;
  pointer-events: none;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}
.fan-area.focused .fan-help {
  visibility: hidden;
}
#gallery-recipient {
  display: block;
  margin: 0 auto 4px;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 1rem var(--serif);
  color: var(--ink);
}
.fan-item {
  --lean-x: 0deg;
  --lean-y: 0deg;
  --glint: 51%;
  position: absolute;
  width: var(--card-w);
  aspect-ratio: 5/7;
  padding: 0;
  transform: translate(var(--fx), var(--fy)) perspective(1200px) rotateZ(var(--roll)) rotateY(var(--yaw))
    rotateX(var(--pitch)) scale(var(--scale));
  opacity: var(--visibility, 1);
  filter: brightness(var(--shade, 1));
  cursor: grab;
  z-index: var(--order);
  border-radius: 1px;
  background: #e9e1ce;
  isolation: isolate;
}
.fan-item:focus-visible {
  outline-offset: 7px;
}
.fan-face {
  position: absolute;
  inset: 0;
  transform: perspective(900px) rotateX(var(--lean-x)) rotateY(var(--lean-y));
  transition: transform 0.24s ease-out;
  box-shadow:
    1px 1px 0 #c7bdab,
    2px 2px 0 #e3dac9,
    3px 3px 0 #c9c1b0,
    -1px 2px 3px #4a403522,
    var(--cast-x, -3px) var(--cast-y, 7px) 12px -7px #59463254;
}
.cover-face {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #efe9dc;
  border-radius: 1px;
}
.cover-face:before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: var(--paper-texture);
  background-size: 155px 155px;
  opacity: 0.16;
  mix-blend-mode: multiply;
}
.cover-art,
.foil,
.spine {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cover-art {
  display: block;
  object-fit: cover;
}
.foil {
  opacity: 0.84;
  z-index: 3;
  background: linear-gradient(
    112deg,
    #73511f 4%,
    #aa8045 28%,
    #d6aa58 36%,
    #fff4ba 46%,
    #fffceb 49%,
    #d3a452 55%,
    #785827 70%,
    #c9a366 82%
  );
  background-size: 260% 145%;
  background-position: var(--glint, 51%) 50%;
  mask-image: linear-gradient(transparent, transparent);
  -webkit-mask-image: linear-gradient(transparent, transparent);
  mix-blend-mode: hard-light;
}
.spine {
  z-index: 4;
  background: linear-gradient(
    90deg,
    #675b472a,
    transparent 1%,
    #fff8e33d 1.6%,
    #7e6f5129 2.15%,
    transparent 2.7%,
    transparent 99.3%,
    #dbcdb14f
  );
  box-shadow: inset 0 0 0 1px #70604c1e;
}
.dock {
  position: absolute;
  z-index: 10;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 5px;
  transform: translateX(-50%);
  border: 1px solid #dedad49e;
  background: #fffffff0;
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 7px 8px;
  box-shadow: 0 5px 22px #39312810;
}
.thumbnails {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}
.thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 37px;
  height: 48px;
  border-radius: 7px;
  padding: 4px;
  opacity: 0.72;
}
.thumb img {
  height: 37px;
  width: 27px;
  object-fit: cover;
  border-radius: 1px;
  box-shadow: 1px 1px 2px #33281034;
}
.thumb[aria-pressed='true'] {
  background: #edeae4;
  opacity: 1;
}
.thumb[aria-pressed='true']:after {
  content: '';
  position: absolute;
  bottom: 1px;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: #484035;
}
.dock-rule {
  height: 25px;
  width: 1px;
  background: #dfdcd6;
  margin: 0 4px;
}
#exhibit {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  --book-width: min(35vw, 43.6svh, 460px);
}
.fan-area.focused #exhibit {
  opacity: 1;
  pointer-events: auto;
}
#exhibit .book-rig,
.recipient .book-rig {
  pointer-events: none;
}
#exhibit .book-object,
.recipient .book-object {
  pointer-events: auto;
}
.fan-area.focused .fan-item {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.book-mount {
  perspective: 1400px;
  display: grid;
  place-items: center;
  min-width: 0;
}
.book-rig {
  position: relative;
  width: var(--book-width, min(31vw, 48vh, 410px));
  aspect-ratio: 5/7;
  perspective: 1600px;
  transform: translateX(calc(var(--spread, 0) * var(--open-offset, 50%)));
  --stock: #f4edde;
  --fibres: 0.38;
  --writing: var(--serif);
}
.book-rig[data-stock='kraft'] {
  --stock: #d2b084;
  --fibres: 0.5;
}
.book-rig[data-stock='pearl'] {
  --stock: #efedec;
  --fibres: 0.25;
}
.book-rig[data-font='hand'] {
  --writing: 'Bradley Hand', 'KaiTi', 'STKaiti', 'Kaiti SC', 'Segoe Print', cursive;
}
.book-rig[data-font='sans'] {
  --writing: var(--sans);
}
.book-object {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--lean-x, 0deg)) rotateY(var(--lean-y, 0deg));
  transition: transform 0.4s;
}
.book-rig.is-open .book-object {
  transform: none;
}
.leaf,
.paper-page,
.leaf-front,
.leaf-back {
  position: absolute;
  inset: 0;
}
.leaf {
  z-index: 3;
  transform-style: preserve-3d;
  transform-origin: left center;
  transform: rotateY(var(--fold-angle, 0deg));
}
.leaf-front,
.leaf-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.leaf-front {
  z-index: 2;
  transform: translateZ(0.8px);
  box-shadow:
    2px 2px 0 #cdbfa6,
    3px 3px 0 #e1d9c9,
    4px 8px 12px #53422721;
}
.leaf-back {
  transform: rotateY(180deg) translateZ(0.8px);
}
.paper-page {
  background-color: var(--stock);
  box-shadow:
    0 2px 1px #8f816b45,
    1px 11px 19px -15px #654e328c;
  isolation: isolate;
  overflow: hidden;
}
.paper-page:before,
.envelope:before,
.pocket:after,
.flap:after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--paper-texture);
  background-size: 180px 180px;
  opacity: var(--fibres, 0.8);
  mix-blend-mode: multiply;
}
.right-page {
  background-image: linear-gradient(
    90deg,
    #5c49303f 0,
    transparent 4%,
    #fff4 7%,
    transparent 13%,
    #fff0 95%,
    #a3937d17
  );
  box-shadow:
    1px 0 #d9cfbd,
    2px 1px #fcf8ee,
    3px 2px #cbc0ae,
    3px 9px 24px -10px #3a281c42;
}
.leaf-back {
  background-image: linear-gradient(270deg, #73604942, transparent 5%, #fff4 11%, transparent 22%);
}
.leaf-back:after,
.right-page:after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(100deg, #372d24e0, #57443369 58%, #8e765319);
  opacity: calc(var(--fold-shadow, 0) * 0.45);
}
.right-page:after {
  opacity: calc(var(--fold-shadow, 0) * 0.126);
}
.book-rig[data-stock='pearl'] .paper-page {
  background-image: linear-gradient(107deg, #d9dfe357, #fff7f878 35%, #efe2ed50 63%, #e0eff557);
}
.endpaper {
  position: absolute;
  inset: 5%;
  border: 1px solid #8972462c;
}
.endpaper:after {
  content: '✧';
  position: absolute;
  bottom: -0.5em;
  left: 48%;
  padding: 0 0.4em;
  background: var(--stock);
  color: #9b875965;
  font: 14px var(--serif);
}
.letter-sheet {
  position: absolute;
  inset: 6%;
  background: linear-gradient(120deg, #fffcf4bf, #faf5e99c);
  box-shadow: 0 1px 2px #6c57321c;
}
.letter-text {
  position: absolute;
  inset: 8% 8% 7%;
  display: flex;
  flex-direction: column;
  gap: 4%;
  font-family: var(--writing);
  color: #423a31;
}
.line {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 4%;
  position: relative;
  font-size: clamp(12px, 1.5vw, 22px);
  font-family: inherit;
}
.line-message {
  flex: 1;
  min-height: 0;
}
.line-sender {
  align-self: stretch;
  justify-content: flex-end;
  margin-top: auto;
}
.letter-prefix {
  font:
    italic 0.9em Georgia,
    serif;
  opacity: 0.66;
  white-space: nowrap;
}
.ink {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: none;
  font: inherit;
  line-height: 1.65;
  letter-spacing: 0.035em;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.line-message .ink {
  resize: none;
  height: 100%;
  overflow: auto;
  scrollbar-width: thin;
}
.line-sender .ink {
  width: 60%;
  text-align: right;
}
.ink::placeholder {
  color: #8b837891;
}
.ink:focus {
  box-shadow: 0 1px #a491665e;
}
.placed-stamps {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.placed {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--slant));
  width: calc(19% * var(--stamp-scale, 1));
  aspect-ratio: 1;
  pointer-events: auto;
  touch-action: none;
  display: grid;
  place-items: center;
  padding: 0;
}
.placed img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(1px 2px 1px #624c3333);
}
button.placed {
  cursor: grab;
}
button.placed.moving {
  cursor: grabbing;
  z-index: 3;
}
.work-head {
  position: relative;
  z-index: 5;
  min-height: 56px;
  padding: 7px clamp(12px, 2.4vw, 35px);
  border-bottom: 1px solid var(--line);
  background: var(--ground);
}
.steps {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #948f87;
  font-size: 0.88rem;
}
.steps strong,
#step-write {
  font-weight: 650;
  color: var(--ink);
}
.steps svg {
  width: 12px !important;
}
.work-head .primary {
  min-height: 35px;
  padding: 6px 13px;
}
.work-body {
  height: calc(100% - 56px);
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) clamp(210px, 22vw, 300px);
}
.tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 15px 6px;
  border-right: 1px solid var(--line);
  background: #fffdfa;
}
.tool {
  flex-direction: column;
  gap: 5px;
  min-width: 54px;
  min-height: 57px;
  font-size: 0.81rem;
  border-radius: 11px;
}
.tool[aria-pressed='true'] {
  background: var(--ink);
  color: white;
}
.desk {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 16px 0;
  container-type: inline-size;
}
.desk .book-rig {
  --book-width: min(44cqw, 48vh, 440px);
}
.options {
  border-left: 1px solid var(--line);
  background: #fffefd;
  padding: 21px 16px;
  overflow: auto;
}
.options h2 {
  font: 600 1rem var(--sans);
  margin-bottom: 8px;
}
.hint {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 3px 0 14px;
}
.choices {
  display: grid;
  gap: 8px;
}
.choices.covers,
.choices.stamps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.choice {
  background: #faf9f6;
  border: 1px solid #e7e3db;
  border-radius: 9px;
  min-height: 43px;
  padding: 8px;
  font-size: 0.84rem;
}
.choice[aria-pressed='true'] {
  outline: 1.5px solid #4d473c;
  outline-offset: -2px;
  background: #f3f0e8;
}
.choice.cover,
.choice.sticker {
  flex-direction: column;
  gap: 7px;
}
.choice.cover img {
  width: 65%;
  aspect-ratio: 5/7;
  object-fit: cover;
  box-shadow: 1px 2px 3px #493b2a30;
}
.choice.sticker img {
  width: 53px;
  height: 53px;
  object-fit: contain;
}
.chip-stock {
  width: 32px;
  height: 29px;
  border-radius: 3px;
  background-image: var(--paper-texture);
  background-size: 140px;
  box-shadow: 1px 1px 2px #5e4b333b;
}
.paper-cotton {
  background-color: #f3edde;
}
.paper-kraft {
  background-color: #d4b48b;
}
.paper-pearl {
  background-color: #efedf0;
}
.options .danger {
  margin-top: 17px;
}
.options .section-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 20px 0 7px;
}
#pack,
.recipient {
  background: radial-gradient(ellipse at 50% 43%, #fffdfa 0, #f9f7f3 80%);
}
.mail-stage {
  height: calc(100% - 56px);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  perspective: 1200px;
  padding: 35px 20px 10px;
}
.mail-object {
  width: min(480px, 72vw, 65vh);
  aspect-ratio: 1.51;
  position: relative;
  perspective: 1000px;
  margin-bottom: 35px;
}
.envelope {
  position: absolute;
  inset: 0;
  background-color: #e6d8b7;
  box-shadow:
    1px 2px 2px #a78c5c47,
    0 20px 32px -18px #503a278c;
  isolation: isolate;
}
.insert {
  position: absolute;
  z-index: 1;
  left: 25%;
  top: 7%;
  width: 50%;
  aspect-ratio: 5/7;
  transform: translateY(4%);
  transition: transform 0.9s ease;
  box-shadow: 1px 2px 5px #533e2829;
}
.pocket,
.flap {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pocket {
  z-index: 2;
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  background: conic-gradient(
    from 233deg at 50% 58%,
    #ecddbe 0deg,
    #e8d9ba 76deg,
    #e0ceab 78deg,
    #eee4ca 157deg,
    #dac7a2 159deg,
    #efe2c5 246deg,
    #e3d1ad 249deg,
    #eddfbf 360deg
  );
}
.flap {
  z-index: 3;
  clip-path: polygon(0 0, 100% 0, 100% 2%, 53% 62%, 50% 64%, 47% 62%, 0 2%);
  transform-origin: 50% 0;
  background: linear-gradient(164deg, #fbefd4, #e0d0ad 60%, #aa90675e);
  transition: transform 0.9s cubic-bezier(0.35, 0.15, 0.15, 1);
  backface-visibility: visible;
}
.wax {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 58%;
  width: 21%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition:
    opacity 0.35s,
    transform 0.4s;
  isolation: isolate;
}
.wax img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(1px 3px 2px #77402855);
  pointer-events: none;
}
.wax.hold:after {
  content: '';
  position: absolute;
  inset: -5%;
  border-radius: 50%;
  border: 2px solid #a3874b;
  animation: sealPulse 0.85s ease both;
}
.wax.hold {
  transform: translate(-50%, -50%) scale(0.91);
}
@keyframes sealPulse {
  from {
    clip-path: inset(0 0 100% 0);
    opacity: 0.3;
  }
  to {
    clip-path: inset(0);
    opacity: 1;
  }
}
.sealed .wax {
  transform: translate(-50%, -50%) rotate(-6deg);
}
.recipient-open .flap {
  transform: rotateX(178deg);
  z-index: 0;
}
.recipient-open .wax {
  opacity: 0;
  transform: translate(-45%, -75%) rotate(14deg);
}
.recipient-open .insert {
  transform: translateY(-59%);
}
.mail-caption {
  font: 500 clamp(16px, 2.1vw, 22px) var(--serif);
  color: #51473b;
  text-align: center;
}
.mail-actions {
  min-height: 50px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mail-actions button {
  font-size: 0.86rem;
}
.recipient .mail-stage {
  height: 100%;
}
.recipient .book-mount {
  position: absolute;
  inset: 35px 0 75px;
  --book-width: min(35vw, 46vh, 400px);
}
.reading-actions {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
}
.reading-actions .secondary:empty {
  display: none;
}
dialog {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffdf9;
  color: var(--ink);
  width: min(430px, 92vw);
  max-height: 75vh;
  box-shadow: 0 20px 80px #29211830;
}
dialog::backdrop {
  background: #332a223d;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
}
.dialog-head h2 {
  font: 600 1.35rem var(--serif);
}
.saved-item {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  text-align: left;
  padding: 9px;
  border-top: 1px solid var(--line);
}
.saved-item img {
  width: 31px;
  height: 43px;
  object-fit: cover;
}
.saved-item span {
  display: grid;
  gap: 3px;
}
.saved-item small,
.empty {
  color: var(--muted);
  font-size: 0.83rem;
}
.empty {
  padding: 12px 0;
}
#notice {
  position: fixed;
  z-index: 50;
  bottom: 95px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 92vw;
  width: max-content;
  padding: 10px 15px;
  border-radius: 8px;
  background: #302a23;
  color: white;
  pointer-events: none;
  font-size: 0.86rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}
#notice.on {
  opacity: 1;
}
@media (max-width: 740px) {
  .gallery-head {
    padding: 17px 15px;
  }
  .quiet {
    font-size: 0.82rem;
    gap: 5px;
  }
  .fan {
    --card-w: min(39vw, 33vh);
  }
  .fan-area {
    inset: 64px 0 82px;
  }
  .dock {
    gap: 3px;
    padding: 5px 6px;
  }
  .thumb {
    width: 32px;
    height: 42px;
  }
  .thumb img {
    height: 33px;
    width: 24px;
  }
  .dock .primary {
    padding: 8px 11px;
  }
  .work-head {
    min-height: 48px;
  }
  .work-body {
    height: calc(100% - 48px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
  }
  .tools {
    grid-row: 2;
    flex-direction: row;
    justify-content: center;
    border: 0;
    border-top: 1px solid var(--line);
    gap: 5px;
    padding: 4px;
  }
  .tool {
    min-width: 48px;
    min-height: 42px;
    gap: 2px;
    font-size: 0.75rem;
  }
  .tool svg {
    width: 16px;
  }
  .desk {
    grid-row: 1;
    padding: 12px 0;
    container-type: size;
  }
  .desk .book-rig {
    --book-width: min(44cqw, 58cqh);
  }
  .options {
    grid-row: 3;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 9px 13px max(10px, env(safe-area-inset-bottom));
    max-height: 24svh;
    min-height: 80px;
  }
  .options h2,
  .options .section-label {
    display: none;
  }
  .hint {
    font-size: 0.78rem;
    margin: 0 0 6px;
  }
  .choices,
  .choices.covers,
  .choices.stamps {
    display: flex;
    gap: 6px;
    overflow: auto;
  }
  .choice {
    padding: 5px 9px;
    min-height: 33px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .choice.cover,
  .choice.sticker {
    flex-direction: row;
  }
  .choice.cover img {
    height: 36px;
    width: 26px;
  }
  .choice.sticker img {
    height: 31px;
    width: 31px;
  }
  .options .danger {
    margin: 4px 0 0;
  }
  .options .choices + .choices {
    margin-top: 5px;
  }
  .line {
    font-size: clamp(12px, 2.85vw, 17px);
  }
  .desk .line-message {
    font-size: clamp(11px, 2.65vw, 16px);
  }
  .line-message .ink {
    line-height: 1.5;
  }
  .mail-stage {
    height: calc(100% - 48px);
  }
  #exhibit {
    --book-width: min(42vw, 37vh);
  }
  .recipient .book-mount {
    --book-width: min(44vw, 43vh);
  }
  .mail-object {
    width: min(79vw, 58vh);
  }
}
@media (max-width: 380px) {
  .dock {
    gap: 1px;
  }
  .thumb {
    width: 28px;
  }
  .wordmark small {
    display: none;
  }
  .steps {
    gap: 4px;
  }
  .tool {
    min-width: 44px;
  }
  .work-head {
    padding-inline: 5px;
  }
  .work-head .primary {
    padding: 5px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition: none !important;
  }
}
.fan-face.cover-face {
  position: absolute;
  inset: 0;
}
.insert {
  left: 29.5%;
  width: 41%;
  top: 6%;
}
#pack .mail-object:not(.sealed) .insert {
  animation: tuck-in 1.2s cubic-bezier(0.35, 0.06, 0.24, 1) both;
}
#pack .mail-object:not(.sealed) .flap {
  animation: fold-flap 1.45s cubic-bezier(0.3, 0.16, 0.2, 1) both;
}
#pack .mail-object:not(.sealed) .wax {
  animation: place-wax 1.4s ease both;
}
@keyframes tuck-in {
  0%,
  15% {
    transform: translateY(-64%) rotate(-4deg);
  }
  100% {
    transform: translateY(4%) rotate(0);
  }
}
@keyframes fold-flap {
  0%,
  43% {
    transform: rotateX(174deg);
    z-index: 0;
  }
  44% {
    z-index: 3;
  }
  100% {
    transform: rotateX(0);
  }
}
@keyframes place-wax {
  0%,
  72% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@media (max-width: 740px) and (orientation: portrait) {
  .desk {
    overflow: hidden;
  }
  .desk .book-rig {
    --open-offset: 10%;
    width: calc(var(--book-width) + (min(73cqw, 60cqh) - var(--book-width)) * var(--spread, 0));
  }
  .desk .line,
  .desk .line-message {
    font-size: clamp(13px, 3.8vw, 17px);
  }
}
.copy-field {
  position: fixed;
  z-index: 60;
  bottom: 12px;
  left: 10%;
  width: 80%;
  padding: 10px;
  border: 1px solid #8f806b;
}
.dock {
  max-width: calc(100vw - 18px);
}
.dock > .icon-btn,
.dock .primary,
.thumb {
  flex-shrink: 0;
}
.thumbnails {
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  min-width: 32px;
}
.inspect-hint {
  position: absolute;
  bottom: max(12px, calc(97px - 11svh));
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  pointer-events: none;
}
.inspectable {
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.inspectable.dragging {
  cursor: grabbing;
}
.inspectable:focus-visible {
  outline: 2px solid #a58e65;
  outline-offset: 7px;
}
.inspectable:not(.is-open) .book-object {
  transform: rotateX(calc(var(--pitch, 0deg) + var(--lean-x, 0deg)))
    rotateY(calc(var(--yaw, 0deg) + var(--lean-y, 0deg)));
  transition: transform 0.15s ease-out;
}
.inspectable.dragging .book-object {
  transition: none;
}
.inspectable.is-open {
  cursor: default;
}
.recipient .inspectable.is-open {
  cursor: pointer;
}
.back-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 0 0 12%;
  backface-visibility: hidden;
  transform: rotateY(180deg) translateZ(2.2px);
  border: 1px solid #c4b392;
  background-color: #e9dfcb;
  background-image: var(--paper-texture);
  background-size: 140px;
  color: #807353;
}
.back-cover:before {
  content: '';
  position: absolute;
  inset: 4.5%;
  border: 1px double #bfae87;
}
.back-mark {
  font:
    italic 1.25rem Georgia,
    serif;
}
.back-cover small {
  font-size: 0.65rem;
}
.right-page {
  backface-visibility: hidden;
}
.book-object:before,
.book-object:after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(to right, #dccdb1 0 1px, #faeddb 1px 2px);
  transform: rotateY(90deg);
  pointer-events: none;
}
.book-object:before {
  left: -1px;
}
.book-object:after {
  right: -1px;
}
.media-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  clip-path: inset(50%);
}
.media-button,
.personal-choice {
  width: 100%;
  margin: 0 0 0.6rem;
}
.personal-choice img {
  height: 2.3rem;
  width: 1.65rem;
  object-fit: cover;
}
.personal-choice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sides {
  display: flex;
  gap: 5px;
  margin: 0 0 0.65rem;
}
.sides .choice {
  flex: 1;
  min-height: 34px;
}
.drag-copy {
  position: fixed !important;
  z-index: 200;
  pointer-events: none;
}
.type-choices {
  grid-template-columns: 1fr 1fr;
}
.type-choice {
  font-size: 1.05rem;
}
.desk[data-tool='stamp'] .leaf-back {
  pointer-events: auto;
}
.desk[data-tool='stamp'] .placed {
  cursor: grab;
}
.desk[data-tool='stamp'] .placed[aria-pressed='true'] {
  outline: 1px dashed #907a56;
  outline-offset: 3px;
}
.stamp-size {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 12px;
  width: 100%;
  margin: 8px 0;
  font-size: 0.85rem;
}
.stamp-size output {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.stamp-size input {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  accent-color: #806a4a;
  cursor: pointer;
}
@media (max-width: 740px) and (orientation: portrait) {
  .desk[data-tool='stamp'][data-side='left'] .book-rig {
    --open-offset: 90%;
  }
  .options:has(.media-button) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
  }
  .options:has(.media-button) .hint {
    width: 100%;
  }
  .options .media-button,
  .options .personal-choice {
    width: auto;
    max-width: 100%;
    min-height: 32px;
    margin: 0;
  }
  .options .choices.covers {
    width: 100%;
  }
  .options:has(.sides) .sides {
    margin: 0 0 4px;
  }
  .inspect-hint {
    bottom: 10%;
  }
  .dock:not(:has(#exit-look[hidden])) .thumbnails {
    max-width: 37vw;
  }
}
.illustrated-type {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.1rem;
}
.illustrated-type > span {
  font: 0.76rem var(--sans);
  color: var(--muted);
}
.type-sample {
  display: block;
  width: 82px;
  height: 22px;
  background-image: url('../assets/atelier/fonts/samples.webp');
  background-size: 100% 400%;
  background-repeat: no-repeat;
}
.letter-audio {
  height: 36px;
  width: min(270px, 48vw);
}
.reading-actions:has(.letter-audio) {
  flex-wrap: wrap;
}
.frame-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 6px 0 14px;
}
.choice.frame-choice {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 6px 3px;
  font-size: 0.76rem;
}
.frame-sample {
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 5/7;
  padding: 6px 4px;
  background: #bbc4ab;
  border: 2px double #7b835a;
  box-shadow: 0 1px 2px #513c2429;
}
.frame-sample img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
[data-frame='glasshouse'] .frame-sample img {
  border-radius: 45% 45% 0 0;
}
[data-frame='nocturne'] .frame-sample {
  background: #172741;
  border-color: #c5a35e;
}
[data-frame='palmette'] .frame-sample {
  background: repeating-linear-gradient(45deg, #647f78 0 3px, #d1ac67 3px 4px);
  border-color: #bf9856;
}
[data-frame='linen'] .frame-sample {
  background: #fcf2df;
  border-color: #e7daca;
  padding-bottom: 10px;
}
[data-frame='vine'] .frame-sample {
  background: #ded2b7;
  border-color: #ab9469;
}
.custom-stickers {
  margin: 12px 0;
}
.custom-stickers h3 {
  font: 500 0.85rem var(--sans);
  margin: 0 0 6px;
}
.custom-sticker-grid {
  margin-top: 6px;
}
.custom-sticker-grid:empty {
  display: none;
}
.custom-sticker-choice {
  min-width: 0;
}
.custom-sticker-choice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
@media (max-width: 740px) {
  .options .frame-choices {
    display: flex;
    width: 100%;
  }
  .options .frame-label {
    display: block;
  }
  .custom-stickers {
    width: 100%;
  }
  .custom-sticker-choice {
    max-width: 130px;
  }
}
