/* Brand Guidelines Generator — a living style-guide document. Sections use
   CSS custom properties (set live by app.js) so editing any token updates
   every preview at once. */

.doc-stage {
  padding: var(--space-7) 0 calc(var(--space-8) + 88px);
}

.doc-section {
  max-width: var(--max-width);
  margin: 0 auto var(--space-8);
  padding: 0 clamp(var(--space-5), 4vw, var(--space-8));
}

.doc-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.doc-section-head h2 {
  font-size: var(--text-xl);
}

.doc-section-head .step-no {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-name-input {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-3xl);
  border: none;
  background: none;
  color: var(--color-text);
  width: 100%;
  padding: 0;
}

.brand-name-input:focus {
  outline: none;
  border-bottom: 2px dashed var(--color-border);
}

.brand-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  margin-top: var(--space-3);
}

/* --- Logo upload slots --- */
.logo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .logo-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .token-row {
    grid-template-columns: 1fr 70px 70px 32px;
    gap: var(--space-2);
  }
  .token-row.has-preview {
    grid-template-columns: 36px 1fr 70px 32px;
  }
  .type-controls { padding: var(--space-3); gap: var(--space-3); }
  .type-field select, .type-field input[type="range"] { min-width: 140px; }
  .type-specimen-row { flex-wrap: wrap; gap: var(--space-2); }
  .dock-cluster { flex-wrap: wrap; row-gap: var(--space-2); height: auto; bottom: var(--space-3); }
  .brand-name-input { font-size: var(--text-2xl); }
}

.logo-slot {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
  padding: var(--space-4);
  text-align: center;
}

.logo-slot.on-dark {
  background: var(--color-brand);
  color: var(--color-bg);
  border-color: transparent;
}

.logo-slot:hover {
  border-color: var(--color-accent);
}

.logo-slot img {
  max-width: 70%;
  max-height: 110px;
  object-fit: contain;
}

.logo-slot input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.logo-slot-name {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  right: 40px;
  z-index: 1;
  font-size: var(--text-xs);
  font-weight: 700;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.75;
  text-align: left;
}

.logo-slot-name:focus { outline: none; opacity: 1; }

.logo-slot-remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: none;
  color: inherit;
  opacity: 0;
  transition: opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-slot:hover .logo-slot-remove { opacity: 0.7; }
.logo-slot-remove:hover { opacity: 1 !important; }
.logo-slot-remove svg { width: 12px; height: 12px; }

.logo-add-slot {
  grid-column: 1 / -1;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  min-height: 56px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
  font-weight: 700;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.logo-add-slot svg { width: 16px; height: 16px; }

.logo-add-slot:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.logo-guidance {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-4);
}

.logo-guidance[contenteditable="true"]:focus {
  outline: none;
  border-left-color: var(--color-accent);
}

/* --- Color roles --- */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
}

.color-role-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.color-role-swatch {
  height: 88px;
  position: relative;
}

.color-role-swatch input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  cursor: pointer;
}
.color-role-swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-role-swatch input[type="color"]::-webkit-color-swatch { border: none; }
.color-role-swatch input[type="color"]::-moz-color-swatch { border: none; }

.color-role-meta {
  padding: var(--space-3);
}

.color-role-name {
  width: 100%;
  border: none;
  background: none;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text);
  padding: 0;
  margin-bottom: 4px;
}

.color-role-name:focus { outline: none; }

.color-role-hex {
  width: 100%;
  border: none;
  background: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  padding: 0;
}

.color-role-hex:focus { outline: none; }

.neutral-scale {
  display: flex;
  gap: 2px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--space-4);
}

.color-role-card {
  position: relative;
}

