/* ── Page Styles: Studio Production ────────────────────────────── */

/* ── Dashboard Widgets (edit mode) ────────────────────────────── */
.dashboard-widgets--editing .dashboard-widget-slot {
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--sp-xs);
  margin-bottom: var(--sp-sm);
  transition: border-color var(--duration-fast);
}
.widget-edit-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) var(--sp-sm);
  margin-bottom: var(--sp-xs);
  background: var(--glass-bg);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.widget-drag-handle {
  cursor: grab;
  opacity: 0.5;
  user-select: none;
  letter-spacing: 2px;
  font-size: 0.875rem;
}
.widget-dragging { opacity: 0.4; }
.widget-dragover { border-color: var(--accent) !important; }
.add-widget-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
}
.add-widget-option {
  padding: var(--sp-md);
  text-align: center;
  cursor: pointer;
}

/* Dashboard customize: gear in header on desktop, text link at bottom on mobile */
.dash-customize-btn { display: none !important; }
@media (min-width: 1024px) {
  .dash-customize-btn { display: inline-flex !important; }
  .dash-mobile-customize { display: none !important; }
}

/* Widget spacing (mobile) */
.dashboard-widgets {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

/* Desktop: 2-column masonry layout */
@media (min-width: 1024px) {
  .dashboard-widgets {
    display: block;
    column-count: 2;
    column-gap: var(--sp-lg);
  }
  .dashboard-widget-slot {
    break-inside: avoid;
    margin-bottom: var(--sp-lg);
  }
  .dashboard-widget-slot.widget-full {
    column-span: all;
  }
  /* Edit mode: single column for easier drag reorder */
  .dashboard-widgets--editing {
    column-count: 1;
  }
}

/* The login page moved to /signin (frontend-shared/signin/signin.css)
   — one sign-in for MainFrame, Social and Cadence. Its login-*,
   user-tile and pin-input rules left with it. (2026-09-14) */

/* ── Home / Dashboard ────────────────────────────────────────── */

/* The brief card's one name — Tally writes the brief inside it. */
.home-brief-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-sm);
}

/* Morning Brief as a to-do list (Sep 25 2026): a headline, then rows —
   kind tag · the thing (+ when) · one next step · chevron. Tag colours are
   palette tokens so every theme carries them. */
.brief { padding: 12px var(--sp-md) 6px; }
.brief-top { display: flex; align-items: center; justify-content: space-between; }
.brief-top .home-brief-label { margin-bottom: 0; }
.brief-refresh { margin: -6px -6px -6px 0; color: var(--text-muted); }
.brief-headline {
  font-family: var(--font-heading); font-size: 1.02rem; line-height: 1.3;
  color: var(--text-primary); margin: 2px 0 6px;
}
.brief-list { display: flex; flex-direction: column; margin: 0 calc(-1 * var(--sp-sm)); }
.brief-row {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 7px var(--sp-sm); border: 0; border-top: 1px solid var(--glass-border);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  border-radius: var(--radius-sm); -webkit-tap-highlight-color: transparent;
}
.brief-row:first-child { border-top: 0; }
.brief-row:hover:not(:disabled) { background: var(--glass-bg-hover); }
.brief-row:disabled { cursor: default; }
.brief-tag {
  flex: none; width: 44px; margin-top: 1px; padding: 2px 0; border-radius: 5px; text-align: center;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  --tag: var(--text-muted);
  color: var(--tag); background: color-mix(in srgb, var(--tag) 14%, transparent);
}
.brief-tag--late { --tag: var(--error); }
.brief-tag--due { --tag: var(--warning); }
.brief-tag--shoot { --tag: var(--event-color-1); }
.brief-tag--risk { --tag: var(--severity-critical); }
.brief-tag--load { --tag: var(--severity-warning); }
.brief-tag--flag, .brief-tag--booking { --tag: var(--accent-text, var(--accent)); }
.brief-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* The name gets the full width (the day moved to the next-step line) and
   may wrap once — "Unlimited Grace: September 14" vs "…: October 26" is
   told apart by its end. */
.brief-title {
  font-size: 0.88rem; font-weight: 600; color: var(--text-primary); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.brief-you {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 6px 1px 0; vertical-align: middle;
  background: var(--accent);
}
.brief-tail { font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.brief-next {
  font-size: 0.8rem; color: var(--text-secondary); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brief-foot { display: flex; gap: 14px; padding-left: calc(44px + 10px); }
.brief-more {
  padding: 5px 0; border: 0; background: none;
  font: inherit; font-size: 0.75rem; color: var(--accent-text, var(--accent)); cursor: pointer;
}

.home-greeting {
  margin-bottom: var(--sp-xl);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
}

.home-greeting h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--sp-xs);
}

.home-greeting p {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
}

.stat-card--desktop-only {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   UNIFIED STAT TILE — shared value+label look
   Consolidates the app's 6 stat-tile implementations (dashboard,
   command sidebar, history log, category summary, creative plan,
   ELT dashboard). Type ramp standardized on value 2rem/700 mono +
   label 0.6875rem uppercase muted — this is the actual majority
   across the two LIVE components (.stat-card, .elt-stat-card both
   use 2rem), not the 1.25rem originally assumed; the three smaller/
   currently-unused tiles keep their compact size as a per-class
   ═══════════════════════════════════════════════════════════════════ */
.stat-card,
.sidebar-stat-card,
.history-stat,
.cat-summary-stat,
.elt-stat-card {
  padding: var(--sp-lg);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.stat-value,
.sidebar-stat-value,
.history-stat-value,
.cat-val,
.elt-stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: var(--sp-xs);
}

.stat-label,
.sidebar-stat-label,
.history-stat-label,
.cat-lbl,
.elt-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* .stat-card already gets its glass background/radius/border from the
   .glass-card--static class in markup — this class only adds the
   accent top border. The shared background/border/radius above is a
   harmless no-op duplicate of those (identical values), kept so the
   rule reads the same as every other tile in this section. */
.stat-card {
  border-top: 2px solid var(--accent);
}

.stat-value {
  letter-spacing: -0.02em;
}

.stat-card--accent .stat-value {
  color: var(--accent-text);
}

.stat-card--warn .stat-value {
  color: var(--severity-warning);
}
/* ═══════════════════════════════════════════════════════════════════ */

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-sm);
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: var(--sp-sm);
  border-left: 2px solid var(--accent);
}

/* Dashboard grid — mobile: flex column */
.dashboard-grid {
  display: flex;
  flex-direction: column;
}

.dashboard-grid-left,
.dashboard-grid-right {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Section dividers: thin line between stacked sections on mobile */
.dashboard-grid-left > * + *,
.dashboard-grid-right > * + * {
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--glass-border);
}

.dash-twin-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}
.dash-desktop-hide > * + * {
  margin-top: var(--sp-lg);
}

/* Pipeline Health Bar */
.pipeline-health {
  padding: var(--sp-lg);
}

.health-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm);
}

.health-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xs);
  cursor: pointer;
  padding: var(--sp-sm) var(--sp-xs);
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease-out);
}

.health-stage:active {
  background: var(--glass-bg-hover);
}

.health-stage--bottleneck {
  background: color-mix(in srgb, var(--severity-critical) 10%, transparent);
  border-radius: var(--radius-sm);
}

.health-count {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
}

/* My Projects list */
.my-projects-list {
  display: flex;
  flex-direction: column;
}

.my-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
}

.my-project-item:last-child {
  border-bottom: none;
}

.my-project-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.my-project-name {
  font-size: 0.9375rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-project-ministry {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Upcoming Shoots */
.shoot-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-sm) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
}

.shoot-item:last-child {
  border-bottom: none;
}

.shoot-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-text);
  white-space: nowrap;
}

.shoot-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shoot-name {
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shoot-ministry {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Team Capacity */
.capacity-list {
  display: flex;
  flex-direction: column;
}

.capacity-member {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
}

.capacity-member:last-child {
  border-bottom: none;
}

/* The Unassigned bucket: a dashed divider above, no rule below the card */
.capacity-unassigned {
  border-top: 1px dashed var(--glass-border);
}
.capacity-unassigned > .capacity-member {
  border-bottom: none;
}

/* One unassigned project: name · stage · who takes it */
.capacity-project-row--assign {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-xs) var(--sp-sm);
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius-sm);
}
.capacity-project-row--assign:hover {
  background: var(--glass-bg-hover);
}
.capacity-project-name {
  flex: 1 1 12rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
/* Two classes deep on purpose: .form-input (width:100%) and
   select.form-input (padding-right:36px) are declared later in this file. */
.capacity-project-row--assign .capacity-assign-select {
  flex: 0 0 auto;
  width: auto;
  max-width: 10rem;
  min-height: 28px;
  padding: 2px 26px 2px 8px;
  background-position: right 8px center;
  font-size: 0.75rem;
}

.capacity-info {
  flex: 1;
  min-width: 0;
}

.capacity-name {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.capacity-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.capacity-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  min-width: 0;
}

.capacity-bar {
  flex: 1;
  height: 6px;
  background: var(--glass-bg);
  border-radius: 3px;
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--duration-normal) var(--ease-out);
}

.capacity-fill--available {
  background: var(--capacity-available);
}

.capacity-fill--busy {
  background: var(--capacity-busy);
}

.capacity-fill--near {
  background: var(--severity-warning);
}

.capacity-fill--over {
  background: var(--severity-critical);
}

.capacity-status {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.capacity-status--available {
  background: color-mix(in srgb, var(--capacity-available) 15%, transparent);
  color: var(--capacity-available);
}

.capacity-status--busy {
  background: color-mix(in srgb, var(--capacity-busy) 15%, transparent);
  color: var(--capacity-busy);
}

.capacity-status--near {
  background: color-mix(in srgb, var(--severity-warning) 15%, transparent);
  color: var(--severity-warning);
}

.capacity-status--over {
  background: color-mix(in srgb, var(--severity-critical) 15%, transparent);
  color: var(--severity-critical);
}

.capacity-assignments {
  font-size: 0.6875rem;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 20px;
  text-align: right;
}

/* Upcoming Deadlines */
.deadline-list {
  display: flex;
  flex-direction: column;
}

.deadline-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
}

.deadline-item:last-child {
  border-bottom: none;
}

.deadline-info {
  flex: 1;
  min-width: 0;
}

.deadline-name {
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deadline-date {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.deadline-days {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--glass-bg);
  color: var(--text-secondary);
}

.deadline-days--urgent {
  background: color-mix(in srgb, var(--severity-critical) 15%, transparent);
  color: var(--severity-critical);
}

.deadline-days--warning {
  background: color-mix(in srgb, var(--severity-warning) 15%, transparent);
  color: var(--severity-warning);
}

/* Category Balance */
.category-balance-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-lg);
}

.category-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

.category-label {
  font-size: 0.8125rem;
  font-weight: 500;
  min-width: 100px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-bar {
  flex: 1;
  height: 8px;
  background: var(--glass-bg);
  border-radius: 4px;
  overflow: hidden;
}

.category-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  opacity: 0.7;
  transition: width var(--duration-normal) var(--ease-out);
}

.category-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.category-row .section-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
}

.category-projects {
  padding: 0 var(--sp-sm) var(--sp-xs) calc(12px + var(--sp-md));
}

.category-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.category-project-item:hover {
  background: var(--glass-bg-hover);
}

.category-project-name {
  font-size: 0.8125rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Claude Insights */
.insights-list {
  display: flex;
  flex-direction: column;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
}

.insight-item:last-child {
  border-bottom: none;
}

.insight-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-top: 2px;
}

.insight-icon-wrap.insight-alert {
  background: color-mix(in srgb, var(--severity-critical) 15%, transparent);
  color: var(--severity-critical);
}

.insight-icon-wrap.insight-metric {
  background: color-mix(in srgb, var(--severity-insight) 15%, transparent);
  color: var(--accent-text);
}

.insight-icon-wrap.insight-suggestion {
  background: color-mix(in srgb, var(--capacity-available) 15%, transparent);
  color: var(--capacity-available);
}

.insight-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.insight-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.insight-body {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* spin keyframes defined in components.css */
.spin {
  animation: spin 1s linear infinite;
}

/* ── Risk Alerts ─────────────────────────────────────────────── */
.risk-alerts-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  overflow: hidden;
  max-width: 100%;
}

.see-more-btn {
  width: 100%;
  text-align: center;
  margin-top: var(--sp-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.risk-count-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--severity-critical);
  color: var(--text-inverse);
  border-radius: 10px;
  padding: 1px 8px;
  line-height: 1.4;
}

.risk-alert-card {
  padding: var(--sp-sm) var(--sp-md);
  border-left: 3px solid var(--severity-watch);
  transition: border-color var(--duration-fast) var(--ease-out);
  overflow: hidden;
  max-width: 100%;
}

.risk-alert-card.risk-severity--critical {
  border-left-color: var(--severity-critical);
}

.risk-alert-card.risk-severity--warning {
  border-left-color: var(--severity-warning);
}

.risk-alert-card.risk-severity--watch {
  border-left-color: var(--severity-watch);
}

.risk-alert-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xs);
  cursor: pointer;
}

.risk-alert-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
}

.risk-alert-icon.risk-severity--critical {
  background: color-mix(in srgb, var(--severity-critical) 15%, transparent);
  color: var(--severity-critical);
}

.risk-alert-icon.risk-severity--warning {
  background: rgba(212, 160, 77, 0.15);
  color: var(--severity-warning);
}

.risk-alert-icon.risk-severity--watch {
  background: rgba(212, 196, 77, 0.15);
  color: var(--severity-watch);
}

.risk-alert-type {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  flex: 1;
}

.risk-dismiss-btn {
  opacity: 0.4;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.risk-alert-card:hover .risk-dismiss-btn {
  opacity: 1;
}

.risk-alert-title {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
}

.risk-alert-project {
  font-size: 0.75rem;
  color: var(--accent-text);
  margin-top: 2px;
  cursor: pointer;
}

.risk-alert-project:hover {
  text-decoration: underline;
}

.risk-detail-expand {
  margin-top: var(--sp-sm);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--glass-border);
}

.risk-analysis {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--sp-xs);
}

.risk-action-desc {
  margin-bottom: var(--sp-xs);
  line-height: 1.4;
}

.risk-card-actions {
  display: flex;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
}

.risk-card-btn {
  flex: 1;
}

/* ── Chat Shell — dual panel at desktop ──────────────────────── */
.chat-shell-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  /* No bottom padding for the nav: the bottom nav is now an in-flow flex
     child of .app-shell (position:relative, reserves its own height), so the
     wrapper already ends above it. The old nav-height padding double-counted
     that space and left a gap below the chat input bar. */
  overflow: hidden;
}


.chat-detail-empty {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
}

/* Mobile: show one panel at a time */
.chat-list-panel.mobile-hidden,
.chat-detail-panel.mobile-hidden {
  display: none;
}

.chat-list-panel:not(.mobile-hidden),
.chat-detail-panel:not(.mobile-hidden) {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.chat-item--active {
  background: var(--glass-bg-hover);
}

/* ── Chat Page — Conversation List ────────────────────────────── */
.chat-list {
  display: flex;
  flex-direction: column;
}

.chat-item-wrapper {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chat-item-delete {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--error, #e53e3e);
  color: var(--text-inverse);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  padding: 0;
}

.chat-item {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  background: var(--bg-primary);
}

.chat-item:active {
  background: var(--glass-bg-hover);
}

.chat-item--unread .chat-item-name {
  font-weight: 700;
  color: var(--text-primary);
}

.chat-item--unread .chat-item-preview {
  color: var(--text-secondary);
}

.chat-item-content {
  flex: 1;
  min-width: 0;
}

.chat-item-name {
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.chat-item-preview {
  font-size: 0.8125rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-xs);
  flex-shrink: 0;
}

.chat-item-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Unread badge */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
}

/* ── User Picker / Group Creator Overlays ────────────────── */
.user-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
}

.user-picker-panel {
  width: 100%;
  max-width: 360px;
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary, var(--bg-primary));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.user-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.user-picker-title {
  font-size: 1rem;
  font-weight: 600;
}

.user-picker-body {
  padding: var(--sp-md) var(--sp-lg) var(--sp-lg);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.user-picker-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-sm);
}

.user-picker-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.user-picker-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  width: 100%;
  padding: var(--sp-sm) var(--sp-lg);
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  text-align: left;
  border-radius: var(--radius-sm);
}

.user-picker-item:hover {
  background: var(--glass-bg-hover, rgba(255, 255, 255, 0.06));
}

.user-picker-item--selected {
  background: var(--accent-soft);
}

.user-picker-item--selected:hover {
  background: var(--accent-soft);
}

.user-picker-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.user-picker-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.user-picker-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Nav badge */
.nav-badge {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(14px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 0.5625rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Avatar variant for Claude */
.avatar-claude {
  background: linear-gradient(135deg, rgba(196, 62, 62, 0.3), rgba(196, 62, 62, 0.15));
  border: 1px solid rgba(196, 62, 62, 0.3);
  color: var(--accent-text);
}

/* ── Admin Console (Ctrl+Shift+. , admins only) ──────────────── */
/* A plain tool, not a set piece: it wears the active palette's tokens, so it
   reads the same way in every theme. */
.admin-console-overlay {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(12px, 8vh, 90px) 16px 16px;
}
.admin-console-panel {
  width: 100%; max-width: 640px; box-sizing: border-box;
  display: flex; flex-direction: column; max-height: 70vh;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border); border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono, monospace); color: var(--text-primary); overflow: hidden;
}
.admin-console-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--glass-border);
  font-size: 10px; letter-spacing: 2px; color: var(--text-muted);
}
.admin-console-esc {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--glass-border); border-radius: 4px;
  font-family: inherit; font-size: 10px; letter-spacing: 1px; padding: 3px 8px; cursor: pointer;
}
.admin-console-esc:hover { color: var(--text-primary); border-color: var(--accent); }
.admin-console-log {
  flex: 1; overflow-y: auto; padding: 14px;
  font-size: 12.5px; line-height: 1.6; min-height: 120px;
}
.admin-console-line { white-space: pre-wrap; word-break: break-word; }
.acl-in  { color: var(--accent); }
.acl-out { color: var(--text-primary); }
.acl-err { color: var(--error); }
.admin-console-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--glass-border);
}
.admin-console-prompt { color: var(--accent); flex-shrink: 0; }
.admin-console-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: inherit; font-size: 13px; color: var(--text-primary); letter-spacing: 0.03em;
}
.admin-console-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.admin-console-input:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-glow);
  border-radius: 4px;
}
.admin-console-busy { color: var(--text-muted); flex-shrink: 0; }
.avatar-thread {
  background: rgba(124, 141, 181, 0.2);
  border: 1px solid rgba(124, 141, 181, 0.3);
  color: var(--stage-forecast);
}

/* Dropdown menu */
.dropdown-menu {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--sp-xs);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.dropdown-item:active {
  background: var(--glass-bg-hover);
}

/* ── Chat Detail Page ────────────────────────────────────────── */
.chat-detail-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.chat-detail-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.chat-detail-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-detail-subtitle {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Messages container */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-md) var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  -webkit-overflow-scrolling: touch;
  background: var(--bg-primary);
}

/* Message bubble row */
.chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-sm);
  max-width: 85%;
  transition: background 0.3s ease;
}
.chat-bubble-row.msg-highlight {
  background: rgba(255, 183, 77, 0.1);
  border-radius: var(--radius-md);
}

.chat-bubble-row--own {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble-row--claude {
  max-width: 90%;
}

.chat-bubble-avatar {
  flex-shrink: 0;
}

/* Bubble */
.chat-bubble {
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  min-width: 0;
  word-wrap: break-word;
}

.chat-bubble--own {
  background: var(--accent-soft);
  border-color: rgba(196, 62, 62, 0.2);
}

.chat-bubble--claude {
  background: linear-gradient(135deg, rgba(196, 62, 62, 0.08), rgba(196, 62, 62, 0.03));
  border-color: rgba(196, 62, 62, 0.15);
  border-left: 3px solid rgba(196, 62, 62, 0.4);
}

.chat-bubble-sender {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.chat-bubble--claude .chat-bubble-sender {
  color: var(--accent-text);
}

.chat-bubble-content {
  font-size: 0.9375rem;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--text-primary);
}

.chat-bubble-time {
  font-size: 0.625rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 2px;
}

/* Typing indicator */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: var(--sp-xs) 0;
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Claude thinking */
.chat-claude-thinking {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) 0;
}

.thinking-content {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.8125rem;
  color: var(--accent-text);
  font-style: italic;
}

/* Chat input bar */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  border-top: 1px solid var(--glass-border);
  background: var(--bg-primary);
  flex-shrink: 0;
}

/* Base glass trio + focus/placeholder: see canonical text input block
   near .form-input. */
.chat-input {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  padding: 10px var(--sp-md);
  border-radius: var(--radius-md);
  resize: none;
  line-height: 1.4;
}

.chat-send-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
}

/* @mention autocomplete popup — anchored above the chat input bar. */
.mention-popup {
  position: absolute;
  bottom: calc(100% + 4px);
  left: var(--sp-md);
  min-width: 220px;
  max-width: calc(100% - var(--sp-md) * 2);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.2;
}
.mention-item--active,
.mention-item:hover {
  background: var(--glass-bg-hover);
}
.mention-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Pipeline Page ────────────────────────────────────────────── */
.pipeline-tabs {
  display: flex;
  gap: var(--sp-sm);
  overflow-x: auto;
  padding-bottom: var(--sp-sm);
  margin-bottom: var(--sp-lg);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pipeline-tabs::-webkit-scrollbar { display: none; }

.pipeline-category-chips {
  margin-top: calc(-1 * var(--sp-sm));
  margin-bottom: var(--sp-lg);
}

/* View row: a horizontally-scrolling group (view tabs + department toggle)
   plus a fixed trailing Category pill. With 9+ chips the group would clip on
   mobile (the dept toggle squeezed out "Mine"); scrolling the group keeps every
   chip reachable. Category stays OUTSIDE the scroller so its dropdown isn't
   clipped by overflow. */
.pipeline-view-row {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-lg);
}

/* The scrolling part: view tabs + dept toggle in one swipeable strip. */
.pipeline-view-scroll {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pipeline-view-scroll::-webkit-scrollbar { display: none; }

.pipeline-view-scroll .pipeline-tabs {
  flex: 0 0 auto;
  overflow-x: visible;
  margin-bottom: 0;
  padding-bottom: 0;
}
.pipeline-view-scroll .pipeline-tabs .chip,
.pipeline-view-scroll .pipeline-dept-toggle,
.pipeline-view-scroll .pipeline-dept-toggle .chip {
  flex-shrink: 0;
}

.pipeline-view-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* Filter row under the view row: search + due window + sort. Client-side
   over the loaded board, so it stacks with every server-side scope. */
.pipeline-filter-row {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--sp-sm));
  margin-bottom: var(--sp-md);
}
.pipeline-search {
  position: relative;
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 360px;
}
.pipeline-search .form-input {
  height: 32px;
  padding: 0 30px;
  font-size: 0.8125rem;
}
.pipeline-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.pipeline-search-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.pipeline-search-clear:hover { color: var(--text-primary); }
.pipeline-filter-count {
  margin-left: var(--sp-xs);
  white-space: nowrap;
}

/* Delivered-media thumbs on the project-detail Social Posts card: hover
   reveals a remove ✕ so a file can be swapped out after delivery. */
.social-asset-thumb {
  position: relative;
  display: inline-block;
}
.social-asset-thumb--busy { opacity: 0.4; pointer-events: none; }
.social-asset-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
}
.social-asset-thumb:hover .social-asset-remove,
.social-asset-remove:focus-visible { opacity: 1; }
.social-asset-remove:hover { color: var(--danger); }
@media (hover: none) { .social-asset-remove { opacity: 1; } }

.pipeline-view-actions .active {
  color: var(--accent-text);
}

/* Board / List mode toggle — segmented icon pair in the view-actions cluster */
.board-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  margin-right: var(--sp-xs);
}

.board-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.board-mode-btn:hover {
  color: var(--text-primary);
}

.board-mode-btn.active {
  background: var(--accent-soft, rgba(196, 62, 62, 0.12));
  color: var(--accent, #c43e3e);
}

/* ── Pipeline list view ─────────────────────────────────────
   Flat rows across all stages — alternative to the kanban/stacked board. */
.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

.pipeline-list-group {
  display: flex;
  flex-direction: column;
}

/* Sticky so the phase you're scrolling through stays named. .app-header is
   position:relative (it scrolls away), so top:0 is the viewport edge. */
.pipeline-list-group-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) 0;
  margin-bottom: var(--sp-xs);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-primary);
}
.pipeline-list-group-header svg {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-out);
}

/* Stage-coloured rail replaces the per-row stage badge — same colour cue,
   84px less repetition on every single row. */
.pipeline-list-group-rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  padding-left: var(--sp-sm);
  border-left: 2px solid color-mix(in srgb, var(--group-stage) 55%, transparent);
}

.pipeline-list-item {
  display: flex;
  flex-direction: column;
}

/* One line, ~34px. Ministry/category/series moved to the detail panel —
   that second line was most of the row's height on every project. */
.pipeline-list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 5px var(--sp-sm);
  min-height: 34px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.pipeline-list-row > .badge {
  flex-shrink: 0;
}

.pipeline-list-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-out);
}
.pipeline-list-chevron--open {
  transform: rotate(90deg);
}

.pipeline-list-name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
}
@media (hover: hover) {
  .pipeline-list-name:hover { text-decoration: underline; }
}

/* Pushes dates/crew/priority to the right without the name having to grow */
.pipeline-list-spacer {
  flex: 1 1 auto;
  min-width: var(--sp-xs);
}

