/* ============================================
   CONVERTKIT — NEUBRUTALIST DESIGN SYSTEM
   ============================================ */

/* ---- CSS VARIABLES ---- */
:root {
  --yellow: #FFEB3B;
  --red: #FF5252;
  --blue: #2196F3;
  --black: #000000;
  --white: #FFFFFF;
  --grey-light: #F5F5F5;
  --grey-mid: #E0E0E0;
  --grey-dark: #757575;
  --border: 2.5px solid var(--black);
  --border-thick: 3.5px solid var(--black);
  --shadow: 4px 4px 0px var(--black);
  --shadow-lg: 6px 6px 0px var(--black);
  --shadow-sm: 2px 2px 0px var(--black);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: 0.12s ease;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }

button { cursor: pointer; font-family: inherit; }

input, select, textarea { font-family: inherit; }

a { text-decoration: none; color: inherit; }

[hidden] { display: none !important; }

/* ---- NAVIGATION ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--yellow);
  border-bottom: var(--border-thick);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.logo-icon { font-size: 1.5rem; }

.logo-text { color: var(--black); }

.nav-links { display: flex; gap: 12px; }

.nav-btn {
  background: var(--black);
  color: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.nav-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--black);
}

.nav-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--black);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  box-shadow: var(--shadow-sm);
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--black);
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 24px 16px;
  gap: 10px;
  border-top: var(--border);
  background: var(--yellow);
}

.mobile-menu.open { display: flex; }

.mobile-nav-btn {
  background: var(--black);
  color: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

/* ---- PAGES & TRANSITIONS ---- */
#app-main { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; }

.page { display: none; animation: fadeIn 0.2s ease; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- HOME PAGE ---- */
.hero { text-align: center; padding: 48px 16px 40px; }

.hero-badge {
  display: inline-block;
  background: var(--black);
  color: var(--yellow);
  border: var(--border);
  border-radius: 99px;
  padding: 6px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.hero-highlight {
  background: var(--yellow);
  border-bottom: 4px solid var(--black);
  padding: 0 4px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #444;
  max-width: 560px;
  margin: 0 auto;
  font-weight: 500;
}

/* ---- FEATURE CARDS ---- */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 40px 0;
}

.feature-card {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition), box-shadow var(--transition);
  outline: none;
}

.feature-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0px var(--black);
}

.feature-card:active, .feature-card:focus-visible {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-sm);
}

.card-yellow { background: var(--yellow); }
.card-blue   { background: #BBDEFB; }

.card-icon { font-size: 3rem; line-height: 1; }

.card-title { font-size: 1.7rem; font-weight: 900; letter-spacing: -0.5px; }

.card-desc { font-size: 0.95rem; color: #333; line-height: 1.6; }

.card-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-features li {
  font-size: 0.88rem;
  font-weight: 600;
  padding-left: 16px;
  position: relative;
}

.card-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--black);
  font-weight: 900;
}

.card-btn {
  background: var(--black);
  color: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  align-self: flex-start;
}

.card-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--black);
}

.card-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* ---- TRUST STRIP ---- */
.trust-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 0 8px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grey-light);
  border: var(--border);
  border-radius: 99px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ---- CONVERTER PAGES ---- */
.page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.back-btn {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: transform var(--transition), box-shadow var(--transition);
}

.back-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--black);
}

.back-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.page-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: -1px; }
.page-subtitle { font-size: 0.95rem; color: #555; font-weight: 500; margin-top: 4px; }

/* ---- CONVERTER LAYOUT ---- */
.converter-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

/* ---- DROP ZONE ---- */
.drop-zone {
  position: relative;
  border: 3px dashed var(--black);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  background: var(--grey-light);
  cursor: pointer;
  transition: background var(--transition), border-style var(--transition);
  margin-bottom: 20px;
}

.drop-zone:hover, .drop-zone.drag-over {
  background: #FFF9C4;
  border-style: solid;
  border-color: var(--black);
}

.drop-zone.drag-over { background: var(--yellow); }

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-zone-inner { pointer-events: none; }

.drop-icon { font-size: 3rem; margin-bottom: 16px; }

.drop-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.drop-text strong { font-size: 1.2rem; font-weight: 800; }
.drop-text span   { font-size: 0.9rem; color: #555; }

.drop-formats {
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--black);
  color: var(--white);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
}

/* ---- IMAGE LIST ---- */
.image-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.list-count { font-size: 0.9rem; font-weight: 800; }

.list-actions { display: flex; gap: 8px; }

.action-btn {
  border: var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.action-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--black);
}

.action-btn:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.btn-outline { background: var(--white); color: var(--black); }
.btn-red     { background: var(--red);   color: var(--white); }

.image-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

/* ---- IMAGE LIST ITEM ---- */
.image-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: transform var(--transition), box-shadow var(--transition), opacity 0.2s;
  animation: slideIn 0.18s ease;
  position: relative;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.image-item:active { cursor: grabbing; }
