/* ---- To-dos — the tab on the canvas's edge and its panel (todos.js) ----
   The tab is one of the column rails (app.css .col-rail): it sits on the
   canvas's right edge just under the Menu's, and wears the open count. It
   slides the panel out as a column of its own between the canvas and the
   menu — the canvas makes room, as it does for the menu — and the panel's ›
   puts it away again. Inside: the add row, the two ways to bring to-dos in
   (the client's review, your email), and the list, which scrolls inside. */
.cockpit { --todo-w: 0px; }
.cockpit.has-todos { --todo-w: 320px; }
@media (max-width: 1100px) { .cockpit.has-todos { --todo-w: 280px; } }

/* the rails on the right hug the canvas, wherever its edge is */
.col-rail.is-right { right: var(--todo-w); }
.col-rail.todo-tab {
  right: calc(var(--insp-w, 300px) + var(--todo-w));
  top: calc(50% + 50px); transform: none;      /* just under the Menu tab (50% ± its own half) */
}
.todo-tab:hover .todo-count { transform: scale(1.08); }
/* the count reads across, not down the tab */
.todo-count {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px;
  writing-mode: horizontal-tb; border-radius: 999px;
  font: 700 10px/16px var(--sans); letter-spacing: 0;
  background: var(--accent); color: #FFFFFF;
  animation: todo-pop-in .35s var(--ease-spring);
  transition: transform .2s var(--ease-spring);
}
@keyframes todo-pop-in { from { transform: scale(.4); opacity: 0; } }

