/* Standalone Notes shell. The console keeps its own workspace layout. */
html, body[data-app=notes] { height: 100%; }
#notes-shell {
  --sidebar-width: 288px;
  display: flex;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
}
#notes-sidebar {
  display: flex;
  flex: 0 0 var(--sidebar-width); width: var(--sidebar-width); max-width: var(--sidebar-width); min-width: 0; overflow: hidden;
  flex-direction: column;
  min-height: 0;
  background: var(--rail);
  border-inline-end: 1px solid var(--line);
}
.notes-collapsed-rail {
  flex: 0 0 52px; width: 52px; display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 9px 8px; background: var(--rail); border-inline-end: 1px solid var(--line);
}
.notes-collapsed-rail[hidden] { display: none; }
#notes-sidebar, #notes-content, #notes-inspector { contain: layout style; }
#notes-resizer {
  position: relative; z-index: 4; flex: none; width: 6px; margin-inline: -3px;
  cursor: col-resize; touch-action: none; outline: none;
}
#notes-resizer::after {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 2px; width: 2px;
  background: transparent;
}
#notes-resizer:hover::after { background: var(--line-mid); }
#notes-resizer:focus-visible::after, .is-resizing #notes-resizer::after { background: var(--ink-strong); }
#notes-shell.is-resizing { user-select: none; cursor: col-resize; }
#notes-shell.is-resizing #notes-sidebar { transition: none; }
.sidebar-closed #notes-resizer { display: none; }
@media (prefers-reduced-motion: no-preference) {
  #notes-resizer::after { transition: background-color 120ms ease; }
}
.notes-brand, #notes-toolbar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 0 0 48px;
  padding-inline: 14px;
  border-bottom: 1px solid var(--line);
}
.notes-brand strong { font: 600 1.14rem/1 var(--sans); }

