/* Random pair generator (tool pairs). Builds on wheel.css (fields, switches, segmented radios, steppers, sticky bar,
   buttons) and the app.css tokens; logical properties only (RTL). Mobile first: the two lists stack, side by side
   from 640 px. .is-one on the root = "one list → pairs" mode. Reduced motion: .lh-reduced / prefers-reduced-motion. */

html:not(.js) .lh-pr-js, html:not(.js) .lh-pr-hist, html:not(.js) .lh-step__b { display: none !important; }
.lh-pr .lh-tl-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px 16px 16px; background: var(--lh-surface); border: 1px solid var(--lh-border); border-radius: 16px; box-shadow: var(--lh-shadow-sm); }
.lh-pr .lh-tl-card__top { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.lh-pr .lh-tl-card__h { margin: 0; color: var(--lh-muted); font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
:lang(ar) .lh-pr .lh-tl-card__h { letter-spacing: 0; font-size: .875rem; }
.lh-pr .lh-tl-card__h:focus { outline: none; }

.lh-pr-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.lh-pr-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.lh-pr-mode { margin: 0; padding: 0; border: 0; min-width: 0; flex: 0 1 auto; }
.lh-pr-mode .lh-segr__o span { min-height: 44px; }
.lh-pr-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.lh-pr-ex__l { color: var(--lh-muted); font-size: .8125rem; font-weight: 650; }
.lh-pr-chip { min-height: 36px; padding: 0 12px; border: 1px solid var(--lh-border); border-radius: 999px; background: var(--lh-surface); color: var(--lh-text); font: inherit; font-size: .8125rem; font-weight: 650; cursor: pointer; }
.lh-pr-chip:hover { background: var(--lh-surface-2); }
.lh-pr-chip:focus-visible { outline: 2px solid var(--lh-focus); outline-offset: 2px; }

/* ---------- The two lists ---------- */
.lh-pr-lists { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: stretch; }
@media (min-width: 640px) { .lh-pr-lists { grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr); gap: 10px; } }
.lh-pr-link { display: none; place-items: center; color: var(--lh-muted); }
.lh-pr-link .lh-ic { width: 26px; height: 26px; }
@media (min-width: 640px) { .lh-pr-link { display: grid; } }
.lh-pr-lname { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 4px 8px; margin-inline-start: -8px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--lh-text); font: inherit; font-weight: 750; font-size: 1rem; }
.lh-pr-lname:hover { border-color: var(--lh-border); }
.lh-pr-lname:focus { outline: 2px solid var(--lh-focus); outline-offset: 0; background: var(--lh-surface-2); }
.lh-pr-lname::placeholder { color: var(--lh-muted); opacity: 1; }
.lh-pr-count { flex: none; padding: 2px 10px; border-radius: 999px; background: var(--lh-brand-soft); color: var(--lh-brand-soft-ink); font-size: .8125rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lh-pr .lh-tl-card__top .lh-btn--icon { inline-size: 44px; min-width: 44px; min-height: 44px; margin-inline-end: -8px; }
.lh-pr-text { block-size: 168px; min-block-size: 96px; flex: none; }
@media (min-width: 900px) { .lh-pr-text { block-size: 220px; } }
.lh-pr-hint, .lh-pr-teams { padding-inline: 4px; }

/* mode switch: one list hides list B and the two-list options; two lists hide the one-list parts */
.lh-pr.is-one .lh-pr-b, .lh-pr.is-one .lh-pr-link, .lh-pr.is-one .lh-pr-two, .lh-pr:not(.is-one) .lh-pr-one { display: none !important; }
@media (min-width: 640px) { .lh-pr.is-one .lh-pr-lists { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Options ---------- */
.lh-pr-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 28px; }
@media (min-width: 900px) { .lh-pr-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.lh-pr-col { display: flex; flex-direction: column; min-width: 0; }
.lh-pr-o { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 8px 0 10px; border: 0; min-width: 0; }
.lh-pr-o + .lh-pr-o, .lh-pr-col > .lh-set__row { border-block-start: 1px solid var(--lh-border); }
.lh-pr-o > legend { float: left; width: 100%; margin-block-end: 8px; }
[dir="rtl"] .lh-pr-o > legend { float: right; }
.lh-pr-o > legend + * { clear: both; }
.lh-pr-radios { display: flex; flex-direction: column; gap: 2px; }
.lh-pr-radio { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 8px; border-radius: 10px; cursor: pointer; font-size: .9375rem; }
.lh-pr-radio:hover { background: var(--lh-surface-2); }
.lh-pr-radio input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--lh-brand); }
.lh-pr-radio input:focus-visible { outline: 2px solid var(--lh-focus); outline-offset: 2px; }
.lh-pr-max { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lh-pr-max.is-off { display: none; }
.lh-pr-step .lh-step__b { inline-size: 44px; block-size: 44px; }
.lh-pr-step .lh-num { inline-size: 56px; block-size: 44px; }
.lh-pr .lh-set__row--sw { padding-block: 8px; }
.lh-pr-segr .lh-segr__o span, .lh-pr-o .lh-segr__o span { min-height: 44px; }

.lh-pr-pv { margin: 0; padding-inline: 4px; min-height: 1.4em; color: var(--lh-muted); font-size: .9375rem; font-weight: 650; font-variant-numeric: tabular-nums; text-align: center; }
.lh-pr .lh-bar { justify-content: center; max-inline-size: none; margin-block-start: 0; }
.lh-pr .lh-spin { max-inline-size: 520px; padding-inline: 16px; }
.lh-pr .lh-spin__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Result ---------- */
.lh-pr-res { margin-block-start: 16px; scroll-margin-block-start: 72px; }
.lh-pr-meta { margin-inline-start: auto; color: var(--lh-muted); font-size: .8125rem; font-variant-numeric: tabular-nums; text-align: end; }
.lh-pr-printed { display: none; }
.lh-pr-rv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lh-pr-rv[hidden] { display: none; }
.lh-pr-prog { margin-inline-start: auto; color: var(--lh-muted); font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.lh-pr-wrap { overflow-x: auto; margin-inline: -4px; }
.lh-pr-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.lh-pr-table th, .lh-pr-table td { padding: 10px 8px; border-block-end: 1px solid var(--lh-border); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.lh-pr-table thead th { padding-block: 6px; color: var(--lh-muted); font-size: .8125rem; font-weight: 750; }
.lh-pr-table tbody td { font-weight: 650; }
.lh-pr-table tbody tr:last-child > * { border-block-end: 0; }
.lh-pr-table .lh-pr-no { inline-size: 1%; white-space: nowrap; color: var(--lh-muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.lh-pr-table tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--lh-surface-2) 55%, transparent); }
.lh-pr-q { display: inline-grid; place-items: center; min-inline-size: 64px; padding: 0 10px; border-radius: 8px; background: var(--lh-surface-2); color: var(--lh-muted); font-weight: 800; letter-spacing: .1em; }
.lh-pr-table tr.is-in > * { animation: lh-pr-in .35s var(--lh-ease, ease-out) backwards; }
.lh-pr-table tr.is-in > * { animation-delay: inherit; }
.lh-pr-table tr.is-pop > td { animation: lh-pr-pop .5s cubic-bezier(.2, .9, .3, 1.3); }
.lh-pr-table tr.is-pop > * { background: color-mix(in srgb, var(--lh-brand) 12%, transparent); transition: background-color 1.2s; }
@keyframes lh-pr-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes lh-pr-pop { 0% { opacity: 0; transform: scale(.85) rotateX(70deg); } 60% { opacity: 1; } }
.lh-reduced .lh-pr-table tr > * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .lh-pr-table tr > * { animation: none !important; } }
.lh-pr-left { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--lh-warning) 12%, transparent); font-size: .9375rem; }
.lh-pr-left[hidden] { display: none; }
.lh-pr-left p { margin: 0; overflow-wrap: anywhere; }
.lh-pr-tools { display: flex; flex-wrap: wrap; gap: 8px; padding-block-start: 4px; }
.lh-pr-tools[hidden] { display: none; }
.lh-pr-tools .lh-btn--sm, .lh-pr-rv .lh-btn { min-height: 44px; }
.lh-pr-msg { font-size: .9375rem; }

