.online-league-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.online-league-view-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.online-league-view-tabs button {
  min-width: 170px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
}

.online-league-view-tabs button.active {
  border-bottom-color: #f0be46;
  color: #fff;
  background: rgba(240, 190, 70, 0.08);
}

.online-league-view {
  min-height: 0;
  overflow: auto;
}

.online-league-builder-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.online-league-sidebar,
.online-league-detail,
.online-league-block,
.online-league-editor,
.online-league-toolbar {
  display: grid;
  gap: 12px;
}

.online-league-sidebar,
.online-league-detail {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.online-league-sidebar,
.online-league-block {
  align-content: start;
  grid-auto-rows: max-content;
}

.online-league-block,
.online-league-editor,
.online-league-toolbar,
.online-league-detail {
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.online-league-import-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(420px, 1.35fr);
  gap: 14px 24px;
  align-items: end;
}

.online-league-import-card h2,
.online-league-library-head h2,
.online-league-section-head h2 {
  margin: 0 0 4px;
}

.online-league-import-card p,
.online-league-library-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
}

.online-league-import-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.online-league-import-controls label,
.online-league-export-field label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.online-league-import-card .root-status {
  grid-column: 1 / -1;
}

.online-league-library-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin: 22px 0 10px;
}

.online-league-library-head > span {
  color: rgba(255, 255, 255, 0.64);
  white-space: nowrap;
}

.online-league-installed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.online-league-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.online-league-list-item,
.online-league-installed {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
}

.online-league-list-item.active {
  border-color: rgba(240, 190, 70, 0.85);
  background: rgba(240, 190, 70, 0.12);
}

.online-league-installed {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-content: start;
  padding: 12px;
}

.online-league-installed.is-expanded {
  border-color: rgba(255, 255, 255, 0.22);
}

.online-league-installed.is-active {
  border-left: 3px solid #74d18a;
}

.online-league-installed.is-partial {
  border-left: 3px solid #f0be46;
}

.online-league-item-copy,
.online-league-item-copy strong,
.online-league-item-copy span,
.online-league-item-copy small,
.online-league-installed span,
.online-league-installed small,
.online-league-empty {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
}

.online-league-empty-card {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  text-align: center;
}

.online-league-item-copy {
  display: grid;
  gap: 4px;
}

.online-league-item-copy strong {
  color: #fff;
  font-size: 1rem;
}

.online-league-installed-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  gap: 8px;
  align-self: center;
}

.online-league-installed-actions button {
  min-width: 104px;
}

.online-league-installed-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  padding: 9px 2px 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  font-size: 0.82rem;
}

.online-league-installed-toggle:hover,
.online-league-installed-toggle:focus-visible {
  background: transparent;
  color: #fff;
}

.online-league-installed-toggle-icon {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 120ms ease;
  margin: -4px 5px 0 12px;
}

.online-league-installed-toggle[aria-expanded="true"] .online-league-installed-toggle-icon {
  transform: rotate(225deg);
  margin-top: 4px;
}

.online-league-installed-detail-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  min-width: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.online-league-installed-detail-panel[hidden] {
  display: none;
}

.online-league-installed-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.online-league-installed-detail-head strong {
  color: #fff;
  font-size: 0.92rem;
}

.online-league-installed-detail-head span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
}

.online-league-installed-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 520px;
}

.online-league-installed-facts span {
  display: grid;
  gap: 2px;
  white-space: normal;
  padding: 6px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  font-size: 0.72rem;
}

.online-league-installed-facts strong {
  color: #fff;
  font-size: 0.95rem;
}

.online-league-installed-livery-scroll {
  max-height: 468px;
  min-width: 0;
  overflow: auto;
  padding-right: 4px;
}

.online-league-installed-livery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 8px;
}