.color-role-remove {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.color-role-card:hover .color-role-remove { opacity: 1; }
.color-role-remove svg { width: 12px; height: 12px; }

.color-add-card {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
  font-weight: 700;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.color-add-card:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.color-add-card svg { width: 20px; height: 20px; }

.neutral-step {
  flex: 1;
  height: 64px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* --- Typography specimen --- */
.type-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.type-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.type-field label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.type-field select,
.type-field input[type="range"] {
  min-width: 180px;
}

.type-specimen-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.type-specimen-row:last-child { border-bottom: none; }

.type-specimen-row .sample {
  font-family: var(--font-heading-live);
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.type-specimen-row.body-sample .sample {
  font-family: var(--font-body-live);
  font-weight: 400;
}

.type-specimen-row .meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  white-space: nowrap;
}

/* --- Spacing & radius --- */
.tokens-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.token-slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.token-slider label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: space-between;
}

.spacing-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.spacing-bar {
  background: var(--color-accent);
  border-radius: 3px;
  width: 28px;
}

.spacing-bar-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--color-text-subtle);
  text-align: center;
  margin-top: 4px;
}

.spacing-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radius-row {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.radius-preview {
  width: 88px;
  height: 88px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.radius-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
}

/* --- Editable token rows (spacing, radius, type styles) --- */
.token-row-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.token-row {
  display: grid;
  grid-template-columns: 1fr 90px 90px 32px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.token-row.has-preview {
  grid-template-columns: 40px 1fr 90px 32px;
}

.token-row input[type="text"],
.token-row input[type="number"] {
  border: none;
  background: none;
  font-size: var(--text-sm);
  color: var(--color-text);
  padding: 4px 0;
  width: 100%;
}

.token-row input[type="text"]:focus,
.token-row input[type="number"]:focus {
  outline: none;
  border-bottom: 1px solid var(--color-accent);
}

.token-row select {
  border: none;
  background: none;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 600;
}

.token-remove-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  color: var(--color-text-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.token-remove-btn:hover { border-color: var(--color-error); color: var(--color-error); }
.token-remove-btn svg { width: 11px; height: 11px; }

.token-preview-bar {
  background: var(--color-accent);
  border-radius: 3px;
  height: 18px;
  width: 100%;
}

.token-preview-radius {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
}

/* --- More interactive component previews --- */
.pv-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--color-border);
  transition: background 0.2s ease;
  border: none;
  flex-shrink: 0;
}
.pv-toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.pv-toggle.on { background: var(--brand-primary); }
.pv-toggle.on::after { transform: translateX(18px); }

.pv-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
}

