:root {
  --bg: #fcfbf8;
  --surface: #ffffff;
  --text: #3a3f4a;
  --muted: #8b8b8b;
  --line-soft: rgba(0, 0, 0, 0.06);
  --accent: #db4c3f;
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #d6d6d6 transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}



.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.left-action-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.right-action-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.note-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #f0f0f0;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: all 0.18s ease;
}

.note-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.note-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.note-card-preview {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.note-card-meta {
  font-size: 0.75rem;
  color: #bbb;
}



body {
  min-height: 100vh;
}

.page {
  padding: 28px 20px 48px;
}

.shell {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.shell-narrow {
  width: min(760px, 100%);
}

.shell-wide {
  width: min(1100px, 100%);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}

.goals-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

.page-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.top-links {
  display: flex;
  gap: 16px;
}

.text-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.18s ease;
  white-space: nowrap;
}

.text-link:hover {
  color: var(--text);
}

.section-title {
  margin: 0 0 14px 0;
  font-size: 1rem;
  font-weight: 600;
}

.surface-block {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

/* Calendar */

.calendar-panel {
  position: sticky;
  top: 20px;
  margin-top: 50px;
}

.calendar-header .page-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}


.task-count-link {
  display: block;
  margin-bottom: 12px;
  color: #1f1f1f;
}


.calendar-card {
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  padding: 14px 12px 12px;
}

.calendar-topbar {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  margin-bottom: 14px;
}

.calendar-month-label {
  text-align: center;
  font-size: 0.98rem;
  font-weight: 600;
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: 1.2rem;
}

.calendar-nav-btn:hover {
  background: #f4f3ef;
  color: var(--text);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}

.calendar-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 0.76rem;
  padding: 6px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--text);
  border-radius: 12px;
}

.calendar-day:hover {
  background: #f5f3ef;
}

.calendar-day.muted {
  color: #c2c0bb;
}

.calendar-day.today .calendar-day-number {
  font-weight: 700;
}

.calendar-day.selected {
  background: #efede7;
}

.calendar-day.has-note .calendar-day-number {
  font-weight: 600;
}

.calendar-day-number {
  font-size: 0.92rem;
}

.calendar-dot {
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

/* Editor */

.editor-panel {
  min-width: 0;
}

.persistent-note-editor {
  display: block;
  width: 100%;
  min-height: 500px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.8;
  letter-spacing: -0.01em;
  font-family: inherit;
  padding: 0;
  overflow-y: auto;
}

.editor-form {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 22px 22px 18px;
  display: block;
}

.note-editor {
  display: block;
  width: 100%;
  min-height: 500px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.8;
  letter-spacing: -0.01em;
  font-family: inherit;
  padding: 14px 24px;
  overflow-y: auto;
}

.note-editor::placeholder {
  color: #b2b2b2;
}

/* Dashboard Tiptap editor */

.dash-tiptap {
  min-height: 420px;
  font-size: 1.04rem;
  line-height: 1.8;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 14px 24px;
}

.dash-tiptap .ProseMirror {
  outline: none;
  min-height: 420px;
}

.dash-tiptap .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: #b2b2b2;
  pointer-events: none;
  float: left;
  height: 0;
}

