/* ——— INFIPDF DESIGN SYSTEM ———
   Native Desktop & Mobile Document & Image Studio
   Inspired by Linear, Raycast, and Apple Preview.
   Typography: Clash Display (display headings) + Satoshi (clean geometric UI).
   Brand Identity: Warm Porcelain & Signature Orange (#E8590C) + Obsidian Dark.
*/

:root {
  /* Porcelain Light (Default) */
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-warm: #FFFDF9;
  --surface-muted: #F3EFE6;
  --ink: #14120E;
  --ink2: #484135;
  --muted: #8E8271;
  --line: rgba(20, 18, 14, 0.08);
  --line-strong: rgba(20, 18, 14, 0.16);
  --orange: #E8590C;
  --orange-hover: #D04E07;
  --orange-light: #FF9442;
  --amber-bg: #FFF2DC;
  --amber-border: #FFE2B8;
  --grad: linear-gradient(96deg, #E8590C 0%, #F57C00 100%);
  --ring: conic-gradient(from 0deg, #FEDA75, #FA7E1E, #D62976, #962FBF, #4F5BD5, #FEDA75);
  --disp: "Clash Display", "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --sh-card: 0 1px 3px rgba(20, 18, 14, 0.04), 0 10px 24px -10px rgba(70, 45, 15, 0.1);
  --sh-card-hover: 0 4px 14px rgba(20, 18, 14, 0.06), 0 18px 36px -12px rgba(70, 45, 15, 0.18);
  --sh-modal: 0 24px 60px -15px rgba(20, 18, 14, 0.35), 0 8px 24px -8px rgba(70, 45, 15, 0.15);
  --sh-pop: 0 8px 28px -6px rgba(20, 18, 14, 0.16);

  --topbar-h: 56px;
  --sidebar-w: 240px;
}

/* Obsidian Dark Theme */
[data-theme="dark"] {
  --bg: #0C0E12;
  --surface: #14171E;
  --surface-warm: #1A1E27;
  --surface-muted: #101217;
  --ink: #F3F4F6;
  --ink2: #C7CBD6;
  --muted: #828A9E;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --orange: #FF6A1A;
  --orange-hover: #E8590C;
  --orange-light: #FFA066;
  --amber-bg: rgba(232, 89, 12, 0.18);
  --amber-border: rgba(232, 89, 12, 0.38);
  
  --sh-card: 0 1px 3px rgba(0, 0, 0, 0.25), 0 10px 24px -10px rgba(0, 0, 0, 0.45);
  --sh-card-hover: 0 4px 14px rgba(0, 0, 0, 0.35), 0 18px 36px -12px rgba(0, 0, 0, 0.55);
  --sh-modal: 0 24px 60px -15px rgba(0, 0, 0, 0.7), 0 8px 24px -8px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
  overscroll-behavior: none;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  user-select: none;
}

/* Allow text selection in preview, inputs, and textareas */
input, textarea, [contenteditable="true"], .file-name, .text-output-box, pre, code {
  user-select: text;
}

::selection {
  background: rgba(232, 89, 12, 0.28);
  color: var(--ink);
}

/* Ambient canvas background: soft mesh blobs + dot grid + subtle noise grain */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

[data-theme="dark"] .bg {
  background: radial-gradient(800px 500px at 85% -80px, rgba(232, 89, 12, 0.12), transparent 65%), var(--bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.55;
  pointer-events: none;
}

[data-theme="dark"] .blob {
  opacity: 0.25;
}

.b1 {
  width: 380px;
  height: 380px;
  background: #FFE2B8;
  top: -120px;
  right: -80px;
}

.b2 {
  width: 320px;
  height: 320px;
  background: #FFD4DE;
  top: 40%;
  left: -140px;
}

.b3 {
  width: 280px;
  height: 280px;
  background: #DFE4FF;
  bottom: -100px;
  right: -60px;
}

.dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line) 1.1px, transparent 1.1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 600px);
  pointer-events: none;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='60' height='60' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* =====================================================================
   PERSISTENT NATIVE APP TOP BAR (56px)
   ===================================================================== */
.app-topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: rgba(250, 247, 242, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

[data-theme="dark"] .app-topbar {
  background: rgba(12, 14, 18, 0.88);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
}

.topbar-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  box-shadow: 0 2px 10px -2px rgba(232, 89, 12, 0.4);
}

.topbar-title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  color: #16A34A;
  letter-spacing: 0.04em;
}

