.notes-workspace { min-width: 0; }
.notes-columns { display: flex; min-width: 0; }
.notes-columns > *, .notes-heading > h2 { min-width: 0; }
.notes-heading, .notes-controls, .notes-list-meta, .notes-row-meta, .notes-search, .notes-sort {
  display: flex; align-items: center;
}
.notes-heading { justify-content: space-between; gap: var(--space-1); min-height: var(--size-control); }
.notes-heading h2 { margin: 0; font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; }
.notes-books, .notes-list { display: flex; flex: none; flex-direction: column; min-height: 0; }
.notes-books { width: var(--notes-books,var(--size-rail)); padding: var(--space-6) var(--space-2) 0 var(--space-4); gap: var(--space-3); }
.notes-books .notes-heading { padding-inline-start: var(--space-3); }
.notes-list { width: var(--notes-list,var(--size-list)); padding-top: var(--space-6); }
.notes-list .notes-heading { flex: none; padding: 0 var(--space-3) 0 var(--space-4); }
.notes-list h2, [data-notes-action="choose-book"] { min-width: 0; font: 650 1.25rem/1.625rem var(--font-sans); letter-spacing: -.02em; }
.notes-fixed-heading, [data-notes-action="choose-book"] { padding-inline: var(--space-2); }
.notes-fixed-heading, .notes-folder-label, .notes-folder-label > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-notes-action="choose-book"] { display: none; align-items: center; gap: var(--space-1); text-align: start; border-radius: var(--radius-sm); }
[data-notes-action="choose-book"] svg { flex: none; color: var(--muted); }
.notes-search-label, [data-searching] .notes-folder-label, [data-searching] [data-notes-action="book-actions"] { display: none; }
[data-searching] .notes-search-label { display: inline; }
.notes-controls { gap: var(--space-1); }
.notes-detail { flex: 1; padding: var(--space-6) var(--space-8); }
.notes-detail-head { display: flex; align-items: center; min-height: var(--size-control); padding-inline-end: var(--search-space); }
.notes-list-filter { flex: none; display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-3) var(--space-1) var(--space-4); }
.notes-search { height: var(--size-control); gap: var(--space-2); padding-inline: var(--space-3); border-radius: var(--radius-md); background: var(--soft); color: var(--muted); }
.notes-search:focus-within { background: var(--surface); outline: .125rem solid var(--accent); outline-offset: -.125rem; }
.notes-search input[type="search"] { flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0; border: 0; outline: 0; box-shadow: none; background: transparent; font: inherit; font-size: .875rem; }
.notes-search input::placeholder { color: var(--muted); opacity: 1; }
.notes-list-meta, .notes-sort, .notes-row-meta { font-size: .8125rem; line-height: 1.125rem; }
.notes-list-meta { justify-content: space-between; gap: var(--space-1); padding-inline-start: var(--space-2); min-height: var(--size-control-sm); color: var(--subtle); font-variant-numeric: tabular-nums; }
.notes-sort { gap: var(--space-1); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); color: var(--muted); }
.notes-sort:hover, [data-notes-action="choose-book"]:hover { background: var(--soft); }
.notes-list [data-notes-action="new-note"] { background: var(--accent); color: var(--on-accent); }
.notes-book-list, [data-notes-results] { display: grid; grid-template-columns: minmax(0,1fr); align-content: start; gap: .125rem; padding-bottom: var(--space-5); overflow-y: auto; }
[data-notes-results] { grid-auto-rows: max-content; padding-inline: var(--space-4) var(--space-3); }
.notes-split { position: relative; z-index: 1; flex: none; width: .0625rem; background: var(--line); cursor: col-resize; touch-action: none; user-select: none; }
.notes-split::before { position: absolute; content: ""; inset: 0 -.375rem; }
.notes-split::after { position: absolute; content: ""; inset: var(--space-6) -.0625rem; border-radius: var(--radius-full); }
.notes-split:is(:hover,:focus-visible,.dragging)::after { background: var(--accent); }
.notes-split:focus-visible { outline: none; }
[data-note-notice] { color: var(--muted); overflow-wrap: anywhere; }
.notes-book, .notes-row, .notes-back {
  display: flex; align-items: center; gap: var(--space-3); min-width: 0; min-height: 2.25rem;
  padding: var(--space-1) var(--space-3); border: 0; border-radius: var(--radius-sm);
  color: var(--muted); background: transparent; text-align: start; text-decoration: none;
}
.notes-book { font: 550 .875rem/1.25rem var(--font-sans); }
.notes-book > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-book > svg, .notes-row-meta > svg, .notes-row-meta time { flex: none; }
.notes-book small { margin-inline-start: auto; color: var(--subtle); font-variant-numeric: tabular-nums; }
.notes-book[aria-current], .notes-row[aria-current] { background: var(--accent-soft); }
.notes-book[aria-current], .notes-book[aria-current] small { color: var(--accent); }
.notes-row { display: grid; gap: .125rem; padding: .625rem var(--space-3); border-radius: var(--radius-md); }
.notes-row-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; font: 600 .875rem/1.25rem var(--font-sans); color: var(--ink); }
.notes-row-meta { min-width: 0; gap: .375rem; }
.notes-row-meta svg { fill: currentColor; color: var(--accent); }
.notes-excerpt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-row time, .notes-dates { color: var(--subtle); font-size: .8125rem; line-height: 1.4; }
:is([data-notes-action="favorite"],[data-notes-action="pin"])[aria-pressed="true"] { color: var(--accent); }
:is([data-notes-action="favorite"],[data-notes-action="pin"])[aria-pressed="true"] .icon { fill: currentColor; }
.notes-controls[hidden] { display: none; }
.notes-empty { margin-block: var(--space-4); color: var(--muted); }
.notes-dates { display: flex; align-items: start; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-5); }
.notes-dates dt { font-weight: 550; }
.notes-dates dd { margin: 0; }
[data-notes-text] { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.notes-back { display: none; color: var(--muted); }
@media (hover: hover) {
  .notes-workspace :is(.notes-book,.notes-row,.notes-back):not([aria-current]):hover { background: var(--soft); }
}
@media (min-width: 47.5rem) {
  .work-area:has(.notes-workspace) { --sheet-padding: var(--space-6); display: flex; flex-direction: column; height: calc(100dvh - 2 * var(--space-3)); }
  .work-area > #main:has(.notes-workspace) { flex: 1; min-height: 0; padding: 0; overflow: hidden; border-radius: var(--radius-xl); }
  .notes-workspace, .notes-columns { height: 100%; }
  .notes-page-title { position: absolute; width: .0625rem; height: .0625rem; margin: 0; overflow: hidden; clip-path: inset(50%); }
  .notes-detail { overflow: auto; }
  [data-books-hidden] > .notes-books, [data-books-hidden] > [data-notes-split=books], [data-books-hidden] .notes-fixed-heading { display: none; }
  [data-books-hidden] [data-notes-action="choose-book"] { display: inline-flex; max-width: 100%; }
}
.notes-workspace[data-one-column] .notes-columns { display: block; }
.notes-workspace[data-one-column] .notes-columns > *, [data-one-column] [data-notes-action="toggle-books"] { display: none; }
[data-one-column][data-level="books"] .notes-books, [data-one-column][data-level="list"] .notes-list, [data-one-column][data-level="note"] .notes-detail {
  display: block; width: 100%; height: 100%; overflow-y: auto;
}
[data-one-column] .notes-back { display: inline-flex; margin-block-end: var(--space-2); }
[data-one-column] [data-notes-action="choose-book"] { display: none; }
[data-one-column] .notes-fixed-heading { display: block; }
@media (forced-colors: active) {
  .notes-book[aria-current], .notes-row[aria-current] { outline: .0625rem solid Highlight; }
}

.note-editor { min-width: 0; border: .0625rem solid var(--control); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.note-editor:focus-within { outline: .125rem solid var(--accent); outline-offset: .125rem; }
.note-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1);
}
.note-toolbar { position: relative; padding: var(--space-1); background: var(--soft); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.note-toolbar[hidden] { display: none; }
.note-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
  min-height: var(--size-control-sm); min-width: var(--size-control-sm);
  padding: var(--space-1) var(--space-2); border: .0625rem solid transparent;
  border-radius: var(--radius-xs); background: transparent; color: var(--ink);
  font: inherit; font-size: .875rem; cursor: pointer;
}
.note-tool:disabled { color: var(--subtle); cursor: default; }
.note-writing { min-width: 0; overflow-x: auto; }
.note-writing .ProseMirror, .note-source {
  width: 100%; min-height: 12rem; box-sizing: border-box; margin: 0;
  padding: var(--space-3); color: var(--ink); background: var(--surface);
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; caret-color: var(--ink);
  border: 0; border-radius: var(--radius-sm); outline: 0;
}
.note-source { display: block; font-family: var(--font-mono); resize: vertical; }
.note-writing .ProseMirror { position: relative; font-size: var(--note-size-normal); font-variant-ligatures: none; }
.note-task { display: flex; align-items: start; }
.note-task > div { flex: 1; min-width: 0; }
.note-writing .ProseMirror-selectednode { outline: .125rem solid var(--accent); }
.note-writing .ProseMirror a { text-decoration: underline; color: var(--accent); }
.note-color-rot, .note-swatch.note-color-rot { color: var(--note-color-rot); }
.note-color-orange, .note-swatch.note-color-orange { color: var(--note-color-orange); }
.note-color-gelb, .note-swatch.note-color-gelb { color: var(--note-color-gelb); }
.note-color-gruen, .note-swatch.note-color-gruen { color: var(--note-color-gruen); }
.note-color-tuerkis, .note-swatch.note-color-tuerkis { color: var(--note-color-tuerkis); }
.note-color-blau, .note-swatch.note-color-blau { color: var(--note-color-blau); }
.note-color-violett, .note-swatch.note-color-violett { color: var(--note-color-violett); }
.note-color-grau, .note-swatch.note-color-grau { color: var(--note-color-grau); }
.note-highlight { background-color: var(--note-highlight); color: inherit; }
.note-size-klein { font-size: var(--note-size-klein); }
.note-size-normal { font-size: var(--note-size-normal); }
.note-size-gross { font-size: var(--note-size-gross); }
.note-size-sehr-gross { font-size: var(--note-size-sehr-gross); }
@media (hover:hover) {
  .note-tool:not(:disabled):hover { background: var(--hover); }
}
@media (max-width:47.5rem) {
  .note-tool { min-width: var(--size-control-lg); min-height: var(--size-control-lg); }
}
.note-writing img.ProseMirror-separator { display: inline; width: 0; height: 0; margin: 0; padding: 0; border: 0; }

