* {
  box-sizing: border-box;
}

:root {
  /* Bangladesh Theme Palette */
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;

  /* Bangladeshi Emerald Green */
  --brand: #007953;
  --brand-dark: #005f41;
  --brand-light: #e6f6ee;
  --brand-hover: #f0faf4;
  --brand-border: #a3e3c6;

  /* Tool Color Categories (Smallpdf Style) */
  --color-purple: #7961f2;
  --color-blue: #3d99f5;
  --color-red: #f23030;
  --color-amber: #ffb700;
  --color-coral: #ff5975;
  --color-teal: #007953;

  /* Bangladeshi Crimson Red Accent */
  --accent-red: #e11d48;
  --accent-red-hover: #be123c;
  --accent-red-light: #fff1f2;
  --accent-red-border: #fecdd3;

  /* Surfaces & Geometry */
  --surface: #ffffff;
  --soft: #f7faf8;
  --danger: #e11d48;
  --danger-soft: #fff1f2;
  --success: #059669;
  --radius: 16px;
  --radius-sm: 10px;
}

/* Global Media Constraints: Prevents elements from breaking out of boxes */
img, canvas, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fbfdfc;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1140px, calc(100% - 40px));
  margin: auto;
}

/* Header & Navigation */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #ffffff;
  border-radius: 10px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 121, 83, 0.28);
  position: relative;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  font-weight: 600;
}

.nav-link {
  color: #475569;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--brand);
}

.logout-form {
  margin: 0;
  display: inline-flex;
}

/* =========================================================================
   TOOLS DROPDOWN BUTTON & MEGA MENU (WITH COLOR ICONS)
   ========================================================================= */

.dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-tools-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 36px;
}

.btn-tools-dropdown:hover {
  background: var(--brand-hover);
  border-color: var(--brand);
}

.grid-icon {
  color: var(--ink);
  display: grid;
  place-items: center;
}

.chevron-icon {
  color: #64748b;
  display: grid;
  place-items: center;
}

.tools-mega-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
  padding: 22px;
  display: none;
  grid-template-columns: repeat(3, 205px);
  gap: 22px;
  z-index: 100;
}

.tools-mega-menu.active {
  display: grid;
}

.mega-menu-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega-menu-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.mega-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.mega-menu-link:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.mega-all-link {
  color: var(--brand);
  font-weight: 750;
  margin-top: 4px;
}

/* Color-Coded Mini Tool Badges */
.tool-mini-badge {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.badge-purple { background-color: var(--color-purple); }
.badge-blue   { background-color: var(--color-blue); }
.badge-red    { background-color: var(--color-red); }
.badge-amber  { background-color: var(--color-amber); }
.badge-coral  { background-color: var(--color-coral); }
.badge-teal   { background-color: var(--color-teal); }

.badge-letter {
  font-weight: 850;
  font-size: 12.5px;
  line-height: 1;
}

/* Hamburger Button (Mobile) */
.btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  padding: 0;
}

.btn-hamburger:hover {
  background: #f9fafb;
}

/* Mobile Off-Canvas Drawer */
.mobile-nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 2px solid var(--brand-border);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  padding: 24px 18px;
  z-index: 95;
}

.mobile-nav-drawer.active {
  display: block;
}

.mobile-drawer-section {
  margin-bottom: 20px;
}

.drawer-section-title {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 10px;
}

.mobile-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mobile-tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 8px;
  background: #f9fafb;
}

.mobile-link {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 6px;
  background: #f9fafb;
  margin-bottom: 6px;
}

.mobile-tool-item:hover, .mobile-link:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.mobile-drawer-auth {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  background: #ffffff;
  color: var(--ink);
  transition: all 0.15s ease;
}

.button:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 121, 83, 0.22);
}

.button.primary:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.button.danger {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.2);
}

.button.danger:hover:not(:disabled) {
  background: var(--accent-red-hover);
  border-color: var(--accent-red-hover);
}

.button.full {
  width: 100%;
  margin-top: 8px;
}

.btn-large {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-text-danger {
  color: var(--accent-red);
}

.btn-text-danger:hover:not(:disabled) {
  background: var(--accent-red-light);
  border-color: var(--accent-red-border);
}

/* Hero Section */
.hero {
  padding: 72px 0 54px;
  text-align: center;
  background: radial-gradient(ellipse at top, #eaf6f0 0%, #fbfdfc 65%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  max-width: 820px;
  margin: 22px auto 18px;
  font-weight: 850;
}

.hero p {
  max-width: 640px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-btn {
  padding: 12px 24px;
  font-size: 15px;
}

.hero-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.hero-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-badge-item svg {
  color: var(--brand);
}

/* Tool Grid & Cards */
.section {
  padding: 56px 0 72px;
}

.section-alt {
  background: #f7faf8;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  text-align: center;
  margin-bottom: 38px;
}

.section-heading h2 {
  font-size: 32px;
  letter-spacing: -0.035em;
  margin: 0 0 8px;
  font-weight: 800;
}

.max-text {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 121, 83, 0.08);
  border-color: var(--brand-border);
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tool-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-light);
  color: var(--brand);
}

.tool-badge {
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
  padding: 3px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tool-card h3 {
  font-size: 16.5px;
  margin: 0 0 6px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.tool-card p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
  flex-grow: 1;
}

.tool-action-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
}

/* Feature Boxes & Privacy */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.feature-box {
  padding: 28px;
}

.feature-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-light);
  color: var(--brand);
  margin-bottom: 18px;
}

.feature-box h3 {
  font-size: 18px;
  margin: 0 0 8px;
  font-weight: 750;
}

.feature-box p {
  font-size: 14px;
  margin: 0;
  line-height: 1.55;
}

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  text-align: center;
  padding: 28px 20px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  background: #ffffff;
}

.step-number {
  width: 38px;
  height: 38px;
  line-height: 38px;
  background: var(--brand);
  color: #ffffff;
  border-radius: 50%;
  margin: 0 auto 16px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(0, 121, 83, 0.2);
}

.step-card h3 {
  font-size: 17px;
  margin: 0 0 8px;
}

.step-card p {
  font-size: 13.5px;
  margin: 0;
}

/* CTA Banner */
.cta-banner {
  background: #0f271e;
  color: #ffffff;
  border-radius: 20px;
  padding: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid #1c4234;
}

.cta-content h2 {
  font-size: 28px;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  font-weight: 800;
}

.cta-content p {
  color: #a7d6c2;
  margin: 0;
  font-size: 15px;
  max-width: 540px;
}

.cta-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cta-banner .button {
  background: #17382c;
  color: #ffffff;
  border-color: #245241;
}

.cta-banner .button:hover {
  background: #1f4738;
}

.cta-banner .button.primary {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.cta-banner .button.primary:hover {
  background: var(--accent-red-hover);
}

/* Ad Slot System */
.ad-slot {
  min-height: 96px;
  border: 1px dashed #cbd5e1;
  background: #fafcfb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 28px auto;
  max-width: 960px;
  overflow: hidden;
}

.ad-placeholder-inner {
  text-align: center;
  padding: 14px;
}

.ad-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 2px;
}

