/* =========================================================
   TOOL FIXT - GLOBAL LAYOUT & NAVIGATION
   ========================================================= */

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
  width: 100%;
  max-width: 1560px;
  margin-inline: auto;
  padding-inline: 1.25rem;
  height: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 0.75rem;
  width: 100%;
}

/* Brand Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.brand-logo-img {
  height: 32px;
  max-width: 140px;
  object-fit: contain;
  flex-shrink: 0 !important;
}

.brand-logo-content,
.brand-logo-fallback {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.brand-logo-svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0 !important;
}

.brand-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  white-space: nowrap !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.brand-logo-text .brand-accent {
  color: var(--brand-primary);
  margin-left: 2px;
}

.brand-badge-pill {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(79, 70, 229, 0.1);
  color: var(--brand-primary);
  border: 1px solid rgba(79, 70, 229, 0.22);
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

/* Desktop Navigation */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  white-space: nowrap !important;
}

.nav-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.38rem 0.5rem;
  border-radius: 8px;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1.2;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--brand-primary);
  background: rgba(79, 70, 229, 0.06);
}

.nav-link.active {
  color: var(--brand-primary);
  background: rgba(79, 70, 229, 0.1);
  font-weight: 700;
}

/* Category & Suite Quick Links with Matching Icons */
.nav-link-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.84rem;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.nav-cat-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  flex-shrink: 0 !important;
  transition: transform 0.15s ease;
}

.nav-chevron {
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0 !important;
}

.nav-dropdown-container:hover .nav-chevron,
.nav-dropdown-container:focus-within .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-link-cat:hover .nav-cat-icon {
  transform: scale(1.08);
}

/* Categories Mega Menu Dropdown */
.nav-dropdown-container {
  position: relative;
}

.nav-dropdown-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-mega-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: -120px;
  width: 900px;
  max-width: 95vw;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.03);
  padding: 1.4rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-dropdown-container:hover .nav-mega-menu,
.nav-dropdown-container:focus-within .nav-mega-menu,
.nav-mega-menu:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

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

.mega-menu-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.mega-menu-all {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-primary);
  text-decoration: none;
}

.mega-menu-all:hover {
  text-decoration: underline;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.mega-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.mega-menu-item:hover {
  background: var(--bg-surface-raised);
}

.mega-menu-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid;
  transition: transform 0.15s ease;
}

.mega-menu-item:hover .mega-menu-icon {
  transform: scale(1.08);
}

.mega-menu-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mega-menu-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.mega-menu-count {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Specific Mega Menu Layouts for Suites and Pricing */
.nav-mega-menu-all {
  width: 900px;
  left: -80px;
}

.nav-mega-menu-suite {
  width: 620px;
  max-width: 92vw;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
}

.nav-dropdown-container:hover .nav-mega-menu-suite,
.nav-dropdown-container:focus-within .nav-mega-menu-suite,
.nav-mega-menu-suite:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-mega-menu-pricing {
  width: 640px;
  max-width: 92vw;
  left: 50%;
  transform: translateX(-60%) translateY(8px);
}

.nav-dropdown-container:hover .nav-mega-menu-pricing,
.nav-dropdown-container:focus-within .nav-mega-menu-pricing,
.nav-mega-menu-pricing:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-60%) translateY(0);
}

.mega-menu-suite-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.mega-menu-suite-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mega-menu-suite-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
}

.mega-menu-suite-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid;
  transition: transform 0.2s ease;
}

.mega-menu-suite-card:hover .mega-menu-suite-icon {
  transform: scale(1.1);
}

.mega-menu-suite-content {
  flex: 1;
  min-width: 0;
}

.mega-menu-suite-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.25;
}

.mega-menu-suite-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mega-menu-suite-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Pricing Mega Menu Cards */
.mega-menu-pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.mega-menu-pricing-card {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.9rem 0.65rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mega-menu-pricing-card.recommended {
  border-color: var(--brand-primary);
  background: rgba(79, 70, 229, 0.04);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

.mega-menu-pricing-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
}

.mega-menu-plan-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.mega-menu-plan-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.mega-menu-plan-limit {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}


.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

/* Search Trigger Button */
.search-trigger-btn {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0 0.75rem;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.search-trigger-btn:hover {
  background: var(--bg-surface);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.search-trigger-btn kbd {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: inherit;
  line-height: 1;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0 !important;
  padding: 0;
}

.theme-toggle-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--brand-primary);
}

/* User Wallet Badge */
.wallet-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.7rem;
  height: 36px;
  border-radius: 9px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #059669;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all var(--transition-fast);
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.wallet-badge-btn:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: #059669;
  transform: translateY(-1px);
}

.wallet-amount {
  letter-spacing: -0.01em;
}

/* User Profile Avatar in Header - Always Crisp 1:1 Circle */
.user-header-menu-wrap {
  position: relative;
  flex-shrink: 0 !important;
}

