#tab-drivers {
  height: 100%;
}

.driver-profile-panel {
  --driver-content-height: calc(100dvh - 190px);
  gap: 16px;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

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

.driver-profile-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 14px;
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: hidden;
}

.driver-profile-rail,
.driver-profile-detail {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 0;
  border: var(--border-width) solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
  overflow: auto;
}

.driver-profile-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.driver-profile-list-actions,
.driver-profile-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.driver-profile-list-actions {
  margin-top: 10px;
}

.driver-profile-list-actions button {
  flex: 1 1 0;
}

.driver-profile-white-icon {
  color: #fff;
}

.driver-profile-white-icon .button-icon,
.driver-profile-white-icon .button-icon svg,
.driver-profile-white-icon .button-icon path {
  color: #fff;
  stroke: #fff !important;
}

.driver-profile-preview-action {
  border-color: rgba(var(--accent-2-rgb), 0.72);
  background: rgba(var(--accent-2-rgb), 0.2);
  color: #fff;
}

.driver-profile-preview-action:hover,
.driver-profile-preview-action:focus-visible {
  background: rgba(var(--accent-2-rgb), 0.3);
  color: #fff;
}

.driver-profile-create {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: var(--border-width) solid var(--line-soft);
}

.driver-profile-create label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.driver-profile-create select,
.driver-profile-create input,
.driver-profile-create button {
  width: 100%;
}

.driver-profile-status,
.driver-profile-empty,
.driver-profile-item span,
.driver-profile-item small,
.driver-profile-paths span {
  color: var(--muted);
  font-size: 13px;
}

.driver-profile-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: none;
  overflow: auto;
}

.driver-profile-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 82px;
  padding: 14px 10px;
  border: var(--border-width) solid var(--line-soft);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  overflow: hidden;
}

.driver-profile-item.active {
  border-color: var(--accent);
  background: rgba(23, 195, 178, 0.08);
}

.driver-profile-mark {
  align-self: center;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  min-height: 52px;
  justify-self: start;
  aspect-ratio: 1 / 1;
  border: var(--border-width) solid var(--line-soft);
  background: #0c0f14;
  color: #fff;
  overflow: hidden;
}

.driver-profile-mark .button-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
}

.driver-profile-mark svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.driver-profile-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.driver-profile-mark.is-large {
  width: 68px;
  height: 68px;
  min-height: 68px;
  flex: 0 0 68px;
}

.driver-profile-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.driver-profile-copy strong,
.driver-profile-copy span,
.driver-profile-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-profile-copy strong {
  color: var(--accent-3);
  font-size: 17px;
}

.driver-profile-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.driver-profile-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.driver-profile-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.driver-profile-status-pill {
  font-size: 13px;
  text-transform: none;
  white-space: nowrap;
}

.driver-profile-detail-toolbar {
  margin-top: 14px;
}

.driver-profile-paths {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin-top: 14px;
}

.driver-profile-paths code {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-profile-technical {
  margin-top: 12px;
}

.driver-profile-preview-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.driver-profile-png-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.driver-profile-png-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: var(--border-width) solid var(--line-soft);
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.driver-profile-png-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  min-width: 0;
  overflow: hidden;
  border: var(--border-width) solid var(--line-soft);
  background: #0b0f14;
}

.driver-profile-png-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.driver-profile-png-state {
  position: absolute;
  inset: auto 8px 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.driver-profile-png-frame:not(.is-missing) .driver-profile-png-state:empty {
  display: none;
}

.driver-profile-png-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.driver-profile-png-meta strong,
.driver-profile-png-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-profile-png-meta span {
  color: var(--muted);
  font-size: 13px;
}

.driver-profile-workflow-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.3fr) minmax(260px, 0.38fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
  align-items: stretch;
}

