:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* UI-02: reserve the scrollbar's width up front, so the page and the tab bar do not shift sideways when the
   content grows tall enough to need a scrollbar. */
html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: #f1f1f1;
  color: #1a1a1a;
}

#ops-notice:empty { display: none; }
#ops-notice { margin: 0 0 12px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  padding: 14px 16px;
}

.stat span {
  display: block;
  color: #616161;
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status {
  color: #616161;
  min-height: 1.4em;
}

.plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.plan {
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan.current {
  border-color: #1a1a1a;
}

.plan .price {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.plan .price span {
  font-size: 14px;
  color: #616161;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.file input,
input.code {
  font: inherit;
}

label.check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}

input.code {
  width: 9.5rem;
  padding: 6px 8px;
  border: 1px solid #c9cccf;
  border-radius: 8px;
  background: #fff;
}

.install {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 16px;
}

.install main {
  max-width: 38rem;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.install h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: #616161;
  margin: 0 0 8px;
}

.warning {
  background: #fff5ea;
  border-radius: 10px;
  padding: 12px 14px;
}

.reason {
  color: #8a6116;
  font-size: 13px;
}

details.debug {
  margin-top: 6px;
  font-size: 12px;
  color: #616161;
}

details.debug summary {
  cursor: pointer;
}

details.debug pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 8rem;
  overflow: auto;
  background: #f6f6f6;
  padding: 8px;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .stats, .plans { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .stats, .plans { grid-template-columns: 1fr; }
  .stat strong, .plan .price { font-size: 24px; }
}

/* Readable if Polaris has not upgraded the custom elements yet.
   Scoped to :not(:defined) so these fallbacks never override Polaris' own
   layout once the components load (a plain display:block on s-table-row/cell
   broke the review table's grid). */
:is(s-page, s-section, s-banner, s-box, s-stack, s-paragraph, s-table, s-table-body, s-table-row, s-table-cell, s-table-header-row):not(:defined) {
  display: block;
}

:is(s-button, s-badge, s-link, s-text, s-checkbox):not(:defined) {
  display: inline-block;
}

s-button:not(:defined) {
  padding: 6px 12px;
  border: 1px solid #c9cccf;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}

s-button[variant="primary"]:not(:defined) {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

s-table-cell:not(:defined) {
  padding: 8px 0;
}

/* Review table: let long reasons wrap so HS / HTS / Origin / Confidence stay in view,
   and keep title, variant and SKU visually separate. */
s-table-cell .reason,
s-table-cell s-paragraph {
  white-space: normal;
  max-width: 19rem;
}

/* UI-01: the Product column is a fixed-width wrapping block instead of one long nowrap line. */
.product-cell {
  white-space: normal;
  width: 17rem;
  max-width: 17rem;
  overflow-wrap: anywhere;
}

.product-cell > s-text {
  display: inline;
}

.product-cell .reason,
.product-cell s-paragraph,
.product-cell .note {
  display: block;
  max-width: 100%;
}

.product-cell > s-text:not(:last-of-type)::after,
s-table-cell > s-text:not(:last-of-type)::after {
  content: " \00B7 ";
  color: #8a8a8a;
}

s-table-cell input.code {
  width: 6.75rem;
  box-sizing: border-box;
}

s-table-cell input.code[aria-label="Origin"] {
  width: 3.25rem;
}

/* Row checkboxes keep their "Select" label for screen readers only. */
s-table-cell label.check span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 12px;
}

.note {
  color: #616161;
  font-size: 12px;
  line-height: 1.35;
  margin: 4px 0 0;
  white-space: normal;
  max-width: 560px;
}

.last-write {
  background: #f1f8f5;
  border: 1px solid #b4e1cc;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