.pipeline-list-when {
  flex-shrink: 0;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── Expanded detail panel ─────────────────────────────────────── */
/* Reads as attached to its row: the row flattens its bottom corners and the
   panel picks up the same glass surface. */
.pipeline-list-item--open .pipeline-list-row {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.pipeline-list-detail {
  padding: var(--sp-sm) var(--sp-md) var(--sp-md) calc(var(--sp-md) + 12px);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* Flex, not grid: facts pack left at their natural width instead of being
   stretched across equal columns with holes between them. */
.pipeline-list-detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs) var(--sp-lg);
}

.pl-fact {
  display: flex;
  align-items: baseline;
  gap: var(--sp-xs);
  min-width: 0;
}
.pl-fact-label {
  flex-shrink: 0;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pipeline-list-detail-crew {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
  margin-top: var(--sp-sm);
}
.pl-crew-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 2px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.pl-crew-role {
  color: var(--text-muted);
}

.pipeline-list-detail-actions {
  display: flex;
  gap: var(--sp-xs);
  margin-top: var(--sp-md);
}

.pipeline-list-crew {
  display: flex;
  flex-shrink: 0;
}

.pipeline-list-row .quick-edit-btn {
  flex-shrink: 0;
}

@media (hover: hover) {
  .pipeline-list-row:hover .quick-edit-btn {
    opacity: 0.6;
  }
}

@media (max-width: 639px) {
  .pipeline-list-crew {
    display: none;
  }
  /* Phone: the rail alone carries the phase, indentation costs real width */
  .pipeline-list-group-rows {
    padding-left: var(--sp-xs);
  }
  .pipeline-list-detail {
    padding-left: var(--sp-sm);
  }
  .pipeline-list-detail-facts {
    gap: var(--sp-xs) var(--sp-md);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   HOLDOUT TAB BARS — pipeline stage filter and booking page
   THE tab primitive is .tabs / .tab / .tab.is-active in components.css;
   every other bar in the app now uses it. These two keep their own
   classes because each carries structure the primitive does not: the
   stage filter has a count pill bound to the active tab, and the booking
   row is auto-width with the underline on the container. They share the
   primitive's look through the rules below — migrate them when their
   markup is next touched. (2026-09-13 audit §6)
   ═══════════════════════════════════════════════════════════════════ */
.pipeline-stage-tab,
.booking-tab {
  padding: var(--sp-sm) var(--sp-md);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  position: relative;
  transition: color 0.15s, border-color 0.15s;
}

.pipeline-stage-tab:hover,
.booking-tab:hover {
  color: var(--text-primary);
}

.pipeline-stage-tab.active,
.booking-tab.active {
  background: none;
  color: var(--text-primary);
  border-bottom-color: var(--accent, #c43e3e);
}

/* Layout mode: equal-stretch, centered, single-line (unchanged sizing) */
.pipeline-stage-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════════════════ */

/* Stage filter tabs — mobile only */
/* Stage filter tabs — matches the .tabs pattern */
.pipeline-stage-tabs {
  display: flex;
  gap: 0;
  padding: 0 var(--sp-md);
  border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
  background: var(--bg-primary);
  margin-bottom: var(--sp-md);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pipeline-stage-tabs::-webkit-scrollbar { display: none; }

.pipeline-stage-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--glass-bg);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pipeline-stage-tab.active .pipeline-stage-tab-count {
  background: var(--accent-soft, rgba(196, 62, 62, 0.12));
  color: var(--accent, #c43e3e);
}

/* Collapsible filter drawer (mobile) */
.pipeline-filter-drawer {
  margin-bottom: var(--sp-md);
  overflow: hidden;
}

/* Desktop: always show category + saved views, hide mobile-only elements */
.pipeline-desktop-filters {
  display: none;
}

/* (Removed old desktop filter overrides — category filter is now a single
   pill in .pipeline-view-actions, visible at all breakpoints.) */

.chip-sm {
  font-size: 0.6875rem;
  padding: var(--sp-xs) var(--sp-sm);
}

.pipeline-tab {
  flex-shrink: 0;
}

.pipeline-stage {
  margin-bottom: var(--sp-xl);
}

.pipeline-stage-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
  user-select: none;
  -webkit-user-select: none;
}
.pipeline-stage-header svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.pipeline-stage-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Drag-and-drop states */
.project-card {
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}
.project-card--dragging {
  transform: scale(1.03);
  opacity: 1;
  box-shadow: 0 0 0 2px var(--accent, #c43e3e),
              0 8px 32px rgba(196, 62, 62, 0.25);
  z-index: 10;
  position: relative;
  animation: card-pulse 1.5s ease-in-out infinite;
}
.project-card--sibling-dim {
  opacity: 0.35;
  transform: scale(0.97);
}
@keyframes card-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent, #c43e3e), 0 8px 32px rgba(196, 62, 62, 0.25); }
  50% { box-shadow: 0 0 0 2px var(--accent, #c43e3e), 0 8px 40px rgba(196, 62, 62, 0.4); }
}
/* Card fly-away on successful drop */
.project-card--dropping {
  transform: scale(0.8);
  opacity: 0;
  transition: transform 300ms var(--ease-out), opacity 300ms var(--ease-out);
}
/* Stale: left-border strip + faint tint so a bottleneck reads from across
   the kanban without opening the risks panel. */
.project-card--stale {
  box-shadow: inset 3px 0 0 0 var(--severity-warning);
  background: color-mix(in srgb, var(--severity-warning) 5%, transparent);
}
.pipeline-stage--drag-valid {
  border-radius: var(--radius-md);
  background: rgba(196, 62, 62, 0.06);
  box-shadow: inset 0 0 0 2px var(--accent);
  transition: all var(--duration-fast) var(--ease-out);
}
.pipeline-stage--drag-invalid {
  border-radius: var(--radius-md);
  background: rgba(255, 80, 80, 0.04);
  box-shadow: inset 0 0 0 2px rgba(255, 80, 80, 0.3);
  transition: all var(--duration-fast) var(--ease-out);
}
/* Desktop: grab cursor for drag */
@media (min-width: 1024px) {
  .project-card[draggable="true"] {
    cursor: grab;
  }
  .project-card[draggable="true"]:active {
    cursor: grabbing;
  }
}

/* Mobile move bar (long-press) */
.move-bar {
  position: fixed;
  bottom: calc(var(--nav-height, 64px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + var(--sp-md));
  left: var(--sp-md);
  right: var(--sp-md);
  z-index: 250;
  background: var(--bg-secondary, var(--glass-bg));
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  box-shadow: var(--shadow-md);
  animation: move-bar-in 350ms var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
}
@keyframes move-bar-in {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.move-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-sm);
}
.move-bar-targets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}
.move-bar-chip {
  cursor: pointer;
  padding: var(--sp-sm) var(--sp-lg) !important;
  font-size: 0.875rem !important;
  animation: chip-pop 300ms var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
  animation-delay: calc(var(--chip-i, 0) * 60ms + 150ms);
}
@keyframes chip-pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.move-bar-chip:active {
  transform: scale(0.92);
}
/* Hide move bar on desktop (use native drag instead) */
@media (min-width: 1024px) {
  .move-bar { display: none; }
}

/* ── Kanban Board ──────────────────────────────────────────────── */
/* Hidden on mobile — shown via desktop media query */
.kanban-board { display: none; }

.project-card {
  padding: var(--sp-lg);
  margin-bottom: var(--sp-sm);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.project-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-sm);
}

/* The title keeps at least 9rem; when a card is narrower than title + badges
   (phones, tight columns) the badge row wraps underneath instead of squeezing
   the title to one word per line. */
.project-card-name {
  font-size: 0.9375rem;
  font-weight: 500;
  flex: 1 1 9rem;
  min-width: 0;
}

.project-card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-xs);
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}

/* Series names run long — ellipsize rather than push the title around */
.badge-series {
  display: inline-block;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-priority {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.6875rem;
}

/* ── Series Shelf ─────────────────────────────────────────── */
.series-shelf {
  margin-bottom: var(--sp-md);
}

.series-shelf-label {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: var(--sp-sm);
}

.series-shelf-scroll {
  display: flex;
  gap: var(--sp-sm);
  overflow-x: auto;
  padding-bottom: var(--sp-xs);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.series-shelf-card {
  min-width: 200px;
  max-width: 360px;
  width: max-content;
  flex-shrink: 0;
  padding: var(--sp-sm) var(--sp-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}

.series-shelf-card:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-1px);
}

.series-shelf-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.series-shelf-card-meta {
  display: flex;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-xs);
  white-space: nowrap;
}

.series-shelf-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: var(--sp-xs);
}

.series-shelf-stage {
  display: flex;
}

.series-shelf-bar {
  height: 3px;
  background: var(--glass-border);
  border-radius: 2px;
  overflow: hidden;
}

.series-shelf-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--duration-normal) var(--ease-out);
}

/* Desktop: horizontal scroll row */
@media (min-width: 1024px) {
  .series-shelf-card {
    min-width: 220px;
    max-width: 360px;
  }
}

/* ── Meeting Recording ────────────────────────────────────── */
.recording-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.recording-dot.pulse {
  animation: recording-pulse 1.2s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.meeting-brief-content {
  font-size: 0.8125rem !important;
  line-height: 1.3 !important;
  color: var(--text-primary);
  padding: 8px 10px !important;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}
.meeting-brief-content * {
  line-height: 1.3 !important;
}
.meeting-brief-content strong { color: var(--text-primary); }
.meeting-brief-content h1, .meeting-brief-content h2, .meeting-brief-content h3, .meeting-brief-content h4 {
  font-size: 0.75rem !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin: 6px 0 1px !important;
  padding: 0 !important;
}
.meeting-brief-content h1:first-child, .meeting-brief-content h2:first-child, .meeting-brief-content h3:first-child {
  margin-top: 0 !important;
}
.meeting-brief-content p {
  margin: 0 0 2px !important;
  padding: 0 !important;
}
.meeting-brief-content ul, .meeting-brief-content ol {
  margin: 0 0 2px !important;
  padding-left: 1.2em !important;
}
.meeting-brief-content li {
  margin-bottom: 0 !important;
  padding: 0 !important;
}
.meeting-brief-content hr {
  border: none !important;
  border-top: 1px solid var(--glass-border) !important;
  margin: 4px 0 !important;
  padding: 0 !important;
}
.meeting-brief-content blockquote {
  margin: 1px 0 2px !important;
  padding: 2px 8px !important;
  border-left: 2px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.8rem !important;
}

.meeting-card {
  transition: background var(--duration-fast) var(--ease-out);
}

.meeting-card:hover {
  background: var(--glass-bg-hover);
}

/* ── Series Kanban (inside series detail) ─────────────────── */
.series-kanban {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.series-kanban-column {
  margin-bottom: var(--sp-xs);
}

.series-kanban-column-header {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-xs);
}

.series-kanban-card {
  cursor: pointer;
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease-out);
}

.series-kanban-card:hover {
  background: var(--glass-bg-hover);
}

.series-kanban-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.series-kanban-card-meta {
  display: flex;
  gap: var(--sp-sm);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.series-kanban-card-crew {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}

/* Desktop: horizontal kanban columns */
@media (min-width: 1024px) {
  .series-kanban {
    flex-direction: row;
    gap: var(--sp-md);
    overflow-x: auto;
    padding-bottom: var(--sp-xs);
  }

  .series-kanban-column {
    min-width: 160px;
    flex: 1;
    margin-bottom: 0;
  }
}

/* ── Series Stack ──────────────────────────────────────────── */
.series-stack {
  border-radius: var(--radius-md);
}

.series-stack-header {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: background var(--duration-fast) var(--ease-out);
}

.series-stack-header:hover {
  background: var(--glass-bg-hover);
}

.series-stack-chevron {
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

.series-stack-chevron--open {
  transform: rotate(180deg);
}

.series-stack-name {
  font-size: 0.8125rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-stack-count {
  background: var(--glass-bg);
  font-size: 0.625rem;
  flex-shrink: 0;
}

.series-stack-cards {
  padding-left: var(--sp-md);
  border-left: 2px solid var(--glass-border);
  margin-left: var(--sp-md);
  margin-top: var(--sp-xs);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.project-card--series-child {
  border-left: none;
}

.badge-sm {
  font-size: 0.625rem;
  padding: 2px 6px;
}

.badge-lg {
  font-size: 0.8125rem;
  padding: 4px 12px;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.project-card-ministry {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.project-card-crew {
  display: flex;
  gap: 4px;
  margin-top: var(--sp-sm);
}

.avatar-xs {
  width: 22px;
  height: 22px;
  font-size: 0.5625rem;
}

.project-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--sp-sm);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--glass-border);
}

/* ── Project Detail ──────────────────────────────────────────── */
.detail-header-compact {
  margin-bottom: var(--sp-sm);
}

.detail-header-top {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-bottom: var(--sp-sm);
}

.detail-badges {
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
  align-items: center;
}

.detail-ministry-inline {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-left: auto;
}

.detail-header-actions {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
  flex-wrap: wrap;
}

.detail-section {
  margin-bottom: var(--sp-xl);
}

/* Desktop column wrappers are invisible on mobile — children flow as
   normal siblings of the overview tab. */
.detail-col {
  display: contents;
}

.detail-fields {
  padding: 0;
}

/* Stacked dates layout */
.dates-stack {
  display: flex;
  flex-direction: column;
  padding: 0;
}
.dates-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
}
.dates-row:last-child { border-bottom: none; }
.dates-row--editable { cursor: pointer; }
.inline-date-edit { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; margin-left: var(--sp-sm); }
.inline-date-edit .inline-input { margin-top: 0; }
.inline-date-actions { display: flex; gap: 2px; flex-shrink: 0; }
.inline-date-actions .btn { padding: 4px; }
.dates-row--editable:hover { background: var(--glass-bg-hover); }
.dates-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 80px;
}
.dates-value {
  font-size: 0.9375rem;
  color: var(--text-primary);
  text-align: right;
}
.dates-edit-row {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
  margin-left: var(--sp-sm);
}

/* Deliverables (graphics) — rows carry the horizontal inset like .dates-row so
   content doesn't skirt the card edge; the card itself has no padding. */
.deliverables-stack {
  display: flex;
  flex-direction: column;
  padding: 0;
}
.deliverables-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
}
.deliverables-row:last-of-type { border-bottom: none; }
.deliverables-check { flex-shrink: 0; cursor: pointer; }
.deliverables-info { flex: 1; min-width: 0; }
.deliverables-name {
  font-size: 0.9375rem;
  color: var(--text-primary);
  word-break: break-word;
}
.deliverables-name--done {
  text-decoration: line-through;
  color: var(--text-tertiary);
}
.deliverables-size {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 1px;
}
.deliverables-remove { flex-shrink: 0; padding: 2px; color: var(--text-tertiary); }
.deliverables-empty {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  padding: var(--sp-sm) var(--sp-lg);
}
/* The add row sits under a top divider and gets the same inset as the rows. */
.deliverables-add {
  display: flex;
  gap: var(--sp-xs);
  align-items: center;
  padding: var(--sp-sm) var(--sp-lg);
  border-top: 1px solid var(--glass-border);
}
.deliverables-add .inline-input { flex: 2; }
.deliverables-add .deliverables-add-size { flex: 1; }

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
}

.detail-field:last-child {
  border-bottom: none;
}

.detail-field-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-field-value {
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.detail-field-value--pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-field-label--toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  user-select: none;
}

/* Scoring grid */
.scoring-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm);
}

.score-card {
  padding: var(--sp-sm) var(--sp-xs);
  text-align: center;
}

.score-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--sp-xs);
}

.score-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Crew list */
.crew-list {
  padding: 0;
}

.crew-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
}

.crew-item:last-child {
  border-bottom: none;
}

.crew-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crew-name {
  font-size: 0.9375rem;
  font-weight: 500;
}

.crew-phase {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Timeline */
.timeline {
  padding: var(--sp-md) var(--sp-lg);
}

.timeline-item {
  display: flex;
  gap: var(--sp-md);
  padding-bottom: var(--sp-md);
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--glass-border);
}

.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-stage {
  font-size: 0.875rem;
  font-weight: 500;
}

.timeline-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Stage-colored dots */
.bg-stage-forecast { background: var(--stage-forecast); }
.bg-stage-intake { background: var(--stage-intake); }
.bg-stage-preproduction { background: var(--stage-preproduction); }
.bg-stage-production { background: var(--stage-production); }
.bg-stage-post { background: var(--stage-post); }
.bg-stage-review { background: var(--stage-review); }
.bg-stage-completion { background: var(--stage-completion); }

/* ── Inline Editing ─────────────────────────────────────────── */
.detail-field--editable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease-out);
}

.detail-field--editable:hover {
  background: var(--glass-bg-hover);
}

/* Pencil icon hint on hover (desktop only) */
@media (hover: hover) {
  .detail-field--editable {
    position: relative;
  }
  .detail-field--editable::after {
    content: '';
    position: absolute;
    right: var(--sp-md);
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M17 3a2.85 2.85 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-out);
    pointer-events: none;
  }
  .detail-field--editable:hover::after {
    opacity: 0.5;
  }
}

.inline-input {
  margin-top: 2px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.detail-field .inline-input[type="date"] {
  font-size: 0.875rem;
  -webkit-appearance: none;
  appearance: none;
}
.detail-field {
  overflow: hidden;
}

/* AI Description Suggestion Card */
/* Approval gate card (prominent CTA for pending approvals) */
.approval-gate-card {
  margin: var(--sp-sm) 0 var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: rgba(255, 183, 77, 0.08);
  border: 1px solid rgba(255, 183, 77, 0.25);
  border-radius: var(--radius-md);
}
.approval-gate-header {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-sm);
  color: var(--color-warning, #ffb74d);
}
.approval-gate-title {
  font-size: 0.875rem;
  font-weight: 600;
}
.approval-gate-prompt {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-md);
}
.approval-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.ai-description-card {
  margin: var(--sp-sm) var(--sp-lg) var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: rgba(196, 62, 62, 0.06);
  border: 1px solid rgba(196, 62, 62, 0.2);
  border-radius: var(--radius-md);
}

.ai-description-header {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-md);
}

.ai-description-text {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: var(--sp-md);
}

.ai-description-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--sp-md);
}

.ai-description-actions {
  display: flex;
  gap: var(--sp-md);
  padding-top: var(--sp-md);
  margin-top: var(--sp-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.ai-description-actions .btn {
  min-width: 80px;
}

/* Score card editable */
.score-card--editable {
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.score-card--editable:hover {
  background: var(--glass-bg-hover);
}

.score-input {
  width: 100%;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  margin-bottom: var(--sp-xs);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  color: var(--text-primary);
  font-family: var(--font-ui);
  outline: none;
  -moz-appearance: textfield;
}

.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Toggle badges for flags */
.badge-toggle {
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  transition: all var(--duration-fast) var(--ease-out);
}

.badge-toggle:active {
  transform: scale(0.95);
}

.badge-toggle--off {
  background: transparent;
  border-color: var(--glass-border);
  color: var(--text-muted);
  opacity: 0.6;
}

.badge-toggle--off:hover {
  opacity: 0.8;
}

/* Small icon button for pipeline card pencil — scoped to icon-only buttons */
.btn-icon.btn-xs {
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* Quick edit pencil on pipeline cards */
.quick-edit-btn {
  opacity: 0.3;
  transition: opacity var(--duration-fast) var(--ease-out);
}

@media (hover: hover) {
  .quick-edit-btn {
    opacity: 0;
  }
  .project-card:hover .quick-edit-btn {
    opacity: 0.6;
  }
  .quick-edit-btn:hover {
    opacity: 1 !important;
  }
}

/* Quick edit modal — narrower than standard */
.quick-edit-modal {
  max-width: 360px;
}

/* ── Edit / Form Styles ─────────────────────────────────────── */
.edit-form {
  padding: var(--sp-xl);
}

.form-group {
  margin-bottom: var(--sp-lg);
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-xs);
}

/* ═══════════════════════════════════════════════════════════════════
   CANONICAL TEXT INPUT — shared glass trio (bg/border/radius)
   Base look for every bespoke text input in the app. Per-class blocks
   further down override ONLY genuine differences: font-size steps,
   padding for compact contexts, and the search inputs' intentional
   borderless style (.global-search-input opts out of bg/border by
   design and keeps its own already-equivalent focus-visible ring).
   ═══════════════════════════════════════════════════════════════════ */
.form-input,
.chat-input,
.modal-card .input,
.booking-input,
.sidebar-chat-textarea,
.sidebar-search-input,
.header-search-input,
.scratch-pad-editor,
.home-sidebar-chat-input textarea {
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.form-input::placeholder,
.chat-input::placeholder,
.modal-card .input::placeholder,
.booking-input::placeholder,
.sidebar-chat-textarea::placeholder,
.sidebar-search-input::placeholder,
.header-search-input::placeholder,
.scratch-pad-editor::placeholder,
.home-sidebar-chat-input textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.chat-input:focus,
.modal-card .input:focus,
.booking-input:focus,
.sidebar-chat-textarea:focus,
.sidebar-search-input:focus,
.header-search-input:focus,
.scratch-pad-editor:focus,
.home-sidebar-chat-input textarea:focus {
  border-color: var(--accent);
}

/* Same focus-visible ring everywhere (keyboard focus only). */
.form-input:focus-visible,
.chat-input:focus-visible,
.modal-card .input:focus-visible,
.booking-input:focus-visible,
.sidebar-chat-textarea:focus-visible,
.sidebar-search-input:focus-visible,
.header-search-input:focus-visible,
.scratch-pad-editor:focus-visible,
.home-sidebar-chat-input textarea:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
/* ═══════════════════════════════════════════════════════════════════ */

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

select.form-input,
.modal-card select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  /* minmax(0, …): a date/time input has an intrinsic width and would
     otherwise push its column past the card instead of shrinking */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-md);
}
@media (max-width: 520px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
}

.form-actions {
  display: flex;
  gap: var(--sp-sm);
  justify-content: flex-end;
  padding-top: var(--sp-lg);
  border-top: 1px solid var(--glass-border);
}

/* ── File Upload ─────────────────────────────────────────────── */
.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: var(--sp-lg) var(--sp-md);
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.file-drop-zone:hover,
.file-drop-zone--active {
  border-color: var(--accent);
  background: rgba(196, 62, 62, 0.05);
}
.file-list { display: flex; flex-direction: column; gap: 4px; }
.file-list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 6px var(--sp-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}
.file-list-icon { flex-shrink: 0; font-size: 1rem; line-height: 1; }
.file-list-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-list-size { flex-shrink: 0; }

/* ── Modal ───────────────────────────────────────────────────── */
/* Canonical .modal-overlay/.modal/.modal-header/.modal-body/.modal-footer
   definitions live in components.css — this page-local copy was overriding
   them with a stale z-index (100, under header/FAB/bottom-nav) and a
   shrunken max-width. Deleted; components.css wins now. */

/* ── Calendar Page ────────────────────────────────────────────── */
/* Event-type colours. Dark defaults; light themes darken them so tinted chips
   stay legible on cream/white; cadence follows the OS scheme like its own tokens. */
:root {
    --cal-film: #4fc3f7;
    --cal-play: #ffd166;
    --cal-deadline: var(--accent);
    --cal-block: #8a8a8a;
    --cal-weekend: rgba(255, 255, 255, 0.025);
}
[data-theme="light"], [data-theme="asana"], [data-theme="perimeter"] {
    --cal-film: #1f8fc4;
    --cal-play: #a67c0c;
    --cal-block: #6e6358;
    --cal-weekend: rgba(120, 90, 60, 0.05);
}
@media (prefers-color-scheme: light) {
    [data-theme="system"] {
        --cal-film: #1f8fc4;
        --cal-play: #a67c0c;
        --cal-block: #6e6358;
        --cal-weekend: rgba(120, 90, 60, 0.05);
    }
}
[data-theme="cadence"], [data-theme="clean-dark"] {
    --cal-film: light-dark(#1f8fc4, #4fc3f7);
    --cal-play: light-dark(#a67c0c, #ffd166);
    --cal-block: light-dark(#6e6358, #8a8a8a);
    --cal-weekend: light-dark(rgba(22, 35, 47, 0.03), rgba(255, 255, 255, 0.025));
}

/* Toolbar under the page header: view toggle + layer legend. Stacked on
   phones; one row on desktop (see the desktop block further down). */
.cal-toolbar {
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-md);
}

/* Mobile: no special layout wrapper behavior */
.cal-desktop-right { display: contents; }
.cal-detail-placeholder { display: none; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
}
.cal-grid--header { margin-bottom: 2px; }

/* Swipe slide animations */
@keyframes cal-slide-left {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cal-slide-right {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
.cal-grid.cal-swipe-left  { animation: cal-slide-left 0.2s ease-out; }
.cal-grid.cal-swipe-right { animation: cal-slide-right 0.2s ease-out; }
.cal-header-cell {
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: var(--sp-xs) 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cal-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 4px 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
    position: relative;
    min-height: 44px;
}
.cal-cell:active { background: var(--glass-bg); }
.cal-cell--empty { cursor: default; }
/* Days of the previous/next month that pad the grid out to full weeks */
.cal-cell--out { cursor: default; }
.cal-cell--out .cal-day-num { color: var(--text-muted); font-weight: 400; }
.cal-cell--today .cal-day-num {
    background: var(--accent);
    color: var(--accent-on);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.cal-cell--selected {
    background: var(--glass-bg);
    box-shadow: inset 0 0 0 1px var(--glass-border);
}
.cal-cell--has-events .cal-day-num { font-weight: 600; }
.cal-day-num {
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1;
}
.cal-dots {
    display: flex;
    gap: 3px;
    margin-top: 3px;
    flex-wrap: wrap;
    justify-content: center;
}
.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}
.cal-dot--film { background: var(--cal-film); }
.cal-dot--deadline { background: var(--cal-deadline); }
.cal-dot--play { background: var(--cal-play); }
.cal-dot--personal { background: var(--event-color-3); }
.cal-dot--block { background: var(--cal-block); }
.cal-dot-overflow {
    /* Compromise floor — this sits in a cramped calendar day cell next to
       5px event dots; 0.6875rem overflows that space. */
    font-size: 0.625rem;
    color: var(--text-secondary);
    line-height: 1;
}

/* Named event chips — desktop month cells and the this-week agenda.
   Studio work (film / deadline / play) is a tinted pill; blocks and personal
   feed items are a dot and plain text so they read as background. */
.cal-chips {
    display: none;   /* phones keep the dots; the desktop block turns these on */
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.cal-chip {
    --c: var(--cal-deadline);
    display: flex;
    align-items: center;
    gap: 5px;
    height: 20px;
    padding: 0 6px;
    border-radius: 4px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 16%, transparent);
}
.cal-chip--film { --c: var(--cal-film); }
.cal-chip--play { --c: var(--cal-play); }
.cal-chip--deadline { --c: var(--cal-deadline); }
.cal-chip--block { --c: var(--cal-block); }
/* personal chips get --c inline from the feed colour */
.cal-chip--block, .cal-chip--personal {
    background: transparent;
    color: var(--text-primary);
    font-weight: 400;
    padding-left: 4px;
}
.cal-chip--block::before, .cal-chip--personal::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c);
    flex-shrink: 0;
}
.cal-chip-time {
    color: var(--text-secondary);
    font-weight: 400;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.cal-chip-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-chip--lg { height: 24px; cursor: pointer; }
.cal-chip-more {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    padding: 1px 6px;
}

/* This-week agenda in the desktop side column (no day selected) */
.cal-agenda-day {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding: var(--sp-sm) 0;
    cursor: pointer;
}
.cal-agenda-day + .cal-agenda-day { border-top: 1px solid var(--glass-border); }
.cal-agenda-label {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.cal-agenda-label small {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.cal-agenda-label b {
    font-size: 1.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}
.cal-agenda-day--today .cal-agenda-label small,
.cal-agenda-day--today .cal-agenda-label b { color: var(--accent); }
.cal-agenda-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.cal-agenda-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    align-self: center;
}
.cal-detail-placeholder-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: var(--sp-xl);
    opacity: 0.4;
}

/* Layer toggle chips */
.cal-layers-wrap {
    margin-bottom: 0;
}

.cal-layers-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.8125rem;
    font-family: var(--font-ui);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--duration-fast), border-color var(--duration-fast);
}
.cal-layers-toggle:hover {
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}
.cal-layers-toggle svg {
    flex-shrink: 0;
    transition: transform var(--duration-fast);
}
.cal-layers-count {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.cal-layers {
    display: flex;
    gap: var(--sp-xs);
    padding-top: var(--sp-sm);
    flex-wrap: wrap;
}
.cal-layer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast);
    opacity: 0.5;
}
.cal-layer-chip--active {
    opacity: 1;
    color: var(--text-primary);
    border-color: var(--text-secondary);
    background: var(--glass-bg);
}
.cal-layer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cal-layer-dot--film { background: var(--cal-film); }
.cal-layer-dot--deadline { background: var(--cal-deadline); }
.cal-layer-dot--play { background: var(--cal-play); }
.cal-layer-dot--personal { background: var(--event-color-3); }
.cal-layer-dot--block { background: var(--cal-block); }

/* Selected day detail panel */
.cal-detail {
    margin-top: var(--sp-md);
    padding-top: var(--sp-md);
    border-top: 1px solid var(--glass-border);
}
.cal-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: var(--sp-sm);
}
.cal-detail-empty {
    padding: var(--sp-md) 0;
    text-align: center;
}
.cal-event-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--sp-sm) var(--sp-md);
    margin-bottom: var(--sp-sm);
    cursor: pointer;
    transition: transform var(--duration-fast);
}
.cal-event-card:active { transform: scale(0.98); }
.cal-event-row {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}
.cal-event-type {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.cal-event-type--film { color: var(--cal-film); }
.cal-event-type--deadline { color: var(--cal-deadline); }
.cal-event-type--play { color: var(--cal-play); }
.cal-event-type--personal { color: var(--event-color-3); }
.cal-event-type--block { color: var(--cal-block); }
.cal-event-name {
    font-weight: 600;
    font-size: 0.875rem;
}
.cal-event-meta {
    margin-top: 2px;
}
.cal-event-remove {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--duration-fast) var(--ease-out);
}
.cal-event-remove:hover,
.cal-event-remove:active {
    opacity: 1;
    color: var(--danger, #e55);
}

/* Calendar create toggle */
.cal-toggle {
    display: inline-flex;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
    flex-shrink: 0;
}
.cal-toggle--on {
    background: var(--accent);
    border-color: var(--accent);
}
.cal-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-inverse);
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-fast) var(--ease-out);
}
.cal-toggle--on .cal-toggle-knob {
    transform: translateX(20px);
}

/* ── Settings / Me Page ───────────────────────────────────────── */
.me-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-lg) 0;
  text-align: center;
}

.me-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--sp-md);
}

.me-role {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: capitalize;
  margin-top: var(--sp-xs);
}

.me-avatar-wrap {
  position: relative;
  display: inline-block;
}

.me-avatar-wrap img.avatar {
  border-radius: 50%;
  object-fit: cover;
}

.me-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  color: var(--text-inverse);
}

