/* Notes extends the incumbent shell and semantic workspace appearance. */
.notes-room > .notes-skip { position: fixed; left: 16px; top: -100px; z-index: 200; padding: 12px 16px; background: var(--workspace-surface); color: var(--workspace-ink); border: 1px solid var(--workspace-field-edge); border-radius: 8px; font-size: 13px; }
.notes-room > .notes-skip:focus { top: 8px; }
.notes { --ink: var(--workspace-ink); padding: var(--ui-content-inset, 32px); color: var(--workspace-ink); }
.notes :is(h1, h2, h3, h4, h5, h6, strong, summary, label) { color: var(--workspace-ink); }
html body .notes, html body .notes * { transition: none; animation: none; }
.notes-editor :is(p, li, span) { color: inherit; }
.notes [hidden] { display: none !important; }
.notes-heading { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.notes-heading h1 { margin: 0 0 8px; font-size: var(--ui-title-size, 30px); line-height: 1.15; letter-spacing: -.025em; font-weight: 700; text-wrap: balance; }
.notes-heading p { margin: 0; max-width: 65ch; color: var(--workspace-secondary); font-size: 15px; }
.notes-heading > a { flex-shrink: 0; }
.notes-status-row { display: flex; align-items: center; gap: 12px; margin: 24px 0; min-height: 44px; }
.notes-status-row > p { flex: 1; margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.notes-status-row[data-error="true"] > p { color: var(--workspace-error); }
.notes .btn-outline, .notes .btn-solid { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 8px; font: 600 13px/1.5 var(--sans); cursor: pointer; text-decoration: none; }
.notes .btn-outline { background: var(--workspace-surface); color: var(--workspace-ink); border: 1px solid var(--workspace-field-edge); }
.notes .btn-solid { background: var(--workspace-ink); color: var(--workspace-on-solid); border: 1px solid transparent; }
.notes .btn-outline:hover { background: var(--workspace-soft); }
.notes .btn-solid:hover { background: var(--workspace-solid-hover); }
.notes button:disabled, .notes input:disabled, .notes select:disabled { opacity: .55; cursor: default; }
.notes button:not(:disabled):active { transform: scale(.97); }
.notes :is(button, a, input, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--workspace-focus); outline-offset: 3px; }
.notes-help, .notes-notice { font-size: 13px; line-height: 1.55; color: var(--workspace-secondary); }
.notes-source-offer, .notes-recovery { padding: 16px 0; border-block: 1px solid var(--workspace-edge); margin-bottom: 24px; }
.notes-source-offer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.notes-source-offer > div { flex: 1; min-width: 240px; }
.notes-source-offer h2 { font-size: 20px; margin: 0 0 8px; }
.notes-source-offer p, .notes-recovery p { margin: 0; max-width: 65ch; font-size: 13px; color: var(--workspace-secondary); }
.notes-recovery > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.notes-workspace { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: 32px; border-top: 1px solid var(--workspace-edge); padding-top: 24px; }
.notes-library { min-width: 0; }
.notes-library > summary, .notes-history > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; font-size: 15px; font-weight: 600; }
.notes-library > summary span, .notes-history > summary span { margin-left: auto; font-size: 13px; color: var(--workspace-secondary); font-weight: 400; font-variant-numeric: tabular-nums; }
.notes-library > .btn-solid { margin: 8px 0 16px; width: 100%; }
.notes-library ul { list-style: none; margin: 0; padding: 0; max-height: 480px; overflow: auto; }
.notes-library li + li { border-top: 1px solid var(--workspace-edge); }
.notes-list-item { width: 100%; min-height: 44px; text-align: left; border: 0; border-radius: 6px; padding: 12px 8px; background: transparent; color: var(--workspace-ink); cursor: pointer; font: 400 13px/1.55 var(--sans); }
.notes-list-item strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.notes-list-item span { display: block; margin-top: 4px; color: var(--workspace-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.notes-list-item:hover { background: var(--workspace-soft); }
.notes-list-item[aria-current="page"] { background: var(--workspace-selected); }
.notes-writing { min-width: 0; border-left: 1px solid var(--workspace-edge); padding-left: 32px; }
.notes-empty { padding: 32px 0; max-width: 60ch; }
.notes-empty h2 { font-size: 20px; margin: 0 0 16px; text-wrap: balance; }
.notes-empty p { font-size: 15px; line-height: 1.7; color: var(--workspace-secondary); }
.notes-title-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.notes-title-row > label { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.notes-title-row input { display: block; margin-top: 8px; width: 100%; box-sizing: border-box; min-height: 44px; border: 1px solid var(--workspace-field-edge); border-radius: 8px; background: var(--workspace-soft); color: var(--workspace-ink); padding: 10px 12px; font: 600 16px/1.4 var(--sans); caret-color: var(--workspace-focus); }
.notes-save-row { display: flex; align-items: center; gap: 12px; }
#notesDirty { white-space: nowrap; font-size: 13px; color: var(--workspace-secondary); }
.notes-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 16px 0; border-block: 1px solid var(--workspace-edge); margin-top: 16px; }
.notes-toolbar .btn-outline { padding-inline: 12px; }
.notes-toolbar [aria-pressed="true"] { background: var(--workspace-selected); border-color: var(--workspace-selected-edge); }
.notes-block-label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.notes-block-label select { box-sizing: border-box; min-width: 0; height: 44px; min-height: 44px; border: 1px solid var(--workspace-field-edge); border-radius: 8px; padding: 8px 12px; color: var(--workspace-ink); background: var(--workspace-soft); font: 400 13px/1.5 var(--sans); }
.notes-editor { padding: 24px 8px; min-height: 320px; max-width: 72ch; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--workspace-ink); font: 400 15px/1.75 var(--sans); caret-color: var(--workspace-focus); }
.notes-editor[contenteditable="false"] { cursor: default; }
.notes-paragraph { margin: 0 0 16px; }
.notes-h1, .notes-h2, .notes-h3 { margin: 24px 0 12px; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
.notes-h1 { font-size: 28px; }.notes-h2 { font-size: 23px; }.notes-h3 { font-size: 20px; }
.notes-quote { margin: 16px 0; padding-left: 16px; border-left: 1px solid var(--workspace-field-edge); color: var(--workspace-secondary); }
.notes-ul, .notes-ol { margin: 12px 0 16px; padding-left: 28px; }
.notes-li { margin-block: 4px; }.notes-nested { list-style: none; }
.notes-bold { font-weight: 700; }.notes-italic { font-style: italic; }.notes-underline { text-decoration: underline; }.notes-strike { text-decoration: line-through; }
.notes-code { font-family: var(--mono); background: var(--workspace-soft); padding: 2px 4px; border-radius: 3px; font-size: 13px; }
.notes-editor-footer { display: flex; align-items: start; justify-content: space-between; gap: 16px; border-top: 1px solid var(--workspace-edge); padding-top: 12px; }
.notes-editor-footer p { margin: 0; }.notes-editor-footer > span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.notes-document-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.notes .notes-delete { color: var(--workspace-error); margin-left: auto; }
.notes-history { border-top: 1px solid var(--workspace-edge); padding-top: 12px; }
.notes-history ol { list-style: none; padding: 0; margin: 12px 0; }
.notes-history li { display: flex; gap: 16px; align-items: center; justify-content: space-between; border-top: 1px solid var(--workspace-edge); padding-block: 8px; font-size: 13px; }
.notes-history li span { min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.notes-history li span strong { display: block; font-weight: 600; }.notes-history li span small { color: var(--workspace-secondary); }
.notes-notice { max-width: 75ch; margin-top: 32px; border-top: 1px solid var(--workspace-edge); padding-top: 24px; }
.notes-notice a { color: inherit; text-underline-offset: 3px; }
.notes ::selection { background: var(--workspace-accent); color: var(--workspace-accent-ink); }
.notes, .notes * { scrollbar-color: var(--workspace-field-edge) transparent; }
@media (max-width: 1023px) { .notes-workspace { grid-template-columns: minmax(0, 1fr); gap: 24px; }.notes-writing { border-left: 0; padding-left: 0; }.notes-library ul { max-height: 220px; }.notes-library > .btn-solid { width: auto; }.notes-title-row { flex-wrap: wrap; }.notes-title-row > label { flex-basis: 100%; }.notes-save-row { width: 100%; justify-content: end; } }
@media (max-width: 768px) { .notes { padding: 24px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }.notes-heading { flex-direction: column; gap: 16px; }.notes-status-row { flex-wrap: wrap; }.notes-status-row > p { flex-basis: 100%; }.notes-editor { padding: 24px 0; }.notes-block-label { width: 100%; }.notes-block-label select { flex: 1; font-size: 16px; }.notes-editor-footer { flex-wrap: wrap; }.notes-document-actions > button { flex: 1 1 auto; }.notes .notes-delete { margin-left: 0; }.notes-history li { align-items: start; }.notes-source-offer > div { min-width: 0; flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { .notes button:not(:disabled):active { transform: none; } }

/* Literal tables share the same paper, ink and field geometry as prose. */
.notes-table-tools { display:flex; align-items:center; gap:4px; overflow-x:auto; max-width:100%; padding:4px 0; }
.notes-table-tools > * { flex-shrink:0; }
.notes #notesTableTools > .btn-outline { min-width:44px; min-height:44px; padding-inline:6px; white-space:nowrap; }
.notes-table-size { display:block; margin:0 0 4px; }
.notes-table-tools[hidden] + .notes-table-size { display:none; }
.notes-table-scroll { max-width:100%; overflow-x:auto; margin:16px 0; border:1px solid var(--workspace-field-edge); border-radius:8px; }
.notes-table-scroll:focus-visible { outline:2px solid var(--workspace-focus); outline-offset:3px; }
.notes-table { border-collapse:collapse; width:100%; table-layout:fixed; }
.notes-table-cell { border:1px solid var(--workspace-edge); padding:12px; min-width:120px; width:160px; height:48px; vertical-align:top; color:var(--workspace-ink); background:var(--workspace-surface); }
.notes-table-header { background:var(--workspace-soft); font-weight:700; }
.notes-table-cell > .notes-paragraph { margin:0; }
.notes-cell-selected { background:var(--workspace-selected); }
.notes-table-selection ::selection { background:transparent; }
@media(max-width:768px) { .notes-table { min-width:calc(var(--notes-table-columns, 3) * 140px); }.notes-table-cell { padding:10px; } }

/* A saved-version download does not disable or remount the editor. */
.notes-export-controls { display:flex; align-items:center; gap:8px; max-width:360px; }
.notes-export-controls select { flex:1; min-width:0; min-height:44px; height:44px; box-sizing:border-box; border:1px solid var(--workspace-field-edge); border-radius:8px; padding:8px 12px; color:var(--workspace-ink); background:var(--workspace-soft); font:500 14px/1.4 var(--sans); }
.notes #notesExport { min-width:104px; min-height:44px; }
.notes-export-status { min-height:20px; margin:8px 0 0; }
.notes-export-status[data-error="true"] { color:var(--workspace-error); }
.notes-create-controls { display:flex; flex-wrap:wrap; align-items:end; gap:8px; margin:12px 0; }
.notes-create-controls label { display:grid; gap:6px; flex:1 1 160px; min-width:0; font-size:13px; }
.notes #notesStarter { width:100%; min-width:0; height:44px; min-height:44px; box-sizing:border-box; border:1px solid var(--workspace-field-edge); border-radius:8px; padding:8px 10px; color:var(--workspace-ink); background:var(--workspace-soft); font:500 14px/1.4 var(--sans); }
.notes-create-controls #notesNew { flex:0 0 auto; margin:0; }
.notes #notesReturnDraft { width:100%; margin:0 0 12px; white-space:normal; overflow-wrap:anywhere; text-align:left; }
.document-note .notes-export-controls,.document-note #notesExportStatus { display:none; }
@media(max-width:768px) { .notes-export-controls select,.notes #notesStarter { font-size:16px; } }
