/* Base layout and legacy race board styles; race-ui.css layers the Pit Wall design on top. */
:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  color: #f4f5f6;
  background: #101319;
  font-size: 16px;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.shell {
  max-width: 1160px;
  margin: auto;
  padding: 18px 20px 60px;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #323943;
  padding: 5px 0 17px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 850;
  letter-spacing: 0.055em;
  font-size: 1.15rem;
}
.mark {
  width: 30px;
  height: 30px;
  border: 4px solid #ed333b;
  border-left-color: transparent;
  transform: rotate(-30deg);
  border-radius: 50%;
}
.small {
  color: #aeb5bd;
  font-size: 0.88rem;
}
.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
h1 {
  font-size: 1.55rem;
  line-height: 1.18;
  margin: 0;
}
h2 {
  font-size: 1.15rem;
  margin: 0;
}
h3 {
  font-size: 1rem;
  margin: 0;
}
.muted {
  color: #aeb5bd;
}
.strong {
  font-weight: 750;
}
.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid #4a535e;
  background: #242a32;
  color: #f8fafb;
  border-radius: 10px;
  padding: 11px 14px;
  min-height: 44px;
  font-weight: 650;
}
.btn:hover {
  background: #313944;
}
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #f56469;
  outline-offset: 2px;
}
.btn.red {
  background: #ed333b;
  border-color: #ed333b;
  color: white;
}
.btn.red:hover {
  background: #cc2730;
}
.btn.subtle {
  background: transparent;
}
.btn.smallbtn {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 0.86rem;
}
.btn.danger {
  border-color: #903c42;
  color: #ffaaaa;
}
.wrap {
  display: grid;
  gap: 18px;
}
.card {
  background: #1a1f26;
  border: 1px solid #333b45;
  border-radius: 16px;
  padding: 18px;
}
.setup {
  max-width: 760px;
  margin: 30px auto;
}
.setup-header {
  margin-bottom: 22px;
}
.setup-header p {
  margin: 8px 0 0;
  line-height: 1.4;
}
.fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label {
  font-size: 0.88rem;
  color: #d1d6dc;
  font-weight: 700;
}
.field input,
.field textarea,
.field select {
  border: 1px solid #505963;
  background: #11161d;
  color: white;
  border-radius: 9px;
  padding: 11px 12px;
  min-height: 44px;
  width: 100%;
}
.field textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.4;
}
.help {
  font-size: 0.84rem;
  color: #aeb5bd;
  line-height: 1.45;
  margin: 6px 0 0;
}
.error {
  color: #ffb0b3;
  font-size: 0.9rem;
  margin: 12px 0;
}
.divider {
  height: 1px;
  background: #353d45;
  margin: 20px 0;
}
.setup-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.race-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 24px 0;
}
.race-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #4a535e;
  border-radius: 999px;
  padding: 5px 9px;
  color: #d1d6dc;
  font-size: 0.83rem;
}
.clock {
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.clockbox {
  text-align: right;
}
.clockbox .small {
  margin-top: 2px;
}
.section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
}
.team-list {
  display: grid;
  gap: 11px;
}
.team {
  background: #222933;
  border: 1px solid #414b56;
  border-radius: 13px;
  padding: 15px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}
