/* ── Fonts ───────────────────────────────────────────────────
   Self-hosted (scripts/vendor-fonts.js) so first paint touches no third-party origin and
   there is no flash of fallback type. Variable `wght` axis: one file per style covers the
   whole scale. Newsreader is everything the user writes; Karla is everything the app says. */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/vendor/fonts/newsreader-normal.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-display: swap;
  font-weight: 200 800;
  src: url("/vendor/fonts/newsreader-italic.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Karla";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/vendor/fonts/karla-normal.woff2") format("woff2-variations");
}

/* ── Tokens ──────────────────────────────────────────────────
   The interface borrows its colour from the sky and introduces no palette of its own.
   --ink-3 on --log-panel measures ~5.5:1; nothing dimmer than 0.56 alpha, nothing under 11px. */
:root {
  --serif: "Newsreader", ui-serif, Georgia, serif;
  --sans: "Karla", ui-sans-serif, system-ui, sans-serif;

  --bg: #02030a;
  --ink: rgba(244, 238, 229, 0.94);
  --ink-2: rgba(244, 238, 229, 0.72);
  --ink-3: rgba(244, 238, 229, 0.62);
  --ink-4: rgba(244, 238, 229, 0.56);
  --hairline: rgba(244, 238, 229, 0.08);
  --edge: rgba(244, 238, 229, 0.1);
  --gold: #f5c96a;
  --blue: #72a6ff;
  --log-panel: rgba(7, 10, 19, 0.74);
  --composer-bg: rgba(8, 11, 20, 0.55);
  --wash: rgba(2, 3, 10, 0.68);

  /* Elevation is blur, not borders. */
  --blur-log: blur(36px) saturate(1.2);
  --blur-composer: blur(26px);
  --blur-hover: blur(18px);
  --shadow-log: 0 -20px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-composer: 0 20px 48px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: 16px;
  --column: 640px;

  --radius-composer: 22px;
  --radius-log: 28px;
  --radius-cell: 13px;
  --radius-button: 16px;
  --radius-hover: 16px;
  --radius-pill: 999px;

  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  /* Written by app.js from visualViewport when the on-screen keyboard opens. */
  --keyboard-offset: 0px;
}

/* ── Base ───────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  /* Newsreader carries an optical-size axis; let the browser use it across the type scale. */
  font-optical-sizing: auto;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid rgba(245, 201, 106, 0.9);
  outline-offset: 3px;
  border-radius: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#app {
  position: fixed;
  inset: 0;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

#app canvas {
  touch-action: none;
  display: block;
  pointer-events: auto;
}

#entry-input,
#reader-text,
.auth-field input {
  user-select: text;
  -webkit-user-select: text;
}

/* ── Motion ─────────────────────────────────────────────────── */

@keyframes smd-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes smd-lift {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes smd-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Hide-interface control ─────────────────────────────────── */

#focus-toggle-btn {
  position: fixed;
  top: calc(11px + var(--sat));
  right: calc(12px + var(--sar));
  z-index: 30;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  transition: opacity 0.3s var(--ease);
}

/* An explicit display beats the user-agent rule for [hidden], so say it outright. */
#focus-toggle-btn[hidden] {
  display: none;
}

.dim-dot {
  width: 15px;
  height: 15px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(244, 238, 229, 0.5);
  background: none;
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
    background 0.3s var(--ease), border-color 0.3s var(--ease);
}

body.composer-hidden #focus-toggle-btn {
  opacity: 0.4;
}

body.composer-hidden .dim-dot {
  width: 9px;
  height: 9px;
  border-color: transparent;
  background: rgba(245, 201, 106, 0.9);
}

/* ── The deck ───────────────────────────────────────────────── */

#deck {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 88px var(--gutter) calc(var(--gutter) + var(--sab) + var(--keyboard-offset));
  background: linear-gradient(
    to top,
    rgba(2, 3, 10, 0.92) 6%,
    rgba(2, 3, 10, 0.6) 46%,
    rgba(2, 3, 10, 0) 100%
  );
  /* The scrim must never eat a drag meant for the sky. */
  pointer-events: none;
  transition: opacity 0.42s var(--ease), transform 0.42s var(--ease);
}