.ad-note {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 54px 0 32px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 14.5px;
  font-weight: 750;
  color: var(--ink);
  margin: 0 0 16px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--brand);
}

.footer-desc {
  font-size: 13.5px;
  margin: 14px 0 18px;
  max-width: 320px;
  line-height: 1.5;
}

.badge.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ecfdf5;
  color: #065f46;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #d1fae5;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 12.5px;
}

/* Tool Workspace & Upload Zone */
.tool-breadcrumb {
  margin-bottom: 20px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.back-link:hover {
  color: var(--brand);
}

.tool-header {
  margin-bottom: 24px;
}

.tool-subtitle {
  font-size: 17px;
  margin: 4px 0 12px;
}

.text-center {
  text-align: center;
}

.tool-workspace {
  max-width: 880px;
  margin: 28px auto 48px;
}

.upload-box {
  border: 2px dashed var(--brand-border);
  border-radius: 20px;
  padding: 56px 24px;
  text-align: center;
  background: #f7fbf9;
  transition: all 0.2s ease;
}

.upload-box.drag-over {
  border-color: var(--brand);
  background: #edf8f3;
  transform: scale(1.01);
}

.upload-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--brand);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 121, 83, 0.12);
}

.upload-box strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.upload-box .select-btn {
  margin: 18px 0 12px;
  padding: 13px 30px;
  font-size: 15px;
}

/* Smart Homepage Auto-Uploader */
.home-upload-container {
  max-width: 820px;
  margin: 24px auto 0;
}

.home-drop-box {
  background: #ffffff;
  border: 2px dashed var(--brand-border);
  box-shadow: 0 10px 30px rgba(0, 121, 83, 0.05);
}

.smart-tray-panel {
  text-align: left;
  border: 2px solid var(--brand-border);
  box-shadow: 0 14px 40px rgba(0, 121, 83, 0.08);
  padding: 30px;
}

.smart-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
  gap: 14px;
}

.smart-title {
  font-size: 20px;
  margin: 0;
  color: var(--ink);
}

.smart-files-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-light);
  color: var(--brand-dark);
  border: 1px solid var(--brand-border);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 650;
  max-width: 100%;
}

.file-chip-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.file-chip-size {
  color: var(--brand);
  font-size: 11px;
}

.smart-actions-wrap {
  margin-top: 10px;
}

.smart-actions-label {
  display: block;
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.smart-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.smart-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.smart-action-card:hover {
  border-color: var(--brand-border);
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 121, 83, 0.08);
}

.smart-action-card.action-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 121, 83, 0.22);
}

.smart-action-card.action-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.smart-action-card.action-primary p {
  color: #e6f6ee;
}

.smart-action-card.action-primary .smart-action-arrow {
  color: #ffffff;
}

.smart-action-body strong {
  display: block;
  font-size: 15px;
  margin-bottom: 3px;
}

.smart-action-body p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.35;
}

.smart-action-arrow {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  margin-left: 12px;
}

/* File Queue Component */
.queue-card {
  padding: 30px;
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.queue-title {
  font-size: 20px;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.queue-hint {
  font-size: 13px;
  margin: 0;
}

.queue-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}

.file-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 12px;
  gap: 16px;
  transition: all 0.15s ease;
}

.file-queue-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.file-order-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  width: 22px;
  text-align: center;
}

.file-icon-pill {
  font-size: 11px;
  font-weight: 800;
  background: var(--brand-light);
  color: var(--brand);
  padding: 6px 10px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}

.file-meta {
  overflow: hidden;
}

.file-name {
  display: block;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 440px;
}

.file-sub-info {
  font-size: 12.5px;
  color: var(--muted);
}

.file-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-reorder-group {
  display: flex;
  gap: 4px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-icon.btn-delete:hover:not(:disabled) {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border-color: var(--accent-red-border);
}

.queue-footer {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.queue-action-btns {
  display: flex;
  justify-content: flex-end;
}

/* Progress Bar Component */
.progress-wrap {
  width: 100%;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007953, #10b981);
  border-radius: 99px;
  transition: width 0.25s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* Result Box */
.result-box {
  text-align: center;
  padding: 48px 24px;
}

.success-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 50%;
}

.result-box h2 {
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.success-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* Forms, Panels & Utility */
.page {
  padding: 40px 0 80px;
  min-height: 65vh;
}

.page-title {
  font-size: 36px;
  letter-spacing: -0.035em;
  margin: 0 0 8px;
  font-weight: 800;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
}

.auth-wrap {
  max-width: 460px;
  margin: 20px auto;
}

.auth-wrap h1 {
  margin-top: 0;
}

.field {
  margin: 16px 0;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 7px;
}

input {
  display: block;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #d9e0e8;
  border-radius: 9px;
  font: inherit;
  background: #ffffff;
}

input:focus {
  outline: 3px solid #d1fae5;
  border-color: var(--brand);
}

.notice {
  padding: 14px 18px;
  background: var(--brand-light);
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  margin: 14px 0;
  font-size: 14px;
}

.notice.error {
  background: var(--accent-red-light);
  border-color: var(--accent-red-border);
  color: var(--accent-red);
}

.notice.success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.tiny {
  font-size: 12px;
  margin-top: 18px;
}

/* Responsive Table Styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

th {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 750;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--line);
}

td {
  padding: 11px 14px;
  border: 1px solid var(--line);
}

tr:nth-child(even) {
  background: #f8fafc;
}

tr:hover {
  background: var(--brand-hover);
}

/* Pill Selectors */
.pill-group {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.pill-btn {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.pill-btn:hover {
  color: var(--ink);
}

.pill-btn.active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 121, 83, 0.25);
}

/* Settings Panels */
.layout-settings-panel {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.settings-row-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.settings-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

/* Password Form Components */
.password-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 42px;
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 4px;
}

.btn-toggle-pwd:hover {
  color: var(--brand);
}

.pwd-strength-wrap {
  margin-top: 8px;
}

.pwd-strength-bar {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 4px;
}

.pwd-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.pwd-strength-fill.weak {
  background-color: var(--accent-red);
}

.pwd-strength-fill.medium {
  background-color: #f59e0b;
}

.pwd-strength-fill.strong {
  background-color: var(--brand);
}

.pwd-strength-text {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.permissions-checkbox-group {
  display: flex;
  gap: 18px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.perm-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
}

.perm-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Stats Comparison */
.comparison-card {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 28px;
  margin: 20px auto 10px;
}

.comparison-stat {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  margin-top: 2px;
}

.stat-highlight {
  color: var(--brand);
}

.comparison-arrow {
  font-size: 22px;
  color: #94a3b8;
  font-weight: 700;
}

.savings-pill {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 800;
}

/* =========================================================================
   CONTAINED & RESPONSIVE IMAGE & PDF PREVIEW BOXES
   ========================================================================= */

/* 1. JPG to PDF Image Queue Cards */
.img-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding: 8px 4px;
}

.img-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.img-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 121, 83, 0.08);
  border-color: var(--brand-border);
}

.img-card-preview {
  width: 100%;
  height: 180px;
  max-height: 180px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.img-card-preview img {
  max-width: 95%;
  max-height: 95%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.img-order-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  z-index: 2;
}

.img-card-details {
  padding: 8px 2px 6px;
  display: flex;
  flex-direction: column;
}

.img-card-name {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.img-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
}

/* 2. PDF to JPG Gallery Grid */
.gallery-wrapper {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.images-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  margin-top: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding: 4px;
}

.gallery-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.gallery-img-wrap {
  width: 100%;
  height: 200px;
  max-height: 200px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-img-wrap img {
  max-width: 95%;
  max-height: 95%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.gallery-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 4px 10px;
}

.btn-download-single {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
  width: 100%;
  text-align: center;
}

.btn-download-single:hover {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand-border);
}

/* 3. Rotate & Organize PDF Thumbnail Cards */
.pages-rotate-grid,
.pages-organize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding: 6px 4px;
}

.rotate-page-card,
.organize-page-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.rotate-thumb-wrap,
.organize-thumb-wrap {
  width: 100%;
  height: 180px;
  max-height: 180px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}

.rotate-thumb-preview,
.organize-thumb-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rotate-thumb-preview canvas,
.organize-thumb-preview canvas {
  max-width: 90% !important;
  max-height: 90% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.angle-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 6px;
  z-index: 2;
}

.angle-badge.badge-rotated {
  background: var(--brand);
}

.rotate-card-hover-actions {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 3;
}

.rotate-page-card:hover .rotate-card-hover-actions {
  opacity: 1;
}

.organize-order-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  z-index: 2;
}