.user-avatar-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0 !important;
  line-height: 1;
}

.user-avatar-img {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid var(--brand-primary) !important;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15) !important;
  flex-shrink: 0 !important;
  display: block !important;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.user-avatar-btn:hover .user-avatar-img {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25) !important;
}

.user-avatar-chevron {
  opacity: 0.6;
  transition: transform var(--transition-fast);
  flex-shrink: 0 !important;
}

.user-avatar-btn:hover .user-avatar-chevron {
  opacity: 1;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
  padding: 0;
  transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: var(--bg-surface);
  border-color: var(--brand-primary);
}

/* Mobile Off-Canvas Drawer & Overlay */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 86vw;
  max-width: 380px;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  z-index: 10001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface-raised);
  position: sticky;
  top: 0;
  z-index: 2;
}

.mobile-drawer-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-drawer-close-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.3rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.mobile-drawer-close-btn:hover {
  background: var(--brand-danger);
  color: #ffffff;
  border-color: var(--brand-danger);
}

.mobile-drawer-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: calc(var(--mobile-nav-height) + 2rem);
}

.mobile-nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: background 0.15s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: var(--bg-surface-raised);
  color: var(--brand-primary);
}

.mobile-nav-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin: 0.85rem 0 0.25rem;
  padding-left: 0.5rem;
}

.mobile-categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-cat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-color);
  text-decoration: none;
  min-height: 44px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.mobile-cat-item:active {
  transform: scale(0.99);
  border-color: var(--brand-primary);
}

.mobile-cat-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid;
}

.mobile-cat-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.mobile-cat-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

/* Mobile Sticky Bottom Navigation Bar */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 9998;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .mobile-bottom-nav {
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 6px;
  border-radius: 8px;
  flex: 1;
  max-width: 68px;
  min-height: 44px;
  transition: all 0.15s ease;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-bottom-tab svg {
  width: 20px;
  height: 20px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.mobile-bottom-tab.active,
.mobile-bottom-tab:active {
  color: var(--brand-primary);
}

.mobile-bottom-tab.active svg {
  transform: scale(1.1);
  color: var(--brand-primary);
}

/* Center prominent pill tab for 850+ Tools */
.mobile-bottom-tab-center {
  background: linear-gradient(135deg, var(--brand-primary) 0%, #06b6d4 100%);
  color: #ffffff !important;
  border-radius: 999px;
  height: 42px;
  max-width: 42px;
  min-width: 42px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transform: translateY(-6px);
  margin: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mobile-bottom-tab-center svg {
  width: 20px;
  height: 20px;
  color: #ffffff !important;
}

.mobile-bottom-tab-center:active {
  transform: translateY(-4px) scale(0.96);
}


/* Footer */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-social-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-icon-link {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.social-icon-link:hover {
  color: #fff;
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.footer-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-legal-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-legal-bar a {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-legal-bar a:hover {
  color: var(--text-primary);
}

/* Dynamic Multi-Format Ad Placement Slots */
.ad-slot-wrapper {
  width: 100%;
  margin: 2rem auto;
  clear: both;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  overflow: hidden;
}

.ad-slot-header {
  max-width: 970px;
  margin: 1.25rem auto 1.75rem;
}

.ad-slot-tool-top,
.ad-slot-tool_top {
  max-width: 970px;
  margin: 1.25rem auto 1.75rem;
  clear: both;
}

.ad-slot-tool-bottom,
.ad-slot-tool_bottom,
.ad-slot-bottom,
.ad-slot-footer {
  max-width: 970px;
  margin: 2.25rem auto 1.5rem;
  clear: both;
}

.ad-slot-sidebar {
  max-width: 300px;
  margin: 1.5rem auto;
}

.ad-slot-label-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  padding: 0 0.25rem;
}

.ad-slot-hide-btn {
  font-size: 0.7rem;
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}

.ad-slot-hide-btn:hover {
  text-decoration: underline;
}

/* 1. Display Banner Ads */
.ad-banner-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  background: var(--bg-surface);
}

.ad-banner-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.3);
}

.ad-banner-img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  display: block;
}

/* 2. Native Sponsored Card */
.ad-native-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.ad-native-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
}

.ad-native-media {
  width: 90px;
  height: 75px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-surface-raised);
}

.ad-native-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-native-details {
  flex: 1;
  min-width: 0;
}

.ad-native-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.ad-native-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(99, 102, 241, 0.12);
  color: var(--brand-primary);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.ad-native-pro-link {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
}

.ad-native-pro-link:hover {
  color: var(--brand-primary);
}

.ad-native-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.ad-native-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.ad-native-title a:hover {
  color: var(--brand-primary);
}

.ad-native-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-native-cta-col {
  flex-shrink: 0;
}

.ad-native-btn {
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

/* 3. Custom HTML / Script Box */
.ad-custom-code-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  padding: 0.5rem;
}