.note-history-columns {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: start;
  gap: var(--space-4);
  margin-block: var(--space-4);
}
.note-history-list {
  display: grid;
  align-content: start;
  gap: .125rem;
  max-block-size: 9.5rem;
  overflow-y: auto;
}
.note-history-version {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  inline-size: 100%;
  min-block-size: var(--size-control-lg);
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  font: 550 .875rem/1.25rem var(--font-sans);
  font-variant-numeric: tabular-nums;
  text-align: start;
  cursor: pointer;
}
@media (hover:hover) { .note-history-version:hover { background: var(--soft); color: var(--ink); } }
.note-history-version[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.note-history-preview {
  margin: 0;
  padding: var(--space-4);
  min-block-size: 12.5rem;
  max-block-size: 20rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: var(--soft);
  border-radius: var(--radius-md);
  font: .8125rem/1.25rem var(--font-mono);
  word-spacing: normal;
}
.note-history-dialog [data-note-history-more] { margin-block-start: var(--space-2); }
.note-history-dialog [data-note-history-more][hidden] { display: none; }
.note-history-dialog [data-note-history-status]:not(:empty) { margin-block-start: var(--space-2); color: var(--muted); }
.note-dialog-field { display: grid; gap: var(--space-1); }
.note-dialog-counts {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--muted);
  font: 500 .875rem/1.25rem var(--font-sans);
}
.note-dialog-counts > div { display: flex; justify-content: space-between; gap: var(--space-4); }
.note-dialog-counts dd, .dialog-body:has(.note-dialog-counts) strong { color: var(--ink); font-weight: 650; }
.note-dialog-counts dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (min-width: 47.5rem) {
  #dialog.note-history-dialog { width: min(47.5rem,calc(100% - var(--space-6))); }
  .note-history-columns { grid-template-columns: 13.5rem minmax(0,1fr); }
  .note-history-list { max-block-size: 20rem; }
  .note-history-version { min-block-size: var(--size-control); }
}

