:root {
  --navy: #0A1551;
  --navy-light: #1E2A5E;
  --blue: #0075E3;
  --blue-light: #E8F4FD;
  --orange: #FF6B00;
  --orange-hover: #E55F00;
  --green: #00B67A;
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  
  --bg: var(--gray-50);
  --bg-panel: var(--white);
  --primary: var(--orange);
  --primary-hover: var(--orange-hover);
  --secondary: var(--green);
  --text: var(--navy);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-400);
  --border: var(--gray-200);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-panel: #1e293b;
  --primary: var(--orange);
  --primary-hover: #FF8533;
  --secondary: var(--green);
  --text: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a;
    --bg-panel: #1e293b;
    --primary: var(--orange);
    --primary-hover: #FF8533;
    --secondary: var(--green);
    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.3);
  }
}

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

/* Accessibility: Visually hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Accessibility: Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
}

/* Accessibility: Focus visible styles */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  overflow: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Inter', sans-serif;
  line-height: 1.2;
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
}

.logo-icon img { width: 100%; height: 100%; object-fit: cover; }

.logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.actions { display: flex; align-items: center; gap: 12px; }

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: var(--text-muted);
  background: var(--bg);
}

.lang-btn svg {
  width: 14px;
  height: 14px;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  min-width: 100px;
  z-index: 100;
}

.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.lang-option:first-child { border-radius: 8px 8px 0 0; }
.lang-option:last-child { border-radius: 0 0 8px 8px; }

.lang-option:hover {
  background: var(--bg);
  color: var(--text);
}

.lang-option.active {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
}

