/* Project Manager Dashboard — global styles
   Palette derived from ~/projects/projects-dashboard/template.html */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f13;
  --panel: #14141c;
  --panel-2: #16161f;
  --border: #1e1e2a;
  --border-2: #2e2e3e;
  --text: #e2e2e8;
  --text-dim: #8b8ba0;
  --text-mute: #6b6b85;
  --text-fade: #55556a;
  --accent: #a78bfa;
  --accent-soft: #c9b3ff;
  --accent-bg: #1a1525;
  --danger: #f87171;
  --success: #4ade80;
}

html[data-theme="light"] {
  --bg: #f7f7fb;
  --panel: #ffffff;
  --panel-2: #f0f0f6;
  --border: #e2e2ec;
  --border-2: #cdcdda;
  --text: #1c1c25;
  --text-dim: #555568;
  --text-mute: #75758a;
  --text-fade: #9a9ab0;
  --accent: #6d4cf0;
  --accent-soft: #8a6dff;
  --accent-bg: #ece6ff;
  --danger: #d23a3a;
  --success: #1f9e4a;
}

html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; }
code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; color: var(--accent-soft); }

.flash {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 100; padding: 0.6rem 1rem; border-radius: 8px;
  border: 1px solid var(--border-2); font-size: 0.85rem;
}
.flash-notice { background: #1a2a1a; color: var(--success); border-color: #2a4a2a; }
.flash-alert  { background: #2a1414; color: var(--danger);  border-color: #5a1a1a; }

/* ─── Header ─────────────────────────────────────────────────────────── */
header.app-header {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
}
header.app-header .brand-col { display: flex; flex-direction: column; gap: 0.25rem; }
header.app-header .crumb {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-mute); text-decoration: none; transition: color 0.15s;
}
header.app-header .crumb:hover { color: var(--accent); }
header.app-header a.logo {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  color: #fff; text-decoration: none; transition: opacity 0.15s;
}
header.app-header a.logo:hover { opacity: 0.85; }
header.app-header a.logo span { color: var(--accent); }
header.app-header a.logo-home {
  display: inline-flex; align-items: center;
  text-decoration: none; transition: opacity 0.15s;
}
header.app-header a.logo-home:hover { opacity: 0.85; }
header.app-header .logo-icon { height: 2.6rem; width: auto; display: block; }
header.app-header .badge {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--border); color: var(--accent);
  border: 1px solid var(--border-2);
  padding: 0.25rem 0.6rem; border-radius: 999px;
}
header.app-header .nav { margin-left: auto; display: flex; gap: 1.4rem; align-items: center; font-size: 0.85rem; color: var(--text-mute); }
header.app-header .nav a { text-decoration: none; transition: color 0.15s; }
header.app-header .nav a:hover { color: var(--accent); }

@media (max-width: 640px) {
  header.app-header { padding: 0.9rem 0.9rem; gap: 0.45rem; min-width: 0; flex-wrap: wrap; }
  header.app-header .logo-icon { height: 1.8rem; }
  header.app-header a.logo { font-size: 1.1rem; }
  header.app-header .nav { gap: 0.6rem; font-size: 0.78rem; flex-shrink: 1; min-width: 0; }
  header.app-header .nav .header-link { white-space: nowrap; }
  /* Mailto is reachable from the user menu — drop on narrow screens so the
     avatar always fits. */
  header.app-header .nav a[href^="mailto:"] { display: none; }
  .container { padding: 1rem; }
}

.user-menu { position: relative; }
.user-menu-btn {
  background: transparent; border: 1px solid transparent;
  padding: 0; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color 0.12s, opacity 0.12s;
}
.user-menu-btn:hover, .user-menu-btn:focus-visible { border-color: var(--accent); outline: none; }
.user-avatar {
  display: block; width: 2rem; height: 2rem; border-radius: 999px;
  object-fit: cover;
}
.user-avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); color: var(--accent);
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  border: 1px solid var(--border-2);
}
.user-menu-popover {
  position: absolute; z-index: 30; right: 0; top: calc(100% + 0.4rem);
  min-width: 200px; padding: 0.5rem;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}