.pv-tabs {
  display: flex;
  gap: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.pv-tab {
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.pv-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.pv-tab-panel {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-top: var(--space-3);
  max-width: 260px;
}

.pv-checkbox, .pv-radio {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pv-checkbox { border-radius: var(--radius-token-sm); }
.pv-radio { border-radius: 50%; }
.pv-checkbox.checked, .pv-radio.checked { background: var(--brand-primary); border-color: var(--brand-primary); }
.pv-checkbox svg { width: 12px; height: 12px; color: #fff; display: none; }
.pv-checkbox.checked svg { display: block; }
.pv-radio.checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

.pv-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-token-sm);
  background: color-mix(in srgb, var(--brand-accent) 14%, transparent);
  color: var(--color-text);
  font-size: var(--text-sm);
  max-width: 320px;
}

.pv-alert-close {
  background: none;
  border: none;
  color: var(--color-text-subtle);
  flex-shrink: 0;
}

.pv-progress {
  width: 200px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
}

.pv-progress-fill {
  height: 100%;
  width: 62%;
  background: var(--brand-primary);
  border-radius: inherit;
  transition: width 0.3s ease;
}

.pv-avatar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  font-family: var(--font-heading-live);
  flex-shrink: 0;
}

.pv-avatar-meta .name {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.pv-avatar-meta .role {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

.component-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.component-group-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
}

.preview-buttons {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.pv-btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  font-weight: 700;
  font-size: var(--text-sm);
  font-family: var(--font-heading-live);
  border-radius: var(--radius-token-md);
  border: 2px solid transparent;
}

.pv-btn-primary { background: var(--brand-primary); color: #fff; }
.pv-btn-accent { background: var(--brand-accent); color: #fff; }
.pv-btn-outline { background: transparent; border-color: var(--brand-primary); color: var(--brand-primary); }

.pv-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-token-lg);
  padding: var(--space-5);
  max-width: 260px;
  box-shadow: var(--shadow-md);
}

.pv-card h4 {
  font-family: var(--font-heading-live);
  margin-bottom: var(--space-2);
}

.pv-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.pv-input {
  padding: 10px 14px;
  border-radius: var(--radius-token-sm);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  min-width: 200px;
}

.pv-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  background: color-mix(in srgb, var(--brand-primary) 15%, transparent);
  color: var(--brand-primary);
}

/* --- Sub-bar under the doc content --- */
.footer-tools-list {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-tools-list a:hover {
  color: var(--color-brand);
}

/* --- Dock (shared pattern) --- */
.dock-cluster {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  transform: translateX(-50%);
  width: auto;
  max-width: calc(100% - var(--space-6) * 2);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--color-bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.dock-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dock-group::-webkit-scrollbar { display: none; }

.dock-group-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.toolbar-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.toolbar-btn:hover { border-color: var(--color-brand); color: var(--color-brand); }

.dock-help-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: var(--text-sm);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.dock-help-btn:hover { border-color: var(--color-brand); color: var(--color-brand); transform: translateY(-2px); }
.dock-help-btn svg { width: 16px; height: 16px; }

.dock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--color-brand);
  color: var(--color-bg);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
.dock-toggle:hover { background: var(--color-brand-hover); transform: translateY(-2px); }
.dock-toggle svg { width: 16px; height: 16px; }

.dock-customize-btn { display: none; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { border-color: var(--color-brand); color: var(--color-brand); }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 20, 14, 0.4);
  z-index: 65;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

.dock-extra-panel { display: none; }

.dock-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.dock-panel-header h2 { font-size: var(--text-lg); }

.dock-panel-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (max-width: 640px) {
  .dock-cluster {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: var(--space-3) var(--space-4);
    justify-content: stretch;
    gap: var(--space-2);
  }

  .dock-group,
  .dock-group-end {
    flex: 1;
    gap: var(--space-2);
  }

  .dock-group > *,
  .dock-group-end > * {
    flex: 1;
  }

  .dock-mobile-hide {
    display: none;
  }

  .dock-customize-btn {
    display: inline-flex;
    justify-content: center;
  }

  .dock-extra-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    padding: var(--space-5);
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .dock-extra-panel.open {
    transform: translateY(0);
  }

  .dock-panel-body > * {
    width: 100%;
  }
}

.export-menu { position: relative; }
.export-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  z-index: 20;
  overflow: hidden;
}
.export-dropdown.open { display: block; }
.export-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
}
.export-dropdown button:hover { background: var(--color-brand-light); color: var(--color-brand); }

.copy-toast {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Tutorial --- */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 20, 14, 0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.tutorial-overlay.hidden { display: none; }
.tutorial-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.tutorial-step { display: none; }
.tutorial-step.active { display: block; }
.tutorial-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-brand), var(--color-accent));
  margin-bottom: var(--space-4);
}
.tutorial-card h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.tutorial-card p { color: var(--color-text-muted); font-size: var(--text-sm); }
.tutorial-dots { display: flex; gap: 6px; margin: var(--space-5) 0; }
.tutorial-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-border); }
.tutorial-dots span.active { background: var(--color-brand); width: 18px; border-radius: 3px; transition: width 0.2s ease; }
.tutorial-actions { display: flex; justify-content: space-between; align-items: center; }

/* --- Print --- */
@media print {
  .site-header, .dock-cluster, .tutorial-overlay, .copy-toast, .skip-link, .scroll-progress, .tool-subbar {
    display: none !important;
  }
  .doc-stage { padding: 0; }
  .doc-section { break-inside: avoid; margin-bottom: 32px; }
  body { background: #fff; }
}