[data-theme="dark"] .lang-option.active {
  background: rgba(0, 117, 227, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 16px;
}

.btn-ghost:hover { background: var(--gray-100); color: var(--text); }
[data-theme="dark"] .btn-ghost:hover { background: var(--border); }

.btn-primary {
  background: var(--orange);
  color: white;
}

.btn-primary:hover {
  background: var(--orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.35);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Layout */
.main {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 72px);
}

.main.empty {
  grid-template-columns: 1fr;
}

/* Pages Panel */
.pages-panel {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 280px;
  max-height: 100%;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge {
  background: var(--blue);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
}

.drop-hint {
  padding: 12px 20px;
  background: var(--blue-light);
  font-size: 14px;
  font-weight: 500;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

[data-theme="dark"] .drop-hint {
  background: rgba(0, 117, 227, 0.15);
}

.drop-hint:hover {
  background: rgba(0, 117, 227, 0.2);
}

.drop-hint svg { width: 18px; height: 18px; }

.pages-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: grab;
  transition: all 0.2s;
  min-height: 76px;
  flex-shrink: 0;
}

.page-card:hover {
  border-color: var(--orange);
  box-shadow: var(--shadow);
}

.page-card.selected {
  border-color: var(--orange);
  background: rgba(255, 107, 0, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.page-card.dragging { 
  opacity: 0.9;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border-color: var(--primary);
}

.page-card.drag-over {
  border-color: var(--green);
  background: rgba(0, 182, 122, 0.1);
  transform: scale(1.02);
}

.page-card.drag-placeholder {
  background: var(--bg);
  border: 2px dashed var(--primary);
  opacity: 0.5;
}

.drag-handle {
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.drag-handle span {
  width: 14px;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
}

.thumb {
  width: 52px;
  height: 68px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb svg { width: 24px; height: 24px; color: var(--text-secondary); }

/* Thumbnail rotation - keep container same size, scale rotated content to fit */
.thumb.rotate-90 img, .thumb.rotate-90 svg { transform: rotate(90deg) scale(0.76); }
.thumb.rotate-180 img, .thumb.rotate-180 svg { transform: rotate(180deg); }
.thumb.rotate-270 img, .thumb.rotate-270 svg { transform: rotate(270deg) scale(0.76); }

.page-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }

.page-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-source {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.card-actions {
  display: none;
  align-items: center;
  gap: 2px;
  align-self: center;
  flex-shrink: 0;
}

.page-card:hover .card-actions { display: flex; }

.card-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.card-btn:hover { background: var(--border); color: var(--text); }
.card-btn.remove:hover { background: rgba(255, 107, 74, 0.1); color: var(--primary); }
.card-btn svg { width: 18px; height: 18px; }

/* Welcome Screen */
.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-panel) 100%);
}

.welcome h1 { 
  font-size: clamp(28px, 4vw, 36px); 
  font-weight: 800; 
  color: var(--text); 
  margin-bottom: 12px; 
}
.welcome p { 
  font-size: 18px; 
  color: var(--text-secondary); 
  margin-bottom: 40px; 
}

.drop-zone {
  width: 100%;
  max-width: 560px;
  padding: 48px 40px;
  background: var(--bg-panel);
  border: 2px dashed var(--gray-300);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--orange);
  background: #FFF8F3;
}

[data-theme="dark"] .drop-zone:hover,
[data-theme="dark"] .drop-zone.dragover {
  background: rgba(255, 107, 0, 0.1);
}

.drop-zone-icon { 
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--orange) 0%, #FF8C42 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 8px 24px rgba(255, 107, 0, 0.25);
}
.drop-zone-text { font-size: 20px; font-weight: 600; color: var(--text); }
.drop-zone-hint { font-size: 14px; color: var(--text-secondary); }
.welcome .divider { color: var(--text-muted); margin: 24px 0; font-size: 14px; }
.welcome .privacy-note { 
  font-size: 14px; 
  color: var(--text-muted); 
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Preview Area */
.preview {
  padding: 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: var(--bg);
}

.preview-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.zoom-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.zoom-btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
}

.zoom-btn:active {
  transform: scale(0.95);
}

.zoom-btn svg {
  width: 18px;
  height: 18px;
}

.zoom-level {
  min-width: 60px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.preview-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding-bottom: 40px;
}

.preview-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  padding: 12px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.preview-page {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 16px;
  padding-bottom: 50px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.preview-page:hover {
  box-shadow: var(--shadow-lg), 0 0 0 2px var(--primary);
}

.preview-page.highlight {
  box-shadow: 0 0 0 3px var(--orange), var(--shadow-lg);
}

.preview-page-image { max-width: 100%; max-height: 100%; object-fit: contain; }

.preview-page-label {
  background: var(--navy);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  white-space: nowrap;
}

.preview-page-canvas { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Rotation classes for preview images (PDFs use pdf.js native rotation) */
.preview-page-image.rotate-90,
.preview-page-image.rotate-270 {
  max-width: 70%;
  max-height: 70%;
}
.preview-page-image.rotate-90 { transform: rotate(90deg); }
.preview-page-image.rotate-180 { transform: rotate(180deg); }
.preview-page-image.rotate-270 { transform: rotate(270deg); }

.preview-page-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 21, 81, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.loading-overlay.show { display: flex; }

.loading-spinner {
  background: var(--bg-panel);
  padding: 32px 48px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.loading-progress {
  width: 250px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}

.loading-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.15s ease;
  width: 0%;
}

.loading-progress-bar.indeterminate {
  width: 30%;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.loading-progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Export Modal */
.export-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 21, 81, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.export-modal.show { display: flex; }

.export-content {
  background: var(--bg-panel);
  border-radius: 16px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.export-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.export-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.export-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 6px 0 0 0;
}

.export-body {
  padding: 24px;
}

.export-field {
  margin-bottom: 16px;
}

.export-field:last-child { margin-bottom: 0; }

.export-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.export-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-panel);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.export-field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 117, 227, 0.1);
}

.export-field input::placeholder {
  color: var(--text-muted);
}

.export-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.export-field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 117, 227, 0.1);
}

.export-section {
  margin-bottom: 20px;
}

.export-section:last-child { margin-bottom: 0; }

.export-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.export-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: -8px 0 12px 0;
}

.export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.export-row .export-field { margin-bottom: 0; }

.export-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* Restore Prompt Modal */
.restore-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 21, 81, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.restore-modal.show { display: flex; }

.restore-content {
  background: var(--bg-panel);
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  margin: 20px;
}

.restore-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
}

.restore-content p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0 0 24px 0;
}