.image-item.dragging { opacity: 0.4; box-shadow: none; }
.image-item.drag-target { border-color: var(--blue); background: #E3F2FD; }

.item-handle {
  color: #999;
  font-size: 1.1rem;
  cursor: grab;
  padding: 4px;
  user-select: none;
}

.item-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: var(--border);
  border-radius: 6px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition);
}

.item-thumb:hover { transform: scale(1.06); }

.item-info { flex: 1; min-width: 0; }

.item-name {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.item-size {
  font-size: 0.78rem;
  color: var(--grey-dark);
  font-weight: 500;
  margin-top: 2px;
}

.item-num {
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--black);
  color: var(--white);
  border-radius: 99px;
  padding: 2px 8px;
  flex-shrink: 0;
}

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

.item-btn {
  border: var(--border);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.item-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0px var(--black);
}

.item-btn:active { transform: translate(1px, 1px); box-shadow: none; }

.item-btn-remove { color: var(--red); font-weight: 900; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  border: 2px dashed var(--grey-mid);
  border-radius: var(--radius-lg);
  margin-top: 12px;
}

.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

.empty-state p {
  font-size: 0.95rem;
  color: var(--grey-dark);
  font-weight: 500;
  line-height: 1.7;
}

/* ---- PROGRESS ---- */
.progress-container {
  margin-top: 20px;
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 16px 20px;
  background: var(--grey-light);
  box-shadow: var(--shadow);
}

.progress-label {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.progress-bar-track {
  background: var(--grey-mid);
  border: var(--border);
  border-radius: 99px;
  height: 18px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--yellow);
  border-right: 2px solid var(--black);
  border-radius: 99px;
  width: 0%;
  transition: width 0.25s ease;
}

.progress-bar-fill.done { background: #4CAF50; }

/* ---- SETTINGS PANEL ---- */
.settings-panel {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 80px;
}

.settings-title {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: var(--border);
}

.setting-group {
  margin-bottom: 20px;
  position: relative;
}

.setting-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.setting-select {
  width: 100%;
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  appearance: none;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

.setting-select:focus {
  outline: none;
  box-shadow: 3px 3px 0px var(--black);
}

.setting-input {
  width: 100%;
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.setting-input:focus {
  outline: none;
  box-shadow: 3px 3px 0px var(--black);
}

.input-suffix {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--grey-dark);
  pointer-events: none;
}

.setting-range {
  width: 100%;
  height: 6px;
  cursor: pointer;
  accent-color: var(--black);
}

.range-hint {
  font-size: 0.75rem;
  color: var(--grey-dark);
  margin-top: 4px;
}

/* ---- TOGGLE GROUPS ---- */
.toggle-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.toggle-btn {
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  flex: 1;
  min-width: 0;
}

.toggle-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--black);
}

.toggle-btn.active {
  background: var(--black);
  color: var(--white);
  transform: translate(1px, 1px);
  box-shadow: none;
}

/* ---- CONVERT BUTTON ---- */
.convert-btn {
  width: 100%;
  background: var(--yellow);
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: var(--shadow);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.convert-btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--black);
}

.convert-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.convert-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: var(--shadow-sm);
}

.convert-btn-secondary { background: #BBDEFB; margin-top: 0; margin-bottom: 8px; }

.settings-actions { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }

.btn-icon { font-size: 1.1rem; }

/* ---- PDF INFO BAR ---- */
.pdf-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 14px 18px;
  background: #FFF9C4;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.pdf-info-left { display: flex; align-items: center; gap: 12px; }

.pdf-file-icon { font-size: 2rem; }

.pdf-filename { font-size: 0.95rem; font-weight: 800; }

.pdf-meta { font-size: 0.8rem; color: #555; font-weight: 500; margin-top: 2px; }

.pdf-info-right { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- PDF PAGES GRID ---- */
.pdf-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.pdf-page-card {
  border: var(--border-thick);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeIn 0.18s ease;
  position: relative;
  outline: none;
}

.pdf-page-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--black);
}

.pdf-page-card.selected {
  border-color: var(--blue);
  border-width: 3px;
  box-shadow: 4px 4px 0px var(--blue);
}

.pdf-page-card.selected .page-canvas-wrap::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--blue);
  color: var(--white);
  border: 2px solid var(--white);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
}

