/* ============================================================
   Seowolf's Salesletters — Design System
   ============================================================ */

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

:root {
  --bg-base: #000000;
  --bg-surface: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;
  --bg-input: #0a0a0a;
  --border-subtle: rgba(255, 118, 0, 0.12);
  --border-focus: #ff7600;
  --text-primary: #f0e6db;
  --text-secondary: #a08c78;
  --text-muted: #5c5045;
  --text-accent: #ff7600;
  --accent: #ff7600;
  --accent-glow: rgba(255, 118, 0, 0.3);
  --accent-light: #ff9a40;
  --accent-dark: #cc5e00;
  --warning: #ffaa44;
  --font-mono: 'Courier New', Courier, monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-mono);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Blobs */
.bg-blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(140px); opacity: 0.2; animation: blobDrift 20s ease-in-out infinite alternate; }
.blob-1 { width: 500px; height: 500px; background: #ff7600; top: -120px; left: -80px; animation-duration: 22s; }
.blob-2 { width: 400px; height: 400px; background: #ff9a40; bottom: -100px; right: -60px; animation-duration: 26s; animation-delay: -5s; }
.blob-3 { width: 300px; height: 300px; background: #cc5e00; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-duration: 18s; animation-delay: -10s; }
@keyframes blobDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(40px, -30px) scale(1.08); }
  66%  { transform: translate(-30px, 50px) scale(0.95); }
  100% { transform: translate(20px, -20px) scale(1.04); }
}

/* Header */
#app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}
.header-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img {
  width: auto;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid rgba(255,118,0,0.25);
  background: #0d0d0d;
  padding: 2px;
  box-shadow: 0 0 16px rgba(255,118,0,0.18);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
  animation: wolfPulse 4s ease-in-out infinite;
}
.logo-img:hover { box-shadow: 0 0 28px rgba(255,118,0,0.4); transform: scale(1.04); }
@keyframes wolfPulse { 0%,100% { box-shadow: 0 0 16px rgba(255,118,0,0.18); } 50% { box-shadow: 0 0 28px rgba(255,118,0,0.35); } }
.logo-text {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.logo-text em { font-style: normal; color: var(--accent); text-shadow: 0 0 20px var(--accent-glow); }

.header-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Buttons */
.btn, .btn-ghost, .btn-icon {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; font-family: var(--font-mono); font-weight: 700;
  transition: all 0.25s var(--ease); border: none; outline: none;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.btn { padding: 12px 26px; border-radius: var(--radius-md); font-size: 0.82rem; }
.btn-primary { background: #ff7600; color: #000; box-shadow: 0 4px 20px var(--accent-glow); }
.btn-primary:hover:not(:disabled) { background: var(--accent-light); transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); }
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--accent); color: var(--accent); }
.btn-accent { background: #ff7600; color: #000; box-shadow: 0 4px 24px var(--accent-glow); font-size: 0.9rem; padding: 14px 32px; }
.btn-accent:hover { background: var(--accent-light); transform: translateY(-2px); box-shadow: 0 8px 36px var(--accent-glow), 0 0 60px rgba(255,118,0,0.15); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  padding: 7px 12px; border-radius: var(--radius-sm); font-size: 0.72rem;
}
.btn-ghost:hover { color: var(--accent); background: rgba(255,118,0,0.06); }
.btn-icon { background: transparent; color: var(--text-secondary); padding: 6px; border-radius: var(--radius-sm); }
.btn-icon:hover { color: var(--accent); background: rgba(255,118,0,0.08); }

/* Inline save button (below textarea) */
.btn-save-inline {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent;
  border: 1px solid rgba(255,118,0,0.2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-save-inline:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255,118,0,0.05);
}

/* Progress bar */
#progress-container {
  position: sticky; top: 63px; z-index: 99;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(16px);
  padding: 10px 28px 8px;
}
.progress-track { width: 100%; height: 4px; background: rgba(255,118,0,0.1); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: #ff7600; border-radius: 100px; transition: width 0.5s var(--ease); box-shadow: 0 0 16px var(--accent-glow); }
.progress-label { text-align: center; font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

/* Layout */
#app-main {
  position: relative; z-index: 1; max-width: 1440px; margin: 0 auto;
  display: flex; gap: 0; min-height: calc(100vh - 115px);
}

/* Sidebar */
#step-sidebar {
  width: 280px; min-width: 280px;
  border-right: 1px solid var(--border-subtle);
  background: rgba(0,0,0,0.6); backdrop-filter: blur(16px);
  padding: 20px 0; overflow-y: auto;
  max-height: calc(100vh - 115px);
  position: sticky; top: 115px;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
#step-sidebar.collapsed { transform: translateX(-100%); opacity: 0; width: 0; min-width: 0; padding: 0; border: none; overflow: hidden; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px 16px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 8px; }
.sidebar-header h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-muted); font-weight: 700; }
.step-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.step-nav-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.2s var(--ease); font-size: 0.75rem;
  color: var(--text-secondary); border: 1px solid transparent; user-select: none;
}
.step-nav-item:hover { background: rgba(255,118,0,0.05); color: var(--text-primary); }
.step-nav-item.active { background: rgba(255,118,0,0.08); color: var(--accent); border-color: rgba(255,118,0,0.25); }
.step-nav-item.completed { color: var(--accent); }
.step-nav-item .step-num {
  width: 24px; height: 24px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700;
  background: rgba(255,118,0,0.08); color: var(--text-muted);
  flex-shrink: 0; transition: all 0.25s var(--ease);
}
.step-nav-item.active .step-num { background: #ff7600; color: #000; box-shadow: 0 0 12px var(--accent-glow); }
.step-nav-item.completed .step-num { background: rgba(255,118,0,0.2); color: var(--accent); }
.step-nav-item .step-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Form area */
#form-area { flex: 1; padding: 40px 48px 40px; display: flex; flex-direction: column; }
.step-content { flex: 1; animation: fadeSlideIn 0.4s var(--ease); }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.step-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 3px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  background: rgba(255,118,0,0.1); color: var(--accent); margin-bottom: 14px;
  border: 1px solid rgba(255,118,0,0.2);
}
.step-title { font-size: 1.7rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.3; margin-bottom: 10px; color: var(--accent); text-transform: uppercase; text-shadow: 0 0 40px var(--accent-glow); }
.step-description { font-size: 0.9rem; color: var(--text-secondary); max-width: 640px; line-height: 1.7; margin-bottom: 32px; }
.step-tip {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 18px;
  background: rgba(255,118,0,0.04); border: 1px solid rgba(255,118,0,0.15);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  margin-bottom: 28px; font-size: 0.82rem; color: var(--warning); line-height: 1.6;
}
.step-tip .tip-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.form-group { margin-bottom: 24px; }
.field-heading {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px; padding-bottom: 8px;
  border-bottom: 2px solid rgba(255,118,0,0.15);
}
.field-heading-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 6px;
  background: #ff7600; color: #000; border-radius: 4px;
  font-size: 0.78rem; font-weight: 700;
}
.form-group label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.1em; }
.form-group textarea, .form-group input[type="text"] {
  width: 100%; max-width: 720px; padding: 14px 18px;
  background: var(--bg-input); border: 1px solid rgba(255,118,0,0.12);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.65;
  resize: vertical; transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease); outline: none;
}
.form-group textarea { min-height: 160px; }
.form-group textarea:focus, .form-group input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-group textarea::placeholder, .form-group input[type="text"]::placeholder { color: var(--text-muted); }

