.notes-sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
  min-width: 276px;
  max-height: 65vh;
  color: var(--text);
}
.shell.right-closed .notes-sidebar {
  display: none;
}
.notes-heading,
.notes-dialog header {
  display: flex;
  gap: 10px;
  align-items: center;
}
.notes-heading h4 {
  margin: 0;
  flex: 1;
  font-size: 14px;
}
.notes-count {
  color: var(--muted, var(--text));
  font-size: 11px;
}
.notes-sidebar-sync {
  padding: 4px 7px !important;
  font-size: 11px;
}
.notes-last-updated {
  margin: -3px 0 8px;
  color: var(--muted, var(--text));
  font-size: 10px;
}
.notes-sidebar button,
.notes-dialog button {
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 7px;
  padding: 6px 10px;
}
.notes-status {
  font-size: 11px;
  margin: 7px 0;
  color: var(--muted, var(--text));
}
.notes-previews {
  height: 196px;
  max-height: 196px;
  min-height: 0;
  overflow: auto;
}
.notes-previews button {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-bottom: 5px;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}
.notes-previews p {
  font-size: 12px;
  opacity: 0.7;
}
.notes-add {
  width: 100%;
  margin-top: 7px;
  flex-shrink: 0;
}
.notes-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
[data-color="yellow"] {
  --note-bg: #fff0b3;
}
[data-color="blue"] {
  --note-bg: #d2eaff;
}
[data-color="green"] {
  --note-bg: #d5f1d5;
}
[data-color="pink"] {
  --note-bg: #ffdae5;
}
[data-color="purple"] {
  --note-bg: #e8dcff;
}
.notes-dot {
  background: var(--note-bg);
  border: 1px solid #7776;
}
.notes-dialog {
  padding: 0;
  width: min(1100px, 94vw);
  max-width: 94vw;
  height: 85vh;
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 20px 80px #0005;
}
.notes-dialog[open] {
  display: flex;
  flex-direction: column;
}
.notes-dialog::backdrop {
  background: #17203870;
}
.notes-dialog header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.notes-dialog header > div {
  flex: 1;
}
.notes-dialog h2 {
  margin: 0;
  font-size: 20px;
}
.notes-search {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}
.notes-search input {
  width: 240px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  padding: 8px;
  border-radius: 7px;
}
.notes-search small {
  opacity: 0.7;
}
.notes-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: color-mix(in srgb, var(--card) 94%, var(--text));
}
.notes-board {
  position: relative;
  min-width: 100%;
  margin: 16px;
}
.sticky-note {
  position: absolute;
  display: flex;
  flex-direction: column;
  padding: 8px 12px 16px;
  border-radius: 10px;
  background: var(--note-bg);
  color: #282434;
  box-shadow: 0 4px 14px #0002;
  border: 1px solid #0001;
  min-width: 220px;
  transition: box-shadow 0.15s;
}
.sticky-note:focus-within {
  z-index: 3 !important;
  box-shadow: 0 5px 20px #0004;
}
.note-tools {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}
.sticky-note .note-tools button,
.sticky-note .note-resize {
  background: transparent;
  border: 0;
  padding: 2px 6px;
}
.note-tools .note-drag {
  margin-right: auto;
  cursor: grab;
  touch-action: none;
}
.sticky-note input,
.sticky-note textarea,
.sticky-note select {
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  border-radius: 3px;
}
.sticky-note .note-title {
  font-weight: 700;
  font-size: 14px;
  width: 100%;
  padding: 8px 0;
}
.sticky-note .note-content {
  flex: 1;
  min-height: 0;
  width: 100%;
  resize: none;
  padding: 3px 0;
  font-size: 13px;
  line-height: 1.5;
}
.note-footer {
  display: flex;
  gap: 5px;
  align-items: center;
  padding-top: 7px;
}
.note-footer select {
  width: 77px;
  font-size: 11px;
  padding: 0;
}
.note-footer small {
  font-size: 9px;
  opacity: 0.75;
}
.sticky-note .note-resize {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  z-index: 2;
  cursor: nwse-resize;
  touch-action: none;
}
.sticky-note.minimized .note-content,
.sticky-note.minimized .note-footer,
.sticky-note.minimized .note-resize {
  display: none;
}
.floating-note-layer {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}
.floating-note-layer .floating-note {
  position: fixed;
  pointer-events: auto;
  z-index: 1 !important;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 80px);
}
.note-float-sync {
  display: none;
}
.floating-note .note-float-sync {
  display: inline-block;
}
.floating-note [data-minimize],
.floating-note [data-delete] {
  display: none !important;
}
.notes-conflicts {
  max-height: 30vh;
  overflow: auto;
}
.notes-conflict {
  margin: 8px 20px;
  padding: 12px;
  border: 1px solid #c98618;
  border-radius: 8px;
  font-size: 12px;
}
.notes-conflict pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notes-empty {
  text-align: center;
  padding: 50px 12px;
  opacity: 0.7;
}
body.dark .sticky-note {
  color: #f4efff;
  background: color-mix(in srgb, var(--note-bg) 23%, #171624);
}
body.dark .sticky-note select option {
  background: #262435;
}
@media (max-width: 600px) {
  .notes-search {
    flex-direction: column;
    align-items: stretch;
  }
  .notes-search input {
    width: 100%;
  }
  .notes-search small {
    display: none;
  }
  .notes-dialog header {
    padding: 10px;
    gap: 5px;
  }
  .notes-dialog header button {
    padding: 6px;
  }
  .notes-board {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0 !important;
    margin: 12px;
  }
  .sticky-note {
    position: relative;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100%;
  }
  .note-drag,
  .note-resize {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-note {
    transition: none;
  }
}
