/* ═══════════════════════════════════════════════════════════
   BRANDKIT — style.css
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #FAF9F7;
  --surface:      #FFFFFF;
  --border:       #E4E0D9;
  --border-light: #F0EDE8;
  --text-primary: #1A1A18;
  --text-secondary:#5C5A56;
  --text-muted:   #9A9690;
  --accent:       #1A1A18;
  --accent-hover: #3D3D3A;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 16px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 24px rgba(0,0,0,0.09);
  --font-ui:      'Inter', system-ui, -apple-system, sans-serif;
  --transition:   160ms ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Typography ────────────────────────────────────────────── */
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: 1.05rem; font-weight: 600; }
p  { color: var(--text-secondary); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--border-light); }

.btn--demo {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn--demo:hover { background: var(--border-light); color: var(--text-primary); }

.btn--sm  { padding: 7px 14px; font-size: 13px; }
.btn--xs  { padding: 5px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.btn--lg  { padding: 14px 28px; font-size: 15px; }

.link-btn {
  background: none; border: none; padding: 0;
  color: var(--text-primary);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover { opacity: 0.7; }

/* ── Site Header ───────────────────────────────────────────── */
.site-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-mark {
  font-size: 18px;
  color: var(--accent);
  line-height: 1;
}
.logo-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.header-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
@media (max-width: 500px) { .header-sub { display: none; } }

/* ── Input Section ─────────────────────────────────────────── */
.input-section { padding: 0; }

/* Hero panel */
.hero-panel {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 80px 16px 88px;
}
.hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 22px;
}
.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 18px;
}
.hero-body {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 440px;
  margin: 0 auto 36px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.btn--hero-primary {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: var(--radius);
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition), transform 0.15s;
}
.btn--hero-primary:hover { background: #2a2a27; transform: translateY(-1px); }
.btn--hero-ghost {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color var(--transition), background var(--transition);
}
.btn--hero-ghost:hover { border-color: var(--text-primary); background: var(--surface); }
.hero-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* Form panel */
.form-panel { padding: 48px 0 72px; }
.form-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 24px;
  cursor: pointer;
  transition: color var(--transition);
}
.form-back-btn:hover { color: var(--text-primary); }
.form-heading {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.form-core { max-width: 640px; }
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }
.form-core-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Details accordion */
.form-details {
  max-width: 640px;
  margin-top: 36px;
  border-top: 1px solid var(--border-light);
}
.form-details-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.form-details-summary::-webkit-details-marker { display: none; }
.form-details-summary::after {
  content: '';
  width: 7px; height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: auto;
  transition: transform 0.18s;
  flex-shrink: 0;
}
details[open] > .form-details-summary::after { transform: rotate(-135deg) translateY(2px); }
.form-optional-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 2px 7px;
  border-radius: 4px;
}
.form-details-body { padding: 20px 0 40px; animation: _slideIn 0.15s ease; }
@keyframes _slideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:none; } }

/* Photo Upload */
.photo-upload-wrap { margin-bottom: 32px; }

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  overflow: hidden;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--accent);
  background: #F5F4F1;
}
.drop-zone-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 24px;
  text-align: center;
}
.upload-icon { width: 32px; height: 32px; color: var(--text-muted); }
.drop-label { font-size: 14px; font-weight: 500; color: var(--text-primary); margin: 0; }
.drop-hint { font-size: 12px; color: var(--text-muted); margin: 0; }

