  * { box-sizing: border-box; margin: 0; padding: 0; }
  button { -webkit-tap-highlight-color: transparent; }
  button:active { transform: scale(0.97); }
  body { font-family: 'Lora', serif; background: #faf6f0; min-height: 100vh; overscroll-behavior-y: none; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

  /* ── Loading ── */
  .loading-screen { position: fixed; inset: 0; background: #faf6f0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 999; }
  .loading-screen .logo { font-family: 'Playfair Display', serif; font-size: 32px; color: #1e1008; margin-bottom: 8px; }
  .loading-screen .logo em { font-style: italic; color: #c0396b; }
  .spinner { width: 32px; height: 32px; border: 3px solid #ede4d8; border-top-color: #c0396b; border-radius: 50%; animation: spin 0.8s linear infinite; margin-top: 20px; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ── PIN Screen ── */
  .pin-screen { position: fixed; inset: 0; background: linear-gradient(160deg,#fff5f8 0%,#faf6f0 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 500; padding: 24px; }
  .pin-screen .pin-logo { font-family: 'Playfair Display', serif; font-size: 28px; color: #1e1008; margin-bottom: 6px; }
  .pin-screen .pin-logo em { font-style: italic; color: #c0396b; }
  .pin-screen .pin-subtitle { font-size: 13px; color: #6b5644; font-style: italic; margin-bottom: 40px; }
  .pin-card { background: #fff; border-radius: 20px; padding: 36px 32px; max-width: 340px; width: 100%; box-shadow: 0 8px 40px rgba(0,0,0,0.1); border: 1px solid #ede4d8; text-align: center; }
  .pin-card h2 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 400; color: #1e1008; margin-bottom: 6px; }
  .pin-card p { font-size: 13px; color: #6b5644; font-style: italic; margin-bottom: 28px; line-height: 1.6; }
  .pin-who-btns { display: flex; gap: 12px; margin-bottom: 32px; }
  .pin-who-btn { flex: 1; padding: 14px; border: 2px solid #ede4d8; border-radius: 12px; background: #faf6f0; cursor: pointer; font-family: 'Playfair Display', serif; font-size: 15px; color: #6b5644; transition: all 0.2s; }
  .pin-who-btn.selected { border-color: #c0396b; background: #fce8f0; color: #c0396b; }
  .pin-dots { display: flex; justify-content: center; gap: 12px; margin-bottom: 28px; }
  .pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #d4b8c0; background: transparent; transition: background 0.15s, border-color 0.15s; }
  .pin-dot.filled { background: #c0396b; border-color: #c0396b; }
  .pin-dot.error { background: #e05050; border-color: #e05050; animation: shake 0.3s ease; }
  @keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }
  .pin-keypad { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; max-width: 240px; margin: 0 auto 20px; }
  .pin-key { padding: 16px; border: 1.5px solid #ede4d8; border-radius: 12px; background: #faf6f0; cursor: pointer; font-family: 'Playfair Display', serif; font-size: 20px; color: #1e1008; transition: background 0.15s, border-color 0.15s, transform 0.1s; user-select: none; }
  .pin-key:hover { background: #f0e8f0; border-color: #c0396b; }
  .pin-key:active { transform: scale(0.94); }
  .pin-key.del { font-size: 16px; color: #6b5644; }
  .pin-error-msg { font-size: 13px; color: #e05050; font-style: italic; min-height: 20px; margin-bottom: 8px; }
  .pin-setup-hint { font-size: 12px; color: #82684c; font-style: italic; }

  /* ── Hero ── */
  .hero { text-align: center; padding: calc(56px + env(safe-area-inset-top)) 24px 40px; background: linear-gradient(180deg,#fff5f8 0%,#faf6f0 100%); border-bottom: 1px solid #ede4d8; position: relative; }
  .hero-kicker { font-size: 11px; letter-spacing: 4px; text-transform: uppercase; color: #c0396b; margin-bottom: 14px; }
  .hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(36px,7vw,60px); font-weight: 400; color: #1e1008; line-height: 1.1; margin-bottom: 12px; }
  .hero h1 em { font-style: italic; color: #c0396b; }
  .hero p { color: #6b5644; font-size: 15px; font-style: italic; max-width: 380px; margin: 0 auto; line-height: 1.7; }
  .hero-flourish { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; color: #c0396b; font-size: 13px; }
  .hero-flourish span { display: block; width: 48px; height: 1px; background: linear-gradient(90deg, transparent, #d4a8b8); }
  .hero-flourish span:last-child { background: linear-gradient(90deg, #d4a8b8, transparent); }
  .hero-user-badge { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 6px; z-index: 5; }
  @media (max-width: 600px) {
    .hero { padding-top: 68px; }
    .hero-user-badge { top: 12px; right: 12px; }
    .user-pill { font-size: 11px; padding: 5px 11px; }
    .lock-out-btn { font-size: 10px; padding: 5px 10px; }
  }
  .user-pill { background: #fce8f0; border: 1px solid #f0c8d8; border-radius: 50px; padding: 6px 14px; font-size: 12px; color: #c0396b; font-family: 'Lora', serif; font-style: italic; }
  .lock-out-btn { background: #f0ebe3; border: none; border-radius: 50px; padding: 6px 12px; font-size: 11px; color: #6b5644; cursor: pointer; font-family: 'Lora', serif; transition: background 0.2s; }
  .lock-out-btn:hover { background: #e0d8cc; }

  /* ── Tabs ── */
  .tabs { display: flex; max-width: 560px; margin: 0 auto; border-bottom: 2px solid #ede4d8; padding: 0 24px; }
  .tab-btn { flex: 1; padding: 18px 0; border: none; background: none; cursor: pointer; font-family: 'Playfair Display', serif; font-size: 15px; color: #82684c; position: relative; transition: color 0.2s; }
  .tab-btn.active { color: #1e1008; }
  .tab-btn.active::after { content:''; position:absolute; bottom:-2px; left:0; right:0; height:2px; background:#c0396b; }

  .modal-receipt { font-size: 10.5px; font-style: italic; color: #c0396b; margin-top: 3px; }

  /* ── Section ── */
  .section { padding: 40px 24px calc(80px + env(safe-area-inset-bottom)); max-width: 920px; margin: 0 auto; animation: sectionFade 0.3s ease; }
  @keyframes sectionFade { from { opacity: 0; } to { opacity: 1; } }
  .section-title { font-family: 'Playfair Display', serif; font-size: 14px; font-style: italic; color: #6b5644; margin-bottom: 28px; text-align: center; }

  /* ── Locked tab notice ── */

  /* ── Grid ── */
  .grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 18px; }
  .envelope { border-radius: 14px; padding: 26px 22px 52px; cursor: pointer; border: 1.5px solid rgba(0,0,0,0.06); box-shadow: 0 1px 3px rgba(30,16,8,0.06), 0 6px 20px rgba(30,16,8,0.06); transition: transform 0.22s ease, box-shadow 0.22s ease; position: relative; }
  .envelope.card-enter { animation: cardIn 0.5s cubic-bezier(0.16,1,0.3,1) backwards; }
  @keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
  .envelope:hover { transform: translateY(-5px); box-shadow: 0 2px 6px rgba(30,16,8,0.07), 0 18px 44px rgba(30,16,8,0.14); }
  .envelope.time-locked { cursor: default; opacity: 0.78; }
  .envelope.time-locked:hover { transform: none; box-shadow: 0 1px 3px rgba(30,16,8,0.06), 0 6px 20px rgba(30,16,8,0.06); }
  .env-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
  .env-emoji { font-size: 26px; }
  .env-badge { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; }
  .env-title { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 400; color: #1a1008; line-height: 1.35; margin-bottom: 4px; }
  .env-sub { font-size: 11.5px; color: #6b5644; font-style: italic; }
  .env-date { font-size: 10px; color: #82684c; font-style: italic; margin-top: 5px; }
  .env-unlock { font-size: 11px; color: #c0396b; font-style: italic; margin-top: 6px; }
  .env-seal { position: absolute; bottom: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; transition: transform 0.2s; }
  .envelope:not(.time-locked):hover .env-seal { transform: rotate(20deg); }
  .env-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 5px; opacity: 1; transition: opacity 0.2s; }
  @media (hover: hover) and (pointer: fine) {
    .env-actions { opacity: 0; }
    .envelope:hover .env-actions { opacity: 1; }
  }
  .env-action-btn { background: rgba(200,0,50,0.10); border: none; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; font-size: 13px; color: #c0396b; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
  .env-action-btn:hover { background: rgba(200,0,50,0.22); }
  .env-action-btn.edit { background: rgba(60,100,200,0.10); color: #3a5a9a; }
  .env-action-btn.edit:hover { background: rgba(60,100,200,0.22); }

  /* ── Write btn / Form ── */
  .write-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 340px; margin: 0 auto 32px; padding: 14px 28px; background: #c0396b; color: #fff; border: none; border-radius: 50px; cursor: pointer; font-family: 'Playfair Display', serif; font-size: 16px; font-style: italic; box-shadow: 0 4px 20px rgba(192,57,107,0.35); transition: transform 0.2s,box-shadow 0.2s; }
  .write-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(192,57,107,0.45); }
  .form-card { background: #fff; border-radius: 16px; padding: 32px 28px; max-width: 560px; margin: 0 auto 36px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); border: 1px solid #ede4d8; }
  .form-card h3 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 400; color: #1e1008; margin-bottom: 6px; }
  .form-card > p { font-size: 13px; color: #6b5644; font-style: italic; margin-bottom: 24px; }
  .form-label { display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #82684c; margin-bottom: 8px; }
  .form-input, .form-textarea { width: 100%; border: 1.5px solid #ede4d8; border-radius: 10px; padding: 12px 16px; font-family: 'Lora', serif; font-size: 15px; color: #1e1008; background: #faf6f0; outline: none; resize: vertical; transition: border-color 0.2s; }
  .form-input:focus, .form-textarea:focus { border-color: #c0396b; }
  .form-textarea { min-height: 150px; line-height: 1.75; }
  .form-group { margin-bottom: 20px; }
  .timelock-toggle { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #faf6f0; border-radius: 10px; border: 1.5px solid #ede4d8; cursor: pointer; margin-bottom: 12px; transition: border-color 0.2s; }
  .timelock-toggle:hover { border-color: #c0396b; }
  .timelock-toggle input[type=checkbox] { width: 18px; height: 18px; accent-color: #c0396b; cursor: pointer; }
  .timelock-toggle span { font-size: 14px; color: #3a2e24; }
  .timelock-toggle span em { font-style: italic; color: #6b5644; font-size: 12px; }
  .date-input-wrap { margin-top: 4px; }
  .emoji-grid { margin-top: 4px; }
  .emoji-cat-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .emoji-cat-tab { padding: 5px 12px; border-radius: 50px; border: 1.5px solid #ede4d8; background: #faf6f0; cursor: pointer; font-family: 'Lora', serif; font-size: 11.5px; color: #6b5644; transition: all 0.15s; }
  .emoji-cat-tab:hover { border-color: #c0396b; color: #c0396b; }
  .emoji-cat-tab.active { background: #c0396b; border-color: #c0396b; color: #fff; }
  .emoji-cells { display: flex; flex-wrap: wrap; gap: 6px; max-height: 148px; overflow-y: auto; padding: 4px; border: 1.5px solid #ede4d8; border-radius: 10px; background: #fdfaf5; scrollbar-width: thin; scrollbar-color: #d4b8c0 transparent; }
  .emoji-cells::-webkit-scrollbar { width: 6px; }
  .emoji-cells::-webkit-scrollbar-thumb { background: #d4b8c0; border-radius: 3px; }
  .emoji-opt { font-size: 22px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: background 0.15s,border-color 0.15s; background: #faf6f0; }
  .emoji-opt:hover { background: #f0e0ec; }
  .emoji-opt.selected { border-color: #c0396b; background: #fce8f0; }
  .color-row { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
  .color-dot { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; transition: transform 0.15s; border: 3px solid transparent; }
  .color-dot.selected { transform: scale(1.2); }
  .form-actions { display: flex; gap: 12px; margin-top: 24px; }
  .btn-submit { flex: 1; padding: 13px; background: #c0396b; color: #fff; border: none; border-radius: 10px; cursor: pointer; font-family: 'Playfair Display', serif; font-size: 16px; font-style: italic; transition: background 0.2s; }
  .btn-submit:hover { background: #a82e5a; }
  .btn-submit:disabled { background: #d4a0b0; cursor: not-allowed; }
  .btn-cancel { padding: 13px 20px; background: #f0ebe3; color: #6b5644; border: none; border-radius: 10px; cursor: pointer; font-family: 'Lora', serif; font-size: 14px; transition: background 0.2s; }
  .btn-cancel:hover { background: #e0d8cc; }

  /* ── Empty ── */
  .empty-state { text-align: center; padding: 60px 24px; }
  .empty-state .big { font-size: 52px; margin-bottom: 16px; }
  .empty-state p { font-family: 'Playfair Display', serif; font-size: 18px; font-style: italic; color: #c0a882; }

  /* ── Modal ── */
  .overlay { position: fixed; inset: 0; background: rgba(20,10,5,0.6); backdrop-filter: blur(6px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn 0.2s ease; }
  @keyframes fadeIn { from{opacity:0} to{opacity:1} }
  .letter-modal { background: #fffef9; background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(180,150,120,0.015) 2px, rgba(180,150,120,0.015) 4px), repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(180,150,120,0.012) 2px, rgba(180,150,120,0.012) 4px); border-radius: 18px; padding: 44px 40px 36px; max-width: 520px; width: 100%; position: relative; box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 40px 90px rgba(0,0,0,0.28); animation: slideUp 0.3s cubic-bezier(0.16,1,0.3,1); border: 1px solid rgba(0,0,0,0.06); max-height: 90vh; overflow-y: auto; }
  @keyframes slideUp { from{opacity:0;transform:translateY(28px) scale(0.96)} to{opacity:1;transform:translateY(0) scale(1)} }
  .modal-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid #ede8e0; }
  .modal-emoji { font-size: 34px; margin-top: 2px; }
  .modal-kicker { font-family: 'Playfair Display', serif; font-size: 12px; font-style: italic; color: #6b5644; margin-bottom: 4px; }
  .modal-trigger { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; color: #1a1008; line-height: 1.2; }
  .modal-from { font-size: 11px; font-style: italic; color: #82684c; margin-top: 4px; }
  .modal-body { font-family: 'Lora', serif; font-size: 15.5px; line-height: 1.9; color: #3a2e24; white-space: pre-wrap; }
  .modal-body::first-letter { font-size: 1.6em; font-family: 'Playfair Display', serif; color: #c0396b; line-height: 1; }
  .modal-footer { margin-top: 28px; padding-top: 18px; border-top: 1px solid #ede8e0; text-align: center; font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: #c0396b; }
  .close-btn { position: absolute; top: 14px; right: 14px; background: #f0ebe3; border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; color: #6b5644; transition: background 0.2s; line-height: 1; }
  .close-btn:hover { background: #e0d8cc; color: #1e1008; }
  .reply-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid #ede8e0; }
  .reply-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #82684c; margin-bottom: 10px; display: block; }
  .reply-bubble { background: #fce8f0; border-radius: 12px; padding: 14px 36px 14px 16px; margin-bottom: 10px; position: relative; }
  .reply-textarea { width: 100%; border: 1.5px solid #ede4d8; border-radius: 10px; padding: 11px 14px; font-family: 'Lora', serif; font-size: 14px; color: #1e1008; background: #faf6f0; outline: none; resize: none; min-height: 90px; line-height: 1.65; transition: border-color 0.2s; }
  .reply-textarea:focus { border-color: #c0396b; }
  .reply-btn { margin-top: 10px; padding: 10px 22px; background: #c0396b; color: #fff; border: none; border-radius: 50px; cursor: pointer; font-family: 'Playfair Display', serif; font-size: 14px; font-style: italic; transition: background 0.2s; }
  .reply-btn:hover { background: #a82e5a; }
  .reply-btn:disabled { background: #d4a0b0; cursor: not-allowed; }
  .locked-modal-body { text-align: center; padding: 32px 0 8px; }
  .locked-modal-body .lock-icon { font-size: 48px; margin-bottom: 16px; }
  .locked-modal-body h3 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; color: #1e1008; margin-bottom: 8px; }
  .locked-modal-body p { font-size: 14px; color: #6b5644; font-style: italic; line-height: 1.6; }
  .locked-modal-body .unlock-date { font-family: 'Playfair Display', serif; font-size: 16px; color: #c0396b; margin-top: 12px; font-style: italic; }

  /* ── Photo upload ── */
  .photo-upload-area { border: 2px dashed #ede4d8; border-radius: 12px; padding: 20px; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; background: #faf6f0; position: relative; }
  .photo-upload-area:hover { border-color: #c0396b; background: #fce8f0; }
  .photo-upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
  .photo-upload-area .upload-icon { font-size: 28px; margin-bottom: 6px; }
  .photo-upload-area p { font-size: 13px; color: #6b5644; font-style: italic; }
  .photo-preview-wrap { position: relative; margin-top: 12px; }
  .photo-alt-input { margin-top: 8px; font-size: 13px; }
  .photo-preview-wrap img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 10px; display: block; }
  .photo-remove-btn { position: absolute; top: 8px; right: 8px; background: rgba(20,10,5,0.6); border: none; border-radius: 50%; width: 28px; height: 28px; color: #fff; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .modal-photo { width: 100%; border-radius: 12px; margin-top: 20px; display: block; }

  /* ── Reply bubble delete ── */
  .reply-bubble p { font-family: 'Lora', serif; font-size: 14px; color: #3a2e24; line-height: 1.7; white-space: pre-wrap; }
  .reply-bubble .reply-meta { font-size: 10px; color: #82684c; font-style: italic; margin-top: 6px; }
  .reply-delete-btn { position: absolute; top: 8px; right: 8px; background: none; border: none; font-size: 13px; color: #d4a0b0; cursor: pointer; line-height: 1; padding: 2px; transition: color 0.2s; }
  .reply-delete-btn:hover { color: #c0396b; }

  /* ── Undo toast ── */
  .undo-toast { position: fixed; bottom: calc(28px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #1e1008; color: #fff; padding: 12px 20px; border-radius: 50px; font-size: 13px; font-family: 'Lora', serif; font-style: italic; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 999; display: flex; align-items: center; gap: 14px; white-space: nowrap; }
  .undo-toast.show { opacity: 1; pointer-events: all; }
  .undo-toast button { background: #c0396b; border: none; color: #fff; padding: 5px 14px; border-radius: 20px; font-family: 'Lora', serif; font-size: 12px; cursor: pointer; font-style: normal; }

  /* ── Export button ── */
  .env-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .env-title-row .env-title { flex: 1; }
  .env-dl-btn { flex-shrink: 0; background: rgba(192,57,107,0.10); border: none; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 12px; color: #c0396b; display: flex; align-items: center; justify-content: center; margin-top: 2px; opacity: 1; transition: opacity 0.2s, background 0.2s; }
  @media (hover: hover) and (pointer: fine) {
    .env-dl-btn { opacity: 0; }
    .envelope:hover .env-dl-btn { opacity: 1; }
  }
  .env-dl-btn:hover { background: rgba(192,57,107,0.22); }

  /* ── Search & Filter ── */
  .search-filter-bar { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 0 auto 28px; }
  .search-wrap { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid #ede4d8; border-radius: 50px; padding: 10px 18px; transition: border-color 0.2s; }
  .search-wrap:focus-within { border-color: #c0396b; }
  .search-input { flex: 1; border: none; outline: none; background: none; font-family: 'Lora', serif; font-size: 14px; color: #1e1008; }
  .search-input::placeholder { color: #c0a882; font-style: italic; }
  .filter-pills { display: flex; gap: 8px; justify-content: center; }
  .filter-pill { padding: 7px 18px; border-radius: 50px; border: 1.5px solid #ede4d8; background: #fff; cursor: pointer; font-family: 'Lora', serif; font-size: 12.5px; color: #6b5644; transition: all 0.2s; }
  .filter-pill:hover { border-color: #c0396b; color: #c0396b; }
  .filter-pill.active { background: #c0396b; border-color: #c0396b; color: #fff; }

  /* ── Opening ceremony ── */
  .ceremony-overlay { position: fixed; inset: 0; background: rgba(20,10,5,0.68); backdrop-filter: blur(10px); z-index: 300; opacity: 0; transition: opacity 0.28s ease; cursor: pointer; }
  .ceremony-overlay.visible { opacity: 1; }
  .cer-env { position: fixed; z-index: 301; perspective: 800px; transition: left 0.55s cubic-bezier(0.22,1,0.36,1), top 0.55s cubic-bezier(0.22,1,0.36,1), width 0.55s cubic-bezier(0.22,1,0.36,1), height 0.55s cubic-bezier(0.22,1,0.36,1); pointer-events: none; }
  .cer-body { position: absolute; inset: 0; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
  .cer-pocket { position: absolute; left: 0; right: 0; bottom: 0; height: 58%; border-radius: 0 0 14px 14px; z-index: 3; clip-path: polygon(0 0, 50% 42%, 100% 0, 100% 100%, 0 100%); }
  .cer-letter { position: absolute; left: 7%; right: 7%; top: 16%; bottom: 10%; background: #fffef9; border-radius: 8px; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: transform 0.6s cubic-bezier(0.22,1,0.36,1), opacity 0.35s ease; box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
  .cer-letter .cer-emoji { font-size: 30px; }
  .cer-letter .cer-lines { width: 55%; }
  .cer-letter .cer-lines div { height: 3px; background: #e8ddd0; border-radius: 2px; margin: 5px 0; }
  .cer-letter .cer-lines div:last-child { width: 65%; }
  .cer-flap { position: absolute; top: 0; left: 0; right: 0; height: 52%; transform-origin: top center; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.45,0,0.2,1); z-index: 4; clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 14px 14px 0 0; }
  .cer-seal { position: absolute; top: 42%; left: 50%; transform: translate(-50%,-50%); width: 46px; height: 46px; border-radius: 50%; z-index: 5; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(0,0,0,0.28), inset 0 0 0 3px rgba(255,255,255,0.22); transition: transform 0.4s cubic-bezier(0.68,-0.55,0.27,1.55), opacity 0.3s ease; }
  .cer-seal.crack { transform: translate(-50%,-50%) scale(0); opacity: 0; }
  .cer-seal.pulse { animation: sealPulse 0.35s ease; }
  @keyframes sealPulse { 0%{transform:translate(-50%,-50%) scale(1)} 50%{transform:translate(-50%,-50%) scale(1.22)} 100%{transform:translate(-50%,-50%) scale(1)} }
  .cer-skip { position: fixed; bottom: calc(34px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.65); font-size: 11.5px; font-style: italic; font-family: 'Lora', serif; z-index: 302; letter-spacing: 1px; pointer-events: none; animation: skipFade 0.4s ease 0.6s backwards; }
  @keyframes skipFade { from { opacity: 0; } to { opacity: 1; } }

  /* ── Draft button ── */
  .btn-draft { padding: 13px 20px; background: #fff8e0; color: #a08020; border: 1.5px solid #f0e4b0; border-radius: 10px; cursor: pointer; font-family: 'Lora', serif; font-size: 13px; font-style: italic; transition: background 0.2s; }
  .btn-draft:hover { background: #fdf0c8; }
  .draft-badge { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; background: #fdf0c880; color: #a08020; }
  .env-draft-strip { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: repeating-linear-gradient(45deg, #f0d060, #f0d060 8px, #fff8e0 8px, #fff8e0 16px); border-radius: 14px 14px 0 0; }

  /* ── Favorite heart ── */
  .env-fav-btn { position: absolute; bottom: 16px; left: 16px; background: none; border: none; cursor: pointer; padding: 2px; display: flex; align-items: center; justify-content: center; transition: transform 0.15s; }
  .env-fav-btn:hover { transform: scale(1.2); }
  .env-fav-btn svg { display: block; }
  .env-fav-btn.faved { animation: favPop 0.35s ease; }
  @keyframes favPop { 0%{transform:scale(1)} 50%{transform:scale(1.45)} 100%{transform:scale(1)} }

  /* ── Confirm modal ── */
  .confirm-card { background: #fffef9; border-radius: 18px; padding: 36px 32px 28px; max-width: 340px; width: 100%; text-align: center; box-shadow: 0 40px 90px rgba(0,0,0,0.3); animation: slideUp 0.3s cubic-bezier(0.16,1,0.3,1); }
  .confirm-card .confirm-emoji { font-size: 40px; margin-bottom: 14px; }
  .confirm-card h3 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 400; color: #1e1008; margin-bottom: 8px; }
  .confirm-card p { font-size: 13.5px; color: #6b5644; font-style: italic; line-height: 1.6; margin-bottom: 24px; }
  .confirm-actions { display: flex; gap: 10px; }
  .confirm-cancel { flex: 1; padding: 12px; background: #f0ebe3; color: #6b5644; border: none; border-radius: 10px; cursor: pointer; font-family: 'Lora', serif; font-size: 14px; transition: background 0.2s; }
  .confirm-cancel:hover { background: #e0d8cc; }
  .confirm-delete { flex: 1; padding: 12px; background: #c0396b; color: #fff; border: none; border-radius: 10px; cursor: pointer; font-family: 'Playfair Display', serif; font-size: 15px; font-style: italic; transition: background 0.2s; }
  .confirm-delete:hover { background: #a82e5a; }

  .env-seal svg { display: block; }

  /* ── Skeleton loading ── */
  .skeleton-card { border-radius: 14px; height: 168px; background: linear-gradient(100deg, #f3ece2 40%, #faf5ec 50%, #f3ece2 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border: 1.5px solid rgba(0,0,0,0.04); }
  @keyframes shimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }

  /* ── Empty search ── */
  .load-more-btn { display: block; margin: 28px auto 0; padding: 10px 24px; background: none; border: 1.5px solid #ede4d8; border-radius: 50px; cursor: pointer; font-family: 'Lora', serif; font-style: italic; font-size: 13px; color: #6b5644; transition: all 0.2s; }
  .load-more-btn:hover { border-color: #c0396b; color: #c0396b; }
  .empty-search { text-align: center; padding: 48px 24px; display: none; }
  .empty-search .big { font-size: 44px; margin-bottom: 12px; }
  .empty-search p { font-family: 'Playfair Display', serif; font-size: 16px; font-style: italic; color: #c0a882; }

  /* ── Toast ── */
  .toast { position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #1e1008; color: #fff; padding: 12px 24px; border-radius: 50px; font-size: 13px; font-family: 'Lora', serif; font-style: italic; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 999; white-space: nowrap; }
  .toast.show { opacity: 1; }

  .hidden { display: none; }