.restore-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.restore-buttons .btn {
  min-width: 120px;
}

/* Help Modal */
.help-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 21, 81, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.help-modal.show { display: flex; }

.help-content {
  background: var(--bg-panel);
  border-radius: 16px;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  margin: 20px;
}

.help-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.help-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.help-close:hover { background: var(--gray-100); color: var(--text); }
[data-theme="dark"] .help-close:hover { background: var(--border); }

.help-body {
  padding: 24px;
}

.help-section {
  margin-bottom: 24px;
}

.help-section:last-child { margin-bottom: 0; }

.help-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.help-section p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.shortcut-item span {
  color: var(--text-secondary);
  font-size: 14px;
}

.shortcut-key {
  display: flex;
  gap: 4px;
}

.shortcut-key kbd {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--navy);
  color: white;
  padding: 14px 24px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--green); }
.toast.error { background: #DC2626; }

#file-input { display: none; }

/* Theme toggle */
#theme-btn .icon-moon { display: none; }
[data-theme="dark"] #theme-btn .icon-sun { display: none; }
[data-theme="dark"] #theme-btn .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme-btn .icon-sun { display: none; }
  :root:not([data-theme="light"]) #theme-btn .icon-moon { display: block; }
}

/* Tablet/Narrow Desktop Responsive Styles */
@media (max-width: 1024px) {
  .main {
    grid-template-columns: 280px 1fr;
  }
  
  .btn span { display: none; }
  .btn { padding: 10px; min-width: auto; }
  
  #export-btn span { display: inline; }
  #export-btn { padding: 10px 16px; min-width: auto; }
}

@media (max-width: 900px) {
  .logo-text { display: none; }
  
  #export-btn span { display: none; }
  #export-btn { padding: 10px; }

  .main {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    display: none !important;
  }

  .pages-panel {
    border-right: none;
  }
}

/* Mobile Responsive Styles */
/* Mobile view tabs */
.mobile-tabs {
  display: none;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  gap: 8px;
}

.mobile-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mobile-tab.active {
  background: var(--primary);
  color: white;
}

.mobile-tab svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .mobile-tabs {
    display: flex;
  }

  .top-bar {
    padding: 12px 16px;
    gap: 8px;
    height: auto;
    min-height: 56px;
  }

  .actions { gap: 4px; }

  .main {
    height: calc(100vh - 56px - 54px); /* Account for tab bar */
    grid-template-columns: 1fr;
  }

  .main.empty {
    height: calc(100vh - 56px);
  }

  .main.empty .drop-zone {
    padding: 40px 20px;
  }

  /* Mobile view switching */
  .pages-panel {
    display: none;
    height: 100%;
  }

  .pages-panel.mobile-visible {
    display: flex;
  }

  .preview {
    display: none;
    height: 100%;
  }

  .preview.mobile-visible {
    display: flex;
    flex-direction: column;
  }

  .drop-zone h2 { font-size: 1.25rem; }
  .drop-zone p { font-size: 0.875rem; }

  .page-card {
    padding: 8px;
    gap: 8px;
  }

  .thumb { width: 44px; height: 56px; }

  .card-actions { 
    display: flex !important;
    position: static;
    background: none;
    padding: 0;
    gap: 2px;
  }

  .card-btn { width: 32px; height: 32px; }

  /* Export modal mobile */
  .export-content {
    width: 95vw;
    max-height: 90vh;
    margin: 20px;
  }

  .export-row {
    flex-direction: column;
  }

  .export-field { width: 100%; }

  /* Help modal mobile */
  .help-content {
    width: 95vw;
    max-height: 90vh;
    margin: 20px;
  }
}

@media (max-width: 480px) {
  .top-bar { padding: 8px 12px; }

  .logo-icon { width: 36px; height: 36px; }

  .page-card { padding: 6px; }

  .thumb { width: 36px; height: 46px; }

  .page-num { font-size: 0.75rem; }
  .page-source { font-size: 0.625rem; }

  .card-btn { width: 28px; height: 28px; }
  .card-btn svg { width: 14px; height: 14px; }
}
