/* Reusable components */

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px;
}
.card-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.card-tight { padding: 14px 16px; }

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 30px; color: var(--text); }
.stat-card .stat-label { font-size: 12px; color: var(--muted); }
.stat-card .stat-delta { font-size: 11.5px; font-weight: 600; }
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }

button, .btn { font-family: var(--font-body); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; padding: 10px 18px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; transition: all .12s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #1a0f08; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid transparent; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: var(--red-dim); color: var(--red); }
.btn-danger:hover { background: rgba(181,100,90,.24); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: inherit; font-size: 13.5px;
  padding: 10px 12px; outline: none; transition: border-color .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 0; white-space: nowrap;
}
.badge-accent { background: var(--accent-dim); color: var(--accent-text); }
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-muted { background: var(--surface-3); color: var(--muted); }

.pill {
  background: var(--surface); border: 1px solid var(--border); border-radius: 0;
  color: var(--text-dim); font-size: 12px; font-weight: 500; padding: 7px 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all .12s; text-decoration: none;
}
.pill:hover { border-color: var(--border-strong); color: var(--text); }
.pill.active { background: var(--accent-dim); border-color: transparent; color: var(--accent-text); }
.pill-count { font-size: 10.5px; font-weight: 700; background: var(--surface-3); border-radius: 0; padding: 1px 6px; }
.pill.active .pill-count { background: rgba(0,0,0,.2); color: var(--accent-text); }

/* Scrolls inside itself rather than pushing the page wide. A plain flex row of
   five tabs (the Clients detail) overflowed the viewport by 110px at 420px and
   took every card on the page with it — the row has to be the thing that
   scrolls, not the document. */
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 4px; margin-right: 22px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  flex-shrink: 0; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none;
}
/* Inline code is used for hints (folder-id paths, JSON shapes) that are longer
   than a narrow column. Without this it refuses to break and pushes the page. */
code {
  font-family: var(--font-mono); font-size: 0.92em;
  overflow-wrap: anywhere; word-break: break-word;
}

.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--text); border-color: var(--accent); }

/* Prospect list row */
.row-list { display: flex; flex-direction: column; gap: 8px; }
.prospect-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: border-color .12s;
}
.prospect-row:hover { border-color: var(--border-strong); }
.prospect-row .pr-name { font-weight: 600; font-size: 14px; }
.prospect-row .pr-niche { font-size: 12px; color: var(--muted); }
.prospect-row .pr-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.prospect-row .pr-overdue { color: var(--red); font-size: 11.5px; font-weight: 600; }

