/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Space Grotesk - Variable font for marketing headers
 * ss01 = single-story 'a' alternate (matches Inter's stylistic personality)
 * ss04 = stylistic alternate capital B (and D, J) */
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  font-feature-settings: "ss01", "ss04";
}

/* Inter - Variable font for body text */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  font-feature-settings: "cv11", "ss01";
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-variable-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  font-feature-settings: "cv11", "ss01";
}

/* Force single-story 'a' (ss01) and the stylistic alternate capital B (ss04)
 * on Space Grotesk wherever it's used.
 * @font-face font-feature-settings is honored inconsistently across browsers,
 * so apply at the utility level too. font-display utility maps to Space Grotesk.
 * font-feature-settings is not additive — list both here so .font-display doesn't
 * clobber the @font-face value. */
.font-display {
  font-feature-settings: "ss01", "ss04";
}

/* Global focus-visible for custom interactive elements (Polaris handles its own) */
:focus-visible {
  outline: 2px solid var(--p-color-border-interactive-focus, #005bd3);
  outline-offset: 2px;
}

/* Product workbench visual polish (scoped to product show page) */
.product-workbench .Polaris-Card {
  border-radius: 12px;
}

.product-workbench {
  --pw-history-gutter: var(--p-space-400);
  --pw-history-status-width: 8.5rem;
}

.product-workbench .pw-section-label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  color: var(--p-color-text-secondary);
  letter-spacing: 0.045em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.product-workbench .pw-mini-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--p-color-text-secondary);
  letter-spacing: 0.01em;
}

/* Score-summary layout: ScoreViz on the left, outcome copy on the right.
 * The visual weight of the score lives entirely inside ScoreViz now —
 * this wrapper is just the two-column scaffolding. */
.product-workbench .pw-score-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--p-space-500);
  align-items: start;
}

.product-workbench .pw-score-summary__viz {
  min-width: 0;
}

@media (max-width: 640px) {
  .product-workbench .pw-score-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Issue #466 — score-delta pill rendered under the ScoreViz number. */
.product-workbench .pw-score-summary__delta {
  margin-top: var(--p-space-200, 0.5rem);
}

.product-workbench .pw-callout {
  border-left: 2px solid #d4a053;
  background: #fbf8f1;
  border-radius: 0 var(--p-border-radius-200) var(--p-border-radius-200) 0;
  padding: var(--p-space-150) var(--p-space-250);
  margin-top: var(--p-space-250);
  margin-bottom: var(--p-space-200);
}

.product-workbench .pw-callout-text {
  font-size: 12px;
  padding-left: var(--p-space-100);
}

.product-workbench .pw-callout-text strong {
  color: var(--p-color-text);
  font-weight: 600;
}

.product-workbench .pw-callout-dash {
  margin: 0 0.15em;
  color: var(--p-color-text-subdued);
}

.product-workbench .pw-fixes-compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--p-space-150);
  margin-top: var(--p-space-200);
}

.product-workbench .pw-next-improve {
  padding-top: var(--p-space-150);
}

.product-workbench .pw-fix-item {
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-150);
  background: var(--p-color-bg-surface, #fff);
  padding: 10px 12px;
}

.product-workbench .pw-fix-item--ranked {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--p-space-300);
}

.product-workbench .pw-fix-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--p-border-radius-full, 999px);
  background: var(--p-color-bg-surface-secondary, #f1f1f1);
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.product-workbench .pw-fix-main {
  min-width: 0;
}

.product-workbench .pw-fix-label {
  display: block;
  font-weight: 600;
  margin-bottom: 1px;
  font-size: 13px;
}

.product-workbench .pw-fix-tip {
  display: block;
  font-size: 11px;
  line-height: 1.35;
}

.product-workbench .pw-fix-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  width: 130px;
}

.product-workbench .pw-fix-score-num {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.product-workbench .pw-fix-score-bar {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: var(--p-border-radius-full, 999px);
  background: var(--p-color-bg-surface-secondary, #f1f1f1);
  overflow: hidden;
}

.product-workbench .pw-fix-score-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--p-color-bg-fill-secondary, #8a8a8a);
}

.product-workbench .pw-fix-score--success .pw-fix-score-num {
  color: var(--p-color-text-success, #0c5132);
}

.product-workbench .pw-fix-score--success .pw-fix-score-fill {
  background: var(--p-color-bg-fill-success, #29845a);
}

.product-workbench .pw-fix-score--warning .pw-fix-score-num {
  color: var(--p-color-text-caution, #8a6116);
}

.product-workbench .pw-fix-score--warning .pw-fix-score-fill {
  background: var(--p-color-bg-fill-caution, #ffc453);
}

.product-workbench .pw-fix-score--critical .pw-fix-score-num {
  color: var(--p-color-text-critical, #c5210a);
}

.product-workbench .pw-fix-score--critical .pw-fix-score-fill {
  background: var(--p-color-bg-fill-critical, #e0301e);
}

.product-workbench .pw-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
  gap: var(--p-space-500);
  align-items: start;
  margin-top: var(--p-space-400);
}

.product-workbench .pw-product-detail-row {
  display: grid;
  grid-template-columns: minmax(104px, max-content) 1fr;
  column-gap: var(--p-space-300);
  align-items: baseline;
}

.product-workbench .pw-update-row {
  background: transparent;
  padding: var(--p-space-200) var(--p-space-400);
}

.product-workbench .pw-update-row + .pw-update-row {
  margin-top: var(--p-space-200);
}

.product-workbench .pw-update-shell {
  background: var(--p-color-bg, #fff);
}

.product-workbench .pw-update-head {
  min-width: 0;
  padding-bottom: var(--p-space-150);
  border-bottom: 1px solid var(--p-color-border-subdued, #dde0e4);
}

.pw-powered-by { font-weight: 400; }
.pw-powered-by-link {
  color: var(--p-color-text-subdued);
  text-decoration: none;
}
.pw-powered-by-link:hover {
  text-decoration: underline;
  color: var(--p-color-text-interactive);
}

.product-workbench .pw-update-diff {
  margin-top: var(--p-space-100);
}

.product-workbench .pw-update-diff--single {
  max-width: none;
}

.product-workbench .pw-update-pane {
  min-width: 0;
}

.product-workbench .pw-update-diff--single .pw-update-pane--proposed {
  width: 100%;
}

.product-workbench .pw-update-pane .pw-mini-label {
  margin-bottom: var(--p-space-050);
}

.product-workbench .pw-update-pane--proposed {
  border-inline-start-color: var(--p-color-border-success, #16a34a);
  box-shadow: var(--p-shadow-xs);
}

.product-workbench .pw-update-actions {
  min-height: 2rem;
}

.product-workbench .pw-update-actions form {
  margin: 0;
}

.product-workbench .pw-rich-copy {
  color: var(--p-color-text);
  line-height: 1.46;
}

.product-workbench .pw-rich-copy-wrap {
  margin-top: var(--p-space-050);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.product-workbench .pw-rich-copy p {
  margin: 0 0 0.45rem 0;
}

.product-workbench .pw-rich-copy p:last-child {
  margin-bottom: 0;
}

.product-workbench .pw-rich-copy ul,
.product-workbench .pw-rich-copy ol {
  margin: 0.25rem 0 0.6rem 1.1rem;
  padding: 0;
}

.product-workbench .pw-rich-copy li {
  margin-bottom: 0.25rem;
}

.product-workbench .pw-rich-copy strong {
  font-weight: 650;
}

.product-workbench .pw-rich-copy--current {
  max-height: none;
}

.product-workbench .pw-rich-copy--proposed {
  max-height: none;
}

.product-workbench .pw-rich-copy-wrap--current {
  max-height: 12.5rem;
}

.product-workbench .pw-rich-copy-wrap--proposed {
  max-height: 13.5rem;
}

.product-workbench .pw-update-diff--single .pw-rich-copy {
  max-width: 78ch;
}

.product-workbench .pw-update-diff--single .pw-rich-copy-wrap--proposed {
  max-height: 14rem;
}

.product-workbench .pw-update-history-heading {
  padding: var(--p-space-300) var(--pw-history-gutter) 0;
}

.product-workbench .pw-update-history-list {
  padding: var(--p-space-150) 0 var(--p-space-300);
}

.product-workbench .pw-update-history-columns {
  padding: 0;
  margin-bottom: 0;
}

.product-workbench .pw-update-history-columns .pw-mini-label {
  margin-bottom: 0;
  white-space: nowrap;
  overflow: visible;
  display: inline;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--p-color-text-subdued, #6d7175);
}

.product-workbench .pw-update-history-columns .pw-update-history-content {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  max-height: none;
}

.product-workbench .pw-update-history-columns .pw-update-history-status {
  min-width: 0;
}

.product-workbench .pw-update-history-columns .pw-update-history-status .Polaris-Badge {
  min-width: 0;
}

.product-workbench .pw-update-history-columns > .pw-update-history-status {
  justify-self: end;
}

.product-workbench .pw-update-history-row {
  padding: 0;
  border-top: 1px solid var(--p-color-border-secondary, #e1e3e5);
}

.product-workbench .pw-update-history-columns.pw-update-history-stack {
  padding: var(--p-space-100) var(--pw-history-gutter) var(--p-space-150);
}

.product-workbench .pw-update-history-row .pw-update-history-stack {
  padding: var(--p-space-200) var(--pw-history-gutter);
}

.product-workbench .pw-update-history-stack {
  display: grid;
  grid-template-columns: minmax(148px, 188px) minmax(0, 1fr) auto;
  column-gap: var(--p-space-300);
  row-gap: var(--p-space-050);
  align-items: start;
}

.product-workbench .pw-update-history-field {
  color: var(--p-color-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-workbench .pw-update-history-content {
  color: var(--p-color-text-secondary);
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 2.8em;
  max-width: 74ch;
}

.product-workbench .pw-update-history-status {
  display: flex;
  justify-content: flex-end;
  justify-self: end;
  min-width: var(--pw-history-status-width);
  align-self: start;
  text-align: right;
}

.product-workbench .pw-update-history-status .Polaris-Badge {
  min-width: var(--pw-history-status-width);
  padding-inline: var(--p-space-200);
  justify-content: center;
}

@media (max-width: 900px) {
  .product-workbench .pw-summary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-workbench .pw-outcome-copy {
    max-width: none;
    text-align: left;
  }

  .product-workbench .pw-summary-metrics {
    justify-content: flex-start;
  }

  .product-workbench .pw-fixes-compact {
    grid-template-columns: 1fr;
  }

  .product-workbench .pw-panels {
    grid-template-columns: 1fr;
    gap: var(--p-space-400);
  }

  .product-workbench .pw-product-detail-row {
    grid-template-columns: minmax(96px, max-content) 1fr;
  }

  .product-workbench .pw-update-row {
    padding: var(--p-space-150) var(--p-space-200);
  }

  .product-workbench .pw-update-row + .pw-update-row {
    margin-top: var(--p-space-150);
  }

  .product-workbench .pw-update-history-list {
    padding: var(--p-space-100) var(--p-space-200) var(--p-space-150);
  }

  .product-workbench .pw-update-history-columns {
    display: none;
  }

  .product-workbench .pw-update-history-row {
    padding: 0;
  }

  .product-workbench .pw-update-history-stack {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--p-space-200);
    row-gap: var(--p-space-100);
    align-items: start;
  }

  .product-workbench .pw-update-history-row .pw-update-history-stack {
    padding: var(--p-space-150) 0;
  }

  .product-workbench .pw-update-history-field {
    grid-column: 1 / 2;
    white-space: normal;
  }

  .product-workbench .pw-update-history-content {
    grid-column: 1 / -1;
    max-width: none;
  }

  .product-workbench .pw-update-history-status {
    grid-column: 2 / 3;
    grid-row: 1;
    min-width: 0;
  }
}

/* Dashboard visual polish (scoped to dashboard page) */
.dashboard-workbench {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400);
}

.dashboard-workbench .Polaris-Card {
  border-radius: 12px;
}

.dashboard-workbench .dw-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p-color-text-secondary);
}

.dashboard-workbench .dw-priority {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--p-space-400);
}

.dashboard-workbench .dw-priority-copy {
  max-width: 720px;
}

.dashboard-workbench .dw-priority-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--p-space-200);
  flex-shrink: 0;
}

.dashboard-workbench .dw-progress-strip {
  border-top: 1px solid var(--p-color-border-secondary, #d2d5d8);
  padding-top: var(--p-space-200);
}

.dashboard-workbench .dw-progress-line {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-workbench .dw-progress-sep {
  color: var(--p-color-text-secondary);
}

.dashboard-workbench .dw-progress-strong {
  color: var(--p-color-text);
  font-weight: 600;
}

.dashboard-workbench .dw-queues-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--p-space-400);
  align-items: start;
}

.dashboard-workbench .dw-queues-grid > * {
  margin-top: 0 !important;
  align-self: start;
}

.dashboard-workbench .dw-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--p-space-250);
}

.dashboard-workbench .dw-queue-title-wrap {
  min-width: 0;
}

.dashboard-workbench .dw-queue-meta {
  display: inline-flex;
  align-items: center;
  gap: var(--p-space-150);
  flex-shrink: 0;
}

.dashboard-workbench .dw-card-link {
  flex-shrink: 0;
  white-space: nowrap;
}

.dashboard-workbench .dw-list-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--p-border-radius-200, 8px);
}

.dashboard-workbench .dw-list-link:hover {
  background: var(--p-color-bg-surface-hover);
}

.dashboard-workbench .dw-list-link:focus-visible {
  outline: 2px solid var(--p-color-border-focus);
  outline-offset: 2px;
}

.dashboard-workbench .dw-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--p-space-250);
  align-items: start;
}

