/* ============================================================
   BOARD — design system
   Palette: paper neutrals + one cobalt accent.
   Partner links use amber so the two connection types are
   readable at a glance (color-coding carries meaning, not
   decoration).
   ============================================================ */

:root {
  --paper: #f6f7f9;        /* canvas + app background */
  --card: #ffffff;         /* node cards, panels */
  --ink: #171e29;          /* primary text */
  --ink-soft: #5b6472;     /* secondary text */
  --line: #e3e7ee;         /* hairline borders */
  --accent: #2f5bea;       /* cobalt — noodles, buttons, focus */
  --accent-deep: #2448c2;
  --accent-soft: #e9eeff;
  --partner: #b45309;      /* amber — partner (peer) connections */
  --partner-soft: #fdf1e2;
  --ok: #178a50;           /* completed tasks */
  --danger: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 30, 41, 0.06), 0 8px 24px rgba(23, 30, 41, 0.08);
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html, body, #root { height: 100%; margin: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  font-size: 14.5px;
  line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

button { font-family: var(--font-body); cursor: pointer; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* ---------- Shared controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: #f0f2f6; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-deep); }

.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: #eef0f4; color: var(--ink); }

.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #fbeeec; border-color: #ecc8c3; }

.btn.small { padding: 5px 10px; font-size: 12.5px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 7px;
  color: var(--ink-soft);
  padding: 0;
}
.icon-btn:hover { background: #eef0f4; color: var(--ink); }
.icon-btn.danger:hover { background: #fbeeec; color: var(--danger); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn:disabled:hover { background: transparent; color: var(--ink-soft); }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--card);
}
.input:focus, .select:focus, .textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}

.label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 5px;
  letter-spacing: 0.01em;
}

.field { margin-bottom: 16px; }

.error-text { color: var(--danger); font-size: 13px; margin-top: 8px; }
.notice-text { color: var(--ink-soft); font-size: 13px; margin-top: 8px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.badge.partner { background: var(--partner-soft); color: var(--partner); }
.badge.neutral { background: #eef0f4; color: var(--ink-soft); }
.badge.stub { background: #f3f0fa; color: #6d4fc4; }

/* ---------- Full-screen centered layouts (auth, wizard, setup) ---------- */

.center-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 15% 20%, #eef1f7 0, transparent 40%),
    radial-gradient(circle at 85% 80%, #eef1f7 0, transparent 40%),
    var(--paper);
}

.panel-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.panel-card.wide { max-width: 560px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.brand .logo-mark {
  width: 34px;
  height: 34px;
  flex: none;
}
.brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.tagline { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 24px; }

.tab-row {
  display: flex;
  gap: 4px;
  background: #eef0f4;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.tab-row button {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 7px;
  padding: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.tab-row button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 30, 41, 0.08);
}

/* ---------- Wizard ---------- */

.wizard-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
}
.wizard-steps .step-dot {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--line);
}
.wizard-steps .step-dot.done { background: var(--accent); }

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 20px;
}

.choice-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 14px;
  text-align: left;
  font-size: 13.5px;
  transition: border-color 0.15s, background 0.15s;
}
.choice-card:hover { border-color: #c6cede; }
.choice-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice-card .choice-title {
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
}
.choice-card .choice-sub { color: var(--ink-soft); font-size: 12.5px; }

.wizard-nav { display: flex; justify-content: space-between; margin-top: 8px; }

/* ---------- Dashboard shell ---------- */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dashboard {
  display: grid;
  grid-template-columns: 240px 1fr 340px;
  flex: 1;
  min-height: 0;
}

/* Left rail */
.rail {
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 6px;
  overflow-y: auto;
}
.rail .brand { margin-bottom: 2px; }
.rail .brand h1 { font-size: 17px; }
.rail-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  margin: 16px 4px 6px;
}
.rail .btn { justify-content: flex-start; width: 100%; border-color: transparent; }
.rail .btn:hover { border-color: var(--line); }
.rail-footer { margin-top: auto; padding-top: 16px; }
.rail-user {
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 0 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Canvas area */
.canvas-wrap { position: relative; height: 100%; }
.canvas-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(23, 30, 41, 0.82);
  color: #fff;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 5;
}

/* Right properties panel */
.props {
  background: var(--card);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.props-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.props-header h2 { font-size: 16px; }
.props-header .subtitle { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.props-body { padding: 16px 18px 24px; }
.props-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* ---------- Node cards on the canvas (STAGE 2) ----------
   Background + font come from inline styles (per-node choice);
   --node-accent is set inline and drives borders, pins, jacks. */

.board-node {
  --node-accent: var(--accent);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 240px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.board-node.selected-node {
  border-color: var(--node-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--node-accent) 18%, transparent), var(--shadow);
}

.board-node-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
}
.node-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  flex: none;
}
.board-node-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node-count { font-size: 11px; color: var(--ink-soft); flex: none; }