/* ---------- History ---------- */
.lh-pr-hist { margin-block-start: 12px; }
.lh-pr-hist > summary { list-style: none; cursor: pointer; width: max-content; max-width: 100%; min-height: 44px; }
.lh-pr-hist > summary::-webkit-details-marker { display: none; }
.lh-pr-hist__list { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; padding: 0; list-style: none; }
.lh-pr-hist__list .lh-hint { padding: 4px 8px; }
.lh-pr-hist__b { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--lh-text); font: inherit; font-size: .9375rem; text-align: start; cursor: pointer; }
.lh-pr-hist__b:hover { background: var(--lh-surface-2); }
.lh-pr-hist__b:focus-visible { outline: 2px solid var(--lh-focus); outline-offset: 0; }
.lh-pr-hist__t, .lh-pr-hist__n { color: var(--lh-muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.lh-pr-hist__b bdi { flex: 1 1 auto; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }

/* ---------- Print: the result only ---------- */
@media print {
  .lh-pr-form, .lh-pr-rv, .lh-pr-tools, .lh-pr-hist, .lh-pr-meta, .c-crumbs, .c-subtitle, .c-content, .lh-toasts { display: none !important; }
  .lh-pr-res { margin: 0; border: 0; box-shadow: none; padding: 0; }
  .lh-pr-printed { display: block; margin: 0 0 8px; font-size: 11pt; color: #333333; }
  .lh-pr-table { font-size: 12pt; }
  .lh-pr-table th, .lh-pr-table td { border-block-end: 1px solid #999999; background: none !important; }
  .lh-pr-table tr { break-inside: avoid; }
}