.driver-profile-team-logo-box,
.driver-profile-details-box,
.driver-profile-appearance {
  display: grid;
  gap: 10px;
  border: var(--border-width) solid var(--line-soft);
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.driver-profile-team-logo-box {
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
}

.driver-profile-team-logo-preview {
  display: grid;
  place-items: center;
  min-height: 96px;
}

.driver-profile-team-logo-preview .driver-profile-mark {
  width: min(100%, 112px);
  height: auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.driver-profile-team-logo-box button {
  width: 100%;
}

.driver-profile-details-box {
  align-content: start;
}

.driver-profile-details-box label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.driver-profile-details-box input,
.driver-profile-details-box select,
.driver-profile-details-box button {
  width: 100%;
}

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

.driver-profile-section-head span,
.driver-profile-material-meta span {
  color: var(--muted);
  font-size: 13px;
}

.driver-profile-color-list {
  display: grid;
  gap: 8px;
}

.driver-profile-color-control {
  display: grid;
  grid-template-columns: 160px minmax(140px, 220px) minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  min-width: 0;
}

.driver-profile-color-control label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.driver-profile-color-control input {
  width: 100%;
}

.driver-profile-color-control input[type="color"] {
  height: 38px;
  padding: 2px;
}

.driver-profile-appearance-actions {
  display: flex;
  justify-content: flex-end;
}

.driver-profile-material-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.driver-profile-material-meta.is-wide {
  margin-top: -2px;
}

.driver-profile-material-meta code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.driver-profile-technical summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.driver-profile-technical pre {
  margin-top: 8px;
  min-height: 150px;
  max-height: min(34dvh, 320px);
}

.driver-preview-modal[hidden] {
  display: none;
}

.driver-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  width: 100vw;
  height: 100vh;
  padding: 0;
  background: #090b0e;
}

.driver-preview-backdrop {
  display: none;
}

.driver-preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100vw;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: #090b0e;
  overflow: hidden;
}

.driver-preview-head,
.driver-preview-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border-bottom: var(--border-width) solid var(--line-soft);
  background: rgba(16, 18, 22, 0.98);
}

.driver-preview-foot {
  justify-content: space-between;
  border-top: var(--border-width) solid var(--line-soft);
  border-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.driver-preview-foot .is-error {
  color: var(--danger);
}

.driver-preview-title {
  display: grid;
  gap: 3px;
  min-width: 220px;
}

.driver-preview-title strong {
  color: #fff;
  font-size: 18px;
}

.driver-preview-title span {
  color: var(--muted);
  font-size: 13px;
}

.driver-preview-model-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.driver-preview-model-tabs button {
  min-width: 96px;
}

.driver-preview-model-tabs button.active {
  border-color: var(--accent);
  color: #fff;
  background: rgba(23, 195, 178, 0.12);
}

.driver-preview-action {
  margin-left: auto;
  min-height: 34px;
  padding: 6px 12px;
  border: var(--border-width) solid var(--accent-2-border);
  background: var(--accent-2);
  color: #fff;
  font-weight: 700;
}

.driver-preview-action:hover,
.driver-preview-action:focus-visible {
  background: var(--accent-2-hover);
  color: #fff;
}

.driver-preview-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #212121;
}

.driver-preview-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.driver-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.driver-preview-appearance-panel {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  gap: 12px;
  width: min(320px, calc(100% - 28px));
  padding: 12px;
  border: var(--border-width) solid rgba(var(--accent-2-rgb), 0.46);
  background: rgba(5, 7, 10, 0.92);
}

.driver-preview-appearance-panel[hidden] {
  display: none;
}

.driver-preview-appearance-head {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.driver-preview-appearance-head strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
}

.driver-preview-appearance-head span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.driver-preview-appearance-controls {
  display: grid;
  gap: 10px;
}

.driver-preview-color-control {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 8px;
  min-width: 0;
}

.driver-preview-color-control label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.driver-preview-color-control input {
  width: 100%;
  min-width: 0;
}

.driver-preview-color-control input[type="color"] {
  height: 34px;
  padding: 2px;
  border-color: rgba(var(--accent-2-rgb), 0.42);
  background: rgba(0, 0, 0, 0.3);
}

.driver-preview-save-appearance {
  width: 100%;
  border-color: var(--accent-2-border);
  background: var(--accent-2);
  color: #fff;
  font-weight: 700;
}

.driver-preview-save-appearance:hover,
.driver-preview-save-appearance:focus-visible {
  background: var(--accent-2-hover);
  color: #fff;
}

@media (max-width: 1280px) {
  .driver-profile-layout {
    grid-template-columns: 1fr;
    align-content: start;
    overflow: auto;
  }

  .driver-profile-rail,
  .driver-profile-detail {
    overflow: visible;
  }

  .driver-profile-workflow-grid {
    grid-template-columns: 1fr;
  }

  .driver-profile-color-control {
    grid-template-columns: 1fr;
  }

  .driver-preview-dialog {
    width: 100%;
  }

  .driver-preview-appearance-panel {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .driver-preview-color-control {
    grid-template-columns: 1fr;
  }
}
