/* Mak wireframe — ClickUp-like product chrome, dark default */
:root {
  --rail: #1a1b1d;
  --sidebar: #242528;
  --sidebar-2: #2a2b2e;
  --sidebar-text: #eeeff1;
  --sidebar-muted: #9b9da2;
  --sidebar-hover: #2a2b2e;
  --sidebar-active: #323338;
  --canvas: #1e1f21;
  --surface: #2a2b2e;
  --elevated: #323338;
  --line: #3c3d40;
  --line-strong: #4a4b50;
  --ink: #eeeff1;
  --ink-2: #c8cacf;
  --muted: #9b9da2;
  --accent: #7b68ee;
  --accent-hover: #6a56e0;
  --accent-soft: rgba(123, 104, 238, 0.16);
  --accent-ink: #c4b8ff;
  --urgent: #f53d5c;
  --high: #ff7a59;
  --normal: #4194f6;
  --low: #9b9da2;
  --done: #2ea52c;
  --progress: #4194f6;
  --review: #f5a623;
  --overdue: #f53d5c;
  --today: #f5a623;
  --warn-bg: rgba(245, 166, 35, 0.12);
  --danger-bg: rgba(245, 61, 92, 0.14);
  --ok-bg: rgba(46, 165, 44, 0.14);
  --brain-bg: rgba(123, 104, 238, 0.12);
  --radius: 8px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.04);
  --rail-w: 48px;
  --sb: 240px;
  --top: 44px;
  --drawer: 460px;
  --slide: 400px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--canvas);
}