/* Char count row — char count + inline save button side by side */
.char-count-row {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 720px; margin-top: 7px;
}
.char-count { font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.05em; }

.form-navigation { display: flex; align-items: center; gap: 14px; padding-top: 24px; border-top: 1px solid var(--border-subtle); margin-top: auto; }

/* Modal */
.overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: overlayIn 0.3s var(--ease);
}
.overlay.hidden { display: none; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #0a0a0a; border: 1px solid rgba(255,118,0,0.2);
  border-radius: var(--radius-lg); width: 100%; max-width: 860px; max-height: 85vh;
  display: flex; flex-direction: column; animation: modalSlideIn 0.35s var(--ease);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 60px rgba(255,118,0,0.08);
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; gap: 12px;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.modal-actions { display: flex; gap: 8px; align-items: center; }
.modal-body { padding: 28px; overflow-y: auto; flex: 1; font-size: 0.9rem; line-height: 1.75; color: var(--text-primary); }
.modal-body h3 { font-size: 0.85rem; font-weight: 700; color: var(--accent); margin-top: 28px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.modal-body h3:first-child { margin-top: 0; }
.modal-body .section-text { margin-bottom: 20px; white-space: pre-wrap; padding-left: 2px; }
.modal-body .section-divider { border: none; height: 1px; background: var(--border-subtle); margin: 24px 0; }
.modal-body .empty-section { color: var(--text-muted); font-style: italic; }

/* Toast */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111; border: 1px solid rgba(255,118,0,0.3);
  color: var(--accent); padding: 14px 28px; border-radius: var(--radius-md);
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 20px var(--accent-glow);
  z-index: 2000; opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.hidden { display: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,118,0,0.15); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,118,0,0.3); }