.dashboard-workbench .dw-list-row--numbered {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.dashboard-workbench .dw-list-row__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-top: 1px;
  padding: 0 6px;
  border-radius: var(--p-border-radius-full, 999px);
  background: var(--p-color-bg-surface-secondary, #f1f1f1);
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dashboard-workbench .dw-list-main {
  min-width: 0;
}

.dashboard-workbench .dw-row-title {
  display: block;
  color: var(--p-color-text);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 2.7em;
}

.dashboard-workbench .dw-row-subtitle {
  display: block;
  line-height: 1.35;
  margin-top: 2px;
}

.dashboard-workbench .dw-row-meta {
  display: block;
  line-height: 1.25;
  margin-top: 1px;
  font-size: 12px;
}

.dashboard-workbench .dw-row-status,
.dashboard-workbench .dw-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  white-space: nowrap;
}

.dashboard-workbench .dw-empty {
  padding: var(--p-space-500) var(--p-space-200) var(--p-space-600);
}

.dashboard-workbench .dw-card-footer {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1060px) {
  .dashboard-workbench .dw-priority {
    flex-direction: column;
  }

  .dashboard-workbench .dw-priority-actions {
    justify-content: flex-start;
  }

  .dashboard-workbench .dw-queues-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-workbench .dw-card-link {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .dashboard-workbench .dw-priority-actions {
    flex-direction: column;
    width: 100%;
  }

  .dashboard-workbench .dw-queue-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-workbench .dw-queue-meta {
    width: 100%;
    justify-content: space-between;
  }
}

/* Welcome / onboarding banner — full-width lane matching .Polaris-Page
   (same left/right padding) so it stacks full-width above the page content
   instead of splitting into a narrow left column. */
.welcome-banner {
  width: 100%;
  box-sizing: border-box;
  padding: var(--p-space-400) var(--p-space-800) 0;
}

.welcome-banner .Polaris-Banner {
  width: 100%;
}

/* Softer, paler info wash to match the prototype (default Polaris info blue
   reads too saturated for a persistent onboarding banner). */
.welcome-banner .Polaris-Banner--statusInfo,
.welcome-banner .Polaris-Banner--withinPage.Polaris-Banner--statusInfo {
  background: #f2f7fe;
  border-color: #d6e4fb;
}

.welcome-banner__actions {
  display: flex;
  align-items: center;
  gap: var(--p-space-300);
  margin-top: var(--p-space-300);
  flex-wrap: wrap;
}

.welcome-banner__cta {
  text-decoration: none;
}

.welcome-banner__progress {
  display: inline-flex;
  align-items: center;
  gap: var(--p-space-150);
}

.welcome-banner__progress-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--p-color-bg-fill-success, #29845a);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
}

/* Billing visual polish (scoped to billing page) */
.billing-workbench {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400);
}

.billing-workbench .Polaris-Card {
  border-radius: 12px;
}

.billing-workbench > * {
  margin-top: 0 !important;
}

.billing-workbench .Polaris-Card__Section,
.billing-workbench .Polaris-LegacyCard__Section {
  padding: 14px 16px;
}

.billing-workbench .bw-current-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--p-space-300);
}

.billing-workbench .bw-current-main {
  min-width: 0;
}

.billing-workbench .bw-current-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.billing-workbench .bw-current-status {
  margin-top: var(--p-space-100);
}

.billing-workbench .bw-current-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: var(--p-space-150);
  min-width: 320px;
}

.billing-workbench .bw-meta-item {
  padding: 10px 12px;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  text-align: right;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.billing-workbench .bw-meta-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.billing-workbench .bw-credit-strip {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100);
}

.billing-workbench .bw-credit-bar {
  margin-top: 2px;
}

.billing-workbench .bw-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--p-space-100);
}

.billing-workbench .bw-kpi-item {
  padding: 10px 12px;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  min-height: 68px;
  display: flex;
  align-items: center;
}

.billing-workbench .bw-kpi-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.billing-workbench .bw-section-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.billing-workbench .bw-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--p-space-200);
  align-items: start;
}

.billing-workbench .bw-plan-card {
  position: relative;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-300, 12px);
  background: var(--p-color-bg-surface, #fff);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-150);
}

.billing-workbench .bw-plan-card--current {
  border-color: #008060;
  background: #f6fef9;
}

.billing-workbench .bw-plan-card--popular {
  border-color: var(--p-color-border-interactive, #2c6ecb);
  box-shadow: 0 0 0 1px rgba(44, 110, 203, 0.15) inset;
  background: #fbfdff;
}

.billing-workbench .bw-plan-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 128px;
}

.billing-workbench .bw-plan-name-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--p-space-200);
  min-height: 28px;
}

.billing-workbench .bw-plan-badges {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.billing-workbench .bw-plan-price {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  min-height: 44px;
}

.billing-workbench .bw-plan-amount {
  font-size: 38px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--p-color-text);
}

.billing-workbench .bw-plan-capacity {
  min-height: 20px;
}

.billing-workbench .bw-plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid var(--p-color-border-secondary, #d2d5d8);
  padding-top: var(--p-space-100);
}

.billing-workbench .bw-plan-feature {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.billing-workbench .bw-plan-check {
  color: #008060;
  font-size: 14px;
  line-height: 1.45;
  margin-top: 1px;
  flex-shrink: 0;
}

.billing-workbench .bw-plan-feature--more .bw-plan-check {
  color: var(--p-color-text-secondary);
}

.billing-workbench .bw-plan-action {
  margin-top: var(--p-space-100);
}

.billing-workbench .bw-current-plan-note {
  padding: 9px 12px;
  border-radius: var(--p-border-radius-200, 8px);
  background: #e8f4ee;
  color: #00684a;
  text-align: center;
}

.billing-workbench .bw-history-empty {
  padding: var(--p-space-200) 0;
}

.billing-workbench .bw-history-amount {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1200px) {
  .billing-workbench .bw-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .billing-workbench .bw-current-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .billing-workbench .bw-current-meta-grid {
    min-width: 0;
    width: 100%;
  }

  .billing-workbench .bw-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .billing-workbench .bw-plan-grid {
    grid-template-columns: 1fr;
  }

  .billing-workbench .bw-plan-head,
  .billing-workbench .bw-plan-name-row,
  .billing-workbench .bw-plan-price,
  .billing-workbench .bw-plan-capacity {
    min-height: 0;
  }

  .billing-workbench .bw-plan-name-row {
    flex-direction: column;
    gap: var(--p-space-100);
  }

  .billing-workbench .bw-plan-badges {
    align-self: flex-start;
  }
}

@media (max-width: 640px) {
  .billing-workbench .bw-current-meta-grid {
    grid-template-columns: 1fr;
  }

  .billing-workbench .bw-meta-item {
    text-align: left;
    justify-content: flex-start;
  }

  .billing-workbench .bw-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* Merchant shell and SaaS workbench primitives */
.merchant-shell {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400);
  width: 100%;
}

.saas-workbench {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400);
}

