/* Released-message viewer. Tokens from design/message-viewer/README.md (repo root). */

@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F3F1EC; --card: #FFFFFF; --inset: #F7F6F2; --hair: #E6E3DC;
  --ink: #2A2440; --ink-hover: #3a3356; --sub: #55506a; --on-ink: #FAF9F6;
  --dot: #0fb4b7; --tint: #e4f6f6; --teal: #0b6f72; --teal-hover: #0a9ba0; --on-tint: #0b4f52;
  --wave: #CFCAD9;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-family: Inter, system-ui, -apple-system, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-hover); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
[hidden] { display: none !important; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.top { width: 100%; max-width: 720px; margin: 0 auto; padding: 22px 22px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--dot); }
.pill { display: flex; align-items: center; height: 36px; padding: 0 15px; border-radius: 999px; background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink); box-shadow: 0 6px 16px -10px rgba(31,41,55,.35); }
.pill:hover { color: var(--ink); }
.column { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 28px 16px 48px; }

/* Intro / error cards */
.card { background: var(--card); border-radius: 28px; padding: 30px 28px; }
.card-narrow { max-width: 480px; margin: 6vh auto 0; padding: 36px 32px 32px; }
.loading { color: var(--sub); font-size: 16px; text-align: center; }
.sender { display: flex; align-items: center; gap: 14px; }
.initial { flex: none; width: 52px; height: 52px; border-radius: 18px; background: var(--tint); color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; }
.sender-name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.sender-date { margin-top: 3px; font-size: 14px; color: var(--sub); }
.h1.first { margin-top: 0; }
.h1 { margin: 28px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; text-wrap: pretty; overflow-wrap: anywhere; }
.body { margin: 14px 0 0; font-size: 16px; line-height: 1.65; color: var(--sub); text-wrap: pretty; }
.body strong, .note strong { color: var(--ink); }
.primary { margin-top: 26px; width: 100%; height: 54px; border-radius: 18px; background: var(--ink); color: var(--on-ink); font-size: 16px; font-weight: 700; transition: background .15s ease; }
.primary:hover { background: var(--ink-hover); }
.note { margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--hair); font-size: 14px; line-height: 1.6; color: var(--sub); text-wrap: pretty; overflow-wrap: anywhere; }
.note a { font-weight: 700; }

/* Message */
.message { animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .message { animation: none; } }
.from { padding: 8px 8px 0; }
.from-label { font-size: 14px; font-weight: 600; color: var(--sub); }
.from-name { margin: 8px 0 0; font-size: 44px; font-weight: 700; letter-spacing: -.04em; line-height: 1.05; overflow-wrap: anywhere; }
.from-date { margin: 14px 0 0; font-size: 16px; line-height: 1.6; color: var(--sub); text-wrap: pretty; }
.stack { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sub); }
.meta { font-size: 14px; color: var(--sub); font-variant-numeric: tabular-nums; }
.link-button { font-size: 14.5px; font-weight: 700; color: var(--teal); }
.link-button:hover { color: var(--teal-hover); }
.unavailable { margin: 16px 0 0; font-size: 14px; color: var(--sub); }

.letter { margin-top: 16px; font-size: 18px; line-height: 1.8; max-width: 560px; white-space: pre-wrap; text-wrap: pretty; overflow-wrap: anywhere; }
.letter-toggle { margin-top: 14px; font-size: 15.5px; font-weight: 700; color: var(--teal); }