#notes-hide { margin-inline-start: auto; }
#notes-hide, #notes-show, #notes-inspect {
  color: var(--muted); background: transparent; border: 0; border-radius: var(--radius-sm);
}
#notes-hide:hover, #notes-show:hover, #notes-inspect:hover, #notes-inspect[aria-expanded=true] {
  color: var(--ink); background: var(--hover);
}
#notes-library {
  display: flex; flex: 1; flex-direction: column; min-height: 0; max-height: none;
  position: static; width: auto; padding: 12px; overflow: hidden; border: 0; box-shadow: none;
}
.notes-search, .notes-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
.notes-search-field {
  height: 34px; display: flex; align-items: center; flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); box-shadow: var(--shadow-xs);
}
.notes-search-field:focus-within { border-color: var(--focus); box-shadow: var(--focus-ring); }
#notes-library .notes-search-field input { min-width: 0; flex: 1; border: 0; outline: 0; box-shadow: none; background: transparent; }
.notes-shortcut {
  flex: none; margin-inline-end: 5px; padding: 1px 4px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--muted); background: var(--rail); font: 11px/1.5 var(--mono);
}
#notes-shell .btn, #notes-toolbar button, #notes-hide { padding: 4px 8px; min-height: 32px; font-size: .8rem; white-space: nowrap; }
.ui-ic { width: 16px; height: 16px; flex: none; align-self: center; vertical-align: middle; }
.notes-search-field > .ui-ic { margin-inline-start: 7px; color: var(--muted); width: 14px; }
#notes-library .notes-search-field input { padding-inline: 4px; font-size: .8rem; }
.notes-filter-toggle, .ws-icon-button, .ws-folder-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 0; background: transparent; color: var(--muted); border-radius: var(--radius-sm); font: inherit;
}
.notes-filter-toggle { padding: 0 8px; height: 34px; flex: none; border: 1px solid transparent; font-size: .76rem; }
.ws-icon-button { width: 30px; height: 30px; flex: none; padding: 0; }
:is(.notes-filter-toggle, .ws-icon-button):is(:hover,:focus-visible), .notes-filter-toggle[aria-expanded=true] {
  color: var(--ink); background: var(--hover);
}
#notes-library .notes-actions { padding-block: 8px; }
.notes-create-split {
  flex: 1; min-width: 0; display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); box-shadow: var(--shadow-xs);
}
.notes-create-main, .notes-create-more {
  height: 32px; display: inline-flex; align-items: center; border: 0; background: transparent;
}
.notes-create-main { flex: 1; gap: 7px; padding: 0 10px; color: var(--ink); font: 500 .82rem var(--sans); border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.notes-create-more { flex: none; width: 30px; justify-content: center; padding: 0; color: var(--muted); border-inline-start: 1px solid var(--line); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.notes-create-split button:is(:hover,:focus-visible), .notes-create-more[aria-expanded=true] { background: var(--hover); }
#notes-filters { padding-bottom: 8px; }
.ws-filter-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: 100%; }
.ws-filter-trigger {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; height: 26px; padding: 0 7px 0 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--muted); font: 400 12px/1 var(--sans);
}
.ws-filter-trigger.is-active { color: var(--ink); border-color: var(--line-strong); background: var(--subtle); font-weight: 500; }
.ws-filter-trigger:hover, .ws-filter-clear:hover, .ws-command-esc:hover { background: var(--hover); }
.ws-filter-trigger-label, .ws-filter-option-label, .ws-command-title, .ws-command-meta {
  min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.ws-filter-trigger .ws-filter-caret { width: 12px; height: 12px; }
.ws-filter-clear, .ws-command-esc { border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font: 12px var(--sans); padding: 4px 6px; }
.ws-tree { --tree-guide: var(--line); flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 3px 2px 1rem; font-size: .82rem; }
#notes-library, .ws-tree, .ws-tree-group, .ws-folder, .ws-folder-inner, .ws-row { min-width: 0; max-width: 100%; }
.ws-tree:hover { --tree-guide: var(--line-strong); }
.ws-tree-group + .ws-tree-group, .ws-tree > .ws-section-head { margin-top: 20px; }
.ws-section-head, .ws-section-head h3 {
  margin: 0; font: 500 12px/1.5 var(--sans); text-transform: none; letter-spacing: 0; color: var(--muted);
}
.ws-section-head { display: flex; align-items: center; gap: 8px; min-height: 30px; padding-inline: 8px; }
.ws-section-head .ws-pin { width: 13px; height: 13px; }
.seed-mark { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--brand-crimson); }
.ws-row, .ws-folder-toggle { display: flex; align-items: center; width: 100%; min-width: 0; gap: 8px; text-align: start; }
.ws-row {
  position: relative; min-height: 34px; padding: 6px 8px; border: 0; border-radius: var(--radius-sm);
  color: var(--ink); font-size: .84rem; line-height: 1.4;
}
.ws-row:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
.ws-row-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ws-row.ws-note { height: auto; align-items: flex-start; }
.ws-row.ws-note > .ui-ic { align-self: flex-start; margin-top: 2px; }
.ws-row.ws-note .ws-row-label {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  white-space: normal; overflow: hidden; overflow-wrap: anywhere;
}
.ws-folder-row { padding: 0; }
.ws-folder-toggle { flex: 1; justify-content: start; min-height: 34px; padding: 6px 8px; color: inherit; }
.ws-row .ui-ic { color: var(--muted); }
.ws-chev { width: 12px; height: 12px; }
[data-open=true] > .ws-row .ws-chev { transform: rotate(90deg); }
.ws-teammates { margin-top: 6px; }
.ws-folder-children > .ws-folder-inner { margin-left: 17px; padding-left: 8px; border-left: 1px solid var(--tree-guide); }
.ws-count {
  flex: none; padding-inline: 5px; color: var(--muted); background: var(--subtle);
  border-radius: 8px; font: 500 10px/16px var(--sans); font-variant-numeric: tabular-nums;
}
.ws-avatar {
  display: grid; place-items: center; flex: none; height: 18px; width: 18px; border-radius: 50%;
  background: var(--active-bg); color: var(--ink-strong); font-size: 10px; text-transform: uppercase;
}
.ws-row-actions { gap: 2px; padding-inline-start: 4px; display: inline-flex; align-items: center; margin-inline-start: auto; }
.ws-row-actions .ws-icon-button { width: 23px; height: 24px; }
.ws-row-act:is(:hover,:focus-visible) { background: var(--active-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ws-row-act:is(:hover,:focus-visible) .ui-ic { color: inherit; }
.ws-row-actions .ui-ic { width: 14px; }
@media (hover: hover) {
  .ws-row-actions { opacity: 0; pointer-events: none; }
  .ws-row > .ws-row-actions { position: absolute; inset-inline-end: 4px; background: var(--hover); border-radius: var(--radius-sm); }
  :is(.ws-row,.ws-section-head):is(:hover,:focus-within) > .ws-row-actions { opacity: 1; pointer-events: auto; }
  .ws-folder-row.has-actions:is(:hover,:focus-within) :is(.ws-count,.ws-chev) { visibility: hidden; }
  .ws-folder-row:focus-within { background: var(--hover); }
  .ws-folder-row.has-two-actions .ws-row-label { max-width: calc(100% - 82px); margin-inline-end: auto; }
}
.ws-row.ws-note.current { background: var(--active-bg); color: var(--ink); font-weight: 500; border: 0; box-shadow: none; }
.ws-row.ws-note.current > .ui-ic { color: var(--ink); }
.ws-row:focus-visible, .ws-folder-toggle:focus-visible, .ws-folder-inner :focus-visible { outline-offset: -2px; }
.ws-empty { margin: 0; padding: 5px 7px; color: var(--muted); font-size: .77rem; font-style: italic; }
.ws-option-path { overflow-wrap: break-word; }
.ws-north-star {
  display: flex; align-items: center; gap: 8px; max-width: 720px; margin: 0 auto 18px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--rail);
}
.ws-north-copy { flex: 1; min-width: 0; font-size: .8rem; }
.ws-north-copy p {
  margin: 2px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; overflow-wrap: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .ws-chev { transition: transform 170ms cubic-bezier(.2,0,0,1), color 130ms ease; }
  .ws-row { transition: transform 120ms ease; }
  .ws-row:active { transform: scale(.985); }
  .ws-folder-inner { transition: border-color 150ms ease; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .ws-row-actions { transform: translateX(3px); transition: opacity 140ms ease, transform 140ms ease; }
  :is(.ws-row,.ws-section-head):is(:hover,:focus-within) > .ws-row-actions { transform: translateX(0); }
}
#notes-footer { padding: 8px 10px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.notes-brand-link { display: inline-flex; align-items: center; padding: 3px; margin-inline-start: -3px; border-radius: var(--radius-sm); }
.notes-brand-link:hover, .notes-pref-pill:hover, .notes-pref-pill[aria-expanded=true] { background: var(--hover); }
.notes-prefs-strip, #session-controls.notes-user-strip, .notes-user-actions { display: flex; align-items: center; gap: 4px; }
.notes-prefs-strip { min-height: 30px; }
.notes-pref-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px;
  border: 0; border-radius: var(--radius-sm); color: var(--muted); background: transparent; font: 500 12px var(--sans);
}
.notes-style-trigger, .notes-user-actions { margin-inline-start: auto; }
.notes-style-trigger .ui-ic { width: 12px; height: 12px; }
#session-controls.notes-user-strip {
  flex-wrap: nowrap; justify-content: start; gap: 6px; padding: 6px 0 0; margin-top: 6px;
  border-top: 1px solid var(--line); color: var(--ink); font: 500 0.8125rem/1.3 var(--sans);
}
#notes-user-avatar { width: 22px; height: 22px; }
#session-member { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.notes-user-actions { gap: 2px; }
.notes-user-actions .ws-icon-button, .notes-pref-btn { width: 26px; height: 26px; }
.notes-user-actions #signout { color: var(--muted); }
.notes-user-actions #signout:hover { color: var(--red-text); background: var(--red-bg); }
#notes-main {
  display: flex; flex: 1; flex-direction: column; min-width: 0; max-width: none;
  min-height: 0; margin: 0; padding: 0;
}
#notes-main:focus { outline: none; }
#notes-toolbar { min-width: 0; white-space: nowrap; overflow-x: auto; }
#notes-path { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow: hidden; font-size: 12.5px; color: var(--muted); }
.ws-crumb-loc, .ws-crumb-cur { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-crumb-loc { flex: none; max-width: 50%; }
.ws-crumb-sep { width: 12px; height: 12px; opacity: .6; }
.ws-crumb-cur { min-width: 0; color: var(--ink); font-weight: 500; }
.ws-inspector-path { overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
#notes-inspect, .notes-saved { display: inline-flex; align-items: center; gap: 4px; }
.notes-saved { color: var(--muted); font-size: 12px; }
.notes-saved > .ui-ic { width: 13px; height: 13px; }
@media (max-width: 640px) {
  .ws-crumb-loc, .ws-crumb-sep { display: none; }
  #notes-path:not(:empty) { min-width: 8ch; }
}
#notes-toolbar .ws-modes { flex-wrap: nowrap; margin: 0; }
#notes-show, .sidebar-closed #notes-sidebar { display: none; }
#notes-content { background: var(--paper); min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; }
.notes-document { padding: 36px 48px; }
.notes-document .ws-canvas { width: 100%; max-width: 720px; }
.notes-document .ws-title { padding: 0; border: 0; box-shadow: none; font-size: 30px; }
.ws-preview { padding-top: 4px; }
.ws-title-display { font: 600 30px/1.28 var(--sans); letter-spacing: -.03em; color: var(--ink); margin: 0; overflow-wrap: break-word; }
.notes-document .ws-edit .cm-editor { border: 0; }
.notes-document .ws-edit .cm-content { padding: .8rem 0; }
.notes-document .ws-edit .cm-editor.cm-focused { outline: none; }
/* The full-page editor and floating composer share this compact formatting rail. */
.ws-editor-bar {
  display: inline-flex; align-items: center; flex-wrap: wrap; align-self: flex-start; gap: 2px; padding: 3px 4px;
  background: var(--rail); border: 1px solid var(--line); border-radius: var(--radius-md); margin-block: 8px 14px;
}
.ws-format-tool {
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
}
.ws-format-tool { width: 28px; height: 28px; padding: 0; }
.ws-format-tool:is(:hover,:focus-visible) { background: var(--hover); }
.ws-format-tool[aria-pressed=true] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-xs); border-color: var(--line); }
.ws-bar-sep { width: 1px; height: 16px; margin-inline: 3px; background: var(--line-strong); }