.note-writing, [data-note-tool="em"] { font-synthesis: style; }
.note-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: .625rem var(--space-3);
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.25rem;
}
.note-notice[hidden] { display: none; }
.note-notice > svg { flex: none; margin-block-start: .0625rem; }
.note-notice > span { flex: 1; min-width: 0; }
.note-notice--warning { background: var(--warning-soft); color: var(--warning); }

/* The note title and body share one reading column, including the read-only copy. */
@media (width >= 47.5rem) {
  .notes-detail { padding: var(--space-6) 0 0; }
  .notes-detail .notes-detail-head { padding-inline: var(--space-5) calc(var(--search-space) + var(--sheet-padding)); }
}
.notes-detail .notes-detail-head { flex-wrap: nowrap; gap: var(--space-1); }
.notes-detail-head .icon-btn { width: var(--size-control-sm); height: var(--size-control-sm); min-width: var(--size-control-sm); min-height: var(--size-control-sm); }
.notes-detail-head .notes-controls { flex: none; flex-wrap: nowrap; margin-inline-start: auto; }
.note-book-button {
  display: inline-flex; align-items: center; gap: var(--space-2); min-inline-size: 0;
  min-block-size: var(--size-control-sm); padding: 0 var(--space-2); border: 0;
  border-radius: var(--radius-sm); color: var(--muted); background: transparent;
  font: 550 .8125rem/1.125rem var(--font-sans);
}
.note-book-button > svg { flex: none; }
.note-book-button > span { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.note-book-button:is(:hover,[aria-expanded="true"]) { color: var(--ink); background: var(--soft); }
.notes-detail-page { max-inline-size: calc(var(--size-content) + 4rem); margin-inline: auto; padding: var(--space-5) var(--space-8) var(--space-12); }
.notes-detail .note-title {
  display: block; inline-size: 100%; min-inline-size: 0; min-block-size: 2.125rem;
  margin: 0; padding: 0; border: 0; outline: 0; box-shadow: none; background: transparent;
  color: var(--ink); font: 650 1.75rem/2.125rem var(--font-sans); letter-spacing: -.025em;
  resize: none; overflow: hidden; overflow-wrap: anywhere; field-sizing: content;
}
.notes-detail .note-title:focus-visible { outline: 0; }
.notes-detail .note-title::placeholder { color: var(--subtle); opacity: 1; }
.notes-detail .notes-dates {
  display: flex; flex-wrap: wrap; gap: 0 var(--space-4); margin: .375rem 0 0;
  font: 400 .8125rem/1.125rem var(--font-sans); font-variant-numeric: tabular-nums; color: var(--subtle);
}
.notes-dates div { display: flex; gap: var(--space-1); }
.notes-dates dt, .notes-dates dd { margin: 0; font-weight: inherit; }
.notes-detail-page .note-notice { margin-block: var(--space-4) 0; }
.notes-detail-page [data-notes-text] { margin-block-start: var(--space-5); }
.notes-detail > .notes-empty { display: grid; min-height: calc(100% - 5rem); place-items: center; }
.note-document-editor { min-inline-size: 0; color: var(--ink); }
.note-writing :is(.ProseMirror,.note-trash-document) {
  min-inline-size: 0; padding: 0; font-size: var(--note-size-normal); line-height: 1.625;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); background: var(--surface); outline: 0;
}
.note-writing :is(.ProseMirror,.note-trash-document) > * { margin: 0; }
.note-writing :is(.ProseMirror,.note-trash-document) > * + * { margin-block-start: var(--space-3); }
.note-writing :is(.ProseMirror,.note-trash-document) :is(h1,h2) { margin-block: var(--space-8) 0; }
.note-writing :is(.ProseMirror,.note-trash-document) h1 { font-size: var(--note-size-sehr-gross); line-height: 2rem; font-weight: 650; letter-spacing: -.02em; }
.note-writing :is(.ProseMirror,.note-trash-document) h2 { font-size: var(--note-size-gross); line-height: 1.75rem; font-weight: 600; letter-spacing: -.015em; }
.note-writing :is(.ProseMirror,.note-trash-document) :is(h1,h2) + * { margin-block-start: var(--space-2); }
.note-writing :is(.ProseMirror,.note-trash-document) > :first-child { margin-block-start: 0; }
.note-writing :is(.ProseMirror,.note-trash-document) :is(ul,ol) { padding-inline-start: 1.625rem; }
.note-writing li::marker { color: var(--subtle); }
.note-writing li + li, .note-writing li :is(ul,ol) { margin-block-start: var(--space-1); }
.note-writing :is(.ProseMirror,.note-trash-document) [data-note-tasks] { padding-inline-start: 0; list-style: none; }
.note-writing li p { margin: 0; }
.note-task { gap: var(--space-3); }
.note-task:has(> label input:checked) > div > p { color: var(--muted); }
.note-check-target { display: flex; align-items: flex-start; flex: none; cursor: pointer; }
.note-writing .note-check-target > input {
  appearance: none; flex: none; position: relative; inline-size: 1.25rem; block-size: 1.25rem;
  min-inline-size: 0; min-block-size: 0; margin: .1875rem 0 0; padding: 0;
  border: .09375rem solid var(--control); border-radius: var(--radius-full); background: var(--surface); cursor: inherit;
}
.note-writing .note-check-target > input:checked { background: var(--accent); border-color: var(--accent); }
.note-check-target input:checked::before {
  content: ''; position: absolute; left: 50%; top: 44%; width: .5625rem; height: .3125rem;
  border: solid var(--on-accent); border-width: 0 0 .125rem .125rem; transform: translate(-50%,-50%) rotate(-45deg);
}
.note-writing table { border-collapse: separate; border-spacing: 0; inline-size: 100%; table-layout: fixed; }
.note-writing tr > :is(td,th) { padding: var(--space-2) var(--space-3); border: solid var(--line); border-width: 0 .0625rem .0625rem 0; vertical-align: top; text-align: start; }
.note-writing tr > :first-child { border-inline-start-width: .0625rem; }
.note-writing tr:first-child > * { border-block-start-width: .0625rem; background: var(--soft); font-weight: 600; }
.note-writing tr:first-child > :first-child { border-start-start-radius: var(--radius-sm); }
.note-writing tr:first-child > :last-child { border-start-end-radius: var(--radius-sm); }
.note-writing tr:last-child > :first-child { border-end-start-radius: var(--radius-sm); }
.note-writing tr:last-child > :last-child { border-end-end-radius: var(--radius-sm); }
.note-writing .note-highlight { padding: .0625rem .125rem; border-radius: .25rem; box-decoration-break: clone; }
@media (width < 47.5rem) {
  .notes-detail-page { padding: var(--space-4) 0 var(--space-8); }
  .note-check-target { min-block-size: var(--size-control-lg); }
}
@media (forced-colors: active) {
  .note-writing .note-check-target > input { appearance: auto; }
  .note-check-target input::before { display: none; }
}

