/* ============================================================
   Notes — ProductivityHub
   Éditeur de carnet riche. Styles préfixés nt- / --nt-.
   Thème clair/sombre piloté par [data-theme] (settings.js).
   ============================================================ */

:root {
  --nt-accent: #c68414;
  --nt-accent-strong: #a86e0f;
  --nt-accent-soft: #fbf1da;
  --nt-danger: #d94b55;
  --nt-danger-soft: #fdeceD;
  --nt-success: #1f8a63;

  --nt-bg: #f4f2ec;
  --nt-surface: #ffffff;
  --nt-surface-soft: #f3f0e8;
  --nt-surface-raised: #ffffff;

  --nt-text: #26241f;
  --nt-text-soft: #6d685d;
  --nt-text-faint: #a09a8c;

  --nt-border: #e7e2d6;
  --nt-border-strong: #d7d1c1;
  --nt-mark: #ffe9a3;

  --nt-shadow: 0 14px 38px rgba(60, 50, 20, 0.10);
  --nt-shadow-small: 0 4px 16px rgba(60, 50, 20, 0.08);
  --nt-shadow-pop: 0 18px 44px rgba(40, 33, 12, 0.20);

  --nt-header-height: 68px;
  --nt-auth-offset: 0px;
  --nt-sidebar-width: 244px;
  --nt-list-width: 320px;
  --nt-radius: 16px;
  --nt-radius-small: 11px;
  color-scheme: light;
}

[data-theme="dark"] {
  --nt-accent: #f0b64a;
  --nt-accent-strong: #f7c766;
  --nt-accent-soft: rgba(240, 182, 74, 0.16);
  --nt-danger: #ff7e88;
  --nt-danger-soft: rgba(255, 126, 136, 0.15);
  --nt-success: #5bd3a7;

  --nt-bg: #16151a;
  --nt-surface: #201f26;
  --nt-surface-soft: #26252d;
  --nt-surface-raised: #24232b;

  --nt-text: #f3f1ea;
  --nt-text-soft: #b1aca1;
  --nt-text-faint: #7d7a70;

  --nt-border: #33313b;
  --nt-border-strong: #474450;
  --nt-mark: #6f5a1c;

  --nt-shadow: 0 16px 40px rgba(0, 0, 0, 0.30);
  --nt-shadow-small: 0 5px 18px rgba(0, 0, 0, 0.26);
  --nt-shadow-pop: 0 20px 48px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--nt-bg); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--nt-bg);
  color: var(--nt-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { color: inherit; font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--nt-accent) 50%, transparent);
  outline-offset: 2px;
}

.nt-visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ---------- App shell ---------- */
.nt-app { min-height: 100vh; display: flex; flex-direction: column; padding-top: var(--nt-auth-offset); }

.nt-header {
  height: var(--nt-header-height);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--nt-surface) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--nt-border);
  position: sticky; top: var(--nt-auth-offset); z-index: 40;
}

.nt-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  color: var(--nt-text-soft); background: transparent;
  transition: background .15s ease, color .15s ease;
  flex: none;
}
.nt-icon-btn:hover { background: var(--nt-surface-soft); color: var(--nt-text); }

.nt-back { border: 1px solid var(--nt-border); }

.nt-brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }
.nt-brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.05rem;
  background: linear-gradient(135deg, #e0a021, #c06a12);
  box-shadow: 0 6px 16px rgba(198, 132, 20, 0.35);
}
.nt-brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.nt-brand-copy strong { font-size: 1.02rem; font-weight: 700; }
.nt-brand-copy small { font-size: .72rem; color: var(--nt-text-faint); letter-spacing: .01em; }

.nt-search {
  margin-left: 10px; flex: 1 1 auto; max-width: 460px;
  display: flex; align-items: center; gap: 9px;
  padding: 0 12px; height: 42px;
  background: var(--nt-surface-soft);
  border: 1px solid var(--nt-border);
  border-radius: 12px; color: var(--nt-text-soft);
  transition: border-color .15s ease, background .15s ease;
}
.nt-search:focus-within { border-color: var(--nt-accent); background: var(--nt-surface); }
.nt-search input {
  flex: 1; border: 0; background: none; outline: none; color: var(--nt-text);
  font-size: .93rem;
}
.nt-search kbd {
  font-family: inherit; font-size: .72rem; color: var(--nt-text-faint);
  border: 1px solid var(--nt-border-strong); border-radius: 6px;
  padding: 1px 6px; background: var(--nt-surface);
}

.nt-header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }

