/* ── Hero ─────────────────────────────────────────── */
.app-hero {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 1.5rem 1.1rem;
}
.app-hero--lavender {
  background: var(--c-lavender-bg);
  border-bottom-color: var(--c-lavender-border);
}
.app-hero__inner { margin: 0 auto; }
.app-hero__title {
  font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800;
  color: var(--c-lavender-text); letter-spacing: -.02em;
  margin: 0 0 .5rem; line-height: 1.2;
}
.app-hero__desc {
  font-size: .9rem; color: var(--color-text-secondary);
  max-width: 660px; line-height: 1.6; margin: 0 0 .85rem;
}
.app-hero__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.hero-chip {
  display: inline-flex; align-items: center;
  padding: .22rem .65rem; font-size: .72rem; font-weight: 700;
  background: var(--color-surface); border: 1.5px solid var(--c-lavender-border);
  border-radius: var(--radius-full); color: var(--c-lavender-text); white-space: nowrap;
}

/* ── Tool shell ─────────────────────────────────────────────── */
.tool-wrap {
  background: var(--color-surface);
  border: 1.5px solid var(--c-lavender-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: var(--space-10);
}

/* ── Drop zone ──────────────────────────────────────────────── */
.drop-zone {
  padding: 3rem var(--space-8);
  background: var(--c-lavender-bg);
  border: 2.5px dashed var(--c-lavender-border);
  border-radius: var(--radius-xl);
  text-align: center;
  cursor: pointer;
  transition: background var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
  outline: none;
}
.drop-zone:focus-visible { box-shadow: 0 0 0 3px rgb(74 40 152 / 0.20); }
.drop-zone.drag-over { background: #ddd8f8; border-color: #8870d0; }
.drop-zone.loaded    { background: var(--color-surface); border-style: solid; border-color: var(--c-lavender-text); }
.dz-icon  { font-size: 2.5rem; display: block; margin-bottom: var(--space-3); }
.dz-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--c-lavender-text); margin: 0 0 var(--space-2); }
.dz-sub   { font-size: var(--text-sm); color: var(--color-text-muted); margin: 0; }
#file-input { display: none; }

/* ── Work area ──────────────────────────────────────────────── */
#work-area { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6); }

/* ── Stats row ──────────────────────────────────────────────── */
.stats-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.stat-chip {
  flex: 1; min-width: 8rem;
  background: var(--c-lavender-bg);
  border: 1.5px solid var(--c-lavender-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}
.stat-chip strong { display: block; font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--c-lavender-text); }
.stat-chip span   { font-size: var(--text-xs); color: var(--color-text-muted); }
.stat-chip.complete-chip strong { color: var(--color-success); }
.stat-chip.complete-chip { background: var(--color-success-subtle); border-color: #90d070; }

/* ── Two-panel layout ───────────────────────────────────────── */
.panels {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 700px) { .panels { grid-template-columns: 1fr; } }

/* ── E-reader mockup ────────────────────────────────────────── */
.mockup-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }

.reader-tabs {
  display: flex;
  background: var(--color-surface-alt);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}
.reader-tab {
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
  white-space: nowrap;
}
.reader-tab.active { background: var(--c-lavender-text); color: #fff; }

.reader-device {
  width: 160px;
  border-radius: 22px;
  padding: 18px 8px;
  position: relative;
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.45), inset 0 1px 0 rgb(255 255 255 / 0.08);
  transition: background var(--duration-base);
}
.reader-device.kindle { background: #2c2c2c; }
.reader-device.apple  { background: #1c1c1e; }
.reader-device.kobo   { background: #3a3a3a; }
.reader-device::before {
  content: '';
  position: absolute;
  top: 7px; left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}
.reader-screen {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  position: relative;
}
#mockup-cover {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.mockup-no-cover {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--c-lavender-bg);
  padding: 12px;
  text-align: center;
}
.mockup-no-cover .nc-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-lavender-text);
  line-height: 1.3;
  word-break: break-word;
}
.mockup-no-cover .nc-author {
  font-size: 9px;
  color: var(--color-text-muted);
}
.cover-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.70));
  padding: 20px 8px 8px;
  display: none;
}
.cover-overlay.visible { display: block; }
.cover-overlay .co-title {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-overlay .co-author {
  font-size: 8px;
  color: rgba(255,255,255,0.8);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── KDP checklist ──────────────────────────────────────────── */
.kdp-box {
  background: var(--color-surface-alt);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  width: 100%;
}
.kdp-box__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-lavender-text);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.kdp-list { display: flex; flex-direction: column; gap: var(--space-2); }
.kdp-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.kdp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-border);
}
.kdp-dot.ok  { background: var(--color-success); }
.kdp-dot.bad { background: var(--color-danger); }