.photo-previews {
  display: flex;
  gap: 12px;
  padding: 16px;
  flex-wrap: wrap;
  width: 100%;
}
.photo-thumb {
  position: relative;
  width: 100px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb-remove {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.photo-thumb-remove:hover { background: rgba(0,0,0,0.75); }
.photo-add-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 80px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 24px;
  transition: border-color var(--transition);
}
.photo-add-hint:hover { border-color: var(--accent); }

/* Brand Form */
.brand-form { margin-bottom: 28px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--full { grid-column: 1 / -1; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.req { color: var(--text-muted); font-weight: 400; }
.field-note { font-size: 12px; font-weight: 400; color: var(--text-muted); }

input[type="text"], select, textarea {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
input[type="text"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,26,24,0.08);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; line-height: 1.5; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A9690' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; cursor: pointer; }

/* Action Bar */
.action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.action-bar .btn--primary { margin-left: auto; }
@media (max-width: 600px) {
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-bar .btn--primary { margin-left: 0; }
}

/* ── CTA Library ───────────────────────────────────────────── */
.cta-showcase {
  padding: 20px 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface-raised);
}
.cta-showcase-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.cta-showcase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cta-showcase-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 5px;
  cursor: default;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.cta-groups { padding: 24px 20px 32px; }
.cta-group { margin-bottom: 32px; }
.cta-group:last-child { margin-bottom: 0; }
.cta-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.cta-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.cta-group-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.cta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 900px) { .cta-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px)  { .cta-grid { grid-template-columns: 1fr; } }
.cta-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cta-card-preview {
  display: flex;
  align-items: center;
  min-height: 42px;
}
.cta-card-info { flex: 1; }
.cta-card-text {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.cta-card-context {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.cta-card-actions {
  display: flex;
  gap: 6px;
}

/* ── Output Section ────────────────────────────────────────── */
.output-section {
  border-top: 1px solid var(--border-light);
}

/* Loading */
.loading-state { display: flex; justify-content: center; padding: 96px 24px; }
.loading-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-label { font-size: 14px; color: var(--text-muted); }

/* Results Header */
.results-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  padding: 20px 0;
}
.results-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.results-header-actions { display: flex; gap: 8px; align-items: center; }
.results-brand-name { font-size: clamp(1.4rem, 3.5vw, 2rem); letter-spacing: -0.02em; }
.results-summary { font-size: 13px; margin-top: 3px; }

/* ── Tab Bar ────────────────────────────────────────────────── */
.tab-bar-wrap {
  position: sticky;
  top: 62px; /* site header height */
  z-index: 80;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.tab-bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-ui);
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  flex-shrink: 0;
  position: relative;
}
.tab-btn:hover { color: var(--text-primary); background: var(--border-light); }
.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}
.tab-num {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}
.tab-label {
  font-size: 12px;
  font-weight: 600;
}
@media (max-width: 480px) {
  .tab-btn { padding: 12px 14px; }
  .tab-label { font-size: 11px; }
}

/* ── Tab Panels ─────────────────────────────────────────────── */
.tab-panels { padding: 32px 0 16px; min-height: 400px; }
.tab-panel { animation: panelIn 200ms ease; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Panel Nav ──────────────────────────────────────────────── */
.panel-nav {
  border-top: 1px solid var(--border-light);
  padding: 16px 0 48px;
}
.panel-nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}
.panel-nav-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
}

/* Kit Sections */
.kit-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.kit-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: #FDFCFA;
}
.kit-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.kit-section-title h3 { color: var(--text-primary); }

.edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.edit-btn svg { width: 13px; height: 13px; }
.edit-btn:hover { background: var(--border-light); color: var(--text-primary); }
.edit-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.section-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.section-content { padding: 24px; }

/* Edit Panel */
.edit-panel {
  border-top: 1px solid var(--border-light);
  padding: 20px 24px;
  background: #FAFAF8;
  animation: slideDown 180ms ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.edit-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 12px; }
.edit-input { width: 100%; margin-bottom: 12px; }
.edit-actions { display: flex; gap: 8px; }

/* ── Strategy Refinement UI ────────────────────────────────── */
.refine-panel { min-height: 160px; }

.refine-areas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.refine-area-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition), transform 80ms ease;
}
.refine-area-btn:hover {
  border-color: var(--accent);
  background: var(--bg);
  transform: translateY(-1px);
}
.refine-area-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--border-light);
  flex-shrink: 0;
  color: var(--text-secondary);
}
.refine-area-icon svg { width: 14px; height: 14px; }

.refine-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0;
  margin-bottom: 14px;
  transition: color var(--transition);
}
.refine-back-btn:hover { color: var(--text-primary); }

