/* 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 { color-scheme: dark; }
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 {
  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 .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); }
header.app-header .nav .me { color: var(--text-fade); font-size: 0.75rem; }

.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, #1a1a27 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: #fff; transform: translateY(-1px); }
.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: #0f0f15; 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: #2a1f3f; color: var(--accent-soft);
  border: 1px solid #3a2f5a; border-radius: 7px;
  cursor: pointer; transition: all 0.15s;
}
.todos-add button:hover { background: #3a2f5a; color: #fff; }
.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; 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; }

/* ─── 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: 720px; }
.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; }
.workspace-cards .card {
  display: block;
  text-decoration: none;
  background: #1e2330;
  border: 1px solid #2d3348;
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  transition: border-color 0.15s, transform 0.15s;
}
.workspace-cards .card:hover { border-color: #6366f1; transform: translateY(-2px); }
.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: #64748b; line-height: 1.5; }
.workspace-cards .card-url  { margin-top: 0.7rem; font-size: 0.7rem; color: #475569; font-family: "SF Mono", monospace; }

.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); }

/* ─── 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; }

/* ─── 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;
}

.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; }
.wiki-pages li a {
  display: block;
  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-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-blurb { color: var(--text-mute); font-size: 0.85rem; margin: 0 0 1rem; }
.btn-google { width: 100%; }

/* ─── 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; }
