:root {
  color-scheme: dark;
  --notes-bg: #101613;
  --notes-panel: #151d19;
  --notes-panel-strong: #1a2420;
  --notes-line: #2b3932;
  --notes-ink: #e5ece8;
  --notes-muted: #95a39b;
  --notes-soft: #202b26;
  --notes-accent: #5c9f83;
  --notes-accent-strong: #72b698;
  --notes-warn: #d7aa62;
}

body.notes-page {
  --bg-panel: var(--notes-panel-strong);
  --text-primary: var(--notes-ink);
  --text-muted: var(--notes-muted);
  --accent: var(--notes-accent);
  background: var(--notes-bg);
  color: var(--notes-ink);
}

body.notes-page .install-banner {
  border-color: var(--notes-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

body.notes-page .notes-shell {
  min-height: calc(100vh - var(--notes-navbar-height, 56px));
}

body.notes-page .notes-sidebar {
  background: #131c18;
  border-right-color: var(--notes-line);
}

body.notes-page .notes-editor {
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(20, 29, 25, 0.97), rgba(14, 20, 17, 0.99)),
    var(--notes-bg);
}

body.notes-page #note-title.note-title {
  padding: 0;
  margin: 0;
  background: transparent;
  border-bottom: 0;
  color: var(--notes-ink);
}

body.notes-page #note-title.note-title:focus,
body.notes-page .note-content:focus {
  outline: none;
}

body.notes-page #note-title.note-title:focus-visible,
body.notes-page .note-content:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 111, 88, 0.14);
  border-radius: 8px;
}

body.notes-page .notes-actionbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(18, 26, 22, 0.94);
  border-bottom: 1px solid var(--notes-line);
  backdrop-filter: blur(14px);
}