.refine-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.refine-option-btn {
  padding: 8px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.refine-option-btn:hover { border-color: var(--accent); }
.refine-option-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ── Palette Section ───────────────────────────────────────── */
/* Brand colours label */
.palette-brand-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-muted);
  margin-bottom: 10px; margin-top: 4px;
}
.palette-brand-label--util { margin-top: 20px; }

.palette-swatches {
  display: grid;
  gap: 12px;
}
.palette-swatches--brand { grid-template-columns: repeat(3, 1fr); }
.palette-swatches--util  { grid-template-columns: repeat(2, 1fr); }

/* Utility swatches are slightly shorter */
.palette-swatches--util .swatch-block { height: 56px; }

@media (max-width: 700px) {
  .palette-swatches--brand { grid-template-columns: repeat(3, 1fr); }
  .palette-swatches--util  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .palette-swatches--brand { grid-template-columns: repeat(2, 1fr); }
  .palette-swatches--util  { grid-template-columns: repeat(2, 1fr); }
}

.swatch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: default;
}
.swatch-block {
  height: 80px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
/* Color picker — invisible overlay, triggers native color picker on click */
.swatch-picker {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
  padding: 0;
}
.swatch-copy {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.35);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-ui);
  color: #fff;
  padding: 3px 7px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
}
.swatch-block:hover .swatch-copy { opacity: 1; pointer-events: auto; }
/* Tooltip hint on hover */
.swatch-block::after {
  content: '✎ adjust';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-ui);
  color: rgba(255,255,255,0.9);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  white-space: nowrap;
}
.swatch-block:hover::after { opacity: 1; }
.swatch-info {}
.swatch-hex { font-size: 13px; font-weight: 700; font-family: 'SF Mono', 'Fira Code', monospace; color: var(--text-primary); }
.swatch-role { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.swatch-usage { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; margin-top: 4px; }

.palette-picker-hint { display: block; margin-top: 4px; color: var(--text-muted); font-style: italic; }

.palette-note {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  border: 1px solid var(--border-light);
}

/* ── Typography Section ────────────────────────────────────── */
.type-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 600px) { .type-display { grid-template-columns: 1fr; } }

.type-card {
  padding: 20px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border-light);
}
.type-card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px; }
.type-card-family { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.type-card-details { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.type-sample-heading { line-height: 1.2; color: var(--text-primary); }
.type-sample-body { line-height: 1.6; color: var(--text-secondary); }

.type-scale {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
}
.type-scale-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}
.type-scale-row:last-child { border-bottom: none; }
.type-scale-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); width: 60px; flex-shrink: 0; }
.type-scale-size { font-size: 10px; color: var(--text-muted); width: 50px; }
.type-scale-sample { color: var(--text-primary); flex: 1; }
.type-pairing-desc { font-size: 13px; color: var(--text-secondary); margin-top: 16px; line-height: 1.5; }

/* ── Brand Voice Section ───────────────────────────────────── */
.voice-intro { font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.voice-traits { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
@media (max-width: 600px) { .voice-traits { grid-template-columns: 1fr; } }

.voice-trait {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}
.voice-trait-name { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }

.voice-sample {
  background: var(--bg);
  border-left: 3px solid var(--border);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
}
.voice-sample-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 6px; }
.voice-sample-text { font-size: 14px; color: var(--text-secondary); font-style: italic; line-height: 1.6; margin: 0; }

/* ── Tagline Section ───────────────────────────────────────── */
.tagline-primary {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.tagline-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 3px 8px;
  border-radius: 20px;
  margin-bottom: 24px;
}
.tagline-variants-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }
.tagline-variants { display: flex; flex-direction: column; gap: 8px; }
.tagline-variant {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.tagline-variant:hover { border-color: var(--border); }
@keyframes taglinePulse {
  0%   { box-shadow: 0 0 0 0 rgba(26,26,24,0.35); }
  60%  { box-shadow: 0 0 0 5px rgba(26,26,24,0); }
  100% { box-shadow: 0 0 0 0 rgba(26,26,24,0); }
}
.tagline-variant.selected {
  border-color: var(--accent);
  background: var(--surface);
  animation: taglinePulse 500ms ease;
}
.tagline-variant-text { flex: 1; font-size: 14px; color: var(--text-primary); font-weight: 500; }
.tagline-variant-type { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); flex-shrink: 0; }
.tagline-select-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.tagline-select-btn:hover, .tagline-variant.selected .tagline-select-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Visual Mockup Section ─────────────────────────────────── */
.kit-section--mockup { overflow: visible; }
.section-content--flush { padding: 0; }