.me-avatar-wrap:hover .me-avatar-overlay {
  opacity: 1;
}

/* ── Avatar Crop Modal ─────────────────────────────────────────── */
.avatar-crop-overlay {
  z-index: 9000;
}

.avatar-crop-modal {
  width: min(360px, 96vw);
  max-width: 100%;
}

.avatar-crop-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-lg) var(--sp-lg) 0;
}

.avatar-crop-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.avatar-crop-stage {
  position: relative;
  width: 280px;
  height: 280px;
  flex-shrink: 0;
}

.avatar-crop-canvas {
  display: block;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.avatar-crop-canvas:active {
  cursor: grabbing;
}

/* Decorative border ring around the circular crop area */
.avatar-crop-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
}

.avatar-crop-zoom {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  width: 100%;
  max-width: 280px;
  padding-bottom: var(--sp-sm);
}

.avatar-crop-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: var(--glass-border);
  outline: none;
  cursor: pointer;
}
.avatar-crop-slider:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* These were "0 1px 3px rgba(0,0,0,0.4)" — --shadow-sm (not md/lg) matches
   almost exactly; md/lg would balloon the shadow way past this 18px thumb. */
.avatar-crop-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary, #b5725a);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

.avatar-crop-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary, #b5725a);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: var(--shadow-sm);
}

/* iOS Safari: prevent canvas tap highlight */
.avatar-crop-canvas {
  -webkit-tap-highlight-color: transparent;
}

.settings-group {
  margin-bottom: var(--sp-md);
}

.settings-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-sm);
  padding-left: var(--sp-lg);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  text-align: left;
}

.settings-item:first-child {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.settings-item:last-child {
  border-bottom: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.settings-item-label {
  font-size: 0.9375rem;
}

.settings-item-value {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.settings-item--danger {
  color: var(--severity-critical);
}

/* Desktop settings: masonry-style columns */
@media (min-width: 1024px) {
  .settings-desktop-grid {
    columns: 2;
    column-gap: var(--sp-lg);
    margin-bottom: var(--sp-md);
  }
  .settings-desktop-grid .settings-group {
    break-inside: avoid;
    margin-bottom: var(--sp-md);
  }
}

/* Desktop detail form: property grid layout */
@media (min-width: 1024px) {
  .detail-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .detail-fields .detail-field {
    padding-left: var(--sp-xl);
    padding-right: var(--sp-xl);
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
  .detail-fields .detail-field-label {
    min-width: 100px;
    flex-shrink: 0;
  }
  .detail-fields .detail-field-value {
    text-align: right;
  }
  .detail-fields .detail-field:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .detail-fields .detail-field--full {
    grid-column: 1 / -1;
  }
  /* Document fields (brief, script): long prose, not label/value pairs —
     full width, label above, left-aligned */
  .detail-fields .detail-field--doc {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
  }
  .detail-fields .detail-field--doc .detail-field-value {
    text-align: left;
  }
}

/* ── Text Size Switcher ──────────────────────────────────────── */
.text-size-options {
  display: flex;
  gap: var(--sp-sm);
  justify-content: center;
}

.text-size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--radius-md);
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  max-width: 100px;
}

.text-size-btn:hover {
  border-color: var(--text-muted);
  background: var(--glass-bg-hover);
}

.text-size-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-primary);
}

.text-size-btn span:first-child {
  font-weight: 700;
  line-height: 1;
}

.text-size-label {
  font-size: 0.5625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.text-size-btn.active .text-size-label {
  color: var(--accent);
}

/* ── Font Pairing Switcher ───────────────────────────────────── */
.font-option {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-md);
  width: 100%;
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.font-option:last-of-type {
  border-bottom: none;
}

.font-option-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.font-option--active .font-option-radio {
  border-color: var(--accent);
}

.font-option-radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.font-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.font-option-label {
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: var(--font-ui);
}

.font-option-desc {
  font-size: 0.8125rem;
  line-height: 1.4;
}

.font-preview {
  border-radius: var(--radius-sm);
}

/* ── Theme Picker Grid ─────────────────────────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-md);
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-md);
  border-radius: var(--radius-md);
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.theme-option:hover {
  border-color: var(--text-muted);
  background: var(--glass-bg-hover);
}

.theme-option--active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-option-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.theme-option-desc {
  line-height: 1.3;
}

/* Mini theme previews */
.theme-preview {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(128,128,128,0.2);
}

.theme-preview-sidebar {
  width: 20%;
  flex-shrink: 0;
}

.theme-preview-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  justify-content: center;
}

.theme-preview-card {
  height: 8px;
  border-radius: 2px;
}

/* Preview color variants */
.theme-preview--dark {
  background: #161616;
}
.theme-preview--dark .theme-preview-sidebar {
  background: #1e1e1e;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.theme-preview--dark .theme-preview-card {
  background: rgba(255,255,255,0.06);
}

.theme-preview--clean-dark {
  background: #1a1a1a;
}
.theme-preview--clean-dark .theme-preview-sidebar {
  background: #222222;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.theme-preview--clean-dark .theme-preview-card {
  background: rgba(255,255,255,0.08);
}

.theme-preview--light {
  background: #ece5dc;
}
.theme-preview--light .theme-preview-sidebar {
  background: #e2d9cf;
  border-right: 1px solid rgba(120,90,60,0.1);
}
.theme-preview--light .theme-preview-card {
  background: rgba(255,252,248,0.55);
  border: 1px solid rgba(120,90,60,0.1);
}

.theme-preview--asana {
  background: #f5f4f3;
}
.theme-preview--asana .theme-preview-sidebar {
  background: #2e2e30;
  border-right: none;
}
.theme-preview--asana .theme-preview-card {
  background: #ffffff;
  border: 1px solid #e6e4e1;
}

.theme-preview--perimeter {
  background: #f7f8fa;
}
.theme-preview--perimeter .theme-preview-sidebar {
  background: #09243f;
  border-right: none;
}
.theme-preview--perimeter .theme-preview-card {
  background: #ffffff;
  border: 1px solid #d4d8de;
}
.theme-preview--cadence {
  background: #fbfcfd;
  border: 1px solid #dfe6ee;
}
.theme-preview--cadence .theme-preview-sidebar {
  background: #16232f;
  border-right: none;
}
.theme-preview--cadence .theme-preview-card {
  background: #ffffff;
  border: 1px solid #dfe6ee;
}
.theme-preview--cadence .theme-preview-card:first-child {
  background: #1c4e88;
  border-color: #1c4e88;
}
.theme-preview--cadence .theme-preview-card:last-child {
  border-left: 3px solid #b98a2f;
}

/* Empty state — see components.css for base styles */

/* ══════════════════════════════════════════════════════════════ */
/* ── Desktop Layouts (1024px+) ───────────────────────────────── */
/* ══════════════════════════════════════════════════════════════ */

@media (min-width: 1024px) {

  /* ── Dashboard Desktop ──────────────────────────────────────── */
  .home-stats {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .stat-card--desktop-only {
    display: block;
  }

  /* With sidebar present, dashboard goes single-column */
  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: var(--sp-xl);
  }

  .dashboard-grid-left,
  .dashboard-grid-right {
    display: flex;
    flex-direction: column;
    gap: var(--sp-xl);
  }

  .dashboard-grid-left > * + *,
  .dashboard-grid-right > * + * {
    padding-top: 0;
    border-top: none;
  }

  /* Hide sections that move to sidebar on desktop */
  .dash-desktop-hide { display: none !important; }

  /* Side-by-side cards on desktop */
  .dash-twin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-xl);
    align-items: start;
  }

  /* ── Calendar Desktop — side-by-side ──────────────────────── */
  .cal-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .cal-layers-toggle { display: none; }   /* legend chips stay open on desktop */
  .cal-layers { padding-top: 0; }

  .cal-desktop-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: var(--sp-xl);
    align-items: start;
  }
  .cal-desktop-left { min-width: 0; }

  /* One bordered month: header row + hairline cells, no gaps. Rows are
     sized to their content, not stretched to the window. */
  .cal-month {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-tertiary);
  }
  .cal-grid { gap: 0; }
  .cal-grid--header {
    margin-bottom: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
  }
  .cal-header-cell {
    text-align: left;
    padding: var(--sp-sm) 10px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
  }
  .cal-header-cell:not(:nth-child(7n)) { border-right: 1px solid var(--glass-border); }
  .cal-header-cell:first-child { color: var(--cal-play); }   /* Sunday: where things air */

  .cal-cell {
    aspect-ratio: auto;
    min-height: 112px;
    min-width: 0;
    align-items: stretch;
    gap: 3px;
    padding: 6px 6px 8px;
    border-radius: 0;
    border-bottom: 1px solid var(--glass-border);
  }
  .cal-cell:not(:nth-child(7n)) { border-right: 1px solid var(--glass-border); }
  .cal-cell:nth-last-child(-n+7) { border-bottom: none; }
  .cal-cell:nth-child(7n+1), .cal-cell:nth-child(7n) { background: var(--cal-weekend); }
  .cal-cell:not(.cal-cell--out):hover { background: var(--glass-bg-hover, var(--glass-bg)); }
  .cal-cell.cal-cell--selected, .cal-cell.cal-cell--selected:hover {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
  }
  .cal-day-num {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 2px 4px;
    margin-bottom: 2px;
    font-variant-numeric: tabular-nums;
  }
  .cal-cell--has-events .cal-day-num { font-weight: 500; color: var(--text-primary); }
  .cal-cell--today .cal-day-num {
    width: 22px;
    height: 22px;
    padding: 0;
    font-weight: 700;
    color: var(--accent-on);
  }
  .cal-dots { display: none; }
  .cal-chips { display: flex; }

  .cal-desktop-right {
    position: sticky;
    top: 0;
    border-left: 1px solid var(--glass-border);
    padding-left: var(--sp-xl);
    align-self: start;
    min-height: 300px;
  }
  .cal-detail { margin-top: 0; }
  .cal-detail-placeholder { display: block; }

  /* The side column needs room. Below ~1080px of content width (a 1440
     screen with the command center open) it drops under the grid. The
     query root is a plain wrapper — never .page-content, which holds
     position:fixed modals that layout containment would trap. */
  .cal-month-view { container: calmonth / inline-size; }
  @container calmonth (max-width: 1079px) {
    .cal-desktop-layout { grid-template-columns: minmax(0, 1fr); }
    .cal-desktop-right {
      position: static;
      border-left: none;
      padding-left: 0;
      min-height: 0;
      margin-top: var(--sp-md);
    }
  }
  /* Narrow cells drop the chip's start time so the name survives
     (container width is the cell's content box: ~112px outer) */
  .cal-cell { container: calcell / inline-size; }
  @container calcell (max-width: 99px) {
    .cal-chips .cal-chip-time { display: none; }
  }

  /* ── Capacity Heatmap Desktop ────────────────────────────── */
  .cap-heatmap-cell {
    aspect-ratio: auto;
    min-height: 48px;
  }

  /* ── Pipeline Desktop ──────────────────────────────────────── */
  .pipeline-stage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--sp-sm);
  }

  /* Hide stacked view on desktop when kanban is active (no stage filter) */
  .pipeline-stacked { display: none; }
  .pipeline-stacked--active { display: block; }

  /* ── Kanban Board ──────────────────────────────────────── */
  .kanban-board {
    display: flex;
    gap: var(--sp-md);
    align-items: flex-start;
    min-height: 0;
    flex: 1;
    overflow-x: auto;
    padding-bottom: var(--sp-md);
  }

  .kanban-column {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 220px);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    transition: background 0.15s, box-shadow 0.15s;
  }

  .kanban-column--drag-valid {
    background: rgba(196, 62, 62, 0.08);
    box-shadow: inset 0 0 0 2px var(--accent), 0 0 16px rgba(196, 62, 62, 0.15);
  }

  .kanban-column--drag-invalid {
    background: rgba(255, 80, 80, 0.04);
    box-shadow: inset 0 0 0 2px rgba(255, 80, 80, 0.3);
  }

  .kanban-column-header {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    padding: var(--sp-sm) var(--sp-md);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 2;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .kanban-column-count {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 600;
  }

  .kanban-column-cards {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-sm);
    display: flex;
    flex-direction: column;
    gap: var(--sp-xs);
  }

  .kanban-column-cards::-webkit-scrollbar { width: 3px; }
  .kanban-column-cards::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

  .kanban-card {
    padding: var(--sp-sm) var(--sp-md);
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    border-radius: var(--radius-sm);
    transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
  }

  .kanban-card:active {
    cursor: grabbing;
  }

  .kanban-card:hover {
    border-color: var(--glass-border-hover);
  }

  .kanban-card-name {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .kanban-card-meta {
    font-size: 0.5625rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
    margin-top: 2px;
  }

  .kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--sp-xs);
  }

  .kanban-card-crew {
    display: flex;
    gap: -4px;
  }

  .kanban-card-crew .avatar {
    margin-left: -4px;
  }

  .kanban-card-crew .avatar:first-child {
    margin-left: 0;
  }

  /* ── Chat Desktop — Side-by-side Panels ────────────────────── */
  .chat-shell-wrapper {
    flex-direction: row;
    padding-bottom: 0;
  }

  /* Always show both panels on desktop, regardless of mobile-hidden class */
  .chat-list-panel,
  .chat-list-panel.mobile-hidden {
    display: flex !important;
    flex-direction: column;
    width: 30%;
    min-width: 280px;
    max-width: 420px;
    flex: none;
    border-right: 1px solid var(--glass-border);
    height: 100%;
    overflow: hidden;
  }

  .chat-detail-panel,
  .chat-detail-panel.mobile-hidden {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    height: 100%;
  }

  .chat-detail-empty {
    display: flex;
  }

  .chat-list-panel .page-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-md);
    max-width: none;
  }

  /* Hide back button on desktop */
  .chat-back-btn {
    display: none;
  }

  .chat-detail-panel .chat-messages {
    flex: 1;
    overflow-y: auto;
  }

  .chat-detail-panel .chat-input-bar {
    padding-bottom: var(--sp-sm);
  }

  /* Wider bubbles on desktop */
  .chat-bubble-row {
    max-width: 65%;
  }

  .chat-bubble-row--claude {
    max-width: 70%;
  }

  /* ── Project Detail Desktop ────────────────────────────────── */
  .scoring-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Hide sections that move to sidebar on desktop */
  .detail-mobile-only { display: none !important; }

  /* Compact sections split into two independently-stacking columns
     (.detail-col wrappers); everything else spans the full row. */
  .detail-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--sp-lg);
    align-items: start;
  }
  .detail-overview > * { grid-column: 1 / -1; min-width: 0; }
  .detail-overview > .detail-col {
    grid-column: auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
}

.sidebar-mode-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
}

.sidebar-card {
  padding: var(--sp-md) var(--sp-lg);
}

.sidebar-card-title {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-sm);
  padding-bottom: var(--sp-xs);
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-vitals {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-xs) var(--sp-md);
}

.sidebar-vital-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-vital-label {
  font-size: 0.5625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-vital-value {
  font-size: 0.875rem;
  font-weight: 600;
}

/* Sidebar crew — compact */
.sidebar-crew-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.sidebar-crew-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.75rem;
  padding: 3px 0;
}

.sidebar-crew-item .avatar {
  width: 24px;
  height: 24px;
  font-size: 0.625rem;
}

/* Sidebar activity — compact */
.sidebar-activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-xs);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  padding: 3px 0;
}

.sidebar-activity-item .activity-icon {
  flex-shrink: 0;
  font-size: 0.625rem;
  margin-top: 2px;
}

/* Sidebar chat */
.sidebar-chat-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sidebar-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-xs) 0;
  min-height: 80px;
  max-height: 50vh;
}
.sidebar-chat-messages::-webkit-scrollbar { width: 3px; }
.sidebar-chat-messages::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

.sidebar-chat-bubble-wrap { display: flex; flex-direction: column; align-items: flex-start; }
.sidebar-chat-bubble-wrap--own { align-items: flex-end; }
.sidebar-chat-sender { font-weight: 600; font-size: 0.6rem; color: var(--text-muted); margin-bottom: 0; padding-left: 2px; line-height: 1.2; }
.sidebar-chat-bubble {
  max-width: 85%;
  padding: 4px 9px;
  border-radius: 12px 12px 12px 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-primary);
  word-wrap: break-word;
  white-space: pre-wrap;
}
.sidebar-chat-bubble--own {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
  border-radius: 12px 12px 4px 12px;
}
.sidebar-chat-bubble--claude {
  background: rgba(96, 187, 233, 0.1);
  border-color: rgba(96, 187, 233, 0.25);
  border-radius: 12px 12px 12px 4px;
}
.sidebar-chat-text { white-space: pre-wrap; word-break: break-word; }
.sidebar-chat-time { font-size: 0.5rem; color: var(--text-muted); margin-top: 0; padding: 0 2px; line-height: 1.2; }
.sidebar-chat-attachments { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-chat-file {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.6875rem; color: var(--text-secondary); text-decoration: none;
}
.sidebar-chat-file:hover { color: var(--text-primary); }

.sidebar-chat-pending { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0; }
.sidebar-chat-pending-file {
  display: flex; align-items: center; gap: 4px;
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 2px 6px; font-size: 0.6875rem;
}
.sidebar-chat-input {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding-top: var(--sp-xs);
  border-top: 1px solid var(--glass-border);
}
.sidebar-chat-attach {
  flex-shrink: 0;
  cursor: pointer;
  padding: 6px 2px;
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.sidebar-chat-attach:hover { opacity: 1; }
/* Base glass trio + focus/placeholder: see canonical text input block
   near .form-input. */
.sidebar-chat-textarea {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.75rem;
  resize: none;
  min-height: 32px;
  max-height: 100px;
  line-height: 1.4;
  font-family: inherit;
}
.sidebar-chat-send-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: var(--accent-on);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}
.sidebar-chat-send-btn:disabled { opacity: 0.3; cursor: default; }
.sidebar-chat-send-btn:hover:not(:disabled) { opacity: 0.85; }

/* Sidebar clickable row */
.sidebar-detail-row--clickable { cursor: pointer; transition: opacity 0.15s; }
.sidebar-detail-row--clickable:hover { opacity: 0.7; }

/* Sidebar search */
.sidebar-search {
  position: relative;
  z-index: 20;
  overflow: visible;
}

/* Base glass trio + focus/placeholder: see canonical text input block
   near .form-input. Left padding leaves room for the search icon. */
.sidebar-search-input {
  padding: 7px 10px 7px 30px;
  font-size: 0.75rem;
}

.sidebar-search-icon {
  position: absolute;
  left: calc(var(--sp-lg) + 8px);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.sidebar-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--bg-secondary, var(--bg-primary));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.sidebar-search-result {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.1s;
}

.sidebar-search-result:last-child { border-bottom: none; }
.sidebar-search-result:hover { background: var(--glass-bg-hover); }

.sidebar-search-result .result-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-search-result .result-meta {
  font-size: 0.625rem;
  color: var(--text-muted);
}

/* ── Header Search (desktop: positioned in page header) ──────── */
.header-search-wrapper {
  position: relative;
  z-index: 20;
}

.header-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Base glass trio + focus/placeholder: see canonical text input block
   near .form-input. Left padding leaves room for the search icon;
   this one also animates its width when the header search expands. */
.header-search-input {
  padding: 7px 10px 7px 30px;
  font-size: 0.8125rem;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              width 0.2s var(--ease-out);
}

.header-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--bg-secondary, var(--bg-primary));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.header-search-result {
  padding: var(--sp-sm) var(--sp-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.1s;
}

.header-search-result:last-child { border-bottom: none; }
.header-search-result:hover { background: var(--glass-bg-hover); }

.header-search-result .result-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-search-result .result-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Header search — inline in page-header-actions */
.header-search-wrapper {
  position: relative;
}

/* ── Global Search Overlay ────────────────────────────────────── */
.global-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(var(--safe-top, 0px) + 60px);
}
.global-search-panel {
  width: 90%;
  max-width: 520px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.global-search-input-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--glass-border);
}
.global-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-ui);
}
.global-search-input::placeholder { color: var(--text-muted); }
.global-search-input:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 6px;
}
.global-search-results {
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.global-search-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--sp-xs) var(--sp-lg);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
}
.global-search-cat:first-child { border-top: none; }
.global-search-cat-ic {
  display: inline-flex;
  flex-shrink: 0;
}
.global-search-cat-ic svg { width: 13px; height: 13px; }
.global-search-item {
  padding: var(--sp-sm) var(--sp-lg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.1s;
}
.global-search-item:hover, .global-search-item.selected {
  background: var(--glass-bg-hover);
}
.global-search-item-name {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
/* Cross-app rows say where they live — the row still opens by its url. */
.global-search-app {
  flex-shrink: 0;
  padding: 1px 6px;
  font-size: 0.5625rem;
}
.global-search-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.global-search-empty {
  padding: var(--sp-xl);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.global-search-hints {
  padding: var(--sp-md) var(--sp-lg) var(--sp-lg);
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.global-search-hints-row { display: flex; flex-wrap: wrap; gap: var(--sp-md); }
.global-search-hints-keys { gap: var(--sp-lg); }
.global-search-hints kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-right: 2px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.6875rem;
  line-height: 1.3;
  color: var(--text-secondary);
}

/* Desktop: show as icon button */
@media (min-width: 1024px) {
  .header-search-wrapper {
    display: block;
  }

  .header-search--open {
    position: relative;
  }

  .header-search-box {
    width: 260px;
  }

  .header-search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
  }
}

/* Expanded search input in dark headers */
[data-theme="dark"] .header-search-input,
[data-theme="clean-dark"] .header-search-input,
[data-theme="asana"] .header-search-input,
[data-theme="perimeter"] .header-search-input,
[data-theme="cadence"] .header-search-input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .header-search-input::placeholder,
[data-theme="clean-dark"] .header-search-input::placeholder,
[data-theme="asana"] .header-search-input::placeholder,
[data-theme="perimeter"] .header-search-input::placeholder,
[data-theme="cadence"] .header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .header-search-icon,
[data-theme="clean-dark"] .header-search-icon,
[data-theme="asana"] .header-search-icon,
[data-theme="perimeter"] .header-search-icon,
[data-theme="cadence"] .header-search-icon {
  color: rgba(255, 255, 255, 0.4);
}

/* Sidebar detail fields (project details in sidebar) */
.sidebar-detail-fields {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.sidebar-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-md);
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 2px 0;
}

.sidebar-detail-label {
  color: var(--text-muted);
  font-size: 0.6875rem;
  flex-shrink: 0;
  min-width: 70px;
}

.sidebar-detail-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-detail-desc {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
  white-space: normal;
  text-align: right;
}

/* Sidebar project list (default mode) */
.sidebar-project-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 6px var(--sp-xs);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-project-item:hover {
  background: var(--glass-bg-hover);
}

.sidebar-project-item .project-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-project-item .project-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-project-item .project-stage-label {
  font-size: 0.5625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

/* Sidebar quick actions (default mode) */
.sidebar-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xs);
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 8px 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-action-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Sidebar insight items */
.sidebar-insights-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.sidebar-insight-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.sidebar-insight-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.sidebar-insight-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.sidebar-insight-icon.insight-suggestion {
  background: rgba(96, 187, 233, 0.15);
  color: var(--accent);
}

.sidebar-insight-icon.insight-alert {
  background: rgba(255, 152, 0, 0.15);
  color: var(--severity-warning);
}

.sidebar-insight-icon.insight-metric {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success, #4caf50);
}

/* Sidebar schedule list */
.sidebar-schedule-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.sidebar-schedule-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-sm);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.sidebar-schedule-item:last-child {
  border-bottom: none;
}

.sidebar-schedule-item:hover {
  background: var(--glass-bg-hover);
}

.sidebar-schedule-urgent {
  border-left: 2px solid var(--severity-warning);
  padding-left: calc(var(--sp-sm) - 2px);
}

.sidebar-schedule-group-label {
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--sp-xs) var(--sp-sm);
}

.sidebar-schedule-divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--sp-sm) 0;
}

.sidebar-schedule-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.sidebar-schedule-type {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.sidebar-schedule-type--shoot {
  background: rgba(96, 187, 233, 0.12);
  color: var(--accent);
}

.sidebar-schedule-type--deadline {
  background: rgba(255, 152, 0, 0.12);
  color: var(--severity-warning);
}

.sidebar-schedule-type--booking {
  background: rgba(76, 175, 80, 0.12);
  color: var(--success, #4caf50);
}

/* Sidebar stat cards (default mode overview) */
.sidebar-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xs);
}

/* Base tile/value/label look: see Unified Stat Tile section near
   .stat-card. Compact context keeps a smaller value size + tighter
   padding than the 2rem default. */
.sidebar-stat-card {
  padding: 8px 10px;
}

.sidebar-stat-value {
  font-size: 1.25rem;
  margin-bottom: 0;
}

.sidebar-stat-label {
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════════
   10-Feature Additions
   ══════════════════════════════════════════════════════════════════ */

/* ── Sub-status Badge ─────────────────────────────────────────── */
.badge-sub-status {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent, #6366f1);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: capitalize;
}

/* Department tag — graphics gets a teal identity, distinct from video's camera red */
.badge-dept-graphics {
  background: rgba(45, 178, 173, 0.16);
  color: #2db2ad;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Social gets violet — distinct from both graphics teal and video red */
.badge-dept-social {
  background: rgba(167, 139, 250, 0.16);
  color: #a78bfa;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ── Forecast Sub-status Badges ─────────────────────────────── */
.badge-forecast-active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-forecast-on_hold {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-forecast-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
}
.badge-forecast-fulfilled {
  background: rgba(96, 165, 250, 0.15);
  color: var(--event-color-1);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ── Timer Indicator (compact, in header area) ──────────────── */
.timer-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) var(--sp-md);
  margin: 0 var(--sp-lg) var(--sp-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
}

.timer-indicator:hover {
  background: var(--glass-bg);
}

.timer-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.timer-indicator-dot.pulse {
  animation: timer-pulse 1.5s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.form-input-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  min-height: 32px;
}

/* ── Checklist ────────────────────────────────────────────────── */
.checklist-progress {
  padding: 0 var(--sp-lg);
  margin-bottom: var(--sp-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-border, rgba(255, 255, 255, 0.08));
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent, #6366f1);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.checklist-list {
  padding: var(--sp-sm) var(--sp-md);
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) 0;
  border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

.checklist-item:last-of-type {
  border-bottom: none;
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #6366f1);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-title {
  flex: 1;
  font-size: 0.875rem;
}

.checklist-title.checklist-done {
  text-decoration: line-through;
  opacity: 0.5;
}

.checklist-add {
  display: flex;
  gap: var(--sp-sm);
  padding-top: var(--sp-sm);
  margin-top: var(--sp-xs);
  border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

.checklist-add .form-input {
  flex: 1;
}


/* ── Deliverables card (step 1 of the fan-out) ────────────────── */
/* The project page's proposed downstream pieces. Tokens only, and the
   whole row collapses to a stack at phone width so a date input and a
   long label never push the card sideways. */
.dlv-card {
  padding: var(--sp-md) var(--sp-lg);
  /* The row re-flows on the CARD's width, not the window's: on a desktop
     project page this card sits in a half-width column beside the thread
     panel, which at 1280 is narrower than a phone. A viewport media query
     never fired there and the labels wrapped one letter per line. */
  container-type: inline-size;
}

.dlv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-bottom: var(--sp-sm);
}

.dlv-head-title {
  display: flex;
  align-items: baseline;
  gap: var(--sp-sm);
  min-width: 0;
  flex-wrap: wrap;
}

.dlv-count {
  white-space: nowrap;
}

.dlv-head-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.dlv-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) 0;
  border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

.dlv-row:last-of-type {
  border-bottom: none;
}

/* Admins only: "3 proposed · Review" → the queue, this project expanded. */
.dlv-review-link {
  white-space: nowrap;
  color: var(--accent);
}

.dlv-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.5;
}

/* The kind, in words, right after the glyph (Sep 15 2026 — "I don't know
   what all these proposals are… social posts? announcements? coming soon
   screens?"). Same pill the standalone request form prints next to a
   proposed part, so the form, the queue and the record agree. */
.dlv-kind {
  flex: 0 0 auto;
  /* One width for every chip, so a column of them reads as a column and
     the labels beside them line up — "Announce" is four characters longer
     than "Reel" and the ragged left edge was the first thing the eye found. */
  min-width: 4.1rem;
  padding: 1px 6px;
  border-radius: var(--radius-xs, 4px);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.7;
  text-align: center;
  white-space: nowrap;
}

/* Video is the part with a crew, a shoot day and a budget attached — it is
   not one row among six, so it does not look like one. (--sunday-accent is
   MainFrame's theme-aware warm gold; the kit's --gold/--gold-soft are not in
   this app's token set.) */
.dlv-kind--video {
  background: color-mix(in srgb, var(--sunday-accent) 22%, transparent);
  color: var(--sunday-accent-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sunday-accent) 35%, transparent);
}