/* Kanban */
.kanban { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 14px; }
.kanban::-webkit-scrollbar { height: 8px; }
.kanban::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 0; }
.kanban::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 0; }
.kanban-col { flex: 1 1 0; min-width: 172px; max-width: 230px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px 10px; }
.kanban-col-head .kh-title { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 13px; margin-bottom: 8px; cursor: grab; transition: border-color .12s; min-width: 0;
}
.kanban-card:hover { border-color: var(--border-strong); }
.kanban-card .kc-name { font-weight: 600; font-size: 13px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card .kc-niche { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card.drag-over { border-color: var(--accent); }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); margin-top: 5px; flex-shrink: 0; }
.timeline-dot.note { background: var(--blue); }
.timeline-dot.stage_change { background: var(--accent); }
.timeline-dot.message_logged { background: var(--green); }
.timeline-dot.ai_asset_created { background: var(--yellow); }
.timeline-dot.page_view { background: var(--green); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-text { font-size: 13px; color: var(--text-dim); margin-top: 2px; white-space: pre-wrap; }
.timeline-time { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* Chat thread */
.chat-thread { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.chat-bubble { max-width: 78%; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.chat-bubble.out { align-self: flex-end; background: var(--accent-dim); border: 1px solid transparent; }
.chat-bubble.in { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); }
.chat-bubble.placeholder { opacity: 0.6; font-style: italic; }
.chat-bubble-meta { font-size: 10.5px; color: var(--muted); margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.chat-bubble-text { white-space: pre-wrap; word-break: break-word; }
.chat-bubble-text a { color: var(--blue); text-decoration: underline; }
.chat-bubble-actions { margin-left: auto; display: flex; gap: 6px; }
.chat-bubble-actions button { background: none; border: none; padding: 0; margin: 0; color: var(--muted); cursor: pointer; display: inline-flex; }
.chat-bubble-actions button:hover { color: var(--text); }
.chat-bubble-actions svg { width: 12px; height: 12px; vertical-align: 0; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; z-index: 500; padding: 40px 20px; overflow-y: auto;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 640px; padding: 26px; box-shadow: var(--shadow);
}
.modal-wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { font-size: 19px; }
.modal-close { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }

/* Toast */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 900; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 11px 16px; font-size: 13px; box-shadow: var(--shadow); animation: toast-in .15s ease-out;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state .es-icon { font-size: 26px; margin-bottom: 10px; opacity: .6; }

.loading-dots::after { content: '...'; animation: none; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.ai-output {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; color: var(--text-dim);
}

hr.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Content Planner calendar view */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid-head { margin-bottom: 6px; }
.cal-weekday { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-height: 96px; padding: 6px; transition: border-color .12s;
}
.cal-cell-empty { background: transparent; border-color: transparent; }
.cal-cell-today { border-color: var(--accent); }
.cal-daynum { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.cal-chips { display: flex; flex-direction: column; gap: 4px; }
.cal-chip {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 6px; font-size: 11px; line-height: 1.3; cursor: grab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-chip:hover { border-color: var(--border-strong); }
@media (max-width: 1000px) {
  .cal-cell { min-height: 64px; }
  .cal-weekday { font-size: 9.5px; }
}

/* ---------- Content Planner v2 ---------- */

.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.45; }

/* The C_Teardown gate and the missing-sources warning. Red for the hard block
   (it stops a save), yellow for the soft one (it only nags). */
.gate-warn {
  background: var(--red-dim); border: 1px solid var(--red); color: var(--text);
  border-radius: var(--radius); padding: 12px 14px; font-size: 12.5px; line-height: 1.5;
  margin-bottom: 16px;
}
.gate-warn-soft { background: var(--yellow-dim); border-color: var(--yellow); }
.card-gated { border-color: var(--accent); }

/* Per-pillar / per-format performance. The hierarchy here is the point: DMs are
   the number this account exists to produce, so they get the display face at
   28px and the accent colour, while impressions sit at 11.5px in --muted. Do not
   "balance" these two — a reach number that reads as big is the exact wrong
   signal on this screen. */
.perf-list { display: flex; flex-direction: column; }
.perf-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "key dms" "imp dms";
  gap: 2px 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.perf-row:last-child { border-bottom: none; padding-bottom: 0; }
.perf-key { grid-area: key; font-size: 13px; font-weight: 600; color: var(--text); }
.perf-n { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.perf-dms { grid-area: dms; text-align: right; }
.perf-dms-value { font-family: var(--font-display); font-size: 28px; line-height: 1.1; color: var(--accent-text); }
.perf-dms-label { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.perf-imp { grid-area: imp; font-size: 11.5px; color: var(--muted); }
.perf-note {
  font-size: 12px; color: var(--muted); margin-bottom: 14px;
  border-left: 2px solid var(--accent); padding-left: 10px;
}

/* Fast metrics entry. Wide by nature (8 numbers + a date), so it scrolls inside
   its own container rather than pushing the page sideways. */
.mx-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
.mx-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mx-table th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 0 6px 8px; white-space: nowrap;
}
.mx-table td { padding: 6px 6px; border-top: 1px solid var(--border); vertical-align: middle; }
.mx-table th.mx-dms-col { color: var(--accent-text); }
.mx-hook { font-weight: 600; font-size: 12.5px; color: var(--text); }
.mx-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mx-table input { padding: 7px 8px; font-size: 12.5px; }
.mx-num { width: 76px; }
.mx-date-col { width: 1%; }
.mx-table input[type="date"] { width: 132px; }
.mx-dms-input { border-color: var(--accent-dim); background: var(--accent-dim); color: var(--accent-text); font-weight: 600; }
.mx-dms-input:focus { border-color: var(--accent); }

@media (max-width: 720px) {
  .perf-dms-value { font-size: 24px; }
}

/* ---------- Pipeline (#/content/pipeline) ----------
   The merged Content Planner + Planable view. Date-major: a backlog rail for
   undated posts and one row per day, so an empty day is visible as an empty
   row. That is the whole reason it is not a kanban — a lane cannot show a hole.
   Keeps the sync freshness line, the drift badges and the multi-select bulk bar
   from the board it replaced. */

.planable-syncbar {
  font-size: 12.5px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 0; padding: 9px 12px;
}
.planable-syncbar.stale { background: var(--red-dim); border-color: var(--red); color: var(--red); }

.planable-card { position: relative; padding-right: 30px; }
.planable-card.selected { border-color: var(--accent); background: var(--accent-dim); }
.planable-check { position: absolute; top: 8px; right: 8px; margin: 0; cursor: pointer; }
.planable-check input { width: auto; margin: 0; cursor: pointer; }

.planable-empty { font-size: 12px; color: var(--muted); padding: 10px 4px; }

/* Day grouping inside the queue lane — the only lane read as a calendar.
   `soon` covers today through +7d, which is the horizon the board promises to
   make visible at a glance. */
.planable-dayhead {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 10px 4px 5px;
}
.planable-dayhead:first-child { padding-top: 0; }
.planable-dayhead.soon { color: var(--accent-text); }

.planable-drift { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.drift-badge {
  font-size: 10px; font-weight: 600; line-height: 1.3;
  border-radius: 0; padding: 2px 5px; cursor: help;
}
.drift-error { background: var(--red-dim); color: var(--red); }
.drift-warn { background: var(--yellow-dim); color: var(--yellow); }

/* Sticky rather than inline: the selection is made while scrolling a long
   agenda, and an action bar that scrolls away with it is unreachable exactly
   when it is needed. */
.planable-bulkbar {
  position: sticky; bottom: 16px; z-index: 5;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 0; padding: 10px 14px; margin-top: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  font-size: 12.5px; font-weight: 600;
}

/* The confirmation rows carry a real button inside .pr-meta, which is
   flex-shrink:0 — at phone widths that squeezed the hook into a ~50px column.
   Everywhere else .pr-meta holds only badges, so this wraps here rather than
   changing the shared row. */
@media (max-width: 640px) {
  .planable-confirm-row { flex-wrap: wrap; }
  .planable-confirm-row .pr-meta { margin-left: 0; width: 100%; }
}

@media (max-width: 720px) {
  .planable-bulkbar { bottom: 8px; }
}

/* ── IDEEN-INBOX & the copy-prompt hand-off ─────────────────────────────────
   The inbox rows reuse .prospect-row/.row-list; only the two things that row
   was never built for get their own rules — a full idea is a paragraph, not a
   name, and the step blocks exist because this dialog is read across a tab
   switch and has to still say where you were when you come back. */

/* An idea is a paragraph, not a name, so the row's text column has to be able
   to grow taller without the buttons riding up against it. */
.idea-row { align-items: flex-start; cursor: default; }
.idea-row .pr-name { line-height: 1.45; }

.quote-block {
  font-size: 13px; line-height: 1.5; color: var(--text-dim);
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0; padding: 10px 12px; margin-bottom: 16px;
  white-space: pre-wrap;
}

/* The idea stays editable while it is being worked on: it is read once more
   right before it is sent, and that is exactly when it gets sharpened. */
.idea-raw-edit { min-height: 72px; font-size: 13px; line-height: 1.5; }

.step-block {
  border: 1px solid var(--border); border-radius: 0;
  padding: 14px; margin-bottom: 14px;
}
.step-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; margin-bottom: 8px;
}
.step-num {
  flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: var(--accent-fg, #0b0b0c);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
}

/* The prompt is long and its line breaks are load-bearing — it is read to
   check what is being sent, not skimmed, so it scrolls in place rather than
   pushing the paste box below the fold. */
.prompt-preview {
  margin: 8px 0 0; max-height: 240px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 0; padding: 10px;
  font-size: 11.5px; line-height: 1.5; color: var(--text-dim);
  white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 640px) {
  .idea-row { flex-wrap: wrap; }
  .idea-row .pr-meta { margin-left: 0; width: 100%; }
}

/* ---------- Pipeline: rail + agenda ---------- */

.pipe-wrap { display: flex; gap: 16px; align-items: flex-start; margin-top: 16px; }

/* The rail is a bag to pull from, not a queue to work down, so it is narrow and
   scrolls on its own rather than stretching the agenda beside it. */
.pipe-rail {
  flex: 0 0 250px; max-width: 250px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 0; padding: 10px;
}
.pipe-rail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pipe-rail-body { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.pipe-rail-hint { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

.pipe-agenda { flex: 1 1 auto; min-width: 0; }

.pipe-day {
  display: flex; gap: 12px; align-items: stretch;
  border-bottom: 1px solid var(--border);
  padding: 7px 6px; min-height: 42px;
}
.pipe-day:first-child { border-top: 1px solid var(--border); }
.pipe-day.drop-target { background: var(--accent-dim); border-radius: 0; }
.pipe-day.weekend .pd-date { opacity: .62; }
.pipe-day.past { opacity: .55; }
.pipe-day.today { background: var(--surface-2); border-radius: 0; }
.pipe-day.today .pd-dow, .pipe-day.today .pd-num { color: var(--accent-text); }

.pd-date {
  flex: 0 0 74px; display: flex; align-items: baseline; gap: 6px;
  font-size: 12px; padding-top: 5px;
}
.pd-dow { font-weight: 700; color: var(--text-dim); }
.pd-num { color: var(--muted); font-variant-numeric: tabular-nums; }

.pd-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

/* An empty day is the signal, not an absence — it gets a visible dashed slot
   rather than blank space, because "nothing is planned for Friday" is the most
   actionable thing this screen says. */
.pd-empty {
  font-size: 11.5px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: 0;
  padding: 6px 10px; opacity: .75;
}
.pipe-day.hole .pd-empty { border-color: var(--yellow); color: var(--yellow); opacity: 1; }

.pipe-post {
  position: relative; display: flex; align-items: flex-start; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0; padding: 7px 9px 7px 26px; cursor: pointer;
}
.pipe-post:hover { border-color: var(--border-strong); }
.pipe-post .planable-check { top: 8px; left: 8px; right: auto; }
.pipe-post.confirming { border-color: var(--yellow); background: var(--yellow-dim); }
.pp-main { flex: 1 1 auto; min-width: 0; }
.pp-hook { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.pp-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 5px; font-size: 11px; }
.pp-actions { display: flex; align-items: center; gap: 3px; flex-shrink: 0; }

.pipe-chip {
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  border-radius: 0; padding: 2px 7px; white-space: nowrap;
}
.pipe-chip-ok { background: var(--green-dim); color: var(--green); }
.pipe-chip-queued { background: var(--blue-dim); color: var(--blue); }
.pipe-chip-warn { background: var(--surface-3); color: var(--muted); }
.pipe-chip-alarm { background: var(--yellow); color: #111; }

.pipe-streak {
  font-size: 12px; color: var(--muted);
  padding: 12px 6px 0; line-height: 1.5;
}

/* Below this the rail cannot sit beside the agenda without crushing both. It
   goes above, horizontally scrollable, so the agenda keeps the full width. */
@media (max-width: 900px) {
  .pipe-wrap { flex-direction: column; }
  .pipe-rail { flex: 1 1 auto; max-width: none; width: 100%; }
  .pipe-rail-body { flex-direction: row; overflow-x: auto; max-height: none; }
  .pipe-rail-body > .pipe-post { flex: 0 0 220px; }
}

@media (max-width: 560px) {
  .pd-date { flex-basis: 58px; }
  .pipe-post { flex-wrap: wrap; }
  .pp-actions { width: 100%; justify-content: flex-end; }
}

/* Coaching — transcript reader + knowledge bodies (#/coaching).
   Lives here rather than in its own file, like .cal-* and .perf-*: analytics.css
   and mockup.css earned separate files at hundreds of lines; this is one grid
   row and a typography block. */
.tr-scroll { max-height: 560px; overflow-y: auto; padding-right: 6px; }
.tr-line { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.tr-line:last-child { border-bottom: none; }
.tr-time {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: 2px; text-decoration: none;
}
a.tr-time:hover { color: var(--accent-text); }
.tr-speaker { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-right: 6px; }
/* anywhere, not break-word: a pasted URL in a transcript is one long token and
   would otherwise push the whole page sideways. */
.tr-text { font-size: 13px; line-height: 1.6; color: var(--text-dim); overflow-wrap: anywhere; }
.tr-line.tr-hit { background: var(--accent-dim); border-radius: var(--radius-sm); }

.md-body { font-size: 13.5px; line-height: 1.65; color: var(--text-dim); }
.md-body p { margin: 0 0 10px; }
.md-body ul, .md-body ol { margin: 0 0 10px; padding-left: 20px; }
.md-body li { margin-bottom: 5px; }
.md-body ul ul, .md-body ul ol, .md-body ol ul, .md-body ol ol { margin: 5px 0 0; }
.md-body strong { color: var(--text); font-weight: 650; }
.md-body code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: var(--radius-sm); }
.md-body blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 2px solid var(--accent); color: var(--muted); font-style: italic; }
.md-body > :last-child { margin-bottom: 0; }
.kb-quote {
  font-size: 12.5px; color: var(--muted); font-style: italic;
  border-left: 2px solid var(--border-strong); padding-left: 10px; margin-top: 10px;
}

@media (max-width: 560px) {
  .tr-line { grid-template-columns: 52px 1fr; gap: 8px; }
  .tr-time { font-size: 10.5px; }
}