.video { position: relative; margin-top: 16px; aspect-ratio: 16 / 9; border-radius: 20px; background: #E7E2D8; overflow: hidden; }
.video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.video.playing { background: #000; }
.video-hit { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.play-big { width: 60px; height: 60px; border-radius: 999px; background: #fff; box-shadow: 0 10px 24px -10px rgba(31,41,55,.45); display: flex; align-items: center; justify-content: center; transition: opacity .2s ease; }
.video.playing .play-big { opacity: 0; }
.video.playing .video-hit:hover .play-big, .video.playing .video-hit:focus-visible .play-big { opacity: 1; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.35); }
.progress > div { height: 100%; width: 0; background: var(--dot); }

.tri { width: 0; height: 0; border-style: solid; border-color: transparent transparent transparent currentColor; }
.tri-big { border-width: 9px 0 9px 14px; margin-left: 3px; color: var(--ink); }
.tri-small { border-width: 7px 0 7px 11px; margin-left: 3px; color: var(--on-ink); }
.bars { display: flex; }
.bars i { display: block; border-radius: 2px; }
.bars-big { gap: 5px; } .bars-big i { width: 5px; height: 18px; background: var(--ink); }
.bars-small { gap: 4px; } .bars-small i { width: 4px; height: 14px; background: var(--on-ink); }

.voice { margin-top: 16px; display: flex; align-items: center; gap: 16px; padding: 12px 18px 12px 12px; border-radius: 20px; background: var(--inset); }
.voice-play { flex: none; width: 48px; height: 48px; border-radius: 999px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.wave { flex: 1; min-width: 0; height: 36px; display: flex; align-items: center; gap: 3px; overflow: hidden; cursor: pointer; }
.wave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--wave); }
.wave i.played { background: var(--dot); }
.voice-time { flex: none; font-size: 14px; font-weight: 600; color: var(--sub); font-variant-numeric: tabular-nums; }

.grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 14px; background: #DCD7CB; overflow: hidden; transition: transform .15s ease; }
.tile:hover { transform: scale(1.02); }
.tile img, .lb-thumb img, .lb-photo img { opacity: 0; transition: opacity .2s ease; }
.tile img.ready, .lb-thumb img.ready, .lb-photo img.ready { opacity: 1; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .veil { position: absolute; inset: 0; background: rgba(250,249,246,.7); }
.tile .more { position: relative; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; height: 100%; }

.banner { border-radius: 28px; padding: 26px 28px; background: var(--tint); display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.banner-text { flex: 1; min-width: 220px; color: var(--on-tint); }
.banner-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.banner-body { margin: 5px 0 0; font-size: 14.5px; line-height: 1.55; text-wrap: pretty; overflow-wrap: anywhere; }
.stores { flex: none; display: flex; gap: 8px; flex-wrap: wrap; }
.store { display: flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; height: 44px; padding: 0 18px; border-radius: 14px; font-size: 14.5px; font-weight: 700; }
.store svg { flex: none; }
.store-apple { background: var(--ink); color: var(--on-ink); }
.store-apple:hover { color: var(--on-ink); background: var(--ink-hover); }
.store-play { background: #fff; color: var(--ink); }
.store-play:hover { color: var(--ink); }

.foot { margin-top: 28px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--sub); }
.foot-private { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.foot-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--dot); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: var(--ink); color: var(--on-ink); display: flex; flex-direction: column; }
.lb-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; }
.lb-count { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lb-round { flex: none; width: 44px; height: 44px; border-radius: 999px; background: rgba(250,249,246,.12); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--on-ink); }
.lb-nav { width: 48px; height: 48px; font-size: 20px; }
.lb-mid { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 16px; }
.lb-photo { flex: 1; max-width: 820px; height: 100%; max-height: 64vh; display: flex; align-items: center; justify-content: center; }
.lb-photo img { max-width: 100%; max-height: 100%; border-radius: 16px; object-fit: contain; }
.lb-strip { display: flex; gap: 6px; overflow-x: auto; padding: 16px 20px 22px; justify-content: safe center; }
.lb-thumb { position: relative; flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; opacity: .6; background: rgba(250,249,246,.12); }
.lb-thumb.active { border-color: var(--on-ink); opacity: 1; }
.lb-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 520px) { .lb-nav { display: none; } .lb-mid { padding: 0 12px; } }

.noscript { text-align: center; color: var(--sub); font-family: system-ui, sans-serif; }

/* /open */
.stores-open { margin-top: 24px; }
.store-outline { border: 1px solid var(--ink); }

/* DELIVERY-015: the code step */
button:disabled { cursor: default; }
.primary:disabled { background: var(--ink-hover); opacity: .75; }
.status { margin: 14px 0 0; min-height: 22px; font-size: 14px; line-height: 1.6; color: var(--sub); }
.status:empty { display: none; }
.status.busy { color: var(--teal); }
.status.error { color: #a1343c; }
.below-card { max-width: 480px; margin: 18px auto 0; padding: 0 8px; font-size: 14px; line-height: 1.6; color: var(--sub); text-align: center; }
.below-card a { font-weight: 700; }
.back { font-size: 14px; font-weight: 600; color: var(--sub); }
.h1.tight { margin-top: 22px; }
.cells { position: relative; margin-top: 26px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.cell { height: 60px; border-radius: 16px; background: var(--inset); border: 1.5px solid transparent; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cell.active { border-color: var(--ink); }
.code-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; color: transparent; background: transparent; caret-color: transparent; cursor: text; }
.code-foot { margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--sub); }
.code-foot .link-button { font-size: 14px; }
.code-foot .link-button:disabled { color: var(--sub); font-weight: 600; }
.card .store-play { border: 1px solid var(--ink); }
