/* Custom size for circular step badges; Bootstrap utilities do not provide 1.75rem sizing. */
.step-badge {
  width: 1.75rem;
  height: 1.75rem;
}

:root {
  --notes-sidebar-bg: #f7f6f2;
  --notes-list-bg: #ffffff;
  --notes-editor-bg: #fdfdfc;
  --notes-border: #e3e0d8;
  --notes-muted: #6b6b6b;
  --notes-accent: #f6c453;
  --notes-selected: #fff7dd;
  --notes-toolbar-bg: #f1f1f1;
  --notes-editor-surface: #1b1b1f;
  --notes-editor-text: #e6e6e6;
  --notes-editor-muted: #a3a3a3;
  --notes-editor-border: #3a3a3a;
}

:root[data-bs-theme="dark"] {
  --notes-sidebar-bg: #1d1f21;
  --notes-list-bg: #25282b;
  --notes-editor-bg: #2b2f33;
  --notes-border: #3c4045;
  --notes-muted: #a2a2a2;
  --notes-accent: #f2c94c;
  --notes-selected: #383328;
  --notes-toolbar-bg: #2f3338;
  --notes-editor-surface: #191b1e;
  --notes-editor-text: #f0f0f0;
  --notes-editor-muted: #b0b0b0;
  --notes-editor-border: #36393d;
}

.notes-body {
  margin: 0;
  background: var(--notes-editor-bg);
  min-height: 100vh;
}

.notes-app {
  display: grid;
  grid-template-columns: 260px 320px 1fr;
  height: 100vh;
  color: var(--bs-body-color);
}

.notes-app.sidebar-collapsed {
  grid-template-columns: 0 320px 1fr;
}

.notes-sidebar,
.notes-list,
.notes-editor {
  height: 100%;
  overflow: hidden;
}

.notes-sidebar {
  background: var(--notes-sidebar-bg);
  border-right: 1px solid var(--notes-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  gap: 1.25rem;
  transition: width 0.2s ease, padding 0.2s ease;
}

.notes-app.sidebar-collapsed .notes-sidebar {
  width: 0;
  padding: 0;
  border-right: none;
}

.notes-app.sidebar-collapsed .notes-sidebar > * {
  display: none;
}

.notes-sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.notes-sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.notes-app-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.notes-sidebar-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid var(--notes-border);
  border-radius: 8px;
  background: var(--notes-list-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.notes-sidebar-toggle--inline {
  width: 30px;
  height: 30px;
  display: none;
}

.notes-sidebar-toggle-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--notes-muted);
  border-bottom: 2px solid var(--notes-muted);
  transform: rotate(135deg);
  display: inline-block;
}

.notes-app.sidebar-collapsed .notes-sidebar-toggle--inline {
  display: inline-flex;
}

.notes-app.sidebar-collapsed .notes-sidebar-toggle-icon {
  transform: rotate(-45deg);
}

.notes-app-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f8d46b, #f2b233);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: inline-block;
}

.notes-account-name {
  font-size: 0.8rem;
  color: var(--notes-muted);
  margin-bottom: 0.35rem;
}

.notes-account-actions {
  display: grid;
  gap: 0.35rem;
}

.notes-search input {
  border-radius: 999px;
  border: 1px solid var(--notes-border);
  background: var(--notes-list-bg);
}

.notes-folders {
  display: grid;
  gap: 0.25rem;
}

.notes-folder {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  color: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.notes-folder.active,
.notes-folder:hover {
  background: var(--notes-selected);
}

.notes-count {
  font-size: 0.75rem;
  color: var(--notes-muted);
}

.notes-sidebar-footer {
  margin-top: auto;
}

.notes-list {
  background: var(--notes-list-bg);
  border-right: 1px solid var(--notes-border);
  display: flex;
  flex-direction: column;
}

.notes-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--notes-border);
}

.notes-list-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.notes-list-title {
  font-weight: 600;
}

.notes-list-subtitle {
  font-size: 0.8rem;
  color: var(--notes-muted);
}

.notes-list-items {
  overflow-y: auto;
  display: grid;
  gap: 0.5rem;
  padding: 1rem 1.25rem 2rem;
}

.notes-list-item {
  border-radius: 12px;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: 0.35rem;
}

.notes-list-item.active {
  border-color: var(--notes-accent);
  background: var(--notes-selected);
}

.notes-list-item-title {
  font-weight: 600;
}

.notes-list-item-meta {
  font-size: 0.75rem;
  color: var(--notes-muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.notes-list-item-preview {
  font-size: 0.85rem;
  color: var(--notes-muted);
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
}

.notes-pin {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b87333;
}

.notes-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--notes-border);
  border-radius: 16px;
}

.notes-editor {
  background: var(--notes-editor-bg);
  display: flex;
  flex-direction: column;
}

.notes-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid var(--notes-border);
  gap: 1rem;
}

.notes-editor-heading {
  font-weight: 600;
  font-size: 1.4rem;
}

.notes-title-input {
  width: 100%;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 1.4rem;
  color: inherit;
}

.notes-title-input:focus {
  outline: none;
}

.notes-editor-subheading {
  font-size: 0.8rem;
  color: var(--notes-muted);
  margin-top: 0.25rem;
}

.notes-editor-status {
  font-size: 0.75rem;
  color: var(--notes-muted);
  border: 1px solid var(--notes-border);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1.5rem;
  background: var(--notes-toolbar-bg);
  border-bottom: 1px solid var(--notes-border);
}

.notes-toolbar.is-disabled {
  opacity: 0.6;
}

.notes-tool-btn {
  border: 1px solid var(--notes-border);
  background: var(--notes-editor-bg);
  border-radius: 8px;
  font-size: 0.7rem;
  padding: 0.35rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.notes-tool-btn:hover {
  border-color: var(--notes-accent);
}

.notes-tool-divider {
  width: 1px;
  height: 18px;
  background: var(--notes-border);
  margin: 0 0.35rem;
}

.notes-editor-body {
  flex: 1;
  overflow: auto;
}

.notes-editor-textarea {
  min-height: 100%;
  padding: 1.5rem 1.75rem;
  background: var(--notes-editor-surface);
  color: var(--notes-editor-text);
  border: 1px solid var(--notes-editor-border);
  font-family: "SF Mono", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 100%;
  height: 100%;
  resize: none;
  outline: none;
  tab-size: 2;
}

.notes-editor-textarea:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25);
}

.notes-editor-textarea::placeholder {
  color: var(--notes-editor-muted);
}

.notes-editor-textarea:disabled {
  opacity: 0.75;
}

@media (max-width: 1200px) {
  .notes-app {
    grid-template-columns: 220px 280px 1fr;
  }
}

@media (max-width: 992px) {
  .notes-app {
    grid-template-columns: 220px 1fr;
  }

  .notes-list {
    display: none;
  }
}

@media (max-width: 768px) {
  .notes-app {
    grid-template-columns: 1fr;
  }

  .notes-sidebar {
    display: none;
  }

  .notes-editor-header {
    padding: 1rem 1.25rem;
  }

  .notes-editor-body {
    padding: 1rem 1.25rem 1.5rem;
  }
}