.organize-orig-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  z-index: 2;
}

.organize-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  margin-top: 4px;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
}

.organize-card-actions .btn-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

/* 4. Split PDF Page Cards */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
  max-height: 480px;
  overflow-y: auto;
  padding: 6px 4px;
}

.page-thumb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 8px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
}

.page-thumb-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.page-thumb-card.active {
  border-color: var(--brand);
  background: var(--brand-hover);
  box-shadow: 0 4px 14px rgba(0, 121, 83, 0.15);
}

.page-thumb-preview {
  width: 100%;
  height: 120px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 8px;
}

.page-corner-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  background: #cbd5e1;
  color: #ffffff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  transition: all 0.15s ease;
  z-index: 2;
}

.page-thumb-card.active .page-corner-check {
  background: var(--brand);
}

/* 5. Word to PDF Sheet & Preview Windows */
.doc-preview-wrapper {
  margin-top: 24px;
}

.doc-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.doc-sheet-container {
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
}

.doc-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  min-height: 600px;
  padding: 40px 48px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  font-family: 'Times New Roman', Times, serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a1a;
}

.doc-sheet img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 14px auto;
  object-fit: contain;
}

.extracted-text-wrap {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  text-align: left;
}

.text-preview-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 30px;
  max-height: 420px;
  overflow-y: auto;
  font-family: Calibri, Inter, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: #1e293b;
}

.preview-page-divider {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #e2e8f0;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
  margin: 14px 0 8px;
}

.preview-page-divider:first-child {
  margin-top: 0;
}

/* =========================================================================
   ALWAYS-FLOATING BOTTOM-CENTER LIVE COUNTER (MOBILE & DESKTOP)
   ========================================================================= */

.floating-counter-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.floating-counter-bar .counter-badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid var(--brand);
  border-radius: 99px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
  user-select: none;
  cursor: default;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  backdrop-filter: blur(8px);
}

.floating-counter-bar .counter-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 121, 83, 0.25);
}

.counter-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--brand);
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.counter-pulse-dot::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: rgba(0, 121, 83, 0.4);
  animation: counter-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes counter-ping {
  0% {
    transform: scale(0.8);
    opacity: 0.9;
  }
  80%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.counter-text {
  letter-spacing: 0.02em;
}

.counter-text strong {
  font-weight: 850;
  color: var(--brand);
}

/* Media Queries */
@media (max-width: 1024px) {
  .tool-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .features-grid,
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
  .footer-col:last-child {
    grid-column: span 3;
  }
}

@media (max-width: 850px) {
  .cta-banner {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }
  .cta-content p {
    margin: 0 auto;
  }
  .cta-buttons {
    width: 100%;
    justify-content: center;
  }
  .settings-row-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .features-grid,
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-col:last-child {
    grid-column: span 1;
  }
  .footer-row {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  .queue-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .file-name {
    max-width: 220px;
  }
  .comparison-card {
    flex-direction: column;
    gap: 14px;
    width: 100%;
  }
  .comparison-stat {
    text-align: center;
  }
  .comparison-arrow {
    transform: rotate(90deg);
  }
  .rotate-card-hover-actions {
    opacity: 1;
  }
}

@media (max-width: 650px) {
  .img-preview-grid,
  .images-gallery-grid,
  .pages-rotate-grid,
  .pages-organize-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .img-card-preview,
  .rotate-thumb-wrap,
  .organize-thumb-wrap {
    height: 140px;
  }
  .gallery-img-wrap {
    height: 150px;
  }
  .smart-actions-grid {
    grid-template-columns: 1fr;
  }
  .doc-sheet-container {
    padding: 12px;
  }
  .doc-sheet {
    padding: 24px 18px;
  }
}

@media (max-width: 640px) {
  .btn-tools-label {
    display: none; /* Collapse text so [ ☷ ▾ ] shows on mobile */
  }
  .btn-tools-dropdown {
    padding: 0 8px;
    height: 36px;
  }
  .btn-hamburger {
    display: inline-flex; /* Hamburger button on mobile */
  }
  .tools-mega-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 64px;
    grid-template-columns: 1fr;
    gap: 14px;
    max-height: 75vh;
    overflow-y: auto;
  }
}

@media (max-width: 600px) {
  .container {
    width: min(100% - 28px, 1140px);
  }
  .nav {
    height: 64px;
    gap: 12px;
  }
  .nav-left {
    gap: 8px;
  }
  .nav-links {
    gap: 12px;
    font-size: 13px;
  }
  .nav-links .hide-mobile {
    display: none;
  }
  .hero {
    padding: 48px 0 38px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .hero p {
    font-size: 16px;
  }
  .hero-badges {
    gap: 14px;
    flex-direction: column;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .cta-buttons {
    flex-direction: column;
  }
  .cta-banner .button {
    width: 100%;
  }
  .file-queue-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .file-item-right {
    width: 100%;
    justify-content: space-between;
  }
  .queue-action-btns,
  .queue-action-btns .button {
    width: 100%;
  }
  .password-form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .floating-counter-bar {
    bottom: 14px;
  }
  .floating-counter-bar .counter-badge {
    font-size: 12px;
    padding: 5px 14px;
  }
}
/* =========================================================================
   SIGNATURE & PHOTO RESIZER (MATCHING SCREENSHOT SPEC)
   ========================================================================= */

.resizer-panel {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px;
}

.preset-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--ink);
}

.custom-dim-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* Dotted Target Guide Box (Screenshot 1:1) */
.resizer-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px auto;
  width: 100%;
}