/* The embedded checklist — scrolls after ~6 tasks */
.board-node-tasks {
  max-height: 172px;
  overflow-y: auto;
  border-top: 1px solid rgba(23, 30, 41, 0.08);
}
.node-task-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(23, 30, 41, 0.06);
  font-size: 13px;
}
.node-task-row:last-child { border-bottom: none; }
.node-task-check {
  width: 15px;
  height: 15px;
  flex: none;
  accent-color: var(--ok);
  cursor: pointer;
}
.node-task-title {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  padding: 1px 3px;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node-task-title:hover { background: rgba(23, 30, 41, 0.06); }
.node-task-title.done { text-decoration: line-through; color: var(--ink-soft); }
.node-empty { font-size: 12px; color: var(--ink-soft); padding: 8px 12px; margin: 0; }

/* Quick-add row at the bottom of every node */
.quick-add {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 8px;
  border-top: 1px solid rgba(23, 30, 41, 0.08);
}
.quick-add-input {
  flex: 1;
  min-width: 0;
  border: 1px dashed #c6cede;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}
.quick-add-input:focus {
  outline: 2px solid var(--node-accent);
  outline-offset: 0;
  border-color: transparent;
}

/* --- The tool pin (mini, on-card + workshop list) ------------
   BOARD's signature: a round patch-cable jack in the node's
   accent color. Clicking it opens the task's detail sheet.    */
.pin-mini {
  width: 19px;
  height: 19px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--node-accent, var(--accent));
  background: transparent;
  color: var(--node-accent, var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
button.pin-mini { cursor: pointer; }
button.pin-mini:hover {
  background: color-mix(in srgb, var(--node-accent, var(--accent)) 14%, transparent);
}

/* React Flow handles (connection jacks) follow the accent */
.board-node .react-flow__handle {
  width: 9px;
  height: 9px;
  background: var(--card);
  border: 2px solid var(--node-accent);
}

/* ---------- Checklist in the right panel ---------- */

.task-list { list-style: none; margin: 0 0 14px; padding: 0; }

.task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}
.task-row:last-child { border-bottom: none; }

.task-check {
  width: 18px;
  height: 18px;
  accent-color: var(--ok);
  flex: none;
  cursor: pointer;
}

.task-title {
  flex: 1;
  font-size: 14px;
  border: none;
  background: transparent;
  text-align: left;
  padding: 2px 4px;
  border-radius: 5px;
  color: var(--ink);
}
.task-title:hover { background: #f0f2f6; }
.task-title.done { text-decoration: line-through; color: var(--ink-soft); }

.task-title-input {
  flex: 1;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 14px;
  font-family: var(--font-body);
}

/* --- The tool pin: BOARD's signature element -----------------
   A small round "patch-cable jack" on the task row. A colored
   ring = a tool is plugged in; clicking it opens the tool.     */
.tool-pin {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
}
.tool-pin::before {           /* the tiny "cable" stub */
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 5px;
  height: 2px;
  background: var(--accent);
  transform: translateY(-50%);
}
.tool-pin:hover { background: #dbe4ff; }
.tool-pin.open { background: var(--accent); color: #fff; }

.task-actions { display: flex; gap: 1px; flex: none; }

/* Add-task form */
.add-task {
  border: 1px dashed #c6cede;
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 6px;
}
.add-task .row { display: flex; gap: 8px; margin-top: 8px; }
.add-task .select { flex: 1; }

/* ---------- Tool panels ---------- */

.tool-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.tool-panel-header h3 { font-size: 15px; flex: 1; }

.notepad-textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
}
.save-state { font-size: 12px; color: var(--ink-soft); margin-top: 6px; min-height: 16px; }
.save-state.saved { color: var(--ok); }

/* Calculator */
.calc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.calc-display {
  font-family: var(--font-mono);
  font-size: 22px;
  text-align: right;
  padding: 16px 14px;
  background: var(--ink);
  color: #fff;
  min-height: 60px;
  overflow-x: auto;
  white-space: nowrap;
}
.calc-display .calc-expr { font-size: 12.5px; color: #9aa3b2; display: block; min-height: 16px; }
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}
.calc-grid button {
  border: none;
  background: var(--card);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 14px 0;
  color: var(--ink);
}
.calc-grid button:hover { background: #f0f2f6; }
.calc-grid button.op { background: #eef0f4; color: var(--accent-deep); font-weight: 500; }
.calc-grid button.op:hover { background: #e2e6ee; }
.calc-grid button.eq { background: var(--accent); color: #fff; }
.calc-grid button.eq:hover { background: var(--accent-deep); }

/* Stub tool panel (Phase 3) */
.stub-panel {
  border: 1px dashed #c6b8ec;
  background: #faf8ff;
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  color: #6d4fc4;
  font-size: 13.5px;
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 30, 41, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 420px;
  padding: 24px;
}
.modal h3 { font-size: 17px; margin-bottom: 6px; }
.modal p { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 16px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  z-index: 100;
  box-shadow: var(--shadow);
}
.toast.error { background: var(--danger); }

/* ---------- Setup screen code block ---------- */

.code-block {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: #f0f2f6;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  overflow-x: auto;
  white-space: pre;
  margin: 10px 0;
}

/* ---------- Small screens: canvas is desktop-first (see README) ---------- */
@media (max-width: 960px) {
  .dashboard { grid-template-columns: 200px 1fr; }
  .props {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(340px, 90vw);
    box-shadow: var(--shadow);
    z-index: 30;
  }
}

/* ---------- STAGE 2: workshop panel (style + details) ---------- */

.style-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.swatch-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}
.swatch-label { font-size: 12px; color: var(--ink-soft); width: 78px; flex: none; }
.swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  padding: 0;
  cursor: pointer;
}
.swatch.active { outline: 2px solid var(--ink); outline-offset: 2px; }
.font-chip {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 9px;
  background: var(--card);
  color: var(--ink-soft);
}
.font-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.done-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  margin-bottom: 16px;
  cursor: pointer;
}

.tool-block {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.detail-field { margin-bottom: 10px; }
.detail-label { display: flex; align-items: center; gap: 6px; }
.detail-label .detail-link { margin-left: auto; font-size: 12px; color: var(--accent-deep); font-weight: 500; }
.detail-field .textarea { min-height: 52px; resize: vertical; font-size: 13.5px; }
.detail-field .input { font-size: 13.5px; padding: 7px 10px; }

/* ---------- Slide-away right panel ---------- */

.panel-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 40; /* floats above the panel overlay on phones */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.panel-toggle:hover { color: var(--ink); background: #f0f2f6; }

/* Desktop: closing the panel gives its column back to the canvas */
.dashboard.panel-closed { grid-template-columns: 240px 1fr 0; }
.dashboard.panel-closed .props { visibility: hidden; }

/* Phones/small screens: the panel is an overlay, so it slides */
@media (max-width: 960px) {
  .dashboard.panel-closed { grid-template-columns: 200px 1fr; }
  .props { transition: transform 0.25s ease; }
  .dashboard.panel-closed .props {
    transform: translateX(110%);
    visibility: visible; /* keep it rendered so the slide animates */
  }
}

/* ---------- STAGE 4: top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.topbar-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
.topbar-rename { max-width: 260px; padding: 5px 10px; font-size: 14px; }
.board-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

/* ---------- STAGE 4: boards home ---------- */

.home-screen {
  max-width: 1000px;
  margin: 0 auto;
  padding: 26px 20px 60px;
}
.home-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.home-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.color-filter { display: flex; align-items: center; gap: 6px; }
.filter-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  padding: 0;
  cursor: pointer;
}
.filter-dot.all {
  width: auto;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  background: var(--card);
  color: var(--ink-soft);
}
.filter-dot.active { outline: 2px solid var(--ink); outline-offset: 2px; }
.filter-dot.all.active { outline: none; background: var(--ink); color: #fff; }

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.board-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.board-card-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 13px 12px 9px;
  cursor: pointer;
  font-family: var(--font-body);
}
.board-card-main:hover { background: #f6f8fc; }
.board-card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
}
.board-card-meta {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--ink-soft);
}
.prio-badge {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
}
.card-actions {
  display: flex;
  gap: 2px;
  padding: 4px 8px 8px;
  border-top: 1px solid var(--line);
}

/* ---------- STAGE 5A: collaboration ---------- */

/* Locked nodes: pending invites, and everything that isn't yours
   when you're a member — visible, observable, untouchable */
.board-node.locked {
  opacity: 0.55;
  filter: grayscale(45%);
}
.board-node.locked .node-task-title.observe { cursor: default; }
.board-node.locked .node-task-title.observe:hover { background: none; }

.state-badge { flex: none; }

.node-task-title.observe:hover { background: none; cursor: default; }

/* ---------- STAGE L: landing page ---------- */

html { scroll-behavior: smooth; }

.landing { background: #fff; min-height: 100%; }

.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 26px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 16px;
}
.nav-links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.nav-login { color: #fff; }

.landing section, .landing header { scroll-margin-top: 76px; }

/* Hero */
.landing-hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1060px;
  margin: 0 auto;
  padding: 130px 26px 70px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.hero-sub {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 430px;
  margin: 0 0 26px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-ctas .btn { text-decoration: none; padding: 11px 20px; font-size: 14.5px; }

/* Hero animation: noodles draw in, cards float, the tick appears */
.noodle-draw {
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: drawNoodle 1.4s ease 0.3s forwards;
}
.noodle-draw.d2 { animation-delay: 0.9s; }
.noodle-draw.d3 { animation-delay: 1.5s; }
@keyframes drawNoodle { to { stroke-dashoffset: 0; } }

.float-card { animation: floatY 7s ease-in-out infinite; }
.float-card.f2 { animation-delay: 1.2s; animation-duration: 8s; }
.float-card.f3 { animation-delay: 0.6s; animation-duration: 9s; }
.float-card.f4 { animation-delay: 1.8s; animation-duration: 7.5s; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.tick-in { opacity: 0; animation: tickIn 0.5s ease 2.3s forwards; }
@keyframes tickIn { to { opacity: 1; } }

/* Sections */
.landing-section {
  max-width: 1060px;
  margin: 0 auto;
  padding: 76px 26px;
}
.landing-section.alt {
  max-width: none;
  background: var(--paper);
}
.landing-section.alt > * { max-width: 1008px; margin-left: auto; margin-right: auto; }

.section-title {
  font-size: clamp(24px, 3.4vw, 32px);
  margin-bottom: 8px;
  text-align: center;
}
.section-sub {
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 36px;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.step-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
}
.step-card .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}
.step-card h3 { font-size: 15.5px; margin-bottom: 6px; }
.step-card p { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.55; }

/* About */
.about-copy { max-width: 640px; margin: 0 auto; font-size: 15.5px; line-height: 1.7; }
.about-copy p { margin: 0 0 16px; }
.about-copy .made-by { color: var(--ink-soft); font-size: 13.5px; }
.about-copy .made-by a { color: var(--accent-deep); }

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.feature-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: var(--card);
}
.feature-card .feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  margin-bottom: 10px;
}
.feature-card h3 { font-size: 15px; margin-bottom: 5px; }
.feature-card p { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.55; }

/* Contact */
.contact-card {
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.contact-card p { color: var(--ink-soft); margin: 0 0 18px; }
.contact-card .btn { text-decoration: none; }

/* Embedded login */
.landing-auth-wrap { display: flex; justify-content: center; }

/* Footer */
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}

@media (max-width: 800px) {
  .landing-hero { grid-template-columns: 1fr; padding-top: 150px; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-ctas { justify-content: center; }
  .landing-nav { padding: 10px 14px; }
  .nav-links { gap: 12px; }
}

/* ---------- STAGE L2: scroll-scrubbed scene ---------- */

.scroll-scene {
  height: 430vh; /* the "film length": taller = slower, more cinematic scrub */
  position: relative;
  background: #fff;
}
.scene-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 76px 16px 20px;
  overflow: hidden;
}
.scene-sticky .section-title { margin-bottom: 4px; }
.scene-svg {
  width: min(940px, 96vw);
  height: auto;
  flex: none;
}

.scene-captions {
  position: relative;
  height: 84px;
  width: min(560px, 92vw);
}
.scene-caption {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.scene-caption.active { opacity: 1; transform: none; }
.scene-caption h3 { font-size: 17px; margin-bottom: 3px; }
.scene-caption p { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.5; }
.scene-caption .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

.scene-progress { display: flex; gap: 9px; margin-top: 4px; }
.scene-progress .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.3s, transform 0.3s;
}
.scene-progress .dot.on { background: var(--accent); transform: scale(1.35); }

/* Hero scroll cue */
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 30px;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: none;
  animation: cueBob 1.7s ease-in-out infinite;
}
.scroll-cue:hover { color: var(--ink); }
@keyframes cueBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* Reduced motion: no pinning, show the finished frame */
@media (prefers-reduced-motion: reduce) {
  .scroll-scene { height: auto; }
  .scene-sticky { position: static; height: auto; padding-top: 40px; }
  .scene-caption { position: static; opacity: 1; transform: none; margin-bottom: 10px; }
  .scene-captions { height: auto; display: grid; gap: 6px; }
}

/* ---------- STAGE 5B pt2: read-only content view ---------- */
.readonly-note {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 40px;
}

/* ---------- STAGE 5D: hidden tasks + declutter switch ---------- */
.hidden-flag {
  display: inline-flex;
  color: var(--ink-soft);
  flex: none;
}
.rail-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--ink);
}
.rail-toggle input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ---------- STAGE L3: contact form ---------- */
.contact-form {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.contact-textarea { min-height: 130px; resize: vertical; }
.hp { position: absolute; left: -9999px; top: -9999px; }

/* ---------- STAGE 8: arrival chips ---------- */
.new-chip {
  flex: none;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  animation: pulseNew 1.8s ease-in-out 3;
}
@keyframes pulseNew {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ---------- STAGE 9: points, badges, view-mode details ---------- */
.stats-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.points-chip {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 5px 13px;
}
.badge-chip {
  font-size: 12.5px;
  font-weight: 500;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  box-shadow: var(--shadow);
}
.node-badge-emoji { font-size: 13px; flex: none; cursor: default; }

/* ---------- ITERATION B: account modal ---------- */
.modal { max-height: 88vh; overflow-y: auto; }
.modal.wide { max-width: 560px; }

/* ---------- STAGE 10: people rows ---------- */
.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  margin-bottom: 8px;
}
.person-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.person-meta { color: var(--ink-soft); font-size: 12.5px; flex: 1; min-width: 140px; }

/* ---------- STAGE 11: deadlines & repeats ---------- */
.due-chip {
  flex: none;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 2px 7px;
  background: #eef0f4;
  color: var(--ink-soft);
}
.due-chip.overdue { background: #fbeeec; color: var(--danger); }
.due-chip.today { background: var(--partner-soft); color: var(--partner); }
.due-chip.soon { background: var(--accent-soft); color: var(--accent-deep); }
.repeat-mark { flex: none; font-size: 11px; cursor: default; }
.deadline-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.due-status { font-weight: 500; }

/* ---------- STAGE 13: attachments ---------- */
.attach-rail {
  position: absolute;
  right: -32px;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 5;
}
.attach-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  padding: 0;
}
.attach-dot:hover { color: var(--accent-deep); border-color: var(--accent); }

.att-section { margin-bottom: 12px; }
.att-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.att-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--card);
}
.att-thumb-btn { border: none; background: none; padding: 0; cursor: pointer; flex: none; display: inline-flex; }
.att-thumb-btn.icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  align-items: center;
  justify-content: center;
}
.att-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block; }
.att-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att-size { color: var(--ink-soft); font-size: 11.5px; }

