/* =========================================================================
 * AFL fan selector — page styles
 * Built on top of the site's main style.css colour tokens.
 * ======================================================================= */

:root {
  --sel-bg-soft:   #fbf9f6;
  --sel-bg-card:   #ffffff;
  --sel-border:    #eee9e3;
  --sel-line:      #f4f0eb;
  --sel-text:      #0f2a35;
  --sel-text-mute: #6a7a82;
  --sel-text-soft: #8d99a1;
  --sel-brand:     #f7b80b;
  --sel-brand-dk:  #d99f00;
  --sel-brand-soft:#fef4d6;
  --sel-on-brand:  #1f1500;
  --sel-op:        #0F2A35;
  --sel-eta:       #3aaf6a;
  --sel-bg-row:    #f8fafc;
}

/* -------------- shared layout -------------- */
.sel-shell {
  background: var(--sel-bg-soft);
  min-height: calc(100vh - 200px);
  padding: 28px 0 64px;
  overflow-x: hidden;
}
.sel-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}
@media (max-width: 760px) {
  .sel-shell { padding: 14px 0 40px; }
  .sel-container { padding: 0 12px; }
}

/* breadcrumbs */
.sel-breadcrumb {
  font-size: 12px;
  color: var(--sel-text-mute);
  margin-bottom: 8px;
  letter-spacing: .02em;
}
.sel-breadcrumb a { color: var(--sel-text-mute); }
.sel-breadcrumb a:hover { color: var(--sel-brand); }
.sel-breadcrumb .sep { margin: 0 8px; color: var(--sel-text-soft); }

/* header bar */
.sel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 24px;
  flex-wrap: wrap;
}
.sel-header__title {
  display: flex;
  align-items: center;
  gap: 18px;
}
.sel-header__title img {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--sel-border);
  object-fit: cover;
  padding: 6px;
}
.sel-header__title h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0;
}
.sel-tabs {
  display: flex;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 999px;
  padding: 4px;
}
.sel-tabs button {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--sel-text-mute);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.sel-tabs button:hover { color: var(--sel-text); }
.sel-tabs button.is-active {
  background: var(--sel-brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(247,184,11,.3);
}

/* -------------- grid (main layout) -------------- */
.sel-grid {
  display: grid;
  grid-template-columns: 360px 1fr 280px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1180px) {
  .sel-grid { grid-template-columns: 1fr 1fr; }
  .sel-card--main { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 760px) {
  .sel-grid { grid-template-columns: 1fr; }
  .sel-mainchart-wrap { height: 340px; }
  .sel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .sel-header__title { width: 100%; }
  .sel-header__title h1 { font-size: 22px; }
  .sel-header__title img { width: 44px; height: 44px; }
  .sel-tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sel-tabs::-webkit-scrollbar { display: none; }
  .sel-tabs button { white-space: nowrap; flex-shrink: 0; }
  .sel-meta { gap: 6px; }
  .sel-meta .chip { font-size: 11px; padding: 2px 7px; }
  .sel-card__title { font-size: 12.5px; }
  .kv-table { font-size: 11.5px; }
  .kv-table th, .kv-table td { padding: 4px 3px; }
  .sel-pin-info { font-size: 11.5px; }
  .sel-pt-toggle { top: 4px; }
  .sel-pt-toggle button { padding: 3px 10px; font-size: 10.5px; }
}

/* -------------- cards -------------- */
.sel-card {
  background: var(--sel-bg-card);
  border: 1px solid var(--sel-border);
  border-radius: 10px;
  padding: 14px 16px 12px;
}
.sel-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--sel-text);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sel-card__title .legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sel-card__title .legend-dot.op { background: var(--sel-op); }
.sel-card__title .legend-dot.eta { background: var(--sel-eta); }

/* -------------- table-style key/value rows -------------- */
.kv-table {
  width: 100%;
  font-size: 12.5px;
  border-collapse: collapse;
}
.kv-table th, .kv-table td {
  text-align: left;
  padding: 5px 4px;
  vertical-align: middle;
  font-weight: 400;
  line-height: 1.25;
}
.kv-table th {
  font-weight: 400;
  color: var(--sel-text);
  width: 56%;
}
.kv-table .sym {
  color: var(--sel-text-mute);
  font-size: 11px;
  width: 26px;
  text-align: right;
  padding-right: 6px;
}
.kv-table .val {
  font-weight: 600;
  color: var(--sel-op);
  text-align: right;
  white-space: nowrap;
}
.kv-table .val--eta { color: var(--sel-eta); }
.kv-table .unit {
  color: var(--sel-text-mute);
  font-weight: 400;
  font-size: 11px;
  margin-left: 3px;
}

.kv-table tr + tr th, .kv-table tr + tr td {
  border-top: 1px solid var(--sel-line);
}

/* -------------- main chart card -------------- */
.sel-card--main {
  padding: 8px 8px 4px;
}
.sel-mainchart-wrap {
  position: relative;
  width: 100%;
  height: 480px;
}
.sel-mainchart-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}
.sel-mainchart-wrap.is-locked svg { cursor: not-allowed; }

.sel-mainchart-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Selector for static-vs-total tab (top of chart) */
.sel-pt-toggle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  border: 1px solid var(--sel-border);
  border-radius: 6px;
  overflow: hidden;
  pointer-events: auto;
  background: #fff;
  z-index: 5;
}
.sel-pt-toggle button {
  padding: 4px 14px;
  font-size: 11px;
  border: 0;
  background: #fff;
  color: var(--sel-text-mute);
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
}
.sel-pt-toggle button.is-active {
  background: var(--sel-op);
  color: #fff;
}

