/* design-token-generator — extracted from inline <style> */
/* ── Primary Color Input ── */
.dtg-color-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dtg-color-picker {
  width: 56px;
  height: 56px;
  border: 2px solid var(--evvy-border-color, #DEE2E6);
  border-radius: 10px;
  padding: 3px;
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
}
.dtg-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.dtg-color-picker::-webkit-color-swatch { border: none; border-radius: 6px; }
.dtg-color-picker::-moz-color-swatch { border: none; border-radius: 6px; }
.dtg-hex-input {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 2px solid var(--evvy-border-color, #DEE2E6);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  background: var(--bs-body-bg, #fff);
  color: var(--evvy-text-primary, #333);
  width: 160px;
  text-transform: uppercase;
}
.dtg-hex-input:focus {
  outline: none;
  border-color: var(--cluster-dark);
  box-shadow: 0 0 0 3px rgba(26, 35, 51, 0.12);
}

/* ── Tonal Scale Strip ── */
.dtg-scale-section { margin-top: 1.5rem; }
.dtg-scale-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--evvy-text-secondary, #666);
  margin-bottom: 0.5rem;
}
.dtg-scale-strip {
  display: flex;
  gap: 2px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.dtg-swatch {
  flex: 1;
  min-height: 68px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 0.3rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dtg-swatch:hover {
  transform: scaleY(1.12);
  transform-origin: bottom;
  z-index: 2;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
}
.dtg-swatch-step {
  font-size: 0.5625rem;
  font-weight: 700;
  opacity: 0.85;
  margin-bottom: 1px;
}
.dtg-swatch-hex {
  font-size: 0.5rem;
  font-weight: 600;
  font-family: monospace;
  opacity: 0.75;
}
.dtg-swatch.dtg-light-text .dtg-swatch-step,
.dtg-swatch.dtg-light-text .dtg-swatch-hex { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.dtg-swatch.dtg-dark-text .dtg-swatch-step,
.dtg-swatch.dtg-dark-text .dtg-swatch-hex { color: #111; text-shadow: 0 1px 1px rgba(255,255,255,0.4); }

/* ── Semantic Tokens ── */
.dtg-semantic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}
.dtg-semantic-card {
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  border-radius: 10px;
  overflow: hidden;
}
.dtg-semantic-header {
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dtg-semantic-body {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.dtg-token-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
}
.dtg-token-swatch {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.dtg-token-name {
  flex: 1;
  font-weight: 600;
  color: var(--evvy-text-secondary, #666);
}
.dtg-token-hex {
  font-family: monospace;
  font-weight: 600;
  color: var(--evvy-text-primary, #333);
  cursor: pointer;
}
.dtg-token-hex:hover { text-decoration: underline; }

/* ── Code Output Tabs ── */
.dtg-code-tabs {
  display: flex;
  gap: 2px;
  margin-top: 1.5rem;
  border-bottom: 2px solid var(--evvy-border-color, #DEE2E6);
}
.dtg-code-tab {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  background: transparent;
  color: var(--evvy-text-secondary, #666);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.dtg-code-tab:hover { color: var(--cluster-dark); }
.dtg-code-tab.dtg-tab-active {
  color: var(--cluster-dark);
  border-bottom-color: var(--cluster-dark);
}
.dtg-code-block {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1rem 1.25rem;
  border-radius: 0 0 10px 10px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.65;
  overflow-x: auto;
  position: relative;
  white-space: pre;
  max-height: 400px;
  overflow-y: auto;
  tab-size: 2;
}
.dtg-code-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #cdd6f4;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.dtg-code-copy:hover { background: rgba(255,255,255,0.22); }

/* ── WCAG Matrix ── */
.dtg-matrix-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  border-radius: 10px;
}
.dtg-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.6875rem;
  text-align: center;
}
.dtg-matrix th {
  padding: 0.4rem 0.35rem;
  font-weight: 700;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--cluster-surface, #ECEEF2);
  color: var(--evvy-text-secondary, #666);
  position: sticky;
  top: 0;
}
.dtg-matrix td {
  padding: 0.35rem 0.25rem;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  font-weight: 600;
  white-space: nowrap;
}
.dtg-matrix .dtg-pass-aaa { background: #d1fae5; color: #065f46; }
.dtg-matrix .dtg-pass-aa  { background: #fef3c7; color: #92400e; }
.dtg-matrix .dtg-fail     { background: #fee2e2; color: #991b1b; }
.dtg-matrix .dtg-row-header {
  text-align: left;
  font-weight: 700;
  background: var(--cluster-surface, #ECEEF2);
  color: var(--evvy-text-primary, #333);
  padding-left: 0.6rem;
  position: sticky;
  left: 0;
}
.dtg-matrix-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.15);
  vertical-align: middle;
  margin-right: 3px;
}

/* ── Component Preview (premium) ── */
.dtg-preview-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.dtg-preview-card {
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  border-radius: 10px;
  padding: 1rem;
  background: var(--bs-body-bg, #fff);
}
.dtg-preview-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--evvy-text-secondary, #666);
  margin-bottom: 0.75rem;
}
.dtg-btn-preview {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8125rem;
  border: none;
  cursor: pointer;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
  transition: filter 0.15s;
}
.dtg-btn-preview:hover { filter: brightness(0.9); }
.dtg-btn-outline-preview {
  display: inline-block;
  padding: 0.45rem 1.15rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8125rem;
  border: 2px solid;
  background: transparent;
  cursor: pointer;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}
.dtg-badge-preview {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.6875rem;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}
.dtg-alert-preview {
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  border-left: 4px solid;
}
.dtg-card-preview {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
}
.dtg-card-preview-header {
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.875rem;
}
.dtg-card-preview-body {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--evvy-text-secondary, #666);
}
.dtg-input-preview {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  background: var(--bs-body-bg, #fff);
  color: var(--evvy-text-primary, #333);
}
.dtg-nav-preview {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
}
.dtg-nav-item-preview {
  flex: 1;
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: default;
}

/* ── Dark Mode Token Section ── */
.dtg-darkmode-preview {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1rem;
}
.dtg-darkmode-scale-strip {
  display: flex;
  gap: 2px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.dtg-darkmode-swatch {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-family: monospace;
  font-weight: 600;
}
.dtg-darkmode-tokens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.dtg-darkmode-token {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  font-size: 0.625rem;
}
.dtg-darkmode-token-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.dtg-darkmode-token-name {
  color: rgba(255,255,255,0.5);
  font-weight: 600;
}
.dtg-darkmode-token-hex {
  color: rgba(255,255,255,0.85);
  font-family: monospace;
  font-weight: 700;
  margin-left: auto;
}

/* ── Results area ── */
.dtg-results { display: none; }
.dtg-results.dtg-visible { display: block; }
.dtg-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--evvy-text-primary, #333);
  margin: 1.5rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dtg-section-title i {
  color: var(--cluster-dark);
  font-size: 1rem;
}

/* ── Toast for copy ── */
.dtg-copied-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--cluster-dark, #1A2333);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
}
.dtg-copied-toast.dtg-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Dark mode overrides ── */
[data-bs-theme="dark"] .dtg-hex-input {
  background: var(--evvy-gray-100, #1E1E1E);
  border-color: var(--evvy-border-color);
  color: #e2e8f0;
}
[data-bs-theme="dark"] .dtg-semantic-card {
  border-color: var(--evvy-border-color);
}
[data-bs-theme="dark"] .dtg-token-name { color: #94a3b8; }
[data-bs-theme="dark"] .dtg-token-hex { color: #e2e8f0; }
[data-bs-theme="dark"] .dtg-matrix th { background: #1e293b; color: #94a3b8; }
[data-bs-theme="dark"] .dtg-matrix .dtg-row-header { background: #1e293b; color: #e2e8f0; }
[data-bs-theme="dark"] .dtg-matrix .dtg-pass-aaa { background: #064e3b; color: #6ee7b7; }
[data-bs-theme="dark"] .dtg-matrix .dtg-pass-aa  { background: #78350f; color: #fcd34d; }
[data-bs-theme="dark"] .dtg-matrix .dtg-fail     { background: #7f1d1d; color: #fca5a5; }
[data-bs-theme="dark"] .dtg-preview-card { background: var(--evvy-gray-100, #1E1E1E); }
[data-bs-theme="dark"] .dtg-code-tab { color: #94a3b8; }
[data-bs-theme="dark"] .dtg-code-tab.dtg-tab-active { color: #e2e8f0; border-bottom-color: #e2e8f0; }

/* ── Mobile ── */
@media (max-width: 575.98px) {
  .dtg-semantic-grid { grid-template-columns: 1fr; }
  .dtg-preview-gallery { grid-template-columns: 1fr; }
  .dtg-swatch { min-height: 52px; }
  .dtg-swatch-hex { display: none; }
  .dtg-color-input-wrap { flex-wrap: wrap; }
  .dtg-hex-input { width: 100%; }
  .dtg-darkmode-tokens { grid-template-columns: repeat(2, 1fr); }
  .dtg-code-tab { padding: 0.4rem 0.6rem; font-size: 0.65rem; }
  .dtg-matrix { font-size: 0.5625rem; }
}