@media (width >= 47.5rem) {
  .work-area:has([data-tight-note]) { --search-space: calc(var(--size-control) + var(--space-2)); }
  .work-area:has([data-tight-note]) .topbar .search-control {
    width: var(--size-control); padding: 0; justify-content: center;
  }
  .work-area:has([data-tight-note]) .search-control :is(span,kbd) { display: none; }
}

.note-document-editor { container: note-editor / inline-size; }
.note-document-editor .note-toolbar {
  position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: nowrap; align-items: center;
  inline-size: 100%; gap: .125rem; padding: var(--space-1); border: 0; border-radius: var(--radius-md);
  background: var(--soft); outline: var(--space-2) solid var(--surface); white-space: normal;
}
.note-document-editor [hidden] { display: none !important; }
.note-document-editor .note-toolbar > .note-tool {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: .125rem;
  inline-size: var(--size-control-sm); block-size: var(--size-control-sm); min-width: 0; min-height: 0;
  padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted);
  font: 600 .9375rem/1.25rem var(--font-sans); cursor: pointer;
}
.note-document-editor .note-toolbar > [data-note-tool="block"] {
  justify-content: space-between; width: auto; max-width: 8rem; padding: 0 .375rem;
  font-size: .8125rem; font-weight: 550;
}
.note-toolbar > [data-note-tool="block"] > span { min-width: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.note-toolbar > [data-note-tool="block"] svg { flex: none; inline-size: .75rem; }
.note-document-editor .note-toolbar svg { inline-size: var(--size-icon); block-size: var(--size-icon); }
.note-document-editor .note-toolbar > [data-note-tool="strong"] { font-weight: 750; }
.note-document-editor .note-toolbar > [data-note-tool="em"] { font-style: italic; }
.note-document-editor .note-toolbar > [data-note-tool="strike"] { text-decoration: line-through; }
.note-document-editor .note-toolbar > .note-tool:is([aria-pressed="true"],[aria-expanded="true"]) {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-raised);
}
.note-document-editor .note-toolbar > .note-tool:disabled { opacity: .45; cursor: default; box-shadow: none; }
.note-letter-color { border-bottom: .1875rem solid var(--accent); }
.note-tool-separator { height: 1rem; flex: 0 0 .0625rem; margin-inline: .125rem; background: var(--line); }
.note-tool-spacer { flex: 1; }
.note-document-editor .note-toolbar > :is([data-density=compact],[data-density=touch]) { display: none; }
@container note-editor (width < 38.5rem) {
  .note-document-editor .note-toolbar > [data-density=wide] { display: none; }
  .note-document-editor .note-toolbar > [data-density=compact] { display: inline-flex; }
}
@container note-editor (width < 26rem) {
  .note-document-editor .note-toolbar { gap: 0; }
  .note-document-editor .note-toolbar > .note-tool { flex-shrink: 1; }
  .note-tool-separator { margin: 0; }
}
@media (width < 47.5rem) {
  .note-document-editor .note-toolbar { gap: 0; }
  .note-document-editor .note-toolbar > .note-tool { flex: 1 1 0; width: 0; height: var(--size-control-lg); }
  .note-document-editor .note-toolbar > :is([data-density=desktop],[data-density=wide],.note-tool-spacer,.note-tool-separator) { display: none; }
  .note-document-editor .note-toolbar > :is([data-density=touch],[data-density=compact]) { display: inline-flex; }
}
@media (hover:hover) {
  .note-document-editor .note-toolbar > .note-tool:not(:disabled):hover { background: var(--hover); color: var(--ink); }
}
.note-document-editor .note-writing { margin-block-start: var(--space-5); }
.note-link-form {
  position: absolute; inset: calc(100% + var(--space-1)) 0 auto auto; z-index: 3;
  display: grid; gap: var(--space-3); inline-size: min(20rem,100%); max-block-size: 60dvh; overflow: auto;
  padding: var(--space-4); border-radius: var(--radius-lg); color: var(--ink); background: var(--surface); box-shadow: var(--shadow-float);
}
.note-link-form label { display: grid; gap: var(--space-1); color: var(--muted); font: 550 .8125rem/1.25 var(--font-sans); }
.note-link-form input { inline-size: 100%; min-inline-size: 0; }
.note-link-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: var(--space-2); }
.note-toolbar .note-link-actions .btn { min-height: var(--size-control); padding: 0 var(--space-3); }
.note-toolbar .note-link-actions .btn.primary { background: var(--accent); color: var(--on-accent); }
.note-document-editor .note-mode-hint { margin-block: var(--space-3); }
.note-mode-hint > .note-message { flex: 1; }
.note-mode-hint .note-tool { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); white-space: normal; }
.note-mode-hint:has(button) { flex-wrap: wrap; }
.note-document-editor .note-source {
  display: block; width: 100%; min-height: 12rem; padding: var(--space-4); border: 0;
  border-radius: var(--radius-md); color: var(--ink); background: var(--soft);
  font: .875rem/1.375rem var(--font-mono); word-spacing: 0; resize: vertical;
}
.note-document-editor .note-source:focus { background: var(--surface); outline: .125rem solid var(--accent); outline-offset: -.125rem; }
.task-action-menu [role=menu]:has(.note-swatch) { max-inline-size: 22rem; }
.task-action-menu button.note-swatch {
  position: relative; display: inline-flex; justify-content: center; vertical-align: middle;
  inline-size: var(--size-control-sm); min-height: var(--size-control-sm); padding: 0;
  border-radius: var(--radius-full); font-weight: 650;
}
.note-swatch > span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
.note-swatch::before { content: 'A'; }
.task-action-menu .note-swatch > svg { display: none; }
.task-action-menu .note-swatch[aria-checked=true] { outline: .125rem solid var(--accent); outline-offset: -.125rem; }
.task-action-menu .note-size-choice { font-size: inherit; }
.task-action-menu .note-size-klein { font-size: var(--note-size-klein); }
.task-action-menu .note-size-normal { font-size: var(--note-size-normal); }
.task-action-menu .note-size-gross { font-size: var(--note-size-gross); }
.task-action-menu .note-size-sehr-gross { font-size: var(--note-size-sehr-gross); }
@media (width < 47.5rem) {
  .task-action-menu .note-swatch { inline-size: var(--size-control-lg); min-height: var(--size-control-lg); }
}

