  /* SPDX-License-Identifier: AGPL-3.0-or-later */
  /* Write and chat: the two transcript screens (Pattern A). The message
     block, composer box and button voices come from components.css; this
     file is what is particular to each screen. */

  /* ---- the scrolling transcript ---- */
  #write-log, #chat-log {
    flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 46rem;
    margin: 0 auto; padding: clamp(1rem, 3vw, 1.5rem) clamp(1rem, 3vw, 1.5rem) .5rem;
  }
  #chat-log { display: flex; flex-direction: column; }
  /* a new journal's empty write screen: one quiet note, gone at the first entry */
  #write-first-run {
    color: var(--text-dim); font-size: .95rem; line-height: 1.6; max-width: 30rem;
    margin: 18vh auto 0; text-align: center; text-wrap: pretty;
  }
  #write-first-run p + p { margin-top: .5rem; }
  #write-first-run b { color: var(--accent); font-weight: 600; }

  /* ---- write: the seed ritual banner, between close and save ---- */
  #seed-banner {
    flex-shrink: 0; width: 100%; max-width: 46rem; margin: 0 auto;
    padding: .4rem clamp(1rem, 3vw, 1.5rem);
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem;
    font: .85rem/1.45 var(--font-ui); color: var(--accent-dim);
  }
  #seed-banner[hidden] { display: none; }
  #seed-banner > span { flex: 1 1 18rem; text-wrap: pretty; }
  #seed-banner .actions { display: flex; flex-wrap: wrap; gap: .4rem; }
  #seed-banner button.send { font-size: .85rem; height: 1.9rem; padding: 0 .9rem; }

  /* ---- write: close-pipeline progress, the updating-memory checklist ---- */
  #close-progress {
    flex-shrink: 0; width: 100%; max-width: 46rem; margin: 0 auto;
    padding: .6rem clamp(1rem, 3vw, 1.5rem) .4rem; font-family: var(--font-ui);
  }
  #close-progress[hidden] { display: none; }
  #close-progress .eyebrow { margin-bottom: .3rem; }
  #close-progress .done-line { margin-top: .4rem; font-size: .85rem; color: var(--text-dim); }

  /* ---- write: the composer ---- */
  .write-composer { gap: .6rem; }
  /* the entry's timestamp, above the box: quiet until you need it */
  #entry-stamp {
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem;
    font: .85rem var(--font-ui); color: var(--accent-dim);
  }
  #entry-stamp input[type=date], #entry-stamp input[type=time] {
    background: var(--bg-input); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: .15rem .35rem; font: inherit;
  }
  #entry-stamp-fields { display: inline-flex; align-items: center; gap: .4rem; }
  #entry-stamp[hidden], #entry-stamp-fields[hidden], #entry-stamp-text[hidden], #entry-stamp-edit[hidden] { display: none; }
  /* height is set inline by autosizeEntry (grow to fill the viewport, then
     scroll). This is only the backstop if that JS hasn't run yet. */
  #entry-text { min-height: 6.6rem; max-height: 85vh; overflow-y: auto; }
  .write-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .6rem; }
  /* the no-reply toggle sits with the other controls */
  #noreply-wrap {
    display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
    font: .85rem var(--font-ui); color: var(--text-dim); min-height: 2.2rem; padding: 0 .2rem;
    white-space: nowrap;
  }
  .saved-note { font: .85rem var(--font-ui); color: var(--accent-dim); text-wrap: pretty; }
  /* the ⋯ menu, pinned right, opening upward */
  #write-actions { position: relative; margin-left: auto; }
  #write-actions summary {
    list-style: none; display: inline-flex; align-items: center; justify-content: center;
    width: 2.8rem; height: 2.2rem; cursor: pointer; color: var(--text-dim);
    border: 1px solid var(--border); border-radius: var(--radius-base);
    font: .95rem var(--font-ui); letter-spacing: .1em; background: transparent;
  }
  #write-actions summary::-webkit-details-marker { display: none; }
  #write-actions summary:hover, #write-actions[open] summary { color: var(--text); background: var(--bg-raised); }
  #write-actions .menu { bottom: calc(100% + .5rem); right: 0; }

  /* ---- chat: the compact composer's toggle ---- */
  #lookup-smart[hidden] { display: none; }

  /* ---- the seed summary editor: a sub-view of write ---- */
  /* The textarea is the view. It grows to fill everything between the head
     and the actions and scrolls internally, full height from the start. */
  #seed-editor {
    flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .6rem;
    width: 100%; max-width: 46rem; margin: 0 auto; padding: clamp(1rem, 3vw, 1.5rem);
  }
  #seed-editor-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
  #seed-back { flex-shrink: 0; padding-left: 0; font-size: .85rem; min-height: 2.2rem; }
  #seed-editor-meta { flex: 1; min-width: 12rem; color: var(--text-dim); font: .85rem var(--font-ui); text-wrap: pretty; }
  #seed-editor-draftnote { flex-basis: 100%; margin: 0; font: .85rem var(--font-ui); color: var(--accent); }
  #seed-editor-draftnote[hidden] { display: none; }
  #seed-editor-text { flex: 1; min-height: 8rem; overflow-y: auto; }
  #seed-editor-actions { display: flex; align-items: center; gap: .5rem .6rem; flex-wrap: wrap; }
  #seed-discard-draft[hidden] { display: none; }
