.tint-demo {
  max-width: 620px;
  margin-top: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  background: rgba(15, 15, 21, 0.88);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

/* Side / Front / Rear: native buttons with role="tab"; js/tint-slider.js moves the selection. */
.tint-demo-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.tint-demo-tab {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 700 0.78rem/1 var(--body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tint-demo-tab:hover {
  color: var(--text);
}

.tint-demo-tab[aria-selected="true"] {
  border-bottom-color: var(--red);
  color: #fff;
}

.tint-demo-tab:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.tint-demo-visual {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #090a0d;
}

/* One stage per view. Its image and all its masks share this box, so they cannot drift apart.
   Each image is prepared at exactly 3:2 with the car framed, so nothing zooms. */
.tint-demo-stage {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tint-demo-stage.is-active {
  opacity: 1;
}

.tint-demo-photo,
.tint-demo-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tint-demo-photo {
  display: block;
}

.tint-demo-photo img {
  object-fit: cover;
  object-position: center;
}

.tint-demo-glass {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tint-demo-film {
  fill: #05080c;
  transition: opacity 0.2s ease;
}

.tint-demo-film-front {
  opacity: var(--tint-front-alpha, 0.665);
}

.tint-demo-film-rear {
  opacity: var(--tint-rear-alpha, 0.822);
}

/* Factory privacy glass (SUV rears): always on under the rear film; 0 on bodies without it. */
.tint-demo-film-factory {
  opacity: var(--tint-factory-alpha, 0);
}

/* Windshield film shows only while its toggle is on, so both default to clear. */
.tint-demo-film-windshield {
  opacity: var(--tint-windshield-alpha, 0);
}

.tint-demo-film-visor {
  opacity: var(--tint-visor-alpha, 0);
}

.tint-demo-caption {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 11px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(7, 8, 11, 0.72);
  padding: 7px 9px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.tint-demo-controls {
  padding: 16px 18px 17px;
}

.tint-demo-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tint-demo-group[hidden] {
  display: none;
}

.tint-demo-group + .tint-demo-group {
  margin-top: 14px;
}

.tint-demo-label {
  padding: 0;
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tint-demo-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.tint-demo-toggles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
}

/* Mirrors .qchip in styles.css so the preview reads as part of the same quote tool. */
.tint-demo-chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1.5px solid var(--line-soft);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tint-demo-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tint-demo-chip span {
  color: var(--muted);
  font: 700 0.95rem/1 var(--disp);
  letter-spacing: 0.04em;
}

.tint-demo-toggle span {
  font-size: 0.8rem;
}

.tint-demo-chip:hover {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.tint-demo-chip:has(input:checked) {
  border-color: var(--red);
  background: var(--red-dim);
  box-shadow: 0 0 0 1px var(--red);
}

.tint-demo-chip:has(input:checked) span {
  color: #fff;
}

.tint-demo-chip:has(input:focus-visible) {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.tint-demo-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

@media (max-width: 767px) {
  .tint-demo {
    margin-top: 24px;
  }

  .tint-demo-caption {
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    font-size: 0.58rem;
  }

  .tint-demo-controls {
    padding: 14px 14px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tint-demo-stage,
  .tint-demo-film,
  .tint-demo-chip,
  .tint-demo-tab {
    transition: none;
  }
}