.saas-context-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--p-space-300);
  padding: var(--p-space-300);
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-300, 12px);
  background: var(--p-color-bg-surface, #fff);
}

.saas-context-bar__identity {
  min-width: 0;
}

.saas-context-bar__eyebrow,
.saas-summary-card__eyebrow {
  margin: 0 0 2px;
  color: var(--p-color-text-secondary);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.saas-context-bar__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--p-space-150);
}

.saas-context-bar__title,
.saas-summary-card__title {
  margin: 0;
  letter-spacing: -0.02em;
}

.saas-context-bar__title {
  font-size: 1.15rem;
  font-weight: 650;
}

.saas-context-bar__subtitle,
.saas-summary-card__body {
  margin: 4px 0 0;
  color: var(--p-color-text-secondary);
}

.saas-context-bar__role {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  color: var(--p-color-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.saas-context-bar__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--p-space-200);
}

.saas-context-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 10rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  color: inherit;
  text-decoration: none;
}

.saas-context-pill--link:hover {
  background: var(--p-color-bg-surface-hover);
}

.saas-context-pill--safe {
  border-color: rgba(0, 128, 96, 0.2);
}

.saas-context-pill--warning {
  border-color: rgba(183, 126, 36, 0.3);
}

.saas-context-pill--critical {
  border-color: rgba(216, 44, 13, 0.3);
}

.saas-context-pill__label,
.saas-summary-metric__label,
.bw-detail-item__label,
.saas-field__label,
.saas-detail-list__label,
.bw-plan-feature-block__label {
  color: var(--p-color-text-secondary);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.saas-context-pill__value,
.saas-summary-metric__value,
.bw-detail-item__value,
.saas-detail-list__value,
.bw-plan-feature-block__value {
  color: var(--p-color-text);
  font-weight: 600;
}

.saas-context-pill__detail,
.bw-detail-item__detail {
  color: var(--p-color-text-secondary);
  font-size: 12px;
}

.saas-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto;
  gap: var(--p-space-300);
  padding: var(--p-space-400);
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-300, 12px);
  background: linear-gradient(180deg, #fff, #fafafa);
}

.saas-summary-card__copy {
  min-width: 0;
}

.saas-summary-card__title {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.1;
}

.saas-summary-card__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(8rem, 1fr));
  gap: var(--p-space-150);
  align-content: start;
}

.saas-summary-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-200, 8px);
  background: rgba(255, 255, 255, 0.85);
}

.saas-summary-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--p-space-200);
  grid-column: 1 / -1;
}

.saas-filter-head,
.bw-section-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.saas-filter-form,
.team-invite-form {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-300);
}

.saas-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--p-space-200);
}

.saas-filter-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.saas-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.saas-field__input {
  min-height: 2.25rem;
  border: 1px solid var(--p-color-border-input, #8c9196);
  border-radius: var(--p-border-radius-150, 6px);
  background: var(--p-color-bg-surface, #fff);
  padding: 0.55rem 0.75rem;
  color: var(--p-color-text);
}

.saas-field__input:focus {
  outline: 2px solid rgba(0, 128, 96, 0.18);
  outline-offset: 1px;
}

.saas-filter-actions,
.settings-save-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--p-space-200);
}

.saas-table-main,
.saas-table-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.saas-tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--p-space-150);
  margin: var(--p-space-300) 0;
}

.saas-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: 999px;
  background: var(--p-color-bg-surface, #fff);
  color: inherit;
  text-decoration: none;
}

.saas-tab--active {
  border-color: rgba(0, 128, 96, 0.35);
  background: #f3fbf8;
}

.saas-tab__count {
  color: var(--p-color-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.saas-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--p-space-300);
  padding: var(--p-space-700) var(--p-space-400);
  text-align: center;
}

.saas-empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  color: var(--p-color-text-subdued, #8a8a8a);
}

.saas-empty-state__title {
  margin: 0;
}

.saas-empty-state__body {
  max-width: 36rem;
  margin: 0;
  color: var(--p-color-text-secondary);
}

.saas-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--p-space-150);
}

.saas-snapshot-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
}

.saas-snapshot-item__label {
  color: var(--p-color-text-secondary);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.saas-snapshot-item__value {
  color: var(--p-color-text);
  font-weight: 650;
}

.saas-snapshot-item__detail {
  color: var(--p-color-text-secondary);
  font-size: 12px;
}

.saas-detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-200);
}

.saas-detail-list__row {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: var(--p-space-300);
  align-items: start;
}

.saas-detail-list__row--stacked {
  grid-template-columns: 1fr;
}

.saas-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--p-space-300);
}

.saas-rich-surface {
  min-height: 14rem;
  padding: var(--p-space-300);
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface, #fff);
  line-height: 1.55;
  overflow: auto;
}

.saas-rich-surface--highlight {
  background: #f7fbf9;
}

.settings-grid,
.team-invite-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 1fr);
  gap: var(--p-space-300);
  align-items: start;
}

.settings-grid__main,
.settings-grid__side {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-300);
}

.settings-field-grid {
  display: grid;
  gap: var(--p-space-200);
}

.settings-choice {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
}

.settings-connection {
  display: flex;
  align-items: center;
  gap: var(--p-space-200);
}

.settings-connection__status {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: #008060;
  flex-shrink: 0;
}

.settings-connection__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-color-border-success, #008060);
  box-shadow: 0 0 0 3px rgba(41, 132, 90, 0.15);
  flex-shrink: 0;
}

.settings-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--p-space-100);
}

.settings-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  color: var(--p-color-text);
  font-size: 12px;
  font-weight: 600;
}

.settings-danger-row {
  margin-top: var(--p-space-300);
}

.team-role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--p-space-150);
  margin-top: var(--p-space-300);
}

.team-role-grid--stacked {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.team-role-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
}

.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--p-space-300);
}

.team-member-main {
  display: flex;
  align-items: center;
  gap: var(--p-space-250);
  min-width: 0;
}

.team-member-avatar {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  color: var(--p-color-text);
  font-weight: 650;
  flex-shrink: 0;
}

.team-member-avatar--pending {
  background: #fbf5ea;
}

.team-member-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-member-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--p-space-200);
  text-align: right;
}

.bw-inline-separator {
  margin: 0 0.35rem;
}

.bw-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 1fr);
  gap: var(--p-space-300);
  align-items: start;
}

.bw-overview-main,
.bw-notice-stack,
.bw-detail-grid,
.bw-credit-summary,
.bw-owner-actions,
.bw-owner-actions__copy,
.bw-credit-summary__head {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-200);
}

.bw-inline-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--p-space-150);
}

.bw-detail-grid {
  gap: var(--p-space-150);
}

.bw-detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--p-color-border-secondary, #d2d5d8);
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
}

.bw-credit-summary__head {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
}

.bw-plan-feature-grid {
  display: grid;
  gap: var(--p-space-100);
}

.bw-plan-feature-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.6rem 0.7rem;
  border-radius: var(--p-border-radius-150, 6px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
}

