/* Boards views (item #4043). Per-view stylesheet — the routed-view
   convention #3456 follows: one css/<view>.css per VIEWS entry, loaded from
   index.html after chat.css so it inherits the entry's token palette.
   Everything here is .mm-tasks* (the Boards landing and Critical), the
   pane's .mm-board-row, and .mm-webboard — the frame one board's page
   sits in; the nav-row chrome stays in chat.css. */

.mm-tasks {
  box-sizing: border-box; height: 100%; overflow-y: auto;
  padding: 28px 32px 40px;
}
.mm-tasks-head {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  max-width: 860px; margin: 0 auto 20px;
}
.mm-tasks-title { font-size: 26px; line-height: 1.3; font-weight: 650; letter-spacing: -.025em; margin: 0; flex: 1; }
.mm-tasks-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mm-tasks-mine {
  font: inherit; font-size: 12px; font-weight: 650;
  color: var(--text-dim); background: var(--panel);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 12px; cursor: pointer;
}
.mm-tasks-mine:hover { border-color: var(--accent); color: var(--text); }
.mm-tasks-mine.on {
  color: var(--on-accent); background: var(--accent-fill);
  border-color: var(--accent-fill);
}

.mm-tasks-body { max-width: 860px; margin: 0 auto; }
.mm-tasks-state {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-dim); font-size: 13.5px; padding: 18px 2px;
}
.mm-tasks-retry {
  font: inherit; font-size: 12px; font-weight: 650;
  color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 12px; cursor: pointer;
}
.mm-tasks-retry:hover { border-color: var(--accent); }

.mm-tasks-sec { margin: 14px 0 0; }
.mm-tasks-sec-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 2px; border-bottom: 1px solid var(--border-soft);
}
.mm-tasks-sec-title {
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-dim); margin: 0;
}
.mm-tasks-planning {
  margin-left: auto; font-size: 12px; font-weight: 650; color: var(--accent);
  text-decoration: none;
}
.mm-tasks-planning:hover { text-decoration: underline; }

.mm-tasks-list { display: flex; flex-direction: column; }
.mm-tasks-empty { color: var(--text-dim); font-size: 13px; padding: 10px 2px; }
.mm-tasks-board-head {
  display: block; text-decoration: none;
  font-size: 11.5px; font-weight: 650; color: var(--text-dim);
  padding: 10px 2px 3px;
}
.mm-tasks-board-head:hover { color: var(--accent); }

/* The row (#3644): id · title · one chip · one dot. The whole row is the
   click (the drawer opens in place), the title is the focusable keyboard
   path, and the chip is the only other action. */
.mm-task-row {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 12px 6px; min-height: 44px; box-sizing: border-box; border-bottom: 1px solid var(--border-soft);
  font-size: 13px; cursor: pointer; border-radius: 6px;
}
.mm-task-row:hover { background: var(--panel-2); }
.mm-task-row:focus-within { background: var(--panel-2); }
.mm-task-row.sub { padding-left: 26px; }
.mm-task-id { flex: none; font-size: 11.5px; color: var(--text-dim); }
/* Only work-list rows use a two-line preview; chat references keep their layout.
   Keyboard focus reveals the full title, which is also the button tooltip. */
.mm-task-row .mm-task-title {
  flex: 1; min-width: 0; color: var(--text); font-weight: 500; line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; white-space: normal; overflow-wrap: anywhere;
}
.mm-task-row:focus-within .mm-task-title { -webkit-line-clamp: unset; }
/* The title is a button (#3465): it opens the item reader in-app. Reset the
   button chrome so the row reads as one line; the focus ring is the one
   visible difference between hover and keyboard focus. */
button.mm-task-title {
  font: inherit; font-weight: 550; background: none; border: 0; padding: 0;
  text-align: left; cursor: pointer; border-radius: 3px;
}
.mm-task-row:hover button.mm-task-title { color: var(--accent-ink); }
button.mm-task-title:focus-visible {
  outline: 0; box-shadow: 0 0 0 2px var(--focus);
}
/* The verb chip: Scope / Build / Approve first on a dispatchable row. A
   button on the desktop build (it starts a session), a span elsewhere. */
.mm-task-chip {
  flex: none; font-size: 12px; font-weight: 500; letter-spacing: 0;
  text-transform: none; white-space: nowrap; border-radius: 6px; padding: 5px 9px;
  border: 1px solid var(--border); color: var(--text);
  background: var(--panel);
}
.mm-task-chip.accent { color: var(--accent-ink); border-color: var(--accent); }
.mm-task-chip.ok { color: var(--ok); border-color: var(--ok); }
.mm-task-chip.warn { color: var(--warn); border-color: var(--warn); }
button.mm-task-chip { font-family: inherit; cursor: pointer; }
button.mm-task-chip:hover { background: var(--panel-2); }
button.mm-task-chip:focus-visible {
  outline: 0; box-shadow: 0 0 0 2px var(--focus);
}
/* Horizon Now: the one urgency the row still shows. */
.mm-task-now {
  flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger);
}
/* The Critical mark (#5094): a solid flag, ahead of the Now dot. It is a
   different SHAPE, not a bigger dot — the two markers sit side by side on a
   row that is both, and colour alone would make them one signal. */