.dotted-guide-box {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 300 / 80;
  border: 2px dashed #9ca3af;
  border-radius: 4px;
  background-image: 
    linear-gradient(45deg, #f3f4f6 25%, transparent 25%), 
    linear-gradient(-45deg, #f3f4f6 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #f3f4f6 75%), 
    linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dotted-guide-box:active {
  cursor: grabbing;
}

.dotted-guide-box canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Resizer Controls with Arrow / Zoom / Rotate Buttons */
.resizer-controls-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 440px;
  margin: 0 auto 24px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-nudge {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: 1px solid #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-nudge:hover {
  background: #bfdbfe;
  border-color: #93c5fd;
}

/* Rounded Blue Sliders matching screenshot */
.resizer-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 99px;
  background: #e5e7eb;
  outline: none;
}

.resizer-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0055ff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 85, 255, 0.4);
  transition: transform 0.1s ease;
}

.resizer-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.resizer-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0055ff;
  cursor: pointer;
  border: none;
}

/* Resizer Footer & Action Buttons */
.resizer-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.output-spec-pill {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
  background: var(--soft);
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--line);
  flex-wrap: wrap;
  justify-content: center;
}

.resizer-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  justify-content: center;
}

.resizer-actions .button {
  flex: 1;
}

@media (max-width: 600px) {
  .resizer-panel {
    padding: 18px;
  }
  .dotted-guide-box {
    max-width: 100%;
  }
  .btn-nudge {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
  .output-spec-pill {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}
/* =========================================================================
   WATERMARK PDF SPECIFIC STYLES
   ========================================================================= */

.watermark-panel {
  max-width: 960px;
  margin: 0 auto;
}

.watermark-layout-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  margin-top: 20px;
}

.watermark-controls-col {
  display: flex;
  flex-direction: column;
}

.wm-preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 16px;
}

.wm-preset-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wm-preset-btn:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.wm-preset-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.control-slider-group {
  margin-bottom: 16px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slider-label-row label {
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 650;
}

.slider-val-badge {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--brand);
  background: var(--brand-light);
  padding: 2px 8px;
  border-radius: 6px;
}

.color-swatch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.color-swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1.5px #cbd5e1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch-btn:hover {
  transform: scale(1.12);
}

.color-swatch-btn.active {
  box-shadow: 0 0 0 2.5px var(--brand);
  transform: scale(1.12);
}

.custom-color-input {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

/* Watermark Live Sheet & Diagonal Overlay */
.watermark-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-title-label {
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  text-align: center;
}

.wm-preview-frame {
  width: 100%;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.wm-sheet {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1.414;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wm-sheet canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wm-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 768px) {
  .watermark-layout-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
/* =========================================================================
   NEW ADDITIONS: 4-COLUMN TOOLS MEGA-MENU, ICONS & FLOATING COUNTER
   ========================================================================= */

/* Tool Color Categories (Smallpdf Style) */
:root {
  --color-purple: #7961f2;
  --color-blue: #3d99f5;
  --color-red: #f23030;
  --color-amber: #ffb700;
  --color-coral: #ff5975;
  --color-teal: #007953;
}

/* Tools Dropdown Button */
.dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-tools-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 36px;
}

.btn-tools-dropdown:hover {
  background: var(--brand-hover);
  border-color: var(--brand);
}

.grid-icon {
  color: var(--ink);
  display: grid;
  place-items: center;
}

.chevron-icon {
  color: #64748b;
  display: grid;
  place-items: center;
}

/* 4-Column Mega Menu */
.tools-mega-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
  padding: 22px;
  display: none;
  grid-template-columns: repeat(4, 210px);
  gap: 20px;
  z-index: 100;
}

.tools-mega-menu.active {
  display: grid;
}

.mega-menu-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mega-menu-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.mega-menu-link {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 5px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.mega-menu-link:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.mega-all-link {
  color: var(--brand);
  font-weight: 750;
  margin-top: 4px;
}

/* Color-Coded Mini Tool Badges */
.tool-mini-badge {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.badge-purple { background-color: var(--color-purple); }
.badge-blue   { background-color: var(--color-blue); }
.badge-red    { background-color: var(--color-red); }
.badge-amber  { background-color: var(--color-amber); }
.badge-coral  { background-color: var(--color-coral); }
.badge-teal   { background-color: var(--color-teal); }

.badge-letter {
  font-weight: 850;
  font-size: 12.5px;
  line-height: 1;
}

/* Hamburger Button (Mobile) */
.btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  padding: 0;
}

.btn-hamburger:hover {
  background: #f9fafb;
}

/* Mobile Off-Canvas Drawer */
.mobile-nav-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 2px solid var(--brand-border);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  padding: 20px 16px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 95;
}

.mobile-nav-drawer.active {
  display: block;
}

.mobile-drawer-section {
  margin-bottom: 18px;
}

.drawer-section-title {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}

.mobile-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mobile-tool-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 7px 9px;
  border-radius: 8px;
  background: #f9fafb;
}

.mobile-tool-item:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.mobile-drawer-auth {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* =========================================================================
   ALWAYS-FLOATING BOTTOM-CENTER LIVE COUNTER (OVERRIDE)
   ========================================================================= */

.header-counter-bar {
  display: none !important; /* Hide old in-header bar */
}

.floating-counter-bar {
  position: fixed !important;
  bottom: 20px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 9999 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  pointer-events: none !important;
  padding: 0 !important;
  background: transparent !important;
}

.floating-counter-bar .counter-badge {
  pointer-events: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #ffffff !important;
  border: 1.5px solid var(--brand) !important;
  border-radius: 99px !important;
  padding: 6px 18px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16) !important;
  user-select: none !important;
  cursor: default !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

.floating-counter-bar .counter-badge:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0, 121, 83, 0.25) !important;
}

.floating-counter-bar .counter-text strong {
  font-weight: 850 !important;
  color: var(--brand) !important;
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS (MOBILE & TABLET OVERRIDES)
   ========================================================================= */

@media (max-width: 1024px) {
  .tools-mega-menu {
    grid-template-columns: repeat(2, 205px);
  }
}

@media (max-width: 640px) {
  .btn-tools-label {
    display: none !important; /* Shows [ ☷ ▾ ] compact */
  }
  .btn-tools-dropdown {
    padding: 0 8px !important;
    height: 36px !important;
  }
  .btn-hamburger {
    display: inline-flex !important;
  }
  .tools-mega-menu {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: 64px !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    max-height: 75vh !important;
    overflow-y: auto !important;
  }
  .floating-counter-bar {
    bottom: 14px !important;
  }
  .floating-counter-bar .counter-badge {
    font-size: 12px !important;
    padding: 5px 14px !important;
  }
}
/* =========================================================================
   ADD PAGE NUMBERS SPECIFIC STYLES
   ========================================================================= */

.page-numbers-panel {
  max-width: 960px;
  margin: 0 auto;
}

/* 6-Position Picker Grid (3x2) */
.pos-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 280px;
  margin-top: 6px;
}

