:root {
  --bg-page: #0F1419;
  --bg-section: #111827;
  --bg-card: #161B22;
  --bg-elevated: #1F2937;
  --border: #2A2F36;
  --text-primary: #E6EDF3;
  --text-muted: #9AA4AE;
  --heading: #F8FAFC;
  --accent: #D32F2F;
  --accent-hover: #B71C1C;
  --success: #2E7D32;
}

body[data-tool-page="true"] .hero {
  background:
    radial-gradient(circle at 15% 25%, rgba(211,47,47,0.14), transparent 46%),
    radial-gradient(circle at 80% 15%, rgba(183,28,28,0.10), transparent 48%),
    linear-gradient(135deg, #161B22 0%, #0F1419 100%);
  border: 1px solid var(--border);
  box-shadow: 0 20px 48px rgba(0,0,0,0.48);
  padding: 36px 30px;
  border-radius: 18px;
  color: var(--text-primary);
}
body[data-tool-page="true"] .hero h1 { color: var(--heading); margin-bottom: 10px; }
body[data-tool-page="true"] .hero h1 { font-size: 2.2rem; letter-spacing: -0.01em; }
body[data-tool-page="true"] .hero p { color: var(--text-muted); margin: 0; }

body[data-tool-page="true"] .upload-section {
  background:
    radial-gradient(circle at 18% 22%, rgba(211,47,47,0.10), transparent 46%),
    linear-gradient(135deg, #161B22 0%, #111827 100%),
    linear-gradient(120deg, rgba(211,47,47,0.22) 0%, rgba(211,47,47,0.00) 40%, rgba(211,47,47,0.22) 80%) !important;
  border: 1px dashed rgba(211,47,47,0.35);
  box-shadow: 0 16px 42px rgba(0,0,0,0.45);
  color: var(--text-primary);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  margin-top: 16px;
}

body[data-tool-page="true"] .upload-section::before {
  content: '';
  position: absolute;
  inset: -30% 0;
  background: linear-gradient(120deg, rgba(211,47,47,0) 0%, rgba(211,47,47,0.35) 45%, rgba(211,47,47,0) 80%);
  transform: translateX(-60%);
  animation: uploadSweep 6s linear infinite;
  opacity: 0.65;
  pointer-events: none;
  z-index: 0;
}

body[data-tool-page="true"] .upload-section > * {
  position: relative;
  z-index: 1;
}

body[data-tool-page="true"] .upload-drop {
  margin-top: 6px;
  border: 2px dashed rgba(255,255,255,0.16);
  border-radius: 14px;
  padding: 26px;
  text-align: center;
  background:
    radial-gradient(circle at 12% 20%, rgba(211,47,47,0.12), transparent 42%),
    linear-gradient(135deg, #161B22 0%, #0F1419 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

body[data-tool-page="true"] .upload-drop:hover,
body[data-tool-page="true"] .upload-drop.is-dragover {
  border-color: rgba(211,47,47,0.45);
  box-shadow: 0 18px 46px rgba(211,47,47,0.18), 0 12px 28px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}

body[data-tool-page="true"] .upload-drop .upload-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D32F2F, #B71C1C);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  margin-bottom: 14px;
  box-shadow: 0 10px 28px rgba(211,47,47,0.32);
}

body[data-tool-page="true"] .upload-drop .upload-text {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.45;
}

body[data-tool-page="true"] .upload-drop .file-button {
  color: #E6EDF3;
  font-weight: 700;
  text-decoration: underline;
}

body[data-tool-page="true"] .upload-hint {
  color: var(--text-muted);
  margin-top: 10px;
  font-size: 0.95rem;
}

body[data-tool-page="true"] .local-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
}

body[data-tool-page="true"] .local-toggle input[type="checkbox"] {
  appearance: none;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1F2937, #111827);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
body[data-tool-page="true"] .local-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 1px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
body[data-tool-page="true"] .local-toggle input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #D32F2F, #B71C1C) !important;
  border-color: #D32F2F !important;
  box-shadow: 0 0 0 1px rgba(211,47,47,0.45), 0 6px 18px rgba(211,47,47,0.35);
}
body[data-tool-page="true"] .local-toggle input[type="checkbox"]:checked::after {
  transform: translateX(19px);
}
body[data-tool-page="true"] .local-toggle .local-label-text {
  background: linear-gradient(90deg, #D32F2F 0%, #B71C1C 50%, #D32F2F 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: marqueeGlow 3s linear infinite;
  font-weight: 700;
}
body[data-tool-page="true"] .local-toggle label {
  justify-content: center;
}
body[data-tool-page="true"] .local-toggle .local-subtext {
  flex-basis: 100%;
}

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

@keyframes uploadSweep {
  0% { transform: translateX(-60%); }
  100% { transform: translateX(60%); }
}

body[data-tool-page="true"] #viewer-wrapper {
  padding: 0 !important;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.45);
}

body[data-tool-page="true"] #viewer {
  padding-top: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
}