/* -------------- mini chart card -------------- */
.sel-card--mini {
  padding: 6px 8px 4px;
}
.sel-mini-wrap {
  width: 100%;
  height: 130px;
}
.sel-mini-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* -------------- guest CTA (non-blocking) -------------- */
.sel-guest-cta {
  position: absolute;
  top: 50px;
  right: 14px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--sel-border);
  box-shadow: 0 8px 22px rgba(42,34,16,.10);
  pointer-events: auto;
  max-width: 280px;
}
.sel-guest-cta svg {
  width: 20px; height: 20px;
  color: var(--sel-brand);
  flex-shrink: 0;
}
.sel-guest-cta .txt {
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--sel-text);
}
.sel-guest-cta .txt small {
  display: block;
  color: var(--sel-text-mute);
  font-size: 11px;
  margin-top: 1px;
}
.sel-guest-cta a {
  color: var(--sel-brand);
  font-weight: 600;
  text-decoration: none;
  font-size: 12.5px;
  white-space: nowrap;
}
.sel-guest-cta a:hover { color: var(--sel-brand-dk); }

/* light "scrim" only on the chart area so cursor is clearly disabled */
.sel-mainchart-wrap.is-locked {
  position: relative;
}
.sel-mainchart-wrap.is-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 75%, rgba(255,255,255,.4) 100%);
  pointer-events: none;
  border-radius: 8px;
}

/* -------------- sound spectrum -------------- */
.sel-sound-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}
@media (max-width: 1180px) {
  .sel-sound-row { grid-template-columns: 1fr; }
}
.sel-sound-card {
  background: var(--sel-bg-card);
  border: 1px solid var(--sel-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.sel-sound-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--sel-text);
}
.sel-sound-bars {
  width: 100%;
  height: 100px;
}
.sel-sound-table {
  width: 100%;
  font-size: 11px;
  margin-top: 8px;
  border-collapse: collapse;
}
.sel-sound-table th, .sel-sound-table td {
  text-align: center;
  padding: 3px 2px;
  color: var(--sel-text-mute);
}
.sel-sound-table .label {
  text-align: left;
  color: var(--sel-text);
  font-weight: 500;
  white-space: nowrap;
}
.sel-sound-table .total {
  color: var(--sel-text);
  font-weight: 600;
  background: var(--sel-brand-soft);
}

.sel-sound-empty {
  background: #fafcfd;
  border: 1px dashed var(--sel-border);
  border-radius: 10px;
  padding: 28px 18px;
  text-align: center;
  color: var(--sel-text-mute);
  font-size: 13px;
}

/* -------------- inline operating-point cells in kv-table -------------- */
.kv-table--op .op-cell {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}
.kv-table--op .op-cell input {
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid var(--sel-border);
  border-radius: 4px;
  text-align: right;
  width: 64px;
  min-width: 0;
  background: #fff;
  color: var(--sel-op);
}
.kv-table--op .op-cell input:focus {
  outline: 2px solid rgba(247,184,11,.18);
  border-color: var(--sel-brand);
}
.kv-table--op .op-unit {
  font-size: 11px;
  color: var(--sel-text-mute);
  white-space: nowrap;
}
.kv-table--op .op-rho {
  color: var(--sel-text-mute);
  margin-left: 6px;
  font-style: italic;
}
.kv-table--op .op-cell--readonly {
  font-size: 12px;
  color: var(--sel-op);
}

/* -------------- operating point set form -------------- */
.op-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.op-form label {
  font-size: 12.5px;
  color: var(--sel-text);
}
.op-form input {
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--sel-border);
  border-radius: 6px;
  background: #fff;
  width: 86px;
  text-align: right;
  color: var(--sel-text);
}
.op-form input:focus {
  border-color: var(--sel-brand);
  outline: 2px solid rgba(247,184,11,.18);
}
.op-form input.input--unit {
  width: 50px;
  color: var(--sel-text-mute);
  pointer-events: none;
  background: var(--sel-bg-soft);
}

/* tiny meta row */
.sel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--sel-text-mute);
  margin-top: 6px;
}
.sel-meta .chip {
  padding: 3px 9px;
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 999px;
}
.sel-meta .chip strong {
  color: var(--sel-text);
  font-weight: 600;
}

/* sticky bottom info bar (mobile reuse) */
.sel-pin-info {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--sel-bg-soft);
  border-radius: 8px;
  font-size: 12px;
  color: var(--sel-text-mute);
}
.sel-pin-info b { color: var(--sel-text); }
.sel-pin-info a {
  color: var(--sel-brand);
  font-weight: 500;
  cursor: pointer;
}

/* -------------- catalog (listing) page -------------- */
.sel-cat-search {
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 760px) {
  .sel-cat-search { grid-template-columns: 1fr 1fr; }
}
.sel-cat-search input,
.sel-cat-search select {
  font: inherit;
  font-size: 13px;
  padding: 8px 11px;
  border: 1px solid var(--sel-border);
  border-radius: 6px;
  background: #fff;
  color: var(--sel-text);
  width: 100%;
}
.sel-cat-search input:focus, .sel-cat-search select:focus {
  border-color: var(--sel-brand);
  outline: 2px solid rgba(247,184,11,.18);
}

.sel-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.sel-cat-chips button {
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px solid var(--sel-border);
  border-radius: 999px;
  background: #fff;
  color: var(--sel-text-mute);
  cursor: pointer;
  font-weight: 500;
}
.sel-cat-chips button.is-active {
  background: var(--sel-brand);
  border-color: var(--sel-brand);
  color: #fff;
}

.sel-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.sel-cat-card {
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .15s;
  cursor: pointer;
  color: var(--sel-text);
}
.sel-cat-card:hover {
  border-color: var(--sel-brand);
  box-shadow: 0 8px 22px rgba(247,184,11,.12);
  transform: translateY(-2px);
}
.sel-cat-card__img {
  width: 100%;
  height: 132px;
  background: linear-gradient(135deg, #faf7f4 0%, #f2ede6 100%);
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sel-cat-card__img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.sel-cat-card__img--placeholder::after {
  content: '';
  width: 56px; height: 56px;
  border: 3px solid rgba(247,184,11,.18);
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle, transparent 30%, rgba(247,184,11,.08) 30% 38%, transparent 38%);
}
.sel-cat-card__body { display: flex; flex-direction: column; gap: 4px; }
.sel-cat-card__cat {
  font-size: 11px;
  color: var(--sel-text-mute);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sel-cat-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--sel-text);
  letter-spacing: -.01em;
}
.sel-cat-card__specs {
  font-size: 12px;
  color: var(--sel-text-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.sel-cat-card__specs span {
  background: var(--sel-bg-soft);
  padding: 2px 8px;
  border-radius: 4px;
}

.sel-cat-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--sel-text-mute);
  font-size: 13px;
}
.sel-cat-info strong { color: var(--sel-text); }