.dlv-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dlv-label {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.dlv-label--editable {
  cursor: text;
}

.dlv-label-input {
  font-size: 0.875rem;
  padding: 2px 6px;
  width: 100%;
}

.dlv-reason {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.dlv-date {
  flex: 0 0 auto;
  width: 8.5rem;
  max-width: 100%;
  font-size: 0.75rem;
  padding: 2px 6px;
}

.dlv-pill {
  flex-shrink: 0;
  text-transform: capitalize;
}

/* Step 3: a created row has a real object somewhere else, and this is the
   door to it. Always in the flow, like .dlv-remove-slot, so the status pills
   line up whether or not a row has been fanned out yet. */
.dlv-open-slot {
  flex: 0 0 auto;
  display: inline-flex;
  justify-content: center;
  min-width: 3.25rem;
}

.dlv-open,
.dlv-campaign-link {
  white-space: nowrap;
  color: var(--accent);
}

/* Always in the flow, with or without a button inside it, so the status
   pills line up whether or not this reader may remove the row. */
.dlv-remove-slot {
  flex: 0 0 auto;
  display: inline-flex;
  justify-content: center;
  min-width: 26px;
}

.dlv-remove {
  flex-shrink: 0;
  opacity: 0.4;
}

.dlv-remove:hover {
  opacity: 1;
}

.dlv-empty {
  padding: var(--sp-md) 0;
  text-align: center;
}

.dlv-add {
  padding-top: var(--sp-sm);
  margin-top: var(--sp-xs);
  border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

.dlv-add-form {
  display: flex;
  gap: var(--sp-xs);
  align-items: center;
  flex-wrap: wrap;
}

.dlv-add-kind { flex: 0 0 auto; width: 9rem; font-size: 0.8rem; }
.dlv-add-label { flex: 1 1 12rem; min-width: 0; font-size: 0.8rem; }
.dlv-add-date { flex: 0 0 auto; width: 8.5rem; font-size: 0.8rem; }
.dlv-add-actions { display: flex; gap: var(--sp-xs); }

@container (max-width: 520px) {
  /* Narrow card — a phone, or a desktop column: the glyph, chip and label
     stay on line one, the date, pill and ✕ wrap under them, indented past
     the glyph. Nothing overflows 390px. */
  .dlv-row {
    flex-wrap: wrap;
    row-gap: var(--sp-xs);
  }
  .dlv-body {
    flex: 1 1 55%;
  }
  /* The chip stays with the glyph; a long label wraps under the pair
     rather than squeezing it to two characters. */
  .dlv-kind {
    font-size: 0.5875rem;
    padding: 1px 5px;
  }
  .dlv-date {
    order: 3;
    margin-left: calc(14px + var(--sp-sm));
  }
  .dlv-pill { order: 4; }
  /* Same order as the pill: equal orders keep DOM order, so "Open" sits
     next to the pill on the wrapped second line instead of jumping up. */
  .dlv-open-slot { order: 4; min-width: 0; }
  .dlv-remove-slot { order: 5; margin-left: auto; }
  .dlv-add-kind,
  .dlv-add-label,
  .dlv-add-date {
    flex: 1 1 100%;
    width: auto;
  }
}

/* ── Ministry status page card (step 2 of the fan-out) ────────── */
/* The project's ONE login-less link and who it goes to. Same card
   language as the deliverables card above it — they are the same story
   told to two audiences. Tokens only; everything wraps to a stack at
   phone width so a long URL never pushes the card sideways. */
.mstat-card {
  padding: var(--sp-md) var(--sp-lg);
}

.mstat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-bottom: var(--sp-xs);
}

.mstat-blurb {
  margin: 0 0 var(--sp-sm);
  line-height: 1.4;
}

.mstat-contact {
  display: flex;
  gap: var(--sp-xs);
  align-items: center;
  flex-wrap: wrap;
}

.mstat-input {
  flex: 1 1 10rem;
  min-width: 0;
  font-size: 0.8rem;
  padding: 3px 8px;
}

.mstat-save {
  flex: 0 0 auto;
}

.mstat-live {
  margin-top: var(--sp-sm);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.mstat-url {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  min-width: 0;
}

/* Truncates rather than wraps: the token is 43 characters of noise and
   nobody reads it — Copy is the affordance. */
.mstat-code {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.mstat-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.mstat-actions .spacer {
  flex: 1 1 auto;
}

/* The send button carries the address, so it can run long. */
.mstat-send {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mstat-note {
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.mstat-warn {
  margin: 0;
  color: var(--warning, var(--text-secondary));
  line-height: 1.4;
}

.mstat-empty {
  padding: var(--sp-sm) 0 0;
}

@media (max-width: 560px) {
  /* Phone: each field takes its own line and the buttons stack under the
     link, so nothing overflows 390px. */
  .mstat-input,
  .mstat-save {
    flex: 1 1 100%;
    width: auto;
  }
  .mstat-actions .spacer { display: none; }
  .mstat-send { flex: 1 1 100%; }
}

/* ── The ministry thread on the status card (Oct 8 2026) ───────── */
/* What the ministry wrote from their page and what the team answered,
   inside the status card. Their lines sit left on the tint, ours right
   on the accent wash; the state line says who is on it. The bell's deep
   link flashes the whole card once. Tokens only. */
.mstat-card--flash {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: box-shadow 0.4s ease;
}

.mthr {
  margin-top: var(--sp-sm);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.mthr-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}

.mthr-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mthr-state { color: var(--text-muted); }
.mthr-state--waiting {
  color: var(--warning, var(--text-secondary));
  font-weight: 600;
}

/* Capped and scrolling: a long thread must never push the rest of the
   project page off screen. */
.mthr-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  max-height: 22rem;
  overflow-y: auto;
  padding: 2px 0;
}

.mthr-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 88%;
}
.mthr-msg--them { align-self: flex-start; }
.mthr-msg--us { align-self: flex-end; align-items: flex-end; }

.mthr-meta { line-height: 1.3; }

.mthr-bubble {
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.mthr-msg--them .mthr-bubble { border-bottom-left-radius: var(--radius-xs); }
.mthr-msg--us .mthr-bubble {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-bottom-right-radius: var(--radius-xs);
}

.mthr-file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.06));
  font-size: 0.75rem;
  color: var(--accent-text);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.mthr-file:hover { text-decoration: underline; }

.mthr-empty {
  margin: 0;
  line-height: 1.4;
}

.mthr-compose {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.mthr-input {
  width: 100%;
  min-height: 2.6rem;
  resize: vertical;
  font-size: 0.85rem;
  padding: 6px 8px;
}

.mthr-compose-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}
.mthr-compose-row .spacer { flex: 1 1 auto; }

.mthr-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.mthr-email input { margin: 0; }

/* ── Ministry messages — the COM inbox (Oct 8 2026) ─────────────── */
/* One row per thread, waiting ones first with a warm left edge. The row
   is a <button> (the whole thing opens the card), so its own type and
   colour are reset to the page's. Stacks under 560px. Tokens only. */
.minbox-intro {
  margin: 0 0 var(--sp-md);
  max-width: 60ch;
  line-height: 1.45;
}

.minbox-scope {
  display: flex;
  gap: 4px;
}
.minbox-scope .chip {
  padding: 4px 10px;
  font-size: 0.72rem;
}

.minbox-count { margin-left: var(--sp-xs); }

.minbox-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.minbox-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
  width: 100%;
  padding: var(--sp-sm) var(--sp-md);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.minbox-row:hover { background: var(--surface-hover, var(--bg-tertiary)); }
.minbox-row--waiting { border-left-color: var(--warning, var(--accent)); }

.minbox-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.minbox-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.minbox-ministry {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.minbox-dot { color: var(--text-muted); }
.minbox-effort {
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.minbox-last {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.minbox-last b {
  color: var(--text-primary);
  font-weight: 600;
  margin-right: 4px;
}

.minbox-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.minbox-state--waiting {
  color: var(--warning, var(--text-secondary));
  font-weight: 600;
}

@media (max-width: 560px) {
  .minbox-row { flex-direction: column; gap: var(--sp-xs); }
  .minbox-side { flex-direction: row; align-items: center; gap: var(--sp-sm); }
}

/* ── Admin → Deliverables: the review queue ───────────────────── */
/* The step before the fan-out. One card per project, collapsed to its
   name + count until an admin opens it; the row is a GRID (the same
   lesson the recipe editor learned — with flex the ✕ dropped to a line
   of its own the moment a label ran long) and re-flows to two lines at
   phone width. Tokens only. */
.dlvq-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  margin-bottom: var(--sp-sm);
}

.dlvq-card {
  padding: var(--sp-sm) var(--sp-md);
  margin-bottom: var(--sp-sm);
  container-type: inline-size;
}

.dlvq-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  cursor: pointer;
  min-width: 0;
}

.dlvq-card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* A link in everything but markup: it opens the project itself. */
.dlvq-project {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.dlvq-project:hover {
  color: var(--accent);
  text-decoration: underline;
}

.dlvq-sub {
  text-transform: capitalize;
}

.dlvq-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  flex-shrink: 0;
}

.dlvq-body {
  padding-top: var(--sp-sm);
  margin-top: var(--sp-sm);
  border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

.dlvq-row {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) 8.5rem auto auto;
  gap: var(--sp-xs);
  align-items: center;
  padding: var(--sp-xs) 0;
  border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

/* Unchecked = it will be declined when the pass is saved. Say so before
   the click, not after. */
.dlvq-row--out {
  opacity: 0.45;
}

.dlvq-row--out .dlvq-label {
  text-decoration: line-through;
}

.dlvq-row--new .dlvq-label {
  font-style: italic;
}

.dlvq-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent, #6366f1);
  cursor: pointer;
}

/* Keeps a not-yet-saved row aligned with the checked ones above it. */
.dlvq-check-spacer {
  display: inline-block;
  width: 18px;
}

/* The queue's copy of the row chip — .dlv-kind paints it, this places it
   in the grid. Every surface that renders a part row now says the word. */
.dlvq-kind {
  justify-self: start;
}

.dlvq-icon {
  display: inline-flex;
  align-items: center;
  opacity: 0.5;
}

.dlvq-body-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dlvq-label {
  font-size: 0.875rem;
  cursor: text;
  overflow-wrap: anywhere;
}

.dlvq-label-input {
  font-size: 0.875rem;
  padding: 2px 6px;
  width: 100%;
}

.dlvq-reason {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.dlvq-date {
  font-size: 0.75rem;
  padding: 2px 6px;
  min-width: 0;
}

.dlvq-pill {
  text-transform: capitalize;
}

.dlvq-remove {
  opacity: 0.4;
}

.dlvq-remove:hover {
  opacity: 1;
}

.dlvq-add {
  display: flex;
  gap: var(--sp-xs);
  align-items: center;
  flex-wrap: wrap;
  padding-top: var(--sp-sm);
}

.dlvq-add-kind { flex: 0 0 auto; width: 9rem; font-size: 0.8rem; }
.dlvq-add-label { flex: 1 1 12rem; min-width: 0; font-size: 0.8rem; }
.dlvq-add-date { flex: 0 0 auto; width: 8.5rem; font-size: 0.8rem; }

.dlvq-actions {
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
  padding-top: var(--sp-sm);
  margin-top: var(--sp-xs);
  border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

.dlvq-empty {
  padding: var(--sp-lg) 0;
  text-align: center;
}

/* ── The review, where the work is (Sep 15 2026) ────────────────
   Same queue, three hosts. "Waiting on you" sits above the requests
   list; a request page and a project page each host their own card
   inline. The card body is identical in all three — only the frame
   around it changes, which is all these three rules do. */

/* Requests page: the section above the list. Its own band, so the
   queue and the requests below it never read as one list. */
.dlvq-section {
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-md);
  border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.06));
}

/* A record's own card: the head above it already separates the body,
   so the queue's divider would only double it. */
.dlvq-body--inline {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Project page: the pass sits inside the Deliverables card, above the
   settled list. The dashed rule is where one ends and the other begins. */
.dlvq-inline-wrap {
  margin-bottom: var(--sp-sm);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px dashed var(--surface-border, rgba(255, 255, 255, 0.14));
}

@container (max-width: 520px) {
  /* Narrow card: two explicit rows — checkbox, glyph, chip, label and ✕ on
     the first, the date and its pill on the second, indented past the
     checkbox. Every cell is placed by hand: leave one to auto-placement and
     it lands on a third row of its own (the ✕ did exactly that). */
  .dlvq-row {
    grid-template-columns: auto auto auto minmax(0, 1fr) auto;
    row-gap: var(--sp-xs);
  }
  .dlvq-check,
  .dlvq-check-spacer { grid-column: 1; grid-row: 1; }
  .dlvq-icon { grid-column: 2; grid-row: 1; }
  .dlvq-kind { grid-column: 3; grid-row: 1; }
  .dlvq-body-text { grid-column: 4; grid-row: 1; }
  .dlvq-remove { grid-column: 5; grid-row: 1; }
  .dlvq-pill { grid-column: 5; grid-row: 2; }
  .dlvq-date {
    grid-column: 2 / 5;
    grid-row: 2;
  }
  .dlvq-add-kind,
  .dlvq-add-label,
  .dlvq-add-date {
    flex: 1 1 100%;
    width: auto;
  }
}

/* ── Admin → Recipes (recipe editor) ──────────────────────────── */
.rcp-wrap {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: var(--sp-md);
  align-items: start;
}

.rcp-list {
  padding: var(--sp-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rcp-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-xs) var(--sp-xs);
}

.rcp-item {
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
}

.rcp-item:hover {
  background: var(--glass-bg);
}

.rcp-item--active {
  background: var(--glass-bg);
  border-color: var(--accent);
}

.rcp-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-xs);
}

.rcp-item-name {
  font-size: 0.8rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.rcp-item-sub {
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.rcp-empty,
.rcp-editor-empty {
  padding: var(--sp-md);
  text-align: center;
}

.rcp-restore {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  flex-wrap: wrap;
  padding-top: var(--sp-xs);
  margin-top: var(--sp-xs);
  border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

.rcp-editor {
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.rcp-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--sp-sm);
}

.rcp-check {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  cursor: pointer;
}

.rcp-section-label {
  line-height: 1.4;
  padding-top: var(--sp-xs);
  border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

.rcp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.rcp-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

/* A fixed grid rather than a wrapping flex row: with flex the remove ✕
   dropped onto a line of its own as soon as the label ran long. */
.rcp-item-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) 9.5rem 4.5rem 4.5rem 4.5rem minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
}

.rcp-item-row .form-input {
  font-size: 0.75rem;
  padding: 3px 6px;
}

/* The grid sizes the item-row fields; these widths are for .rcp-f-num where
   it appears outside a row (the preview bar's project number). */
.rcp-item-row .form-input { min-width: 0; }
.rcp-preview-bar .rcp-f-num { width: 5rem; }

.rcp-actions {
  display: flex;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.rcp-preview {
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
}

.rcp-preview-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  flex-wrap: wrap;
}

.rcp-preview-out {
  margin-top: var(--sp-sm);
}

.rcp-preview-row {
  display: flex;
  gap: var(--sp-sm);
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
  flex-wrap: wrap;
}

.rcp-preview-row:last-of-type {
  border-bottom: none;
}

@media (max-width: 860px) {
  .rcp-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Narrow: one field per line, with the three number boxes sharing a row
     and the remove ✕ tucked beside the reason. */
  .rcp-item-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    padding-bottom: var(--sp-xs);
    border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
  }
  .rcp-f-kind,
  .rcp-f-label,
  .rcp-f-anchor {
    grid-column: 1 / -1;
  }
  .rcp-f-reason {
    grid-column: 1 / 4;
  }
}

.chip-xs {
  font-size: 0.65rem;
  padding: 2px 8px;
}

.chip-outline {
  border: 1px dashed var(--surface-border, rgba(255, 255, 255, 0.12));
  background: transparent;
}

/* ── Project Thread ───────────────────────────────────────────── */
.project-thread-section {
  display: flex;
  flex-direction: column;
}

.project-thread-messages {
  max-height: 420px;
  overflow-y: auto;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--surface-alt, rgba(255, 255, 255, 0.02));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
  border-bottom: none;
}

/* Activity group (collapsed summary) */
.thread-activity-group {
  margin: var(--sp-xs) 0;
}
.thread-activity-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s, background 0.15s;
}
.thread-activity-summary:hover,
.thread-activity-summary:active {
  opacity: 0.8;
  background: var(--surface-hover, rgba(255,255,255,0.04));
}
.thread-activity-summary .activity-icon {
  font-size: 0.65rem;
  opacity: 0.5;
}
.thread-activity-summary .activity-text {
  color: var(--text-secondary);
  font-style: italic;
}
.thread-activity-summary .section-chevron {
  opacity: 0.35;
  flex-shrink: 0;
}
.thread-activity-summary .activity-meta {
  color: var(--text-muted, rgba(255,255,255,0.35));
  margin-left: auto;
  white-space: nowrap;
}
.thread-activity-group-items {
  padding-left: var(--sp-md);
  border-left: 2px solid var(--border);
  margin-left: var(--sp-sm);
}

/* System activity entries in thread */
.thread-activity-entry {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm);
  margin: var(--sp-xs) 0;
  opacity: 0.6;
}

.thread-activity-entry .activity-icon {
  font-size: 0.75rem;
  width: auto;
  height: auto;
  background: none;
}

.thread-activity-entry .activity-text {
  color: var(--text-secondary);
}

.thread-activity-entry .activity-meta {
  color: var(--text-muted, rgba(255, 255, 255, 0.35));
  margin-left: auto;
  white-space: nowrap;
}

/* Chat messages in thread */
.thread-message {
  display: flex;
  gap: var(--sp-xs);
  padding: var(--sp-xs) 0;
  margin-bottom: var(--sp-xs);
}

.thread-message--own {
  flex-direction: row-reverse;
}

.thread-message-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-alt, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.thread-message--claude .thread-message-avatar {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent, #6366f1);
}

.thread-message-bubble {
  max-width: 75%;
  padding: var(--sp-sm) var(--sp-md);
  border-radius: var(--radius-md);
  background: var(--glass-bg, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
}

.thread-message-bubble--own {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.thread-message-bubble--claude {
  background: rgba(var(--accent-rgb), 0.06);
  border-color: rgba(var(--accent-rgb), 0.12);
}

.thread-message-sender {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.thread-message-content {
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-message-time {
  color: var(--text-muted, rgba(255, 255, 255, 0.35));
  margin-top: 2px;
  text-align: right;
}

/* ── Action items (checkable task messages) ─────────────────────── */
.thread-message-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-xs);
}

/* Reveal the "make action item" affordance only on hover, so normal chat stays clean */
.thread-action-toggle {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0 2px;
  color: var(--text-muted, rgba(255, 255, 255, 0.4));
  transition: opacity 0.12s ease, color 0.12s ease;
  align-self: center;
  margin-left: auto;
}
.thread-message-bubble:hover .thread-action-toggle { opacity: 0.55; }
.thread-action-toggle:hover { opacity: 1 !important; color: var(--accent, #c43e3e); }

/* An action-item bubble reads as a task: accent left edge */
.thread-message-bubble--action {
  border-left: 3px solid var(--accent, #c43e3e);
}
.thread-message-bubble--done {
  opacity: 0.7;
  border-left-color: var(--success, #3ba55d);
}

/* The checkbox */
.thread-action-check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 4px;
  border: 1.5px solid var(--text-muted, rgba(255, 255, 255, 0.4));
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.thread-action-check:hover { border-color: var(--accent, #c43e3e); }
.thread-action-check--done {
  background: var(--success, #3ba55d);
  border-color: var(--success, #3ba55d);
}

/* Strike through completed action-item text */
.thread-message-content--done {
  text-decoration: line-through;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

.thread-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  margin-top: 2px;
}
.thread-message-done-by {
  color: var(--success, #3ba55d);
  font-weight: 600;
}

/* Composer: "send as action item" toggle */
.thread-actionitem-btn {
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted, rgba(255, 255, 255, 0.45));
  transition: color 0.12s ease, background 0.12s ease;
  border-radius: var(--radius-sm, 6px);
}
.thread-actionitem-btn--on {
  color: #fff;
  background: var(--accent, #c43e3e);
}

/* File attachments in messages */
.thread-attachments {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  margin-top: var(--sp-sm);
}

.thread-file {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-sm);
  background: var(--glass-bg);
  border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s;
}

.thread-file:hover {
  background: var(--glass-bg-hover);
}

.thread-file-icon {
  font-size: 1rem;
}

.thread-file-name {
  font-size: 0.8rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-file-size {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Pending files preview */
.thread-pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-md);
  background: rgba(var(--accent-rgb), 0.05);
  border-left: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
  border-right: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
}

.thread-pending-file {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 2px var(--sp-sm);
  background: rgba(var(--accent-rgb), 0.15);
  border-radius: var(--radius-sm);
}

.btn-icon-xs {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.9rem;
  line-height: 1;
}

/* Input bar */
.thread-input-bar {
  position: relative; /* anchors the @mention popup */
  display: flex;
  align-items: flex-end;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md) calc(var(--sp-sm) + env(safe-area-inset-bottom, 0px));
  background: var(--glass-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: border-color 0.2s;
}

.thread-input-bar--dragover {
  border-color: var(--accent, #6366f1);
  background: rgba(var(--accent-rgb), 0.08);
}

/* ── Scratch Pad (shared rich-text notes under the thread) ─────── */
/* Always-open bottom half of the thread column. Shares the leftover column
   height with the message list (both flex:1), so Tally ≈ top half, scratch
   pad ≈ bottom half. */
.scratch-pad {
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--glass-border);
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scratch-pad-header {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: var(--sp-sm) var(--sp-md);
  user-select: none;
  flex-shrink: 0;
}

.scratch-pad-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scratch-pad-status {
  margin-left: auto;
  color: var(--text-muted);
}

.scratch-pad-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 var(--sp-md) var(--sp-xs);
  flex-shrink: 0;
}

.scratch-tool {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.scratch-tool:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}
.scratch-tool-divider {
  width: 1px;
  height: 16px;
  background: var(--glass-border);
  margin: 0 4px;
}

/* Base glass trio + focus/placeholder: see canonical text input block
   near .form-input. This is a contenteditable div, not an <input>, so
   it also carries its own empty-state placeholder + rich-text rules. */
.scratch-pad-editor {
  flex: 1;
  overflow-y: auto;
  margin: 0 var(--sp-md) var(--sp-sm);
  min-height: 80px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
}
.scratch-pad-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}
.scratch-pad-editor h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: var(--sp-xs) 0;
  color: var(--text-primary);
}
.scratch-pad-editor ul,
.scratch-pad-editor ol { padding-left: 1.25rem; margin: var(--sp-xs) 0; }
.scratch-pad-editor::-webkit-scrollbar { width: 3px; }
.scratch-pad-editor::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

.scratch-pad-footer {
  padding: 0 var(--sp-md) var(--sp-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Mobile Notes tab: editor stands alone in the tab (not inside the thread
   panel), so give it room and no side margins. */
.scratch-pad-editor--mobile {
  margin: 0;
  min-height: 240px;
  max-height: none;
}
.scratch-pad-mobile .scratch-pad-toolbar {
  padding: 0 0 var(--sp-xs);
}
.scratch-pad-mobile .scratch-pad-footer {
  padding: var(--sp-xs) 0 0;
}

.thread-attach-btn {
  cursor: pointer;
  font-size: 1.1rem;
  padding: var(--sp-xs);
  opacity: 0.6;
  transition: opacity 0.15s;
}

.thread-attach-btn:hover {
  opacity: 1;
}

.thread-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary, #fff);
  font-size: 0.85rem;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  padding: var(--sp-xs) 0;
}

.thread-input::placeholder {
  color: var(--text-muted, rgba(255, 255, 255, 0.35));
}

.thread-send-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* ── Capacity Page ────────────────────────────────────────────── */

/* Section labels */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--sp-xs) 0;
  margin-bottom: var(--sp-xs);
}

/* Forecast cards */
.forecast-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.forecast-card {
  text-align: center;
  padding: var(--sp-sm) var(--sp-xs) !important;
}
.forecast-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.forecast-utilization {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.forecast-status {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.forecast-note {
  min-height: 1rem;
  line-height: 1.2;
}
.forecast-count {
  margin-top: 2px;
}
.forecast-badge--available { color: var(--capacity-available); }
.forecast-badge--busy { color: var(--capacity-busy); }
.forecast-badge--near { color: var(--warning); }
.forecast-badge--over { color: var(--error); }

/* Heatmap grid */
.cap-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: var(--sp-xs) 0;
}
.cap-heatmap-header {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  padding-bottom: 2px;
}
.cap-heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-primary);
  position: relative;
  min-height: 32px;
}
.cap-heatmap-date {
  font-variant-numeric: tabular-nums;
}
.cap-heat-empty { background: transparent; }
/* Token-derived heat ramp (was hardcoded rgba green/amber/orange/red —
   the 12% low bucket was invisible on the perimeter theme's #f7f8fa bg).
   Hue carries most of the "heat" read; alpha increases toward the danger
   end. Verified visually distinct on both #f7f8fa and dark theme bgs. */
/* Tier names are capacity.py's heat_status: light < 30 < available < 60 < busy < 85 < near ≤ 100 < over */
/* The strip cells (.cap-person-cell, .ov-strip-cell) carry a base glass
   background declared later in this file; the tier selectors below are
   doubled with the cell classes so the colour wins (Oct 7 2026 — the
   per-person strips had been plain grey since September). */
.cap-heat-light,     .cap-person-cell.cap-heat-light,     .ov-strip-cell.cap-heat-light     { background: color-mix(in srgb, var(--capacity-available) 25%, transparent); }
.cap-heat-available, .cap-person-cell.cap-heat-available, .ov-strip-cell.cap-heat-available { background: color-mix(in srgb, var(--capacity-available) 45%, transparent); }
.cap-heat-busy,      .cap-person-cell.cap-heat-busy,      .ov-strip-cell.cap-heat-busy      { background: color-mix(in srgb, var(--warning) 35%, transparent); }
.cap-heat-near,      .cap-person-cell.cap-heat-near,      .ov-strip-cell.cap-heat-near      { background: color-mix(in srgb, color-mix(in srgb, var(--warning) 50%, var(--error) 50%) 50%, transparent); }
.cap-heat-over,      .cap-person-cell.cap-heat-over,      .ov-strip-cell.cap-heat-over      { background: color-mix(in srgb, var(--error) 60%, transparent); }

/* By-person strips under the 60-day grid (Forecast tab) */
.cap-person-rows { display: flex; flex-direction: column; gap: 6px; }
.cap-person-row { display: flex; align-items: center; gap: 10px; }
.cap-person-label { flex: 0 0 120px; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.cap-person-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-person-strip { flex: 1; display: flex; gap: 1px; height: 14px; min-width: 0; }
.cap-person-cell { flex: 1; min-width: 0; border-radius: 2px; background: var(--glass-bg); }
.cap-person-cell.is-weekend { opacity: 0.45; }
@media (max-width: 600px) {
  .cap-person-label { flex-basis: 84px; }
  .cap-person-label .text-xs { display: none; }
}

/* 60-day month grid (Forecast tab) */
.cap-grid-layout {
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg, 16px);
}
.cap-grid-side {
  min-width: 0;
}
@media (min-width: 900px) {
  .cap-grid-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--sp-xl, 24px);
  }
  .cap-grid-side {
    flex: 1;
  }
}
.cap-grid {
  --cap-cell: 20px;
  --cap-gap: 3px;
  display: flex;
  gap: var(--cap-gap);
  overflow-x: auto;
  padding-bottom: 4px;
}
@media (min-width: 900px) {
  .cap-grid { --cap-cell: 30px; --cap-gap: 4px; }
}
@media (min-width: 1300px) {
  .cap-grid { --cap-cell: 38px; }
}
.cap-grid-col {
  display: flex;
  flex-direction: column;
  gap: var(--cap-gap);
  width: var(--cap-cell);
  flex-shrink: 0;
}
.cap-grid-dowcol {
  display: flex;
  flex-direction: column;
  gap: var(--cap-gap);
  padding-top: calc(14px + var(--cap-gap));
  flex-shrink: 0;
}
.cap-grid-dow {
  height: var(--cap-cell);
  line-height: var(--cap-cell);
  width: 28px;
}
.cap-grid-month {
  height: 14px;
  white-space: nowrap;
  overflow: visible;
}
.cap-grid-cell {
  width: var(--cap-cell);
  height: var(--cap-cell);
  border-radius: 4px;
  position: relative;
  flex-shrink: 0;
}
.cap-grid-dot {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: 22%;
  height: 22%;
  min-width: 5px;
  min-height: 5px;
  border-radius: 50%;
  background: var(--text-primary);
}

/* Legend */
.cap-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
  padding: var(--sp-sm) 0;
  font-size: 0.65rem;
  color: var(--text-secondary);
}
.cap-legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
}
.cap-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ── Capacity → Overview (rebuilt Oct 7 2026): the state of the studio.
   A weather line, five stat tiles that carry their own context, then
   People · This week · Needs attention. Content-sized cards on a capped
   width, so nothing stretches to fill a 2000px screen. ── */
.ov { max-width: 1560px; margin: 0 auto; }
.ov-top { display: flex; flex-direction: column; gap: var(--sp-sm); margin-bottom: var(--sp-md); }
.ov-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-sm); }

