/* ================================================================
   AI-GENERATED SERIES — the Series Brief editor + AI-task treatment.

   Two visual jobs:
   1. In generate mode the task popup must READ as a brief, not a task —
      same chrome, different substance. Violet is the AI accent throughout
      the app, so the brief carries it as a tint, not a repaint.
   2. A task the AI wrote must be obvious at a glance in a list of hand-written
      ones — a violet edge + spark, never a whole different card.
   ================================================================ */

.wksb {
  --wksb: var(--c-purple, #7c3aed);
  --wksb-bg: var(--c-purple-bg, #f5f3ff);
  --wksb-soft: var(--c-purple-soft, #c4b5fd);
}

/* ── hero: what this card actually is ─────────────────────────── */
/* A quiet banner: a hairline accent edge and text. No gradient wash, no
   rounded icon tile — those read as decoration, and this is a caption.
   It holds NO button. Drafting lives on the header's "Draft with AI" and
   nowhere else; a second copy in here was the same action twice, and being
   unstyled it wrapped onto two lines inside a text block. */
.wksb-hero {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px; margin-bottom: 20px;
  border: 1px solid var(--border, #e0e0e0);
  border-left: 2px solid var(--wksb);
  border-radius: 7px;
  background: var(--surf, #fff);
}
.wksb-hero-spark { flex: 0 0 auto; color: var(--wksb); line-height: 0; padding-top: 1px; }
.wksb-hero-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wksb-hero-txt strong { font-size: 12.5px; font-weight: 700; color: var(--ink, #161616); letter-spacing: -.01em; }
.wksb-hero-txt span { font-size: 11.5px; line-height: 1.5; color: var(--ink2, #525252); }
/* Points at the header control instead of duplicating it. */
.wksb-hero-cue { margin-top: 1px; }
.wksb-hero-cue b { font-weight: 700; color: var(--wksb); }

/* ── blocks ───────────────────────────────────────────────────── */
.wksb-block { margin-bottom: 22px; }
.wksb-block-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 8px;
  font: 700 11px/1.3 var(--f); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink, #161616);
}
.wksb-block-head span {
  font: 400 11px/1.4 var(--f); letter-spacing: 0; text-transform: none;
  color: var(--ink3, #8d8d8d);
}

.wksb-input {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border, #e0e0e0); border-radius: 6px;
  background: var(--surf, #fff); color: var(--ink, #161616);
  font: 400 12.5px/1.5 var(--f); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wksb-input::placeholder { color: var(--ink4, #c6c6c6); }
.wksb-input:focus { border-color: var(--wksb); box-shadow: 0 0 0 2px rgba(124,58,237,.12); }
.wksb-area { resize: vertical; min-height: 62px; }
.wksb-sm { max-width: 110px; flex: 0 0 auto; }
.wksb-row { display: flex; gap: 8px; align-items: center; }

.wksb-add { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.wksb-add-btn {
  flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px; background: var(--surf, #fff); color: var(--ink2, #525252);
  font: 600 11.5px/1 var(--f); cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.wksb-add-btn:hover { border-color: var(--wksb); color: var(--wksb); }
/* Browsing the shared library is the primary way to attach real material, so
   it leads the row rather than sitting behind a generic "Upload". */
.wksb-add-btn--lead {
  display: inline-flex; align-items: center; gap: 6px;
  border-color: var(--border, #e0e0e0); color: var(--wksb);
}
.wksb-add-btn--lead svg { flex: 0 0 auto; }
.wksb-add-btn--lead:hover { border-color: var(--wksb); }

/* "Require proof" reads as a decision, not a stray checkbox. */
.wksb-toggle--row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 11px; border-radius: 6px;
  border: 1px solid var(--border, #e0e0e0); background: var(--surf, #fff);
}
.wksb-toggle--row input { margin-top: 2px; }
.wksb-toggle--row span { display: flex; flex-direction: column; gap: 3px; }
.wksb-toggle--row strong { font: 600 12.5px/1.35 var(--f); color: var(--ink, #161616); }
.wksb-toggle--row em { font: 400 11.5px/1.45 var(--f); font-style: normal; color: var(--ink3, #8d8d8d); }
.wksb-toggle--row:has(input:checked) { border-color: var(--wksb); background: var(--wksb-bg); }
/* Overridden by a stronger setting elsewhere (one-at-a-time beats write-ahead).
   `.is-muted` is set alongside the input's own `disabled`, so the row still reads
   as switched-off-by-something rather than merely unchecked — and it must beat the
   :has(input:checked) rule above, hence the later position. */
.wksb-toggle--row.is-muted,
.wksb-toggle--row.is-muted:has(input:checked) {
  opacity: .55; cursor: default;
  border-color: var(--border, #e0e0e0); background: var(--bg, #f8fafc);
}
/* The reason the row above is inert. Hairline, no tinted fill — same flatness as
   the rest of the brief. */
.wksb-gatenote {
  margin-top: 7px; padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--border, #e0e0e0);
  font: 400 11.5px/1.5 var(--f); color: var(--ink3, #8d8d8d);
}
.wksb-gatenote strong { font-weight: 600; color: var(--ink2, #525252); }

.wksb-empty {
  padding: 2px 0; font: 400 11.5px/1.5 var(--f); color: var(--ink3, #8d8d8d);
}

/* ── chips (guardrails + sources) ─────────────────────────────── */
.wksb-list, .wksb-src { display: flex; flex-direction: column; gap: 5px; }
.wksb-src { flex-direction: row; flex-wrap: wrap; }
.wksb-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 7px 6px 10px; border-radius: 6px;
  border: 1px solid var(--border, #e0e0e0); background: var(--surf, #fff);
  font: 400 12px/1.4 var(--f); color: var(--ink, #161616);
}
.wksb-chip > span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.wksb-chip svg { flex: 0 0 auto; color: var(--wksb); }
.wksb-chip--src { max-width: 100%; }
.wksb-x {
  flex: 0 0 auto; width: 18px; height: 18px; border: 0; border-radius: 5px;
  background: transparent; color: var(--ink3, #8d8d8d);
  font: 400 15px/1 var(--f); cursor: pointer;
}
.wksb-x:hover { background: var(--c-red-bg, #fff1f1); color: var(--c-red, #ef4444); }

/* What the setup AI said would be worth attaching — a prompt, not furniture. */
.wksb-suggest {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px;
  padding: 8px 10px; border-radius: 6px;
  background: var(--c-yellow-bg, #fef3c7);
  font: 400 11.5px/1.4 var(--f); color: #92400e;
}
.wksb-suggest strong { font: 700 11px/1.4 var(--f); }
.wksb-suggest span {
  padding: 3px 8px; border-radius: 20px; background: rgba(255,255,255,.7);
}

/* ── the arc ──────────────────────────────────────────────────── */
.wksb-plan { display: flex; flex-direction: column; gap: 4px; }
.wksb-plan-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7px 8px; border-radius: 6px;
  border: 1px solid var(--border, #e0e0e0); background: var(--surf, #fff);
}
.wksb-plan-mark {
  flex: 0 0 auto; width: 19px; height: 19px; margin-top: 1px;
  border: 1px solid var(--border, #e0e0e0); border-radius: 50%;
  background: var(--surf, #fff); color: var(--ink3, #8d8d8d);
  font: 700 10px/1 var(--f); cursor: pointer; display: grid; place-items: center;
}
.wksb-plan-mark:hover { border-color: var(--wksb); color: var(--wksb); }
.wksb-plan-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wksb-plan-txt strong { font: 600 12.5px/1.4 var(--f); color: var(--ink, #161616); }
.wksb-plan-txt span { font: 400 11.5px/1.45 var(--f); color: var(--ink2, #525252); }

.wksb-plan-row.is-done { opacity: .55; }
.wksb-plan-row.is-done .wksb-plan-mark { background: var(--c-green, #16a34a); border-color: var(--c-green, #16a34a); color: #fff; }
.wksb-plan-row.is-done .wksb-plan-txt strong { text-decoration: line-through; }
.wksb-plan-row.is-next { border-color: var(--wksb); background: var(--wksb-bg); }
.wksb-plan-row.is-next .wksb-plan-mark { background: var(--wksb); border-color: var(--wksb); color: #fff; }

/* ── the journey ──────────────────────────────────────────────────
   A real timeline, not a list of titles: every entry carries the AI's
   own reason and which plan step it moved, and the top entry is what is
   coming next. This is the "why am I being given this" surface. */
.wksb-jrn { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.wksb-jrn-row { display: flex; gap: 10px; padding: 2px 0; }
.wksb-jrn-row[data-wksb-act] { cursor: pointer; }
.wksb-jrn-row[data-wksb-act]:hover .wksb-jrn-title { color: var(--wksb); }

/* Continuous rail with a node per entry. */
.wksb-jrn-rail { flex: 0 0 auto; position: relative; width: 12px; }
.wksb-jrn-rail::before {
  content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px;
  background: var(--border, #e0e0e0);
}
.wksb-jrn-row:first-child .wksb-jrn-rail::before { top: 12px; }
.wksb-jrn-row:last-child .wksb-jrn-rail::before { bottom: auto; height: 12px; }
.wksb-jrn-rail i {
  position: absolute; left: 1px; top: 8px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--surf, #fff);
  border: 2px solid var(--border, #e0e0e0); box-sizing: border-box;
}
.wksb-jrn-row.is-done .wksb-jrn-rail i { background: var(--c-green, #16a34a); border-color: var(--c-green, #16a34a); }
.wksb-jrn-row.is-missed .wksb-jrn-rail i { background: var(--c-red, #ef4444); border-color: var(--c-red, #ef4444); }
.wksb-jrn-row.is-open .wksb-jrn-rail i { border-color: var(--c-yellow, #f59e0b); }
.wksb-jrn-row.is-next .wksb-jrn-rail i,
.wksb-jrn-row.is-pending .wksb-jrn-rail i { border-color: var(--wksb); border-style: dashed; }
.wksb-jrn-row.is-pending .wksb-jrn-rail i { animation: wkai-pulse 1.3s ease-in-out infinite; }

.wksb-jrn-body {
  flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px;
  padding: 6px 0 10px;
}
.wksb-jrn-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wksb-jrn-when {
  flex: 0 0 auto; font: 600 10.5px/1.4 var(--f); color: var(--ink3, #8d8d8d);
  font-variant-numeric: tabular-nums;
}
.wksb-jrn-title { flex: 1 1 auto; min-width: 0; font: 600 12.5px/1.4 var(--f); color: var(--ink, #161616); }
.wksb-jrn-st {
  flex: 0 0 auto; padding: 2px 7px; border-radius: 20px;
  font: 600 9.5px/1.6 var(--f); text-transform: uppercase; letter-spacing: .04em;
  background: var(--border-s, #f4f4f4); color: var(--ink3, #8d8d8d);
}
.wksb-jrn-row.is-done .wksb-jrn-st { background: var(--c-green-bg, #defbe6); color: var(--c-green, #16a34a); }
.wksb-jrn-row.is-missed .wksb-jrn-st { background: var(--c-red-bg, #fff1f1); color: var(--c-red, #ef4444); }
.wksb-jrn-row.is-open .wksb-jrn-st { background: var(--c-yellow-bg, #fef3c7); color: #b45309; }

.wksb-jrn-step { font: 600 10.5px/1.4 var(--f); color: var(--wksb); }
.wksb-jrn-why { font: 400 11.5px/1.5 var(--f); color: var(--ink2, #525252); }

/* What's coming — reads forward, so it's tinted rather than neutral. */
.wksb-jrn-row.is-next .wksb-jrn-body,
.wksb-jrn-row.is-pending .wksb-jrn-body {
  padding: 7px 10px; margin-bottom: 6px; border-radius: 6px;
  background: var(--surf, #fff); border: 1px solid var(--border, #e0e0e0);
  border-left: 2px solid var(--wksb);
}
.wksb-jrn-row.is-next .wksb-jrn-when { color: var(--wksb); }

/* ── footer controls ──────────────────────────────────────────── */
.wksb-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border-s, #f4f4f4);
}
.wksb-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.wksb-toggle input { width: 15px; height: 15px; accent-color: var(--wksb); cursor: pointer; }
.wksb-toggle span { font: 400 12px/1.4 var(--f); color: var(--ink2, #525252); }
.wksb-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--wksb); color: #fff; font: 600 12px/1 var(--f);
}
.wksb-primary:hover { filter: brightness(1.08); }
.wksb-primary:disabled { opacity: .6; cursor: default; }

/* ================================================================
   SCHEDULE EDITOR — "Same task" vs "AI writes it"
   A segmented control: one track, two segments, a white thumb on the
   selected one, and a single helper line underneath. The first cut used
   two filled cards with body copy in each, which read as heavy bubbles
   and doubled the popover height.
   ================================================================ */
/* ⚠️ The popover's WIDTH is no longer set here. It used to be
   `min-width: 372px; max-width: 420px`, which capped the editor at 420px — and
   because this file loads AFTER work.css that cap silently won over anything the
   two-column layout asked for. Sizing now lives with the layout, on
   `.tp-sched-cols` in work.css. Do not re-add a width here. */
.tp-edit-popover.is-sched { min-width: 330px; }

/* 12px matches .tp-sched-row, so the segmented track lines up with the Starts /
   At values below it instead of running edge to edge. */
.tp-sched-mode { padding: 2px 12px 12px; }
/* The settings column is a stack of groups (mode · starts/at · how many at once ·
   missed day · ends). Each one gets the same hairline rule .tp-drop-ends-section
   already carries, so they read as one list instead of running together — without
   it, "HOW MANY AT ONCE" sits flush under the time value and looks like part of
   it. No rule on the first group; it is the top of the column. */
.tp-sched-mode--gate,
.tp-sched-mode--roll,
.tp-sched-mode--reveal {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border-s, #e2e8f0);
}
.tp-sched-mode--roll { padding-bottom: 4px; }
/* "When it shows up": segment, then the hold time, then one helper line. The row
   inherits .tp-sched-row's 12px gutter from work.css but not its top padding —
   here it hangs directly off the segment it belongs to. */
.tp-sched-mode--reveal { padding-bottom: 2px; }
.tp-sched-row--reveal { padding: 7px 0 0; }
.tp-sched-mode-lbl {
  font: 600 10px/1.3 var(--f); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink3, #8d8d8d); margin-bottom: 7px;
}

/* The track. */
.tp-recmode {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 2px; padding: 3px;
  background: var(--border-s, #f4f4f4);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 9px;
}
.tp-recmode-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 0; padding: 7px 10px; cursor: pointer;
  border: 0; border-radius: 6px; background: transparent;
  font: 600 12px/1.2 var(--f); color: var(--ink2, #525252);
  white-space: nowrap; letter-spacing: -.005em;
  transition: color .12s ease, background .12s ease, box-shadow .12s ease;
}
.tp-recmode-btn svg { flex: 0 0 auto; opacity: .55; transition: opacity .12s ease; }
.tp-recmode-btn:hover { color: var(--ink, #161616); }
/* The thumb — a plain white surface with a hairline lift. No fills, no glow. */
.tp-recmode-btn.is-on {
  background: var(--surf, #fff);
  color: var(--ink, #161616);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 .5px rgba(0,0,0,.04);
}
.tp-recmode-btn--ai.is-on { color: var(--c-purple, #7c3aed); }
.tp-recmode-btn--ai.is-on svg { opacity: 1; }

/* Reserved for the LONGER of the two lines, so swapping mode changes the text
   without changing the layout — nothing below it moves, and the popover never
   has to be repositioned just because a sentence got shorter. */
.tp-recmode-help {
  margin-top: 7px; min-height: 33px;
  font: 400 11px/1.5 var(--f); color: var(--ink3, #8d8d8d);
}

/* ================================================================
   AI MODE IS A COLOUR SHIFT, NOT A DIFFERENT SCREEN
   Every field stays exactly where it was — same boxes, same order,
   nothing hidden. The popup just tells you which mode you are in.
   ================================================================ */
.tp-overlay.is-series-brief .tp-block-head { color: var(--c-purple, #7c3aed); }
.tp-overlay.is-series-brief .tp-block-head svg { stroke: var(--c-purple, #7c3aed); }
.tp-overlay.is-series-brief .tp-title-input:focus,
.tp-overlay.is-series-brief .tp-editor:focus {
  border-color: var(--c-purple, #7c3aed);
  box-shadow: 0 0 0 2px rgba(124,58,237,.12);
}
.tp-overlay.is-series-brief .tp-add-btn { background: var(--c-purple, #7c3aed); }
/* The header already carries the violet inset bar (below) — this adds the
   faintest wash to the body so the mode is legible without a repaint. */
.tp-overlay.is-series-brief .tp-panel[data-tp-panel="work"] {
  background: linear-gradient(180deg, rgba(124,58,237,.035) 0%, transparent 220px);
}
/* ================================================================
   A TASK THE AI WROTE
   ================================================================ */

/* Provenance strip at the top of a generated task's Work panel. */
.wkai-banner {
  --wkai: var(--c-purple, #7c3aed);
  display: flex; flex-direction: column; gap: 7px;
  padding: 12px 14px; margin-bottom: 20px;
  border: 1px solid var(--border, #e0e0e0); border-left: 2px solid var(--wkai);
  border-radius: 7px; background: var(--surf, #fff);
}
.wkai-banner.is-failed { --wkai: var(--c-red, #ef4444); }
.wkai-banner-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.wkai-spark { color: var(--wkai); line-height: 0; }
.wkai-banner.is-pending .wkai-spark { animation: wkai-pulse 1.3s ease-in-out infinite; }
@keyframes wkai-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.9); } }
.wkai-banner-title { font: 700 12px/1.3 var(--f); color: var(--ink, #161616); }
.wkai-banner-series {
  margin-left: auto; padding: 3px 8px; border: 1px solid var(--border, #e0e0e0);
  border-radius: 5px; background: var(--surf, #fff); color: var(--wkai);
  font: 600 11px/1.3 var(--f); cursor: pointer; max-width: 240px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wkai-banner-series:hover { background: var(--c-purple-bg, #f5f3ff); }
.wkai-banner-why { font: 400 11.5px/1.5 var(--f); color: var(--ink2, #525252); }
.wkai-banner-why.wkai-err { color: var(--c-red, #ef4444); }
.wkai-banner-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.wkai-mini {
  padding: 6px 11px; border: 1px solid var(--border, #e0e0e0); border-radius: 6px;
  background: #fff; color: var(--ink2, #525252); font: 600 11px/1 var(--f); cursor: pointer;
}
.wkai-mini:hover { border-color: var(--wkai); color: var(--wkai); }

/* ── the glow: how an AI task reads in a list ─────────────────────
   The card already has an accent system — `--_pri` drives its top bar,
   hover border and background wash. An AI task drives that same variable
   violet and adds a soft outer glow, so it reads as obviously AI-written
   without becoming a different card. */
.mw-task-card.is-ai-written {
  --_pri: var(--c-purple, #7c3aed);
  box-shadow: 0 0 0 1px rgba(124,58,237,.10), 0 2px 12px rgba(124,58,237,.13);
}
.mw-task-card.is-ai-written::before { opacity: 1; }
.mw-task-card.is-ai-written:hover {
  box-shadow: 0 0 0 1px rgba(124,58,237,.20), 0 10px 26px rgba(124,58,237,.20);
}
/* Still being written — the card is real, its content isn't there yet. */
.mw-task-card.is-ai-pending .mw-task-card-title { color: var(--c-purple, #7c3aed); font-style: italic; }
.mw-task-card.is-ai-pending::before { animation: wkai-sweep 1.4s ease-in-out infinite; }
@keyframes wkai-sweep { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.mw-task-card.is-ai-failed {
  --_pri: var(--c-red, #ef4444);
  box-shadow: 0 0 0 1px rgba(239,68,68,.12), 0 2px 10px rgba(239,68,68,.12);
}

/* The spark pill on the card meta row. */
.mw-card-pill--ai {
  background: var(--c-purple-bg, #f5f3ff) !important;
  color: var(--c-purple, #7c3aed) !important;
  border-color: var(--c-purple-soft, #c4b5fd) !important;
}

/* Popup header treatment so an open AI task matches its card. */
.tp-overlay.is-ai-task .tp-header { box-shadow: inset 0 3px 0 var(--c-purple, #7c3aed); }
.tp-overlay.is-series-brief .tp-header { box-shadow: inset 0 3px 0 var(--c-purple, #7c3aed); }

@media (max-width: 640px) {
  .wksb-hero { flex-wrap: wrap; }
    .wksb-foot { flex-direction: column; align-items: stretch; }
  .wksb-primary { justify-content: center; }
  .wksb-row { flex-wrap: wrap; }
  .wksb-sm { max-width: none; width: 100%; }
}

/* Provenance strip additions — step and what-comes-next. */
.wkai-banner-step { font: 600 10.5px/1.4 var(--f); color: var(--c-purple, #7c3aed); }
.wkai-banner-next { font: 400 11.5px/1.5 var(--f); color: var(--ink2, #525252); }
.wkai-banner-next strong, .wkai-banner-why strong { font-weight: 700; color: var(--ink, #161616); }

/* ================================================================
   SERIES TABS — the brief is four tabs, not one long scroll
   Injected pills ride the popup's own .tp-pill-bar and the panels are
   real .tp-panel siblings, so switching is the app's existing tab
   behaviour with no special-casing.
   ================================================================ */
.tp-pill.wksb-pill { display: inline-flex; align-items: center; gap: 6px; }
.tp-pill.wksb-pill.is-active {
  background: var(--c-purple, #7c3aed);
  border-color: var(--c-purple, #7c3aed);
  color: #fff;
}
.wksb-pill-count {
  min-width: 16px; padding: 0 4px; border-radius: 20px;
  background: rgba(0,0,0,.07); color: inherit;
  font: 700 9.5px/16px var(--f); text-align: center;
}
.tp-pill.wksb-pill.is-active .wksb-pill-count { background: rgba(255,255,255,.24); }
/* The pill bar now carries up to seven tabs — let it wrap rather than squash. */
.tp-pill-bar { flex-wrap: wrap; row-gap: 6px; }

/* A tab's first block shouldn't have a redundant top gap. */
.tp-panel.wksb > .wksb-block:first-child { margin-top: 2px; }

/* ================================================================
   ASK SHEET — the real "Draft with AI" dialog (was window.prompt)
   ================================================================ */
.wksb-ask {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(15,23,42,.42);
  opacity: 0; transition: opacity .13s ease;
}
.wksb-ask.is-in { opacity: 1; }
.wksb-ask-card {
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px;
  background: var(--surf, #fff);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.04);
  transform: translateY(8px) scale(.985);
  transition: transform .16s cubic-bezier(.2,.8,.2,1);
}
.wksb-ask.is-in .wksb-ask-card { transform: none; }
/* Empty submit — a short shake beats an alert. */
.wksb-ask-card.is-nudge { animation: wksbNudge .34s ease; }
@keyframes wksbNudge { 0%,100%{transform:none} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
@media (prefers-reduced-motion: reduce) {
  .wksb-ask, .wksb-ask-card { transition: none; }
  .wksb-ask-card.is-nudge { animation: none; }
}

.wksb-ask-head { display: flex; align-items: flex-start; gap: 9px; }
.wksb-ask-spark { flex: 0 0 auto; color: var(--c-purple, #7c3aed); line-height: 0; padding-top: 2px; }
.wksb-ask-head > div { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wksb-ask-head strong { font: 700 14px/1.3 var(--f); color: var(--ink, #161616); letter-spacing: -.01em; }
.wksb-ask-head span { font: 400 11.5px/1.5 var(--f); color: var(--ink2, #525252); }
.wksb-ask-x {
  flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink3, #8d8d8d);
  font: 400 18px/1 var(--f); cursor: pointer;
}
.wksb-ask-x:hover { background: var(--border-s, #f4f4f4); color: var(--ink, #161616); }

.wksb-ask-input {
  width: 100%; padding: 11px 12px; resize: vertical; min-height: 84px;
  border: 1px solid var(--border, #e0e0e0); border-radius: 8px;
  background: var(--surf, #fff); color: var(--ink, #161616);
  font: 400 13px/1.55 var(--f); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wksb-ask-input::placeholder { color: var(--ink4, #c6c6c6); }
.wksb-ask-input:focus {
  border-color: var(--c-purple, #7c3aed);
  box-shadow: 0 0 0 3px rgba(124,58,237,.10);
}

.wksb-ask-ex { display: flex; flex-direction: column; gap: 5px; }
.wksb-ask-ex > span {
  font: 600 10px/1.3 var(--f); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink3, #8d8d8d);
}
.wksb-ask-chip {
  text-align: left; padding: 7px 10px; cursor: pointer;
  border: 1px solid var(--border, #e0e0e0); border-radius: 6px;
  background: var(--surf, #fff); color: var(--ink2, #525252);
  font: 400 11.5px/1.45 var(--f);
  transition: border-color .14s ease, color .14s ease;
}
.wksb-ask-chip:hover { border-color: var(--c-purple, #7c3aed); color: var(--c-purple, #7c3aed); }

.wksb-ask-foot { display: flex; align-items: center; gap: 8px; }
.wksb-ask-hint {
  flex: 1 1 auto; font: 400 10.5px/1.3 var(--f); color: var(--ink4, #c6c6c6);
  font-variant-numeric: tabular-nums;
}
.wksb-ask-btn {
  padding: 9px 14px; cursor: pointer;
  border: 1px solid var(--border, #e0e0e0); border-radius: 6px;
  background: var(--surf, #fff); color: var(--ink2, #525252);
  font: 600 12px/1 var(--f);
}
.wksb-ask-btn:hover { border-color: var(--ink4, #c6c6c6); color: var(--ink, #161616); }
.wksb-ask-go {
  padding: 9px 16px; cursor: pointer; border: 0; border-radius: 6px;
  background: var(--c-purple, #7c3aed); color: #fff;
  font: 600 12px/1 var(--f);
}
.wksb-ask-go:hover { filter: brightness(1.07); }
.wksb-ask-go:disabled { opacity: .6; cursor: default; }

@media (max-width: 560px) {
  .wksb-ask { padding: 12px; align-items: flex-end; }
  .wksb-ask-card { max-width: none; }
  .wksb-ask-foot { flex-wrap: wrap; }
  .wksb-ask-hint { order: 3; flex-basis: 100%; }
}