/* -------------- login / admin -------------- */
.auth-shell {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--sel-bg-soft);
}
.auth-card {
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 14px;
  padding: 32px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(42,34,16,.08);
}
.auth-card h2 {
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--sel-text);
}
.auth-card p {
  font-size: 13px;
  color: var(--sel-text-mute);
  margin: 0 0 20px;
}
.auth-card .form-row {
  margin-bottom: 12px;
}
.auth-card label {
  display: block;
  font-size: 12px;
  color: var(--sel-text-mute);
  margin-bottom: 4px;
  font-weight: 500;
}
.auth-card input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--sel-border);
  border-radius: 8px;
  color: var(--sel-text);
}
.auth-card input:focus {
  border-color: var(--sel-brand);
  outline: 2px solid rgba(247,184,11,.18);
}
.auth-card .btn {
  width: 100%;
  margin-top: 10px;
}
.auth-card .err {
  color: #cc4444;
  font-size: 12.5px;
  margin-top: 6px;
}
.auth-card .ok {
  color: var(--sel-eta);
  font-size: 12.5px;
  margin-top: 6px;
}

/* admin */
.admin-shell { padding: 36px 0; }
.admin-card {
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 18px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--sel-line);
}
.admin-table th {
  font-weight: 600;
  color: var(--sel-text-mute);
  font-size: 11.5px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.admin-table .actions { text-align: right; }
.admin-table button {
  background: transparent;
  color: var(--sel-text-mute);
  border: 1px solid var(--sel-border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 4px;
}
.admin-table button:hover { color: var(--sel-text); border-color: var(--sel-text-mute); }
.admin-table button.danger { color: #cc4444; }
.admin-table button.danger:hover { background: #fef2f2; border-color: #cc4444; }

.user-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px dashed var(--sel-border);
}
@media (max-width: 760px) {
  .user-add-form { grid-template-columns: 1fr; }
}
.user-add-form label {
  display: block;
  font-size: 11px;
  color: var(--sel-text-mute);
  margin-bottom: 4px;
  font-weight: 500;
}
.user-add-form input,
.user-add-form select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--sel-border);
  border-radius: 6px;
}

/* "you are signed in" pill */
.auth-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  color: var(--sel-text-mute);
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 999px;
  padding: 5px 12px;
}
.auth-pill .name { color: var(--sel-text); font-weight: 600; }
.auth-pill a { color: var(--sel-brand); margin-left: 6px; }
.auth-pill .badge {
  background: var(--sel-brand);
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.auth-pill .badge.admin { background: #cc4444; }

/* =========================================================================
   Find — operating point search
   ========================================================================= */
.find-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.find-header__sub {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sel-brand);
  font-weight: 600;
  margin-bottom: 6px;
}
.find-header__title {
  font-family: 'Manrope','Inter',sans-serif;
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -.02em;
  color: var(--sel-op);
  line-height: 1.1;
}
.find-header__desc {
  font-size: 14.5px;
  color: var(--sel-text-mute);
  max-width: 760px;
  line-height: 1.55;
  margin: 0;
}

.find-form {
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 14px;
}
.find-form__main {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.find-form__cell label {
  display: block;
  font-size: 11.5px;
  color: var(--sel-text-mute);
  margin-bottom: 5px;
  font-weight: 600;
}
.find-form__cell label small {
  text-transform: none;
  color: var(--sel-brand);
  font-weight: 500;
  font-size: 10px;
  margin-left: 6px;
}
.find-form__input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--sel-border);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  transition: border-color .12s;
}
.find-form__input:focus-within {
  border-color: var(--sel-brand);
  box-shadow: 0 0 0 3px rgba(247,184,11,.14);
}
.find-form__input input {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--sel-op);
  padding: 8px 0;
  border: 0;
  background: transparent;
  width: 100%;
  outline: none;
  min-width: 0;
}
.find-form__unit {
  font-size: 12px;
  color: var(--sel-text-mute);
  font-weight: 500;
  white-space: nowrap;
  margin-left: 8px;
}
.find-toggle {
  display: flex;
  background: var(--sel-bg-soft);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--sel-border);
}
.find-toggle label {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  text-align: center;
  cursor: pointer;
  border-radius: 5px;
  color: var(--sel-text-mute);
  margin: 0;
  transition: all .12s;
}
.find-toggle label:has(input:checked) {
  background: #fff;
  color: var(--sel-op);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.find-toggle input { display: none; }
.find-form__cell select {
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1.5px solid var(--sel-border);
  border-radius: 8px;
  width: 100%;
  background: #fff;
  cursor: pointer;
  color: var(--sel-op);
}
.find-form__cell select:focus {
  border-color: var(--sel-brand);
  outline: 2px solid rgba(247,184,11,.18);
}
.find-form__cta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  justify-content: flex-end;
  min-width: 140px;
}
.find-form__btn {
  height: 42px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.find-form__clear {
  font: inherit;
  font-size: 11px;
  background: transparent;
  border: 0;
  color: var(--sel-text-mute);
  cursor: pointer;
  text-decoration: underline;
}
.find-form__clear:hover { color: var(--sel-text); }

.find-extra {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--sel-border);
}
.find-extra > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--sel-text);
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.find-extra > summary::before {
  content: '▸';
  display: inline-block;
  transition: transform .2s;
  color: var(--sel-text-mute);
}
.find-extra[open] > summary::before { transform: rotate(90deg); }
.find-extra > summary #filtersHint {
  font-weight: 400;
  font-size: 12px;
  color: var(--sel-text-mute);
}
.find-extra__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.find-extra__cell label {
  display: block;
  font-size: 11.5px;
  color: var(--sel-text-mute);
  font-weight: 600;
  margin-bottom: 5px;
}
.find-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.find-chip {
  font: inherit;
  font-size: 11.5px;
  padding: 5px 11px;
  border: 1.5px solid var(--sel-border);
  border-radius: 999px;
  background: #fff;
  color: var(--sel-text-mute);
  cursor: pointer;
  font-weight: 500;
  transition: all .12s;
}
.find-chip:hover { border-color: var(--sel-text-mute); color: var(--sel-op); }
.find-chip.is-active {
  background: var(--sel-brand);
  border-color: var(--sel-brand);
  color: #fff;
}
.find-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 4px;
  align-items: center;
}
.find-range input {
  font: inherit;
  font-size: 12.5px;
  padding: 6px 9px;
  border: 1.5px solid var(--sel-border);
  border-radius: 6px;
  text-align: right;
  width: 100%;
  min-width: 0;
}
.find-range input:focus {
  border-color: var(--sel-brand);
  outline: 2px solid rgba(247,184,11,.18);
}
.find-range span { color: var(--sel-text-soft); }
.find-extra__cell > input[type="number"],
.find-extra__cell > input[type="text"] {
  font: inherit;
  font-size: 12.5px;
  padding: 6px 9px;
  border: 1.5px solid var(--sel-border);
  border-radius: 6px;
  width: 100%;
  background: #fff;
  color: var(--sel-op);
  box-sizing: border-box;
}
.find-extra__cell > input[type="number"]:focus,
.find-extra__cell > input[type="text"]:focus {
  border-color: var(--sel-brand);
  outline: 2px solid rgba(247,184,11,.18);
}

