/* ── Finance + Marketing panels (Phase 2 frontend) ──
   Shared styling for the Finance and Marketing panels. Both use the .fin-*
   namespace on top of the m3 surface-card primitives (.m3-panel / .m3-section)
   so they read as native andy-sub panels. Light/dark come from the m3 color
   tokens defined in styles.css; nothing hardcoded here. */

.fin-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 4px 0 16px;
}

/* Period / entity chip rows. Horizontally scrollable on narrow screens so the
   full period set never wraps awkwardly. */
.fin-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.fin-chips::-webkit-scrollbar { display: none; }
.fin-chips--entity { margin: 0; }

.fin-chip {
  flex: 0 0 auto;
  font-size: 13px;
  font-family: inherit;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 16px;
  border: 1px solid var(--md-sys-color-outline);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.fin-chip:hover { border-color: var(--md-sys-color-primary); }
.fin-chip--active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}

/* Section head with an inline entity switcher (QuickBooks). */
.fin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.fin-section-head .m3-section-title { margin-bottom: 0; }

/* Metric grid: responsive auto-fit cells, each a value + label. */
.fin-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.fin-metric {
  background: var(--md-sys-color-surface-container-high);
  border-radius: 12px;
  padding: 12px;
}
.fin-metric-value {
  font-size: 19px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.fin-metric-label {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 4px;
}
.fin-metric-sub {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 2px;
  opacity: 0.85;
}

/* Sub-heading inside a section (e.g. "Cash position", "Top channels"). */
.fin-subhead {
  font-size: 13px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  margin: 16px 0 8px;
}

/* List rows (expense categories, GSC queries, channels). */
.fin-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.fin-row:last-child { border-bottom: none; }
.fin-row--head {
  border-bottom: 1px solid var(--md-sys-color-outline);
}
.fin-row--head .fin-row-label,
.fin-row--head .fin-row-value {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600;
}
.fin-row-label {
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: column;
}
.fin-row-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fin-row-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 2px;
}

/* Alert bars (Stripe disputes, churn, bank staleness). */
.fin-alert {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.fin-alert--warning {
  background: var(--md-sys-color-warning-bg);
  color: var(--md-sys-color-warning-fg);
}
.fin-alert--danger {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.fin-timestamp {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 10px;
}

/* ── Full-parity dashboard UI (Finance + Marketing command centers) ──
   Rich card/KPI/chart/table system ported from Alon's personal Andy and mapped
   to m3 tokens. All colors route through var(--md-sys-color-*). */

/* Entity row + chips */
.fin-entity-row { margin-bottom: 12px; }

/* Period toggle + segmented control (data-period / data-tab) */
.mkt-period-toggle {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; margin: 12px 0;
}
.mkt-period-toggle::-webkit-scrollbar { display: none; }
.mkt-period-btn {
  flex: 0 0 auto; font-size: 13px; font-family: inherit; line-height: 1;
  padding: 8px 14px; border-radius: 16px; border: 1px solid var(--md-sys-color-outline);
  background: transparent; color: var(--md-sys-color-on-surface-variant);
  cursor: pointer; white-space: nowrap;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.mkt-period-btn:hover { border-color: var(--md-sys-color-primary); }
.mkt-period-btn.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container); border-color: transparent;
}

.mkt-segment {
  display: flex; gap: 4px; margin: 14px 0 10px; overflow-x: auto;
  scrollbar-width: none; background: var(--md-sys-color-surface-container);
  border-radius: 12px; padding: 4px;
}
.mkt-segment::-webkit-scrollbar { display: none; }
.mkt-segment-btn {
  flex: 1 1 auto; min-width: max-content; font-size: 13px; font-family: inherit;
  padding: 8px 12px; border-radius: 9px; border: none; background: transparent;
  color: var(--md-sys-color-on-surface-variant); cursor: pointer; white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.mkt-segment-btn.active {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface); font-weight: 600;
}

/* Cards */
.finance-card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 16px; padding: 16px; margin-bottom: 14px;
}
.finance-scoreboard-hero {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 16px; padding: 16px; margin-bottom: 8px;
}
.finance-card .panel-heading { text-align: left; }
.finance-empty-state {
  text-align: left; color: var(--md-sys-color-on-surface-variant);
  padding: 14px 4px; font-size: 15px;
}
.finance-sub-note {
  text-align: left; font-size: 12px; color: var(--md-sys-color-on-surface-variant);
  margin: 4px 0 8px;
}
.finance-updated {
  text-align: left; font-size: 12px; color: var(--md-sys-color-on-surface-variant);
  margin: 10px 0 4px;
}
.fin-refresh-row { display: flex; justify-content: center; padding: 8px 0 4px; }

