/* The historical sample workspace shares the live reading hierarchy. */
.demo-ready { --demo-paper: #fbfaf7; --demo-paper-line: #e4e4db; --demo-muted: #66736b; }
.demo-ready .toolbar { gap: 12px; }
.demo-ready .toolbar-right { min-width: 0; }
.demo-ready #storageButton { color: #66736b; font-size: 12px; line-height: 1.35; min-height: 36px; }
.demo-ready #storageButton[data-storage="unavailable"] .status-dot { background: #8c413b; }
.demo-ready #workspace { height: calc(100dvh - 64px); }
.demo-ready .prototype-footer { display: none; }
.demo-ready .focused .companion-pane { bottom: 0; }
.demo-ready .pane-title { visibility: hidden; }
.demo-ready .pane-heading { height: 60px; }
.demo-ready #dateButton { color: #66736b; }
.demo-ready .day-group { grid-template-columns: 64px minmax(0, 1fr); gap: 28px; }
.demo-ready .day-heading { position: static; align-self: start; }
.demo-ready .day-group + .day-group { margin-top: 36px; }
.demo-ready .record-row { display: block; margin-bottom: 28px; }
.demo-ready .record-body { font-size: 16px; line-height: 1.65; max-inline-size: 64ch; padding: 0; cursor: text; }
.demo-ready .record-body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.demo-ready .record-row.selected::before { display: none; }
.demo-ready .record-foot { display: flex; align-items: center; gap: 10px; min-height: 32px; margin-top: 3px; }
.demo-ready .record-foot .record-time { display: inline-flex; align-items: center; gap: 6px; padding: 5px 0; font-size: 12px; line-height: 1.5; color: #66736b; min-height: 32px; border-radius: 4px; }
.demo-ready .record-foot .record-time svg { display: inline; margin: 0; }
.demo-ready .record-foot .record-origin { margin: 0; font-size: 12px; color: #66736b; }
.demo-ready .record-controls { position: static; display: flex; align-items: center; gap: 3px; margin-left: 1px; height: auto; background: transparent; opacity: 0; }
.demo-ready .record-row:hover .record-controls, .demo-ready .record-row:focus-within .record-controls { opacity: 1; }
.demo-ready .record-controls .record-more, .demo-ready .record-controls .record-quote { position: static; display: inline-flex; opacity: 1; height: 30px; width: 30px; align-items: center; justify-content: center; padding: 5px; background: transparent; }
.demo-ready .record-controls button:hover { background: #eef3ef; }
.demo-ready .media-inspect { color: #4d5d53; text-align: left; border-radius: 7px; width: fit-content; max-width: 100%; }
.demo-ready .record-body .media-inspect { margin: 12px 0 0; }
.demo-ready .media-inspect.file-tile, .demo-ready .media-inspect.audio-line { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 10px 12px; background: #f5f7f5; min-height: 44px; font-size: 13px; line-height: 1.5; }
.demo-ready .media-inspect > svg { width: 18px; height: 18px; color: #66736b; }
.demo-ready .media-inspect > svg:last-child { width: 16px; margin-left: 8px; }
.demo-ready .media-inspect > span { min-width: 0; overflow-wrap: anywhere; }
.demo-ready .media-inspect.audio-line small { font-size: 12px; margin-left: 8px; color: #66736b; }
.demo-ready .media-inspect:hover { background: #edf2ed; }
.demo-ready .record-extra { padding-top: 3px; color: #7b592d; font-size: 12px; gap: 10px; }
.demo-ready .record-extra button { min-height: 32px; padding: 4px 6px; font-size: 12px; color: #375a4b; text-decoration: underline; text-underline-offset: 3px; }
.demo-ready .list-end { margin-top: 40px; font-size: 12px; color: #66736b; }

/* Capture holds words on a lightly warm material; controls have their own edge. */
.demo-ready .capture { padding-top: 10px; padding-bottom: 18px; }
.demo-ready .capture-companion { display: none; }
.demo-ready .capture-note:empty { display: none; }
.demo-ready .capture-note { color: #66736b; font-size: 12px; }
.demo-ready .capture-editor { display: flex; flex-direction: column; min-height: 0; max-height: min(52dvh, 410px); background: var(--demo-paper); border: 1px solid var(--demo-paper-line); border-radius: 12px; padding: 12px 16px 14px; margin: 0; box-shadow: 0 3px 12px #2a302505; }
.demo-ready .capture-editor:focus-within { border-color: #a6b4a4; box-shadow: 0 0 0 3px #e8eee640, 0 3px 12px #2a302505; }
.demo-ready .editor-top { flex: 0 0 auto; font-size: 12px; color: #66736b; }
.demo-ready .editor-top .iconbutton { width: 32px; height: 32px; }
.demo-ready #captureInput { flex: 1 1 auto; min-height: 100px; max-height: min(28dvh, 250px); padding: 10px 0 16px; font-size: 16px; line-height: 1.65; color: #252a28; }
.demo-ready #captureInput::placeholder { color: #7b8276; }
.demo-ready .editor-bottom { flex: 0 0 auto; padding-top: 11px; border-top: 1px solid #e7e7de; gap: 12px; align-items: center; }
.demo-ready .editor-bottom > span { color: #66736b; font-size: 12px; line-height: 1.5; }
.demo-ready #captureHint[data-error] { color: #252a28; padding-left: 12px; border-left: 2px solid #b18d77; }
.demo-ready #captureHint { flex: 1 1 auto; min-width: 0; }
.demo-ready #captureHint[data-error] strong { display: block; margin-bottom: 3px; font-weight: 550; font-size: 12px; }
.demo-ready #captureHint[data-error] > span { display: block; color: #66736b; font-size: 12px; }
.demo-ready #toast[data-tone="error"] { border-color: #dfd0c4; background: #faf8f5; }
.demo-ready .toast-error-mark { display: grid; place-items: center; border: 1px solid #a98267; color: #805e49; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 600; }
.demo-ready #saveCapture { min-height: 40px; padding: 9px 16px; background: #375a4b; color: #fff; font-size: 13px; border-radius: 7px; }
.demo-ready #saveCapture:disabled { opacity: .45; }
.demo-ready #saveCapture kbd { font-size: 11px; color: #e0e8e0; }

/* Interpretation first, exact originals within reach, corrections at the end. */
.demo-ready #memoryView { background: #fbfcfa; }
.demo-ready #memoryView > .companion-heading { height: auto; min-height: 90px; align-items: flex-start; gap: 12px; padding-top: 24px; padding-bottom: 20px; }
.demo-ready #memoryView > .companion-heading > div { display: block; }
.demo-ready #memoryView h2 { font-size: 18px; font-weight: 550; }
.demo-ready #memoryView .secondary { color: #66736b; font-size: 12px; line-height: 1.5; margin-top: 6px; }
.demo-ready #backToChat { min-height: 36px; width: 36px; font-size: 0; flex: 0 0 auto; padding: 9px; }
.demo-ready #backToChat svg { width: 18px; height: 18px; }
.demo-ready .memory-list { padding: 8px 26px 32px; }
.demo-ready .memory-intro { color: #66736b; margin: 0 0 32px; max-width: 35ch; }
.demo-ready .memory-eyebrow { display: block; color: #375a4b; font-size: 12px; font-weight: 500; margin-bottom: 8px; }
.demo-ready .memory-intro p { font-size: 16px; line-height: 1.65; color: #536057; margin: 0; }
.demo-ready .memory-card { background: #fff; border: 1px solid #e9ede6; border-radius: 12px; padding: 20px 20px 8px; margin-bottom: 20px; }
.demo-ready .memory-card .memory-meta { order: 0; font-size: 12px; color: #66736b; margin-bottom: 14px; line-height: 1.5; }
.demo-ready .memory-card .memory-thought { order: 1; margin: 0 0 24px; font-size: 19px; line-height: 1.55; letter-spacing: -.015em; color: #303c34; }
.demo-ready .memory-sources { order: 2; border-top: 1px solid #eef0eb; padding-top: 15px; }
.demo-ready .memory-sources h3 { font-size: 12px; font-weight: 500; color: #66736b; margin: 0 0 10px; }
.demo-ready .memory-card .memory-source { display: block; width: 100%; min-height: 54px; text-align: left; padding: 9px 0; color: #375a4b; }
.demo-ready .memory-source-quote { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.6; color: #536057; }
.demo-ready .memory-source-meta { display: flex; gap: 5px; align-items: center; margin-top: 4px; color: #66736b; font-size: 12px; }
.demo-ready .memory-source-meta svg { margin-left: auto; color: #375a4b; }
.demo-ready .memory-card .memory-actions { order: 3; border-top: 1px solid #eef0eb; margin-top: 13px; padding-top: 5px; display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.demo-ready .memory-card .memory-actions button { min-height: 40px; font-size: 12px; color: #375a4b; }
.demo-ready .memory-card .memory-actions button:last-child { color: #66736b; }
.demo-ready .memory-version { font-variant-numeric: tabular-nums; }
.demo-ready .correction-basis { color: #66736b; font-size: 12px; line-height: 1.7; }
.demo-ready .dialog-textarea { background: #fbfaf7; border: 1px solid #e4e4db; font-size: 16px; line-height: 1.65; }
.demo-ready .muted, .demo-ready .dialog-note, .demo-ready .dialog-row small { color: #66736b; }
.demo-ready button:focus-visible { outline: 2px solid #4e6d5b; outline-offset: 3px; }
.demo-ready .dialog-row { flex-wrap: wrap; }
.demo-ready #dialogBody h3 { overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.demo-ready #dialogBody .dialog-actions { flex-wrap: wrap; }
.demo-ready #dialogBody .dialog-actions button { white-space: normal; }
.demo-ready .dialog-row > span:first-child { flex: 1 1 180px; }

@media (max-width: 1100px) and (min-width: 900px) {
  .demo-ready .day-group { gap: 20px; }
  .demo-ready .memory-card { padding: 18px 16px 6px; }
  .demo-ready .memory-list { padding-inline: 18px; }
}
@media (max-width: 899px) {
  .demo-ready #workspace { height: calc(100dvh - 72px); }
  .demo-ready .toolbar { min-height: 72px; height: 72px; padding: 0 14px; gap: 8px; }
  .demo-ready .toolbar-right { flex: 1; justify-content: flex-end; gap: 3px; }
  .demo-ready .toolbar-left { gap: 5px; }
  .demo-ready #profileButton { gap: 6px; }
  .demo-ready #profileButton .caret { display: none; }
  .demo-ready #storageButton { font-size: 11px; padding: 6px 8px; white-space: normal; max-width: 116px; text-align: left; }
  .demo-ready #storageButton .status-dot { display: none; }
  .demo-ready .toolbar-right .search-button { padding: 5px; }
  .demo-ready .toolbar-right .iconbutton { width: 30px; }
  .demo-ready .focused .companion-pane, .demo-ready.focused .companion-pane { top: 72px; bottom: 0; }
  .demo-ready .record-scroller { padding: 10px 24px 24px; }
  .demo-ready .day-group { display: block; }
  .demo-ready .day-heading { margin-bottom: 24px!important; }
  .demo-ready .record-row { margin-bottom: 25px; }
  .demo-ready .record-controls { opacity: 1; }
  .demo-ready .record-controls .record-quote { display: none; }
  .demo-ready .record-foot .record-time, .demo-ready .record-controls .record-more { min-height: 40px; }
  .demo-ready .capture { padding: 10px 18px 16px; }
  .demo-ready .capture-editor { padding: 10px 14px 12px; }
  .demo-ready .editor-bottom > span { max-width: none; font-size: 12px; }
  .demo-ready #saveCapture kbd { display: none; }
  .demo-ready #memoryView > .companion-heading { padding-top: 20px; min-height: 90px; }
  .demo-ready .memory-list { padding-inline: 20px; }
  .demo-ready .memory-intro { margin-bottom: 26px; }
  .demo-ready .memory-card { padding: 18px 17px 7px; }
  .demo-ready .memory-card .memory-thought { order: 1; font-size: 19px; }
  .demo-ready .source-return { padding-inline: 24px; flex-wrap: wrap; font-size: 12px; }
  .demo-ready .source-return button { min-height: 40px; font-size: 12px; }
}
@media (max-width: 360px) {
  .demo-ready #profileButton .tormie-app-icon { display: none; }
  .demo-ready .toolbar-left { gap: 2px; }
  .demo-ready #storageButton { max-width: 110px; padding-inline: 4px; }
  .demo-ready .record-scroller { padding-inline: 20px; }
  .demo-ready .capture { padding-inline: 14px; }
  .demo-ready .editor-bottom { align-items: flex-start; }
}
@media (max-height: 500px) {
  .demo-ready .records-pane:has(#captureEditor:not([hidden])) .pane-heading { display: none; }
  .demo-ready .records-pane:has(#captureEditor:not([hidden])) .record-scroller { visibility: hidden; min-height: 0; flex: 1 1 0; padding-block: 0; }
  .demo-ready .capture { flex-shrink: 1; min-height: 0; }
  .demo-ready .capture-editor { flex: 1 1 auto; max-height: min(70dvh, calc(100dvh - 98px)); overflow: hidden; }
  .demo-ready #captureInput { min-height: 44px; height: 44px; max-height: 18dvh; flex: 1 1 0; }
  .demo-ready .capture { padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) { .demo-ready *, .demo-ready *::before { scroll-behavior: auto; } }

.demo-ready #memoryView > .companion-heading > .memory-navigation { display: flex; align-items: center; gap: 0; }
.demo-ready #closeMemory { width: 36px; height: 36px; color: #66736b; }

/* Keep the actual outgoing pane in its measured place as records regain input.
   A newer view intent removes these bounds and cancels the finite exit. */
body.demo-ready #companionPane[data-pane-exiting] {
  display: flex;
  position: fixed;
  inset: auto;
  left: var(--pane-exit-left);
  top: var(--pane-exit-top);
  width: var(--pane-exit-width);
  height: var(--pane-exit-height);
  margin: 0;
  z-index: 4;
  pointer-events: none;
}
