.mm-notes-app, .mm-notes-quick-add {
  --mm-gold: #ac9343;
  --mm-cream: #f7f2e6;
  --mm-sand: #e9e4d6;
  --mm-ink: #161616;
  --mm-muted: #6d6d6d;
  --mm-line: #ddd4c2;
  --mm-danger: #8b1e1e;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--mm-ink);
}

.mm-notes-shell {
  display: grid;
  grid-template-columns: 290px 340px minmax(0, 1fr);
  min-height: 78vh;
  background: #fff;
  border: 1px solid var(--mm-line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.06);
}

.mm-notes-sidebar,
.mm-notes-center,
.mm-notes-editor {
  min-width: 0;
}

.mm-notes-sidebar {
  background: #fbf8f1;
  border-right: 1px solid var(--mm-line);
  padding: 18px;
}

.mm-notes-center {
  border-right: 1px solid var(--mm-line);
  background: #fffdfa;
}

.mm-notes-editor {
  background: #ffffff;
}

.mm-notes-brand,
.mm-notes-toolbar,
.mm-editor-actions,
.mm-editor-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mm-notes-brand h2,
.mm-editor-empty h3 {
  margin: 0;
}

.mm-notes-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--mm-muted);
  margin-bottom: 4px;
}

.mm-sidebar-help {
  margin: 8px 0 12px;
  color: var(--mm-muted);
  font-size: 12px;
}

.mm-btn {
  border: 1px solid var(--mm-line);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: var(--mm-ink);
}

.mm-btn-primary {
  background: var(--mm-gold);
  color: #fff;
  border-color: var(--mm-gold);
}

.mm-btn-danger {
  color: var(--mm-danger);
}

.mm-btn-danger-fill {
  background: var(--mm-danger);
  color: #fff;
  border-color: var(--mm-danger);
}

.mm-notes-search-wrap {
  margin: 16px 0 8px;
}

.mm-notes-search,
.mm-note-title,
.mm-note-tags,
.mm-note-notebook,
.mm-note-source-grid input,
.mm-quick-title,
.mm-quick-content,
.mm-note-content,
.mm-modal-notebook-title,
.mm-delete-target-notebook,
.mm-delete-confirm-input {
  width: 100%;
  border: 1px solid var(--mm-line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-sizing: border-box;
  color: var(--mm-ink);
}

.mm-notebooks-list,
.mm-notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mm-notebook-item,
.mm-note-card {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
}

.mm-notebook-item.is-active,
.mm-note-card.is-active {
  border-color: var(--mm-gold);
  box-shadow: inset 0 0 0 1px rgba(172,147,67,.15);
}

.mm-notebook-item {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  position: relative;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.mm-notebook-item:hover {
  transform: translateY(-1px);
}

.mm-notebook-item:hover .mm-notebook-spine,
.mm-notebook-item.is-dragging .mm-notebook-spine {
  box-shadow: inset -3px 0 0 rgba(255,255,255,.18), 0 0 0 1px rgba(0,0,0,.06), 0 0 14px var(--spine-color, rgba(172,147,67,.55));
}

.mm-notebook-item.is-dragging {
  opacity: .72;
  transform: scale(.985);
}

.mm-notebook-spine {
  width: 16px;
  flex: 0 0 16px;
  align-self: stretch;
  border-right: 1px solid rgba(0,0,0,.08);
  position: relative;
  transition: box-shadow .16s ease;
}

.mm-notebook-spine::before,
.mm-notebook-spine::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  height: 2px;
  background: rgba(255,255,255,.24);
  border-radius: 999px;
}

.mm-notebook-spine::before { top: 8px; }
.mm-notebook-spine::after { bottom: 8px; }

.mm-notebook-item-body {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  min-width: 0;
  flex: 1;
}

.mm-notebook-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 12px;
}

.mm-notebook-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mm-notebook-main strong {
  white-space: normal;
  color: var(--mm-ink);
}

.mm-notebook-main small,
.mm-note-card p,
.mm-note-card-meta,
.mm-editor-status,
.mm-quick-status,
.mm-note-source-title,
.mm-editor-empty p,
.mm-choice-card small,
.mm-delete-copy,
.mm-delete-summary {
  color: var(--mm-muted);
}

.mm-notes-toolbar {
  padding: 18px;
  border-bottom: 1px solid var(--mm-line);
}

.mm-notes-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mm-notes-list {
  padding: 18px;
}

.mm-note-card-top,
.mm-note-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mm-note-card p {
  margin: 10px 0;
  line-height: 1.45;
}

.mm-note-card-meta {
  font-size: 12px;
}

.mm-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--mm-cream);
  color: #7a6221;
  font-size: 12px;
}

.mm-editor-empty,
.mm-editor-fields {
  height: 100%;
}

.mm-editor-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.mm-editor-empty-inner {
  max-width: 380px;
  text-align: center;
}

.mm-editor-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.mm-note-title {
  font-size: 28px;
  font-weight: 700;
}

.mm-note-content {
  min-height: 360px;
  resize: vertical;
  line-height: 1.55;
}

.mm-note-source-box {
  border: 1px solid var(--mm-line);
  background: #fdfbf7;
  border-radius: 16px;
  padding: 14px;
}

.mm-note-source-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.mm-editor-actions-right {
  display: flex;
  gap: 10px;
}

.mm-editor-status.is-error,
.mm-quick-status.is-error {
  color: var(--mm-danger);
}

.mm-notes-list-empty,
.mm-notes-login {
  padding: 18px;
  border: 1px dashed var(--mm-line);
  border-radius: 16px;
  background: #fffdfa;
}