body.notes-page .notes-context {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.notes-page .notes-context__space {
  color: var(--notes-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.notes-page .notes-context__note {
  max-width: 42rem;
  overflow: hidden;
  color: var(--notes-ink);
  font-size: 1rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.notes-page .notes-actionbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

body.notes-page .notes-sync-status,
body.notes-page .notes-save-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--notes-line);
  border-radius: 8px;
  color: var(--notes-muted);
  background: rgba(28, 39, 34, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
}

body.notes-page .notes-sync-status[data-state="offline"] {
  color: var(--notes-warn);
  border-color: rgba(143, 90, 23, 0.28);
  background: rgba(73, 52, 24, 0.48);
}

body.notes-page .primary-button,
body.notes-page .secondary-button {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 7px 12px;
  font-size: 0.86rem;
  font-weight: 800;
}

body.notes-page .primary-button {
  background: var(--notes-accent);
  color: #f4faf7;
}

body.notes-page .primary-button:hover {
  background: var(--notes-accent-strong);
}

body.notes-page .secondary-button {
  background: var(--notes-panel-strong);
  color: var(--notes-ink);
  border-color: var(--notes-line);
  cursor: pointer;
}

body.notes-page .secondary-button:hover {
  background: var(--notes-soft);
}

body.notes-page .folder-item,
body.notes-page .note-item {
  min-height: 42px;
}

body.notes-page .folder-content,
body.notes-page .note-item-content {
  min-width: 0;
}

body.notes-page .note-item-title,
body.notes-page .folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.notes-page .folder-item.active,
body.notes-page .note-item.active {
  background: #22342c;
  box-shadow: inset 0 0 0 1px rgba(92, 159, 131, 0.34);
}

body.notes-page .editor-wrapper {
  width: min(100%, 940px);
  margin: 0 auto;
  padding-top: 34px;
}

body.notes-page .note-header,
body.notes-page .note-content {
  width: min(100%, 760px);
}

body.notes-page .note-title {
  font-size: 2.45rem;
  line-height: 1.08;
  letter-spacing: 0;
}

body.notes-page .note-meta {
  flex-shrink: 0;
}

body.notes-page .note-toolbar {
  position: static;
  z-index: 4;
  max-width: 100%;
  margin: 6px 0 18px;
  overflow-x: auto;
  border-color: var(--notes-line);
  border-radius: 8px;
}

body.notes-page .note-content {
  min-height: 55vh;
  padding-bottom: 30vh;
}

body.notes-page .empty-state {
  width: min(100% - 32px, 520px);
  padding: 34px;
  border: 1px solid var(--notes-line);
  border-radius: 8px;
  background: rgba(21, 29, 25, 0.9);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

body.notes-page .empty-state h2 {
  margin: 0 0 10px;
  color: var(--notes-ink);
  font-size: 1.65rem;
}

body.notes-page .empty-state p {
  margin: 0;
  color: var(--notes-muted);
}

body.notes-page .empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

body.notes-page .quick-capture {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--notes-line);
  background: rgba(17, 24, 20, 0.9);
}

body.notes-page .quick-capture__copy {
  display: grid;
  min-width: 180px;
  gap: 2px;
}

body.notes-page .quick-capture__copy span {
  color: var(--notes-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

body.notes-page .quick-capture__copy strong {
  font-size: 0.92rem;
}

body.notes-page .quick-capture__form {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

body.notes-page .quick-capture__form input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--notes-line);
  border-radius: 8px;
  background: var(--notes-panel-strong);
  color: var(--notes-ink);
  caret-color: var(--notes-accent-strong);
  font: inherit;
}

body.notes-page .quick-capture__form input:focus {
  outline: none;
  border-color: var(--notes-accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 88, 0.12);
}

body.notes-page .editor-wrapper {
  flex: 1;
  min-height: 0;
  height: auto;
}

body.notes-page .workspace-label,
body.notes-page .note-item-meta,
body.notes-page .note-meta,
body.notes-page .slash-hint,
body.notes-page .slash-option-description,
body.notes-page .notes-list.empty::before {
  color: var(--notes-muted);
}

body.notes-page .workspace-title,
body.notes-page .section-heading,
body.notes-page .note-item-title,
body.notes-page .folder-name,
body.notes-page .note-content,
body.notes-page .slash-option-label {
  color: var(--notes-ink);
}

body.notes-page .sidebar-input,
body.notes-page .sidebar-toggle,
body.notes-page .secondary-button,
body.notes-page .note-toolbar,
body.notes-page .slash-menu {
  background: var(--notes-panel-strong);
  color: var(--notes-ink);
  border-color: var(--notes-line);
}

body.notes-page .sidebar-input::placeholder,
body.notes-page .quick-capture__form input::placeholder,
body.notes-page .note-title:empty::before,
body.notes-page .note-content:empty::before {
  color: #718078;
}

body.notes-page .sidebar-input:focus {
  outline: 2px solid rgba(92, 159, 131, 0.22);
  border-color: var(--notes-accent);
}

body.notes-page .icon-button,
body.notes-page .icon-button.subtle {
  color: var(--notes-muted);
}

body.notes-page .icon-button:hover,
body.notes-page .folder-item:hover,
body.notes-page .note-item:hover,
body.notes-page .secondary-button:hover {
  background: var(--notes-soft);
}

body.notes-page .primary-button[disabled] {
  background: #26312c;
  color: #66736c;
}

body.notes-page .note-toolbar {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

body.notes-page .note-toolbar .toolbar-divider,
body.notes-page .note-content .note-divider,
body.notes-page .note-content hr {
  background: var(--notes-line);
}

body.notes-page .note-content blockquote {
  border-left-color: var(--notes-accent);
  color: #b5c1ba;
}

body.notes-page .note-content figure.note-image-block figcaption {
  color: var(--notes-muted);
}

body.notes-page .slash-menu {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
}

body.notes-page #slash-options li.active {
  background: #22342c;
}

body.notes-page #slash-options li.empty {
  color: var(--notes-muted);
}

@media (max-width: 900px) {
  body.notes-page .sidebar-toggle {
    display: none;
  }

  body.notes-page .notes-actionbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }

  body.notes-page .notes-actionbar__actions {
    justify-content: flex-start;
    width: 100%;
  }

  body.notes-page .quick-capture {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  body.notes-page .quick-capture__copy {
    min-width: 0;
  }

  body.notes-page .quick-capture__form {
    width: 100%;
  }

  body.notes-page .notes-sync-status,
  body.notes-page .notes-save-status {
    min-height: 28px;
  }

  body.notes-page .editor-wrapper {
    padding-top: 22px;
  }

  body.notes-page .note-header,
  body.notes-page .note-content {
    width: 100%;
  }
}

@media (max-width: 560px) {
  body.notes-page .notes-context__note {
    max-width: calc(100vw - 34px);
  }

  body.notes-page .notes-actionbar__actions > button {
    flex: 1 1 120px;
  }

  body.notes-page .note-title {
    font-size: 2rem;
  }

  body.notes-page .empty-state {
    padding: 26px 20px;
  }
}
