/* Match the existing --success and --success-dark tokens in css/styles.css. */
:root { color-scheme: light; --success: #00b67a; --success-dark: #006b47; --ink: #191919; --muted: #64645f; --line: #e4e3dc; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 6px; font: 14px/1.45 system-ui, sans-serif; color: var(--ink); background: transparent; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--success-dark); outline-offset: 3px; }
.widget { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 12px; }
.widget-name { display: block; min-width: 0; }
.widget-name strong { display: block; font-size: 19px; overflow-wrap: anywhere; }
.widget-name small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 11px; }
.widget-summary { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.stars { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; line-height: 1; }
.star { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; background: #e6e7e8; color: #fff; line-height: 1; }
.star svg { display: block; width: 20px; height: 20px; fill: currentColor; }
.star.filled { background: var(--success); }
.widget-reviews { min-height: 120px; border-top: 1px solid var(--line); padding-top: 12px; }
.review-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.review-meta strong { overflow-wrap: anywhere; }
.review-meta .muted { flex-shrink: 0; font-size: 11px; }
.muted { color: var(--muted); }
.review-rating { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0; font-size: 12px; }
.review-excerpt { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.widget-controls { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.widget-controls span { margin-right: auto; }
.widget-controls button { width: 30px; height: 28px; border: 0; border-radius: 6px; background: var(--success); color: #fff; cursor: pointer; }
.widget-controls button:hover { background: var(--success-dark); color: #fff; }
.widget-cta { display: block; text-align: center; background: var(--success); color: #fff; border-radius: 8px; padding: 9px 12px; font-weight: 650; font-size: 13px; transition: background 150ms ease, box-shadow 150ms ease; }
.widget-cta:hover { background: var(--success-dark); color: #fff; text-decoration: none; box-shadow: 0 4px 12px rgba(0, 107, 71, 0.2); }
.widget-brand { display: flex; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-size: 11px; }
.widget-brand img { display: block; flex-shrink: 0; width: 12px; height: 16px; object-fit: contain; }
.widget-unavailable { margin: 6px 0; }
@media (max-width: 340px) { .widget { padding: 12px; gap: 10px; } .review-meta { flex-direction: column; gap: 2px; } }
/* A compact card fits sidebars/footers; the wide layout uses its iframe width. */
.widget { --review-columns: 1; }
.widget-heading { display: contents; }
.widget-name { order: 0; }
.widget-summary { order: 1; }
.widget-content { order: 2; min-width: 0; }
.widget-cta { order: 3; }
.widget-brand { order: 4; }
.widget-controls { margin-top: 10px; }
.widget-review { min-width: 0; }
@media (min-width: 760px) {
  .widget--wide { --review-columns: 2; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px 24px; padding: 24px; }
  .widget--wide .widget-heading { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .widget--wide .widget-name strong { font-size: 22px; }
  .widget--wide .widget-summary { flex-direction: column; align-items: flex-start; }
  .widget--wide .widget-cta { margin-top: auto; }
  .widget--wide .widget-reviews { display: grid; grid-template-columns: repeat(var(--visible-columns, var(--review-columns)), minmax(0, 1fr)); border: 0; padding: 0; gap: 12px; }
  .widget--wide .widget-review { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
  .widget--wide .review-meta { flex-direction: column; gap: 2px; }
  .widget--wide .review-excerpt { -webkit-line-clamp: 5; }
  .widget--wide .widget-brand { grid-column: 1 / -1; justify-content: flex-end; }
  .widget--wide.widget--rating { display: flex; }
  .widget--wide.widget--rating .widget-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 24px; }
  .widget--wide.widget--rating .widget-cta { margin-top: 0; }
  .widget--wide .widget-unavailable { grid-column: 1 / -1; }
}
@media (min-width: 1100px) { .widget--wide { --review-columns: 3; } }

@media (prefers-reduced-motion: reduce) { .widget-cta { transition: none; } }