.ov-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-sm); margin-bottom: var(--sp-lg); }
.ov-stat:last-child { grid-column: 1 / -1; }   /* phones: five tiles, no orphan */
.ov-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0;
  text-align: left; padding: var(--sp-md) var(--sp-lg); cursor: pointer; color: inherit; font: inherit;
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-md);
}
.ov-stat:hover { background: color-mix(in srgb, var(--accent) 6%, var(--glass-bg)); }
.ov-stat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ov-stat--near { border-color: color-mix(in srgb, var(--warning) 45%, var(--glass-border)); }
.ov-stat--over { border-color: color-mix(in srgb, var(--error) 45%, var(--glass-border)); }
.ov-stat-label { font-size: 0.7rem; color: var(--text-muted); }
.ov-stat-value {
  font-family: var(--font-heading); font-size: 1.9rem; font-weight: 600; line-height: 1.05;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.ov-stat-suffix { font-size: 1rem; font-weight: 500; opacity: 0.6; margin-left: 1px; }
.ov-stat-note { font-size: 0.7rem; color: var(--text-muted); line-height: 1.35; margin-top: 2px; }
.ov-stat-note--bad { color: var(--error); }
.ov-stat-note--warn { color: var(--warning); }
.ov-health { font-size: 0.78rem; font-weight: 600; }
/* The stage bar is a split, not a verdict: no outline per segment (four
   outlined segments read as one red blob — Oct 8 2026). The tile border
   carries the level; the jammed stage's count takes the level's colour. */
.ov-stage-bar { display: flex; gap: 2px; width: 100%; height: 8px; margin-top: 6px; }
.ov-stage-seg { min-width: 3px; border-radius: 2px; opacity: 0.85; }
.ov-stage-counts { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 0.68rem; color: var(--text-muted); }
.ov-stage-count b { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }
.ov-stage-count--warn, .ov-stage-count--warn b { color: var(--warning); }
.ov-stage-count--crit, .ov-stage-count--crit b { color: var(--error); }
.ov-spark { width: 100%; height: 28px; color: var(--capacity-busy); margin-top: 2px; }
.ov-bars { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 28px; margin-top: 2px; }
.ov-bar { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--stage-completion) 70%, transparent); }

.ov-stat.is-open { border-color: color-mix(in srgb, var(--accent) 60%, var(--glass-border)); background: color-mix(in srgb, var(--accent) 8%, var(--glass-bg)); }

/* See more: the list behind the open tile */
.ov-detail { margin: calc(-1 * var(--sp-sm)) 0 var(--sp-lg); }
.ov-detail-head { display: flex; align-items: center; gap: var(--sp-sm); margin-bottom: var(--sp-sm); }
.ov-detail-head .elt-section-title { margin-bottom: 0; }
.ov-detail-groups { display: grid; grid-template-columns: 1fr; gap: var(--sp-md); }
.ov-detail-group { min-width: 0; }
.ov-detail-group-head { display: flex; align-items: center; gap: var(--sp-sm); margin-bottom: 2px; }
.ov-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--sp-sm); align-items: center;
  padding: 6px 0; border-top: 1px solid var(--glass-border); cursor: pointer; font-size: 0.8rem;
}
.ov-row:hover .ov-row-name { color: var(--accent); }
.ov-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-row-meta { grid-column: 1; font-size: 0.68rem; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-row-num { grid-column: 2; grid-row: 1 / span 2; font-size: 0.74rem; color: var(--text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-row--3 { grid-template-columns: minmax(0, 1fr) auto auto; }
.ov-row--3 > * { grid-row: auto; grid-column: auto; }
.ov-chip { grid-column: 2; grid-row: 1 / span 2; font-size: 0.64rem; font-weight: 600; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.ov-chip--ok { color: var(--capacity-available); background: color-mix(in srgb, var(--capacity-available) 14%, transparent); }
.ov-chip--warn { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.ov-chip--late { color: var(--error); background: color-mix(in srgb, var(--error) 12%, transparent); }
.ov-chip--none { color: var(--text-muted); background: var(--glass-bg); }

.ov-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-lg); align-items: start; }
.ov-person-list { display: flex; flex-direction: column; gap: var(--sp-md); }
.ov-person { cursor: pointer; border-radius: var(--radius-sm); }
.ov-person:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.ov-person-chevron { width: 12px; height: 12px; color: var(--text-muted); flex-shrink: 0; align-self: center; transition: transform 0.15s ease; }
.ov-person.is-open .ov-person-chevron { transform: rotate(90deg); }
.ov-person-list { margin-top: 6px; padding-left: 20px; }
.ov-person-head { display: flex; align-items: baseline; gap: var(--sp-sm); margin-bottom: 4px; min-width: 0; }
.ov-person-name { font-weight: 600; font-size: 0.9rem; }
.ov-person-role { font-size: 0.68rem; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-person-load { margin-left: auto; font-size: 0.72rem; white-space: nowrap; }
.ov-person-load b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ov-person-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-sm); margin-top: 6px; min-width: 0; }
.ov-strip { display: flex; gap: 2px; flex: 0 0 auto; width: 112px; height: 10px; }
.ov-strip-cell { flex: 1; border-radius: 2px; background: var(--glass-bg); }
.ov-strip-cell.is-weekend { opacity: 0.45; }
.ov-person-projects { flex: 1 1 200px; font-size: 0.7rem; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-unassigned { margin-top: var(--sp-md); padding-top: var(--sp-md); border-top: 1px dashed var(--glass-border); scroll-margin-top: 80px; }
.ov-unassigned-list { margin-top: var(--sp-xs); }

.ov-day { padding: var(--sp-sm) 0; border-top: 1px solid var(--glass-border); }
.ov-day:first-of-type { border-top: 0; padding-top: 0; }
.ov-day-head { display: flex; align-items: center; gap: var(--sp-sm); font-size: 0.74rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.ov-day-flag { font-size: 0.62rem; font-weight: 600; color: var(--error); background: color-mix(in srgb, var(--error) 12%, transparent); padding: 1px 6px; border-radius: 4px; }
.ov-event { display: grid; grid-template-columns: auto 1fr; gap: 1px var(--sp-sm); align-items: center; padding: 5px 0; cursor: pointer; }
.ov-event:hover .ov-event-name { color: var(--accent); }
.ov-event-name { font-size: 0.84rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-event-people { grid-column: 2; font-size: 0.68rem; color: var(--text-muted); }
.ov-event-people--none { color: var(--warning); }

.ov-ok {
  display: flex; align-items: center; gap: var(--sp-sm); padding: var(--sp-md); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--capacity-available) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--capacity-available) 30%, transparent);
  color: var(--capacity-available); font-size: 0.84rem; font-weight: 500;
}
/* Needs attention is a digest (Oct 11 2026): one row per KIND, so the
   card is a handful of rows however many alerts there are (18 that
   morning, and the page as long as the list). The rows tile into columns
   where the card is wide — the full-width strip at mid widths — and stack
   in the rail and on a phone. */
.ov-attn-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm); margin-bottom: 4px; }
.ov-attn-head .elt-section-title { margin-bottom: 0; }
.ov-attn-head .btn { padding-right: 0; }
.ov-attn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.ov-attn {
  display: flex; flex-direction: column; gap: 2px; padding: var(--sp-sm) var(--sp-md); cursor: pointer; min-width: 0;
  border-left: 3px solid var(--warning); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--warning) 7%, transparent);
}
.ov-attn:hover .ov-attn-text { color: var(--accent); }
.ov-attn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ov-attn--high { border-left-color: var(--error); background: color-mix(in srgb, var(--error) 7%, transparent); }
.ov-attn--low { border-left-color: var(--text-muted); background: var(--glass-bg); }
.ov-attn-text { font-size: 0.82rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ov-attn-meta { font-size: 0.68rem; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The jammed stages, each a door to its longest-sitting-first list */
.ov-attn-stages { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ov-attn-stage {
  font: inherit; font-size: 0.68rem; font-weight: 600; line-height: 1.2; padding: 3px 9px; cursor: pointer;
  border-radius: var(--radius-full); color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  font-variant-numeric: tabular-nums;
}
.ov-attn-stage.is-critical {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 45%, transparent);
  background: color-mix(in srgb, var(--error) 10%, transparent);
}
.ov-attn-stage:hover { filter: brightness(1.15); }
.ov-attn-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* On a phone the digest comes right after the numbers, before People */
.ov-attention { order: -1; }

/* Tiers follow the content width, not the viewport: the rail and the
   right-hand panel take ~550px at 1440, so a 1440 screen gives the
   Overview about 890px. */
.ov { container-type: inline-size; }
@container (min-width: 560px) {
  /* five tiles on two rows: 3 across, then 2 across, no empty slot */
  .ov-stats { grid-template-columns: repeat(6, 1fr); }
  .ov-stat { grid-column: span 2; }
  .ov-stat:nth-child(4), .ov-stat:nth-child(5) { grid-column: span 3; }
  .ov-top { flex-direction: row; align-items: center; }
}
@container (min-width: 760px) {
  .ov-detail-groups { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .ov-grid { grid-template-columns: 1.3fr 1fr; }
  .ov-attention { grid-column: 1 / -1; }   /* a strip above People · This week; its rows tile */
}
@container (min-width: 960px) {
  .ov-stats { grid-template-columns: repeat(5, 1fr); }
  .ov-stat, .ov-stat:nth-child(4), .ov-stat:nth-child(5) { grid-column: auto; }
}
@container (min-width: 1180px) {
  .ov-grid { grid-template-columns: 5fr 4fr 3fr; }
  .ov-attention { grid-column: auto; order: 0; }   /* the third column, rows stacked */
}

/* ── Capacity → Alerts (Oct 7 2026): one feed. Cards carry their severity
   on the left edge; the chips above filter by it. ── */
.al { container: al / inline-size; }
/* Oct 19 2026 (Zach: "its format is weird"): the tab used a 960px column on a
   2000px screen with the tools floating mid-page. Now a rail beside the
   list once the tab is wide, the list in severity sections, two cards a row
   when there's room; a stage's stuck list takes the row to itself. */
.al-layout { display: flex; flex-direction: column; gap: var(--sp-md); }
.al-rail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-xs) var(--sp-sm); }
.al-group-label { display: none; }
.al-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.al-filter b { font-weight: 600; margin-left: 2px; font-variant-numeric: tabular-nums; }
.al-tools { margin-left: auto; display: flex; gap: 2px; }
.al-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--severity-watch); flex-shrink: 0; }
.al-chip--critical .al-chip-dot, .al-section-head--critical .al-chip-dot { background: var(--severity-critical); }
.al-chip--warning .al-chip-dot, .al-section-head--warning .al-chip-dot { background: var(--severity-warning); }
.al-chip--insight .al-chip-dot, .al-section-head--insight .al-chip-dot { background: var(--severity-insight); }
.al-chip span:not(.al-chip-dot)::first-letter { text-transform: uppercase; }
.al-intro { flex-basis: 100%; font-size: 0.75rem; line-height: 1.5; color: var(--text-muted); margin: 0; }

.al-main { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-lg); }
.al-section-head {
  display: flex; align-items: center; gap: 8px; margin: 0 0 var(--sp-sm);
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary);
}
.al-section-head .al-chip-dot { display: none; }
.al-section-head[class*="al-section-head--"] .al-chip-dot { display: block; }
.al-section-count { color: var(--text-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.al-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-sm); }

.al-card {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: var(--sp-sm) var(--sp-md) var(--sp-md); border-radius: var(--radius-md);
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-left: 3px solid var(--severity-watch);
}
.al-card--critical { border-left-color: var(--severity-critical); background: color-mix(in srgb, var(--severity-critical) 5%, var(--glass-bg)); }
.al-card--warning { border-left-color: var(--severity-warning); }
.al-card--insight { border-left-color: var(--severity-insight); }
.al-card--cleared { opacity: 0.65; border-left-color: var(--text-muted); padding-bottom: var(--sp-sm); }
.al-card.is-busy { opacity: 0.6; pointer-events: none; }

.al-head { display: flex; align-items: center; gap: var(--sp-sm); min-height: 26px; min-width: 0; }
.al-head-toggle {
  display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1;
  background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.al-head-toggle:disabled { cursor: default; }
.al-type { font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.al-age { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }
.al-why { font-size: 0.68rem; color: var(--accent-text, var(--accent)); }
.al-head-toggle:hover .al-why { text-decoration: underline; }
.al-verbs { margin-left: auto; display: flex; gap: 2px; flex-shrink: 0; }
.al-verbs .btn { color: var(--text-muted); }
.al-verbs .btn:hover { color: var(--text-primary); }

.al-title { font-size: 0.95rem; font-weight: 500; line-height: 1.35; color: var(--text-primary); }
.al-title--link {
  background: none; border: 0; padding: 0; font: inherit; font-size: 0.95rem; font-weight: 500; line-height: 1.35;
  color: var(--text-primary); text-align: left; cursor: pointer; align-self: flex-start;
}
.al-title--link:hover { color: var(--accent-text, var(--accent)); text-decoration: underline; text-underline-offset: 3px; }
.al-meta { font-size: 0.72rem; color: var(--text-muted); }

/* Several projects (a stuck stage, a film conflict): a list, name left, days right. */
.al-projects {
  list-style: none; margin: 4px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 var(--sp-lg);
}
.al-project {
  display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 5px 0; min-width: 0;
  background: none; border: 0; border-bottom: 1px solid var(--glass-border); font: inherit; font-size: 0.8rem;
  color: var(--text-secondary); text-align: left; cursor: pointer;
}
.al-project:hover .al-project-name { color: var(--accent-text, var(--accent)); text-decoration: underline; }
.al-project-time { color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.al-project-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-project-days { color: var(--text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }

.al-detail { font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary); margin: 2px 0 0; max-width: 80ch; }

/* The next step is advice, not a button: a quiet line with one verb beside it. */
.al-foot { margin-top: auto; padding-top: var(--sp-xs); display: flex; flex-direction: column; gap: 6px; }
.al-next {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label btn" "text btn";
  align-items: center; gap: 2px var(--sp-md);
  padding: 8px 10px; border-radius: var(--radius-sm, 6px);
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
}
.al-next-label { grid-area: label; font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.al-next-text { grid-area: text; margin: 0; font-size: 0.8rem; line-height: 1.45; color: var(--text-secondary); }
.al-next .btn { grid-area: btn; white-space: nowrap; }
.al-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-sm); }
.al-more {
  background: none; border: 0; padding: 0; font: inherit; font-size: 0.78rem; cursor: pointer;
  color: var(--accent-text, var(--accent));
}
.al-more:hover { text-decoration: underline; }

@container al (min-width: 900px) {
  .al-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--sp-xl); align-items: start; }
  .al-rail { position: sticky; top: 0; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: var(--sp-md); }
  .al-group-label { display: block; font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 4px 10px; }
  .al-filters { flex-direction: column; flex-wrap: nowrap; gap: 1px; }
  .al-rail .chip.al-filter {
    width: 100%; justify-content: flex-start; gap: 8px; padding: 6px 10px; border: 0; border-radius: var(--radius-sm, 6px);
    background: transparent; font-size: 0.8rem;
  }
  .al-rail .chip.al-filter:hover { background: var(--glass-bg); }
  .al-rail .chip.al-filter.active { background: var(--glass-bg); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--glass-border); }
  .al-rail .chip.al-filter b { margin-left: auto; color: var(--text-muted); font-weight: 500; }
  .al-tools { margin-left: 0; flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid var(--glass-border); padding-top: var(--sp-sm); }
  .al-tools .btn { justify-content: flex-start; }
  .al-intro { padding: 0 10px; }
}
@container al (min-width: 1300px) {
  .al-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .al-card--span { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  /* Filters one swipeable row each; the note lives in Legend on a phone. */
  .al-group { flex-basis: 100%; min-width: 0; }
  .al-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .al-filters::-webkit-scrollbar { display: none; }
  .al-filter { flex-shrink: 0; }
  .al-intro { display: none; }
  .al-next { grid-template-columns: minmax(0, 1fr); grid-template-areas: "label" "text" "btn"; }
  .al-next .btn { justify-self: start; margin-top: 4px; }
}

/* Capacity → Legend tab: how the numbers are made (Oct 2026). Sits in
   .elt-section cards inside the page's .elt-grid-2. The two live equations
   (.cap-key-eq) are the one loud element; everything else stays quiet.
   Type: the mono slot (--font-mono, set per palette, not by the Appearance
   pairing) is used only for the small uppercase sub-heads, as the page's
   own card titles are; every number, operator and formula sits in the
   pairing's UI face with tabular numerals (Zach, Oct 7 2026). */
.cap-key-intro {
  font-size: 0.86rem; line-height: 1.45; color: var(--text-secondary);
  max-width: 62ch; margin: 0 0 var(--sp-lg);
}
.cap-key-link { padding-left: 0; }

/* In short: three tiles, each a door */
.cap-key-sum {
  display: grid; grid-template-columns: 1fr; gap: var(--sp-sm);
  margin-bottom: var(--sp-lg);
}
.cap-key-sum-tile {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: var(--sp-md) var(--sp-lg); cursor: pointer; color: inherit; font: inherit;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent); border-radius: var(--radius-md);
}
.cap-key-sum-tile:hover { background: color-mix(in srgb, var(--accent) 8%, var(--glass-bg)); }
.cap-key-sum-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cap-key-sum-kicker { font-size: 0.68rem; color: var(--accent); font-weight: 600; }
.cap-key-sum-title { font-size: 1rem; font-weight: 600; line-height: 1.25; }
.cap-key-sum-text { font-size: 0.76rem; line-height: 1.4; color: var(--text-secondary); }
.cap-key-sum-unit { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

/* The live equation */
.cap-key-eq {
  display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-xs);
  margin: var(--sp-sm) 0 var(--sp-md);
}
.cap-key-term {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 0;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
}
.cap-key-term--result {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--glass-border));
  background: color-mix(in srgb, var(--accent) 10%, var(--glass-bg));
}
.cap-key-term-label { font-size: 0.68rem; color: var(--text-muted); }
.cap-key-term-value { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 600; line-height: 1.2; }
.cap-key-term-hint { font-size: 0.68rem; line-height: 1.3; color: var(--text-muted); }
.cap-key-result-value { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 1.7rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
.cap-key-result-of { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-left: 2px; }
.cap-key-op {
  align-self: center; font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 1.1rem;
  color: var(--text-muted); line-height: 1; padding: 0 2px;
}
.cap-key-select-wrap { position: relative; display: block; }
.cap-key-select {
  width: 100%; appearance: none; -webkit-appearance: none;
  background: transparent; border: 0; border-bottom: 1px dashed var(--glass-border);
  color: var(--text-primary); font: inherit; font-size: 0.9rem; font-weight: 600;
  padding: 2px 18px 3px 0; cursor: pointer; border-radius: 0;
}
.cap-key-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cap-key-select-wrap::after {
  content: ''; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px;
  border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.cap-key-meter {
  display: block; height: 4px; margin: 6px 0 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 18%, transparent); overflow: hidden;
}
.cap-key-meter-fill { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s ease; }
.cap-key-toggle { padding-left: 0; margin-top: var(--sp-xs); }

/* The three priority ladders */
.cap-key-ladders { display: grid; grid-template-columns: 1fr; gap: var(--sp-md); margin-top: var(--sp-md); }
.cap-key-ladder { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cap-key-ladder-title { font-size: 0.78rem; font-weight: 600; margin-bottom: 2px; }
.cap-key-rung {
  display: grid; grid-template-columns: 28px 1fr; gap: var(--sp-sm); align-items: start;
  text-align: left; padding: 6px 8px 6px 6px; cursor: pointer; color: inherit; font: inherit;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
}
.cap-key-rung:hover { background: var(--glass-bg); }
.cap-key-rung:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cap-key-rung--on { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cap-key-rung-score {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 6px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 0.8rem; font-weight: 600;
  background: color-mix(in srgb, var(--accent) var(--rung, 30%), transparent);
}
.cap-key-rung-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cap-key-rung-label { font-size: 0.8rem; font-weight: 600; line-height: 1.25; }
.cap-key-rung-detail { font-size: 0.7rem; line-height: 1.35; color: var(--text-muted); }

/* Complexity strip */
.cap-key-strip { display: flex; gap: 2px; margin: var(--sp-sm) 0 var(--sp-md); }
.cap-key-strip-seg {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 2px; border-radius: 4px; text-align: center;
  background: color-mix(in srgb, var(--accent) var(--tint, 20%), transparent);
}
.cap-key-strip-range { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 0.68rem; font-weight: 600; }
.cap-key-strip-label { font-size: 0.6rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Load flow */
.cap-key-flow { display: flex; flex-direction: column; gap: 4px; margin: var(--sp-sm) 0; }
.cap-key-flow-arrow { width: 18px; height: 18px; color: var(--text-muted); align-self: center; flex-shrink: 0; transform: rotate(90deg); }
.cap-key-step {
  display: flex; flex-direction: column; gap: 2px; flex: 1 1 0; min-width: 0;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
}
.cap-key-step--branch { border-style: dashed; margin: var(--sp-sm) 0 var(--sp-md); }
.cap-key-step-title { font-size: 0.8rem; font-weight: 600; }
.cap-key-step-text { font-size: 0.72rem; line-height: 1.4; color: var(--text-secondary); }

/* Scale bar */
.cap-key-bar { display: flex; gap: 2px; height: 18px; margin-top: var(--sp-sm); }
.cap-key-bar-seg { min-width: 0; border-radius: 3px; }
.cap-key-bar-row { display: flex; gap: 2px; margin-top: 4px; }
.cap-key-bar-cell { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cap-key-bar-name { font-size: 0.66rem; font-weight: 600; line-height: 1.2; }
.cap-key-bar-range { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 0.62rem; color: var(--text-muted); }

/* Reference tables, lists, definitions */
.cap-key-formula {
  font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 0.74rem; line-height: 1.4;
  padding: var(--sp-sm) var(--sp-md); margin: 0 0 var(--sp-md);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); overflow-wrap: anywhere;
}
.cap-key-formula--tight { margin-bottom: var(--sp-md); }
.cap-key-tables { display: grid; grid-template-columns: 1fr; gap: var(--sp-md); }
.cap-key-table { min-width: 0; display: flex; flex-direction: column; }
.cap-key-head {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted);
  margin-bottom: var(--sp-xs);
}
.cap-key-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--sp-sm); padding: 4px 0; font-size: 0.78rem;
  border-bottom: 1px solid var(--glass-border);
}
.cap-key-row:last-child { border-bottom: 0; }
.cap-key-row--stack { align-items: flex-start; }
.cap-key-k { min-width: 0; color: var(--text-primary); }
.cap-key-k-strong { font-weight: 600; }
.cap-key-v {
  font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-size: 0.72rem; color: var(--text-secondary);
  white-space: nowrap; flex-shrink: 0;
}
.cap-key-sub { display: block; font-size: 0.68rem; line-height: 1.35; color: var(--text-muted); }
.cap-key-note { font-size: 0.7rem; line-height: 1.4; color: var(--text-muted); margin-top: var(--sp-sm); }
.cap-key-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cap-key-list li { position: relative; padding-left: 14px; font-size: 0.76rem; line-height: 1.45; }
.cap-key-list li::before {
  content: ''; position: absolute; left: 0; top: 0.6em; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent); opacity: 0.8;
}
.cap-key-list b, .cap-key-step-text b { font-weight: 600; }
.cap-key-wide { grid-column: 1 / -1; }
.cap-key-tabs { display: grid; grid-template-columns: 1fr; gap: var(--sp-lg); }
.cap-key-tab { min-width: 0; }
.cap-key-def { display: grid; grid-template-columns: 1fr; gap: 2px var(--sp-md); margin: 0; }
.cap-key-def dt { font-size: 0.76rem; font-weight: 600; padding-top: 6px; }
.cap-key-def dd { margin: 0 0 4px; font-size: 0.74rem; line-height: 1.45; color: var(--text-secondary); }
.cap-key-def-pair { display: contents; }
.cap-key-targets { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.cap-key-target { font-size: 0.72rem; white-space: nowrap; }
.cap-key-target b { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-primary); }
.cap-key-rules { display: flex; flex-direction: column; }
.cap-key-rule-head { display: none; }
.cap-key-rule {
  display: grid; grid-template-columns: 1fr; gap: 2px;
  padding: var(--sp-sm) 0; border-top: 1px solid var(--glass-border); font-size: 0.74rem; line-height: 1.45;
}
.cap-key-rule-name { font-weight: 600; font-size: 0.78rem; }
.cap-key-rule-text { color: var(--text-secondary); }
.cap-key-rule-sev { color: var(--text-muted); font-size: 0.7rem; }

@media (min-width: 640px) {
  .cap-key-sum { grid-template-columns: repeat(3, 1fr); }
  .cap-key-eq { flex-direction: row; align-items: stretch; gap: var(--sp-sm); }
  .cap-key-term--result { flex: 1.15 1 0; }
  .cap-key-tables { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .cap-key-tabs { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .cap-key-ladders { grid-template-columns: repeat(3, 1fr); }
  .cap-key-flow { flex-direction: row; align-items: stretch; gap: var(--sp-xs); }
  .cap-key-flow-arrow { transform: none; }
  .cap-key-def { grid-template-columns: minmax(120px, 170px) 1fr; }
  .cap-key-def dt, .cap-key-def dd { padding-top: 6px; margin: 0; border-top: 1px solid var(--glass-border); }
  .cap-key-def dt:first-of-type, .cap-key-def dd:first-of-type { border-top: 0; padding-top: 0; }
  .cap-key-rule-head { display: grid; grid-template-columns: minmax(130px, 180px) 1fr minmax(150px, 220px); gap: var(--sp-md);
    font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding-bottom: 4px; }
  .cap-key-rule { grid-template-columns: minmax(130px, 180px) 1fr minmax(150px, 220px); gap: var(--sp-md); align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .cap-key-meter-fill { transition: none; }
  .ov-person-chevron { transition: none; }
}

/* Timeline */
.timeline-container {
  position: relative;
  height: 220px;
  margin-top: var(--sp-sm);
}
.timeline-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100%;
  padding-bottom: 24px;
}
.timeline-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 28px;
  flex-shrink: 0;
  height: 100%;
  justify-content: flex-end;
}
.timeline-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  position: relative;
  transition: height 0.3s ease;
}
.timeline-bar-label {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}
.timeline-week-label {
  font-size: 0.5rem;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: nowrap;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  height: 20px;
}
.timeline-100-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  z-index: 1;
  pointer-events: none;
}
.timeline-100-label {
  position: absolute;
  right: 4px;
  top: -10px;
  font-size: 0.55rem;
  color: var(--text-secondary);
}