/* —— Icon rail —— */
.icon-rail {
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  background: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 36px;
  gap: 2px;
  border-right: 1px solid #141516;
  z-index: 3;
}
.rail-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  display: grid;
  place-items: center;
  position: relative;
  text-decoration: none;
  flex: 0 0 auto;
}
.rail-btn:hover { background: var(--elevated); color: var(--ink); }
.rail-btn.active {
  background: var(--elevated);
  color: var(--ink);
}
.rail-btn.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.rail-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: var(--overdue);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* —— Sidebar —— */
.sidebar {
  width: var(--sb);
  flex: 0 0 var(--sb);
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
}
.ws-switch {
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.ws-av {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.ws-meta { line-height: 1.2; min-width: 0; }
.ws-meta b { display: block; font-size: 13px; font-weight: 650; color: var(--ink); }
.ws-meta span { font-size: 11px; color: var(--muted); }

.brand {
  padding: 12px 14px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}
.brand-sub {
  font-size: 10px;
  color: var(--sidebar-muted);
  margin-top: 2px;
}

.nav { padding: 2px 8px 6px; }
.nav-sec-label, .tree-label {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 10px 8px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-item, .tree-item, .tree-list {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  text-align: left;
  padding: 5px 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
}
.nav-item:hover, .tree-item:hover, .tree-list:hover { background: var(--sidebar-hover); }
.nav-item.active, .tree-list.active {
  background: var(--sidebar-active);
  color: #fff;
}
.nav-item .ic, .tree-list .ic { opacity: 0.8; flex: 0 0 auto; }
.nav-item svg, .tree-list svg, .tree-folder svg { opacity: 0.75; flex: 0 0 auto; }
.nav-label { flex: 1; font-weight: 500; }
.nav-count {
  font-size: 11px;
  color: var(--sidebar-muted);
  background: #00000040;
  padding: 0 6px;
  border-radius: 8px;
  line-height: 16px;
}

.tree {
  flex: 1;
  overflow: auto;
  padding: 2px 8px 12px;
  min-height: 0;
}
.tree-space {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 3px;
  font-weight: 650;
  color: var(--ink);
  font-size: 13px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}
.tree-folder {
  font-size: 12px;
  color: var(--sidebar-muted);
  padding: 5px 8px 2px 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tree-list { padding-left: 28px; font-size: 12.5px; }
.tree-list .count { margin-left: auto; font-size: 11px; color: var(--sidebar-muted); }

.sb-foot {
  border-top: 1px solid var(--line);
  padding: 8px;
}
.wantok {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wantok-av {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.wantok-meta { line-height: 1.2; }
.wantok-meta b { display: block; font-size: 12px; color: var(--ink); font-weight: 600; }
.wantok-meta span { font-size: 10px; color: var(--sidebar-muted); }

/* —— Shell / topbar —— */
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--canvas); }
.topbar {
  height: var(--top);
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  flex: 0 0 var(--top);
}
.search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  height: 30px;
  color: var(--muted);
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  color: var(--ink);
}
.search input {
  border: 0; background: transparent; outline: none;
  width: 100%; color: var(--ink);
}
.search input::placeholder { color: var(--muted); }
.tb-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tb-btn:hover { background: var(--elevated); }
.tb-btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tb-btn.accent:hover { background: var(--accent-hover); }
.tb-btn.brain {
  background: var(--accent-soft);
  border-color: #7b68ee55;
  color: var(--accent-ink);
  font-weight: 600;
}
.tb-btn.brain:hover { background: rgba(123, 104, 238, 0.26); }
.tb-btn:disabled { opacity: 0.45; cursor: default; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 10px;
  border: 0;
  flex: 0 0 auto;
}
.avatar.sm { width: 18px; height: 18px; font-size: 8px; }
.avatar.md { width: 22px; height: 22px; font-size: 9px; }

.main {
  flex: 1;
  overflow: auto;
  min-height: 0;
  background: var(--canvas);
}

/* —— Views —— */
.page { padding: 18px 22px 40px; max-width: 1100px; }
.page.wide { max-width: none; padding: 0; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.page-kicker { font-size: 11px; color: var(--muted); font-weight: 500; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; margin: 0; color: var(--ink); }
.page-sub { color: var(--muted); margin: 4px 0 0; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}
.grid-home {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  align-items: start;
}
@media (max-width: 960px) {
  .grid-2, .grid-home { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
}
.card-h {
  padding: 10px 14px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-h h2 { margin: 0; font-size: 13px; font-weight: 650; }
.card-h .meta { font-size: 11px; color: var(--muted); }
.card-b { padding: 4px 8px 10px; }

.standup { border-left: 3px solid var(--accent); }
.standup-block { padding: 6px 14px 10px; }
.standup-block h3 {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.standup-block ul { margin: 0; padding: 0; list-style: none; }
.standup-block li { padding: 3px 0; }

.cite {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}
.cite:hover { background: rgba(123, 104, 238, 0.28); }
.cite.overdue { background: var(--danger-bg); color: var(--overdue); }

.row-task {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 6px 8px;
  border-radius: 6px;
  color: inherit;
}
.row-task:hover { background: var(--elevated); }
.row-task .title { flex: 1; font-weight: 550; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-task.done .title { color: var(--muted); text-decoration: line-through; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.date { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.date.overdue { color: var(--overdue); }
.date.today { color: var(--today); }
.pri { font-size: 11px; font-weight: 700; white-space: nowrap; }

.remind li {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
}
.remind li + li { border-top: 1px solid var(--line); }
.remind button.linkish { padding: 0; border: 0; background: 0; color: var(--accent-ink); font-weight: 600; }

/* —— List chrome —— */
.list-chrome {
  padding: 8px 16px 0;
  background: var(--canvas);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crumb button { border: 0; background: 0; color: var(--muted); padding: 0; font-weight: 500; }
.crumb button:hover { color: var(--ink); }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--line-strong); }
.list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
}
.list-title-row h1 { margin: 0; font-size: 16px; letter-spacing: -0.02em; font-weight: 650; }
.list-actions { display: flex; gap: 8px; align-items: center; }
.loc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.loc-tabs { display: flex; gap: 2px; }
.loc-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px 8px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.loc-tab:hover { color: var(--ink); }
.loc-tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.views {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px;
}
.views button {
  border: 0;
  background: transparent;
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--ink-2);
  font-weight: 550;
  font-size: 12px;
}
.views button.on { background: var(--elevated); color: var(--ink); box-shadow: none; }

.list-toolbar {
  padding: 8px 16px 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

/* table */
.table-wrap { padding: 0 8px 8px; }
.t-head, .t-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 88px 110px 72px;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
}
.t-head {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  height: 26px;
  border-bottom: 1px solid var(--line);
}
.t-row {
  min-height: 32px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  text-align: left;
  color: inherit;
  border-radius: 0;
}
.t-row:hover { background: var(--surface); }
.t-row.done .t-title { color: var(--muted); text-decoration: line-through; }
.t-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.t-title {
  font-weight: 550;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t-check {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  flex: 0 0 auto;
  background: transparent;
}
.t-check.on {
  border-color: var(--done);
  background: var(--done);
  box-shadow: inset 0 0 0 2px var(--canvas);
}
.t-flag {
  width: 12px; height: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.t-flag svg { width: 12px; height: 12px; }
.t-flag.pri-urgent { color: var(--urgent); }
.t-flag.pri-high { color: var(--high); }
.t-flag.pri-normal { color: var(--normal); }
.t-flag.pri-low { color: var(--low); }
.t-subs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  flex: 0 0 auto;
}
.t-subs svg { width: 12px; height: 12px; }
.t-avs { display: flex; align-items: center; }
.t-avs .avatar + .avatar { margin-left: -4px; }

.group { padding-top: 4px; }
.group-h {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px 6px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  border: 0;
  background: transparent;
  color: var(--st, var(--ink));
  text-align: left;
}
.group-h .group-name { text-transform: uppercase; }
.group-h .n { color: var(--muted); font-weight: 500; letter-spacing: 0; }
.group-h .chev {
  display: grid;
  place-items: center;
  color: inherit;
  opacity: 0.8;
  transition: transform 0.12s ease;
}
.group-h .chev svg { width: 14px; height: 14px; }
.group.collapsed .group-body { display: none; }
.group.collapsed .chev { transform: rotate(-90deg); }
.group-h::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--st, var(--muted));
  flex: 0 0 auto;
}

.stub-view {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  max-width: 420px;
  margin: 40px auto;
}
.stub-view h2 { margin: 0 0 8px; color: var(--ink); font-size: 18px; }
.stub-view p { margin: 0; }

/* board */
.board {
  display: flex;
  gap: 10px;
  padding: 14px 16px 24px;
  overflow-x: auto;
  align-items: flex-start;
  min-height: calc(100vh - 140px);
}
.col {
  flex: 0 0 260px;
  background: var(--surface);
  border-radius: 10px;
  padding: 8px;
  min-height: 200px;
  border: 1px solid var(--line);
}
.col-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px 8px;
  font-weight: 650;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.kanban {
  width: 100%;
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  margin-bottom: 8px;
  color: inherit;
  box-shadow: none;
}
.kanban:hover { border-color: var(--accent); }
.kanban .kt { font-weight: 600; margin-bottom: 8px; }
.kanban .km { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban.done .kt { color: var(--muted); text-decoration: line-through; }

/* calendar */
.cal { padding: 12px 16px 24px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.cal-dow {
  background: var(--surface);
  padding: 8px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
}
.cal-cell {
  background: var(--canvas);
  min-height: 108px;
  padding: 6px;
}
.cal-cell.out { background: #191a1c; color: var(--muted); }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-num { font-size: 11px; font-weight: 650; margin-bottom: 4px; }
.cal-task {
  display: block;
  width: 100%;
  border: 0;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-task.overdue { background: var(--danger-bg); color: var(--overdue); }
.cal-task.done { background: var(--ok-bg); color: var(--done); }

/* —— Drawer / slide —— */
.backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.46);
  z-index: 20;
}
.drawer, .slide {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  background: var(--surface);
  z-index: 30;
  box-shadow: var(--shadow);
  overflow: auto;
  color: var(--ink);
}
.drawer { width: min(var(--drawer), 100vw); }
.slide { width: min(var(--slide), 100vw); border-left: 1px solid var(--line); }
.drawer-h, .slide-h {
  position: sticky; top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 1;
}
.drawer-h h2, .slide-h h2 { margin: 0; font-size: 14px; }
.icon-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  background: var(--elevated);
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--line); }
.icon-btn.ghost {
  width: 20px; height: 20px;
  background: transparent;
  border-color: transparent;
  color: var(--sidebar-muted);
}
.icon-btn.ghost:hover { background: var(--sidebar-hover); color: var(--ink); }

.fields { padding: 12px 16px; display: grid; gap: 8px; }
.field {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 28px;
}
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field-val { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.brain-mark {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 999px;
}
.brain-empty {
  border: 1px dashed #7b68ee88;
  background: var(--brain-bg);
  color: var(--accent-ink);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.desc { padding: 0 16px 12px; }
.desc p { margin: 0; color: var(--ink-2); }
.sec { padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.sec h3 { margin: 0 0 8px; font-size: 12px; font-weight: 650; color: var(--ink-2); }
.sub { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.sub input { accent-color: var(--accent); }
.comment { display: flex; gap: 8px; padding: 8px 0; }
.comment .who { font-weight: 650; }
.comment .when { color: var(--muted); font-size: 11px; margin-left: 6px; }
.act { font-size: 12px; color: var(--ink-2); padding: 4px 0; }
.act .when { color: var(--muted); }

/* Brain thread */
.thread { padding: 12px 14px 20px; display: grid; gap: 10px; }
.bubble {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--canvas);
}
.bubble.me { background: var(--accent-soft); border-color: #7b68ee55; }
.bubble .who { font-size: 11px; font-weight: 700; color: var(--accent-ink); margin-bottom: 4px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px; }
.chip {
  border: 1px solid #7b68ee55;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 600;
  font-size: 12px;
}
.chip:hover { background: rgba(123, 104, 238, 0.28); }
.cite-list { display: grid; gap: 6px; margin-top: 8px; }
.cite-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--elevated);
  border-radius: 8px;
  padding: 8px;
  color: inherit;
}
.cite-row:hover { border-color: var(--accent); }

/* templates / brain page / inbox / docs */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.tpl {
  text-align: left;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
}
.tpl h3 { margin: 0; font-size: 15px; }
.tpl p { margin: 0; color: var(--ink-2); flex: 1; }
.tpl.later { opacity: 0.55; }
.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
}
.badge.later { color: var(--muted); background: var(--elevated); }

.ask-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  border-radius: 6px;
  color: inherit;
}
.ask-row:hover { background: var(--elevated); }
.ask-row .q { flex: 1; font-weight: 550; }
.doc-row {
  display: block;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.doc-row:last-child { border-bottom: 0; }
.doc-row h3 { margin: 0 0 4px; font-size: 14px; }
.doc-row p { margin: 0; color: var(--ink-2); }

.inbox-item {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  border-radius: 6px;
  align-items: flex-start;
  color: inherit;
}
.inbox-item:hover { background: var(--elevated); }
.inbox-item.unread { background: var(--brain-bg); }
.dot-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex: 0 0 auto; }

/* modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.modal-card h2 { margin: 0 0 10px; font-size: 16px; }
.modal-card input, .modal-card textarea, .modal-card select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  background: var(--canvas);
  color: var(--ink);
}
.modal-card input:focus { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.menu {
  position: absolute;
  right: 12px;
  top: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 15;
  padding: 4px;
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: 0;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
}
.menu button:hover { background: var(--elevated); }
.menu button:disabled { color: var(--muted); }

.toasts {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
}
.toast {
  background: var(--elevated);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 550;
  box-shadow: var(--shadow);
  max-width: 320px;
}

.wf-mark {
  position: fixed;
  left: 5px;
  bottom: 8px;
  z-index: 60;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #9b9da266;
  pointer-events: none;
}

.empty {
  padding: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.status-btn, .pri-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 650;
}

.presence {
  font-size: 11px;
  color: var(--accent-ink);
  font-weight: 600;
}

.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--ink-2);
  min-width: 52px;
  text-align: center;
}

.stub-note {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 14px 14px;
}

select {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--elevated);
  color: var(--ink);
}
body.has-task.has-brain .slide { right: min(var(--drawer), 100vw); }
@media (max-width: 1100px) {
  body.has-task.has-brain .slide { right: 0; }
}