/* Responsive */
@media (max-width: 1024px) {
  #step-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    background: rgba(0,0,0,0.96); backdrop-filter: blur(24px);
    max-height: 100vh; transform: translateX(-100%); opacity: 0;
    border-right: 1px solid var(--border-subtle);
  }
  #step-sidebar.mobile-open { transform: translateX(0); opacity: 1; }
  #form-area { padding: 28px 20px; }
  .step-title { font-size: 1.3rem; }
  .logo-text { display: none; }
}
@media (max-width: 600px) {
  .header-actions span { display: none; }
  .btn { padding: 10px 18px; font-size: 0.78rem; }
  .btn-accent { padding: 12px 22px; font-size: 0.82rem; }
  .form-navigation { flex-wrap: wrap; }
  .char-count-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}

#mobile-sidebar-toggle {
  display: none; position: fixed; bottom: 24px; right: 24px; z-index: 150;
  width: 52px; height: 52px; border-radius: 6px;
  background: #ff7600; color: #000; border: none; cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow);
  align-items: center; justify-content: center;
  transition: transform 0.25s var(--ease);
}
#mobile-sidebar-toggle:hover { transform: scale(1.08); }
@media (max-width: 1024px) { #mobile-sidebar-toggle { display: flex; } }

/* ── How To Guide link (used in both pages) ── */
.nav-guide-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); text-decoration: none;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,118,0,0.25);
  background: rgba(255,118,0,0.06);
  transition: all 0.2s var(--ease);
  font-family: var(--font-mono);
}
.nav-guide-link:hover {
  background: rgba(255,118,0,0.14);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(255,118,0,0.15);
}

/* ============================================================
   Tools Nav Strip
   ============================================================ */
#tools-nav {
  position: sticky;
  top: 63px;
  z-index: 98;
  background: rgba(0,0,0,0.92);
  border-bottom: 1px solid rgba(255,118,0,0.18);
  backdrop-filter: blur(16px);
  overflow-x: auto;
  scrollbar-width: none;
}
#tools-nav::-webkit-scrollbar { display: none; }

.tools-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 36px;
  white-space: nowrap;
}

.tools-nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-right: 10px;
  flex-shrink: 0;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 36px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  text-decoration: none;
  border-right: 1px solid rgba(255,118,0,0.08);
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.tool-link:first-of-type { border-left: 1px solid rgba(255,118,0,0.08); }
.tool-link:hover { color: var(--accent); background: rgba(255,118,0,0.06); }
.tool-link svg { flex-shrink: 0; }

.tool-link-social {
  color: #c45fa0;
  margin-left: 4px;
}
.tool-link-social:hover { color: #e070b8; background: rgba(196,95,160,0.06); }

/* Adjust progress-container and sidebar top to account for tools-nav */
#progress-container { top: 99px; }
#step-sidebar { top: 151px; max-height: calc(100vh - 151px); }

/* ============================================================
   Footer
   ============================================================ */
#app-footer {
  position: relative;
  z-index: 1;
  background: rgba(0,0,0,0.95);
  border-top: 1px solid rgba(255,118,0,0.15);
  margin-top: 64px;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 40px 36px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}