.user-menu-info { padding: 0.3rem 0.4rem 0.5rem; border-bottom: 1px solid var(--border); margin-bottom: 0.4rem; }
.user-menu-name { font-size: 0.85rem; color: var(--text); font-weight: 600; }
.user-menu-email { font-size: 0.72rem; color: var(--text-mute); margin-top: 0.1rem; word-break: break-all; }
.user-menu-link {
  display: block; padding: 0.4rem 0.6rem; margin-bottom: 0.3rem;
  border-radius: 6px; color: var(--text-dim); text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.12s, background 0.12s;
}
.user-menu-link:hover { color: #fff; background: var(--accent-bg, rgba(167,139,250,0.1)); }
.user-menu-link-button {
  width: 100%; text-align: left; background: transparent; border: 0;
  font: inherit; cursor: pointer;
}
html[data-theme="light"] .user-menu-link:hover,
html[data-theme="light"] .user-menu-signout:hover { color: var(--text); }
.user-menu-signout {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 1px solid var(--border-2); border-radius: 6px;
  padding: 0.4rem 0.6rem; color: var(--text-dim);
  font-size: 0.82rem; cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.user-menu-signout:hover { color: #fff; border-color: var(--accent); background: var(--accent-bg, rgba(167,139,250,0.1)); }

.container { max-width: 1440px; margin: 0 auto; padding: 2.5rem; }

/* ─── Bookmarks ──────────────────────────────────────────────────────── */
.bookmarks { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.5rem; }
.bookmarks a {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border-2); border-radius: 10px;
  color: var(--text); text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  transition: all 0.15s;
}
.bookmarks a:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.bookmarks a.sortable-ghost { opacity: 0.4; }
.bookmark-drag-handle {
  font-size: 0.8rem; line-height: 1;
  color: var(--text-fade);
  cursor: grab;
  margin-right: 0.25rem;
  opacity: 0;
  user-select: none;
  transition: opacity 0.15s, color 0.15s;
}
.bookmarks a:hover .bookmark-drag-handle { opacity: 0.7; }
.bookmark-drag-handle:hover { color: var(--accent); opacity: 1; }
.bookmark-drag-handle:active { cursor: grabbing; }
.bookmarks a .bm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.bookmarks a .bm-label { color: var(--text-dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; margin-right: 0.2rem; }

/* ─── Pitch ─────────────────────────────────────────────────────────── */
.pitch {
  margin-bottom: 2.5rem;
  padding: 1.6rem 1.8rem;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 1px solid var(--border); border-radius: 14px;
}
.pitch h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin-bottom: 0.5rem; }
.pitch p, .pitch div { font-size: 0.9rem; color: var(--text-dim); line-height: 1.55; max-width: 760px; }
.pitch p + p { margin-top: 0.6rem; }


/* ─── TODOs ─────────────────────────────────────────────────────────── */
.todos {
  margin-bottom: 2.5rem;
  padding: 1.4rem 1.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.todos-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.9rem; }
.todos h2 { font-size: 0.9rem; font-weight: 700; color: #fff; letter-spacing: -0.01em; margin-right: auto; }
.todos-tabs { display: flex; gap: 0.3rem; }
.todos-tab {
  font: inherit; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.35rem 0.7rem; border-radius: 6px;
  border: 1px solid var(--border-2); background: transparent;
  color: var(--text-mute); cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.todos-tab:hover { color: var(--accent-soft); border-color: #3a3a4e; }
.todos-tab.active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.todos-tab .badge {
  display: inline-block; margin-left: 0.4rem; padding: 0 0.4rem;
  background: var(--border); color: var(--text-dim); border-radius: 999px; font-size: 0.65rem;
}
.todos-tab.active .badge { background: #2a2640; color: var(--accent-soft); }
.todos-add { display: flex; gap: 0.5rem; margin-bottom: 0.7rem; }
.todos-add input[type="text"] {
  flex: 1; font: inherit; font-size: 0.85rem;
  padding: 0.55rem 0.7rem;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 7px;
  outline: none; transition: border-color 0.15s;
}
.todos-add input[type="text"]:focus { border-color: var(--accent); }
.todos-add button {
  font: inherit; font-size: 0.78rem; font-weight: 600;
  padding: 0 1rem;
  background: var(--accent-bg); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 7px;
  cursor: pointer; transition: all 0.15s;
}
.todos-add button:hover { background: var(--accent); color: var(--panel); }
.todos-list {
  list-style: none; max-height: 460px; overflow-y: auto;
  padding-right: 0.4rem;
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.todos-list::-webkit-scrollbar { width: 6px; }
.todos-list::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.todos-empty {
  padding: 1.2rem 0.7rem;
  color: var(--text-fade); font-size: 0.82rem;
  font-style: italic; text-align: center;
}
.todo-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem;
  padding: 0.55rem 0.6rem; border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.todo-row:hover { background: #1a1a25; border-color: #2a2a36; }
.todo-row.sortable-ghost { opacity: 0.4; background: var(--accent-bg); }
.todo-row .handle {
  color: #3e3e52; cursor: grab; font-size: 0.95rem;
  line-height: 1; padding: 0 0.15rem; user-select: none;
  transition: color 0.15s;
}
.todo-row:hover .handle { color: var(--text-mute); }
.todo-row .handle:active { cursor: grabbing; }
.todo-row .text {
  flex: 1; font-size: 0.86rem; color: var(--text);
  line-height: 1.4; word-break: break-word; cursor: text;
}
.todo-row.deleted .text, .todo-row.done .text { color: var(--text-mute); text-decoration: line-through; }
.todo-row .check {
  appearance: none;
  width: 16px; height: 16px; flex-shrink: 0;
  border: 1px solid #3a3a4e; border-radius: 4px;
  background: var(--panel); cursor: pointer;
  display: grid; place-items: center;
  transition: border-color 0.12s, background 0.12s;
}
.todo-row .check:hover { border-color: var(--accent); }
.todo-row .check:checked { background: var(--accent); border-color: var(--accent); }
.todo-row .check:checked::after {
  content: "✓"; color: var(--panel);
  font-size: 0.75rem; font-weight: 700; line-height: 1;
}
.todo-row .text-edit {
  flex: 1; font: inherit; font-size: 0.86rem;
  padding: 0.3rem 0.5rem;
  background: #0f0f15; color: var(--text);
  border: 1px solid var(--accent); border-radius: 5px; outline: none;
}
.todo-check-form, .todo-edit-form { display: contents; }
.todo-edit-form[hidden] { display: none; }
.todo-row[data-editing="1"] .text { display: none; }
.todo-row .actions { display: flex; gap: 0.3rem; opacity: 0; transition: opacity 0.12s; }
.todo-row:hover .actions, .todo-row.editing .actions { opacity: 1; }
.todo-row .actions button, .todo-row .actions a {
  font: inherit; font-size: 0.7rem; font-weight: 600;
  padding: 0.3rem 0.55rem; background: transparent;
  color: var(--text-dim); border: 1px solid var(--border-2);
  border-radius: 5px; cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.todo-row .actions button:hover, .todo-row .actions a:hover { color: #fff; border-color: var(--accent); }
.todo-row .actions .danger:hover { color: var(--danger); border-color: #5a1a1a; background: #2a1414; }
.todo-row .actions .todo-promote-stack {
  display: inline-grid; grid-template-rows: 1fr 1fr; gap: 2px;
  align-self: stretch;
}
.todo-row .actions .todo-promote-stack .todo-promote-btn {
  font-size: 0.7rem; padding: 0 0.35rem; line-height: 1;
  min-height: 0; min-width: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.05em;
}

@media (max-width: 640px) {
  .todo-row .text, .todo-row .text-edit { flex-basis: 100%; order: 1; }
  .todo-row .handle { order: 2; }
  .todo-row .check { order: 3; }
  .todo-row .schedule-picker { order: 4; margin-left: auto; }
  .todo-row .actions { order: 5; }
  .todo-row .progress-dots { order: 6; }
  .todo-row .handle { color: var(--text-mute); }
}

/* ─── Runbook (.startup) ────────────────────────────────────────────── */
.startup {
  margin-bottom: 2.5rem;
  padding: 1.4rem 1.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.startup h2 { font-size: 0.9rem; font-weight: 700; color: #fff; margin-bottom: 0.3rem; letter-spacing: -0.01em; }
.startup p.sub { font-size: 0.78rem; color: var(--text-mute); margin-bottom: 1rem; }
.startup .step-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); margin: 0.9rem 0 0.45rem;
}
.startup .step-label:first-of-type { margin-top: 0; }
.cmd {
  position: relative;
  background: #0c0c10;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.55rem 2.2rem 0.55rem 0.7rem;
  margin-bottom: 0.4rem;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem; line-height: 1.5;
  color: #d4d4e0; white-space: pre; overflow-x: auto;
}
.cmd:last-child { margin-bottom: 0; }
.cmd .copy-btn {
  position: absolute; top: 0.35rem; right: 0.35rem;
  background: var(--border); border: 1px solid var(--border-2);
  color: var(--text-dim); border-radius: 5px;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem; font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.cmd .copy-btn:hover { background: #2a2640; color: var(--text); border-color: var(--accent); }
.cmd .copy-btn.copied { color: var(--success); border-color: #1a2a1a; background: #1a2a1a; }

/* ─── Tech stack ─────────────────────────────────────────────────────── */
.section-title {
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #555568; margin-bottom: 1rem;
}
.stack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem; margin-bottom: 2.5rem;
}
.stack .pill {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.7rem 0.9rem; font-size: 0.8rem;
}
.stack .pill strong { color: var(--text); display: block; font-weight: 600; margin-bottom: 0.15rem; }
.stack .pill span { color: var(--text-mute); font-size: 0.7rem; }

/* ─── Documents ──────────────────────────────────────────────────────── */
.docs-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 2.5rem; }
.doc-row {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.4rem;
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.doc-row:hover { border-color: var(--accent); background: #1a1a26; }
.doc-row .doc-icon { font-size: 1.2rem; flex-shrink: 0; }
.doc-row .doc-info { flex: 1; }
.doc-row .doc-name { font-size: 0.9rem; font-weight: 600; color: #c4c4d4; }
.doc-row .doc-meta { font-size: 0.75rem; color: var(--text-fade); margin-top: 0.15rem; }
.doc-row .doc-arrow { color: #3a3a50; font-size: 1rem; transition: color 0.15s; }
.doc-row:hover .doc-arrow { color: var(--accent); }

/* ─── Footer ─────────────────────────────────────────────────────────── */
footer.app-footer {
  padding: 2rem 2.5rem; border-top: 1px solid var(--border);
  color: var(--text-fade); font-size: 0.75rem; text-align: center;
}
footer.app-footer a { color: var(--accent); text-decoration: none; }
footer.app-footer a:hover { text-decoration: underline; }

/* ─── Workspace (project list) ───────────────────────────────────────── */
.workspace-cards { display: flex; flex-direction: column; gap: 0.9rem; max-width: 1100px; }
.workspace-cards .card-slot {
  position: relative;
  border-radius: 12px;
  transition: opacity 0.12s, box-shadow 0.12s;
}
.workspace-cards .card-slot.sortable-ghost { opacity: 0.4; }
.workspace-cards .card-slot .drag-handle {
  position: absolute;
  top: 12px; left: -22px;
  font-size: 1rem; line-height: 1;
  color: var(--text-fade); cursor: grab;
  padding: 4px 6px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  user-select: none;
  z-index: 2;
}
.workspace-cards .card-slot:hover .drag-handle { opacity: 0.8; }
.workspace-cards .card-slot .drag-handle:hover { color: var(--accent); opacity: 1; }
.workspace-cards .card-slot .drag-handle:active { cursor: grabbing; }

/* Mobile-only thumb-grip in the top-right of each project card. Same drag
   behaviour as the desktop ⋮⋮ rail (both elements share .sortable-handle),
   just sized as a thumb target. */
.workspace-cards .card-slot .card-thumb-handle { display: none; }
@media (max-width: 640px) {
  .workspace-cards .card-slot .card-thumb-handle {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 8px; right: 8px;
    width: 38px; height: 38px;
    font-size: 1.25rem; line-height: 1;
    color: var(--accent);
    background: var(--accent-bg);
    border: 1px solid var(--accent);
    border-radius: 8px;
    cursor: grab; user-select: none;
    z-index: 3;
    touch-action: none; /* let SortableJS own the drag gesture */
  }
  .workspace-cards .card-slot .card-thumb-handle:active { cursor: grabbing; }
}
.workspace-cards .card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  transition: border-color 0.15s;
}
.workspace-cards .card:hover { border-color: var(--accent); }
.workspace-cards .card-header { display: block; text-decoration: none; }
.workspace-cards .card-todos { border-left: 1px solid var(--border-2); padding-left: 1.2rem; }
.workspace-cards .card-todos-head { display: flex; justify-content: flex-end; margin-bottom: 0.4rem; }
.workspace-cards .card-todos .todo-empty { font-size: 0.75rem; color: var(--text-mute); margin: 0; }
.workspace-cards .bring-in-next-btn {
  font: inherit; font-size: 0.7rem; font-weight: 600;
  margin-top: 0.4rem; padding: 0.25rem 0.55rem;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border-2); border-radius: 5px;
  cursor: pointer; transition: all 0.15s;
}
.workspace-cards .bring-in-next-btn:hover { color: #fff; border-color: var(--accent); }
.workspace-cards .card-add-todo { margin-top: 0.5rem; }
.workspace-cards .card-add-todo-input {
  width: 100%; box-sizing: border-box;
  font: inherit; font-size: 0.8rem;
  padding: 0.35rem 0.55rem;
  background: transparent; color: var(--text);
  border: 1px dashed var(--border-2); border-radius: 5px;
  transition: border-color 0.15s, background 0.15s;
}
.workspace-cards .card-add-todo-input::placeholder { color: var(--text-mute); }
.workspace-cards .card-add-todo-input:focus {
  outline: none; border-style: solid; border-color: var(--accent);
  background: var(--bg-2);
}
@media (max-width: 640px) {
  .workspace-cards .card { grid-template-columns: 1fr; gap: 0.85rem; }
  .workspace-cards .card-todos { border-left: none; padding-left: 0; padding-top: 0.7rem; border-top: 1px solid var(--border-2); }
}
.home-projects-head { display: flex; justify-content: flex-end; margin-bottom: 0.6rem; max-width: 1100px; }
.workspace-cards .card-label { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; color: var(--accent); margin-bottom: 0.4rem; }
.workspace-cards .card-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; }
.workspace-cards .card-url  { margin-top: 0.7rem; font-size: 0.7rem; color: var(--text-mute); font-family: "SF Mono", monospace; }
.workspace-cards .card-priority-day {
  margin-top: 0.45rem;
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-soft);
  background: var(--accent-bg);
  border: 1px solid var(--border-2);
  padding: 0.15rem 0.5rem; border-radius: 999px;
}
.workspace-cards .card-priority-day-icon { font-size: 0.8rem; line-height: 1; }

.add-project-link {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.78rem; color: var(--text-mute); text-decoration: none;
  padding: 0.5rem 0.8rem; border: 1px dashed var(--border-2); border-radius: 8px;
}
.add-project-link:hover { color: var(--accent); border-color: var(--accent); }

.home-projects-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; gap: 0.6rem; max-width: 1100px; }
.home-projects-footer .add-project-link { margin-top: 0; }
.view-all-link {
  font-size: 0.78rem; color: var(--text-mute); text-decoration: none;
  padding: 0.5rem 0.8rem; border: 1px solid var(--border-2); border-radius: 8px;
}
.view-all-link:hover { color: var(--accent); border-color: var(--accent); }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.6rem 1.8rem; margin-bottom: 1.5rem;
}
.form-card h3 { font-size: 0.85rem; font-weight: 700; color: #fff; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.08em; }
.form-card .field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.form-card label { font-size: 0.72rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.05em; }
.form-card input[type="text"], .form-card input[type="url"], .form-card input[type="email"], .form-card input[type="password"], .form-card textarea, .form-card select {
  font: inherit; font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  background: #0f0f15; color: var(--text);
  border: 1px solid var(--border-2); border-radius: 7px;
  outline: none; transition: border-color 0.15s;
}
.form-card input:focus, .form-card textarea:focus { border-color: var(--accent); }
.form-card textarea { min-height: 80px; font-family: "SF Mono", Menlo, monospace; }
.form-card .actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.btn {
  display: inline-block; font: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 0.55rem 1rem; background: #2a1f3f; color: var(--accent-soft);
  border: 1px solid #3a2f5a; border-radius: 7px; cursor: pointer;
  text-decoration: none; transition: all 0.15s;
}
.btn:hover { background: #3a2f5a; color: #fff; }
.btn-secondary { background: transparent; color: var(--text-dim); border-color: var(--border-2); }
.btn-secondary:hover { color: #fff; border-color: var(--accent); background: transparent; }
.btn-danger { background: transparent; color: #f87171; border-color: #7a1f24; }
.btn-danger:hover { background: #3a1216; color: #ffb4b4; border-color: #f87171; }

/* ─── Nested forms ──────────────────────────────────────────────────── */
.nested-row {
  position: relative;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 0.9rem 1rem 0.6rem;
  margin-bottom: 0.6rem;
  background: #0f0f15;
}
.nested-row[hidden] { display: none; }
.nested-row .nested-remove {
  position: absolute; top: 0.55rem; right: 0.55rem;
  font-size: 0.7rem; padding: 0.25rem 0.55rem;
}
.nested-row .field { margin-bottom: 0.55rem; }
.nested-section { padding: 1.1rem 1.1rem 0.8rem; }
.nested-section .nested-sub {
  margin-top: 0.6rem; padding: 0.7rem 0.9rem;
  background: #14141c; border: 1px solid var(--border);
  border-radius: 7px;
}
.nested-section .nested-sub-label {
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); margin-bottom: 0.5rem;
}
.nested-step {
  background: #0c0c10;
  margin-bottom: 0.4rem; padding: 0.7rem 0.8rem 0.4rem;
}
.nested-grid {
  display: grid; gap: 0.5rem 0.7rem; margin-bottom: 0.4rem;
}
.nested-grid.bookmark-grid { grid-template-columns: minmax(80px, 120px) 1fr 1.5fr; }
.nested-grid.stack-grid    { grid-template-columns: minmax(120px, 1fr) 1fr 1.4fr; }
.nested-grid.doc-grid      { grid-template-columns: 60px 1fr 1.5fr 2fr; }
.nested-grid .field { margin-bottom: 0; }
@media (max-width: 800px) {
  .nested-grid.bookmark-grid, .nested-grid.stack-grid, .nested-grid.doc-grid {
    grid-template-columns: 1fr;
  }
}
.nested-actions { margin-top: 0.6rem; }

/* ─── Project shell (header + left menu + main) ─────────────────────── */
.project-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.4rem 2rem 2.5rem;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.6rem;
  align-items: start;
}
@media (max-width: 900px) {
  .project-shell { grid-template-columns: 1fr; }
}
.project-menu {
  display: flex; flex-direction: column;
  gap: 0.2rem;
  position: sticky;
  top: 1rem;
  padding: 0.7rem 0.4rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.project-menu-item {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.86rem;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 7px;
  transition: background 0.12s, color 0.12s;
}
.project-menu-item:hover { background: var(--panel-2); color: #fff; }
.project-menu-item.active {
  background: var(--accent-bg);
  color: var(--accent-soft);
}
.project-menu-item .pmi-icon { font-size: 0.95rem; opacity: 0.85; }
.project-main { min-width: 0; }

.settings-subnav {
  display: flex; gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}
.settings-subnav-link {
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  color: var(--text-mute);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.settings-subnav-link:hover { background: var(--panel-2); color: var(--text); }
.settings-subnav-link:target,
.settings-subnav-link.active { background: var(--accent-bg); color: var(--accent); }
.settings-hint {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-mute);
  line-height: 1.5;
}

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 1.5rem; align-items: start; }
/* Single-column only on truly narrow viewports (phones in portrait).
   At ~640px+ (e.g. a phone in landscape, ~750–950 CSS px) the 2-col
   layout fits and matches the desktop. */
@media (max-width: 640px) { .home-grid { grid-template-columns: 1fr; } }
.home-todos { position: sticky; top: 1rem; }
.global-todos h3 { margin-bottom: 0.2rem; }
.global-todos-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.preview-toggle-btn {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-mute); text-decoration: none;
  border: 1px solid var(--border-2); border-radius: 999px;
  padding: 0.15rem 0.55rem;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.preview-toggle-btn:hover { color: var(--accent); border-color: var(--accent); }
.global-todos.is-preview { border-left: 3px solid var(--accent); }
.todo-group { margin-top: 1rem; }
.todo-group + .todo-group { padding-top: 0.8rem; border-top: 1px solid var(--border-2); }
.todo-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.35rem; }
.todo-group-title { display: inline-block; font-weight: 600; color: var(--accent); text-decoration: none; font-size: 0.85rem; }
.todo-group-title:hover { text-decoration: underline; }
.todo-defer-btn { background: transparent; color: var(--text-mute); border: 1px solid var(--border-2); border-radius: 5px; font-size: 0.7rem; padding: 0.1rem 0.45rem; cursor: pointer; transition: color 0.12s, border-color 0.12s; }
.todo-defer-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Home Top Todos row: [done tick] [text] [waiting] / [dots + log-circle] */
.todo-line {
  display: grid; grid-template-columns: 1.1rem minmax(0, 1fr) auto;
  column-gap: 0.45rem; row-gap: 2px; align-items: start;
  position: relative;
}
.todo-line form { display: inline-block; margin: 0; }
.todo-tick, .todo-move-btn {
  width: 1.1rem; height: 1.1rem; padding: 0; line-height: 1;
  background: transparent;
  border: 1px solid var(--border-2); border-radius: 4px;
  font-size: 0.7rem; cursor: pointer;
  margin-top: 1px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.todo-tick { color: transparent; }
.todo-tick:hover { color: #34d399; border-color: #34d399; background: rgba(52, 211, 153, 0.08); }
.todo-move { display: inline-block; position: relative; }
.todo-move-btn { color: var(--text-mute); display: inline-flex; align-items: center; justify-content: center; }
.todo-move-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.todo-move-popover {
  background: #14141c;
  border: 1px solid var(--border-2); border-radius: 6px;
  padding: 0.25rem; box-shadow: 0 6px 24px rgba(0,0,0,0.55);
  z-index: 100; min-width: 200px; max-height: 60vh; overflow-y: auto;
}
.todo-move-list { list-style: none; margin: 0; padding: 0; }
.todo-move-list li { margin: 0; }
.todo-move-list form { display: block; margin: 0; }
.todo-move-item {
  display: block; width: 100%; text-align: left;
  background: transparent; color: #e2e2e8;
  border: none; border-radius: 4px;
  padding: 0.4rem 0.6rem; font-size: 0.85rem; font: inherit;
  cursor: pointer;
}
.todo-move-item:hover { background: var(--accent); color: #fff; }
.todo-line .todo-item { grid-column: 2; }
.todo-line .progress-dots { grid-column: 2 / -1; padding-left: 0; margin-top: 2px; }

/* "Waiting" chip — hidden until the todo-line is hovered. Hovering the chip
   itself reveals a popover with 1d / 3d / 1w snooze buttons. */
.todo-waiting {
  grid-column: 3; grid-row: 1;
  position: relative;
  opacity: 0; visibility: hidden;
  transition: opacity 0.12s;
  margin-left: 0.4rem;
}
.todo-line:hover .todo-waiting,
.todo-line:focus-within .todo-waiting,
.todo-waiting:hover { opacity: 1; visibility: visible; }
.todo-waiting-label {
  display: inline-block;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  background: var(--accent-bg); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 4px;
  cursor: pointer;
}
.todo-waiting-menu {
  position: absolute; top: 100%; right: 0;
  margin-top: 4px;
  display: none;
  background: var(--panel); border: 1px solid var(--border-2);
  border-radius: 6px; padding: 0.5rem 0.6rem;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  white-space: nowrap; z-index: 50;
}
.todo-waiting:hover .todo-waiting-menu,
.todo-waiting:focus-within .todo-waiting-menu { display: block; }
.todo-waiting-heading {
  display: block;
  font-size: 0.7rem; color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.todo-waiting-actions { display: flex; gap: 0.3rem; }
.todo-waiting-btn {
  font: inherit; font-size: 0.72rem; font-weight: 600;
  padding: 0.25rem 0.55rem;
  background: var(--accent-bg); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 4px;
  cursor: pointer; transition: background 0.12s, color 0.12s;
}
.todo-waiting-btn:hover { background: var(--accent); color: var(--panel); }

/* Day-of-progress dots + the empty "log progress" circle */
.progress-dots { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.progress-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); opacity: 0.9; cursor: help; }

.progress-log {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0; padding: 0;
}
.progress-log-input {
  width: 0; padding: 0; border: 0; opacity: 0;
  background: #14141c; color: #e2e2e8;
  border-radius: 4px; font-size: 0.78rem; height: 18px;
  transition: width 0.15s ease, opacity 0.12s ease, padding 0.15s ease, border-color 0.12s ease;
  outline: none;
}
.progress-log:hover .progress-log-input,
.progress-log:focus-within .progress-log-input {
  width: 11rem; padding: 0 0.4rem;
  border: 1px solid var(--accent); opacity: 1;
}
.progress-log-circle {
  width: 10px; height: 10px; padding: 0; border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--accent);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}
.progress-log-circle:hover { background: rgba(167, 139, 250, 0.35); transform: scale(1.15); }
.todos-list .progress-dots { flex-basis: 100%; padding-left: 2.4rem; margin-top: 4px; }
.todo-list { list-style: none; padding: 0; margin: 0; }
.todo-list li { padding: 0.18rem 0; font-size: 0.82rem; line-height: 1.35; }
.todo-list a.todo-item { color: var(--text-dim); text-decoration: none; }
.todo-list a.todo-item:hover { color: var(--text); }
.todo-empty { font-size: 0.78rem; color: var(--text-mute); margin: 0.2rem 0 0; }

.priority-row { display: flex; align-items: center; gap: 1rem; margin-top: 0.8rem; }
.priority-slider { flex: 1; min-width: 0; max-width: 380px; accent-color: var(--accent); height: 1.6rem; }
.priority-value {
  font-variant-numeric: tabular-nums; font-size: 1.1rem; font-weight: 700;
  color: var(--accent); min-width: 1.6em; text-align: center;
  background: var(--accent-bg); border-radius: 6px; padding: 0.15rem 0.5rem;
}

.toggle-row {
  display: flex; gap: 0.8rem; align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: #0f0f15;
  cursor: pointer;
}
.toggle-row .toggle-check {
  width: 18px; height: 18px;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  cursor: pointer;
}
.toggle-row .toggle-label { display: flex; flex-direction: column; gap: 0.2rem; }
.toggle-row .toggle-label strong { color: var(--text); font-size: 0.95rem; }
.toggle-row .toggle-sub { color: var(--text-mute); font-size: 0.78rem; }

/* ─── Wiki ──────────────────────────────────────────────────────────── */
.wiki-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.2rem;
}
@media (max-width: 900px) { .wiki-shell { grid-template-columns: 1fr; } }
.wiki-sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.4rem 1rem;
}
.wiki-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.6rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.wiki-sidebar-title {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-mute);
}
.wiki-new-btn {
  font-size: 0.72rem; font-weight: 600;
  color: var(--accent-soft);
  text-decoration: none;
  padding: 0.25rem 0.55rem;
  border: 1px solid #3a2f5a;
  border-radius: 6px;
  background: #2a1f3f;
  transition: background 0.12s;
}
.wiki-new-btn:hover { background: #3a2f5a; color: #fff; }
.wiki-pages { list-style: none; padding: 0.4rem 0.2rem; margin: 0; max-height: 65vh; overflow-y: auto; }
.wiki-pages li { margin: 0.15rem 0; display: flex; align-items: center; gap: 0.2rem; }
.wiki-pages li.sortable-ghost { opacity: 0.4; }
.wiki-drag-handle {
  flex: 0 0 auto;
  font-size: 0.85rem; line-height: 1;
  color: var(--text-fade);
  padding: 0.45rem 0.25rem;
  cursor: grab;
  opacity: 0;
  user-select: none;
  transition: opacity 0.15s, color 0.15s;
}
.wiki-pages li:hover .wiki-drag-handle { opacity: 0.7; }
.wiki-drag-handle:hover { color: var(--accent); opacity: 1; }
.wiki-drag-handle:active { cursor: grabbing; }
.wiki-pages li a {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.84rem;
  color: var(--text-dim);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.wiki-pages li a:hover { background: var(--panel-2); color: var(--text); }
.wiki-pages li.active a {
  background: var(--accent-bg);
  color: var(--accent-soft);
}
.wiki-pages .wiki-empty {
  padding: 1rem 0.7rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-fade);
}
.wiki-main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  min-width: 0;
}
.wiki-toolbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.2rem;
  gap: 1rem;
}
.wiki-title { font-size: 1.5rem; font-weight: 700; color: #fff; letter-spacing: -0.02em; line-height: 1.2; }
.wiki-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.wiki-empty-state { color: var(--text-mute); }
.wiki-empty-state h2 { color: #fff; font-size: 1.2rem; margin-bottom: 0.5rem; }
.wiki-form { display: flex; flex-direction: column; gap: 1rem; }
.wiki-title-input {
  font: inherit; font-size: 1.5rem; font-weight: 700;
  background: transparent; color: #fff;
  border: 0; outline: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border-2);
}
.wiki-title-input:focus { border-bottom-color: var(--accent); }

/* Trix editor — dark-theme overrides */
trix-toolbar .trix-button-group {
  background: var(--panel-2);
  border-color: var(--border-2);
}
trix-toolbar .trix-button {
  background: transparent;
  border: 0;
  color: var(--text-dim);
}
trix-toolbar .trix-button:not(:disabled):hover { background: var(--accent-bg); color: var(--accent-soft); }
trix-toolbar .trix-button.trix-active { background: var(--accent-bg); color: var(--accent); }
/* Trix ships its icons as dark-on-light SVGs in CSS background-image,
   so on the dark theme they're invisible. Invert them. */
trix-toolbar .trix-button--icon::before { filter: invert(1) brightness(1.4); opacity: 0.75; }
trix-toolbar .trix-button--icon:not(:disabled):hover::before { opacity: 1; }
trix-toolbar .trix-button--icon.trix-active::before { opacity: 1; }
trix-toolbar .trix-button--icon:disabled::before { opacity: 0.25; }
trix-editor {
  background: #0f0f15;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  padding: 1rem 1.1rem;
  min-height: 280px;
  font-size: 0.92rem;
  line-height: 1.6;
}
trix-editor:focus { outline: none; border-color: var(--accent); }
trix-editor h1, .trix-content h1 { font-size: 1.4rem; color: #fff; margin: 0.6rem 0 0.4rem; }
trix-editor a, .trix-content a { color: var(--accent); }
trix-editor ul, .trix-content ul { padding-left: 1.4rem; }
trix-editor ol, .trix-content ol { padding-left: 1.4rem; }
trix-editor blockquote, .trix-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-mute);
  margin: 0.6rem 0;
}
trix-editor pre, .trix-content pre {
  background: #0c0c10;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
}
.trix-content { color: var(--text); }
.wiki-body { font-size: 0.95rem; line-height: 1.65; }
.wiki-body img { max-width: 100%; border-radius: 6px; }

/* Wiki attachments */
.wiki-attachments-edit { margin-top: 1rem; padding: 1rem 1.1rem; background: #0f0f15; border: 1px solid var(--border-2); border-radius: 8px; }
.wiki-attachments-label { display: block; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-mute); margin-bottom: 0.6rem; }
.wiki-attachments-show { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.wiki-attachments-heading { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mute); margin-bottom: 0.7rem; }
.wiki-attachments-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.wiki-attachments-list li {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0.75rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.85rem;
}
.wiki-attachments-list .att-icon { font-size: 1rem; }
.wiki-attachments-list .att-name {
  color: var(--accent-soft); text-decoration: none; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wiki-attachments-list .att-name:hover { color: #fff; text-decoration: underline; }
.wiki-attachments-list .att-size { color: var(--text-fade); font-size: 0.72rem; font-family: "SF Mono", Menlo, monospace; }
.wiki-attachments-list form { display: contents; }
.wiki-attachments-list .att-remove {
  font: inherit; font-size: 0.7rem; font-weight: 600;
  padding: 0.25rem 0.55rem;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border-2); border-radius: 5px;
  cursor: pointer; transition: all 0.12s;
}
.wiki-attachments-list .att-remove:hover { color: var(--danger); border-color: #5a1a1a; background: #2a1414; }
.wiki-file-input {
  display: block; width: 100%;
  padding: 0.5rem 0;
  font: inherit; font-size: 0.85rem;
  color: var(--text-dim);
}
.wiki-file-input::file-selector-button {
  margin-right: 0.6rem;
  padding: 0.4rem 0.8rem;
  background: #2a1f3f; color: var(--accent-soft);
  border: 1px solid #3a2f5a; border-radius: 6px;
  font-size: 0.78rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.wiki-file-input::file-selector-button:hover { background: #3a2f5a; color: #fff; }
.wiki-hint { font-size: 0.72rem; color: var(--text-mute); margin-top: 0.4rem; }

/* ─── Auth ──────────────────────────────────────────────────────────── */
.auth-shell { display: grid; place-items: center; min-height: 100vh; padding: 2rem; }
.auth-card { width: 100%; max-width: 360px; }
.auth-tagline { color: var(--accent); font-size: 0.95rem; font-weight: 500; margin: 0.1rem 0 0.9rem; }
.auth-blurb { color: var(--text-mute); font-size: 0.85rem; margin: 0 0 1rem; }
.btn-google { width: 100%; }

.import-button[disabled], .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.bulk-import-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.bulk-import-actions form { display: inline-block; margin: 0; }

.sync-cards { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.6rem; }
.sync-card { background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 0.7rem 0.9rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; justify-content: space-between; }
.sync-card-head { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.sync-card-name { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.sync-card-slug { font-size: 0.72rem; color: var(--text-mute); font-family: ui-monospace, monospace; }
.sync-card-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.sync-card-actions form { display: inline-block; margin: 0; }
.sync-card-actions .btn { padding: 0.25rem 0.55rem; font-size: 0.75rem; }

/* ─── Docs ──────────────────────────────────────────────────────────── */
.header-link { color: var(--text-mute); text-decoration: none; font-size: 0.85rem; padding: 0.25rem 0.5rem; border-radius: 6px; transition: background 0.12s, color 0.12s; }
.header-link:hover { background: var(--panel-2); color: var(--text); }

.docs-main { max-width: 880px; }
.docs-title { font-size: 1.6rem; font-weight: 700; margin: 0 0 1rem; color: var(--text); }
.docs-content h2 { font-size: 1.15rem; margin: 1.8rem 0 0.5rem; color: var(--text); }
.docs-content p, .docs-content ul, .docs-content ol { line-height: 1.55; color: #c4c4d4; }
.docs-content ul, .docs-content ol { padding-left: 1.2rem; }
.docs-content li + li { margin-top: 0.25rem; }
.docs-content code { background: var(--panel-2); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.85em; color: #e0e0ec; }
.docs-content strong { color: var(--text); }
.docs-shot { display: block; max-width: 100%; height: auto; margin: 0.8rem 0 1.2rem; border: 1px solid var(--panel-border, #2a2a3a); border-radius: 8px; }

.req { color: #f87171; margin-left: 0.15rem; }
.form-required-note { font-size: 0.78rem; color: var(--text-mute); margin-top: 0.75rem; }
.form-required-note .req { margin-left: 0; margin-right: 0.15rem; }

.subtle-link { color: var(--text-mute); text-decoration: underline; }
.subtle-link:hover { color: var(--accent); }

.weekday-grid { width: 100%; border-collapse: collapse; margin-top: 0.4rem; font-size: 0.85rem; }
.weekday-grid th, .weekday-grid td { padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--panel-border, #2a2a3a); }
.weekday-grid th { color: var(--text-mute); font-weight: 500; }
.weekday-grid tbody tr:last-child td { border-bottom: none; }

.priority-day-form select { padding: 0.2rem 0.4rem; }
.priority-day-list { list-style: none; padding-left: 0; margin-top: 0.6rem; }
.priority-day-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--panel-border, #2a2a3a); }
.priority-day-list li:last-child { border-bottom: none; }
.btn-tiny { font-size: 0.72rem; padding: 0.2rem 0.5rem; }

.surfacing-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 0.6rem; }
.surfacing-cols > div { min-width: 0; }
.surfacing-cols h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim, #8a8a9a); }
@media (max-width: 800px) { .surfacing-cols { grid-template-columns: 1fr; } }

.project-shell.has-side { grid-template-columns: 220px minmax(0, 1fr) 280px; }
@media (max-width: 1100px) { .project-shell.has-side { grid-template-columns: 220px minmax(0, 1fr); } .project-shell.has-side .project-side { grid-column: 1 / -1; } }
@media (max-width: 900px)  { .project-shell.has-side { grid-template-columns: 1fr; } }

.project-side { position: sticky; top: 1rem; align-self: start; }
.commits-list { list-style: none; padding-left: 0; margin: 0.4rem 0 0; }
.commits-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--panel-border, #2a2a3a); }
.commits-list li:last-child { border-bottom: none; }
.commit-link { display: block; text-decoration: none; color: var(--text); }
.commit-link:hover .commit-msg { color: var(--accent); }
.commit-link code { font-size: 0.78rem; color: var(--text-mute); padding-right: 0.4rem; }
.commit-msg { font-size: 0.88rem; }
.commit-meta { font-size: 0.7rem; color: var(--text-mute); margin-top: 0.15rem; }

.admin-body { background: #0f0f13; color: #e6e6ee; font-family: system-ui, sans-serif; margin: 0; }
.admin-header { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 1.4rem; border-bottom: 1px solid #2a2a3a; }
.admin-brand a { color: #a78bfa; text-decoration: none; font-weight: 600; }
.admin-main { max-width: 980px; margin: 1.4rem auto; padding: 0 1.4rem; }
.admin-card { max-width: 420px; margin: 4rem auto; background: #1a1a22; border: 1px solid #2a2a3a; border-radius: 10px; padding: 1.6rem; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid #2a2a3a; font-size: 0.88rem; }
.admin-table th { color: #9b9bb0; font-weight: 500; }

.schedule-picker { position: relative; display: inline-block; }
.schedule-btn {
  background: transparent; color: var(--text-mute);
  border: 1px solid transparent; border-radius: 6px;
  padding: 0.15rem 0.35rem; cursor: pointer; font-size: 0.95rem;
  opacity: 0; transition: opacity 0.12s ease, background 0.12s ease;
}
.todo-row:hover .schedule-btn,
.schedule-btn:focus-visible { opacity: 1; }
.schedule-btn:hover { background: var(--panel-2, #1a1a2a); border-color: var(--border, #2a2a3a); }
button.todo-scheduled-badge.schedule-trigger { border: 0; cursor: pointer; font: inherit; line-height: 1.2; }
button.todo-scheduled-badge.schedule-trigger:hover { filter: brightness(1.2); }

.schedule-popover {
  position: absolute; z-index: 20; right: 0; top: calc(100% + 0.3rem);
  min-width: 220px; padding: 0.6rem;
  background: var(--panel, #14141d); border: 1px solid var(--border, #2a2a3a);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.schedule-popover-head { font-size: 0.74rem; color: var(--text-mute); margin: 0 0 0.4rem; text-transform: uppercase; letter-spacing: 0.04em; }
.schedule-pick {
  display: flex; justify-content: space-between; gap: 0.6rem; width: 100%;
  text-align: left; background: transparent; border: none;
  padding: 0.35rem 0.4rem; border-radius: 6px; color: var(--text); cursor: pointer;
  font-size: 0.85rem;
}
.schedule-pick:hover { background: var(--panel-2, #1a1a2a); color: var(--accent); }
.schedule-pick-day { font-weight: 500; }
.schedule-pick-date { color: var(--text-mute); font-size: 0.78rem; }
.schedule-date-form { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--panel-border, #2a2a3a); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.schedule-date-label { font-size: 0.74rem; color: var(--text-mute); flex-basis: 100%; margin-bottom: 0.2rem; }
.schedule-date-form input[type="date"] { background: var(--panel-2, #1a1a2a); border: 1px solid var(--border, #2a2a3a); color: var(--text); padding: 0.2rem 0.3rem; border-radius: 4px; }
.schedule-set { font-size: 0.78rem; padding: 0.2rem 0.6rem; background: var(--accent); color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.schedule-clear { width: 100%; font-size: 0.74rem; padding: 0.3rem; background: transparent; color: var(--text-mute); border: 1px solid var(--border, #2a2a3a); border-radius: 4px; cursor: pointer; }
.schedule-clear:hover { color: #f87171; border-color: #f87171; }

.todo-scheduled-badge { display: inline-block; font-size: 0.72rem; color: var(--accent); background: var(--accent-bg, rgba(167,139,250,0.1)); padding: 0.1rem 0.4rem; border-radius: 4px; margin-right: 0.4rem; }

.calendar-todos { margin: 0.8rem 0 1rem; padding: 0.5rem 0.7rem 0.6rem; background: rgba(167, 139, 250, 0.06); border: 1px solid var(--accent); border-radius: 8px; }
.calendar-todos-head { font-size: 0.84rem; color: var(--accent); margin: 0 0 0.4rem; font-weight: 600; }
.calendar-todos-panel { border-color: var(--accent); }
.calendar-todo-meta { display: inline-flex; gap: 0.5rem; align-items: baseline; margin-left: 0.4rem; font-size: 0.7rem; }
.calendar-todo-project { color: var(--text-mute); text-decoration: none; }
.calendar-todo-project:hover { color: var(--accent); }
.calendar-todo-date { color: var(--accent); font-variant-numeric: tabular-nums; }

/* Home page search */
.home-search { position: relative; max-width: 1100px; margin-bottom: 1rem; }
.home-calendar { max-width: 1100px; margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.home-calendar-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  background: var(--bg-2);
  border: 1px solid var(--border-2); border-left: 3px solid #f59e0b;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
  min-width: 0;
}
.home-calendar-row:hover { border-color: #f59e0b; }
.home-calendar-icon { flex: 0 0 auto; font-size: 1rem; }
.home-calendar-project { flex: 0 0 auto; font-weight: 600; color: var(--accent); }
.home-calendar-sep { flex: 0 0 auto; color: var(--muted, #888); }
.home-calendar-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-reminder {
  max-width: 1100px;
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 0.95rem;
  margin-bottom: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border-2); border-left: 3px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.92rem;
}
.home-reminder-icon { flex: 0 0 auto; font-size: 1rem; }
.home-reminder-text { flex: 1 1 auto; }
.home-holiday {
  max-width: 1100px;
  display: flex; align-items: center; gap: 0.8rem;
  padding: 1.2rem 1.2rem;
  margin: 1rem 0 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border-2); border-left: 3px solid var(--accent);
  border-radius: 8px;
  color: var(--text); font-size: 0.95rem;
}
.home-holiday-icon { font-size: 1.6rem; }
.home-holiday-text strong { color: var(--accent); margin-right: 0.3rem; }
.home-holiday-link { color: var(--accent); text-decoration: underline; margin-left: 0.3rem; }
.home-holiday-link:hover { color: var(--accent-soft); }

.reminder-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.reminder-row {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0;
}
.reminder-edit-form { display: flex; flex: 1 1 auto; gap: 0.4rem; align-items: center; }
.reminder-edit-input {
  flex: 1 1 auto; box-sizing: border-box;
  font: inherit; font-size: 0.85rem;
  padding: 0.35rem 0.55rem;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 5px;
}
.reminder-edit-input:focus { outline: none; border-color: var(--accent); }
.home-search-input {
  width: 100%;
  background: var(--panel, #14141c);
  border: 1px solid var(--border, #2a2a3a);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.home-search-input:focus { outline: none; border-color: var(--accent); }
.home-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--panel, #14141c);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 8px;
  max-height: 60vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.search-results-empty { padding: 0.8rem 1rem; color: var(--text-mute); font-size: 0.85rem; }
.search-results-list { list-style: none; margin: 0; padding: 0.3rem 0; }
.search-result { margin: 0; }
.search-result-link {
  display: grid;
  grid-template-columns: 70px 1fr;
  column-gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border, #2a2a3a);
}
.search-result:last-child .search-result-link { border-bottom: none; }
.search-result-link:hover { background: rgba(167, 139, 250, 0.08); }
.search-result-kind {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  align-self: start;
  padding-top: 0.15rem;
}
.search-result-title { font-size: 0.92rem; color: var(--text); }
.search-result-snippet {
  grid-column: 2;
  font-size: 0.78rem;
  color: var(--text-mute);
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-link mark { background: rgba(167, 139, 250, 0.25); color: inherit; padding: 0 1px; border-radius: 2px; }

/* Schedule picker — recurring badge per row */
.schedule-pick-row { display: flex; align-items: stretch; gap: 0.3rem; }
.schedule-recur-btn {
  background: transparent;
  border: 1px solid var(--border, #2a2a3a);
  color: var(--text-mute);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.2;
}
.schedule-recur-btn:hover { color: #f0abfc; border-color: #f0abfc; background: rgba(240, 171, 252, 0.08); }
.schedule-recur-btn.is-current { color: #f0abfc; border-color: #f0abfc; background: rgba(240, 171, 252, 0.15); }
.todo-scheduled-badge.is-recurring { color: #f0abfc; background: rgba(240, 171, 252, 0.1); }

/* ─── Marketing site (public, served at /) ─────────────────────────── */
body.marketing {
  background: #0c0c12;
  color: var(--text);
  font-family: inherit;
  margin: 0;
  scroll-behavior: smooth;
}
body.marketing section[id] { scroll-margin-top: 70px; }
body.marketing main { display: block; }

.mkt-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(12, 12, 18, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #1d1d2a;
}
.mkt-header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0.85rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.mkt-brand {
  font-weight: 600; font-size: 1.05rem;
  color: var(--text); text-decoration: none;
}
.mkt-brand-mark { color: var(--accent); }
.mkt-nav { display: flex; align-items: center; gap: 1.4rem; font-size: 0.9rem; }
.mkt-nav a { color: var(--text-mute); text-decoration: none; transition: color 0.12s; }
.mkt-nav a:hover { color: var(--text); }
.mkt-signin {
  padding: 0.45rem 0.95rem;
  background: var(--accent); color: #0c0c12 !important;
  border-radius: 6px; font-weight: 600;
}
.mkt-signin:hover { filter: brightness(1.1); color: #0c0c12 !important; }

.mkt-hero {
  max-width: 1100px; margin: 0 auto;
  padding: 4.5rem 1.4rem 3rem;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem; align-items: center;
}
.mkt-eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--accent); font-size: 0.72rem; font-weight: 600;
  margin: 0 0 1rem;
}
.mkt-h1 {
  font-size: 2.6rem; line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 1.2rem; color: #f4f4fa;
}
.mkt-sub {
  font-size: 1.05rem; line-height: 1.55;
  color: #b8b8c8; margin: 0 0 1.8rem; max-width: 32rem;
}
.mkt-cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; margin-bottom: 0.9rem; }
.mkt-cta-primary {
  display: inline-block; padding: 0.75rem 1.3rem;
  background: var(--accent); color: #0c0c12;
  border-radius: 7px; font-weight: 600; text-decoration: none;
  transition: filter 0.12s, transform 0.06s;
}
.mkt-cta-primary:hover { filter: brightness(1.1); }
.mkt-cta-primary:active { transform: translateY(1px); }
.mkt-cta-secondary {
  color: var(--text-mute); text-decoration: none; font-size: 0.92rem;
}
.mkt-cta-secondary:hover { color: var(--text); }
.mkt-cta-note { color: #6b6b80; font-size: 0.78rem; margin: 0.3rem 0 0; }

.mkt-mock-window {
  background: #15151e; border: 1px solid #25253a;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(167, 139, 250, 0.05);
}
.mkt-mock-bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  background: #1a1a25; border-bottom: 1px solid #25253a;
  font-size: 0.72rem; color: #6b6b80;
}
.mkt-dot { width: 9px; height: 9px; border-radius: 50%; }
.mkt-dot.red { background: #ff5f56; }
.mkt-dot.amber { background: #ffbd2e; }
.mkt-dot.green { background: #27c93f; }
.mkt-mock-url { margin-left: 0.6rem; }
.mkt-mock-body { display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem; }
.mkt-mock-card {
  background: #1e1e2c; border: 1px solid #2a2a3a;
  border-radius: 7px; padding: 0.7rem 0.9rem;
}
.mkt-mock-card-h { font-size: 0.85rem; font-weight: 600; color: #d4d4e0; margin-bottom: 0.4rem; }
.mkt-mock-card ul { margin: 0; padding: 0; list-style: none; font-size: 0.78rem; color: #9999ad; line-height: 1.6; }

.mkt-features {
  max-width: 1100px; margin: 0 auto;
  padding: 4rem 1.4rem;
  border-top: 1px solid #1d1d2a;
}
.mkt-h2 {
  font-size: 1.8rem; letter-spacing: -0.01em;
  margin: 0 0 2rem; color: #f4f4fa;
}
.mkt-feature-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}
.mkt-feature {
  background: #15151e; border: 1px solid #25253a;
  border-radius: 9px; padding: 1.4rem;
}
.mkt-feature-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(167, 139, 250, 0.1); color: var(--accent);
  display: grid; place-items: center;
  font-size: 1.05rem; margin-bottom: 0.8rem;
}
.mkt-feature h3 { font-size: 1.0rem; margin: 0 0 0.4rem; color: #ececf4; }
.mkt-feature p  { font-size: 0.88rem; line-height: 1.5; color: #9999ad; margin: 0; }

.mkt-features-cta { text-align: center; margin-top: 2.5rem; }

.mkt-footer { border-top: 1px solid #1d1d2a; }
.mkt-footer-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 1.4rem; font-size: 0.82rem; color: var(--text-mute);
  display: flex; align-items: center; gap: 0.6rem;
}
.mkt-footer-inner a { color: var(--text-mute); text-decoration: none; }
.mkt-footer-inner a:hover { color: var(--text); }
.mkt-footer-sep { color: #3a3a4e; }

@media (max-width: 820px) {
  .mkt-hero { grid-template-columns: 1fr; padding-top: 3rem; gap: 2rem; }
  .mkt-h1 { font-size: 2rem; }
  .mkt-feature-grid { grid-template-columns: 1fr; }
  .mkt-nav { gap: 0.9rem; }
  .mkt-nav a:not(.mkt-signin) { display: none; }
}

/* ─── Marketing screenshot slider ──────────────────────────────────── */
.mkt-shots {
  max-width: 1100px; margin: 0 auto;
  padding: 1rem 1.4rem 3rem;
}
.mkt-shots-frame { position: relative; }
.mkt-shots-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 0;
  border-radius: 12px;
  background: #15151e;
  border: 1px solid #25253a;
  scrollbar-width: none;
}
.mkt-shots-track::-webkit-scrollbar { display: none; }
.mkt-shot {
  flex: 0 0 100%; scroll-snap-align: start;
  margin: 0; padding: 1rem 1rem 0.6rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  box-sizing: border-box;
}
.mkt-shot img {
  display: block; max-width: 100%; height: auto;
  max-height: 64vh; object-fit: contain;
  border-radius: 8px; border: 1px solid #25253a;
  background: #0c0c12;
}
.mkt-shot figcaption {
  font-size: 0.85rem; color: var(--text-mute); text-align: center;
  max-width: 44rem;
}
.mkt-shots-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(20, 20, 30, 0.85); color: #f4f4fa;
  border: 1px solid #2d3348; cursor: pointer;
  font-size: 1.5rem; line-height: 1; padding: 0;
  display: grid; place-items: center;
  transition: background 0.12s, border-color 0.12s;
}
.mkt-shots-arrow:hover { background: rgba(167, 139, 250, 0.2); border-color: var(--accent); }
.mkt-shots-prev { left: 0.6rem; }
.mkt-shots-next { right: 0.6rem; }
.mkt-shots-dots {
  position: absolute; bottom: -1.6rem; left: 0; right: 0;
  display: flex; justify-content: center; gap: 0.4rem;
}
.mkt-shots-dot {
  width: 8px; height: 8px; border-radius: 50%; padding: 0;
  background: #2d3348; border: 0; cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}
.mkt-shots-dot:hover { background: #4a4f6e; }
.mkt-shots-dot.is-active { background: var(--accent); transform: scale(1.25); }

@media (max-width: 640px) {
  .mkt-shots-arrow { width: 32px; height: 32px; font-size: 1.2rem; }
  .mkt-shot { padding: 0.6rem 0.6rem 0.4rem; }
}

/* ─── Owner stats page ─────────────────────────────────────────────── */
.stats-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.88rem; }
.stats-table th, .stats-table td {
  text-align: left; padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border-2);
}
.stats-table th { color: var(--text-mute); font-weight: 500; }
.stats-table td { color: var(--text); }
.stats-table th.num, .stats-table td.num { text-align: right; }
.stats-table tbody tr:hover { background: #1a1a25; }