body[data-tool-page="true"] .pdf-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 20, 25, 0.82);
  z-index: 9999;
  backdrop-filter: blur(4px);
}

body[data-tool-page="true"] .pdf-loading[hidden] {
  display: none;
}

body[data-tool-page="true"] .pdf-loading-inner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.95));
  border: 1px solid rgba(211, 47, 47, 0.35);
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--text-primary);
  box-shadow: 0 18px 40px rgba(0,0,0,0.55), 0 0 28px rgba(211,47,47,0.25);
}

body[data-tool-page="true"] .pdf-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(211,47,47,0.25);
  border-top-color: var(--accent);
  box-shadow: 0 0 12px rgba(211,47,47,0.55);
  animation: pdfSpinner 0.9s linear infinite;
}

body[data-tool-page="true"] .pdf-loading-text {
  font-size: 0.98rem;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

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

@media (prefers-reduced-motion: reduce) {
  body[data-tool-page="true"] .pdf-spinner { animation: none; }
}

body[data-tool-page="true"] #viewer canvas {
  display: block;
  margin: 0;
  max-width: none;
  height: auto;
}

body[data-tool-page="true"] .canvas-wrap {
  position: relative;
  display: inline-block;
}

body[data-tool-page="true"] .canvas-wrap .fabric-overlay {
  position: absolute;
  top: 0;
  left: 0;
}

body[data-tool-page="true"] .canvas-wrap #pdfCanvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

body[data-tool-page="true"] .canvas-wrap .canvas-container {
  position: absolute !important;
  top: 0;
  left: 0;
  z-index: 2;
}

/* ---------- Content below upload: dark cards & sections ---------- */
body[data-tool-page="true"] section {
  color: var(--text-primary);
}

body[data-tool-page="true"] .steps-grid,
body[data-tool-page="true"] .features-grid,
body[data-tool-page="true"] .faq-grid {
  gap: 24px !important;
}

body[data-tool-page="true"] .step-card,
body[data-tool-page="true"] .feature-card,
body[data-tool-page="true"] .faq-item {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 42px rgba(0,0,0,0.4) !important;
  padding: 22px !important;
}

body[data-tool-page="true"] .step-card h3,
body[data-tool-page="true"] .feature-card h3,
body[data-tool-page="true"] .faq-item h3 {
  color: var(--heading) !important;
}

body[data-tool-page="true"] .step-card p,
body[data-tool-page="true"] .feature-card p,
body[data-tool-page="true"] .faq-item p {
  color: var(--text-muted) !important;
}

body[data-tool-page="true"] .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 25px;
}

body[data-tool-page="true"] .cta-section {
  background: radial-gradient(circle at 18% 22%, rgba(211,47,47,0.12), transparent 45%), linear-gradient(135deg, #1F2937 0%, #111827 100%) !important;
  color: var(--heading) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 48px rgba(0,0,0,0.45) !important;
}

body[data-tool-page="true"] .cta-section a {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%) !important;
  color: #fff !important;
  border-radius: 30px !important;
  box-shadow: 0 12px 30px rgba(211,47,47,0.35) !important;
  border: none !important;
}

body[data-tool-page="true"] .cta-section p {
  color: var(--text-muted) !important;
}

body[data-tool-page="true"] .content-section {
  background:
    radial-gradient(circle at 12% 18%, rgba(211,47,47,0.08), transparent 42%),
    linear-gradient(135deg, #161B22 0%, #111827 100%) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  padding: 28px !important;
  box-shadow: 0 18px 44px rgba(0,0,0,0.45) !important;
}

body[data-tool-page="true"] .content-section h2 {
  color: var(--heading) !important;
}

body[data-tool-page="true"] .content-section p,
body[data-tool-page="true"] .content-section li {
  color: var(--text-muted) !important;
}

body[data-tool-page="true"] .step-number {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(211,47,47,0.32) !important;
}

body[data-tool-page="true"] .related-tools p {
  color: var(--text-muted) !important;
}

body[data-tool-page="true"] .tool-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  text-decoration: none !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body[data-tool-page="true"] .tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(211,47,47,0.45) !important;
  box-shadow: 0 20px 48px rgba(0,0,0,0.5) !important;
}

body[data-tool-page="true"] .tool-card h3 {
  color: var(--heading) !important;
}

body[data-tool-page="true"] .tool-card p {
  color: var(--text-muted) !important;
}

body[data-tool-page="true"] .use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

body[data-tool-page="true"] .use-case {
  background: linear-gradient(135deg, #161B22 0%, #0F1419 100%) !important;
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  border-left: 4px solid var(--accent) !important;
  padding: 20px !important;
  box-shadow: 0 14px 36px rgba(0,0,0,0.42) !important;
  color: var(--text-muted) !important;
}

body[data-tool-page="true"] .use-case h4 {
  color: var(--heading) !important;
  margin: 0 0 8px 0 !important;
}

body[data-tool-page="true"] .use-case p {
  color: var(--text-muted) !important;
  margin: 0 !important;
  font-size: 0.95rem !important;
}

#viewer-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    background: var(--bg-section);
}