.footer-brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.footer-wolf {
  font-size: 1.6rem;
  animation: wolfPulse 4s ease-in-out infinite;
}
.footer-brand-name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-primary);
}
.footer-brand-name em { font-style: normal; color: var(--accent); }

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 280px;
  margin-bottom: 20px;
}

.footer-ig-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(196,95,160,0.12), rgba(255,118,0,0.08));
  border: 1px solid rgba(196,95,160,0.3);
  border-radius: var(--radius-sm);
  color: #c45fa0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-decoration: none;
  transition: all 0.25s var(--ease);
}
.footer-ig-btn:hover {
  background: linear-gradient(135deg, rgba(196,95,160,0.2), rgba(255,118,0,0.12));
  border-color: #c45fa0;
  box-shadow: 0 0 20px rgba(196,95,160,0.2);
  transform: translateY(-1px);
}

.footer-heading {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,118,0,0.12);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  transition: color 0.2s;
  padding: 2px 0;
}
.footer-links a:hover { color: var(--accent); }
.footer-links a svg { flex-shrink: 0; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover svg { color: var(--accent); }

.footer-bottom {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 40px;
  border-top: 1px solid rgba(255,118,0,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.footer-bottom a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.footer-bottom a:hover { color: var(--accent); }
.footer-bottom-sep { opacity: 0.3; }

/* Responsive footer */
@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand-col { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer-inner { grid-template-columns: 1fr; padding: 32px 20px 24px; }
  .footer-bottom { padding: 14px 20px; flex-wrap: wrap; gap: 6px; }
  .tools-nav-inner { padding: 0 16px; }
  #progress-container { top: 99px; }
}

/* Mobile sidebar overlay fix with tools nav */
@media (max-width: 1024px) {
  #step-sidebar { top: 0; max-height: 100vh; }
}

/* ============================================================
   Affiliate Banner
   ============================================================ */
.affiliate-banner-wrap {
  background: #000;
  border-top: 1px solid #1a1a1a;
  padding: 18px 16px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.affiliate-banner-img {
  display: inline-block;
  max-width: 728px;
  width: 100%;
  height: auto;
  border: 0;
}
@media (max-width: 728px) {
  .affiliate-banner-img { max-width: 100%; }
}

/* ============================================================
   Accessibility & Motion — Audit Fixes
   ============================================================ */

/* Focus-visible: visible keyboard focus ring without mouse outline */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) {
  outline: none;
}

/* Step nav items need focus ring too */
.step-nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .blob { animation: none; }
  .logo-img { animation: none; }
  .progress-fill { transition: none; }
  .step-content { animation: none; }
  .overlay, .modal { animation: none; }
  .toast { transition: opacity 0.01ms; }
}

/* Skip-to-content link for keyboard users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: none;
}

/* ============================================================
   Swipe File Drawer
   ============================================================ */

/* Label row — label left, swipe toggle button right */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  max-width: 720px;
}
.field-label-row label {
  margin-bottom: 0;
}

/* Swipe toggle button */
.swipe-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid rgba(255, 118, 0, 0.25);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}
.swipe-toggle-btn:hover,
.swipe-toggle-btn.swipe-open {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255, 118, 0, 0.06);
}
.swipe-toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.swipe-chevron {
  transition: transform 0.25s var(--ease);
  flex-shrink: 0;
}
.swipe-toggle-btn.swipe-open .swipe-chevron {
  transform: rotate(180deg);
}

/* Drawer container */
.swipe-drawer {
  max-width: 720px;
  background: #0a0a0a;
  border: 1px solid rgba(255, 118, 0, 0.18);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  /* Animate open/close */
  animation: swipeDrawerIn 0.22s var(--ease);
}
@keyframes swipeDrawerIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Drawer header */
.swipe-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 118, 0, 0.05);
  border-bottom: 1px solid rgba(255, 118, 0, 0.12);
  flex-wrap: wrap;
}
.swipe-drawer-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.swipe-drawer-hint {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  font-style: italic;
}

/* Scrollable list */
.swipe-list {
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 118, 0, 0.2) transparent;
}
.swipe-list::-webkit-scrollbar { width: 4px; }
.swipe-list::-webkit-scrollbar-track { background: transparent; }
.swipe-list::-webkit-scrollbar-thumb { background: rgba(255, 118, 0, 0.2); border-radius: 100px; }

