
  :root {
    --ink: #eef7f2;
    --gold: #e6c489;
    --muted: rgba(228, 242, 236, 0.52);
    --bg: #03080a;
  }

  * { box-sizing: border-box; }

  html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
  }

  body {
    overflow: hidden;
    color: var(--ink);
    font-family: "Helvetica Neue", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  #scene {
    position: fixed;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
  }
  #scene:active { cursor: grabbing; }

  .vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
      radial-gradient(ellipse at 50% 44%, transparent 34%, rgba(2, 6, 8, 0.26) 74%, rgba(2, 6, 8, 0.7) 100%),
      linear-gradient(to bottom, rgba(2, 6, 8, 0.34), transparent 24%, transparent 84%, rgba(2, 6, 8, 0.38));
  }

  .brand {
    position: fixed;
    z-index: 3;
    top: clamp(20px, 4.2vh, 44px);
    left: clamp(20px, 4vw, 52px);
    display: flex;
    gap: 13px;
    align-items: flex-start;
    pointer-events: none;
    opacity: 0;
    animation: rise 1.4s cubic-bezier(.2,.7,.2,1) .5s forwards;
  }
  .brand-mark {
    color: var(--gold);
    font-size: 13px;
    line-height: 1.5;
    opacity: .9;
  }
  .eyebrow {
    margin: 0;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .42em;
    color: var(--gold);
    text-transform: uppercase;
  }
  .sub {
    margin: 9px 0 0;
    font-size: 10.5px;
    letter-spacing: .2em;
    color: var(--muted);
  }

  .top-actions {
    position: fixed;
    z-index: 4;
    top: clamp(20px, 4.2vh, 44px);
    right: clamp(20px, 4vw, 52px);
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.8vw, 22px);
    opacity: 0;
    animation: rise 1.4s cubic-bezier(.2,.7,.2,1) 1.1s forwards;
  }

  .customize {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 0 5px;
    border: 0;
    border-bottom: 1px solid rgba(230, 196, 137, 0.32);
    background: none;
    color: rgba(230, 196, 137, 0.82);
    font: inherit;
    font-size: 9.5px;
    letter-spacing: 0.24em;
    cursor: pointer;
    transition: color .3s ease, border-color .3s ease;
  }
  .customize:hover {
    color: #f6dfb4;
    border-color: rgba(246, 223, 180, 0.75);
  }
  .customize span:last-child {
    font-size: 11px;
    letter-spacing: 0;
    transform: translateY(-1px);
  }

  .sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 0 5px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: none;
    color: rgba(230, 196, 137, 0.6);
    font: inherit;
    font-size: 8.5px;
    letter-spacing: 0.18em;
    cursor: pointer;
    transition: color .3s ease, border-color .3s ease;
  }
  .sound-toggle:hover { color: rgba(246, 223, 180, 0.92); border-color: rgba(246, 223, 180, 0.4); }
  .sound-toggle svg { display: block; overflow: visible; }
  .sound-slash { display: none; }
  .sound-toggle[aria-pressed="false"] .sound-wave { display: none; }
  .sound-toggle[aria-pressed="false"] .sound-slash { display: block; }

  .hint {
    position: fixed;
    z-index: 3;
    bottom: clamp(18px, 3.6vh, 34px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 92vw;
    text-align: center;
    font-size: 10px;
    letter-spacing: .22em;
    color: rgba(228, 242, 236, 0.4);
    pointer-events: none;
    opacity: 0;
    animation: fade 1.8s ease 2.2s forwards;
  }
  .hint .sep { margin: 0 .7em; color: rgba(230, 196, 137, 0.45); }
  .hint-touch { display: none; }

  @media (hover: none) {
    .hint-desktop { display: none; }
    .hint-touch { display: inline; }
  }
  @media (max-width: 640px) {
    .brand { gap: 10px; }
    .eyebrow { font-size: 9px; letter-spacing: .34em; }
    .sub { font-size: 9.5px; letter-spacing: .16em; }
    .top-actions { top: 20px; right: 20px; gap: 12px; }
    .customize { font-size: 9px; letter-spacing: .16em; }
    .sound-toggle { font-size: 0; gap: 0; }
    .sound-toggle svg { width: 16px; height: 16px; }
    .hint { font-size: 9px; letter-spacing: .14em; }
  }

  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes fade { to { opacity: 1; } }

  [hidden] { display: none !important; }

  /* ---------- gift cue + tag ---------- */
  .gift-cue {
    position: fixed;
    z-index: 3;
    left: 50%;
    bottom: clamp(52px, 7.4vh, 68px);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: 92vw;
    padding: 7px 14px;
    border: 1px solid rgba(230, 196, 137, 0.14);
    border-radius: 999px;
    background: rgba(4, 16, 13, 0.32);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: rgba(230, 196, 137, 0.7);
    font-size: 9.5px;
    letter-spacing: 0.18em;
    pointer-events: none;
    opacity: 0;
    animation: fade 1.8s ease 2.6s forwards;
    transition: opacity .4s ease;
    white-space: nowrap;
  }
  .gift-cue .cue-star { color: var(--gold); font-size: 10px; }
  .gift-cue span:last-child { overflow: hidden; text-overflow: ellipsis; }
  body.overlay-open .gift-cue { opacity: 0 !important; }

  .gift-tag {
    position: fixed;
    z-index: 4;
    transform: translate(-50%, -100%);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid rgba(230, 196, 137, 0.38);
    background: rgba(5, 19, 15, 0.78);
    color: #f0dfb9;
    font-family: "Songti SC", "Noto Serif SC", "STSong", SimSun, serif;
    font-size: 10.5px;
    letter-spacing: 0.16em;
    white-space: nowrap;
    border-radius: 2px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s ease;
  }
  .gift-tag::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 1px;
    height: 16px;
    background: linear-gradient(to bottom, rgba(230, 196, 137, 0.55), rgba(230, 196, 137, 0));
  }
  .gift-tag.is-visible { opacity: 1; }
  .gift-tag .tag-star { color: var(--gold); font-size: 9px; }
  body.overlay-open .gift-tag { opacity: 0; }

  /* ---------- postcard ---------- */
  .card-stage {
    position: fixed;
    inset: 0;
    z-index: 24;
    display: grid;
    place-items: center;
    pointer-events: none;
  }
  .card-stage[hidden] { display: none; }
  .card-stage.is-visible { pointer-events: auto; }

  .card-veil {
    position: absolute;
    inset: 0;
    background:
      radial-gradient(ellipse at 50% 46%, rgba(230, 196, 137, 0.05) 0%, transparent 52%),
      radial-gradient(ellipse at 50% 46%, rgba(8, 24, 20, 0.12) 0%, rgba(3, 10, 8, 0.64) 58%, rgba(2, 6, 5, 0.9) 100%);
    opacity: 0;
    transition: opacity .7s ease;
    -webkit-backdrop-filter: blur(6px) brightness(.72) saturate(.9);
    backdrop-filter: blur(6px) brightness(.72) saturate(.9);
  }
  .card-stage.is-open .card-veil { opacity: 1; }

  .postcard-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(780px, 88vw);
    transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, 0px)) scale(.14) rotate(-7deg);
    opacity: 0;
    transition: transform 1.05s cubic-bezier(.16, 1, .3, 1), opacity .55s ease;
    will-change: transform, opacity;
    z-index: 1;
  }
  .postcard-wrap::before {
    content: "";
    position: absolute;
    inset: -70px;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(230, 190, 120, 0.13), transparent 65%);
    filter: blur(18px);
    pointer-events: none;
  }
  .card-stage.is-open .postcard-wrap {
    transform: translate(-50%, -50%) translate(0, 0) scale(1) rotate(-.65deg);
    opacity: 1;
  }
  .card-stage.is-preview .postcard-wrap {
    transform: translate(-50%, -50%) translate(0, 0) scale(.9) rotate(-1.4deg);
  }
  .card-stage.is-preview.is-open .postcard-wrap {
    transform: translate(-50%, -50%) translate(0, 0) scale(1) rotate(-.65deg);
  }

  .postcard {
    position: relative;
    width: 100%;
    aspect-ratio: 1.62;
    overflow: hidden;
    border: 1px solid rgba(151, 117, 64, 0.24);
    border-radius: 3px;
    color: #243b32;
    background:
      radial-gradient(120% 120% at 12% 0%, rgba(255, 255, 255, 0.9), transparent 55%),
      radial-gradient(100% 100% at 100% 100%, rgba(190, 155, 95, 0.14), transparent 60%),
      linear-gradient(135deg, #fcf7ec 0%, #f3e8d3 100%);
    box-shadow:
      0 55px 130px -34px rgba(0, 0, 0, 0.9),
      0 12px 40px rgba(0, 0, 0, 0.35),
      inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    isolation: isolate;
  }
  .postcard::before {
    content: "";
    position: absolute;
    inset: 12px;
    z-index: 3;
    border: 1px solid rgba(160, 124, 67, 0.23);
    pointer-events: none;
  }
  .postcard::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: 0.045;
    mix-blend-mode: multiply;
    pointer-events: none;
  }

  .postcard-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.55fr .86fr;
    gap: 32px;
    height: 100%;
    padding: 40px 46px 32px;
  }
  .card-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
  .card-main > * { flex-shrink: 0; }
  .card-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #9a7a45;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 8.5px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .card-kicker .k-star { color: #b89255; font-size: 10px; }
  .card-kicker .k-year { margin-left: auto; color: rgba(90, 70, 40, 0.4); letter-spacing: 0.18em; }
  .card-no {
    margin: 10px 0 0;
    font-family: Georgia, serif;
    font-size: 8px;
    letter-spacing: 0.26em;
    color: var(--accent, #a53029);
    opacity: 0.8;
  }
  .card-title {
    margin: 13px 0 0;
    font-family: "Songti SC", "Noto Serif SC", "STSong", SimSun, serif;
    font-weight: 500;
    font-size: clamp(27px, 3vw, 36px);
    line-height: 1.3;
    letter-spacing: 0.06em;
    color: #1f3a30;
    overflow-wrap: anywhere;
  }
  .card-title::after {
    content: "";
    display: block;
    width: 38px;
    height: 1px;
    margin-top: 15px;
    background: var(--accent, #a53029);
    opacity: 0.5;
  }
  .card-body-scroll {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 20px;
  }
  .card-body-scroll::after {
    content: "";
    position: absolute;
    left: 0;
    right: 10px;
    bottom: 0;
    height: 34px;
    background: linear-gradient(to bottom, rgba(247, 239, 222, 0), rgba(247, 239, 222, 0.88));
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .card-body-scroll.has-more::after { opacity: 1; }
  .card-body {
    height: 100%;
    margin: 0;
    padding-right: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    font-family: "Kaiti SC", "KaiTi", "STKaiti", "FangSong", serif;
    font-size: clamp(17px, 1.55vw, 21px);
    line-height: 2.05;
    color: #3d3a2e;
    letter-spacing: 0.035em;
    white-space: pre-line;
    overflow-wrap: anywhere;
  }
  .card-body::-webkit-scrollbar { width: 2px; }
  .card-body::-webkit-scrollbar-track { background: transparent; }
  .card-body::-webkit-scrollbar-button { display: none; height: 0; }
  .card-body::-webkit-scrollbar-thumb {
    border-radius: 2px;
    background: rgba(154, 122, 69, 0.3);
  }
  .card-body:hover::-webkit-scrollbar-thumb { background: rgba(154, 122, 69, 0.5); }
  @supports not selector(::-webkit-scrollbar) {
    .card-body {
      scrollbar-width: thin;
      scrollbar-color: rgba(154, 122, 69, 0.34) transparent;
    }
  }
  .card-body:focus-visible {
    outline: 1px solid rgba(154, 122, 69, 0.5);
    outline-offset: 5px;
  }
  .card-sign {
    margin: 12px 0 0;
    padding-top: 10px;
    text-align: right;
    font-family: "Kaiti SC", "KaiTi", "STKaiti", serif;
    font-size: 16px;
    color: #6b5638;
  }
  .card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    font-family: Georgia, serif;
    font-size: 7px;
    letter-spacing: 0.28em;
    color: rgba(90, 70, 40, 0.38);
    text-transform: uppercase;
  }
  .card-footer::before {
    content: "";
    height: 1px;
    flex: 1;
    background: linear-gradient(to right, rgba(150, 115, 60, 0.28), transparent);
  }

  .card-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    min-width: 0;
    padding-left: 30px;
    border-left: 1px dashed rgba(145, 110, 58, 0.3);
  }
  .stamp-block {
    position: relative;
    align-self: flex-end;
    margin-top: -2px;
    padding: 0 0 17px 17px;
  }
  .stamp {
    position: relative;
    width: 74px;
    height: 92px;
    padding: 8px 8px 6px;
    background: #103a2d;
    color: #e7c889;
    transform: rotate(1.5deg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
  }
  .stamp::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px dashed rgba(231, 200, 137, 0.5);
    pointer-events: none;
  }
  .stamp svg { display: block; width: 100%; height: 62px; }
  .stamp span {
    display: block;
    padding-top: 3px;
    text-align: center;
    font-family: Georgia, serif;
    font-size: 6.5px;
    letter-spacing: 0.3em;
  }
  .postmark {
    position: absolute;
    left: -7px;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 61px;
    height: 61px;
    border: 1px solid rgba(88, 64, 36, 0.34);
    border-radius: 50%;
    color: rgba(88, 64, 36, 0.56);
    font-family: Georgia, serif;
    font-size: 5.5px;
    letter-spacing: 0.12em;
    line-height: 1.6;
    text-align: center;
    transform: rotate(-13deg);
    background: rgba(252, 247, 236, 0.18);
  }
  .postmark strong { font-size: 8px; font-weight: 400; letter-spacing: 0.1em; }

  .address { width: 100%; margin-top: 18px; }
  .address p { margin: 0 0 11px; }
  .address span {
    display: block;
    margin-bottom: 3px;
    font-family: Georgia, serif;
    font-size: 6.5px;
    letter-spacing: 0.3em;
    color: #a3824e;
  }
  .address strong {
    display: block;
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(120, 90, 50, 0.2);
    font-family: "Songti SC", "Noto Serif SC", "STSong", SimSun, serif;
    font-weight: 500;
    font-size: 14px;
    color: #2b3c32;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card-close {
    position: absolute;
    top: -17px;
    right: -4px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(230, 196, 137, 0.45);
    border-radius: 50%;
    background: rgba(5, 18, 14, 0.9);
    color: #e6c489;
    font-family: Georgia, serif;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background .25s ease, color .25s ease, transform .25s ease;
  }
  .card-close:hover { background: #e6c489; color: #0c261e; transform: scale(1.06); }

  .card-hint {
    margin: 15px 0 0;
    text-align: center;
    font-family: inherit;
    font-size: 8.5px;
    letter-spacing: 0.22em;
    color: rgba(235, 220, 190, 0.38);
    pointer-events: none;
  }

  /* ---------- editor ---------- */
  .editor-stage {
    position: fixed;
    inset: 0;
    z-index: 22;
    display: grid;
    place-items: center;
    pointer-events: none;
  }
  .editor-stage[hidden] { display: none; }
  .editor-stage.is-visible { pointer-events: auto; }
  .editor-veil {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 6, 0.62);
    opacity: 0;
    transition: opacity .6s ease;
    -webkit-backdrop-filter: blur(7px) brightness(.65);
    backdrop-filter: blur(7px) brightness(.65);
  }
  .editor-stage.is-open .editor-veil { opacity: 1; }

  .editor-wrap {
    position: relative;
    width: min(660px, 92vw);
    max-height: 90vh;
    transform: translateY(16px) scale(.985);
    opacity: 0;
    transition: transform .55s cubic-bezier(.16, 1, .3, 1), opacity .4s ease;
  }
  .editor-stage.is-open .editor-wrap { transform: translateY(0) scale(1); opacity: 1; }

  .editor-panel {
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    padding: 38px 44px 30px;
    border: 1px solid rgba(151, 117, 64, 0.22);
    border-radius: 3px;
    color: #243b32;
    background:
      radial-gradient(120% 100% at 10% 0%, rgba(255, 255, 255, 0.85), transparent 55%),
      linear-gradient(135deg, #fbf6ea 0%, #f2e7d2 100%);
    box-shadow: 0 45px 110px -28px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    scrollbar-width: thin;
    scrollbar-color: rgba(150, 115, 60, 0.35) transparent;
  }
  .editor-panel::before {
    content: "";
    position: absolute;
    inset: 12px;
    z-index: 0;
    border: 1px solid rgba(160, 124, 67, 0.2);
    pointer-events: none;
  }
  .editor-panel::-webkit-scrollbar { width: 4px; }
  .editor-panel::-webkit-scrollbar-thumb { background: rgba(150, 115, 60, 0.35); }

  .editor-close {
    position: absolute;
    top: -16px;
    right: 2px;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(230, 196, 137, 0.4);
    border-radius: 50%;
    background: rgba(5, 18, 14, 0.92);
    color: #e6c489;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background .25s ease, color .25s ease;
  }
  .editor-close:hover { background: #e6c489; color: #0c261e; }

  .editor-kicker {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 8px;
    letter-spacing: 0.34em;
    color: #a3824e;
    text-transform: uppercase;
  }
  .editor-title {
    margin: 10px 0 0;
    font-family: "Songti SC", "Noto Serif SC", "STSong", SimSun, serif;
    font-weight: 500;
    font-size: 32px;
    line-height: 1.3;
    letter-spacing: 0.05em;
    color: #1f3a30;
  }
  .editor-sub {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.8;
    letter-spacing: 0.05em;
    color: rgba(70, 62, 48, 0.6);
  }

  .editor-form { margin-top: 24px; }
  .editor-row { position: relative; margin-top: 18px; }
  .editor-row label, .editor-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 9px;
    letter-spacing: 0.22em;
    color: #8f6f3d;
  }
  .editor-row label span, .editor-label span {
    font-family: Georgia, serif;
    font-size: 6.5px;
    letter-spacing: 0.2em;
    color: rgba(90, 70, 40, 0.35);
  }
  .editor-row input, .editor-row textarea {
    width: 100%;
    padding: 7px 0 9px;
    border: 0;
    border-bottom: 1px solid rgba(120, 90, 50, 0.25);
    border-radius: 0;
    background: transparent;
    font-family: "Kaiti SC", "KaiTi", "STKaiti", "FangSong", serif;
    font-size: 19px;
    line-height: 1.6;
    color: #2c3b31;
    outline: none;
    resize: none;
  }
  .editor-row input::placeholder, .editor-row textarea::placeholder { color: rgba(60, 50, 35, 0.27); }
  .editor-row input:focus, .editor-row textarea:focus {
    border-bottom-color: #b08a4e;
    box-shadow: 0 1px 0 #b08a4e;
  }
  .editor-message { margin-top: 20px; padding-bottom: 13px; }
  .editor-message textarea { min-height: 88px; }
  .char-count {
    position: absolute;
    right: 0;
    bottom: 0;
    font-family: Georgia, serif;
    font-size: 8px;
    letter-spacing: 0.1em;
    color: rgba(90, 70, 40, 0.35);
  }

  .gift-picker { display: flex; gap: 12px; margin-top: 10px; }
  .gift-swatch {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    background: var(--swatch);
    cursor: pointer;
    outline: 1px solid transparent;
    outline-offset: 3px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 2px 5px rgba(0, 0, 0, 0.12);
    transition: transform .2s ease, outline-color .2s ease;
  }
  .gift-swatch::before, .gift-swatch::after {
    content: "";
    position: absolute;
    background: rgba(244, 226, 185, 0.7);
  }
  .gift-swatch::before { left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; }
  .gift-swatch::after { top: 50%; left: 0; right: 0; height: 4px; margin-top: -2px; }
  .gift-swatch:hover { transform: translateY(-2px); }
  .gift-swatch.is-selected { outline-color: #a98148; transform: translateY(-2px); }
  .gift-picker-note {
    margin: 10px 0 0;
    font-size: 9px;
    letter-spacing: 0.08em;
    color: rgba(70, 62, 48, 0.42);
  }

  .editor-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
  }
  .btn-ghost, .btn-solid {
    padding: 12px 20px;
    border-radius: 2px;
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: background .25s ease, color .25s ease, border-color .25s ease;
  }
  .btn-ghost {
    border: 1px solid rgba(120, 90, 50, 0.3);
    background: transparent;
    color: #6b5638;
  }
  .btn-ghost:hover { border-color: #a98148; background: rgba(255, 255, 255, 0.25); color: #8f6f3d; }
  .btn-solid {
    border: 1px solid #123f32;
    background: #123f32;
    color: #f5e7c8;
  }
  .btn-solid:hover { background: #1a5544; border-color: #1a5544; }
  .btn-solid span { margin-left: 4px; color: #e6c489; }

  .share-box {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px dashed rgba(145, 110, 58, 0.35);
  }
  .share-box[hidden] { display: none; }
  .share-label { margin: 0 0 8px; font-size: 9px; letter-spacing: 0.22em; color: #8f6f3d; }
  .share-row { display: flex; gap: 8px; }
  .share-row input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(120, 90, 50, 0.25);
    background: rgba(255, 255, 255, 0.38);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10px;
    color: #4b4a3f;
    outline: none;
  }
  .share-row input:focus { border-color: #b08a4e; }
  .share-row button {
    flex: 0 0 auto;
    padding: 0 16px;
    border: 0;
    background: #b08a4e;
    color: #162a23;
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 0.14em;
    cursor: pointer;
  }
  .share-note { margin: 9px 0 0; font-size: 9.5px; line-height: 1.7; color: rgba(70, 62, 48, 0.5); }
  .share-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
  .share-edit {
    border: 0;
    background: none;
    padding: 0;
    color: rgba(70, 62, 48, 0.5);
    font-family: inherit;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }
  .editor-foot {
    margin: 11px 0 0;
    text-align: center;
    font-size: 8.5px;
    letter-spacing: 0.12em;
    color: rgba(90, 70, 40, 0.38);
  }

  @media (max-width: 760px) {
    .postcard-wrap { width: min(90vw, 430px); }
    .postcard {
      aspect-ratio: auto;
      height: min(82vh, 620px);
      height: min(82dvh, 620px);
      min-height: 0;
    }
    .postcard-grid {
      grid-template-columns: 1fr;
      grid-template-rows: minmax(0, 1fr) auto;
      height: 100%;
      min-height: 0;
      gap: 20px;
      padding: 32px 28px 26px;
    }
    .card-kicker { font-size: 7.5px; letter-spacing: 0.2em; }
    .card-title { margin-top: 10px; font-size: 27px; }
    .card-title::after { margin-top: 12px; }
    .card-body-scroll { margin-top: 18px; }
    .card-body { font-size: 18px; line-height: 1.9; }
    .card-sign { padding-top: 12px; font-size: 15px; }
    .card-footer { margin-top: 12px; }
    .card-side {
      flex-direction: row;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
      padding: 16px 0 0;
      border-top: 1px dashed rgba(145, 110, 58, 0.3);
      border-left: 0;
    }
    .stamp-block { align-self: flex-start; padding: 0; }
    .stamp { width: 58px; height: 73px; padding: 6px; }
    .stamp svg { height: 46px; }
    .stamp span { font-size: 5.5px; }
    .postmark { left: -14px; bottom: -6px; width: 48px; height: 48px; font-size: 4.5px; }
    .address { width: auto; flex: 1; margin: 0; text-align: right; }
    .address p { margin-bottom: 8px; }
    .address strong { font-size: 12px; }
    .card-close { top: -16px; right: 2px; width: 36px; height: 36px; }
    .card-hint { margin-top: 13px; font-size: 8px; }

    .gift-cue { bottom: 72px; padding: 6px 11px; font-size: 8.5px; letter-spacing: 0.12em; }
    .gift-tag { padding: 6px 9px; font-size: 9px; letter-spacing: 0.1em; }

    .editor-wrap { width: min(92vw, 430px); }
    .editor-panel { padding: 30px 24px 24px; }
    .editor-title { font-size: 28px; }
    .editor-sub { font-size: 10px; }
    .editor-close { top: -15px; right: 0; }
    .editor-actions { justify-content: stretch; }
    .editor-actions .btn-ghost, .editor-actions .btn-solid { flex: 1; padding-left: 10px; padding-right: 10px; }
    .share-actions { justify-content: stretch; }
    .share-actions .btn-ghost, .share-actions .btn-solid { flex: 1; }
    .share-row { flex-wrap: wrap; }
    .share-row input { flex-basis: 100%; }
    .share-row button { padding: 10px 16px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .card-veil, .editor-veil, .postcard-wrap, .editor-wrap { transition-duration: .01ms !important; }
    .top-actions, .customize, .gift-cue, .hint { animation: none; opacity: 1; }
  }

  #loader {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    background: var(--bg);
    transition: opacity 1s ease, visibility 1s ease;
  }
  #loader.is-hidden { opacity: 0; visibility: hidden; }
  .loader-inner { text-align: center; padding: 0 24px; }
  .loader-line {
    width: 128px;
    height: 1px;
    margin: 0 auto 22px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    animation: breathe 2.4s ease-in-out infinite;
  }
  .loader-text {
    margin: 0;
    font-size: 10px;
    letter-spacing: .32em;
    color: rgba(230, 196, 137, 0.72);
  }
  .loader-note {
    margin: 14px 0 0;
    font-size: 10px;
    line-height: 1.8;
    letter-spacing: .08em;
    color: rgba(228, 242, 236, 0.35);
    max-width: 300px;
  }
  .loader-note:empty { display: none; }
  @keyframes breathe {
    0%, 100% { opacity: .35; transform: scaleX(.7); }
    50% { opacity: 1; transform: scaleX(1); }
  }

  @media (prefers-reduced-motion: reduce) {
    .brand, .tech, .hint { animation: none; opacity: 1; }
    .loader-line { animation: none; }
  }


  /* ---------- 3D / lite loading modes ---------- */
  #scene { z-index: 0; opacity: 0; transition: opacity 1s ease; background: #03080a; }
  body.mode-3d #scene { opacity: 1; }

  .poster {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    background: #03080a;
    pointer-events: none;
    transition: opacity 1s ease, visibility 1s;
  }
  .poster picture, .poster img { display: block; width: 100%; height: 100%; margin: 0; }
  .poster img { object-fit: cover; object-position: 50% 44%; }
  .poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(2, 8, 6, .1), transparent 38%, rgba(2, 8, 6, .54) 100%);
    pointer-events: none;
  }
  body.mode-3d .poster { opacity: 0; visibility: hidden; }

  .gift-shelf {
    position: fixed;
    z-index: 3;
    left: 50%;
    bottom: max(22px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: min(560px, 92vw);
    padding: 12px 16px 13px;
    border: 1px solid rgba(230, 196, 137, 0.2);
    border-radius: 3px;
    background: rgba(4, 16, 13, 0.62);
    -webkit-backdrop-filter: blur(14px) saturate(.9);
    backdrop-filter: blur(14px) saturate(.9);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease, visibility .5s;
  }
  body.show-gift-shelf .gift-shelf { opacity: 1; visibility: visible; }
  body.mode-3d .gift-shelf { opacity: 0; visibility: hidden; pointer-events: none; }
  .gift-shelf-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 9px;
    letter-spacing: 0.14em;
    color: rgba(230, 196, 137, 0.72);
  }
  .shelf-retry {
    padding: 0 0 2px;
    border: 0;
    border-bottom: 1px solid rgba(230, 196, 137, 0.24);
    background: none;
    color: rgba(230, 196, 137, 0.58);
    font: inherit;
    font-size: 8.5px;
    letter-spacing: 0.14em;
    white-space: nowrap;
    cursor: pointer;
  }
  .shelf-retry:hover { color: #f2d9a8; border-color: rgba(242, 217, 168, 0.6); }
  .shelf-gifts { display: flex; align-items: flex-end; justify-content: center; gap: clamp(12px, 3vw, 26px); }
  .shelf-gift {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 58px;
    padding: 2px 0;
    border: 0;
    background: none;
    color: rgba(235, 220, 190, 0.45);
    font-family: Georgia, serif;
    font-size: 8px;
    letter-spacing: 0.18em;
    cursor: pointer;
  }
  .shelf-box {
    position: relative;
    width: 33px;
    height: 27px;
    border-radius: 1px;
    background: var(--gift);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 5px 12px rgba(0, 0, 0, 0.35);
    transition: transform .2s ease;
  }
  .shelf-box::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -2px;
    bottom: -2px;
    width: 5px;
    margin-left: -2.5px;
    background: var(--ribbon);
    opacity: 0.85;
  }
  .shelf-box::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -2px;
    right: -2px;
    height: 5px;
    margin-top: -2.5px;
    background: var(--ribbon);
    opacity: 0.85;
  }
  .shelf-gift:hover .shelf-box { transform: translateY(-3px); }
  .shelf-gift.is-personal .shelf-box { outline: 1px solid rgba(230, 196, 137, 0.75); outline-offset: 4px; }
  .shelf-gift.is-personal .shelf-label { color: #e6c489; }
  .shelf-gift:focus-visible { outline: 1px solid rgba(230, 196, 137, 0.6); outline-offset: 4px; }
  body:not(.mode-3d) .gift-cue,
  body:not(.mode-3d) .hint,
  body:not(.mode-3d) .gift-tag { display: none; }

  .loader-status {
    position: fixed;
    z-index: 3;
    left: 50%;
    bottom: max(30px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border: 1px solid rgba(230, 196, 137, 0.14);
    border-radius: 999px;
    background: rgba(4, 16, 13, 0.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: rgba(230, 196, 137, 0.72);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s;
  }
  body.is-loading-3d:not(.show-gift-shelf) .loader-status { opacity: 1; visibility: visible; }
  body.mode-3d .loader-status { display: none; }
  .loader-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    animation: loaderPulse 1.2s ease-in-out infinite;
  }
  @keyframes loaderPulse {
    0%, 100% { opacity: .25; transform: scale(.8); }
    50% { opacity: 1; transform: scale(1.15); }
  }

  .gift-tag {
    pointer-events: none;
    cursor: default;
    font: inherit;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
  }
  .gift-tag.is-visible { pointer-events: auto; cursor: pointer; }
  .gift-tag:hover { border-color: rgba(230, 196, 137, 0.7); background: rgba(12, 38, 28, 0.9); }
  .gift-tag:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
  .gift-tag .tag-open {
    margin-left: 2px;
    padding-left: 8px;
    border-left: 1px solid rgba(230, 196, 137, 0.25);
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 0.18em;
  }
  body.overlay-open .gift-tag { opacity: 0; pointer-events: none; }

  @media (max-width: 640px) {
    .gift-shelf { bottom: max(16px, env(safe-area-inset-bottom)); width: 94vw; padding: 10px 12px 11px; }
    .gift-shelf-head { gap: 8px; font-size: 8px; letter-spacing: 0.1em; }
    .shelf-retry { font-size: 7.5px; letter-spacing: 0.08em; }
    .shelf-gift { width: 48px; }
    .shelf-box { width: 28px; height: 23px; }
    .gift-tag { padding: 6px 9px; font-size: 9px; letter-spacing: 0.1em; }
  }