#deck-column {
  max-width: var(--column);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
}

body.composer-hidden #deck {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}

/* Single channel for every transient string in the product. */
#message-line {
  margin: 0;
  min-height: 1em;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  animation: smd-fade 0.35s var(--ease);
}

#message-line:empty {
  display: none;
}

#milestone-line {
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 300;
  line-height: 1.3;
  color: var(--gold);
  animation: smd-lift 0.5s var(--ease);
}

#milestone-line[hidden] {
  display: none;
}

/* ── Meta row ──────────────────────────────────────────────── */

#meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  text-align: left;
}

#meta-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#meta-date {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-4);
  white-space: nowrap;
}

#meta-streak-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  box-shadow: 0 0 9px rgba(245, 201, 106, 0.85);
}

#meta-streak-dot[hidden] {
  display: none;
}

#meta-streak {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#meta-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

#meta-log-label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(244, 238, 229, 0.5);
}

.chevron {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: rgba(244, 238, 229, 0.5);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease);
}

#meta-row[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

/* ── Composer ──────────────────────────────────────────────── */

#entry-compose {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

#entry-input {
  --compose-height: 60px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--compose-height);
  height: var(--compose-height);
  max-height: 168px;
  resize: none;
  padding: 18px;
  border-radius: var(--radius-composer);
  border: 1px solid var(--edge);
  background: var(--composer-bg);
  backdrop-filter: var(--blur-composer);
  box-shadow: var(--shadow-composer);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.5;
  outline: none;
  overflow-y: hidden;
  transition: border-color 0.3s var(--ease);
}

#entry-input::placeholder {
  color: rgba(244, 238, 229, 0.42);
}

#entry-input:focus {
  border-color: rgba(244, 238, 229, 0.2);
}

/* A sibling of the field, never inside it. This is what removes the old overlap. */
#submit-btn {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-bottom: 8px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: rgba(244, 238, 229, 0.34);
  box-shadow: inset 0 0 0 1px rgba(244, 238, 229, 0.16);
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    box-shadow 0.3s var(--ease), transform 0.15s var(--ease);
}

/* The glyph lights up as you write. */
#submit-btn.ready {
  background: linear-gradient(160deg, #f7d489, #eedcc4);
  color: #10131c;
  box-shadow: 0 8px 22px rgba(245, 201, 106, 0.3);
}

#submit-btn:active {
  transform: scale(0.93);
}

.star-glyph {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* ── The log ───────────────────────────────────────────────── */

#log-scrim {
  position: fixed;
  inset: 0;
  z-index: 34;
  background: rgba(2, 3, 10, 0.4);
  animation: smd-fade 0.3s var(--ease);
}

#log-scrim[hidden] {
  display: none;
}

#log {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  max-height: 84dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px 18px calc(24px + var(--sab));
  border-radius: var(--radius-log) var(--radius-log) 0 0;
  background: var(--log-panel);
  backdrop-filter: var(--blur-log);
  box-shadow: var(--shadow-log);
  animation: smd-rise 0.36s var(--ease);
}

#log[hidden] {
  display: none;
}

#log-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: var(--radius-pill);
  background: rgba(244, 238, 229, 0.18);
}

#log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

#log-title {
  margin: 0;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  white-space: nowrap;
}

#log-range {
  font-size: 12px;
  color: rgba(244, 238, 229, 0.5);
  white-space: nowrap;
}

#log-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

#log-weekdays span {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

#log-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.night {
  aspect-ratio: 1;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-cell);
  background: none;
  transition: box-shadow 0.3s var(--ease);
}

.night-dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(244, 238, 229, 0.2);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.night.written .night-dot {
  width: 10px;
  height: 10px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(245, 201, 106, 0.55);
}

.night.rested .night-dot {
  width: 10px;
  height: 10px;
  background: rgba(114, 166, 255, 0.14);
  border: 1px solid rgba(114, 166, 255, 0.85);
  box-shadow: none;
}