#viewer {
    position: relative !important;
    background: var(--bg-section);
}

#canvas {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
}

#pdf-canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
    box-shadow: 0 18px 44px rgba(0,0,0,0.45);
}

.overlay {
    position: absolute !important;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    outline: 1px solid transparent;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.4);
    position: sticky;
    top: 15px;
    z-index: 10;
}

.btn-share {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}

.btn-share::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 12px;
  border: 1px solid rgba(211,47,47,0.45);
  opacity: 0;
  pointer-events: none;
  animation: sharePulse 2.6s ease-out infinite;
}

.btn-share::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, -4px);
  background: rgba(22, 27, 34, 0.96);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  z-index: 20;
}

.btn-share:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@keyframes sharePulse {
  0% { transform: scale(0.95); opacity: 0; }
  15% { opacity: 0.8; }
  100% { transform: scale(1.25); opacity: 0; }
}

.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
  backdrop-filter: blur(6px);
}

.share-modal[hidden] {
  display: none;
}

.share-dialog {
  background: linear-gradient(135deg, #161B22 0%, #111827 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 26px;
  width: min(460px, 92vw);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  color: var(--text-primary);
  position: relative;
}

.share-dialog h3 {
  margin: 0 0 8px 0;
  color: var(--heading);
  font-size: 1.25rem;
}

.share-subtext {
  color: var(--text-muted);
  margin: 0 0 18px 0;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.share-copy {
  width: 42px;
  height: 42px;
}

.share-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  text-decoration: none;
  position: relative;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.share-icon-btn svg {
  width: 20px;
  height: 20px;
}

.share-icon-btn:hover {
  color: #fff !important;
  border-color: rgba(211,47,47,0.5) !important;
  box-shadow: 0 10px 24px rgba(211,47,47,0.2);
  transform: translateY(-2px);
}

.share-icon-btn.is-copied::after {
  content: 'Copied';
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, -4px);
  background: rgba(22, 27, 34, 0.96);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.8rem;
  opacity: 1;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  pointer-events: none;
}

.share-bmc-wrap {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.share-bmc {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 14px 32px rgba(211,47,47,0.4);
  overflow: hidden;
}

.share-bmc::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 999px;
  border: 1px solid rgba(211,47,47,0.45);
  opacity: 0;
  animation: sharePulse 2.8s ease-out infinite;
}

.share-note {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(31, 41, 55, 0.7);
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.share-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
}

.share-close:hover {
  background: var(--bg-card);
}

@media (max-width: 600px) {
  .btn-share::after {
    white-space: normal;
    width: 200px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-share::before {
    animation: none;
  }
  .share-bmc::before {
    animation: none;
  }
}
.tool-hint {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translate(-50%, -6px);
    background: rgba(22, 27, 34, 0.94);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.95rem;
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
}

.tool-hint.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 768px) {
    .tool-hint {
        top: 90px;
        max-width: 90vw;
        text-align: center;
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tool-hint {
        transition: none;
    }
}

.toolbar button {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
}

.toolbar button.active,
.toolbar button:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-save-icon {
    position: relative;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-save-icon::after {
    content: 'Save PDF';
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    z-index: 20;
}

.btn-save-icon:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.btn-save-icon svg {
    width: 28px;
    height: 28px;
}

.btn-icon {
    position: relative;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    z-index: 20;
}

.btn-icon:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

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

.btn-download-icon {
    position: relative;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-download-icon::after {
    content: 'Download PDF';
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    z-index: 20;
}

.btn-download-icon:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.btn-download-icon svg {
    width: 28px;
    height: 28px;
}

.btn-clear-icon {
    position: relative;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-clear-icon::after {
    content: 'Clear All';
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    z-index: 20;
}

.btn-clear-icon:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.btn-clear-icon svg {
    width: 28px;
    height: 28px;
}

.panel,
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.4);
    color: var(--text-primary);
}

.side-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 14px 34px rgba(0,0,0,0.4);
    color: var(--text-primary);
}

input, select, textarea {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.btn-primary, .save-btn {
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 10px;
    box-shadow: 0 12px 26px rgba(211,47,47,0.3);
}

.btn-primary:hover, .save-btn:hover {
    background: var(--accent-hover);
}

.status-bar {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.35);
}

.thumb-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.35);
    color: var(--text-primary);
}

.thumb-card .page-number {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: 0 18px 44px rgba(0,0,0,0.45);
}

.tooltip {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.progress {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.progress-bar {
    background: linear-gradient(90deg, var(--accent) 0%, #f56969 100%);
}

.alert {
    background: rgba(46,125,50,0.15);
    border: 1px solid rgba(46,125,50,0.5);
    color: #CDE9D1;
}
