:root {
  color-scheme: dark;
  --canvas: #500c1c;
  --paper: #fff8f0;
  --ink: #4d1220;
  --muted: #79514f;
  --brand: #85152f;
  --rose: #f5ced3;
  --on-muted: #ebc9cb;
  --line: #a66a77;
  font: 16px/1.6 Manrope, system-ui, sans-serif;
  background: var(--canvas);
  color: var(--paper);
  scrollbar-color: var(--line) var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button {
  cursor: pointer;
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  background: var(--brand);
  color: var(--paper);
  padding: 12px 20px;
  font-weight: 500;
  transition: background-color 180ms ease-out;
}
button:hover { background: #a02240; }
button:disabled { opacity: .65; cursor: wait; }
a { color: inherit; text-underline-offset: .25em; }
h1, h2, p { margin-top: 0; }
h1, h2, .wordmark, .note-body, .primary-light, #send {
  font-family: Lora, Georgia, serif;
  font-weight: 500;
}
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.25; letter-spacing: -.025em; margin-bottom: 24px; text-wrap: balance; }
h2 { font-size: 1.4rem; line-height: 1.3; letter-spacing: -.02em; }
p { overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--rose); outline-offset: 4px; }
input:focus-visible, textarea:focus-visible, .paper button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
::selection { background: var(--rose); color: var(--ink); }
[hidden] { display: none !important; }
.shell { max-width: 720px; margin: auto; padding: 0 32px; }
.brand-header { position: relative; padding: 60px 0 20px; min-height: 180px; isolation: isolate; }
.wordmark { display: block; width: fit-content; font-size: clamp(3rem, 8vw, 4rem); line-height: 1.1; text-decoration: none; letter-spacing: -.04em; }
.edition { display: block; margin-top: 10px; color: var(--on-muted); font-size: .9rem; }
.header-rose { position: absolute; z-index: -1; right: -12px; top: 6px; width: 235px; height: 235px; object-fit: contain; pointer-events: none; transform: rotate(20deg); }
main { padding: 0; min-height: 60vh; }
#status { margin: 12px 0 20px; color: var(--on-muted); }
#status:empty { display: none; }
.intro { color: var(--on-muted); margin-bottom: 32px; }
.paper { background: var(--paper); color: var(--ink); padding: 28px; border-radius: 18px; color-scheme: light; }
.login-paper { margin-top: 28px; }
.login-paper h2 { margin-bottom: 24px; }
#login { padding-top: 20px; }
label { display: block; font-weight: 500; margin: 20px 0 8px; }
input, textarea { width: 100%; min-width: 0; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 12px; caret-color: var(--brand); }
input { min-height: 48px; }
textarea { resize: vertical; min-height: 260px; font: 500 clamp(1.6rem, 5vw, 2.2rem)/1.4 Lora, Georgia, serif; letter-spacing: -.025em; }
textarea::placeholder { color: var(--muted); opacity: 1; }
.login-paper button, .editor-paper button { width: 100%; margin-top: 24px; }
.help { font-size: .8125rem; line-height: 1.5; color: var(--muted); margin: 16px 0 0; }
.identity { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 30px; color: var(--on-muted); font-size: .875rem; }
.identity p { margin: 0; }
#journal-date { font-size: .8125rem; }
.text-button { background: transparent; padding: 8px 0; color: inherit; font-weight: 400; text-align: left; text-decoration: underline; text-underline-offset: 5px; border-radius: 0; }
.text-button:hover { background: transparent; color: var(--rose); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.section-heading h1 { font-size: 1.5rem; margin-bottom: 16px; }
.section-heading .text-button { font-size: .8125rem; }
.note { margin-bottom: 16px; }
.note-body { font-size: clamp(1.65rem, 4.5vw, 2.15rem); line-height: 1.25; letter-spacing: -.025em; white-space: pre-wrap; margin-bottom: 24px; unicode-bidi: plaintext; }
.note-meta { color: var(--muted); font-size: .8125rem; margin-bottom: 0; }
.note-question { font-size: .875rem; color: var(--muted); margin-bottom: 20px; }
.primary-light { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin-top: 4px; background: var(--rose); color: var(--ink); font-size: 1.25rem; }
.primary-light:hover { background: var(--paper); }
.icon { flex-shrink: 0; width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.question { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.question h2 { font-size: 1.2rem; margin-bottom: 8px; }
.question p { font: italic 1.4rem/1.45 Lora, Georgia, serif; margin-bottom: 4px; }
.question .text-button { font-family: Lora, Georgia, serif; font-size: 1.1rem; }
.footer-note { margin: 24px 0; font-size: .8125rem; color: var(--on-muted); }
.journal-nav { display: flex; justify-content: center; gap: 16px; border-top: 1px solid var(--line); padding: 12px 0 max(12px, env(safe-area-inset-bottom)); }
.journal-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: transparent; color: var(--on-muted); min-width: 108px; padding: 8px 16px; font-size: .8125rem; }
.journal-nav button[aria-current] { background: var(--rose); color: var(--ink); }
.journal-nav button:hover { background: var(--brand); color: var(--paper); }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 28px; padding: 20px 0; font-size: .75rem; color: var(--on-muted); }
body[data-view='editor'] .brand-header { display: none; }
#editor { padding-top: 24px; }
#editor > h1 { margin: 16px 0 24px; }
#back { font-size: .875rem; }
.editor-paper { position: relative; display: flex; flex-direction: column; min-height: 660px; padding: 32px; }
.editor-rose { position: absolute; right: 16px; top: 12px; width: 78px; height: 78px; object-fit: contain; transform: rotate(18deg); pointer-events: none; }
#draft-status { margin: 0 68px 28px 0; }
.editor-paper label { font: 400 1rem/1.5 Lora, Georgia, serif; margin-bottom: 20px; }
.editor-paper textarea { flex: 1; border: 0; padding: 0; border-radius: 0; min-height: 250px; }
.count { text-align: right; font-variant-numeric: tabular-nums; }
.visibility { display: flex; align-items: center; gap: 12px; border-top: 1px solid #d7bdb5; margin-top: 24px; padding-top: 16px; color: var(--muted); }
.visibility .icon { width: 22px; height: 22px; }
.visibility .help { margin: 0; }
#send { font-size: 1.3rem; }
.editor-paper #close-draft { align-self: center; width: auto; text-align: center; margin-top: 8px; color: var(--brand); }
.editor-paper .text-button:hover { color: var(--ink); }
.muted { color: var(--on-muted); font-size: .875rem; }
.empty { padding: 32px 24px; border: 1px solid var(--line); border-radius: 18px; margin-bottom: 16px; color: var(--on-muted); }
.empty h2 { color: var(--paper); }
.empty p { margin-bottom: 0; font-size: .875rem; }
.skip { position: absolute; left: 16px; top: -100px; background: var(--paper); color: var(--ink); padding: 12px; z-index: 2; }
.skip:focus { top: 12px; }
#journal-title:focus, #editor-title:focus { outline: none; }
@media (min-width: 1000px) {
  .shell { padding: 0 40px; }
  .brand-header { min-height: 220px; padding-top: 64px; }
  .header-rose { width: 275px; height: 275px; top: 0; right: -24px; }
  .paper { padding: 36px; }
  .editor-paper { padding: 36px; }
}
@media (max-width: 480px) {
  .shell { padding: 0 20px; }
  .brand-header { min-height: 150px; padding-top: 40px; }
  .header-rose { width: 165px; height: 165px; top: 5px; right: 12px; }
  .edition { max-width: 55%; font-size: .8125rem; }
  .identity { margin-bottom: 20px; flex-wrap: wrap; }
  .paper { padding: 24px; }
  .section-heading { flex-wrap: wrap; gap: 0 12px; }
  .section-heading h1 { margin-right: auto; }
  .editor-paper { min-height: 620px; }
  #editor > h1 { font-size: 1.6rem; }
}
@media (max-width: 340px) {
  .shell { padding: 0 16px; }
  .paper { padding: 20px; }
  .header-rose { width: 145px; height: 145px; right: 8px; }
  .journal-nav button { min-width: 0; flex: 1; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