.bw-owner-actions {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 1100px) {
  .saas-summary-card,
  .bw-overview-grid,
  .settings-grid,
  .team-invite-grid,
  .saas-compare-grid {
    grid-template-columns: 1fr;
  }

  .saas-snapshot-grid,
  .team-role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .saas-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .saas-context-bar {
    flex-direction: column;
  }

  .saas-context-bar__meta {
    width: 100%;
    justify-content: flex-start;
  }

  .saas-context-pill {
    min-width: min(100%, 14rem);
  }

  .saas-summary-card__metrics,
  .saas-snapshot-grid,
  .team-role-grid,
  .saas-filter-grid,
  .saas-filter-grid--3 {
    grid-template-columns: 1fr;
  }

  .team-member-row,
  .bw-owner-actions,
  .bw-credit-summary__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .team-member-actions {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .saas-summary-card,
  .saas-context-bar {
    padding: var(--p-space-300);
  }

  .saas-detail-list__row {
    grid-template-columns: 1fr;
    gap: var(--p-space-100);
  }
}

/* Polaris page header alignment fixes */
.Polaris-Page-Header__Row {
  align-items: center;
}

.Polaris-Page-Header__RightAlign {
  align-self: center;
}

/* Product show / index header: action buttons and the persistent credit ring
   sit together on one baseline at the right end of the title bar. */
.pw-header-actions {
  display: flex;
  align-items: center;
  gap: var(--p-space-300, 12px);
}

/* ------------------------------------------------------------------
 * Polaris refinement Phase 2 — shared utilities + notification bell +
 * command palette stub styles. Scoped under their own wrappers so they
 * don't leak into existing screens.
 * ------------------------------------------------------------------ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--p-border-radius-100, 6px);
  color: var(--p-color-icon, currentColor);
  text-decoration: none;
  transition: background-color 120ms ease;
}

.notification-bell:hover,
.notification-bell:focus-visible {
  background-color: var(--p-color-bg-surface-hover, rgba(0, 0, 0, 0.06));
  outline: none;
}

.notification-bell__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background-color: var(--p-color-bg-fill-critical, #d72c0d);
  color: var(--p-color-text-critical-on-bg-fill, #fff);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--p-space-200, 8px);
  padding: var(--p-space-200, 8px) var(--p-space-400, 16px);
  border-bottom: 1px solid var(--p-color-border, rgba(0, 0, 0, 0.08));
  background-color: var(--p-color-bg-surface, #fff);
}

.app-bar__hint {
  font-size: 12px;
  color: var(--p-color-text-subdued, rgba(0, 0, 0, 0.55));
}

@keyframes palette-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes palette-overlay-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes palette-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1);    }
}
@keyframes palette-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1);    }
  to   { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.97); }
}

.command-palette__overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.4);
}
.command-palette__overlay[data-state="open"]   { animation: palette-overlay-in  150ms ease forwards; }
.command-palette__overlay[data-state="closed"] { animation: palette-overlay-out 120ms ease forwards; }

.command-palette {
  position: fixed;
  top: 15%;
  left: 50%;
  z-index: 51;
  width: min(560px, 90vw);
  padding: var(--p-space-500, 20px);
  background-color: var(--p-color-bg-surface, #fff);
  border-radius: var(--p-border-radius-300, 12px);
  box-shadow: var(--p-shadow-500, 0 12px 32px rgba(0, 0, 0, 0.18));
  transform: translateX(-50%);
}
.command-palette[data-state="open"]   { animation: palette-in  150ms ease forwards; }
.command-palette[data-state="closed"] { animation: palette-out 120ms ease forwards; }

.command-palette__title {
  margin: 0 0 var(--p-space-300, 12px) 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--p-color-text-subdued, rgba(0, 0, 0, 0.55));
}

.command-palette__field {
  display: block;
  margin-bottom: var(--p-space-300, 12px);
}

.command-palette__input {
  width: 100%;
  padding: var(--p-space-300, 12px);
  font-size: 15px;
  border: 1px solid var(--p-color-border, rgba(0, 0, 0, 0.12));
  border-radius: var(--p-border-radius-200, 8px);
  background-color: var(--p-color-bg-surface, #fff);
}

.command-palette__input:focus {
  border-color: var(--p-color-border-focus, #005bd3);
  outline: none;
  box-shadow: 0 0 0 2px var(--p-color-border-focus, rgba(0, 91, 211, 0.25));
}

.command-palette__list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
}

.command-palette__item {
  display: flex;
  align-items: baseline;
  gap: var(--p-space-200, 8px);
  padding: var(--p-space-200, 8px) var(--p-space-300, 12px);
  color: inherit;
  text-decoration: none;
  border-radius: var(--p-border-radius-100, 6px);
}

.command-palette__item:hover,
.command-palette__item:focus-visible {
  background-color: var(--p-color-bg-surface-hover, rgba(0, 91, 211, 0.08));
  outline: none;
}

.command-palette__group {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--p-color-text-subdued, rgba(0, 0, 0, 0.55));
}

.command-palette__label {
  font-size: 14px;
}

.command-palette__empty {
  padding: var(--p-space-400, 16px);
  color: var(--p-color-text-subdued, rgba(0, 0, 0, 0.55));
  text-align: center;
}

.command-palette__close {
  position: absolute;
  top: var(--p-space-300, 12px);
  right: var(--p-space-300, 12px);
  width: 24px;
  height: 24px;
  font-size: 18px;
  line-height: 1;
  color: var(--p-color-text-subdued, rgba(0, 0, 0, 0.55));
  background: transparent;
  border: none;
  cursor: pointer;
}

/* Phase 2 stub-page list styles — replaced in Phase 3. */
.notifications-stub-list,
.activity-stub-list,
.brand-voice-stub-list,
.agent-insights-stub-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notifications-stub-list > li,
.activity-stub-list > li,
.brand-voice-stub-list > li,
.agent-insights-stub-list > li {
  padding: var(--p-space-300, 12px) 0;
  border-bottom: 1px solid var(--p-color-border-subdued, rgba(0, 0, 0, 0.06));
}

.notifications-stub-list > li:last-child,
.activity-stub-list > li:last-child,
.brand-voice-stub-list > li:last-child,
.agent-insights-stub-list > li:last-child {
  border-bottom: none;
}

/* ----------------------------------------------------------
 * Phase 3.1 — Catalog Issues workbench
 * ---------------------------------------------------------- */

.catalog-issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: var(--p-space-400, 16px);
}

.catalog-issue-card {
  display: block;
}