/* Individual swipe item */
.swipe-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 118, 0, 0.07);
  cursor: pointer;
  transition: background 0.15s var(--ease);
  position: relative;
}
.swipe-item:last-child {
  border-bottom: none;
}
.swipe-item:hover {
  background: rgba(255, 118, 0, 0.04);
}
.swipe-item:hover .swipe-use-btn {
  opacity: 1;
  transform: translateX(0);
}
.swipe-item:focus-visible {
  outline: none;
  background: rgba(255, 118, 0, 0.07);
}

/* Sample number badge */
.swipe-item-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: rgba(255, 118, 0, 0.1);
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 0.15s, color 0.15s;
}
.swipe-item:hover .swipe-item-num {
  background: rgba(255, 118, 0, 0.2);
  color: var(--accent);
}

/* Sample text */
.swipe-item-text {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.65;
  /* clamp to 3 lines by default, expand on hover via JS would be overkill — just show full */
}

/* Use button — slides in on hover */
.swipe-use-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 118, 0, 0.1);
  border: 1px solid rgba(255, 118, 0, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), background 0.15s;
  margin-top: 2px;
  white-space: nowrap;
}
.swipe-use-btn:hover {
  background: rgba(255, 118, 0, 0.2);
  border-color: var(--accent);
}
.swipe-use-btn:focus-visible {
  opacity: 1;
  transform: translateX(0);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* On touch devices, always show the use button */
@media (hover: none) {
  .swipe-use-btn {
    opacity: 1;
    transform: none;
  }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .field-label-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .swipe-toggle-btn {
    font-size: 0.6rem;
    padding: 4px 10px;
  }
  .swipe-drawer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .swipe-list { max-height: 260px; }
  .swipe-item-text { font-size: 0.74rem; }
  .swipe-use-btn {
    opacity: 1;
    transform: none;
    font-size: 0.58rem;
    padding: 3px 8px;
  }
}

/* ============================================================
   Accessibility & Motion — Audit Fixes
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

.step-nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .blob { animation: none; }
  .logo-img { animation: none; }
  .progress-fill { transition: none; }
  .step-content { animation: none; }
  .overlay, .modal { animation: none; }
  .toast { transition: opacity 0.01ms; }
  .swipe-drawer { animation: none; }
  .swipe-chevron { transition: none; }
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; outline: none; }

/* ============================================================
   Feature #5 — Auto-save indicator
   ============================================================ */
.autosave-indicator {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  white-space: nowrap;
  align-self: center;
  padding: 4px 8px;
}
.autosave-indicator.visible { opacity: 1; }

/* ============================================================
   Feature #6 — Modal preview mode toggle + letter preview
   ============================================================ */
.modal-view-toggle {
  display: flex;
  background: rgba(255,118,0,0.06);
  border: 1px solid rgba(255,118,0,0.18);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.modal-view-btn {
  padding: 5px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-right: 1px solid rgba(255,118,0,0.12);
}
.modal-view-btn:last-child { border-right: none; }
.modal-view-btn:hover { color: var(--accent); background: rgba(255,118,0,0.08); }
.modal-view-btn.active { background: rgba(255,118,0,0.15); color: var(--accent); }

/* Letter preview mode inside modal */
.modal-body-letter { background: #fff; color: #1a1a1a; }
.letter-preview {
  font-family: Georgia, serif;
  line-height: 1.9;
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 0;
}
.letter-block { margin-bottom: 28px; }
.letter-block p { margin-bottom: 0.8em; font-size: 1rem; color: #1a1a1a; }
.letter-block p:last-child { margin-bottom: 0; }

/* ============================================================
   Feature #7 — Word count targets in sidebar + wc bar
   ============================================================ */

/* Mini pip on sidebar items */
.step-wc-pip {
  width: 28px;
  height: 3px;
  background: rgba(255,118,0,0.12);
  border-radius: 100px;
  margin-left: auto;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.step-wc-pip::after {
  content: "";
  position: absolute;
  inset: 0 0 0 0;
  width: var(--pip-pct, 0%);
  background: rgba(255,118,0,0.5);
  border-radius: 100px;
  transition: width 0.3s var(--ease), background 0.3s;
}
.step-wc-pip.pip-done::after { background: #ff7600; }

/* Word count bar below textarea */
.wc-target-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  margin-top: 5px;
}
.wc-bar {
  flex: 1;
  height: 3px;
  background: rgba(255,118,0,0.1);
  border-radius: 100px;
  overflow: hidden;
}
.wc-bar-fill {
  height: 100%;
  background: rgba(255,118,0,0.45);
  border-radius: 100px;
  transition: width 0.25s var(--ease), background 0.25s;
}
.wc-bar-fill.wc-done { background: #ff7600; }
.wc-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   Feature #18 — Focus / Distraction-free mode
   ============================================================ */
body.focus-mode #app-header,
body.focus-mode #tools-nav,
body.focus-mode #progress-container,
body.focus-mode #step-sidebar,
body.focus-mode #app-footer,
body.focus-mode .affiliate-banner-wrap,
body.focus-mode #mobile-sidebar-toggle,
body.focus-mode .form-navigation,
body.focus-mode .header-actions,
body.focus-mode .step-badge,
body.focus-mode .step-tip,
body.focus-mode .field-heading,
body.focus-mode .char-count-row,
body.focus-mode .wc-target-row {
  display: none !important;
}

body.focus-mode {
  background: #000;
}

body.focus-mode #app-main {
  min-height: 100vh;
  padding: 0;
}

body.focus-mode #form-area {
  max-width: 720px;
  margin: 0 auto;
  padding: 8vh 32px 12vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.focus-mode .step-title {
  font-size: 1.1rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

body.focus-mode .step-description {
  display: none;
}

body.focus-mode .field-label-row label {
  display: none;
}

body.focus-mode textarea {
  min-height: 55vh !important;
  font-size: 1rem !important;
  line-height: 1.85 !important;
  border-color: rgba(255,118,0,0.08) !important;
  background: transparent !important;
  resize: none;
  max-width: 100%;
}

body.focus-mode textarea:focus {
  border-color: rgba(255,118,0,0.2) !important;
  box-shadow: none !important;
}

body.focus-mode .swipe-drawer { display: none !important; }
body.focus-mode .swipe-toggle-btn { display: none !important; }

/* Focus mode exit hint */
.focus-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,118,0,0.2);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  z-index: 500;
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}
.focus-hint.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.focus-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(255,118,0,0.12);
  border: 1px solid rgba(255,118,0,0.25);
  border-radius: 3px;
  font-family: var(--font-mono);
  color: var(--accent);
}

/* Active state on Focus button */
#btn-focus-mode[aria-pressed="true"] {
  color: var(--accent);
  background: rgba(255,118,0,0.08);
  border-color: rgba(255,118,0,0.3);
}

@media (prefers-reduced-motion: reduce) {
  .wc-bar-fill { transition: none; }
  .step-wc-pip::after { transition: none; }
  .focus-hint { transition: none; }
  .autosave-indicator { transition: none; }
}

@media (max-width: 600px) {
  body.focus-mode #form-area { padding: 5vh 20px 8vh; }
  body.focus-mode textarea { min-height: 50vh !important; }
  .modal-view-toggle { order: -1; width: 100%; }
  .modal-header { flex-wrap: wrap; }
}

/* ============================================================
   Bug Fixes
   ============================================================ */

/* FIX 5: Autosave indicator — reserve space to prevent layout shift */
.autosave-indicator {
  min-width: 80px;
}

/* FIX 6: Modal actions — wrap on small screens */
.modal-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Focus mode navigation bar */
.focus-nav {
  display: none;
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  align-items: center;
  gap: 6px;
  background: rgba(10,10,10,0.92);
  border: 1px solid rgba(255,118,0,0.25);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
body.focus-mode .focus-nav {
  display: flex;
}
.focus-nav-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,118,0,0.08);
  border: 1px solid rgba(255,118,0,0.2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.focus-nav-btn:hover { background: rgba(255,118,0,0.18); }
.focus-nav-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 8px;
  white-space: nowrap;
}
.focus-nav-exit {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(255,118,0,0.15);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  cursor: pointer;
  margin-left: 4px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.focus-nav-exit:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(255,118,0,0.06);
}

@media (prefers-reduced-motion: reduce) {
  .focus-nav { transition: none; }
}

/* ============================================================
   SEO Content Blocks — crawlable, keyword-rich
   ============================================================ */

/* Intro block above the app */
.seo-intro {
  position: relative; z-index: 1;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(255,118,0,0.12);
  padding: 28px 0 24px;
}
.seo-intro-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 0 32px;
}
.seo-intro-h1 {
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 8px;
}
.seo-intro-lead {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 860px;
  margin-bottom: 12px;
}
.seo-intro-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 10px;
}
.seo-intro-features span {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.seo-intro-features strong {
  color: var(--text-secondary);
}
.seo-intro-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 860px;
}