/* Backward compatibility */
.ad-slot-container {
  width: 100%;
  margin: 1.5rem auto;
}

@media (max-width: 768px) {
  .ad-native-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .ad-native-media {
    width: 100%;
    height: 120px;
  }
  .ad-native-cta-col {
    width: 100%;
  }
  .ad-native-btn {
    display: block;
    width: 100%;
    text-align: center;
  }
}

/* Vertical Skyscraper Banner Creative */
.ad-banner-vertical {
  max-width: 300px;
  max-height: 600px;
  margin: 0 auto;
}

.ad-banner-img-vertical {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
  display: block;
}

.ad-custom-vertical {
  max-width: 300px;
  margin: 0 auto;
  min-height: 250px;
}

/* Desktop Skyscraper Banners (Strictly side gutters on ultra-wide screens >=1680px) */
.desktop-skyscraper {
  display: none !important;
}

/* Completely suppress floating skyscrapers on tool workspaces and editors */
body:has(.workspace-container) .desktop-skyscraper,
body:has(#tool-workspace) .desktop-skyscraper,
body:has(.tool-workspace-card) .desktop-skyscraper,
body.is-workspace-page .desktop-skyscraper {
  display: none !important;
}

@media (min-width: 1680px) {
  .desktop-skyscraper {
    display: block !important;
    position: fixed;
    top: 120px;
    width: 160px;
    max-width: 160px;
    z-index: 25; /* Always stay below interactive dropdowns, modals, and headers */
    pointer-events: auto;
    transition: opacity 0.2s ease;
  }
  /* Calculate distance strictly outside the centered 1240px container */
  /* 50% - (1240px / 2 = 620px) - 25px gap - 160px ad width = 50% - 805px */
  .desktop-skyscraper.skyscraper-left {
    left: calc(50% - 620px - 25px - 160px);
  }
  .desktop-skyscraper.skyscraper-right {
    right: calc(50% - 620px - 25px - 160px);
  }
  .skyscraper-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 0.35rem;
  }
}

/* Layout stability & CLS Protection */
.adsense-container {
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ad-slot-sidebar .adsense-container {
  min-height: 250px;
  max-width: 300px;
}
.ad-slot-native-wrapper {
  min-height: 110px;
}

/* Responsive Media Queries */
@media (max-width: 1360px) {
  .search-trigger-btn {
    width: 36px;
    min-width: 36px;
    padding: 0;
    justify-content: center;
  }
  .search-trigger-btn .search-text,
  .search-trigger-btn .search-kbd {
    display: none;
  }
  .nav-desktop {
    gap: 0.2rem;
  }
  .nav-link {
    padding: 0.32rem 0.45rem;
    font-size: 0.81rem;
  }
  .nav-cat-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 1160px) {
  .nav-desktop {
    display: none !important;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
  }
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .footer-brand {
    grid-column: span 3;
  }
}

@media (max-width: 768px) {
  .brand-badge-pill {
    display: none !important;
  }
  .site-header {
    height: 58px;
  }
  .header-container {
    padding-inline: 0.85rem;
  }
  .brand-logo-text {
    font-size: 1.15rem;
  }
  .brand-logo-svg {
    width: 28px;
    height: 28px;
  }
  .wallet-badge-btn {
    padding: 0 0.45rem;
    height: 34px;
    font-size: 0.76rem;
  }
  .mobile-bottom-nav {
    display: flex !important;
  }
  #main-content {
    padding-bottom: calc(var(--mobile-nav-height) + 16px);
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-brand {
    grid-column: span 1;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding-inline: 0.6rem;
  }
  .header-actions {
    gap: 0.35rem;
  }
  .brand-logo {
    gap: 0.35rem;
  }
  .brand-logo-text {
    font-size: 1.08rem;
  }
  .brand-logo-svg {
    width: 26px;
    height: 26px;
  }
  .search-trigger-btn,
  .theme-toggle-btn,
  .mobile-menu-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 8px;
  }
  .user-avatar-img {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
  }
  .wallet-badge-btn {
    padding: 0 0.35rem;
    height: 32px;
    font-size: 0.72rem;
    gap: 0.2rem;
  }
  .footer-social-icons {
    gap: 0.5rem;
  }
  .social-icon-link {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 360px) {
  .header-container {
    padding-inline: 0.45rem;
  }
  .brand-logo-text {
    font-size: 0.98rem;
  }
  .brand-logo-svg {
    width: 24px;
    height: 24px;
  }
  .header-actions {
    gap: 0.25rem;
  }
  .search-trigger-btn,
  .theme-toggle-btn,
  .mobile-menu-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }
  .wallet-badge-btn span.wallet-amount {
    display: none;
  }
  .wallet-badge-btn {
    padding: 0 0.35rem;
    width: 30px;
    justify-content: center;
  }
}


