/* ══════════════════════════════════════════
   CHROME — page chrome around previews
   ══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  line-height: 1.5;
}

/* ── Selector bar ── */
.selector {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.selector h1 {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 6px;
}
.selector button {
  padding: 6px 16px;
  border: 2px solid #444;
  border-radius: 6px;
  background: transparent;
  color: #ccc;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.selector button:hover { border-color: #888; color: #fff; }
.selector button.active {
  border-color: var(--sel-color, #fff);
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.selector button[data-style="amber"].active { --sel-color: #D4922A; }
.selector button[data-style="nordic"].active { --sel-color: #2A7F8E; }
.selector button[data-style="green"].active { --sel-color: #2D5F3E; }
.selector button[data-style="modern"].active { --sel-color: #1E3A5F; }
.selector button[data-style="modern-gov"].active { --sel-color: #CC3344; }
.selector button[data-style="govpl"].active { --sel-color: #CC3344; }
.selector button[data-style="gdansk"].active,
.selector button[data-style="gdansk-dark"].active { --sel-color: #D4A843; }
.selector button[data-style="civic"].active { --sel-color: #2563EB; }

.selector .sep {
  width: 1px;
  height: 24px;
  background: #333;
  margin: 0 4px;
}

/* ── Preview frame ── */
.preview-wrapper {
  max-width: 1280px;
  margin: 32px auto;
  padding: 0 24px;
}
.preview-frame {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 60px rgba(0,0,0,0.5);
  background: #fff;
}
.style-section { display: none; }
.style-section.active { display: block; }

/* ── Description panel ── */
.style-description {
  max-width: 1280px;
  margin: 24px auto 56px;
  padding: 0 24px;
}
.desc-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.desc-card { display: none; }
.desc-card.active { display: grid; }

.desc-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  grid-column: 1 / -1;
}
.desc-card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin-bottom: 8px;
}
.desc-card p, .desc-card li {
  font-size: 14px;
  color: #aaa;
  line-height: 1.7;
}
.desc-card ul { list-style: disc; padding-left: 18px; }

.swatch-row { display: flex; gap: 6px; margin-bottom: 20px; }
.swatch {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
}
.swatch span {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #666;
  white-space: nowrap;
}

.font-demo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.font-demo span { color: #ccc; }

/* ── Viewport toggle ── */
.viewport-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.viewport-btn {
  padding: 6px 12px;
  border: 2px solid #444;
  border-radius: 6px;
  background: transparent;
  color: #ccc;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.viewport-btn:hover { border-color: #888; color: #fff; }
.viewport-btn.active {
  border-color: #888;
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.viewport-btn svg { width: 16px; height: 16px; }

/* ── Mobile preview frame ── */
.preview-frame.mobile-preview {
  max-width: 390px;
  margin: 0 auto;
  border-radius: 24px;
  box-shadow: 0 4px 60px rgba(0,0,0,0.5), 0 0 0 6px #222;
}

/* ── Responsive chrome for real mobile ── */
@media (max-width: 768px) {
  .selector {
    padding: 10px 12px;
    gap: 6px;
  }
  .selector h1 {
    width: 100%;
    margin-bottom: 2px;
  }
  .selector button {
    padding: 5px 10px;
    font-size: 12px;
  }
  .selector .sep {
    display: none;
  }
  .viewport-toggle {
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
  }
  .viewport-btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 5px 8px;
  }
  .dark-toggle {
    font-size: 12px !important;
    padding: 5px 10px !important;
  }
  .preview-wrapper {
    margin: 12px auto;
    padding: 0 8px;
  }
  .preview-frame {
    border-radius: 8px;
  }
  .style-description {
    margin: 12px auto 32px;
    padding: 0 8px;
  }
  .desc-card {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 20px;
  }
  /* Hide desktop/mobile toggle on real mobile — always show as-is */
  .viewport-toggle {
    display: none;
  }
}