.find-stats {
  margin: 14px 4px 10px;
  font-size: 13.5px;
  color: var(--sel-text-mute);
}
.find-stats strong { color: var(--sel-op); font-weight: 700; }
.find-results { background: transparent; }

.find-empty {
  background: #fff;
  border: 1px dashed var(--sel-border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  color: var(--sel-text-mute);
  font-size: 14px;
}

.find-table {
  width: 100%;
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 12px;
  overflow: hidden;
  border-collapse: collapse;
  font-size: 13px;
}
.find-table thead th {
  background: var(--sel-bg-soft);
  border-bottom: 1px solid var(--sel-line);
  padding: 11px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--sel-text);
  font-size: 11.5px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.find-table th.num { text-align: right; }
.find-table tbody tr {
  border-bottom: 1px solid var(--sel-line);
  cursor: pointer;
  transition: background .12s;
}
.find-table tbody tr:hover {
  background: var(--sel-brand-soft);
}
.find-table tbody tr:last-child { border-bottom: 0; }
.find-table td {
  padding: 9px 10px;
  vertical-align: middle;
  color: var(--sel-text);
}
.find-table td.num { text-align: right; white-space: nowrap; }
.find-table td.thumb {
  width: 44px;
  padding: 6px 4px 6px 12px;
}
.find-table td.thumb img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}
.find-table td.name { min-width: 180px; }
.find-table td.name .name-main {
  font-weight: 600;
  font-size: 13px;
  color: var(--sel-op);
  font-family: 'Inter', monospace;
}
.find-table td.name .name-sub {
  font-size: 11px;
  color: var(--sel-text-mute);
  margin-top: 1px;
}
.find-table td.dim { color: var(--sel-text-mute); font-size: 12px; }
.find-table td.gap.is-good { color: var(--sel-eta); font-weight: 600; }
.find-table td.gap.is-under { color: #cc7e23; font-weight: 600; }
.find-table td.gap.is-over { color: #b06b87; font-weight: 600; }
.find-table .find-open {
  color: var(--sel-brand);
  font-weight: 700;
  font-size: 18px;
}

/* score bar */
.score-bar {
  position: relative;
  display: inline-block;
  width: 96px;
  height: 22px;
  background: var(--sel-bg-soft);
  border-radius: 4px;
  overflow: hidden;
  text-align: center;
  vertical-align: middle;
}
.score-bar__fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--sel-brand);
  opacity: 0.35;
  transition: width .4s ease;
}
.score-bar__txt {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--sel-op);
  line-height: 22px;
}
.score-bar.is-perfect .score-bar__fill { background: var(--sel-eta); opacity: 0.4; }
.score-bar.is-perfect .score-bar__txt { color: #1c6f3b; }
.score-bar.is-good .score-bar__fill { background: var(--sel-brand); opacity: 0.35; }
.score-bar.is-okay .score-bar__fill { background: #f0a868; opacity: 0.35; }

.find-more {
  text-align: center;
  padding: 14px;
  color: var(--sel-text-mute);
  font-size: 12.5px;
}

@media (max-width: 760px) {
  .find-header { flex-direction: column; }
  .find-header__title { font-size: 22px; }
  .find-form__main { grid-template-columns: 1fr 1fr; }
  .find-form__cta { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .find-form__btn { flex: 1; }
  .find-table { font-size: 12px; }
  .find-table thead th { padding: 8px 6px; font-size: 10.5px; }
  .find-table td { padding: 8px 6px; }
  .find-table-wrap { overflow-x: auto; }
}

/* =========================================================================
   Fan-wall result cards
   ========================================================================= */
.wall-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.wall-card {
  background: #fff;
  border: 1.5px solid var(--sel-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wall-card:hover {
  border-color: var(--sel-brand);
  box-shadow: 0 12px 28px rgba(247,184,11,.16);
  transform: translateY(-2px);
}
.wall-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wall-card__header img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: var(--sel-bg-soft);
  border-radius: 6px;
  padding: 3px;
}
.wall-card__name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--sel-op);
  font-family: 'Inter', monospace;
}
.wall-card__sub {
  font-size: 11.5px;
  color: var(--sel-text-mute);
  margin-top: 1px;
}
.wall-card__layout {
  background: var(--sel-bg-soft);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.wall-card__big {
  font-family: 'Manrope','Inter',sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--sel-op);
  margin-bottom: 10px;
  letter-spacing: -.01em;
}
.wall-card__big span {
  color: var(--sel-text-mute);
  font-weight: 500;
  font-size: 13px;
  margin-left: 4px;
}
.wall-card__pitch {
  font-size: 11.5px;
  color: var(--sel-text-mute);
  margin-top: 8px;
}
.wall-card__metrics {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}
.wall-card__metrics th, .wall-card__metrics td {
  padding: 4px 0;
  text-align: left;
  vertical-align: middle;
}
.wall-card__metrics th {
  font-weight: 400;
  color: var(--sel-text-mute);
}
.wall-card__metrics td {
  text-align: right;
  color: var(--sel-op);
  font-weight: 600;
}
.wall-card__metrics tr + tr th, .wall-card__metrics tr + tr td {
  border-top: 1px solid var(--sel-line);
}

/* =========================================================================
   Quick action cards (find + fan-wall) on landing
   ========================================================================= */
.sel-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
  margin-bottom: 26px;
}
@media (max-width: 760px) { .sel-quick { grid-template-columns: 1fr; } }
.sel-quick__card {
  display: flex;
  gap: 16px;
  background: #fff;
  border: 1.5px solid var(--sel-border);
  border-radius: 14px;
  padding: 20px 22px;
  text-decoration: none;
  color: var(--sel-text);
  transition: all .18s;
  position: relative;
}
.sel-quick__card:hover {
  border-color: var(--sel-brand);
  box-shadow: 0 14px 32px rgba(247,184,11,.18);
  transform: translateY(-2px);
}
.sel-quick__card--primary {
  background: linear-gradient(135deg, #2a2210 0%, #6b4d10 100%);
  color: #fff;
  border-color: #1f5b6a;
}
.sel-quick__card--primary:hover {
  border-color: var(--sel-accent);
  box-shadow: 0 14px 38px rgba(42,34,16,.4);
}
.sel-quick__icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--sel-brand-soft);
  color: var(--sel-brand);
}
.sel-quick__card--primary .sel-quick__icon {
  background: rgba(205, 189, 100,.18);
  color: var(--sel-accent);
}
.sel-quick__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sel-brand);
  font-weight: 600;
}
.sel-quick__card--primary .sel-quick__eyebrow { color: var(--sel-accent); }
.sel-quick__body h3 {
  font-family: 'Manrope','Inter',sans-serif;
  font-size: 18px;
  margin: 4px 0 6px;
  letter-spacing: -.01em;
  color: var(--sel-op);
  font-weight: 700;
}
.sel-quick__card--primary .sel-quick__body h3 { color: #fff; }
.sel-quick__body p {
  font-size: 13.5px;
  color: var(--sel-text-mute);
  line-height: 1.5;
  margin: 0 0 10px;
}
.sel-quick__card--primary .sel-quick__body p { color: rgba(255,255,255,.78); }
.sel-quick__cta {
  font-size: 13px;
  color: var(--sel-brand);
  font-weight: 600;
}
.sel-quick__card--primary .sel-quick__cta { color: var(--sel-accent); }

.sel-section-title {
  font-family: 'Manrope','Inter',sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 4px;
  color: var(--sel-op);
  letter-spacing: -.01em;
}

/* =========================================================================
   Family tiles on selector landing
   ========================================================================= */
.fam-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 4px;
}
.fam-tile {
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 14px;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--sel-text);
  transition: all .18s;
  position: relative;
  overflow: hidden;
}
.fam-tile:hover {
  border-color: var(--sel-brand);
  box-shadow: 0 14px 32px rgba(247,184,11,.16);
  transform: translateY(-2px);
}
.fam-tile__head {}
.fam-tile__eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sel-brand);
  font-weight: 600;
}
.fam-tile__title {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin: 4px 0 6px;
  color: var(--sel-op);
  letter-spacing: -.01em;
  line-height: 1.2;
}
.fam-tile__count {
  font-size: 12.5px;
  color: var(--sel-text-mute);
}
.fam-tile__count strong { color: var(--sel-op); font-weight: 700; }
.fam-tile__chart {
  height: 120px;
  background: linear-gradient(180deg, #fbf9f6 0%, #f7f3ec 100%);
  border-radius: 8px;
  padding: 4px;
  overflow: hidden;
}
.fam-tile__chart svg {
  width: 100%;
  height: 100%;
  display: block;
}
.fam-tile__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--sel-brand);
  font-weight: 600;
  padding-top: 4px;
}
.fam-tile__cta svg { transition: transform .15s; }
.fam-tile:hover .fam-tile__cta svg { transform: translateX(4px); }

