/* ==========================================================================
   Utility Seva — Rotate PDF Tool Stylesheet
   File: css/rotate-pdf.css
   Matches Utility Seva design system, dark/light themes, horizontal
   breadcrumbs, and exact 50/50 two-column workspace layout.
   ========================================================================== */

:root {
  --pdf-accent: #e11d48;
  --pdf-accent-hover: #be123c;
  --pdf-accent-glow: rgba(225, 29, 72, 0.25);
  --pdf-accent-light: rgba(225, 29, 72, 0.1);

  --pdf-sky-border: #38bdf8;
  --pdf-sky-bg: rgba(224, 242, 254, 0.65);
  --pdf-sky-hover: rgba(186, 230, 253, 0.9);
  --pdf-sky-glow: rgba(56, 189, 248, 0.35);

  --card-radius: 12px;
  --card-radius-sm: 8px;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"],
html.dark {
  --pdf-accent: #fb7185;
  --pdf-accent-hover: #f43f5e;
  --pdf-accent-glow: rgba(251, 113, 133, 0.3);
  --pdf-accent-light: rgba(251, 113, 133, 0.15);

  --pdf-sky-border: #0284c7;
  --pdf-sky-bg: rgba(14, 165, 233, 0.08);
  --pdf-sky-hover: rgba(14, 165, 233, 0.16);
  --pdf-sky-glow: rgba(14, 165, 233, 0.25);
}

/* --------------------------------------------------------------------------
   Breadcrumb Navigation (Strictly Horizontal with Flexbox)
   -------------------------------------------------------------------------- */
.breadcrumb-nav-compact,
.tool-breadcrumbs {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--text-secondary, #64748b);
  margin-top: 0.25rem;
  margin-bottom: 0.85rem;
  line-height: 1.4;
  list-style: none;
  padding: 0;
}

.breadcrumb-nav-compact a,
.tool-breadcrumbs a {
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--transition-fast);
}