.page-canvas-wrap {
  position: relative;
  background: #eee;
  line-height: 0;
  aspect-ratio: 0.707;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-canvas-wrap canvas,
.page-canvas-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-skeleton {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.page-label {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  border-top: var(--border);
  text-align: center;
  background: var(--white);
}

.pdf-page-card.selected .page-label {
  background: var(--blue);
  color: var(--white);
  border-top-color: var(--blue);
}

/* ---- SELECTED PAGES BADGE ---- */
.selected-pages-badge {
  background: var(--grey-light);
  border: var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

/* ---- TOAST NOTIFICATIONS ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--black);
  color: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideUp 0.2s ease;
  min-width: 240px;
  max-width: 360px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast.toast-success { background: #2E7D32; }
.toast.toast-error   { background: var(--red); }
.toast.toast-info    { background: var(--blue); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

.toast.removing {
  animation: slideDown 0.2s ease forwards;
}

@keyframes slideDown {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}

.modal-box {
  position: relative;
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  padding: 12px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--red);
  color: var(--white);
  border: var(--border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.modal-close:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--black); }

.modal-image { max-width: 80vw; max-height: 80vh; object-fit: contain; border-radius: 6px; }

/* ---- FOCUS VISIBLE ---- */
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 3px;
}

/* ---- DOWNLOAD INDIVIDUAL PAGE BTN ---- */
.page-download-btn {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--yellow);
  border: var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  white-space: nowrap;
  z-index: 2;
}

.pdf-page-card:hover .page-download-btn {
  opacity: 1;
  pointer-events: auto;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .converter-layout {
    grid-template-columns: 1fr;
  }
  .settings-panel {
    position: static;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #app-main { padding: 20px 16px 48px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 32px 8px 28px; }
  .hero-title { letter-spacing: -1px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .pdf-info-bar { flex-direction: column; align-items: flex-start; }
  .pdf-info-right { width: 100%; }
  .item-name { max-width: 150px; }
  .pdf-pages-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .settings-actions { flex-direction: column; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { min-width: unset; max-width: unset; }
}

@media (max-width: 400px) {
  .image-item { flex-wrap: wrap; }
  .item-actions { margin-left: auto; }
}

/* ---- PRINT ---- */
@media print { .navbar, .toast-container, .modal-overlay { display: none !important; } }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--black);
  color: var(--white);
  border-top: var(--border-thick);
  margin-top: 64px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 36px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 48px;
  align-items: start;
}

.footer-brand { display: flex; flex-direction: column; gap: 12px; }

.footer-logo {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--yellow);
  letter-spacing: -0.5px;
}

.footer-tagline {
  font-size: 0.88rem;
  color: #aaa;
  line-height: 1.7;
  font-weight: 500;
}

.footer-links-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 14px;
}

.footer-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color var(--transition);
  position: relative;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--yellow);
  transition: width 0.2s ease;
}

.footer-link:hover { color: var(--yellow); }
.footer-link:hover::after { width: 100%; }

.footer-fact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-fact-list li {
  font-size: 0.82rem;
  color: #bbb;
  font-weight: 500;
  line-height: 1.5;
}

/* Footer bottom bar */
.footer-bottom {
  border-top: 1px solid #222;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

.footer-bottom-links { display: flex; gap: 20px; }

.footer-bottom-link {
  background: none;
  border: none;
  color: #666;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}

.footer-bottom-link:hover { color: var(--yellow); }

/* ============================================
   PRIVACY POLICY PAGE
   ============================================ */
.privacy-wrap {
  max-width: 960px;
  margin: 0 auto;
}

.privacy-hero {
  text-align: center;
  padding: 40px 16px 36px;
}

.privacy-badge {
  display: inline-block;
  background: var(--yellow);
  border: var(--border);
  border-radius: 99px;
  padding: 5px 16px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.privacy-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}

.privacy-lead {
  font-size: 1.05rem;
  color: #444;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.privacy-lead strong { color: var(--black); }

/* Privacy cards grid */
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.privacy-card {
  background: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.privacy-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.privacy-highlight {
  background: var(--yellow);
  grid-column: span 2;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
}

.privacy-highlight .privacy-card-icon {
  grid-row: span 2;
  font-size: 2.8rem;
  align-self: center;
}

.privacy-card-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
  line-height: 1;
}

.privacy-card h2 {
  font-size: 1.05rem;
  font-weight: 900;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.privacy-highlight h2 { font-size: 1.2rem; }

.privacy-card p {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.75;
}

.privacy-card code {
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.82rem;
  font-family: 'Consolas', 'Courier New', monospace;
}

/* TL;DR footer note */
.privacy-footer-note {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--black);
  color: var(--white);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}

.privacy-footer-note span { font-size: 2rem; flex-shrink: 0; }

.privacy-footer-note p {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

/* Responsive — privacy + footer */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-links-group {
    grid-template-columns: repeat(3, 1fr);
  }
  .privacy-grid {
    grid-template-columns: 1fr;
  }
  .privacy-highlight {
    grid-column: span 1;
    grid-template-columns: auto 1fr;
  }
}

@media (max-width: 640px) {
  .footer-links-group {
    grid-template-columns: 1fr 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .privacy-highlight {
    grid-template-columns: 1fr;
  }
  .privacy-highlight .privacy-card-icon {
    grid-row: auto;
    font-size: 2rem;
  }
  .privacy-footer-note {
    flex-direction: column;
    text-align: center;
  }
}

/* Privacy page wrapper — matches app-main spacing */
#privacy-page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

#privacy-page-wrapper .page { display: block; } /* always shown when wrapper is visible */

@media (max-width: 640px) {
  #privacy-page-wrapper { padding: 20px 16px 48px; }
}
