/* Catalog Check's own pieces, where Polaris has no component: the masthead,
   the scan strip, the severity ledger, the worklist, inspection cards and
   the change preview. Graphite ink on warm paper, ochre for the app's own
   accent, and a three-step severity scale. */
:root {
  --cc-ink: #1f2124;
  --cc-ink-soft: #4d5157;
  --cc-muted: #7b7f85;
  --cc-paper: #f8f7f3;
  --cc-sand: #efede6;
  --cc-line: #e2dfd6;
  --cc-ochre: #9a6510;
  --cc-ochre-soft: #f5ead2;
  --cc-high: #a2331d;
  --cc-high-soft: #f8e1da;
  --cc-medium: #95600b;
  --cc-medium-soft: #f6ebd3;
  --cc-low: #5f646b;
  --cc-low-soft: #ebebe8;
  --cc-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --cc-sans: Inter, -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, sans-serif;
  --cc-mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

.cc-figure { font-family: var(--cc-serif); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.01em; }
.cc-kicker { margin: 0; font: 600 11px/1.4 var(--cc-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--cc-ochre); }
.cc-link { color: var(--cc-ochre); text-decoration: none; font-weight: 550; }
.cc-link:hover { color: #6f4808; text-decoration: underline; }
:where(.cc-link, .cc-ledger a, .cc-work a, .cc-row, .cc-pills button):focus-visible { outline: 2px solid var(--cc-ochre); outline-offset: 2px; border-radius: 4px; }

/* Masthead: when the catalog was last checked and one sentence about it. */
.cc-masthead {
  position: relative; overflow: hidden; padding: 26px 28px 24px; border-radius: 14px; color: var(--cc-ink);
  background: var(--cc-paper); border: 1px solid var(--cc-line);
}
/* A faint ruled grid, like a spec sheet. */
.cc-masthead::after {
  content: ''; position: absolute; inset: 0 0 0 55%; pointer-events: none; opacity: .55;
  background-image: linear-gradient(var(--cc-line) 1px, transparent 1px), linear-gradient(90deg, var(--cc-line) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.cc-masthead > * { position: relative; z-index: 1; }
.cc-display { margin: 8px 0 0; max-inline-size: 32ch; font: 500 29px/1.2 var(--cc-serif); letter-spacing: -0.015em; }
.cc-masthead-note { margin: 10px 0 0; max-inline-size: 60ch; color: var(--cc-ink-soft); }
@media (max-width: 600px) { .cc-display { font-size: 23px; } .cc-masthead { padding: 20px; } .cc-masthead::after { display: none; } }

/* Scan strip: freshness on the left, the action on the right. */
.cc-scan { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.cc-scan-dot { inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--cc-muted); }
.cc-scan[data-state='fresh'] .cc-scan-dot { background: var(--cc-ink); }
.cc-scan[data-state='stale'] .cc-scan-dot { background: var(--cc-medium); }
.cc-scan[data-state='failed'] .cc-scan-dot { background: var(--cc-high); }
.cc-scan[data-state='running'] .cc-scan-dot { background: var(--cc-ochre); box-shadow: 0 0 0 4px var(--cc-ochre-soft); animation: cc-pulse 1.4s ease-in-out infinite; }
.cc-scan-bar { grid-column: 1 / -1; block-size: 4px; border-radius: 999px; overflow: hidden; background: var(--cc-sand); }
.cc-scan-bar > div { block-size: 100%; inline-size: 35%; border-radius: inherit; background: var(--cc-ochre); animation: cc-sweep 1.6s ease-in-out infinite; }
@keyframes cc-pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
@keyframes cc-sweep { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (max-width: 560px) { .cc-scan { grid-template-columns: auto 1fr; } .cc-scan > s-button { grid-column: 1 / -1; } }

/* Severity ledger: three columns, products affected in each. */
.cc-ledger { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 0; list-style: none; }
.cc-ledger li + li { border-inline-start: 1px solid var(--cc-line); }
.cc-ledger a { display: grid; gap: 4px; padding: 18px 20px 20px; block-size: 100%; box-sizing: border-box; color: inherit; text-decoration: none; transition: background-color .15s ease; }
.cc-ledger a:hover { background: var(--cc-paper); }
.cc-ledger .cc-figure { font-size: 40px; line-height: 1.05; color: var(--cc-ink); }
.cc-ledger [data-level='high'] .cc-figure { color: var(--cc-high); }
.cc-ledger [data-level='medium'] .cc-figure { color: var(--cc-medium); }
.cc-ledger [data-empty] .cc-figure { color: #cfcbc1; }
.cc-ledger-hint { font-size: 13px; color: var(--cc-muted); }
@media (max-width: 640px) {
  .cc-ledger { grid-template-columns: 1fr; }
  .cc-ledger li + li { border-inline-start: 0; border-block-start: 1px solid var(--cc-line); }
}

/* Severity marker: filled, half-filled or outlined square. */
.cc-severity { display: inline-flex; align-items: center; gap: 7px; font: 600 12px/1.4 var(--cc-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--cc-ink-soft); white-space: nowrap; }
.cc-severity > span { inline-size: 9px; block-size: 9px; border-radius: 2px; box-sizing: border-box; }
.cc-severity[data-level='high'] > span { background: var(--cc-high); }
.cc-severity[data-level='medium'] > span { border: 1.5px solid var(--cc-medium); background: linear-gradient(135deg, var(--cc-medium) 50%, transparent 50%); }
.cc-severity[data-level='low'] > span { border: 1.5px solid var(--cc-low); }
.cc-severity[data-quiet] { text-transform: none; letter-spacing: 0; font-weight: 550; }

/* Worklist: each rule a row with a bar for how much of the catalog it touches. */
.cc-work { margin: 0; padding: 0; list-style: none; }
.cc-work li + li { border-block-start: 1px solid var(--cc-line); }
.cc-work a { display: grid; grid-template-columns: 96px minmax(0, 1.3fr) minmax(120px, 1fr) 110px; gap: 16px; align-items: center; padding: 12px 4px; color: inherit; text-decoration: none; }
.cc-work a:hover .cc-work-label { color: var(--cc-ochre); }
.cc-work-label { font-weight: 600; color: var(--cc-ink); }
.cc-work-bar { block-size: 8px; border-radius: 999px; background: var(--cc-sand); overflow: hidden; }
.cc-work-bar > span { display: block; block-size: 100%; border-radius: inherit; background: var(--cc-ink); }
.cc-work [data-level='high'] .cc-work-bar > span { background: var(--cc-high); }
.cc-work [data-level='medium'] .cc-work-bar > span { background: var(--cc-medium); }
.cc-work [data-level='low'] .cc-work-bar > span { background: #a7a9ab; }
.cc-work-count { text-align: end; font-variant-numeric: tabular-nums; color: var(--cc-ink-soft); font-size: 13px; }
@media (max-width: 640px) {
  .cc-work a { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .cc-work-bar { grid-column: 1 / -1; grid-row: 3; }
}

/* Issue tags. */
.cc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font: 550 12px/1.6 var(--cc-sans); white-space: nowrap; background: var(--cc-low-soft); color: #3f4247; }
.cc-tag[data-level='high'] { background: var(--cc-high-soft); color: #7d2512; }
.cc-tag[data-level='medium'] { background: var(--cc-medium-soft); color: #6c4507; }
.cc-tag-more { color: var(--cc-muted); font-size: 12px; align-self: center; }

/* Filter pills. */
.cc-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-pills button {
  display: inline-flex; align-items: center; gap: 7px; font: 550 13px/1 var(--cc-sans); padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--cc-line); background: #fff; color: var(--cc-ink-soft);
}
.cc-pills button:hover { border-color: #cbc6ba; color: var(--cc-ink); }
.cc-pills button[aria-pressed='true'] { background: var(--cc-ink); border-color: var(--cc-ink); color: var(--cc-paper); }

/* Product rows on Issues. */
.cc-rows { border-block-start: 1px solid var(--cc-line); }
.cc-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 120px; gap: 16px; align-items: center;
  padding: 12px 16px; border-block-end: 1px solid var(--cc-line); color: inherit; text-decoration: none; font-size: 13px;
}
.cc-row:last-child { border-block-end: 0; }
a.cc-row { transition: background-color .12s ease; }
a.cc-row:hover { background: var(--cc-paper); }
a.cc-row:hover .cc-row-title { color: var(--cc-ochre); }
.cc-row-head { padding-block: 10px; background: var(--cc-paper); font-weight: 600; color: var(--cc-ink-soft); }
.cc-row-who { display: grid; gap: 2px; min-inline-size: 0; }
.cc-row-who > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-row-title { font-weight: 600; color: var(--cc-ink); }
.cc-row-who span { color: var(--cc-muted); }
.cc-row > :last-child { text-align: end; color: var(--cc-muted); }
@media (max-width: 720px) {
  .cc-row { grid-template-columns: 1fr; gap: 8px; }
  .cc-row > :last-child { text-align: start; }
  .cc-row-head { display: none; }
}

/* Inspection cards on a product: the severity runs down the left edge. */
.cc-cards { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.cc-card { border: 1px solid var(--cc-line); border-inline-start: 4px solid #b8bbbe; border-radius: 10px; background: #fff; }
.cc-card[data-level='high'] { border-inline-start-color: var(--cc-high); }
.cc-card[data-level='medium'] { border-inline-start-color: var(--cc-medium); }
.cc-card[data-state='ignored'], .cc-card[data-state='resolved'] { border-inline-start-color: var(--cc-line); background: var(--cc-paper); }
.cc-card-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; }
.cc-card-title { margin: 0 0 4px; font: 600 15px/1.35 var(--cc-sans); color: var(--cc-ink); }
.cc-card-evidence { margin: 0; color: var(--cc-ink-soft); line-height: 1.5; max-inline-size: 70ch; }
.cc-card-meta { margin: 6px 0 0; font-size: 12px; color: var(--cc-muted); }
.cc-card-fix { padding: 16px; border-block-start: 1px dashed var(--cc-line); background: var(--cc-paper); border-end-start-radius: 10px; border-end-end-radius: 10px; }

/* Product facts beside the findings. */
.cc-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.cc-facts dt { color: var(--cc-muted); }
.cc-facts dd { margin: 0; color: var(--cc-ink); min-inline-size: 0; overflow-wrap: anywhere; }

/* Change preview: what is added, or the old value struck through. */
.cc-diff { display: grid; gap: 8px; padding: 14px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--cc-line); font-size: 13px; line-height: 1.55; }
.cc-diff-label { font: 600 11px/1.4 var(--cc-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--cc-muted); }
.cc-diff del { color: var(--cc-muted); text-decoration-color: var(--cc-high); background: var(--cc-high-soft); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }
.cc-diff ins { text-decoration: none; color: var(--cc-ink); background: var(--cc-ochre-soft); box-shadow: inset 3px 0 0 var(--cc-ochre); padding: 6px 10px; border-radius: 4px; white-space: pre-wrap; overflow-wrap: anywhere; display: block; }
.cc-diff-context { color: var(--cc-muted); white-space: pre-wrap; max-block-size: 7.5em; overflow: hidden; mask-image: linear-gradient(transparent, #000 45%); }

.cc-mono { font-family: var(--cc-mono); font-size: 12px; }
.cc-clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-inline-size: 42ch; }

/* Templates on Rules. */
.cc-templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cc-template { padding: 16px; border: 1px solid var(--cc-line); border-radius: 12px; background: var(--cc-paper); display: grid; gap: 6px; }
.cc-template h3 { margin: 0; font: 500 19px/1.25 var(--cc-serif); color: var(--cc-ink); }
.cc-template p { margin: 0; color: var(--cc-ink-soft); font-size: 13px; }
.cc-template .cc-figure { font-size: 24px; color: var(--cc-ochre); }

.cc-step { display: grid; place-items: center; inline-size: 28px; block-size: 28px; border-radius: 50%; font: 600 13px var(--cc-sans); border: 1.5px solid var(--cc-ink); color: var(--cc-ink); }
.cc-step[data-done] { background: var(--cc-ink); color: var(--cc-paper); }

.cc-price { margin: 0; font-size: 34px; line-height: 1; }
.cc-tick { inline-size: 16px; block-size: 16px; color: var(--cc-ochre); margin-block-start: 2px; }

/* Empty state: three product cards, squared up. */
.cc-empty { position: relative; inline-size: 104px; block-size: 72px; }
.cc-empty span { position: absolute; inset-block: 0; inline-size: 44px; border-radius: 8px; background: #fff; border: 1px solid var(--cc-line); box-shadow: 0 6px 16px -10px rgba(31, 33, 36, .35); }
.cc-empty span::before { content: ''; position: absolute; inset: 6px 6px auto; block-size: 28px; border-radius: 4px; background: var(--cc-sand); }
.cc-empty span::after { content: ''; position: absolute; inset: auto 6px 10px; block-size: 6px; border-radius: 3px; background: var(--cc-line); }
.cc-empty span:nth-child(1) { inset-inline-start: 0; transform: translateY(6px); }
.cc-empty span:nth-child(2) { inset-inline-start: 30px; z-index: 1; }
.cc-empty span:nth-child(3) { inset-inline-start: 60px; transform: translateY(6px); }
.cc-empty span:nth-child(2)::after { background: var(--cc-ochre); inline-size: 18px; }

.cc-progress { block-size: 6px; border-radius: 999px; background: var(--cc-sand); overflow: hidden; }
.cc-progress > div { block-size: 100%; border-radius: inherit; background: var(--cc-ink); transition: inline-size .4s ease; }

@media (prefers-reduced-motion: reduce) {
  .cc-ledger a, .cc-progress > div, a.cc-row { transition: none; }
  .cc-scan-bar > div, .cc-scan[data-state='running'] .cc-scan-dot { animation: none; }
  .cc-scan-bar > div { inline-size: 100%; opacity: .5; }
}