.night.future .night-dot {
  background: rgba(244, 238, 229, 0.07);
}

.night.today {
  box-shadow: inset 0 0 0 1px rgba(244, 238, 229, 0.24);
}

.night.filtered {
  box-shadow: inset 0 0 0 1px rgba(245, 201, 106, 0.85);
}

/* Streaks off: the calendar still works as a finder, it just stops celebrating. */
#log.streaks-off .night.written .night-dot {
  background: rgba(244, 238, 229, 0.86);
  box-shadow: none;
}

#log-caption {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-4);
}

#streak-block {
  margin: 22px 0 4px;
}

#streak-block[hidden] {
  display: none;
}

#streak-headline {
  margin: 0;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

#streak-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

#streak-next {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-4);
}

.log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  border-top: 1px solid var(--hairline);
}

#streak-block + .log-row {
  margin-top: 18px;
}

.log-row-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.log-row-title {
  font-size: 14px;
  color: var(--ink);
}

.log-row-hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-4);
}

/* Sits under the reminder row, full width, when iOS needs installing first. */
#ios-install-hint {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(245, 201, 106, 0.86);
}

#ios-install-hint[hidden] {
  display: none;
}

#logout-btn {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  flex: 0 0 auto;
}

/* ── Switch ────────────────────────────────────────────────── */

#streak-switch,
#reminder-switch {
  position: relative;
  flex: 0 0 52px;
  width: 52px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
}

.switch-track {
  position: absolute;
  top: 6.5px;
  left: 0;
  width: 52px;
  height: 31px;
  border-radius: var(--radius-pill);
  background: rgba(244, 238, 229, 0.14);
  transition: background 0.28s var(--ease);
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 25px;
  height: 25px;
  border-radius: var(--radius-pill);
  background: rgba(244, 238, 229, 0.75);
  transition: left 0.28s var(--ease), background 0.28s var(--ease);
}

#streak-switch[aria-checked="true"] .switch-track,
#reminder-switch[aria-checked="true"] .switch-track {
  background: rgba(245, 201, 106, 0.9);
}

#streak-switch[aria-checked="true"] .switch-knob,
#reminder-switch[aria-checked="true"] .switch-knob {
  left: 24px;
  background: #12151f;
}

/* ── Signed out ────────────────────────────────────────────── */

#auth-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 88px var(--gutter) calc(28px + var(--sab) + var(--keyboard-offset));
  background: linear-gradient(
    to top,
    rgba(2, 3, 10, 0.94) 8%,
    rgba(2, 3, 10, 0.62) 52%,
    rgba(2, 3, 10, 0) 100%
  );
  pointer-events: none;
}

#auth-panel[hidden] {
  display: none;
}

#auth-column {
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  pointer-events: auto;
}

#wordmark {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}

#auth-blurb {
  margin: 0;
  max-width: 36ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#auth-form[hidden],
#auth-check[hidden],
#password-hint[hidden],
#auth-check-open[hidden] {
  display: none;
}

#auth-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-3);
}

.auth-field input {
  height: 46px;
  border: 0;
  border-bottom: 1px solid rgba(244, 238, 229, 0.16);
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  /* 16px keeps iOS from zooming the page on focus. */
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s var(--ease);
}

.auth-field input:focus {
  border-bottom-color: rgba(245, 201, 106, 0.6);
}

.auth-hint {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-4);
}

#auth-primary-btn {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-button);
  background: linear-gradient(160deg, #f7d489, #eedcc4);
  color: #10131c;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px rgba(245, 201, 106, 0.22);
  transition: opacity 0.25s var(--ease);
}

#auth-primary-btn[aria-disabled="true"] {
  opacity: 0.55;
}

/* ── Waiting on the inbox ──────────────────────────────────── */

#auth-check {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#auth-check-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--ink);
}

#auth-check-body {
  margin: 0;
  max-width: 38ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

#auth-check-body b {
  font-weight: 500;
  color: var(--ink);
  /* A long address should break rather than push the column wider than the panel. */
  overflow-wrap: anywhere;
}

