#tab-tyre-brands {
  height: 100%;
}

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

.tyre-brand-studio {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(360px, 1fr) minmax(320px, 420px);
  gap: 14px;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.tyre-brand-rail,
.tyre-brand-detail,
.tyre-brand-editor {
  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;
}

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

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

.tyre-brand-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: calc(var(--studio-content-height) - 122px);
  overflow: auto;
}

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

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

.tyre-brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  aspect-ratio: 1 / 1;
  border: var(--border-width) solid var(--line-soft);
  background: #0c0f14;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.tyre-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tyre-brand-mark.is-large {
  width: 68px;
}

.tyre-brand-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tyre-brand-copy strong,
.tyre-brand-copy span,
.tyre-brand-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tyre-brand-copy strong {
    color: var(--accent-3);
    font-size: 17px;
}
.tyre-brand-detail-body {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.tyre-brand-preview-stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 12px 0 0;
}

.tyre-brand-preview-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.tyre-brand-preview-card h2 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tyre-brand-canvas {
  width: min(100%, 280px);
  justify-self: center;
  aspect-ratio: 1 / 1;
  border: var(--border-width) solid var(--line);
  background: #0c0f14;
}

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

.tyre-brand-hero strong {
  color: #fff;
  font-size: 18px;
}

.tyre-brand-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tyre-brand-metrics div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: var(--border-width) solid var(--line-soft);
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.tyre-brand-metrics strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tyre-brand-paths {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.tyre-brand-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.tyre-brand-rail-actions button:first-child {
  grid-column: 1 / -1;
}

.tyre-brand-template-download {
  grid-column: 1 / -1;
}

.tyre-brand-actions button:only-child,
.tyre-brand-actions .primary {
  grid-column: 1 / -1;
}

.tyre-brand-technical {
  margin-top: 12px;
}

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

.tyre-brand-technical pre {
  margin-top: 8px;
  min-height: 150px;
  max-height: min(26dvh, 240px);
}

.tyre-brand-editor {
  display: grid;
  gap: 12px;
  align-content: start;
}

.tyre-brand-editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.tyre-brand-editor-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tyre-brand-editor-grid input,
.tyre-brand-editor-grid select {
  width: 100%;
}

.tyre-brand-inline-action {
  margin-top: 6px;
  width: 100%;
}

.tyre-brand-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 15px;
}

.tyre-brand-grid-wide {
  grid-column: 1 / -1;
}

.tyre-brand-grid-wide button {
  grid-column: 1 / -1;
}

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

  .tyre-brand-rail,
  .tyre-brand-detail,
  .tyre-brand-editor {
    overflow: visible;
  }

  .tyre-brand-editor-grid {
    grid-template-columns: 1fr;
  }

  .tyre-brand-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