.dash-tiptap .ProseMirror > * + * { margin-top: 0.75em; }
.dash-tiptap h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin: 1.2em 0 0.3em; }
.dash-tiptap h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; margin: 1em 0 0.3em; }
.dash-tiptap h3 { font-size: 1.05rem; font-weight: 600; margin: 1em 0 0.3em; }
.dash-tiptap p  { margin: 0; }
.dash-tiptap ul, .dash-tiptap ol { padding-left: 1.4em; margin: 0.4em 0; }
.dash-tiptap li { margin: 0.2em 0; }
.dash-tiptap blockquote { border-left: 3px solid #d0ccc5; margin: 0.8em 0; padding: 0.3em 0 0.3em 1em; color: var(--muted); font-style: italic; }
.dash-tiptap code { background: #f4f1ec; padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; font-family: ui-monospace, monospace; }
.dash-tiptap pre { background: #f4f1ec; padding: 1em 1.2em; border-radius: 10px; overflow-x: auto; margin: 0.8em 0; }
.dash-tiptap pre code { background: none; padding: 0; }
.dash-tiptap hr { border: none; border-top: 1px solid var(--line-soft); margin: 1.4em 0; }
.dash-tiptap ul[data-type="taskList"] { list-style: none; padding-left: 0.2em; }
.dash-tiptap ul[data-type="taskList"] li { display: flex; align-items: center; gap: 8px; }
.dash-tiptap ul[data-type="taskList"] li > label { flex-shrink: 0; cursor: pointer; display: flex; align-items: center; }
.dash-tiptap ul[data-type="taskList"] li > label input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.dash-tiptap ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.dash-tiptap ul[data-type="taskList"] li > div > p { margin: 0; }
.dash-tiptap ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--muted); text-decoration: line-through; }

/* ── Table toolbar ── */
.table-toolbar { position:absolute; z-index:500; display:flex; align-items:center; gap:4px; background:#fff; border:1px solid rgba(70,99,108,0.12); border-radius:10px; padding:5px 8px; box-shadow:0 4px 14px rgba(40,55,70,0.12); }
.table-toolbar.hidden { display:none; }
.tt-btn { border:none; background:transparent; font-size:0.72rem; font-weight:600; color:#46636c; cursor:pointer; padding:4px 8px; border-radius:6px; font-family:inherit; white-space:nowrap; }
.tt-btn:hover { background:#f0f4f6; }
.tt-btn.danger { color:#e06060; }
.tt-btn.danger:hover { background:#fef2f2; }
.tt-sep { width:1px; height:16px; background:#e5ebee; margin:0 2px; }

/* ── Tables ── */
.dash-tiptap table, .ne-tiptap table { border-collapse: collapse; width: 100%; margin: 0.8em 0; border-radius: 8px; overflow: hidden; }
.dash-tiptap th, .ne-tiptap th { background: #f0f4f6; font-weight: 600; font-size: 0.82rem; color: #46636c; padding: 8px 12px; border: 1px solid #dde6e9; text-align: left; }
.dash-tiptap td, .ne-tiptap td { padding: 7px 12px; border: 1px solid #dde6e9; font-size: 0.85rem; color: #3a5560; vertical-align: top; }
.dash-tiptap td p, .ne-tiptap td p, .dash-tiptap th p, .ne-tiptap th p { margin: 0; }
.dash-tiptap tr:hover td, .ne-tiptap tr:hover td { background: #f8fafb; }

/* ── Toggle block (div-based) ── */
.dash-tiptap [data-type="toggle-block"], .ne-tiptap [data-type="toggle-block"] { border-left: 2px solid #dde6e9; padding-left: 12px; margin: 0.6em 0; }
.dash-tiptap [data-type="toggle-summary"], .ne-tiptap [data-type="toggle-summary"] { cursor: pointer; font-weight: 600; color: #46636c; font-size: 0.9rem; padding: 2px 0; display: flex; align-items: center; gap: 6px; user-select: none; }
.dash-tiptap [data-type="toggle-summary"]::before, .ne-tiptap [data-type="toggle-summary"]::before { content: '▶'; font-size: 0.6rem; color: #a5b4bc; transition: transform 0.2s; flex-shrink: 0; pointer-events: none; }
.dash-tiptap [data-type="toggle-block"][data-open="true"] [data-type="toggle-summary"]::before, .ne-tiptap [data-type="toggle-block"][data-open="true"] [data-type="toggle-summary"]::before { transform: rotate(90deg); }
.dash-tiptap [data-type="toggle-block"][data-open="false"] > *:not([data-type="toggle-summary"]), .ne-tiptap [data-type="toggle-block"][data-open="false"] > *:not([data-type="toggle-summary"]) { display: none; }
.dash-tiptap [data-type="toggle-block"] > *:not([data-type="toggle-summary"]), .ne-tiptap [data-type="toggle-block"] > *:not([data-type="toggle-summary"]) { margin-top: 6px; }

/* ── Image node view ── */
.img-nv { display: block; position: relative; line-height: 0; margin: 0.6em 0; max-width: 100%; }
.img-nv img { border-radius: 6px; max-width: 100%; display: block; }
.img-nv.selected img { outline: 2px solid #3F51B5; border-radius: 6px; }
.img-nv-toolbar { display: none; position: absolute; top: -34px; left: 50%; transform: translateX(-50%); background: #2a3540; border-radius: 8px; padding: 3px 5px; gap: 2px; z-index: 200; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.img-nv.selected .img-nv-toolbar { display: flex; align-items: center; }
.img-nv-btn { background: transparent; border: none; color: #e2eaed; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 5px; cursor: pointer; font-family: inherit; letter-spacing: 0.03em; }
.img-nv-btn:hover { background: rgba(255,255,255,0.12); }
.img-nv-handle { display: none; position: absolute; bottom: 5px; right: 5px; width: 13px; height: 13px; background: #3F51B5; border-radius: 3px; cursor: se-resize; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.img-nv.selected .img-nv-handle { display: block; }

.editor-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.primary-btn,
.ghost-btn,
.filter-select,
.check-circle,
.delete-task-btn,
.task-input,
.task-tag-select,
.goal-value-input {
  font: inherit;
}

.primary-btn {
  border: none;
  background: var(--text);
  color: white;
  padding: 10px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.94rem;
}

.primary-btn:hover {
  opacity: 0.92;
}

.ghost-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 2px;
  font-size: 0.93rem;
}

.ghost-btn:hover {
  color: var(--text);
}

.small-ghost-btn {
  font-size: 0.86rem;
}

/* note editor */

.note-editor-wrap {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 20px;
}

.note-title-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  background: transparent;
  margin-bottom: 24px;
  font-family: inherit;
}

.note-title-input::placeholder {
  color: #ccc;
}

#editor {
  min-height: 400px;
  outline: none;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}

/* Save status */

.save-status {
  font-size: 0.85rem;
  color: #aaa;
  transition: color 0.2s;
}

.save-status.saved { color: #aaa; }
.save-status.error { color: var(--accent); }

/* Slash command menu */

.slash-menu {
  position: absolute;
  z-index: 999;
  width: 240px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.06);
  padding: 6px;
  overflow: hidden;
}

.slash-menu.hidden { display: none; }

.slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 8px;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}

.slash-item:hover,
.slash-item.is-selected {
  background: #f5f3ef;
}

.slash-item-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: #f0ede8;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  font-family: ui-monospace, monospace;
}

.slash-item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.slash-item-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.slash-item-hint {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tiptap editor content */

.tiptap-editor {
  min-height: 500px;
  outline: none;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}

.tiptap-editor .ProseMirror {
  outline: none;
  min-height: 500px;
}

.tiptap-editor .ProseMirror > * + * {
  margin-top: 0.75em;
}

.tiptap-editor h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 1.2em 0 0.3em;
}

.tiptap-editor h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 1em 0 0.3em;
}

.tiptap-editor h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1em 0 0.3em;
}

.tiptap-editor p { margin: 0; }

.tiptap-editor ul,
.tiptap-editor ol {
  padding-left: 1.4em;
  margin: 0.4em 0;
}

.tiptap-editor li { margin: 0.2em 0; }

.tiptap-editor blockquote {
  border-left: 3px solid #d0ccc5;
  margin: 0.8em 0;
  padding: 0.3em 0 0.3em 1em;
  color: var(--muted);
  font-style: italic;
}

.tiptap-editor code {
  background: #f4f1ec;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: ui-monospace, monospace;
}

.tiptap-editor pre {
  background: #f4f1ec;
  padding: 1em 1.2em;
  border-radius: 10px;
  overflow-x: auto;
  margin: 0.8em 0;
}

.tiptap-editor pre code {
  background: none;
  padding: 0;
}

.tiptap-editor hr {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 1.4em 0;
}

.tiptap-editor .ProseMirror p.is-editor-empty:first-child::before {
  content: 'Type "/" for commands…';
  color: #bbb;
  pointer-events: none;
  float: left;
  height: 0;
}

/* Task list (checkbox) */

.tiptap-editor ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0.2em;
}

.tiptap-editor ul[data-type="taskList"] li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tiptap-editor ul[data-type="taskList"] li > label {
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.tiptap-editor ul[data-type="taskList"] li > label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

.tiptap-editor ul[data-type="taskList"] li > div {
  flex: 1;
  min-width: 0;
}

.tiptap-editor ul[data-type="taskList"] li > div > p {
  margin: 0;
}

.tiptap-editor ul[data-type="taskList"] li[data-checked="true"] > div {
  color: var(--muted);
  text-decoration: line-through;
}

/* White editor card */

.tiptap-editor-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 22px 26px 28px;
}

/* Bubble menu */

.bubble-menu {
  position: absolute;
  z-index: 1000;
  background: #1f1f1f;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  padding: 5px 6px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.bubble-menu.hidden { display: none; }

.bubble-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.bubble-btn {
  border: none;
  background: transparent;
  color: #d0d0d0;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}

.bubble-btn:hover { background: #333; color: #fff; }
.bubble-btn.is-active { background: #3a3a3a; color: #fff; }

.bubble-btn.b-italic  { font-style: italic; }
.bubble-btn.b-strike  { text-decoration: line-through; }
.bubble-btn.b-code    { font-family: ui-monospace, monospace; font-weight: 400; }

.bubble-sep {
  width: 1px;
  height: 16px;
  background: #3a3a3a;
  margin: 0 3px;
  flex-shrink: 0;
}

/* Bubble sub-panels (colors / highlights) */

.bubble-swatches {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 0;
}

.bubble-swatches.hidden { display: none; }

.bubble-back {
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  padding: 2px 4px;
  text-align: left;
}

.bubble-back:hover { color: #fff; }

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.12);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s, border-color 0.1s;
}

.swatch:hover {
  transform: scale(1.18);
  border-color: rgba(255,255,255,0.5);
}

.swatch-clear {
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: inherit;
  padding: 2px 0;
  text-align: left;
}

.swatch-clear:hover { color: #fff; }

/* Drag handle */

.block-drag-handle {
  position: fixed;
  display: none;
  cursor: grab;
  color: #bbb;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
  z-index: 100;
}

.block-drag-handle:hover {
  background: #f0ede8;
  color: var(--text);
}

.block-drag-handle:active { cursor: grabbing; }

/* ProseMirror native drop cursor */
.ProseMirror-dropcursor { border-top: 2px solid #3F51B5 !important; }

/* Drop indicator line */

.drop-line {
  position: fixed;
  height: 2px;
  background: #3b82f6;
  border-radius: 2px;
  pointer-events: none;
  display: none;
  z-index: 200;
}

/* Tasks */

.task-add-bar {
  margin-bottom: 20px;
}

.add-task-form {
  display: grid;
  grid-template-columns: 1fr 170px auto;
  gap: 10px;
  align-items: center;
}

.task-input,
.task-tag-select,
.goal-value-input,
.boolean-select {
  border: none;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.95rem;
  outline: none;
}

.task-input::placeholder,
.goal-value-input::placeholder {
  color: #b2b2b2;
}

.task-toolbar {
  margin-bottom: 14px;
}

.filter-select {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  padding: 4px 0;
}

.filter-select:hover {
  color: var(--text);
}

.task-list {
  display: flex;
  flex-direction: column;
}

.task-row {
  display: grid;
  grid-template-columns: 42px 1fr 32px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

.task-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.task-text {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.task-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f3f1;
  color: #8a8a84;
  font-size: 0.78rem;
  white-space: nowrap;
}

.task-row.done .task-text {
  opacity: 0.42;
  text-decoration: line-through;
}

.task-row.done .task-tag {
  opacity: 0.6;
}

.task-action-form,
.inline-form {
  margin: 0;
}

.check-circle {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.check-circle-inner {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1.6px solid #d6d6d2;
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.78rem;
  line-height: 1;
}

.check-circle-inner.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.delete-task-btn {
  border: none;
  background: transparent;
  color: #c8c8c3;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
  opacity: 0;
}

.task-row:hover .delete-task-btn {
  opacity: 1;
}

.delete-task-btn:hover {
  color: var(--accent);
}

.empty-state {
  padding: 28px 0;
  color: var(--muted);
  font-size: 1rem;
}

/* Goals */

.goal-create-form {
  display: grid;
  gap: 10px;
}

.goal-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.goal-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.goal-row-inactive {
  opacity: 0.55;
}

.goal-name {
  font-size: 1rem;
  font-weight: 600;
}

.goal-submeta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.goal-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.goals-head {
  margin-bottom: 8px;
}

/* Scrollbar */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
  margin: 20px 0;
}

::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: #d6d6d6;
}

/* Show scrollbar only on hover for any scrollable container */
*:hover::-webkit-scrollbar-thumb {
  background: #d6d6d6;
}

/* Auto-collapse sidebar at narrow viewports — see consolidated rule at bottom */

/* Responsive */

@media (max-width: 980px) {
  .dashboard-grid,
  .goals-layout {
    grid-template-columns: 1fr;
  }

  .calendar-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 24px 16px 40px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
  }

  .top-links {
    gap: 12px;
  }

  .page-title {
    font-size: 1.45rem;
  }

  .editor-form,
  .calendar-card,
  .surface-block {
    border-radius: 20px;
  }

  .note-editor {
    min-height: 420px;
    font-size: 1rem;
    line-height: 1.7;
    padding: 10px 18px;
  }

  .add-task-form,
  .goal-row,
  .goal-controls {
    grid-template-columns: 1fr;
  }

  .task-row {
    grid-template-columns: 38px 1fr 24px;
    gap: 10px;
  }

  .task-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .delete-task-btn {
    opacity: 1;
  }
}

.counter-card {
  margin-top: 14px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  padding: 12px 10px;
}

.counter-title {
  margin: 0 0 8px 2px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.counter-item {
  padding: 8px 4px;
  text-align: center;
}

.counter-item h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.counter-item p {
  margin: 4px 0 0;
  font-size: 0.7rem;
  color: var(--muted);
}




/* ── Daily Notes redesign ────────────────────────────────────────────────── */

/* Scoped palette — only affects the Daily Notes page */
.dn-page {
  --bg:      #e9edf9;
  --surface: #ffffff;
  --text:    #1f2a2e;
  /* --muted:   #6b7c8a;
  --accent:  #005691; */
  --line-soft: rgba(0, 48, 73, 0.08);
  --shadow-soft: 0 4px 20px rgba(0, 48, 73, 0.06), 0 12px 40px rgba(0, 48, 73, 0.08);
  padding: 16px;
  overflow: hidden;
  height: 100vh;
  box-sizing: border-box;
  background: #e9edf9;
}

.dn-shell {
  --dn-sidebar-w: 260px;
  display: grid;
  grid-template-columns: var(--dn-sidebar-w) 1fr 280px;
  height: calc(100vh - 32px);
  gap: 12px;
  transition: grid-template-columns 0.22s ease;
}

.dn-shell.sidebar-collapsed {
  --dn-sidebar-w: 60px;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.dn-sidebar {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 2px 40px rgba(0, 20, 80, 0.07);
}

.dn-sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 0 0;
  overflow: hidden;
}

.dn-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 20px;
  flex-shrink: 0;
}

.dn-brand-wrap {
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.dn-brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #005691;
  white-space: nowrap;
  display: block;
  opacity: 1;
  transition: opacity 0.18s;
  font-family: 'Manrope', 'Inter', sans-serif;
}

.sidebar-collapsed .dn-brand {
  opacity: 0;
  pointer-events: none;
}

.dn-collapse-btn {
  border: none;
  background: transparent;
  color: #8a9ea5;
  cursor: pointer;
  padding: 5px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s, transform 0.22s;
}

.dn-collapse-btn:hover {
  color: #005691;
  background: rgba(0, 48, 73, 0.08);
}

.sidebar-collapsed .dn-collapse-btn {
  transform: rotate(180deg);
}

/* Nav */

.dn-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 8px;
  flex-shrink: 0;
}

.dn-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: #8a9ea5;
  font-size: 0.87rem;
  font-weight: 500;
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
  overflow: hidden;
}

.dn-nav-item:hover {
  background: rgba(0, 48, 73, 0.06);
  color: #005691;
}

.dn-nav-item.active {
  background: rgba(0, 48, 73, 0.08);
  color: #005691;
  font-weight: 600;
  border-right: 2px solid #005691;
}

.dn-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.dn-nav-label {
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.18s;
}

.sidebar-collapsed .dn-nav-label {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
  flex-shrink: 1;
}

/* ── Compact fading calendar ────────────────────────────────────────────── */

.dn-cal-section {
  margin-top: 20px;
  padding: 0 10px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 1;
  transition: opacity 0.18s;
}

.sidebar-collapsed .dn-cal-section {
  opacity: 0;
  pointer-events: none;
}

.sidebar-collapsed .dn-countdown-widget {
  opacity: 0;
  pointer-events: none;
}

.dn-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.dn-cal-month {
  font-size: 0.7rem;
  font-weight: 600;
  color: #586064;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dn-cal-nav {
  color: #8a9ea5;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 2px 5px;
  border-radius: 5px;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
}

.dn-cal-nav:hover {
  color: #005691;
  background: rgba(0, 48, 73, 0.08);
}

.dn-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 2px;
  flex-shrink: 0;
}

.dn-cal-weekdays span {
  text-align: center;
  font-size: 0.6rem;
  color: #a0b4bc;
  padding: 2px 0;
  font-weight: 500;
}

.dn-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  overflow: hidden;
}

.dn-cal-fade {
  mask-image: none;
  -webkit-mask-image: none;
}

.dn-cal-day {
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #586064;
  font-size: 0.69rem;
  border-radius: 5px;
  transition: background 0.12s, color 0.12s;
}

.dn-cal-day:hover    { background: rgba(0, 48, 73, 0.08); color: #005691; }
.dn-cal-day.muted    { visibility: hidden; pointer-events: none; }
.dn-cal-day.today    { font-weight: 700; color: #005691; }
.dn-cal-day.selected {
  background: #005691;
  color: #ffffff;
  border-radius: 5px;
}
.dn-cal-day.has-note { font-weight: 600; }

.dn-cal-dot {
  position: absolute;
  bottom: 2px;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #005691;
}

.dn-cal-day.selected .dn-cal-dot { background: rgba(255,255,255,0.7); }

/* ── Main content ───────────────────────────────────────────────────────── */

.dn-main {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
  min-height: 0;
}

.dn-header {
  width: 100%;
  max-width: clamp(700px, 68vw, 1080px);
  margin: 0 auto;
  padding: 32px 32px 24px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.dn-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
}

.dn-greeting {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #2c3e50;
  line-height: 1.15;
  font-family: 'Manrope', 'Inter', sans-serif;
}

.dn-date-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dn-date-arrow {
  color: var(--muted);
  text-decoration: none;
  font-size: 1rem;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}

.dn-date-arrow:hover {
  background: rgba(0, 48, 73, 0.08);
  color: #005691;
}

.dn-date-label {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 500;
  padding: 0 2px;
}

/* Search bar */

.dn-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid rgba(70, 99, 108, 0.14);
  border-radius: 10px;
  padding: 7px 12px;
  min-width: 160px;
  position: relative;
}

.dn-search-icon {
  width: 13px;
  height: 13px;
  color: var(--muted);
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.dn-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.83rem;
  color: var(--text);
  font-family: inherit;
  width: 100%;
  cursor: text;
}

.dn-search-input::placeholder { color: #8fa8b0; }

.dn-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(70,99,108,0.13);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,20,80,0.11);
  z-index: 400;
  overflow: hidden;
  display: none;
}
.dn-search-results.open { display: block; }
.dn-search-result-item {
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f3f5f8;
  transition: background 0.11s;
}
.dn-search-result-item:last-child { border-bottom: none; }
.dn-search-result-item:hover { background: #f6f8fc; }
.dn-search-result-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: #3F51B5;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dn-search-result-snippet {
  font-size: 0.8rem;
  color: #6a7f86;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.dn-search-result-snippet mark {
  background: rgba(63,81,181,0.12);
  color: #3F51B5;
  border-radius: 2px;
  padding: 0 1px;
  font-weight: 600;
}
.dn-search-empty {
  padding: 14px 16px;
  font-size: 0.82rem;
  color: #a5b4bc;
  text-align: center;
}
[data-theme="dark"] .dn-search-results { background: #1e2330; border-color: rgba(255,255,255,0.09); box-shadow: 0 8px 28px rgba(0,0,0,0.35); }
[data-theme="dark"] .dn-search-result-item { border-bottom-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .dn-search-result-item:hover { background: #252a38; }
[data-theme="dark"] .dn-search-result-snippet { color: #6a8090; }
[data-theme="dark"] .dn-search-result-snippet mark { background: rgba(91,122,191,0.18); color: #7b9fe8; }

/* ── Editor area ─────────────────────────────────────────────────────────── */

.dn-editor-area {
  width: 100%;
  max-width: clamp(700px, 68vw, 1080px);
  margin: 0 auto;
  padding: 0 32px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}



.dn-editor-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Tiptap quick toolbar — lives inside the card */
.dn-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 0 0 12px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 48, 73, 0.06);
  margin-bottom: 12px;
}

.dn-tb-btn {
  border: none;
  background: transparent;
  color: #8a9ea5;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dn-tb-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.dn-tb-btn:hover     { background: rgba(0,48,73,0.07); color: #005691; }
.dn-tb-btn.is-active { background: rgba(0,48,73,0.09); color: #005691; }

.dn-tb-sep {
  width: 1px;
  height: 14px;
  background: #d6dbd7;
  margin: 0 4px;
  flex-shrink: 0;
}


.dn-tiptap-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 22px 28px 16px;
  box-shadow: 0 4px 20px rgba(0, 48, 73, 0.06), 0 12px 40px rgba(0, 48, 73, 0.08);
  border: none;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.dn-tiptap {
  font-size: 1rem;
  line-height: 1.8;
  letter-spacing: -0.01em;
  color: var(--text);
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.dn-tiptap .ProseMirror {
  outline: none;
  min-height: 100%;
  padding-bottom: 40px;
}

.dn-tiptap .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: #b4c4ca;
  pointer-events: none;
  float: left;
  height: 0;
  font-style: italic;
}

.dn-tiptap .ProseMirror > * + * { margin-top: 0.72em; }
.dn-tiptap h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin: 1.1em 0 0.3em; color: #3a5560; }
.dn-tiptap h2 { font-size: 1.18rem; font-weight: 600; letter-spacing: -0.02em; margin: 1em 0 0.3em; color: #3a5560; }
.dn-tiptap h3 { font-size: 1rem; font-weight: 600; margin: 1em 0 0.3em; color: #3a5560; }
.dn-tiptap p  { margin: 0; }
.dn-tiptap ul, .dn-tiptap ol { padding-left: 1.4em; margin: 0.4em 0; }
.dn-tiptap li { margin: 0.2em 0; }
.dn-tiptap blockquote { border-left: 3px solid rgba(63,81,181,0.25); margin: 0.8em 0; padding: 0.3em 0 0.3em 1em; color: var(--muted); font-style: italic; }
.dn-tiptap code { background: #eef0f8; padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; font-family: ui-monospace, monospace; color: #3F51B5; }
.dn-tiptap pre { background: #eef0f8; padding: 1em 1.2em; border-radius: 10px; overflow-x: auto; margin: 0.8em 0; }
.dn-tiptap pre code { background: none; padding: 0; }
.dn-tiptap hr { border: none; border-top: 1px solid var(--line-soft); margin: 1.4em 0; }
.dn-tiptap ul[data-type="taskList"] { list-style: none; padding-left: 0.2em; }
.dn-tiptap ul[data-type="taskList"] li { display: flex; align-items: center; gap: 8px; }
.dn-tiptap ul[data-type="taskList"] li > label { flex-shrink: 0; cursor: pointer; display: flex; align-items: center; }
.dn-tiptap ul[data-type="taskList"] li > label input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.dn-tiptap ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.dn-tiptap ul[data-type="taskList"] li > div > p { margin: 0; }
.dn-tiptap ul[data-type="taskList"] li[data-checked="true"] > div { color: var(--muted); text-decoration: line-through; }

.dn-editor-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(0, 48, 73, 0.06);
  margin-top: 2px;
}

.dn-footer-words { font-size: 0.72rem; color: #a5b4bc; }
.dn-footer-sep   { font-size: 0.72rem; color: #c8d4d8; }

.dn-save-status { font-size: 0.72rem; font-weight: 500; display: flex; align-items: center; gap: 5px; transition: color 0.3s; color: #a5b4bc; }
.dn-save-status.saving { color: #a5b4bc; }
.dn-save-status.saved  { color: #4caf7d; }
.dn-save-status.error  { color: #e06060; }
.dn-save-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0; transition: opacity 0.3s; }
.dn-save-status.saved .dn-save-dot { opacity: 1; }

/* AI Extract icon button */
.dn-extract-btn {
  margin-left: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

/* The uiverse-style AI button */
.dn-ai-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #005691 0%, #004a73 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,48,73,0.35);
}
.dn-ai-btn:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(0,48,73,0.45); }
.dn-ai-btn:active { transform: scale(0.96); }
.dn-ai-btn svg { width: 18px; height: 18px; }
.dn-ai-btn-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(0,48,73,0.22);
  animation: dn-ai-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes dn-ai-pulse {
  0%,100% { opacity: 0; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.12); }
}
.dn-ai-btn.extracting {
  transition: none;
  animation: dn-ai-shake 0.5s ease forwards;
}
.dn-ai-btn.loading svg {
  animation: dn-ai-spin 1s linear infinite;
}
.dn-ai-btn.done {
  background: linear-gradient(135deg, #4caf7d 0%, #43a047 100%);
  box-shadow: 0 2px 10px rgba(76,175,80,0.4);
  transition: background 0.4s, box-shadow 0.4s;
}
@keyframes dn-ai-shake {
  0%,100% { transform: rotate(0deg) scale(1); }
  20%     { transform: rotate(-14deg) scale(1.12); }
  40%     { transform: rotate(14deg) scale(1.12); }
  60%     { transform: rotate(-9deg) scale(1.05); }
  80%     { transform: rotate(9deg) scale(1.05); }
}
@keyframes dn-ai-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.dn-ai-btn-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #3a5560;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 6px;
  padding: 4px 9px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  font-family: inherit;
}
.dn-extract-btn:hover .dn-ai-btn-tooltip { opacity: 1; }

/* ── Right panel ─────────────────────────────────────────────────────────── */

.dn-right {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  border-left: none;
  background: #ffffff;
  border-radius: 20px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
}

.dn-right-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-shrink: 0;
}


.dn-right-header-icon {
  width: 32px;
  height: 32px;
  background: #dde8ef;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dn-right-header-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #2c3e50;
  font-family: 'Manrope', 'Inter', sans-serif;
}

.dn-widget {
  background: #ffffff;
  border-radius: 14px;
  padding: 15px 16px 17px;
  /* box-shadow: 0 2px 8px rgba(0, 48, 73, 0.06), 0 1px 3px rgba(0, 48, 73, 0.04); */
  border: none;
  flex-shrink: 0;
  margin-bottom: 12px;
}

/* Priorities widget — flex:1 so it fills remaining space, scrolls internally */
#dn-top-priorities-widget {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#dn-top-priorities-widget .dn-widget-header { flex-shrink: 0; }

#dn-top-priorities-widget .dn-task-list,
#dn-top-priorities-widget .dn-empty {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

/* Hide scrollbar on task list until hover */
#dn-top-priorities-widget .dn-task-list::-webkit-scrollbar { width: 3px; }
#dn-top-priorities-widget .dn-task-list::-webkit-scrollbar-track { background: transparent; }
#dn-top-priorities-widget .dn-task-list::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; transition: background 0.2s; }
#dn-top-priorities-widget:hover .dn-task-list::-webkit-scrollbar-thumb { background: rgba(0,86,145,0.2); }

/* Hide scrollbar on tiptap editor until hover */
.dn-tiptap::-webkit-scrollbar { width: 4px; }
.dn-tiptap::-webkit-scrollbar-track { background: transparent; }
.dn-tiptap::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; transition: background 0.2s; }
.dn-tiptap-card:hover .dn-tiptap::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }

/* Firefox */
.dn-tiptap { scrollbar-color: transparent transparent; }
.dn-tiptap-card:hover .dn-tiptap { scrollbar-color: rgba(0,0,0,0.12) transparent; }
#dn-top-priorities-widget .dn-task-list { scrollbar-color: transparent transparent; }
#dn-top-priorities-widget:hover .dn-task-list { scrollbar-color: rgba(0,86,145,0.2) transparent; }

.dn-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.dn-widget-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8a9ea5;
}

.dn-view-all {
  font-size: 0.73rem;
  color: #005691;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.14s;
}

.dn-view-all:hover { opacity: 0.7; }

/* Pulse */

.dn-pulse-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #005691;
}

.dn-pulse-bar-track {
  height: 4px;
  background: #dde6ec;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.dn-pulse-bar-fill {
  height: 100%;
  background: #005691;
  border-radius: 999px;
  transition: width 0.35s ease;
  min-width: 0;
}

.dn-pulse-desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #586064;
}

/* Right panel task list */

.dn-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.dn-task-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 0;
  border-bottom: 1px solid #f2f5f6;
}

.dn-task-item:last-child { border-bottom: none; }

.dn-task-check {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
}

.dn-task-check-inner {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #c6d3d8;
  display: grid;
  place-items: center;
  color: white;
  font-size: 0.62rem;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}

.dn-task-check-inner.checked {
  background: #005691;
  border-color: #005691;
}

.dn-task-body {
  flex: 1;
  min-width: 0;
}

.dn-task-text {
  font-size: 0.9rem;
  line-height: 1.45;
  display: block;
  word-break: break-word;
  color: #46636c;
  font-weight: 500;
}

.dn-task-item.done .dn-task-text {
  color: #a8bcc2;
  text-decoration: line-through;
  font-weight: 400;
}

.dn-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
  align-items: center;
}

.dn-task-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 4px;
  background: #eef0f8;
  color: #3F51B5;
  font-size: 0.68rem;
  white-space: nowrap;
  font-weight: 500;
}

.tk-source-icon { flex-shrink:0; position:relative; cursor:default; opacity:0.45; display:inline-flex; align-items:center; justify-content:center; border-radius:4px; transition:opacity 0.13s; }
.tk-source-icon svg { width:13px; height:13px; pointer-events:none; }
.tk-source-icon::after { content:attr(data-tip); position:absolute; bottom:calc(100% + 6px); left:50%; transform:translateX(-50%); background:#3a5560; color:#fff; font-size:0.65rem; font-weight:600; white-space:nowrap; border-radius:5px; padding:3px 8px; opacity:0; pointer-events:none; transition:opacity 0.15s; z-index:100; box-shadow:0 2px 8px rgba(0,0,0,0.18); }
.tk-source-icon:hover { opacity:1; }
.tk-source-icon:hover::after { opacity:1; }
.tk-project-source { cursor:pointer; text-decoration:none; color:inherit; }
/* Dashboard: source icon sits outside meta, aligned right on the li */
.dn-task-item .dn-task-source { margin-left:auto; align-self:stretch; display:flex; align-items:center; padding-left:8px; flex-shrink:0; }

.dn-task-pri {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}
.dn-task-pri.high   { background: #fdecea; color: #ef5350; }
.dn-task-pri.medium { background: #fff8e1; color: #f59e0b; }

.dn-task-time {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  color: #a5b4bc;
}
.dn-task-time svg { flex-shrink:0; }
.dn-task-time.time-soon   { color: #f59e0b; }
.dn-task-time.time-urgent { color: #ef5350; }

.dn-task-check-inner.skipped { background: #e06060; border-color: #e06060; }
.dn-task-item.skipped .dn-task-text { color: #a8bcc2; text-decoration: line-through; font-weight: 400; }

/* ── Countdown widget ─────────────────────────────────────────────────────── */
.dn-countdown-widget { padding: 12px 14px 14px; margin: 8px 8px 8px; background: rgba(0,86,145,0.05); border-radius: 12px; }
.dn-countdown-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.dn-countdown-name { font-size:0.62rem; font-weight:700; letter-spacing:0.09em; text-transform:uppercase; color:#8a9ea5; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:140px; }
.dn-countdown-edit-btn { border:none; background:transparent; color:#c0cdd4; cursor:pointer; border-radius:6px; padding:2px 4px; transition:color 0.13s, background 0.13s; display:flex; align-items:center; }
.dn-countdown-edit-btn:hover { color:#46636c; background:#f0f4f6; }
.dn-countdown-units { display:grid; grid-template-columns:repeat(3,1fr); gap:4px; margin:0 0 4px; }
.dn-countdown-unit { background:#fff; border-radius:7px; padding:6px 4px 5px; text-align:center; }
.dn-countdown-val { font-size:1.1rem; font-weight:800; color:#005691; letter-spacing:-0.03em; line-height:1; display:block; }
.dn-countdown-lbl { font-size:0.54rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:#a5b4bc; margin-top:3px; display:block; }
.dn-countdown-deadline { font-size:0.65rem; color:#b8c9cf; text-align:center; margin-top:4px; }

/* Date picker button */
.dn-date-picker-btn { background:transparent; border:none; cursor:pointer; font-family:inherit; padding:0; }
.dn-date-picker-btn:hover { color:#005691; }

/* Countdown edit modal */
.dn-cd-overlay { position:fixed; inset:0; background:rgba(40,55,70,0.42); display:flex; align-items:center; justify-content:center; z-index:300; backdrop-filter:blur(2px); }
.dn-cd-overlay.hidden { display:none; }
.dn-cd-modal { background:#fff; border-radius:16px; width:min(360px,90vw); padding:22px 24px 26px; box-shadow:0 20px 60px rgba(40,55,70,0.18); }
.dn-cd-modal-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.dn-cd-modal-title { font-size:0.9rem; font-weight:700; color:#3a5560; }
.dn-cd-modal-close { border:none; background:transparent; color:#8a9ea5; cursor:pointer; font-size:1.3rem; line-height:1; }
.dn-cd-modal label { display:block; font-size:0.75rem; font-weight:600; color:#586064; margin:12px 0 4px; }
.dn-cd-modal label:first-of-type { margin-top:0; }
.dn-cd-modal input { width:100%; box-sizing:border-box; border:1px solid rgba(70,99,108,0.15); border-radius:8px; padding:8px 11px; font-size:0.85rem; font-family:inherit; color:#46636c; outline:none; transition:border-color 0.14s; }
.dn-cd-modal input:focus { border-color:#3F51B5; }
.dn-cd-save-btn { width:100%; margin-top:16px; border:none; background:#3F51B5; color:#fff; border-radius:9px; padding:10px; font-size:0.88rem; font-weight:600; cursor:pointer; font-family:inherit; transition:background 0.14s; }
.dn-cd-save-btn:hover { background:#3648a0; }
.dn-cd-clear-btn { width:100%; margin-top:8px; border:1px solid rgba(70,99,108,0.15); background:transparent; color:#8a9ea5; border-radius:9px; padding:9px; font-size:0.82rem; cursor:pointer; font-family:inherit; transition:background 0.14s, color 0.14s; }
.dn-cd-clear-btn:hover { background:#fdf0f0; color:#e06060; border-color:#f0c0c0; }

.dn-empty {
  font-size: 0.82rem;
  color: #8a9ea5;
  margin: 0;
  line-height: 1.5;
}

/* ── Account button + dropdown ────────────────────────────────────────────── */
.dn-account-wrap {
  position: relative;
  padding: 8px 0 8px;
  border-top: 1px solid rgba(0,48,73,0.08);
}
.dn-account-btn {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 10px;
  border: none; background: transparent; cursor: pointer;
  color: #8a9ea5; border-radius: 9px; font-family: inherit;
  font-size: 0.87rem; font-weight: 500; text-align: left;
  white-space: nowrap; overflow: hidden;
  transition: background 0.14s, color 0.14s;
}
.dn-account-btn:hover { background: rgba(0,48,73,0.06); color: #46636c; }
.dn-account-btn svg { flex-shrink: 0; }
.dn-account-name { overflow: hidden; text-overflow: ellipsis; }
.sidebar-collapsed .dn-account-name { opacity: 0; pointer-events: none; }
.dn-account-dd {
  position: fixed;
  background: #fff; border: 1px solid rgba(70,99,108,0.12);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(40,55,70,0.13);
  z-index: 600; overflow: hidden; display: none; min-width: 160px;
}
.dn-account-dd.open { display: block; }
.dn-account-dd-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; font-size: 0.83rem; color: #46636c;
  cursor: pointer; background: transparent; border: none;
  width: 100%; text-align: left; font-family: inherit;
  transition: background 0.12s;
}
.dn-account-dd-item:hover { background: #f5f7fa; }
.dn-account-dd-item.danger { color: #e06060; }
.dn-account-dd-item.danger:hover { background: #fff5f5; }
.dn-account-dd-item svg { flex-shrink: 0; opacity: 0.7; }
.dn-account-dd-sep { height: 1px; background: #f0f3f5; margin: 3px 0; }
/* Settings modal */
.dn-settings-overlay {
  position: fixed; inset: 0; background: rgba(40,55,70,0.42);
  display: flex; align-items: center; justify-content: center;
  z-index: 700; backdrop-filter: blur(2px);
}
.dn-settings-overlay.hidden { display: none; }
.dn-settings-modal {
  background: #fff; border-radius: 18px; width: min(420px, 92vw);
  box-shadow: 0 20px 60px rgba(40,55,70,0.18); overflow: hidden;
}
.dn-settings-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 18px; border-bottom: 1px solid rgba(70,99,108,0.08);
}
.dn-settings-title { font-size: 1rem; font-weight: 700; color: #3a5560; }
.dn-settings-close {
  border: none; background: transparent; color: #8a9ea5;
  cursor: pointer; font-size: 1.4rem; line-height: 1;
}
.dn-settings-close:hover { color: #46636c; }
.dn-settings-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 20px; }
.dn-settings-section-title {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #a5b4bc; margin-bottom: 10px;
}
.dn-settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.dn-settings-row-info { flex: 1; }
.dn-settings-row-label { font-size: 0.88rem; font-weight: 600; color: #3a5560; }
.dn-settings-row-desc { font-size: 0.75rem; color: #8a9ea5; margin-top: 2px; }
.dn-settings-btn {
  border: 1px solid rgba(63,81,181,0.25); background: transparent; color: #3F51B5;
  border-radius: 8px; padding: 7px 14px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background 0.13s, border-color 0.13s;
}
.dn-settings-btn:hover { background: rgba(63,81,181,0.07); border-color: rgba(63,81,181,0.4); }
/* Dark mode */
[data-theme="dark"] .dn-account-wrap { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .dn-account-btn { color: #8a9ea5; }
[data-theme="dark"] .dn-account-btn:hover { background: rgba(255,255,255,0.05); color: #a8c4da; }
[data-theme="dark"] .dn-account-dd { background: #1e2330; border-color: rgba(255,255,255,0.1); box-shadow: 0 8px 28px rgba(0,0,0,0.35); }
[data-theme="dark"] .dn-account-dd-item { color: #b4c4ca; }
[data-theme="dark"] .dn-account-dd-item:hover { background: #252a38; }
[data-theme="dark"] .dn-account-dd-item.danger { color: #e06060; }
[data-theme="dark"] .dn-account-dd-item.danger:hover { background: rgba(224,96,96,0.1); }
[data-theme="dark"] .dn-account-dd-sep { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .dn-settings-overlay { background: rgba(0,0,0,0.6); }
[data-theme="dark"] .dn-settings-modal { background: #1e2330; }
[data-theme="dark"] .dn-settings-hdr { border-bottom-color: rgba(255,255,255,0.07); }
[data-theme="dark"] .dn-settings-title { color: #c8dae6; }
[data-theme="dark"] .dn-settings-close { color: #8a9ea5; }
[data-theme="dark"] .dn-settings-row-label { color: #b4c4ca; }
[data-theme="dark"] .dn-settings-row-desc { color: #4a6070; }
[data-theme="dark"] .dn-settings-btn { border-color: rgba(123,167,204,0.3); color: #7ba7cc; }
[data-theme="dark"] .dn-settings-btn:hover { background: rgba(123,167,204,0.08); }
/* ── Shared confirm / alert dialog ── */
.sea-dialog-overlay {
  position: fixed; inset: 0; background: rgba(40,55,70,0.42);
  display: flex; align-items: center; justify-content: center;
  z-index: 1800; backdrop-filter: blur(2px);
  animation: sea-fade-in 0.18s ease;
}
@keyframes sea-fade-in { from { opacity:0; } to { opacity:1; } }
.sea-dialog {
  background: #fff; border-radius: 18px; width: min(360px, 88vw);
  box-shadow: 0 20px 60px rgba(40,55,70,0.18); overflow: hidden;
  animation: sea-dialog-in 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes sea-dialog-in { from { opacity:0; transform:scale(0.94) translateY(8px); } to { opacity:1; transform:scale(1) translateY(0); } }
.sea-dialog-body { padding: 28px 24px 20px; text-align: center; }
.sea-dialog-icon { font-size: 2rem; margin-bottom: 12px; line-height: 1; }
.sea-dialog-title { font-size: 0.98rem; font-weight: 700; color: #3a5560; margin-bottom: 6px; }
.sea-dialog-msg { font-size: 0.82rem; color: #8a9ea5; line-height: 1.55; }
.sea-dialog-input {
  width: 100%; box-sizing: border-box; margin-top: 14px;
  border: 1px solid rgba(70,99,108,0.2); border-radius: 10px;
  padding: 10px 14px; font-size: 0.9rem; font-family: inherit;
  color: #46636c; outline: none; background: #f8f9fa; transition: border-color 0.14s;
}
.sea-dialog-input:focus { border-color: rgba(63,81,181,0.4); background: #fff; }
.sea-dialog-footer { display: flex; gap: 10px; padding: 0 24px 24px; }
.sea-dialog-cancel {
  flex: 1; border: 1px solid rgba(70,99,108,0.18); background: transparent;
  color: #8a9ea5; border-radius: 10px; padding: 10px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.13s;
}
.sea-dialog-cancel:hover { background: #f5f7fa; }
.sea-dialog-confirm {
  flex: 1; border: none; background: #3F51B5; color: #fff;
  border-radius: 10px; padding: 10px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: background 0.13s;
}
.sea-dialog-confirm:hover { background: #3648a0; }
.sea-dialog-confirm.danger { background: #e06060; }
.sea-dialog-confirm.danger:hover { background: #c85050; }
[data-theme="dark"] .sea-dialog { background: #1e2330; }
[data-theme="dark"] .sea-dialog-title { color: #c8dae6; }
[data-theme="dark"] .sea-dialog-msg { color: #6a8898; }
[data-theme="dark"] .sea-dialog-input { background: #252a38; border-color: rgba(255,255,255,0.1); color: #c8dae6; }
[data-theme="dark"] .sea-dialog-input:focus { border-color: rgba(123,167,204,0.4); background: #2a3040; }
[data-theme="dark"] .sea-dialog-cancel { border-color: rgba(255,255,255,0.1); color: #6a8898; }
[data-theme="dark"] .sea-dialog-cancel:hover { background: #252a38; }

.dn-tips-freq-wrap { position: relative; }
.dn-tips-freq-btn {
  border: 1px solid rgba(63,81,181,0.25); background: transparent; color: #3F51B5;
  border-radius: 8px; padding: 7px 12px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; transition: background 0.13s, border-color 0.13s;
}
.dn-tips-freq-btn:hover { background: rgba(63,81,181,0.07); border-color: rgba(63,81,181,0.4); }
.dn-tips-freq-chevron { font-size: 0.55rem; opacity: 0.7; }
.dn-tips-freq-dd {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid rgba(70,99,108,0.12); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(40,55,70,0.12); z-index: 50; min-width: 140px; overflow: hidden;
}
.dn-tips-freq-dd.hidden { display: none; }
.dn-tips-freq-item {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  padding: 9px 14px; font-size: 0.82rem; font-family: inherit; color: #46636c;
  cursor: pointer; transition: background 0.12s;
}
.dn-tips-freq-item:hover { background: #f5f7fa; }
.dn-tips-freq-item.active { color: #3F51B5; font-weight: 600; }
[data-theme="dark"] .dn-tips-freq-btn { border-color: rgba(123,167,204,0.3); color: #7ba7cc; }
[data-theme="dark"] .dn-tips-freq-btn:hover { background: rgba(123,167,204,0.08); }
[data-theme="dark"] .dn-tips-freq-dd { background: #1e2330; border-color: rgba(255,255,255,0.1); box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
[data-theme="dark"] .dn-tips-freq-item { color: #b4c4ca; }
[data-theme="dark"] .dn-tips-freq-item:hover { background: #252a38; }
[data-theme="dark"] .dn-tips-freq-item.active { color: #7ba7cc; }

/* ── Tips toast ── */
.sea-tip-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 32px rgba(30,50,100,0.14);
  border: 1px solid rgba(63,81,181,0.1);
  z-index: 2000; max-width: 320px; min-width: 260px;
  padding: 14px 16px 10px;
  animation: sea-tip-in 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
.sea-tip-toast.hiding { animation: sea-tip-out 0.25s ease forwards; }
@keyframes sea-tip-in { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes sea-tip-out { to { opacity:0; transform:translateY(12px); } }
.sea-tip-main { display: flex; align-items: flex-start; gap: 10px; }
.sea-tip-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.sea-tip-text { font-size: 0.83rem; color: #46636c; line-height: 1.5; flex: 1; }
.sea-tip-close {
  border: none; background: transparent; color: #c0cdd4;
  cursor: pointer; font-size: 0.85rem; line-height: 1;
  padding: 0; flex-shrink: 0; margin-top: 1px; transition: color 0.13s;
}
.sea-tip-close:hover { color: #8a9ea5; }
.sea-tip-foot {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(63,81,181,0.07);
  font-size: 0.68rem; color: #b8c9cf;
  display: flex; align-items: center; gap: 4px;
}
.sea-tip-disable {
  border: none; background: transparent; color: #b8c9cf;
  font-size: 0.68rem; cursor: pointer; font-family: inherit;
  padding: 0; transition: color 0.13s; text-decoration: underline;
}
.sea-tip-disable:hover { color: #8a9ea5; }
[data-theme="dark"] .sea-tip-toast {
  background: #1e2330; border-color: rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
[data-theme="dark"] .sea-tip-text { color: #b4c4ca; }
[data-theme="dark"] .sea-tip-foot { border-top-color: rgba(255,255,255,0.06); color: #4a6070; }
[data-theme="dark"] .sea-tip-disable { color: #4a6070; }
[data-theme="dark"] .sea-tip-disable:hover { color: #8a9ea5; }
@media (max-width: 768px) {
  .sea-tip-toast { bottom: 80px; right: 12px; left: 12px; max-width: none; }
}

/* ── Mobile: bottom navigation ────────────────────────────────────────────── */
.mob-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #e9edf9;
  border-top: 1px solid rgba(0,48,73,0.08);
  z-index: 500;
  padding-bottom: env(safe-area-inset-bottom);
}
.mob-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  width: 100%;
  height: 62px;
}
.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #b0bec5;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 12px;
  transition: color 0.15s;
  flex: 1;
}
.mob-nav-item.active { color: #3F51B5; }
.mob-nav-item:hover  { color: #3F51B5; }
.mob-nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.mob-nav-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.mob-nav-logout {
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

/* ── Mobile user avatar (top-right, hidden on desktop) ── */
.mob-avatar {
  display: none;
  position: relative;
  flex-shrink: 0;
}
.gn-bell-btn-mob {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(63,81,181,0.1);
  color: #3F51B5;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  position: relative;
  flex-shrink: 0;
  transition: background 0.13s;
}
.gn-bell-btn-mob:hover { background: rgba(63,81,181,0.18); }
[data-theme="dark"] .gn-bell-btn-mob { background: rgba(91,122,191,0.15); color: #7b9fe8; }
[data-theme="dark"] .gn-bell-btn-mob:hover { background: rgba(91,122,191,0.25); }

.mob-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #3F51B5;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.mob-avatar-dd {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid rgba(70,99,108,0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(40,55,70,0.13);
  min-width: 170px;
  overflow: hidden;
  z-index: 1000;
}
.mob-avatar-dd.hidden { display: none; }
.mob-avatar-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  white-space: nowrap;
  font-size: 0.83rem;
  color: #46636c;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.mob-avatar-dd-item:hover { background: #f5f7fa; }
.mob-avatar-dd-item.danger { color: #e06060; }
.mob-avatar-dd-item.danger:hover { background: #fff5f5; }

@media (max-width: 768px) {
  /* ── Layout: show bottom nav, hide sidebar ── */
  .mob-nav { display: flex; }
  .dn-sidebar { display: none !important; }

  /* Pages — no outer padding, full bleed */
  .dn-page, .tk-page, .fn-page, .gp-page, .np-page, .ne-page {
    padding: 0 !important;
    background: var(--mob-bg, #e9edf9);
  }

  /* Shells — single column, no gap */
  .dn-shell, .tk-shell, .fn-shell, .ne-shell, .np-shell, .gp-shell {
    grid-template-columns: 1fr !important;
    --dn-sidebar-w: 0px !important;
    height: 100vh !important;
    gap: 0 !important;
  }

  /* Hide right/detail panels */
  .tk-right, .dn-right, .np-right { display: none !important; }

  /* Main panels — full bleed, no card chrome */
  .tk-main, .fn-main, .gp-main, .np-main, .ne-main {
    border-radius: 0 !important;
    box-shadow: none !important;
    height: 100vh !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Inner scroll areas */
  .tk-main-inner, .fn-main-inner, .gp-main-scroll, .np-main-inner, .ne-main-scroll {
    padding: 20px 16px calc(100px + env(safe-area-inset-bottom)) !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    height: 100% !important;
    overflow-y: auto !important;
    flex: none !important;
    background: #ffffff;
  }

  /* FABs — above bottom nav */
  .tk-fab, .fn-fab, .gp-fab, .np-fab {
    bottom: calc(88px + env(safe-area-inset-bottom)) !important;
    right: 20px !important;
  }

  /* ── Page headings — unified size ── */
  .fn-greeting, .gp-page-title, .np-greeting { font-size: 1.8rem !important; }
  .tk-main-inner h1, .fn-main-inner h1 { font-size: 1.8rem !important; }
  .tk-title { font-size: 1.8rem !important; }
  /* Goals search bar — cap width on mobile */
  .gp-search-wrap { max-width: 160px !important; }
  /* ── Tasks — hide search on mobile ── */
  .tk-search-wrap { display: none !important; }

  /* ── Custom date picker button sizing on mobile ── */
  button[data-sdp-btn] { min-height: 38px; }

  /* ── Daily Notes ── */
  .dn-main {
    height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    background: #f0f3f9 !important;
    padding: 0 0 calc(68px + env(safe-area-inset-bottom)) 0 !important;
  }
  /* Header anchored to top */
  .dn-header {
    padding: 28px 16px 8px !important;
    max-width: 100% !important;
    flex-shrink: 0 !important;
  }
  .dn-header-top { align-items: center !important; }
  .dn-search-wrap { display: none !important; }
  .dn-greeting { font-size: 1.3rem !important; margin-bottom: 2px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dn-date-label { font-size: 0.82rem !important; white-space: nowrap; }

  /* Editor area fills remaining space and centers the card */
  .dn-editor-area {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    padding: 0 16px 16px !important;
    max-width: 100% !important;
  }
  .dn-editor-form { flex: none !important; }
  .dn-tiptap-card {
    min-height: calc(100vh - 230px) !important;
    border-radius: 14px !important;
    padding: 14px 16px 10px !important;
    margin-bottom: 0 !important;
  }
  .dn-tiptap { min-height: calc(100vh - 330px) !important; overflow-y: auto !important; }
  /* Toolbar — scrollable row */
  .dn-toolbar { overflow-x: auto; overflow-y: hidden; white-space: nowrap; flex-wrap: nowrap; padding-bottom: 10px !important; }
  .dn-toolbar::-webkit-scrollbar { display: none; }
  /* Editor footer — compact */
  .dn-editor-footer { padding: 8px 0 4px !important; }
  .dn-footer-sep { display: none !important; }
  .dn-footer-words + .dn-footer-sep + .dn-footer-words { display: none !important; }

  /* Right panel — hidden, content accessible via M menu */
  .dn-right { display: none !important; }

  /* Week in Review modal — bottom sheet */
  .dn-review-overlay { align-items: flex-end !important; padding-bottom: env(safe-area-inset-bottom) !important; }
  .dn-review-modal {
    width: 100% !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
  }

  /* ── Note editor ── */
  .ne-body { padding: 20px 16px 0 !important; }
  .ne-footer { padding: 10px 16px !important; }

  /* ── Tasks ── */
  .tk-filter-bar { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .tk-filter-bar::-webkit-scrollbar { display: none; }

  /* ── Finances ── */
  .fn-summary { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .fn-stat-card { padding: 12px 14px !important; }
  .fn-chart-card, .fn-cats-card, .fn-tx-card { padding: 14px !important; }
  .fn-header { flex-wrap: wrap; gap: 10px !important; }
  .fn-search-wrap { max-width: 100% !important; flex: 1 1 100% !important; }
  /* Transaction table — hide description + source on mobile */
  .fn-tx-table th:nth-child(4),
  .fn-tx-table td:nth-child(4),
  .fn-tx-table th:nth-child(5),
  .fn-tx-table td:nth-child(5) { display: none !important; }
  /* Compact table layout: DATE | AMOUNT | CATEGORY | MENU */
  .fn-tx-table { table-layout: fixed !important; width: 100% !important; }
  .fn-tx-table th, .fn-tx-table td { padding: 10px 8px !important; }
  /* col 1: date */
  .fn-tx-table th:nth-child(1), .fn-tx-table td:nth-child(1) { width: 58px !important; font-size: 0.72rem !important; }
  /* col 2: amount — no wrap */
  .fn-tx-table th:nth-child(2), .fn-tx-table td:nth-child(2) { width: 90px !important; font-size: 0.78rem !important; white-space: nowrap !important; }
  /* col 3: category — fixed, remaining space goes to menu */
  .fn-tx-table th:nth-child(3), .fn-tx-table td:nth-child(3) { width: 100px !important; overflow: hidden !important; }
  /* col 6: menu — auto fills rest, button right-aligned */
  .fn-tx-table th:nth-child(6), .fn-tx-table td:nth-child(6) { width: auto !important; text-align: right !important; padding-right: 6px !important; }
  .fn-tx-menu-wrap { justify-content: flex-end !important; }
  /* Truncate category chip */
  .fn-tx-table .fn-cat-chip { max-width: 90px !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; display: inline-block !important; }
  /* Hide year in date column */
  .fn-date-year { display: none !important; }
  /* Make ··· menu button visible and easy to tap */
  .fn-tx-menu-btn { font-size: 1.1rem !important; padding: 6px 8px !important; min-width: 38px !important; min-height: 40px !important; color: #8a9ea5 !important; }
  /* Category name — more space vs bar on mobile */
  .fn-cat-name { flex: 2 !important; white-space: normal !important; overflow: hidden !important; text-overflow: clip !important; font-size: 0.76rem !important; word-break: break-word !important; }
  .fn-cat-bar-wrap { flex: 1 !important; }

  /* ── Goals ── */
  .gp-grid { columns: 1 !important; }

  /* ── All Notes ── */
  .np-shell { grid-template-columns: 1fr !important; }
  /* Search bar below title */
  .np-topbar { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 10px !important; }
  .np-topbar .np-greeting { flex: 1 !important; }
  .np-trash-mob-btn { display: flex !important; }
  .np-search-wrap { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; order: 1 !important; }
  /* Compact capture card */
  .np-capture-card { padding: 12px 14px !important; margin-bottom: 20px !important; }
  /* Single row: [Inbox][+Tag][editor link] ··· [Save] */
  .np-capture-footer { flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; gap: 6px !important; }
  .np-capture-meta { flex-wrap: nowrap !important; align-items: center !important; gap: 6px !important; flex: 1 !important; min-width: 0 !important; }
  /* Hide "Open in editor" on mobile — FAB handles that */
  .np-capture-btn:not(.np-capture-save-btn) { display: none !important; }
  /* Save — circular checkmark button */
  .np-capture-save-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    background: #3F51B5 !important;
    color: transparent !important;
    font-size: 0 !important;
    position: relative !important;
  }
  .np-capture-save-btn::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #fff;
    line-height: 1;
  }
  /* Prevent iOS zoom on capture inputs */
  .np-capture-title, .np-capture-textarea, .np-capture-tag-input { font-size: 16px !important; }

  /* ── Modals — bottom sheet on mobile ── */
  .tk-overlay, .fn-overlay, .gp-overlay {
    align-items: flex-end !important;
    padding-bottom: 0 !important;
  }
  .tk-modal, .fn-modal, .gp-modal-card {
    width: 100% !important;
    max-height: 92dvh !important;
    overflow-y: auto !important;
    border-radius: 18px 18px 0 0 !important;
    padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
  }
  /* Prevent iOS auto-zoom on input focus (triggered when font-size < 16px) */
  .tk-modal input, .tk-modal textarea, .tk-modal select,
  .fn-modal input, .fn-modal textarea, .fn-modal select,
  .gp-modal-card input, .gp-modal-card textarea, .gp-modal-card select {
    font-size: 16px !important;
  }

  /* ── Goals insights modal — bottom sheet ── */
  .gp-insights-card {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 72dvh !important;
    max-height: 96dvh !important;
    border-radius: 18px 18px 0 0 !important;
    padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    position: relative !important;
  }
  #gp-insights-overlay {
    align-items: flex-end !important;
  }
  /* Header: title + close on line 1, month nav on line 2 */
  .gp-insights-hdr {
    flex-wrap: wrap !important;
    position: relative !important;
    padding-right: 36px !important;
    row-gap: 16px !important;
  }
  #gp-insights-close {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
  }
  #gp-ins-mnav {
    width: 100% !important;
    justify-content: center !important;
    order: 1 !important;
    margin-bottom: 4px !important;
  }
  /* Gap between month picker and heatmap calendar */
  #gp-ins-hm-wrap .gc-hm-nav { margin-bottom: 10px !important; }
  #gp-ins-hm-wrap .gc-hm-grid { margin-top: 6px !important; }

  /* ── Auth ── */
  .auth-card { padding: 32px 24px 28px; }

  /* ── Mobile user avatar ── */
  .mob-avatar { display: flex !important; }
  .gn-bell-btn-mob { display: flex !important; }
}

/* ── Dark mode on mobile inner panels ── */
@media (max-width: 768px) {
  [data-theme="dark"] .dn-page,
  [data-theme="dark"] .tk-page,
  [data-theme="dark"] .fn-page,
  [data-theme="dark"] .gp-page,
  [data-theme="dark"] .np-page,
  [data-theme="dark"] .ne-page { background: #0f1117 !important; }

  [data-theme="dark"] .tk-main,
  [data-theme="dark"] .fn-main,
  [data-theme="dark"] .gp-main,
  [data-theme="dark"] .np-main,
  [data-theme="dark"] .ne-main { background: #1a1d26 !important; }

  [data-theme="dark"] .tk-main-inner,
  [data-theme="dark"] .fn-main-inner,
  [data-theme="dark"] .gp-main-scroll,
  [data-theme="dark"] .np-main-inner,
  [data-theme="dark"] .ne-main-scroll { background: #1a1d26 !important; }

  [data-theme="dark"] .dn-main { background: #0f1117 !important; }
  [data-theme="dark"] .dn-review-modal { background: #1a1d26 !important; }
}

/* ── Collapsed sidebar icon-centering (all screen sizes) ─────────────────── */
.sidebar-collapsed .dn-nav-item { justify-content: center; padding: 10px 0; }
.sidebar-collapsed .dn-sidebar-top { justify-content: center; }
.sidebar-collapsed .dn-account-btn { justify-content: center; padding: 10px 0; }
.sidebar-collapsed .dn-theme-toggle { justify-content: center; padding: 10px 0; }
.sidebar-collapsed .gn-bell-btn { justify-content: center; padding: 10px 0; }

/* ══════════════════════════════════════════════════════════════════
   DARK MODE
   Applied when <html data-theme="dark">
   ══════════════════════════════════════════════════════════════════ */

/* ── Global variables ── */
[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d26;
  --text: #c8dae6;
  --muted: #8a9ea5;
  --line-soft: rgba(255, 255, 255, 0.06);
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] html,
[data-theme="dark"] body {
  background: #0f1117;
  color: #c8dae6;
}

/* ── Note cards ── */
[data-theme="dark"] .note-card { background: #1a1d26; border-color: rgba(255,255,255,0.07); color: #c8dae6; }
[data-theme="dark"] .note-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
[data-theme="dark"] .note-card-meta { color: #4a6070; }

/* ── Shared surfaces ── */
[data-theme="dark"] .surface-block,
[data-theme="dark"] .calendar-card,
[data-theme="dark"] .editor-form { background: #1a1d26; }
[data-theme="dark"] .calendar-nav-btn:hover { background: #252a38; }
[data-theme="dark"] .calendar-day:hover { background: #252a38; }
[data-theme="dark"] .calendar-day.selected { background: #252a38; }
[data-theme="dark"] .calendar-day.muted { color: #3a4a5a; }
[data-theme="dark"] .task-input, [data-theme="dark"] .goal-value-input { background: #252a38; color: #c8dae6; }
[data-theme="dark"] .task-tag { background: #252a38; color: #8a9ea5; }
[data-theme="dark"] .check-circle-inner { border-color: #3a4a5c; }
[data-theme="dark"] .check-circle-inner.checked { background: #4f6dd4; border-color: #4f6dd4; }

/* ── Tiptap editor (shared) ── */
[data-theme="dark"] .tiptap-editor-card { background: #1a1d26; }
[data-theme="dark"] .tiptap-editor code,
[data-theme="dark"] .tiptap-editor pre { background: #252a38; }
[data-theme="dark"] .tiptap-editor blockquote { border-left-color: #3a4a5c; }
[data-theme="dark"] .dash-tiptap code,
[data-theme="dark"] .dash-tiptap pre { background: #252a38; color: #a8c4da; }
[data-theme="dark"] .dash-tiptap h1,
[data-theme="dark"] .dash-tiptap h2,
[data-theme="dark"] .dash-tiptap h3 { color: #c8dae6; }
[data-theme="dark"] .dash-tiptap td { color: #c8dae6; border-color: #2e3a48; }
[data-theme="dark"] .dash-tiptap th { background: #252a38; color: #8a9ea5; border-color: #2e3a48; }
[data-theme="dark"] .dash-tiptap tr:hover td { background: #252a38; }

/* ── Slash menu ── */
[data-theme="dark"] .slash-menu { background: #1e2330; border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .slash-item:hover,
[data-theme="dark"] .slash-item.is-selected { background: #252a38; }
[data-theme="dark"] .slash-item-icon { background: #252a38; color: #c8dae6; }
[data-theme="dark"] .slash-item-label { color: #c8dae6; }

/* ── Table toolbar ── */
[data-theme="dark"] .table-toolbar { background: #1e2330; border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .tt-btn { color: #8a9ea5; }
[data-theme="dark"] .tt-btn:hover { background: #252a38; }
[data-theme="dark"] .tt-sep { background: #2e3a48; }

/* ── Block drag ── */
[data-theme="dark"] .block-drag-handle:hover { background: #252a38; }

/* ── Counter card ── */
[data-theme="dark"] .counter-card { background: #1a1d26; }

/* ── Auth cards ── */
[data-theme="dark"] .auth-card { background: #1a1d26; }

/* ══ SIDEBAR ══════════════════════════════════════════════════════ */
[data-theme="dark"] .dn-sidebar { background: #1a1d26; box-shadow: 0 2px 40px rgba(0,0,0,0.4); }
[data-theme="dark"] .dn-brand { color: #7ba7cc; }
[data-theme="dark"] .dn-collapse-btn { color: #8a9ea5; }
[data-theme="dark"] .dn-collapse-btn:hover { color: #a8c4da; background: rgba(255,255,255,0.06); }
[data-theme="dark"] .dn-nav-item { color: #8a9ea5; }
[data-theme="dark"] .dn-nav-item:hover { background: rgba(255,255,255,0.05); color: #a8c4da; }
[data-theme="dark"] .dn-nav-item.active { background: rgba(79,109,212,0.18); color: #7ba7cc; border-right-color: #4f6dd4; }

/* Sidebar calendar */
[data-theme="dark"] .dn-cal-month { color: #8a9ea5; }
[data-theme="dark"] .dn-cal-weekdays span { color: #4a6070; }
[data-theme="dark"] .dn-cal-day { color: #8a9ea5; }
[data-theme="dark"] .dn-cal-day:hover { background: rgba(255,255,255,0.06); color: #a8c4da; }
[data-theme="dark"] .dn-cal-day.today { color: #7ba7cc; }
[data-theme="dark"] .dn-cal-day.selected { background: #4f6dd4; color: #fff; }
[data-theme="dark"] .dn-cal-dot { background: #7ba7cc; }
[data-theme="dark"] .dn-cal-nav:hover { background: rgba(255,255,255,0.06); color: #a8c4da; }

/* Countdown widget */
[data-theme="dark"] .dn-countdown-widget { background: rgba(79,109,212,0.1); }
[data-theme="dark"] .dn-countdown-unit { background: #252a38; }
[data-theme="dark"] .dn-countdown-val { color: #7ba7cc; }
[data-theme="dark"] .dn-countdown-lbl { color: #4a6070; }
[data-theme="dark"] .dn-countdown-deadline { color: #4a6070; }
[data-theme="dark"] .dn-countdown-name { color: #8a9ea5; }
[data-theme="dark"] .dn-countdown-edit-btn { color: #4a6070; }
[data-theme="dark"] .dn-countdown-edit-btn:hover { color: #a8c4da; background: #252a38; }

/* Countdown modal */
[data-theme="dark"] .dn-cd-overlay { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .dn-cd-modal { background: #1e2330; }
[data-theme="dark"] .dn-cd-modal-title { color: #c8dae6; }
[data-theme="dark"] .dn-cd-modal-close { color: #8a9ea5; }
[data-theme="dark"] .dn-cd-modal label { color: #8a9ea5; }
[data-theme="dark"] .dn-cd-modal input { background: #252a38; border-color: rgba(255,255,255,0.12); color: #c8dae6; }

/* ══ DAILY NOTES MAIN ══════════════════════════════════════════════ */
[data-theme="dark"] .dn-page { background: #0f1117 !important; }
[data-theme="dark"] .dn-greeting { color: #c8dae6; }
[data-theme="dark"] .dn-date-arrow:hover { background: rgba(255,255,255,0.06); color: #a8c4da; }
[data-theme="dark"] .dn-date-picker-btn:hover { color: #7ba7cc; }
[data-theme="dark"] .dn-search-wrap { background: #1a1d26; border-color: rgba(255,255,255,0.1); }
[data-theme="dark"] .dn-search-input { color: #c8dae6; }
[data-theme="dark"] .dn-search-input::placeholder { color: #5a7080; }

[data-theme="dark"] .dn-tiptap-card { background: #1a1d26; box-shadow: 0 4px 20px rgba(0,0,0,0.35); }
[data-theme="dark"] .dn-toolbar { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .dn-tb-btn { color: #8a9ea5; }
[data-theme="dark"] .dn-tb-btn:hover { background: rgba(255,255,255,0.06); color: #a8c4da; }
[data-theme="dark"] .dn-tb-btn.is-active { background: rgba(79,109,212,0.2); color: #7ba7cc; }
[data-theme="dark"] .dn-tb-sep { background: #2e3a48; }
[data-theme="dark"] .dn-editor-footer { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .dn-footer-words,
[data-theme="dark"] .dn-footer-sep,
[data-theme="dark"] .dn-save-status { color: #8a9ea5; }
/* Editor body text + caret */
[data-theme="dark"] .dn-tiptap { color: #b4c4ca; }
[data-theme="dark"] .dn-tiptap .ProseMirror { caret-color: #b4c4ca; }
[data-theme="dark"] .dn-tiptap hr,
[data-theme="dark"] .dash-tiptap hr { border-top-color: rgba(180,196,202,0.25); }
[data-theme="dark"] .dn-tiptap h1,
[data-theme="dark"] .dn-tiptap h2,
[data-theme="dark"] .dn-tiptap h3 { color: #a8c4da; }
[data-theme="dark"] .dn-tiptap code { background: #252a38; color: #7ba7cc; }
[data-theme="dark"] .dn-tiptap pre { background: #252a38; }

/* Right panel */
[data-theme="dark"] .dn-right { background: #1a1d26; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
[data-theme="dark"] .dn-right-header-title { color: #c8dae6; }
[data-theme="dark"] .dn-right-header-icon { background: #252a38; }
[data-theme="dark"] .dn-right-header-icon svg { stroke: #7ba7cc; }
[data-theme="dark"] .dn-ai-btn-ring { border-color: rgba(123,167,204,0.5); }
[data-theme="dark"] .dn-widget { background: #1a1d26; }
[data-theme="dark"] .dn-widget-title { color: #4a6070; }
[data-theme="dark"] .dn-view-all { color: #7ba7cc; }
[data-theme="dark"] .dn-pulse-badge { color: #7ba7cc; }
[data-theme="dark"] .dn-pulse-bar-track { background: #252a38; }
[data-theme="dark"] .dn-pulse-bar-fill { background: #4f6dd4; }
[data-theme="dark"] .dn-pulse-desc { color: #8a9ea5; }
[data-theme="dark"] .dn-task-item { border-bottom-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .dn-task-text { color: #b4c4ca; }
[data-theme="dark"] .dn-task-item.done .dn-task-text { color: #4a6070; }
[data-theme="dark"] .dn-task-check-inner { border-color: #3a4a5c; }
[data-theme="dark"] .dn-task-check-inner.checked { background: #4f6dd4; border-color: #4f6dd4; }
[data-theme="dark"] .dn-task-tag { background: #1e2a40; color: #7ba7cc; }
[data-theme="dark"] .dn-empty { color: #3a4a5a; }

/* ══ MOBILE NAV ══════════════════════════════════════════════════ */
[data-theme="dark"] .mob-nav { background: #1a1d26; border-top-color: rgba(255,255,255,0.07); }
[data-theme="dark"] .mob-nav-item { color: #4a6070; }
[data-theme="dark"] .mob-nav-item.active,
[data-theme="dark"] .mob-nav-item:hover { color: #7ba7cc; }
[data-theme="dark"] .mob-avatar-btn { background: #4f6dd4; }
[data-theme="dark"] .mob-avatar-dd { background: #1e2330; border-color: rgba(255,255,255,0.08); box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
[data-theme="dark"] .mob-avatar-dd-item { color: #8a9ea5; }
[data-theme="dark"] .mob-avatar-dd-item:hover { background: #252a38; }
[data-theme="dark"] .mob-avatar-dd-item.danger { color: #ef7070; }
[data-theme="dark"] .mob-avatar-dd-item.danger:hover { background: #2a1a1a; }

/* ── Sidebar footer wrapper (theme toggle, bell, account) ── */
.dn-sidebar-foot {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
  margin-top: auto;
}

/* ── Theme toggle button (sidebar) ── */
.dn-theme-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #8a9ea5;
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.14s, color 0.14s;
  text-align: left;
}
.dn-theme-toggle:hover { background: rgba(0,48,73,0.06); color: #005691; }
[data-theme="dark"] .dn-theme-toggle { color: #8a9ea5; }
[data-theme="dark"] .dn-theme-toggle:hover { background: rgba(255,255,255,0.06); color: #a8c4da; }
.dn-theme-toggle svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; }
/* Sun icon shown in dark mode, moon in light mode */
.dn-theme-sun { display: none; }
.dn-theme-moon { display: block; }
[data-theme="dark"] .dn-theme-sun { display: block; }
[data-theme="dark"] .dn-theme-moon { display: none; }
/* Hide label when sidebar is collapsed */
.sidebar-collapsed .dn-theme-toggle .dn-nav-label { opacity: 0; pointer-events: none; }

/* ── Week in Review ── */
.dn-week-review-btn { display:flex; align-items:center; gap:7px; width:calc(100% - 24px); margin:4px 12px 14px; border:1.5px solid rgba(70,99,108,0.15); background:transparent; border-radius:10px; padding:9px 14px; font-size:0.78rem; font-weight:600; font-family:inherit; color:#8a9ea5; cursor:pointer; transition:all 0.14s; }
.dn-week-review-btn:hover { border-color:rgba(70,99,108,0.35); color:#46636c; background:rgba(70,99,108,0.04); }
.dn-review-overlay { position:fixed; inset:0; background:rgba(0,20,60,0.4); z-index:9000; display:flex; align-items:center; justify-content:center; }
.dn-review-overlay.hidden { display:none; }
.dn-review-modal { background:#fff; border-radius:20px; width:min(560px,92vw); max-height:82vh; display:flex; flex-direction:column; box-shadow:0 12px 60px rgba(0,20,80,0.18); overflow:hidden; }
.dn-review-modal-hdr { display:flex; align-items:flex-start; justify-content:space-between; padding:22px 24px 16px; border-bottom:1px solid rgba(70,99,108,0.08); flex-shrink:0; }
.dn-review-modal-title { font-size:1.05rem; font-weight:800; color:#3a5560; letter-spacing:-0.02em; }
.dn-review-modal-range { font-size:0.75rem; color:#a5b4bc; margin-top:2px; }
.dn-review-close { border:none; background:none; font-size:1.3rem; color:#a5b4bc; cursor:pointer; padding:0; line-height:1; transition:color 0.13s; }
.dn-review-close:hover { color:#46636c; }
.dn-review-body { flex:1; overflow-y:auto; padding:20px 24px 24px; }
.dn-review-loading { display:flex; align-items:center; gap:10px; color:#8a9ea5; font-size:0.85rem; }
@keyframes spin { to { transform:rotate(360deg); } }
.dn-review-section { margin-bottom:18px; }
.dn-review-section-label { font-size:0.65rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:#a5b4bc; margin-bottom:5px; }
.dn-review-section-text { font-size:0.88rem; color:#46636c; line-height:1.6; }
.dn-review-headline { font-size:1rem; font-weight:700; color:#3a5560; line-height:1.4; margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid rgba(70,99,108,0.07); }
[data-theme="dark"] .dn-week-review-btn { border-color:rgba(255,255,255,0.1); color:#8a9ea5; }
[data-theme="dark"] .dn-week-review-btn:hover { border-color:rgba(255,255,255,0.2); color:#c8dae6; background:rgba(255,255,255,0.04); }
[data-theme="dark"] .dn-review-modal { background:#1a1d26; }
[data-theme="dark"] .dn-review-modal-hdr { border-bottom-color:rgba(255,255,255,0.07); }
[data-theme="dark"] .dn-review-modal-title { color:#c8dae6; }
[data-theme="dark"] .dn-review-headline { color:#c8dae6; border-bottom-color:rgba(255,255,255,0.07); }
[data-theme="dark"] .dn-review-section-text { color:#b4c4ca; }

/* ── Review history button ── */
.dn-review-hist-btn { border:none; background:transparent; color:#a5b4bc; cursor:pointer; padding:4px 6px; border-radius:7px; display:flex; align-items:center; transition:color 0.13s, background 0.13s; }
.dn-review-hist-btn:hover { color:#46636c; background:rgba(70,99,108,0.07); }
[data-theme="dark"] .dn-review-hist-btn { color:#6a8898; }
[data-theme="dark"] .dn-review-hist-btn:hover { color:#a8c4da; background:rgba(255,255,255,0.06); }

/* ── Past review compact rows (history list) ── */
.dn-review-hist-list { display:flex; flex-direction:column; }
.dn-review-hist-row { display:flex; flex-direction:column; gap:2px; padding:10px 12px; border-radius:9px; cursor:pointer; transition:background 0.13s; }
.dn-review-hist-row:hover { background:rgba(70,99,108,0.06); }
.dn-review-hist-row + .dn-review-hist-row { border-top:1px solid rgba(70,99,108,0.07); }
.dn-review-hist-row-date { font-size:0.68rem; font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:#a5b4bc; }
.dn-review-hist-row-headline { font-size:0.82rem; color:#46636c; line-height:1.35; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
[data-theme="dark"] .dn-review-hist-row:hover { background:rgba(255,255,255,0.04); }
[data-theme="dark"] .dn-review-hist-row + .dn-review-hist-row { border-color:rgba(255,255,255,0.06); }
[data-theme="dark"] .dn-review-hist-row-headline { color:#a8c4da; }

/* ── Review prev/next nav ── */
.dn-review-nav { display:flex; justify-content:space-between; align-items:center; margin-top:14px; padding-top:12px; border-top:1px solid rgba(70,99,108,0.09); }
.dn-review-nav-btn { border:none; background:transparent; color:#a5b4bc; cursor:pointer; padding:5px 8px; border-radius:7px; font-size:0.75rem; font-weight:600; display:flex; align-items:center; gap:4px; transition:color 0.13s, background 0.13s; }
.dn-review-nav-btn:hover:not(:disabled) { color:#46636c; background:rgba(70,99,108,0.07); }
.dn-review-nav-btn:disabled { opacity:0.3; cursor:default; }
[data-theme="dark"] .dn-review-nav-btn { color:#6a8898; }
[data-theme="dark"] .dn-review-nav-btn:hover:not(:disabled) { color:#a8c4da; background:rgba(255,255,255,0.06); }

/* ── Legacy card classes (unused, kept for safety) ── */
.dn-review-hist-card { border:1px solid rgba(70,99,108,0.1); border-radius:12px; padding:14px 16px; cursor:pointer; }
.dn-review-hist-range { font-size:0.7rem; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:#a5b4bc; margin-bottom:5px; }
.dn-review-hist-headline { font-size:0.88rem; font-weight:600; color:#3a5560; margin-bottom:4px; line-height:1.35; }
.dn-review-hist-focus { font-size:0.78rem; color:#8a9ea5; line-height:1.45; }

/* ── Finance table inside week review ── */
.dn-review-fin-table { width:100%; border-collapse:collapse; margin-top:8px; font-size:0.78rem; }
.dn-review-fin-table th { text-align:left; font-size:0.62rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:#a5b4bc; padding:0 6px 5px; }
.dn-review-fin-table th:last-child { text-align:right; }
.dn-review-fin-table td { padding:5px 6px; color:#46636c; border-top:1px solid rgba(70,99,108,0.07); }
.dn-review-fin-table td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
.dn-review-fin-table tr.fin-total td { font-weight:700; color:#3a5560; border-top:1px solid rgba(70,99,108,0.15); }
.dn-review-fin-table tr.fin-income td { color:#3d9e6a; }
.dn-review-fin-table tr.fin-income.fin-total td { color:#2e8558; }
.dn-review-fin-sub { font-size:0.65rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:#a5b4bc; margin:10px 0 0; }
[data-theme="dark"] .dn-review-fin-table td { color:#8ab0b8; border-top-color:rgba(255,255,255,0.05); }
[data-theme="dark"] .dn-review-fin-table tr.fin-total td { color:#c8dae6; border-top-color:rgba(255,255,255,0.1); }
[data-theme="dark"] .dn-review-fin-table tr.fin-income td { color:#4aba7a; }
[data-theme="dark"] .dn-review-fin-table tr.fin-income.fin-total td { color:#3da068; }

/* ── Feedback modal ── */
.sea-feedback-overlay { position:fixed; inset:0; background:rgba(40,55,70,0.45); display:flex; align-items:center; justify-content:center; z-index:1000; backdrop-filter:blur(2px); padding:20px; }
.sea-feedback-overlay.hidden { display:none; }
.sea-feedback-card { background:#fff; border-radius:18px; width:min(420px,100%); padding:26px 28px 24px; box-shadow:0 20px 60px rgba(40,55,70,0.18); }
.sea-feedback-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.sea-feedback-title { font-size:1rem; font-weight:700; color:#3a5560; }
.sea-feedback-close { border:none; background:transparent; color:#8a9ea5; cursor:pointer; font-size:1.4rem; line-height:1; padding:0 4px; border-radius:6px; }
.sea-feedback-close:hover { color:#46636c; }
.sea-feedback-sub { font-size:0.82rem; color:#8a9ea5; margin-bottom:16px; }
.sea-feedback-cats { display:flex; gap:8px; margin-bottom:14px; }
.sea-feedback-cat { border:1.5px solid rgba(70,99,108,0.15); background:transparent; border-radius:20px; padding:5px 14px; font-size:0.82rem; color:#8a9ea5; cursor:pointer; font-family:inherit; transition:all 0.14s; }
.sea-feedback-cat.active { background:#3F51B5; border-color:#3F51B5; color:#fff; font-weight:600; }
.sea-feedback-ta { width:100%; box-sizing:border-box; border:none; background:#f4f6fb; border-radius:12px; padding:12px 14px; font-size:0.88rem; font-family:inherit; color:#46636c; resize:none; outline:none; }
.sea-feedback-ta:focus { box-shadow:0 0 0 2px rgba(63,81,181,0.2); }
.sea-feedback-card .primary-btn { width:100%; margin-top:12px; background:#3F51B5; border-radius:10px; padding:11px; font-size:0.9rem; }
.sea-feedback-status { font-size:0.82rem; margin-top:8px; min-height:18px; text-align:center; }
[data-theme="dark"] .sea-feedback-card { background:#1a1d26; }
[data-theme="dark"] .sea-feedback-title { color:#c8dae6; }
[data-theme="dark"] .sea-feedback-sub { color:#5a7080; }
[data-theme="dark"] .sea-feedback-cat { border-color:rgba(255,255,255,0.1); color:#5a7080; }
[data-theme="dark"] .sea-feedback-ta { background:#252a38; color:#c8dae6; }
