@font-face{font-family:Instrument Serif;src:url('/fonts/instrument-serif.ttf') format('truetype');font-style:normal;font-weight:400;font-display:swap}
@font-face{font-family:Instrument Serif;src:url('/fonts/instrument-serif-italic.ttf') format('truetype');font-style:italic;font-weight:400;font-display:swap}
@font-face{font-family:Manrope;src:url('/fonts/manrope.ttf') format('truetype');font-style:normal;font-weight:400 800;font-display:swap}

:root {
  --dusk: #211a2b;
  --dusk-soft: #2c2236;
  --dusk-lift: #3a2d45;
  --plum: #67556f;
  --quiet-plum: #79657d;
  --paper: #f7f0e8;
  --paper-soft: #eadfd8;
  --ink: #2d2431;
  --ink-soft: #675967;
  --text: #fff6ee;
  --text-soft: #d7c8d2;
  --text-faint: #b7a7b6;
  --apricot: #f0ad8c;
  --apricot-light: #f5c8ae;
  --mist: #aac5cc;
  --lavender: #b9afc6;
  --rose: #d9a9ae;
  --sage: #bdc6ad;
  --danger: #f4aaa3;
  --display: 'Instrument Serif', 'Songti SC', STSong, Georgia, serif;
  --body: 'Manrope', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.2,.78,.2,1);
}

* { box-sizing: border-box; }
html { background: var(--dusk); color-scheme: dark; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 6%, rgba(240,173,140,.13), transparent 24rem),
    radial-gradient(circle at 5% 44%, rgba(170,197,204,.09), transparent 28rem),
    var(--dusk);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,.13) 0 1px, transparent 1.4px), radial-gradient(circle at 70% 65%, rgba(255,255,255,.09) 0 1px, transparent 1.3px);
  background-size: 31px 37px, 47px 53px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.45), transparent 74%);
}
button, textarea, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--apricot); color: var(--ink); }

.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 100; padding: .7rem 1rem; border-radius: 14px; background: var(--paper); color: var(--ink); }
.skip-link:focus { top: 1rem; }
.prototype-shell { position: relative; z-index: 1; width: min(760px, 100%); min-height: 100vh; margin: 0 auto; }
.app-frame { min-height: 100vh; position: relative; overflow: clip; background: linear-gradient(180deg, rgba(44,34,54,.62), rgba(33,26,43,.22) 34rem, transparent); }
.app-header { min-height: 94px; padding: 1.35rem 2.25rem 1rem; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.2rem; }
.wordmark { display: inline-flex; align-items: center; gap: .68rem; text-decoration: none; font-weight: 750; letter-spacing: -.035em; }
.wordmark-symbol { position: relative; display: inline-block; width: 30px; height: 30px; }
.wordmark-symbol::before, .wordmark-symbol::after { content: ''; position: absolute; top: 7px; width: 15px; height: 15px; border: 1.5px solid; border-radius: 50%; }
.wordmark-symbol::before { left: 1px; color: var(--mist); }
.wordmark-symbol::after { right: 1px; color: var(--apricot); }
.wordmark-symbol i { position: absolute; z-index: 2; left: 14px; top: 12px; width: 3px; height: 6px; border-radius: 99px; background: var(--paper); }
.today-copy { justify-self: center; text-align: center; }
.today-copy p { margin: 0; color: var(--text-soft); font-size: .76rem; font-weight: 650; }
.today-copy span { display: block; margin-top: .05rem; color: var(--text-faint); font-size: .67rem; }
.prototype-badge { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--text-faint); font-size: .72rem; cursor: pointer; }
.prototype-badge:hover { color: var(--text); }