.team.warn {
  border-color: #eab650;
  background: #312a21;
}
.team.over {
  border-color: #ed555b;
  background: #372226;
}
.team-name {
  font-size: 1.05rem;
  font-weight: 800;
}
.kart-number {
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: #ff7378;
}
.stint {
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: right;
}
.quality {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.quality.good {
  color: #6ad698;
}
.quality.bad {
  color: #ff8085;
}
.quality.neutral {
  color: #eac66a;
}
.kart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid #444c57;
  background: #232a33;
  border-radius: 10px;
  padding: 10px 11px;
}
.kart-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex-wrap: wrap;
}
.kart-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}
.kart-actions .btn {
  min-width: 36px;
  padding: 5px 7px;
}
.kart-note {
  color: #abb3bc;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.empty {
  color: #abb3bc;
  padding: 12px 0;
}
.footer-actions {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #353d45;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.log {
  margin-top: 18px;
}
.log-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid #303842;
  color: #d5d9df;
  font-size: 0.88rem;
}
.log-row time {
  color: #aeb5bd;
  font-variant-numeric: tabular-nums;
}
.note {
  margin-top: 14px;
  color: #aeb5bd;
  font-size: 0.83rem;
  line-height: 1.4;
}
dialog {
  background: #1b222b;
  color: #f4f5f6;
  border: 1px solid #5b6572;
  border-radius: 16px;
  padding: 0;
  width: min(450px, calc(100vw - 28px));
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overflow-x: hidden;
}
dialog::backdrop {
  background: rgba(2, 5, 9, 0.77);
}
.modal {
  padding: 22px;
  min-width: 0;
}
.modal h2 {
  overflow-wrap: anywhere;
}
.modal input,
.modal select {
  min-width: 0;
  max-width: 100%;
}
.modal h2 {
  margin-bottom: 17px;
}
.modal .field {
  margin: 13px 0;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
.modal-actions .btn {
  flex: 1 1 135px;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.modal .toolbar {
  flex-wrap: wrap;
}
.modal .toolbar .btn {
  max-width: 100%;
  white-space: normal;
}
.team-position {
  font-size: 0.8em;
  color: #b2d4ee;
}
.timing-kart {
  font: inherit;
  font-weight: 800;
  color: #98d9ff;
  background: #14212d;
  border: 1px solid #6b94b1;
  border-radius: 6px;
  min-height: 36px;
  padding: 3px 9px;
  cursor: pointer;
}
.timing-actions {
  flex-wrap: wrap;
}
@media (max-width: 420px) {
  .modal {
    padding: 16px;
  }
  .modal-actions .btn {
    flex-basis: 100%;
  }
}
.inline-choice {
  display: flex;
  gap: 9px;
  align-items: center;
}
.inline-choice input {
  width: 19px;
  height: 19px;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #e8eef3;
  color: #101319;
  border-radius: 10px;
  padding: 10px 15px;
  font-weight: 700;
  box-shadow: 0 8px 35px #0008;
  z-index: 5;
  max-width: 90vw;
}
@media (max-width: 800px) {
  .race-head {
    grid-template-columns: 1fr;
  }
  .clockbox {
    text-align: left;
    grid-row: 2;
  }
  .fields {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .shell {
    padding: 13px 12px 45px;
  }
  .header {
    padding-bottom: 12px;
  }
  .header-right .small {
    display: none;
  }
  .setup {
    margin: 22px auto;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .race-head {
    padding: 20px 2px;
  }
  .team {
    grid-template-columns: 1fr;
  }
  .stint {
    text-align: left;
  }
  .kart {
    grid-template-columns: 1fr;
  }
  .kart-actions {
    justify-content: flex-start;
  }
  .card {
    padding: 15px;
  }
}
/* Race wall: both the pit and a 30-team grid stay in the first viewport on common phones. */
.shell {
  max-width: 1500px;
  padding: 8px 12px 28px;
}
.header {
  padding: 2px 0 7px;
}
.header .mark {
  width: 21px;
  height: 21px;
  border-width: 3px;
}
.header .brand {
  font-size: 0.9rem;
  gap: 7px;
}
.header .pill {
  font-size: 0.72rem;
  padding: 3px 7px;
}
.race-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
}
.race-head h1 {
  font-size: 1.03rem;
  max-width: 40vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.race-meta {
  margin-top: 2px;
  gap: 5px;
}
.race-meta .pill {
  border: none;
  padding: 0;
  font-size: 0.75rem;
}
.race-head .clock {
  font-size: 1.55rem;
}
.race-head .clockbox {
  grid-row: auto;
  text-align: right;
}
.race-head .clockbox .small {
  font-size: 0.7rem;
}
.race-tools {
  margin-bottom: 5px;
}
.race-tools summary {
  cursor: pointer;
  color: #b4bdc6;
  font-size: 0.78rem;
  list-style: none;
  padding: 4px 0;
}
.race-tools summary::before {
  content: '⚙ ';
  color: #eab650;
}
.race-tools .toolbar {
  padding: 5px 0;
}
.race-tools .btn {
  min-height: 35px;
  padding: 5px 9px;
  font-size: 0.8rem;
}
.race-work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(265px, 360px);
  gap: 8px;
  align-items: start;
}
.race-work .card {
  padding: 7px;
  border-radius: 10px;
}
.race-work .section-top {
  margin: 0 0 5px;
  padding: 0 2px;
}
.race-work h2 {
  font-size: 0.86rem;
}
.race-work .small {
  font-size: 0.75rem;
}
.teams-section {
  min-width: 0;
}
.team-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}
.team-tile,
.pit-kart {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #303943;
  color: #fff;
  border: 1px solid #68737d;
  border-radius: 5px;
  text-align: left;
  min-width: 0;
  box-shadow: inset 0 0 0 1px #0002;
}
.team-tile {
  height: 31px;
  width: 100%;
  padding: 3px 6px;
}
.team-tile:active,
.pit-kart:active {
  filter: brightness(1.16);
}
.team-tile:focus-visible,
.pit-kart:focus-visible {
  outline: 2px solid white;
  outline-offset: 1px;
}
.team-tile .tile-name {
  font-size: 0.82rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.team-tile .tile-kart {
  font-weight: 850;
  font-size: 0.8rem;
  white-space: nowrap;
}
.team-tile.warn {
  box-shadow: inset 0 0 0 2px #f4f6f8;
}
.team-tile.over {
  box-shadow:
    inset 0 0 0 2px #fff,
    0 0 0 1px #f44;
}
.rating-good {
  background: #156947;
  border-color: #37aa72;
}
.rating-neutral {
  background: #9c711d;
  border-color: #e9b751;
  color: #fff;
}
.rating-bad {
  background: #9b2c34;
  border-color: #e25258;
  color: #fff;
}
.rating-unknown {
  background: #303943;
  border-color: #586470;
}
.pit-lanes {
  display: grid;
  gap: 3px;
}
.pit-lane {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  min-height: 31px;
  background: #252d36;
  border: 1px solid #424d59;
  border-radius: 6px;
  padding: 2px 3px;
}
.lane-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  color: #c7cdd3;
}
.lane-karts {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.pit-kart {
  height: 26px;
  min-width: 40px;
  justify-content: center;
  padding: 2px 5px;
  font-size: 0.82rem;
  font-weight: 800;
}
.lane-empty {
  font-size: 0.76rem;
  color: #8b97a2;
}
.repair-line {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 0.76rem;
  color: #b9c1ca;
}
.repair-line button {
  padding: 2px 6px;
  min-height: 25px;
  font-size: 0.76rem;
}
.race-work + .log {
  margin-top: 9px;
}
.log {
  padding: 10px;
}
.footer-actions {
  margin-top: 8px;
  padding-top: 8px;
}
.footer-actions .btn {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 0.8rem;
}
.note {
  margin: 7px 0;
}
.modal .field {
  margin: 10px 0;
}
@media (max-width: 950px) {
  .race-work {
    grid-template-columns: 1fr;
  }
  .pit-section {
    order: -1;
  }
  .team-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .team-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .race-head .clock {
    font-size: 1.3rem;
  }
  .race-head h1 {
    max-width: 51vw;
  }
  .header .header-right .small {
    display: none;
  }
  .team-tile {
    height: 30px;
    padding: 2px 4px;
  }
  .team-tile .tile-name {
    font-size: 0.79rem;
  }
  .race-work .card {
    padding: 5px;
  }
  .race-work .section-top {
    margin-bottom: 3px;
  }
}
@media (max-width: 650px) and (max-height: 950px) {
  .shell {
    padding-top: 4px;
  }
  .header {
    padding-bottom: 3px;
  }
  .race-head {
    padding: 5px 0;
  }
  .team-list,
  .pit-lanes {
    gap: 2px;
  }
  .team-tile {
    height: 27px;
  }
  .team-tile .tile-name {
    font-size: 0.76rem;
  }
  .team-tile .tile-kart {
    font-size: 0.72rem;
  }
  .pit-lane {
    min-height: 27px;
  }
  .pit-kart {
    height: 22px;
  }
  .race-work .section-top {
    margin-bottom: 2px;
  }
  .race-work .card {
    padding: 4px;
  }
  .race-meta {
    margin-top: 0;
  }
  .race-tools summary {
    padding: 2px 0;
  }
}
.lane-add {
  width: 25px;
  height: 25px;
  min-width: 25px;
  padding: 0;
  border: 1px dashed #81909b;
  border-radius: 5px;
  background: #26313a;
  color: #ecf1f5;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  touch-action: manipulation;
}
.lane-add:hover {
  background: #394b58;
}
.pit-kart {
  touch-action: none;
}
.pit-kart.dragging {
  opacity: 0.4;
}
.team-tile.drop-ready {
  outline: 1px dashed #aebac4;
  outline-offset: -2px;
}
.team-tile.drop-over {
  outline: 3px solid #fff;
  outline-offset: -2px;
  filter: brightness(1.24);
}
.drag-ghost {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  background: #e7eef4;
  color: #142029;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 900;
  box-shadow: 0 6px 22px #0009;
  white-space: nowrap;
  transform: translate(13px, -12px);
}
.attention-row {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 6px;
  margin: 3px 0 7px;
}
.attention-panel {
  min-width: 0;
  background: #202831;
  border: 1px solid #515d68;
  border-radius: 8px;
  padding: 5px;
}
.attention-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: #e2e8ee;
  font-size: 0.75rem;
  font-weight: 800;
  min-height: 22px;
}
.attention-edit,
.pick-team {
  background: none;
  border: 0;
  color: #ffadb0;
  font-size: 0.72rem;
  font-weight: 700;
}
.pick-team {
  border: 1px dashed #778592;
  border-radius: 6px;
  width: 100%;
  min-height: 35px;
  margin-top: 3px;
}
.mine-panel .team-tile {
  width: 100%;
  margin-top: 2px;
}
.watch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.watch-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  column-gap: 3px;
  flex: 1 1 122px;
  max-width: 180px;
  min-width: 112px;
  min-height: 48px;
  padding: 4px 6px;
  border: 1px solid #f48470;
  border-radius: 5px;
  background: #572b2d;
  color: #fff;
  font-size: 0.75rem;
  text-align: left;
}
.watch-team.over {
  background: #9a2530;
  border-color: #fff;
}
.watch-name {
  grid-column: 1/-1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}
.watch-team strong {
  font-variant-numeric: tabular-nums;
}
.team-list {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}
.team-tile {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-content: center;
  justify-items: stretch;
  gap: 1px;
  height: 57px;
  padding: 4px 6px;
}
.team-tile .tile-name {
  width: 100%;
  font-size: 0.81rem;
}
.tile-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  min-width: 0;
}
.team-tile .tile-kart,
.team-tile .tile-stops {
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}
.team-tile.is-mine {
  outline: 2px solid #f2f6ff;
  outline-offset: -3px;
}
.team-tile.warn,
.team-tile.over {
  box-shadow: inset 0 0 0 1px #f7767a;
}
@keyframes stint-alert {
  0%,
  100% {
    background: #9d1d27;
    box-shadow: 0 0 0 #ff495000;
  }
  50% {
    background: #ff4050;
    box-shadow: 0 0 8px #ff3949;
  }
}
.pit-lane {
  align-items: start;
}
.lane-label {
  padding-top: 4px;
}
.lane-karts {
  flex-wrap: wrap;
  min-width: 0;
}
.pit-kart {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 950px) {
  .team-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .team-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .team-tile {
    height: 56px;
    padding: 4px;
  }
  .team-tile .tile-name {
    font-size: 0.76rem;
  }
  .team-tile .tile-kart,
  .team-tile .tile-stops {
    font-size: 0.7rem;
  }
  .attention-row {
    grid-template-columns: minmax(100px, 35%) minmax(0, 1fr);
  }
  .watch-team {
    min-width: 92px;
    min-height: 47px;
    font-size: 0.71rem;
  }
  .race-work .card {
    padding: 5px;
  }
}
@media (max-width: 355px) {
  .team-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.prestart {
  max-width: 920px;
}
.start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.start-team {
  min-width: 0;
  padding: 9px;
  background: #252d36;
  border: 1px solid #49545e;
  border-radius: 9px;
}
.start-team label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 750;
  margin-bottom: 6px;
}
.start-team select {
  width: 100%;
  min-height: 44px;
  background: #11161d;
  border: 1px solid #64707a;
  border-radius: 7px;
  color: #fff;
  padding: 7px;
  font-size: 0.86rem;
}
.team-number {
  color: #fff5b3;
  font-weight: 900;
}
.team-tile .tile-kart {
  font-size: 0.72rem;
}
.watch-team {
  max-width: 210px;
}
@media (max-width: 650px) {
  .start-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .start-team {
    padding: 7px;
  }
}
@media (max-width: 355px) {
  .start-grid {
    grid-template-columns: 1fr;
  }
}
/* Larger pit controls remain within each row, including on narrow phones. */
.pit-lane {
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 3px;
  padding: 4px;
}
.lane-karts {
  gap: 5px;
  flex-wrap: wrap;
}
.pit-kart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 90px;
  height: 58px;
  padding: 5px 9px;
  font-size: 1.1rem;
  line-height: 1.1;
  white-space: normal;
  overflow: visible;
}
.pit-grade {
  min-height: 17px;
  font-size: 0.83rem;
  letter-spacing: 0.1em;
  font-weight: 900;
}
.lane-add {
  width: 48px;
  height: 48px;
  min-width: 48px;
  font-size: 1.5rem;
}
.start-ratings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 12px 0 20px;
}
.start-rating {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #252d36;
  border: 1px solid #49545e;
  border-radius: 8px;
  padding: 8px;
}
.start-rating label {
  font-size: 0.85rem;
  font-weight: 750;
}
.start-rating select {
  width: 100%;
  min-height: 44px;
  background: #11161d;
  border: 1px solid #64707a;
  border-radius: 7px;
  color: #fff;
  padding: 6px;
}
@media (max-width: 650px) {
  .pit-kart {
    min-width: 84px;
    height: 55px;
  }
  .start-ratings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.pit-kart {
  min-width: 70px;
  height: 44px;
  padding: 3px 6px;
  font-size: 1rem;
}
.pit-grade {
  min-height: 0;
  font-size: 0.7rem;
  line-height: 1;
}
.lane-add {
  width: 37px;
  height: 37px;
  min-width: 37px;
  font-size: 1.25rem;
}
.mine-panel .attention-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 1px;
  min-height: 0;
}
.mine-panel .attention-edit {
  justify-self: end;
  max-width: 100%;
  padding: 2px 0;
  white-space: nowrap;
}
@media (max-width: 650px) {
  .pit-kart {
    min-width: 66px;
    height: 42px;
  }
  .attention-row {
    grid-template-columns: minmax(125px, 35%) minmax(0, 1fr);
  }
}
.team-list .team-tile,
.mine-panel .team-tile {
  touch-action: none;
}
.team-tile.dragging {
  opacity: 0.4;
}
.pit-lane.drop-ready {
  outline: 1px dashed #aebac4;
  outline-offset: -2px;
}
.pit-lane.drop-over {
  outline: 3px solid #fff;
  outline-offset: -2px;
  background: #405366;
}
.timing-panel {
  padding: 5px 9px;
  margin: 3px 0 7px;
  border-radius: 9px;
  background: #202831;
}
.timing-panel summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  color: #dce5ed;
}
.timing-panel[open] {
  padding: 9px;
}
.timing-panel .small {
  font-size: 0.73rem;
  margin: 6px 0;
}
.timing-actions {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.timing-actions .btn {
  min-height: 31px;
  padding: 4px 8px;
  font-size: 0.75rem;
}
.timing-meta {
  font-size: 0.82rem;
  font-weight: 750;
  margin: 9px 0;
}
.timing-hint {
  font-size: 0.76rem;
  color: #f3cc76;
  margin: 6px 0;
}
.timing-table {
  display: grid;
  gap: 2px;
}
.timing-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.3fr) 85px 135px minmax(130px, 1fr);
  gap: 5px;
  align-items: center;
  padding: 5px 7px;
  border-radius: 5px;
  background: #29323b;
  font-size: 0.75rem;
  min-width: 0;
}
.timing-row strong,
.timing-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.timing-row em {
  display: block;
  color: #ffb2b4;
  font-style: normal;
  font-size: 0.7rem;
}
.timing-head {
  background: #36424d;
  color: #d3dce4;
  font-weight: 750;
}
.timing-mine {
  background: #29443f;
  box-shadow: inset 0 0 0 1px #6ec6a1;
}
.timing-unmatched {
  color: #aab4bd;
}
@media (max-width: 650px) {
  .timing-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    row-gap: 2px;
    font-size: 0.74rem;
  }
  .timing-row > strong {
    grid-column: 1;
    grid-row: 1;
  }
  .timing-row > span:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }
  .timing-row > span:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }
  .timing-row > span:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
  }
  .timing-head {
    display: none;
  }
}
.roster-review {
  display: grid;
  gap: 7px;
  max-height: 52vh;
  overflow: auto;
}
.roster-row {
  display: grid;
  grid-template-columns: 76px minmax(120px, 1fr) 80px 36px;
  gap: 5px;
}
.roster-row input {
  min-width: 0;
}
.roster-source textarea {
  width: 100%;
  min-height: 120px;
  margin-top: 8px;
}
.roster-source {
  margin: 12px 0;
  color: #becbd4;
}
@media (max-width: 500px) {
  .roster-row {
    grid-template-columns: 54px minmax(75px, 1fr) 64px 30px;
    gap: 3px;
  }
  .roster-row input {
    padding: 6px 4px;
    font-size: 0.75rem;
  }
}
.stint-history {
  margin: 14px 0;
  border-top: 1px solid #4a535e;
  padding-top: 12px;
}
.stint-history summary {
  cursor: pointer;
  font-weight: 750;
}
.stint-records {
  display: grid;
  gap: 7px;
  max-height: 36vh;
  overflow: auto;
  margin: 10px 0;
}
.stint-record {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid #4a535e;
  border-radius: 8px;
  font-size: 0.82rem;
}
.stint-record span {
  color: #becbd4;
}
.pit-lane.signal-left {
  grid-template-columns: 24px 72px minmax(0, 1fr);
}
.pit-lane.signal-right {
  grid-template-columns: 24px minmax(0, 1fr) 72px;
}
.signal-right .lane-karts {
  grid-column: 2;
  grid-row: 1;
}
.signal-right .lane-signal {
  grid-column: 3;
  grid-row: 1;
}
.lane-signal {
  border: 1px solid currentColor;
  border-radius: 7px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  min-height: 40px;
  padding: 4px;
  max-width: 72px;
  width: 100%;
  white-space: normal;
}
.lane-signal.red {
  color: #ffb4b4;
  background: #6c1b27;
}
.lane-signal.green {
  color: #a5edbd;
  background: #173a29;
}
.lane-signal:disabled {
  opacity: 1;
  cursor: default;
}
.driver-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  padding: 7px 0;
  border-bottom: 1px solid #414c59;
}
.driver-total strong {
  overflow-wrap: anywhere;
}
.driver-total small {
  grid-column: 1/-1;
  color: #b5c2ce;
}
.driver-total.needs-time {
  color: #ffbd80;
}
.timing-name {
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  padding: 4px 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.timing-gaps {
  display: block;
  font-size: 0.68rem;
  color: #cee1f0;
}
.timing-laps {
  padding: 10px;
  background: #16212b;
  border: 1px solid #536b80;
  border-radius: 6px;
}
.lap-scroll {
  max-height: 260px;
  overflow: auto;
}
.lap-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 5px 0;
  border-bottom: 1px solid #364450;
  font-size: 0.76rem;
}
.lap-row small {
  grid-column: 1/-1;
}
.timing-laps .small {
  overflow-wrap: anywhere;
}
.pro-tools,
.pro-lanes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pro-board {
  margin: 16px 0;
}
.pro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}
.pro-team {
  border: 1px solid #465060;
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
}
.pro-team h3 {
  margin: 0;
  overflow-wrap: anywhere;
}
.pro-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
.pro-metrics span {
  display: block;
  color: #a9b2c0;
  font-size: 14px;
}
.pro-metrics strong {
  display: block;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.pro-lanes {
  margin-top: 12px;
}
.pro-history,
.rival-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #35404b;
}
.pro-history h3,
.pro-history p {
  margin: 0;
}
.plan-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 90px;
  gap: 8px;
  border-bottom: 1px solid #35404b;
  padding: 12px 0;
}
.plan-row input,
.plan-row select {
  min-width: 0;
  width: 100%;
}
.plan-row label {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-row label input {
  width: auto;
}
.plan-row .btn {
  min-width: 44px;
}
.plan-ok {
  color: #67e3a4;
}
.pro-team .toolbar {
  display: flex;
  flex-wrap: wrap;
}
.pro-team .btn {
  flex: 1 1 120px;
}
.pro-metrics .error {
  color: #ff9aa4;
}
#plan-result {
  margin-top: 16px;
}
.pro-board .section-top {
  flex-wrap: wrap;
}