.pos-picker-btn {
  height: 38px;
  border: 1.5px solid var(--line);
  background: #ffffff;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 750;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: grid;
  place-items: center;
}

.pos-picker-btn:hover {
  border-color: var(--brand);
  color: var(--ink);
}

.pos-picker-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 121, 83, 0.25);
}

/* Dynamic Live Position Preview Tag */
.preview-number-tag {
  position: absolute;
  padding: 3px 8px;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  border-radius: 4px;
  font-weight: 700;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

/* Positions inside Preview Sheet */
.preview-number-tag.tag-top-left      { top: 14px; left: 14px; }
.preview-number-tag.tag-top-center    { top: 14px; left: 50%; transform: translateX(-50%); }
.preview-number-tag.tag-top-right     { top: 14px; right: 14px; }
.preview-number-tag.tag-bottom-left   { bottom: 14px; left: 14px; }
.preview-number-tag.tag-bottom-center { bottom: 14px; left: 50%; transform: translateX(-50%); }
.preview-number-tag.tag-bottom-right  { bottom: 14px; right: 14px; }
/* =========================================================================
   FLATTEN PDF SPECIFIC STYLES
   ========================================================================= */

.flatten-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0 24px;
}

.flatten-card {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  display: block;
}

.flatten-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.flatten-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.flatten-card.active {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 4px 14px rgba(0, 121, 83, 0.12);
}

.flatten-card-inner strong {
  display: block;
  font-size: 16px;
  margin: 8px 0 6px;
  color: var(--ink);
}

.flatten-card-inner p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

@media (max-width: 768px) {
  .flatten-mode-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
/* =========================================================================
   NID FRONT & BACK IN 1 PAGE SPECIFIC STYLES
   ========================================================================= */

.nid-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

.nid-slot-box {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #fdfefe;
  padding: 24px 16px;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.nid-slot-box:hover {
  border-color: var(--brand);
  background: #f7fbf9;
}

.slot-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  background: #f1f5f9;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 6px;
}

.slot-preview-wrap {
  width: 100%;
  max-width: 260px;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-preview-wrap img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.slot-actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

/* Virtual A4 Sheet Container */
.nid-a4-sheet {
  position: relative;
  width: 100%;
  max-width: 290px;
  aspect-ratio: 1 / 1.414;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.nid-a4-sheet canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 650px) {
  .nid-slots-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
/* =========================================================================
   ADMIT & APPLICATION BUNDLER SPECIFIC STYLES
   ========================================================================= */

.bundler-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.bundler-slot-card {
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
  padding: 24px 16px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 220px;
  transition: all 0.2s ease;
}

.bundler-slot-card:hover {
  border-color: var(--brand);
  background: var(--brand-hover);
}

.bundler-slot-card.slot-filled {
  border-color: var(--brand);
  background: var(--brand-light);
}

.bundler-slot-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bundler-badge-req {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  background: #f1f5f9;
  color: var(--ink);
  padding: 2px 8px;
  border-radius: 6px;
}

.bundler-badge-opt {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  background: #e2e8f0;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 6px;
}

.bundler-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--brand);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}

.bundler-slot-card.slot-filled .bundler-icon-box {
  background: #ffffff;
}

.bundler-slot-title {
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 2px;
}

.bundler-role-badge {
  font-size: 10.5px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.bundler-role-badge.role-req {
  background: var(--brand-light);
  color: var(--brand);
}

.bundler-role-badge.role-opt {
  background: #f1f5f9;
  color: var(--muted);
}

@media (max-width: 768px) {
  .bundler-slots-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .bundler-slot-card {
    min-height: 180px;
    padding: 18px;
  }
}
/* =========================================================================
   SIGN PDF WORKSPACE & SAVED SIGNATURE STYLES
   ========================================================================= */

.sign-workspace-panel {
  padding: 18px;
  background: #ffffff;
}

.sign-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.sign-toolbar-left,
.sign-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sign-page-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 8px;
}

.sign-page-indicator {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.sign-canvas-wrapper {
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 12px;
  overflow: auto;
  display: flex;
  justify-content: center;
  max-height: 70vh;
}

.sign-page-container {
  position: relative;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
  background: #ffffff;
  user-select: none;
}

.sign-page-container canvas {
  display: block;
}

.overlays-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Draggable Signature Overlay Item */
.placed-sig-box {
  position: absolute;
  border: 1.5px dashed var(--brand);
  background: rgba(225, 29, 72, 0.04);
  border-radius: 4px;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
}

.placed-sig-box:active {
  cursor: grabbing;
}

.placed-sig-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.sig-delete-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  background: #e11d48;
  color: #ffffff;
  border-radius: 50%;
  border: none;
  font-size: 11px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 5;
}

.sig-resize-handle {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 12px;
  height: 12px;
  background: var(--brand);
  border-radius: 2px;
  cursor: se-resize;
  z-index: 5;
}

/* Signature Creation Modal */
.sig-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sig-modal-dialog {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 24px;
}

.sig-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sig-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.sig-pad-wrap {
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  background: #fdfefe;
  position: relative;
  overflow: hidden;
}

.sig-pad-wrap canvas {
  width: 100%;
  height: 170px;
  cursor: crosshair;
  touch-action: none;
}

.sig-pad-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.ink-color-pills {
  display: flex;
  gap: 8px;
}

.ink-pill {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
}

.ink-pill.active {
  box-shadow: 0 0 0 2px #e11d48;
}

.typed-sig-preview-box {
  height: 120px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.typed-cursive-sig {
  font-size: 38px;
  font-family: 'Brush Script MT', 'Dancing Script', cursive;
  color: #002a80;
  user-select: none;
}

.saved-signatures-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.saved-sig-card {
  height: 80px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.saved-sig-card img {
  max-height: 100%;
  object-fit: contain;
}

.saved-sig-card:hover {
  border-color: #cbd5e1;
}

.saved-sig-card.active {
  border-color: var(--brand);
  background: #fff1f5;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15);
}

.sig-modal-footer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

@media (max-width: 650px) {
  .sign-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .sign-toolbar-left,
  .sign-page-nav,
  .sign-toolbar-right {
    justify-content: center;
    width: 100%;
  }
}
/* =========================================================================
   DELETE PDF PAGES SPECIFIC STYLES
   ========================================================================= */

.pages-delete-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding: 6px 4px;
}

.delete-page-card {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  user-select: none;
}

.delete-page-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.delete-thumb-wrap {
  width: 100%;
  height: 180px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.delete-canvas-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-canvas-container canvas {
  max-width: 90% !important;
  max-height: 90% !important;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  transition: opacity 0.2s ease;
}

.delete-page-num {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  z-index: 2;
}

.btn-card-trash {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: #ffffff;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.15s ease;
  z-index: 3;
}

.delete-page-card:hover .btn-card-trash {
  color: var(--accent-red);
}

/* Marked for Deletion Overlay State */
.delete-marked-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(254, 226, 226, 0.88);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 4;
}

.delete-marked-overlay span {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  color: #b91c1c;
}

.delete-page-card.marked-delete {
  border-color: #ef4444;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}

.delete-page-card.marked-delete .delete-marked-overlay {
  display: flex;
}

.delete-page-card.marked-delete .btn-card-trash {
  background: #ef4444;
  color: #ffffff;
}

@media (max-width: 650px) {
  .pages-delete-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .delete-thumb-wrap {
    height: 140px;
  }
}
/* =========================================================================
   REORDER PDF PAGES SPECIFIC STYLES
   ========================================================================= */

.reorder-toolbar-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 14px;
  gap: 14px;
  flex-wrap: wrap;
}

.reorder-toolbar-left,
.reorder-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pages-reorder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding: 6px 4px;
}

.reorder-page-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  user-select: none;
}

