/* Kept Chats. Warm paper, soft ink, a little clay. Calm on purpose. */

@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-full-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin-full-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Source Sans 3'; src: url('/fonts/source-sans-3-latin-wght-normal.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; 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; }
@font-face { font-family: 'Source Sans 3'; src: url('/fonts/source-sans-3-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; 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: 'Source Sans 3'; src: url('/fonts/source-sans-3-latin-wght-italic.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --paper: #f5eee2;
  --paper-deep: #ebe1d0;
  --card: #fffaf2;
  --ink: #2c2420;
  --ink-soft: #66574d;
  --ink-faint: #8f7f72;
  --line: #e0d2bd;
  --line-strong: #cdbca3;
  --clay: #9b5238;
  --clay-deep: #7a3d27;
  --clay-tint: #f3e2d7;
  --sage: #5f7d66;
  --sage-tint: #e1e9d9;
  --sage-line: #c9d6bd;
  --gold: #d29d45;
  --shadow: 0 1px 2px rgba(60, 40, 25, .06), 0 8px 28px rgba(60, 40, 25, .08);
  --shadow-lift: 0 2px 4px rgba(60, 40, 25, .08), 0 18px 48px rgba(60, 40, 25, .14);
  --radius: 18px;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --wrap: 1160px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--clay-deep); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--clay); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; font-variation-settings: 'SOFT' 100, 'WONK' 0; color: var(--ink); }
