/*
 * Control bars: one consistent, deliberate layout on every page.
 * Desktop keeps the existing one-line docks; phones get full-width
 * switches, label-over-control fields and folded map filters.
 * Pairs with assets/kft-controls.js.
 */
/*
 * Inside the kft-studio layer on purpose: that layer's !important rules
 * outrank any unlayered ones, so these only win (by specificity) from within it.
 */
@layer kft-studio {
  html body .kft-ctl-bar .kft-ctl-undo:disabled { display: none !important; }

  html body .kft-ctl-bar .kft-field { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
  html body .kft-ctl-bar .kft-ctl-drawer { display: contents; }
  html body .kft-ctl-bar .kft-dock-price-input { width: 64px !important; min-width: 64px !important; }
  html body .kft-ctl-bar .kft-ctl-toggle { display: none !important; }

  /* Fields and actions share a baseline at every width. */
  html body .kft-ctl-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    padding: 16px !important;
    overflow: visible !important;
  }
  html body .kft-ctl-bar :is(.kft-dock-item, .kft-btn, .kft-dock-search, .kft-dock-price-input, .kft-dl-btn, select) {
    min-height: 44px !important;
    height: 44px !important;
    margin-block: 0 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    box-sizing: border-box;
  }
  html body .kft-ctl-bar .kft-dock-search { flex: 1 1 200px !important; width: auto !important; min-width: 0 !important; max-width: 320px !important; }
  html body .kft-ctl-bar .kft-dock-sep { display: none !important; }
  html body .kft-ctl-bar .kft-dl-btn { min-width: 44px !important; }
  html body .kft-ctl-bar :is(.kft-compare-range-label, .kft-rot-field-label) { font: 550 12px/1.5 var(--kft-body) !important; letter-spacing: 0 !important; text-transform: none !important; }
  html body .kft-ctl-bar :is(.kft-field, .kft-rot-field, .kft-ticker-visible-range label) {
    display: grid !important;
    gap: 6px !important;
    align-items: start !important;
    min-width: 0 !important;
  }
  html body .kft-ctl-bar .kft-field { flex: 1 1 120px; }
  html body .kft-ctl-bar .kft-rot-field { display: flex !important; align-items: center !important; gap: 8px !important; }
  html body .kft-ctl-bar .kft-field-range { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center !important; }
  html body .kft-ctl-bar .kft-field-range > :first-child { grid-column: 1 / -1; }
  html body .kft-ctl-bar :is(.kft-field, .kft-rot-field) select { width: 100% !important; min-width: 0 !important; }
  html body .kft-ctl-bar .kft-rot-field select { width: 64px !important; min-width: 64px !important; }
  html body .kft-ctl-bar .kft-ticker-visible-range {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  html body .kft-ctl-bar .kft-ticker-visible-range > span { display: none !important; }
  html body .kft-ctl-bar .kft-ticker-visible-range select { width: 100% !important; min-width: 0 !important; }
  html body .kft-ctl-bar .kft-ticker-visible-range label { color: var(--kft-muted) !important; font: 600 11px/1.3 var(--kft-body) !important; }
  html body .kft-ctl-bar .xgi-pos-filter { gap: 6px !important; }
  html body .kft-ctl-bar .kft-ticker-metric-switch { display: flex !important; gap: 6px !important; flex-wrap: nowrap !important; min-width: 0 !important; margin: 0 !important; }
  html body .kft-ctl-bar .kft-ticker-metric-switch > button { flex: 1 1 auto !important; min-width: 0 !important; white-space: nowrap; padding-inline: 10px !important; }
  html body .kft-ctl-bar.kft-ctl-ticker {
    display: grid !important;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 280px) !important;
    align-items: end !important;
    gap: 16px !important;
    padding: 16px !important;
  }
  html body .kft-ctl-measure { align-self: end; min-width: 0; }
  html body .kft-ctl-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; grid-column: 1 / -1; }
  html body .kft-ctl-ticker .ticker-sort-state { margin-left: auto !important; order: 0 !important; font-size: 11px !important; }
  html body .kft-ctl-ticker .kft-dl-btn { display: inline-flex !important; align-items: center; justify-content: center; gap: 8px; margin-left: 0 !important; flex: 0 0 auto !important; width: auto !important; padding-inline: 12px !important; }
  html body .kft-ctl-export-label { color: var(--kft-floodlight); white-space: nowrap; }
  html body .kft-ctl-ticker .kft-dl-arrow { position: static !important; width: 12px !important; height: 14px !important; transform: none !important; }
  html body .kft-ctl-ticker :is(.kft-dl-tray, .kft-dl-tip) { display: none !important; }
  html body .kft-ctl-ticker .ticker-sort-state { font: 400 11px/1.4 var(--kft-body) !important; color: var(--kft-muted) !important; }
  html body .kft-ctl-bar:has(> .xgi-gw-label) { align-items: center !important; }
  html body #plannerTicker .kft-controls { padding: 0 !important; }
  html body #plannerTicker :is(.kft-row, .kft-row-left) { width: 100% !important; }
  html body #plannerTicker .kft-hint:has(.kft-status:empty) { display: none; }

  /* A planner has five or six live stats; let the grid follow the content. */
  html body.kft-page-planner #planCard .chips-row.kft-ctl-planner { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto auto auto !important; align-items: start !important; gap: 16px !important; padding: 16px !important; }
  html body.kft-page-planner:not(.planner-has-squad) #planCard .chips-row.kft-ctl-planner { display: none !important; }
  html body.kft-page-planner #planCard .chips-row.kft-ctl-planner > :is(.kft-dock-sep, .kft-dock-ctrl-label) { display: none !important; }
  html body .kft-ctl-stats { display: flex !important; flex-wrap: wrap; gap: 12px; height: auto !important; min-height: 0 !important; flex: none !important; align-items: flex-start; }
  html body.kft-page-planner #planCard .kft-ctl-stats .kft-dock-ctrl-block { height: auto !important; min-height: 0 !important; align-self: start !important; flex: 1 1 120px !important; }
  html body.kft-page-planner #planCard .kft-ctl-stats .kft-dock-ctrl-block { display: flex !important; flex-direction: column !important; align-items: flex-start !important; justify-content: space-between !important; gap: 8px !important; padding: 0 !important; border: 0 !important; background: transparent !important; grid-column: auto !important; min-width: 0 !important; margin: 0 !important; }
  html body.kft-page-planner #planCard .kft-ctl-stats :is(.budget-pill, .cost-pill) { padding: 0 !important; border: 0 !important; background: transparent !important; font-size: 16px !important; line-height: 44px !important; }
  html body.kft-page-planner #planCard .kft-ctl-stats .step-btn { width: 44px !important; min-width: 44px !important; padding: 0 !important; }
  html body .kft-ctl-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  html body.kft-page-planner #planCard .chips-row.kft-ctl-planner :is(.chip-badge, .planner-dock-action) { grid-column: auto !important; min-width: 0 !important; width: auto !important; margin: 0 !important; padding-inline: 12px !important; }
  html body.kft-page-planner #planCard .kft-ctl-chips .chip-badge { width: 100% !important; }
  html body.kft-page-planner #planCard .kft-ctl-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html body #hero .planner-entry-input-row { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; align-items: end !important; }
  html body #hero .planner-entry-input-row > .gw-select-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
  html body #hero .planner-entry-input-row :is(.kft-team-input-scope, .gw-input) { width: 100% !important; max-width: none !important; min-width: 0 !important; margin: 0 !important; }
  html body #hero .planner-entry-input-row .kft-team-input-scope { gap: 6px; }
  html body #hero .planner-entry-input-row > button { margin: 0 !important; }
  html body.kft-page-planner .planner-entry-method { gap: 12px !important; }
  html body.kft-page-profile .graph-toolbar { gap: 12px !important; }
  html body.kft-page-planner #planCard .kft-ctl-stats .kft-dock-ctrl-block:is([hidden], [style*="display:none"], [style*="display: none"]) { display: none !important; }

  /* Gameweek navigation and its live deadline read as one calm status row. */
  html body .kft-ctl-gameweek {
    display: grid !important;
    grid-template-columns: 44px auto 44px auto !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html body .kft-ctl-gameweek:not(:has(button)) { grid-template-columns: auto auto !important; }
  html body .kft-ctl-gameweek .xgi-gw-label {
    padding: 0 8px !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    color: var(--kft-floodlight) !important;
    font: 650 16px/1.4 var(--kft-body) !important;
    text-align: center !important;
    letter-spacing: 0 !important;
    background: transparent !important;
    border: 0 !important;
    transform: none !important;
  }
  html body .kft-ctl-gameweek :is(.xgi-gw-btn, .gw-nav-btn) {
    display: inline-grid !important;
    place-items: center !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    font: 500 20px/1 var(--kft-body) !important;
    color: var(--kft-floodlight) !important;
    border: 1px solid var(--kft-match-line-strong) !important;
    background: var(--kft-stand) !important;
    transform: none !important;
  }
  html body .kft-ctl-deadline { display: flex !important; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
  html body .kft-ctl-deadline-label { color: var(--kft-muted) !important; font: 500 12px/1.5 var(--kft-body) !important; white-space: nowrap; }
  html body .kft-ctl-deadline:has(.xgi-deadline:empty) { display: none !important; }
  html body .kft-ctl-gameweek :is(.xgi-deadline, .deadline-timer, .kft-dclock) {
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    color: var(--kft-floodlight) !important;
    font: 500 13px/1.5 var(--kft-body) !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: 0 !important;
    animation: none !important;
    gap: 3px !important;
  }
  html body .kft-ctl-gameweek .kft-dc-col { opacity: .5 !important; animation: none !important; }
  html body .kft-ctl-gameweek .kft-dclock.is-soon { color: #e9c17d !important; }
  html body .kft-ctl-gameweek .kft-dclock.is-urgent { color: #ffabb3 !important; }
  html body .kft-ctl-gameweek .kft-dclock.is-expired { color: var(--kft-muted) !important; }

  /* A name column has a reading width, independent of the metric headings. */
  html body.kft-page-analytics [data-scatter] .kft-compare-table-wrap { padding: 0 16px 14px !important; overflow-x: auto !important; }
  html body.kft-page-analytics [data-scatter] .kft-compare-table { min-width: 520px !important; table-layout: auto !important; }
  html body.kft-page-analytics [data-scatter] .kft-compare-table :is(th, td) { padding: 12px !important; font: 500 14px/1.5 var(--kft-body) !important; font-variant-numeric: tabular-nums; }
  html body.kft-page-analytics [data-scatter] .kft-compare-table th { font-size: 12px !important; color: var(--kft-muted) !important; text-transform: none !important; letter-spacing: 0 !important; }
  html body.kft-page-analytics [data-scatter] .kft-compare-table :is(th, td):first-child {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    text-align: left !important;
    position: static !important;
  }
  html body.kft-page-analytics [data-scatter] .kft-player-with-kit { display: flex !important; align-items: center !important; gap: 8px !important; min-width: 0 !important; }
  html body.kft-page-analytics [data-scatter] .kft-player-with-kit > span:last-child { font: 600 14px/1.5 var(--kft-body) !important; min-width: 0 !important; }
  html body.kft-page-analytics [data-scatter] .kft-compare-kit { flex: 0 0 22px !important; margin: 0 !important; }
  /* One line each for name and club, so every row is the same height; a long name ends in an ellipsis. */
  html body.kft-page-analytics :is(.xgi-player-name, .brk-player-name, .proj-player-name, .proj-player-copy > strong, .kft-map-player-name) { font: 600 14px/1.4 var(--kft-body) !important; }
  html body.kft-page-analytics :is(.xgi-player-team, .brk-player-team, .proj-player-team, .proj-player-copy > span, .kft-map-player-team) { font: 450 12px/1.5 var(--kft-body) !important; color: var(--kft-muted) !important; }
  html body.kft-page-analytics :is(.proj-player-copy, .kft-map-player-copy) { display: flex !important; flex: 1 1 0 !important; flex-direction: column !important; gap: 2px !important; min-width: 0 !important; max-width: 100% !important; }
  html body.kft-page-analytics :is(.xgi-player-name, .brk-player-name, .xgi-player-team, .brk-player-team, .proj-player-copy > *, .kft-map-player-copy > *) { display: block !important; max-width: 100% !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; word-break: normal !important; overflow-wrap: normal !important; }
  html body.kft-page-analytics .proj-player-cell { min-width: 0 !important; overflow: hidden !important; }
  html body.kft-page-planner .manual-player-sub { white-space: normal !important; overflow-wrap: break-word !important; }
  html body.kft-page-analytics [data-scatter] :is(.kft-scatter-status, .kft-compare-caption, .kft-scatter-help) { font: 450 13px/1.6 var(--kft-body) !important; }
  html body.kft-page-analytics [data-scatter] .kft-compare-caption { margin: 0 !important; padding: 12px 16px !important; white-space: normal !important; text-align: left !important; }
  html body :is(.xgi-page-btn, .brk-page-btn) { min-height: 44px !important; padding: 8px 14px !important; font: 550 14px/1.4 var(--kft-body) !important; }

  @media (max-width: 640px) {
    html body.kft-page-analytics [data-scatter] .kft-compare-table { min-width: 400px !important; }
    html body.kft-page-analytics [data-scatter] .kft-compare-table :is(th, td) { padding-inline: 8px !important; white-space: normal !important; }
    html body :is(.xgi-pagination, .brk-pagination):not([hidden]):not([style*="display:none"]):not([style*="display: none"]) {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 12px !important;
    }
    html body :is(.xgi-pagination, .brk-pagination) :is(.xgi-page-info, .brk-page-info) { grid-column: 1 / -1; grid-row: 1; font: 500 12px/1.5 var(--kft-body) !important; white-space: normal !important; text-align: center !important; }
    html body :is(.xgi-pagination, .brk-pagination) :is(.xgi-page-btn, .brk-page-btn) { grid-row: 2; width: 100% !important; min-width: 0 !important; white-space: nowrap !important; }
    html body #navBrand > span:first-of-type { flex: 1 1 auto !important; min-width: 0 !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
    html body #navBrand :is(picture, .nav-brand-caret) { flex-shrink: 0 !important; }
    html body.kft-page-analytics [data-scatter] .kft-ctl-bar:has(.kft-ctl-gameweek) > .kft-field { flex: 1 1 100% !important; order: 1; }
    html body.kft-page-analytics [data-scatter] :is([data-scatter-hide-gw], [data-scatter-restore-gw]) { order: 2; }
    html body.kft-page-analytics [data-scatter] .kft-compare-caption { max-width: calc(100vw - 100px) !important; white-space: normal !important; }
    html body .kft-ctl-gameweek {
      flex: 1 1 100% !important;
      width: 100% !important;
      grid-template-columns: 44px minmax(0, 1fr) 44px !important;
      gap: 8px !important;
    }
    html body .kft-ctl-gameweek:not(:has(button)) { grid-template-columns: minmax(0, 1fr) !important; }
    html body .kft-ctl-deadline { grid-column: 1 / -1; }
    html body .kft-ctl-bar {
      display: flex !important;
      flex-wrap: wrap !important;
      align-items: flex-end !important;
      gap: 12px !important;
      padding: 12px !important;
      height: auto !important;
      overflow: visible !important;
    }
    html body .kft-ctl-bar .kft-dock-sep { display: none !important; }

    /* Segmented switches span the panel, segments share it equally. */
    html body .kft-ctl-bar .kft-ticker-metric-switch,
    html body .kft-ctl-bar .xgi-pos-filter {
      display: flex !important;
      flex: 1 1 100% !important;
      width: 100% !important;
      gap: 6px !important;
      margin: 0 !important;
    }
    html body .kft-ctl-bar .kft-ticker-metric-switch > *,
    html body .kft-ctl-bar .xgi-pos-filter > * {
      flex: 1 1 auto !important;
      white-space: nowrap !important;
      min-width: 0 !important;
      justify-content: center !important;
      text-align: center !important;
    }

    /* Fields: a small label above its control. */
    html body .kft-ctl-bar .kft-field {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      flex: 1 1 140px;
      gap: 5px;
      align-items: stretch;
    }
    html body .kft-ctl-bar .kft-field-wide { flex-basis: 100%; }
    html body .kft-ctl-bar .kft-field > :is(.kft-compare-range-label, .kft-rot-field-label):first-child,
    html body .kft-ctl-bar .kft-ticker-visible-range label {
      margin: 0 !important;
      font-size: 12px !important;
      font-weight: 550 !important;
      letter-spacing: 0 !important;
      text-transform: none !important;
      color: var(--text-muted, #adb3af) !important;
      text-align: left !important;
    }
    html body .kft-ctl-bar .kft-field > :is(select, input) { width: 100% !important; min-width: 0 !important; }
    html body .kft-ctl-bar .kft-field-range { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
    html body .kft-ctl-bar .kft-field-range > :first-child { grid-column: 1 / -1; }
    html body .kft-ctl-bar .kft-field-range > .kft-compare-range-label:not(:first-child) { margin: 0 !important; font-size: 12px !important; }

    /* Gameweek range: two equal fields, no extra frame. */
    html body .kft-ctl-bar .kft-ticker-visible-range {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      flex: 1 1 100% !important;
      gap: 12px !important;
      margin: 0 !important;
      padding: 0 !important;
      border: 0 !important;
      background: none !important;
      box-shadow: none !important;
    }
    html body .kft-ctl-bar .kft-ticker-visible-range > span { display: none !important; }
    html body .kft-ctl-bar .kft-ticker-visible-range label {
      display: grid !important;
      gap: 5px !important;
      min-width: 0 !important;
    }
    html body .kft-ctl-bar .kft-ticker-visible-range select { width: 100% !important; min-width: 0 !important; }

    html body .kft-ctl-bar .kft-rot-field { flex: 1 1 100% !important; justify-content: flex-start !important; margin: 0 !important; }
    html body .kft-ctl-bar .kft-dock-search { flex: 1 1 150px !important; min-width: 0 !important; width: auto !important; }
    html body .kft-ctl-bar .kft-dl-btn { margin-left: auto !important; }
    html body .kft-ctl-bar .ticker-sort-state { flex: 1 1 100%; order: 50; margin: 0 !important; text-align: left !important; }

    /* Folded map filters. */
    html body .kft-ctl-bar .kft-ctl-toggle {
      display: inline-flex !important;
      align-items: center;
      gap: 6px;
    }
    html body .kft-ctl-bar .kft-ctl-count:empty { display: none; }
    html body .kft-ctl-bar .kft-ctl-count {
      display: inline-grid;
      place-items: center;
      min-width: 18px;
      height: 18px;
      padding: 0 5px;
      border-radius: 9px;
      background: var(--accent-primary, #e36169);
      color: #fff;
      font-size: 11px;
      font-weight: 800;
    }
    html body .kft-ctl-bar .kft-ctl-drawer { display: none; }
    html body .kft-ctl-bar.is-open .kft-ctl-drawer {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-end;
      gap: 12px;
      flex: 1 1 100%;
      order: 60;
      padding-top: 10px;
      border-top: 1px solid var(--border, #313736);
    }
    html body .kft-ctl-bar.is-open .kft-ctl-toggle { border-color: var(--accent-primary, #e36169) !important; }

    /* Ticker: the measure switch leads, actions follow, then the range. */
    html body .kft-ctl-bar.kft-ctl-ticker { grid-template-columns: minmax(0, 1fr) !important; }
    html body .kft-ctl-ticker .kft-ctl-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html body .kft-ctl-ticker .kft-ctl-actions > button:not(.kft-dl-btn) { width: 100% !important; }
    html body .kft-ctl-ticker .ticker-sort-state { grid-column: 1 / -1; flex-basis: auto !important; }
    html body .kft-ctl-ticker .kft-dl-btn { width: 100% !important; }
    html body .kft-ctl-ticker .kft-ctl-actions > button:nth-last-child(2):nth-child(odd) { grid-column: 1 / -1; }
    html body .kft-ctl-ticker .kft-ticker-visible-range { order: 0 !important; }
    html body #hero .planner-entry-input-row { grid-template-columns: minmax(0, 1fr) !important; }
    html body .kft-ctl-bar .kft-dock-search { flex-basis: 100% !important; max-width: none !important; }
    html body .kft-ctl-bar :is(.kft-dock-search, .kft-field select, .kft-ticker-visible-range select) { font-size: 16px !important; }
    /* Search, then Sort and Filter as halves, then the icon actions share one row. */
    html body .kft-ctl-bar .brk-menu-wrap { flex: 1 1 calc(50% - 6px); min-width: 0; }
    html body .kft-ctl-bar > :is(.kft-dock-item, .kft-dl-btn) { flex: 1 1 0 !important; min-width: 44px !important; margin-left: 0 !important; }
    html body .kft-ctl-bar .brk-menu-wrap > button { width: 100%; }
    html body.kft-page-planner #planCard .kft-ctl-stats .kft-dock-ctrl-block { flex: 1 1 calc(50% - 6px) !important; }
    html body.kft-page-planner #planCard .kft-ctl-stats > .kft-dock-ctrl-block:first-child { flex-basis: 100% !important; }
    html body.kft-page-planner #planCard .kft-ctl-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html body.kft-page-planner #planCard .chips-row.kft-ctl-planner .kft-ctl-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  }
}

/*
 * Control panels read as toolbars: one solid surface a step lighter than the
 * page, a hairline border and top highlight, solid buttons, grouped switches as
 * segmented controls, and a flat red for whatever is switched on.
 * Colour only: sizes and layout stay as above.
 */
@layer kft-studio {
  html body :is(.kft-ctl-bar, .kft-dock-bar):not(.kft-compare-head-actions),
  html body .kft-rot-picks {
    background: #1f2423 !important;
    border: 1px solid #3a4240 !important;
    border-radius: 10px !important;
    padding: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.4) !important;
  }
  html body .kft-ctl-bar :is(.kft-compare-range-label, .kft-rot-field-label, .kft-rot-field, .kft-ticker-visible-range label) { color: #c4cbc6 !important; }
  html body :is(.kft-ctl-bar, .kft-dock-bar, .kft-team-view) :is(.kft-dock-item, .kft-btn):not(.kft-btn-primary) {
    background: #2a302f !important;
    border: 1px solid #4a5350 !important;
    border-radius: 8px !important;
    color: #f0f1ed !important;
    font-weight: 600 !important;
    box-shadow: none !important;
  }
  html body :is(.kft-ctl-bar, .kft-dock-bar, .kft-team-view) :is(.kft-dock-item, .kft-btn):not(.kft-btn-primary):not(:disabled):hover { background: #323937 !important; border-color: #5f6a66 !important; }
  /* Grouped choices sit in one recessed track, like a segmented control. */
  html body :is(.kft-ctl-bar, .kft-dock-bar) .kft-ticker-metric-switch {
    padding: 3px !important;
    gap: 3px !important;
    background: #141817 !important;
    border: 1px solid #3a4240 !important;
    border-radius: 10px !important;
  }
  html body :is(.kft-ctl-bar, .kft-dock-bar) .kft-ticker-metric-switch > :is(.kft-dock-item, .kft-btn):not(.kft-btn-primary) { background: transparent !important; border-color: transparent !important; color: #c4cbc6 !important; }
  html body :is(.kft-ctl-bar, .kft-dock-bar) .kft-ticker-metric-switch > :is(.kft-dock-item, .kft-btn):not(.kft-btn-primary):not(:disabled):hover { background: #2a302f !important; color: #f0f1ed !important; }
  html body :is(.kft-ctl-bar, .kft-dock-bar, .kft-team-view) :is(.kft-dock-item, .kft-btn):is([aria-pressed="true"], .active, .chip-active):not(:disabled),
  html body :is(.kft-ctl-bar, .kft-dock-bar) .kft-ticker-metric-switch > :is(.kft-dock-item, .kft-btn)[aria-pressed="true"] {
    background: var(--studio-action, #b82e41) !important;
    border-color: var(--studio-action, #b82e41) !important;
    color: #ffffff !important;
  }
  html body :is(.kft-ctl-bar, .kft-dock-bar) .plan-btn-warn:not(:disabled) { color: #f07a85 !important; }
  /* Profile chart headers are toolbars too: same surface, same buttons. */
  html body .graph-toolbar { background: #1f2423 !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important; }
  html body :is(.control-btn, .compare-btn):not(.primary):not(.active):not([aria-pressed="true"]) { background: #2a302f !important; border: 1px solid #4a5350 !important; color: #f0f1ed !important; }
  html body :is(.control-btn, .compare-btn):not(.primary):not(.active):not([aria-pressed="true"]):not(:disabled):hover { background: #323937 !important; border-color: #5f6a66 !important; }
  html body :is(.control-btn.primary, .control-btn.active, .control-btn[aria-pressed="true"]) { background: var(--studio-action, #b82e41) !important; border-color: var(--studio-action, #b82e41) !important; color: #ffffff !important; }
  /* Rotation Finder's picks are part of its controls: same toolbar, full width. */
  html body .kft-rot-picks { max-width: none !important; margin: 0 0 6px !important; }
  html body .kft-rot-picks select { background-color: #141817 !important; border: 1px solid #4a5350 !important; color: #f0f1ed !important; }
  html body :is(.kft-ctl-bar, .kft-dock-bar) :is(select, .kft-dock-search, .kft-dock-price-input) { background-color: #141817 !important; border: 1px solid #4a5350 !important; border-radius: 8px !important; color: #f0f1ed !important; }
  html body :is(.kft-ctl-bar, .kft-dock-bar) :is(select, .kft-dock-search, .kft-dock-price-input):hover { border-color: #5f6a66 !important; }
  html body :is(.kft-ctl-bar, .kft-dock-bar) :is(select, .kft-dock-search, .kft-dock-price-input):focus-visible { border-color: #e36169 !important; }
}