.reorder-page-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.reorder-thumb-wrap {
  width: 100%;
  height: 180px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}

.reorder-canvas-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reorder-canvas-container canvas {
  max-width: 90% !important;
  max-height: 90% !important;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.reorder-new-num {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--brand);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  z-index: 2;
}

.reorder-orig-num {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  z-index: 2;
}

.reorder-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
}

.reorder-card-pos-text {
  font-size: 12px;
  font-weight: 750;
  color: var(--ink);
}

@media (max-width: 650px) {
  .reorder-toolbar-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .reorder-toolbar-left,
  .reorder-toolbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .pages-reorder-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .reorder-thumb-wrap {
    height: 140px;
  }
}

/* =========================================================================
   ANIMATED BACKGROUND & HERO
   ========================================================================= */
.site-ambient-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  background: #fbfdfc;
}

.ambient-kinetic-grid {
  position: absolute;
  inset: -60px;
  background-image: 
    linear-gradient(to right, rgba(0, 121, 83, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 121, 83, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  animation: gridDrift 28s linear infinite;
  mask-image: radial-gradient(circle at 50% 40%, black 35%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black 35%, transparent 85%);
}

@keyframes gridDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(34px, 34px, 0); }
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  mix-blend-mode: multiply;
  will-change: transform;
}

.blob-emerald-top {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(0, 121, 83, 0.42) 0%, rgba(0, 121, 83, 0.05) 70%, transparent 85%);
  top: -100px;
  left: -80px;
  animation: blobFloat1 11s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.blob-crimson-top {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(225, 29, 72, 0.35) 0%, rgba(225, 29, 72, 0.05) 70%, transparent 85%);
  top: -60px;
  right: -60px;
  animation: blobFloat2 13s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.blob-mint-mid {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.32) 0%, rgba(16, 185, 129, 0.02) 70%, transparent 85%);
  top: 42%;
  left: 10%;
  animation: blobFloat3 15s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.blob-rose-bottom {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.32) 0%, rgba(225, 29, 72, 0.02) 70%, transparent 85%);
  bottom: 0%;
  right: 5%;
  animation: blobFloat4 14s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes blobFloat1 {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(140px, 80px, 0) scale(1.15) rotate(45deg); }
  100% { transform: translate3d(50px, 140px, 0) scale(0.92) rotate(90deg); }
}

@keyframes blobFloat2 {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(-120px, 90px, 0) scale(1.18) rotate(-50deg); }
  100% { transform: translate3d(-40px, 40px, 0) scale(0.9) rotate(-90deg); }
}

@keyframes blobFloat3 {
  0%   { transform: translate3d(0, 0, 0) scale(0.95); }
  50%  { transform: translate3d(100px, -60px, 0) scale(1.12); }
  100% { transform: translate3d(-50px, 70px, 0) scale(1.02); }
}

@keyframes blobFloat4 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-130px, -70px, 0) scale(1.15); }
  100% { transform: translate3d(-40px, 30px, 0) scale(0.95); }
}

.btn-pulse-red-action {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #9f1239 !important;
  font-weight: 750 !important;
  letter-spacing: 0.01em !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35) !important;
  
  position: relative !important;
  cursor: pointer !important;
}

.btn-pulse-red-action:hover {
  background: linear-gradient(135deg, #be123c 0%, #9f1239 100%) !important;
  border-color: #881337 !important;
}

@keyframes floatPulseRed {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
  }
  50% {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 24px rgba(225, 29, 72, 0.55), 0 0 0 6px rgba(225, 29, 72, 0.18);
  }
}

.homepage-content-layer {
  position: relative;
  z-index: 1;
}

.hero-clean {
  padding: 32px 0 20px;
  background: transparent;
}

