@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f4f5f9;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --border: #e7e8ee;
  --text: #14141f;
  --text-muted: #6b7080;
  --accent: #6d5ef8;
  --accent-hover: #5b4de0;
  --accent-soft: #efecfe;
  --shadow-sm: 0 1px 2px rgba(20, 20, 31, 0.05);
  --shadow-md: 0 4px 16px rgba(20, 20, 31, 0.07);
  --shadow-lg: 0 12px 32px rgba(20, 20, 31, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { text-decoration: none; }

/* ── App shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.5rem 0.5rem 1.25rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}

.sidebar-brand .brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.sidebar-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.9rem 0.6rem 0.4rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.15s, color 0.15s;
}

.sidebar-link i { font-size: 1rem; width: 1.1rem; text-align: center; }

.sidebar-link:hover {
  background-color: #f6f5ff;
  color: var(--text);
}

.sidebar-link.active {
  background-color: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 600;
}

.sidebar-spacer { flex: 1; }

.sidebar-file-card {
  margin-top: 1.25rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sidebar-file-card .file-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fdeeee;
  color: #e5484d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-file-card .file-name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-file-card .file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-premium {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--accent-soft), #f8f7ff);
  border: 1px solid #e3ddff;
}

.sidebar-premium .premium-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.sidebar-premium .premium-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.75rem;
}

.btn-premium {
  display: block;
  text-align: center;
  background-color: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
}

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

.sidebar-credits {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--accent-soft), #f8f7ff);
  border: 1px solid #e3ddff;
}

.credits-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.credits-row i { color: var(--accent); font-size: 1.1rem; }
.credits-amount { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.credits-label { font-size: 0.8rem; color: var(--text-muted); }

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover { color: var(--accent); }

/* ── Home welcome cards ── */
.welcome-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin: -0.25rem -0.25rem 2rem;
}

.welcome-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 100% at 15% 0%, rgba(109, 94, 248, 0.14), transparent 70%),
    radial-gradient(ellipse 50% 90% at 90% 10%, rgba(47, 111, 237, 0.12), transparent 70%);
}

.welcome-hero-inner { position: relative; z-index: 1; padding: 0.25rem; }

.welcome-card {
  border-radius: 20px !important;
  border: 1px solid var(--border) !important;
  padding: 1.25rem 1.4rem;
  text-align: center;
  background: #fff;
}