/* ── Panel accent token. Care& Blue routes the primary chart/bar color. ── */
.fin-panel, .dash-panel { --dash-accent: #2693D1; }

/* ── Tier 1: hero band ──
   Compact daily-ops strip: four tiles across on desktop, two on mobile. The
   overrides below are scoped to .dash-hero so the shared .finance-kpi / .kpi-hero
   styles used elsewhere (Overview cards, etc.) keep their poster sizing. */
.dash-hero {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 16px; padding: 10px 12px; margin-bottom: 12px;
}
.dash-hero .finance-kpis { gap: 8px; }

/* Hero grid: 2-across on mobile, 4-across on desktop. Tiles do NOT span the
   full row here (the base .kpi-hero rule sets grid-column: 1 / -1, which made
   each tile a giant full-width band). Force auto placement inside the hero. */
.dash-hero .finance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-hero .finance-kpi,
.dash-hero .finance-kpi.kpi-hero,
.dash-hero .finance-kpi.kpi-large { grid-column: auto; }

/* Tighter tile padding + smaller value type so the band stays under ~120px. */
.dash-hero .finance-kpi { padding: 8px 10px; }
.dash-hero .kpi-hero .kpi-value { font-size: 24px; font-weight: 600; }
.dash-hero .kpi-label { margin-bottom: 2px; }
.dash-hero .kpi-lastmonth { margin-top: 2px; }

@media (max-width: 380px) {
  /* Keep the hero 2-across even on narrow phones (override the global 1-col). */
  .dash-hero .finance-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-hero .finance-kpi,
  .dash-hero .finance-kpi.kpi-hero,
  .dash-hero .finance-kpi.kpi-large { grid-column: auto; }
  .dash-hero .kpi-hero .kpi-value { font-size: 20px; }
}

@media (min-width: 1024px) {
  .dash-hero .finance-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-hero .finance-kpi,
  .dash-hero .finance-kpi.kpi-hero,
  .dash-hero .finance-kpi.kpi-large { grid-column: auto; }
  /* Override the global desktop rule that bumps hero values to 40px. */
  .dash-hero .kpi-hero .kpi-value { font-size: 24px; font-weight: 600; }
}

/* ── Tier 2: sticky control bar ── */
.dash-controls {
  position: sticky; top: 0; z-index: 5;
  background: var(--md-sys-color-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  margin: 0 0 12px; padding: 8px 0;
  display: flex; flex-direction: column; gap: 6px;
}
.dash-controls .mkt-period-toggle,
.dash-controls .mkt-segment { margin: 0; }
.dash-controls-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.dash-controls-row .mkt-period-toggle { flex: 1 1 auto; min-width: 0; }

/* ── Tier 3: content cards ── */
.dash-card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 14px; padding: 14px; margin-bottom: 12px;
}
.dash-card .panel-heading { text-align: left; }
/* QB-sourced cards: muted so bank/Stripe keep primary visual weight. */
.dash-card--qb {
  background: var(--md-sys-color-surface-container-low);
  opacity: 0.92;
}
.dash-card--qb .finance-collapse-header .panel-heading { color: var(--md-sys-color-on-surface-variant); }

/* Left-aligned empty / error component (replaces centered empty cards). */
.dash-empty {
  font-size: 15px; color: var(--md-sys-color-on-surface-variant);
  padding: 14px 4px; text-align: left;
}
.dash-empty--error { color: var(--md-sys-color-error); }

/* QuickBooks trust badge: muted, visible provenance on every QB block. */
.qb-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-high);
  border-radius: 999px; padding: 2px 9px; margin-left: 8px;
  font-weight: 500; vertical-align: middle;
}