.mm-task-critical {
  flex: none; width: 10px; height: 11px; background: var(--danger);
  clip-path: polygon(0 0, 100% 0, 72% 38%, 100% 76%, 22% 76%, 22% 100%, 0 100%);
}

/* The Critical destination (#5094, Plan #5092): the workspace's marked
   items, every board in one list. The rows carry two facts the Boards rows
   do not — who marked it and why — so each row is a block, not a line. */
.mm-critical-count {
  font-size: 12px; font-weight: 700;
  color: var(--on-danger); background: var(--danger-fill);
  border-radius: 999px; padding: 1px 8px; line-height: 17px;
}
.mm-critical-count[hidden] { display: none; }
.mm-critical-row {
  display: block; padding: 9px 10px; border-left: 3px solid var(--danger);
  border-radius: 0 6px 6px 0;
}
.mm-critical-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* the flag leads, then the id, then the title takes the rest */
.mm-critical-main .mm-task-critical { margin-right: 2px; }
/* Both secondary lines take --text, not --text-dim: they carry facts a
   person has to be able to READ (which board, who marked it, why), and
   --text-dim is 2.9:1 on the light theme's panel. The hierarchy comes from
   size and weight instead of from a colour nobody can see. */
.mm-critical-facts, .mm-critical-reason {
  font-size: 12px; color: var(--text); padding-left: 2px;
}
.mm-critical-facts { margin-top: 3px; font-weight: 550; opacity: .85; }
/* The reason a person typed: their words, wrapped in full — it is the
   answer to "why is this on the list" and must never be clipped. */
.mm-critical-reason {
  margin-top: 2px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere;
}
.mm-critical-help { display: block; margin-top: 4px; }
.mm-tasks-sec-count {
  font-size: 11.5px; font-weight: 650; color: var(--text-dim);
  margin-left: -4px;
}

.mm-tasks-more {
  align-self: flex-start; font: inherit; font-size: 12px; font-weight: 650;
  color: var(--text-dim); background: none; border: 0; cursor: pointer;
  padding: 8px 2px;
}
.mm-tasks-more:hover { color: var(--text); }

.mm-tasks-new {
  flex: none; font: inherit; font-size: 12px; font-weight: 650;
  color: var(--on-accent); background: var(--accent-fill);
  border: 1px solid var(--accent-fill); border-radius: 6px;
  padding: 5px 10px; cursor: pointer;
}
.mm-tasks-new:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.mm-boards-empty {
  display: flex; align-items: center; gap: 10px; padding-top: 16px;
}

.mm-board-row {
  display: flex; align-items: center; gap: 8px; width: calc(100% - 16px);
  margin: 1px 8px; padding: 7px 10px; border: 0; border-radius: 7px;
  color: var(--text-dim); background: none; font: inherit; font-size: 12.5px;
  text-align: left; cursor: pointer;
}
.mm-board-row:hover { color: var(--text); background: var(--panel-2); }
.mm-board-row.active { color: var(--accent-ink); background: var(--accent-soft); }
.mm-board-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-board-count { flex: none; color: inherit; font-size: 11px; }

.mm-newboard-kinds { display: flex; flex-direction: column; gap: 7px; }
.mm-newboard-kind {
  display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: start;
  border: 1px solid var(--border); border-radius: 7px; padding: 9px 10px;
  cursor: pointer;
}
.mm-newboard-kind:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mm-newboard-kind strong, .mm-newboard-kind small { display: block; }
.mm-newboard-kind small { color: var(--text-dim); margin-top: 2px; line-height: 1.35; }

/* One board (views/board.js): the workspace app's own board page, whose
   rules (.board-*, .trow, .kanban …) come with ../workspaces/css/app.css.
   The frame stands in for the portal's #main: it is the board's vertical
   scroller, so the sticky board head and stage heads pin to ITS top — there
   is no portal topbar here, hence --topbar-h: 0. Columns wider than the
   frame scroll inside the board (.kanban owns its horizontal scroll); the
   frame itself never scrolls sideways. Scoped to .mm-webboard so the
   portal is untouched. */
.mm-webboard {
  --topbar-h: 0px;
  box-sizing: border-box; height: 100%; overflow-y: auto; overflow-x: hidden;
  padding: 0 24px 72px;
}
/* The top gap is the board's own margin, not the frame's padding: a sticky
   head pins to the scroller's padding edge, and a padded frame would leave
   a strip of rows scrolling past ABOVE the stuck head. */
.mm-webboard > div { margin-top: 18px; }
.mm-webboard-note {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  max-width: 560px; padding: 28px 0; color: var(--text-dim); font-size: 13.5px;
}
.mm-webboard-note p { margin: 0; }

/* Keep the work list usable when navigation and a conversation share the window. */
@media (max-width: 700px) {
  .mm-tasks { padding: 20px 18px 32px; }
  .mm-webboard { padding: 0 16px 64px; }
  .mm-tasks-head-actions { width: 100%; }
  .mm-tasks-state { flex-wrap: wrap; line-height: 1.5; }
}