.hero-single-title {
  font-size: clamp(20px, 3.2vw, 34px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 960px;
  margin: 0 auto 8px;
  font-weight: 850;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.hero-subtext {
  margin: 0 auto 16px; 
  font-size: 14.5px; 
  color: var(--muted); 
  max-width: 600px;
}

.compact-drop-box {
  padding: 18px 16px !important; 
  border-radius: 14px !important; 
  border: 2px dashed var(--brand) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 121, 83, 0.07) !important;
}

.compact-drop-content {
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 14px; 
  flex-wrap: wrap;
}

.compact-drop-content .upload-icon {
  width: 40px !important; 
  height: 40px !important; 
  margin: 0 !important; 
  border-radius: 10px !important; 
  background: var(--brand-light) !important; 
  color: var(--brand) !important; 
  box-shadow: none !important;
}

.compact-drop-meta {
  text-align: left;
}

.compact-drop-meta strong {
  font-size: 15px !important; 
  margin: 0 !important; 
  line-height: 1.2 !important;
}

.compact-drop-meta span {
  font-size: 12px !important; 
  color: var(--muted) !important; 
  display: block !important;
}

.compact-browse-btn {
  margin: 0 0 0 8px !important; 
  padding: 8px 16px !important; 
  font-size: 13px !important; 
  border-radius: 8px !important;
}

.tools-bar-wrap {
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  flex-wrap: wrap; 
  gap: 14px;
}

.category-scroll-tabs {
  padding: 3px; 
  background: rgba(241, 245, 249, 0.92); 
  backdrop-filter: blur(8px);
  border-radius: 10px; 
  border: 1px solid var(--line);
}

.tool-badge-green {
  background: var(--brand-light) !important;
  color: var(--brand-dark) !important;
  border: 1px solid var(--brand-border);
  font-size: 10px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
}

.tool-badge-red {
  background: var(--accent-red-light) !important;
  color: var(--accent-red) !important;
  border: 1px solid var(--accent-red-border);
  font-size: 10px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
}

/* Tool Grid & Cards */
.home-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.tool-card {
  padding: 16px 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.tool-card-title {
  font-size: 15px;
  margin: 0 0 4px;
  font-weight: 750;
  color: var(--ink);
}

.tool-card-desc {
  font-size: 12.5px;
  margin: 0 0 12px;
  line-height: 1.4;
  color: var(--muted);
  flex-grow: 1;
}

@media (min-width: 768px) {
  .home-tool-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (min-width: 1024px) {
  .home-tool-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}
@media (min-width: 1200px) {
  .home-tool-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

/* =========================================================================
   MOBILE VIEW: HIDE DESCRIPTION FOR CLEAN, COMPACT APP CARDS
   ========================================================================= */
@media (max-width: 680px) {
  .explore-heading-box {
    display: none !important;
  }

  /* HIDE TOOL DESCRIPTION ON MOBILE */
  .home-tool-grid .tool-card-desc {
    display: none !important;
  }

  .home-tool-grid .tool-card {
    padding: 12px 10px !important;
    justify-content: space-between;
  }

  .home-tool-grid .tool-card-title {
    font-size: 13.5px !important;
    margin-bottom: 6px !important;
    line-height: 1.25 !important;
  }

  .tools-bar-wrap {
    justify-content: center;
    width: 100%;
  }

  .category-scroll-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-scroll-tabs::-webkit-scrollbar {
    display: none;
  }

  .category-scroll-tabs .pill-btn {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 12.5px;
  }

  .hero-single-title {
    white-space: normal;
    font-size: 21px;
  }

  .compact-drop-content {
    flex-direction: column;
    text-align: center;
  }

  .compact-drop-meta {
    text-align: center;
  }
}
/* =========================================================================
   DESKTOP SEARCH STYLING
   ========================================================================= */
.header-search-desktop {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-box input {
  height: 36px;
  width: 220px;
  padding: 0 32px 0 32px !important;
  font-size: 13px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  color: var(--ink) !important;
  transition: all 0.18s ease !important;
}

.search-input-box input:focus {
  width: 270px;
  background: #ffffff !important;
  border-color: var(--brand) !important;
  outline: 3px solid var(--brand-light) !important;
}

.search-icon-svg {
  position: absolute;
  left: 10px;
  color: #64748b;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.search-shortcut-tag {
  position: absolute;
  right: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  pointer-events: none;
}

/* Instant Search Results Dropdown */
.header-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
  max-height: 380px;
  overflow-y: auto;
  display: none;
  z-index: 105;
  padding: 6px;
}

.header-search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.12s ease;
  text-decoration: none;
}

.search-result-item:hover, .search-result-item.selected {
  background: var(--brand-light);
  color: var(--brand);
}

.search-result-cat {
  font-size: 10.5px;
  font-weight: 750;
  color: #94a3b8;
  text-transform: uppercase;
}

.search-empty-hint {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* Mobile Search Trigger Icon */
.btn-search-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}

.btn-search-mobile:hover {
  background: var(--brand-light);
  color: var(--brand);
}

/* Mobile Search Modal */
.mobile-search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 99999;
  padding: 16px;
}

.mobile-search-modal.active {
  display: block;
}

.mobile-search-dialog {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 16px;
  max-width: 500px;
  margin: 10px auto 0;
  animation: modalSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.mobile-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-search {
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #475569;
}

.mobile-search-results {
  margin-top: 14px;
  max-height: 60vh;
  overflow-y: auto;
}

/* =========================================================================
   RESPONSIVE OVERRIDES: TRANSFORM MEGA MENU INTO 2-COLUMN MOBILE CARDS
   ========================================================================= */
@media (max-width: 768px) {
  .header-search-desktop {
    display: none !important;
  }
  .btn-search-mobile {
    display: inline-flex !important;
  }

  /* Transform Mega Menu into Clean Mobile Drawer on Mobile Screen */
  .tools-mega-menu {
    position: fixed !important;
    top: 68px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 82vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 18px 14px !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28) !important;
    border: 1.5px solid var(--line) !important;
    display: none !important;
    z-index: 99999 !important;
  }

  .tools-mega-menu.active {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    animation: modalSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Each Category column becomes a clean 2-column mobile grid */
  .mega-menu-col {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding-bottom: 14px !important;
  }

  .mega-menu-col:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }

  .mega-menu-title {
    grid-column: span 2 !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--brand) !important;
    margin-bottom: 2px !important;
    display: block !important;
  }

  /* Card Links matching mobile-tool-item styling */
  .mega-menu-link {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 12.5px !important;
    font-weight: 650 !important;
    color: var(--ink) !important;
    padding: 8px 9px !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    border: 1px solid #f1f5f9 !important;
    text-decoration: none !important;
    overflow: hidden !important;
  }

  .mega-menu-link span:last-child {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .mega-menu-link:hover {
    background: var(--brand-light) !important;
    color: var(--brand) !important;
    border-color: var(--brand-border) !important;
  }

  .mega-all-link {
    grid-column: span 2 !important;
    background: var(--brand-light) !important;
    color: var(--brand) !important;
    font-weight: 800 !important;
    justify-content: center !important;
    text-align: center !important;
    border-color: var(--brand-border) !important;
  }
}
/* =========================================================================
   WARM GOLD YELLOW THEME & 100% RESPONSIVE VIDEO EMBED
   ========================================================================= */

:root {
  /* Warm Gold / Golden Amber Accent */
  --mag-gold: #f59e0b;
  --mag-gold-dark: #d97706;
  --mag-gold-light: #fef3c7;
  --mag-gold-border: #fde68a;
}

.mag-blog-page, .mag-single-page {
  background: #fdfdfd;
}

/* Two-Column Grid */
.mag-main-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 32px;
  align-items: start;
}

.mag-content-col {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.mag-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Gold Category Section Header with Underline Accent */
.mag-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--mag-gold);
  margin-bottom: 18px;
  position: relative;
}

.mag-cat-tag {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 850;
  color: #111827; /* High-contrast dark text on gold */
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--mag-gold);
}

.mag-cat-viewall {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  transition: color 0.15s ease;
}

.mag-cat-viewall:hover {
  color: var(--mag-gold-dark);
}

/* Overlay Badge */
.mag-overlay-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--mag-gold);
  color: #111827;
  font-size: 11px;
  font-weight: 850;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  z-index: 3;
}

/* Metadata Text */
.mag-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #94a3b8;
}

.mag-card-meta.light-meta {
  color: #e2e8f0;
}

/* Block 1: Left Lead Story + Right 4-Item List */
.mag-split-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 16px;
}

.mag-lead-overlay-card {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  height: 100%;
  min-height: 280px;
  background: #0f172a;
}

.mag-lead-overlay-card.compact-lead {
  min-height: 200px;
}

.mag-lead-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.mag-lead-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.mag-lead-overlay-card:hover img {
  transform: scale(1.04);
}

.mag-lead-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.88) 100%);
  z-index: 2;
}

.mag-lead-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px;
  z-index: 3;
}

.mag-lead-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.35;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.mag-list-items-stack {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.mag-list-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mag-list-thumb {
  width: 80px;
  height: 60px;
  min-width: 80px;
  border-radius: 3px;
  overflow: hidden;
  background: #f1f5f9;
}

.mag-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mag-list-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mag-list-item-title {
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0;
}

.mag-list-item-title a {
  color: var(--ink);
  transition: color 0.15s ease;
}

.mag-list-item-title a:hover {
  color: var(--mag-gold-dark);
}

/* Block 2: Two-Column Side-by-Side Grid */
.mag-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Block 3: Wide Horizontal Hero Card + 3-Col Cards */
.mag-horizontal-hero-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 16px;
  margin-bottom: 18px;
  align-items: center;
}