/* FAQ section */
.seo-faq {
  position: relative; z-index: 1;
  background: rgba(0,0,0,0.4);
  border-top: 1px solid rgba(255,118,0,0.1);
  padding: 48px 0 56px;
}
.seo-faq-inner {
  max-width: 860px; margin: 0 auto;
  padding: 0 32px;
}
.seo-faq-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(255,118,0,0.15);
}
.faq-item {
  border-bottom: 1px solid rgba(255,118,0,0.08);
  padding: 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  gap: 16px;
  transition: color 0.2s;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: "+";
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 400;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}
.faq-item[open] .faq-q { color: var(--accent); }
.faq-item[open] .faq-q::after { transform: rotate(45deg); }
.faq-a {
  padding: 0 4px 18px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.8;
}
.faq-a p { margin-bottom: 0.7em; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-a strong { color: var(--text-primary); }

/* Hide seo intro and faq in focus mode */
body.focus-mode .seo-intro,
body.focus-mode .seo-faq { display: none !important; }

/* Adjust progress-container top offset now seo-intro exists */
/* seo-intro sits between tools-nav and app-main, not sticky, so no offset needed */

@media (max-width: 600px) {
  .seo-intro { padding: 20px 0 18px; }
  .seo-intro-inner { padding: 0 16px; }
  .seo-intro-h1 { font-size: 0.95rem; }
  .seo-faq-inner { padding: 0 16px; }
  .seo-faq { padding: 36px 0 40px; }
  .faq-q { font-size: 0.8rem; }
  .faq-a { font-size: 0.78rem; }
}

/* ============================================================
   UI/UX Improvements
   ============================================================ */

/* ── A1: tools-nav removed from index.php — adjust offsets ── */
/* progress-container now sticks directly below header (~63px) */
#progress-container { top: 63px; }
#step-sidebar { top: 115px; max-height: calc(100vh - 115px); }

/* ── A2: Header cleanup — tighter, cleaner actions ── */
.header-divider {
  width: 1px; height: 20px;
  background: rgba(255,118,0,0.2);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Accent ghost btn (Preview) */
.btn-ghost-accent {
  color: var(--accent) !important;
  border: 1px solid rgba(255,118,0,0.3) !important;
  background: rgba(255,118,0,0.06) !important;
}
.btn-ghost-accent:hover {
  background: rgba(255,118,0,0.14) !important;
  border-color: var(--accent) !important;
}

/* Save menu dropdown */
.save-menu-wrap {
  position: relative;
  flex-shrink: 0;
}
.btn-save-menu-toggle {
  padding: 7px 9px !important;
}
.save-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #111;
  border: 1px solid rgba(255,118,0,0.2);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 24px rgba(255,118,0,0.06);
  z-index: 300;
  overflow: hidden;
  animation: saveMenuIn 0.18s var(--ease);
}
@keyframes saveMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.save-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.save-menu-item:hover { background: rgba(255,118,0,0.07); color: var(--accent); }
.save-menu-item svg { flex-shrink: 0; color: var(--text-muted); }
.save-menu-item:hover svg { color: var(--accent); }
.save-menu-divider {
  height: 1px;
  background: rgba(255,118,0,0.1);
  margin: 4px 0;
}

/* ── A3: Phase label in step badge ── */
.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.step-badge-phase {
  font-weight: 700;
  text-transform: uppercase;
}
.step-badge-sep {
  opacity: 0.4;
}

/* ── A4: Compact SEO intro banner ── */
.seo-intro-compact {
  padding: 10px 0 !important;
  border-bottom: 1px solid rgba(255,118,0,0.1);
}
.seo-intro-compact .seo-intro-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.seo-intro-compact .seo-intro-h1 {
  font-size: 0.72rem !important;
  margin-bottom: 0 !important;
  white-space: nowrap;
}
.seo-intro-tagline {
  font-size: 0.68rem;
  color: var(--text-muted);
  flex: 1;
}
.seo-intro-expand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid rgba(255,118,0,0.15);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}
.seo-intro-expand:hover,
.seo-intro-expand.expanded { color: var(--accent); border-color: var(--accent); }
.seo-intro-expand svg { transition: transform 0.2s; }
.seo-intro-expand.expanded svg { transform: rotate(180deg); }
.seo-intro-detail {
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid rgba(255,118,0,0.08);
  margin-top: 8px;
}