.mm-notes-quick-add {
  display: grid;
  gap: 12px;
  max-width: 620px;
}

.mm-modal[hidden] { display: none; }

.mm-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.mm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

.mm-modal-card {
  position: relative;
  width: min(560px, calc(100vw - 24px));
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--mm-line);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
  padding: 20px;
  z-index: 2;
}

.mm-modal-card-danger {
  width: min(620px, calc(100vw - 24px));
}

.mm-modal-card h3 {
  margin: 0 0 8px;
}

.mm-color-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
}

.mm-modal-color-picker {
  width: 56px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}

.mm-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.mm-color-swatch {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 14px;
  width: 100%;
  height: 36px;
  cursor: pointer;
}

.mm-color-swatch.is-active {
  border-color: #161616;
}

.mm-delete-options {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.mm-choice-card {
  border: 1px solid var(--mm-line);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  background: #fffdfa;
}

.mm-choice-card input {
  margin-top: 4px;
}

.mm-choice-card.is-active {
  border-color: var(--mm-gold);
  box-shadow: inset 0 0 0 1px rgba(172,147,67,.16);
}

.mm-choice-card-danger.is-active {
  border-color: var(--mm-danger);
  box-shadow: inset 0 0 0 1px rgba(139,30,30,.18);
}

.mm-move-target-wrap,
.mm-delete-confirm-wrap {
  margin-left: 8px;
}

.mm-delete-confirm-wrap[hidden] {
  display: none;
}

.mm-confirm-label {
  display: block;
  font-size: 13px;
  margin: 2px 0 8px;
}

.mm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 1200px) {
  .mm-notes-shell {
    grid-template-columns: 250px 300px minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .mm-notes-shell {
    grid-template-columns: 1fr;
  }

  .mm-notes-sidebar,
  .mm-notes-center {
    border-right: 0;
    border-bottom: 1px solid var(--mm-line);
  }

  .mm-note-source-grid {
    grid-template-columns: 1fr;
  }
}


.mm-edit-notebook-btn {
  background: #fff8ea;
  border-color: rgba(172,147,67,.35);
}

.mm-note-card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(0,0,0,.03);
}

.mm-note-card:hover {
  border-color: rgba(172,147,67,.34);
  box-shadow: 0 16px 28px rgba(0,0,0,.05);
  transform: translateY(-1px);
}

.mm-note-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--note-accent, var(--mm-gold));
}

.mm-note-card-top,
.mm-note-card p,
.mm-note-card-meta {
  position: relative;
  z-index: 1;
}

.mm-note-card-meta-right {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mm-note-book-label {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f5efe0;
  color: #755b1b;
}

.mm-editor-fields {
  background: linear-gradient(180deg, #fffefb 0%, #ffffff 180px);
}

.mm-editor-meta-row {
  padding: 10px;
  border: 1px solid var(--mm-line);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
}

.mm-note-title {
  border: 0;
  padding-left: 0;
  padding-right: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid rgba(221,212,194,.7);
}

.mm-note-title:focus {
  outline: none;
  box-shadow: none;
  border-bottom-color: var(--mm-gold);
}

.mm-note-content {
  border-radius: 18px;
  background: #fffdfa;
}

.mm-note-source-box {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}


.mm-note-title-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 0;
}

.mm-note-title-row .mm-note-title {
  flex: 1 1 auto;
}

.mm-note-open-source {
  white-space: nowrap;
  text-decoration: none;
}

.mm-note-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mm-note-card-title-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.mm-note-card-title-link:hover {
  color: var(--mm-gold);
  border-bottom-color: currentColor;
}

.mm-note-source-hint {
  font-size: 12px;
  color: var(--mm-muted);
}

.mm-connected-preview {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #e8dfca;
  border-radius: 16px;
  background: #fbf8ef;
}
.mm-connected-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.mm-connected-preview-ref {
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b655b;
}
.mm-connected-preview-quote {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.6;
  font-weight: 600;
}
.mm-connected-preview-quote-yellow, .mm-highlight-chip-yellow, .mm-highlight-pill-yellow { background: #f4df72; color: #1f1f1f; }
.mm-connected-preview-quote-green, .mm-highlight-chip-green, .mm-highlight-pill-green { background: #a8e6a1; color: #1f1f1f; }
.mm-connected-preview-quote-blue, .mm-highlight-chip-blue, .mm-highlight-pill-blue { background: #b7d8f5; color: #1f1f1f; }
.mm-connected-preview-quote-pink, .mm-highlight-chip-pink, .mm-highlight-pill-pink { background: #efbfd0; color: #1f1f1f; }
.mm-highlight-chip {
  display: inline;
  padding: 4px 6px;
  border-radius: 8px;
  line-height: 1.7;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.mm-highlight-pill {
  text-transform: capitalize;
  border: none;
}
.mm-note-card.is-highlight-card p {
  line-height: 1.7;
}
.mm-note-content.is-highlight-note.is-highlight-yellow { background: linear-gradient(0deg, rgba(244,223,114,.20), rgba(244,223,114,.20)), #fff; }
.mm-note-content.is-highlight-note.is-highlight-green { background: linear-gradient(0deg, rgba(168,230,161,.20), rgba(168,230,161,.20)), #fff; }
.mm-note-content.is-highlight-note.is-highlight-blue { background: linear-gradient(0deg, rgba(183,216,245,.22), rgba(183,216,245,.22)), #fff; }
.mm-note-content.is-highlight-note.is-highlight-pink { background: linear-gradient(0deg, rgba(239,191,208,.22), rgba(239,191,208,.22)), #fff; }