.mag-hero-img-wrap {
  position: relative;
  height: 210px;
  border-radius: 4px;
  overflow: hidden;
  background: #f1f5f9;
}

.mag-hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mag-hero-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mag-hero-title {
  font-size: 20px;
  font-weight: 850;
  line-height: 1.3;
  margin: 0;
}

.mag-hero-title a {
  color: var(--ink);
}

.mag-hero-title a:hover {
  color: var(--mag-gold-dark);
}

.mag-hero-excerpt {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
}

.mag-three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mag-sub-card {
  background: #ffffff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.mag-card-img-wrap {
  position: relative;
  height: 130px;
  overflow: hidden;
  background: #f1f5f9;
}

.mag-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.mag-sub-card:hover .mag-card-img-wrap img {
  transform: scale(1.05);
}

.mag-sub-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mag-sub-card-title {
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0;
}

.mag-sub-card-title a {
  color: var(--ink);
}

.mag-sub-card-title a:hover {
  color: var(--mag-gold-dark);
}

/* Play Icon Overlay */
.mag-play-icon-circle {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid #ffffff;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 14px;
  z-index: 3;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.mag-play-icon-circle.small-play {
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  font-size: 10px;
  border-width: 1.5px;
}

.mag-lead-overlay-card:hover .mag-play-icon-circle,
.mag-sub-card:hover .mag-play-icon-circle {
  background: var(--mag-gold);
  color: #111827;
  transform: scale(1.1);
}

/* =========================================================================
   ADVERTISEMENT BANNERS & STRIPS
   ========================================================================= */

.mag-ad-strip {
  width: 100%;
  min-height: 90px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.top-ad-strip { margin-bottom: 24px; }
.in-feed-ad-strip { margin: 10px 0 24px; }
.in-article-ad-strip { margin: 18px 0 24px; }

.mag-sidebar-ad-box {
  width: 100%;
  height: 260px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mag-ad-badge {
  font-size: 13px;
  font-style: italic;
  color: #94a3b8;
  font-weight: 500;
}

/* =========================================================================
   SIDEBAR (TABS, TIMELINE, CATEGORIES, TAGS)
   ========================================================================= */

.mag-sidebar-widget {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 16px;
}

.mag-widget-header {
  background: #111827;
  color: #ffffff;
  padding: 6px 14px;
  margin: -16px -16px 14px;
}

.mag-widget-header h3 {
  font-size: 12.5px;
  font-weight: 850;
  letter-spacing: 0.05em;
  margin: 0;
  text-transform: uppercase;
}

.mag-tabs-header {
  display: flex;
  margin: -16px -16px 14px;
}

.mag-tab-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-align: center;
  background: #111827;
  color: #ffffff;
  border: none;
  cursor: pointer;
  border-right: 1px solid #1f2937;
  transition: all 0.15s ease;
}

.mag-tab-btn.active {
  background: var(--mag-gold);
  color: #111827;
}

.mag-tab-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.mag-tab-pane.active {
  display: flex;
}

.mag-sidebar-thumb-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mag-side-thumb {
  width: 76px;
  height: 56px;
  min-width: 76px;
  border-radius: 3px;
  overflow: hidden;
  background: #f1f5f9;
}

.mag-side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mag-side-info h4 {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0 0 3px;
}

.mag-side-info h4 a {
  color: var(--ink);
}

.mag-side-info h4 a:hover {
  color: var(--mag-gold-dark);
}

.mag-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-left: 14px;
  border-left: 2px solid #e2e8f0;
}

.mag-timeline-item {
  position: relative;
}

.mag-timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mag-gold);
}

.mag-timeline-date {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.mag-timeline-title {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0;
}

.mag-timeline-title a {
  color: var(--ink);
}

.mag-timeline-title a:hover {
  color: var(--mag-gold-dark);
}

.mag-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.mag-cat-list li {
  border-bottom: 1px solid #f1f5f9;
}

.mag-cat-list li:last-child {
  border-bottom: none;
}

.mag-cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 650;
  color: #334155;
  transition: color 0.15s ease;
}

.mag-cat-list a:hover {
  color: var(--mag-gold-dark);
}

.mag-cat-count {
  color: #94a3b8;
  font-weight: 500;
}

.mag-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mag-tag-pill {
  font-size: 11.5px;
  font-weight: 650;
  color: #475569;
  background: #f1f5f9;
  padding: 4px 9px;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.mag-tag-pill:hover {
  background: var(--mag-gold);
  color: #111827;
}

/* =========================================================================
   SINGLE ARTICLE PAGE STYLES & RESPONSIVE VIDEO FIX
   ========================================================================= */

.mag-breadcrumbs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #94a3b8;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mag-breadcrumbs-bar a {
  color: #64748b;
  font-weight: 600;
}

.mag-breadcrumbs-bar a:hover {
  color: var(--mag-gold-dark);
}

.mag-breadcrumbs-bar .current-crumb {
  color: var(--ink);
  font-weight: 700;
}

.mag-article-col {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 24px;
}

.mag-article-h1 {
  font-size: 28px;
  font-weight: 850;
  line-height: 1.25;
  color: var(--ink);
  margin: 10px 0 12px;
  letter-spacing: -0.02em;
}

.mag-article-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: #94a3b8;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.mag-article-media-box {
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  background: #000000;
  margin-bottom: 6px;
}

/* Fixed 16:9 Responsive Video Wrapper (Spans 100% width, No Side Gaps) */
.video-responsive-wrap {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  background: #000000;
  position: relative;
  overflow: hidden;
  display: block;
}

.video-responsive-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  display: block;
}

.mag-article-hero-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.mag-article-body {
  font-size: 15.5px;
  line-height: 1.8;
  color: #334155;
}

.mag-article-body h2 {
  font-size: 22px;
  color: var(--ink);
  margin: 28px 0 12px;
  line-height: 1.35;
}

.mag-article-body h3 {
  font-size: 18px;
  color: var(--ink);
  margin: 22px 0 10px;
  line-height: 1.4;
}

.mag-article-body p {
  margin: 0 0 16px;
}

.mag-article-footer {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mag-article-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mag-share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.mag-share-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mag-share-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 750;
  border-radius: 3px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
}

.share-fb { background: #3b5998; }
.share-x  { background: #0f172a; }
.share-wa { background: #25d366; }
.share-copy { background: #475569; }

/* =========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================= */

@media (max-width: 900px) {
  .mag-main-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .mag-split-grid {
    grid-template-columns: 1fr;
  }
  .mag-two-col-grid {
    grid-template-columns: 1fr;
  }
  .mag-horizontal-hero-card {
    grid-template-columns: 1fr;
  }
  .mag-three-col-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .mag-article-h1 {
    font-size: 22px;
  }
  .mag-article-col {
    padding: 16px;
  }
  .mag-article-body {
    font-size: 14.5px;
  }
}