/* ---------- STAGE 14: sketch pad + calc presets ---------- */
.sketch-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.sketch-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  cursor: pointer;
  padding: 0;
  flex: none;
}
.sketch-swatch.on { border-color: var(--ink); transform: scale(1.12); }
.sketch-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.sketch-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}
.preset-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.preset-result {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- PHASE 3 pt1: spreadsheet ---------- */
.sheet-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.sheet-selid {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12.5px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 7px;
  padding: 6px 9px;
  flex: none;
}
.sheet-wrap {
  overflow: auto;
  max-height: 380px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sheet { border-collapse: collapse; font-size: 12.5px; }
.sheet th {
  position: sticky;
  top: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  min-width: 30px;
  z-index: 2;
}
.sheet tbody th { position: sticky; left: 0; top: auto; z-index: 1; }
.sheet td { border: 1px solid var(--line); padding: 0; }
.sheet-cell {
  border: none;
  outline: none;
  width: 86px;
  padding: 5px 7px;
  font-size: 12.5px;
  font-family: var(--font-body);
  background: #fff;
}
.sheet-cell.sel { background: var(--accent-soft); }
.sheet-cell.err { color: var(--danger); font-weight: 600; }
.sheet-ro {
  padding: 5px 8px;
  min-width: 60px;
  white-space: nowrap;
  background: #fff;
}

/* ---------- PHASE 3 pt2: slides ---------- */
.slide-scale-box { position: relative; overflow: hidden; flex: none; }
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 960px;
  height: 540px;
  transform-origin: top left;
  font-family: var(--font-body);
  overflow: hidden;
}
.slide-center {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 80px;
}
.slide-accent-bar { width: 90px; height: 8px; border-radius: 4px; margin-bottom: 28px; }
.slide-accent-bar.small { width: 64px; height: 6px; margin: 14px 0 26px; }
.slide-big-title {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}
.slide-subtitle { font-size: 30px; margin: 22px 0 0; font-weight: 500; }
.slide-body-wrap { padding: 58px 70px; height: 100%; }
.slide-title {
  font-family: var(--font-display);
  font-size: 42px;
  margin: 0;
  line-height: 1.15;
}
.slide-bullets { list-style: none; margin: 0; padding: 0; }
.slide-bullets li {
  font-size: 28px;
  line-height: 1.45;
  margin-bottom: 18px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.slide-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; position: relative; top: -2px; }
.slide-text { font-size: 26px; line-height: 1.6; margin: 0; white-space: pre-wrap; }

.deck-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.deck-thumb {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  cursor: pointer;
  flex: none;
  overflow: hidden;
}
.deck-thumb.on { border-color: var(--accent); }
.deck-thumb .slide-scale-box { pointer-events: none; }
.deck-thumb-num {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  padding: 0 4px;
}
.deck-thumb.add {
  width: 60px;
  min-height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}
.deck-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.deck-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.present-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0b0e14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
}
.present-overlay .slide-scale-box { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); border-radius: 6px; }
.present-ui {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
}
.present-counter {
  color: #aab3c2;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ---------- PHASE 3 pt3: code editor + slide graphics ---------- */
.code-editor {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fbfcfe;
  max-height: 420px;
}
.code-gutter {
  overflow: hidden;
  background: var(--paper);
  border-right: 1px solid var(--line);
  flex: none;
  padding: 10px 0;
}
.code-gutter pre {
  margin: 0;
  padding: 0 9px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: right;
}
.code-stack { position: relative; flex: 1; min-width: 0; }
.code-hl, .code-input {
  margin: 0;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre;
  tab-size: 2;
}
.code-hl {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--ink);
}
.code-hl.static { position: static; overflow: auto; max-height: 400px; }
.code-hl code { font: inherit; }
.code-input {
  position: relative;
  display: block;
  width: 100%;
  height: 320px;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  color: transparent;
  caret-color: var(--ink);
  overflow: auto;
}
.code-editor.readonly { max-height: none; }
.tok-k { color: #6d4fc4; font-weight: 600; }
.tok-s { color: #178a50; }
.tok-c { color: #97a1b0; font-style: italic; }
.tok-n { color: #b45309; }

.slide-decor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.slide-center, .slide-body-wrap { position: relative; z-index: 1; }
.slide-stat {
  font-family: var(--font-display);
  font-size: 170px;
  line-height: 1;
  margin: 0;
  letter-spacing: -0.02em;
}
.slide-quote-mark {
  font-family: var(--font-display);
  font-size: 130px;
  line-height: 0.6;
  display: block;
  margin-bottom: 6px;
}
.slide-quote {
  font-size: 36px;
  line-height: 1.45;
  margin: 0;
  font-style: italic;
  max-width: 760px;
  white-space: pre-wrap;
}
.slide-attrib { font-size: 24px; margin: 26px 0 0; font-weight: 600; }
.slide-image-layout { display: flex; flex-direction: column; }
.slide-image-box {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}
.slide-image-box img {
  max-width: 100%;
  max-height: 340px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 8px 26px rgba(23, 30, 41, 0.18);
}
.slide-image-ph {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 26px;
  opacity: 0.4;
}
.slide-caption { font-size: 22px; margin: 14px 0 0; opacity: 0.75; }

/* ---------- STAGE 15: spaces ---------- */
.space-box {
  position: relative;
  border: 2px dashed;
  border-radius: 16px;
  pointer-events: none; /* clicks and marquee pass through to nodes/canvas */
}
.space-box.done { opacity: 0.55; }
.space-titlebar {
  pointer-events: all;
  position: absolute;
  top: -14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: grab;
  box-shadow: var(--shadow);
  max-width: 85%;
}
.space-titlebar:active { cursor: grabbing; }
.space-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 1px 7px;
  flex: none;
}
.space-resize {
  pointer-events: all;
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  border-radius: 0 0 10px 0;
  opacity: 0.5;
  color: inherit;
}
.space-box:hover .space-resize { opacity: 0.9; }

.ctx-menu {
  position: fixed;
  z-index: 900;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(23, 30, 41, 0.18);
  padding: 6px;
  min-width: 210px;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
}
.ctx-item:hover { background: var(--accent-soft); color: var(--accent-deep); }

.space-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 4px;
}
.space-row.done .space-row-name { text-decoration: line-through; opacity: 0.6; }
.space-jump {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 9px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink);
}
.space-jump:hover { border-color: var(--accent); }
.space-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.space-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.space-count-mini { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-soft); flex: none; }
.space-row-actions { display: inline-flex; gap: 0; flex: none; }