.nt-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px; height: 42px; border-radius: 12px;
  font-weight: 600; font-size: .92rem;
  background: var(--nt-surface-soft); color: var(--nt-text);
  border: 1px solid var(--nt-border);
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.nt-btn:hover { transform: translateY(-1px); }
.nt-btn:active { transform: translateY(0); }
.nt-btn-primary {
  background: linear-gradient(135deg, var(--nt-accent), var(--nt-accent-strong));
  color: #fff; border-color: transparent;
  box-shadow: 0 8px 20px rgba(198, 132, 20, 0.30);
}
[data-theme="dark"] .nt-btn-primary { color: #23180a; }
.nt-btn-ghost { background: transparent; }
.nt-btn-danger { background: var(--nt-danger); color: #fff; border-color: transparent; }
.nt-btn-danger:hover { filter: brightness(1.05); }

/* ---------- Shell layout (3 panes) ---------- */
.nt-shell {
  flex: 1; display: grid;
  grid-template-columns: var(--nt-sidebar-width) var(--nt-list-width) 1fr;
  min-height: 0;
  height: calc(100vh - var(--nt-header-height) - var(--nt-auth-offset));
}

/* ---------- Sidebar ---------- */
.nt-sidebar {
  border-right: 1px solid var(--nt-border);
  background: var(--nt-bg);
  padding: 16px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
}
.nt-smartlists { display: flex; flex-direction: column; gap: 2px; }
.nt-smart {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px;
  color: var(--nt-text-soft); font-size: .92rem; font-weight: 500; text-align: left;
  transition: background .13s ease, color .13s ease;
}
.nt-smart > span:nth-child(2) { flex: 1; }
.nt-smart i { width: 18px; text-align: center; color: var(--nt-text-faint); }
.nt-smart:hover { background: var(--nt-surface-soft); color: var(--nt-text); }
.nt-smart.is-active { background: var(--nt-accent-soft); color: var(--nt-accent-strong); }
.nt-smart.is-active i { color: var(--nt-accent-strong); }
[data-theme="dark"] .nt-smart.is-active { color: var(--nt-accent); }
[data-theme="dark"] .nt-smart.is-active i { color: var(--nt-accent); }
.nt-count {
  font-size: .74rem; font-weight: 600; color: var(--nt-text-faint);
  background: var(--nt-surface-soft); border-radius: 20px; padding: 1px 8px; min-width: 22px; text-align: center;
}
.nt-smart.is-active .nt-count { background: color-mix(in srgb, var(--nt-accent) 22%, transparent); color: var(--nt-accent-strong); }

.nt-side-section { display: flex; flex-direction: column; gap: 6px; }
.nt-side-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 2px; }
.nt-side-heading h2 {
  margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--nt-text-faint);
}
.nt-mini {
  width: 26px; height: 26px; border-radius: 8px; color: var(--nt-text-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.nt-mini:hover { background: var(--nt-surface-soft); color: var(--nt-accent-strong); }

.nt-notebooks, .nt-tags { display: flex; flex-direction: column; gap: 2px; }
.nt-nb {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; text-align: left;
  color: var(--nt-text); font-size: .91rem; width: 100%;
  transition: background .13s ease;
}
.nt-nb:hover { background: var(--nt-surface-soft); }
.nt-nb.is-active { background: var(--nt-surface); box-shadow: var(--nt-shadow-small); }
.nt-nb-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent); }
.nt-nb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-nb-count { font-size: .74rem; color: var(--nt-text-faint); }
.nt-nb-edit {
  opacity: 0; width: 24px; height: 24px; border-radius: 7px; color: var(--nt-text-faint);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.nt-nb:hover .nt-nb-edit { opacity: 1; }
.nt-nb-edit:hover { background: var(--nt-border); color: var(--nt-text); }

.nt-tag-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 9px; color: var(--nt-text-soft); font-size: .87rem; text-align: left;
}
.nt-tag-chip:hover { background: var(--nt-surface-soft); color: var(--nt-text); }
.nt-tag-chip.is-active { background: var(--nt-accent-soft); color: var(--nt-accent-strong); }
.nt-tag-chip i { font-size: .74rem; color: var(--nt-text-faint); }

.nt-side-foot { margin-top: auto; display: flex; gap: 6px; padding-top: 8px; border-top: 1px solid var(--nt-border); }
.nt-mini-link {
  display: inline-flex; align-items: center; gap: 6px; flex: 1; justify-content: center;
  padding: 8px; border-radius: 9px; color: var(--nt-text-soft); font-size: .82rem;
}
.nt-mini-link:hover { background: var(--nt-surface-soft); color: var(--nt-text); }

