/* Rotation Finder. Controls reuse the ticker's dock bar, switch and range styles. */
#rotationFinder { max-width: 1180px; margin: 0 auto; }

.kft-rot-bar { flex-wrap: wrap; row-gap: 6px; }
.kft-rot-bar .kft-ticker-metric-switch { flex-wrap: nowrap; }
.kft-rot-field,
.kft-rot-field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.kft-rot-field-label { padding: 0 4px 0 6px; }
.kft-rot-field select,
.kft-rot-picks select,
.kft-rot-week select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}
.kft-rot-field .kft-dock-price-input { width: 64px; }
.kft-rot-pro {
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--kft-accent, #E85A1A) 16%, transparent);
  color: var(--kft-accent, #E85A1A);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Picks: plain lines, no card around them. */
.kft-rot-picks {
  display: grid;
  gap: 10px;
  margin: 4px auto 6px;
  max-width: 900px;
}
.kft-rot-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.kft-rot-label {
  min-width: 86px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-ink);
}
.kft-rot-hint { font-size: 12px; color: var(--text-muted); }
.kft-rot-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 8px;
  border-radius: 999px;
  background: var(--bg-neutral);
  color: var(--text-ink);
  font-size: 12px;
  font-weight: 700;
}
.kft-rot-chip small,
.kft-rot-member small,
.kft-rot-name small,
.kft-rot-suggest small { color: var(--text-muted); font-weight: 600; font-size: 11px; }
.kft-rot-chip button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-muted) !important;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.kft-rot-chip button:hover { background: var(--bg-white) !important; color: var(--text-ink) !important; }
.kft-rot-kit { display: inline-flex; flex-shrink: 0; }
.kft-rot-shirt svg { display: block; }
.kft-rot-dl { display: inline-flex; flex: 0 0 auto; }

.kft-rot-search { position: relative; }
.kft-rot-search input {
  width: 220px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-ink);
  font: inherit;
  font-size: 13px;
}
.kft-rot-suggest {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-white);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}
.kft-rot-suggest[hidden] { display: none; }
.kft-rot-suggest button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.kft-rot-suggest button small { margin-left: auto; }
.kft-rot-suggest button:hover,
.kft-rot-suggest button:focus-visible { background: var(--bg-neutral); outline: none; }
.kft-rot-suggest-empty { display: block; padding: 8px; font-size: 12px; color: var(--text-muted); }

.kft-rot-weeks summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.kft-rot-weeks summary:hover { color: var(--text-ink); }
.kft-rot-week-list { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 10px; }
.kft-rot-week { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.kft-rot-week.is-set { color: var(--kft-accent, #E85A1A); }
.kft-rot-link {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

.kft-rot-status {
  margin: 14px auto 6px;
  max-width: 900px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.kft-rot-status:empty { display: none; }

/* Results: a ranked list separated by rules, each with a fixture strip. */
.kft-rot-results { list-style: none; margin: 8px 0 0; padding: 0; }
.kft-rot-result { padding: 16px 0; border-top: 1px solid var(--border); }
.kft-rot-result:last-child { border-bottom: 1px solid var(--border); }
.kft-rot-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 10px;
}
.kft-rot-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--text-ink);
  color: var(--bg-white);
  font-size: 13px;
  font-weight: 800;
}
.kft-rot-names { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; color: var(--text-ink); }
.kft-rot-name { display: inline-flex; align-items: center; gap: 6px; }
.kft-rot-plus { color: var(--text-muted); font-weight: 600; }
.kft-rot-figures {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.kft-rot-figures strong { font-size: 16px; color: var(--text-ink); font-variant-numeric: tabular-nums; }
.kft-rot-figures > span { display: inline-flex; align-items: baseline; gap: 4px; }
.kft-rot-tough { color: #C2410C; font-weight: 700; }
.kft-rot-clear { color: #15803D; font-weight: 700; }

.kft-rot-strip { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kft-rot-strip table { border-collapse: separate; border-spacing: 4px; min-width: 100%; }
/* A site-wide dark-mode rule paints every th; the strip sits on the page. */
.kft-rot-strip th {
  padding: 0 0 2px;
  border: 0;
  background: transparent !important;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted) !important;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  white-space: nowrap;
}
.kft-rot-gw { display: inline-flex; align-items: center; gap: 2px; }
.kft-rot-strip .kft-rot-skip {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text-muted) !important;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: .55;
}
.kft-rot-strip .kft-rot-skip:hover,
.kft-rot-strip .kft-rot-skip:focus-visible { opacity: 1; background: var(--bg-neutral) !important; color: var(--text-ink) !important; }
.kft-rot-gain-row th.kft-rot-member { font-size: 11px; color: var(--text-muted) !important; font-weight: 700; }
.kft-rot-gain {
  display: block;
  padding: 2px 0;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.kft-rot-gain.is-up { color: #22A45D; }
.kft-rot-gain.is-cover { font-size: 10px; color: var(--text-ink); }
.kft-rot-strip thead th small { display: block; font-size: 10px; font-weight: 700; color: var(--kft-accent, #E85A1A); }
.kft-rot-strip th.kft-rot-member {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 132px;
  padding-right: 6px;
  background: var(--bg-paper, var(--bg-white)) !important;
  text-align: left;
}
.kft-rot-strip th.kft-rot-member { font-family: inherit !important; font-size: 12px; color: var(--text-ink) !important; }
.kft-rot-member > * { vertical-align: middle; }
.kft-rot-member span { margin-left: 4px; font-weight: 800; }
.kft-rot-member small { margin-left: 4px; }
.kft-rot-strip td { min-width: 62px; padding: 0; }
.kft-rot-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 34px;
  padding: 3px 4px;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
  transition: opacity .15s ease;
}
.kft-rot-opp { font-size: 11px; font-weight: 900; line-height: 1.1; }
.kft-rot-val { font-size: 10px; font-weight: 800; line-height: 1.1; opacity: .85; }
.kft-rot-cell.d1 { background: #0B5D3B; color: #fff; }
.kft-rot-cell.d2 { background: #62C370; color: #111; }
.kft-rot-cell.d3 { background: #F4C542; color: #111; }
.kft-rot-cell.d4 { background: #F28C28; color: #111; }
.kft-rot-cell.d5 { background: #8F1D2C; color: #fff; }
.kft-rot-cell.is-unknown,
.kft-rot-cell.is-blank { background: var(--bg-neutral); color: var(--text-muted); font-size: 11px; font-weight: 800; }
.kft-rot-cell[data-rot-edit] { cursor: pointer; }
.kft-rot-cell[data-rot-edit]:hover { filter: brightness(1.12); }
.kft-rot-cell[data-rot-edit]:focus-visible { outline: 2px solid var(--kft-accent, #E85A1A); outline-offset: 2px; }
.kft-rot-cell.is-bench { opacity: .28; }
.kft-rot-cell.is-bench:hover,
.kft-rot-cell.is-bench:focus-visible { opacity: .7; }
.kft-rot-cell.is-start { box-shadow: 0 0 0 2px var(--text-ink); }

.kft-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 768px) {
  .kft-rot-bar { width: 100%; }
  .kft-rot-bar .kft-dock-sep { display: none; }
  .kft-rot-label { min-width: 0; flex: 1 1 100%; }
  .kft-rot-search,
  .kft-rot-search input { width: 100%; }
  .kft-rot-figures { margin-left: 0; flex: 1 1 100%; }
  .kft-rot-strip th.kft-rot-member { min-width: 104px; }
  .kft-rot-member small { display: none; }
}
