/* Team generator (wave 2, agent B) — spec §5.5. Uses the tokens of app.css / wheel.css (.lh-app scope).
   Input panel at the inline start, team cards at the inline end (≥ 1024 px); one column below. */

/* ---------- Layout ---------- */
.lh-tm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin: 0; align-items: start; }
@media (min-width: 900px) { .lh-tm-grid { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); } }
@media (min-width: 1024px) { .lh-tm-grid { grid-template-columns: 380px minmax(0, 1fr); gap: 32px; } }
html:not(.js) .lh-tl-js, html:not(.js) .lh-step__b { display: none !important; }

.lh-tl-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; background: var(--lh-surface); border: 1px solid var(--lh-border); border-radius: 16px; box-shadow: var(--lh-shadow-sm); min-width: 0; }
.lh-tl-step .lh-step__b { inline-size: 48px; block-size: 48px; font-size: 1.25rem; }
.lh-tl-step .lh-num { inline-size: 64px; block-size: 48px; font-size: 1.0625rem; }

/* ---------- Input panel ---------- */
.lh-tm-head { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.lh-tm-label { font-weight: 750; font-size: .9375rem; }
.lh-tm-count { margin-inline-start: auto; 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-tm-head .lh-btn--icon { inline-size: 44px; min-width: 44px; min-height: 44px; margin-inline-end: -8px; }
.lh-tm-text { block-size: 150px; min-block-size: 96px; flex: none; }
@media (min-width: 900px) { .lh-tm-text { block-size: 220px; } }
.lh-tm-mode { margin: 0; padding: 0; border: 0; min-width: 0; }
.lh-tm-mode .lh-segr__o span { min-height: 44px; }
.lh-tm-k { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lh-tm-k__l { font-weight: 650; font-size: .9375rem; }
.lh-tm-pv { margin: -2px 0 0; color: var(--lh-muted); font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.lh-tm-opts { display: flex; flex-direction: column; border-block-start: 1px solid var(--lh-border); }
.lh-tm-opts .lh-set__row { padding-block: 6px; min-height: 44px; }
.lh-tm-opts .lh-set__row + .lh-set__row { border-block-start: 1px solid var(--lh-border); }
.lh-tm-naming .lh-select { min-width: 0; max-inline-size: 60%; min-height: 44px; }
.lh-tm-custom { display: flex; flex-direction: column; gap: 6px; padding-block: 6px 2px; }
.js .lh-tm-custom.is-off { display: none; }
.lh-tm .lh-bar { justify-content: center; margin-block-start: 4px; }
@media (min-width: 768px) { .lh-tm .lh-bar { max-inline-size: none; } }
.lh-tm .lh-spin.is-alt { font-size: 1.0625rem; }

/* ---------- Results ---------- */
.lh-tm-out { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-block-size: 280px; scroll-margin-block-start: 12px; }
.lh-tm-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.lh-tm-tools .lh-btn--sm { min-height: 44px; }
.lh-app:not(.lh-app--fs) .lh-tm-tools .lh-fs-exit { display: none; }
.lh-tm-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--lh-warning) 12%, transparent); font-size: .9375rem; }
.lh-tm-printed { display: none; }
.lh-tm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.lh-tm-card { display: flex; flex-direction: column; min-width: 0; background: var(--lh-surface); border: 1px solid var(--lh-border); border-radius: 16px; box-shadow: var(--lh-shadow-sm); }
.lh-tm-card__head { padding: 10px 14px 9px; border-start-start-radius: 15px; border-start-end-radius: 15px; background: var(--c); color: var(--ink); border-block-end: 1px solid rgba(0, 0, 0, .08); }
.lh-tm-card__name { margin: 0; font-size: 1.0625rem; font-weight: 850; line-height: 1.25; overflow-wrap: anywhere; }
.lh-tm-card__meta { margin: 1px 0 0; font-size: .8125rem; font-weight: 650; opacity: .92; font-variant-numeric: tabular-nums; }
.lh-tm-card__list { display: flex; flex-direction: column; margin: 0; padding: 6px 8px 8px; list-style: none; }
.lh-tm-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 36px; padding: 5px 6px; border-radius: 10px; font-weight: 600; overflow-wrap: anywhere; }
.lh-tm-m + .lh-tm-m { border-block-start: 1px solid var(--lh-border); border-start-start-radius: 0; border-start-end-radius: 0; }
.lh-tm-m__n { min-width: 0; }
.lh-tm-cards.is-flying .lh-tm-m { position: relative; z-index: 2; }
.lh-tm-m.is-cap { background: color-mix(in srgb, var(--c) 14%, transparent); }
.lh-tm-m__crown { inline-size: 18px; block-size: 18px; color: #B07A00; }
.lh-tm-m__cap { padding: 0 8px; border-radius: 999px; background: var(--lh-accent); color: #14151A; font-size: .75rem; font-weight: 800; line-height: 1.7; }
.lh-tm-m__lv { display: inline-grid; place-items: center; min-inline-size: 22px; block-size: 22px; padding: 0 5px; border-radius: 999px; background: var(--lh-surface-2); color: var(--lh-muted); font-size: .75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.lh-tm-m__tag { padding: 0 8px; border-radius: 999px; background: var(--lh-brand-soft); color: var(--lh-brand-soft-ink); font-size: .75rem; font-weight: 700; line-height: 1.7; }
.lh-tm-m__lv, .lh-tm-m__tag, .lh-tm-m__cap { margin-inline-start: auto; }
.lh-tm-m__lv ~ .lh-tm-m__tag, .lh-tm-m__cap ~ .lh-tm-m__lv { margin-inline-start: 0; }
:root[data-theme="dark"] .lh-tm-m__crown { color: #FFCB47; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lh-tm-m__crown { color: #FFCB47; } }

/* placeholder cards before the first draw */
.lh-tm-cards.is-ghost .lh-tm-card { border-style: dashed; box-shadow: none; background: transparent; }
.lh-tm-card--ghost .lh-tm-card__head { background: var(--lh-surface-2); color: var(--lh-muted); }
.lh-tm-card--ghost .lh-tm-card__list li { block-size: 12px; margin: 10px 6px; border-radius: 6px; background: var(--lh-surface-2); }
.lh-tm-card--ghost .lh-tm-card__list li:nth-child(2) { inline-size: 70%; }
.lh-tm-card--ghost .lh-tm-card__list li:nth-child(3) { inline-size: 45%; }
.lh-tm-empty { position: absolute; inset: 56px 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-inline: auto; inline-size: min(100% - 32px, 420px); padding: 16px 20px; border-radius: 16px; background: var(--lh-surface); box-shadow: var(--lh-shadow-md); text-align: center; }
.lh-tm-empty__t { margin: 0; font-weight: 800; font-size: 1.0625rem; }
.lh-tm-empty__h { margin: 0; color: var(--lh-muted); font-size: .9375rem; }
.lh-tm-empty .lh-btn { margin-block-start: 6px; }

/* ---------- Full screen (core/fullscreen.js toggles .lh-app--fs) ---------- */
.lh-app.lh-tm.lh-app--fs { display: block; overflow: auto; padding: 20px 24px 32px; }
.lh-app--fs .lh-tm-grid { display: block; }
.lh-app--fs .lh-tm-in, .lh-app--fs .lh-tm-tools .lh-btn:not([data-act="redraw"]) { display: none; }
.lh-app--fs .lh-tm-tools { padding-inline-end: 220px; }
.lh-app--fs .lh-tm-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.lh-app--fs .lh-tm-card__name { font-size: 1.5rem; }
.lh-app--fs .lh-tm-m { font-size: 1.25rem; min-height: 44px; }

/* ---------- Print: the title and the cards only ---------- */
@media print {
  .lh-tm-in, .lh-tm-tools, .lh-tm-note, .lh-tm-empty, .c-crumbs, .c-subtitle, .c-content, .lh-toasts { display: none !important; }
  .lh-tm-grid { display: block; }
  .lh-tm-printed { display: block; margin: 0 0 12px; font-size: 12pt; color: #333333; }
  .lh-tm-cards { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .lh-tm-card { break-inside: avoid; border: 2px solid var(--c); box-shadow: none; }
  .lh-tm-card__head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.lh-tm-k .lh-tl-step .lh-num { inline-size: 56px; }
.lh-tm-k__l { flex: 1; min-width: 0; }
.lh-tm-mode .lh-segr { flex-wrap: nowrap; }
.lh-tm-mode .lh-segr__o { min-width: 0; }
.lh-tm-mode .lh-segr__o span { padding: 4px 8px; line-height: 1.2; }
.lh-tm .lh-spin { padding-inline: 16px; }
.lh-tm .lh-spin__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 399.98px) { .lh-tm .lh-spin { font-size: 1.0625rem; } }
@media (max-width: 339.98px) { .lh-tm .lh-spin { font-size: .9375rem; } }