/* ── A5: Phase group headers in sidebar ── */
.step-phase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--phase-color, var(--accent));
  margin-top: 8px;
  border-top: 1px solid rgba(255,118,0,0.08);
}
.step-phase-header:first-child { margin-top: 0; border-top: none; }
.step-phase-collapse {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  transition: color 0.15s, transform 0.2s;
}
.step-phase-collapse:hover { color: var(--accent); }
.step-phase-collapse.collapsed svg { transform: rotate(-90deg); }

/* ── T3: Swipe file — more prominent new-user hint ── */
.swipe-toggle-btn {
  position: relative;
}
.swipe-toggle-btn.swipe-new::after {
  content: "";
  position: absolute;
  top: -3px; right: -3px;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: swipePulse 2s ease-in-out infinite;
}
@keyframes swipePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.3); }
}

/* ── T5: Modal CTA hierarchy — HTML download is primary ── */
#btn-download-html {
  background: rgba(255,118,0,0.1);
  border-color: rgba(255,118,0,0.35) !important;
  color: var(--accent) !important;
  font-weight: 700;
}
#btn-download-html:hover {
  background: rgba(255,118,0,0.2) !important;
  border-color: var(--accent) !important;
}

/* ── T8: Keyboard shortcut hints ── */
.kb-hints {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: center;
  padding: 6px 0 0;
  letter-spacing: 0.04em;
}
.kb-hints kbd {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(255,118,0,0.07);
  border: 1px solid rgba(255,118,0,0.2);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-secondary);
}

