/*
 * 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.
 */

/* 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-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--p-space-400);
}

.product-workbench .pw-score-label,
.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;
}

.product-workbench .pw-score-line {
  display: flex;
  align-items: center;
  gap: var(--p-space-200);
  margin-top: var(--p-space-100);
}

.product-workbench .pw-score-value {
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--p-color-text);
}

.product-workbench .pw-score-percent {
  font-size: 18px;
  font-weight: 600;
  color: var(--p-color-text-secondary);
  vertical-align: middle;
}

.product-workbench .pw-outcome-copy {
  max-width: 460px;
  text-align: right;
  min-width: 0;
}

.product-workbench .pw-outcome-copy .Polaris-Text--headingSm,
.product-workbench .pw-outcome-copy .Polaris-Text--bodySm {
  margin: 0;
}

.product-workbench .pw-summary-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--p-space-100);
  margin-top: var(--p-space-100);
  min-height: 1.75rem;
}

.product-workbench .pw-summary-metrics--single {
  margin-top: var(--p-space-050);
}

.product-workbench .pw-summary-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--p-color-bg-surface-secondary, #f6f6f7);
}

.product-workbench .pw-summary-metric-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--p-color-text);
}

.product-workbench .pw-summary-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--p-color-text-secondary);
  font-weight: 600;
}

.product-workbench .pw-overall-bar-track {
  margin: var(--p-space-300) calc(-1 * var(--p-space-400)) calc(-1 * var(--p-space-400));
  height: 4px;
  background: var(--p-color-bg-fill-transparent-secondary, #e4e5e7);
  border-radius: 999px;
  overflow: hidden;
}

.product-workbench .pw-overall-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.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: repeat(2, minmax(0, 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-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-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);
}

.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-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;
  }
}

/* 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;
}

@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;
  }
}