[data-theme="dark"] .engine-badge {
  background: rgba(34, 197, 94, 0.16);
  color: #4ADE80;
}

.engine-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 8px #22C55E;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* Spotlight-Style Search Bar */
.topbar-center {
  flex: 1;
  max-width: 480px;
  margin: 0 16px;
}

.spotlight-search {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.spotlight-search .search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  stroke-width: 2.2;
  fill: none;
  pointer-events: none;
}

.spotlight-search input {
  width: 100%;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 68px 0 36px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(20, 18, 14, 0.04);
}

.spotlight-search input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 89, 12, 0.18), 0 2px 8px -2px rgba(232, 89, 12, 0.15);
  background: var(--surface-warm);
}

.spotlight-search .search-kbd {
  position: absolute;
  right: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  pointer-events: none;
  line-height: 1.2;
}

.spotlight-search .search-clear {
  position: absolute;
  right: 36px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotlight-search .search-clear:hover {
  color: var(--ink);
}

/* Topbar Actions */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(20, 18, 14, 0.04);
}

.topbar-btn:hover {
  background: var(--surface-muted);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.topbar-btn:active {
  transform: scale(0.98);
}

.topbar-btn svg {
  width: 15px;
  height: 15px;
}

.topbar-btn.icon-only {
  width: 36px;
  padding: 0;
  justify-content: center;
}

.topbar-btn.pwa-btn {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.topbar-btn.pwa-btn:hover {
  background: var(--orange);
  border-color: var(--orange);
}

/* Theme Toggle Icons */
.theme-sun {
  display: block;
}
.theme-moon {
  display: none;
}
[data-theme="dark"] .theme-sun {
  display: none;
}
[data-theme="dark"] .theme-moon {
  display: block;
}

.exports-badge {
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
}

/* =====================================================================
   MAIN APP LAYOUT (Sidebar + Content Stage)
   ===================================================================== */
.app-layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
  position: relative;
}

/* Left Navigation Sidebar (240px fixed on desktop) */
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: rgba(250, 247, 242, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .app-sidebar {
  background: rgba(12, 14, 18, 0.6);
}

.sidebar-top {
  margin-bottom: 16px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding: 4px 10px 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink2);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.sidebar-nav-item:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.sidebar-nav-item.active {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: var(--orange);
  font-weight: 700;
}

.sidebar-nav-item .snav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav-item .snav-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.sidebar-nav-item .snav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav-item .snav-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-muted);
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.sidebar-nav-item.active .snav-count {
  background: #FFF;
  color: var(--orange);
}

/* Quick Drop Zone Card at Sidebar Bottom */
.sidebar-drop-card {
  margin-top: auto;
  background: var(--surface-warm);
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-drop-card:hover, .sidebar-drop-card.dragover {
  border-color: var(--orange);
  background: var(--amber-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px -4px rgba(232, 89, 12, 0.25);
}

.sdc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--amber-bg);
  color: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sdc-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sdc-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sdc-text strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.sdc-text span {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.app-main {
  flex: 1;
  min-width: 0;
  padding: 24px 32px 80px;
}

/* =====================================================================
   HIGH-DENSITY APP GRID LAUNCHER
   ===================================================================== */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.view-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.view-title-group h2 {
  font-family: var(--disp);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.sec-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Quick Launch Pills */
.quick-launch-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ql-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ql-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.qa-pill {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.qa-pill svg {
  width: 13px;
  height: 13px;
  display: block;
  flex-shrink: 0;
}

.qa-pill:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  transform: translateY(-1px);
}

/* High-Density Multi-Column Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

/* Compact Native Tool Card */
.tool-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--sh-card);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 89, 12, 0.35);
  box-shadow: var(--sh-card-hover);
}

.tool-card:active {
  transform: scale(0.99);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-icon-badge svg {
  width: 20px;
  height: 20px;
  display: block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card:hover .card-icon-badge svg {
  transform: scale(1.12);
}

/* Tinted Category Badges */
.badge-pdf { background: rgba(232, 89, 12, 0.12); border-color: rgba(232, 89, 12, 0.26); color: var(--orange); }
.badge-image { background: rgba(147, 51, 234, 0.12); border-color: rgba(147, 51, 234, 0.26); color: #9333EA; }
.badge-convert { background: rgba(14, 165, 233, 0.12); border-color: rgba(14, 165, 233, 0.26); color: #0EA5E9; }
.badge-edit { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.26); color: #D97706; }
.badge-security { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.26); color: #059669; }

.tool-card:hover .badge-pdf { background: rgba(232, 89, 12, 0.18); border-color: rgba(232, 89, 12, 0.45); }
.tool-card:hover .badge-image { background: rgba(147, 51, 234, 0.18); border-color: rgba(147, 51, 234, 0.45); }
.tool-card:hover .badge-convert { background: rgba(14, 165, 233, 0.18); border-color: rgba(14, 165, 233, 0.45); }
.tool-card:hover .badge-edit { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.45); }
.tool-card:hover .badge-security { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.45); }

.card-kw-badge {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-muted);
  padding: 3px 8px;
  border-radius: 6px;
}

.card-star-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s;
  padding: 0;
  margin-left: auto;
}

.card-star-btn:hover {
  border-color: #F5A12E;
  color: var(--orange);
  transform: scale(1.1);
}

.card-star-btn.starred {
  background: var(--amber-bg);
  border-color: #F5A12E;
  color: var(--orange);
}

.card-title {
  font-family: var(--disp);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc mark {
  background: transparent;
  color: var(--orange);
  font-weight: 700;
}

.card-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-muted);
  color: var(--muted);
  flex-shrink: 0;
}

