/* Work Queue — the delivery pipeline view. */

.wq-summary {
  font-size: 0.88rem;
  color: var(--text-dim);
}
.wq-summary strong { color: var(--text); }
.wq-hot-count { color: var(--warning) !important; }
.wq-clear { color: var(--success); font-weight: 600; }

/* ---- needs-action banner ---- */

.wq-attention {
  border: 1px solid var(--warning-soft);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.wq-attention-head {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warning);
  margin-bottom: 0.6rem;
}
.wq-attention-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.wq-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.wq-chip:hover { border-color: var(--warning); transform: translateY(-1px); }
.wq-chip-why { font-weight: 500; font-size: 0.74rem; color: var(--text-faint); }

/* ---- stage filters ---- */

.wq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.wq-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}
.wq-filter:hover { border-color: var(--border-strong); color: var(--text); }
.wq-filter span {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-faint);
}
.wq-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wq-filter.active span { color: rgba(255, 255, 255, 0.75); }

/* ---- groups ---- */

.wq-group { margin-bottom: 1.6rem; }
.wq-group-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}
.wq-group-hint { font-size: 0.8rem; color: var(--text-faint); margin-right: auto; }
.wq-group-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-faint);
  background: var(--bg-hover);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* ---- stage pills ---- */

.stage-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
  border: 1px solid transparent;
}
.stage-not-started { background: var(--bg-hover); color: var(--text-faint); }
.stage-building    { background: var(--purple-soft); color: var(--purple); }
.stage-mockup-ready{ background: var(--warning-soft); color: var(--warning); }
.stage-sent        { background: var(--accent-soft); color: var(--accent); }
.stage-replied     { background: var(--success-soft); color: var(--success); }
.stage-closed      { background: var(--bg-hover); color: var(--text-faint); }

/* ---- rows ---- */

.wq-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  animation: wq-in 0.28s ease both;
  animation-delay: calc(var(--i, 0) * 30ms);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wq-row:hover { border-color: var(--border-strong); }
.wq-row.wq-hot { border-left: 3px solid var(--warning); }

@keyframes wq-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.wq-row.wq-flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 45%, transparent); }

.wq-main { flex: 1; min-width: 0; }

.wq-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.wq-head h4 { margin: 0; font-size: 0.98rem; font-weight: 650; }

.wq-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.wq-value { font-weight: 700; color: var(--success); }
.wq-sent { font-style: italic; }

.wq-next {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.wq-next-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.wq-next-text { color: var(--text); }
.wq-next-none { font-size: 0.82rem; color: var(--text-faint); font-style: italic; }

.due-chip {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  background: var(--bg-hover);
  color: var(--text-faint);
  white-space: nowrap;
}
.due-chip.due-today { background: var(--warning-soft); color: var(--warning); }
.due-chip.due-overdue { background: var(--danger-soft); color: var(--danger); }

.wq-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.wq-link {
  font-size: 0.74rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 0.18rem 0.5rem;
  color: var(--text-dim);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.wq-link:hover { border-color: var(--accent); color: var(--accent); }
.wq-path { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.7rem; }

.wq-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: none;
}

@media (max-width: 640px) {
  /* align-items: flex-start is inherited from the base rule, and in a column
     flex that sizes each item to its own content instead of stretching it. The
     result was .wq-main taking the width of the longest file path in the row
     and pushing everything past the right edge of a phone. */
  .wq-row { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .wq-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .wq-actions .btn { flex: 1; min-height: 44px; }

  /* Thumb-sized targets. These are all secondary links on desktop, but on a
     phone they are the primary way through the queue. */
  .wq-link { padding: 0.5rem 0.7rem; font-size: 0.78rem; }
  .wq-head h4 { font-size: 1.02rem; }
}

.email-draft {
  width: 100%;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  resize: vertical;
  white-space: pre-wrap;
}

/* ---- lead-card flags (Leads board) ---- */

.kc-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.kc-flag {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
}

.kc-flag-gap {
  background: var(--danger-soft);
  color: var(--danger);
}

.kc-flag-touch {
  background: var(--bg-hover);
  color: var(--text-faint);
  font-weight: 600;
}

.kc-flag-link {
  background: var(--accent-soft);
  color: var(--accent);
}

.kc-flag-link:hover { text-decoration: underline; }


/* ---- lead card: both pipeline states, stated out loud ---- */

.kc-states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.kc-state {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0.5rem 0.12rem 0.4rem;
}

.kc-state-k {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.kc-state-v {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  white-space: nowrap;
}

.stage-none { background: transparent; color: var(--text-faint); font-weight: 600; }

.kc-mockup-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  text-decoration: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kc-mockup-link:hover { text-decoration: underline; }

.segmented button { cursor: pointer; white-space: nowrap; }

/* ---- lead form: mockup section ---- */

.form-section {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.form-section-hint {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--text-faint);
}

.field-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.field-link:hover { text-decoration: underline; }

/* Build price and monthly fee sit together on the lead card — the monthly is
   the number you forget when you are quoting from memory. */
.quote-monthly {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
  margin-top: 1px;
}

/* ===========================================================================
   One pipeline — the summary strip above the board, and the stage tones used
   by the strip, the column headings and the card badge so a stage looks the
   same everywhere it appears.
   =========================================================================== */

.pipe-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.pipe-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 108px;
  padding: 0.55rem 0.9rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.pipe-chip:hover { transform: translateY(-2px); }

.pipe-chip b {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.pipe-chip span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}

.pipe-chip.on {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.pipe-chip.on span { color: var(--text); }

/* "Mockup ready" with anything in it is the one that needs you today. */
.pipe-chip.nudge {
  border-left-color: var(--warning);
  background: color-mix(in srgb, var(--warning) 9%, var(--bg-card));
}
.pipe-chip.nudge b { color: var(--warning); }

/* ---- shared stage tones ---- */

.tone-grey   { --tone: var(--text-faint); --tone-bg: var(--bg-hover); }
.tone-purple { --tone: var(--purple);  --tone-bg: var(--purple-soft); }
.tone-amber  { --tone: var(--warning); --tone-bg: var(--warning-soft); }
.tone-blue   { --tone: var(--accent);  --tone-bg: var(--accent-soft); }
.tone-teal   { --tone: var(--info);    --tone-bg: var(--info-soft); }
.tone-green  { --tone: var(--success); --tone-bg: var(--success-soft); }
.tone-red    { --tone: var(--danger);  --tone-bg: var(--danger-soft); }

.pipe-chip[class*="tone-"] { border-left-color: var(--tone); }

.kanban-col-title[class*="tone-"] {
  background: var(--tone-bg);
  color: var(--tone);
}

.kanban-col-hint {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-faint);
  margin: 0.2rem 0 0.35rem;
  min-height: 1.9em;
}

/* ---- the single stage badge on a card ---- */

.kc-stage {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  white-space: nowrap;
  background: var(--tone-bg);
  color: var(--tone);
}

/* The outreach message sits on the lead itself — it is what you read just
   before you pick up the phone, so it gets room to breathe. */
.talking-points {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  resize: vertical;
}

button.field-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  text-align: left;
}
button.field-link:hover { text-decoration: underline; }

/* Explains why [PREVIEW LINK] is still visible in the stored message: the
   placeholder is deliberate, and only the copy resolves it. */
.field-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-dim);
}