/* ---------- STAGE 16: linked (group) tasks ---------- */
.group-sync-box {
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 12px;
}
.ctx-item:disabled { opacity: 0.45; cursor: not-allowed; }
.ctx-item:disabled:hover { background: none; color: var(--ink); }

/* ---------- STAGE 17: calendar view ---------- */
.view-seg {
  display: flex;
  gap: 4px;
  margin: 0 0 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}
.view-seg-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 6px 4px;
  cursor: pointer;
}
.view-seg-btn.on {
  background: var(--card);
  color: var(--accent-deep);
  box-shadow: var(--shadow);
}

.calendar-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--paper);
  overflow: auto;
  padding: 18px 20px 26px;
}
.cal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.cal-title {
  font-family: var(--font-display);
  font-size: 21px;
  margin: 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-weekdays { margin-bottom: 6px; }
.cal-weekday {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}
.cal-cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 96px;
  max-height: 170px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cal-cell.muted { background: transparent; border-style: dashed; opacity: 0.45; }
.cal-cell.today { border-color: var(--accent); border-width: 2px; }
.cal-daynum {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
  flex: none;
}
.cal-daynum.today {
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-chips {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  min-height: 0;
}
.cal-chip {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.3;
  padding: 3px 6px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: none;
}
.cal-chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.cal-chip.overdue {
  background: #fdecea;
  border-color: #e5b3ac;
  color: #a13324;
}
.cal-chip.due-today {
  background: #fdf1e2;
  border-color: #e2c391;
  color: #8a5410;
}
.cal-chip.done {
  text-decoration: line-through;
  opacity: 0.55;
}

/* ---------- STAGE 18: mobile pass ---------- */
.rail-burger {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 9px;
  width: 36px;
  height: 34px;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  flex: none;
}
.rail-backdrop { display: none; }

@media (max-width: 820px) {
  .dashboard { grid-template-columns: 1fr; }
  .dashboard.panel-closed { grid-template-columns: 1fr; }
  .rail-burger { display: inline-flex; }
  .rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 620;
    width: min(300px, 84vw);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 0 10px 40px rgba(23, 30, 41, 0.25);
  }
  .rail.open { transform: translateX(0); }
  .rail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 610;
    background: rgba(23, 30, 41, 0.35);
  }
  .props { width: 100vw; }
  .topbar { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .topbar-name { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-layer { padding: 12px 10px 20px; }
  .cal-scroll-note { display: block; }
  .cal-grid { min-width: 640px; }
  .cal-grid-wrap { overflow-x: auto; }
  .home-header { flex-wrap: wrap; gap: 8px; }
  .board-grid { grid-template-columns: 1fr !important; }
  .home-toolbar { flex-wrap: wrap; }
  .attach-rail { right: -28px; }
}

/* Bigger touch targets + no iOS zoom-on-focus, on touch devices */
@media (pointer: coarse) {
  .icon-btn { min-width: 36px; min-height: 36px; }
  .task-check { width: 20px; height: 20px; }
  .btn.small { padding: 8px 12px; }
  .cal-chip { padding: 6px 8px; font-size: 12px; }
  .input, .select, .textarea, .sheet-cell, .code-input { font-size: 16px; }
  .space-resize { width: 24px; height: 24px; }
  .attach-dot { width: 32px; height: 32px; }
}

/* ---------- STAGE 19: board people chip + modal ---------- */
.people-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 3px 10px;
  cursor: pointer;
}
.people-chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.bp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
}
.bp-row:last-of-type { border-bottom: none; }
.bp-row.pending { opacity: 0.75; }
.bp-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.bp-avatar.hollow { background: var(--paper); border: 1px dashed var(--line); font-size: 13px; }
.bp-name { flex: 1; min-width: 0; font-size: 13.5px; }