#app-main { min-height: calc(100vh - 94px); outline: none; }
.screen { min-height: calc(100vh - 94px); padding: 2rem 2.25rem calc(9rem + var(--safe-bottom)); animation: settle-in 280ms var(--ease-out) both; }
@keyframes settle-in { from { opacity: .35; transform: translateY(8px); filter: blur(3px); } to { opacity: 1; transform: none; filter: blur(0); } }
.screen-heading { max-width: 14ch; margin: 0 0 1rem; font-family: var(--display); font-size: clamp(2.85rem, 8.5vw, 4.65rem); line-height: .98; font-weight: 400; letter-spacing: -.028em; }
.screen-heading em { color: var(--apricot-light); font-style: normal; font-weight: 400; white-space: nowrap; }
.screen-intro { max-width: 35rem; margin: 0 0 1.7rem; color: var(--text-soft); font-size: .94rem; line-height: 1.75; }
.prototype-footnote { max-width: 38rem; margin: 1.25rem 0 0; color: var(--text-faint); font-size: .75rem; }
.stage-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .1rem 0 1.3rem; color: var(--text-faint); font-size: .72rem; }
.sample-label, .local-label { display: inline-flex; align-items: center; gap: .42rem; color: var(--apricot-light); font-size: .7rem; }
.sample-label::before, .local-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.local-label { color: var(--text-faint); }
.status-copy, .muted-copy { max-width: 35rem; color: var(--text-soft); }

.privacy-promise { max-width: 36rem; margin: 0 0 1.2rem; padding: .8rem 1rem; border-radius: 18px 25px 20px 22px; background: rgba(170,197,204,.11); display: flex; align-items: center; gap: .75rem; color: var(--text-soft); font-size: .74rem; }
.privacy-promise svg { flex: 0 0 auto; width: 20px; color: var(--mist); }
.privacy-promise strong { display: block; color: var(--text); font-size: .76rem; }