/* =========================================================================
   Family overview page
   ========================================================================= */
.fam-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: start;
  margin-bottom: 22px;
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 14px;
  padding: 28px 30px;
}
.fam-header__sub {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sel-brand);
  font-weight: 600;
  margin-bottom: 4px;
}
.fam-header__title {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -.02em;
  color: var(--sel-op);
  line-height: 1.1;
}
.fam-header__desc {
  font-size: 14.5px;
  color: var(--sel-text);
  line-height: 1.55;
  max-width: 760px;
}
.fam-header__desc p { margin: 0 0 10px; }
.fam-header__desc p:last-child { margin-bottom: 0; }
.fam-header__desc strong, .fam-header__desc b { color: var(--sel-op); }

/* Filters */
.fam-filters {
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 14px;
  padding: 16px 20px 14px;
  margin-bottom: 16px;
}
.fam-filters__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sel-line);
}
.fam-filters__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sel-op);
  letter-spacing: .01em;
}
.fam-filters__count {
  font-size: 12px;
  color: var(--sel-text-mute);
  background: var(--sel-bg-soft);
  padding: 3px 10px;
  border-radius: 999px;
}
.fam-filters__reset {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--sel-border);
  color: var(--sel-text-mute);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s;
}
.fam-filters__reset:hover {
  color: var(--sel-op);
  border-color: var(--sel-text-mute);
}
.fam-filters__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px 22px;
}
.fam-filt-row {}
.fam-filt-row__label {
  font-size: 11.5px;
  color: var(--sel-text-mute);
  margin-bottom: 4px;
  font-weight: 500;
}
.fam-filt-row__label span {
  color: var(--sel-op);
  font-weight: 600;
  font-style: italic;
}
.fam-filt-row__inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 4px;
  align-items: center;
}
.fam-filt-row__inputs--single {
  grid-template-columns: 1fr auto;
}
.fam-filt-row__inputs input {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 8px;
  border: 1px solid var(--sel-border);
  border-radius: 5px;
  width: 100%;
  min-width: 0;
  background: #fff;
  color: var(--sel-op);
}
.fam-filt-row__inputs input:focus {
  outline: 2px solid rgba(247,184,11,.2);
  border-color: var(--sel-brand);
}
.fam-filt-row__dash {
  color: var(--sel-text-soft);
  font-size: 11px;
}
.fam-filt-row__unit {
  font-size: 11px;
  color: var(--sel-text-mute);
}
.fam-filt-row__chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.fam-filt-chip {
  font: inherit;
  font-size: 11.5px;
  padding: 4px 12px;
  border: 1px solid var(--sel-border);
  border-radius: 999px;
  background: #fff;
  color: var(--sel-text-mute);
  cursor: pointer;
  font-weight: 500;
  transition: all .12s;
}
.fam-filt-chip:hover {
  color: var(--sel-op);
  border-color: var(--sel-text-mute);
}
.fam-filt-chip.is-active {
  background: var(--sel-brand);
  border-color: var(--sel-brand);
  color: #fff;
}
.fam-filt-row--search {
  grid-column: span 2;
}
.fam-filt-row--search .fam-filt-row__inputs input[type="text"] {
  grid-column: 1 / -1;
}
@media (max-width: 760px) {
  .fam-filters__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fam-filt-row--search { grid-column: span 2; }
}