.breadcrumb-nav-compact a:hover,
.tool-breadcrumbs a:hover {
  color: var(--pdf-accent, #e11d48);
}

.breadcrumb-nav-compact .breadcrumb-sep,
.tool-breadcrumbs .breadcrumb-sep {
  color: var(--text-muted, #94a3b8);
  font-size: 0.75rem;
  user-select: none;
  opacity: 0.7;
  display: inline-flex;
  align-items: center;
}

.breadcrumb-nav-compact .breadcrumb-current,
.tool-breadcrumbs .breadcrumb-current {
  color: var(--text-primary, #0f172a);
  font-weight: 600;
}

html[data-theme="dark"] .breadcrumb-nav-compact .breadcrumb-current,
html.dark .breadcrumb-nav-compact .breadcrumb-current {
  color: #f8fafc;
}

/* --------------------------------------------------------------------------
   Stage Container & Exact 50/50 Two-Column Layout
   -------------------------------------------------------------------------- */
.rotate-pdf-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.pdf-panel-col {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 900px) {
  .rotate-pdf-stage {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Privacy Pill
   -------------------------------------------------------------------------- */
.privacy-banner-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
  line-height: 1.4;
}

html[data-theme="dark"] .privacy-banner-pill,
html.dark .privacy-banner-pill {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.privacy-banner-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Left Panel: Upload & Controls Cards
   -------------------------------------------------------------------------- */
.panel-surface-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 1.15rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.pdf-dropzone {
  border: 2px dashed var(--pdf-sky-border);
  background: var(--pdf-sky-bg);
  border-radius: var(--card-radius-sm);
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  box-sizing: border-box;
}

.pdf-dropzone:hover,
.pdf-dropzone.drag-over {
  background: var(--pdf-sky-hover);
  border-color: #0284c7;
  box-shadow: 0 0 0 4px var(--pdf-sky-glow);
  transform: translateY(-1px);
}

.pdf-dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
  transition: transform var(--transition-fast);
}

.pdf-dropzone:hover .pdf-dropzone-icon,
.pdf-dropzone.drag-over .pdf-dropzone-icon {
  transform: scale(1.1);
}

.pdf-dropzone-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.pdf-dropzone-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.btn-select-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: #0284c7;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.62rem 1.35rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
  transition: all var(--transition-fast);
}

.btn-select-pdf:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.pdf-dropzone-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Loaded PDF Card */
.loaded-pdf-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 0.9rem 1.05rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.loaded-pdf-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
}

.loaded-pdf-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--pdf-accent-light);
  color: var(--pdf-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loaded-pdf-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.loaded-pdf-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.loaded-pdf-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.badge-pill-sm {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.48rem;
  border-radius: 9999px;
  background: var(--pdf-accent-light);
  color: var(--pdf-accent);
  font-weight: 700;
  font-size: 0.7rem;
}

.loaded-pdf-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn-panel-ctrl {
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.36rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  transition: all var(--transition-fast);
}

html[data-theme="dark"] .btn-panel-ctrl,
html.dark .btn-panel-ctrl {
  background: rgba(255, 255, 255, 0.05);
}

.btn-panel-ctrl:hover:not(:disabled) {
  background: var(--bg-hover, #e2e8f0);
  color: var(--text-primary);
}

.btn-panel-ctrl.btn-clear-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

.btn-panel-ctrl:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Feature Disclosure Warning */
.feature-disclosure-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #b45309;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.74rem;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

html[data-theme="dark"] .feature-disclosure-banner,
html.dark .feature-disclosure-banner {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

/* Mode Selector & Rotation Control Buttons */
.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.55rem;
}

.settings-section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.segmented-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.seg-btn {
  flex: 1;
  min-width: 82px;
  padding: 0.45rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

html[data-theme="dark"] .seg-btn,
html.dark .seg-btn {
  background: rgba(255, 255, 255, 0.04);
}

.seg-btn:hover {
  border-color: var(--pdf-accent);
  color: var(--text-primary);
}

.seg-btn.active {
  background: var(--pdf-accent);
  border-color: var(--pdf-accent);
  color: #ffffff;
}

.rot-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.btn-rot-action {
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.62rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
}

html[data-theme="dark"] .btn-rot-action,
html.dark .btn-rot-action {
  background: rgba(255, 255, 255, 0.04);
}

.btn-rot-action:hover:not(:disabled) {
  border-color: var(--pdf-accent);
  background: var(--pdf-accent-light);
  color: var(--pdf-accent);
}

.btn-rot-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.history-ctrl-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

html[data-theme="dark"] .history-ctrl-bar,
html.dark .history-ctrl-bar {
  background: rgba(255, 255, 255, 0.025);
}

.history-btns-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pdf-input-with-suffix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-surface);
  overflow: hidden;
}

.pdf-input-text {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}

.pdf-input-suffix {
  padding: 0.5rem 0.7rem;
  background: var(--bg-subtle, #f1f5f9);
  border-left: 1px solid var(--border-color);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 600;
}

html[data-theme="dark"] .pdf-input-suffix,
html.dark .pdf-input-suffix {
  background: rgba(255, 255, 255, 0.05);
}

.btn-primary-save {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.4rem;
  background: var(--pdf-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: var(--card-radius-sm);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--pdf-accent-glow);
  transition: all var(--transition-fast);
}

.btn-primary-save:hover:not(:disabled) {
  background: var(--pdf-accent-hover);
  box-shadow: 0 6px 18px var(--pdf-accent-glow);
  transform: translateY(-1px);
}

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

/* --------------------------------------------------------------------------
   Right Panel: Empty State, Thumbnails Grid w/ Individual Controls & Results
   -------------------------------------------------------------------------- */
.pdf-right-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.pdf-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  gap: 1rem;
}

.pdf-empty-illustration {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pdf-accent-light);
  color: var(--pdf-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-empty-illustration svg {
  width: 32px;
  height: 32px;
}

.pdf-empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.pdf-empty-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 420px;
  margin: 0;
}

.pdf-empty-tips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
  text-align: left;
}

.pdf-empty-tip-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pdf-empty-tip-tag svg {
  width: 14px;
  height: 14px;
  color: #10b981;
  flex-shrink: 0;
}

/* Preview Workspace */
.preview-workspace-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

.preview-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.6rem;
}

.preview-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-header-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.active-page-status-strip {
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.45rem 0.68rem;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

html[data-theme="dark"] .active-page-status-strip,
html.dark .active-page-status-strip {
  background: rgba(255, 255, 255, 0.03);
}

.pdf-thumbnails-scroll {
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.75rem;
  box-sizing: border-box;
}

.pdf-thumbnails-scroll::-webkit-scrollbar {
  width: 6px;
}
.pdf-thumbnails-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.thumbnail-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  user-select: none;
}