.welcome-card.theme-red   { background: linear-gradient(165deg, #fdedef 0%, #ffffff 60%); }
.welcome-card.theme-blue  { background: linear-gradient(165deg, #eaf3fd 0%, #ffffff 60%); }
.welcome-card.theme-green { background: linear-gradient(165deg, #e9faf0 0%, #ffffff 60%); }
.welcome-card.theme-purple{ background: linear-gradient(165deg, #f1edfe 0%, #ffffff 60%); }

.welcome-eyebrow {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}
.welcome-eyebrow.theme-red    { background: #fbdbe0; color: #d9364a; }
.welcome-eyebrow.theme-blue   { background: #dbeafe; color: #2563eb; }
.welcome-eyebrow.theme-green  { background: #d7f7e3; color: #16a34a; }
.welcome-eyebrow.theme-purple { background: var(--accent-soft); color: var(--accent); }

.welcome-icon {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  margin: 0 auto 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  box-shadow: 0 10px 20px -8px rgba(20, 20, 31, 0.3), inset 0 2px 3px rgba(255, 255, 255, 0.35);
}
.welcome-icon.theme-red    { background: linear-gradient(150deg, #ff9a9a, #e5484d); }
.welcome-icon.theme-blue   { background: linear-gradient(150deg, #8ec1ff, #2f6fed); }
.welcome-icon.theme-green  { background: linear-gradient(150deg, #7de3a8, #2ea043); }
.welcome-icon.theme-purple { background: linear-gradient(150deg, #bcaeff, var(--accent)); }

.welcome-card h4 { font-weight: 800; margin-bottom: 0.4rem; font-size: 1.05rem; }
.welcome-card .welcome-desc { color: var(--text-muted); font-size: 0.84rem; margin-bottom: 0.9rem; min-height: 2.3rem; }

.welcome-tags { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.9rem; }
.welcome-tag {
  background: #f1f2f6;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
}

.welcome-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem;
  border-radius: 12px;
  font-weight: 700;
  color: #fff !important;
  font-size: 0.86rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.welcome-btn.theme-red    { background: linear-gradient(135deg, #ff8585, #e5484d); }
.welcome-btn.theme-blue   { background: linear-gradient(135deg, #6ba5ff, #2f6fed); }
.welcome-btn.theme-green  { background: linear-gradient(135deg, #52dd8b, #2ea043); }
.welcome-btn.theme-purple { background: linear-gradient(135deg, #ad98ff, var(--accent)); }
.welcome-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -8px rgba(20, 20, 31, 0.35); }

/* ── Before/after compare slider ── */
.compare-wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: ew-resize;
  touch-action: none;
  background: var(--bg);
}

.compare-wrap.checkered {
  background-image:
    linear-gradient(45deg, #d7d9e2 25%, transparent 25%),
    linear-gradient(-45deg, #d7d9e2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d7d9e2 75%),
    linear-gradient(-45deg, transparent 75%, #d7d9e2 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.compare-after { display: block; width: 100%; height: auto; }

.compare-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  clip-path: inset(0 50% 0 0);
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(20, 20, 31, 0.15), 0 2px 8px rgba(20, 20, 31, 0.25);
  transform: translateX(-50%);
  pointer-events: none;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 14px rgba(20, 20, 31, 0.3);
}

.compare-tag {
  position: absolute;
  top: 0.7rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(20, 20, 31, 0.6);
  color: #fff;
  pointer-events: none;
}
.compare-tag-left { left: 0.7rem; }
.compare-tag-right { right: 0.7rem; }

/* ── Mobile shell ── */
.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sidebar-brand-row .sidebar-brand { flex: 1; }

.sidebar-close, .mobile-topbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 31, 0.45);
  z-index: 40;
}
.sidebar-backdrop.open { display: block; }

@media (max-width: 860px) {
  .mobile-topbar-toggle { display: flex; }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 40px rgba(20, 20, 31, 0.2);
    width: min(var(--sidebar-w), 84vw);
  }
  .app-sidebar.open { transform: translateX(0); }

  .sidebar-close { display: flex; }

  .app-topbar {
    padding: 1rem 1.1rem;
    gap: 0.75rem;
  }
  .topbar-title { font-size: 1.15rem; }
  .topbar-subtitle { font-size: 0.82rem; }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn-accent,
  .topbar-actions .btn-ghost { flex: 1; justify-content: center; }

  .app-content { padding: 1.1rem 1rem 2.5rem; }

  .page-card { width: 118px; }
  .page-card .thumb-box { height: 148px; }

  .welcome-icon { width: 72px; height: 72px; font-size: 1.9rem; }
  .welcome-card { padding: 1.5rem 1.25rem; }
}

@media (min-width: 861px) {
  .sidebar-close { display: none !important; }
}

/* Comfortable touch targets everywhere on small screens */
@media (max-width: 480px) {
  .sidebar-link { padding: 0.7rem 0.65rem; }
  .btn-ghost, .btn-accent { padding: 0.65rem 1rem; }
  .drop-zone { padding: 1.75rem 0.75rem; }
}

/* ── Main area ── */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
}

.topbar-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.topbar-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-content {
  padding: 1.75rem 2rem 3rem;
  flex: 1;
}

/* ── Buttons ── */
.btn-ghost {
  background-color: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  font-size: 0.86rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, background-color 0.15s;
}

.btn-ghost:hover { border-color: #c9c9d6; background-color: #fafafc; color: var(--text); }

.btn-accent {
  background-color: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-accent:hover { background-color: var(--accent-hover); color: #fff; }
.btn-accent:disabled { opacity: 0.5; cursor: not-allowed; }

/* Bootstrap overrides to fit the light/premium system */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm);
}

.tool-card { transition: transform 0.2s, box-shadow 0.2s; }
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md) !important; }

/* ── Pastel tool icon badges ── */
.tool-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.tool-badge.badge-danger    { background: #fdeeee; color: #e5484d; }
.tool-badge.badge-primary   { background: var(--accent-soft); color: var(--accent); }
.tool-badge.badge-warning   { background: #fff4e5; color: #d9791a; }
.tool-badge.badge-info      { background: #e6f6fb; color: #1698b8; }
.tool-badge.badge-secondary { background: #f1f2f6; color: #6b7080; }
.tool-badge.badge-success   { background: #e6f7ec; color: #2ea043; }

.tool-badge.tool-badge-sm { width: 38px; height: 38px; border-radius: 10px; font-size: 1.05rem; }

/* ── Category tabs ── */
.category-tabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.category-tab {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.category-tab:hover { border-color: #c9c9d6; }

.category-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Coming soon cards ── */
.tool-card.coming-soon .tool-badge { filter: saturate(0.5); opacity: 0.8; }
.tool-card.coming-soon .card-title,
.tool-card.coming-soon .card-text { opacity: 0.75; }

.soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f1f2f6;
  color: var(--text-muted);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
}

.section-label {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.btn-danger, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-secondary {
  border-radius: var(--radius-sm);
  font-weight: 600;
}

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

.btn-outline-danger, .btn-outline-primary, .btn-outline-info, .btn-outline-warning,
.btn-outline-success, .btn-outline-secondary {
  border-radius: var(--radius-sm);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  background-color: #fbfbfd;
}

.drop-zone.drag-over { border-color: var(--accent); background-color: var(--accent-soft); }
.drop-zone:hover { border-color: var(--accent); }

/* Form controls */
.form-control, .form-select {
  background-color: #fff;
  border-color: var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}

.form-control:focus, .form-select:focus {
  background-color: #fff;
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 0.2rem var(--accent-soft);
}

.form-range::-webkit-slider-thumb { background-color: var(--accent); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

/* Progress bar */
.progress { background-color: #eceef4; border-radius: 20px; }
.progress-bar { background-color: var(--accent) !important; }

/* Badge status colors */
.badge-pending    { background-color: #9296a6; }
.badge-detecting  { background-color: #4d8dff; }
.badge-detected   { background-color: var(--accent); }
.badge-processing { background-color: #f0883e; }
.badge-done       { background-color: #2ea043; }
.badge-error      { background-color: #e5484d; }

.text-secondary { color: var(--text-muted) !important; }

/* Spinner overlay on upload */
.upload-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 31, 0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  color: white;
  font-size: 1.1rem;
}

.upload-overlay.active { display: flex; }

/* ── Page organizer — drag & drop grid ── */
.page-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.page-card {
  width: var(--thumb-w, 150px);
  background-color: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: border-color 0.15s, box-shadow 0.15s, opacity 0.15s, transform 0.15s;
  position: relative;
}

.page-card:hover { border-color: #cfcfe0; box-shadow: var(--shadow-sm); }
.page-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.page-card.dragging { opacity: 0.35; }

.page-card .thumb-box {
  width: 100%;
  height: var(--thumb-h, 190px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
  background-color: #f4f5f9;
}

.page-card img { max-width: 100%; max-height: 100%; transition: transform 0.15s; }

.page-card .page-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.4rem;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.page-card .drag-handle {
  opacity: 0;
  transition: opacity 0.15s;
  cursor: grab;
}

.page-card:hover .drag-handle { opacity: 1; }

.btn-remove-card {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: #fff;
  color: #e5484d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.page-card:hover .btn-remove-card { opacity: 1; }

.file-icon-lg {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background-color: #fdeeee;
  color: #e5484d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.page-card .check-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  background-color: var(--border);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: background-color 0.15s, color 0.15s;
  z-index: 2;
}

.page-card.selected .check-badge {
  background-color: var(--accent);
  color: #fff;
}

.page-card.selectable { cursor: pointer; }

.page-card .group-label {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Right-hand contextual panel */
.side-panel {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.side-panel + .side-panel { margin-top: 1rem; }

.side-panel h6 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: #fff;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  transition: background-color 0.15s, border-color 0.15s;
}

.action-btn:hover:not(:disabled) { background-color: #f6f5ff; border-color: var(--accent); }
.action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.action-btn:last-child { margin-bottom: 0; }

.help-step {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
}

.help-step .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Bottom zoom bar */
.zoom-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.7rem;
  margin-top: 1.5rem;
  background-color: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.zoom-bar button {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}

.zoom-bar input[type="range"] { width: 110px; }

/* ── Metadata properties panel ── */
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

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

.meta-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.meta-value {
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-value.is-empty { color: var(--text-muted); font-weight: 400; font-style: italic; }
.meta-value.is-cleared { color: #e5484d; font-weight: 400; font-style: italic; }
