/* Visible before authentication, without a font download or a looping animation. */
.page-loader {position:fixed;z-index:1000;inset:0;display:grid;align-content:center;justify-items:center;gap:16px;background:#f8eddf;color:#684b38;visibility:visible;font-family:system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;pointer-events:auto}
.page-loader[hidden] {display:none!important}
.page-loader p {margin:6px 0 0;font-size:17px;letter-spacing:.12em}
.page-loader small {font-size:12px;color:#8a6a50}
.loader-envelope {position:relative;display:grid;place-items:end center;width:94px;height:64px;padding-bottom:8px;border:1px solid #d5ad8e;border-radius:5px;background:#f0d4b8;color:#b47b53;box-shadow:0 4px 10px rgba(120,70,38,.05);font-size:22px}
.loader-envelope::before {content:'';position:absolute;inset:0 0 auto;height:34px;background:#f8e7d2;clip-path:polygon(0 0,100% 0,50% 100%)}
.page-loader .loader-retry {padding:9px 16px;border:1px solid #d5ad8e;border-radius:20px;color:inherit;background:#fff7ea;font:13px system-ui;cursor:pointer}
html[data-theme='night'] .page-loader {background:#282620;color:#e9dac7}
html[data-theme='warm'] .page-loader {background:#f5ebd5}


    :root {
      color-scheme: light;
      --cream: #f8eddf;
      --apricot: #f3ddc8;
      --peach: #edc5a7;
      --ivory: #fffaf1;
      --ink: #684b38;
      --ink-soft: #80634d;
      --orange: #c9784e;
      --kraft: #c9956e;
      --kraft-light: #dfb18b;
      --kraft-deep: #ad7652;
      --paper-edge: rgba(135, 94, 63, .18);
      --warm-shadow: rgba(120, 70, 38, .16);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
      font-synthesis: none;
      text-rendering: optimizeLegibility;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    * { box-sizing: border-box; }

    html { min-width: 320px; min-height: 100%; }

    body {
      min-height: 100vh;
      min-height: 100svh;
      margin: 0;
      overflow-x: hidden;
      color: var(--ink);
      background:
        radial-gradient(ellipse 52% 45% at 14% 18%, rgba(255, 247, 230, .94), transparent 72%),
        radial-gradient(ellipse 46% 42% at 88% 79%, rgba(231, 167, 126, .30), transparent 75%),
        radial-gradient(ellipse 34% 28% at 77% 12%, rgba(255, 232, 204, .62), transparent 76%),
        linear-gradient(135deg, #f9edde 0%, #f5dfca 43%, #f1d2ba 100%);
    }

    body::before {
      content: "";
      position: fixed;
      z-index: -1;
      inset: 0;
      pointer-events: none;
      opacity: .23;
      background-image:
        repeating-linear-gradient(0deg, rgba(130, 93, 63, .045) 0, rgba(130, 93, 63, .045) 1px, transparent 1px, transparent 4px),
        repeating-linear-gradient(93deg, rgba(255, 255, 255, .22) 0, rgba(255, 255, 255, .22) 1px, transparent 1px, transparent 6px);

    }

    body::after {
      content: "";
      position: fixed;
      z-index: 0;
      inset: -8%;
      pointer-events: none;
      opacity: 0;
      background-image:
        radial-gradient(circle at 17% 28%, rgba(255, 250, 235, .58) 0 1px, transparent 2px),
        radial-gradient(circle at 77% 22%, rgba(181, 113, 76, .19) 0 1px, transparent 2px),
        radial-gradient(circle at 66% 72%, rgba(255, 248, 232, .48) 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 31% 83%, rgba(183, 115, 77, .16) 0 1px, transparent 2px);
      background-size: 240px 220px, 310px 270px, 360px 320px, 280px 260px;
      transform: translate3d(0, 0, 0);
      animation: none;
    }

    .app-shell { position: relative; z-index: 1; min-height: 100vh; padding: 16px clamp(14px, 3vw, 34px) 30px; }

    .view-nav {
      position: relative;
      z-index: 10;
      display: flex;
      justify-content: center;
      gap: 5px;
      width: fit-content;
      max-width: 100%;
      margin: 0 auto 10px;
      padding: 6px;
      border: 1px solid rgba(160, 111, 75, .2);
      border-radius: 999px;
      background: rgba(255, 248, 236, .64);
      box-shadow: 0 5px 18px rgba(126, 78, 45, .07);
    }

    .view-tab {
      min-height: 40px;
      padding: 9px 17px;
      border: 0;
      border-radius: 999px;
      color: #806148;
      background: transparent;
      font: inherit;
      font-size: 13px;
      letter-spacing: .035em;
      white-space: nowrap;
      cursor: pointer;
      transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
    }

    .view-tab[aria-selected="true"] {
      color: #70472f;
      background: #fff9ef;
      box-shadow: 0 2px 8px rgba(126, 78, 45, .11), inset 0 0 0 1px rgba(176, 128, 87, .15);
    }

    .view-tab:focus-visible { outline: 2px solid #a96743; outline-offset: 2px; }

    .view-panel { max-width: 1240px; margin: 0 auto; animation: view-appear 260ms ease both; }
    .view-panel[hidden] { display: none !important; }

    .page-view {
      width: min(100%, 960px);
      min-height: calc(100svh - 116px);
      margin: 0 auto;
      padding: clamp(30px, 6vh, 62px) 10px 60px;
    }

    .view-heading { margin: 4px auto 25px; text-align: center; }
    .view-kicker { margin: 0 0 9px; color: #a87554; font-size: 11px; letter-spacing: .18em; }
    .view-heading h1 { margin: 0; color: #684b38; font-size: clamp(24px, 4vw, 32px); font-weight: 620; letter-spacing: .08em; }
    .view-heading p:last-child { margin: 10px auto 0; color: #8d715a; font-size: 14px; line-height: 1.8; }

    .sticker-row { display: flex; align-items: center; justify-content: center; gap: 21px; margin: 10px auto 20px; color: rgba(163, 111, 79, .72); }
    .sticker-row svg { display: block; width: 19px; height: 19px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
    .sticker-row svg:nth-child(odd) { transform: rotate(-7deg); }
    .sticker-row svg:nth-child(even) { transform: rotate(6deg); }
    .showcase-stickers { margin: 14px auto 0; }

    .content-card {
      border: 1px solid rgba(150, 109, 76, .18);
      border-radius: 12px;
      padding: clamp(21px, 4vw, 36px);
      background-color: rgba(255, 250, 241, .88);
      background-image: repeating-linear-gradient(0deg, rgba(126, 89, 57, .018) 0, rgba(126, 89, 57, .018) 1px, transparent 1px, transparent 5px);
      box-shadow: 0 14px 38px rgba(119, 74, 45, .11), inset 0 0 0 4px rgba(255, 255, 255, .2);
    }

    .compose-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); gap: 19px; align-items: start; }
    .compose-card h2, .saved-card h2 { margin: 0 0 18px; color: #74543c; font-size: 16px; font-weight: 650; letter-spacing: .04em; }
    .form-stack { display: grid; gap: 15px; }
    .form-label { display: grid; gap: 7px; color: #795b42; font-size: 13px; font-weight: 600; }
    .form-field {
      width: 100%;
      border: 1px solid rgba(160, 118, 75, .25);
      border-radius: 6px;
      padding: 11px 12px;
      color: #624936;
      background: rgba(255, 252, 244, .9);
      font: inherit;
      font-size: 16px;
      font-weight: 400;
      line-height: 1.7;
      outline: none;
    }

    .form-field:focus { border-color: rgba(185, 112, 67, .68); box-shadow: 0 0 0 3px rgba(201, 120, 78, .12); }
    textarea.form-field { min-height: 320px; resize: vertical; }
    .upload-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
    .upload-button {
      display: inline-flex;
      align-items: center;
      min-height: 39px;
      padding: 8px 13px;
      border: 1px solid rgba(174, 121, 82, .3);
      border-radius: 999px;
      color: #865b41;
      background: rgba(248, 233, 213, .7);
      font-size: 13px;
      cursor: pointer;
    }

    .upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
    .upload-hint { margin: 0; color: #977b62; font-size: 12px; line-height: 1.6; }
    .form-submit {
      justify-self: start;
      min-height: 41px;
      padding: 9px 19px;
      border: 1px solid rgba(152, 83, 50, .24);
      border-radius: 999px;
      color: #fff8ec;
      background: linear-gradient(145deg, #cc8057, #b86e4a);
      box-shadow: 0 3px 8px rgba(130, 77, 46, .14);
      font: inherit;
      font-size: 13px;
      cursor: pointer;
    }

    .form-submit:hover { background: linear-gradient(145deg, #d18a61, #bf7651); }
    .form-submit:focus-visible { outline: 2px solid #9d5839; outline-offset: 3px; }
    .form-submit:disabled { cursor: wait; opacity: .65; }
    .form-status { min-height: 1.6em; margin: 0; color: #85684e; font-size: 12px; line-height: 1.6; }
    .saved-list, .shared-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
    .saved-item, .shared-item { padding: 13px 14px; border: 1px solid rgba(165, 126, 75, .16); border-radius: 5px; background: rgba(255, 250, 231, .62); box-shadow: 0 3px 8px rgba(120, 78, 40, .05); }
    .saved-item h3 { margin: 0 0 5px; color: #75563f; font-size: 14px; font-weight: 650; }
    .record-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: #8f684a; font-size: 11px; }
    .record-date { flex: 0 0 auto; color: #aa8c70; }
    .record-content { margin: 0; color: #634b37; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
    .list-empty { padding: 12px 3px; color: #95775e; font-size: 13px; text-align: center; }
    .record-image-frame { margin: 12px 0 0; overflow: hidden; border: 1px solid rgba(201, 120, 78, .28); border-radius: 8px; background: rgba(247, 226, 205, .72); }
    .record-image-preview { display: block; width: 100%; max-height: 320px; object-fit: cover; cursor: zoom-in; }
    .record-image-preview:focus-visible { outline: 3px solid rgba(201, 120, 78, .58); outline-offset: -3px; }
    .pull-refresh-hint { height: 0; margin: 0; overflow: hidden; color: #a06e4d; font-size: 12px; line-height: 1.5; opacity: 0; text-align: center; transition: height 180ms ease, margin 180ms ease, opacity 180ms ease; }
    .pull-refresh-hint.is-visible { height: 19px; margin: 0 0 7px; opacity: 1; }
    .refreshable-list { transition: transform 220ms cubic-bezier(.2, .7, .3, 1); }
    .refreshable-list.is-pulling { transform: translateY(7px); }
    .touch-tilt { transform: rotate(-.5deg) scale(.995); }
    .touch-toast[hidden], .photo-lightbox[hidden] { display: none !important; }
    .touch-toast { position: fixed; z-index: 40; right: 18px; bottom: 24px; display: flex; align-items: center; gap: 10px; max-width: min(390px, calc(100vw - 32px)); padding: 12px 12px 12px 16px; border: 1px solid rgba(167, 112, 74, .25); border-radius: 12px; color: #684b38; background: rgba(255, 249, 238, .96); box-shadow: 0 12px 30px rgba(101, 61, 38, .16); opacity: 0; transform: translate3d(0, 10px, 0); transition: opacity 180ms ease, transform 180ms ease; }
    .touch-toast.is-visible { opacity: 1; transform: translate3d(0, 0, 0); }
    .touch-toast.is-leaving { opacity: 0; transform: translate3d(22px, 0, 0); }
    .touch-toast button { flex: 0 0 40px; min-width: 40px; min-height: 40px; border: 0; border-radius: 50%; color: #865b41; background: rgba(233, 204, 176, .46); font: inherit; font-size: 20px; cursor: pointer; }
    .photo-lightbox { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(72, 49, 36, .74); opacity: 0; transition: opacity 200ms ease; }
    .photo-lightbox.is-open { opacity: 1; }
    .photo-lightbox-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: zoom-out; }
    .photo-lightbox-dialog { position: relative; z-index: 1; width: min(92vw, 1080px); max-height: 88svh; padding: 10px; border: 1px solid rgba(255, 245, 228, .45); border-radius: 13px; background: #fff8ec; box-shadow: 0 24px 70px rgba(35, 22, 14, .3); transform: scale(.985); transition: transform 200ms ease; }
    .photo-lightbox.is-open .photo-lightbox-dialog { transform: scale(1); }
    .photo-lightbox-dialog img { display: block; max-width: 100%; max-height: calc(88svh - 20px); margin: auto; border-radius: 7px; object-fit: contain; }
    .photo-lightbox-close { position: absolute; z-index: 2; top: 13px; right: 13px; min-width: 44px; min-height: 44px; border: 1px solid rgba(135, 94, 63, .22); border-radius: 50%; color: #684b38; background: rgba(255, 250, 241, .93); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }

    .short-form { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
    .reply-form { grid-template-columns: minmax(0, 1fr) auto; }
    .short-form .form-field { min-height: 43px; }
    .short-form textarea.form-field { min-height: 90px; }
    .short-form .form-submit { align-self: start; }
    .short-form-status { margin: 13px 0 16px; }

    .free-board {
      position: relative;
      width: min(100%, 740px);
      margin: 3px auto 0;
      padding: clamp(24px, 5vw, 42px);
      border: 1px solid rgba(190, 143, 77, .29);
      border-radius: 4px 5px 3px 6px;
      color: #654b37;
      background-color: #f9e8b9;
      background-image: radial-gradient(ellipse at 8% 2%, rgba(255,255,241,.55),transparent 52%), repeating-linear-gradient(0deg,rgba(144,108,56,.045) 0,rgba(144,108,56,.045) 1px,transparent 1px,transparent 5px);
      box-shadow: 2px 11px 26px rgba(129, 83, 42, .15), inset 0 0 0 4px rgba(255, 251, 228, .18);
      transform: rotate(-.45deg);
    }

    .free-board::before { content: ""; position: absolute; top: -9px; left: 50%; width: 68px; height: 18px; border: 1px solid rgba(198,145,100,.13); background: rgba(239,200,159,.66); transform: translateX(-50%) rotate(-2deg); }
    .free-board h2 { margin: 0 58px 7px 0; color: #684b38; font-size: 19px; letter-spacing: .05em; }
    .free-board > p { margin: 0 0 20px; color: #8d7053; font-size: 13px; line-height: 1.7; }
    .sticky-open-button { position: absolute; top: 17px; right: 20px; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgba(174,121,82,.32); border-radius: 50%; color: #865b41; background: rgba(255,249,238,.86); box-shadow: 0 4px 12px rgba(126,78,45,.1); font: inherit; font-size: 27px; line-height: 1; cursor: pointer; transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease; }
    .sticky-open-button:hover { transform: translateY(-2px) rotate(4deg); background: #fff9ef; box-shadow: 0 8px 17px rgba(126,78,45,.14); }
    .sticky-open-button:focus-visible, .sticky-dialog-close:focus-visible { outline: 2px solid rgba(145,77,47,.72); outline-offset: 3px; }
    .sticky-dialog { width: min(460px, calc(100% - 30px)); max-height: min(88vh, 700px); padding: 0; overflow: auto; border: 1px solid rgba(174,121,82,.34); border-radius: 17px; color: #684b38; background: #fffaf1; box-shadow: 0 22px 60px rgba(77,49,31,.24), inset 0 0 0 4px rgba(255,255,255,.36); }
    .sticky-dialog::backdrop { background: rgba(72,49,36,.36); }
    .sticky-dialog-inner { padding: 23px; background-image: radial-gradient(ellipse at 8% 2%, rgba(255,255,255,.78), transparent 54%), repeating-linear-gradient(0deg, rgba(144,108,56,.025) 0 1px, transparent 1px 6px); }
    .sticky-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 17px; }
    .sticky-dialog-heading h2 { margin: 0; color: #684b38; font-size: 18px; letter-spacing: .04em; }
    .sticky-dialog-close { flex: 0 0 48px; width: 48px; height: 48px; border: 1px solid rgba(174,121,82,.25); border-radius: 50%; color: #865b41; background: rgba(244,225,204,.62); font: inherit; font-size: 23px; cursor: pointer; transition: transform 180ms ease, background-color 180ms ease; }
    .sticky-dialog-close:hover { transform: rotate(6deg); background: rgba(238,211,183,.78); }
    .sticky-dialog .form-field { background: rgba(255,251,236,.9); }
    .sticky-dialog textarea.form-field { min-height: 115px; }

    @keyframes view-appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes ambient-drift { from { opacity: .11; transform: translate3d(-.5%, -.4%, 0); } to { opacity: .28; transform: translate3d(.6%, .5%, 0); } }

    .scene {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-height: 100vh;
      min-height: 100svh;
      padding: clamp(30px, 6vh, 64px) 20px;
      isolation: isolate;
    }

    @media (min-width: 769px) {
      .content-card { position: relative; box-shadow: 1px 3px 0 rgba(160, 113, 76, .06), 0 16px 42px rgba(119, 74, 45, .12), inset 0 0 0 4px rgba(255, 255, 255, .22); transition: transform 220ms ease, box-shadow 220ms ease; }
      .content-card:hover { transform: none; }
      .saved-item, .shared-item { transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease; }
      .saved-item:hover, .shared-item:hover { transform: translateY(-2px) rotate(-.18deg); border-color: rgba(165, 126, 75, .26); box-shadow: 0 8px 19px rgba(120, 78, 40, .1); }
      .form-submit, .upload-button, .reply-entry-button, .view-tab { transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease; }
      .form-submit:hover, .upload-button:hover { transform: translateY(-1px); box-shadow: 0 7px 14px rgba(130, 77, 46, .16); }
      body::after { opacity: .14; }
    }

    .ornament {
      position: absolute;
      z-index: -1;
      color: rgba(174, 106, 70, .34);
      pointer-events: none;
      user-select: none;
    }

    .ornament-heart {
      top: 12%;
      right: max(8%, calc((100vw - 1040px) / 2));
      color: rgba(193, 111, 73, .5);
      font-size: 17px;
      animation: heartbeat 4.8s ease-in-out infinite;
    }

    .ornament-star {
      top: 22%;
      left: max(11%, calc((100vw - 1000px) / 2));
      font-size: 10px;
      opacity: .48;
    }

    .ornament-line {
      right: max(9%, calc((100vw - 1080px) / 2));
      bottom: 16%;
      width: 27px;
      height: 12px;
      border-top: 1px solid rgba(174, 106, 70, .33);
      border-radius: 50%;
      transform: rotate(-19deg);
    }

    .letter-shell {
      display: grid;
      grid-template-rows: 0fr;
      width: min(100%, 780px);
      margin: 0 auto;
      opacity: 0;
      transition: grid-template-rows 850ms cubic-bezier(.22, .72, .25, 1), opacity 500ms ease, margin 850ms ease;
    }

    .letter-clip { min-height: 0; overflow: hidden; }

    .letter-paper {
      position: relative;
      padding: clamp(30px, 6vw, 62px) clamp(25px, 7.2vw, 74px) clamp(32px, 5vw, 50px);
      overflow: hidden;
      border: 1px solid var(--paper-edge);
      border-radius: 9px 11px 8px 10px;
      background-color: var(--ivory);
      background-image:
        radial-gradient(ellipse at 13% 5%, rgba(232, 194, 155, .20), transparent 43%),
        radial-gradient(ellipse at 95% 94%, rgba(222, 181, 140, .15), transparent 42%),
        repeating-linear-gradient(0deg, rgba(126, 89, 57, .025) 0, rgba(126, 89, 57, .025) 1px, transparent 1px, transparent 5px),
        repeating-linear-gradient(91deg, rgba(255, 255, 255, .24) 0, rgba(255, 255, 255, .24) 1px, transparent 1px, transparent 7px);
      box-shadow: 0 18px 52px rgba(119, 74, 45, .14), 0 4px 13px rgba(119, 74, 45, .08), inset 0 0 0 5px rgba(255, 255, 255, .28);
      transform: translateY(25px) scale(.99);
      opacity: 0;
      transition: transform 750ms cubic-bezier(.2, .74, .28, 1), opacity 600ms ease;
    }

    .letter-paper::before {
      content: "";
      position: absolute;
      inset: 12px;
      border: 1px solid rgba(174, 135, 99, .13);
      border-radius: 4px;
      pointer-events: none;
    }

    .letter-paper::after {
      content: "";
      position: absolute;
      top: 0;
      left: 10%;
      width: 42%;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(189, 144, 101, .28), transparent);
      pointer-events: none;
    }

    .letter-copy {
      position: relative;
      z-index: 1;
      font-size: clamp(16px, 1.8vw, 18px);
      line-height: 2.02;
      letter-spacing: .025em;
      word-break: break-word;
    }

    .letter-copy p { margin: 0 0 1.22em; }
    .letter-copy .salutation { margin-bottom: 1.15em; font-weight: 650; }

    .keepsake-figure {
      margin: 18px 0 0;
      padding: 9px;
      border: 1px solid rgba(164, 124, 88, .2);
      border-radius: 9px;
      background: rgba(255, 247, 234, .72);
      box-shadow: 0 7px 18px rgba(130, 81, 49, .08);
      transform-origin: top center;
      animation: picture-reveal 420ms ease both;
    }

    .keepsake-figure[hidden] { display: none; }

    .photo-preview-frame {
      width: min(100%, 720px);
      margin: 22px auto 0;
    }

    .photo-preview-surface {
      position: relative;
      width: 100%;
      aspect-ratio: 720 / 340;
      overflow: hidden;
      border-radius: 5px;
      background:
        radial-gradient(ellipse at 50% 42%, rgba(255, 248, 232, .92), transparent 58%),
        linear-gradient(140deg, #f5dfc8, #efd0b6);
    }

    .photo-preview-image { display: block; width: 100%; height: 100%; object-fit: cover; }
    .photo-preview-image[hidden], .photo-placeholder-hint[hidden] { display: none; }

    .photo-placeholder-hint {
      position: absolute;
      inset: 0;
      display: grid;
      align-content: center;
      justify-items: center;
      color: #986f52;
      text-align: center;
    }

    .photo-placeholder-hint > span { color: #c57a50; font-size: 23px; line-height: 1.1; }
    .photo-placeholder-hint p { margin: 8px 0 0; color: #92735b; font-size: 13px; letter-spacing: .04em; }

    .reply-entry-button {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 11px;
      min-height: 42px;
      margin: 13px auto 0;
      padding: 9px 19px;
      border: 1px solid rgba(174, 121, 82, .32);
      border-radius: 999px;
      color: #865b41;
      background: rgba(248, 233, 213, .72);
      font: inherit;
      font-size: 13px;
      letter-spacing: .035em;
      cursor: pointer;
      transition: background-color 180ms ease, transform 180ms ease;
    }

    .reply-entry-button:hover { background: rgba(244, 222, 197, .9); transform: translateY(-1px); }
    .reply-entry-button:focus-visible { outline: 2px solid rgba(145, 77, 47, .72); outline-offset: 3px; }

    .reply-toggle {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin: 21px 0 0;
      padding: 8px 12px;
      border: 1px solid rgba(174, 121, 82, .24);
      border-radius: 999px;
      color: #865b41;
      background: rgba(248, 233, 213, .48);
      font: inherit;
      font-size: 13px;
      letter-spacing: .035em;
      cursor: pointer;
      transition: background-color 220ms ease, border-color 220ms ease;
    }

    .reply-toggle:hover { border-color: rgba(174, 121, 82, .46); background: rgba(244, 222, 197, .72); }
    .reply-toggle:focus-visible { outline: 2px solid rgba(145, 77, 47, .72); outline-offset: 3px; }
    .reply-toggle-mark { color: var(--orange); font-size: 15px; }

    .reply-board[hidden] { display: none; }

    .reply-board {
      position: relative;
      margin: 19px 2px 0;
      padding: 24px clamp(18px, 4.5vw, 36px) 26px;
      border: 1px solid rgba(190, 143, 77, .29);
      border-radius: 4px 5px 3px 6px;
      color: #654b37;
      background-color: #f9e8b9;
      background-image:
        radial-gradient(ellipse at 8% 2%, rgba(255, 255, 241, .55), transparent 52%),
        repeating-linear-gradient(0deg, rgba(144, 108, 56, .045) 0, rgba(144, 108, 56, .045) 1px, transparent 1px, transparent 5px);
      box-shadow: 2px 9px 20px rgba(129, 83, 42, .13), inset 0 0 0 4px rgba(255, 251, 228, .18);
      transform: rotate(-.45deg);
      transform-origin: center top;
      animation: picture-reveal 450ms ease both;
    }

    .reply-board::before {
      content: "";
      position: absolute;
      top: -9px;
      left: 50%;
      width: 64px;
      height: 18px;
      border: 1px solid rgba(198, 145, 100, .13);
      background: rgba(239, 200, 159, .66);
      box-shadow: 0 1px 2px rgba(123, 79, 49, .06);
      transform: translateX(-50%) rotate(-2deg);
    }

    .reply-board h2 { margin: 0 0 5px; font-size: 17px; font-weight: 650; letter-spacing: .05em; }
    .reply-board-intro { margin: 0 0 17px; color: #8d7053; font-size: 12px; line-height: 1.7; }

    .note-form { display: grid; gap: 12px; }
    .note-form label { display: grid; gap: 6px; color: #795b42; font-size: 12px; font-weight: 600; letter-spacing: .035em; }
    .note-form input, .note-form textarea {
      width: 100%;
      border: 1px solid rgba(160, 118, 75, .25);
      border-radius: 5px;
      padding: 10px 11px;
      color: #624936;
      background: rgba(255, 251, 236, .78);
      font: inherit;
      font-size: 16px;
      font-weight: 400;
      letter-spacing: normal;
      outline: none;
    }

    .note-form input:focus, .note-form textarea:focus { border-color: rgba(185, 112, 67, .68); box-shadow: 0 0 0 3px rgba(201, 120, 78, .12); }
    .note-form textarea { min-height: 86px; resize: vertical; line-height: 1.7; }

    .note-submit {
      justify-self: end;
      border: 1px solid rgba(152, 83, 50, .24);
      border-radius: 999px;
      padding: 9px 17px;
      color: #fff8ec;
      background: linear-gradient(145deg, #cc8057, #b86e4a);
      box-shadow: 0 3px 8px rgba(130, 77, 46, .14);
      font: inherit;
      font-size: 13px;
      cursor: pointer;
    }

    .note-submit:hover { background: linear-gradient(145deg, #d18a61, #bf7651); }
    .note-submit:focus-visible { outline: 2px solid #9d5839; outline-offset: 3px; }
    .note-submit:disabled { cursor: wait; opacity: .65; }

    .note-status { min-height: 1.6em; margin: 13px 0 0; color: #85684e; font-size: 12px; line-height: 1.6; }
    .note-list { display: grid; gap: 9px; margin: 12px 0 0; padding: 0; list-style: none; }

    .note-item {
      padding: 11px 13px;
      border: 1px solid rgba(165, 126, 75, .16);
      border-radius: 3px 5px 4px 3px;
      background: rgba(255, 250, 231, .63);
      box-shadow: 0 3px 8px rgba(120, 78, 40, .06);
    }

    .note-item:nth-child(odd) { transform: rotate(.25deg); }
    .note-item:nth-child(even) { transform: rotate(-.2deg); }
    .note-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: #8f684a; font-size: 11px; }
    .note-author { font-weight: 650; }
    .note-date { flex: 0 0 auto; color: #aa8c70; }
    .note-content { margin: 0; color: #634b37; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
    .note-empty { padding: 9px 2px 0; color: #95775e; font-size: 12px; text-align: center; }

    .envelope-wrap {
      position: relative;
      z-index: 2;
      flex: 0 0 auto;
      width: min(430px, calc(100vw - 52px));
      aspect-ratio: 1.56;
      margin-top: 0;
      filter: drop-shadow(0 17px 19px rgba(118, 67, 39, .15));
      animation: envelope-arrive 1100ms cubic-bezier(.2, .72, .25, 1) both;
      transition: transform 750ms cubic-bezier(.2, .72, .25, 1), margin 800ms ease;
    }

    .envelope-button {
      position: absolute;
      inset: 0;
      display: block;
      width: 100%;
      height: 100%;
      padding: 0;
      overflow: hidden;
      border: 1px solid rgba(111, 69, 43, .30);
      border-radius: 8px 9px 7px 8px;
      background-color: var(--kraft);
      background-image:
        radial-gradient(ellipse at 21% 18%, rgba(255, 239, 216, .28), transparent 43%),
        radial-gradient(ellipse at 82% 92%, rgba(119, 68, 42, .15), transparent 50%),
        repeating-linear-gradient(0deg, rgba(91, 59, 39, .075) 0, rgba(91, 59, 39, .075) 1px, transparent 1px, transparent 5px),
        repeating-linear-gradient(88deg, rgba(255, 239, 216, .14) 0, rgba(255, 239, 216, .14) 1px, transparent 1px, transparent 7px);
      box-shadow: inset 0 0 0 5px rgba(255, 241, 220, .19), inset 0 0 25px rgba(98, 57, 34, .13);
      cursor: pointer;
      appearance: none;
      -webkit-tap-highlight-color: transparent;
    }

    .envelope-button:focus-visible {
      outline: 3px solid rgba(145, 77, 47, .76);
      outline-offset: 6px;
    }

    .envelope-button:disabled { cursor: default; }

    .envelope-button::before {
      content: "";
      position: absolute;
      z-index: 5;
      inset: 3px;
      border: 1px dashed rgba(104, 65, 43, .17);
      border-radius: 6px;
      pointer-events: none;
    }

    .envelope-pocket {
      position: absolute;
      z-index: 2;
      inset: 0;
      border-radius: inherit;
      background:
        linear-gradient(148deg, rgba(239, 200, 163, .98), #d5a078 52%, #c88f68);
      clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
      filter: drop-shadow(0 -1px 1px rgba(94, 54, 33, .2));
    }

    .envelope-pocket::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(145deg, transparent 48.5%, rgba(107, 67, 43, .18) 49%, transparent 49.5%), linear-gradient(35deg, transparent 48.5%, rgba(255, 235, 211, .24) 49%, transparent 49.5%);
      clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
    }

    .envelope-flap {
      position: absolute;
      z-index: 3;
      inset: 0 0 auto;
      height: 69%;
      background:
        linear-gradient(170deg, #e4b891 0%, var(--kraft-light) 54%, #d09a72 100%);
      clip-path: polygon(0 0, 100% 0, 50% 100%);
      transform-origin: 50% 0;
      transform-style: preserve-3d;
      transition: transform 780ms cubic-bezier(.34, .02, .25, 1), filter 780ms ease;
      filter: drop-shadow(0 3px 3px rgba(98, 58, 36, .16));
      backface-visibility: hidden;
    }

    .seal {
      position: absolute;
      z-index: 4;
      top: 43%;
      left: 50%;
      display: grid;
      width: 47px;
      aspect-ratio: 1;
      place-items: center;
      border: 1px solid rgba(255, 236, 215, .6);
      border-radius: 50%;
      color: #fff2e4;
      background: linear-gradient(145deg, #d18158, #bd6d4a);
      box-shadow: 0 3px 9px rgba(91, 49, 30, .24), inset 0 1px 3px rgba(255, 248, 229, .4);
      font-size: 17px;
      line-height: 1;
      transform: translate(-50%, -50%);
      transition: opacity 260ms ease, transform 350ms ease;
    }

    .open-hint {
      margin: 17px 0 0;
      color: rgba(111, 79, 58, .76);
      font-size: 13px;
      letter-spacing: .08em;
      transition: opacity 300ms ease;
    }

    .scene.is-open .letter-shell {
      grid-template-rows: 1fr;
      margin-bottom: 2px;
      opacity: 1;
    }

    .scene.is-open .letter-paper {
      transform: translateY(0) scale(1);
      opacity: 1;
    }

    .scene.is-open .letter-copy > * {
      animation: copy-reveal 520ms ease both;
    }

    .scene.is-open .letter-copy > *:nth-child(1) { animation-delay: 150ms; }
    .scene.is-open .letter-copy > *:nth-child(2) { animation-delay: 205ms; }
    .scene.is-open .letter-copy > *:nth-child(3) { animation-delay: 260ms; }
    .scene.is-open .letter-copy > *:nth-child(4) { animation-delay: 315ms; }
    .scene.is-open .letter-copy > *:nth-child(5) { animation-delay: 370ms; }
    .scene.is-open .letter-copy > *:nth-child(6) { animation-delay: 425ms; }
    .scene.is-open .letter-copy > *:nth-child(7) { animation-delay: 480ms; }
    .scene.is-open .letter-copy > *:nth-child(8) { animation-delay: 535ms; }
    .scene.is-open .letter-copy > *:nth-child(9) { animation-delay: 590ms; }

    .scene.is-open .envelope-wrap {
      margin-top: 22px;
      transform: translateY(11px);
      animation: none;
    }

    .scene.is-open .envelope-flap {
      z-index: 1;
      transform: rotateX(180deg);
      filter: brightness(.96);
    }

    .scene.is-open .seal {
      opacity: 0;
      transform: translate(-50%, -50%) scale(.8);
    }

    .scene.is-open .open-hint { opacity: 0; }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    @keyframes envelope-arrive {
      from { opacity: 0; transform: translateY(17px) scale(.985); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    @keyframes envelope-float {
      0%, 100% { translate: 0 0; }
      50% { translate: 0 -7px; }
    }

    @keyframes heartbeat {
      0%, 84%, 100% { transform: scale(1); }
      88% { transform: scale(1.13); }
      92% { transform: scale(1); }
      96% { transform: scale(1.08); }
    }

    @keyframes copy-reveal {
      from { opacity: 0; transform: translateY(8px); }
      to { opacity: 1; transform: translateY(0); }
    }

    @keyframes picture-reveal {
      from { opacity: 0; transform: translateY(7px) scale(.99); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .showcase-view .scene { min-height: calc(100vh - 88px); min-height: calc(100svh - 88px); padding-top: 26px; }

    @media (max-width: 768px) {
      body::after { opacity: .1; animation-duration: 70s; }
      .app-shell { padding: 12px 14px calc(88px + env(safe-area-inset-bottom)); }
      .view-nav {
        position: fixed;
        right: 10px;
        bottom: max(9px, env(safe-area-inset-bottom));
        left: 10px;
        width: auto;
        justify-content: space-around;
        gap: 3px;
        margin: 0;
        padding: 5px;
        border-radius: 18px;
        background: rgba(255, 248, 236, .94);
        box-shadow: 0 6px 24px rgba(109, 67, 42, .18);

      }
      .view-tab { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 7px 3px; font-size: 12px; letter-spacing: .01em; }
      .form-field, .form-submit, .upload-button, .reply-entry-button { min-height: 48px; }
      .short-form .form-field { min-height: 48px; }
      .photo-lightbox { padding: 10px; }
      .photo-lightbox-dialog { width: 100%; padding: 7px; }
      .photo-lightbox-close { top: 10px; right: 10px; min-width: 48px; min-height: 48px; }
      .touch-toast { right: 12px; bottom: calc(94px + env(safe-area-inset-bottom)); left: 12px; justify-content: space-between; max-width: none; }
      .touch-toast button { min-width: 48px; min-height: 48px; }
      .showcase-view .scene { min-height: calc(100svh - 72px); padding: 23px 10px 34px; }
      .page-view { min-height: calc(100svh - 60px); padding: 22px 0 35px; }
      .compose-grid { grid-template-columns: 1fr; }
      .short-form { grid-template-columns: 1fr; }
      .short-form .form-submit { justify-self: end; }
      textarea.form-field { min-height: 260px; }
      .free-board { transform: rotate(-.25deg); }
      .sticky-open-button { top: 16px; right: 16px; }
      .sticky-dialog-inner { padding: 19px; }
      .sticker-row { gap: 16px; margin: 8px auto 17px; }
      .sticker-row svg { width: 17px; height: 17px; }
    }

    @media (max-width: 560px) {
      .scene { justify-content: center; padding: 24px 14px 32px; }
      .letter-shell { width: 100%; }
      .letter-paper { padding: 30px 23px 32px; border-radius: 8px; }
      .letter-paper::before { inset: 9px; }
      .letter-copy { font-size: 16px; line-height: 1.98; letter-spacing: .015em; }
      .letter-copy p { margin-bottom: 1.15em; }
      .envelope-wrap { width: min(390px, calc(100vw - 42px)); }
      .scene.is-open .envelope-wrap { margin-top: 16px; }
      .ornament-heart { top: 7%; right: 12%; }
      .ornament-star { top: 15%; left: 9%; }
      .ornament-line { right: 10%; bottom: 7%; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
      }
    }

/* 原稿色值与贴纸不变；以下仅扩展布局、纸张层次与交互。 */
[hidden] { display: none !important; }
a { color: inherit; }
.view-nav { width: max-content; max-width: 100%; margin-bottom: 18px; }
a.view-tab { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.view-tab[aria-current="page"] { color: #70472f; background: #fff9ef; box-shadow: 0 2px 8px rgba(126,78,45,.11), inset 0 0 0 1px rgba(176,128,87,.15); }
.scene { min-height: calc(100svh - 108px); padding-top: 24px; }
.text-link { display: inline-block; border: 0; padding: 6px 0; background: transparent; color: var(--ink-soft); font: inherit; font-size: 13px; text-decoration: underline; text-decoration-color: rgba(174,121,82,.35); text-underline-offset: 5px; cursor: pointer; }
.text-link:hover { color: var(--orange); }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #a96743; outline-offset: 4px; }
.saved-card { position: sticky; top: 22px; }
.saved-card > .text-link { margin: -8px 0 16px; }
.saved-list { margin-top: 12px; }
.recent-link { display: block; padding: 6px 0; line-height: 1.6; text-decoration: none; overflow-wrap: anywhere; }
.saved-item { border-radius: 8px; }
.saved-item .record-date { margin: 4px 0 0; }
.form-stack { position: relative; }
.form-field { transition: border-color 180ms ease, box-shadow 180ms ease; }
.form-field:disabled { opacity: .65; }
.character-count { margin: -6px 0 0; text-align: right; color: var(--ink-soft); font-size: 11px; font-weight: 400; }
.free-board { width: 100%; min-height: 300px; padding: clamp(24px,4vw,40px); transform: none; }
.free-board > p { margin-bottom: 18px; }
#stickyList { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px 22px; padding-top: 8px; align-items: start; }
.sticky-note { position: relative; min-height: 170px; padding: 26px 21px 25px; border-radius: 2px 3px 18px 3px; background: rgba(255,250,231,.85); box-shadow: 2px 5px 0 rgba(138,91,51,.06),0 12px 24px rgba(129,83,42,.10); transform: rotate(-1deg); transition: transform 250ms ease, box-shadow 250ms ease; overflow-wrap: anywhere; }
.sticky-note:nth-child(3n + 2) { transform: rotate(1deg); background: #faedca; }
.sticky-note:nth-child(3n) { transform: rotate(-.4deg); background: #f7ebc8; }
.sticky-note::before { content: ""; position: absolute; top: -8px; left: calc(50% - 27px); width: 54px; height: 18px; border: 1px solid rgba(198,145,100,.13); background: rgba(239,200,159,.66); transform: rotate(-4deg); }
.sticky-note .record-meta { flex-wrap: wrap; gap: 7px; margin-bottom: 15px; padding-bottom: 9px; border-bottom: 1px dashed rgba(165,126,75,.22); }
.sticky-note .record-content { font-size: 15px; line-height: 1.95; }
.note-corner { position: absolute; bottom: 0; right: 0; width: 21px; height: 21px; border-radius: 3px 0 15px 0; background: linear-gradient(135deg,rgba(174,121,82,.14),rgba(255,250,231,.92) 52%); pointer-events: none; }
.sticky-note.is-new { animation: note-land 620ms cubic-bezier(.2,.75,.3,1) var(--delay,0ms) both; }
.sticky-dialog[open] { animation: dialog-unfold 280ms cubic-bezier(.2,.8,.3,1); }
.sticky-dialog[open]::backdrop { animation: backdrop-in 220ms ease; }
.sticker-row svg { transform-origin: center; animation: sticker-sway 1200ms ease-in-out 1; }
.sticker-row svg:nth-child(even) { animation-delay: -3s; animation-direction: reverse; }
.sticky-open-button { animation: invite-breathe 1400ms ease-in-out 2; }
.sticky-open-button:hover { animation-play-state: paused; transform: rotate(90deg); }
.library-page { width: min(100%,1060px); }
.library-tools { display: grid; grid-template-columns: 1fr minmax(150px,220px); gap: 18px; margin: 26px 0 15px; }
.letter-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; padding: 14px 0 0; margin: 0; list-style: none; }
.letter-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 260px; padding: 25px 22px 20px; border: 1px solid var(--paper-edge); border-radius: 8px 10px 8px 9px; background: var(--ivory); box-shadow: 0 7px 22px var(--warm-shadow); animation: page-rise 480ms ease var(--delay,0ms) both; transition: transform 230ms ease,box-shadow 230ms ease; }
.letter-card::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(174,135,99,.13); border-radius: 4px; pointer-events: none; }
.letter-card-top { display: flex; justify-content: space-between; align-items: center; color: var(--ink-soft); font-size: 11px; letter-spacing: .08em; }
.letter-mark { color: var(--orange); font-size: 22px; }
.letter-card h2 { margin: 19px 0 12px; font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.letter-title-link { text-decoration: none; }
.letter-title-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.letter-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 0 0 22px; font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-soft); }
.letter-card-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 13px; border-top: 1px solid rgba(165,126,75,.16); }
.letter-card-footer a { position: relative; z-index: 1; }
.library-empty { grid-column: 1/-1; padding: 45px 15px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; margin: 30px 0 12px; }
.pagination:empty { display: none; }
.page-button { min-height: 44px; padding: 8px 17px; border: 1px solid rgba(174,121,82,.3); border-radius: 999px; background: var(--ivory); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; transition: transform 180ms ease; }
.page-button:hover:not(:disabled) { transform: translateY(-2px); }
.page-button:disabled { opacity: .45; cursor: default; }
.page-position { font-size: 12px; color: var(--ink-soft); }
.reader-paper { max-width: 780px; margin: 25px auto 0; opacity: 1; transform: none; animation: page-rise 550ms ease both; }
.reader-heading { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid rgba(165,126,75,.2); }
.reader-heading h1 { font-size: clamp(23px,4vw,32px); line-height: 1.6; overflow-wrap: anywhere; }
.reader-heading .record-meta { margin: 12px 0 0; }
.reader-content, .original-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-paper .reply-entry-button { text-decoration: none; }
.image-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.reader-lightbox { max-width: min(96vw,1100px); max-height: 94svh; padding: 10px; border: 1px solid var(--paper-edge); border-radius: 12px; background: var(--ivory); }
.reader-lightbox::backdrop { background: rgba(72,49,36,.74); }
.reader-lightbox img { display: block; max-width: 100%; max-height: 85svh; object-fit: contain; }
.reader-lightbox .sticky-dialog-close { position: absolute; top: 18px; right: 18px; }
.celebration-heart { position: fixed; z-index: 100; pointer-events: none; color: var(--orange); font-size: 18px; animation: heart-fly 1000ms ease-out both; }
@keyframes note-land { from { opacity: 0; translate: 0 20px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes page-rise { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@keyframes dialog-unfold { from { opacity: 0; transform: translateY(16px) rotate(-1deg) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sticker-sway { 0%,100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-3px); } }
@keyframes invite-breathe { 0%,80%,100% { box-shadow: 0 4px 12px rgba(126,78,45,.1); } 90% { box-shadow: 0 4px 12px rgba(126,78,45,.1),0 0 0 7px rgba(201,120,78,.08); } }
@keyframes heart-fly { from { opacity: .9; transform: translate(-50%,-50%) scale(.6); } to { opacity: 0; transform: translate(calc(-50% + var(--dx)),-100px) rotate(var(--turn)) scale(1.1); } }
@media (hover:hover) and (pointer:fine) {
  .sticky-note:hover { z-index: 2; transform: translateY(-5px) rotate(0deg); box-shadow: 2px 9px 0 rgba(138,91,51,.06),0 18px 30px rgba(129,83,42,.15); }
  .letter-card:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: 0 13px 30px var(--warm-shadow); }
}
@media (max-width:960px) { .letter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:767px) {
  .app-shell { padding: 14px 13px calc(88px + env(safe-area-inset-bottom)); }
  .view-nav { gap: 1px; padding: 4px; width: auto; max-width: calc(100% - 20px); margin: 0; }
  .view-tab { min-width: 0; min-height: 44px; flex: 1 1 auto; padding: 7px 6px; font-size: 12px; letter-spacing: 0; }
  .view-tab:first-child { font-size: 11px; }
  .page-view { padding: 26px 2px 36px; }
  .saved-card { position: static; }
  .free-board { padding: 26px 17px; }
  #stickyList { grid-template-columns: 1fr; gap: 27px; padding: 10px 3px; }
  .sticky-note { min-height: 150px; padding: 25px 20px; }
  .library-tools { grid-template-columns: 1fr; gap: 12px; }
  .letter-grid { grid-template-columns: 1fr; gap: 20px; }
  .letter-card { min-height: 240px; padding: 24px 23px; }
  .reader-paper { padding: 32px 24px; }
  .reader-heading h1 { font-size: 25px; }
  .photo-lightbox-dialog { width: 100%; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.letter-card-footer .record-date { font-size: 11px; line-height: 1.7; }

/* 有限书架：每次六封/六张，月份归档。 */
.library-tools { grid-template-columns: minmax(0,1fr) minmax(135px,180px) minmax(135px,180px); }
.board-tools { display:grid;grid-template-columns:minmax(0,1fr) minmax(140px,210px);gap:16px;margin:28px 0 12px; }
.note-excerpt { display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden; }
.note-read { background:none;border:0;padding:12px 0 0;cursor:pointer;font:inherit; }
.note-reader { max-height:85dvh;overflow:auto; }
.note-reader .record-content { white-space:pre-wrap;overflow-wrap:anywhere; }
.note-reader:not([open]) { display:none; }
@media(max-width:700px){.library-tools,.board-tools{grid-template-columns:1fr;gap:12px}.board-tools{margin-top:24px}.free-board{overflow:visible}}

/* Adapted from Kami's Letter template (MIT). Existing site colours take precedence.
   https://github.com/tw93/Kami/blob/main/skills/kami/assets/templates/letter.html */
:root {
  --letter-serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --letter-hand: "Kaiti SC", "KaiTi", "STKaiti", "DFKai-SB", "Songti SC", serif;
  --letter-ui: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body { font-family: var(--letter-ui); font-weight: 400; }
.view-nav, .typesetting-toolbar, .form-label, .form-status, .upload-hint, .record-meta, .record-date, .page-position, .form-submit, .upload-button, .text-link, .reply-entry-button, .pagination, .view-kicker, .letter-category { font-family: var(--letter-ui); }
.view-heading h1 { font-family: var(--letter-serif); font-size: clamp(30px,4vw,40px); font-weight: 500; line-height: 1.3; letter-spacing: .03em; }
.view-heading p:last-child { font-family: var(--letter-serif); font-size: 16px; line-height: 1.75; }
.letter-card h2, .recent-link, .free-board h2, .sticky-dialog-heading h2, .reply-compose h2 { font-family: var(--letter-serif); font-weight: 500; }
.letter-card h2 { font-size: 22px; line-height: 1.55; }
.letter-excerpt { font-size: 16px; line-height: 1.75; letter-spacing: 0; }
.sticky-note .record-content { font-family: var(--letter-serif); font-size: 18px; line-height: 1.8; }
input.form-field, select.form-field { height: 50px; min-height: 50px; min-width: 0; max-width: 100%; padding: 0 14px; font: 400 16px/normal var(--letter-ui); letter-spacing: 0; }
textarea.form-field { font: 400 18px/1.8 var(--letter-serif); padding: 14px; }
select.form-field, input[type="search"] { font-family: var(--letter-ui); font-size: 16px; }
/* Reading column and Letter slots follow Kami's Letter template. */
.letter-shell { width: min(100%,880px); }
.letter-paper { padding: clamp(40px,6vw,76px) clamp(28px,7vw,104px) 52px; }
.reader-paper { max-width: 880px; }
.letterhead { margin: 0 0 38px; }
.letterhead .letterhead-line { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 28px; font: 11px/1.5 var(--letter-ui); letter-spacing: .12em; color: var(--ink-soft); }
.letterhead .letterhead-line span:last-child { letter-spacing: 0; }
.subject { margin: 0; }
.subject .label { margin: 0 0 10px; font: 12px/1.4 var(--letter-ui); color: var(--ink-soft); letter-spacing: .08em; }
.subject .title { margin: 0; color: var(--ink); font-family: var(--letter-serif); font-size: clamp(30px,4vw,40px); font-weight: 500; line-height: 1.35; letter-spacing: .02em; text-align: left; text-wrap: balance; overflow-wrap: anywhere; }
.letterhead .letterhead-meta { margin: 20px 0 0; font: 12px/1.6 var(--letter-ui); color: var(--ink-soft); }
.kami-letter { --letter-size: 20px; max-width: 36em; margin-inline: auto; font-family: var(--letter-serif); font-size: var(--letter-size); font-weight: 400; line-height: 1.75; letter-spacing: 0; color: var(--ink); line-break: strict; word-break: normal; overflow-wrap: anywhere; }
.kami-letter .salutation { margin: 0 0 28px; font-size: 1.1em; font-weight: 500; line-height: 1.55; text-indent: 0; }
.kami-letter .body-content p { margin: 0 0 1.2em; font-size: inherit; font-weight: 400; line-height: 1.75; text-align: justify; text-justify: inter-ideograph; text-indent: 2em; widows: 3; orphans: 3; }
.kami-letter .body-content p:last-child { margin-bottom: 0; }
.kami-letter .body-content .no-indent { text-indent: 0; text-align: left; }
.kami-letter .body-content .letter-postscript { margin-top: 1.75em; font-size: .9em; text-indent: 0; }
.kami-letter .closing { margin-top: 2em; text-align: right; break-inside: avoid; }
.kami-letter .closing .regards { margin: 0 0 .6em; font-size: inherit; line-height: 1.55; }
.kami-letter .closing .signature { margin: .6em 0 0; font-size: 1.1em; font-weight: 500; line-height: 1.55; }
.kami-letter .closing .signoff-meta { margin: .5em 0 0; font: 12px/1.6 var(--letter-ui); color: var(--ink-soft); }
.kami-letter .letter-raw { white-space: pre-wrap; line-height: 1.75; overflow-wrap: anywhere; }
.reader-content, .original-text { white-space: normal; }
.letter-copy:not(.kami-letter) { font-size: inherit; line-height: inherit; letter-spacing: 0; }
.typesetting-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; padding: 12px 0; color: var(--ink-soft); }
.layout-mode-group, .type-size-group { display: inline-flex; align-items: center; gap: 3px; }
.layout-mode-group { padding: 3px; border: 1px solid var(--paper-edge); border-radius: 999px; background: rgba(255,250,241,.62); }
.layout-button { min-height: 38px; padding: 7px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); font: 12px/1.4 var(--letter-ui); cursor: pointer; transition: background-color 180ms ease,transform 180ms ease; }
.layout-button[aria-pressed="true"] { background: var(--ivory); color: var(--ink); box-shadow: 0 2px 7px var(--warm-shadow); }
.layout-button:disabled { opacity: .38; cursor: default; }
.layout-button:hover:not(:disabled) { background: rgba(243,221,200,.55); }
.type-size { min-width: 36px; padding-inline: 7px; font-family: Georgia,serif; font-size: 15px; }
.reading-length { margin-left: auto; font-size: 11px; line-height: 1.5; white-space: nowrap; }
.print-letter { border: 1px solid var(--paper-edge); }
.reading-controls { width: min(100%,880px); margin: 8px auto 15px; }
.showcase-reading-controls { margin-top: 0; margin-bottom: 30px; padding-bottom: 12px; border-bottom: 1px solid var(--paper-edge); }
.reader-heading { border: 0; padding-bottom: 0; margin-bottom: 24px; }
.reader-paper .reader-heading h1 { font: inherit; }
.reader-paper .reader-heading .subject .title { font-size: clamp(30px,4vw,40px); font-weight: 500; line-height: 1.35; }
.reader-paper .record-image-frame { margin-top: 36px; }
.letter-paper > .reply-entry-button, .letter-copy > .reply-entry-button { margin-top: 36px; }
.letter-copy > .keepsake-figure { margin-top: 36px; }
/* Writing and preview share the same typesetting engine and paper components. */
#view-compose > .page-view { width: min(100%,1260px); }
.compose-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 28px; }
.compose-preview { position: sticky; top: 22px; min-width: 0; }
.compose-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compose-preview-header h2 { margin: 0; font: 13px/1.6 var(--letter-ui); color: var(--ink-soft); }
.preview-paper { position: relative; min-height: 450px; max-height: 78svh; overflow-y: auto; padding: 40px 36px; border: 1px solid var(--paper-edge); border-radius: 9px; background: var(--ivory); box-shadow: 0 12px 32px var(--warm-shadow); scrollbar-color: var(--kraft-light) transparent; }
.preview-paper .subject .title { font-size: 28px; line-height: 1.4; }
.preview-paper .kami-letter { font-size: calc(var(--letter-size) - 2px); }
.preview-paper .letterhead { margin-bottom: 30px; }
.preview-placeholder { margin: 22px 0 0; font: 16px/1.9 var(--letter-serif); color: var(--ink-soft); }
.preview-image { display: block; width: 100%; max-height: 280px; object-fit: contain; margin-top: 28px; border-radius: 6px; }
.recent-letters-section { margin-top: 32px; }
.recent-letters-section .saved-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.recent-letters-section > h2 { margin-bottom: 8px; font-size: 20px; font-weight: 500; }
.recent-letters-section > .text-link { margin-bottom: 12px; }
.recent-letters-section .record-date { font-size: 11px; }
.reply-page h1 { font-family: var(--letter-serif); font-weight: 500; font-size: clamp(30px,4vw,40px); line-height: 1.35; }
.reply-note .kami-letter { margin: 0; font-size: 18px; }
.reply-note .kami-letter .body-content p { text-align: left; text-indent: 0; margin-bottom: .8em; }
.reply-note .kami-letter .salutation { margin-bottom: 1em; }
.original-letter-copy { padding: 30px clamp(20px,5vw,60px); }
.original-letter-copy .kami-letter { font-size: 18px; }
.original-letter-copy h2 { font: 500 24px/1.5 var(--letter-serif); margin-bottom: 25px; }
@media (max-width:960px) {
  .compose-grid { grid-template-columns: minmax(0,1fr); }
  .compose-preview { position: static; }
  .preview-paper { max-height: none; }
}
@media (max-width:767px) {
  .view-heading h1 { font-size: 30px; }
  .letter-paper, .reader-paper { padding: 36px 23px 38px; }
  .subject .title, .reader-paper .reader-heading .subject .title { font-size: 30px; }
  .letterhead { margin-bottom: 28px; }
  .letterhead .letterhead-line { margin-bottom: 24px; gap: 12px; font-size: 10px; }
  .kami-letter { font-size: calc(var(--letter-size) - 2px); line-height: 1.75; }
  .kami-letter .body-content p { margin-bottom: 1.1em; }
  .kami-letter .salutation { margin-bottom: 24px; }
  .typesetting-toolbar { gap: 7px; }
  .layout-button { min-height: 42px; padding: 7px 9px; }
  .type-size { padding-inline: 6px; }
  .reading-length { width: 100%; margin: 2px 0 0; }
  .preview-paper { padding: 32px 24px; min-height: 360px; }
  .preview-paper .subject .title { font-size: 26px; }
  .recent-letters-section .saved-list { grid-template-columns: 1fr; }
  .reply-note .kami-letter { font-size: 17px; }
}
@page { size: A4; margin: 23mm; }
@media print {
  html,body { min-width: 0; background: var(--ivory); }
  body::before,body::after,.view-nav,.typesetting-toolbar,.sticker-row,.ornament,.envelope-wrap,.open-hint,.reply-entry-button,.reader-lightbox,.photo-lightbox,.touch-toast { display: none !important; }
  .app-shell,.page-view,.scene { width: 100%; max-width: none; min-height: 0; margin: 0; padding: 0; }
  .view-panel[hidden] { display: none !important; }
  .letter-shell { display: block; width: 100%; grid-template-rows: 1fr; opacity: 1; margin: 0; }
  .letter-clip { overflow: visible; }
  .letter-paper,.reader-paper { opacity: 1; transform: none; width: 100%; max-width: none; border: 0; border-radius: 0; margin: 0; padding: 0; box-shadow: none; background: none; overflow: visible; }
  .letter-paper::before,.letter-paper::after { display: none; }
  .kami-letter { max-width: none; font-size: 12pt; line-height: 1.55; }
  .kami-letter .body-content p { line-height: 1.55; margin-bottom: 14pt; }
  .subject .title,.reader-paper .reader-heading .subject .title { font-size: 22pt; }
  .keepsake-figure,.record-image-frame { break-inside: avoid; }
  *,*::before,*::after { animation: none !important; transition: none !important; }
}
@media (prefers-reduced-motion:reduce) { .layout-button { transition: none; } }
@media print {
  .library-page > .text-link, #readerStatus { display: none !important; }
}
@media (max-width:767px) {
  .reading-length { width: auto; flex: 1 1 110px; }
  .print-letter { margin-left: auto; }
}

html[data-private] body {
  visibility: hidden;
}
html {
  scroll-padding-top: 24px;
}
.auth-problem {
  max-width: 540px;
  margin: 20vh auto;
  padding: 32px;
  background: var(--ivory);
  border: 1px solid var(--paper-edge);
  border-radius: 22px;
}
.auth-problem .text-link {
  display: block;
  margin-top: 22px;
}
.account-bar {
  max-width: 1130px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font: 12px/1.5 var(--letter-ui);
}
.mail-brand {
  font-family: var(--letter-serif);
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.account-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.account-link {
  color: var(--ink-soft);
  background: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
}
.account-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
}
.theme-modes {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--paper-edge);
  border-radius: 24px;
  background: var(--ivory);
}
.theme-button {
  font: 11px/1.5 var(--letter-ui);
  padding: 5px 9px;
  border: 0;
  background: transparent;
  border-radius: 20px;
  color: var(--ink-soft);
  cursor: pointer;
}
.theme-button[aria-pressed="true"] {
  background: var(--apricot);
  color: var(--ink);
}
.unread-badge {
  display: inline-flex;
  min-width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  background: #bf6348;
  color: #fffaf1;
  font: 10px/1 var(--letter-ui);
  border-radius: 20px;
}
.unread-badge[hidden] {
  display: none;
}
.mail-toast {
  position: fixed;
  z-index: 1500;
  bottom: 95px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 560px);
  padding: 14px 24px;
  border: 1px solid var(--paper-edge);
  border-radius: 18px;
  background: var(--ivory);
  color: var(--ink);
  box-shadow: 0 10px 40px var(--warm-shadow);
  font: 14px/1.6 var(--letter-ui);
}
.soft-button {
  border: 1px solid var(--paper-edge);
  border-radius: 30px;
  background: var(--ivory);
  color: var(--ink);
  padding: 9px 17px;
  font: 13px/1.5 var(--letter-ui);
  cursor: pointer;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.soft-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 18px var(--warm-shadow);
}
button:disabled {
  cursor: wait;
  opacity: 0.65;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
}
.mail-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 9px 0;
}
.tag-pill {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--paper-edge);
  border-radius: 20px;
  background: rgba(243, 221, 200, 0.48);
  color: var(--ink-soft);
  font: 11px/1.5 var(--letter-ui);
}
.letter-features {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 28px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--paper-edge);
  font-family: var(--letter-ui);
}
.mini-label {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font: 11px/1.5 var(--letter-ui);
}
.mini-select {
  min-height: 36px;
  max-width: 100%;
  border: 1px solid var(--paper-edge);
  border-radius: 9px;
  padding: 5px 9px;
  background: var(--ivory);
  color: var(--ink);
  font: 13px/1.4 var(--letter-ui);
}
.export-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}
.letter-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tag-editor {
  width: 100%;
  font: 12px/1.7 var(--letter-ui);
  color: var(--ink-soft);
}
.tag-editor summary {
  cursor: pointer;
}
.tag-editor .form-field {
  width: min(100%, 340px);
  font: 14px var(--letter-ui);
  padding: 9px;
  margin: 10px 8px 0 0;
}
.letter-paper,
.preview-paper {
  position: relative;
}
.letter-paper[data-paper="ruled"],
.preview-paper[data-paper="ruled"] {
  background-color: #fffaf1;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 34px,
    rgba(135, 94, 63, 0.13) 35px,
    transparent 36px
  );
}
.letter-paper[data-paper="kraft"],
.preview-paper[data-paper="kraft"] {
  background: #e8c7a2;
  background-image: radial-gradient(
    rgba(135, 94, 63, 0.11) 0.6px,
    transparent 0.6px
  );
  background-size: 5px 5px;
}
.letter-paper[data-paper="plain"],
.preview-paper[data-paper="plain"] {
  background: var(--ivory);
}
.letter-paper .kami-letter,
.preview-paper .kami-letter {
  color: var(--letter-ink, var(--ink));
}
.letter-paper[data-font="hand"] .kami-letter,
.preview-paper[data-font="hand"] .kami-letter {
  font-family: var(--letter-hand);
  letter-spacing: 0.03em;
}
.paper-cat {
  position: absolute;
  right: 26px;
  top: calc(100% - 110px);
  width: 72px;
  height: 72px;
  object-fit: contain;
  opacity: 0.9;
  pointer-events: none;
  transform: rotate(7deg);
}
.letter-paper:has(> .paper-cat),
.preview-paper:has(> .paper-cat) {
  padding-bottom: 128px;
}
.compose-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 0;
  border: 0;
  margin: 4px 0 0;
  min-width: 0;
}
.compose-options .form-label {
  min-width: 0;
}
.compose-options select {
  width: 100%;
  font-size: 16px;
}
.compose-wide {
  grid-column: 1/-1;
}
.sticker-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.cat-choice {
  padding: 8px 3px 5px;
  border: 1px solid var(--paper-edge);
  background: var(--ivory);
  border-radius: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    transform 0.3s,
    background 0.3s;
}
.cat-choice img {
  display: block;
  width: 100%;
  height: 39px;
  object-fit: contain;
}
.cat-choice span {
  font: 10px var(--letter-ui);
}
.cat-choice[aria-pressed="true"] {
  background: var(--apricot);
  border-color: var(--orange);
  transform: translateY(-3px) rotate(-2deg);
}
.draft-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.draft-note {
  font: 12px/1.6 var(--letter-ui);
  color: var(--ink-soft);
}
.schedule-hint {
  font: 12px/1.7 var(--letter-ui);
  color: var(--ink-soft);
  margin: 0;
}
.compose-card input[type="datetime-local"] {
  font: 14px var(--letter-ui);
}
.collection-advanced {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 18px 0;
}
.collection-advanced > label {
  flex: 1;
  min-width: 130px;
}
.view-switch {
  display: flex;
  gap: 4px;
  background: var(--ivory);
  padding: 4px;
  border: 1px solid var(--paper-edge);
  border-radius: 30px;
}
.view-switch button {
  border: 0;
  background: none;
  color: var(--ink-soft);
  border-radius: 20px;
  padding: 9px 16px;
  font: 13px var(--letter-ui);
  cursor: pointer;
}
.view-switch button[aria-pressed="true"] {
  background: var(--apricot);
  color: var(--ink);
}
.timeline-grid {
  display: block !important;
  max-width: 820px;
  margin: 35px auto;
  padding-left: 28px;
  border-left: 1px solid var(--paper-edge);
}
.timeline-grid .letter-card {
  position: relative;
  max-width: 100%;
  margin: 0 0 24px;
  padding: 25px 30px;
  background: var(--ivory);
  border: 1px solid var(--paper-edge);
  border-radius: 4px 20px 20px 20px;
  list-style: none;
  animation: mail-rise 0.45s both;
}
.timeline-grid .letter-card::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 35px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 5px var(--cream);
}
.timeline-title {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 24px/1.6 var(--letter-serif);
  text-align: left;
  cursor: pointer;
}
.timeline-excerpt {
  margin: 12px 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.timeline-open-hint {
  font: 12px var(--letter-ui);
  color: var(--orange);
}
.timeline-grid .archive-sheet {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.timeline-trigger {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  position: relative;
  color: inherit;
  cursor: pointer;
}
.timeline-trigger h2 {
  font: 24px/1.6 var(--letter-serif);
  margin: 8px 0;
}
.draft-grid,
.inbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}
.draft-card,
.inbox-card {
  position: relative;
  background: var(--ivory);
  padding: 28px;
  border: 1px solid var(--paper-edge);
  border-radius: 6px 22px 22px 22px;
  box-shadow: 0 10px 30px var(--warm-shadow);
  animation: mail-rise 0.5s both;
  overflow-wrap: anywhere;
}
.draft-card::before {
  content: "";
  display: block;
  width: 54px;
  height: 15px;
  background: rgba(223, 177, 139, 0.42);
  position: absolute;
  top: -7px;
  left: 35px;
  transform: rotate(-4deg);
}
.draft-card h2,
.inbox-card h2 {
  font: 23px/1.5 var(--letter-serif);
  margin: 12px 0;
}
.draft-excerpt {
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  line-height: 1.8;
  margin: 15px 0;
}
.inbox-card details {
  margin: 15px 0;
}
.inbox-card .reply-full {
  white-space: pre-wrap;
  line-height: 1.9;
  padding-top: 15px;
}
.inbox-card summary {
  cursor: pointer;
  color: var(--orange);
}
.inbox-card.is-unread {
  border-left: 3px solid var(--orange);
}
.inbox-card.is-unread h2::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bf6348;
  margin-right: 8px;
}
.draft-empty {
  padding: 60px 30px;
  text-align: center;
  background: var(--ivory);
  border: 1px dashed var(--paper-edge);
  border-radius: 24px;
}
.locked-letter {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 2;
}
.auth-page {
  min-height: 100vh;
}
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
  gap: clamp(36px, 7vw, 100px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 50px 38px;
  align-items: center;
  min-height: 100vh;
}
.auth-story {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 0;
}
.auth-brand {
  font: 10px/1.5 var(--letter-ui);
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 45px;
}
.brand-seal {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--kraft);
  border-radius: 50%;
  font-size: 26px;
  color: var(--orange);
}
.auth-story h1 {
  font: clamp(31px, 3.8vw, 46px) / 1.6 var(--letter-serif);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 12px 0 18px;
}
.auth-story .view-kicker {
  text-align: left;
}
.auth-intro {
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-soft);
  margin: 0;
}
.auth-still-life {
  height: 260px;
  position: relative;
  max-width: 410px;
  margin: 30px 0 16px;
}
.auth-postcard {
  position: absolute;
  width: 230px;
  height: 205px;
  top: 0;
  left: 50px;
  transform: rotate(-7deg);
  padding: 25px 28px;
  background: var(--ivory);
  box-shadow: 0 10px 50px var(--warm-shadow);
  animation: auth-float 6s ease-in-out infinite;
}
.auth-postcard span {
  font: 22px var(--letter-serif);
  color: var(--ink);
}
.auth-postcard i {
  display: block;
  width: 75%;
  height: 1px;
  background: var(--paper-edge);
  margin-top: 20px;
}
.auth-postcard img {
  position: absolute;
  width: 65px;
  bottom: 18px;
  right: 18px;
}
.auth-envelope-art {
  position: absolute;
  bottom: 8px;
  left: 20px;
  width: 320px;
  height: 155px;
  border-radius: 4px 4px 12px 12px;
  background: var(--kraft-light);
  clip-path: polygon(0 0, 50% 40%, 100% 0, 100% 100%, 0 100%);
  display: grid;
  place-items: center;
  color: var(--orange);
  font-size: 45px;
  filter: drop-shadow(0 12px 15px var(--warm-shadow));
}
.auth-paper-note {
  position: absolute;
  right: 0;
  bottom: 14px;
  background: var(--apricot);
  padding: 18px 15px;
  transform: rotate(7deg);
  font:
    16px "Kaiti SC",
    serif;
  box-shadow: 0 10px 20px var(--warm-shadow);
}
.auth-orbit {
  position: absolute;
  right: 30px;
  top: 0;
  color: var(--orange);
  font-size: 28px;
  animation: auth-twinkle 4s ease-in-out infinite;
}
.auth-story-foot {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font: 11px/1.5 var(--letter-ui);
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin-top: 22px;
}
.auth-card {
  position: relative;
  background: rgba(255, 250, 241, 0.9);
  padding: clamp(27px, 4vw, 46px);
  border: 1px solid var(--paper-edge);
  border-radius: 32px 32px 10px 32px;
  box-shadow: 0 20px 70px var(--warm-shadow);
  animation: mail-rise 0.8s cubic-bezier(0.2, 0.65, 0.2, 1) both;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  display: block;
  height: 6px;
  background: repeating-linear-gradient(
    120deg,
    var(--kraft-light) 0 16px,
    transparent 16px 32px,
    var(--peach) 32px 48px,
    transparent 48px 64px
  );
  position: absolute;
  inset: 0 0 auto;
  opacity: 0.75;
}
.auth-card h2 {
  font: 27px/1.5 var(--letter-serif);
  font-weight: 500;
  margin: 14px 0 10px;
  max-width: 280px;
}
.auth-subtitle {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.8;
  margin-bottom: 26px;
}
.auth-stamp {
  position: absolute;
  right: 22px;
  top: 23px;
  width: 45px;
  height: 49px;
  border: 1px dashed var(--kraft);
  padding-top: 5px;
  text-align: center;
  transform: rotate(10deg);
  font: 11px/1.6 var(--letter-ui);
  color: var(--kraft-deep);
}
.auth-tabs {
  display: flex;
  border: 1px solid var(--paper-edge);
  padding: 4px;
  border-radius: 16px;
  background: var(--cream);
  margin-bottom: 26px;
  gap: 4px;
}
.auth-tabs button {
  width: 50%;
  border: 0;
  padding: 12px 8px;
  border-radius: 12px;
  background: none;
  color: var(--ink-soft);
  font: 14px var(--letter-ui);
  cursor: pointer;
  transition:
    background 0.3s,
    box-shadow 0.3s;
}
.auth-tabs button[aria-selected="true"] {
  background: var(--ivory);
  box-shadow: 0 3px 14px var(--warm-shadow);
  color: var(--ink);
}
.auth-card .form-stack {
  gap: 17px;
}
.auth-card .form-label {
  font-size: 12px;
  gap: 9px;
}
.auth-card .form-field {
  font: 14px var(--letter-ui);
  padding: 14px 15px;
  border-radius: 12px;
  min-height: 48px;
  background: var(--ivory);
}
.auth-card .form-submit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 13px;
  font: 14px var(--letter-ui);
  padding: 17px 19px;
  min-height: 52px;
}
.auth-card .form-status {
  min-height: 23px;
  margin: 0;
  font-size: 12px;
}
.auth-card .form-field[aria-invalid="true"] {
  border-color: #b8573b;
}
.field-hint {
  font: 11px/1.8 var(--letter-ui);
  color: var(--ink-soft);
  margin: -9px 0 0;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 12px var(--letter-ui);
  color: var(--ink-soft);
}
.check-label input {
  accent-color: var(--orange);
}
.auth-bottom-note {
  text-align: center;
  font-size: 11px;
  color: var(--ink-soft);
  margin: 26px 0 0;
  line-height: 1.8;
}
html[data-theme="warm"] {
  --cream: #f5e4bc;
  --apricot: #ecd2a1;
  --ivory: #fff0c8;
  --ink: #67492f;
  --ink-soft: #81613d;
  --peach: #e7c08e;
}
html[data-theme="warm"] body {
  background: #f5e4bc;
}
html[data-theme="warm"] .letter-paper[data-paper="plain"],
html[data-theme="warm"] .preview-paper[data-paper="plain"] {
  background: #fff0c8;
}
html[data-theme="night"] {
  color-scheme: dark;
  --cream: #2b2522;
  --apricot: #46372c;
  --peach: #654632;
  --ivory: #382e27;
  --ink: #efdac3;
  --ink-soft: #c4ac96;
  --orange: #dfa379;
  --kraft: #aa7d5c;
  --kraft-light: #74563e;
  --kraft-deep: #b88a68;
  --paper-edge: rgba(229, 195, 163, 0.2);
  --warm-shadow: rgba(0, 0, 0, 0.22);
}
html[data-theme="night"] body {
  background: #2b2522;
}
html[data-theme="night"] body::before,
html[data-theme="night"] body::after {
  opacity: 0.12;
}
html[data-theme="night"] .letter-paper,
html[data-theme="night"] .preview-paper,
html[data-theme="night"] .content-card,
html[data-theme="night"] .free-board,
html[data-theme="night"] .sticky-note,
html[data-theme="night"] .reply-note,
html[data-theme="night"] .sticky-dialog {
  background-color: var(--ivory);
  color: var(--ink);
  border-color: var(--paper-edge);
}
html[data-theme="night"] .letter-paper .kami-letter,
html[data-theme="night"] .preview-paper .kami-letter {
  color: var(--ink);
}
html[data-theme="night"] .letter-paper[data-paper="ruled"] {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 34px,
    rgba(229, 195, 163, 0.12) 35px,
    transparent 36px
  );
}
html[data-theme="night"] .letter-paper[data-paper="kraft"] {
  background-color: #4c3b2c;
}
html[data-theme="night"] .form-field,
html[data-theme="night"] .view-nav {
  background: var(--ivory);
  color: var(--ink);
}
html[data-theme="night"] .tag-pill {
  background: var(--apricot);
}
@keyframes mail-rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes auth-float {
  0%,
  100% {
    transform: translateY(0) rotate(-7deg);
  }
  50% {
    transform: translateY(-9px) rotate(-4deg);
  }
}
@keyframes auth-twinkle {
  50% {
    transform: rotate(15deg) scale(0.9);
    opacity: 0.6;
  }
}
@media (max-width: 900px) {
  .account-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .theme-modes {
    margin-left: auto;
  }
  .auth-layout {
    gap: 35px;
    padding: 30px 24px;
  }
  .auth-story h1 {
    font-size: 32px;
  }
  .auth-card h2 {
    font-size: 24px;
  }
  .auth-story-foot {
    gap: 10px;
  }
  .auth-still-life {
    transform: scale(0.85);
    transform-origin: left center;
    width: 350px;
  }
  .account-name {
    display: none;
  }
}
@media (max-width: 700px) {
  .auth-layout {
    grid-template-columns: 1fr;
    max-width: 540px;
    padding: 24px 20px 38px;
    gap: 24px;
  }
  .auth-story {
    padding: 0;
  }
  .auth-brand {
    margin-bottom: 22px;
  }
  .auth-story h1 {
    font-size: 29px;
    line-height: 1.5;
    margin-bottom: 12px;
  }
  .auth-intro {
    font-size: 14px;
  }
  .auth-still-life {
    position: absolute;
    right: -25px;
    top: 85px;
    transform: scale(0.46);
    transform-origin: right top;
    opacity: 0.85;
    pointer-events: none;
  }
  .auth-story-foot {
    margin-top: 22px;
    font-size: 10px;
    gap: 14px;
  }
  .auth-story .view-kicker {
    font-size: 10px;
  }
  .auth-intro {
    max-width: 230px;
  }
  .auth-card {
    padding: 30px 25px;
    border-radius: 25px;
  }
  .auth-card h2 {
    font-size: 24px;
  }
  .auth-story {
    overflow: hidden;
    min-height: 275px;
  }
  .account-bar {
    margin-bottom: 15px;
  }
  .mail-brand {
    font-size: 14px;
  }
  .account-actions {
    gap: 10px;
    font-size: 11px;
  }
  .theme-modes {
    margin: 0;
  }
  .account-bar .theme-modes {
    width: 100%;
    justify-content: center;
  }
  .theme-button {
    flex: 1;
  }
  .view-nav .view-tab {
    font-size: 10px;
    padding: 10px 8px;
  }
  .compose-options {
    grid-template-columns: 1fr;
  }
  .compose-wide {
    grid-column: auto;
  }
  .sticker-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .draft-grid,
  .inbox-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .draft-card,
  .inbox-card {
    padding: 23px;
  }
  .timeline-grid {
    padding-left: 20px;
  }
  .timeline-grid .letter-card {
    padding: 20px;
  }
  .timeline-grid .letter-card::before {
    left: -26px;
  }
  .timeline-trigger h2 {
    font-size: 22px;
  }
  .collection-advanced {
    gap: 10px;
  }
  .collection-advanced > label {
    min-width: calc(50% - 10px);
  }
  .letter-features {
    gap: 10px;
  }
  .mini-label {
    flex: 1;
    min-width: 75px;
  }
  .export-actions {
    width: 100%;
  }
  .paper-cat {
    right: 17px;
    width: 60px;
    height: 60px;
  }
  .draft-actions .soft-button {
    flex: 1;
  }
  .library-page {
    padding-top: 24px;
  }
  .auth-stamp {
    right: 18px;
    top: 22px;
    width: 37px;
    font-size: 10px;
  }
  .auth-card h2 {
    max-width: 235px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .account-bar,
  .letter-features,
  .mail-toast {
    display: none !important;
  }
  .letter-paper .kami-letter {
    color: #684b38 !important;
  }
  .letter-paper {
    box-shadow: none;
  }
  .paper-cat {
    position: absolute;
  }
}

.collection-advanced .form-field {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.collection-filter-panel {
  border: 1px dashed var(--paper-edge);
  border-radius: 16px;
  padding: 14px 18px;
  margin: 18px 0;
  background: rgba(255, 250, 241, 0.25);
}
.collection-filter-panel summary {
  cursor: pointer;
  font: 13px/1.6 var(--letter-ui);
  color: var(--ink-soft);
}
.collection-filter-panel .collection-advanced {
  margin-bottom: 4px;
}
.library-page > .view-switch {
  width: max-content;
  margin: 18px 0;
}
.auth-card .form-submit {
  width: 100%;
}
.auth-title-line {
  display: inline;
}
@media (max-width: 700px) {
  .auth-title-line {
    display: block;
  }
  .auth-card h2 {
    max-width: 100%;
  }
  .library-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .library-tools > .form-label:first-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 400px) {
  .collection-advanced > label {
    flex-basis: 100%;
    min-width: 0;
  }
  .collection-advanced .form-field {
    min-width: 0;
  }
}
@media (max-width: 370px) {
  .auth-still-life {
    opacity: 0.24;
    right: -45px;
    top: 110px;
    transform: scale(0.37);
  }
  .auth-story h1 {
    font-size: 26px;
    position: relative;
    z-index: 1;
  }
  .auth-card {
    padding: 28px 22px;
  }
  .auth-story-foot {
    gap: 7px;
  }
}

.auth-card [role="tabpanel"] {
  animation: mail-rise 0.35s cubic-bezier(0.2, 0.65, 0.2, 1) both;
}
.cat-choice:hover {
  transform: translateY(-3px) rotate(2deg);
}

/* Form rhythm: one baseline, one control size, no native fieldset outline. */
.compose-options-title { grid-column: 1/-1; margin: 0 0 4px; font: 600 15px/1.6 var(--letter-ui); color: var(--ink); }
.form-label { min-width: 0; line-height: 1.5; }
.compose-card input[type="datetime-local"] { height: 50px; min-height: 50px; font: 400 16px/normal var(--letter-ui); }
input[type="date"], input[type="datetime-local"] { appearance: none; -webkit-appearance: none; }
input::-webkit-date-and-time-value { text-align: left; }
.compose-card .form-submit { min-height: 50px; }
.collection-advanced { gap: 16px; }
.collection-advanced > label { min-width: 0; }
.reply-search-tools { display: grid; grid-template-columns: minmax(0,1.45fr) repeat(2,minmax(0,1fr)) auto; align-items: end; }
.reply-search-tools > .text-link { display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 8px; white-space: nowrap; }
.content-card:hover { transform: none; }
.compose-card { min-width: 0; }
.compose-options > *, .form-stack > * { min-width: 0; }
.compose-preview .preview-paper { contain: layout style; }
@media (max-width:960px) { .compose-preview .preview-paper { max-height: 70svh; } }
@media (max-width:700px) {
  .compose-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 10px; padding: 16px 0; }
  .compose-options-title, .compose-wide { grid-column: 1/-1; }
  .compose-options select { padding-inline: 8px; font-size: 16px; }
  .reply-search-tools { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 12px; }
  .reply-search-tools > label:first-child { grid-column: 1/-1; }
  .reply-search-tools > .text-link { grid-column: 1/-1; justify-self: end; height: 36px; }
  .sticker-picker { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
  .draft-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .draft-actions .soft-button { justify-content: center; min-height: 44px; text-align: center; }
  .compose-card { padding: 24px 18px; }
}
@media (max-width:360px) { .compose-options { grid-template-columns: 1fr; } }

.compose-card .photo-preview-frame:has(#composePreview[hidden]) .photo-preview-surface { aspect-ratio: auto; height: 110px; }
@media (min-width:961px) { .compose-card h2 { margin-bottom: 4px; } }
@media (max-width:700px) {
  .account-bar { display: grid; grid-template-columns: minmax(0,1fr); }
  .account-actions { justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .account-bar .theme-modes { width: 100%; margin: 0; }
  .intro-replay { padding-left: 0; }
}

.reply-tools { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 10px 14px; }
.reply-tools > .form-label, .reply-tools > .form-status, .reply-tools > .pagination { grid-column: 1/-1; margin-block: 0; }
.reply-tools > .pagination { margin-top: 8px; }
@media (max-width:700px) { .reply-tools { grid-template-columns: minmax(0,1fr); gap: 12px; } }

/* First-letter opening: no per-frame expansion of the full document height. */
.scene .letter-shell { display: none; opacity: 1; transition: none; }
.scene.is-unsealing .envelope-button { overflow: visible; }
.scene.is-unsealing .envelope-flap { transform: rotateX(175deg); transition: transform 560ms cubic-bezier(.22,.72,.2,1); }
.scene.is-unsealing .seal { opacity: 0; transform: scale(.8); }
.scene.is-open .letter-shell { display: block; margin: 0 auto; }
.scene.is-open .letter-paper { opacity: 1; transform: none; transition: none; animation: showcase-paper-reveal 420ms ease both; }
.scene.is-open .letter-copy > * { animation: none; }
.scene.is-open .envelope-wrap, .scene.is-open .open-hint { display: none; }
@keyframes showcase-paper-reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion:reduce) { .scene.is-open .letter-paper { animation: none; } }
@media print { .scene .letter-shell { display: block; } }

.pwa-tools {display:flex;justify-content:center;padding:20px 18px calc(24px + env(safe-area-inset-bottom,0px));gap:12px}.pwa-tools[hidden]{display:none}.pwa-install{font:inherit;font-size:14px;line-height:1.4;min-height:44px;padding:10px 22px;background:var(--ivory,#fffaf1);color:var(--ink,#684b38);border:1px solid var(--paper-edge,rgba(135,94,63,.18));border-radius:28px;cursor:pointer}.pwa-install:focus-visible,.pwa-address:focus-visible{outline:2px solid var(--orange,#c9784e);outline-offset:4px}.pwa-dialog{box-sizing:border-box;width:min(440px,calc(100vw - 32px));max-height:calc(100svh - 48px);overflow-y:auto;padding:28px;border:0;border-radius:22px;background:var(--ivory,#fffaf1);color:var(--ink,#684b38);box-shadow:0 18px 60px rgba(104,75,56,.18);font:inherit;line-height:1.8}.pwa-dialog::backdrop{background:rgba(104,75,56,.35)}.pwa-dialog h2{margin:0 0 14px;font-size:22px;font-weight:500}.pwa-dialog p,.pwa-dialog li{font-size:14px}.pwa-dialog ol{padding-left:22px}.pwa-dialog li{margin:10px 0}.pwa-note{color:var(--ink-soft,#80634d)}.pwa-address{box-sizing:border-box;width:100%;min-width:0;height:44px;padding:8px 12px;border:1px solid var(--paper-edge,rgba(135,94,63,.18));border-radius:10px;font:inherit;font-size:13px;background:transparent;color:inherit}.pwa-dialog>.pwa-install{display:block;margin:18px 0 0 auto}@media(display-mode:standalone){body{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}.pwa-tools{display:none}}
.web-push-settings{max-width:440px;margin:0 auto;padding:0 20px 28px;text-align:center}.web-push-status{font:12px/1.7 var(--letter-ui,system-ui);color:var(--ink-soft,#80634d);margin:10px 0 0;overflow-wrap:anywhere}.web-push-settings button:disabled{opacity:.6;cursor:default}@media(max-width:700px){.web-push-settings{padding-bottom:calc(104px + env(safe-area-inset-bottom,0px))}.web-push-settings:has(button)~.pwa-tools{padding-bottom:12px}}
.web-push-reset{border:0;background:none;color:var(--ink-soft,#80634d);font:inherit;cursor:pointer;margin:8px auto 0;display:inline-flex;min-height:36px;font-size:12px}.web-push-reset[hidden]{display:none}

/* Mobile editorial layout. Palette, sticker artwork and reading engine are inherited. */
.writing-heading {position:relative;padding-right:38px}
.writing-number {font:11px/1.5 var(--letter-ui);letter-spacing:.16em;color:var(--ink-soft)}
.writing-heading h2 {margin:9px 0 20px;font:500 24px/1.5 var(--letter-serif)}
.writing-seal {position:absolute;right:0;top:0;font-size:29px;color:var(--orange)}
.compose-attachment {min-width:0}
.compose-personalize {border-block:1px solid var(--paper-edge);padding:16px 0;margin:8px 0}
.compose-personalize>summary,.compose-preview-fold>summary {cursor:pointer;font:500 15px/1.6 var(--letter-ui);color:var(--ink);list-style:none;position:relative;padding:4px 30px 4px 0}
.compose-personalize>summary::-webkit-details-marker,.compose-preview-fold>summary::-webkit-details-marker {display:none}
.compose-personalize>summary::after,.compose-preview-fold>summary::after {content:'+';position:absolute;right:3px;top:2px;font:24px/1 var(--letter-ui);color:var(--orange)}
.compose-personalize[open]>summary::after,.compose-preview-fold[open]>summary::after {content:'−'}
.compose-personalize>summary span,.compose-preview-fold>summary span {display:block;font:12px/1.6 var(--letter-ui);color:var(--ink-soft);margin-top:3px}
.compose-personalize .compose-options-title {display:none}
.compose-preview-fold>summary {margin-bottom:16px}
.board-heading h2 {margin:8px 56px 8px 0}
.board-heading p {margin:0;font:13px/1.7 var(--letter-ui);color:var(--ink-soft)}
@media(min-width:701px) {.compose-preview-fold>summary {display:none}.compose-personalize {margin-block:14px}}
@media(max-width:700px) {
  :root {--mobile-control:48px}
  .app-shell {padding:18px 20px calc(98px + env(safe-area-inset-bottom,0px))}
  .account-bar {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px 12px;margin-bottom:8px;padding:0 0 18px;border-bottom:1px solid var(--paper-edge)}
  .mail-brand {font:500 16px/1.5 var(--letter-serif);letter-spacing:-.02em;min-width:0}
  .account-actions {justify-content:flex-end;gap:12px;flex-wrap:nowrap;font-size:11px}
  .account-actions .account-name {display:none}
  .account-actions .account-link {min-height:34px;white-space:nowrap}
  .account-bar .theme-modes {grid-column:1;grid-row:2;justify-self:start;width:auto;margin:0;padding:3px}
  .theme-button {min-height:30px;padding:4px 14px;font-size:11px}
  .intro-replay {grid-column:2;grid-row:2;justify-self:end;font-size:11px;padding:8px 0}
  .view-nav {position:fixed;z-index:40;left:12px;right:12px;bottom:max(10px,env(safe-area-inset-bottom,0px));width:auto;max-width:none;margin:0;display:flex;align-items:stretch;gap:2px;padding:7px 6px;border-radius:24px;border:1px solid var(--paper-edge);background:var(--ivory);box-shadow:0 8px 28px var(--warm-shadow);backdrop-filter:none;-webkit-backdrop-filter:none;transform:none}
  .view-nav>.view-tab {display:flex;flex:1 1 0;min-width:0;min-height:52px;flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:5px 2px;font:11px/1.3 var(--letter-ui);border-radius:17px;letter-spacing:0;white-space:nowrap}
  .view-nav>.view-tab[data-nav='showcase'] {display:none}
  .view-tab::before {content:'';width:20px;height:20px;background:currentColor;mask:center/contain no-repeat var(--tab-icon);-webkit-mask:center/contain no-repeat var(--tab-icon)}
  .view-tab[data-nav='letters'] {--tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='15' rx='2'/%3E%3Cpath d='m3 7 9 7 9-7M5 3h14'/%3E%3C/svg%3E")}
  .view-tab[data-nav='compose'] {--tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 4H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-7M16 3l5 5-10 10-5 1 1-5Z'/%3E%3C/svg%3E")}
  .view-tab[data-nav='sticky'] {--tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M4 3h16v12l-6 6H4ZM14 21v-6h6M8 8h8M8 12h5'/%3E%3C/svg%3E")}
  .view-tab[data-nav='replies'] {--tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M9 6 3 12l6 6M4 12h10a6 6 0 0 1 6 6M3 12V4h18v9'/%3E%3C/svg%3E")}
  .view-tab[href*='drafts'] {--tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M6 3h9l4 4v14H6ZM15 3v5h4M9 12h7M9 16h5'/%3E%3C/svg%3E")}
  .view-nav:has([data-nav='showcase'][aria-current='page']) [data-nav='letters'] {background:var(--apricot);color:var(--ink)}
  .page-view,.library-page {padding:30px 0 32px;min-height:0;width:100%}
  .view-heading {position:relative;text-align:left;margin-bottom:20px;padding:0}
  .view-heading .view-kicker {font:11px/1.6 var(--letter-ui);letter-spacing:.12em;margin:0 0 10px}
  .view-heading h1 {font:500 31px/1.4 var(--letter-serif);letter-spacing:.02em;margin:0 0 10px}
  .view-heading p:last-child {font:14px/1.8 var(--letter-ui);max-width:28em;margin:0;color:var(--ink-soft)}
  .page-view>.sticker-row {justify-content:flex-start;margin:16px 0 24px;gap:14px}
  .page-view>.sticker-row svg {width:23px;height:23px}
  input.form-field,select.form-field {height:var(--mobile-control);min-height:var(--mobile-control);font:400 16px/normal var(--letter-ui);padding:0 13px;border-radius:13px;max-width:100%;min-width:0}
  .form-label {font:500 12px/1.6 var(--letter-ui);gap:8px;color:var(--ink-soft)}
  .form-field:focus {outline:2px solid var(--peach);outline-offset:3px;box-shadow:none}
  .form-submit {min-height:50px;border-radius:15px;font:500 16px/1.4 var(--letter-ui);letter-spacing:.04em}
  .compose-grid {gap:18px}
  .compose-card {padding:27px 22px 22px;border:1px solid var(--paper-edge);border-radius:6px 6px 20px 6px;background:var(--ivory);box-shadow:0 8px 22px var(--warm-shadow)}
  .compose-card::before {display:none}
  .writing-heading h2 {font-size:23px;line-height:1.6;margin-bottom:18px}
  .writing-number {font-size:10px}
  .writing-seal {font-size:28px}
  .compose-card .form-label[for='composeTitle'] {margin:0}
  #composeTitle {height:54px;min-height:54px;border:0;border-bottom:1px solid var(--paper-edge);border-radius:0;background:transparent;padding:4px 0 12px;font:500 20px/1.5 var(--letter-serif);color:var(--ink);box-shadow:none}
  #composeTitle::placeholder {font-size:17px;color:var(--ink-soft);opacity:.7}
  .compose-card .form-label[for='composeContent'] {margin-top:4px}
  #composeContent,#replyContent,#stickyContent {border:0;border-radius:0;padding:4px 0;font:400 17px/32px var(--letter-serif);color:var(--ink);background:repeating-linear-gradient(to bottom,transparent 0,transparent 31px,var(--paper-edge) 31px,var(--paper-edge) 32px);background-position:0 4px;box-shadow:none;resize:vertical;caret-color:var(--orange)}
  #composeContent {height:340px;min-height:260px;max-height:65svh}
  #composeContent::placeholder,#replyContent::placeholder,#stickyContent::placeholder {font-size:16px;color:var(--ink-soft);opacity:.7}
  .compose-attachment {display:grid;grid-template-columns:minmax(0,1fr) 76px;gap:8px 16px;align-items:center;border:1px dashed var(--paper-edge);border-radius:14px;padding:14px;margin:3px 0;background:transparent}
  .compose-attachment>div {min-width:0}
  .compose-attachment .upload-button {display:inline-flex;min-height:40px;align-items:center;padding:0;background:none;box-shadow:none;border:0;font:500 13px/1.6 var(--letter-ui);color:var(--ink)}
  .compose-attachment .upload-button::before {content:'＋';font-size:19px;margin-right:6px}
  .compose-attachment .upload-hint {font:10px/1.6 var(--letter-ui);margin:0;color:var(--ink-soft)}
  .compose-attachment .photo-preview-frame {margin:0;padding:0;border-radius:10px;overflow:hidden;box-shadow:none;border:0}
  .compose-card .compose-attachment .photo-preview-surface {height:76px;min-height:0;aspect-ratio:1}
  .compose-attachment .photo-placeholder-hint {padding:8px}
  .compose-attachment .photo-placeholder-hint>span {font-size:25px}
  .compose-attachment .photo-placeholder-hint p {display:none}
  .compose-attachment #removeImage {grid-column:1/-1;justify-self:end;margin:0;padding:0;font-size:12px}
  .compose-personalize {margin:0;padding:17px 0}
  .compose-options {grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 10px;padding:22px 0 0}
  .compose-options select {font-size:14px;padding-inline:8px;border-radius:10px}
  .compose-options input {font-size:16px}
  .compose-options .compose-wide {grid-column:1/-1}
  .schedule-hint,.draft-note {font:11px/1.7 var(--letter-ui)}
  .sticker-picker {grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
  .cat-choice {padding:8px 3px;min-height:70px;border-radius:12px}
  .cat-choice img {width:31px;height:31px}
  .cat-choice span {font-size:10px}
  .draft-actions {display:flex;flex-wrap:wrap;gap:6px;margin:0}
  .draft-actions .soft-button {flex:1 1 auto;min-height:40px;font-size:11px;padding:8px 6px;border:0;background:var(--cream);border-radius:10px;white-space:nowrap}
  #draftStatus {margin:0;min-height:18px;font-size:10px;line-height:1.6}
  #saveLetterButton {width:100%;margin-top:2px}
  #composeStatus:empty {display:none}
  .compose-preview {padding:0;border:0;background:none;box-shadow:none}
  .compose-preview-fold {border:1px solid var(--paper-edge);border-radius:16px;padding:17px 18px;background:rgba(255,250,241,.45)}
  .compose-preview-fold>summary {margin:0;font-size:14px}
  .compose-preview-fold[open]>summary {margin-bottom:20px}
  .compose-preview-header {display:none}
  .compose-preview .preview-paper {padding:30px 21px;margin-top:16px;max-height:none}
  .compose-preview .typesetting-toolbar {gap:6px}
  .recent-letters-section {padding:22px 18px;border-radius:16px;margin-top:26px;box-shadow:none}
  .recent-letters-section h2 {font-size:20px}
  .library-tools {margin:0 0 16px;gap:13px 10px;grid-template-columns:repeat(2,minmax(0,1fr))}
  .library-tools .form-label:first-child {grid-column:1/-1}
  .library-tools .form-field {margin:0}
  .collection-filter-panel {border:0;border-block:1px solid var(--paper-edge);border-radius:0;background:transparent;padding:14px 0;margin:8px 0 16px}
  .collection-filter-panel summary {font-size:12px}
  .collection-advanced {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 10px;padding:14px 0 0}
  .collection-advanced>label {min-width:0}
  .collection-advanced .form-field {margin:0}
  .library-page>.view-switch {margin:16px 0 10px}
  #libraryStatus {font-size:11px;margin:12px 0}
  .letter-grid {padding:0;gap:18px;grid-template-columns:minmax(0,1fr)}
  .archive-envelope {max-width:300px;height:278px}
  .envelope-card .archive-title {font-size:20px}
  .archive-reader {width:calc(100% - 20px);max-height:calc(100svh - 24px);padding:0;border-radius:16px}
  .archive-reader-paper {padding:30px 22px}
  .archive-reader-close {min-height:44px;font-size:12px}
  .letter-paper .kami-letter,.reader-paper .kami-letter {font-size:17px;line-height:1.9}
  #view-sticky .page-view {padding-bottom:10px}
  .free-board {padding:24px 0 12px;border:0;border-top:1px solid var(--paper-edge);border-radius:0;background:transparent;box-shadow:none;min-height:0;transform:none;overflow:visible}
  .free-board::before,.free-board::after {display:none}
  .board-heading {padding-right:55px}
  .board-heading h2 {margin:8px 0;font:500 24px/1.5 var(--letter-serif)}
  .board-heading p {font-size:12px}
  .sticky-open-button {top:30px;right:0;width:46px;height:46px;min-height:46px;line-height:1;border-radius:15px;font:300 28px/1 var(--letter-ui);box-shadow:0 5px 12px var(--warm-shadow)}
  .board-tools {grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:10px;margin:24px 0 8px}
  .board-tools .form-field {padding-inline:10px;font-size:14px;margin:0}
  #stickyStatus {font-size:11px;margin:14px 0 20px}
  #stickyList {display:grid;grid-template-columns:minmax(0,1fr);gap:26px;margin:0;padding:0 4px}
  #stickyList .sticky-note {min-height:196px;padding:28px 22px 20px;border:1px solid var(--paper-edge);border-radius:4px 4px 24px 4px;box-shadow:0 7px 15px rgba(120,70,38,.07);transform:rotate(-.6deg);margin:0 5px 0 0}
  #stickyList .sticky-note:nth-child(2n) {transform:rotate(.6deg);margin:0 0 0 5px}
  .sticky-note .record-meta {border-bottom:0;padding-bottom:0;margin-bottom:17px;display:flex;justify-content:space-between;gap:8px;font:12px/1.6 var(--letter-ui)}
  .sticky-note .record-date {font-size:10px;max-width:58%;text-align:right}
  .sticky-note .record-content {font:400 17px/1.9 var(--letter-serif);margin:0 0 14px}
  .sticky-note .note-read {font-size:11px;padding:6px 0;margin-top:4px}
  .sticky-note::before {height:16px;top:-8px}
  #stickyDialog {inset:auto 0 0;width:100%;max-width:100%;max-height:90svh;margin:0;border:0;border-radius:26px 26px 0 0;padding:0;animation:mobile-note-sheet .32s cubic-bezier(.2,.7,.2,1) both}
  #stickyDialog .sticky-dialog-inner {padding:28px 24px calc(26px + env(safe-area-inset-bottom,0px));max-height:90svh;overflow-y:auto}
  #stickyDialog .sticky-dialog-inner::before {content:'';display:block;width:34px;height:4px;border-radius:4px;background:var(--peach);margin:-14px auto 25px}
  .sticky-dialog-heading {align-items:center;margin-bottom:23px}
  .sticky-dialog-heading h2 {font:500 23px/1.6 var(--letter-serif);padding-right:35px;margin:0}
  #closeStickyDialog {width:40px;height:40px;min-height:40px;border-radius:50%;font-size:23px}
  #stickyContent {height:210px;min-height:180px}
  #stickyCount {font:11px/1.6 var(--letter-ui);margin:0}
  #stickySubmit {width:100%}
  .note-reader {width:calc(100% - 30px);max-height:85svh;border-radius:18px}
  .note-reader .sticky-dialog-inner {padding:34px 24px}
  .reply-page {padding:28px 0 36px}
  .reply-page>h1 {font:500 29px/1.5 var(--letter-serif);text-align:left;margin:18px 0 8px}
  .reply-page>.subtitle {text-align:left;font-size:13px}
  .reply-page>.top-mark {justify-content:flex-start;font-size:11px}
  .reply-compose {padding:26px 22px;border-radius:6px 6px 20px 6px;box-shadow:0 8px 22px var(--warm-shadow)}
  .reply-compose h2 {font-size:23px;margin-bottom:12px}
  #replyContent {min-height:220px;height:270px}
  .reply-compose .form-submit {width:100%}
  .reply-tools {padding:16px 0}
  .reply-search-tools>label:first-child {grid-column:1/-1}
  .reply-tools input,.reply-tools select {margin:0}
  .pwa-tools {padding-bottom:calc(102px + env(safe-area-inset-bottom,0px));padding-top:0}
  .pwa-install {font-size:12px}
  .auth-page .pwa-tools {padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:360px) {
 .app-shell {padding-inline:15px}
 .account-bar {gap:12px 7px}
 .mail-brand {font-size:14px}
 .account-actions {gap:8px;font-size:10px}
 .theme-button {padding-inline:11px}
 .compose-card {padding-inline:18px}
 .writing-heading h2 {font-size:21px}
 .compose-personalize>summary {font-size:13px}
 .compose-personalize>summary span {font-size:10px}
 .view-heading h1 {font-size:29px}
}
@keyframes mobile-note-sheet {from {opacity:0;transform:translateY(35px)}to {opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce) {#stickyDialog {animation:none}}

/* Quiet, consistent links: no browser-blue underlined action rows. */
.text-link {display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:6px 11px;border-radius:10px;background:rgba(201,120,78,.07);color:var(--ink);text-decoration:none;font:500 12px/1.5 var(--letter-ui);transition:background-color .18s ease}
.text-link:hover {background:rgba(201,120,78,.13);color:var(--ink)}
.text-link:focus-visible,.recent-link:focus-visible {outline:2px solid var(--orange);outline-offset:3px}
.recent-link {border-radius:10px;padding:12px 0;line-height:1.7}
.kami-letter a,.original-text a,.record-content a {color:var(--ink);text-decoration:none;border-bottom:1px solid var(--peach);overflow-wrap:anywhere;word-break:break-word}
.kami-letter a[href^='http']::after {content:' ↗';font:12px/1 var(--letter-ui);color:var(--orange)}
@media(max-width:700px) {
 .theme-button {white-space:nowrap;flex-shrink:0}
 .account-bar .theme-modes {min-width:160px;flex-wrap:nowrap}
 .library-tools>.form-label {font-size:0;gap:0}
 .library-tools {gap:10px;margin-top:4px}
 .library-tools .form-field {font-size:14px}
 .letter-card.envelope-card {animation:none}
 .archive-envelope {height:254px}
 .envelope-card .archive-sheet {bottom:30px}
 .envelope-card .archive-sheet-copy {-webkit-line-clamp:2}
 .sticky-note .note-read {min-height:36px;padding:6px 10px;background:rgba(201,120,78,.07)}
 .envelope-footer .text-link {min-height:36px;padding:5px 10px;font-size:11px}
 .recent-letters-section>.text-link {font-size:11px}
}
@media(max-width:700px){body:has(textarea:focus) .view-nav{display:none}textarea.form-field,input.form-field{scroll-margin-block:90px}.pwa-tools:has(~.web-push-settings){padding-bottom:18px}.app-shell:has(~.pwa-tools){padding-bottom:30px}}
@media(max-width:700px){.compose-options{grid-template-columns:repeat(2,minmax(0,1fr))}.compose-options label[for='composeInk']{grid-column:1/-1}.compose-options select,.board-tools .form-field{font-size:16px}}

/* Quiet mail: static utilities + small compositor animations, mobile first. */
/* Inline links share their surrounding text's baseline. Boxed actions use their own classes. */
.text-link,.envelope-footer .text-link,.sticky-note .note-read {
  display:inline;vertical-align:baseline;min-height:0;padding:0;border:0;border-radius:0;
  background:none;font:inherit;line-height:inherit;color:var(--ink);text-decoration:none;
}
.text-link:hover {background:none;text-decoration:underline;text-underline-offset:.25em}
.kami-letter a,.original-text a,.record-content a {vertical-align:baseline;font:inherit;line-height:inherit}
.kami-letter a[href^='http']::after {font:inherit;font-size:.7em;vertical-align:baseline}
.form-status a {white-space:normal}
.record-meta,.envelope-footer {align-items:baseline}
.page-jump {display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font:12px/1.5 var(--letter-ui)}
.page-number {width:54px;height:40px;min-width:0;padding:6px;border:1px solid var(--paper-edge);border-radius:10px;text-align:center;background:var(--ivory);color:var(--ink);font:16px/1 var(--letter-ui)}
.pagination {flex-wrap:wrap;gap:12px;align-items:center}
.page-button {min-height:40px;white-space:nowrap}
.studio-links {display:flex;justify-content:center;align-items:center;gap:24px;flex-wrap:wrap;margin:4px 0 8px;font:13px/1.5 var(--letter-ui)}
.studio-links a {color:var(--ink-soft);text-decoration:none;padding-block:10px}
.studio-links a[aria-current='page'] {color:var(--ink);text-decoration:underline;text-underline-offset:7px}
.app-shell {padding-bottom:120px}
.view-nav.quiet-bottom-nav {
 position:fixed;z-index:40;inset:auto auto max(12px,env(safe-area-inset-bottom,0px)) 50%;
 transform:translateX(-50%);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;
 width:min(390px,calc(100% - 28px));max-width:none;margin:0;padding:8px 14px;border:1px solid rgba(129,122,108,.15);
 border-radius:22px;background:rgba(250,249,245,.93);box-shadow:0 5px 18px rgba(58,54,42,.06);
 backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
}
.view-nav.quiet-bottom-nav>.view-tab {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:48px;padding:3px 10px;border-radius:14px;font:11px/1.4 var(--letter-ui);letter-spacing:.03em;color:#7c796e;background:none}
.view-nav.quiet-bottom-nav>.view-tab[aria-current='page'] {background:#eeeee5;color:#66745d}
.view-nav.quiet-bottom-nav:has([data-nav='showcase'][aria-current='page']) [data-nav='letters'] {background:none;color:#7c796e}
.quiet-bottom-nav .view-tab::before {content:'';display:block;width:21px;height:21px;background:currentColor;mask:center/contain no-repeat var(--tab-icon);-webkit-mask:center/contain no-repeat var(--tab-icon)}
.view-tab[data-nav='showcase'] {--tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='m3 11 9-8 9 8M5 10v11h5v-7h4v7h5V10'/%3E%3C/svg%3E")}
.quiet-bottom-nav [data-nav='letters'] {--tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 7 9-7M6 3h12'/%3E%3C/svg%3E")}
.quiet-bottom-nav [data-nav='compose'] {--tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M12 4H4v17h16v-9M17 3l4 4-10 10-5 1 1-5Z'/%3E%3C/svg%3E")}
/* The collection alone adopts the requested white / sage paper palette. */
.collection-body {--cream:#f6f5f1;--ivory:#fffefa;--apricot:#eeeee7;--peach:#d6d9cb;--ink:#685f52;--ink-soft:#8a8377;--orange:#8a987f;--paper-edge:rgba(118,116,100,.16);--warm-shadow:rgba(68,62,47,.06);background:#f6f5f1}
.collection-body::before,.collection-body::after {display:none}
.collection-body .library-page {max-width:760px;margin:auto}
.collection-body .view-heading {text-align:left;margin:22px auto 24px;max-width:620px}
.collection-body .view-heading h1 {font-size:clamp(29px,5vw,42px);font-weight:400;letter-spacing:.06em}
.collection-body .view-heading p:last-child {font:13px/1.8 var(--letter-ui)}
.collection-body .library-tools {margin:18px auto;max-width:620px;gap:12px}
.collection-body .collection-filter-panel,.collection-body .view-switch,#libraryStatus {max-width:620px;margin-inline:auto}
.collection-body .collection-filter-panel {background:none;box-shadow:none;border:0;border-block:1px solid var(--paper-edge);border-radius:0}
.collection-body .form-field {background:#fcfbf8;box-shadow:none}
.collection-body .letter-grid:not(.timeline-grid) {display:flex;flex-direction:column;align-items:center;max-width:540px;gap:0;padding:18px 12px 34px;margin:0 auto;isolation:isolate}
.collection-body .letter-card.envelope-card {
 position:relative;display:block;flex:none;width:min(100%,420px);margin:0 0 -14px;padding:0;
 background:none;border:0;box-shadow:none;min-height:0;
 transform:translate(var(--scatter-x,0px),var(--drift,0px)) rotate(var(--scatter-angle,0deg)) scale(var(--depth-scale,1));
 animation:envelope-settle 850ms cubic-bezier(.16,.58,.27,1) var(--delay,0ms) backwards;
}
.collection-body .envelope-card .archive-envelope {display:block;width:100%;max-width:none;height:auto;aspect-ratio:1.3;text-decoration:none;transform:translateY(0);transition:transform .3s ease-out;contain:layout style}
.collection-body .envelope-card .archive-envelope-back {inset:36px 0 25px;background:#fff;box-shadow:0 5px 12px rgba(68,62,47,.045),0 1px 2px rgba(68,62,47,.05);border-color:#e6e4dd}
.collection-body .envelope-card .archive-pocket {inset:36px 0 25px;background:linear-gradient(155deg,#fff,#f5f4ef);border-color:#e8e6de}
.collection-body .envelope-card .archive-pocket::before {opacity:.28}
.collection-body .envelope-card .archive-flap {top:36px;height:38%;background:linear-gradient(170deg,#fdfdfb,#eeeee7);filter:none}
.collection-body .envelope-card .archive-sheet {inset:45px 17px 35px;background:#fff;border-color:#eeece6;padding:14px;overflow:hidden}
.collection-body .envelope-card .archive-sheet-copy {display:none}
.collection-body .envelope-card .archive-front {bottom:48px;left:22px;right:22px}
.collection-body .envelope-card .archive-title {font-size:clamp(18px,4vw,25px);font-weight:400;line-height:1.55}
.collection-body .envelope-card .archive-address {font-size:11px;margin-top:7px}
.collection-body .envelope-card .archive-seal {top:46%;left:calc(50% - 15px);width:30px;height:30px;background:#a3ae95;border:1px solid #929f84;box-shadow:inset 0 0 0 3px rgba(255,255,255,.2);font-size:20px}
.collection-body .envelope-card .archive-category {top:50px;left:16px;font-size:9px;letter-spacing:.06em}
.collection-body .envelope-card .archive-open-hint {display:none}
.collection-body .envelope-footer {position:relative;width:100%;padding:0 6px 10px;margin-top:-17px;font:10px/1.7 var(--letter-ui)}
.collection-body .envelope-footer .record-date,.collection-body .envelope-footer .text-link {font:inherit}
.collection-body .envelope-card>.letter-badges {margin-top:-8px;position:relative;z-index:6}
.collection-body .letter-card.envelope-card:hover {box-shadow:none;transform:translate(var(--scatter-x,0px),var(--drift,0px)) rotate(var(--scatter-angle,0deg)) scale(var(--depth-scale,1))}
.collection-body .timeline-grid {max-width:620px;margin:auto;display:grid;grid-template-columns:1fr;gap:18px;padding:18px 0}
.collection-body .timeline-grid .letter-card {background:#fff;border:1px solid var(--paper-edge);box-shadow:0 3px 12px var(--warm-shadow)}
.collection-body .timeline-trigger {width:100%;text-align:left}
.collection-body .timeline-grid .archive-sheet {display:none}
@media(hover:hover) and (pointer:fine) {.collection-body .envelope-card .archive-envelope:hover {transform:translateY(-5px)}}
@keyframes envelope-settle {from{opacity:0;transform:translate(var(--scatter-x,0px),-38px) rotate(var(--scatter-angle,0deg)) scale(var(--depth-scale,1))}to{opacity:1;transform:translate(var(--scatter-x,0px),var(--drift,0px)) rotate(var(--scatter-angle,0deg)) scale(var(--depth-scale,1))}}
/* Date navigation and inline reply threads. */
.board-tools {align-items:end}
.board-date-actions {grid-column:1/-1;display:flex;gap:8px;align-items:center;justify-content:space-between}
.board-date-actions .soft-button {min-height:40px;padding:8px 12px;font:12px/1.4 var(--letter-ui);background:transparent;box-shadow:none}
.note-thread {position:relative;z-index:2;margin-top:12px;border-top:1px solid var(--paper-edge);padding-top:12px;transform:none}
.note-thread-summary {cursor:pointer;font:12px/1.7 var(--letter-ui);padding:5px 0;color:var(--ink)}
.note-thread-content {padding-top:10px}
.note-replies {list-style:none;margin:0;padding:0}
.note-reply {border-bottom:1px solid var(--paper-edge);padding:12px 0}
.note-reply .record-meta {margin:0 0 8px;font-size:11px}
.sticky-note .note-reply .record-content {font:14px/1.85 var(--letter-ui);white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
.note-reply-form {display:grid;gap:12px;margin-top:18px}
.note-reply-form textarea.form-field {font:16px/1.8 var(--letter-ui);min-height:110px;max-height:260px;padding:10px 12px;resize:vertical}
.note-reply-form .soft-button {justify-self:end;min-height:42px}
.note-reply-pages {margin-top:12px;gap:7px}
.note-reply-pages .page-button {padding:8px;font-size:11px}
.note-reply-pages .page-jump {font-size:10px;gap:3px}
.note-reply-pages .page-number {width:42px}
#stickyList .sticky-note:has(.note-thread[open]) {transform:none;z-index:2}
/* A paper slips into its envelope after a successful save. No modal or input blocking. */
.sent-envelope {position:fixed;z-index:90;left:calc(50% - 74px);display:block;width:148px;height:108px;pointer-events:none;isolation:isolate;animation:mail-away 1350ms ease-out both}
.sent-envelope i {position:absolute;display:block;font-style:normal}
.sent-paper {z-index:1;inset:0 14px 18px;background:repeating-linear-gradient(#fffefa 0 14px,#eae6dc 14px 15px);border:1px solid #e5ded0;border-radius:3px;animation:paper-post 850ms ease-out both}
.sent-pocket {z-index:2;inset:28px 0 0;background:#ead9c6;clip-path:polygon(0 0,50% 45%,100% 0,100% 100%,0 100%);border-radius:4px}
.sent-flap {z-index:3;inset:28px 0 auto;height:45px;background:#f0e2d0;clip-path:polygon(0 0,100% 0,50% 100%);transform-origin:top;animation:seal-post 1100ms ease-out both}
.sent-seal {z-index:4;left:64px;top:63px;color:#a77c59;animation:seal-appear 1100ms ease-out both}
@keyframes paper-post {0%,12%{transform:translateY(-38px)}65%,100%{transform:translateY(18px)}}
@keyframes seal-post {0%,58%{transform:rotateX(170deg)}90%,100%{transform:rotateX(0)}}
@keyframes seal-appear {0%,75%{opacity:0}100%{opacity:1}}
@keyframes mail-away {0%{opacity:0;transform:translateY(12px)}15%,80%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-22px)}}
/* Avoid painting invisible full letter/previews and nested paper shadows while typing. */
.view-panel[hidden] {display:none!important}
.compose-preview-fold:not([open]) .preview-paper {display:none}
body::after {animation:none}
.ornament-heart {animation:none}
@media(max-width:700px) {
 .collection-body .app-shell {padding-inline:20px}
 .collection-body .view-heading {margin-top:12px}
 .collection-body .letter-grid:not(.timeline-grid) {padding:12px 8px 28px}
 .collection-body .letter-card.envelope-card {width:min(100%,340px);margin-bottom:-9px}
 .collection-body .envelope-card .archive-title {font-size:19px}
 .collection-body .envelope-card .archive-front {bottom:47px}
 .collection-body .envelope-card .archive-seal {top:45%}
 .collection-body .envelope-footer {font-size:9px}
 .studio-links {gap:26px;margin:0;font-size:12px}
 .board-tools {grid-template-columns:minmax(0,1fr);gap:14px}
 .board-tools>.form-label {min-width:0}
 .board-date-actions {gap:6px}
 .board-tools .form-field {width:100%}
 .board-date-actions .soft-button {padding-inline:10px}
 .note-thread .form-field {width:100%;margin:0}
 .sticky-note .note-read {display:inline-block;font:12px/1.8 var(--letter-ui);padding-block:5px}
 .pwa-tools,.web-push-settings {padding-bottom:20px}
 .web-push-settings {margin-bottom:100px}
 body:has(textarea:focus) .quiet-bottom-nav {display:none}
}
@media(prefers-reduced-motion:reduce) {
 .collection-body .letter-card.envelope-card {animation:none;transform:translateX(var(--scatter-x,0px)) rotate(var(--scatter-angle,0deg)) scale(var(--depth-scale,1))}
 .sent-envelope {display:none}
}
/* Explicit reading modes still override the collection's paper palette. */
html[data-theme='night'] .collection-body {--ink:#e9dac7;--ink-soft:#c2b09b;--paper-edge:rgba(233,218,199,.16);background:#282620}
html[data-theme='night'] .collection-body .form-field,html[data-theme='night'] .collection-body .timeline-grid .letter-card {background:#343129}
html[data-theme='night'] .collection-body .archive-title,html[data-theme='night'] .collection-body .archive-address,html[data-theme='night'] .collection-body .archive-category {color:#685f52}
html[data-theme='warm'] .collection-body {background:#f5ebd5}
/* Paper metadata follows a single baseline, below the envelope rather than overlapping tags. */
.collection-body .envelope-footer {margin-top:-18px;padding:0 6px 0;min-height:20px}
.collection-body .envelope-card>.mail-badges {margin:0 6px 14px;min-height:17px;gap:4px}
.collection-body .envelope-card>.mail-badges:empty {display:none}
.collection-body .envelope-card .tag-pill {font:9px/1.5 var(--letter-ui);padding:2px 7px;background:#e9ece2;color:#727b67}
.collection-body .letter-card.envelope-card {margin-bottom:-18px}
.collection-body .letter-card.envelope-card::after {content:'';position:absolute;z-index:-1;inset:41px -2px 55px 3px;border:1px solid #e8e6df;border-radius:6px;background:#fbfbf7;transform:rotate(-.5deg);pointer-events:none}
.collection-body .envelope-footer {position:relative;z-index:6}
.collection-body .library-tools>.form-label {min-width:0}
@media(max-width:700px) {
 .collection-body .view-heading {margin-bottom:16px}
 .collection-body .view-heading .view-kicker {margin-bottom:5px}
 .collection-body .view-heading h1 {margin-bottom:6px}
 .collection-body .library-tools {margin:12px 0;gap:8px}
 .collection-body .collection-filter-panel {padding-block:10px;margin-block:10px}
 .collection-body .library-page>.view-switch {margin-block:10px}
 .collection-body #libraryStatus {margin-block:9px}
}
/* Overlap the envelopes themselves; keep address and title clear of the next sheet. */
.collection-body .letter-card.envelope-card {margin-bottom:-74px}
.collection-body .letter-card.envelope-card:last-child {margin-bottom:0}
.collection-body .envelope-card .archive-front {bottom:68px}
.collection-body .envelope-card>.mail-badges {display:none}
.collection-body .envelope-card>.envelope-footer {position:absolute;top:51px;right:16px;bottom:auto;left:auto;width:auto;margin:0;padding:0;min-height:0;pointer-events:none;z-index:5}
.collection-body .envelope-footer .text-link {display:none}
.collection-body .envelope-card>.envelope-footer .record-date {font:8px/1.5 var(--letter-ui);opacity:.75}
.collection-body .letter-card.envelope-card::after {bottom:22px}
.collection-body .letter-grid:not(.timeline-grid) {padding-bottom:42px}
@media(max-width:700px){.collection-body .envelope-card .archive-front {bottom:65px}.collection-body .envelope-card>.envelope-footer{top:51px;right:12px}.collection-body .envelope-card>.envelope-footer .record-date {font-size:9px}}
/* Reference refinement: one navigation, flat central envelope, receding upper/lower paper. */
.studio-desk {margin-top:32px;padding-top:28px;border-top:1px solid var(--paper-edge)}
.studio-desk h2 {font:400 24px/1.5 var(--letter-serif);margin:8px 0 20px}
.studio-desk-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.studio-desk-grid a {display:flex;flex-direction:column;gap:10px;padding:22px 18px;border:1px solid var(--paper-edge);border-radius:12px;color:var(--ink);background:var(--ivory);text-decoration:none}
.studio-desk-grid strong {font:500 15px/1.6 var(--letter-ui)}
.studio-desk-grid span {font:12px/1.8 var(--letter-ui);color:var(--ink-soft)}
.collection-body .library-tools {display:block}
.collection-body .letter-grid:not(.timeline-grid) {position:relative;isolation:isolate}
.collection-body .letter-card.envelope-card,.collection-body .letter-card.envelope-card:hover {transform:translate(var(--scatter-x,0px),var(--drift,0px)) perspective(1000px) rotateX(var(--view-tilt,0deg)) rotate(var(--scatter-angle,0deg)) scale(var(--depth-scale,1));transform-origin:50% 50%}
.collection-body .envelope-card .archive-seal {width:26px;height:26px;left:calc(50% - 13px);font-size:18px}
@keyframes envelope-settle {from{opacity:0;transform:translate(var(--scatter-x,0px),-38px) perspective(1000px) rotateX(var(--view-tilt,0deg)) rotate(var(--scatter-angle,0deg)) scale(var(--depth-scale,1))}to{opacity:1;transform:translate(var(--scatter-x,0px),var(--drift,0px)) perspective(1000px) rotateX(var(--view-tilt,0deg)) rotate(var(--scatter-angle,0deg)) scale(var(--depth-scale,1))}}
@media(max-width:700px){.studio-desk-grid{grid-template-columns:1fr}.studio-desk-grid a {padding:20px}.collection-body .library-tools>.form-label {font-size:0}.collection-body .library-tools .form-field {width:100%}}
@media(prefers-reduced-motion:reduce){.collection-body .letter-card.envelope-card,.collection-body .letter-card.envelope-card:hover {transform:translateX(var(--scatter-x,0px)) rotate(var(--scatter-angle,0deg));animation:none}}
.collection-body .library-page {padding-top:10px}
.collection-body .letter-grid:not(.timeline-grid) {padding-top:0}
/* Keep the existing reading-mode controls, with paper surfaces matching the chosen light. */
html[data-theme='night'] .quiet-bottom-nav {background:rgba(49,47,41,.95);border-color:rgba(232,220,201,.15)}
html[data-theme='night'] .quiet-bottom-nav>.view-tab {color:#c1b9a8}
html[data-theme='night'] .quiet-bottom-nav>.view-tab[aria-current='page'] {background:#4b4d40;color:#e5e5d4}
html[data-theme='night'] .collection-body .envelope-card .archive-envelope-back,
html[data-theme='night'] .collection-body .envelope-card .archive-pocket {background:linear-gradient(150deg,#4d4a42,#3d3b35);border-color:#5b584f}
html[data-theme='night'] .collection-body .envelope-card .archive-flap {background:linear-gradient(170deg,#555247,#454239)}
html[data-theme='night'] .collection-body .envelope-card .archive-sheet {background:#514e45;border-color:#5b584f}
html[data-theme='night'] .collection-body .archive-title,
html[data-theme='night'] .collection-body .archive-address,
html[data-theme='night'] .collection-body .archive-category {color:#e6ddcb}
html[data-theme='night'] .collection-body .letter-card.envelope-card::after {background:#403e37;border-color:#5b584f}
html[data-theme='warm'] .collection-body .envelope-card .archive-envelope-back {background:#fff7e2}
html[data-theme='warm'] .collection-body .envelope-card .archive-pocket {background:linear-gradient(155deg,#fff8e6,#f5e9ce)}
html[data-theme='warm'] .collection-body .envelope-card .archive-flap {background:linear-gradient(170deg,#fff6dd,#eee2c5)}
html[data-theme='warm'] .collection-body .envelope-card .archive-sheet {background:#fff7e2}
html[data-theme='warm'] .collection-body .letter-card.envelope-card::after {background:#f6ebd4}

/* Performance baseline: installed fonts, ordinary flow, short compositor-only transitions. */
:root {--letter-serif:"Songti SC","STSong","SimSun","Noto Serif CJK SC",Georgia,serif;--letter-hand:"Kaiti SC","KaiTi","STKaiti","DFKai-SB",serif}
body,.collection-body {--cream:#f8eddf;--apricot:#f3ddc8;--peach:#edc5a7;--ivory:#fffaf1;--ink:#684b38;--ink-soft:#80634d;--orange:#c9784e;--paper-edge:rgba(135,94,63,.18);--warm-shadow:rgba(120,70,38,.1);background:linear-gradient(138deg,#fbf0e1,#f6e3ce 55%,#f1d7bf)}
body::before,body::after,.desk-light {display:none!important}
*,*::before,*::after {scroll-behavior:auto}
.view-panel,.letter-card,.reader-paper {animation:none}
.view-nav.quiet-bottom-nav {background:#fff7eaeF;border-color:var(--paper-edge);backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:0 4px 14px rgba(120,70,38,.08)}
.view-nav.quiet-bottom-nav>.view-tab {color:var(--ink-soft)}
.view-nav.quiet-bottom-nav>.view-tab[aria-current='page'] {color:var(--ink);background:var(--apricot)}
.quiet-bottom-nav [data-nav='studio'] {--tab-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M3 11h18v4H3zM5 15v6m14-6v6M6 11V4h8v7M17 5l3-2M17 8l4-2'/%3E%3C/svg%3E")}
.collection-body .account-bar .theme-modes {display:flex}
.collection-body .form-field {background:var(--ivory)}
.collection-body .library-page {width:min(100%,920px);max-width:920px;padding-top:22px}
.library-hero {display:flex;align-items:center;justify-content:space-between;gap:28px;margin:0 0 24px}
.collection-body .library-hero .view-heading {flex:1;min-width:0;max-width:none;margin:0;text-align:left}
.collection-body .library-hero .view-heading h1 {font-size:34px;line-height:1.35;letter-spacing:.025em}
.collection-body .library-hero .view-heading p:last-child {margin:10px 0 0;font:14px/1.8 var(--letter-ui)}
.library-control-panel {padding:16px 18px 0;border:1px solid var(--paper-edge);border-radius:16px;background:var(--ivory)}
.library-toolbar {display:flex;gap:16px;align-items:center}
.collection-body .library-tools {display:block;flex:1;min-width:0;max-width:none;margin:0}
.collection-body .library-tools .form-field {height:46px;min-height:46px;margin:0;padding:0 15px;border-radius:10px;font:14px/normal var(--letter-ui);background:var(--cream)}
.collection-body .library-toolbar .view-switch {flex:none;max-width:none;margin:0;padding:3px;border-radius:11px;background:var(--cream)}
.library-toolbar .view-switch button {min-height:38px;padding:8px 14px;border-radius:8px;font:12px/1.5 var(--letter-ui)}
.collection-body .library-control-panel .collection-filter-panel {max-width:none;margin:12px 0 0;padding:11px 0;border:0;border-top:1px solid var(--paper-edge);background:none}
.library-control-panel summary {list-style:none;font:12px/1.7 var(--letter-ui);color:var(--ink);cursor:pointer}
.library-control-panel summary::-webkit-details-marker {display:none}
.library-control-panel summary::before {content:'＋';display:inline-block;width:21px;color:var(--orange)}
.library-control-panel details[open]>summary::before {content:'−'}
.library-control-panel summary span {float:right;color:var(--ink-soft);font-size:11px}
.collection-body .library-control-panel .collection-advanced {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 14px;padding:16px 0 6px;margin:0}
.library-control-panel .collection-advanced .form-label {font:12px/1.6 var(--letter-ui)}
.library-control-panel .collection-advanced .form-field {height:44px;min-height:44px;margin:0;padding:0 10px;font:14px/normal var(--letter-ui);border-radius:9px}
.library-results {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 4px;font:11px/1.6 var(--letter-ui);color:var(--ink-soft)}
.collection-body .library-results #libraryStatus {max-width:none;margin:0;font:inherit}
.library-results-hint {flex:none}
.collection-body .letter-grid:not(.timeline-grid) {display:flex;flex-direction:column;align-items:center;gap:4px;max-width:510px;margin-inline:auto;padding:0 8px 18px;perspective:none}
.collection-body .letter-card.envelope-card,.collection-body .letter-card.envelope-card:hover {position:relative;display:block;width:min(100%,380px);margin:0;z-index:auto!important;transform:none;animation:quiet-envelope-in .26s ease-out var(--delay,0ms) backwards;box-shadow:none;isolation:isolate}
.collection-body .letter-card.envelope-card:nth-child(even) {align-self:center;margin-left:24px}
.collection-body .letter-card.envelope-card:nth-child(odd) {align-self:center;margin-right:24px}
.collection-body .letter-card.envelope-card::before,.collection-body .letter-card.envelope-card::after {display:none}
.collection-body .envelope-card .archive-envelope,.collection-body .envelope-card .archive-envelope:hover {display:block;width:100%;height:214px;aspect-ratio:auto;max-width:none;perspective:none;transform:none;contain:layout style;transition:transform .15s ease-out}
.collection-body .envelope-card .archive-envelope-back {inset:8px 0;background:var(--ivory);border-color:var(--paper-edge);box-shadow:0 3px 8px rgba(120,70,38,.06)}
.collection-body .envelope-card .archive-pocket {inset:8px 0;background:linear-gradient(150deg,#fffdf7,#f9f1e4);border-color:var(--paper-edge)}
.collection-body .envelope-card .archive-flap {top:8px;height:88px;background:linear-gradient(170deg,#fffaf1,#f2e3cc);filter:none;transform:none;transition:none;backface-visibility:hidden}
.collection-body .envelope-card .archive-sheet {display:none}
.collection-body .envelope-card .archive-front {top:116px;bottom:auto;z-index:3}
.collection-body .envelope-card .archive-title {font:400 21px/1.4 var(--letter-serif)}
.collection-body .envelope-card .archive-address {font:11px/1.6 var(--letter-ui);margin-top:6px;color:var(--ink-soft)}
.collection-body .envelope-card .archive-seal {top:82px;width:28px;height:28px;left:calc(50% - 14px);background:var(--orange);border-color:#b97f59;color:var(--ivory);box-shadow:inset 0 0 0 3px rgba(255,255,255,.18)}
.collection-body .envelope-card .archive-category {top:21px;left:14px;font-size:10px;color:var(--ink-soft)}
.collection-body .envelope-card>.envelope-footer {top:26px;right:14px}
.collection-body .envelope-card>.envelope-footer .record-date {font-size:10px}
.new-letter-envelope {display:flex;position:relative;flex:none;flex-direction:column;align-items:center;justify-content:flex-end;width:184px;height:116px;margin:0;padding:12px;border:1px solid var(--paper-edge);border-radius:7px;background:var(--ivory);color:var(--ink);text-decoration:none;box-shadow:0 3px 8px rgba(120,70,38,.04);overflow:hidden}
.new-envelope-fold {position:absolute;inset:0 0 auto;height:53px;background:#f2dfc4;clip-path:polygon(0 0,100% 0,50% 100%)}
.new-envelope-plus {position:absolute;top:21px;left:calc(50% - 12px);width:24px;height:24px;display:grid;place-items:center;border:1px dashed #c6a17f;border-radius:50%;background:#fff7e8;font:18px/1 system-ui;color:#b38660}
.new-envelope-title {font:400 15px/1.6 var(--letter-serif);position:relative}
.new-envelope-hint {font:10px/1.7 var(--letter-ui);color:var(--ink-soft);margin-top:3px;position:relative}
@keyframes quiet-envelope-in {from{opacity:0;transform:translateY(-7px)}to{opacity:1;transform:translateY(0)}}
/* A desk made from a few static paper objects: the object itself is the link. */
.studio-page {max-width:960px;margin:auto}
.desk-surface {position:relative;width:100%;height:560px;border:1px solid rgba(174,121,82,.2);border-radius:16px;background:repeating-linear-gradient(2deg,transparent 0 83px,rgba(140,97,62,.025) 84px 85px),linear-gradient(110deg,#f4dfc4,#ecd0ad 54%,#f0d9bd);box-shadow:inset 0 1px 0 rgba(255,255,255,.65),0 7px 18px rgba(120,70,38,.06);isolation:isolate}
.desk-object {position:absolute;display:block;text-decoration:none;color:var(--ink);border-radius:5px;outline-offset:8px}
.desk-object>span {pointer-events:none}
.desk-notebook {width:37%;height:220px;left:8%;top:42px}
.desk-book-cover {position:relative;display:block;width:100%;height:190px;background:#bc9170;border:1px solid #a67a57;border-radius:4px 10px 10px 4px;box-shadow:3px 4px 0 #f6e7ce,4px 5px 0 #c2a17d,0 7px 14px rgba(92,58,29,.1);transform:rotate(-5deg)}
.book-spine {position:absolute;left:12px;top:0;bottom:0;border-left:1px solid rgba(98,65,42,.22)}
.book-label {display:block;position:absolute;left:24%;right:17%;top:26px;padding:15px 5px;border:1px solid rgba(111,78,49,.18);background:#fbefda;text-align:center;font:19px/1.8 var(--letter-serif)}
.book-label em {font:italic 12px Georgia;color:#9a7b5c}
.book-heart {position:absolute;right:19px;bottom:14px;color:#f8e4c9;font:29px Georgia}
.desk-drafts {width:33%;height:230px;right:7%;top:53px}
.draft-paper-stack {position:relative;display:block;height:180px;margin:0 4px;background:#fff8e9;border:1px solid #dfc9a8;transform:rotate(5deg);box-shadow:0 5px 10px rgba(115,74,40,.06)}
.draft-paper-stack>i {position:absolute;inset:2px;z-index:-1;border:1px solid #d8c1a0;background:#f9ecd6;transform:rotate(-5deg)}
.draft-paper-stack>i:nth-child(2) {transform:rotate(3deg) translate(3px,4px)}
.draft-pencil-lines {display:block;margin:38px 17px;font:italic 15px/2.2 var(--letter-hand);color:#a78b6b;border-bottom:1px solid #e6d9c4}
.draft-clip {position:absolute;left:20px;top:-8px;width:13px;height:33px;border:2px solid #af9c83;border-radius:8px;transform:rotate(-8deg)}
.desk-replies {width:54%;height:210px;left:24%;bottom:24px}
.desk-writing-paper {display:block;height:155px;margin-right:18px;position:relative;padding:22px 25px;border:1px solid #dec5a1;border-radius:3px;background:#fff8e7;transform:rotate(-3deg);box-shadow:0 5px 10px rgba(115,74,40,.06)}
.desk-writing-paper>span {font:16px/1.7 var(--letter-serif)}
.desk-writing-paper>i {display:block;height:19px;border-bottom:1px solid #e5d6bc}
.desk-writing-paper>b {position:absolute;right:20px;bottom:10px;font:22px Georgia;color:#be9470}
.desk-quill {position:absolute;width:83px;height:185px;right:-8px;top:-31px;color:#ae7751;transform:rotate(13deg);pointer-events:none}
.desk-caption {display:block;position:relative;margin-top:18px;text-align:center;line-height:1.5}
.desk-caption strong {display:block;font:500 16px/1.6 var(--letter-ui)}
.desk-caption small {display:block;margin-top:3px;font:11px/1.6 var(--letter-ui);color:var(--ink-soft)}
.studio-compose-link {display:block;margin:26px auto 0;text-align:center;color:var(--ink-soft);text-decoration:none;font:13px/1.8 var(--letter-ui)}
/* Short mobile diary entries, instead of a large reading surface per letter. */
.collection-body .timeline-grid {gap:12px;max-width:660px}
.collection-body .timeline-grid .letter-card {min-height:0;padding:18px 20px;background:var(--ivory);border-color:var(--paper-edge);box-shadow:0 3px 9px rgba(120,70,38,.04);transform:none;transition:none}
.timeline-trigger {display:block;padding:0;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer}
.timeline-excerpt {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;font:14px/1.7 var(--letter-ui);margin:10px 0}
@media(hover:hover) and (pointer:fine){.desk-object:hover,.new-letter-envelope:hover {outline:1px solid var(--peach)}.collection-body .envelope-card .archive-envelope:hover {transform:translateY(-2px)}}
@media(max-width:700px){
 .collection-body .library-page {padding-top:16px}
 .library-hero {gap:14px;margin-bottom:18px}
 .collection-body .library-hero .view-heading h1 {font-size:27px}
 .collection-body .library-hero .view-heading .view-kicker {font-size:10px;letter-spacing:.04em;margin-bottom:7px}
 .collection-body .library-hero .view-heading p:last-child {font-size:12px;line-height:1.7;margin-top:8px}
 .library-control-panel {padding:12px 12px 0;border-radius:13px}
 .library-toolbar {flex-wrap:wrap;gap:10px}
 .collection-body .library-tools {flex-basis:100%}
 .collection-body .library-tools .form-field {font-size:16px;height:44px;min-height:44px;padding-inline:11px}
 .library-toolbar .view-switch button {min-height:34px;padding:6px 13px}
 .collection-body .library-control-panel .collection-advanced {grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 10px}
 .library-control-panel .collection-advanced .form-field {font-size:16px}
 .library-results {margin:16px 0 4px;font-size:10px}
 .library-results-hint {display:none}
 .collection-body .letter-grid:not(.timeline-grid) {max-width:350px;gap:0;padding:0 4px 16px}
 .collection-body .letter-card.envelope-card {width:calc(100% - 16px);max-width:326px;margin:0}
 .collection-body .letter-card.envelope-card:nth-child(even) {margin-left:12px}
 .collection-body .letter-card.envelope-card:nth-child(odd) {margin-right:12px}
 .collection-body .envelope-card .archive-envelope {height:176px}
 .collection-body .envelope-card .archive-flap {height:72px}
 .collection-body .envelope-card .archive-seal {top:65px;width:26px;height:26px;left:calc(50% - 13px)}
 .collection-body .envelope-card .archive-title {font-size:18px;line-height:1.35}
 .collection-body .envelope-card .archive-address {font-size:10px;margin-top:4px}
 .collection-body .envelope-card .archive-front {top:98px;bottom:auto;left:16px;right:16px}
 .collection-body .envelope-card .archive-category {top:19px;left:10px;font-size:9px}
 .collection-body .envelope-card>.envelope-footer .record-date {font-size:9px}
 .new-letter-envelope {width:106px;height:89px;padding:9px 5px}
 .new-envelope-title {font-size:12px}.new-envelope-hint {display:none}
 .new-envelope-fold {height:43px}.new-envelope-plus {top:18px;width:22px;height:22px;left:calc(50% - 11px);font-size:16px}
 .desk-surface {height:450px;border-radius:11px}
 .desk-notebook {width:42%;height:185px;left:6%;top:28px}
 .desk-book-cover {height:150px}
 .book-label {left:22%;right:13%;top:21px;font-size:16px;padding:9px 3px}
 .book-heart {font-size:23px;bottom:11px;right:14px}
 .desk-drafts {width:37%;height:190px;right:6%;top:37px}
 .draft-paper-stack {height:140px}.draft-pencil-lines {margin:30px 12px;font-size:12px;line-height:2}
 .desk-caption {margin-top:14px}.desk-caption strong {font-size:14px}.desk-caption small {font-size:10px}
 .desk-replies {width:64%;left:19%;height:176px;bottom:25px}
 .desk-writing-paper {height:128px;padding:17px 18px}.desk-writing-paper>span {font-size:14px}.desk-writing-paper>i {height:17px}
 .desk-quill {height:155px;width:70px;top:-27px;right:-10px}
 .collection-body .timeline-grid .letter-card {padding:14px 15px;min-height:0}
 .collection-body .timeline-grid h2 {font-size:18px;line-height:1.4;margin:7px 0}
 .collection-body .timeline-grid .record-date {font-size:10px}
 .collection-body .timeline-grid .mail-badges {margin:6px 0;max-height:24px;overflow:hidden}
 .collection-body .timeline-grid .tag-pill {font-size:10px;padding:2px 6px}
 .timeline-excerpt {font:13px/1.6 var(--letter-ui);-webkit-line-clamp:2;max-height:42px;margin:8px 0}
 .timeline-open-hint {font:11px/1.5 var(--letter-ui)}
}
@media(prefers-reduced-motion:reduce){.collection-body .letter-card.envelope-card {animation:none}}
html[data-theme='warm'] body {--ivory:#fff4d8;background:#f5e6c8}
html[data-theme='night'] body {--cream:#282620;--ivory:#343129;--ink:#e9dac7;--ink-soft:#c2b09b;--paper-edge:rgba(233,218,199,.16);--apricot:#4c463a;--peach:#796b54;background:#282620}
html[data-theme='night'] .desk-surface {background:linear-gradient(115deg,#443a2d,#4b3e2e);border-color:#5c4d3a}
html[data-theme='night'] .desk-caption,html[data-theme='night'] .desk-caption small {color:#d5c4ac}
html[data-theme='night'] .collection-body .envelope-card .archive-envelope-back,html[data-theme='night'] .collection-body .envelope-card .archive-pocket {background:linear-gradient(150deg,#504638,#40382e);border-color:#6b5943}
html[data-theme='night'] .collection-body .envelope-card .archive-flap {background:linear-gradient(170deg,#5c4e3e,#493e31)}
html[data-theme='night'] .new-envelope-fold {background:#574934}
html[data-theme='night'] .new-envelope-plus {background:#3e382d;color:#e0c5a3}
.desk-book-cover .book-label,.desk-writing-paper {color:#684b38}
.pwa-update {display:block;width:100%;max-width:700px;margin:0 auto 16px;padding:10px 14px;border:1px solid var(--paper-edge);border-radius:12px;background:var(--ivory);color:var(--ink-soft);font:12px/1.7 var(--letter-ui);cursor:pointer}
/* Independent paper cells prevent intersection. A single focused envelope lies flat. */
.collection-body .letter-card.envelope-card {height:238px;min-height:238px;padding:12px;contain:layout paint;isolation:isolate;overflow:hidden}
.envelope-motion {position:relative;width:100%;height:214px;isolation:isolate;transform:perspective(1500px) rotateX(-35deg) scale(.96);transform-origin:50% 50%;transform-style:flat;backface-visibility:hidden;transition:transform .22s ease-out}
.envelope-card[data-focus='focus'] .envelope-motion {transform:perspective(1500px) rotateX(0deg) scale(1)}
.envelope-card[data-focus='before'] .envelope-motion {transform:perspective(1500px) rotateX(35deg) scale(.96)}
.envelope-card:focus-within .envelope-motion {transform:perspective(1500px) rotateX(0deg) scale(1)}
.collection-body .envelope-motion>.mail-badges {display:none}
.collection-body .envelope-motion>.envelope-footer {position:absolute;top:21px;right:14px;left:auto;bottom:auto;width:auto;margin:0;padding:0;min-height:0;z-index:6;pointer-events:none}
.collection-body .envelope-motion .envelope-footer .record-date {font:10px/1.5 var(--letter-ui)}
@media(max-width:700px){.collection-body .letter-card.envelope-card{height:196px;min-height:196px;padding:10px}.envelope-motion{height:176px}.collection-body .envelope-motion>.envelope-footer{top:19px;right:10px}.collection-body .envelope-motion .envelope-footer .record-date{font-size:9px}}
@media(prefers-reduced-motion:reduce){.envelope-motion,.envelope-card[data-focus='focus'] .envelope-motion,.envelope-card[data-focus='before'] .envelope-motion {transform:none;transition:none}}

@media(max-width:700px){.collection-body .timeline-grid h2{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}}

/* One centered writing surface. A second column exists only while preview is open. */
#view-compose>.page-view {width:min(100%,820px);padding-top:24px}
#view-compose .compose-page-heading {position:relative;text-align:left;margin:0 0 20px;padding:0 125px 0 0}
#view-compose .compose-page-heading h1 {font-size:34px;line-height:1.35;letter-spacing:.025em;color:var(--ink)}
#view-compose .compose-page-heading p:last-of-type {margin:10px 0 0;font:14px/1.8 var(--letter-ui);color:var(--ink-soft)}
.compose-page-heading .compose-preview-toggle {position:absolute;right:0;top:32px;min-height:44px;padding:10px 17px;font:13px/1.6 var(--letter-ui);background:var(--ivory);border:1px solid var(--paper-edge);color:var(--ink);box-shadow:none}
#view-compose .page-view>.sticker-row {justify-content:flex-start;margin:0 0 18px;gap:12px}
#view-compose .page-view>.sticker-row svg {width:18px;height:18px}
#view-compose .compose-grid {grid-template-columns:minmax(0,1fr);gap:16px}
#view-compose .compose-card {padding:30px 34px;border-radius:12px;background:var(--ivory);background-image:none;box-shadow:0 5px 18px var(--warm-shadow);gap:20px}
#view-compose .writing-heading h2 {margin:7px 0 6px;font:400 23px/1.5 var(--letter-serif);color:var(--ink)}
#view-compose .writing-number {font:11px/1.6 var(--letter-ui);letter-spacing:.08em}
#view-compose .form-label {font:500 12px/1.7 var(--letter-ui);color:var(--ink-soft);gap:8px}
#view-compose #composeTitle {height:52px;min-height:52px;padding:5px 0 10px;border:0;border-bottom:1px solid var(--paper-edge);border-radius:0;background:transparent;color:var(--ink);font:400 23px/1.4 var(--letter-serif);box-shadow:none}
#view-compose #composeTitle::placeholder {font:17px/1.5 var(--letter-ui);color:var(--ink-soft);opacity:.7}
#view-compose #composeContent {height:330px;min-height:270px;max-height:70svh;padding:2px 0;border:0;border-radius:0;background:repeating-linear-gradient(to bottom,transparent 0 33px,var(--paper-edge) 33px 34px);background-position:0 2px;color:var(--ink);font:400 18px/34px var(--letter-serif);box-shadow:none;resize:vertical}
#view-compose #composeContent::placeholder {color:var(--ink-soft);opacity:.7;font-size:17px}
#view-compose #composeTitle:focus,#view-compose #composeContent:focus {outline:2px solid var(--peach);outline-offset:6px}
#view-compose .compose-attachment {display:grid;grid-template-columns:minmax(0,1fr) 72px;gap:8px 14px;align-items:center;margin:0;padding:12px 14px;border:1px dashed var(--paper-edge);border-radius:10px;background:transparent}
#view-compose .compose-attachment .upload-button {padding:4px 0;min-height:40px;background:none;border:0;box-shadow:none;color:var(--ink);font:13px/1.6 var(--letter-ui)}
#view-compose .compose-attachment .upload-hint {margin:0;font:11px/1.7 var(--letter-ui)}
#view-compose .compose-attachment .photo-preview-frame {margin:0;padding:0;border:0;border-radius:6px;overflow:hidden;box-shadow:none}
#view-compose .compose-attachment .photo-preview-surface {height:72px;min-height:0;aspect-ratio:1}
#view-compose .compose-attachment .photo-placeholder-hint {padding:8px}
#view-compose .compose-attachment .photo-placeholder-hint p {display:none}
#view-compose .compose-attachment .photo-placeholder-hint>span {font-size:25px}
#view-compose .compose-attachment #removeImage {grid-column:1/-1;justify-self:end;font:12px/1.7 var(--letter-ui)}
#view-compose .compose-personalize {margin:0;padding:16px 0}
#view-compose .compose-personalize>summary {font-size:14px}
#view-compose .compose-options {padding:20px 0 4px;gap:18px 14px}
#view-compose .compose-options .form-field {height:46px;min-height:46px;font:16px/normal var(--letter-ui);border-radius:9px;padding:0 12px}
#view-compose .compose-options .compose-wide {grid-column:1/-1}
#view-compose .draft-actions {display:flex;flex-wrap:wrap;gap:8px}
#view-compose .draft-actions .soft-button {min-height:40px;padding:8px 12px;font:12px/1.6 var(--letter-ui);box-shadow:none}
#view-compose .draft-note {margin:0;font:11px/1.7 var(--letter-ui)}
#view-compose #saveLetterButton {width:100%;min-height:48px;border-radius:10px;font:500 15px/1.6 var(--letter-ui)}
#view-compose .compose-preview {position:static;min-width:0}
#view-compose .compose-preview-fold {padding:16px 18px;border:1px solid var(--paper-edge);border-radius:12px;background:var(--ivory);scroll-margin-top:20px}
#view-compose .compose-preview-fold>summary {display:block;margin:0;font-size:13px}
#view-compose .compose-preview-fold[open]>summary {margin-bottom:18px}
#view-compose .compose-preview-header {display:none}
#view-compose .compose-preview .preview-paper {max-height:74svh;min-height:360px;padding:28px 24px;margin-top:14px;box-shadow:none}
#view-compose .compose-preview .preview-paper .subject .title {font-size:25px}
#view-compose .recent-letters-section {margin-top:24px;padding:22px 26px;border-radius:12px;box-shadow:none;background-image:none}
#view-compose .recent-letters-section h2 {font:400 20px/1.6 var(--letter-serif);margin-bottom:8px}
@media(min-width:1180px){
 #view-compose>.page-view:has(.compose-grid.has-preview) {width:min(100%,1160px)}
 #view-compose .compose-grid.has-preview {grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:24px}
 #view-compose .has-preview .compose-preview {position:sticky;top:22px}
}
@media(max-width:700px){
 #view-compose>.page-view {padding-top:20px}
 #view-compose .compose-page-heading {padding-right:0;margin-bottom:16px}
 #view-compose .compose-page-heading h1 {font-size:28px;padding-right:96px}
 #view-compose .compose-page-heading p:last-of-type {font-size:13px;max-width:none}
 .compose-page-heading .compose-preview-toggle {position:absolute;right:0;top:25px;margin:0;min-height:40px;padding:8px 12px;font-size:12px}
 #view-compose .page-view>.sticker-row {margin-bottom:14px}
 #view-compose .compose-card {padding:23px 20px;gap:18px;border-radius:10px}
 #view-compose .writing-heading h2 {font-size:21px}
 #view-compose .writing-number {font-size:10px}
 #view-compose #composeTitle {font-size:21px;height:48px;min-height:48px}
 #view-compose #composeTitle::placeholder {font-size:16px}
 #view-compose #composeContent {height:290px;min-height:240px;font-size:17px;line-height:32px;background-size:auto;background:repeating-linear-gradient(to bottom,transparent 0 31px,var(--paper-edge) 31px 32px);background-position:0 2px}
 #view-compose #composeContent::placeholder {font-size:16px}
 #view-compose .compose-attachment {grid-template-columns:minmax(0,1fr) 60px;padding:10px;gap:8px 10px}
 #view-compose .compose-attachment .photo-preview-surface {height:60px}
 #view-compose .compose-attachment .upload-hint {font-size:10px}
 #view-compose .compose-options {gap:16px 10px}
 #view-compose .compose-options select {font-size:14px;padding-inline:8px}
 #view-compose .sticker-picker {grid-template-columns:repeat(4,minmax(0,1fr))}
 #view-compose .draft-actions .soft-button {padding:8px;font-size:11px}
 #view-compose .recent-letters-section {padding:20px}
}
@media(max-width:360px){
 .library-hero {gap:10px}.new-letter-envelope {width:88px;height:82px}
 .collection-body .library-hero .view-heading h1 {font-size:24px;letter-spacing:0}
 .collection-body .library-hero .view-heading .view-kicker {font-size:9px;letter-spacing:0}
 #view-compose .compose-options {grid-template-columns:minmax(0,1fr)}
 #view-compose .compose-options select {font-size:16px}
 #view-compose .draft-actions .soft-button {flex-basis:calc(50% - 8px)}
}
html[data-theme='night'] .view-nav.quiet-bottom-nav {background:#302c25;border-color:var(--paper-edge)}
html[data-theme='night'] .collection-body .library-hero h1 {color:var(--ink)}
html[data-theme='night'] #view-compose .compose-card,html[data-theme='night'] #view-compose .compose-preview-fold,html[data-theme='night'] .library-control-panel {background:var(--ivory);color:var(--ink)}
html[data-theme='night'] .library-results #libraryStatus,html[data-theme='night'] .envelope-motion .record-date,html[data-theme='night'] .collection-body .archive-category {color:var(--ink-soft);opacity:1}
html[data-theme='night'] .library-control-panel .form-field::placeholder,html[data-theme='night'] #view-compose #composeContent::placeholder,html[data-theme='night'] #view-compose #composeTitle::placeholder {color:var(--ink-soft);opacity:1}

/* Cream, milk peach and paper. The content keeps the strongest contrast. */
body,.collection-body {--cream:#fff4ee;--apricot:#f7e4dd;--peach:#ebc9bf;--ivory:#fffdf8;--ink:#614b48;--ink-soft:#806763;--orange:#b9786b;--paper-edge:rgba(143,103,96,.16);--warm-shadow:rgba(136,98,84,.065);background:linear-gradient(145deg,#fff9f2,#fcf0e9 65%,#f9e8df)}
.view-heading h1,.view-heading p,.view-kicker {color:var(--ink)}
.view-kicker {color:var(--ink-soft)}
body .form-submit {background:#e7bfb2;color:#513b36;border:1px solid #d7aa9b;box-shadow:0 3px 9px var(--warm-shadow)}
body .form-submit:hover {background:#dfb2a3}
.page-context {position:sticky;top:0;z-index:41;display:flex;align-items:center;justify-content:space-between;gap:12px;width:min(100%,920px);margin:0 auto 8px;padding:8px 0;background:var(--cream);border-radius:9px;font:12px/1.6 var(--letter-ui)}
.context-tools {display:flex;gap:6px;margin-left:auto}
.context-back,.context-button {display:inline-flex;align-items:center;min-height:36px;padding:6px 10px;border:0;border-radius:20px;color:var(--ink-soft);background:none;text-decoration:none;font:inherit;cursor:pointer}
.context-button:hover,.context-back:hover {background:var(--apricot)}
.context-back[hidden] {display:none}
.usage-guide {width:min(100%,920px);margin:0 auto 18px;padding:16px 20px;border:1px solid var(--paper-edge);border-radius:14px;background:var(--ivory);color:var(--ink);font:13px/1.9 var(--letter-ui)}
.usage-guide summary {cursor:pointer;font-weight:500}.usage-guide ol {padding-left:20px;margin:10px 0 0}.usage-guide li+li {margin-top:6px}
.focus-restore {display:none;position:fixed;z-index:60;bottom:max(14px,env(safe-area-inset-bottom));right:16px;padding:10px 16px;border:1px solid var(--paper-edge);border-radius:24px;background:var(--ivory);color:var(--ink);font:12px/1.6 var(--letter-ui);box-shadow:0 3px 10px var(--warm-shadow);cursor:pointer}
.cozy-tools-hidden .account-bar,.cozy-tools-hidden .view-nav.quiet-bottom-nav {display:none}
.cozy-pointer-editing .view-nav.quiet-bottom-nav {display:none}
.cozy-tools-hidden .focus-restore {display:block}
.cozy-tools-hidden .page-context {margin-top:0}
.discovery-panel {margin:12px 0;border:0;min-width:0;color:var(--ink-soft)}
.discovery-panel>summary {display:flex;align-items:center;gap:8px;width:max-content;max-width:100%;min-height:38px;padding:8px 13px;border:1px solid var(--paper-edge);border-radius:24px;background:var(--ivory);list-style:none;font:12px/1.6 var(--letter-ui);cursor:pointer}
.discovery-panel>summary::-webkit-details-marker {display:none}.discovery-panel>summary::before {content:'⌕';font:20px/1 system-ui}.discovery-panel[open]>summary::before {content:'−';font-size:17px}
.discovery-panel>summary span {font-size:10px;opacity:.75}
.discovery-panel[open]>summary {margin-bottom:12px}
.collection-body .library-control-panel {border:0;border-radius:14px;padding:14px;background:var(--ivory);box-shadow:inset 0 0 0 1px var(--paper-edge)}
.library-results .view-switch {order:2;flex:none;margin:0;padding:2px;border-radius:22px;background:none;border:0}
.library-results .view-switch button {min-height:34px;padding:6px 11px;font:11px/1.5 var(--letter-ui);border-radius:20px}
.library-results-hint {display:none}
.collection-body .library-hero {margin-bottom:12px}
.collection-body .envelope-card .archive-pocket {background:linear-gradient(155deg,#fffef9,#fbf2e8)}
.collection-body .envelope-card .archive-flap {background:linear-gradient(170deg,#fff9f0,#f2e0d3)}
.collection-body .envelope-card .archive-seal {background:#d5a08e;border-color:#c28d7b;color:#fff9f1}
.desk-surface {background:repeating-linear-gradient(2deg,transparent 0 83px,rgba(149,112,99,.022) 84px 85px),linear-gradient(115deg,#f9e9d9,#f1dacf 58%,#fae8dc);border-color:var(--paper-edge)}
.desk-book-cover {background:#c7a097;border-color:#ad847c}.book-label {background:#fff8e9}.desk-quill {color:#b38773}
.desk-promise-card {display:grid;grid-template-columns:auto 1fr;align-items:center;gap:3px 18px;width:min(100%,620px);margin:22px auto 0;padding:20px 24px;border:1px solid var(--paper-edge);border-radius:16px;background:var(--ivory);color:var(--ink);text-decoration:none;box-shadow:0 4px 14px var(--warm-shadow)}
.desk-promise-card>span {grid-row:1/3;font:28px/1.5 var(--letter-serif);color:var(--orange)}
.desk-promise-card strong {font:400 20px/1.5 var(--letter-serif)}.desk-promise-card small {font:12px/1.6 var(--letter-ui);color:var(--ink-soft)}
.board-heading p {color:var(--ink-soft)}
.free-board {background:#fff8e8;color:var(--ink);background-image:none;border-color:var(--paper-edge);border-radius:17px;box-shadow:0 5px 16px var(--warm-shadow)}
.board-date-actions {display:flex;gap:8px;align-items:center;justify-content:flex-start;margin:16px 0}
.board-date-actions #noteDayLabel {font:13px/1.6 var(--letter-ui);margin-right:auto;color:var(--ink)}
.board-date-actions .soft-button {min-height:34px;padding:6px 10px;font-size:11px;background:transparent}
#stickyList .sticky-note {background:#fffdf5;box-shadow:0 3px 9px var(--warm-shadow);border:1px solid var(--paper-edge);transform:none;border-radius:10px;animation:none;opacity:1}
#stickyList .note-excerpt {font:17px/1.9 var(--letter-serif);color:var(--ink);margin:12px 0}
.note-thread-summary {display:inline-block;border-radius:18px;background:var(--cream);padding:6px 12px;min-height:34px}
.together-page {max-width:780px;padding-top:22px}
.together-page .view-heading {text-align:left;margin-bottom:24px}
.wish-compose {border:1px solid var(--paper-edge);border-radius:18px;background:var(--ivory);padding:18px 22px}
.wish-compose>summary {cursor:pointer;font:500 15px/1.7 var(--letter-ui);list-style:none}.wish-compose>summary::-webkit-details-marker {display:none}
.wish-compose>summary span {display:block;margin:3px 0 0 20px;color:var(--ink-soft);font:11px/1.6 var(--letter-ui)}
.wish-compose form {margin-top:22px}.wish-compose textarea.form-field {min-height:110px}.wish-compose .form-field {font:16px/1.7 var(--letter-ui)}
.wish-tabs {display:flex;flex-wrap:wrap;gap:7px;margin:22px 0 12px}.wish-tabs button {padding:7px 13px;min-height:36px;background:none;color:var(--ink-soft);border:1px solid transparent;border-radius:20px;font:12px/1.5 var(--letter-ui);cursor:pointer}
.wish-tabs button[aria-pressed='true'] {background:var(--ivory);border-color:var(--paper-edge);color:var(--ink)}
.wish-list,.activity-list {list-style:none;margin:0;padding:0;display:grid;gap:14px}
.wish-card {padding:24px;border:1px solid var(--paper-edge);border-radius:16px;background:var(--ivory);box-shadow:0 4px 12px var(--warm-shadow);overflow-wrap:anywhere}
.wish-meta {display:flex;justify-content:space-between;gap:12px;align-items:center;font:11px/1.6 var(--letter-ui);color:var(--ink-soft)}
.wish-state {padding:3px 9px;border-radius:14px;background:var(--apricot);color:var(--ink)}
.wish-card h2 {font:400 23px/1.6 var(--letter-serif);margin:15px 0 10px}
.wish-detail,.wish-response-note {font:14px/1.9 var(--letter-ui);white-space:pre-wrap;margin:10px 0;color:var(--ink);overflow-wrap:anywhere}
.wish-date,.wish-waiting {font:12px/1.7 var(--letter-ui);color:var(--ink-soft)}
.wish-response {padding-top:14px;border-top:1px solid var(--paper-edge);margin-top:18px}.wish-response summary {font:13px/1.7 var(--letter-ui);cursor:pointer}
.wish-response form {margin-top:16px}.wish-response textarea.form-field {min-height:85px;font:16px/1.7 var(--letter-ui)}
.wish-actions {display:flex;gap:10px;flex-wrap:wrap}.wish-actions .soft-button {font-size:12px;min-height:42px}.wish-approve {background:var(--apricot)}
.wish-complete {margin:12px 0;font-size:12px}.wish-card>.record-date {display:block;margin:14px 0 0;font-size:10px}
.wish-empty {padding:40px 20px;text-align:center;font:14px/1.9 var(--letter-ui);color:var(--ink-soft)}
.wish-highlight {outline:2px solid var(--peach);outline-offset:3px}
.activity-panel {margin:0 0 26px;padding:22px;border:1px solid var(--paper-edge);border-radius:16px;background:var(--ivory)}
.activity-panel[hidden] {display:none}.activity-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.activity-heading h2 {font:400 22px/1.5 var(--letter-serif);margin:0}.activity-heading button {font:11px/1.5 var(--letter-ui)}
.activity-item {position:relative;border-top:1px solid var(--paper-edge);padding:14px 0 10px 14px}
.activity-link {font:14px/1.7 var(--letter-ui);color:var(--ink);text-decoration:none}.activity-item time {display:block;margin-top:4px;font-size:10px}
.activity-item.is-unread::before {content:'';position:absolute;left:0;top:23px;width:5px;height:5px;border-radius:50%;background:var(--orange)}
html[data-theme='warm'] body {--cream:#fff3df;--ivory:#fff9ec;background:#fff3df}
html[data-theme='night'] body {--cream:#282620;--ivory:#343129;--ink:#e9dac7;--ink-soft:#c2b09b;--paper-edge:rgba(233,218,199,.16);--apricot:#4c463a;--peach:#796b54;background:#282620}
html[data-theme='night'] body .form-submit {background:#70584d;color:#fff4e3;border-color:#8e7061}
html[data-theme='night'] .free-board,html[data-theme='night'] #stickyList .sticky-note,html[data-theme='night'] .wish-card,html[data-theme='night'] .wish-compose {background:var(--ivory);color:var(--ink)}
html[data-theme='night'] .collection-body .envelope-card .archive-pocket {background:linear-gradient(150deg,#504638,#40382e)}
html[data-theme='night'] .collection-body .envelope-card .archive-flap {background:linear-gradient(170deg,#5c4e3e,#493e31)}
@media(max-width:700px){
 body:has(form:focus-within) .view-nav.quiet-bottom-nav {display:none}
 .app-shell {padding-inline:18px}
 .account-bar {gap:7px 10px;padding-bottom:9px;margin-bottom:0;border:0}
 .account-bar .theme-modes {padding:2px}.theme-button {min-height:26px;padding:3px 11px;font-size:10px}
 .account-actions {gap:9px;font-size:10px}.mail-brand {font-size:15px}.intro-replay {padding:4px 0;font-size:10px}
 .page-context {padding:2px 0;margin-bottom:0;font-size:11px}.context-back,.context-button {min-height:32px;padding:5px 8px}
 .page-view,.collection-body .library-page,.together-page,#view-compose>.page-view {padding-top:12px}
 .view-heading .view-kicker,.library-hero .view-heading .view-kicker {font-size:9px;margin-bottom:5px}
 .collection-body .library-hero .view-heading h1,.view-heading h1,#view-compose .compose-page-heading h1 {font-size:26px}
 .collection-body .library-hero .view-heading p:last-child {display:none}
 .library-hero {gap:12px}.new-letter-envelope {width:92px;height:76px}.new-envelope-fold {height:37px}.new-envelope-plus {top:13px}
 .new-envelope-title {font-size:11px}.collection-body .library-results {flex-wrap:wrap;margin-top:12px;gap:4px}
 .collection-body .library-results #libraryStatus {font-size:10px;flex:1;min-width:0}.library-results .view-switch button {padding-inline:8px;font-size:10px}
 .discovery-panel {margin:10px 0}.discovery-panel>summary {font-size:11px;min-height:34px;padding:6px 11px}.discovery-panel>summary span {font-size:9px}
 .collection-body .library-hero {margin-bottom:8px}
 .free-board {padding:23px 16px}.board-heading h2 {font-size:23px}.board-heading p {font-size:12px}
 #view-sticky .view-heading p:last-child {display:none}
 .board-heading .writing-number {display:none}.board-heading h2 {font-size:21px;margin-top:0}.board-heading p {font-size:11px}
 #view-sticky .page-view>.sticker-row {margin:8px 0 15px}
 .board-tools {grid-template-columns:1fr;gap:13px;padding:8px 0}.board-tools .form-field {font-size:16px}
 .board-date-actions {gap:6px;margin:12px 0}.board-date-actions #noteDayLabel {font-size:11px}.board-date-actions .soft-button {padding:5px 8px;min-height:32px}
 #stickyList .sticky-note {padding:20px 17px}.sticky-note .record-meta {font-size:10px;margin-bottom:12px}.note-excerpt {font:16px/1.9 var(--letter-serif)}
 .desk-promise-card {padding:17px 18px;gap:2px 13px;margin-top:16px}.desk-promise-card>span {font-size:23px}.desk-promise-card strong {font-size:17px}.desk-promise-card small {font-size:10px}
 .together-page .view-heading {margin-bottom:18px}.together-page .view-heading p:last-child {font-size:13px}
 .wish-compose {padding:16px}.wish-compose>summary {font-size:14px}.wish-tabs {gap:2px}.wish-tabs button {padding:6px 10px;font-size:11px}
 .wish-card {padding:21px 18px}.wish-card h2 {font-size:21px}.wish-detail {font-size:14px}
 .activity-panel {padding:18px 16px}.activity-heading h2 {font-size:20px}
 #view-compose .page-view>.sticker-row {margin-bottom:10px}.usage-guide {font-size:12px;padding:14px 17px}
}

/* One quiet header, with optional tools anchored to its trailing button. */
.account-bar.has-context {display:flex;align-items:center;gap:14px;margin:0 0 14px;padding:0;min-height:44px;border:0;position:relative;z-index:45}
.has-context .mail-brand {margin-right:auto;min-width:0}
.has-context .account-actions {flex:none;margin:0}
.has-context .context-back {flex:none;padding:4px 9px;font:12px/1.6 var(--letter-ui);min-height:40px;background:none}
.account-menu {position:relative;flex:none}
.account-menu>summary {display:grid;place-items:center;width:40px;height:40px;padding:0;list-style:none;border-radius:50%;background:var(--ivory);border:1px solid var(--paper-edge);color:var(--ink);font:22px/1 system-ui;cursor:pointer;user-select:none;touch-action:manipulation}
.account-menu>summary::-webkit-details-marker {display:none}
.account-menu-panel {position:absolute;top:calc(100% + 10px);right:0;width:min(272px,calc(100vw - 32px));padding:16px;border:1px solid var(--paper-edge);border-radius:18px;background:var(--ivory);box-shadow:0 12px 32px rgba(92,64,52,.12);display:grid;gap:12px;transform-origin:top right}
.account-menu:not([open])>.account-menu-panel {display:none}
.account-menu-panel .context-tools {display:grid;grid-template-columns:1fr;gap:2px;margin:0}
.account-menu-panel .context-button {min-height:42px;text-align:left;padding:9px 12px;border-radius:10px;font:13px/1.5 var(--letter-ui)}
.account-menu-panel .theme-modes {display:flex;grid-column:auto;grid-row:auto;width:100%;margin:0;padding:3px}
.account-menu-panel .theme-button {flex:1;min-height:38px;padding:7px 10px;font:12px/1.5 var(--letter-ui)}
.account-menu-panel .account-name {display:block;font:11px/1.6 var(--letter-ui);color:var(--ink-soft)}
.account-menu-panel .account-link,.account-menu-panel .intro-replay {display:block;grid-column:auto;grid-row:auto;min-height:40px;width:100%;margin:0;padding:8px 12px;text-align:left;font:12px/1.6 var(--letter-ui);border-radius:10px}
.account-menu-panel .context-button,.account-menu-panel .theme-button {min-height:44px}
.focus-restore {min-height:44px}
.pwa-tools,.web-push-settings {display:none}
.show-device-tools .pwa-tools {display:flex}.show-device-tools .web-push-settings {display:block}
.pwa-tools[hidden],.web-push-settings[hidden] {display:none!important}
.new-letter-envelope {width:112px;height:132px;padding:0;border:0;background:none;box-shadow:none;overflow:visible;justify-content:center;gap:0}
.new-writing-object {display:block;width:105px;height:105px;flex:none}
.new-letter-envelope .new-envelope-title {font:12px/1.5 var(--letter-ui);color:var(--ink-soft)}
.desk-wishes {width:25%;height:225px;right:12%;bottom:23px;text-align:center}
.wish-bottle {display:block;width:100%;height:178px;overflow:visible}
.desk-wishes .desk-caption {margin-top:8px}
.desk-replies {width:46%;left:8%;bottom:24px}
.desk-replies .desk-quill {right:-4px}
.note-day-control {position:relative;display:flex;align-items:center;min-height:40px;flex:1;cursor:pointer}
.note-day-control input {position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font:16px system-ui}
.note-day-control #noteDayLabel {margin:0}
.board-date-actions .soft-button {min-width:44px;min-height:44px}
.desk-object,.new-letter-envelope,button {touch-action:manipulation}
.desk-object:active,.new-letter-envelope:active {transform:translateY(1px) scale(.985)}
@media(hover:hover) and (pointer:fine){.desk-object:hover,.new-letter-envelope:hover{outline:none;filter:brightness(1.025)}}
@media(max-width:700px){
 .account-bar.has-context {gap:8px;margin-bottom:10px;min-height:40px}
 .has-context .context-back {font-size:0;width:44px;min-width:44px;min-height:44px;padding:0;justify-content:center}
 .has-context .context-back::before {content:'←';font:20px/1.4 var(--letter-ui)}
 .has-context .mail-brand {font-size:14px;letter-spacing:-.02em}
 .has-context .account-actions {font-size:11px;gap:0}.has-context .account-actions .account-link {min-height:40px;display:flex;gap:5px;align-items:center}
 .account-menu>summary {width:44px;height:44px;font-size:20px}
 .account-menu-panel {padding:13px}
 .new-letter-envelope {width:90px;height:108px;margin:0;padding:0;border:0;box-shadow:none;background:none}
 .new-writing-object {width:89px;height:89px}.new-letter-envelope .new-envelope-title {font-size:10px}
 .desk-wishes {width:29%;height:175px;right:8%;bottom:20px}
 .wish-bottle {height:139px}.desk-wishes .desk-caption {margin-top:5px}.desk-wishes .desk-caption small {font-size:9px}
 .desk-replies {width:47%;height:167px;left:5%;bottom:23px}
 .desk-replies .desk-writing-paper {height:116px;margin-right:8px;padding:15px}
 .desk-replies .desk-quill {height:136px;width:62px;right:-3px;top:-22px}
 .desk-replies .desk-caption {margin-top:15px}.desk-replies .desk-caption strong {font-size:13px}
 #view-sticky>.page-view>.view-heading {position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 #view-sticky .page-view>.sticker-row {justify-content:flex-end;gap:9px;margin:0 4px 12px}
 #view-sticky .page-view>.sticker-row svg {width:17px;height:17px}
 .wish-compose>summary {font-size:14px}.wish-compose {border-radius:15px;padding:15px 18px}
 .together-page .view-heading p:last-child {margin-top:7px;font-size:12px}
}
@media(prefers-reduced-motion:reduce){.desk-object:active,.new-letter-envelope:active{transform:none}}
@media(prefers-contrast:more){.account-menu-panel,.account-menu>summary{border-color:currentColor}}