h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.04; margin: 0 0 18px; }
h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.12; margin: 0 0 14px; }
h3 { font-size: 22px; line-height: 1.25; margin: 0 0 8px; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--card); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.eyebrow { font: 600 14px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--clay); margin: 0 0 14px; }
.lede { font-size: 21px; line-height: 1.55; color: var(--ink-soft); }
.small { font-size: 15px; color: var(--ink-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header and footer */
.site-head { position: relative; z-index: 2; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; padding-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font: 500 23px/1 var(--serif); font-variation-settings: 'SOFT' 100; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.mark { width: 36px; height: 36px; flex: none; }
.site-nav { display: flex; gap: 26px; font-size: 16px; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--clay-deep); }
.site-foot { margin-top: 40px; background: var(--paper-deep); border-top: 1px solid var(--line); padding: 54px 0 40px; font-size: 15px; color: var(--ink-soft); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot-grid h2 { font: 600 14px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 12px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin: 0 0 8px; }
.foot-grid a { color: var(--ink-soft); }
.foot-brand .brand { margin-bottom: 14px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font: 600 17px/1 var(--sans); padding: 15px 24px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { border-color: var(--clay); color: var(--clay-deep); }
.btn.primary { background: var(--clay); border-color: var(--clay); color: #fff8f0; box-shadow: 0 6px 18px rgba(155, 82, 56, .25); }
.btn.primary:hover { background: var(--clay-deep); border-color: var(--clay-deep); color: #fff; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--ink-soft); padding-left: 12px; padding-right: 12px; }
.btn.quiet:hover { color: var(--clay-deep); background: rgba(155, 82, 56, .07); }
.btn.small { font-size: 15px; padding: 10px 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- hero */
.hero { position: relative; padding: 36px 0 80px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -20% -10% auto auto; width: 70%; height: 120%; background: radial-gradient(closest-side, rgba(226, 178, 104, .28), rgba(226, 178, 104, 0)); pointer-events: none; }
.hero::after { content: ''; position: absolute; left: -12%; bottom: -30%; width: 55%; height: 80%; background: radial-gradient(closest-side, rgba(155, 82, 56, .10), rgba(155, 82, 56, 0)); pointer-events: none; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center; }
.hero .lede { margin-bottom: 30px; }

.drop { position: relative; background: var(--card); border: 1.5px dashed var(--line-strong); border-radius: 24px; padding: 28px 28px 24px; box-shadow: var(--shadow); transition: border-color .2s, background .2s, transform .2s; }
.drop.over { border-color: var(--clay); background: #fff6ec; transform: scale(1.01); }
.drop-row { display: flex; align-items: center; gap: 18px; }
.drop-icon { width: 54px; height: 54px; flex: none; border-radius: 16px; background: var(--clay-tint); display: grid; place-items: center; color: var(--clay); }
.drop-icon svg { width: 28px; height: 28px; }
.drop h2 { font-size: 24px; margin: 0 0 2px; }
.drop p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.drop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.drop-note { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 15px; }
.drop-note svg { width: 17px; height: 17px; color: var(--sage); flex: none; }
.drop-error { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: #fbebe4; border: 1px solid #ecc8b8; color: #6b2f1c; font-size: 16px; }
.drop-error strong { display: block; margin-bottom: 2px; }
.drop-error.ok { background: var(--sage-tint); border-color: var(--sage-line); color: #2f4434; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; max-width: min(560px, calc(100vw - 32px)); background: var(--ink); color: var(--paper); padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow-lift); font-size: 15.5px; }
.drop-progress { margin-top: 18px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--ink-soft); margin-bottom: 8px; }
.progress-track { height: 8px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--clay)); border-radius: 99px; transition: width .25s; }
.progress-track.indeterminate .progress-fill { width: 35%; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* the letter: a printed conversation on paper */
.letter-wrap { position: relative; padding: 18px 8px 18px 18px; }
.letter { position: relative; background: #fffcf6; border-radius: 6px; padding: 30px 28px 26px; box-shadow: var(--shadow-lift); transform: rotate(1.6deg); border: 1px solid #efe4d2; }
.letter::before { content: ''; position: absolute; inset: 10px -12px -12px 10px; background: #f8f1e5; border-radius: 6px; z-index: -1; transform: rotate(-3.2deg); box-shadow: var(--shadow); border: 1px solid #ece0cc; }
.letter-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.letter-head .who { font: 500 20px/1.1 var(--serif); font-variation-settings: 'SOFT' 100; }
.letter-head .when { font-size: 14px; color: var(--ink-faint); }
.letter .day { margin: 6px 0 12px; }
.sprig { position: absolute; width: 120px; right: -26px; bottom: -34px; transform: rotate(-18deg); z-index: 2; pointer-events: none; }

/* ---------- shared bubbles (hero, reader) */
.av { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 600 15px/1 var(--sans); color: #fffaf2; background: var(--sage); letter-spacing: .02em; }
.day { display: flex; justify-content: center; margin: 22px 0 12px; }
.day span { font: italic 400 15px/1 var(--serif); color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); padding: 7px 16px; border-radius: 999px; }
.letter .day span { background: #fffcf6; }
.b { position: relative; display: block; width: fit-content; max-width: min(78%, 560px); padding: 8px 14px 6px; margin: 2px 0; border-radius: 18px; background: var(--card); border: 1px solid var(--line); font-size: 17px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.b.mine { margin-left: auto; background: var(--sage-tint); border-color: var(--sage-line); }
.b .t { float: right; margin: 6px 0 -2px 12px; font-size: 12.5px; line-height: 1.2; color: var(--ink-faint); white-space: nowrap; }
.b .t .ed { font-style: italic; margin-right: 4px; }
.b.del { font-style: italic; color: var(--ink-faint); background: transparent; border-style: dashed; }

/* ---------- sections */
.band { padding: 72px 0; }
.band.article { padding-top: 16px; }
.band.tint { background: var(--paper-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 36px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; box-shadow: 0 1px 2px rgba(60, 40, 25, .04); }
.card p { color: var(--ink-soft); font-size: 17px; margin: 0; }
.card .file-chip { display: inline-block; font: 600 14px/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--clay-deep); background: var(--clay-tint); padding: 7px 10px; border-radius: 8px; margin-bottom: 16px; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding-top: 58px; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--clay); color: var(--clay); display: grid; place-items: center; font: 500 20px/1 var(--serif); }
.steps p { color: var(--ink-soft); margin: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.quiet-panel { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 30px; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 32px; margin: 0 0 12px; }
.check-list li::before { content: ''; position: absolute; left: 0; top: 7px; width: 18px; height: 18px; border-radius: 50%; background: var(--sage-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5.5 10.5 3 3 6-7' fill='none' stroke='%235f7d66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.take-time { position: relative; border-left: 3px solid var(--gold); padding: 6px 0 6px 24px; font: italic 400 22px/1.5 var(--serif); font-variation-settings: 'SOFT' 100; color: var(--ink-soft); margin: 0; }

.unlock-box { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 40px; box-shadow: var(--shadow); }
.price { font: 500 46px/1 var(--serif); color: var(--ink); }
.price small { font: 400 16px/1.4 var(--sans); color: var(--ink-soft); display: block; margin-top: 8px; }
.soon-pill { display: inline-block; font: 600 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 8px 12px; border-radius: 99px; background: var(--paper-deep); color: var(--ink-soft); border: 1px solid var(--line); }
.formats { display: grid; gap: 12px; margin: 22px 0 0; padding: 0; list-style: none; }
.formats li { display: flex; gap: 14px; align-items: flex-start; }
.formats .fmt { flex: none; width: 52px; text-align: center; font: 700 12px/1 var(--sans); letter-spacing: .06em; padding: 8px 0; border-radius: 8px; background: var(--clay-tint); color: var(--clay-deep); margin-top: 3px; }

.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font: 500 21px/1.35 var(--serif); font-variation-settings: 'SOFT' 100; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 300 28px/1 var(--sans); color: var(--clay); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding-top: 10px; color: var(--ink-soft); }
.guide-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; list-style: none; padding: 0; margin: 0; }
.guide-list a { display: block; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font: 500 19px/1.35 var(--serif); font-variation-settings: 'SOFT' 100; }
.guide-list a span { display: block; font: 400 15px/1.5 var(--sans); color: var(--ink-soft); margin-top: 4px; }
.guide-list a:hover { color: var(--clay-deep); }

/* ---------- article pages */
.page-head { padding: 34px 0 30px; }
.page-head .lede { margin: 0; }
.prose { font-size: 18px; }
.prose h2 { font-size: 30px; margin: 44px 0 12px; }
.prose h3 { margin: 28px 0 8px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose code, .prose kbd { font: 15px/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; background: var(--paper-deep); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); }
.prose pre { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow-x: auto; font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 0 0 1em; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose blockquote { margin: 0 0 1em; border-left: 3px solid var(--gold); padding: 4px 0 4px 18px; color: var(--ink-soft); }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
.aside-tool { position: sticky; top: 24px; }
.aside-tool .drop { padding: 22px; }
.aside-tool .drop h2 { font-size: 21px; }
.note { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--sage); border-radius: 12px; padding: 16px 18px; margin: 0 0 1.2em; }
.updated { font-size: 15px; color: var(--ink-faint); margin-top: 6px; }

/* ================================================================= the reader */
body.reading { overflow: hidden; }
.reader { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); }
.reader[hidden] { display: none; }
.reader-bar { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--card); min-height: 60px; }
.reader-bar .brand { font-size: 19px; }
.reader-bar .mark { width: 30px; height: 30px; }
.reader-sum { flex: 1; min-width: 0; color: var(--ink-soft); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.convs { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); background: #faf4ea; }
.search-box { padding: 14px 14px 10px; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.search-field input { width: 100%; font: 400 16px/1.2 var(--sans); padding: 12px 14px 12px 40px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); }
.search-field input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px rgba(155, 82, 56, .15); }
.list-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 16px; }
.list-label { font: 600 12.5px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); padding: 14px 10px 8px; }
.conv { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: 14px; cursor: pointer; font: inherit; color: inherit; }
.conv:hover { background: rgba(155, 82, 56, .06); }
.conv[aria-current='true'] { background: var(--card); box-shadow: 0 1px 2px rgba(60, 40, 25, .08), inset 0 0 0 1px var(--line); }
.conv-main { min-width: 0; flex: 1; }
.conv-name { display: block; font-weight: 600; font-size: 16.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: block; font-size: 14px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.others-toggle { margin: 10px 10px 0; font-size: 14px; }
.hit { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 12px; cursor: pointer; font: inherit; color: inherit; }
.hit:hover, .hit:focus-visible { background: rgba(155, 82, 56, .06); }
.hit-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.hit-top b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit-text { display: block; font-size: 15.5px; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.hit mark, .b mark.find { background: #f6dca4; color: inherit; border-radius: 3px; padding: 0 1px; }
.search-sum { padding: 4px 12px 10px; font-size: 14px; color: var(--ink-soft); }

.chat { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--paper); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 18px; min-height: 68px; border-bottom: 1px solid var(--line); background: rgba(255, 250, 242, .92); }
.chat-head .who { min-width: 0; flex: 1; }
.chat-head h2 { font-size: 22px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .sub { font-size: 14px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-soft); font: 600 15px/1 var(--sans); padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.icon-btn:hover { background: rgba(155, 82, 56, .07); color: var(--clay-deep); }
.icon-btn svg { width: 19px; height: 19px; flex: none; }
.back { display: none; }
.date-pop { position: absolute; right: 18px; top: 64px; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lift); padding: 16px; width: 290px; }
.date-pop label { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.date-pop input { width: 100%; font: 16px var(--sans); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); }
.date-pop .pop-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.media-note { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: #fbf1e3; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-soft); }
.media-note button { margin-left: auto; flex: none; }
.chat-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; }
.chat-inner { position: relative; width: 100%; }
.row { position: absolute; left: 0; right: 0; top: 0; padding: 0 clamp(14px, 4vw, 48px); contain: layout style; }
.row.flash .b { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px rgba(210, 157, 69, .55); } 100% { box-shadow: 0 0 0 0 rgba(210, 157, 69, 0); } }
.msg { display: flex; gap: 10px; align-items: flex-end; }
.msg.mine { justify-content: flex-end; }
.msg .av { width: 32px; height: 32px; font-size: 13px; margin-bottom: 2px; }
.msg .av.spacer { visibility: hidden; }
.msg-col { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; max-width: min(80%, 620px); }
.msg.mine .msg-col { align-items: flex-end; }
.msg-col .b { max-width: 100%; }
.msg.start { padding-top: 10px; }
.sender { font-size: 13.5px; font-weight: 600; margin: 0 0 3px 6px; }
.b .quote { display: block; margin: 2px 0 7px; padding: 6px 10px; border-left: 3px solid var(--clay); background: rgba(155, 82, 56, .06); border-radius: 6px; font-size: 15px; color: var(--ink-soft); white-space: pre-wrap; }
.b .quote-by { display: block; font-weight: 600; font-size: 13px; color: var(--clay-deep); }
.b a { color: var(--clay-deep); }
.b .mention { color: var(--clay-deep); font-weight: 600; }
.b pre { margin: 4px 0; font: 14.5px/1.45 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; white-space: pre-wrap; }
.b code { font: 14.5px ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.b.has-photo { padding: 4px; }
.b.has-photo .t { position: absolute; right: 10px; bottom: 8px; background: rgba(44, 36, 32, .55); color: #fff; padding: 3px 7px; border-radius: 99px; margin: 0; float: none; }
.photo { display: block; border: 0; padding: 0; margin: 0; background: var(--paper-deep); border-radius: 14px; overflow: hidden; cursor: zoom-in; max-width: 100%; }
.photo img { display: block; width: 100%; height: auto; }
.b.has-photo .photo + .photo { margin-top: 4px; }
.b.has-photo .txt { display: block; padding: 6px 10px 2px; }
.attach { display: flex; align-items: center; gap: 12px; padding: 8px 4px 6px; min-width: 220px; }
.attach-icon { width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--clay-tint); color: var(--clay); display: grid; place-items: center; }
.attach-icon svg { width: 22px; height: 22px; }
.attach-main { min-width: 0; flex: 1; }
.attach-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.attach-sub { display: block; font-size: 14px; color: var(--ink-soft); }
.attach.missing .attach-icon { background: var(--paper-deep); color: var(--ink-faint); }
.b video, .b audio { display: block; max-width: 100%; border-radius: 12px; margin: 2px 0; }
.b audio { width: 280px; }
.event-row { display: flex; justify-content: center; padding: 8px 0; }
.event { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-soft); background: rgba(255, 250, 242, .7); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; max-width: 92%; text-align: center; }
.event svg { width: 16px; height: 16px; flex: none; color: var(--sage); }
.event.missed svg { color: var(--clay); }
.event time { color: var(--ink-faint); }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px; color: var(--ink-soft); }
.chat-empty h2 { font-size: 30px; }
.chat-empty p { margin: 0 auto; }
.chat-foot-pad { height: 24px; }
.to-end { position: absolute; right: 22px; bottom: 22px; z-index: 4; box-shadow: var(--shadow); }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(26, 21, 18, .96); display: grid; grid-template-rows: auto 1fr; }
.lightbox[hidden] { display: none; }
.lightbox-bar { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 12px 16px; color: #f5eee2; }
.lightbox-bar .cap { margin-right: auto; font-size: 15px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-bar .btn { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .25); }
.lightbox img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; display: block; min-height: 0; padding: 0 16px 16px; }

dialog.sheet { border: 0; padding: 0; border-radius: 24px; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lift); }
dialog.sheet::backdrop { background: rgba(44, 36, 32, .45); }
.sheet-in { padding: 24px 26px; }
.sheet h2 { font-size: 28px; margin-bottom: 6px; }
.sheet fieldset { border: 0; padding: 0; margin: 16px 0 0; }
.sheet .fmt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet .fmt-grid .choice { margin: 0; flex-direction: column; gap: 6px; }
.sheet .fmt-grid .choice input { margin: 0; }
.sheet legend { font-weight: 600; margin-bottom: 8px; font-size: 16px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; cursor: pointer; background: #fffdf8; }
.choice:has(input:checked) { border-color: var(--clay); background: #fff6ec; }
.choice input { margin-top: 5px; accent-color: var(--clay); }
.choice b { display: block; font-weight: 600; }
.choice span span { display: block; font-size: 14.5px; color: var(--ink-soft); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.sheet .notice { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); font-size: 15.5px; color: var(--ink-soft); }
.sheet .notice strong { color: var(--ink); }

@media (max-width: 980px) {
  .hero-grid, .split, .unlock-box, .article-grid { grid-template-columns: 1fr; gap: 36px; }
  .aside-tool { position: static; }
  .cards, .steps { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .letter-wrap { max-width: 520px; margin: 0 auto; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .wrap { padding: 0 18px; }
  .site-nav { display: none; }
  .hero { padding: 8px 0 56px; }
  .lede { font-size: 19px; }
  .band { padding: 52px 0; }
  .drop { padding: 22px 18px 18px; }
  .drop-row { align-items: flex-start; }
  .drop-actions .btn { flex: 1 1 auto; }
  .guide-list { grid-template-columns: 1fr; }
  .unlock-box { padding: 26px 20px; }
  .foot-grid { grid-template-columns: 1fr; }
  .sprig { width: 90px; right: -8px; bottom: -26px; }
  .reader-body { grid-template-columns: minmax(0, 1fr); }
  .convs { border-right: 0; }
  .reader .chat { display: none; }
  .reader.show-chat .chat { display: flex; }
  .reader.show-chat .convs { display: none; }
  .reader-bar { padding: 8px 12px; min-height: 54px; }
  .reader-bar .brand span { display: none; }
  .back { display: inline-flex; }
  .chat-head { padding: 8px 10px; gap: 6px; }
  .chat-head h2 { font-size: 19px; }
  .chat-head .av { display: none; }
  .icon-btn .label { display: none; }
  .msg-col { max-width: 86%; }
  .b { font-size: 16.5px; }
  .date-pop { right: 10px; left: 10px; width: auto; }
  .sheet .fmt-grid { grid-template-columns: 1fr; }
  .sheet .fmt-grid .choice { flex-direction: row; }
  .sheet .fmt-grid .choice input { margin-top: 5px; }
}

@media (prefers-color-scheme: dark) {
  .reader {
    --paper: #1f1a17; --paper-deep: #181411; --card: #2a2420; --ink: #f1e8dc; --ink-soft: #c2b3a3; --ink-faint: #9b8b7c;
    --line: #3d342d; --line-strong: #54483e; --clay: #d08a6c; --clay-deep: #e3a487; --clay-tint: #3e2a21;
    --sage-tint: #2f3a2e; --sage-line: #44533f; --sage: #93b099;
    color-scheme: dark;
  }
  .reader .convs { background: #241e1a; }
  .reader .chat-head { background: rgba(42, 36, 32, .94); }
  .reader .event { background: rgba(42, 36, 32, .7); }
  .reader .media-note { background: #2c241d; }
  .reader .hit mark, .reader .b mark.find { background: #6b5320; }
  .reader .date-pop input { background: var(--paper); }
  .reader .sender { filter: brightness(1.7) saturate(.8); }
  .reader .av { filter: brightness(.92); }
}
@media (hover: none) and (pointer: coarse) {
  .folder-btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-head, .site-foot, .drop, .aside-tool { display: none; }
}