.thumbnail-card:hover {
  border-color: var(--pdf-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.thumbnail-card.selected {
  border-color: var(--pdf-accent);
  background: var(--pdf-accent-light);
  box-shadow: 0 0 0 2px var(--pdf-accent-glow);
}

.thumbnail-card.focused {
  box-shadow: 0 0 0 2px #0284c7;
}

.thumbnail-card-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.thumbnail-page-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-primary);
}

.thumbnail-rot-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-subtle, #f1f5f9);
  color: var(--text-secondary);
}

.thumbnail-rot-pill.changed {
  background: var(--pdf-accent);
  color: #ffffff;
}

.thumbnail-checkbox {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbnail-card.selected .thumbnail-checkbox {
  background: var(--pdf-accent);
  border-color: var(--pdf-accent);
}

.thumbnail-checkbox svg {
  width: 10px;
  height: 10px;
  color: #ffffff;
  display: none;
}

.thumbnail-card.selected .thumbnail-checkbox svg {
  display: block;
}

.thumbnail-canvas-wrap {
  width: 100%;
  height: 132px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

html[data-theme="dark"] .thumbnail-canvas-wrap,
html.dark .thumbnail-canvas-wrap {
  background: #1e293b;
}

.thumbnail-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.thumbnail-loading-placeholder {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.thumbnail-card-rot-bar {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.2rem;
}

.btn-thumb-rot {
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.24rem 0.1rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

html[data-theme="dark"] .btn-thumb-rot,
html.dark .btn-thumb-rot {
  background: rgba(255, 255, 255, 0.05);
}

.btn-thumb-rot:hover:not(:disabled) {
  background: var(--pdf-accent);
  border-color: var(--pdf-accent);
  color: #ffffff;
}

.btn-thumb-rot:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.preview-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 0.6rem;
}

/* Progress Card */
.save-progress-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.75rem 1.5rem;
  gap: 0.85rem;
  width: 100%;
}

.save-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid var(--pdf-accent-light);
  border-top-color: var(--pdf-accent);
  border-radius: 50%;
  animation: rotSpin 0.8s linear infinite;
}

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

.save-progress-bar-track {
  width: 100%;
  max-width: 380px;
  height: 8px;
  border-radius: 9999px;
  background: var(--bg-subtle, #e2e8f0);
  overflow: hidden;
}

html[data-theme="dark"] .save-progress-bar-track,
html.dark .save-progress-bar-track {
  background: rgba(255, 255, 255, 0.1);
}

.save-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f43f5e, #e11d48);
  border-radius: 9999px;
  transition: width 0.2s ease;
}

.save-progress-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 380px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Success Output Card */
.save-success-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.save-success-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.save-success-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.save-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.save-summary-tile {
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.6rem 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

html[data-theme="dark"] .save-summary-tile,
html.dark .save-summary-tile {
  background: rgba(255, 255, 255, 0.03);
}

.save-summary-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.save-summary-val {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-download-pdf {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.82rem 1.25rem;
  background: #059669;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
  transition: all var(--transition-fast);
}

.btn-download-pdf:hover:not(:disabled) {
  background: #047857;
  transform: translateY(-1px);
}

.btn-download-pdf:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-sub-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

@media (max-width: 520px) {
  .result-sub-actions {
    grid-template-columns: 1fr;
  }
}

.btn-sub-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.76rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

html[data-theme="dark"] .btn-sub-action,
html.dark .btn-sub-action {
  background: rgba(255, 255, 255, 0.05);
}

.btn-sub-action:hover {
  background: var(--bg-hover, #e2e8f0);
}

/* Modal Preview Dialog */
.pdf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pdf-modal-backdrop.active {
  display: flex;
}

.pdf-modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.pdf-modal-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pdf-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle, #f8fafc);
  min-height: 400px;
}

html[data-theme="dark"] .pdf-modal-body,
html.dark .pdf-modal-body {
  background: #0b1120;
}

.pdf-modal-canvas {
  max-width: 100%;
  max-height: 66vh;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  border-radius: 4px;
  background: #ffffff;
}

.pdf-modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-msg {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
}

.toast-msg.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-msg.toast-success {
  border-left: 4px solid #10b981;
}

.toast-msg.toast-warning {
  border-left: 4px solid #f59e0b;
}