.note-document-editor .note-toolbar [data-note-tool=attach] > span { display: none; }

/* Books, list and note use the same navigation levels on a narrow sheet. */
.notes-page-head { display: contents; }
.notes-page-head [data-notes-action=new-from-books], .notes-detail-head .notes-controls > [data-notes-action=more-note], .notes-create-book > span { display: none; }
@media (width >= 47.5rem) {
  .notes-columns:not([data-books-hidden]) .notes-books {
    display: grid; grid-template: auto minmax(0,1fr) / minmax(0,1fr) auto;
    align-items: start; column-gap: var(--space-1);
  }
  .notes-books .notes-heading { grid-area: 1 / 1; }
  .notes-books .notes-create-book { grid-area: 1 / 2; align-self: center; }
  .notes-books .notes-book-list { grid-area: 2 / 1 / 3 / -1; max-height: 100%; }
}
[data-one-column] .notes-page-head { display: flex; align-items: center; justify-content: space-between; min-width: 0; }
[data-one-column]:not([data-level=books]) .notes-page-title {
  position: absolute; width: .0625rem; height: .0625rem; margin: 0; overflow: hidden; clip-path: inset(50%);
}
[data-one-column][data-level=books] .notes-page-title { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; }
[data-one-column][data-level=books] .notes-page-head { margin-block-end: var(--space-4); }
[data-one-column][data-level=books] [data-notes-action=new-from-books] { display: inline-flex; }
[data-one-column] [data-notes-action=new-from-books], [data-one-column] [data-notes-action=new-note] {
  width: var(--size-control-lg); height: var(--size-control-lg); color: var(--on-accent); background: var(--accent);
}
[data-one-column][data-level=books] .notes-books, [data-one-column][data-level=list] .notes-list,
[data-one-column][data-level=note] .notes-detail { padding: 0; }
[data-one-column] .notes-books .notes-heading { display: none; }
[data-one-column] .notes-book-list { padding-bottom: 0; }
[data-one-column] .notes-book, [data-one-column] .notes-create-book {
  min-height: var(--size-control-lg); gap: var(--space-3); font-size: .9375rem;
}
[data-one-column] .notes-create-book {
  display: inline-flex; justify-content: start; width: 100%; padding-inline: var(--space-3); color: var(--subtle);
}
[data-one-column] .notes-create-book > span { display: inline; }
[data-one-column] .notes-list .notes-heading { padding-inline: 0; gap: var(--space-2); }
[data-one-column] .notes-fixed-heading { padding: 0; }
[data-one-column] .notes-list h2 { font-size: 1.5rem; line-height: 1.875rem; }
[data-one-column] .notes-list-filter { padding: var(--space-3) 0 var(--space-1); }
[data-one-column] .notes-search { height: var(--size-control-lg); }
[data-one-column] :is(.notes-sort,.notes-back,.btn,.icon-btn) { min-height: var(--size-control-lg); }
[data-one-column] .icon-btn { min-width: var(--size-control-lg); }
[data-one-column] [data-notes-results] { padding-inline: 0; }
[data-one-column] .notes-row { grid-template-columns: minmax(0,1fr) auto; align-items: baseline; gap: var(--space-3); min-height: var(--size-control-lg); padding: .8125rem var(--space-3); }
[data-one-column] .notes-row-title { font-size: .9375rem; line-height: 1.375rem; }
[data-one-column] .notes-excerpt { display: none; }
[data-one-column] .notes-detail .notes-detail-head { padding: 0; }
[data-one-column] .notes-detail-head .note-book-button { display: none; }
[data-one-column] .notes-detail-head .notes-controls > [data-notes-action=more-note] { display: inline-flex; }
[data-one-column] .notes-detail-head .notes-controls > :not([data-notes-action=favorite],[data-notes-action=more-note],[data-notes-action=restore-note]) { display: none; }
[data-one-column] .notes-detail-head .icon-btn { width: var(--size-control-lg); height: var(--size-control-lg); }
[data-one-column] .notes-detail-head .notes-back { flex: 0 1 auto; min-width: 0; margin: 0; padding-inline: 0 var(--space-2); }
[data-one-column] .notes-back svg { flex: none; }
[data-one-column] [data-note-back-label] { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
[data-one-column] .notes-detail-page { padding: var(--space-4) 0 var(--space-6); }
[data-one-column] .notes-detail .note-title { font-size: 1.5rem; line-height: 1.875rem; }
[data-one-column] .note-check-target { min-height: var(--size-control-lg); }
.work-area:has(.notes-workspace[data-one-column][data-level=books]) .topbar { right: calc(var(--sheet-padding) + var(--size-control-lg) + var(--space-2)); }
.work-area:has(.notes-workspace[data-one-column]:not([data-level=books])) .topbar { display: none; }
@media (width >= 47.5rem) {
  .notes-workspace[data-one-column] { display: flex; flex-direction: column; }
  [data-one-column] .notes-page-head { margin: var(--sheet-padding) var(--sheet-padding) var(--space-4); }
  [data-one-column]:not([data-level=books]) .notes-page-head { margin: 0; }
  [data-one-column] .notes-columns { flex: 1; min-height: 0; }
  [data-one-column][data-level=books] .notes-books, [data-one-column][data-level=list] .notes-list,
  [data-one-column][data-level=note] .notes-detail { padding-inline: var(--sheet-padding); }
}
@media (width < 47.5rem) {
  [data-one-column][data-level=books] .notes-books, [data-one-column][data-level=list] .notes-list,
  [data-one-column][data-level=note] .notes-detail { height: auto; overflow: visible; }
}
