/* Removable interaction layer. */
:where(:is(button, a[href], input, select, textarea, summary, [tabindex], [role="button"]):focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Buttons that already press in styles.css (746, 772, 1669, 1762, 4783,
   5216, 5220, 5761, 6082) keep their own rule. The active-only transition
   replaces resting transition lists only while pressed (same pattern as
   styles.css:4783). */
body :is(button, [role="button"], summary, .library-card-head, .library-deck-tile):active:not(:disabled):not(.primary-button, .secondary-button, .tab-button, .icon-button, .grade-btn, .segment-btn, .generate-tab-button, .file-card-next, .generation-result-chip, .ghost-button-sm, .plan-button, .generation-more-menu button) {
  scale: .97;
  transition: scale 100ms var(--ease-out);
}
body :is(.library-card-head, .library-deck-tile, .library-card-item):active:not(:disabled):not(.primary-button, .secondary-button, .tab-button, .icon-button, .grade-btn, .segment-btn, .generate-tab-button, .file-card-next, .generation-result-chip, .ghost-button-sm, .plan-button) { scale: .99; }
body .theme-card:active:not(:disabled) { scale: .98; }
:is(.tag-pill, .review-tag-pill, .tag-pill-more, .checkbox-field, .figures-checkbox, .terms-modal-check, .tag-picker-label, .tag-action-check, .library-detail-title):active {
  scale: .97;
  transition: scale 100ms var(--ease-out);
}
/* The review card flips on click, so it gets no press scale: the reveal is instant. */
.drop-zone:active { scale: .99; transition: scale 100ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  /* overrides styles.css:1321,5131 for hovered pills and result chips. */
  :is(.pill-button, .tag-pill, .review-tag-pill, .tag-pill-more, .generation-result-chip):hover:not(:disabled) {
    translate: 0 -1px;
    transition: translate 140ms var(--ease-out);
  }
  a[href]:hover { opacity: .8; transition: opacity 140ms var(--ease-out); }
}

/* The indicator owns only the selected segment's paint. */
.segment-group.rx-has-indicator { position: relative; isolation: isolate; }
.rx-segment-indicator {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: var(--shadow-accent);
  transform-origin: left center;
  pointer-events: none;
  z-index: -1;
}
/* overrides styles.css:1325,1331,1339,1350,1360 */
.rx-has-indicator .segment-btn.active { background: transparent; box-shadow: none; }
/* Inactive buttons painted an opaque surface over the sliding pill, hiding most of the slide (run 2, Oct 22). */
.rx-has-indicator .segment-btn:not(.active) { background: transparent; }
.rx-has-indicator .segment-btn.fx-bounce { animation: none; }
.rx-has-indicator :is(.segment-btn.fx-shimmer, .segment-btn.fx-pulse)::after,
.rx-has-indicator .segment-spark { display: none; }

.grade-btn { position: relative; isolation: isolate; }
.grade-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--rx-grade);
  opacity: 0;
  pointer-events: none;
}
.rx-grade-flash {
  position: fixed;
  z-index: 10002;
  border-radius: 14px;
  pointer-events: none;
}
.rx-grade-flash::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--rx-grade); }
.grade-again { --rx-grade: var(--again); }
.grade-hard { --rx-grade: var(--hard); }
.grade-good { --rx-grade: var(--good); }
.grade-easy { --rx-grade: var(--easy); }
.review-queue-item b { display: inline-block; }
.rx-success-check { display: inline-block; }
.rx-ghost { pointer-events: none !important; margin: 0 !important; animation: none !important; transition: none !important; }
.rx-ghost * { animation: none !important; transition: none !important; }
.rx-burst-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
}


@media (prefers-reduced-motion: no-preference) {
  #generateTab .drop-visual[data-chippy-state="generating"] { animation: rx-generating-bob 1.2s var(--ease-in-out) infinite alternate; }
}
@keyframes rx-generating-bob { from { translate: 0 0; } to { translate: 0 -3px; } }

@media (prefers-reduced-motion: reduce) {
  body :is(button, [role="button"], summary, .library-card-head, .library-deck-tile):active:not(:disabled):not(.primary-button, .secondary-button, .tab-button, .icon-button, .grade-btn, .segment-btn, .generate-tab-button, .file-card-next, .generation-result-chip, .ghost-button-sm, .plan-button, .generation-more-menu button),
  :is(.tag-pill, .review-tag-pill, .tag-pill-more, .checkbox-field, .figures-checkbox, .terms-modal-check, .tag-picker-label, .tag-action-check, .library-detail-title, .drop-zone):active {
    scale: none;
    translate: none;
    rotate: none;
    opacity: .8;
    transition: opacity 100ms var(--ease-out);
  }
  :is(.pill-button, .tag-pill, .review-tag-pill, .tag-pill-more, .generation-result-chip) { translate: none !important; }
  .rx-segment-indicator { display: none; }
  /* overrides styles.css:1325; static selected paint replaces the hidden pill. */
  .rx-has-indicator .segment-btn.active { background: var(--accent); box-shadow: var(--shadow-accent); }
}