/* Conflict / Alert cards */
.conflict-card {
  margin-bottom: var(--sp-sm);
  padding: var(--sp-md) !important;
  border-left: 3px solid var(--warning, #d97706);
}
.conflict-card:has(.conflict-badge--hard) {
  border-left-color: var(--danger, #c43e3e);
}
.conflict-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-xs);
}
.conflict-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-inverse);
}
.conflict-badge--hard { background: var(--danger, #c43e3e); }
.conflict-badge--soft { background: var(--warning, #d97706); }
.conflict-date {
  font-size: 0.75rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-secondary);
}
.conflict-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-sm);
}
.conflict-projects {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.conflict-project-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--glass-bg);
  transition: background 0.15s;
}
.conflict-project-row:active {
  background: var(--glass-bg-hover);
}
.conflict-project-time {
  font-size: 0.75rem;
  font-family: var(--font-mono, monospace);
  color: var(--accent, #c43e3e);
  min-width: 42px;
  font-weight: 600;
}
.conflict-project-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}
.risk-factor {
  font-size: 0.75rem;
  color: var(--danger, #c43e3e);
  padding: 2px 0;
}
.risk-factor::before {
  content: '\26A0\FE0F ';
  font-size: 0.7rem;
}

/* Empty state — see components.css for base styles */

/* Mobile responsive */
@media (max-width: 600px) {
  .forecast-cards { grid-template-columns: 1fr; }
  .forecast-card { padding: var(--sp-xs) !important; }
  .forecast-utilization { font-size: 1.25rem; }
  .timeline-container { height: 180px; }
  .timeline-col { min-width: 22px; }
}

/* ── Saved Views ──────────────────────────────────────────────── */
.pipeline-tabs .chip-outline:hover {
  border-color: var(--accent, #6366f1);
}

/* ── Approval badges ──────────────────────────────────────────── */
.badge-ghost {
  background: var(--surface-alt, rgba(255, 255, 255, 0.05));
  color: var(--text-secondary);
  font-size: 0.65rem;
}

.section-link {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.02em;
  color: var(--accent-text, #b5725a);
  cursor: pointer;
  text-decoration: none;
}

/* ── Dashboard Capacity Forecast Widgets ──────────────────────── */
.cap-dash-wrap {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

/* Forecast strip: 3 compact cards */
.cap-dash-forecast {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-sm);
}

.cap-dash-forecast-card {
  padding: var(--sp-sm) var(--sp-md);
  text-align: center;
}

.cap-dash-forecast-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.cap-dash-forecast-util {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cap-dash-forecast-status {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
}

/* Mini heatmap: 7-col grid */
.cap-dash-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cap-dash-heat-cell {
  aspect-ratio: 1.6 / 1;
  border-radius: 3px;
  background: var(--glass-bg);
  min-height: 12px;
}
/* Same token-derived ramp as .cap-heat-* above — kept in sync. */
.cap-dash-heat-cell.cap-heat-light     { background: color-mix(in srgb, var(--capacity-available) 25%, transparent); }
.cap-dash-heat-cell.cap-heat-available { background: color-mix(in srgb, var(--capacity-available) 45%, transparent); }
.cap-dash-heat-cell.cap-heat-busy      { background: color-mix(in srgb, var(--warning) 35%, transparent); }
.cap-dash-heat-cell.cap-heat-near      { background: color-mix(in srgb, color-mix(in srgb, var(--warning) 50%, var(--error) 50%) 50%, transparent); }
.cap-dash-heat-cell.cap-heat-over      { background: color-mix(in srgb, var(--error) 60%, transparent); }

/* Spark timeline */
.cap-dash-spark-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cap-dash-spark-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--text-muted);
}

.cap-dash-spark-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 64px;
}

.cap-dash-spark-bar {
  flex: 1;
  min-width: 0;
  border-radius: 2px 2px 0 0;
  transition: height var(--duration-normal, 0.2s) var(--ease-out, ease-out);
}

.cap-dash-spark-100 {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--text-muted);
  opacity: 0.3;
  pointer-events: none;
}

/* ── Archived search + meta ───────────────────────────────────── */
.archived-search-wrap {
  position: relative;
  margin-bottom: var(--sp-md);
}
.archived-search-wrap .form-input {
  padding-right: 80px;
}
.archived-search-count {
  position: absolute;
  right: var(--sp-md);
  top: 50%;
  transform: translateY(-50%);
}
.archived-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs) var(--sp-md);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--sp-xs);
}

/* ── Pipeline archived badge color ────────────────────────────── */
.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ── Dashboard Load Animation ────────────────────────────────── */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-grid > * {
  animation: fade-up 0.3s ease-out both;
}

.dashboard-grid > *:nth-child(1) { animation-delay: 0s; }
.dashboard-grid > *:nth-child(2) { animation-delay: 0.05s; }

.dashboard-grid-left > *,
.dashboard-grid-right > * {
  animation: fade-up 0.3s ease-out both;
}

.dashboard-grid-left > *:nth-child(1) { animation-delay: 0.05s; }
.dashboard-grid-left > *:nth-child(2) { animation-delay: 0.1s; }
.dashboard-grid-left > *:nth-child(3) { animation-delay: 0.15s; }
.dashboard-grid-left > *:nth-child(4) { animation-delay: 0.2s; }
.dashboard-grid-left > *:nth-child(5) { animation-delay: 0.25s; }
.dashboard-grid-right > *:nth-child(1) { animation-delay: 0.1s; }
.dashboard-grid-right > *:nth-child(2) { animation-delay: 0.15s; }
.dashboard-grid-right > *:nth-child(3) { animation-delay: 0.2s; }
.dashboard-grid-right > *:nth-child(4) { animation-delay: 0.25s; }

.home-stats {
  animation: fade-up 0.3s ease-out both;
}

/* ── Project Detail Tab Animations ────────────────────────────── */
.detail-tab-content {
  min-height: 0;
}

.tab-slide-enter-left {
  animation: tabSlideLeft 0.25s ease-out;
}
.tab-slide-enter-right {
  animation: tabSlideRight 0.25s ease-out;
}

@keyframes tabSlideLeft {
  from { transform: translateX(30px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes tabSlideRight {
  from { transform: translateX(-30px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Stage Progress Bar ───────────────────────────────────────── */
.stage-progress-bar {
  display: flex;
  align-items: center;
  padding: var(--sp-sm) var(--sp-lg);
  margin: var(--sp-xs) 0 var(--sp-sm);
  gap: 0;
  overflow-x: auto;
  background: var(--glass-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  -webkit-overflow-scrolling: touch;
}

.stage-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  min-width: 0;
}

.stage-progress-step::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.stage-progress-step:last-child::after {
  display: none;
}

/* These used to hardcode a second, different-hued palette (purple/gold/etc)
   that didn't match the --stage-* colors used everywhere else (badges,
   kanban), so the same project showed two different stage colors at once.
   index.html binds this element's --step-color to `var(--step-<stage>)`
   inline (see stage-progress-step template), so the --step-* custom
   properties themselves can't be deleted without breaking that binding —
   instead they're aliased 1:1 to --stage-* so there is only one palette. */
.stage-progress-bar {
  --step-forecast: var(--stage-forecast);
  --step-intake: var(--stage-intake);
  --step-preproduction: var(--stage-preproduction);
  --step-production: var(--stage-production);
  --step-post: var(--stage-post);
  --step-review: var(--stage-review);
  --step-completion: var(--stage-completion);
}

.stage-progress-step--done::after {
  background: var(--step-color, var(--accent));
}

.stage-progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  z-index: 1;
  transition: all 0.2s ease;
}

.stage-progress-step--done .stage-progress-dot {
  background: var(--step-color, var(--accent));
}

.stage-progress-step--active .stage-progress-dot {
  width: 16px;
  height: 16px;
  background: var(--step-color, var(--accent));
  box-shadow: 0 0 8px var(--step-color, var(--accent));
}

.stage-progress-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stage-progress-step--done .stage-progress-label {
  color: var(--text-secondary);
}

.stage-progress-step--active .stage-progress-label {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Film Date Countdown Badge ────────────────────────────────── */
.badge-countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.badge-countdown.badge-error {
  animation: countdownPulse 1.5s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Tally Intelligence Card ──────────────────────────────────── */
.tally-intel-card {
  padding: var(--sp-sm) var(--sp-md) !important;
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.risk-alert-inline {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
}

.risk-alert-inline .risk-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.risk-alert-inline.risk-warning {
  border-left-color: var(--error, #c43e3e);
  background: rgba(196, 62, 62, 0.06);
}
.risk-alert-inline.risk-warning .risk-icon {
  color: var(--error, #c43e3e);
}

.risk-alert-inline.risk-watch {
  border-left-color: var(--warning, #d4a843);
  background: rgba(212, 168, 67, 0.06);
}
.risk-alert-inline.risk-watch .risk-icon {
  color: var(--warning, #d4a843);
}

.risk-alert-inline.risk-info {
  border-left-color: var(--info, #60BBE9);
  background: rgba(96, 187, 233, 0.06);
}
.risk-alert-inline.risk-info .risk-icon {
  color: var(--info, #60BBE9);
}

/* ── Sticky Detail Tab Bar ────────────────────────────────────── */
.detail-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  margin: 0 calc(-1 * var(--sp-lg));
  padding: 0 var(--sp-lg);
}

/* Remove top padding on project/series detail so sticky tabs sit flush against header */
.project-detail-body > .page-content {
  padding-top: 0;
}
.detail-header-compact {
  padding-top: var(--sp-lg);
}

/* ── Collapsible Sections ─────────────────────────────────────── */
.section-header--collapsible {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.section-header--collapsible:active {
  opacity: 0.7;
}

.section-chevron {
  transition: transform 0.2s ease;
  opacity: 0.4;
  flex-shrink: 0;
}

.section-chevron--open {
  transform: rotate(90deg);
}

/* ── Thread Tab Count ─────────────────────────────────────────── */
.thread-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 0.6rem;
  font-weight: 700;
  margin-left: 4px;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   BOOKING PAGE
   ═══════════════════════════════════════════════════════════════════ */

.booking-tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  padding-bottom: var(--sp-md);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: var(--sp-md);
}
/* Visual treatment: see Unified Tab Bar section above. Auto-width,
   non-scrolling row is this component's own layout — nothing to
   override here. */

/* ── Booking Cards ───────────────────────────────────────────── */
.booking-card {
  padding: var(--sp-md);
  margin-bottom: var(--sp-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.booking-card:active { transform: scale(0.98); }
.booking-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-sm);
}
.booking-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.booking-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.booking-card-project {
  font-size: 0.72rem;
  color: var(--accent);
  margin-top: 2px;
}
.booking-status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: capitalize;
  white-space: nowrap;
  flex-shrink: 0;
}
.booking-confirmed-info {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--sp-xs);
  font-size: 0.78rem;
  color: var(--stage-review);
}

/* ── Booking Detail (expanded) ───────────────────────────────── */
.booking-detail {
  margin-top: var(--sp-md);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--glass-border);
}
.booking-detail-section {
  margin-bottom: var(--sp-md);
}
.booking-detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--sp-xs);
}
.booking-slot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}
.booking-slot-confirmed {
  background: rgba(var(--accent-rgb), 0.08);
}

/* ── Token Rows ──────────────────────────────────────────────── */
.booking-token-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  transition: background var(--duration-fast);
}
.booking-token-active {
  background: rgba(var(--accent-rgb), 0.06);
  border-left: 2px solid var(--accent);
}
.booking-token-info {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.booking-token-name {
  font-size: 0.82rem;
  font-weight: 500;
}
.booking-token-status {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: capitalize;
}
.booking-token-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ── Contact Cards ───────────────────────────────────────────── */
.contact-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-sm) var(--sp-md);
  margin-bottom: var(--sp-xs);
}
.contact-info { flex: 1; min-width: 0; }
.contact-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.contact-email {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.contact-phone {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.contact-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ── Contact Picker (new booking) ────────────────────────────── */
.contact-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.contact-pick-item {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--duration-fast);
  user-select: none;
}
.contact-pick-item.selected {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}

/* ── Selected Contacts Order ─────────────────────────────────── */
.selected-contacts-order {
  margin-top: var(--sp-sm);
}
.priority-contact-row {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 6px 8px;
  font-size: 0.82rem;
}
.priority-num {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--glass-bg);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.priority-arrows {
  margin-left: auto;
  display: flex;
  gap: 2px;
}

/* ── Mode Toggle ─────────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.mode-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.mode-btn.active {
  background: var(--accent);
  color: var(--accent-on);
}
.form-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Booking Inputs ──────────────────────────────────────────── */
/* Base glass trio + focus/placeholder: see canonical text input block
   near .form-input. */
.booking-input,
.modal-card .input {
  padding: 10px 12px;
  font-size: 0.85rem;
}
.modal-card textarea.input {
  resize: vertical;
}

/* ── Slot Row ────────────────────────────────────────────────── */
.slot-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.slot-row .input {
  font-size: 0.78rem;
  padding: 8px;
}
.slot-row input[type="date"] { flex: 1.5; }
.slot-row input[type="time"] { flex: 1; }
.slot-row select { flex: 1; }
/* Phones: date + From/To selects don't fit on one line — the date takes
   its own; a date-to-date range still does. */
@media (max-width: 520px) {
  .slot-row { flex-wrap: wrap; }
  .slot-row:has(select) input[type="date"] { flex: 1 1 100%; }
}

/* ── Slot Conflict Warning ─────────────────────────────────── */
.slot-conflict-warning {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  margin-top: 2px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  background: rgba(255, 180, 50, 0.12);
  border: 1px solid rgba(255, 180, 50, 0.25);
  color: #f0b030;
  font-size: 0.72rem;
  line-height: 1.3;
}
.slot-conflict-warning svg {
  flex-shrink: 0;
  margin-top: 1px;
  stroke: #f0b030;
}

/* ── Project Search Results ──────────────────────────────────── */
.project-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary, var(--glass-bg));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  max-height: 180px;
  overflow-y: auto;
  z-index: 10;
  backdrop-filter: blur(var(--blur-lg));
}
.project-search-item {
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
}
.project-search-item:hover {
  background: var(--glass-bg-hover);
}
.selected-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--glass-bg);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

/* Empty state — see components.css for base styles */

/* ── Modal Card (booking modals) ─────────────────────────────── */
.modal-card {
  background: var(--bg-secondary, #1e1e1e);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn var(--duration-normal, 200ms) var(--ease-out, ease-out);
}
.modal-card--lg {
  max-width: 520px;
  width: 95%;
}

/* ── Capacity History ────────────────────────────────────── */
.history-view-toggle {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: var(--sp-md);
  padding: 2px;
}
.history-toggle-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.15s ease;
}
.history-toggle-btn.active {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}
.history-months-select {
  width: auto !important;
  padding: 4px 8px !important;
  font-size: 0.75rem !important;
  min-width: 60px;
}
.history-summary-card {
  padding: var(--sp-md);
  margin-bottom: var(--sp-md);
}
.history-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-sm);
}
.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-xs);
}
/* Base tile/value/label look: see Unified Stat Tile section near
   .stat-card. Sits inside an already-bordered grid cell, so drop the
   tile's own padding/background/border; compact context keeps a
   smaller value size + tighter label letter-spacing. */
.history-stat {
  padding: 0;
  background: none;
  border: none;
}
.history-stat-value {
  font-size: 1.1rem;
  margin-bottom: 0;
}
.history-stat-label {
  letter-spacing: 0.03em;
  margin-top: 2px;
}
.history-filter-row {
  display: flex;
  gap: 4px;
  margin-bottom: var(--sp-md);
  flex-wrap: wrap;
}
.history-filter-btn {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--glass-bg);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
}
.history-filter-btn.active {
  background: var(--accent);
  color: var(--accent-on);
}
.history-chart-container {
  position: relative;
  height: 220px;
  margin-top: var(--sp-sm);
}
.history-chart-container .timeline-scroll {
  height: 100%;
}
.history-100-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--error, #c43e3e);
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
}
.trend-over { background: var(--error); color: var(--text-inverse); }
.trend-at { background: var(--warning, #e8a838); color: #000; }
.trend-healthy { background: var(--accent); color: var(--accent-on); }
.trend-under { background: var(--text-secondary); color: var(--text-inverse); }

/* ── Category History ────────────────────────────────────── */
.cat-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}
.cat-summary-card {
  padding: var(--sp-sm) var(--sp-md);
}
.cat-summary-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cat-summary-name {
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
/* Base tile/value/label look: see Unified Stat Tile section near
   .stat-card. Bare inline number pair in a flex row, not a bordered
   tile, so drop the tile's own padding/background/border; compact
   context keeps a much smaller value size. */
.cat-summary-stat {
  padding: 0;
  background: none;
  border: none;
}
.cat-val {
  font-size: 0.85rem;
  margin-bottom: 0;
}
.cat-lbl {
  font-size: 0.55rem;
  text-transform: uppercase;
}
.cat-bar-wrap {
  position: relative;
  height: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: visible;
}
.cat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.cat-bar-target {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 1px;
}
.cat-chart-container {
  position: relative;
  height: 140px;
  margin-top: var(--sp-xs);
}
.cat-target-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(255,255,255,0.3);
  z-index: 1;
  pointer-events: none;
}
.var-ok { color: var(--accent); }
.var-over { color: var(--warning, #e8a838); }
.var-under { color: var(--error); }

@media (max-width: 400px) {
  .cat-summary-grid { grid-template-columns: 1fr; }
  .history-summary-grid { gap: 2px; }
  .history-stat-value { font-size: 0.95rem; }
}

/* ── Environment Asset Library ────────────────────────────────── */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-md);
  padding-bottom: calc(var(--nav-height, 64px) + var(--sp-lg));
}
@media (min-width: 768px) {
  .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}
.asset-card {
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
  border: 1px solid var(--border-primary);
  background: var(--glass-bg);
}
.asset-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.asset-thumbnail {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--glass-bg);
}
.asset-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.asset-type-badge {
  position: absolute;
  top: var(--sp-xs);
  left: var(--sp-xs);
}
.asset-wall-btn {
  position: absolute;
  top: var(--sp-xs);
  right: var(--sp-xs);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  backdrop-filter: blur(4px);
}
.asset-card:hover .asset-wall-btn,
.asset-wall-btn:focus-visible {
  opacity: 1;
}
.asset-wall-btn:hover {
  background: var(--accent);
  color: var(--accent-on);
  transform: scale(1.05);
}
@media (hover: none) {
  /* Always visible on touch devices */
  .asset-wall-btn { opacity: 1; background: rgba(0, 0, 0, 0.5); }
}
.asset-info {
  padding: var(--sp-sm) var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.asset-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-blue {
  background: rgba(96, 165, 250, 0.15);
  color: var(--event-color-1);
}
.badge-purple {
  background: rgba(167, 139, 250, 0.15);
  color: var(--event-color-2);
}

/* ── Concept Preview Gallery ─────────────────────── */
.preview-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-md);
}
.preview-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  transition: border-color 0.15s, transform 0.15s;
}
.preview-card:hover {
  border-color: var(--accent);
}
.preview-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.preview-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  overflow: hidden;
}
.preview-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.preview-card:hover .preview-card-image img {
  transform: scale(1.02);
}
.preview-card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  pointer-events: none;
}
.preview-card-badge--upscaled {
  background: var(--accent);
}
.preview-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-primary);
  border-top: 1px solid var(--glass-border);
}
.preview-action-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  font-size: 0.72rem;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}
.preview-action-btn svg {
  flex-shrink: 0;
}
.preview-action-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Narrow cards: hide button labels, show icon only. Tooltip stays via title=. */
@media (max-width: 1100px) {
  .preview-action-label {
    display: none;
  }
  .preview-action-btn {
    padding: 6px;
  }
}
.preview-card-overflow-wrap {
  position: relative;
  flex: 0 0 auto;
}
.preview-card-actions .btn-overflow {
  padding: 6px 8px;
}
.preview-card-overflow-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--bg-elevated, var(--bg-primary));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 8px 20px rgba(0,0,0,0.18));
  padding: 4px;
  z-index: 50;
}
.preview-card-overflow-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-align: left;
  font-size: 0.78rem;
  cursor: pointer;
}
.preview-card-overflow-menu button:hover {
  background: var(--bg-secondary);
}
.preview-card-overflow-menu button.danger {
  color: var(--color-error, #c93b3b);
}
.preview-card-overflow-menu .menu-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 4px 0;
}

@keyframes wallPanelSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}


@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}


/* ── Dashboard 2-Column at 1440px+ ──────────────────────────── */
@media (min-width: 1440px) {
  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-xl);
    align-items: start;
  }
  .home-stats {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* ── Context Menu (desktop right-click) ─────────────────────── */
.ctx-menu {
  position: fixed;
  z-index: 9999;
  min-width: 200px;
}
.ctx-menu .dropdown-item--danger {
  color: var(--severity-critical);
}

/* ── ELT Dashboard ──────────────────────────────────────────── */

/* Prevent horizontal overflow on the whole dashboard */
.page-content .elt-stat-row,
.page-content .elt-grid-2,
.page-content .elt-section {
  max-width: 100%; box-sizing: border-box;
}

.elt-stat-row {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: var(--sp-lg);
}

/* Base tile/value/label look: see Unified Stat Tile section near
   .stat-card. This one keeps its own glassmorphic extras (backdrop
   blur, specular ::before overlay, depth shadow) since no other class
   supplies them in markup — genuine addition, not drift. */
.elt-stat-card {
  position: relative; flex: 1 1 0; min-width: 0;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  box-shadow: var(--glass-inner-shadow), var(--glass-depth-shadow);
}
.elt-stat-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, var(--glass-specular) 0%, var(--glass-specular-edge) 50%);
  pointer-events: none; z-index: 1;
}
.elt-stat-card--danger { border-color: rgba(196, 62, 62, 0.4); }

.elt-stat-label {
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  font-weight: 500;
}
.elt-stat-value {
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0;
}
.elt-stat-suffix { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 500; opacity: 0.6; }
.elt-stat-compare {
  font-size: 0.7rem; margin-top: 4px; color: var(--text-muted);
}
.elt-trend-up { color: #4caf50; }
.elt-trend-down { color: var(--error); }

.elt-grid-2 {
  display: grid; grid-template-columns: 1fr;
  gap: var(--sp-lg); margin-bottom: var(--sp-lg);
}

.elt-section {
  position: relative;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-md); padding: var(--sp-lg);
  overflow: hidden; min-width: 0;
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  box-shadow: var(--glass-inner-shadow), var(--glass-depth-shadow);
}
.elt-section::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, var(--glass-specular) 0%, var(--glass-specular-edge) 50%);
  pointer-events: none; z-index: 1;
}
.elt-section-title {
  font-family: var(--font-mono);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 4px;
}
.elt-stat-label {
  font-family: var(--font-mono);
}
.elt-section-desc {
  font-size: 0.7rem; color: var(--text-muted); opacity: 0.7;
  margin-bottom: var(--sp-md); line-height: 1.3;
}

/* Capacity bars */
.elt-bar-track {
  position: relative; height: 8px; background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 4px; overflow: visible;
}
.elt-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.6s ease; max-width: 100%;
}
.elt-bar-available { background: var(--capacity-available); }
.elt-bar-busy { background: var(--capacity-busy); }
.elt-bar-near { background: var(--warning); }
.elt-bar-over { background: var(--error); }
.elt-bar-100 {
  position: absolute; top: -3px; width: 2px; height: 14px;
  background: var(--text-muted); border-radius: 1px;
}
.elt-load-available { color: var(--capacity-available); }
.elt-load-busy { color: var(--capacity-busy); }
.elt-load-near { color: var(--warning); }
.elt-load-over { color: var(--error); }

/* Pipeline donut */

/* Pipeline layout */

/* Events */
.elt-event-badge {
  font-size: 0.6rem; padding: 2px 8px; border-radius: 4px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  flex-shrink: 0;
}
.elt-event-shoot { background: rgba(196, 62, 62, 0.15); color: var(--accent); }
.elt-event-delivery { background: rgba(76, 175, 80, 0.15); color: #4caf50; }

/* Risk cards */
.elt-risk-card {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
  word-break: break-word; overflow-wrap: break-word;
}
.elt-risk-high { border-left-color: var(--error); background: rgba(196, 62, 62, 0.06); }
.elt-risk-medium { border-left-color: var(--warning); background: rgba(255, 152, 0, 0.06); }

/* Throughput chart */

/* Desktop: 2-column grid */
@media (min-width: 1024px) {
  .elt-grid-2 { grid-template-columns: 1fr 1fr; }
  .elt-stat-card { min-width: 0; }
  .elt-stat-value { font-size: 2.4rem; }
  .elt-throughput-chart { height: 120px; }
}

/* Mobile: stack stat cards */
@media (max-width: 767.98px) {
  .elt-stat-row { flex-wrap: wrap; }
  .elt-stat-card { flex: 1 1 calc(50% - 6px); min-width: 0; }
}

/* ── Review Note Resolve Checkboxes ──────────────────────────── */
.review-note-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  transition: opacity 0.2s, background 0.2s;
}
.review-note-row--resolved {
  opacity: 0.5;
  background: rgba(76, 175, 80, 0.06);
  border-color: rgba(76, 175, 80, 0.15);
}
.review-note-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 0.15s;
  padding: 0;
}
.review-note-check:hover {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
}
.review-note-check--done {
  background: #4caf50 !important;
  border-color: #4caf50 !important;
}

/* ── Home Sidebar (Action Queue + Tally Chat) ──────────────────── */
.home-sidebar-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 480px;
  gap: 0;
}

.home-sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--sp-xs) 0;
  margin-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--glass-border);
}

/* Top half: action queue, scrollable */
.home-sidebar-actions {
  flex: 1 1 50%;
  min-height: 120px;
  overflow-y: auto;
  padding-right: 2px;
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: var(--sp-md);
}

.home-sidebar-actions::-webkit-scrollbar { width: 3px; }
.home-sidebar-actions::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

.home-sidebar-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: var(--sp-md) var(--sp-xs);
  text-align: center;
}

.action-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-sm);
  padding: var(--sp-xs) var(--sp-sm);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  margin-bottom: 2px;
  transition: background 0.12s ease;
}

.action-row:hover {
  background: var(--glass-bg-hover);
}

.action-row--warning {
  border-left-color: var(--severity-warning, #d4a04a);
}

.action-row--critical {
  border-left-color: var(--severity-critical, #c43e3e);
  background: rgba(196, 62, 62, 0.04);
}

.action-row-icon {
  font-size: 0.875rem;
  width: 16px;
  flex-shrink: 0;
  text-align: center;
  opacity: 0.85;
  margin-top: 1px;
}

.action-row-body {
  flex: 1;
  min-width: 0;
}

.action-row-title {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.action-row-meta {
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom half: chat panel */
.home-sidebar-chat {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  overflow: hidden;
}

.home-sidebar-chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  padding: var(--sp-xs) 2px var(--sp-sm);
}

.home-sidebar-chat-log::-webkit-scrollbar { width: 3px; }
.home-sidebar-chat-log::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

.home-sidebar-chat-hint {
  text-align: center;
  padding: var(--sp-md) var(--sp-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
}
.home-sidebar-chat-hint p { margin: 0; }

.home-sidebar-chat-msg {
  display: flex;
}

.home-sidebar-chat-msg--user {
  justify-content: flex-end;
}

.home-sidebar-chat-bubble {
  max-width: 85%;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.home-sidebar-chat-msg--user .home-sidebar-chat-bubble {
  background: var(--accent-soft);
  color: var(--text-primary);
  border-bottom-right-radius: var(--radius-sm);
}

.home-sidebar-chat-msg--claude .home-sidebar-chat-bubble {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
}

.home-sidebar-chat-input {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-xs);
  padding-top: var(--sp-sm);
  border-top: 1px solid var(--glass-border);
}

/* Base glass trio + focus/placeholder: see canonical text input block
   near .form-input. */
.home-sidebar-chat-input textarea {
  flex: 1;
  min-height: 32px;
  max-height: 120px;
  resize: none;
  padding: 6px 8px;
  font-size: 0.8125rem;
  line-height: 1.4;
  font-family: inherit;
}


/* Calendar view-mode segmented toggle (Month / Sundays) */
.cal-view-toggle {
  display: inline-flex;
  gap: 0;
  margin: 0;
  padding: 3px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  align-self: flex-start;
}
.cal-view-toggle-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  padding: var(--sp-sm) var(--sp-md);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  min-width: 76px;
}
.cal-view-toggle-btn:hover {
  color: var(--text-primary);
}
.cal-view-toggle-btn--active {
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
}
.cal-view-toggle-btn--active:hover {
  color: var(--accent-on);
}

/* Save Setup project picker list */
.save-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 600px;
  margin: 0 auto;
}
.save-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
  width: 100%;
  font: inherit;
}
.save-picker-item:hover {
  border-color: var(--accent);
}
.save-picker-item--selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on);
}
.save-picker-item--selected .save-picker-item-sub {
  color: rgba(255, 255, 255, 0.85);
}
.save-picker-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.save-picker-item-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.save-picker-item-sub {
  color: var(--text-secondary);
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── AI Editor: transcript-with-clickable-words view ──────────────────── */
.transcript-view {
  /* Block iOS native text-selection / double-tap zoom so taps land on
     word spans as clicks instead of starting a system text selection. */
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.transcript-view .word {
  display: inline;
  cursor: pointer;
  padding: 1px 2px;
  border-radius: 3px;
  transition: background 0.1s ease;
}
.transcript-view .word:hover {
  background: var(--glass-bg-hover);
}
.transcript-view .word:active {
  background: rgba(255, 215, 0, 0.18);
}
.transcript-view .word--interviewer {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.2);
}
.transcript-view .word--soundbite {
  background: rgba(196, 62, 62, 0.18);
  border-bottom: 2px solid var(--accent);
}
.transcript-view .word--soundbite-manual {
  background: rgba(96, 187, 233, 0.18);
  border-bottom-color: #60BBE9;
}
.transcript-view .word--selecting {
  background: rgba(255, 215, 0, 0.28);
  outline: 1px solid rgba(255, 215, 0, 0.6);
}

.transcript-view .word-edit-input {
  display: inline-block;
  width: auto;
  min-width: 60px;
  padding: 1px 4px;
  font-size: 0.9rem;
  line-height: 1.4;
  vertical-align: baseline;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--text-primary);
}