/* ── Metadata form ──────────────────────────────────────────── */
.form-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Cover upload strip */
.cover-upload {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--c-lavender-bg);
  border: 1.5px dashed var(--c-lavender-border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.cover-upload:hover { border-color: var(--c-lavender-text); background: #ddd8f8; }
.cover-upload.drag-over { border-color: var(--c-lavender-text); background: #ccc4f4; }
.cover-thumb {
  width: 48px; height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1.5px solid var(--c-lavender-border);
  background: var(--c-lavender-bg);
  flex-shrink: 0;
  display: none;
}
.cover-thumb.visible { display: block; }
.cover-ph {
  width: 48px; height: 64px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--c-lavender-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  background: var(--color-surface);
}
.cover-ph.hidden { display: none; }
.cover-text { flex: 1; }
.cover-text strong { display: block; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--c-lavender-text); }
.cover-text small  { font-size: var(--text-xs); color: var(--color-text-muted); }
#cover-input { display: none; }

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-4);
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid .two-thirds { grid-column: span 1; }

.field-group { display: flex; flex-direction: column; gap: var(--space-1); }
.field-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
}
.field-label .req { color: var(--color-danger); margin-left: 2px; }
.field-input,
.field-select,
.field-textarea {
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-in-out),
              box-shadow   var(--duration-fast) var(--ease-in-out);
  width: 100%;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--c-lavender-text);
  box-shadow: 0 0 0 3px rgb(74 40 152 / 0.12);
}
.field-input.dirty,
.field-textarea.dirty { border-color: var(--c-lavender-border); }
.field-textarea { resize: vertical; min-height: 80px; line-height: var(--leading-relaxed); }

/* ── Revert button ──────────────────────────────────────────── */
.revert-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
  font-family: inherit;
}
.revert-btn:hover {
  border-color: var(--c-lavender-border);
  color: var(--c-lavender-text);
  background: var(--c-lavender-bg);
}

/* ── Download button ────────────────────────────────────────── */
.dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  border: none;
  background: var(--c-lavender-text);
  color: #fff;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  cursor: pointer;
  box-shadow: 0 4px 14px rgb(74 40 152 / 0.30);
  transition: opacity var(--duration-fast) var(--ease-in-out),
              transform var(--duration-fast) var(--ease-in-out),
              box-shadow var(--duration-fast) var(--ease-in-out);
}
.dl-btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.dl-btn:active { transform: scale(0.97); }
.dl-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.dl-btn.dirty {
  box-shadow: 0 4px 22px rgb(74 40 152 / 0.55);
  animation: pulse-btn 2s ease-in-out infinite;
}
@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 4px 14px rgb(74 40 152 / 0.35); }
  50%       { box-shadow: 0 4px 28px rgb(74 40 152 / 0.65); }
}

/* ── Progress overlay ───────────────────────────────────────── */
.progress-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgb(0 0 0 / 0.45);
  backdrop-filter: blur(6px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.progress-overlay.is-open { display: flex; }
.progress-card {
  background: var(--color-surface);
  border: 1.5px solid var(--c-lavender-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  text-align: center;
  min-width: 18rem;
  box-shadow: var(--shadow-xl);
}
.progress-spinner {
  width: 2.5rem; height: 2.5rem;
  border: 3px solid var(--c-lavender-border);
  border-top-color: var(--c-lavender-text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto var(--space-4);
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-label { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* ── Privacy note ───────────────────────────────────────────── */
.privacy-note {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--color-text-muted); justify-content: center;
}

/* ── Learn more section ────────────────────────────────────────── */
.learn-more{max-width:820px;margin:1.25rem auto 0;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-xl);padding:1.1rem 1.5rem}
.learn-more-title{font-size:1.1rem;font-weight:800;color:var(--c-lavender-text);margin:0 0 .75rem}
.learn-more h3{font-size:1rem;font-weight:800;color:var(--color-text-primary);margin:1.1rem 0 .5rem}
.learn-more p{font-size:.88rem;line-height:1.65;color:var(--color-text-secondary);margin:0 0 .75rem}
.learn-more a{color:var(--c-lavender-text)}
.learn-more .faq-item{margin-bottom:.75rem}
.learn-more .faq-q{font-size:.88rem;font-weight:700;color:var(--color-text-primary);margin:0 0 .25rem}
.learn-more-meta{font-size:.72rem;color:var(--color-text-muted);margin-top:1rem}