/* ---------- STAGE 20: AI integration ---------- */
.ai-btn {
  border-color: #d9c7f5;
  background: linear-gradient(135deg, #f4edfd, #eef2ff);
  color: #6d4fc4;
  font-weight: 600;
}
.ai-btn:hover { border-color: #6d4fc4; }
.ai-helper {
  margin-top: 22px;
  border: 1px dashed #d9c7f5;
  background: linear-gradient(135deg, #faf7ff, #f5f8ff);
  border-radius: 12px;
  padding: 12px;
}
.ai-out {
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.ai-out-text {
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}

/* ---------- Tagviz rebrand: wordmark ---------- */
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.wordmark-viz {
  background: linear-gradient(120deg, #2f5bea, #6d4fc4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- STAGE 21: templates + subscribe ---------- */
.tpl-shelf {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 22px;
}
.tpl-card {
  flex: none;
  width: 210px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}
.tpl-art {
  position: relative;
  border: 1px dashed;
  border-radius: 10px;
  padding: 6px 6px 2px;
  margin-bottom: 8px;
}
.tpl-art svg { width: 100%; height: auto; display: block; }
.tpl-emoji {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 18px;
}
.tpl-name { margin: 0; font-weight: 700; font-size: 13.5px; }
.tpl-blurb {
  margin: 3px 0 8px;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.45;
  flex: 1;
}
.tpl-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-meta { font-family: var(--font-mono); font-size: 10px; color: var(--ink-soft); }
.tpl-steps { margin: 0 0 6px; padding-left: 20px; }
.tpl-steps li { font-size: 13px; line-height: 1.55; margin-bottom: 9px; }

.sub-card {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 11px 14px;
  margin: 6px 0 26px;
}

/* ---------- STAGE 21b: compact template cards ---------- */
.tpl-card { padding: 10px 12px 9px; display: flex; flex-direction: column; }
.tpl-head { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.tpl-emoji { font-size: 16px; flex: none; }
.tpl-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: 999px;
  padding: 2px 7px;
  flex: none;
}
.tpl-blurb {
  margin: 0 0 7px;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.tpl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.tpl-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  padding: 1.5px 8px;
  color: var(--ink-soft);
  background: var(--card);
}
.tpl-sample {
  margin: 0 0 8px;
  font-size: 11px;
  font-style: italic;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.tpl-meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-soft); }

/* STAGE 21b: neutralize the retired shelf-era rules */
.tpl-card { width: auto; flex: 1 1 auto; }
.tpl-emoji { position: static; top: auto; right: auto; }

/* ---------- STAGE 21c: poster template cards ---------- */
.tpl-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tpl-card:hover, .tpl-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(23, 30, 41, 0.12);
  outline: none;
}
.tpl-bigmoji {
  position: absolute;
  right: -8px;
  bottom: -14px;
  font-size: 74px;
  line-height: 1;
  opacity: 0.15;
  transform: rotate(-10deg);
  pointer-events: none;
}
.tpl-badge { position: absolute; top: 9px; right: 10px; margin-left: 0; }
.tpl-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin: 14px 0 2px;
  position: relative;
}
.tpl-hook {
  font-size: 12px;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 12px;
  position: relative;
}
.tpl-cta {
  font-size: 12px;
  font-weight: 700;
  margin-top: auto;
  position: relative;
}

/* ---------- STAGE 23: tours + how-it-works ---------- */
.tour-modal { max-width: 420px; }
.tour-art {
  background: linear-gradient(140deg, #f4f6fd, #fdf8f1);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
.tour-art.small { padding: 6px 10px; flex: none; width: 132px; }
.tour-art-svg { width: 100%; height: auto; display: block; }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin: 14px 0 4px; }
.tour-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line);
}
.tour-dot.on { background: var(--accent); transform: scale(1.25); }

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: var(--paper);
  overflow-y: auto;
}
.help-inner { max-width: 860px; margin: 0 auto; padding: 26px 22px 60px; }
.help-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.help-title { font-family: var(--font-display); font-size: 26px; margin: 0 0 4px; letter-spacing: -0.01em; }
.help-sub { margin: 0 0 22px; color: var(--ink-soft); font-size: 14px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.help-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
@media (max-width: 720px) { .help-grid { grid-template-columns: 1fr; } }
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.faq summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.faq details p { margin: 10px 0 2px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.faq details[open] summary { color: var(--accent-deep); }

/* ---------- STAGE 23b: elegant How-it-works panel ---------- */
.hiw-backdrop {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(23, 30, 41, 0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 14px;
  animation: hiwFade 0.25s ease;
}
.hiw-panel {
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(23, 30, 41, 0.3);
  width: min(620px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px 22px 22px;
  animation: hiwDrop 0.38s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes hiwFade { from { opacity: 0; } }
@keyframes hiwDrop { from { opacity: 0; transform: translateY(-28px) scale(0.985); } }
.hiw-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.hiw-title {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: -0.01em;
  margin: 4px 0 14px;
  text-align: center;
}
.hiw-stage { display: flex; align-items: center; gap: 8px; }
.hiw-arrow {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 20px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}
.hiw-arrow:hover:not(:disabled) { color: var(--accent-deep); border-color: var(--accent); }
.hiw-arrow:disabled { opacity: 0.3; cursor: default; }
.hiw-slide { flex: 1; min-width: 0; text-align: center; animation: hiwSlideIn 0.35s ease; }
@keyframes hiwSlideIn { from { opacity: 0; transform: translateX(14px); } }
.hiw-art {
  background: linear-gradient(140deg, #f4f6fd, #fdf8f1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 26px;
  max-width: 320px;
  margin: 0 auto 10px;
}
.hiw-slide-h { margin: 0 0 4px; font-size: 16px; font-family: var(--font-display); }
.hiw-slide-p { margin: 0 auto; max-width: 400px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.btn-dot { border: none; padding: 0; cursor: pointer; }
.hiw-divider { height: 1px; background: var(--line); margin: 18px 0 14px; }

.hiw-faq { display: flex; flex-direction: column; gap: 7px; }
.hiw-q {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.hiw-q.open { border-color: var(--accent); box-shadow: 0 6px 18px rgba(47, 91, 234, 0.08); }
.hiw-q-head {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: none;
  background: none;
  padding: 11px 13px;
  cursor: pointer;
  text-align: left;
}
.hiw-q-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: transform 0.25s ease;
}
.hiw-q.open .hiw-q-icon { transform: scale(1.08); }
.hiw-q-text { flex: 1; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.hiw-chev { color: var(--ink-soft); transition: transform 0.3s ease; display: inline-flex; }
.hiw-q.open .hiw-chev { transform: rotate(180deg); color: var(--accent-deep); }
.hiw-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s ease;
}
.hiw-q.open .hiw-a { grid-template-rows: 1fr; }
.hiw-a-inner { overflow: hidden; min-height: 0; }
.hiw-a-inner p {
  margin: 0;
  padding: 0 13px 12px 52px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}
.hiw-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- living illustrations ---------- */
@keyframes aFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes aPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes aDraw { 0% { stroke-dashoffset: 70; } 55%, 100% { stroke-dashoffset: 0; } }
@keyframes aDash { to { stroke-dashoffset: -14; } }
@keyframes aTwinkle { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.16) rotate(8deg); } }
@keyframes aGlow { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.32; } }
.a-float { animation: aFloat 3.2s ease-in-out infinite; }
.a-float.d2 { animation-delay: 0.5s; }
.a-float.d3 { animation-delay: 1s; }
.a-pulse { animation: aPulse 2.4s ease-in-out infinite; }
.a-pulse.d2 { animation-delay: 0.4s; }
.a-pulse.d3 { animation-delay: 0.8s; }
.a-draw { stroke-dasharray: 70; animation: aDraw 3s ease-in-out infinite; }
.a-dash { animation: aDash 1.4s linear infinite; }
.a-twinkle { animation: aTwinkle 2.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.a-glow { animation: aGlow 3s ease-in-out infinite; }
.a-float, .a-twinkle { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) {
  .a-float, .a-pulse, .a-draw, .a-dash, .a-twinkle, .a-glow,
  .hiw-panel, .hiw-backdrop, .hiw-slide { animation: none !important; }
}

/* ---------- STAGE 23c: refined, space-saving panel ---------- */
.hiw-backdrop {
  background: rgba(23, 30, 41, 0.3);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  padding-top: 7vh;
}
.hiw-panel {
  width: min(470px, 100%);
  padding: 14px 18px 18px;
  border-radius: 18px;
}
.hiw-title { font-size: 17px; margin: 2px 0 12px; }
.hiw-stage { gap: 10px; }
.hiw-arrow {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}
.hiw-art {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(150deg, #f7f8fc, #fcfaf6);
  animation: hiwSlideIn 0.3s ease;
}
.hiw-caption {
  text-align: center;
  margin-top: 10px;
  animation: hiwSlideIn 0.3s ease;
}
.hiw-slide-h { font-size: 14.5px; margin: 0; }
.hiw-rule {
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin: 6px auto 7px;
}
.hiw-slide-p { font-size: 12px; line-height: 1.6; max-width: 340px; }
.hiw-divider { margin: 14px 0 12px; }
.hiw-q-head { padding: 9px 11px; gap: 9px; }
.hiw-q-icon { width: 25px; height: 25px; }
.hiw-q-text { font-size: 12.5px; }
.hiw-a-inner p { padding: 0 12px 10px 45px; font-size: 12px; }
.hiw-foot { margin-top: 14px; }

/* refined motions */
@keyframes eDraw { 0% { stroke-dashoffset: var(--dl, 176); } 40%, 100% { stroke-dashoffset: 0; } }
@keyframes eTravel { 0% { offset-distance: 0%; } 55%, 100% { offset-distance: 100%; } }
@keyframes ePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes eSeq { 0%, 15% { opacity: 0; transform: translateX(-4px); } 35%, 100% { opacity: 1; transform: translateX(0); } }
@keyframes eTwinkle { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.22); opacity: 1; } }
.e-draw { animation: eDraw 4.5s ease-in-out infinite; }
.e-travel { offset-rotate: 0deg; animation: eTravel 3.4s ease-in-out infinite; }
.e-travel.slow { animation-duration: 5s; }
.e-pulse { animation: ePulse 2.8s ease-in-out infinite; }
.e-seq { animation: eSeq 4s ease-in-out infinite; }
.e-seq.d2 { animation-delay: 0.35s; }
.e-seq.d3 { animation-delay: 0.7s; }
.e-twinkle { animation: eTwinkle 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) {
  .e-draw, .e-travel, .e-pulse, .e-seq, .e-twinkle { animation: none !important; }
  .e-travel { offset-distance: 100%; }
  .e-seq { opacity: 1; transform: none; }
}

/* ---------- STAGE 25: AI teammates ---------- */
.agent-node {
  border: 2px solid #6d4fc4 !important;
  background: linear-gradient(160deg, #f8f5fe, #ffffff 55%) !important;
  position: relative;
}
.agent-node::before {
  content: "🤖 AI teammate";
  position: absolute;
  top: -10px;
  left: 10px;
  background: linear-gradient(120deg, #6d4fc4, #2f5bea);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
  pointer-events: none;
}
.agent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px dashed #6d4fc4;
  background: #f8f5fe;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 12px;
}