/* ── Admin: user management ───────────────────────────────────── */
.is-inactive-row { opacity: 0.5; }

/* Keep the admin user/job lists at a comfortable reading width on
   wide desktop instead of stretching edge-to-edge in page-content--wide. */
@media (min-width: 1024px) {
  .admin-tabs,
  .admin-list-wrap {
    max-width: 720px;
  }
}

/* ── Interview Questions (project detail) ─────────────────────── */
.iq-toolbar {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-md);
}
.iq-progress-chip {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full, 999px);
  padding: 3px 10px;
  white-space: nowrap;
}

/* Interviewee tab strip — outlined chips, horizontal scroll on phones.
   pan-x + overscroll containment + snap keep the scroll on rails instead
   of the loose diagonal rubber-banding a bare overflow-x container gets. */
.iq-tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  margin-bottom: var(--sp-md);
  padding: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scroll-snap-type: x proximity;
}
.iq-tabs::-webkit-scrollbar { display: none; }
.iq-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full, 999px);
  transition: color var(--dur-fast, 150ms) ease, background var(--dur-fast, 150ms) ease,
              border-color var(--dur-fast, 150ms) ease;
}
.iq-tab:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
.iq-tab.active {
  color: var(--accent-text, var(--accent));
  border-color: var(--accent);
  background: var(--accent-soft);
}
.iq-tab-x {
  display: none;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  color: var(--text-tertiary);
}
.iq-tab.active .iq-tab-x { display: inline-flex; }
.iq-tab-x:hover { color: var(--error, #e5484d); background: var(--bg-primary); }

/* One card, grouped sections divided by rules — no floating boxes */
.iq-card {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg, var(--bg-secondary));
  overflow: hidden;
  margin-bottom: var(--sp-sm);
}
.iq-group { padding: var(--sp-sm) var(--sp-md); }
.iq-group + .iq-group { border-top: 1px solid var(--border-primary); }
.iq-group-head {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-xs) 0;
}
.iq-group-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.iq-group-count {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.iq-group-add {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.iq-group-add:hover { color: var(--accent-text, var(--accent)); background: var(--accent-soft); }

/* Question row — grid keeps wrapped text in its own column */
.iq-question {
  display: grid;
  grid-template-columns: auto auto 1fr 28px;
  gap: var(--sp-sm);
  align-items: start;
  padding: var(--sp-sm) 0;
}
.iq-question + .iq-question { border-top: 1px solid var(--border-primary); }
.iq-check {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--accent);
}
.iq-num {
  min-width: 16px;
  padding-top: 2px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: right;
  color: var(--accent-text, var(--accent));
  font-variant-numeric: tabular-nums;
}
.iq-text {
  font-size: 0.875rem;
  line-height: 1.55;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.iq-question.asked .iq-text {
  text-decoration: line-through;
  opacity: 0.5;
}
.iq-del {
  width: 28px;
  height: 28px;
  margin: -4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity var(--dur-fast, 150ms) ease;
}
.iq-question:hover .iq-del, .iq-question:focus-within .iq-del { opacity: 0.6; }
.iq-del:hover { opacity: 1 !important; color: var(--error, #e5484d); background: var(--bg-secondary); }
@media (pointer: coarse) {
  .iq-del { opacity: 0.45; }
}

.iq-notes {
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  padding: var(--sp-sm) var(--sp-md);
  margin-bottom: var(--sp-sm);
}

/* ── Wall Remote v2 — Library sheet (backgrounds + presets) ──────── */
.wall2-lib {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
}
.wall2-lib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: var(--sp-sm) var(--sp-md);
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--sp-sm));
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.wall2-lib-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-md);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--sp-md));
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.wall2-lib-section {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.wall2-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 640px) {
  .wall2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.wall2-tile {
  position: relative;
  min-width: 0;
}
.wall2-tile-pick {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.wall2-tile-pick:active { transform: scale(0.98); }
.wall2-tile-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wall2-tile.is-current .wall2-tile-pick { border-color: var(--accent); }
.wall2-tile-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}
.wall2-tile-name {
  display: block;
  padding: 6px 8px;
  font-size: 0.75rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wall2-tile-sub {
  display: block;
  padding: 0 8px 6px;
  margin-top: -2px;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wall2-tile-sub:empty { display: none; }
.wall2-tile-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wall2-tile-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--accent-on, #fff);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}
.wall2-lib-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: var(--sp-lg) 0;
}

/* ── Wall Remote v2 — tabs, slider component, DOF ──────────────────
   Layout lives in classes, never in inline style on an x-show element:
   Alpine strips the inline `display` when it shows the element, which
   silently turned these flex columns into blocks (the "cornered" DOF tab). */
.wall2-tab, .wall2-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wall2-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 0 24px;
}
.wall2-ctl { display: flex; flex-direction: column; gap: 2px; }
.wall2-ctl--divided { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--glass-border); }
.wall2-ctl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.wall2-ctl-label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); }
.wall2-ctl-value {
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.wall2-ctl-hint {
  display: flex;
  justify-content: space-between;
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: -6px;
  padding: 0 2px;
}
.wall2-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;              /* full-height touch target; track drawn centered */
  margin: 0;
  background: transparent;
  outline: none;
  cursor: pointer;
  touch-action: pan-y;
  --p: 0%;
}
.wall2-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--glass-border) var(--p));
}
.wall2-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -10px;        /* (28 - 8) / 2 */
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s;
}
.wall2-slider:active::-webkit-slider-thumb { transform: scale(1.12); }
.wall2-slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: var(--glass-border);
}
.wall2-slider::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--accent); }
.wall2-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.wall2-slider:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.wall2-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wall2-note { font-size: 0.72rem; line-height: 1.4; color: var(--text-muted); }
.wall2-dof-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wall2-dof-status {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.85;
  text-transform: lowercase;
}
.wall2-dof-body { display: flex; flex-direction: column; gap: 14px; transition: opacity 0.15s; }
.wall2-dof.is-off .wall2-dof-body { opacity: 0.38; pointer-events: none; }
.wall2-connecting { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }

/* ── Wall Remote v2 — tap-to-focus on the preview ─────────────────── */
.wall2-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.wall2-preview.can-focus { cursor: crosshair; }
.wall2-focus-hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 0.68rem;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 9px;
  border-radius: 4px;
  pointer-events: none;
}
.wall2-focus-mark {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.wall2-focus-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.5);
  animation: wall2-focus-pop 0.35s ease-out;
}
.wall2-focus-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
@keyframes wall2-focus-pop {
  from { transform: scale(1.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.wall2-preview-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  background: #000;
}
.wall2-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--accent-soft, rgba(196, 62, 62, 0.12));
  border: 1px solid var(--glass-border);
}
.wall2-notice-text { flex: 1; font-size: 0.78rem; line-height: 1.35; color: var(--text-secondary); }
.wall2-notice-text strong { color: var(--text-primary); }
.wall2-notice .btn { flex-shrink: 0; }
.wall2-inactive { opacity: 0.55; }

/* ── Brief (project detail) — the linked social post's brief, read live ── */
.social-brief {
  padding: var(--sp-md) var(--sp-lg);
  margin-bottom: var(--sp-xs);
}
.social-brief-post {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: var(--sp-sm);
}
.social-brief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-sm) var(--sp-lg);
}
.social-brief-field--wide {
  grid-column: 1 / -1;
}
.social-brief-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.social-brief-value {
  font-size: 0.9375rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.social-brief-edit {
  margin-top: var(--sp-sm);
}

/* ── Contractor view (user.contractor_scope) ─────────────────────────
   A scoped login sees the pipeline board + project pages + the Wall
   Remote and nothing else. .app-shell gets .contractor-view from the
   store; the nav rail keeps only the Pipeline item, the app drawer and
   its swipe handle vanish. The server enforces the real boundary — this
   is chrome. */
.contractor-view .nav-item--rail:not(.nav-item-pipeline),
.contractor-view .nav-section-label,
.contractor-view .nav-section-rule,
.contractor-view .nav-item--app,
.contractor-view .nav-divider,
.contractor-view .app-library-handle,
.contractor-view .app-library-drawer,
.contractor-view .app-library-backdrop { display: none !important; }

.contractor-header-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
}
.contractor-header-actions .btn svg { margin-right: 4px; vertical-align: -2px; }


/* ── Admin → Ministries (THE roster) ──────────────────────────────
   One row per ministry: name, category, email section, what it is
   carrying (projects + social accounts), and the edit/retire pair.
   The same grid serves the header, the read row and the edit row, so
   an inline edit doesn't shift the columns under the cursor. */
.min-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-sm);
    flex-wrap: wrap;
    padding-bottom: var(--sp-sm);
}

.min-head-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    flex-wrap: wrap;
}

.min-missing { padding-bottom: var(--sp-sm); }

.min-list {
    padding: var(--sp-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.min-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, 1.2fr) 4.5rem 5rem minmax(0, auto);
    align-items: center;
    gap: var(--sp-sm);
    padding: 6px var(--sp-sm);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.min-row:not(.min-row--head):hover { background: var(--glass-bg); }

.min-row--head {
    padding-bottom: var(--sp-xs);
    border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
    border-radius: 0;
}

.min-row--edit {
    background: var(--glass-bg);
    border-color: var(--accent);
}

.min-row--off .min-name { opacity: 0.55; }

.min-name {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    font-size: 0.8rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.min-num { text-align: right; }

.min-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.min-check {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.min-row .form-input { font-size: 0.8rem; }

.min-empty { padding: var(--sp-md); text-align: center; }

/* Phone: the roster stacks — the counts and actions wrap under the name
   rather than squeezing six columns into 390px. */
@media (max-width: 720px) {
    .min-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        row-gap: 4px;
    }
    .min-row--head { display: none; }
    .min-name,
    .min-actions { grid-column: 1 / -1; }
    .min-actions { justify-content: flex-start; }
    .min-num { text-align: left; }
}

/* ═══ Com requests ════════════════════════════════════════════════
   Sep 15 2026 (Zach): "a sermon series is not a video, it's a campaign
   with videos in it." A request is the top-level object; "video" is one
   KIND of part. Three surfaces share this block — the New request form,
   the Requests list and a request's own page — and all three borrow the
   deliverables card's row language above, because they are the same
   story told at three altitudes. Tokens only; everything stacks at
   phone width. */

/* ── New request form ─────────────────────────────────────────── */
/* The kind chips are the first question and they change the rest of the
   form, so they wrap rather than scroll — all five have to be visible
   at once to be a choice. */
.rq-kinds {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-xs);
}

/* Proposed parts — the box that answers back. Dashed, because nothing
   in it exists yet. */
.rqp-box {
    margin: var(--sp-md) 0;
    padding: var(--sp-sm) var(--sp-md);
    border: 1px dashed var(--surface-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-md);
    background: var(--glass-bg, rgba(255, 255, 255, 0.04));
}

.rqp-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--warning);
}

.rqp-note {
    margin: 2px 0 var(--sp-sm);
    line-height: 1.4;
}

.rqp-row {
    display: flex;
    align-items: baseline;
    gap: var(--sp-xs);
    padding: 5px 0;
    border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
    font-size: 0.85rem;
}

.rqp-row:first-of-type {
    border-top: none;
}

.rqp-pill {
    flex: 0 0 auto;
    padding: 1px 6px;
    border-radius: var(--radius-xs, 4px);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Video is the part with a crew, a shoot day and a budget behind it —
   it is not one row among six, so it does not look like one. */
.rqp-pill--video {
    background: color-mix(in srgb, var(--warning) 18%, transparent);
    color: var(--warning);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 35%, transparent);
}

.rqp-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.rqp-date {
    flex: 0 0 auto;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.rqp-empty {
    padding: var(--sp-xs) 0;
    line-height: 1.4;
}

/* ── The receipt ──────────────────────────────────────────────── */
.rqdone {
    padding: var(--sp-md) var(--sp-lg);
    border-left: 3px solid var(--success);
}

.rqdone-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    text-wrap: balance;
}

.rqdone-note {
    margin: 4px 0 0;
    line-height: 1.45;
}

.rqdone-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-xs);
    margin-top: var(--sp-md);
}

.rqdone-status {
    margin-top: var(--sp-md);
    padding-top: var(--sp-sm);
    border-top: 1px solid var(--surface-border, rgba(255, 255, 255, 0.06));
}

.rqdone-url {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    margin-top: 4px;
    min-width: 0;
}

/* ── The requests list ────────────────────────────────────────── */
.req-card {
    margin-bottom: var(--sp-sm);
    padding: var(--sp-md) var(--sp-lg);
    cursor: pointer;
}

.req-top {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    flex-wrap: wrap;
}

.req-spacer { flex: 1 1 auto; }

.req-kind { flex: 0 0 auto; }

.req-name {
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.req-sub { margin-top: 3px; line-height: 1.4; }
.req-parts { margin-top: 3px; }

/* What the parts turned into. The point of the list: a request is not
   done when it is reviewed, it is done when these are. */
.req-projects {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-xs);
    margin-top: var(--sp-sm);
}

.req-project {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-xs);
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid var(--surface-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 8px);
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.req-project:hover {
    color: var(--text-primary);
    background: var(--glass-bg-hover, rgba(255, 255, 255, 0.07));
}

.req-project-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.req-more {
    display: flex;
    justify-content: center;
    padding: var(--sp-sm) 0 var(--sp-lg);
}

/* ── One request ──────────────────────────────────────────────── */
.reqd-head {
    padding: var(--sp-md) var(--sp-lg);
    margin-bottom: var(--sp-md);
}

.reqd-head-top {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    flex-wrap: wrap;
    margin-bottom: var(--sp-xs);
}

.reqd-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.25;
    text-wrap: balance;
}

.reqd-meta { margin-top: 4px; }
.reqd-date { margin-top: 2px; }

.reqd-brief {
    margin: var(--sp-sm) 0 0;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.reqd-card {
    padding: var(--sp-md) var(--sp-lg);
}

.reqd-project {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-xs) 0;
    border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
    cursor: pointer;
}

.reqd-project:last-of-type { border-bottom: none; }
.reqd-project:hover .reqd-project-name { color: var(--accent-text); }

.reqd-project-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

/* An <a>, because the payload signs every object_key — but it must not
   read as body copy with a link in it. */
.reqd-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-sm);
    padding: var(--sp-xs) 0;
    border-bottom: 1px solid var(--surface-border, rgba(255, 255, 255, 0.04));
    color: inherit;
    text-decoration: none;
}

.reqd-file:last-of-type { border-bottom: none; }
.reqd-file:hover .reqd-file-name { color: var(--accent-text); }

/* A legacy row with no object_key has nothing to open. */
.reqd-file--dead { cursor: default; opacity: 0.65; }
.reqd-file--dead:hover .reqd-file-name { color: inherit; }

.reqd-file-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ── The review queue's request cards ─────────────────────────── */
/* A request card carries a kind pill in front of its title. The title
   line is its own flex row so the pill never pushes the title button
   out of the card at 390. */
.dlvq-title-line {
    display: flex;
    align-items: baseline;
    gap: var(--sp-xs);
    flex-wrap: wrap;
    min-width: 0;
}

.dlvq-kind { flex: 0 0 auto; }

/* The one visual difference between a project card and a request card:
   a request is the bigger object, and approving its parts creates
   projects. The rail says so quietly. */
.dlvq-card--request {
    border-left: 2px solid var(--accent-glow, rgba(255, 255, 255, 0.12));
}

/* ── The queue's post-review strip ────────────────────────────── */
/* Approving is exactly what removes the card, and the card was the only
   door to what it just made. */
.dlvq-reviewed {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    flex-wrap: wrap;
    margin-bottom: var(--sp-sm);
    padding: var(--sp-xs) var(--sp-md);
    border-left: 2px solid var(--success);
    border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
    background: color-mix(in srgb, var(--success) 10%, transparent);
    font-size: 0.8rem;
}

.dlvq-reviewed-text {
    flex: 1 1 14rem;
    min-width: 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

@media (max-width: 560px) {
    .rqdone-actions .btn { flex: 1 1 auto; justify-content: center; }
    .req-project { max-width: 100%; }
    .dlvq-reviewed .btn { flex: 0 0 auto; }
}

/* ── Graphics Board — read-only view of David's Asana board ─────────
   Mirrors "Graphic Design Projects": one column per Asana section, in
   Asana's order, empty ones included so the shape matches. Cards link
   out; nothing here edits Asana. Phone: sections stack. */
.abv-page { display: flex; flex-direction: column; gap: var(--sp-md); min-height: 0; }
.abv-approvals { display: flex; align-items: center; gap: var(--sp-sm) var(--sp-md); flex-wrap: wrap; margin: var(--sp-sm) 0 var(--sp-md); padding: 10px 14px; border-radius: 12px; text-decoration: none; color: inherit; background: var(--gold-wash, rgba(185, 138, 47, 0.12)); border: 1px solid rgba(185, 138, 47, 0.35); }
.abv-approvals:hover { border-color: rgba(185, 138, 47, 0.7); }
.abv-approvals-label { font-size: 13px; }
.abv-approvals-thumbs { display: flex; gap: 4px; }
.abv-approvals-thumb { width: 34px; height: 34px; border-radius: 6px; overflow: hidden; background: var(--bg-tertiary, #eee); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--text-muted); }
.abv-approvals-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.abv-approvals-names { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-secondary); }
.abv-approvals-go { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.abv-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-sm) var(--sp-md); align-items: center; justify-content: space-between; }
.abv-source { display: flex; flex-wrap: wrap; gap: var(--sp-xs); align-items: center; font-size: 0.85rem; color: var(--text-secondary); }
.abv-tools { display: flex; gap: var(--sp-sm); align-items: center; flex-wrap: wrap; }
.abv-search { width: min(320px, 100%); }
.abv-toggle { display: flex; gap: 6px; align-items: center; font-size: 0.8rem; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.abv-board { display: flex; flex-direction: column; gap: var(--sp-md); }
.abv-column { border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass-bg); display: flex; flex-direction: column; min-width: 0; }
.abv-column--empty { opacity: 0.6; }
.abv-column-header { display: flex; align-items: center; gap: var(--sp-xs); padding: var(--sp-sm) var(--sp-md); border-bottom: 1px solid var(--glass-border); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.abv-column-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.abv-column-count { font-variant-numeric: tabular-nums; border: 1px solid var(--glass-border); border-radius: 999px; padding: 0 8px; font-size: 0.7rem; }
.abv-column-cards { display: flex; flex-direction: column; gap: var(--sp-xs); padding: var(--sp-sm); }
.abv-empty { text-align: center; color: var(--text-muted); font-size: 0.8rem; padding: var(--sp-sm); }
.abv-card { padding: var(--sp-sm) var(--sp-md); display: flex; flex-direction: column; gap: 6px; }
.abv-card--done { opacity: 0.55; }
.abv-parent { font-size: 0.7rem; color: var(--text-muted); display: flex; gap: 4px; flex-wrap: wrap; }
.abv-parent a { color: var(--text-secondary); text-decoration: none; }
.abv-parent a:hover { text-decoration: underline; }
.abv-name { font-weight: 600; font-size: 0.9rem; line-height: 1.3; display: flex; gap: 6px; align-items: flex-start; }
.abv-name a { color: var(--text-primary); text-decoration: none; }
.abv-name a:hover { text-decoration: underline; }
.abv-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.abv-chip { font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--glass-border); color: var(--text-secondary); }
.abv-due--soon { border-color: var(--warning); color: var(--warning); }
.abv-due--late { border-color: var(--error); color: var(--error); }
.abv-extra { font-size: 0.75rem; color: var(--text-secondary); display: flex; gap: 10px; flex-wrap: wrap; }
.abv-extra a { color: var(--accent); text-decoration: none; }
.abv-progress { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0 0; color: var(--text-secondary); font-size: 0.72rem; cursor: pointer; width: 100%; text-align: left; font-family: inherit; }
.abv-progress:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.abv-progress-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--glass-border); overflow: hidden; }
.abv-progress-fill { display: block; height: 100%; background: var(--accent); }
.abv-caret { width: 12px; height: 12px; flex: none; transition: transform var(--duration-fast) var(--ease-out); }
.abv-caret.open { transform: rotate(90deg); }
.abv-subtasks { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 0.78rem; }
.abv-subtasks li { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; padding-left: 14px; position: relative; }
.abv-subtasks li::before { content: ''; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--text-muted); }
.abv-subtasks li.done::before { background: var(--success); border-color: var(--success); }
.abv-subtasks li.done > a { text-decoration: line-through; color: var(--text-muted); }
.abv-subtasks a { color: var(--text-primary); text-decoration: none; }
.abv-subtasks ul { list-style: none; margin: 2px 0 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 2px; }
@media (min-width: 900px) {
  .abv-board { flex-direction: row; align-items: flex-start; overflow-x: auto; padding-bottom: var(--sp-md); }
  .abv-column { flex: 0 0 280px; max-height: calc(100vh - 260px); }
  .abv-column-cards { overflow-y: auto; }
  /* A wide screen drags; the Move select is for phones and the list. */
  .abv-board .abv-move { display: none; }
}

/* ── Operating the board (David, John, admins) ───────────────────────── */
.abv-view { display: flex; gap: 4px; }
.abv-check { width: 18px; height: 18px; flex: none; margin-top: 1px; padding: 0; border-radius: 50%; border: 1.5px solid var(--text-muted); background: transparent; color: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
.abv-check svg { width: 11px; height: 11px; }
.abv-check:hover { border-color: var(--success); color: var(--success); }
.abv-check.done { background: var(--success); border-color: var(--success); color: #fff; }
.abv-check:disabled { opacity: 0.5; cursor: progress; }
.abv-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.abv-card[draggable="true"] { cursor: grab; }
.abv-card[draggable="true"]:active { cursor: grabbing; }
.abv-card--dragging { opacity: 0.4; }
.abv-card--busy { opacity: 0.6; pointer-events: none; }
.abv-column--over { outline: 2px dashed var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 8%, var(--glass-bg)); }
.abv-column--over .abv-column-cards { min-height: 64px; }
.abv-move { width: auto; max-width: 100%; min-height: 28px; padding: 2px 26px 2px 8px; background-position: right 8px center; font-size: 0.75rem; align-self: flex-start; }
.abv-card .abv-move { margin-top: 2px; }
.abv-undo { position: fixed; left: 50%; bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--sp-md)); transform: translateX(-50%); z-index: 150; display: flex; align-items: center; gap: var(--sp-md); padding: var(--sp-xs) var(--sp-xs) var(--sp-xs) var(--sp-md); border-radius: 999px; background: var(--text-primary); color: var(--bg-primary); font-size: 0.85rem; box-shadow: var(--shadow-md); max-width: min(92vw, 560px); }
.abv-undo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The list reading: one block per section. flex:none — as a flex child of the
   scrolling page-content it would otherwise shrink to the viewport and clip. */