.catalog-issue-card__description {
  color: var(--p-color-text-subdued, #6d7175);
  margin-bottom: var(--p-space-400, 16px);
}

.catalog-issue-card__stats {
  display: flex;
  gap: var(--p-space-500, 20px);
  padding: var(--p-space-300, 12px) 0;
  border-top: 1px solid var(--p-color-border-subdued, rgba(0, 0, 0, 0.06));
  border-bottom: 1px solid var(--p-color-border-subdued, rgba(0, 0, 0, 0.06));
}

.catalog-issue-card__stat {
  display: flex;
  flex-direction: column;
}

.catalog-issue-card__stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

.catalog-issue-card__stat--lift .catalog-issue-card__stat-value {
  color: var(--p-color-text-success, #008060);
}

.catalog-issue-card__stat-label {
  font-size: 0.8125rem;
  color: var(--p-color-text-subdued, #6d7175);
  margin-top: var(--p-space-100, 4px);
}

.catalog-issue-card__suggested-action {
  margin-top: var(--p-space-300, 12px);
  font-size: 0.875rem;
}

.catalog-issue-card__actions {
  display: flex;
  gap: var(--p-space-300, 12px);
  align-items: center;
  margin-top: var(--p-space-400, 16px);
  flex-wrap: wrap;
}

.catalog-issue-drill__back {
  margin-bottom: var(--p-space-300, 12px);
}

.catalog-issue-drill__action {
  margin: var(--p-space-300, 12px) 0;
}

.catalog-issue-affected {
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-issue-affected__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--p-space-300, 12px) 0;
  border-bottom: 1px solid var(--p-color-border-subdued, rgba(0, 0, 0, 0.06));
}

.catalog-issue-affected__row:last-child {
  border-bottom: none;
}

.catalog-issue-affected__score {
  font-variant-numeric: tabular-nums;
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 0.875rem;
}

/* Polaris refinement Phase 3.2 — Drafts review screen */

.drafts-review__back {
  margin-bottom: var(--p-space-300, 12px);
}

.drafts-review__header {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-300, 12px);
}

@media (min-width: 600px) {
  .drafts-review__header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.drafts-review__count {
  margin: 0;
}

.drafts-review__bulk-actions {
  display: flex;
  gap: var(--p-space-200, 8px);
  flex-wrap: wrap;
}

.drafts-review__score-lift {
  color: var(--p-color-text-success, #007a5c);
  font-weight: 500;
  margin: 0 0 var(--p-space-300, 12px) 0;
}

.drafts-review__diff {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--p-space-400, 16px);
  margin: var(--p-space-300, 12px) 0;
}

@media (min-width: 760px) {
  .drafts-review__diff {
    grid-template-columns: 1fr 1fr;
  }
}

.drafts-review__diff-side {
  border: 1px solid var(--p-color-border-subdued, rgba(0, 0, 0, 0.06));
  border-radius: var(--p-border-radius-200, 8px);
  padding: var(--p-space-400, 16px);
  background: var(--p-color-bg-surface, #ffffff);
}

.drafts-review__diff-side--draft {
  border-color: var(--p-color-border-success-subdued, #abf5d1);
  background: var(--p-color-bg-success-subdued, #f0fdf4);
}

.drafts-review__diff-label {
  margin: 0 0 var(--p-space-200, 8px) 0;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--p-color-text-subdued, #6d7175);
}

.drafts-review__diff-content {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--p-color-text, #202223);
  line-height: 1.5;
}

.drafts-review__empty-value {
  color: var(--p-color-text-subdued, #6d7175);
  font-style: italic;
}

.drafts-review__actions {
  display: flex;
  gap: var(--p-space-200, 8px);
  flex-wrap: wrap;
  margin-top: var(--p-space-400, 16px);
}

/* Polaris refinement Phase 3.3 — Brand Voice Studio */

.brand-voice__section-help {
  color: var(--p-color-text-subdued, #6d7175);
  margin: 0 0 var(--p-space-400, 16px) 0;
  font-size: 0.875rem;
}

.brand-voice__reference {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--p-space-300, 12px);
  padding: var(--p-space-300, 12px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  border-radius: var(--p-border-radius-200, 8px);
}

.brand-voice__reference-meta {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100, 4px);
}

.brand-voice__reference-title {
  font-size: 1rem;
  color: var(--p-color-text, #202223);
}

.brand-voice__reference-score {
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 0.875rem;
}

.brand-voice__empty {
  color: var(--p-color-text-subdued, #6d7175);
  margin: 0;
  font-style: italic;
}

.brand-voice__form {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400, 16px);
}

.brand-voice__field {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100, 4px);
}

.brand-voice__field-help {
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 0.8125rem;
  margin: 0 0 var(--p-space-100, 4px) 0;
}

.brand-voice__form-actions {
  display: flex;
  gap: var(--p-space-200, 8px);
  margin-top: var(--p-space-200, 8px);
}

.brand-voice__patterns {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-300, 12px);
}

.brand-voice__pattern {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--p-space-400, 16px);
  padding: var(--p-space-300, 12px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  border-radius: var(--p-border-radius-200, 8px);
  border-left: 3px solid transparent;
}

.brand-voice__pattern--promoted {
  border-left-color: var(--p-color-border-success, #008060);
  background: var(--p-color-bg-surface-success-subdued, #e8f5ec);
}

.brand-voice__pattern-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100, 4px);
}

.brand-voice__pattern-header {
  display: flex;
  align-items: center;
  gap: var(--p-space-200, 8px);
  flex-wrap: wrap;
}

.brand-voice__pattern-label {
  font-size: 0.9375rem;
  color: var(--p-color-text, #202223);
}

.brand-voice__pattern-badge {
  background: var(--p-color-bg-success-strong, #008060);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.brand-voice__pattern-strength {
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 0.8125rem;
}

.brand-voice__pattern-sample {
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 0.875rem;
  margin: 0;
  font-style: italic;
}

.brand-voice__pattern-actions {
  display: flex;
  gap: var(--p-space-200, 8px);
  flex-shrink: 0;
}

/* Polaris refinement Phase 3.4 — Activity feed + Notifications inbox */

.activity-feed__filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--p-space-200, 8px);
}

.activity-feed__filter-label {
  margin-right: var(--p-space-200, 8px);
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 0.875rem;
}

.activity-feed__chip {
  padding: var(--p-space-100, 4px) var(--p-space-300, 12px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--p-color-text, #202223);
  text-decoration: none;
}

.activity-feed__chip--active {
  background: var(--p-color-bg-fill-emphasis, #202223);
  color: #fff;
}

.activity-feed__list,
.notifications-inbox__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-200, 8px);
}

.activity-feed__item {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100, 4px);
  padding: var(--p-space-300, 12px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  border-radius: var(--p-border-radius-200, 8px);
}

.activity-feed__item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--p-space-200, 8px);
}

.activity-feed__item-kind {
  font-size: 0.9375rem;
  color: var(--p-color-text, #202223);
}

.activity-feed__item-time {
  font-size: 0.8125rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.activity-feed__item-body {
  font-size: 0.875rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.activity-feed__item-actor {
  color: var(--p-color-text, #202223);
}

.activity-feed__pagination {
  display: flex;
  align-items: center;
  gap: var(--p-space-200, 8px);
  margin-top: var(--p-space-400, 16px);
}

.activity-feed__page-indicator {
  font-size: 0.8125rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.activity-feed__empty,
.notifications-inbox__empty {
  color: var(--p-color-text-subdued, #6d7175);
  margin: 0;
  font-style: italic;
}

.notifications-inbox__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--p-space-300, 12px);
}

.notifications-inbox__unread-count {
  font-weight: 600;
  color: var(--p-color-text, #202223);
}

.notifications-inbox__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--p-space-200, 8px);
}

.notifications-inbox__chip {
  padding: var(--p-space-100, 4px) var(--p-space-300, 12px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--p-color-text, #202223);
  text-decoration: none;
}

.notifications-inbox__chip--active {
  background: var(--p-color-bg-fill-emphasis, #202223);
  color: #fff;
}

.notifications-inbox__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--p-space-400, 16px);
  padding: var(--p-space-300, 12px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  border-radius: var(--p-border-radius-200, 8px);
  border-left: 3px solid transparent;
}

.notifications-inbox__item--unread {
  border-left-color: var(--p-color-border-info, #2c6ecb);
  background: var(--p-color-bg-surface-info-subdued, #ebf5ff);
}

.notifications-inbox__item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100, 4px);
}

.notifications-inbox__item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--p-space-200, 8px);
}

.notifications-inbox__item-title {
  font-size: 0.9375rem;
  color: var(--p-color-text, #202223);
}

.notifications-inbox__item-kind {
  font-size: 0.75rem;
  color: var(--p-color-text-subdued, #6d7175);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.notifications-inbox__item-text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--p-color-text-subdued, #6d7175);
  line-height: 1.5;
}

.notifications-inbox__item-time {
  font-size: 0.75rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.notifications-inbox__item-actions {
  display: flex;
  gap: var(--p-space-200, 8px);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* AI Agent Insights — Phase 3.5 */
.agent-insights__cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--p-space-400, 16px);
}

.agent-insights__card {
  flex: 1 1 220px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-200, 8px);
  padding: var(--p-space-400, 16px);
  border: 1px solid var(--p-color-border-subdued, #e1e3e5);
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface, #ffffff);
}

.agent-insights__card--empty {
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  border-style: dashed;
}

.agent-insights__card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--p-color-text, #202223);
}

.agent-insights__card-metric {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--p-color-text, #202223);
  line-height: 1;
}

.agent-insights__card-metric-label {
  font-size: 0.75rem;
  color: var(--p-color-text-subdued, #6d7175);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agent-insights__card-metric--secondary {
  font-size: 0.875rem;
  color: var(--p-color-text-secondary, #6d7175);
}

.agent-insights__card-meta {
  font-size: 0.75rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.agent-insights__empty-hint {
  margin: var(--p-space-400, 16px) 0 0 0;
  font-size: 0.875rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.agent-insights__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--p-space-200, 8px);
  margin-bottom: var(--p-space-400, 16px);
}

.agent-insights__chip {
  display: inline-flex;
  align-items: center;
  padding: var(--p-space-100, 4px) var(--p-space-300, 12px);
  border-radius: var(--p-border-radius-full, 9999px);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  color: var(--p-color-text, #202223);
  text-decoration: none;
  font-size: 0.875rem;
}

.agent-insights__chip--active {
  background: var(--p-color-bg-fill-emphasis, #303030);
  color: var(--p-color-text-on-color, #ffffff);
}

.agent-insights__mentions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.agent-insights__mention {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100, 4px);
  padding: var(--p-space-400, 16px) 0;
  border-bottom: 1px solid var(--p-color-border-subdued, #e1e3e5);
}

.agent-insights__mention:last-child {
  border-bottom: none;
}

.agent-insights__mention-header {
  display: flex;
  align-items: center;
  gap: var(--p-space-200, 8px);
  flex-wrap: wrap;
}

.agent-insights__mention-badge {
  font-size: 0.75rem;
  color: var(--p-color-text-subdued, #6d7175);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  padding: 2px var(--p-space-200, 8px);
  border-radius: var(--p-border-radius-100, 4px);
}

.agent-insights__mention-url {
  font-size: 0.875rem;
  color: var(--p-color-text-link, #006fbb);
  word-break: break-all;
}

.agent-insights__mention-excerpt {
  margin: 0;
  font-size: 0.875rem;
  color: var(--p-color-text, #202223);
}

.agent-insights__mention-excerpt--empty {
  color: var(--p-color-text-subdued, #6d7175);
  font-style: italic;
}

.agent-insights__mention-time {
  font-size: 0.75rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.agent-insights__mentions-empty {
  margin: 0;
  padding: var(--p-space-400, 16px) 0;
  font-size: 0.875rem;
  color: var(--p-color-text-subdued, #6d7175);
}

/* Polaris refinement Phase 3.6 — Autopilot settings */

.autopilot__form {
  display: block;
  margin-bottom: var(--p-space-400, 16px);
}

.autopilot__toggle-row {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-300, 12px);
}

.autopilot__toggle-state {
  margin: 0;
  font-size: 0.875rem;
  color: var(--p-color-text, #202223);
}

.autopilot__guardrails {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400, 16px);
  margin-bottom: var(--p-space-400, 16px);
}

.autopilot__field {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100, 4px);
  font-size: 0.875rem;
}

.autopilot__field span {
  color: var(--p-color-text, #202223);
  font-weight: 500;
}

.autopilot__field input[type="number"] {
  max-width: 200px;
  padding: var(--p-space-200, 8px);
  border: 1px solid var(--p-color-border, #c9cccf);
  border-radius: var(--p-border-radius-200, 6px);
  font-size: 0.875rem;
}

.autopilot__field-group {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-200, 8px);
  padding: var(--p-space-300, 12px);
  border: 1px solid var(--p-color-border, #c9cccf);
  border-radius: var(--p-border-radius-200, 6px);
}

.autopilot__field-group legend {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--p-color-text, #202223);
}

.autopilot__field-checkbox {
  display: flex;
  align-items: center;
  gap: var(--p-space-200, 8px);
  font-size: 0.875rem;
  color: var(--p-color-text, #202223);
}

.autopilot__runs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-300, 12px);
}

.autopilot__run-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--p-space-300, 12px);
  padding: var(--p-space-300, 12px);
  border-bottom: 1px solid var(--p-color-border-subdued, #e1e3e5);
}

.autopilot__run-row:last-child {
  border-bottom: none;
}

.autopilot__run-counts {
  font-size: 0.875rem;
  color: var(--p-color-text, #202223);
}

.autopilot__run-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.autopilot__run-error {
  flex-basis: 100%;
  font-size: 0.75rem;
  color: var(--p-color-text-critical, #d72c0d);
}

.autopilot__runs-empty {
  margin: 0;
  padding: var(--p-space-400, 16px) 0;
  font-size: 0.875rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.autopilot__status-badge {
  display: inline-block;
  padding: var(--p-space-100, 4px) var(--p-space-200, 8px);
  border-radius: var(--p-border-radius-100, 4px);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.autopilot__status-badge--running {
  background: var(--p-color-bg-info, #ebf3ff);
  color: var(--p-color-text-info, #00527c);
}

.autopilot__status-badge--completed {
  background: var(--p-color-bg-success, #e3f1df);
  color: var(--p-color-text-success, #007f5f);
}

.autopilot__status-badge--failed {
  background: var(--p-color-bg-critical, #fee9e8);
  color: var(--p-color-text-critical, #d72c0d);
}

.autopilot__status-badge--skipped {
  background: var(--p-color-bg-subdued, #f6f6f7);
  color: var(--p-color-text-subdued, #6d7175);
}

/* Polaris refinement Phase 4.1 — healthy dashboard variant */

.dashboard-workbench--healthy .dw-priority--healthy {
  background: var(--p-color-bg-success-subdued, #f1f8f5);
  border-radius: var(--p-border-radius-200, 6px);
  padding: var(--p-space-400, 16px);
}

.dw-healthy-signals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--p-space-300, 12px);
}

.dw-healthy-signal {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100, 4px);
  padding: var(--p-space-300, 12px);
  background: var(--p-color-bg-subdued, #f6f6f7);
  border-radius: var(--p-border-radius-200, 6px);
}

.dw-healthy-signal__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--p-color-text-subdued, #6d7175);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dw-healthy-signal__value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--p-color-text, #202223);
}

.dw-healthy-signal__help {
  font-size: 0.75rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.dw-recent-activity {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-200, 8px);
}

.dw-recent-activity__row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: var(--p-space-300, 12px);
  padding: var(--p-space-200, 8px) 0;
  border-bottom: 1px solid var(--p-color-border-subdued, #e1e3e5);
  font-size: 0.875rem;
}

.dw-recent-activity__row:last-child {
  border-bottom: none;
}

.dw-recent-activity__title {
  font-weight: 500;
  color: var(--p-color-text, #202223);
}

.dw-recent-activity__subtitle {
  color: var(--p-color-text-subdued, #6d7175);
}

.dw-recent-activity__meta {
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 0.75rem;
}

/* Phase 4.2 — Focus mode for Drafts review */
.drafts-focus {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400, 1rem);
}

.drafts-focus__back {
  margin: 0;
}

.drafts-focus__progress {
  font-size: 0.875rem;
  color: var(--p-color-text-subdued, #6d7175);
  text-align: center;
}

.drafts-focus__score-lift {
  font-size: 0.875rem;
  color: var(--p-color-text-success, #007a5c);
  margin: 0 0 var(--p-space-300, 0.75rem);
}

.drafts-focus__diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--p-space-400, 1rem);
  margin: var(--p-space-300, 0.75rem) 0;
}

@media (max-width: 640px) {
  .drafts-focus__diff {
    grid-template-columns: 1fr;
  }
}

.drafts-focus__diff-side {
  border: 1px solid var(--p-color-border-subdued, #e1e3e5);
  border-radius: 8px;
  padding: var(--p-space-300, 0.75rem);
  background: var(--p-color-bg-surface, #ffffff);
}

.drafts-focus__diff-side--draft {
  border-color: var(--p-color-border-success-subdued, #95c9b3);
  background: var(--p-color-bg-surface-success-subdued, #f1f8f5);
}

.drafts-focus__diff-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--p-color-text-subdued, #6d7175);
  margin: 0 0 var(--p-space-200, 0.5rem);
}

.drafts-focus__diff-content {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--p-color-text, #202223);
}

.drafts-focus__empty-value {
  color: var(--p-color-text-subdued, #6d7175);
}

.drafts-focus__actions {
  display: flex;
  gap: var(--p-space-300, 0.75rem);
  margin-top: var(--p-space-400, 1rem);
}

.drafts-focus__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drafts-focus__nav-spacer {
  display: inline-block;
  width: 1px;
}

/* Phase 4.3 — Per-product version history */
.product-history {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400, 1rem);
}

.product-history__back {
  margin: 0 0 var(--p-space-300, 0.75rem);
}

.product-history__entry {
  margin: 0;
}

.product-history__entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--p-space-300, 0.75rem);
  margin-bottom: var(--p-space-300, 0.75rem);
  flex-wrap: wrap;
}

.product-history__field {
  font-weight: 600;
  margin-right: var(--p-space-200, 0.5rem);
}

.product-history__status {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-history__status--applied {
  background: var(--p-color-bg-fill-success-secondary, #cdfee1);
  color: var(--p-color-text-success, #007a5c);
}

.product-history__status--reverted {
  background: var(--p-color-bg-fill-warning-secondary, #fff2c4);
  color: var(--p-color-text-warning, #8a6116);
}

.product-history__timestamp {
  font-size: 0.8125rem;
  color: var(--p-color-text-subdued, #6d7175);
}

.product-history__diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--p-space-300, 0.75rem);
  margin-bottom: var(--p-space-300, 0.75rem);
}

@media (max-width: 640px) {
  .product-history__diff {
    grid-template-columns: 1fr;
  }
}

.product-history__diff-side {
  border: 1px solid var(--p-color-border-subdued, #e1e3e5);
  border-radius: 8px;
  padding: var(--p-space-300, 0.75rem);
  background: var(--p-color-bg-surface, #ffffff);
}

.product-history__diff-side--after {
  border-color: var(--p-color-border-success-subdued, #95c9b3);
}

.product-history__diff-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--p-color-text-subdued, #6d7175);
  margin: 0 0 var(--p-space-200, 0.5rem);
}

.product-history__diff-content {
  font-size: 0.875rem;
  line-height: 1.5;
}

.product-history__empty-value {
  color: var(--p-color-text-subdued, #6d7175);
}

.product-history__actions {
  display: flex;
  justify-content: flex-end;
}

.product-history__entry--reverted .product-history__diff-side--after {
  opacity: 0.6;
}

/* Issue #466 — readiness-score timeline on the version history page. */
.product-history__scores {
  margin-bottom: var(--p-space-400, 1rem);
}

.product-history__scores-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--p-color-text-subdued, #6d7175);
  margin: 0 0 var(--p-space-200, 0.5rem);
}

.product-history__scores-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-history__score-row {
  display: flex;
  align-items: baseline;
  gap: var(--p-space-300, 0.75rem);
  padding: var(--p-space-150, 0.375rem) 0;
  font-size: 0.875rem;
}

.product-history__score-row + .product-history__score-row {
  border-top: 1px solid var(--p-color-border-subdued, #e1e3e5);
}

.product-history__score-date {
  color: var(--p-color-text-subdued, #6d7175);
  min-width: 7rem;
}

.product-history__score-values {
  font-weight: 600;
}

.product-history__score-delta--up {
  color: var(--p-color-text-success, #007a5c);
  font-weight: 600;
}

.product-history__score-delta--down {
  color: var(--p-color-text-critical, #d72c0d);
  font-weight: 600;
}

.product-history__score-delta--flat {
  color: var(--p-color-text-subdued, #6d7175);
}

/* Phase 4.4 — Conflict resolution UI */
.conflict {
  max-width: 760px;
  margin: 0 auto;
}

.conflict__back {
  margin: 0 0 var(--p-space-300, 0.75rem);
}

.conflict__field {
  margin-bottom: var(--p-space-400, 1rem);
}

.conflict__field-label {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 var(--p-space-200, 0.5rem);
}

.conflict__notification-body {
  color: var(--p-color-text-subdued, #6d7175);
  font-size: 0.875rem;
  margin: 0;
}

.conflict__diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--p-space-300, 0.75rem);
  margin-bottom: var(--p-space-400, 1rem);
}

@media (max-width: 640px) {
  .conflict__diff {
    grid-template-columns: 1fr;
  }
}

.conflict__diff-side {
  border: 1px solid var(--p-color-border-subdued, #e1e3e5);
  border-radius: 8px;
  padding: var(--p-space-300, 0.75rem);
  background: var(--p-color-bg-surface, #ffffff);
}

.conflict__diff-side--shopify {
  border-color: var(--p-color-border-caution-subdued, #f1c879);
  background: var(--p-color-bg-surface-caution-subdued, #fff8eb);
}

.conflict__diff-side--draft {
  border-color: var(--p-color-border-info-subdued, #98c6cd);
  background: var(--p-color-bg-surface-info-subdued, #ebf9fc);
}

.conflict__diff-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--p-color-text-subdued, #6d7175);
  margin: 0 0 var(--p-space-200, 0.5rem);
}

.conflict__diff-content {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.conflict__empty-value {
  color: var(--p-color-text-subdued, #6d7175);
}

.conflict__actions {
  display: flex;
  gap: var(--p-space-300, 0.75rem);
  flex-wrap: wrap;
}

/* Phase 5.1 — Dashboard quick actions */
.dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--p-space-200, 0.5rem);
  margin-bottom: var(--p-space-400, 1rem);
}

.dashboard-quick-actions__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--p-color-text-emphasis, #2c6ecb);
  text-decoration: none;
  padding: var(--p-space-200, 0.5rem) var(--p-space-300, 0.75rem);
  border: 1px solid var(--p-color-border-subdued, #e1e3e5);
  border-radius: 6px;
  background: var(--p-color-bg-surface, #ffffff);
}

.dashboard-quick-actions__link:hover {
  background: var(--p-color-bg-surface-hover, #f6f6f7);
  border-color: var(--p-color-border, #c9cccf);
}

/* Phase 5.2 — Products index search */
.products-search {
  margin-bottom: var(--p-space-400, 1rem);
}

.products-search__row {
  display: flex;
  gap: var(--p-space-200, 0.5rem);
  align-items: stretch;
  max-width: 480px;
}

.products-search__field {
  flex: 1;
}

.products-search__field .Polaris-TextField__Input {
  width: 100%;
  padding: var(--p-space-200, 0.5rem) var(--p-space-300, 0.75rem);
  border: 1px solid var(--p-color-border, #c9cccf);
  border-radius: 6px;
  background: var(--p-color-bg-surface, #ffffff);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.products-search__field .Polaris-TextField__Input:focus {
  outline: 2px solid var(--p-color-border-emphasis, #2c6ecb);
  outline-offset: -1px;
}

/* ============================================================
   Shared shopify_app primitives (Task 1: polish punch list)
   All styles use Polaris tokens for color, spacing, and radius.
   Wrapper classes live on the ViewComponents themselves; the
   styles here are global because the components are reused on
   every screen.
   ============================================================ */

/* ---- ScoreViz: AI Readiness number + target-marked bar ---- */
.score-viz {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-150);
  min-width: 0;
}

.score-viz__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--p-space-200);
}

.score-viz__label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--p-color-text-secondary);
}

.score-viz__row {
  display: flex;
  align-items: baseline;
}

.score-viz__num {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--p-color-text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.score-viz__pct {
  font-weight: 600;
  color: var(--p-color-text-secondary);
  margin-left: 2px;
}

.score-viz__bar {
  position: relative;
  width: 100%;
  background: var(--p-color-bg-fill-transparent-secondary, #e4e5e7);
  border-radius: 999px;
  overflow: visible;
}

.score-viz__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.score-viz--success .score-viz__bar-fill { background: var(--p-color-bg-fill-success, #29845a); }
.score-viz--warning .score-viz__bar-fill { background: var(--p-color-bg-fill-warning, #d4a053); }
.score-viz--critical .score-viz__bar-fill { background: var(--p-color-bg-fill-critical, #e02b2b); }

.score-viz__target {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.score-viz__target-tick {
  display: block;
  width: 2px;
  height: 100%;
  background: var(--p-color-text);
  opacity: 0.55;
  border-radius: 1px;
}

.score-viz__legend {
  display: flex;
  justify-content: space-between;
  gap: var(--p-space-200);
  font-size: 11px;
  color: var(--p-color-text-secondary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.score-viz--pulse .score-viz__num {
  animation: score-viz-pulse 1.6s ease-in-out infinite;
}

@keyframes score-viz-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .score-viz--pulse .score-viz__num { animation: none; }
  .score-viz__bar-fill { transition: none; }
}

/* ---- BeaconMark: the "B" wordmark ---- */
.beacon-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.beacon-mark svg { display: block; }

/* ---- PageHeader: title bar above every page ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--p-space-400);
  padding: var(--p-space-500) 0 var(--p-space-500);
  border-bottom: 1px solid var(--p-color-border-subdued, #e4e5e7);
  margin-bottom: var(--p-space-100);
}

.page-header__left {
  display: flex;
  align-items: flex-start;
  gap: var(--p-space-400);
  min-width: 0;
}

.page-header__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  flex-shrink: 0;
}

.page-header__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border-radius: var(--p-border-radius-200);
  color: var(--p-color-text-secondary);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  border: 1px solid var(--p-color-border-subdued, #e4e5e7);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.page-header__back:hover,
.page-header__back:focus-visible {
  background: var(--p-color-bg-surface, #fff);
  color: var(--p-color-text);
  border-color: var(--p-color-border, #c9cccf);
}

.page-header__copy { min-width: 0; flex: 1; }

.page-header__eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p-color-text-secondary);
  margin-bottom: var(--p-space-100);
}

.page-header__breadcrumb { margin-bottom: var(--p-space-100); }
.page-header__breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--p-space-100);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: var(--p-color-text-secondary);
}
.page-header__breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: var(--p-space-100);
}
.page-header__breadcrumb a {
  color: var(--p-color-text-secondary);
  text-decoration: none;
}
.page-header__breadcrumb a:hover { color: var(--p-color-text); text-decoration: underline; }
.page-header__breadcrumb-sep { color: var(--p-color-text-subdued); opacity: 0.65; }
.page-header__breadcrumb [aria-current="page"] { color: var(--p-color-text); font-weight: 500; }

.page-header__title {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--p-color-text);
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
}

.page-header__meta {
  margin-top: var(--p-space-150);
  font-size: 13px;
  line-height: 1.5;
  color: var(--p-color-text-secondary);
  max-width: 64ch;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--p-space-200);
  flex-shrink: 0;
  margin-top: var(--p-space-200);
}

.page-header__action-form { display: inline-block; margin: 0; }

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--p-space-300);
  }
  .page-header__left { gap: var(--p-space-300); }
  .page-header__title { font-size: 24px; }
  .page-header__actions { justify-content: flex-start; }
}

/* ============================================================
   Polish punch list — shared page layout primitives
   (Tasks 2/3/4/5/6/7: consistent vertical rhythm)
   ============================================================ */

/* The "stack-of-cards" rhythm: every embedded screen wraps its
   page content in .page-stack so card gaps are uniform. */
.page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400);
}

.page-stack > * { min-width: 0; }

/* ---- KPI strip (3 or 4 equal columns of value + label) ---- */
.kpi-row {
  display: grid;
  gap: 0;
  align-items: stretch;
  background: var(--p-color-bg-surface, #fff);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.kpi-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-row--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .kpi-row--3,
  .kpi-row--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .kpi-row--3,
  .kpi-row--4 { grid-template-columns: minmax(0, 1fr); }
}

.kpi-cell {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-150);
  padding: var(--p-space-400) var(--p-space-500) var(--p-space-300);
  border-right: 1px solid var(--p-color-border-subdued, #e4e5e7);
  background: var(--p-color-bg-surface, #fff);
  min-width: 0;
}

.kpi-cell:last-child { border-right: none; }

/* On wrap, the cells that fall to a new visual row need a top divider and the
   right-edge cell of each row should drop its divider. Handled per breakpoint. */
@media (max-width: 900px) {
  .kpi-row--4 .kpi-cell:nth-child(2n) { border-right: none; }
  .kpi-row--4 .kpi-cell:nth-child(n + 3),
  .kpi-row--3 .kpi-cell:nth-child(n + 3) { border-top: 1px solid var(--p-color-border-subdued, #e4e5e7); }
  .kpi-row--3 .kpi-cell:nth-child(2n) { border-right: none; }
}
@media (max-width: 560px) {
  .kpi-cell { border-right: none; }
  .kpi-cell:not(:first-child) { border-top: 1px solid var(--p-color-border-subdued, #e4e5e7); }
}

.kpi-cell__eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--p-color-text-secondary);
}

.kpi-cell__value {
  display: flex;
  align-items: baseline;
  gap: var(--p-space-100);
  flex-wrap: wrap;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--p-color-text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.kpi-cell__value-pct,
.kpi-cell__value-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--p-color-text-secondary);
}

.kpi-cell__label {
  font-size: 12px;
  color: var(--p-color-text-secondary);
}

/* ---- Segmented control (billing monthly/annual etc.) ---- */
.segmented {
  display: inline-flex;
  border: 1px solid var(--p-color-border-subdued, #e4e5e7);
  border-radius: var(--p-border-radius-200);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  padding: 2px;
}

.segmented__btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--p-color-text-secondary);
  padding: 6px 14px;
  border-radius: calc(var(--p-border-radius-200) - 2px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}

.segmented__btn:hover { color: var(--p-color-text); }

.segmented__btn.is-active {
  background: var(--p-color-bg-surface, #fff);
  color: var(--p-color-text);
  box-shadow: var(--p-shadow-100, 0 1px 0 rgba(0,0,0,0.05));
}

.segmented__save {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p-color-text-success, #29845a);
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--p-color-bg-fill-success-secondary, #e7f5ec);
}

/* ---- Dashboard refinements ---- */
.dashboard-workbench .dw-queues-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--p-space-400);
}

@media (max-width: 900px) {
  .dashboard-workbench .dw-queues-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dw-queue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--p-space-300);
}

.dw-queue-title-wrap { min-width: 0; }

.dw-list-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.dw-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--p-space-300);
  padding: var(--p-space-150) 0;
  border-top: 1px solid var(--p-color-border-subdued, #e4e5e7);
}

.dw-list-row:hover { background: var(--p-color-bg-surface-hover, #f6f6f7); }

.dw-list-main { min-width: 0; }
.dw-list-main > * { margin: 0; }

.dw-row-status,
.dw-score-badge { flex-shrink: 0; }

.dw-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--p-space-200);
  padding-top: var(--p-space-200);
  border-top: 1px solid var(--p-color-border-subdued, #e4e5e7);
}

.dw-empty {
  padding: var(--p-space-400) var(--p-space-400);
  text-align: center;
}

.dw-readiness-card {
  display: flex;
  gap: var(--p-space-500);
  align-items: stretch;
  flex-wrap: wrap;
}

.dw-readiness-card__viz { flex: 1 1 320px; min-width: 0; }
.dw-readiness-card__copy {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-200);
  justify-content: center;
}

.dw-priority-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--p-space-200);
  align-items: center;
}

/* ---- Products list refinements ---- */
.products-index-table .Polaris-IndexTable__TableCell { vertical-align: middle; }
.products-index-table .Polaris-IndexTable__TableCell--first { min-width: 240px; }

/* Refined column headers — uppercase, tracked, subdued (Shopify admin 2026 look) */
.products-index-table .Polaris-IndexTable__TableHeading,
.billing-workbench .Polaris-IndexTable__TableHeading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p-color-text-secondary);
}

.products-handle {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Mono", monospace;
  font-size: 12px;
  color: var(--p-color-text-secondary);
}

.products-row-actions {
  display: flex;
  gap: var(--p-space-200);
  justify-content: flex-end;
  align-items: center;
}

.products-row-score { display: inline-block; min-width: 110px; }

/* ---- Billing refinements ---- */
.bw-section-head {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-100);
}

.bw-section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--p-space-300);
  flex-wrap: wrap;
}

.bw-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--p-space-300);
}

@media (max-width: 1100px) { .bw-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .bw-plan-grid { grid-template-columns: minmax(0, 1fr); } }

.bw-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-300);
  padding: var(--p-space-400);
  border-radius: var(--p-border-radius-300);
  border: 1px solid var(--p-color-border-subdued, #e4e5e7);
  background: var(--p-color-bg-surface, #fff);
}

.bw-plan-card--popular {
  border-color: var(--p-color-border-emphasis, #1a1a1a);
  box-shadow: var(--p-shadow-200, 0 1px 2px rgba(0,0,0,0.05));
}

.bw-plan-card--current {
  border-color: var(--p-color-border-success, #29845a);
  background: var(--p-color-bg-surface-success-subdued, #f1f8f5);
}

.bw-plan-head {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-200);
}

.bw-plan-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--p-space-200);
}

.bw-plan-price {
  display: flex;
  align-items: baseline;
  gap: var(--p-space-100);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.bw-plan-amount {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--p-color-text);
}

.bw-plan-capacity {
  font-size: 13px;
  color: var(--p-color-text-secondary);
}

.bw-plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-150);
  flex: 1;
}

.bw-plan-feature {
  display: flex;
  gap: var(--p-space-150);
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.4;
  color: var(--p-color-text);
}

.bw-plan-check {
  color: var(--p-color-text-success, #29845a);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.bw-plan-feature--more .bw-plan-check { color: var(--p-color-text-secondary); }

.bw-plan-select-link { text-decoration: none; display: block; }
.bw-plan-action { margin-top: auto; }

.bw-current-plan-note {
  text-align: center;
  padding: 8px 0;
  color: var(--p-color-text-success, #29845a);
}

/* ---- Settings field stack (replaces hand-rolled inline gap divs) ---- */
.settings-field-stack {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400);
}

.settings-field-stack--snug { gap: var(--p-space-300); }

/* ============================================================
   Embedded app layout shell (Task 2)
   Page padding: 20 top, 32 left/right, 40 bottom.
   Inter-card gap: handled by .page-stack (16px = --p-space-400).
   ============================================================ */
/* This layout reuses .Polaris-Frame as a plain wrapper (Shopify's <ui-nav-menu>
   provides chrome, not a Polaris nav). The gem's base rule is display:flex,
   which would lay the banner and the page out side-by-side as flex-row items.
   Force a vertical stack so banners sit above full-width page content.
   body > beats the gem's bare .Polaris-Frame on specificity. */
body > .Polaris-Frame {
  display: block;
}

/* Full-width lane. Views pass full_width: true so the gem applies
   .Polaris-Page--fullWidth (max-width: none); here we only set the page
   padding so the page edges line up with the welcome banner below. */
.Polaris-Frame .Polaris-Page {
  padding: var(--p-space-500) var(--p-space-800) var(--p-space-1000);
  width: 100%;
  box-sizing: border-box;
}

.Polaris-Page-Header { padding: var(--p-space-500) 0 var(--p-space-400); }
.Polaris-Header-Title { margin: 0; }
.Polaris-LegacyCard p { margin: 0; }

/* BFS mobile safe-area: keep content clear of the iOS bottom inset. */
body { padding-bottom: var(--shopify-safe-area-inset-bottom, 0); }

/* ============================================================
   Second polish pass — louder visual treatment
   ============================================================ */

/* ScoreViz tweaks: bigger weight, prominent target tick */
.score-viz__num {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.score-viz__bar {
  background: var(--p-color-bg-fill-transparent-secondary, #ebebeb);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.score-viz__target {
  top: -4px;
  bottom: -4px;
}

.score-viz__target-tick {
  width: 3px;
  background: var(--p-color-text);
  opacity: 0.85;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.score-viz--lg .score-viz__num,
.score-viz--md .score-viz__num {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

/* Status dot for badges (Polaris-like prefix dot) */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  vertical-align: middle;
}

/* AI tag: the "magic" treatment for AI-authored moments */
.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6535c9;
  background: linear-gradient(135deg, #f3edff 0%, #ece3ff 100%);
  border: 1px solid #d9c8ff;
  border-radius: 999px;
  padding: 3px 8px;
  line-height: 1;
}

.ai-tag svg { flex-shrink: 0; }

/* Card density modifiers (the snug/tight pattern) */
.polaris-card-snug .Polaris-LegacyCard__Section,
.card-snug .Polaris-LegacyCard__Section {
  padding: 14px 24px;
}

.polaris-card-tight .Polaris-LegacyCard__Section,
.card-tight .Polaris-LegacyCard__Section {
  padding: 10px 24px;
}

/* ---- Dashboard louder treatment ---- */
.dw-readiness-card {
  padding: var(--p-space-200) 0;
}

.dw-readiness-card__copy h3,
.dw-readiness-card__copy p {
  margin: 0;
}

/* KPI cell: subtle hover wash within the unified strip */
.kpi-cell {
  position: relative;
  transition: background 0.15s;
}

.kpi-cell:hover {
  background: var(--p-color-bg-surface-hover, #f6f6f7);
}

.kpi-cell__value {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.022em;
}

.kpi-cell__delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
}

.kpi-cell__delta--up {
  color: var(--p-color-text-success, #29845a);
  background: var(--p-color-bg-fill-success-secondary, #e7f5ec);
}

.kpi-cell__delta--down {
  color: var(--p-color-text-critical, #e02b2b);
  background: var(--p-color-bg-fill-critical-secondary, #fce9e8);
}

/* Hover lift on list rows in queue cards */
.dw-list-row {
  transition: background 0.12s, transform 0.12s;
  border-radius: var(--p-border-radius-150);
  margin: 0 calc(-1 * var(--p-space-200));
  padding-left: var(--p-space-200);
  padding-right: var(--p-space-200);
}

.dw-list-row:hover {
  background: var(--p-color-bg-surface-hover, #f6f6f7);
}

/* The queue card header gets an explicit eyebrow + dividing rule */
.dw-queue-head {
  padding-bottom: var(--p-space-200);
  border-bottom: 1px solid var(--p-color-border-subdued, #e4e5e7);
  margin-bottom: var(--p-space-200);
}

/* Sparkline placeholder for the readiness card (visual scaffold only) */
.dw-sparkline {
  width: 100%;
  max-width: 220px;
  height: 40px;
  display: block;
  color: var(--p-color-text);
  opacity: 0.6;
}

/* ---- Products list louder treatment ---- */
.products-index-table .Polaris-IndexTable__TableRow {
  transition: background 0.12s;
}

.products-index-table .Polaris-IndexTable__TableRow:hover {
  background: var(--p-color-bg-surface-hover, #f6f6f7);
}

.products-row-score { display: inline-block; min-width: 130px; }

.products-handle {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Mono", monospace;
  font-size: 11px;
  color: var(--p-color-text-secondary);
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

/* ---- Billing louder plan cards ---- */
.bw-plan-card {
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.bw-plan-card:hover {
  border-color: var(--p-color-border, #c9cccf);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.bw-plan-card--popular {
  border-width: 2px;
  border-color: var(--p-color-border-emphasis, #1a1a1a);
}

.bw-plan-card--popular::before {
  content: "Recommended";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--p-color-bg-fill-emphasis, #1a1a1a);
  padding: 4px 10px;
  border-radius: 999px;
}

.bw-plan-amount {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.028em;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .bw-plan-card:hover,
  .kpi-cell:hover,
  .dw-list-row:hover { transform: none; }
}

/* ============================================================
   Status legibility pass (Beaconed UX fixes)
   Two-column status on the products list, a calm credit meter,
   the "review & publish" moment and the "what changed" summary
   on product detail. Tokens use this app's --p-color-* form with
   literal fallbacks so they resolve in the embedded Polaris build.
   ============================================================ */

/* ---------- Status cell: workflow badge + optional sub-line ---------- */
.status-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.status-cell__sub {
  font-size: 11.5px;
  color: var(--p-color-text-secondary, #6d7175);
  line-height: 1.35;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.status-cell__sub .ai-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #5c2fd4; flex-shrink: 0;
}

/* the live "preparing" dot inside the info badge */
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  display: inline-block;
  margin-right: 4px;
  animation: livePulse 1.1s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ---------- Credit meter (calm, legible) ---------- */
.credit-meter {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--p-color-bg-surface, #fff);
  border: 1px solid var(--p-color-border, #e1e3e5);
  border-radius: var(--p-border-radius-300, 12px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02);
}
.credit-meter__ring {
  position: relative;
  width: 38px; height: 38px;
  flex-shrink: 0;
}
.credit-meter__ring svg { transform: rotate(-90deg); }
.credit-meter__ring-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: var(--p-color-text, #1a1a1a);
  font-variant-numeric: tabular-nums;
}
.credit-meter__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.credit-meter__top {
  display: flex; align-items: baseline; gap: 6px;
  white-space: nowrap;
}
.credit-meter__num {
  font-size: 14px; font-weight: 700; color: var(--p-color-text, #1a1a1a);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.credit-meter__den { font-size: 12px; color: var(--p-color-text-secondary, #6d7175); font-weight: 550; }
.credit-meter__label { font-size: 11.5px; color: var(--p-color-text-secondary, #6d7175); }
.credit-meter__bar {
  width: 168px; height: 5px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 999px; overflow: hidden;
  margin-top: 1px;
}
.credit-meter__bar-fill {
  height: 100%; border-radius: inherit;
  background: var(--p-color-bg-fill-emphasis, #1a1a1a);
}
.credit-meter__bar-fill--warning { background: #b98900; }
.credit-meter__bar-fill--critical { background: #e0301e; }
.credit-meter__reset {
  font-size: 11px; color: var(--p-color-text-secondary, #6d7175);
  border-left: 1px solid var(--p-color-border, #e1e3e5);
  padding-left: 14px;
  display: flex; flex-direction: column; gap: 2px;
  white-space: nowrap;
}
.credit-meter__reset strong { color: var(--p-color-text, #1a1a1a); font-weight: 600; font-size: 12px; }

/* ---- Compact credit pill: the persistent balance indicator that lives in
   every screen's title-bar action row. A small "remaining" ring sits beside
   the number + "credits" label, so any balance — 5 or 5,000 — stays legible
   (the number is never crammed inside the ring). ---- */
.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.credit-pill__ring {
  display: inline-flex;
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.credit-pill__ring svg { transform: rotate(-90deg); display: block; }
.credit-pill__dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--p-color-bg-fill-emphasis, #1a1a1a);
}
.credit-pill__value {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.credit-pill__num {
  font-size: 13px; font-weight: 700;
  color: var(--p-color-text, #1a1a1a);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.credit-pill__label {
  font-size: 12px; font-weight: 550;
  color: var(--p-color-text-secondary, #6d7175);
}

/* ---------- "What Beaconed changed" mini summary (detail page) ---------- */
.changed-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.changed-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 550;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--p-color-bg-surface-success-subdued, #f1f8f5);
  color: var(--p-color-text-success, #29845a);
}
.changed-chip svg { width: 10px; height: 10px; flex-shrink: 0; }

/* ---------- Published banner (detail) ---------- */
.published-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--p-border-radius-200, 8px);
  background: var(--p-color-bg-surface-success-subdued, #f1f8f5);
  color: var(--p-color-text-success, #29845a);
}
.published-banner__icon {
  width: 24px; height: 24px; border-radius: 50%;
  background: #29845a; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.published-banner__icon svg { width: 14px; height: 14px; }
.published-banner__main { flex: 1; min-width: 0; }
.published-banner__title { font-size: 13px; font-weight: 650; }
.published-banner__sub { font-size: 12px; opacity: 0.85; margin-top: 1px; }

/* ---------- Side-panel stack (detail) ---------- */
.pw-side-stack {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-400, 16px);
}

/* "What happens when you publish" explainer */
.publish-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--p-space-300, 12px);
}
.publish-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.publish-step__num {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--p-color-bg-fill-emphasis, #1a1a1a);
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.publish-step__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.publish-step__title { font-size: 12.5px; font-weight: 600; color: var(--p-color-text, #1a1a1a); }
.publish-step__desc { font-size: 11.5px; line-height: 1.4; color: var(--p-color-text-secondary, #6d7175); }