.card-badge.new {
  background: rgba(34, 197, 94, 0.15);
  color: #16A34A;
}

.card-badge.pro {
  background: var(--amber-bg);
  color: var(--orange);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  max-width: 500px;
  margin: 40px auto;
}

.empty-state[hidden] {
  display: none !important;
}

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

.empty-state h3 {
  font-family: var(--disp);
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

/* =====================================================================
   DEDICATED 2-PANE STUDIO WORKSPACE (#toolPage)
   ===================================================================== */
.page-view {
  display: block;
  width: 100%;
}

.page-view[hidden] {
  display: none !important;
}

/* Studio Navbar */
.tool-navbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
}

[data-theme="dark"] .tool-navbar {
  background: rgba(12, 14, 18, 0.94);
}

.tool-navbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tool-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 6px 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-back-btn:hover {
  background: var(--surface-muted);
}

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

.nav-esc-kbd {
  font-family: monospace;
  font-size: 10px;
  font-weight: 700;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
}

.nav-sep {
  color: var(--line-strong);
  font-weight: 700;
}

.nav-brand-tag {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.kw {
  font-family: var(--disp);
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  background: var(--amber-bg);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.06em;
}

.tool-nav-icon-badge {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.tool-nav-icon-badge svg {
  width: 15px;
  height: 15px;
  display: block;
}

.tool-nav-heading {
  font-family: var(--disp);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-home-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}

.nav-home-pill:hover {
  background: var(--surface-muted);
}

.nav-home-pill svg {
  width: 14px;
  height: 14px;
}

/* Full-Screen Workspace Body Container */
.tool-fullscreen-wrap {
  max-width: 1440px;
  margin: 18px auto;
  padding: 0 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wb-tip-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--ink2);
}

.tip-icon {
  font-size: 15px;
}

/* =====================================================================
   2-PANE STUDIO WORKSPACE GRID
   ===================================================================== */
.studio-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }
}

/* Main Stage (Left) */
.studio-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* Zoom Controls Bar */
.studio-zoom-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 12px;
  width: fit-content;
}

.zoom-btn {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}