/* Chart zoom controls */
.fam-chart-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 4;
}
.fam-chart-controls button {
  width: 30px;
  height: 30px;
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 16px;
  color: var(--sel-op);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all .12s;
  box-shadow: 0 2px 4px rgba(42,34,16,.06);
}
.fam-chart-controls button:hover {
  background: var(--sel-brand-soft);
  border-color: var(--sel-brand);
  color: var(--sel-brand);
}
.fam-chart-controls button:active {
  transform: scale(0.95);
}

/* chart card */
.fam-chart-card {
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 14px;
  padding: 16px 18px 12px;
  margin-bottom: 22px;
}
.fam-chart-wrap {
  position: relative;
  width: 100%;
  height: 460px;
  user-select: none;
}
.fam-chart-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}
.fam-curve {
  transition: stroke-opacity .12s, stroke-width .12s, stroke .12s;
}
.fam-curve-hit:hover ~ .fam-curve { pointer-events: none; }
.fam-chart-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--sel-text-mute);
  padding-left: 4px;
}

/* table */
.fam-table-host { background: transparent; }
.fam-table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--sel-text-mute);
}
.fam-table-toolbar strong { color: var(--sel-text); font-weight: 700; }
.fam-table-wrap {
  background: #fff;
  border: 1px solid var(--sel-border);
  border-radius: 12px;
  overflow: auto;
  max-height: 640px;
  -webkit-overflow-scrolling: touch;
}
.fam-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.fam-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  border-bottom: 1px solid var(--sel-line);
  padding: 10px 6px 8px;
  text-align: center;
  font-weight: 600;
  color: var(--sel-text);
  white-space: nowrap;
  font-size: 11.5px;
}
.fam-table thead th sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--sel-text-mute);
  vertical-align: bottom;
  margin-left: 1px;
}
.fam-table thead th small {
  display: block;
  font-size: 9.5px;
  font-weight: 400;
  color: var(--sel-text-mute);
  letter-spacing: 0;
  margin-top: 2px;
}
.fam-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}
.fam-table thead th.sortable:hover { background: var(--sel-bg-soft); }
.fam-table thead th .sort-arrows {
  font-size: 8px;
  color: var(--sel-text-soft);
  display: inline-block;
  margin-right: 3px;
  letter-spacing: -2px;
}

.fam-table tbody tr {
  cursor: pointer;
  transition: background .1s;
}
.fam-table tbody tr:hover,
.fam-table tbody tr.is-highlight {
  background: var(--sel-brand-soft);
}
.fam-table tbody tr.is-highlight td { color: var(--sel-op); font-weight: 500; }
.fam-table tbody td {
  padding: 6px 6px;
  text-align: center;
  border-bottom: 1px solid var(--sel-line);
  color: var(--sel-text);
  white-space: nowrap;
}
.fam-table tbody td.name-cell {
  text-align: left;
  font-weight: 500;
  color: var(--sel-op);
  font-family: 'Inter', monospace;
  font-size: 12px;
}
.fam-table tbody td.thumb-cell {
  width: 36px;
  padding: 4px 4px 4px 10px;
}
.fam-table tbody td.thumb-cell img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

@media (max-width: 760px) {
  .fam-header { grid-template-columns: 1fr; padding: 18px 16px; }
  .fam-header__title { font-size: 24px; }
  .fam-chart-wrap { height: 340px; }
  .fam-table { font-size: 11px; }
  .fam-table tbody td { padding: 4px 4px; }
}

/* =========================================================================
   Clickable dimension image + Lightbox
   ========================================================================= */