/* ---------- Note list ---------- */
.nt-list-pane {
  border-right: 1px solid var(--nt-border);
  background: var(--nt-surface);
  display: flex; flex-direction: column; min-height: 0;
}
.nt-list-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px 12px; border-bottom: 1px solid var(--nt-border);
}
.nt-list-back { display: none; }
.nt-list-title { margin: 0; font-size: 1.05rem; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-list-tools { display: flex; gap: 2px; }

.nt-note-list { flex: 1; overflow-y: auto; padding: 8px; }
.nt-note-card {
  display: block; width: 100%; text-align: left;
  padding: 12px 13px; border-radius: 12px; margin-bottom: 4px;
  border: 1px solid transparent; transition: background .12s ease, border-color .12s ease;
  position: relative;
}
.nt-note-card:hover { background: var(--nt-surface-soft); }
.nt-note-card.is-active { background: var(--nt-accent-soft); border-color: color-mix(in srgb, var(--nt-accent) 30%, transparent); }
.nt-note-card-top { display: flex; align-items: baseline; gap: 8px; }
.nt-note-title { font-weight: 650; font-size: .96rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-note-title.is-empty { color: var(--nt-text-faint); font-style: italic; font-weight: 500; }
.nt-note-fav { color: var(--nt-accent); font-size: .78rem; flex: none; }
.nt-note-snippet {
  margin-top: 3px; font-size: .84rem; color: var(--nt-text-soft); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nt-note-meta { margin-top: 7px; display: flex; align-items: center; gap: 8px; font-size: .74rem; color: var(--nt-text-faint); }
.nt-note-meta .nt-note-nb { display: inline-flex; align-items: center; gap: 5px; }
.nt-note-meta .nt-note-nb .nt-nb-dot { width: 8px; height: 8px; box-shadow: none; }

/* ---------- Editor ---------- */
.nt-editor-pane { background: var(--nt-bg); overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.nt-editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.nt-editor-topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-bottom: 1px solid var(--nt-border);
  background: var(--nt-surface);
}
.nt-editor-back { display: none; }
.nt-nb-select {
  height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--nt-border); background: var(--nt-surface-soft);
  color: var(--nt-text); font-size: .85rem; max-width: 220px;
}
.nt-editor-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nt-editor-actions .nt-icon-btn { width: 36px; height: 36px; }
.nt-editor-actions .is-fav { color: var(--nt-accent); }

/* Toolbar */
.nt-toolbar {
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
  padding: 8px 18px; border-bottom: 1px solid var(--nt-border);
  background: color-mix(in srgb, var(--nt-surface) 60%, var(--nt-bg));
  position: sticky; top: 0; z-index: 5;
}
.nt-tool {
  width: 34px; height: 34px; border-radius: 8px; color: var(--nt-text-soft);
  display: inline-flex; align-items: center; justify-content: center; font-size: .9rem;
  transition: background .12s ease, color .12s ease;
}
.nt-tool:hover { background: var(--nt-surface-soft); color: var(--nt-text); }
.nt-tool.is-on { background: var(--nt-accent-soft); color: var(--nt-accent-strong); }
[data-theme="dark"] .nt-tool.is-on { color: var(--nt-accent); }
.nt-tool-sep { width: 1px; height: 22px; background: var(--nt-border); margin: 0 4px; }
.nt-block-select {
  height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--nt-border);
  background: var(--nt-surface-soft); color: var(--nt-text); font-size: .84rem; font-weight: 600;
}

.nt-editor-scroll { flex: 1; overflow-y: auto; padding: 30px clamp(18px, 6vw, 80px) 120px; }
.nt-editor-inner { max-width: 760px; margin: 0 auto; }

.nt-title {
  width: 100%; border: 0; background: none; outline: none; resize: none;
  font-size: 2rem; font-weight: 750; line-height: 1.2; color: var(--nt-text);
  font-family: inherit; overflow: hidden; padding: 0; margin: 0;
  min-height: 1.3em; display: block;
}
.nt-title::placeholder { color: var(--nt-text-faint); }

.nt-tags-edit { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; align-items: center; }
.nt-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px 3px 10px; border-radius: 20px; font-size: .78rem;
  background: var(--nt-surface-soft); color: var(--nt-text-soft); border: 1px solid var(--nt-border);
}
.nt-tag button { color: var(--nt-text-faint); font-size: .7rem; width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.nt-tag button:hover { background: var(--nt-danger); color: #fff; }
.nt-tag-add {
  border: 1px dashed var(--nt-border-strong); background: none; color: var(--nt-text-faint);
  padding: 3px 10px; border-radius: 20px; font-size: .78rem;
}
.nt-tag-add:hover { color: var(--nt-accent-strong); border-color: var(--nt-accent); }
.nt-tag-input {
  width: 120px; border: 1px solid var(--nt-accent); background: var(--nt-surface);
  border-radius: 20px; padding: 3px 10px; font-size: .78rem; outline: none;
}

/* Rich content */
.nt-body {
  margin-top: 18px; outline: none; min-height: 320px;
  font-size: 1.02rem; line-height: 1.72; color: var(--nt-text);
  word-break: break-word;
}
.nt-body:empty::before {
  content: attr(data-placeholder); color: var(--nt-text-faint); pointer-events: none;
}
.nt-body > *:first-child { margin-top: 0; }
.nt-body p { margin: 0 0 .7em; }
.nt-body h1 { font-size: 1.6rem; font-weight: 720; margin: 1.2em 0 .4em; line-height: 1.25; }
.nt-body h2 { font-size: 1.32rem; font-weight: 700; margin: 1.1em 0 .35em; line-height: 1.3; }
.nt-body h3 { font-size: 1.12rem; font-weight: 680; margin: 1em 0 .3em; }
.nt-body ul, .nt-body ol { margin: 0 0 .7em; padding-left: 1.5em; }
.nt-body li { margin: .18em 0; }
.nt-body blockquote {
  margin: .6em 0; padding: .3em 0 .3em 1em; border-left: 3px solid var(--nt-accent);
  color: var(--nt-text-soft); font-style: italic;
}
.nt-body pre {
  margin: .7em 0; padding: 14px 16px; border-radius: 12px; overflow-x: auto;
  background: var(--nt-surface-soft); border: 1px solid var(--nt-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.55;
}
.nt-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em;
  background: var(--nt-surface-soft); border: 1px solid var(--nt-border);
  padding: .08em .38em; border-radius: 6px;
}
.nt-body pre code { background: none; border: 0; padding: 0; }
.nt-body a { color: var(--nt-accent-strong); text-decoration: underline; text-underline-offset: 2px; }
[data-theme="dark"] .nt-body a { color: var(--nt-accent); }
.nt-body mark { background: var(--nt-mark); color: inherit; border-radius: 3px; padding: .02em .15em; }
.nt-body hr { border: 0; border-top: 1px solid var(--nt-border-strong); margin: 1.4em 0; }
.nt-body img { max-width: 100%; border-radius: 10px; }

/* Checklist */
.nt-body ul.nt-check { list-style: none; padding-left: 0; }
.nt-body ul.nt-check > li {
  position: relative; padding-left: 30px; cursor: default;
}
.nt-body ul.nt-check > li::before {
  content: ""; position: absolute; left: 0; top: .28em;
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--nt-border-strong); background: var(--nt-surface);
  cursor: pointer; transition: background .12s ease, border-color .12s ease;
}
.nt-body ul.nt-check > li.nt-done::before {
  background: var(--nt-accent); border-color: var(--nt-accent);
}
.nt-body ul.nt-check > li.nt-done::after {
  content: "\2713"; position: absolute; left: 3px; top: .16em;
  color: #fff; font-size: .82rem; font-weight: 700; cursor: pointer;
}
[data-theme="dark"] .nt-body ul.nt-check > li.nt-done::after { color: #23180a; }
.nt-body ul.nt-check > li.nt-done { color: var(--nt-text-faint); text-decoration: line-through; }

.nt-editor-foot {
  padding: 9px 18px; border-top: 1px solid var(--nt-border); background: var(--nt-surface);
  font-size: .76rem; color: var(--nt-text-faint); display: flex; align-items: center; gap: 8px;
}
.nt-save-slot { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.nt-save-slot i { font-size: .82rem; }
.nt-save-ok { color: var(--nt-success); }
.nt-save-pending { color: var(--nt-text-soft); }
.nt-save-err { color: var(--nt-danger); }

/* ---------- Empty states ---------- */
.nt-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px; color: var(--nt-text-soft); gap: 8px;
}
.nt-empty-icon {
  width: 74px; height: 74px; border-radius: 22px; margin-bottom: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.9rem;
  color: var(--nt-accent-strong); background: var(--nt-accent-soft);
}
[data-theme="dark"] .nt-empty-icon { color: var(--nt-accent); }
.nt-empty h3 { margin: 0; font-size: 1.15rem; color: var(--nt-text); }
.nt-empty p { margin: 0; max-width: 340px; font-size: .9rem; line-height: 1.5; }
.nt-empty .nt-btn { margin-top: 14px; }
.nt-list-empty { padding: 30px 18px; text-align: center; color: var(--nt-text-faint); font-size: .88rem; }

/* ---------- Toasts ---------- */
.nt-toast-region {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.nt-toast {
  background: var(--nt-text); color: var(--nt-bg);
  padding: 11px 18px; border-radius: 12px; font-size: .88rem; font-weight: 500;
  box-shadow: var(--nt-shadow-pop); max-width: min(90vw, 420px);
  animation: nt-toast-in .22s ease;
}
.nt-toast.is-error { background: var(--nt-danger); color: #fff; }
@keyframes nt-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Dialogs ---------- */
.nt-dialog {
  border: 0; padding: 0; background: transparent; color: inherit;
  max-width: 460px; width: calc(100% - 32px);
}
.nt-dialog::backdrop { background: rgba(20, 16, 6, 0.42); backdrop-filter: blur(2px); }
.nt-dialog-panel {
  background: var(--nt-surface); border-radius: var(--nt-radius);
  box-shadow: var(--nt-shadow-pop); border: 1px solid var(--nt-border); overflow: hidden;
}
.nt-dialog-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 8px;
}
.nt-dialog-header h2 { margin: 0; font-size: 1.15rem; }
.nt-dialog-body { padding: 6px 18px 12px; display: flex; flex-direction: column; gap: 14px; }
.nt-dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px 18px; }
.nt-field { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--nt-text-soft); }
.nt-field > span { font-weight: 600; }
.nt-field input[type="text"] {
  height: 42px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--nt-border); background: var(--nt-surface-soft); color: var(--nt-text); outline: none;
}
.nt-field input[type="text"]:focus { border-color: var(--nt-accent); background: var(--nt-surface); }
.nt-color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.nt-color {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; position: relative;
  border: 2px solid transparent; transition: transform .12s ease;
}
.nt-color:hover { transform: scale(1.1); }
.nt-color.is-selected { border-color: var(--nt-text); }
.nt-color.is-selected::after { content: "\2713"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 700; }
.nt-form-error { color: var(--nt-danger); font-size: .84rem; }
.nt-confirm-dialog .nt-dialog-body p { margin: 0; line-height: 1.5; color: var(--nt-text-soft); }