.zoom-btn:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.zoom-btn.icon {
  width: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zoom-level {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  min-width: 44px;
  text-align: center;
}

/* Inspector Panel (Right) */
.studio-inspector {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--sh-card);
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inspector-section h4 {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.inspector-sticky-action {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

/* Reusable Dropzone */
.dropzone {
  border: 2px dashed rgba(20, 18, 14, 0.2);
  border-radius: 20px;
  padding: 40px 24px;
  text-align: center;
  background: var(--surface-warm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

[data-theme="dark"] .dropzone {
  border-color: rgba(255, 255, 255, 0.2);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--orange);
  background: var(--amber-bg);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(232, 89, 12, 0.25);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--orange);
}

.dropzone-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--orange);
}

.dropzone h4 {
  font-family: var(--disp);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
}

.dropzone p {
  color: var(--muted);
  font-size: 13.5px;
}

.dropzone .browse-pill {
  background: var(--ink);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  padding: 7px 16px;
  border-radius: 999px;
  margin-top: 4px;
  box-shadow: 0 4px 12px -4px rgba(20, 18, 14, 0.4);
}

/* General Workbench Sections */
.wb-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--sh-card);
}

.wb-section h4 {
  font-family: var(--disp);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* File items list */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 12px;
  transition: transform 0.2s;
}

.file-item .file-order {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 12px;
  color: var(--orange);
  background: var(--amber-bg);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.file-item .file-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #FFF;
}

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

.file-item .file-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item .file-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.file-actions {
  display: flex;
  gap: 4px;
}

.file-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
}

.file-btn:hover:not(:disabled) {
  background: var(--ink);
  color: #FFF;
}

.file-btn.delete:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFF;
}

.file-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Control Fields & Sliders */
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
}

.control-field .label-val {
  color: var(--orange);
  font-weight: 800;
}

.control-field input[type="text"],
.control-field input[type="number"],
.control-field select {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 10px;
  font-family: var(--sans);
  font-size: 13px;
  background: var(--surface-warm);
  color: var(--ink);
  outline: none;
}

.control-field input[type="text"]:focus,
.control-field input[type="number"]:focus,
.control-field select:focus {
  border-color: var(--orange);
}