/* KPI grid + cards */
.finance-kpis {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.finance-kpi {
  background: var(--md-sys-color-surface-container-high);
  border-radius: 12px; padding: 12px; min-width: 0;
}
.finance-kpi.kpi-large { grid-column: 1 / -1; }
.finance-kpi.kpi-hero { grid-column: 1 / -1; }
.finance-kpi.kpi-alert {
  background: var(--md-sys-color-error-container);
}
.finance-kpi.kpi-alert .kpi-value { color: var(--md-sys-color-on-error-container); }
.kpi-label {
  font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 4px;
}
.kpi-valrow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kpi-value {
  font-size: 22px; font-weight: 600; color: var(--md-sys-color-on-surface);
  line-height: 1.2;
  /* Safety net: long currency strings (e.g. "$2,260.50 CAD") must wrap inside the
     card rather than clip off-screen. Wrap at any point only as a last resort. */
  overflow-wrap: anywhere; word-break: normal; white-space: normal;
  font-variant-numeric: tabular-nums;
}
.kpi-large .kpi-value { font-size: 26px; }
.kpi-hero .kpi-value { font-size: 28px; font-weight: 700; }
.kpi-value.kpi-negative { color: var(--md-sys-color-error); }
.kpi-sparkline-inline { margin-top: 6px; }
.kpi-lastmonth { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 4px; }

/* Delta pills: tinted bg via color-mix, triangle glyph (not color-alone). */
.kpi-pill {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 3px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kpi-pill-glyph { font-size: 9px; }
.kpi-pill.pill-good {
  background: color-mix(in srgb, var(--md-sys-color-success-fg) 16%, transparent);
  color: var(--md-sys-color-success-fg);
}
.kpi-pill.pill-bad {
  background: color-mix(in srgb, var(--md-sys-color-error) 16%, transparent);
  color: var(--md-sys-color-error);
}
.kpi-pill.pill-amber {
  background: color-mix(in srgb, var(--md-sys-color-warning-fg) 18%, transparent);
  color: var(--md-sys-color-warning-fg);
}
.delta-good { color: var(--md-sys-color-success-fg); }
.delta-bad  { color: var(--md-sys-color-error); }

/* Net burn hero + profit-cash blocks */
.finance-burn-hero {
  text-align: left; font-size: 22px; font-weight: 600;
  color: var(--md-sys-color-on-surface); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.finance-burn-unit { font-size: 13px; font-weight: 400; color: var(--md-sys-color-on-surface-variant); }
.finance-pcb-block {
  border-top: 1px solid var(--md-sys-color-outline-variant); margin-top: 10px; padding-top: 10px;
}
.finance-pcb-label { font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 6px; }

/* List rows (shared by both panels) */
.mkt-row { padding: 9px 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.mkt-row:last-child { border-bottom: none; }
.mkt-row--total { border-top: 1px solid var(--md-sys-color-outline); }
.mkt-row-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mkt-row-query {
  font-size: 14px; color: var(--md-sys-color-on-surface); min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}
.mkt-row-amt {
  font-size: 14px; font-weight: 600; color: var(--md-sys-color-on-surface);
  flex-shrink: 0; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.mkt-row-position {
  font-size: 13px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); flex-shrink: 0;
}
.mkt-row-metrics { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

/* Bars + legends */
.mkt-bar-container { margin-top: 8px; }
.mkt-bar-track {
  width: 100%; height: 12px; background: var(--md-sys-color-surface-container-highest);
  border-radius: 6px; overflow: hidden;
}
.mkt-bar-track--split { display: flex; }
.mkt-bar-track--split > div { height: 12px; }
.mkt-bar-fill { height: 100%; border-radius: 6px; }
.mkt-bar-legend {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px;
  font-size: 12px; color: var(--md-sys-color-on-surface-variant);
}
.mkt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

/* Notices */
.mkt-notice {
  font-size: 13px; padding: 8px 12px; margin-bottom: 12px; border-radius: 10px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
}
.mkt-notice--ok { color: var(--md-sys-color-success-fg); }
.mkt-lag { color: var(--md-sys-color-on-surface-variant); font-size: 11px; font-weight: 400; }

/* MTD partial-data hint: a small info dot on the MTD period chip when an
   early-month MTD view folds in prior-month days. The full explanation lives
   in the Demand tab notice. Scoped to the marketing period toggle so it never
   touches the finance chips. */
.mkt-period-toggle.has-mtd-note .mkt-period-btn:last-child::after {
  content: "\2139"; /* ℹ */
  font-size: 10px; line-height: 1;
  margin-left: 4px;
  color: var(--md-sys-color-on-surface-variant);
  vertical-align: super;
}

/* Scoreboard mini-charts */
.mkt-mini-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mkt-cpa-row {
  display: flex; justify-content: center; gap: 24px; margin-top: 8px;
  font-size: 13px; color: var(--md-sys-color-on-surface-variant);
}
.mkt-funnel-label {
  display: flex; justify-content: space-between; font-size: 13px;
  color: var(--md-sys-color-on-surface-variant); margin-bottom: 2px;
}
.mkt-divider { margin-top: 12px; border-top: 1px solid var(--md-sys-color-outline-variant); padding-top: 10px; }

/* Attribution compare grid */
.mkt-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mkt-compare-cell {
  background: var(--md-sys-color-surface-container-high); border-radius: 10px; padding: 10px;
}
.mkt-compare-label { font-size: 11px; color: var(--md-sys-color-on-surface-variant); }
.mkt-compare-value { font-size: 17px; font-weight: 600; color: var(--md-sys-color-on-surface); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Charts */
.chart-container { width: 100%; }
.chart-svg { width: 100%; height: auto; display: block; }

/* Collapsible groups */
.finance-collapse-header {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 0;
}
.finance-collapse-header .arrow {
  font-size: 11px; color: var(--md-sys-color-on-surface-variant);
  transition: transform .15s ease; display: inline-block;
}
.finance-collapse-header .arrow.open { transform: rotate(90deg); }
.panel-heading--sm { font-size: 13px; text-transform: none; letter-spacing: 0; }
/* Dashboard collapse bodies use their OWN class (not the chat component's
   .tool-group-body, which is collapsed by default and only opens via an .open
   CLASS — that global rule was overriding these and keeping every dashboard
   collapsible permanently hidden). These toggle the [hidden] attribute instead. */
.dash-group-body { display: block; margin-top: 8px; }
.dash-group-body[hidden] { display: none; }

/* Tables (cohort / forecast / unit econ) */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  position: relative;
}
/* Right-edge fade affordance so a scrollable table reads as scrollable. */
.table-scroll::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 24px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--md-sys-color-surface-container));
}
.cohort-table {
  width: 100%; min-width: 480px; border-collapse: collapse; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.cohort-table th {
  text-align: right; padding: 6px 8px; color: var(--md-sys-color-on-surface-variant);
  font-weight: 600; border-bottom: 1px solid var(--md-sys-color-outline);
  white-space: nowrap;
}
.cohort-table th:first-child, .cohort-table td:first-child { text-align: left; }
.cohort-table td {
  text-align: right; padding: 6px 8px; color: var(--md-sys-color-on-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant); white-space: nowrap;
}
.cohort-table .ret-good { color: var(--md-sys-color-success-fg); font-weight: 600; }
.cohort-table .ret-ok   { color: var(--md-sys-color-warning-fg); font-weight: 600; }
.cohort-table .ret-bad  { color: var(--md-sys-color-error); font-weight: 600; }

/* Stacked projection rows (price transition, seasonal) */
.finance-stack-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.finance-stack-label {
  width: 40px; font-size: 10px; color: var(--md-sys-color-on-surface-variant); text-align: right;
}
.finance-stack-track {
  flex: 1; height: 14px; background: var(--md-sys-color-surface-container-highest);
  border-radius: 3px; overflow: hidden; display: flex;
}
.finance-stack-count { width: 80px; font-size: 10px; color: var(--md-sys-color-on-surface-variant); }
.finance-stack-mrr { width: 74px; font-size: 10px; font-weight: 600; color: var(--md-sys-color-on-surface); }
.finance-legend {
  display: flex; gap: 16px; margin-top: 6px; font-size: 10px;
  color: var(--md-sys-color-on-surface-variant);
}

/* ── Responsive grid + font floors + touch targets ──
   App convention: 600px phone / 1024px desktop / pointer:coarse for touch. */

/* Base (mobile, <=600px) is already 2-col for .finance-kpis / .fin-metric-grid.
   Single column on very narrow phones. */
@media (max-width: 380px) {
  .finance-kpis,
  .fin-metric-grid { grid-template-columns: 1fr; }
  .finance-kpi.kpi-large,
  .finance-kpi.kpi-hero { grid-column: 1 / -1; }
}

/* Hide optional cohort columns on phones */
@media (max-width: 600px) {
  .cohort-col-optional { display: none; }
  .mkt-mini-chart-grid { grid-template-columns: 1fr; }
  /* Font floors: nothing below 12px metadata; labels >=13px. */
  .finance-stack-label,
  .finance-stack-count,
  .finance-stack-mrr,
  .finance-legend { font-size: 12px; }
  .cohort-table { font-size: 13px; }
  .kpi-label { font-size: 13px; }
}

/* Tablet (601-1023px): 3 columns, hero/large span 2. */
@media (min-width: 601px) and (max-width: 1023px) {
  .finance-kpis,
  .fin-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finance-kpi.kpi-large,
  .finance-kpi.kpi-hero { grid-column: span 2; }
}

/* Desktop (>=1024px): 4 columns, hero/large span 2, room for full numbers. */
@media (min-width: 1024px) {
  .finance-kpis,
  .fin-metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .finance-kpi.kpi-large,
  .finance-kpi.kpi-hero { grid-column: span 2; }
  .kpi-value { white-space: normal; }
  .kpi-hero .kpi-value { font-size: 40px; }
  .kpi-large .kpi-value { font-size: 30px; }
}

/* Touch targets: chips/tabs/tiles >=44px on coarse pointers. */
@media (pointer: coarse) {
  .fin-chip,
  .mkt-period-btn {
    min-height: 44px; padding: 0 16px;
    display: inline-flex; align-items: center; font-size: 14px;
  }
  .mkt-segment-btn { min-height: 40px; font-size: 14px; }
  .content-chip,
  .content-kpitile { min-height: 44px; }
}

/* ── Content review panel (blog + social). Shares the finance/marketing
   surface; these are the only content-specific additions. ── */
.content-batch-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.content-sub { font-size: 13px; color: var(--md-sys-color-on-surface-variant); }
.content-warn { color: var(--md-sys-color-warning-fg); }
.content-pill {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
}
.content-pill.delta-good { background: color-mix(in srgb, var(--md-sys-color-success-fg) 18%, transparent); color: var(--md-sys-color-success-fg); }
.content-pill.delta-bad { background: color-mix(in srgb, var(--md-sys-color-error) 18%, transparent); color: var(--md-sys-color-error); }
.content-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: none; border-top: 1px solid var(--md-sys-color-outline-variant);
  padding: 12px 2px; cursor: pointer; color: inherit; font: inherit;
}
.content-row:first-of-type { border-top: none; }
.content-row:hover { background: var(--md-sys-color-surface-container-high); }
.content-row-main { flex: 1; min-width: 0; }
.content-row-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.content-row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.content-chevron { font-size: 20px; color: var(--md-sys-color-on-surface-variant); flex-shrink: 0; }
.content-detail-head { margin-bottom: 8px; }
.content-hero { width: 100%; border-radius: 12px; margin: 4px 0 12px; display: block; }
.content-excerpt { font-size: 15px; color: var(--md-sys-color-on-surface-variant); margin: 0 0 12px; }
/* Render the article on a white "paper" card so the post's own colors (authored
   for the white careand.ca page) stay readable instead of dark-on-dark. */
.content-html {
  font-size: 15px; line-height: 1.6;
  background: #ffffff; color: #1f2937;
  padding: 16px 18px; border-radius: 12px; margin-top: 4px;
}
.content-html img { max-width: 100%; height: auto; border-radius: 8px; }
.content-html h1, .content-html h2, .content-html h3 { line-height: 1.3; color: #111827; }
.content-html a { color: #1E6FA8; }
.content-html p, .content-html li, .content-html span, .content-html td { color: #1f2937; }
.content-approved { font-size: 15px; font-weight: 600; color: var(--md-sys-color-success-fg); }
.content-social-text { font-size: 15px; line-height: 1.55; margin: 8px 0; white-space: pre-wrap; }

/* ── Social platform preview cards ── */
/* Lightweight mimics of how a post will look on LinkedIn / Google Business
   Profile. White card + dark text so it reads like the real platform regardless
   of the cockpit theme. No external assets; the avatar is a monogram. */
.content-preview { margin: 4px 0 12px; }
.content-pv-card {
  background: #ffffff; color: #1c1c1c; border-radius: 12px;
  border: 1px solid #e2e4e8; overflow: hidden; max-width: 560px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.content-pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 4px; }
.content-pv-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #fff; background: #0a66c2;
}
.content-pv-avatar--gmb { background: #1a73e8; border-radius: 12px; }
.content-pv-avatar--li { background: #0a66c2; }
.content-pv-meta { min-width: 0; }
.content-pv-name { font-size: 15px; font-weight: 600; color: #1c1c1c; }
.content-pv-sub { font-size: 12px; color: #65676b; }
.content-pv-body { font-size: 15px; line-height: 1.5; color: #1c1c1c; padding: 8px 14px 12px; word-wrap: break-word; }
.content-pv-img { line-height: 0; background: #f0f2f5; }
.content-pv-img img { width: 100%; height: auto; display: block; }
/* LinkedIn link unfurl */
.content-pv-unfurl {
  display: block; text-decoration: none; border-top: 1px solid #e2e4e8;
  background: #f3f6f8; padding: 10px 14px;
}
.content-pv-unfurl-domain { font-size: 12px; color: #65676b; text-transform: lowercase; }
.content-pv-unfurl-title { font-size: 15px; font-weight: 600; color: #1c1c1c; margin-top: 2px; }
/* GMB footer CTA */
.content-pv-gmb-footer { padding: 4px 14px 14px; }
.content-pv-gmb-cta {
  display: inline-block; font-size: 14px; font-weight: 600; color: #1a73e8;
  text-decoration: none;
}
/* Raw text disclosure below the preview */
.content-social-raw { margin: 8px 0; }
.content-social-raw > summary {
  cursor: pointer; font-size: 13px; color: var(--md-sys-color-on-surface-variant);
  padding: 4px 0;
}
/* Draft (unscheduled) date hint */
.content-qtime--draft, .content-sub--draft {
  color: var(--md-sys-color-on-surface-variant); font-style: italic;
}

/* ── Cockpit (Pass 4) additions ── */
.content-tag {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant);
  text-transform: lowercase;
}
.content-tag--blog { background: color-mix(in srgb, var(--md-sys-color-primary) 16%, transparent); color: var(--md-sys-color-primary); }
.content-tag--social { background: color-mix(in srgb, var(--md-sys-color-tertiary, var(--md-sys-color-primary)) 16%, transparent); color: var(--md-sys-color-tertiary, var(--md-sys-color-primary)); }

.content-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.content-select {
  font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low); color: var(--md-sys-color-on-surface);
}
.content-input { flex: 1; min-width: 120px; }
.content-textarea { width: 100%; resize: vertical; }

.content-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.content-action-note { font-size: 14px; color: var(--md-sys-color-on-surface-variant); margin-top: 8px; min-height: 18px; }

.content-prov { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--md-sys-color-outline-variant); }
.content-prov-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13px; }
.content-prov-row span:last-child { text-align: right; word-break: break-word; }

.content-form { display: flex; flex-direction: column; gap: 12px; }
.content-field { display: flex; flex-direction: column; gap: 4px; }
.content-field > span { font-size: 13px; color: var(--md-sys-color-on-surface-variant); }

.content-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.content-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.content-cal-dow { font-size: 13px; font-weight: 600; text-align: center; color: var(--md-sys-color-on-surface-variant); padding: 4px 0; }
.content-cal-cell {
  min-height: 112px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 8px;
  padding: 6px; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.content-cal-empty { border: none; }
.content-cal-date { font-size: 14px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); }
.content-cal-chip {
  font: inherit; font-size: 13px; text-align: left; border: none; border-left: 4px solid transparent;
  border-radius: 5px; padding: 4px 7px; cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; color: var(--md-sys-color-on-surface); min-height: 24px;
}
/* Fill = kind/platform (the at-a-glance scan signal). */
.content-cal-chip--kind-blog      { background: color-mix(in srgb, var(--md-sys-color-primary) 16%, transparent); }
.content-cal-chip--kind-social    { background: color-mix(in srgb, var(--md-sys-color-tertiary, var(--md-sys-color-primary)) 16%, transparent); }
.content-cal-chip--kind-linkedin  { background: color-mix(in srgb, #0a66c2 18%, transparent); }
.content-cal-chip--kind-gmb       { background: color-mix(in srgb, #34a853 18%, transparent); }
.content-cal-chip--kind-facebook  { background: color-mix(in srgb, #1877f2 18%, transparent); }
.content-cal-chip--kind-instagram { background: color-mix(in srgb, #c13584 18%, transparent); }
.content-cal-chip--kind-twitter   { background: color-mix(in srgb, #1da1f2 18%, transparent); }

.content-signal { margin-top: 10px; }
.content-signal-list { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.content-signal-list li { margin: 2px 0; }

.content-social-metric { padding: 8px 0; border-top: 1px solid var(--md-sys-color-outline-variant); }
.content-social-metric:first-child { border-top: none; }

.content-history-row { padding: 6px 0; }
.content-permalink { display: block; word-break: break-all; margin: 0 2px 4px; }

.content-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--md-sys-color-outline-variant); }
.content-setting:first-of-type { border-top: none; }
.content-setting--toggle { cursor: pointer; }

/* ── Cockpit B2: triage queue + review detail ── */

/* Status pill color map (explicit per status; needs-edit must scream). */
.content-pill--pending { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); }
.content-pill--approved { background: color-mix(in srgb, var(--md-sys-color-success-fg) 18%, transparent); color: var(--md-sys-color-success-fg); }
.content-pill--published { background: color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent); color: var(--md-sys-color-primary); }
.content-pill--scheduled { background: color-mix(in srgb, var(--md-sys-color-tertiary, var(--md-sys-color-primary)) 18%, transparent); color: var(--md-sys-color-tertiary, var(--md-sys-color-primary)); }
.content-pill--rejected { background: color-mix(in srgb, var(--md-sys-color-error) 18%, transparent); color: var(--md-sys-color-error); }
.content-pill--needsedit { background: color-mix(in srgb, var(--md-sys-color-warning-fg) 22%, transparent); color: var(--md-sys-color-warning-fg); }

/* Mode header chip. */
.content-modechip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--md-sys-color-on-surface-variant);
  padding: 6px 10px; margin-bottom: 10px; border-radius: 8px;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.content-modechip b { color: var(--md-sys-color-on-surface); }
.content-modechip-sep { opacity: 0.5; }

/* KPI strip. */
.content-kpistrip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.content-kpitile {
  font: inherit; cursor: pointer; text-align: center; padding: 10px 6px; border-radius: 10px;
  background: var(--md-sys-color-surface-container-low); color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.content-kpitile.active { border-color: var(--md-sys-color-primary); background: color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent); }
.content-kpitile--static { cursor: default; }
.content-kpitile-val { font-size: 20px; font-weight: 700; line-height: 1.1; }
.content-kpitile-lbl { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

/* Filter chips. */
.content-filterbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.content-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.content-chip {
  font: inherit; font-size: 13px; cursor: pointer; padding: 6px 12px; border-radius: 999px;
  background: var(--md-sys-color-surface-container-low); color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.content-chip.active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); border-color: var(--md-sys-color-primary); }

/* Bulk action bar. */
.content-bulkbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 10px; border-radius: 10px;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
}
.content-bulk-count { font-size: 13px; font-weight: 600; }
.content-bulk-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Queue rows (triage). */
.content-queue-list { padding: 0 2px; }
.content-qrow {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 4px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.content-qrow:first-child { border-top: none; }
.content-qrow--needsedit { border-left: 3px solid var(--md-sys-color-warning-fg); background: color-mix(in srgb, var(--md-sys-color-warning-fg) 7%, transparent); }
.content-qrow--done { opacity: 0.6; }
.content-qcheck { display: flex; align-items: center; padding-top: 2px; }
.content-qcheck input { width: 18px; height: 18px; }
.content-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 8px; font-size: 16px; margin-top: 2px;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant);
}
.content-icon--blog { background: color-mix(in srgb, var(--md-sys-color-primary) 16%, transparent); color: var(--md-sys-color-primary); }
.content-icon--social { background: color-mix(in srgb, var(--md-sys-color-tertiary, var(--md-sys-color-primary)) 16%, transparent); color: var(--md-sys-color-tertiary, var(--md-sys-color-primary)); }
.content-icon--linkedin { background: color-mix(in srgb, #0a66c2 22%, transparent); color: #0a66c2; }
.content-icon--instagram { background: color-mix(in srgb, #c13584 22%, transparent); color: #c13584; }
.content-icon--facebook { background: color-mix(in srgb, #1877f2 22%, transparent); color: #1877f2; }
.content-icon--gmb { background: color-mix(in srgb, #34a853 22%, transparent); color: #34a853; }
.content-icon--twitter { background: color-mix(in srgb, #1da1f2 22%, transparent); color: #1da1f2; }
.content-qmain {
  flex: 1; min-width: 0; text-align: left; background: transparent; border: none;
  font: inherit; color: inherit; cursor: pointer; padding: 0;
}
.content-qtitle { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.content-qpreview {
  font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.content-qmeta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.content-qright { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.content-qtime { font-size: 12px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; }
.content-qapprove {
  font: inherit; cursor: pointer; width: 34px; height: 34px; border-radius: 999px; font-size: 17px;
  background: color-mix(in srgb, var(--md-sys-color-success-fg) 16%, transparent); color: var(--md-sys-color-success-fg);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-success-fg) 40%, transparent);
}
@media (hover: hover) { .content-qapprove:hover { background: var(--md-sys-color-success-fg); color: var(--md-sys-color-surface); } }

/* Detail / review view. */
.content-detail-back { margin-bottom: 6px; }
.content-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; padding: 6px 4px;
  color: var(--md-sys-color-primary);
}
.content-back-btn:active { opacity: 0.7; }
.content-detail-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.content-detail-pos { font-size: 13px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); }

/* Global "working" indicator: a thin status pill under the segment tabs that
   reflects ALL active generation jobs, not just the current screen's. */
.content-working {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 8px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  background: var(--md-sys-color-secondary-container, rgba(127,127,127,0.12));
  color: var(--md-sys-color-on-secondary-container, var(--md-sys-color-on-surface));
}
.content-working--err {
  background: var(--md-sys-color-error-container, rgba(200,40,40,0.14));
  color: var(--md-sys-color-on-error-container, #b00020);
}
.content-working-text { line-height: 1.3; }
.content-working-spinner {
  width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: content-working-spin 0.7s linear infinite;
}
@keyframes content-working-spin { to { transform: rotate(360deg); } }
.content-editnotes { border-left: 3px solid var(--md-sys-color-warning-fg); }

/* Quality meta grid. */
.content-qualgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.content-metatile { text-align: center; padding: 8px 4px; border-radius: 8px; background: var(--md-sys-color-surface-container-low); border: 1px solid var(--md-sys-color-outline-variant); }
.content-metatile-val { font-size: 17px; font-weight: 700; line-height: 1.1; }
.content-metatile-lbl { font-size: 11px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.content-metatile--good { border-color: color-mix(in srgb, var(--md-sys-color-success-fg) 40%, transparent); }
.content-metatile--warn { border-color: color-mix(in srgb, var(--md-sys-color-warning-fg) 50%, transparent); }
.content-metatile--bad { border-color: color-mix(in srgb, var(--md-sys-color-error) 50%, transparent); }
.content-valid { font-size: 13px; margin: 4px 0; padding: 6px 8px; border-radius: 6px; }
.content-valid--err { background: color-mix(in srgb, var(--md-sys-color-error) 12%, transparent); color: var(--md-sys-color-error); }
.content-valid--warn { background: color-mix(in srgb, var(--md-sys-color-warning-fg) 14%, transparent); color: var(--md-sys-color-warning-fg); }

/* Inline forms + confirm. */
.content-inline { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--md-sys-color-surface-container-low); border: 1px solid var(--md-sys-color-outline-variant); }
.content-confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }

/* Sticky action bar. */
.content-actionbar {
  position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; align-items: center;
  margin-top: 14px; padding: 10px 0; padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--md-sys-color-surface) 70%, transparent);
}
.content-act-primary { flex: 1; }
.content-act-reject { flex: 1; color: var(--md-sys-color-error); border-color: var(--md-sys-color-error); }
.content-act-more { flex: 0 0 auto; }

/* Overflow sheet: fixed bottom-sheet overlay. Sits ABOVE the post content and the
   sticky action bar, with a dimmed backdrop. Never interleaves with the body. */
.content-sheet-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
}
.content-sheet[hidden], .content-sheet-backdrop[hidden] { display: none; }
.content-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001;
  display: flex; flex-direction: column; gap: 2px;
  margin: 0; padding: 8px 8px max(12px, env(safe-area-inset-bottom));
  max-height: 80vh; overflow-y: auto;
  border-radius: 16px 16px 0 0;
  background: var(--md-sys-color-surface-container-high);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-3, 0 -6px 20px rgba(0,0,0,0.28));
}
/* Constrain the sheet width to the panel column on wider viewports. */
@media (min-width: 720px) {
  .content-sheet {
    left: 50%; right: auto; transform: translateX(-50%);
    width: 100%; max-width: 640px;
    border-radius: 16px 16px 0 0;
  }
}
.content-sheet-item {
  font: inherit; font-size: 15px; text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 8px;
  background: transparent; border: none; color: var(--md-sys-color-on-surface);
}
@media (hover: hover) { .content-sheet-item:hover { background: var(--md-sys-color-surface-container-low); } }
.content-sheet-cancel { color: var(--md-sys-color-on-surface-variant); text-align: center; }
.content-danger { color: var(--md-sys-color-error) !important; }

/* Small buttons. */
.m3-btn--sm { font-size: 13px; padding: 6px 12px; min-height: 34px; }

/* Skeleton loaders. */
.content-skel { display: flex; flex-direction: column; gap: 10px; }
.content-skel-line, .content-skel-icon, .content-skel-hero, .content-skel-cell {
  background: linear-gradient(90deg,
    var(--md-sys-color-surface-container-low) 25%,
    var(--md-sys-color-surface-container-high) 37%,
    var(--md-sys-color-surface-container-low) 63%);
  background-size: 400% 100%; animation: content-shimmer 1.4s ease infinite; border-radius: 6px;
}
.content-skel-line { height: 14px; margin: 6px 0; }
.content-skel-icon { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; }
.content-skel-hero { height: 140px; margin: 8px 0; border-radius: 12px; }
.content-skel-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.content-skel-kpis .content-skel-line { height: 46px; margin: 0; }
.content-skel-chips .content-skel-line { height: 28px; }
.content-skel-row { display: flex; gap: 10px; padding: 12px 4px; align-items: flex-start; }
.content-skel-rowmain { flex: 1; }
.content-skel-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.content-skel-cell { height: 56px; }
@keyframes content-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ── Cockpit B3: compose, calendar status, analytics, planner, history, scheduler ── */

/* Compose composer. */
.content-compose { display: flex; flex-direction: column; gap: 12px; }
.content-compose-toggle { display: inline-flex; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 999px; overflow: hidden; align-self: flex-start; }
.content-toggle-btn {
  font: inherit; font-size: 14px; cursor: pointer; padding: 8px 18px; border: none;
  background: var(--md-sys-color-surface-container-low); color: var(--md-sys-color-on-surface-variant);
}
.content-toggle-btn.active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.content-compose-mode { display: flex; gap: 6px; flex-wrap: wrap; }
.content-source-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.content-platform-multi { display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 0; }
.content-platform-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.content-charcount { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.content-charcount--over { color: var(--md-sys-color-error); font-weight: 600; }
.content-gen-status {
  margin-top: 6px; padding: 8px 10px; border-radius: 8px; font-size: 13px;
  background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant);
}
.content-gen-status--err { background: color-mix(in srgb, var(--md-sys-color-error) 14%, transparent); color: var(--md-sys-color-error); }
.content-gen-status--done { background: color-mix(in srgb, var(--md-sys-color-success-fg) 14%, transparent); color: var(--md-sys-color-success-fg); }

/* Calendar: status-colored chips, today marker, shelf, legend. */
.content-cal-chip { display: flex; align-items: center; gap: 5px; }
/* Per-platform glyph: the colorblind-safe carrier of kind, never relies on color. */
.content-cal-chip-glyph {
  flex: none; min-width: 16px; text-align: center; font-size: 10px; font-weight: 700;
  line-height: 1; text-transform: uppercase; opacity: 0.85;
}
/* Left border = status (rides alongside the kind fill). */
.content-cal-chip.is-pending   { border-left-color: var(--md-sys-color-outline); border-left-style: dashed; opacity: 0.75; }
.content-cal-chip.is-needsedit { border-left-color: var(--md-sys-color-warning-fg); border-left-width: 5px; }
.content-cal-chip.is-approved  { border-left-color: var(--md-sys-color-success-fg); }
.content-cal-chip.is-scheduled { border-left-color: var(--md-sys-color-tertiary, var(--md-sys-color-primary)); }
.content-cal-chip.is-published { border-left-color: var(--md-sys-color-primary); opacity: 0.6; }
.content-cal-chip.is-rejected  { border-left-color: var(--md-sys-color-error); }
/* Shelf chips: approved but unscheduled. Dashed outline = "needs a time". */
.content-cal-chip--shelf { border-style: dashed; border-width: 1px; border-left-width: 4px; border-color: var(--md-sys-color-outline); }
.content-cal-cell--today { border-color: var(--md-sys-color-primary); box-shadow: inset 0 0 0 1px var(--md-sys-color-primary); }
.content-cal-cell--today .content-cal-date { color: var(--md-sys-color-primary); font-weight: 700; }
.content-cal-more {
  font: inherit; font-size: 12px; cursor: pointer; border: none; background: none;
  color: var(--md-sys-color-primary); text-align: left; padding: 2px 4px;
}
.content-cal-shelf { margin-bottom: 10px; }
.content-cal-shelf-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.content-cal-legend { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.content-cal-legend-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.content-cal-legend-cap { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; min-width: 58px; }
.content-cal-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.content-cal-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.content-cal-swatch--bar { width: 6px; height: 14px; border-radius: 2px; background: var(--md-sys-color-surface-container-high); }
.content-cal-swatch--bar.is-pending   { background: var(--md-sys-color-outline); }
.content-cal-swatch--bar.is-needsedit { background: var(--md-sys-color-warning-fg); }
.content-cal-swatch--bar.is-approved  { background: var(--md-sys-color-success-fg); }
.content-cal-swatch--bar.is-scheduled { background: var(--md-sys-color-tertiary, var(--md-sys-color-primary)); }
.content-cal-swatch--bar.is-published { background: var(--md-sys-color-primary); }

/* Analytics: header, sparklines, sorted bars. */
.content-analytics-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.content-kpi-spark { margin: 4px 0 2px; }
.content-barlist { margin-top: 6px; }
.content-bar-row { display: grid; grid-template-columns: minmax(80px, 1.6fr) 2fr minmax(48px, auto); gap: 8px; align-items: center; padding: 3px 0; }
.content-bar-label { font-size: 13px; color: var(--md-sys-color-on-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content-bar-track { height: 10px; border-radius: 5px; background: var(--md-sys-color-surface-container-high); overflow: hidden; }
.content-bar-track--empty { background: transparent; }
.content-bar-fill { height: 100%; border-radius: 5px; background: var(--md-sys-color-primary); }
.content-bar-val { font-size: 13px; text-align: right; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; }

/* Planner: ranked signal rows. */
.content-signal-row { padding: 2px 0; }
.content-signal-rank { display: inline-block; min-width: 16px; color: var(--md-sys-color-on-surface-variant); font-size: 12px; }
.content-planner-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* History: controls + view-live link. */
.content-history-controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.content-history-search { width: 100%; }
.content-viewlive { font-size: 13px; color: var(--md-sys-color-primary); white-space: nowrap; text-decoration: none; align-self: center; padding-left: 8px; }
.content-viewlive:hover { text-decoration: underline; }

/* Scheduler / job visibility (in Settings). */
.content-sched-grid { display: flex; flex-direction: column; gap: 2px; }
.content-job-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.content-job-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-top: 1px solid var(--md-sys-color-outline-variant); }
.content-job-row:first-child { border-top: none; }
.content-job-cmd { font-size: 13px; font-family: ui-monospace, monospace; color: var(--md-sys-color-on-surface); }

@media (max-width: 480px) {
  .content-kpistrip { grid-template-columns: repeat(2, 1fr); }
  .content-qualgrid { grid-template-columns: repeat(2, 1fr); }
  .content-bar-row { grid-template-columns: minmax(60px, 1.4fr) 1.5fr minmax(40px, auto); }
}

/* ── Social Autopilot (v266): queue grouping, pause bar, batch approve,
      metadata badges, calendar expiry ── */
.content-pausebar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 4%, transparent);
  font-size: 13px;
}
.content-pausebar--on {
  background: color-mix(in srgb, var(--md-sys-color-error, #b3261e) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-error, #b3261e) 35%, transparent);
}
.content-pausebar-text { flex: 1; min-width: 180px; }

.content-batchbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px; font-size: 13px;
}

.content-qgroup {
  display: flex; align-items: baseline; gap: 8px;
  margin: 14px 2px 6px; font-weight: 600; font-size: 14px;
}
.content-qgroup-count {
  font-weight: 400; font-size: 12px; opacity: 0.65;
}

.content-tag--loc {
  background: color-mix(in srgb, #34a853 16%, transparent);
}
.content-tag--reshare {
  background: color-mix(in srgb, #0a66c2 16%, transparent);
}
.content-tag--lint {
  background: color-mix(in srgb, var(--md-sys-color-error, #b3261e) 16%, transparent);
  color: var(--md-sys-color-error, #b3261e);
}

.content-cal-chip--expired { opacity: 0.55; }
.content-cal-chip--expired .content-cal-chip-glyph { text-decoration: line-through; }
.content-cal-expired-mark { margin-left: 3px; font-size: 10px; opacity: 0.9; }

/* ── Marketing: By Source (daily conversions by source) tab ── */
/* Two stacked-column charts side by side on tablet/desktop, one column on
   mobile. Mirrors .mkt-mini-chart-grid; kept as its own class so the pair can
   collapse independently. */
.src-chart-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .src-chart-pair { grid-template-columns: 1fr; } }

.src-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.src-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.src-table th, .src-table td {
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.src-table thead th {
  font-size: 11px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
}
.src-table .src-subhead th {
  font-weight: 400;
  font-size: 10px;
  padding-top: 0;
  padding-bottom: 6px;
}
.src-th-anchor { color: var(--md-sys-color-on-surface); }
.src-th-ga4, .src-th-lag { font-style: normal; }
.src-td-date { white-space: nowrap; color: var(--md-sys-color-on-surface); }
.src-td-anchor {
  font-weight: 700;
  text-align: right;
  color: var(--md-sys-color-on-surface);
  min-width: 34px;
}
.src-td-ch { min-width: 150px; }
.src-td-ads { white-space: nowrap; }

.src-chip {
  display: inline-block;
  font-size: 12px;
  padding: 1px 6px;
  margin: 1px 2px 1px 0;
  border-radius: 6px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
.src-dim { color: var(--md-sys-color-on-surface-variant); }
.src-ads-val { color: var(--md-sys-color-on-surface); }
.src-ads-lag {
  color: var(--md-sys-color-on-surface-variant);
  font-style: italic;
  opacity: 0.7;
}
