/* NEXUS surfaces and type scale; Ion-inspired action hierarchy and touch targets. */
:root {
  color-scheme: dark;
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  --bg: #0b0f17;
  --paper: #131a25;
  --raised: #1b2636;
  --nav: #0e141f;
  --line: #283344;
  --line-strong: #43536c;
  --ink: #f1f5ff;
  --muted: #a6b3c8;
  --brand: #ff8b96;
  --brand-soft: #30212c;
  --on-brand: #291319;
  --error: #edceb6;
  --error-soft: #30251f;
  --success: #b7e4c5;
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .5; }
:where(button, input, textarea, select, a, summary):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
h1:focus, main:focus { outline: 0; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; letter-spacing: -.025em; }
h1 { font-size: 28px; }
h2 { font-size: 17px; }
p { line-height: 1.7; }
a { color: #ffb0b8; text-underline-offset: 4px; overflow-wrap: anywhere; }
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: fixed; z-index: 20; top: 12px; left: 12px; padding: 12px; background: var(--paper); border-radius: 8px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.shell { display: grid; grid-template-columns: 192px minmax(0, 1fr); height: 100dvh; }
.sidebar { min-height: 0; padding: 28px 16px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--nav); }
.brand { display: flex; align-items: center; gap: 10px; }
.brandmark { display: block; width: 38px; height: 38px; flex-shrink: 0; object-fit: contain; }
.brand-copy { display: grid; gap: 1px; }
.brand small { font-size: 10px; letter-spacing: .18em; color: var(--muted); }
.brand strong { font-size: 21px; font-weight: 600; letter-spacing: -.04em; line-height: 1.2; }
.sidebar .brand { padding: 0 6px; }
.sidebar nav { display: grid; gap: 6px; margin-top: 42px; }
.nav { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; }
.nav.selected { color: #ffd6db; background: var(--brand-soft); }
.nav.selected .icon { color: var(--brand); }
.nav:hover { background: var(--raised); color: var(--ink); }
.side-footer { margin-top: auto; padding: 18px 6px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.account-label { display: flex; align-items: center; gap: 8px; }
.account-label .icon { width: 17px; height: 17px; }
.side-footer p { margin: 7px 0; }
.side-footer .quiet { font-size: 12px; padding: 8px 0; justify-content: start; }
.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.preview-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 24px; background: #161e2b; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); flex-shrink: 0; }
.preview-banner strong { font-weight: 500; color: #ced8e9; }
.preview-banner button { border: 0; background: none; font-size: 12px; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; flex-shrink: 0; }
.library { flex: 1; min-height: 0; display: grid; grid-template-columns: 348px minmax(0, 1fr); }
.list-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.list-header { padding: 24px 20px 16px; border-bottom: 1px solid var(--line); }
.list-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.list-title h1, .list-title h2 { font-size: 23px; }
.list-title .primary { font-size: 13px; min-height: 40px; padding: 9px 12px; }
.primary, .secondary, .quiet { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 9px; padding: 10px 15px; line-height: 1.4; font-size: 14px; font-weight: 600; }
.primary { background: var(--brand); border: 1px solid var(--brand); color: var(--on-brand); }
.primary:hover { background: #ffacb4; border-color: #ffacb4; }
.secondary { background: var(--raised); border: 1px solid var(--line-strong); }
.secondary:hover { background: #26354a; }
.quiet { background: none; border: 1px solid transparent; color: var(--muted); font-weight: 400; }
.quiet:hover { background: var(--raised); color: var(--ink); }
.popover { position: relative; }
.popover summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; color: var(--muted); font-size: 13px; border-radius: 8px; padding: 8px 10px; }
.popover summary::-webkit-details-marker { display: none; }
.popover summary:hover, .popover[open] summary { background: var(--raised); color: var(--ink); }
.popover .chevron { margin-left: auto; }
.view-menu { margin: 0 -8px 12px; }
.view-menu summary .icon { width: 17px; height: 17px; }
.menu-options { position: absolute; top: calc(100% + 6px); left: 0; z-index: 4; padding: 6px; min-width: 220px; background: #1a2434; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 32px #0006; }
.menu-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; border: 0; padding: 10px 12px; text-align: left; font-size: 14px; border-radius: 6px; background: transparent; }
.menu-option:hover { background: #29374c; }
.menu-option.chosen, .menu-option.active { color: #ffc1c8; background: var(--brand-soft); }
.menu-option > span, .menu-option > .icon { margin-left: auto; }
.toolbar { display: flex; gap: 8px; }
.search { min-width: 0; flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--paper); border-radius: 9px; padding: 0 10px; color: var(--muted); }
.search:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.search .icon { width: 18px; height: 18px; }
.search input { width: 100%; min-width: 0; height: 44px; padding: 0; color: var(--ink); background: transparent; border: 0; outline: none; font-size: 13px; }
.search input::placeholder { color: var(--muted); }
kbd { font: 12px inherit; opacity: .7; }
.filter-menu summary { padding: 10px; border: 1px solid var(--line); }
.filter-menu summary > span { display: none; }
.filter-menu .menu-options { left: auto; right: 0; }
.filter-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; margin: 12px 0 0; padding: 6px 10px; border: 1px solid #66404c; border-radius: 7px; background: var(--brand-soft); color: #ffd6db; font-size: 12px; }
.filter-chip .icon { width: 14px; height: 14px; }
.entry-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 10px 28px; scrollbar-gutter: stable; }
.result-title { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 12px; color: var(--muted); font-size: 12px; }
.section-label { display: flex; align-items: baseline; gap: 8px; padding: 10px 10px 7px; color: var(--muted); }
.section-label h3, .section-label > span { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.collection-section + .collection-section { margin-top: 14px; }
.cards, .notes-list { display: grid; }
.card { position: relative; display: grid; grid-template-columns: 22px minmax(0,1fr); column-gap: 10px; row-gap: 8px; align-items: start; min-width: 0; width: 100%; padding: 16px 10px; border: 1px solid transparent; border-bottom-color: var(--line); border-radius: 0; background: transparent; text-align: left; }
.card:hover { background: var(--paper); border-radius: 8px; }
.card.is-selected { background: #251c29; border-color: #5d3b4b; border-radius: 8px; }
.card.is-selected::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; background: var(--brand); border-radius: 3px; }
.card:focus-visible { outline-offset: -2px; }
.format-icon { display: grid; place-items: center; color: var(--muted); padding-top: 3px; }
.card.is-selected .format-icon { color: var(--brand); }
.card-body { min-width: 0; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.card-title { display: block; font-size: 15px; line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
.card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-source { grid-column: 2; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; min-width: 0; }
.card-source .icon { width: 14px; height: 14px; }
.card-source span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-open { display: none; }
.badge { display: inline-flex; gap: 5px; align-items: center; border-radius: 5px; background: #242d3e; color: #cad4e5; padding: 4px 8px; font-size: 12px; }
.badge .icon { width: 14px; height: 14px; }
.badge.active { color: var(--success); background: #1b302c; }
.badge.review { color: var(--error); background: var(--error-soft); }
.card .badge { font-size: 11px; padding: 1px 5px; }
.reader { min-width: 0; overflow-y: auto; overscroll-behavior: contain; background: #101620; scrollbar-gutter: stable; }
.reader-idle { display: grid; place-items: center; }
.reader-message { padding: 40px; max-width: 440px; color: var(--muted); font-size: 15px; }
.reader-message > .icon { width: 30px; height: 30px; margin-bottom: 18px; color: #b88b9b; }
.reader-message h2 { color: var(--ink); font-size: 21px; font-weight: 500; }
.reader-message p { margin: 12px 0 0; }
.reader-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 16px 28px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.back { font-size: 13px; padding: 8px 0; }
.document { max-width: 900px; margin: 0 auto; padding: 32px 36px 60px; }
.document-header h1 { margin: 16px 0 20px; font-size: clamp(26px,2.2vw,34px); line-height: 1.25; letter-spacing: -.035em; }
.detail-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.actions-menu .menu-options { min-width: 200px; }
.document .content { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.85; max-width: 70ch; margin: 12px 0 28px; }
.document .comment-heading { font-size: 13px; letter-spacing: 0; color: var(--muted); font-weight: 500; margin: 0; }
.source-box { border-top: 1px solid var(--line); padding: 22px 0; margin-top: 12px; overflow-wrap: anywhere; font-size: 14px; }
.source-box h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 12px; }
.source-box h2 .icon { color: #cfa6b4; width: 18px; height: 18px; }
.source-box p { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.source-box .content { margin: 12px 0; padding-left: 16px; border-left: 2px solid #9a6c81; }
.detail-aside { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 24px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 28px; }
.detail-aside h2 { font-size: 15px; margin-bottom: 16px; }
.detail-aside section > p { color: var(--muted); font-size: 13px; }
.facts { margin: 0; display: grid; gap: 14px; }
.facts dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.facts dd { font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.assessment { font-size: 13px; color: var(--muted); margin-top: 12px; }
.assessment summary { cursor: pointer; padding: 9px 0; }
.assessment .facts { margin-top: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { font-size: 13px; color: var(--muted); border-left: 1px solid var(--line-strong); padding: 0 0 16px 14px; }
.timeline strong { display: block; font-size: 13px; color: var(--ink); font-weight: 500; }
.timeline small { font-size: 12px; }
.empty { padding: 24px 10px; }
.empty > .icon { margin-bottom: 14px; color: var(--muted); }
.empty h2 { font-size: 19px; }
.empty p { color: var(--muted); font-size: 14px; }
.empty .secondary { padding: 10px; font-size: 13px; }
.page { padding: 40px; max-width: 960px; }
.heading { margin-bottom: 20px; }
.personal-intro { color: var(--muted); max-width: 64ch; font-size: 16px; }
.personal-status { display: flex; gap: 12px; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 28px; }
.personal-status > .icon { color: var(--muted); margin-top: 3px; }
.personal-status p { font-size: 14px; color: var(--muted); max-width: 64ch; }
.entry-shell { min-height: 100dvh; }
.entry-main { min-height: 100dvh; display: grid; place-items: center; padding: 40px 24px; }
.entry-card { width: min(100%,460px); padding: 32px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.entry-header { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.connection { font-size: 12px; color: var(--muted); text-align: right; }
.gate .eyebrow { display: none; }
.gate h1 { font-size: 28px; margin-bottom: 12px; }
.gate-intro { color: var(--muted); margin: 0 0 24px; font-size: 15px; }
.gate-status { display: flex; align-items: start; gap: 10px; border: 1px solid var(--line-strong); background: var(--raised); padding: 14px; border-radius: 9px; font-size: 14px; margin: 18px 0; color: #d3deef; }
.gate-status p { margin: 0; }
.gate > .primary, .gate .native-login > .primary { width: 100%; min-height: 48px; }
.gate > .primary + .secondary { margin-top: 10px; }
.gate-note { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 500; }
html:has(dialog[open]) { overflow: hidden; }
dialog { width: min(700px,calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--paper); color: var(--ink); overflow: hidden; box-shadow: 0 24px 80px #0007; }
dialog::backdrop { background: #050810ba; }
dialog[open] { animation: enter 140ms ease-out; }
dialog > form { display: flex; flex-direction: column; max-height: calc(100dvh - 36px); }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.editor-head .eyebrow { display: block; margin-bottom: 6px; }
.editor-head h2 { font-size: 22px; }
.editor-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px; }
.field { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 500; margin: 0 0 20px; }
.field > span { color: var(--muted); font-weight: 400; font-size: 12px; }
.field :is(input, textarea, select) { flex-basis: 100%; width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: #0e1520; font-size: 15px; font-weight: 400; }
.field textarea { min-height: 140px; line-height: 1.7; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; }
.qa-tools { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 12px; color: var(--muted); }
.qa-tools summary { cursor: pointer; }
.qa-tools p { margin: 12px 0; }
.editor-footer { display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; padding: 18px 24px; border-top: 1px solid var(--line); background: var(--nav); }
.error { color: var(--error); background: var(--error-soft); border: 1px solid #7a583d; border-left: 3px solid #d7aa84; border-radius: 8px; font-size: 14px; line-height: 1.7; padding: 16px; margin-bottom: 20px; scroll-margin: 8px; }
.error:empty { display: none; }
.error strong { display: flex; align-items: start; gap: 8px; margin-bottom: 5px; }
.error strong .icon { margin-top: 3px; }
.error p { font-size: 13px; }
.error button { margin-top: 12px; }
.conflict-values { border-top: 1px solid #775a44; padding-top: 10px; margin-top: 10px; max-height: 120px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
#notice { position: fixed; z-index: 10; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(540px,calc(100% - 32px)); padding: 14px 20px; background: #283346; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px #0005; pointer-events: none; }
#notice:empty { display: none; }
@keyframes enter { from {opacity:0;transform:translateY(4px)} to {opacity:1;transform:none} }
@media (min-width: 1600px) { .library { grid-template-columns: 380px minmax(0,1fr); } .document { padding: 44px 60px 80px; } }
@media (max-width: 1099px) {
  .shell { grid-template-columns: 176px minmax(0,1fr); height: auto; min-height: 100dvh; }
  .sidebar { position: sticky; top: 0; height: 100dvh; padding-inline: 12px; }
  .library { display: block; }
  .list-pane { border-right: 0; }
  .list-header { padding: 24px 28px 16px; }
  .entry-list { padding: 14px 18px 40px; overflow: visible; }
  .reader-idle, .library:not(.has-selection) .reader { display: none; }
  .has-selection .list-pane { display: none; }
  .reader { overflow: visible; min-height: 100%; }
  .filter-menu summary > span { display: inline; }
  .card { padding: 18px 10px; }
  .document { padding: 28px 32px 60px; }
  .preview-detail { display: none; }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 16px 20px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0; }
  .brandmark { width: 32px; height: 32px; }
  .brand strong { font-size: 20px; }
  .sidebar nav { display: flex; gap: 20px; margin-top: 18px; }
  .nav { flex: 1; justify-content: center; border-radius: 0; padding: 12px 4px; font-size: 14px; border-bottom: 2px solid transparent; }
  .nav.selected { background: transparent; color: #ffd6db; border-bottom-color: var(--brand); }
  .nav .icon { width: 18px; height: 18px; }
  .side-footer { position: absolute; top: 11px; right: 20px; margin: 0; padding: 0; border: 0; }
  .side-footer .account-label, .side-footer p, .side-footer #leave-demo { display: none; }
  .side-footer .quiet { min-height: 44px; padding: 8px 0; font-size: 13px; }
  .preview-banner { padding: 9px 20px; gap: 12px; font-size: 11px; }
  .preview-banner button { font-size: 11px; }
  .list-header { padding: 22px 20px 16px; }
  .list-title h1, .list-title h2 { font-size: 25px; }
  .list-title .primary { min-height: 44px; font-size: 14px; }
  .search input { font-size: 16px; }
  kbd { display: none; }
  .filter-menu summary > span { display: none; }
  .entry-list { padding: 12px 10px 32px; }
  .card { padding: 18px 10px; }
  .card-title { font-size: 16px; }
  .card p { font-size: 14px; }
  .reader-toolbar { padding: 10px 20px; }
  .reader-toolbar > span { font-size: 12px; }
  .document { padding: 24px 22px 48px; }
  .document-header h1 { font-size: 28px; }
  .detail-actions { flex-wrap: wrap; }
  .detail-aside { grid-template-columns: 1fr; gap: 24px; }
  .page { padding: 28px 22px; }
  .entry-main { padding: 28px 18px; align-items: start; }
  .entry-card { padding: 26px 22px; border-radius: 14px; }
  .entry-header { gap: 10px; }
  .entry-header .connection { max-width: 110px; }
  .gate h1 { font-size: 27px; }
  dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 12px; }
  dialog > form { max-height: calc(100dvh - 24px); }
  .editor-head, .editor-body { padding: 20px 18px; }
  .editor-footer { padding: 16px 18px; }
  .field :is(input,textarea,select) { font-size: 16px; }
  .editor-footer button { font-size: 13px; padding: 10px 12px; }
  .field-row { gap: 12px; }
  #notice { bottom: 16px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Personal reader: content, evidence and uncertainty have separate visual roles. */
.muted, .personal-context, .document-meta { color: var(--muted); }
.read-only { font-size: 12px; color: var(--muted); white-space: nowrap; }
.list-intro { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.personal-library .list-header .search { display: flex; }
.personal-hit { grid-template-columns: minmax(0,1fr); }
.personal-hit .card-body { padding-left: 4px; }
.personal-hit .personal-evidence { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.personal-context { font-size: 14px; margin: -6px 0 20px; overflow-wrap: anywhere; }
.coverage-note { color: var(--muted); font-size: 13px; line-height: 1.7; }
.entry-list > .coverage-note { padding: 0 10px; margin-top: 20px; }
.personal-document > .coverage-note { padding: 0 0 20px; margin: 0; border-bottom: 1px solid var(--line); }
.personal-section { padding-top: 26px; }
.personal-section > h2 { font-size: 19px; margin-bottom: 18px; }
.knowledge-statement { margin: 0 0 20px; padding: 0 0 20px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.knowledge-statement.unconfirmed { padding-left: 16px; border-left: 2px solid #c9a16f; }
.statement-label { font-size: 13px; color: #cbd5e6; margin: 0 0 10px; display: flex; flex-direction: column; gap: 4px; }
.statement-label > span { font-size: 12px; color: var(--muted); }
.unconfirmed .statement-label > span { color: var(--error); }
.statement-value, .personal-value { white-space: pre-wrap; font-size: 16px; line-height: 1.8; }
.statement-value { margin: 0 0 12px; }
.validity { font-size: 13px; color: var(--muted); margin: 10px 0; }
.personal-source { font-size: 13px; display: grid; gap: 5px; margin-top: 14px; }
.source-label { color: var(--muted); font-size: 12px; }
.source-reference { overflow-wrap: anywhere; }
.personal-source p { color: var(--muted); margin: 0; font-size: 13px; }
.source-unavailable { color: var(--error); font-size: 13px; }
.personal-document blockquote { margin: 12px 0; padding-left: 16px; border-left: 2px solid #64728a; white-space: pre-wrap; }
.value-fields { margin: 0; display: grid; gap: 12px; }
.value-fields dt { color: var(--muted); font-size: 13px; }
.value-fields dd { margin: 4px 0 0; }
.value-list { padding-left: 20px; }
.document-meta { font-size: 12px; margin-top: 28px; }
.load-more { margin: 18px 10px 0; }
.list-error { padding: 10px; font-size: 14px; color: var(--error); }
@media (max-width:700px) { .personal-section > h2 { font-size: 18px; } }
.query-help { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.invalid-query { color: var(--error); }

/* Memory changes retain literal command and compare before explicit confirmation. */
.memory-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.writer-note { color:var(--muted); font-size:12px; margin:0; padding:12px 20px 0; }
.writer-retry { font-size:12px; margin:0 10px 8px; }
.recovery-panel { margin:12px 16px; padding:16px; border:1px solid #74604c; border-radius:9px; background:var(--error-soft); }
.recovery-panel h2 { font-size:15px; }
.recovery-panel p { font-size:13px; color:var(--error); }
.recovery-panel button { margin:8px 8px 0 0; font-size:13px; }
.memory-original { margin-bottom:24px; }
.memory-original h3, .memory-comparison h3, .memory-command-section h3 { font-size:14px; margin:0 0 12px; }
.memory-original blockquote, .memory-comparison blockquote { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:16px; line-height:1.75; padding-left:14px; border-left:2px solid #796074; }
.memory-comparison { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; margin-bottom:28px; }
.memory-comparison section:last-child blockquote { border-left-color:var(--brand); }
.memory-command-section { margin-top:24px; }
.memory-command { font-size:15px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; padding:16px; background:var(--nav); border:1px solid var(--line); border-radius:8px; }
.memory-outcome, .memory-open { padding:16px; margin:0 0 22px; border:1px solid var(--line-strong); border-radius:9px; }
.memory-outcome { color:var(--success); background:#1b302c; }
.memory-open { color:var(--error); background:var(--error-soft); }
.memory-outcome p, .memory-open p { font-size:14px; margin:8px 0 0; }
#memory-form .editor-footer { flex-wrap:wrap; }
@media(max-width:700px){ .memory-comparison { grid-template-columns:minmax(0,1fr); } #memory-form .editor-footer button { flex:1; } }

/* Keep assertions first; provenance and empty supplementary states remain reachable. */
.personal-document .reader-scope { color:var(--muted); font-size:12px; line-height:1.6; margin:0 0 4px; }
.personal-source { gap:0; margin-top:12px; }
.source-brief { display:flex; align-items:baseline; flex-wrap:wrap; column-gap:8px; min-width:0; }
.source-brief > :last-child { min-width:0; overflow-wrap:anywhere; }
.source-details summary { color:var(--muted); cursor:pointer; padding:8px 0; min-height:44px; }
.source-metadata { padding:4px 0 8px; display:grid; gap:5px; }
.entry-source, .reader-additional { border-top:1px solid var(--line); margin-top:16px; font-size:13px; }
.entry-source > summary, .reader-additional > summary { cursor:pointer; min-height:48px; padding:14px 0; color:var(--muted); }
.entry-source[open] > summary, .reader-additional[open] > summary { color:var(--ink); }
.entry-source > .personal-source { margin:0 0 12px; }
.reader-additional > div { padding:0 0 12px; color:var(--muted); }
.reader-additional p { margin:8px 0; }
.reader-empty { color:var(--muted); margin:24px 0; }