#auth-check-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-button);
  border: 1px solid rgba(244, 238, 229, 0.2);
  color: var(--ink);
  font-size: 13.5px;
  text-decoration: none;
  transition: border-color 0.3s var(--ease);
}

#auth-check-open:hover {
  border-color: rgba(245, 201, 106, 0.55);
}

#auth-check-note {
  margin: 0;
  max-width: 38ch;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-4);
}

#auth-check-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

#auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#auth-status {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-4);
}

/* Something the reader has to act on, rather than the resting hint. */
#auth-status.is-alert {
  color: rgba(245, 201, 106, 0.86);
}

#auth-mode-btn,
#auth-resend-btn,
#auth-signin-btn,
#auth-back-btn {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  flex: 0 0 auto;
}

#auth-resend-btn[aria-disabled="true"] {
  color: var(--ink-4);
  text-decoration: none;
}

/* ── Hover preview (restyled fully in a later pass) ────────── */

#tooltip {
  position: fixed;
  z-index: 28;
  max-width: min(300px, 74vw);
  padding: 13px 15px;
  border-radius: var(--radius-hover);
  background: rgba(5, 7, 15, 0.86);
  backdrop-filter: var(--blur-hover);
  box-shadow: var(--shadow-hover);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.45;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 26px));
  transition: opacity 0.2s var(--ease);
  pointer-events: none;
}

.preview-text {
  display: block;
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 11px;
  color: rgba(244, 238, 229, 0.58);
}

.preview-meta i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: var(--radius-pill);
}

/* ── Reading a night ───────────────────────────────────────── */

#reader {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--wash);
  backdrop-filter: blur(2px);
  animation: smd-fade 0.34s var(--ease);
}

#reader[hidden] {
  display: none;
}

/* The star you touched stays lit above the wash. */
#reader-star {
  position: absolute;
  width: 110px;
  height: 110px;
  margin: -55px 0 0 -55px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.34s var(--ease);
}

#reader-star.visible {
  opacity: 1;
}

/* Desktop only: a hairline from the star to its text, like an annotated chart. */
#reader-leader {
  position: absolute;
  height: 1px;
  display: none;
  pointer-events: none;
  background: linear-gradient(to right, rgba(245, 201, 106, 0.65), rgba(244, 238, 229, 0.1));
}

#reader-leader.to-left {
  background: linear-gradient(to left, rgba(245, 201, 106, 0.65), rgba(244, 238, 229, 0.1));
}

#reader-column {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 86dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 30px 22px calc(30px + var(--sab));
  animation: smd-rise 0.4s var(--ease);
}

#reader-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}

#reader-mood {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: var(--radius-pill);
}

#reader-text {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 300;
  line-height: 1.62;
  letter-spacing: 0.002em;
  color: var(--ink);
  white-space: pre-wrap;
  text-wrap: pretty;
}

#reader-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}

#reader-steps {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

#reader-close,
#reader-prev,
#reader-next {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 12.5px;
}

#reader-close {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#reader-prev:disabled,
#reader-next:disabled {
  color: rgba(244, 238, 229, 0.24);
  cursor: default;
}

/* ── Desktop ───────────────────────────────────────────────── */

@media (min-width: 900px) {
  /* The log becomes a standing panel rather than a sheet. */
  #log {
    left: 20px;
    right: auto;
    top: 20px;
    bottom: 20px;
    width: 384px;
    max-height: none;
    padding: 26px 24px 28px;
    border-radius: var(--radius-log);
    animation: smd-lift 0.36s var(--ease);
  }

  #log-handle {
    display: none;
  }

  #reader-column {
    left: auto;
    right: auto;
    bottom: auto;
    width: 440px;
    max-height: 70dvh;
    padding: 0;
    animation: smd-fade 0.4s var(--ease);
  }

  #reader-leader {
    display: block;
  }

  #reader-text {
    font-size: 21px;
  }

  #auth-panel {
    display: grid;
    place-items: center;
    padding: var(--gutter);
    background: var(--wash);
  }
}