/* ---------- Popover menu ---------- */
.nt-menu {
  position: fixed; z-index: 95; min-width: 190px;
  background: var(--nt-surface); border: 1px solid var(--nt-border);
  border-radius: 12px; box-shadow: var(--nt-shadow-pop); padding: 6px; overflow: hidden;
}
.nt-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 8px; color: var(--nt-text); font-size: .88rem;
}
.nt-menu button i { width: 16px; text-align: center; color: var(--nt-text-faint); }
.nt-menu button:hover { background: var(--nt-surface-soft); }
.nt-menu button.is-danger { color: var(--nt-danger); }
.nt-menu button.is-danger i { color: var(--nt-danger); }
.nt-menu hr { border: 0; border-top: 1px solid var(--nt-border); margin: 5px 0; }

/* ---------- Guest offset ---------- */
body:has(#guest-banner:not([hidden])) { --nt-auth-offset: 48px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  :root { --nt-sidebar-width: 210px; --nt-list-width: 280px; }
}

@media (max-width: 860px) {
  .nt-shell { grid-template-columns: 1fr; position: relative; }
  .nt-sidebar {
    position: absolute; inset: 0 auto 0 0; width: 280px; z-index: 30;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--nt-shadow-pop);
  }
  .nt-shell[data-sidebar="open"] .nt-sidebar { transform: translateX(0); }
  .nt-shell::after {
    content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.32); opacity: 0; pointer-events: none;
    transition: opacity .2s ease; z-index: 25;
  }
  .nt-shell[data-sidebar="open"]::after { opacity: 1; pointer-events: auto; }

  .nt-list-pane, .nt-editor-pane { grid-column: 1; grid-row: 1; }
  .nt-list-pane { display: flex; }
  .nt-editor-pane { display: none; }
  .nt-shell[data-pane="editor"] .nt-list-pane { display: none; }
  .nt-shell[data-pane="editor"] .nt-editor-pane { display: flex; }

  .nt-list-back { display: inline-flex; }
  .nt-editor-back { display: inline-flex; }
  .nt-search { max-width: none; }
  .nt-brand-copy small { display: none; }
}

@media (max-width: 560px) {
  .nt-header { gap: 8px; padding: 0 12px; }
  .nt-btn-primary span { display: none; }
  .nt-btn-primary { padding: 0; width: 42px; justify-content: center; }
  .nt-brand-copy { display: none; }
  .nt-editor-scroll { padding: 22px 18px 110px; }
  .nt-title { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