.todo-panel {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: rgba(255, 255, 255, .55); border-left: 1px solid var(--line-soft);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.cockpit:not(.has-todos) > .todo-panel { visibility: hidden; border: 0; }
.cockpit.has-todos > .todo-panel > * { animation: todo-slide .28s var(--ease-out); }
@keyframes todo-slide { from { opacity: 0; transform: translateX(14px); } }
body.dash:not(.mb-full) .todo-panel {
  background: var(--sb-sheet); border-left-color: rgba(255, 255, 255, .14);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.todo-panel .panel-title { flex: none; }
.todo-tally { font: 600 11.5px var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); }
.todo-in { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0 14px 8px; }
.todo-lede { flex: none; margin: 0 0 10px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }

/* full screen (Esc): it floats beside the menu, like the menu floats */
body.mb-full .todo-panel {
  position: fixed; z-index: 15; top: 84px; bottom: 14px; width: clamp(240px, 22vw, 310px);
  right: calc(28px + clamp(240px, 22vw, 310px)); border-radius: 24px; border: 1px solid rgba(255, 255, 255, .2);
}
body.mb-full .cockpit.no-insp > .todo-panel { right: 14px; }
body.mb-full .cockpit:not(.has-todos) > .todo-panel { display: none; }

/* phones and tablets keep the sheets of the mobile cockpit (app.css) */
@media (max-width: 768px), (pointer: coarse) and (max-width: 1024px) {
  .todo-panel { display: none !important; }
}

.todo-add { flex: none; display: flex; gap: 8px; }
.todo-add input { font-size: 13.5px; padding: 7px 12px; }
.todo-add .btn { flex: none; }

.todo-bring { flex: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.todo-src { padding: 5px 11px; font-size: 12px; gap: 5px; }
.todo-src svg { width: 13px; height: 13px; }
.todo-src.on { background: var(--accent-soft); border-color: rgba(123, 30, 46, .45); color: var(--accent-deep); }
.todo-src-n {
  display: inline-grid; place-items: center; min-width: 16px; height: 15px; padding: 0 4px; margin-left: 1px;
  border-radius: 999px; font: 700 10px/15px var(--sans); background: var(--accent); color: #FFFFFF;
}

/* the importers fold open under their buttons */
.todo-import {
  flex: none; display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; padding: 10px 11px;
  border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(26, 26, 26, .035);
  box-shadow: inset 0 1px 3px rgba(26, 26, 26, .05);
  animation: todo-fold .28s var(--ease-out);
}
@keyframes todo-fold { from { opacity: 0; transform: translateY(-4px); } }
.todo-import-head { display: flex; flex-direction: column; gap: 2px; }
.todo-import-head b { font: 700 13px var(--sans); }
.todo-import-head span { font-size: 12px; line-height: 1.4; color: var(--muted); }
.todo-import-foot { display: flex; justify-content: flex-end; gap: 6px; }
.todo-import-foot .btn { padding: 5px 12px; font-size: 12.5px; }
.todo-none { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

.todo-picks { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.todo-picks:empty { display: none; }
.todo-pick label { display: flex; align-items: flex-start; gap: 9px; padding: 6px; border-radius: 10px; cursor: pointer; transition: background .14s var(--ease-out); }
.todo-pick label:hover { background: rgba(255, 255, 255, .8); }
.todo-pick input { width: 15px; height: 15px; margin: 2px 0 0; padding: 0; flex: none; cursor: pointer; }
.todo-pick label > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-pick b { font: 500 13px/1.4 var(--sans); word-break: break-word; }
.todo-pick q { font-size: 12px; line-height: 1.4; font-style: italic; color: var(--muted); }
.todo-pick label > span > span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.todo-pick.is-on label { cursor: default; opacity: .55; }
.todo-pick.is-on label:hover { background: none; }

.todo-gmail-form { display: flex; gap: 6px; }
.todo-gmail-form input { font: 400 12px var(--mono); padding: 6px 10px; }
.todo-gmail-form .btn { flex: none; padding: 5px 13px; font-size: 12.5px; }
.todo-paste summary { font-size: 12px; color: var(--muted); cursor: pointer; width: max-content; border-radius: 4px; }
.todo-paste summary:hover { color: var(--ink); }
.todo-paste textarea { display: block; margin: 6px 0; font-size: 12.5px; padding: 7px 10px; resize: vertical; min-height: 70px; }
.todo-paste .btn { padding: 5px 12px; font-size: 12.5px; }
.todo-status {
  display: flex; align-items: flex-start; gap: 7px; padding: 7px 10px; border-radius: 10px;
  font-size: 12px; line-height: 1.45; color: var(--ink);
  background: rgba(255, 255, 255, .75); border: 1px solid var(--line-soft);
}
.todo-status.is-busy::before {
  content: ''; flex: none; width: 10px; height: 10px; margin-top: 3px; border-radius: 50%;
  border: 2px solid var(--accent); border-top-color: transparent; animation: todo-spin .8s linear infinite;
}
.todo-status.is-err { color: var(--danger-ink); background: var(--danger-bg); border-color: var(--danger-line); }
@keyframes todo-spin { to { transform: rotate(1turn); } }

/* the list */
.todo-body { flex: 1 1 auto; min-height: 60px; overflow-y: auto; margin: 6px -6px 0; padding: 0 6px; }
.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.todo-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 2px 6px;
  padding: 8px 2px 8px 4px; border-top: 1px solid var(--line-soft);
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
}
.todo-row:first-child { border-top: 0; }
.todo-row.is-new { animation: todo-in .3s var(--ease-out); }
@keyframes todo-in { from { opacity: 0; transform: translateY(-4px); } }
.todo-row.is-leaving { opacity: 0; transform: translateX(8px); pointer-events: none; }
.todo-tick { display: flex; align-items: flex-start; gap: 9px; min-width: 0; cursor: pointer; font-size: 13.5px; line-height: 1.4; }
.todo-tick input { width: 16px; height: 16px; margin: 2px 0 0; padding: 0; flex: none; cursor: pointer; }
.todo-text { word-break: break-word; transition: color .2s var(--ease-out); }
.todo-row.is-done .todo-text { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(46, 46, 46, .45); }
.btn.todo-x { width: 22px; height: 22px; padding: 0; justify-content: center; font-size: 16px; line-height: 1; opacity: .5; }
.btn.todo-x:hover { opacity: 1; color: var(--danger-ink); }
.todo-sub { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; padding-left: 25px; }
.todo-from { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
a.todo-from:hover { color: var(--accent-deep); text-decoration: underline; }
.todo-donewho { flex: none; font-size: 11.5px; color: var(--muted); }
/* from a client's review: the canvas goes to the spot of their note */
.todo-see {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 6px; margin-left: -4px;
  border: 0; background: none; cursor: pointer;
  border-radius: 999px; font: 600 11.5px var(--sans); color: var(--accent-deep); text-decoration: none;
  transition: background .16s var(--ease-out), transform .32s var(--ease-spring);
}
.todo-see svg { width: 13px; height: 13px; flex: none; }
.todo-see:hover { background: var(--accent-soft); transform: translateY(-1px); }
.todo-see:active { transform: translateY(1px) scale(.96); transition-duration: .06s; }

/* who has it — a pill that opens the assign menu */
.todo-who {
  flex: none; display: inline-flex; align-items: center; gap: 5px; max-width: 180px; height: 22px; padding: 0 9px 0 4px;
  border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .7);
  font: 600 11.5px var(--sans); color: var(--ink); cursor: pointer;
  transition: transform .32s var(--ease-spring), box-shadow .32s var(--ease-out), background .16s var(--ease-out), border-color .16s var(--ease-out);
}
.todo-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-who svg { width: 13px; height: 13px; flex: none; }
.todo-who i {
  display: grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%;
  font: normal 700 8.5px var(--sans); background: var(--accent-soft); color: var(--accent-deep);
}
.todo-who:hover { background: #FFFFFF; border-color: rgba(123, 30, 46, .45); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.todo-who:active { transform: translateY(1px) scale(.96); box-shadow: none; transition-duration: .06s; }
.todo-who.is-none { padding-left: 7px; color: var(--muted); border-style: dashed; border-color: var(--line); }
.todo-who.is-claude { padding-left: 6px; }
.todo-who.is-claude:not(.is-agent) svg { color: var(--accent); }
.todo-who.is-busy:not(.is-agent) svg { animation: todo-spin 2.4s linear infinite; }
/* one of the team's agents has it: its own face, in its own tint (agents.css) */
.todo-who.is-agent { padding-left: 2px; }
.todo-who .ag-face svg { width: 11px; height: 11px; }
.todo-who.is-agent.is-busy .ag-face { animation: todo-breathe 1.6s var(--ease-out) infinite; }
@keyframes todo-breathe { 50% { transform: scale(.86); opacity: .7; } }
.todo-who.is-me i { background: var(--accent); color: #FFFFFF; }

.todo-empty { margin: 0; padding: 14px 6px; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-align: center; }
.todo-done-toggle {
  display: flex; align-items: center; gap: 5px; width: 100%; margin-top: 2px; padding: 9px 2px 6px;
  border: 0; border-top: 1px solid var(--line-soft); background: none; cursor: pointer;
  font: 700 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.todo-done-toggle:hover { color: var(--ink); }
.todo-done-toggle svg { width: 11px; height: 11px; transition: transform .25s var(--ease-out); }
.todo-done-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.todo-list.is-done .todo-row:first-child { border-top: 0; }

/* the assign menu — the app's own .dd-menu, with a second line per row */
.td-menu { min-width: 230px; max-width: 290px; }
.td-menu .dd-item > svg:not(.dd-check) { width: 14px; height: 14px; flex: none; color: var(--accent); }
.td-mi { display: flex; flex-direction: column; min-width: 0; }
.td-mi b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-mi span { font-size: 11.5px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-av {
  display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%;
  font: normal 700 9px var(--sans); background: var(--accent-soft); color: var(--accent-deep);
}
.td-mnone { padding: 3px 10px 8px; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* Claude's part of the menu wears Claude's own look: the clay spark on its
   heading and rows, and picking a chat turns the menu into a small composer —
   the prompt to rewrite, the effort for this one message, a clay Send. The
   clay is spelled out, since the menu sits outside .chat where it lives. */
.td-menu .dd-item > svg.td-spark { color: #D97757; }
.dd-group.td-cl-group { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line-soft); color: #D97757; }
.td-cl-group .td-spark { width: 12px; height: 12px; flex: none; }
.td-cl-group span { font: 500 13.5px/1 ui-serif, Georgia, "Times New Roman", serif; letter-spacing: .01em; text-transform: none; }

.td-menu.is-compose { width: min(380px, calc(100vw - 16px)); max-width: none; max-height: min(600px, calc(100vh - 16px)); padding: 10px 12px 12px; }
.td-cmp-head { display: flex; align-items: center; gap: 8px; padding-bottom: 9px; margin-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.td-cmp-back {
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; margin-left: -2px;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
  transition: background .14s var(--ease-out), color .14s var(--ease-out);
}
.td-cmp-back svg { width: 15px; height: 15px; }
.td-cmp-back:hover { background: rgba(217, 119, 87, .14); color: var(--ink); }
.td-cl-mark { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: #D97757; color: #FFFFFF; }
.td-cl-mark svg { width: 14px; height: 14px; }
.td-cmp-head .td-mi b { font: 500 15px/1.15 ui-serif, Georgia, "Times New Roman", serif; letter-spacing: .01em; }
.td-cmp-lab { display: block; margin: 4px 0 5px; font: 700 10px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.td-cmp-text {
  display: block; width: 100%; box-sizing: border-box; min-height: 120px; max-height: 300px; margin-bottom: 8px;
  padding: 8px 10px; resize: vertical; font: 400 12.5px/1.5 var(--sans);
}
.td-cmp-text:focus { border-color: rgba(217, 119, 87, .7); box-shadow: 0 0 0 3px rgba(217, 119, 87, .16); outline: none; }
/* the effort: one inset track, the pick lifted white with a clay word */
.td-eff { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 3px; border-radius: 999px; background: rgba(26, 26, 26, .06); box-shadow: inset 0 1px 2px rgba(26, 26, 26, .06); }
.td-eff button {
  height: 26px; padding: 0 2px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 600 11.5px var(--sans); color: var(--muted); white-space: nowrap;
  transition: background .16s var(--ease-out), color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}
.td-eff button:hover { color: var(--ink); }
.td-eff button.on { background: #FFFFFF; color: #C4613F; box-shadow: 0 1px 3px rgba(26, 26, 26, .14); }
.td-cmp-note { padding: 2px 0 4px; }
.td-cmp-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.td-cmp-hint { flex: 1; min-width: 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.td-cmp-send {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto; height: 32px; padding: 0 14px 0 12px;
  border: 0; border-radius: 999px; background: #D97757; color: #FFFFFF; cursor: pointer;
  font: 600 13px var(--sans); box-shadow: 0 2px 10px rgba(217, 119, 87, .32);
  transition: background .16s var(--ease-out), transform .32s var(--ease-spring), box-shadow .16s var(--ease-out), opacity .16s var(--ease-out);
}
.td-cmp-send svg { width: 13px; height: 13px; }
.td-cmp-send:hover:not(:disabled) { background: #C4613F; transform: translateY(-1px); }
.td-cmp-send:active:not(:disabled) { transform: translateY(1px) scale(.97); transition-duration: .06s; }
.td-cmp-send:disabled { opacity: .5; cursor: default; box-shadow: none; }
:where(body.dash) .td-eff { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
:where(body.dash) .td-eff button.on { background: rgba(255, 255, 255, .16); color: #EFA383; box-shadow: none; }
:where(body.dash) .dd-group.td-cl-group { color: #EFA383; border-color: rgba(255, 255, 255, .14); }
body.mb-full .td-eff { background: rgba(255, 255, 255, .08); box-shadow: none; }
body.mb-full .td-eff button { color: rgba(222, 222, 222, .7); }
body.mb-full .td-eff button.on { background: rgba(255, 255, 255, .18); color: #FFFFFF; }
body.mb-full :is(.td-cmp-lab, .td-cmp-hint, .td-cmp-back) { color: rgba(222, 222, 222, .66); }
body.mb-full .td-cmp-head, body.mb-full .dd-group.td-cl-group { border-color: rgba(255, 255, 255, .18); }
body.mb-full .td-cmp-text { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #F1F1F1; }

/* full screen (Esc): the panel takes the smoked glass the rest of the chrome wears */
body.mb-full .todo-panel { background: rgba(16, 16, 16, .86); border-color: rgba(255, 255, 255, .2); color: #F1F1F1; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 22px 60px rgba(9, 9, 9, .45); }
body.mb-full .todo-panel :is(.todo-lede, .todo-tally, .panel-title, .todo-from, .todo-donewho, .todo-see, .todo-empty, .todo-done-toggle, .todo-import-head span, .todo-none, .todo-paste summary, .todo-pick q, .todo-pick label > span > span) { color: rgba(222, 222, 222, .66); }
body.mb-full .todo-panel :is(.todo-row, .todo-done-toggle) { border-color: rgba(255, 255, 255, .14); }
body.mb-full .todo-panel :is(.todo-import, .todo-status, .todo-who) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #F1F1F1; }
body.mb-full .todo-panel .todo-pick label:hover { background: rgba(255, 255, 255, .1); }

@media (prefers-reduced-motion: reduce) {
  .todo-count, .cockpit.has-todos > .todo-panel > *, .todo-import, .todo-row.is-new, .todo-who.is-busy svg, .todo-who.is-busy .ag-face, .todo-status.is-busy::before { animation: none; }
  .todo-who:hover, .todo-who:active, .todo-see:hover, .todo-see:active, .todo-row.is-leaving { transform: none; }
}