/* Standard Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-muted);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--orange);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(232, 89, 12, 0.4);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Radio Pill Group */
.radio-pill-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.radio-pill-group label {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  background: var(--surface-warm);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.radio-pill-group label:has(input:checked) {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.radio-pill-group input {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 800;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary {
  height: 44px;
  padding: 0 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 13.5px;
}

.btn-secondary:hover {
  background: var(--surface-muted);
}

.btn-primary {
  height: 46px;
  padding: 0 22px;
  background: var(--ink);
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  width: 100%;
  box-shadow: 0 4px 14px -4px rgba(20, 18, 14, 0.4);
}

.btn-primary:hover {
  background: var(--orange);
  box-shadow: 0 6px 18px -4px rgba(232, 89, 12, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: var(--muted);
  box-shadow: none;
}

.wb-bottom-bar {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* FIXED TOAST NOTIFICATION (MANDATORY REQUIREMENT) */
.wb-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  animation: toastRise 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.wb-toast[hidden] {
  display: none !important;
}

@keyframes toastRise {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* Chaining Suggestion Shelf */
.wb-chaining-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 14px;
  flex-wrap: wrap;
}

.chaining-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chaining-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chain-btn {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.chain-btn:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Tool Footer */
.tool-page-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

/* =====================================================================
   RECENT EXPORTS DRAWER (IndexedDB: InfiPDF_Exports)
   ===================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  animation: fadeIn 0.2s ease-out both;
}

.drawer-backdrop[hidden] {
  display: none !important;
}

.exports-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  z-index: 1001;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.exports-drawer.open {
  transform: translateX(0);
}

.exports-drawer[hidden] {
  display: none !important;
}

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

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-title-group h3 {
  font-family: var(--disp);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.drawer-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  background: var(--amber-bg);
  padding: 2px 8px;
  border-radius: 999px;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.drawer-close-btn:hover {
  color: var(--ink);
}

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

.drawer-empty {
  text-align: center;
  padding: 40px 10px;
  color: var(--muted);
  font-size: 13px;
}

.export-card {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s;
}

.export-card:hover {
  border-color: rgba(232, 89, 12, 0.3);
}

.exp-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exp-type-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--amber-bg);
  color: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

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

.exp-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exp-meta {
  font-size: 11px;
  color: var(--muted);
}

.exp-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.exp-btn {
  flex: 1;
  height: 30px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
}

.exp-btn:hover {
  background: var(--ink);
  color: #fff;
}

.exp-btn.delete {
  flex: none;
  width: 30px;
  color: var(--muted);
}

.exp-btn.delete:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.drawer-clear-btn {
  width: 100%;
  font-size: 12.5px;
}

/* =====================================================================
   COLLAPSIBLE MOBILE BOTTOM TAB BAR (< 768px)
   ===================================================================== */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
}

[data-theme="dark"] .mobile-tab-bar {
  background: rgba(12, 14, 18, 0.94);
}

.tab-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
}

.tab-btn.active {
  color: var(--orange);
}

.tab-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.tab-label {
  font-size: 10.5px;
  font-weight: 700;
}

/* =====================================================================
   SPECIFIC WORKBENCH & TOOL STYLES
   ===================================================================== */
/* e-Sign Signature Pad */
.sig-canvas-wrap {
  border: 2px dashed var(--line-strong);
  border-radius: 16px;
  background: #FFFDF9;
  position: relative;
  overflow: hidden;
  touch-action: none;
}

[data-theme="dark"] .sig-canvas-wrap {
  background: #181B22;
}

.sig-canvas-wrap canvas {
  width: 100%;
  height: 180px;
  display: block;
  cursor: crosshair;
}

.sig-pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.pos-btn {
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.pos-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.pos-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Compare PDF Diff Viewer */
.diff-slider-wrap {
  position: relative;
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #14120E;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diff-slider-wrap canvas {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
}

/* QR Code Preview Box */
.qr-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-top: 14px;
}

.qr-preview-box canvas, .qr-preview-box img {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

/* N-Up Grid Selector */
.nup-grid-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.nup-pill {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-warm);
  font-family: var(--sans);
  font-weight: 800;
  font-size: 12px;
  color: var(--ink);
  transition: all 0.15s;
}

.nup-pill:hover {
  border-color: var(--orange);
}

.nup-pill.active {
  border-color: var(--orange);
  background: var(--ink);
  color: #fff;
}

/* Blank Page Remover Page Grid */
.blank-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding: 10px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.blank-page-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.blank-page-card.blank-detected {
  border-color: #DC2626;
  opacity: 0.6;
}

.blank-page-card.blank-detected::after {
  content: "BLANK";
  position: absolute;
  top: 8px;
  right: 8px;
  background: #DC2626;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 4px;
}

.blank-page-card canvas {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #FFF;
}

.blank-page-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

/* Redaction / Censor Overlay Canvas */
.censor-canvas-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: inline-block;
  max-width: 100%;
}

.censor-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  cursor: crosshair;
}

/* Metadata Form Grid */
.meta-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .meta-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Collage Thumbnails Strip */
.collage-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  margin-top: 8px;
}

.col-thumb-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-warm);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.col-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.col-thumb-ctrls {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.col-thumb-item:hover .col-thumb-ctrls {
  opacity: 1;
}

.col-thumb-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Global Drag & Drop Overlay */
.global-drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease-out both;
  pointer-events: none;
}

.global-drop-overlay[hidden] {
  display: none !important;
}

.drop-hint-box {
  background: var(--surface);
  border: 2px dashed var(--orange);
  border-radius: 28px;
  padding: 48px;
  text-align: center;
  max-width: 440px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.drop-hint-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.drop-hint-box h3 {
  font-family: var(--disp);
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--ink);
}

.drop-hint-box p {
  color: var(--muted);
  font-size: 14px;
}

/* Back to Top Floating Button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 90;
  transition: all 0.15s;
}

.back-to-top:hover {
  transform: translateY(-2px);
  background: var(--ink);
  color: #fff;
}

.back-to-top[hidden] {
  display: none !important;
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* =====================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ===================================================================== */
@media (max-width: 768px) {
  .app-sidebar {
    display: none;
  }

  .mobile-tab-bar {
    display: flex;
  }

  .app-main {
    padding: 16px 14px 80px;
  }

  .topbar-left {
    min-width: auto;
  }

  .engine-badge {
    display: none;
  }

  .topbar-btn .btn-label {
    display: none;
  }

  .topbar-center {
    margin: 0 8px;
  }

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

  .back-to-top {
    bottom: 76px;
    right: 16px;
  }

  .wb-toast {
    bottom: 76px;
  }
}