.online-league-installed-livery {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  min-height: 106px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.online-league-installed-livery-thumb {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0c0f14;
}

.online-league-installed-livery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.online-league-installed-livery-thumb span {
  padding: 6px;
  color: rgba(255, 255, 255, 0.42);
  white-space: normal;
  text-align: center;
  font-size: 0.62rem;
  text-transform: uppercase;
}

.online-league-installed-livery-copy {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.online-league-installed-livery-copy > span,
.online-league-installed-livery-copy > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-league-installed-livery-copy > span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8rem;
}

.online-league-installed-livery-copy > small {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
}

.online-league-installed-livery-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.online-league-installed-livery-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.online-league-installed-livery-title strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.online-league-installed-livery-state {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.64rem;
  line-height: 1.2;
}

.online-league-installed-livery-state.is-active {
  border-color: rgba(116, 209, 138, 0.46);
  color: #92e4a5;
}

.online-league-installed-livery-state.is-reused {
  border-color: rgba(240, 190, 70, 0.46);
  color: #f0c968;
}

.online-league-advanced summary {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
}

.online-league-pack-mark {
  display: grid;
  place-items: center;
  width: 52px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0c0f14;
  color: #fff;
  overflow: hidden;
}

.online-league-pack-mark.is-large {
  width: min(100%, 132px);
}

.online-league-pack-mark img,
.online-league-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.online-league-pack-mark span {
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.online-league-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.online-league-section-head > div {
  min-width: 0;
}

.online-league-section-head span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

.online-league-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.online-league-detail-head h2 {
  margin: 6px 0 4px;
}

.online-league-detail-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.online-league-summary {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  text-align: right;
}

.online-league-save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.online-league-save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  white-space: nowrap;
}

.online-league-save-state::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #74d18a;
}

.online-league-save-state.is-dirty {
  color: #f0be46;
}

.online-league-save-state.is-dirty::before {
  background: #f0be46;
}

.online-league-editor {
  grid-template-columns: minmax(160px, 190px) minmax(0, 1fr);
  align-items: start;
}

.online-league-editor-main {
  display: grid;
  gap: 12px;
}

.online-league-export-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.online-league-export-field button {
  min-width: 150px;
}

.online-league-advanced {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 10px;
}

.online-league-advanced .online-league-export-field {
  margin-top: 10px;
}

.online-league-preview-box {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.online-league-preview-stage {
  display: grid;
  place-items: center;
  min-height: 116px;
}

.online-league-preview-box button {
  width: 100%;
}

.online-league-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.online-league-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.online-league-toolbar-copy {
  display: grid;
  gap: 3px;
}

.online-league-toolbar-copy span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.82rem;
}

.online-league-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
}

.online-league-entry-list {
  display: grid;
  gap: 10px;
}

.online-league-entry {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.online-league-entry.is-ready {
  border-left: 3px solid #74d18a;
}

.online-league-entry.is-warning {
  border-left: 3px solid #f0be46;
}

.online-league-entry.is-error {
  border-left: 3px solid #ff766d;
}

.online-league-thumb {
  position: relative;
  width: 64px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.online-league-entry-media {
  display: grid;
  gap: 6px;
  width: 64px;
}

.online-league-entry-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.online-league-entry-copy strong,
.online-league-entry-copy span,
.online-league-entry-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-league-entry-copy span,
.online-league-entry-copy small {
  color: rgba(255, 255, 255, 0.64);
}

.online-league-entry-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.online-league-entry-editor[hidden] {
  display: none;
}

.online-league-entry-fields {
  display: grid;
  grid-template-columns: 70px repeat(5, minmax(110px, 1fr));
  gap: 8px;
}

.online-league-entry-fields label {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.68);
}

.online-league-entry-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.online-league-entry-side {
  display: grid;
  gap: 8px;
  align-self: start;
}

.online-league-entry-status {
  display: inline-grid;
  place-items: center;
  width: 100%;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-transform: uppercase;
  font-size: 0.68rem;
}

.online-league-entry-status.is-ready {
  color: #74d18a;
}

.online-league-entry-status.is-warning {
  color: #f0be46;
}

.online-league-entry-status.is-error {
  color: #ff766d;
}

.online-league-entry-issues {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
}

@media (max-width: 1280px) {
  .online-league-builder-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .online-league-import-card {
    grid-template-columns: 1fr;
  }

  .online-league-import-card .root-status {
    grid-column: 1;
  }

  .online-league-entry-fields {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }
}