/* ── T10: focus mode z-index fixes ── */
body.focus-mode #mobile-sidebar-toggle { display: none !important; }
#focus-mode-nav { z-index: 500; }
#mobile-sidebar-toggle { z-index: 150; }

/* ── Progress bar with phase markers ── */
.progress-track { position: relative; }
.progress-phase-markers {
  display: flex;
  justify-content: space-between;
  padding: 0 0 4px;
  margin-bottom: 3px;
}
.progress-phase-marker {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  position: relative;
}
.progress-phase-marker.active { color: var(--accent); }

/* ── Responsive: hide tagline on very small screens ── */
@media (max-width: 480px) {
  .seo-intro-tagline { display: none; }
  .kb-hints { display: none; }
  .header-divider { display: none; }
  .step-badge-sep, .step-badge-phase { display: none; }
}

/* ── Remove the old field-heading CSS (no longer used) ── */
/* .field-heading, .field-heading-num retained in CSS for legacy safety
   but no longer rendered in JS */

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
  .swipe-toggle-btn.swipe-new::after { animation: none; }
  .save-menu-dropdown { animation: none; }
}

/* ============================================================
   T2: Collapsible step tip on mobile
   T6: Word count visibility on small screens
   ============================================================ */
@media (max-width: 600px) {
  .step-tip {
    cursor: pointer;
  }
  .step-tip-text-collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .wc-target-row {
    position: sticky;
    bottom: 0;
    background: var(--bg-base);
    padding: 6px 0 2px;
    z-index: 2;
  }
}