.journal-paper { position: relative; isolation: isolate; border-radius: 27px 39px 31px 22px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 72px rgba(8,5,11,.38); transform: rotate(-.25deg); overflow: hidden; }
.journal-paper::after { content: ''; position: absolute; z-index: -1; right: -8rem; bottom: -9rem; width: 18rem; height: 18rem; border-radius: 46% 54% 43% 57%; background: rgba(170,197,204,.14); }
.editor-paper { padding: 1.4rem 1.5rem 1.55rem; }
.paper-head, .paper-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #746773; font-size: .68rem; }
.paper-head span:last-child { display: inline-flex; align-items: center; gap: .35rem; }
.paper-head svg { width: 14px; }
.paper-foot { margin-top: 2rem; padding-top: .9rem; color: #7d707a; }

.mood-fieldset, .intent-fieldset { min-width: 0; margin: 1.45rem 0 1.4rem; padding: 0; border: 0; }
.mood-fieldset legend, .intent-fieldset legend { margin: 0 0 .65rem; color: var(--ink-soft); font-size: .75rem; font-weight: 700; }
.mood-ribbon { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.mood-mark { position: relative; min-width: 0; min-height: 76px; padding: .75rem .45rem; border: 0; border-radius: 44% 56% 48% 52% / 58% 42% 58% 42%; background: var(--lavender); color: var(--ink); display: grid; place-items: center; align-content: center; text-align: center; cursor: pointer; transition: transform 190ms var(--ease-out), box-shadow 190ms ease; }
.mood-mark:nth-child(2) { border-radius: 57% 43% 55% 45% / 43% 57% 45% 55%; }
.mood-mark:nth-child(3) { border-radius: 45% 55% 61% 39% / 56% 44% 56% 44%; }
.mood-mark:nth-child(4) { border-radius: 54% 46% 44% 56% / 48% 58% 42% 52%; }
.mood-mark:nth-child(5) { border-radius: 43% 57% 53% 47% / 60% 40% 55% 45%; }
.mood-mark:nth-child(6) { border-radius: 59% 41% 47% 53% / 46% 61% 39% 54%; }
.mood-mark strong, .mood-mark span { display: block; overflow: hidden; text-overflow: ellipsis; }
.mood-mark strong { font-family: var(--display); font-size: 1rem; font-weight: 400; line-height: 1; }
.mood-mark span { margin-top: .2rem; font-size: .57rem; white-space: nowrap; }
.mood-mark svg { position: absolute; right: .55rem; top: .5rem; width: 14px; }
.mood-mark:hover { transform: translateY(-2px); }
.mood-mark.selected { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 10px 24px rgba(45,36,49,.22); }
.mood-mark.mood-low { background: var(--lavender); }
.mood-mark.mood-quiet { background: var(--quiet-plum); color: var(--text); }
.mood-mark.mood-awake { background: var(--mist); }
.mood-mark.mood-close { background: var(--rose); }
.mood-mark.mood-bright { background: var(--apricot-light); }
.mood-mark.mood-unsure { background: var(--sage); }

.paper-writing { display: block; }
.paper-writing > span { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; color: var(--ink-soft); font-size: .75rem; font-weight: 700; }
.paper-writing small { color: #685a66; font-weight: 400; }
.paper-writing textarea { width: 100%; min-height: 132px; resize: vertical; padding: .9rem 0; border: 0; border-radius: 0; outline: 0; background: transparent; color: var(--ink); font-family: var(--display); font-size: 1.45rem; line-height: 1.45; }
.paper-writing textarea::placeholder { color: #685a66; opacity: 1; }
.paper-writing textarea:focus { box-shadow: inset 0 -2px 0 var(--mist); }
.sticker-dock { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin: 1rem 0 1.4rem; }
.photo-add { min-height: 76px; flex: 1 1 13rem; padding: .85rem 1rem; border-radius: 19px 27px 21px 24px; background: rgba(45,36,49,.07); display: flex; align-items: center; gap: .75rem; cursor: pointer; }
.photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-add:focus-within { outline: 2px solid var(--quiet-plum); outline-offset: 3px; }
.photo-add svg { width: 22px; flex: 0 0 auto; }
.photo-add span { font-size: .76rem; font-weight: 700; }
.photo-add small { display: block; color: #746773; font-size: .61rem; font-weight: 400; }
.photo-sticker { position: relative; width: min(190px, 46%); margin: 1rem 0 1.2rem auto; padding: .42rem .42rem 1.4rem; border-radius: 14px 18px 13px 16px; background: #fffaf4; box-shadow: 0 14px 28px rgba(45,36,49,.2); transform: rotate(2.2deg); }
.sticker-dock .photo-sticker { margin: 0; }
.photo-sticker img { display: block; width: 100%; aspect-ratio: 1.1; border-radius: 9px 12px 8px 10px; object-fit: cover; }
.photo-sticker figcaption { position: absolute; left: .65rem; bottom: .3rem; color: #746773; font-size: .58rem; }
.photo-sticker button { position: absolute; right: -.55rem; top: -.55rem; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; cursor: pointer; }
.photo-sticker button svg { width: 15px; }

.saved-page { min-height: 330px; padding: 1.5rem 1.65rem 1.3rem; }
.saved-page.compact { min-height: 290px; }
.saved-mood { display: inline-flex; align-items: center; gap: .65rem; margin: 1.3rem 0 1rem; color: var(--ink-soft); font-size: .66rem; }
.saved-mood i { width: 42px; height: 34px; border-radius: 46% 54% 48% 52%; background: var(--lavender); }
.saved-mood.mood-quiet i { background: var(--quiet-plum); }
.saved-mood.mood-awake i { background: var(--mist); }
.saved-mood.mood-close i { background: var(--rose); }
.saved-mood.mood-bright i { background: var(--apricot-light); }
.saved-mood.mood-unsure i { background: var(--sage); }
.saved-mood strong { display: block; color: var(--ink); font-size: .78rem; }
.journal-copy { position: relative; z-index: 1; max-width: 22ch; margin: .5rem 0; font-family: var(--display); font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.22; letter-spacing: -.018em; }
.margin-reply { position: relative; z-index: 2; max-width: 25rem; margin: 1.6rem 0 .5rem auto; padding: 1rem 1.1rem; border-radius: 20px 27px 22px 18px; background: #c8d8dc; color: var(--ink); transform: rotate(.5deg); }
.margin-reply span, .margin-reply small { color: #465257; font-size: .62rem; }
.margin-reply p { margin: .35rem 0; font-family: var(--display); font-size: 1.15rem; line-height: 1.35; }
.margin-reply small { display: block; }
.page-actions, .button-group { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.25rem; }

.button { min-height: 48px; padding: .72rem 1rem; border: 0; border-radius: 15px; background: rgba(247,240,232,.1); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: .55rem; font-size: .8rem; font-weight: 700; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(247,240,232,.11); transition: transform 160ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease; }
.button:hover { transform: translateY(-2px); background: rgba(247,240,232,.16); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button svg { width: 17px; height: 17px; }
.button.primary { background: var(--paper); color: var(--ink); box-shadow: 0 13px 28px rgba(11,7,14,.2); }
.button.primary:hover { background: #fff9f2; }
.button.signal { background: var(--apricot); color: var(--ink); box-shadow: 0 13px 30px rgba(90,47,41,.22); }
.button.danger { background: var(--danger); color: var(--ink); }
.button.full { width: 100%; }
.journal-paper > .button { background: var(--ink); color: var(--paper); box-shadow: 0 13px 26px rgba(45,36,49,.18); }
.text-action { min-height: 44px; padding: .35rem .1rem; border: 0; background: transparent; color: var(--text-soft); font-size: .76rem; text-decoration: underline; text-decoration-color: rgba(215,200,210,.35); text-underline-offset: 4px; cursor: pointer; }
.screen-back { min-height: 44px; margin: -1rem 0 1.45rem; padding: .25rem 0; border: 0; background: transparent; color: var(--text-soft); display: inline-flex; align-items: center; gap: .55rem; font-size: .78rem; cursor: pointer; }
.screen-back svg { width: 17px; }

.boundary-explainer { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1.8rem 0 3rem; }
.boundary-explainer > div { padding: 1rem 1.1rem; border-radius: 22px 29px 24px 20px; background: rgba(247,240,232,.07); }
.boundary-explainer > div:nth-child(2) { border-radius: 29px 21px 27px 24px; }
.boundary-explainer > div > span { width: 32px; height: 32px; margin-bottom: .55rem; border-radius: 50%; background: rgba(170,197,204,.14); display: grid; place-items: center; color: var(--mist); }
.boundary-explainer svg { width: 17px; }
.boundary-explainer strong { display: block; font-size: .8rem; }
.boundary-explainer p { margin: .25rem 0 0; color: var(--text-faint); font-size: .69rem; }
.drift-return, .incoming-door { margin-top: 2.5rem; padding: 1.6rem 1.5rem; border-radius: 30px 41px 32px 27px; background: rgba(103,85,111,.28); }
.drift-return h2, .incoming-door h2, .empty-state h2 { max-width: 18ch; margin: .55rem 0 .5rem; font-family: var(--display); font-size: 2rem; line-height: 1.08; font-weight: 400; }
.drift-return > p, .incoming-door > p, .empty-state > p { margin: 0; color: var(--text-soft); font-size: .84rem; }
.incoming-door { background: var(--paper); color: var(--ink); transform: rotate(.2deg); box-shadow: 0 24px 54px rgba(10,6,13,.28); }
.incoming-door .sample-label { color: #805f6b; }
.incoming-door > p { color: var(--ink-soft); }
.incoming-door .button { margin-top: 1rem; background: var(--ink); color: var(--paper); box-shadow: none; }

.page-shelf { display: grid; grid-template-columns: auto repeat(7, 1fr); align-items: end; gap: .45rem; margin: 0 0 1.5rem; color: var(--text-faint); font-size: .65rem; }
.page-shelf i { min-height: 46px; border-radius: 12px 16px 10px 14px; background: rgba(247,240,232,.07); display: grid; place-items: center; font-style: normal; }
.page-shelf i.filled { min-height: 66px; background: var(--apricot); color: var(--ink); box-shadow: 0 12px 28px rgba(14,8,17,.28); }
.understanding-panel { margin-top: 3rem; padding: 1.5rem; border-radius: 30px 42px 34px 26px; background: var(--dusk-lift); }
.understanding-head { display: flex; justify-content: space-between; gap: 1rem; }
.understanding-head h2 { margin: 0; font-family: var(--display); font-size: 1.75rem; font-weight: 400; line-height: 1.1; }
.understanding-head p { margin: .25rem 0 0; color: var(--text-faint); font-size: .68rem; }
.understanding-head > svg { width: 22px; color: var(--mist); }
.signal-cloud { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.2rem 0; }
.understanding-consent { width: 100%; }
.understanding-consent p { max-width: 35rem; margin: 0 0 1rem; color: var(--text-soft); font-size: .76rem; }
.signal-chip { min-height: 44px; padding: .55rem .75rem .55rem .9rem; border: 0; border-radius: 999px; background: var(--paper); color: var(--ink); display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; }
.signal-chip span { font-size: .7rem; }
.signal-chip small { color: #746773; font-size: .59rem; text-decoration: underline; text-underline-offset: 3px; }
.panel-note { margin: 0; color: var(--text-soft); font-size: .76rem; }
.understanding-revoke { margin-top: .65rem; }

.privacy-boundary { display: grid; grid-template-columns: .72fr 1.28fr; align-items: start; gap: 1rem; }
.stays-private, .leaves-page { border-radius: 27px 36px 29px 23px; }
.stays-private { padding: 1.25rem; background: rgba(170,197,204,.12); }
.leaves-page { padding: 1.45rem; background: var(--paper); color: var(--ink); box-shadow: 0 28px 66px rgba(8,5,11,.34); transform: rotate(-.2deg); }
.boundary-title { display: flex; align-items: center; gap: .65rem; }
.boundary-title > svg { flex: 0 0 auto; width: 21px; }
.boundary-title strong, .boundary-title small { display: block; }
.boundary-title strong { font-size: .78rem; }
.boundary-title small { color: var(--text-faint); font-size: .62rem; }
.leaves-page .boundary-title small { color: #746773; }
.stays-private ul { margin: 1rem 0 0; padding-left: 1.1rem; color: var(--text-soft); font-size: .74rem; }
.stays-private li + li { margin-top: .35rem; }
.stays-private img { display: block; width: 100%; max-height: 150px; margin-top: 1rem; border-radius: 15px 20px 16px 18px; object-fit: cover; opacity: .82; }
.leaves-page .paper-writing { margin-top: 1.3rem; }
.leaves-page .paper-writing textarea { min-height: 150px; }
.choice-row { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .45rem; }
.choice-row label { position: relative; cursor: pointer; }
.choice-row input { position: absolute; opacity: 0; }
.choice-row span { min-height: 48px; padding: .55rem .35rem; border-radius: 999px; background: rgba(45,36,49,.07); display: grid; place-items: center; color: var(--ink-soft); text-align: center; font-size: .67rem; }
.choice-row input:checked + span { background: var(--quiet-plum); color: var(--text); }
.choice-row input:focus-visible + span { outline: 2px solid var(--quiet-plum); outline-offset: 3px; }
.consent-check { position: relative; display: block; margin: 1rem 0; cursor: pointer; }
.consent-check input { position: absolute; opacity: 0; }
.consent-check span { min-height: 50px; padding: .7rem .8rem; border-radius: 16px 22px 18px 20px; background: rgba(45,36,49,.07); display: flex; align-items: center; gap: .6rem; color: var(--ink-soft); font-size: .68rem; }
.consent-check svg { width: 18px; opacity: .28; }
.consent-check input:checked + span { background: #d4e0e2; color: var(--ink); }
.consent-check input:checked + span svg { opacity: 1; }
.consent-check input:focus-visible + span { outline: 2px solid var(--quiet-plum); outline-offset: 3px; }

.trace-letter { position: relative; isolation: isolate; margin: 1.3rem .35rem 1.8rem; padding: clamp(2.2rem, 8vw, 4rem) clamp(1.6rem, 7vw, 3.2rem) 1.7rem; border-radius: 26px 35px 29px 18px; background: var(--paper); color: var(--ink); box-shadow: 0 26px 60px rgba(8,5,11,.34); transform: rotate(-.4deg); }
.trace-letter::after { content: ''; position: absolute; z-index: -1; right: -2rem; top: -3rem; width: 9rem; height: 9rem; border-radius: 46% 54% 61% 39%; background: rgba(240,173,140,.14); }
.trace-letter blockquote { margin: 0; font-family: var(--display); font-size: clamp(2rem, 7vw, 3.35rem); line-height: 1.16; letter-spacing: -.015em; }
.trace-letter footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.3rem; color: #756a73; font-size: .69rem; }
.not-included, .routing-note { max-width: 36rem; margin: 0 0 1.25rem; padding: 1.15rem 1.25rem; border-radius: 20px 28px 22px 25px; background: rgba(170,197,204,.12); display: flex; align-items: flex-start; gap: .75rem; }
.not-included > svg { flex: 0 0 auto; width: 20px; color: var(--mist); }
.not-included strong, .routing-note strong { font-size: .78rem; }
.not-included p, .routing-note p { margin: .2rem 0 0; color: var(--text-soft); font-size: .76rem; }
.success-orbit { position: relative; width: 118px; height: 94px; margin: 1rem 0 2rem; }
.success-orbit::before, .success-orbit::after { content: ''; position: absolute; top: 10px; width: 78px; height: 78px; border-radius: 48% 52% 46% 54%; }
.success-orbit::before { left: 0; background: rgba(170,197,204,.62); transform: rotate(-12deg); }
.success-orbit::after { right: 0; background: rgba(240,173,140,.64); transform: rotate(13deg); }
.success-orbit i { position: absolute; z-index: 2; left: 56px; top: 42px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); }
.safety-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; color: var(--text-faint); font-size: .7rem; }

.trace-stack { display: grid; gap: 1rem; }
.trace-record { padding: 1.5rem; border-radius: 27px 38px 30px 23px; background: var(--paper); color: var(--ink); box-shadow: 0 22px 52px rgba(8,5,11,.28); }
.trace-record.received { background: #dce5e5; transform: rotate(.25deg); }
.trace-record header, .trace-record footer { display: flex; justify-content: space-between; gap: 1rem; color: #746773; font-size: .66rem; }
.trace-record > p { margin: 1rem 0; font-family: var(--display); font-size: 1.65rem; line-height: 1.3; }
.trace-record aside { margin-top: 1.2rem; padding: 1rem; border-radius: 18px 24px 20px 16px; background: #c7d7da; }
.trace-record aside strong { font-size: .66rem; }
.trace-record aside p { margin: .35rem 0 0; font-family: var(--display); font-size: 1.1rem; }
.trace-record .button { margin-top: 1.2rem; background: var(--ink); color: var(--paper); box-shadow: none; }
.empty-state { margin: 1.5rem 0; padding: 1.7rem; border-radius: 31px 42px 33px 26px; background: rgba(103,85,111,.26); }
.empty-state .button { margin-top: 1.1rem; }

.profile-name { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0 2rem; }
.profile-sigil { width: 72px; height: 72px; border-radius: 46% 54% 58% 42%; background: var(--lavender); color: var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: 1.8rem; transform: rotate(-5deg); }
.profile-name strong, .profile-name span { display: block; }
.profile-name span { margin-top: .18rem; color: var(--text-faint); font-size: .72rem; }
.settings-list { display: grid; gap: .65rem; }
.settings-row { width: 100%; min-height: 76px; padding: .9rem 1rem; border: 0; border-radius: 22px 29px 24px 20px; background: rgba(247,240,232,.07); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1rem; text-align: left; cursor: pointer; }
.settings-row:nth-child(even) { border-radius: 28px 21px 29px 23px; }
.settings-row strong, .settings-row span { display: block; }
.settings-row > span > span { margin-top: .15rem; color: var(--text-faint); font-size: .7rem; }
.settings-row svg { width: 17px; color: var(--text-faint); }
.prototype-reset { margin-top: 1.5rem; }

.app-nav { position: fixed; z-index: 20; left: 50%; bottom: calc(.85rem + var(--safe-bottom)); width: min(620px, calc(100vw - 1.5rem)); min-height: 78px; padding: .5rem .65rem; border-radius: 31px 38px 29px 35px; background: #33283d; display: grid; grid-template-columns: repeat(4,1fr); box-shadow: 0 18px 50px rgba(8,5,11,.44); transform: translateX(-50%); }
.app-nav button { min-width: 0; min-height: 60px; padding: .45rem .3rem; border: 0; border-radius: 22px; background: transparent; color: var(--text-faint); display: grid; place-items: center; align-content: center; gap: .15rem; font-size: .66rem; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, transform 160ms ease; }
.app-nav button:hover { color: var(--text); }
.app-nav button.active { background: rgba(240,173,140,.16); color: var(--apricot-light); transform: translateY(-2px); }
.app-nav svg { width: 21px; height: 21px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(6.5rem + var(--safe-bottom)); width: max-content; max-width: calc(100vw - 2rem); padding: .8rem 1rem; border-radius: 16px; background: var(--paper); color: var(--ink); font-size: .78rem; box-shadow: 0 18px 44px rgba(8,5,11,.35); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity 160ms ease, transform 220ms var(--ease-out); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

dialog { color: var(--text); }
dialog::backdrop { background: rgba(16,10,20,.76); }
.prototype-note, .report-dialog, .reset-dialog { width: min(520px, calc(100vw - 2rem)); max-height: min(760px, calc(100vh - 2rem)); margin: auto; padding: 2.2rem; border: 0; border-radius: 30px 42px 34px 26px; background: var(--dusk-soft); box-shadow: 0 35px 100px rgba(0,0,0,.58); }
.prototype-note[open], .report-dialog[open], .reset-dialog[open] { animation: dialog-open 200ms var(--ease-out) both; }
@keyframes dialog-open { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-close { position: absolute; right: 1rem; top: 1rem; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(247,240,232,.08); display: grid; place-items: center; cursor: pointer; }
.dialog-close svg { width: 19px; }
dialog h2 { max-width: 12ch; margin: 0 3rem 1rem 0; font-family: var(--display); font-size: 2.4rem; line-height: 1.05; font-weight: 400; }
dialog p, dialog li { color: var(--text-soft); font-size: .84rem; }
dialog ul { padding-left: 1.2rem; }
.report-dialog form { display: grid; gap: .65rem; margin-top: 1.2rem; }
.report-dialog label { position: relative; }
.report-dialog input { position: absolute; opacity: 0; }
.report-dialog label span { min-height: 50px; padding: .75rem 1rem; border-radius: 16px; background: rgba(247,240,232,.07); display: flex; align-items: center; cursor: pointer; }
.report-dialog input:checked + span { background: var(--paper); color: var(--ink); }

:focus-visible { outline: 2px solid var(--apricot-light); outline-offset: 4px; }

@media (max-width: 620px) {
  .app-header { min-height: 84px; padding: 1.05rem 1.15rem .8rem; gap: .65rem; }
  .wordmark { font-size: .88rem; }
  .wordmark-symbol { width: 27px; height: 27px; }
  .wordmark-symbol::before, .wordmark-symbol::after { top: 6px; width: 14px; height: 14px; }
  .wordmark-symbol i { left: 13px; top: 11px; }
  .today-copy { text-align: left; }
  .today-copy p { font-size: .69rem; }
  .today-copy span { display: none; }
  .prototype-badge { font-size: 0; }
  .prototype-badge::before { content: '?'; width: 36px; height: 36px; border-radius: 50%; background: rgba(247,240,232,.08); display: grid; place-items: center; color: var(--text-soft); font-size: .76rem; }
  .screen { padding: 1.5rem 1.15rem calc(8.4rem + var(--safe-bottom)); }
  .screen-heading { max-width: none; font-size: clamp(2.3rem, 9.4vw, 3.45rem); }
  .screen-intro { margin-bottom: 1.35rem; }
  .journal-compose-screen { padding-top: .7rem; }
  .journal-compose-screen .screen-heading { margin-bottom: .5rem; font-size: 2.08rem; }
  .journal-compose-screen .screen-intro { margin-bottom: .65rem; font-size: .78rem; line-height: 1.45; }
  .journal-compose-screen .privacy-promise { margin-bottom: .65rem; padding: .55rem .7rem; }
  .editor-paper, .saved-page { padding: 1.2rem 1.1rem 1.1rem; }
  .journal-compose-screen .editor-paper { padding: .85rem .9rem .9rem; }
  .journal-compose-screen .mood-fieldset { margin: .65rem 0 .7rem; }
  .journal-compose-screen .mood-ribbon { grid-template-columns: repeat(6, 82px); gap: .4rem; overflow-x: auto; padding: 0 .1rem .3rem; scrollbar-width: none; }
  .journal-compose-screen .mood-ribbon::-webkit-scrollbar { display: none; }
  .journal-compose-screen .mood-mark { min-height: 58px; padding: .5rem .3rem; }
  .journal-compose-screen .mood-mark span { display: none; }
  .journal-compose-screen .paper-writing textarea { min-height: 72px; padding: .5rem 0; font-size: 1.12rem; }
  .journal-compose-screen .sticker-dock { margin: .55rem 0 .65rem; }
  .journal-compose-screen .photo-add { min-height: 54px; padding: .55rem .75rem; }
  .journal-compose-screen .prototype-footnote { margin-top: .7rem; font-size: .65rem; }
  .mood-ribbon { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .mood-mark { min-height: 70px; }
  .paper-writing textarea { min-height: 116px; font-size: 1.25rem; }
  .photo-sticker { width: min(160px, 52%); }
  .page-actions, .button-group { display: grid; grid-template-columns: 1fr 1fr; }
  .page-actions .button, .button-group .button { width: 100%; }
  .boundary-explainer { gap: .5rem; }
  .boundary-explainer > div { padding: .9rem; }
  .privacy-boundary { grid-template-columns: 1fr; }
  .stays-private { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; }
  .stays-private .boundary-title, .stays-private ul { grid-column: 1; }
  .stays-private img { grid-column: 2; grid-row: 1 / 3; width: 86px; height: 108px; margin: 0; }
  .leaves-page { padding: 1.2rem 1.05rem; }
  .trace-letter { margin-inline: 0; padding: 2.25rem 1.3rem 1.4rem; }
  .safety-row { align-items: flex-start; }
  .page-shelf { gap: .28rem; }
  .page-shelf i { min-height: 39px; }
  .page-shelf i.filled { min-height: 56px; }
  .app-nav { width: calc(100vw - 1rem); min-height: 72px; bottom: calc(.5rem + var(--safe-bottom)); padding: .4rem; border-radius: 27px 31px 25px 29px; }
  .app-nav button { min-height: 58px; }
  .prototype-note, .report-dialog, .reset-dialog { padding: 1.7rem 1.25rem; }
}

@media (min-width: 621px) {
  .journal-compose-screen { padding-top: 1rem; }
  .journal-compose-screen .screen-heading { max-width: none; margin-bottom: .55rem; font-size: 3.45rem; }
  .journal-compose-screen .screen-heading br { display: none; }
  .journal-compose-screen .screen-intro { margin-bottom: .75rem; }
  .journal-compose-screen .privacy-promise { margin-bottom: .75rem; }
  .journal-compose-screen .editor-paper { padding-top: 1rem; }
  .journal-compose-screen .mood-fieldset { margin: .85rem 0 .8rem; }
  .journal-compose-screen .mood-ribbon { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .journal-compose-screen .mood-mark { min-height: 68px; }
  .journal-compose-screen .paper-writing textarea { min-height: 82px; padding: .55rem 0; }
  .journal-compose-screen .sticker-dock { margin: .6rem 0 .8rem; }
  .journal-compose-screen .photo-add { min-height: 58px; }
}

@media (max-width: 380px) {
  .screen-heading { font-size: 2.18rem; }
  .mood-mark span { font-size: .54rem; }
  .choice-row span { font-size: .61rem; }
  .journal-copy { font-size: 1.75rem; }
}

@media (min-width: 900px) {
  .app-frame { box-shadow: 0 0 90px rgba(7,4,10,.22); }
}

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