/* Platform tab strip */
.platform-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface-raised);
  overflow-x: auto;
  scrollbar-width: none;
}
.platform-tabs::-webkit-scrollbar { display: none; }
.platform-tab-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}
.platform-tab-btn:hover { color: var(--text); }
.platform-tab-btn.active { color: var(--text); border-bottom-color: var(--text); }

/* Mockup grid — base */
.mockup-grid {
  display: grid;
  gap: 3px;
  background: var(--border-light);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.mockup-grid--3col { grid-template-columns: 1fr 1fr 1fr; }
.mockup-grid--2col { grid-template-columns: 1fr 1fr; }
.mockup-grid--1col { grid-template-columns: 1fr; }
.mockup-cell--wide { grid-column: 1 / -1; }

.mockup-cell { background: var(--surface); overflow: hidden; position: relative; }

/* Per-cell action overlay (regen + code) */
.mockup-cell-actions {
  position: absolute;
  top: 8px; right: 8px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 2;
}
.mockup-cell:hover .mockup-cell-actions,
.mockup-cell:focus-within .mockup-cell-actions { opacity: 1; }

.mockup-action-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: none;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.mockup-action-btn:hover { background: rgba(0,0,0,0.8); transform: scale(1.08); }
.mockup-action-btn--code { background: rgba(26,26,24,0.72); }
.mockup-action-btn--edit { background: rgba(26,26,24,0.65); }
.mockup-action-btn svg { width: 14px; height: 14px; pointer-events: none; }

/* ── Edit mode ── */
.cell-editing { outline: 2px solid var(--accent, #5b6af0); outline-offset: -2px; }
.cell-editing .mockup-cell-actions { display: none !important; }
.cell-editing .wm-cell-actions     { display: none !important; }

/* "Done" button overlay */
.cell-edit-done-btn {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 20;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--accent, #5b6af0);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: background var(--transition);
}
.cell-edit-done-btn:hover { background: #4757e0; }

/* Editable layers within a cell */
.editable-layer {
  cursor: grab;
  outline: 1.5px dashed rgba(91,106,240,0.5);
  outline-offset: 2px;
  position: relative; /* needed for resize handles */
  transition: outline-color 0.15s;
  user-select: none;
}
.editable-layer:hover { outline-color: rgba(91,106,240,0.85); }
.editable-layer.layer-selected {
  outline: 2px solid #5b6af0;
  cursor: grabbing;
  z-index: 5;
}

/* Corner resize handles */
.resize-handle {
  position: absolute;
  width: 10px; height: 10px;
  background: #fff;
  border: 2px solid #5b6af0;
  border-radius: 2px;
  z-index: 10;
  pointer-events: all;
}
.resize-handle--nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle--ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle--sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle--se { bottom: -5px; right: -5px; cursor: se-resize; }

/* Wordmark edit button */
.wm-action-btn--edit { background: rgba(26,26,24,0.65); }
.mockup-frame {
  width: 100%;
  display: block;
  overflow: hidden;
}
/* Aspect ratios per context */
.mockup-frame--card     { aspect-ratio: 1.6 / 1; }
.mockup-frame--profile  { aspect-ratio: 1 / 1; }
.mockup-frame--feed     { aspect-ratio: 1 / 1; }
.mockup-frame--story    { aspect-ratio: 9 / 16; }
.mockup-frame--hero     { aspect-ratio: 2.4 / 1; }
.mockup-frame--email    { aspect-ratio: 4 / 1; }
.mockup-frame--yt-thumb { aspect-ratio: 16 / 9; }
.mockup-frame--yt-banner{ aspect-ratio: 16 / 3; }
.mockup-frame--web-card { aspect-ratio: 2 / 1; }

/* Mockup section header layout */
.mockup-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mockup-meta {
  padding: 8px 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
}
.mockup-meta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.mockup-meta-context {
  font-size: 10px;
  color: var(--text-muted);
}

@media (max-width: 700px) {
  .mockup-grid--3col { grid-template-columns: 1fr 1fr; }
  .mockup-frame--hero     { aspect-ratio: 2 / 1; }
  .mockup-frame--email    { aspect-ratio: 3 / 1; }
  .mockup-frame--yt-banner{ aspect-ratio: 8 / 1; }
}
@media (max-width: 480px) {
  .mockup-grid--3col,
  .mockup-grid--2col { grid-template-columns: 1fr; }
  .mockup-cell--wide { grid-column: 1; }
}

/* ── Content Strategy Section ──────────────────────────────── */
.strategy-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 24px;
}
.strategy-section-title:first-child { margin-top: 0; }

.pillars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
@media (max-width: 600px) { .pillars-grid { grid-template-columns: 1fr; } }

.pillar-card {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}
.pillar-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.pillar-num {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-muted); font-family: 'SF Mono','Fira Code',monospace;
  flex-shrink: 0; padding-top: 1px; min-width: 20px;
}
.pillar-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.pillar-goal {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 2px 7px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.pillar-desc { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }

.channels-list { display: flex; flex-direction: column; gap: 8px; }
.channel-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}
.channel-fit-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.channel-fit-badge.primary { background: var(--accent); color: #fff; }
.channel-fit-badge.secondary { background: var(--border-light); color: var(--text-muted); }
.channel-body {}
.channel-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.channel-freq { font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 3px; }
.channel-rationale { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.channel-formats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.format-tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
}

.tone-guidance-block {
  padding: 16px 18px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.posting-tips { display: flex; flex-direction: column; gap: 6px; }
.posting-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.posting-tip::before {
  content: '→';
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Brand Personality Section ─────────────────────────────── */
.personality-section {
  margin-top: 28px;
  padding: 20px 22px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}
.personality-head { margin-bottom: 16px; }
.personality-title { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.optional-label { font-size: 11px; font-weight: 500; color: var(--text-muted); background: var(--border-light); padding: 1px 7px; border-radius: 20px; }
.personality-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.archetype-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
@media (max-width: 680px) { .archetype-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .archetype-grid { grid-template-columns: repeat(2, 1fr); } }

.archetype-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg);
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  text-align: center;
}
.archetype-card:hover { border-color: var(--border); background: var(--surface); transform: translateY(-1px); }
.archetype-card.selected { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(26,26,24,0.08); }
.arch-emoji { font-size: 20px; line-height: 1; margin-bottom: 2px; }
.arch-label { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.arch-desc { font-size: 10px; color: var(--text-muted); line-height: 1.3; }

/* ── Tone Sliders ───────────────────────────────────────────── */
.tone-sliders { display: flex; flex-direction: column; gap: 14px; }
.tone-slider-row { display: flex; flex-direction: column; gap: 6px; }
.tone-slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
}
.tone-slider-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--border-light);
  padding: 2px 10px;
  border-radius: 20px;
}

.tone-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.tone-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.tone-range::-webkit-slider-thumb:hover { transform: scale(1.15); box-shadow: 0 2px 8px rgba(0,0,0,0.22); }
.tone-range::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

/* ── Voice Section (updated) ────────────────────────────────── */
.voice-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 24px 0 10px;
}
.voice-section-label:first-of-type { margin-top: 0; }
.voice-trait-means { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 8px; }
.voice-do-dont { display: flex; flex-direction: column; gap: 5px; }
.voice-do, .voice-dont {
  display: flex;
  gap: 7px;
  font-size: 12px;
  line-height: 1.45;
  align-items: flex-start;
}
.voice-do  { color: var(--text-secondary); }
.voice-dont { color: var(--text-muted); }
.do-label, .dont-label {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 5px;
  border-radius: 3px;
  margin-top: 1px;
}
.do-label   { background: #D1FAE5; color: #065F46; }
.dont-label { background: #FEE2E2; color: #991B1B; }

.writing-rules { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.writing-rule {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  padding: 7px 10px;
  background: var(--bg);
  border-radius: 6px;
}
.writing-rule-key {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 110px;
  flex-shrink: 0;
}
.writing-rule-val { color: var(--text-secondary); }

.voice-channels { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.voice-channel-row {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 12.5px;
}
@media (max-width: 640px) { .voice-channel-row { grid-template-columns: 1fr; } }
.voice-channel-name { font-weight: 700; color: var(--text-primary); }
.voice-channel-tone { color: var(--text-secondary); }
.voice-channel-example { color: var(--text-muted); font-style: italic; }

/* ── Wordmark Section ───────────────────────────────────────── */
.wm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) { .wm-grid { grid-template-columns: 1fr; } }

.wm-card {
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: border-color var(--transition);
  position: relative;
}
.wm-card:hover { border-color: var(--border); }

/* Per-card action overlay (regen + download) */
.wm-cell-actions {
  position: absolute;
  top: 8px; right: 8px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 2;
}
.wm-card:hover .wm-cell-actions,
.wm-card:focus-within .wm-cell-actions { opacity: 1; }

.wm-action-btn {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: none;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.wm-action-btn:hover { background: rgba(0,0,0,0.78); transform: scale(1.08); }
.wm-action-btn svg { width: 14px; height: 14px; pointer-events: none; }

.wm-preview {
  width: 100%;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}
.wm-preview svg { width: 100%; height: 100%; display: block; }
.wm-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
  gap: 10px;
}
.wm-label { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.wm-desc  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.wm-download-btn { flex-shrink: 0; }

/* ── Output Footer ─────────────────────────────────────────── */
.output-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}
@media (max-width: 500px) { .output-footer { flex-direction: column; } }

/* ── Site Footer ───────────────────────────────────────────── */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
}
.site-footer p { font-size: 12px; color: var(--text-muted); }

/* ── Utilities ─────────────────────────────────────────────── */
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Code Snippet Modal ────────────────────────────────────── */
.code-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.code-modal[hidden] { display: none; }

.code-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.code-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 900px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
  animation: modalSlideUp 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.code-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  gap: 12px;
}

.code-modal-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.code-modal-title  { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.code-modal-sub    { font-size: 12px; color: var(--text-muted); }

.code-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.code-modal-close {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.code-modal-close:hover { background: var(--border-light); color: var(--text-primary); }
.code-modal-close svg { width: 14px; height: 14px; }

.code-modal-pre {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 20px 24px 32px;
  background: var(--bg);
  border-radius: 0 0 16px 16px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-primary);
  tab-size: 2;
  white-space: pre;
  word-break: normal;
  -webkit-overflow-scrolling: touch;
}
.code-modal-pre code { font: inherit; }

@media (max-width: 600px) {
  .code-modal-header { flex-direction: column; align-items: flex-start; }
  .code-modal-header-actions { width: 100%; justify-content: flex-end; }
  .code-modal-pre { font-size: 11px; padding: 16px 16px 40px; }
}

/* ── Print Styles ──────────────────────────────────────────── */
@media print {
  .site-header,
  .input-section,
  .output-footer,
  .site-footer,
  .edit-btn,
  .section-badge,
  .edit-panel,
  .loading-state { display: none !important; }

  body { background: #fff; }
  .output-section { padding: 20px 0; }
  .kit-section { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
  .kit-section-head { background: #f8f8f8; }
  .mockup-grid { grid-template-columns: 1fr 1fr 1fr; }
  .pillars-grid { grid-template-columns: 1fr 1fr; }
  .palette-swatches { grid-template-columns: repeat(6, 1fr); }
}
