/* Keep the bubble and both targets together when the marks wrap on a narrow card. */
.thumbs-group, .thumbs { display: inline-flex; flex: none; align-items: center; }
.thumbs-group { min-width: 0; }
.thumbs-group .comments-slot { flex: none; }
.thumbs { gap: 2px; flex-shrink: 1; min-width: 90px; }
.glass-site .g-bill-row:has(.thumbs-group) { container: thumbs-card / inline-size; }
/* A bill's page (the editor, Nov 24, 2026): the thumbs sit under the status in the heading,
 * and a failure line drops to its own line below them. The space above belongs to the buttons,
 * so hidden thumbs leave no gap. An editor label already ends with a 12px margin. */
.glass-site .gb-thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.glass-site .gb-thumbs .thumbs { margin-top: 12px; }
.glass-site .gb-heading:has(.g-chip-editor) .gb-thumbs .thumbs { margin-top: 0; }
.thumbs[hidden], [data-thumbs-unavailable] .thumbs { display: none; }
/* Giant lists measure parked rows before a deferred script or observer can reveal them. */
@media (scripting: enabled) {
  html:not([data-thumbs-unavailable]) .thumbs[hidden] { display: inline-flex !important; visibility: hidden; pointer-events: none; }
}
.glass-site .thumbs-button {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  width: 3.75rem; min-width: 44px; height: 44px; margin: 0; padding: 0 3px;
  color: var(--comments-outline); background: transparent; border: 1px solid transparent; border-radius: 999px;
  font: 400 12px/1.2 var(--g-body, system-ui, sans-serif); font-variant-numeric: tabular-nums;
  white-space: nowrap; cursor: pointer;
}
/* Chromium before version 120 reads only the prefixed mask, so declare both, as comments.css does. */
.thumbs-button::before {
  content: ""; width: 17px; height: 17px; flex: none; background: currentColor;
  --thumbs-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10H3v11h4zM7 11l5-7c.8-1.4 3-.8 3 1v4h4.6a1.9 1.9 0 0 1 1.9 2.3l-1.7 7.8A2.4 2.4 0 0 1 17.5 21H11l-4-1.5z'/%3E%3C/svg%3E");
  -webkit-mask: var(--thumbs-icon) center/contain no-repeat; mask: var(--thumbs-icon) center/contain no-repeat;
}
.thumbs-button[data-thumbs-value="-1"]::before { transform: rotate(180deg); }
.glass-site .thumbs-button[aria-pressed="true"] { background: var(--comments-fill); color: var(--comments-on-fill); border-color: var(--comments-outline); }
.glass-site .thumbs-group .thumbs-button:focus-visible { outline: 3px solid var(--comments-outline); outline-offset: 2px; }
.thumbs-status { flex-basis: 100%; color: var(--g-text); font-size: 13px; }
/* An empty status stays in the accessibility tree, so a screen reader announces the failure line
 * when it appears. It takes no space and no gap until then, so the card keeps its height. */
.thumbs-status:empty {
  position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
/* Some cards keep the marks in the text column beside a portrait. On a narrow card,
 * start a fresh line for reactions and extend just that line across the portrait column.
 * 100% is the marks width, and 100cqw is the full content width of this particular card. */
@container thumbs-card (max-width: 19rem) {
  html:not([data-thumbs-unavailable]) .thumbs-group:has(.thumbs:not([hidden])),
  .thumbs-status {
    flex-basis: 100cqw; margin-inline-start: calc(100% - 100cqw);
  }
  @media (scripting: enabled) {
    html:not([data-thumbs-unavailable]) .thumbs-group {
      flex-basis: 100cqw; margin-inline-start: calc(100% - 100cqw);
    }
  }
}
@container thumbs-card (max-width: 13.5rem) {
  .glass-site .thumbs-button { padding: 0; gap: 1px; }
}
/* The full comment slot and two 44px thumbs need 182px. Below that, as on a lawmaker card
 * under 320px, reserve room for a three-digit comment count only. The group then fits a card
 * whose inner width is about 150px. A longer count widens the slot and moves the thumbs over.
 * It never covers them. */
@container thumbs-card (max-width: 11.5rem) {
  .thumbs-group .comments-slot { width: 3.5rem; min-width: max-content; }
}
/* Forced colors replace backgrounds, which would erase both icons and the pressed state.
 * Draw them in the system's own colors instead. */
@media (forced-colors: active) {
  .thumbs-button::before { forced-color-adjust: none; background: ButtonText; }
  .glass-site .thumbs-button[aria-pressed="true"] {
    forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight;
  }
  .glass-site .thumbs-button[aria-pressed="true"]::before { background: HighlightText; }
}