.ws-modal-head h2 { flex: none; margin: 0; font-size: 1rem; }
.ws-destination { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ws-modal-body { display: flex; flex-direction: column; }
dialog.ws-modal-large input.ws-composer-title {
  width: 100%; padding: 6px 0 10px; outline: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent;
  color: var(--ink); font: 600 26px/1.35 var(--sans); letter-spacing: -.03em;
}
dialog.ws-modal-large input.ws-composer-title:is(:focus, :focus-visible) { outline: none; box-shadow: none; border-bottom-color: var(--line-strong); }
.ws-composer-edit { flex: 1; min-height: 6rem; }
.ws-composer-edit .cm-editor { height: 100%; border: 0; background: transparent; }
.ws-composer-edit .cm-editor.cm-focused { outline: none; }
.ws-composer-edit .cm-content { padding: .6rem 0; }
.ws-composer-edit .cm-scroller { overflow: auto; }
.ws-compose-status { margin-inline-end: auto; font-size: .82rem; }

/* A folding description list keeps metadata inside the document's reading measure. */
.ws-props-card {
  flex: none; min-width: 0; margin: 12px 0 22px; overflow: hidden;
  background: var(--rail); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.ws-props-head {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 34px; padding: 0 12px;
  border: 0; background: transparent; color: var(--ink); text-align: start;
  font: 500 11.5px/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase;
}
.ws-props-head:hover { background: var(--hover); }
.ws-props-head:focus-visible { outline-offset: -2px; }
.ws-props-summary { margin-inline-start: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); text-transform: none; letter-spacing: normal; }
.ws-props-head .ws-chev { width: 12px; height: 12px; }
.ws-props-card[data-open=true] .ws-chev { transform: rotate(90deg); }
.ws-props-body { display: block; }
.ws-props-grid { margin: 0; }
.ws-prop-row {
  display: grid; grid-template-columns: 120px minmax(0,1fr); align-items: center; gap: 12px;
  min-height: 34px; padding: 5px 12px; border-top: 1px solid var(--line);
}
.ws-prop-row dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.ws-prop-row .ui-ic { width: 13px; height: 13px; }
.ws-prop-row dd { min-width: 0; margin: 0; font-size: 12.5px; overflow-wrap: break-word; }
.ws-prop-row time { font-variant-numeric: tabular-nums; }
.ws-term-list, .ws-prop-row .ws-meta-pill { min-width: 0; max-width: 100%; }
.ws-prop-row .ws-meta-pill { min-height: 21px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); }
.ws-prop-row .ws-signal-digested { color: var(--green-text); background: var(--green-bg); border-color: transparent; }
.ws-prop-row :is(.ws-signal-pending,.ws-signal-unlinked) { color: var(--muted); }
.ws-prop-row .ws-signal-central { border-color: var(--line-strong); font-weight: 500; }
.ws-prop-row .ws-connected:is(:hover,:focus-visible) { background: var(--hover); }
.ws-prop-row dd, .ws-term-list, .ws-att-head, .ws-att-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
}
.ws-meta-pill, .ws-stage, .ws-term-input, .ws-att-status {
  display: inline-flex; align-items: center; gap: 3px; padding: 0 7px; min-height: 24px; border-radius: var(--radius-sm);
  background: var(--rail); font-size: 12px; overflow-wrap: break-word;
}
.ws-stage { padding: 2px; background: var(--paper); border: 1px solid var(--line); }
.ws-stage-option, .ws-remove {
  background: transparent; color: var(--muted); border: 0; border-radius: 4px; font: inherit;
}
.ws-stage-option { height: 22px; padding-inline: 8px; }
.ws-stage-option[aria-pressed=true] { background: var(--subtle); color: var(--ink); font-weight: 500; box-shadow: none; }
.ws-prop-row dd { gap: 6px 8px; }
.ws-term-list:empty { display: none; }
.ws-term-input { width: 7.5rem; height: 24px; padding: 0 6px; border: 0; background: transparent; box-shadow: none; font-size: 12.5px; }
.ws-term-list:empty + .ws-term-input { margin-inline-start: -6px; }
@media (min-width: 721px) {
  .ws-prop-row dd > .ws-meta-pill:first-child,
  .ws-prop-row .ws-term-list:first-child > .ws-meta-pill:first-child { margin-inline-start: -7px; }
  .ws-prop-row .ws-stage { margin-inline-start: -10px; }
}
.ws-term-input:is(:hover,:focus-visible) { background: var(--hover); }
@media (hover:hover) {
  .ws-meta-pill:not(:hover,:focus-within) > .ws-remove { opacity: 0; }
}
.ws-remove { padding: 0 3px; }
.ws-dialog label { display: grid; gap: 6px; font-size: .84rem; color: var(--muted); }
.ws-dialog select { width: 100%; font-size: .88rem; }
.ws-dropzone { border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--rail); color: var(--ink); padding: 20px; }
.ws-file-list { color: var(--muted); font-size: .82rem; overflow-wrap: break-word; }
.ws-attachment-card { padding: 14px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ws-att-head { gap: 8px; overflow-wrap: break-word; }
.ws-att-actions { margin-inline-start: auto; }
.ws-att-actions .btn { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.ws-att-status[data-status=ready] { color: var(--green-text); background: var(--green-bg); }
.ws-att-status:is([data-status=needs_ocr],[data-status=needs_transcription]) { color: var(--amber-text); background: var(--amber-bg); }
.ws-attachment-img, .ws-attachment-audio { display: block; max-width: 100%; margin: 12px auto 0; }
.ws-attachment-img { max-height: 420px; object-fit: contain; border-radius: var(--radius-md); }
.ws-attachment-audio { width: 100%; }
.ws-attachment-card p { margin-bottom: 0; font-size: .82rem; }
@media (prefers-reduced-motion: no-preference) {
  .ws-format-tool { transition: transform 120ms ease, background-color 140ms ease; }
  .ws-format-tool:active { transform: scale(.94); }
}
#notes-inspector {
  flex: 0 0 260px; padding: 18px; overflow-y: auto; overscroll-behavior: contain;
  border-inline-start: 1px solid var(--line); background: var(--rail);
}
#notes-inspector h2, #notes-inspector h3 { font: 600 11px/1.5 var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
#notes-inspector .kb-related-row {
  margin-block: .5rem; padding: .65rem .75rem; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--paper);
}
@media (min-width: 1024px) {
  #notes-content[data-mode=split] .notes-document { height: 100%; padding-block: 18px; }
  .notes-document .ws-canvas[data-mode=split] {
    max-width: none; height: 100%; display: flex; flex-direction: column;
  }
  .notes-document .ws-panes[data-mode=split] {
    flex: 1; min-height: 10rem; gap: 0; grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .notes-document .ws-panes[data-mode=split] > * { min-height: 0; overflow-y: auto; }
  .notes-document .ws-panes[data-mode=split] .cm-editor { height: 100%; min-height: 0; }
  .notes-document .ws-panes[data-mode=split] .ws-edit { padding-inline-end: 16px; }
  .notes-document .ws-panes[data-mode=split] .ws-preview { padding-inline-start: 16px; border-inline-start: 1px solid var(--line); }
}
@media (max-width: 1023px) {
  #notes-modes [data-mode=split] { display: none; }
  .notes-document .ws-panes[data-mode=split] { display: block; }
  .notes-document .ws-panes[data-mode=split] .ws-preview { display: none; }
}
@media (max-width: 1100px) {
  .notes-document { padding: 24px; }
}
@media (max-width: 959px) {
  #notes-resizer, #notes-rail-collapsed { display: none; }
  #notes-show { display: inline-flex; }
  #notes-sidebar, #notes-inspector {
    position: fixed; top: 0; bottom: 0; z-index: 5; box-shadow: 0 6px 24px var(--drawer-shadow);
  }
  #notes-sidebar { display: none; inset-inline-start: 0; width: min(288px, 90vw); max-width: 90vw; }
  #notes-shell.sidebar-open #notes-sidebar { display: flex; }
  #notes-inspector { inset-inline-end: 0; top: 48px; width: min(260px, 90vw); }
  #notes-toolbar { gap: 2px; padding-inline: 6px; }
  #notes-toolbar button { padding-inline: 5px; }
  .notes-document { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}
@media (max-width: 720px) {
  .ws-title-display, .notes-document .ws-title { font-size: 24px; }
  .notes-document { padding: 20px 16px max(20px, env(safe-area-inset-bottom)); }
  .ws-props-grid .ws-prop-row { grid-template-columns: minmax(0,1fr); gap: 4px; }
}
.ws-banner:not(:empty) {
  border: 1px solid var(--line); border-inline-start: 3px solid var(--ink); border-radius: var(--radius-md);
  background: var(--rail); padding: 10px 14px; margin: 0 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.ws-banner .notice { border: 0; padding: 0; margin: 0; background: transparent; font-size: .85rem; }
.ws-prop-row .ws-mention { border-style: dashed; }
.ws-popover {
  position: fixed; inset: auto; margin: 0; z-index: 15; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow: auto;
  padding: 4px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 8px 24px var(--drawer-shadow);
}
.ws-heading-menu { min-width: 132px; }
.ws-heading-option, .ws-suggest-item {
  display: flex; width: 100%; align-items: center; gap: 6px; text-align: start;
  padding: 5px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: inherit;
}
.ws-heading-option[aria-checked=true], .ws-heading-option:is(:hover,:focus-visible),
.ws-suggest-item:is(:hover,:focus-visible), .ws-suggest-item[aria-current=true] { background: var(--subtle); }
.ws-table-picker { padding: 8px; }
.ws-table-size { padding: 0 2px 6px; color: var(--muted); font: 12px var(--sans); font-variant-numeric: tabular-nums; }
.ws-table-grid { display: grid; grid-template-columns: repeat(6,18px); gap: 3px; }
.ws-grid-cell { width: 18px; height: 18px; padding: 0; background: var(--rail); border: 1px solid var(--line); border-radius: 4px; }
.ws-grid-cell.is-selected { background: var(--active-bg); border-color: var(--ink-strong); }
.ws-suggest-popover {
  width: min(320px,88vw); max-height: min(240px,90vh);
  overflow-y: auto; font-size: .85rem;
}
.ws-suggest-item .ui-ic { flex: none; }
.ws-suggest-title, .ws-suggest-path { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ws-suggest-title { flex: 1 1 0; min-width: 0; }
.ws-suggest-path { flex: 0 0 auto; margin-inline-start: 8px; color: var(--muted); font-size: 11.5px; max-width: 38%; }

.ws-dropdown { min-width: 164px; }
.ws-dropdown-item {
  display: flex; width: 100%; height: 30px; align-items: center; gap: 8px; padding: 0 8px;
  border: 0; border-radius: var(--radius-sm); color: var(--ink); background: transparent; text-align: start; font: 400 .8125rem var(--sans);
}
.ws-dropdown-item:is(:hover,:focus-visible) { background: var(--hover); }
.ws-dropdown-item.is-destructive { color: var(--red-text); }
.ws-dropdown-item.is-destructive:is(:hover,:focus-visible) { background: var(--red-bg); }
.ws-dropdown-item .ws-check { margin-inline-start: auto; }
.ws-dropdown-sep { height: 1px; background: var(--line); margin: 4px -4px; }
.ws-dropdown-header { padding: 5px 8px; color: var(--muted); font: 12px var(--sans); overflow-wrap: anywhere; }
.ws-alert-dialog { max-width: 420px; }
.ws-toasts {
  position: fixed; inset-inline-end: max(16px,env(safe-area-inset-right)); bottom: max(16px,env(safe-area-inset-bottom));
  z-index: 30; width: min(340px,calc(100vw - 32px)); display: grid; gap: 6px; pointer-events: none;
}
.ws-toast {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; pointer-events: auto;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: 0 8px 24px var(--drawer-shadow); font: 400 .8125rem var(--sans); overflow-wrap: anywhere;
}
.ws-toast > :first-child { flex: 1; min-width: 0; }
.ws-toast .notice { margin: 0; padding: 0; background: transparent; border: 0; }
.ws-toast.is-error { border-inline-start: 3px solid var(--red); }
.ws-toast .ws-icon-button { width: 22px; height: 22px; }

.ws-dialog.ws-command { width: min(560px,92vw); max-height: min(460px,78dvh); padding: 0; overflow: hidden; }
.ws-command[open] { gap: 0; }
.ws-command-head, .ws-combobox-head {
  display: flex; align-items: center; gap: 8px; flex: none; padding: 0 12px; height: 44px;
  border-bottom: 1px solid var(--line); color: var(--muted);
}
.ws-command-head input.ws-command-input, .ws-combobox-head input.ws-combobox-search {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  padding: 0; outline: none; box-shadow: none; font: .9rem var(--sans);
}
.ws-command-esc { border: 1px solid var(--line); font-size: 10px; }
.ws-command-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.ws-command-group + .ws-command-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.ws-command-group-label { padding: 6px 8px 4px; color: var(--muted); font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .05em; }
.ws-command-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px; border: 0;
  border-radius: var(--radius-sm); color: var(--ink); background: transparent; text-align: start; font: .85rem var(--sans);
}
.ws-command-item.is-active, .ws-combobox-option.is-active { background: var(--hover); color: var(--ink); }
.ws-command-item .ui-ic { flex: none; color: var(--muted); }
.ws-command-title { flex: 1; }
.ws-command-meta { max-width: 38%; font-size: 11.5px; color: var(--muted); }
.ws-command-empty, .ws-combobox-empty { padding: 16px 8px; margin: 0; color: var(--muted); text-align: center; font-size: .8125rem; }
.ws-combobox { min-width: min(200px,calc(100vw - 16px)); max-width: min(260px,calc(100vw - 16px)); }
.ws-combobox-head { height: 34px; padding: 0 6px; }
.ws-combobox-head input.ws-combobox-search { width: 100%; font-size: .8125rem; }
.ws-combobox-list { max-height: 210px; overflow-y: auto; padding-top: 4px; }