.abv-list { display: flex; flex-direction: column; gap: var(--sp-md); flex: none; }
.abv-list-head, .abv-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 150px 72px 120px 130px 64px 176px; gap: var(--sp-sm); align-items: center; padding: 6px var(--sp-md); }
.abv-list-head { position: sticky; top: 0; z-index: 2; margin-bottom: calc(-1 * var(--sp-sm)); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); background: var(--bg-primary); border-bottom: 1px solid var(--glass-border); }
.abv-group { border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass-bg); overflow: clip; }
.abv-group--empty { opacity: 0.6; }
.abv-group-head { margin: 0; display: flex; align-items: center; gap: var(--sp-sm); padding: var(--sp-sm) var(--sp-md); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-primary); background: color-mix(in srgb, var(--accent) 9%, var(--glass-bg)); border-bottom: 1px solid var(--glass-border); }
.abv-row { border-top: 1px solid var(--glass-border); font-size: 0.82rem; }
.abv-group-head + .abv-row, .abv-group-head + .abv-empty + .abv-row { border-top: 0; }
.abv-row:hover { background: var(--glass-bg-hover); }
.abv-row-check { display: inline-flex; align-items: center; justify-content: center; }
.abv-row-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.abv-row-name { font-weight: 600; color: var(--text-primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abv-row-name:hover { text-decoration: underline; }
.abv-card--done .abv-row-name { text-decoration: line-through; color: var(--text-muted); }
.abv-row-sub { font-size: 0.7rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 8px; }
.abv-row-sub a { color: var(--accent); text-decoration: none; }
.abv-row-phone { display: none; }
.abv-row-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem; color: var(--text-secondary); }
.abv-row-cell.abv-due--soon { color: var(--warning); }
.abv-row-cell.abv-due--late { color: var(--error); }
.abv-row-progress { font-variant-numeric: tabular-nums; }
.abv-row .abv-move { width: 100%; max-width: 176px; }
@media (max-width: 899px) {
  .abv-list-head { display: none; }
  .abv-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .abv-row-cell:not(.abv-row-move) { display: none; }
  /* who · due · status on its own line under "part of …" */
  .abv-row-sub { white-space: normal; flex-wrap: wrap; }
  .abv-row-phone { display: block; width: 100%; color: var(--text-secondary); }
  .abv-row .abv-move { max-width: 8.5rem; }
}

/* ── The Now reading (Sep 21 2026) ───────────────────────────────────
   One person's next move, not the system's state: one big card, three
   small ones, the rest folded. Quiet everywhere except the Done moment. */
.abv-now { width: min(100%, 760px); margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-lg); flex: none; padding-bottom: var(--sp-xl); }
.abv-now-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--sp-sm); }
.abv-now-label--row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm); }
.abv-now-slot--next + .abv-now-slot--next { margin-top: calc(-1 * var(--sp-lg) + var(--sp-sm)); }
.abv-now-card { border: 1px solid var(--glass-border); border-radius: var(--radius-lg); background: var(--glass-bg); transform-origin: 50% 0; transition: box-shadow var(--duration-normal) var(--ease-out), border-color var(--duration-normal) var(--ease-out); }
.abv-now-card--big { background: color-mix(in srgb, var(--accent) 6%, var(--glass-bg)); border-color: color-mix(in srgb, var(--accent) 35%, var(--glass-border)); box-shadow: var(--shadow-md); }
.abv-now-card--open { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-border)); }
.abv-now-head { display: flex; align-items: flex-start; gap: var(--sp-md); padding: var(--sp-md); }
.abv-now-card--big .abv-now-head { padding: var(--sp-lg); gap: var(--sp-lg); }
.abv-now-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; background: none; border: 0; padding: 0; text-align: left; font-family: inherit; color: inherit; cursor: pointer; }
.abv-now-body:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 6px; }
.abv-now-title { font-weight: 600; font-size: 1.02rem; line-height: 1.3; color: var(--text-primary); overflow-wrap: anywhere; }
.abv-now-card--big .abv-now-title { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.abv-now-when { font-size: 0.82rem; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.abv-now-card--big .abv-now-when { font-size: 0.95rem; }
.abv-now-tag { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.abv-now-bump { flex: none; white-space: nowrap; align-self: center; }
/* The Done button: big, round, and the one thing that moves. */
.abv-now-check { flex: none; width: 36px; height: 36px; margin-top: 2px; padding: 0; border-radius: 50%; border: 2px solid var(--text-muted); background: transparent; color: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-spring); }
.abv-now-card--big .abv-now-check { width: 48px; height: 48px; border-width: 2.5px; }
.abv-now-check svg { width: 55%; height: 55%; }
.abv-now-check:hover { border-color: var(--success); color: var(--success); transform: scale(1.06); }
.abv-now-check.done { background: var(--success); border-color: var(--success); color: #fff; transform: scale(1.1); }
.abv-now-check:disabled { cursor: progress; }
.abv-now-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.abv-now-card--going { animation: abvFold 460ms var(--ease-in-out) forwards; pointer-events: none; }
@keyframes abvFold {
  0%   { opacity: 1; transform: none; }
  30%  { opacity: 1; transform: scale(1.015); }
  100% { opacity: 0; transform: perspective(900px) rotateX(-72deg) scale(0.94); }
}
.abv-now-details { padding: 0 var(--sp-md) var(--sp-md); display: flex; flex-direction: column; gap: var(--sp-sm); border-top: 1px solid var(--glass-border); padding-top: var(--sp-sm); }
.abv-now-card--big .abv-now-details { padding-left: var(--sp-lg); padding-right: var(--sp-lg); }
/* The description, read as Asana shows it, edited as plain text */
.abv-now-desc { display: flex; flex-direction: column; gap: 6px; }
.abv-now-desc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm); }
.abv-now-desc-head .abv-now-label { margin: 0; }
.abv-now-desc-text { font-size: 0.9rem; line-height: 1.55; color: var(--text-primary); overflow-wrap: anywhere; max-height: 50vh; overflow-y: auto; }
.abv-now-desc-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.abv-now-desc-text ul, .abv-now-desc-text ol { margin: 4px 0; padding-left: 1.4em; }
.abv-now-desc-text ul { list-style: disc; }
.abv-now-desc-text ol { list-style: decimal; }
.abv-now-desc-text p { margin: 0 0 6px; }
.abv-now-desc-text h1, .abv-now-desc-text h2, .abv-now-desc-text h3 { font-size: 1em; font-weight: 700; margin: 8px 0 2px; }
.abv-now-desc-text blockquote { margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--glass-border); color: var(--text-secondary); }
.abv-now-desc-text code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; padding: 0 4px; border-radius: 4px; background: var(--glass-bg-hover); }
.abv-now-desc-text hr { border: 0; border-top: 1px solid var(--glass-border); margin: 8px 0; }
.abv-now-desc-text table { border-collapse: collapse; font-size: 0.85em; }
.abv-now-desc-text td, .abv-now-desc-text th { border: 1px solid var(--glass-border); padding: 2px 8px; }
.abv-now-desc-empty { font-size: 0.85rem; color: var(--text-muted); }
.abv-now-desc-editor { display: flex; flex-direction: column; gap: 6px; }
.abv-now-desc-edit { width: 100%; min-height: 7.5em; resize: vertical; font-size: 0.9rem; line-height: 1.5; font-family: inherit; }
.abv-now-desc-note { font-size: 0.75rem; color: var(--warning); }
.abv-now-desc-hint { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; }
/* The Box folder link: a small row that opens above the actions */
.abv-now-box { display: flex; gap: var(--sp-xs); align-items: center; flex-wrap: wrap; }
.abv-now-box-edit { flex: 1 1 260px; min-width: 0; }
.abv-now-boxlink { display: inline-flex; align-items: center; gap: 2px; }
.abv-now-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--text-secondary); }
.abv-now-facts a { color: var(--accent); text-decoration: none; }
.abv-now-actions { display: flex; flex-wrap: wrap; gap: var(--sp-xs); align-items: center; }
.abv-now-actions .abv-move { align-self: center; }
/* Later, the inbox, and any folded list: quiet rows */
.abv-now-fold { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; font-family: inherit; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.abv-now-fold:hover { color: var(--text-primary); }
.abv-now-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.abv-now-rows { display: flex; flex-direction: column; margin-top: var(--sp-xs); border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass-bg); overflow: clip; }
.abv-now-inbox { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--glass-border)); border-radius: var(--radius-md); padding: var(--sp-sm) var(--sp-md); background: color-mix(in srgb, var(--accent) 5%, var(--glass-bg)); }
.abv-now-inbox .abv-now-label { margin-bottom: 2px; }
.abv-now-row { display: flex; align-items: center; gap: var(--sp-sm); padding: 8px var(--sp-md); border-top: 1px solid var(--glass-border); font-size: 0.85rem; }
.abv-now-inbox .abv-now-row { padding-left: 0; padding-right: 0; }
.abv-now-inbox .abv-now-row:first-of-type, .abv-now-rows .abv-now-row:first-child { border-top: 0; }
.abv-now-row--parked { opacity: 0.7; }
.abv-now-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.abv-now-row-name { font-weight: 600; color: var(--text-primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abv-now-row-name:hover { text-decoration: underline; }
.abv-now-row-sub { font-size: 0.72rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abv-now-row-actions { flex: none; display: flex; gap: 4px; }
.abv-now-clear { text-align: center; padding: var(--sp-xl) var(--sp-md); }
.abv-now-clear-mark { width: 56px; height: 56px; margin: 0 auto var(--sp-md); border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; color: #fff; background: var(--success); }
.abv-now-clear-title { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.abv-now-clear-desc { margin-top: 4px; font-size: 0.9rem; color: var(--text-secondary); }
.abv-now-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-md); flex-wrap: wrap; }
.abv-now-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: calc(-1 * var(--sp-md)); }
.abv-now-chips .chip.active { background: color-mix(in srgb, var(--accent) 14%, var(--glass-bg)); border-color: var(--accent); color: var(--text-primary); }
.abv-now-chips .chip[disabled] { opacity: 0.6; cursor: progress; }
@media (max-width: 599px) {
  .abv-now-card--big .abv-now-head { padding: var(--sp-md); gap: var(--sp-md); }
  .abv-now-card--big .abv-now-title { font-size: 1.25rem; }
  .abv-now-card--big .abv-now-check { width: 42px; height: 42px; }
  .abv-now-bump { display: none; }
  .abv-now-row { flex-wrap: wrap; }
  .abv-now-row-actions { width: 100%; justify-content: flex-end; }
}

/* ── Ask Tally sheet (Sep 25 2026 rebuild — tallyQuick in app.js) ─────
   A chat sheet over a scrim: bottom sheet on a phone, a centred panel on
   a desk. Typing first; files ride in a tray above the composer and stay
   on the message they were sent with. Every colour is a palette token so
   the sheet follows Cadence, Clean, Studio Dark… in both schemes. */
.tally-scrim {
    /* Pinned to the visible strip (--tally-vvt/--tally-vvh from
       visualViewport, set in tallyQuick) so the iOS keyboard can't push
       the sheet's header off the top. */
    position: fixed; left: 0; right: 0; z-index: 9990;
    top: var(--tally-vvt, 0px); height: var(--tally-vvh, 100%);
    background: var(--overlay-bg, rgba(0, 0, 0, 0.5));
    display: flex; align-items: flex-end; justify-content: center;
    animation: tallyFade 160ms ease-out;
}
.tally-sheet {
    position: relative; display: flex; flex-direction: column;
    width: 100%; height: min(88dvh, 760px);
    /* Never taller than what's visible under the status bar — with the
       keyboard up that's the strip above it. */
    max-height: calc(var(--tally-vvh, 100dvh) - env(safe-area-inset-top, 0px) - 8px);
    background: var(--bg-secondary); color: var(--text-primary);
    border: 1px solid var(--glass-border); border-bottom: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-lg);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: tallyUp 220ms cubic-bezier(0.25, 0.6, 0.3, 1);
    overflow: hidden;
}
/* Keyboard up: the home-indicator inset is under the keyboard, not the sheet. */
.tally-kb .tally-sheet { padding-bottom: 0; }
@media (min-width: 768px) {
    .tally-scrim { align-items: center; }
    .tally-sheet { width: min(640px, calc(100vw - 48px)); height: min(80vh, 760px); border-bottom: 1px solid var(--glass-border); border-radius: var(--radius-xl); }
}
@keyframes tallyFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tallyUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.tally-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--glass-border);
}
.tally-mark {
    flex: none; width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--accent-on, #fff); font-weight: 700; font-size: 0.85rem;
}
.tally-head-text { flex: 1; min-width: 0; }
.tally-head-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; line-height: 1.2; }
.tally-head-sub { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tally-icon-btn {
    flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; color: var(--text-secondary); cursor: pointer;
}
.tally-icon-btn:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.tally-icon-btn--on { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }

.tally-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 8px; display: flex; flex-direction: column; gap: 12px; }
.tally-empty { margin: auto 0; display: flex; flex-direction: column; gap: 14px; padding: 8px 0 16px; }
.tally-empty-lead { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.5; margin: 0; }
.tally-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.tally-chip {
    border: 1px solid var(--glass-border); background: var(--glass-bg); color: var(--text-primary);
    border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 0.85rem; cursor: pointer; text-align: left;
}
.tally-chip:hover { border-color: var(--accent); }

.tally-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 100%; }
.tally-msg--user { align-items: flex-end; }
.tally-bubble {
    max-width: 88%; padding: 9px 13px; border-radius: 16px; border-top-left-radius: 6px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    font-size: 0.92rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.tally-msg--user .tally-bubble { background: var(--accent-soft); border-color: transparent; border-radius: 16px; border-top-right-radius: 6px; }
.tally-bubble--md { white-space: normal; max-width: 100%; }
.tally-bubble--md p, .tally-bubble--md h4 { margin: 0; }
.tally-bubble--md h4 { font-size: 0.92rem; margin-top: 4px; }
.tally-bubble--md ul, .tally-bubble--md ol { margin: 2px 0; padding-left: 20px; }
.tally-bubble--md ul { list-style: disc; }
.tally-bubble--md ol { list-style: decimal; }
.tally-bubble--md li { margin: 2px 0; }
.tally-bubble--md code { font-family: var(--font-mono); font-size: 0.85em; background: var(--glass-bg-hover); padding: 1px 4px; border-radius: 4px; }
.tally-bubble--md a { color: var(--accent-text, var(--accent)); }
.tally-gap { height: 8px; }

.tally-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.tally-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: tallyDot 1.2s infinite ease-in-out; }
.tally-typing span:nth-child(2) { animation-delay: 0.15s; }
.tally-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tallyDot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.tally-error { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--error); }

.tally-files, .tally-tray { display: flex; flex-wrap: wrap; gap: 6px; }
.tally-msg--user .tally-files { justify-content: flex-end; }
.tally-tray { padding: 8px 14px 0; border-top: 1px solid var(--glass-border); }
.tally-file {
    display: inline-flex; align-items: center; gap: 6px; max-width: 220px; height: 36px;
    padding: 0 10px 0 3px; border-radius: 10px; background: var(--glass-bg); border: 1px solid var(--glass-border);
    font-size: 0.78rem; color: var(--text-secondary);
}
.tally-file img { width: 30px; height: 30px; object-fit: cover; border-radius: 7px; }
.tally-file-ext {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px;
    background: var(--accent-soft); color: var(--accent-text, var(--accent)); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.03em;
}
.tally-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tally-file--busy { opacity: 0.6; }
.tally-file-x { border: 0; background: none; color: var(--text-muted); font-size: 1.1rem; line-height: 1; padding: 0 0 0 2px; cursor: pointer; }
.tally-file-x:hover { color: var(--text-primary); }

.tally-compose {
    display: flex; align-items: flex-end; gap: 4px; margin: 10px 12px 12px;
    padding: 4px; border: 1px solid var(--glass-border); border-radius: 22px; background: var(--bg-primary);
}
.tally-compose:focus-within { border-color: var(--accent); }
.tally-compose textarea {
    flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: transparent; color: var(--text-primary);
    font: inherit; font-size: 16px; line-height: 1.4; padding: 8px 4px; max-height: 140px;
}
.tally-send {
    flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--accent-on, #fff);
}
.tally-send:disabled { background: var(--glass-bg-hover); color: var(--text-muted); cursor: default; }
.tally-sheet--drop { outline: 2px dashed var(--accent); outline-offset: -8px; }
.tally-drop-hint {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--bg-secondary) 80%, transparent); color: var(--accent-text, var(--accent));
    font-weight: 600; pointer-events: none;
}

/* ── My week (Sep 30 2026 — rhythmPage in app.js) ─────────────────────
   The Lead Cohort weekly rhythm: inbox left, the time-blocked week right,
   Friday review below; stacks on phones. Block kinds are washes of palette
   tokens (color-mix) so every theme, light or dark, carries them. */
.rw-page { display: flex; flex-direction: column; gap: var(--sp-md); }
.rw-top { display: flex; flex-direction: column; gap: var(--sp-sm); }
.rw-intro { display: flex; flex-direction: column; gap: 4px; font-size: 0.875rem; }
.rw-intro p { margin: 0; max-width: 72ch; }
.rw-help-btn { min-width: 32px; font-size: 1rem; line-height: 1; }
.rw-eyebrow { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-text, var(--accent)); }
/* The week selector spans the page: ‹ on the left, the week in the middle, › on the right. */
.rw-weeknav { display: flex; align-items: center; gap: var(--sp-sm); width: 100%; }
.rw-weeknav { align-items: stretch; }
.rw-weekarrow { flex: none; min-width: 44px; height: auto; }
.rw-weekwhen { width: 100%; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text, var(--accent)); }
.rw-weekrange { white-space: nowrap; }
@media (min-width: 600px) { .rw-weekwhen { width: auto; font-size: inherit; letter-spacing: 0; text-transform: none; color: var(--text-muted); } }
.rw-weeklabel { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 10px; padding: 6px 10px;
    text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-primary);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm); background: var(--glass-bg); }
.rw-body { display: flex; flex-direction: column; gap: var(--sp-md); }
.rw-main { display: grid; grid-template-columns: 1fr; gap: var(--sp-md); align-items: start; }
.rw-inbox, .rw-weekcard, .rw-review { padding: var(--sp-md); }
.rw-inbox { display: flex; flex-direction: column; gap: var(--sp-sm); }
.rw-inbox h2, .rw-review h2 { margin: 0; font-size: 1.1rem; color: var(--text-primary); }
.rw-inbox-head { display: flex; justify-content: space-between; align-items: baseline; }
.rw-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.rw-add { display: flex; gap: 6px; }
.rw-add input { flex: 1; min-width: 0; }
.rw-hint { margin: 0; font-size: 0.75rem; color: var(--text-muted); }
.rw-list { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.rw-empty { font-size: 0.8rem; color: var(--text-muted); padding: 10px; border: 1px dashed var(--glass-border); border-radius: var(--radius-sm); text-align: center; }
.rw-cal-hint { font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--glass-border); padding-top: var(--sp-sm); }
.rw-cal-hint a { color: var(--accent-text, var(--accent)); }
.rw-over { outline: 2px dashed var(--accent); outline-offset: 2px; }

.rw-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px; align-items: start; background: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 6px 6px 6px 8px; font-size: 0.82rem; line-height: 1.3; cursor: grab; }
.rw-item input[type=checkbox] { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.rw-txt { overflow-wrap: anywhere; }
.rw-tag { display: block; margin-top: 2px; font-size: 0.68rem; color: var(--warning); }
.rw-done .rw-txt { text-decoration: line-through; color: var(--text-muted); }
.rw-dragging { opacity: 0.45; }
.rw-move { appearance: none; -webkit-appearance: none; width: 24px; height: 20px; padding: 0; border: 0; border-radius: var(--radius-xs); cursor: pointer; color: transparent; background-color: transparent;
    background-image: linear-gradient(var(--text-muted), var(--text-muted)), linear-gradient(var(--text-muted), var(--text-muted)), linear-gradient(var(--text-muted), var(--text-muted));
    background-size: 12px 2px; background-repeat: no-repeat; background-position: 6px 5px, 6px 9px, 6px 13px; }
.rw-move:hover { background-color: var(--glass-bg-hover); }
.rw-move option, .rw-move optgroup { color: var(--text-primary); background: var(--bg-secondary); }
.rw-x { width: 22px; height: 20px; padding: 0; border: 0; background: none; border-radius: var(--radius-xs); color: var(--text-muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.rw-x:hover { color: var(--error); background: var(--glass-bg-hover); }
.rw-move:focus-visible, .rw-x:focus-visible, .rw-plus:focus-visible, .rw-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.rw-week { display: grid; grid-template-columns: 1fr; gap: var(--sp-md); }
.rw-day { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rw-dayhead { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--glass-border); }
.rw-today .rw-dayhead { border-bottom-width: 2px; }
.rw-dayhead b { font-size: 0.95rem; color: var(--text-primary); }
.rw-dayhead span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.rw-today .rw-dayhead { border-color: var(--accent); }
.rw-today .rw-dayhead b::after { content: "Today"; margin-left: 8px; padding: 1px 6px; border-radius: var(--radius-xs); vertical-align: 2px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-on, #fff); background: var(--accent); }

/* Oct 21 2026 clean-up: near-white cards, the kind colour lives in the spine. */
.rw-blk { --k: var(--text-muted); border-radius: var(--radius-sm); padding: 7px 8px; display: flex; flex-direction: column; gap: 5px; min-width: 0;
    background: color-mix(in srgb, var(--k) 5%, var(--bg-primary)); border-left: 3px solid var(--k); }
.rw-blk-top { display: flex; gap: 6px; align-items: baseline; }
.rw-blk-top .rw-plus { align-self: center; }
.rw-n { flex: 1; min-width: 0; font-weight: 700; font-size: 0.82rem; line-height: 1.2; color: var(--text-primary); }
.rw-fixed .rw-n::after { content: " ●"; font-size: 0.7em; vertical-align: middle; color: var(--k); }
.rw-t { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); white-space: nowrap; }
.rw-edit { border: 0; background: none; padding: 0; font-size: 0.7rem; font-weight: 600; color: var(--accent-text, var(--accent)); cursor: pointer; }
.rw-blk-body { display: flex; flex-direction: column; gap: 4px; }
.rw-d { font-size: 0.74rem; color: var(--text-secondary); }
/* "+" sits in the title row and shows on hover/focus (always, faintly, on touch). */
.rw-plus { flex: none; width: 20px; height: 18px; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; font-size: 0.95rem; font-weight: 600; line-height: 1; color: var(--text-muted); cursor: pointer; }
.rw-plus:hover { color: var(--text-primary); background: var(--glass-bg-hover); }
@media (hover: hover) {
    .rw-plus { opacity: 0; transition: opacity var(--d-fast, .15s) ease; }
    .rw-blk:hover .rw-plus, .rw-blk:focus-within .rw-plus { opacity: 1; }
}
@media (hover: none) { .rw-plus { opacity: 0.55; } }
.rw-inline-add { width: 100%; box-sizing: border-box; padding: 5px 7px; font-size: 0.8rem; color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--glass-border); border-radius: var(--radius-xs); }
.rw-newblk { align-self: flex-start; }
.rw-k-meet { --k: var(--accent); }
.rw-k-deep { --k: var(--stage-preproduction); }
.rw-k-task { --k: var(--success); }
.rw-k-event { --k: var(--stage-production); }
.rw-k-review { --k: var(--sunday-accent, var(--warning)); }
.rw-blk.rw-k-review { box-shadow: inset 0 0 0 1.5px var(--k); background: color-mix(in srgb, var(--k) 8%, var(--bg-primary)); }
.rw-k-pray { --k: var(--info); }
.rw-k-margin { --k: var(--text-muted); }
/* Margin is open time: no fill, a faint dashed outline, a quiet name. */
.rw-blk.rw-k-margin { background: transparent; border: 1px dashed color-mix(in srgb, var(--k) 45%, transparent); border-left-width: 1px; }
.rw-blk.rw-k-margin .rw-n { font-weight: 500; color: var(--text-muted); }
.rw-blk.rw-k-lunch { padding: 3px 8px; background: color-mix(in srgb, var(--text-muted) 7%, transparent); border-left-color: transparent; }
.rw-blk.rw-k-lunch .rw-n { font-weight: 500; color: var(--text-muted); }

/* The calendar on top: a hairline row per meeting, in the block it lands in. */
.rw-ev { display: flex; gap: 6px; align-items: baseline; font-size: 0.72rem; line-height: 1.25; color: var(--text-secondary); padding: 1px 0; }
.rw-ev::before { content: ""; flex: none; align-self: flex-start; margin-top: 0.42em; width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--text-muted); }
.rw-ev-t { flex: none; font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-muted); }
.rw-ev--loose { padding: 2px 8px; border-radius: var(--radius-xs); background: color-mix(in srgb, var(--text-muted) 6%, transparent); }

/* Where the week goes — each kind's share of the planned week. */
.rw-share { margin-top: var(--sp-md); padding-top: var(--sp-md); border-top: 1px solid var(--glass-border); display: flex; flex-direction: column; gap: 8px; }
.rw-share-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.rw-share-total { font-weight: 500; font-size: 0.74rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rw-share-bar { display: flex; gap: 2px; height: 12px; border-radius: var(--radius-full); overflow: hidden; }
.rw-share-seg { flex-basis: 0; min-width: 3px; background: color-mix(in srgb, var(--k) 70%, transparent); }
.rw-share-seg.rw-k-margin { background: color-mix(in srgb, var(--k) 22%, transparent); }
.rw-share-rows { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.76rem; color: var(--text-secondary); }
.rw-share-row { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.rw-share-row b { color: var(--text-primary); }
.rw-share-h { color: var(--text-muted); }
.rw-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: var(--sp-md); font-size: 0.74rem; color: var(--text-muted); }
.rw-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.rw-sw { width: 11px; height: 11px; flex: none; border-radius: 3px; background: color-mix(in srgb, var(--k) 40%, transparent); border-left: 3px solid var(--k); }
.rw-sw--ev { width: 7px; height: 7px; background: none; border: 1px solid var(--text-muted); border-radius: 50%; }
.rw-sw.rw-k-margin { background: none; border: 1px dashed var(--k); }

.rw-review { display: grid; grid-template-columns: 1fr; gap: var(--sp-lg); }
.rw-stats { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 12px 0 4px; }
.rw-stats b { display: block; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.rw-stats span { font-size: 0.76rem; color: var(--text-muted); }
.rw-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rw-steps li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.rw-answer { grid-column: 2; width: 100%; box-sizing: border-box; min-height: 52px; field-sizing: content; resize: none; overflow: hidden; padding: 8px 10px; font: inherit; font-size: 0.875rem; line-height: 1.4; color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }
.rw-answer:focus { outline: none; border-color: var(--accent); }
.rw-answer::placeholder { color: var(--text-muted); }
.rw-review-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--sp-sm); }
.rw-review-week { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.rw-review-tools { display: flex; align-items: center; gap: var(--sp-sm); }
.rw-saved { font-size: 0.72rem; color: var(--text-muted); }
.rw-history { width: auto; max-width: 200px; }
.rw-steps input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.rw-steps label { cursor: pointer; }
.rw-m { display: block; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.rw-q { font-weight: 600; color: var(--text-primary); }
.rw-h { display: block; font-size: 0.8rem; color: var(--text-muted); }
.rw-steps input:checked + label .rw-q { text-decoration: line-through; color: var(--text-muted); }
.rw-notes { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; color: var(--text-secondary); }
.rw-notes h3 { margin: var(--sp-sm) 0 0; font-size: 0.95rem; color: var(--text-primary); }
.rw-notes ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.rw-note { resize: vertical; min-height: 110px; }
.rw-form { display: flex; flex-direction: column; gap: 6px; }
.rw-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-sm); }
.rw-check { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.85rem; color: var(--text-secondary); }
.rw-del { color: var(--error); }

@media (min-width: 860px) {
    .rw-week { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
    .rw-review { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
@media (min-width: 1200px) {
    .rw-main { grid-template-columns: 280px minmax(0, 1fr); }
    .rw-inbox { position: sticky; top: var(--sp-md); }
}

/* My week speaks the Studio's voice (Oct 1 2026, Zach: "fonts seem off"):
   card titles, eyebrows, counts and the week label are --font-mono like the
   page header and nav, not the heading serif an h2 would otherwise get.
   Content (block names, items, questions) stays in --font-body. */
.rw-eyebrow, .rw-weeklabel, .rw-inbox h2, .rw-review h2, .rw-review-week,
.rw-notes h3, .rw-share-head, .rw-stats b, .rw-dayhead b, .rw-today .rw-dayhead b::after {
    font-family: var(--font-mono);
}
.rw-inbox h2, .rw-review h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }
.rw-notes h3 { font-size: 0.85rem; letter-spacing: -0.01em; }
.rw-review-week { font-size: 0.8rem; }
.rw-stats b { font-size: 1.4rem; letter-spacing: -0.02em; }
.rw-dayhead b { font-size: 0.9rem; letter-spacing: -0.01em; }

/* Tally's suggestions — what no longer lines up with the calendar (Oct 1 2026). */
.rw-tally { display: flex; flex-direction: column; gap: 8px; }
.rw-tally-card { display: flex; align-items: center; gap: var(--sp-md); flex-wrap: wrap; padding: 10px 12px;
    background: color-mix(in srgb, var(--accent) 9%, var(--bg-secondary)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--radius-md); }
.rw-tally-mark { flex: none; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--accent-on, #fff); background: var(--accent); padding: 2px 7px; border-radius: var(--radius-xs); }
.rw-tally-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.rw-tally-text { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.rw-tally-when { font-size: 0.74rem; color: var(--text-muted); }
.rw-tally-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 600px) { .rw-tally-actions { width: 100%; justify-content: flex-end; } }

/* Tally on your iPhone — Settings (Oct 1 2026). */
.tk-card { display: flex; flex-direction: column; gap: var(--sp-sm); padding: var(--sp-md); }
.tk-lead { margin: 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.45; }
.tk-prefix, .tk-copy code { font-family: var(--font-mono); font-size: 0.75rem; }
.tk-row-right { display: inline-flex; align-items: center; gap: 8px; }
.tk-new { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tk-new-title { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.tk-copy { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tk-copy code { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: 6px 8px; border-radius: var(--radius-xs); background: var(--bg-primary); color: var(--text-primary); user-select: all; }
.tk-copy--inline { display: inline-flex; max-width: 100%; vertical-align: middle; }
.tk-steps { font-size: 0.82rem; color: var(--text-secondary); }
.tk-steps summary { cursor: pointer; font-weight: 600; color: var(--text-primary); padding: 4px 0; }
.tk-steps ol { list-style: decimal; margin: 8px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
.tk-steps ul { list-style: disc; margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.tk-steps code { font-family: var(--font-mono); font-size: 0.75rem; }

/* Film date add / edit form (project page → Dates). Labeled date + optional
   call time side by side, actions underneath; in a narrow column the two
   fields wrap onto their own rows instead of the time field squeezing the
   date down to its icon (Oct 1 2026). */
.film-date-editor {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  flex: 1 1 100%;
  min-width: 0;
  margin-top: var(--sp-xs);
  padding: var(--sp-sm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md, 10px);
  background: var(--glass-bg);
}
.fde-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  cursor: default;
}
.fde-field--date { flex: 1 1 11rem; }
.fde-field--time { flex: 1 1 9rem; }
.fde-field .form-input { width: 100%; margin: 0; }
.fde-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.fde-optional {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-tertiary);
}
.fde-actions {
  flex: 1 1 100%;
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-xs);
}

/* Booking detail — a series guest's own project (Oct 1 2026). */
.booking-token-project { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.booking-token-project select { max-width: 100%; min-width: 0; flex: 1 1 200px; font-size: 0.78rem; }

/* Capacity — "Filming together" on a film conflict (Oct 1 2026). */
.elt-together { margin-top: 6px; padding-left: 0; color: var(--accent-text, var(--accent)); }

/* Sub-status chips on an automatic stage (production, review) are read-only:
   the facts set them (app/services/sub_status.py, Oct 8 2026). */
.stage-substatus-row .chip.chip-auto { cursor: default; pointer-events: none; }
.stage-substatus-row .chip.chip-auto:not(.active) { opacity: 0.5; }