.sel-dim-img {
  position: relative;
  display: block;
  max-width: 1100px;
  margin: 0 auto;
  border: 1px solid var(--sel-border);
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.sel-dim-img:hover {
  border-color: var(--sel-brand);
  box-shadow: 0 8px 22px rgba(247,184,11,.14);
}
.sel-dim-img img {
  width: 100%;
  display: block;
}
.sel-dim-img__hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #fff;
  background: rgba(15, 42, 53, 0.78);
  padding: 5px 10px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
  pointer-events: none;
  transition: opacity .15s;
}
.sel-dim-img:hover .sel-dim-img__hint {
  background: var(--sel-brand);
}

.sel-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 36, 0.92);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.sel-lightbox.is-open { display: flex; }
.sel-lightbox__inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
  overflow: hidden;
}
.sel-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  cursor: grab;
  transform-origin: center center;
  transition: transform .12s ease-out;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  background: #fff;
}
.sel-lightbox__caption {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  background: rgba(15, 42, 53, 0.6);
  padding: 6px 16px;
  border-radius: 999px;
}
.sel-lightbox__close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 24px;
  font-family: inherit;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}
.sel-lightbox__close:hover { background: rgba(255,255,255,0.25); }

.sel-lightbox__controls {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 6px;
  background: rgba(15, 42, 53, 0.85);
  padding: 6px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
}
.sel-lightbox__controls button {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 18px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sel-lightbox__controls button:hover { background: rgba(255,255,255,0.15); }
.sel-lightbox__hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  pointer-events: none;
}
@media (max-width: 760px) {
  .sel-lightbox__hint { font-size: 11px; bottom: 80px; }
  .sel-lightbox__controls { bottom: 16px; right: 50%; transform: translateX(50%); }
  .sel-lightbox__inner { padding: 16px; }
}

