/* The shared card row (src/pages/card.ts): the same classes and look as an
   /app opportunity row in portal.css, for the AI shopping report's fix rows. A
   page that does not set the /app palette gets it here. */

:where(.ais) {
  --pt-panel: #ffffff;
  --pt-ink: #1e1c16;
  --pt-muted: #6a665b;
  --pt-line: #e4e1d8;
  --pt-dark: #1e1c16;
  --pt-broken: #b3261e;
  --pt-broken-soft: #fbe9e7;
  --pt-improve: #c2690f;
  --pt-improve-soft: #fbeedc;
  --pt-look: #a68a00;
  --pt-good: #1f7a55;
  --pt-good-soft: #e2f1e9;
  --pt-mustard: #d9a520;
}

.pt-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pt-list[hidden] { display: none; }
.pt-item { background: var(--pt-panel); border: 1px solid var(--pt-line); border-left: 5px solid var(--pt-line); border-radius: 14px; overflow: clip; }
.pt-item[hidden] { display: none; }
.pt-pri-broken { border-left-color: var(--pt-broken); }
.pt-pri-improve { border-left-color: var(--pt-improve); }
.pt-pri-look { border-left-color: var(--pt-look); }
.pt-pri-good { border-left-color: var(--pt-good); }
.pt-toggle { width: 100%; display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pt-toggle:focus-visible { outline: 3px solid var(--pt-mustard); outline-offset: -3px; }
.pt-sev { flex: none; width: 12px; height: 12px; margin-top: 7px; border-radius: 50%; background: var(--pt-line); }
.pt-pri-broken .pt-sev { background: var(--pt-broken); }
.pt-pri-improve .pt-sev { background: var(--pt-improve); }
.pt-pri-look .pt-sev { background: var(--pt-look); }
.pt-pri-good .pt-sev { background: var(--pt-good); }
.pt-summary { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.pt-head { flex: 1 1 260px; min-width: 0; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.pt-head strong { font-weight: 700; }
.pt-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; color: var(--pt-muted); }
.pt-pri { font-weight: 700; }
.pt-pri-broken .pt-pri { color: var(--pt-broken); }
.pt-pri-improve .pt-pri { color: var(--pt-improve); }
.pt-pri-look .pt-pri { color: var(--pt-look); }
.pt-pri-good .pt-pri { color: var(--pt-good); }
.pt-chev { width: 10px; height: 10px; margin-top: 6px; border-right: 2px solid var(--pt-muted); border-bottom: 2px solid var(--pt-muted); transform: rotate(45deg); transition: transform var(--dur, 200ms) var(--ease-out, ease); flex: none; }
.pt-item[data-open] .pt-chev { transform: rotate(-135deg); }

.pt-detail { padding: 0 18px 18px 44px; display: flex; flex-direction: column; gap: 16px; }
.pt-detail[hidden] { display: none; }
.pt-ab { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pt-ab > div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--pt-line); min-width: 0; }
.pt-ab span { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pt-muted); margin-bottom: 4px; }
.pt-ab p { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.pt-now { background: #fbfaf7; }
.pt-after { background: var(--pt-good-soft); border-color: #c5e3d3 !important; }

.pt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--pt-dark); background: var(--pt-dark); color: #fff; font: 600 15px/1.2 var(--font-sans); text-decoration: none; cursor: pointer; }
.pt-btn:hover { background: #000; }
.pt-btn:disabled { opacity: 0.6; cursor: progress; }
.pt-btn-alt { background: var(--pt-panel); color: var(--pt-ink); border-color: var(--pt-line); }
.pt-btn-alt:hover { background: #f1efe9; }
.pt-btn:focus-visible, .pt-thumb:focus-visible { outline: 3px solid var(--pt-mustard); outline-offset: 2px; }

.pt-actions { display: none; }
/* The open card's actions stick to the bottom of the screen while the card scrolls past, and park at its end. */
.pt-item[data-open] .pt-actions { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px 12px 44px; background: var(--pt-panel); border-top: 1px solid var(--pt-line); box-shadow: 0 -8px 18px rgba(30, 28, 22, 0.06); }
.pt-actions .ais-fixstate { margin: 0; }
.pt-thumbs { margin-left: auto; display: inline-flex; gap: 4px; }
.pt-thumb { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--pt-line); background: #fff; font-size: 17px; cursor: pointer; }
.pt-thumb[aria-pressed="true"] { background: var(--pt-dark); border-color: var(--pt-dark); }
.pt-state { margin: 0; font-size: 14px; color: var(--pt-muted); }
.pt-state:empty { display: none; }
.pt-actions .pt-state { flex-basis: 100%; order: 9; }

@media (max-width: 560px) {
  .pt-detail { padding: 0 14px 16px; }
  .pt-toggle { padding: 14px; }
  .pt-ab { grid-template-columns: 1fr; }
  .pt-item[data-open] .pt-actions { padding: 10px 14px; gap: 6px; }
  .pt-actions .pt-btn { min-height: 40px; padding: 8px 12px; font-size: 14px; }
  .pt-thumb { width: 36px; height: 36px; font-size: 16px; }
}