/* selector home hero */
.sel-hero {
  background: linear-gradient(135deg, #2a2210 0%, #6b4d10 100%);
  color: #fff;
  border-radius: 14px;
  padding: 36px 32px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.sel-hero::before {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(205, 189, 100,.45) 0%, rgba(205, 189, 100,0) 70%);
  pointer-events: none;
}
.sel-hero h1 {
  font-family: 'Manrope', 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -.02em;
  color: #fff;
}
.sel-hero p {
  font-size: 15px;
  max-width: 720px;
  color: rgba(255,255,255,.88);
  margin: 0 0 16px;
  line-height: 1.5;
}
.sel-hero .badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sel-hero .badges span {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.sel-hero .badges strong {
  color: #fff;
  font-weight: 700;
}

/* =========================================================================
   MOBILE — комплексная адаптация (≤ 760px)
   ========================================================================= */
/* Глобально: запрет горизонтального переполнения (всегда, не только мобильный) */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

@media (max-width: 760px) {

  /* topbar — скрываем (контакты есть в футере) */
  .topbar { display: none; }

  /* header — компактный */
  .header__inner { padding: 8px 0; gap: 10px; }
  .header__logo img { height: 32px; }
  .header .nav { display: none; }
  .header__cta { padding: 9px 14px; font-size: 13px; }
  .header__actions { gap: 6px; }

  /* breadcrumb — мельче */
  .sel-breadcrumb { font-size: 11px; margin-bottom: 6px; word-wrap: break-word; }
  .sel-breadcrumb .sep { margin: 0 5px; }

  /* ===== HERO (landing) ===== */
  .sel-hero {
    padding: 22px 18px 80px;        /* нижний padding под auth-pill */
    border-radius: 10px;
    position: relative;
  }
  .sel-hero h1 {
    font-size: 22px;
    line-height: 1.2;
    margin-bottom: 8px;
  }
  .sel-hero p {
    font-size: 13.5px;
    line-height: 1.45;
    margin-bottom: 14px;
  }
  .sel-hero .badges {
    gap: 5px;
  }
  .sel-hero .badges span {
    font-size: 11px;
    padding: 4px 9px;
  }
  /* auth pill не должен накладываться */
  .sel-hero #authPill,
  .sel-hero [id="authPill"] {
    position: absolute !important;
    top: auto !important;
    right: 14px !important;
    bottom: 14px !important;
  }

  /* ===== Family tiles ===== */
  .fam-tiles {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 14px;
  }
  .fam-tile {
    padding: 14px 16px 12px;
  }
  .fam-tile__title { font-size: 16px; }
  .fam-tile__chart { height: 110px; }

  /* ===== Family page header ===== */
  .fam-header {
    grid-template-columns: 1fr;
    padding: 18px 16px;
    gap: 14px;
    border-radius: 10px;
  }
  .fam-header__title { font-size: 22px; }
  .fam-header__desc {
    font-size: 13.5px;
    line-height: 1.5;
  }
  .fam-header__desc p { margin-bottom: 8px; }
  .fam-header__pill {
    align-self: flex-start;
  }

  /* ===== Family chart ===== */
  .fam-chart-card {
    padding: 12px 10px 8px;
    border-radius: 10px;
  }
  .fam-chart-wrap { height: 280px; }
  .fam-chart-hint { font-size: 11.5px; line-height: 1.4; }

  /* ===== Family table ===== */
  .fam-table-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 4px;
  }
  .fam-table-toolbar #famExport {
    width: 100%;
  }
  .fam-table-wrap {
    max-height: 520px;
    border-radius: 10px;
  }
  .fam-table {
    font-size: 11px;
    min-width: 700px;     /* горизонтальный скролл — но колонки не сжимаются в кашу */
  }
  .fam-table thead th { padding: 8px 5px 6px; font-size: 10.5px; }
  .fam-table thead th sub, .fam-table thead th small { font-size: 9px; }
  .fam-table tbody td { padding: 5px 5px; }
  .fam-table tbody td.thumb-cell { padding: 4px; width: 30px; }
  .fam-table tbody td.thumb-cell img { width: 22px; height: 22px; }
  .fam-table tbody td.name-cell { font-size: 11px; }

  /* ===== MODEL page ===== */
  .sel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }
  .sel-header__title {
    flex-wrap: wrap;
    gap: 12px;
  }
  .sel-header__title img {
    width: 44px; height: 44px;
    padding: 4px;
  }
  .sel-header__title h1 {
    font-size: 22px;
    line-height: 1.15;
    word-break: break-all;
  }
  /* На мобиле — auth pill справа сверху, tabs ниже */
  .sel-header > div:last-child {
    display: flex;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }
  .sel-header > div:last-child > #authPill {
    align-self: flex-end;
  }
  .sel-meta {
    gap: 6px;
    margin-top: 6px;
  }
  .sel-meta .chip { font-size: 11px; padding: 3px 8px; }

  /* Tabs — горизонтальный скролл */
  .sel-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    scrollbar-width: none;
    padding: 3px;
  }
  .sel-tabs::-webkit-scrollbar { display: none; }
  .sel-tabs button {
    padding: 8px 14px;
    font-size: 12.5px;
    flex-shrink: 0;
  }

  /* Auth pill — компактный, отдельной строкой */
  .auth-pill {
    align-self: flex-end;
    font-size: 12px;
    padding: 4px 10px;
  }

  /* Главная сетка — в один столбец */
  .sel-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .sel-card { border-radius: 10px; padding: 12px 14px 10px; }
  .sel-card__title { font-size: 12.5px; margin-bottom: 8px; }

  /* Основной график — фиксированная высота */
  .sel-card--main { padding: 6px 6px 4px; }
  .sel-mainchart-wrap { height: 340px; }

  /* Inputs in operating point form — крупнее, легче тапать */
  .op-form input,
  #opQ, #opP {
    width: 70px !important;
    font-size: 14px !important;
    padding: 6px 8px !important;
  }

  /* Toggle статич/полное */
  .sel-pt-toggle button {
    padding: 5px 12px;
    font-size: 11px;
  }

  /* Guest CTA — компактный над графиком, не накладывается */
  .sel-guest-cta {
    position: static !important;
    margin: 8px 4px 4px;
    max-width: 100%;
    box-shadow: none;
    border-radius: 8px;
    padding: 8px 12px;
  }
  .sel-guest-cta .txt { font-size: 11.5px; }
  .sel-guest-cta a { font-size: 12.5px; }

  /* kv-table в калькуляторе — уплотняем */
  .kv-table { font-size: 11.5px; }
  .kv-table th, .kv-table td { padding: 4px 3px; line-height: 1.2; }
  .kv-table .sym { font-size: 10px; width: 22px; }
  .kv-table .unit { font-size: 10px; }

  /* Мини-графики — 2 в ряд на маленьких экранах для экономии вертикали */
  .sel-grid > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .sel-card--mini { padding: 6px 6px; }
  .sel-mini-wrap { height: 110px; }
  .sel-grid > div:last-child .sel-card--mini:nth-child(3) {
    grid-column: 1 / -1;
  }

  /* Sound block — 1 столбец */
  .sel-sound-row { grid-template-columns: 1fr; gap: 12px; }
  .sel-sound-card { padding: 10px 12px; }
  .sel-sound-card h3 { font-size: 12.5px; }
  .sel-sound-bars { height: 80px; }
  .sel-sound-table { font-size: 10px; }
  .sel-sound-table th, .sel-sound-table td { padding: 2px 1px; }

  /* Pin info — компактнее */
  .sel-pin-info { font-size: 11.5px; padding: 8px 10px; line-height: 1.45; }
  #pinMismatch { font-size: 11.5px !important; padding: 8px 10px !important; }

  /* Catalog cards (legacy) */
  .sel-cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .sel-cat-card { padding: 10px 12px; }
  .sel-cat-card__img { height: 96px; }
  .sel-cat-card__name { font-size: 13px; }
  .sel-cat-card__cat { font-size: 10px; }
  .sel-cat-card__specs { font-size: 11px; gap: 5px; }
  .sel-cat-card__specs span { padding: 1px 6px; }

  /* search inputs */
  .sel-cat-search {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
    gap: 8px;
  }
  .sel-cat-search input { grid-column: 1 / -1; }

  /* Login & admin */
  .auth-shell {
    padding: 24px 14px;
    align-items: flex-start;
    min-height: auto;
    padding-top: 40px;
  }
  .auth-card {
    padding: 22px 18px;
    border-radius: 12px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .auth-card h2 { font-size: 18px; }
  .auth-card input {
    box-sizing: border-box;
    max-width: 100%;
  }

  /* Admin */
  .admin-card { padding: 16px 14px; border-radius: 10px; }
  .admin-table { font-size: 11.5px; }
  .admin-table th, .admin-table td { padding: 8px 5px; }
  .user-add-form { grid-template-columns: 1fr; }
  .user-add-form button { width: 100%; }

  /* Footer — компактнее */
  footer { padding: 18px 0 !important; font-size: 12px !important; }
}

/* Очень узкие экраны — iPhone SE / Galaxy old */
@media (max-width: 380px) {
  .sel-container { padding: 0 10px; }
  .sel-hero h1 { font-size: 19px; }
  .sel-header__title h1 { font-size: 19px; }
  .fam-header__title { font-size: 19px; }
  .sel-grid > div:last-child { grid-template-columns: 1fr; }
  .sel-grid > div:last-child .sel-card--mini:nth-child(3) {
    grid-column: auto;
  }
  .sel-cat-grid { grid-template-columns: 1fr; }
  .sel-mainchart-wrap { height: 300px; }
}

/* amber brand — dark text on filled brand surfaces (was white-on-teal) */
.sel-tabs button.is-active,
.sel-cat-chips button.is-active,
.auth-pill .badge,
.find-chip.is-active,
.fam-filt-chip.is-active,
.sel-dim-img:hover .sel-dim-img__hint { color: var(--sel-on-brand); }
