/* ==========================================================================
   Kazakan Tools 2.0 — World-Class Modern iPhone Glass Style (Liquid Glass)
   Strictly adheres to user vision mockups (Zero emojis, Pure SVGs, 100% Responsive)
   ========================================================================== */

/* 1. Global Setup & Body Layout (Luminous Liquid Glass Atmosphere) */
body {
  background-color: #060913;
  background-image: 
    radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.16) 0%, transparent 40%),
    radial-gradient(circle at 15% 22%, rgba(37, 99, 235, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 50% 36%, rgba(99, 102, 241, 0.14) 0%, transparent 50%),
    radial-gradient(circle at 82% 62%, rgba(59, 130, 246, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 20% 82%, rgba(30, 64, 175, 0.14) 0%, transparent 45%);
  /* A scrolling canvas keeps the ambient gradients continuous in long-page captures. */
  background-attachment: scroll;
  background-repeat: no-repeat;
  color: var(--text-main);
  font-family: var(--font-system);
  transition: background-color 0.25s ease, color 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

[data-theme="light"] body {
  background-color: #f0f4f9;
  background-image:
    radial-gradient(circle at 82% 8%, rgba(56, 189, 248, 0.12) 0%, transparent 36%),
    radial-gradient(circle at 12% 24%, rgba(37, 99, 235, 0.1) 0%, transparent 42%),
    radial-gradient(circle at 72% 62%, rgba(99, 102, 241, 0.06) 0%, transparent 44%);
}

/* 2. Floating iPhone Modern Glass Header */
.glass-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 16, 30, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-block-end: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="light"] .glass-header {
  background: rgba(255, 255, 255, 0.85);
  border-block-end: 1px solid rgba(15, 23, 42, 0.08);
}

.header-container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
  position: relative;
  direction: ltr !important;
}

.brand-link {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.02em;
}

[data-theme="light"] .brand-link {
  color: #0f172a;
}

.brand-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.4));
  flex-shrink: 0;
}

/* Header Navigation (Tools, Articles, About) */
.header-nav {
  display: flex;
  grid-column: 2;
  justify-self: center;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  direction: ltr !important;
  position: static;
  width: max-content;
}

.header-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 640px) {
  .header-nav {
    display: none;
  }
}

.nav-link-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: #94a3b8;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
  line-height: 1.2;
  text-align: center;
}

.nav-link-btn:hover {
  color: #ffffff;
}

[data-theme="light"] .nav-link-btn:hover {
  color: #0f172a;
}

.nav-link-btn.active,
.nav-link-btn.active-pill {
  color: #ffffff;
  background-color: transparent;
  border-radius: var(--radius-pill);
  position: relative;
  box-shadow: 0 2px 0 0 #3b82f6;
}

[data-theme="light"] .nav-link-btn.active,
[data-theme="light"] .nav-link-btn.active-pill {
  color: #0f172a;
  background-color: rgba(15, 23, 42, 0.06);
}

/* 3. Centered Frosted Glass Mega Menu */
.mega-menu-wrapper {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(7px);
  width: min(940px, calc(100vw - 32px));
  max-height: min(72vh, 560px);
  max-height: min(72dvh, 560px);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.48) transparent;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.07), transparent 52%), rgba(248, 250, 255, 0.98);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-card);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  z-index: 2000;
  transition: opacity 130ms ease, transform 130ms ease, visibility 0s linear 130ms;
}

[dir="rtl"] .mega-menu-wrapper {
  direction: rtl;
  text-align: right;
}

[dir="ltr"] .mega-menu-wrapper {
  direction: ltr;
  text-align: left;
}

.mega-menu-wrapper::-webkit-scrollbar,
.mobile-drawer-content::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.mega-menu-wrapper::-webkit-scrollbar-track,
.mobile-drawer-content::-webkit-scrollbar-track {
  background: transparent;
}

.mega-menu-wrapper::-webkit-scrollbar-thumb,
.mobile-drawer-content::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.42);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

.mega-menu-wrapper::-webkit-scrollbar-thumb:hover,
.mobile-drawer-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.68);
  background-clip: padding-box;
}

.mega-menu-wrapper::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 100%;
  height: 16px;
}

[data-theme="dark"] .mega-menu-wrapper {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.1), transparent 55%), rgba(8, 13, 25, 0.98);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Visibility is state-driven so touch and pointer interactions behave consistently. */
.nav-item.is-open .mega-menu-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}

.nav-item.is-open > #mega-menu-trigger {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 2px 0 0 #3b82f6;
}

[data-theme="light"] .nav-item.is-open > #mega-menu-trigger {
  background: rgba(15, 23, 42, 0.06);
}

#mega-menu-trigger svg {
  transition: transform 180ms ease;
}

.nav-item.is-open > #mega-menu-trigger svg {
  transform: rotate(180deg);
}

.mega-callout-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.04));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mega-callout-title {
  font-size: 1.125rem;
  font-weight: 800;
  margin-block-end: var(--space-2);
  color: var(--text-main);
}

.mega-callout-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-block-end: var(--space-4);
}

.mega-menu-all-tools {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  padding: 0 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 15px;
  background: linear-gradient(115deg, var(--brand-primary), #3978eb 55%, #4d91f7);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.mega-menu-all-tools::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.17), transparent 72%);
  transform: translateX(-110%);
  transition: transform 380ms ease;
}

.mega-menu-all-tools:hover {
  color: #fff;
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.mega-menu-all-tools:hover::before {
  transform: translateX(110%);
}

.mega-menu-all-tools:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.75);
  outline-offset: 3px;
}

.mega-menu-all-tools-arrow {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.mega-menu-all-tools:hover .mega-menu-all-tools-arrow {
  transform: translateX(3px);
}

[dir="rtl"] .mega-menu-all-tools-arrow {
  transform: rotate(180deg);
}

[dir="rtl"] .mega-menu-all-tools:hover .mega-menu-all-tools-arrow {
  transform: rotate(180deg) translateX(3px);
}

.mega-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.mega-tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  text-decoration: none;
  background-color: transparent;
  border: 1px solid transparent;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.mega-tool-item:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.mega-tool-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--brand-primary);
}

.mega-tool-icon svg {
  width: 16px;
  height: 16px;
}

.mega-tool-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.mega-tool-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.mega-tool-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.mega-tool-arrow {
  color: var(--text-subtle);
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.mega-tool-item:hover .mega-tool-arrow {
  color: var(--brand-primary);
  transform: translateX(-3px);
}

[dir="ltr"] .mega-tool-item:hover .mega-tool-arrow {
  transform: translateX(3px);
}

/* 4. iOS Theme Switcher Pill (Vision Matching) */
.theme-toggle-pill {
  position: relative;
  width: 58px;
  height: 30px;
  border-radius: var(--radius-pill);
  background-color: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  cursor: pointer;
  outline: none;
  direction: ltr !important;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

[data-theme="light"] .theme-toggle-pill {
  background-color: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.15);
}

.theme-toggle-pill .icon-svg {
  width: 13px;
  height: 13px;
  z-index: 1;
  color: #94a3b8;
  transition: color 0.25s ease;
}

.theme-toggle-knob {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .theme-toggle-knob,
.theme-toggle-pill.is-dark .theme-toggle-knob {
  transform: translateX(26px) !important;
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr !important;
}

.lang-switch-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  height: 30px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.8125rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.15s ease;
}

.lang-switch-pill:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

[data-theme="light"] .lang-switch-pill {
  background-color: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

[data-theme="light"] .lang-switch-pill:hover {
  background-color: rgba(15, 23, 42, 0.1);
  border-color: rgba(15, 23, 42, 0.22);
  color: #0f172a;
}

.lang-switch-pill:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Mobile Drawer Hamburger */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  cursor: pointer;
}

@media (max-width: 640px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  background: rgba(3, 7, 18, 0.58);
  backdrop-filter: blur(12px) saturate(115%);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}

.mobile-drawer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.mobile-drawer-content {
  position: relative;
  width: min(400px, calc(100vw - 22px));
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  box-sizing: border-box;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
  color: var(--text-main);
  background:
    radial-gradient(circle at 10% 0%, rgba(59, 130, 246, 0.16), transparent 34%),
    linear-gradient(160deg, rgba(59, 130, 246, 0.055), transparent 42%),
    var(--bg-surface);
  border-inline-end: 1px solid var(--border-medium);
  border-start-end-radius: 28px;
  border-end-end-radius: 28px;
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.48) transparent;
  transform: translateX(-105%);
  transition: transform 320ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

[dir="rtl"] .mobile-drawer-content {
  transform: translateX(105%);
}

.mobile-drawer.is-open .mobile-drawer-content {
  transform: translateX(0);
}

.mobile-drawer-header,
.mobile-drawer-brand,
.mobile-drawer-section-heading,
.mobile-drawer-nav-link,
.mobile-drawer-tool-link,
.mobile-drawer-store-link,
.mobile-drawer-control {
  display: flex;
  align-items: center;
}

.mobile-drawer-header {
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 14px;
  min-height: 46px;
}

.mobile-drawer-brand {
  min-width: 0;
  gap: 10px;
  color: var(--text-main);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.mobile-drawer-brand .brand-icon {
  width: 34px;
  height: 34px;
}

.mobile-drawer-close {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  appearance: none;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.mobile-drawer-close svg {
  width: 20px;
  height: 20px;
}

.mobile-drawer-close:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  transform: rotate(90deg);
}

.mobile-drawer-primary-nav {
  display: grid;
  gap: 8px;
  padding-block-end: 18px;
  border-block-end: 1px solid var(--border-subtle);
}

.mobile-drawer-nav-link {
  width: 100%;
  min-height: 54px;
  box-sizing: border-box;
  gap: 12px;
  padding: 8px 12px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  text-align: start;
  text-decoration: none;
  appearance: none;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.mobile-drawer-nav-link:hover,
.mobile-drawer-nav-link:focus-visible {
  background: var(--bg-card-hover);
  border-color: var(--brand-primary-border);
  transform: translateY(-1px);
}

.mobile-drawer-nav-link-primary {
  background: linear-gradient(110deg, rgba(37, 99, 235, 0.16), rgba(59, 130, 246, 0.055));
  border-color: var(--brand-primary-border);
}

.mobile-drawer-nav-icon,
.mobile-drawer-tool-icon,
.mobile-drawer-store-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: var(--brand-primary-hover);
  background: var(--brand-primary-light);
  border: 1px solid var(--brand-primary-border);
  border-radius: 13px;
}

.mobile-drawer-nav-icon svg,
.mobile-drawer-tool-icon svg,
.mobile-drawer-store-icon svg {
  width: 19px;
  height: 19px;
}

.mobile-drawer-nav-link > span:nth-child(2),
.mobile-drawer-tool-name,
.mobile-drawer-store-link > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.mobile-drawer-nav-arrow,
.mobile-drawer-tool-arrow {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--text-subtle);
  transition: transform 160ms ease, color 160ms ease;
}

[dir="rtl"] .mobile-drawer-nav-arrow,
[dir="rtl"] .mobile-drawer-tool-arrow {
  transform: rotate(180deg);
}

.mobile-drawer-nav-link:hover .mobile-drawer-nav-arrow,
.mobile-drawer-tool-link:hover .mobile-drawer-tool-arrow {
  color: var(--brand-primary-hover);
}

[dir="rtl"] .mobile-drawer-nav-link:hover .mobile-drawer-nav-arrow,
[dir="rtl"] .mobile-drawer-tool-link:hover .mobile-drawer-tool-arrow {
  transform: rotate(180deg) translateX(-3px);
}

[dir="ltr"] .mobile-drawer-nav-link:hover .mobile-drawer-nav-arrow,
[dir="ltr"] .mobile-drawer-tool-link:hover .mobile-drawer-tool-arrow {
  transform: translateX(3px);
}

.mobile-drawer-tools {
  min-width: 0;
}

.mobile-drawer-section-heading {
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 12px;
}

.mobile-drawer-section-heading h2 {
  margin: 0;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 750;
}

.mobile-drawer-all-tools {
  color: var(--brand-primary-hover);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.mobile-drawer-all-tools:hover {
  color: var(--brand-accent);
}

.mobile-drawer-tool-list {
  display: grid;
  gap: 6px;
}

.mobile-drawer-tool-link {
  min-width: 0;
  min-height: 48px;
  box-sizing: border-box;
  gap: 11px;
  padding: 5px 8px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.mobile-drawer-tool-link:hover,
.mobile-drawer-tool-link:focus-visible {
  color: var(--text-main);
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

.mobile-drawer-tool-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.mobile-drawer-tool-icon svg {
  width: 17px;
  height: 17px;
}

.mobile-drawer-tool-arrow {
  width: 15px;
  height: 15px;
}

.mobile-drawer-bottom {
  display: grid;
  gap: 12px;
  margin-block-start: auto;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--border-subtle);
}

.mobile-drawer-store-link {
  min-height: 52px;
  gap: 11px;
  padding: 7px 10px;
  color: var(--text-main);
  background: linear-gradient(110deg, rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.045));
  border: 1px solid var(--brand-primary-border);
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.mobile-drawer-store-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}

.mobile-drawer-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mobile-drawer-control {
  min-width: 0;
  min-height: 44px;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
  appearance: none;
  cursor: pointer;
}

.mobile-drawer-control svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--brand-primary-hover);
}

.mobile-drawer-control:hover {
  color: var(--text-main);
  border-color: var(--brand-primary-border);
}

.mobile-drawer-open {
  overflow: hidden;
}

.mobile-menu-btn:focus-visible,
.mobile-drawer-close:focus-visible,
.mobile-drawer-nav-link:focus-visible,
.mobile-drawer-tool-link:focus-visible,
.mobile-drawer-control:focus-visible,
.mobile-drawer-store-link:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-drawer,
  .mobile-drawer-content,
  .mobile-drawer-nav-link,
  .mobile-drawer-tool-link,
  .mobile-drawer-close {
    transition-duration: 0.01ms;
  }
}

[dir="rtl"] .mobile-drawer.is-open .mobile-drawer-content {
  transform: translateX(0);
}

[dir="ltr"] .mobile-drawer-content {
  transform: translateX(-105%);
}

.mobile-drawer.is-open .mobile-drawer-content {
  transform: translateX(0);
}

.mobile-drawer-content > * {
  box-sizing: border-box;
}

/* Localized About popup */
.about-dialog {
  position: fixed;
  width: min(660px, calc(100vw - 28px));
  max-width: none;
  max-height: min(84vh, 760px);
  max-height: min(84dvh, 760px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--text-main);
  background:
    radial-gradient(circle at 90% 0%, rgba(59, 130, 246, 0.2), transparent 38%),
    linear-gradient(145deg, rgba(59, 130, 246, 0.08), transparent 55%),
    var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 30px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.48) transparent;
}

.article-dialog {
  width: min(780px, calc(100vw - 28px));
}

.about-dialog::backdrop {
  background: rgba(3, 7, 18, 0.68);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.about-dialog[open] {
  animation: about-dialog-enter 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes about-dialog-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.about-dialog::-webkit-scrollbar {
  width: 7px;
}

.about-dialog::-webkit-scrollbar-track {
  background: transparent;
}

.about-dialog::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.42);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

.about-dialog-shell {
  padding: clamp(22px, 5vw, 38px);
}

.about-dialog-topline,
.about-dialog-brand,
.about-dialog-actions {
  display: flex;
  align-items: center;
}

.about-dialog-topline {
  justify-content: space-between;
  gap: 16px;
}

.about-dialog-brand {
  min-width: 0;
  gap: 12px;
  color: var(--brand-primary-hover);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.about-dialog-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 5px;
  object-fit: contain;
  border: 1px solid var(--brand-primary-border);
  border-radius: 14px;
  background: var(--brand-primary-light);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
}

.about-dialog-close {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.about-dialog-close svg {
  width: 19px;
  height: 19px;
}

.about-dialog-close:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  transform: rotate(90deg);
}

.about-dialog-title {
  margin: 26px 0 10px;
  color: var(--text-main);
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.25;
  text-wrap: balance;
}

.about-dialog-description {
  max-width: 56ch;
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.article-dialog-content {
  margin-block-start: 18px;
}

.article-dialog-intro {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.article-dialog-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.article-dialog-point {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-width: 0;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 17px;
}

.article-dialog-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--brand-primary-hover);
  background: var(--brand-primary-light);
  border: 1px solid var(--brand-primary-border);
  border-radius: 11px;
  font-size: 0.72rem;
  font-weight: 800;
}

.article-dialog-point h3 {
  margin: 1px 0 5px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.45;
}

.article-dialog-point p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.77rem;
  line-height: 1.6;
}

.about-dialog-store {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-block-start: 20px;
  padding: 14px;
  background: linear-gradient(115deg, rgba(37, 99, 235, 0.12), rgba(56, 189, 248, 0.045)), var(--bg-card);
  border: 1px solid var(--brand-primary-border);
  border-radius: 18px;
}

.about-dialog-store-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--brand-primary-hover);
  background: var(--brand-primary-light);
  border: 1px solid var(--brand-primary-border);
  border-radius: 14px;
}

.about-dialog-store-icon svg {
  width: 21px;
  height: 21px;
}

.about-dialog-store-copy {
  min-width: 0;
}

.about-dialog-store-copy h3 {
  margin: 0 0 4px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.4;
}

.about-dialog-store-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.about-dialog-store-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.about-dialog-store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding-inline: 15px;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: 1px solid rgba(96, 165, 250, 0.55);
  border-radius: var(--radius-pill);
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, filter 160ms ease;
}

.about-dialog-store-link:hover {
  color: #fff;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.about-dialog-store-link svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

[dir="rtl"] .about-dialog-store-link svg {
  transform: rotate(180deg);
}

.about-dialog-store-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 160ms cubic-bezier(0.16, 1, 0.3, 1);
  direction: ltr;
}

.about-dialog-store-email svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--brand-primary-hover);
}

.about-dialog-store-email:hover {
  color: #ffffff;
  background: var(--brand-primary-light);
  border-color: var(--brand-primary-border);
  transform: translateY(-1px);
}

.about-dialog-store-email:focus-visible,
.about-dialog-store-link:focus-visible {
  outline: 2px solid var(--brand-primary-border);
  outline-offset: 2px;
}

[data-theme="light"] .about-dialog-store-email {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
  color: #475569;
}

[data-theme="light"] .about-dialog-store-email:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1e40af;
}

.about-dialog-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-block-start: 26px;
}

.about-dialog-feature {
  min-width: 0;
  padding: 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
}

.about-dialog-feature-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-block-end: 14px;
  color: var(--brand-primary-hover);
  background: var(--brand-primary-light);
  border: 1px solid var(--brand-primary-border);
  border-radius: 14px;
}

.about-dialog-feature-icon svg {
  width: 21px;
  height: 21px;
}

.about-dialog-feature h3 {
  margin: 0 0 7px;
  color: var(--text-main);
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.4;
}

.about-dialog-feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.65;
}

.about-dialog-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 26px;
}

.about-dialog-primary,
.about-dialog-dismiss {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.about-dialog-primary {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: 1px solid rgba(96, 165, 250, 0.55);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.about-dialog-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}

.about-dialog-primary svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

[dir="rtl"] .about-dialog-primary svg {
  transform: rotate(180deg);
}

.about-dialog-dismiss {
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
}

.about-dialog-dismiss:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.about-dialog-close:focus-visible,
.about-dialog-primary:focus-visible,
.about-dialog-dismiss:focus-visible,
.footer-about-open:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
}

.footer-about-open {
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.8125rem;
  text-align: start;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.footer-about-open:hover {
  color: var(--text-main);
  transform: translateX(-2px);
}

[dir="ltr"] .footer-about-open:hover {
  transform: translateX(2px);
}

@media (max-width: 600px) {
  .about-dialog {
    width: calc(100vw - 20px);
    max-height: min(88vh, 760px);
    max-height: min(88dvh, 760px);
    border-radius: 24px;
  }

  .article-dialog-points {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .article-dialog-point {
    padding: 12px;
  }

  .about-dialog-shell {
    padding: 22px;
  }

  .about-dialog-features {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
    margin-block-start: 20px;
  }

  .about-dialog-store {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .about-dialog-store-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .about-dialog-store-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-block-start: 4px;
  }

  .about-dialog-feature {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: 12px;
    padding: 14px;
  }

  .about-dialog-feature-icon {
    grid-row: span 2;
    margin: 0;
  }

  .about-dialog-feature h3 {
    align-self: end;
  }

  .about-dialog-actions {
    margin-block-start: 20px;
  }

  .about-dialog-primary {
    flex: 1;
  }
}

/* 5. Homepage Hero Section (Vision Matching) */
.hero-glass {
  padding-block-start: clamp(var(--space-8), 6vw, var(--space-12));
  padding-block-end: var(--space-6);
  text-align: center;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-block-end: var(--space-4);
}

.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-block-end: var(--space-3);
  color: var(--text-main);
}

.hero-title .highlight {
  color: var(--brand-primary);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 620px;
  margin-inline: auto;
  margin-block-end: var(--space-6);
}

/* Search Bar Pill (Exact Vision Mockup) */
.search-pill-wrapper {
  position: relative;
  max-width: 520px;
  margin-inline: auto;
  margin-block-end: var(--space-6);
}

.search-pill-input {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-pill);
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding-inline-start: 48px;
  padding-inline-end: 20px;
  font-size: 0.95rem;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  outline: none;
}

[data-theme="light"] .search-pill-input {
  background-color: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text-main);
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .search-pill-input::placeholder {
  color: var(--text-subtle);
}

[dir="rtl"] .search-pill-input {
  text-align: right;
  padding-inline-start: 48px;
  padding-inline-end: 20px;
}

.search-pill-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light), 0 4px 20px rgba(37, 99, 235, 0.2);
}

.search-pill-icon {
  position: absolute;
  inset-inline-start: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-subtle);
  pointer-events: none;
  z-index: 2;
  display: block;
}

[data-theme="light"] .search-pill-icon {
  color: var(--text-muted);
}

/* Category Filter Pills Bar */
.category-pills-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-block-end: var(--space-8);
}

.category-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-4);
  height: 40px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-filter-btn:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.category-filter-btn.active {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px var(--brand-primary-light);
}

/* 6. Most Used Tools Moving Bar Section (Vision Matching) */
.most-used-section {
  margin-block-start: var(--space-4);
  margin-block-end: var(--space-12);
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--glass-shadow);
}

.most-used-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-block-end: var(--space-4);
}

.most-used-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.marquee-track-wrapper {
  overflow: hidden;
  position: relative;
  direction: ltr !important;
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.marquee-track {
  display: flex;
  gap: var(--space-3);
  width: max-content;
  will-change: transform;
}

.marquee-track:hover {
  animation-play-state: paused !important;
}

/* Silky smooth drift (60s) */
.marquee-left {
  animation: smoothScrollLeft 60s linear infinite;
}

@keyframes smoothScrollLeft {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.marquee-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 18px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
}

[dir="ltr"] .marquee-badge {
  direction: ltr;
}

.marquee-badge:hover {
  background-color: #ffffff;
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  color: var(--brand-primary);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] .marquee-badge:hover {
  background-color: rgba(30, 41, 59, 0.9);
}

.marquee-badge-3d-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

/* 7. World-Class Tool Cards (3-Column Vision Layout) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  margin-block-end: var(--space-8);
}

@media (max-width: 992px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

@media (max-width: 640px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* Full-Card Clickable Button Card (Exact Vision Mockup) */
.tool-card-glass {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(14, 22, 40, 0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  padding: 24px 20px 18px;
  text-decoration: none;
  color: #ffffff;
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
  min-height: 290px;
}

[data-theme="light"] .tool-card-glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.tool-card-glass:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.7), 0 0 24px rgba(37, 99, 235, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  border-color: rgba(96, 165, 250, 0.4);
}

[data-theme="light"] .tool-card-glass:hover {
  box-shadow: 0 18px 36px -8px rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
}

/* Free-Floating 3D Tool Feature Visual (Prominent, High-Resolution 3D Icons) */
.tool-card-img-wrap {
  width: min(100%, 430px);
  height: auto;
  aspect-ratio: 1.65 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block-end: 12px;
  background: transparent;
  border: none;
}

.tool-card-img-wrap img {
  width: min(58%, 250px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card-glass:hover .tool-card-img-wrap img {
  transform: scale(1.1) translateY(-5px);
}

.tool-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-block-end: 6px;
  line-height: 1.35;
  color: #ffffff;
  text-align: center;
}

[data-theme="light"] .tool-card-title {
  color: #0f172a;
}

.tool-card-desc {
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-block-end: 16px;
  text-align: center;
  flex-grow: 1;
}

[data-theme="light"] .tool-card-desc {
  color: #475569;
}

.tool-card-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start !important;
  direction: ltr !important;
  margin-block-start: auto;
  padding-block-start: 4px;
}

[dir="ltr"] .tool-card-bottom {
  justify-content: flex-end !important;
}

.tool-action-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: all 0.2s ease;
}

[data-theme="light"] .tool-action-circle {
  background-color: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

.tool-card-glass:hover .tool-action-circle {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
  transform: translateX(-3px);
}

[dir="ltr"] .tool-card-glass:hover .tool-action-circle {
  transform: translateX(3px);
}

/* "عرض جميع الأدوات" Button — Modern Liquid Glass Pill */
.view-all-tools-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-block: 40px 48px;
}

.view-all-tools-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding-block: 8px;
  padding-inline-start: 30px;
  padding-inline-end: 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(24, 36, 62, 0.88) 0%, rgba(13, 20, 36, 0.96) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.32);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-family: var(--font-system);
  font-weight: 750;
  font-size: 1.025rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  box-shadow: 
    0 12px 32px -6px rgba(0, 0, 0, 0.5),
    0 2px 10px -2px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.22s ease, 
              background 0.22s ease, 
              border-color 0.22s ease,
              color 0.22s ease;
}

.view-all-tools-text {
  display: inline-block;
  white-space: nowrap;
}

.view-all-tools-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.2s ease, 
              border-color 0.2s ease, 
              color 0.2s ease,
              box-shadow 0.2s ease;
}

.view-all-tools-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.view-all-tools-btn > svg:not(.view-all-tools-icon svg) {
  width: 18px;
  height: 18px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-all-tools-btn:hover {
  background: linear-gradient(135deg, rgba(32, 50, 88, 0.94) 0%, rgba(18, 28, 52, 0.98) 100%);
  border-color: rgba(96, 165, 250, 0.55);
  border-top-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 
    0 18px 40px -8px rgba(0, 0, 0, 0.65),
    0 4px 18px -2px rgba(59, 130, 246, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.view-all-tools-btn:hover .view-all-tools-icon {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

[dir="rtl"] .view-all-tools-btn:hover .view-all-tools-icon,
[dir="rtl"] .view-all-tools-btn:hover > svg:not(.view-all-tools-icon svg) {
  transform: translateX(-4px);
}

[dir="ltr"] .view-all-tools-btn:hover .view-all-tools-icon,
[dir="ltr"] .view-all-tools-btn:hover > svg:not(.view-all-tools-icon svg) {
  transform: translateX(4px);
}

.view-all-tools-btn:active {
  transform: translateY(0) scale(0.985);
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.45);
}

.view-all-tools-btn:focus-visible {
  outline: 3px solid var(--brand-primary);
  outline-offset: 3px;
}

/* Light Theme */
[data-theme="light"] .view-all-tools-btn {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border: 1px solid rgba(37, 99, 235, 0.24);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  color: #0f172a;
  box-shadow: 
    0 12px 30px -6px rgba(37, 99, 235, 0.12),
    0 4px 12px -2px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 #ffffff;
}

[data-theme="light"] .view-all-tools-icon {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: #2563eb;
}

[data-theme="light"] .view-all-tools-btn:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.48);
  border-top-color: rgba(255, 255, 255, 1);
  color: #1d4ed8;
  box-shadow: 
    0 18px 38px -8px rgba(37, 99, 235, 0.22),
    0 6px 16px -2px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 #ffffff;
}

[data-theme="light"] .view-all-tools-btn:hover .view-all-tools-icon {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* 8. Trust Badges Row (Exact Vision Mockup) */
.trust-badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-block-end: 36px;
}

@media (max-width: 420px) {
  .trust-badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.trust-badge-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(14, 22, 40, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .trust-badge-title {
  color: var(--text-main);
}

[data-theme="light"] .trust-badge-subtitle {
  color: var(--text-muted);
}

[data-theme="light"] .trust-badge-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 244, 250, 0.9) 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.trust-badge-icon {
  width: auto;
  height: auto;
  background: transparent;
  color: #3b82f6;
  margin-block-end: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.trust-badge-copy {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.trust-badge-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-block-end: 4px;
}

.trust-badge-subtitle {
  font-size: 0.775rem;
  color: #94a3b8;
}

@media (max-width: 900px) {
  .trust-badge-pill {
    min-width: 0;
    min-height: 78px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 10px;
    text-align: start;
    border-radius: 16px;
  }

  .trust-badge-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    margin: 0;
    border: 1px solid var(--brand-primary-border);
    border-radius: 12px;
    background: var(--brand-primary-light);
  }

  .trust-badge-icon svg {
    width: 19px;
    height: 19px;
  }

  .trust-badge-copy {
    width: auto;
    flex: 1;
    align-items: flex-start;
    text-align: start;
  }

  .trust-badge-title {
    margin-block-end: 2px;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .trust-badge-subtitle {
    font-size: 0.66rem;
    line-height: 1.4;
  }
}

/* 9. "تسوق من كازاكان" Store Showcase Banner (Exact Vision Mockup) */
.store-showcase-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 58, 138, 0.25) 100%);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 22px;
  padding: 28px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-block-end: 40px;
  box-shadow: 0 14px 34px -8px rgba(37, 99, 235, 0.15);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .store-showcase-banner {
  background: linear-gradient(120deg, rgba(219, 234, 254, 0.82), rgba(240, 249, 255, 0.76));
  border-color: rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 14px 34px -8px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .store-showcase-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 58, 138, 0.25) 100%);
  border-color: rgba(59, 130, 246, 0.3);
}

@media (max-width: 420px) {
  .store-showcase-banner {
    flex-direction: column-reverse;
    text-align: center;
  }
}

.store-banner-content {
  flex: 1;
}

.store-banner-media {
  flex-shrink: 0;
  text-align: center;
}

.store-banner-media img {
  max-height: 180px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.3));
}

.store-banner-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  margin-block-end: 8px;
}

[data-theme="light"] .store-banner-title {
  color: var(--text-main);
}

.store-banner-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  max-width: 500px;
  margin-block-end: 18px;
  line-height: 1.6;
}

[data-theme="light"] .store-banner-desc {
  color: var(--text-muted);
}

.store-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 32px;
  border-radius: var(--radius-pill);
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.store-cta-btn:hover {
  background-color: #1d4ed8;
  transform: translateY(-2px);
}

/* 10. "أحدث المقالات" Articles Section (Vision Matching) */
.articles-section {
  margin-block-end: var(--space-12);
}

.articles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: var(--space-6);
}

.articles-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
}

[data-theme="light"] .articles-title {
  color: var(--text-main);
}

.articles-view-all {
  font-size: 0.875rem;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 420px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
}

.article-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(14, 22, 40, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 22px 20px 18px;
  text-decoration: none;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  font: inherit;
  text-align: start;
  cursor: pointer;
  appearance: none;
  min-height: 145px;
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

[data-theme="light"] .article-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 244, 250, 0.9) 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 16px 32px -6px rgba(0, 0, 0, 0.5);
}

.article-card-featured {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.85) 0%, rgba(29, 78, 216, 0.95) 100%) !important;
  border: 1px solid rgba(147, 197, 253, 0.4) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 14px 34px -8px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.article-card-featured .article-card-title {
  color: #ffffff !important;
}

.article-card-featured .article-card-desc {
  color: rgba(255, 255, 255, 0.88) !important;
}

.article-action-circle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-block-start: 14px;
  align-self: flex-end;
  transition: all 0.2s ease;
}

[dir="ltr"] .article-action-circle {
  align-self: flex-start;
}

.article-card-featured .article-action-circle {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.article-card:hover .article-action-circle {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.article-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-block-end: 6px;
  line-height: 1.4;
}

[data-theme="light"] .article-card:not(.article-card-featured) .article-card-title {
  color: var(--text-main);
}

.article-card-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
}

[data-theme="light"] .article-card:not(.article-card-featured) .article-card-desc {
  color: var(--text-muted);
}

/* 11. Modern iOS Glass Breadcrumbs */
.breadcrumbs-glass {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background-color: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-block-end: var(--space-6);
  list-style: none;
}

.breadcrumbs-glass a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs-glass a:hover {
  color: var(--text-main);
}

.breadcrumbs-sep {
  color: var(--text-subtle);
  width: 12px;
  height: 12px;
}

/* 12. Vision Mockup Liquid Glass Footer System */
.footer-glass {
  width: 100%;
  margin-block-start: auto;
  background: linear-gradient(180deg, rgba(8, 13, 25, 0.45) 0%, rgba(6, 9, 19, 0.96) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-block-start: 1px solid rgba(255, 255, 255, 0.08);
  padding-block-start: var(--space-10);
  padding-block-end: var(--space-6);
}

[data-theme="light"] .footer-glass {
  background: rgba(255, 255, 255, 0.76);
  border-block-start-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.04);
}

.footer-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1.15fr 1.15fr auto;
  gap: var(--space-6);
  align-items: start;
  direction: ltr !important;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  direction: ltr;
  text-align: left;
}

.footer-brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 10px;
}

.footer-brand-header .brand-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.45));
}

.footer-brand-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

[data-theme="light"] .footer-brand-title,
[data-theme="light"] .footer-col-title {
  color: var(--text-main);
}

.footer-brand-desc {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 270px;
  margin-block-end: 14px;
}

[dir="rtl"] .footer-brand-desc {
  direction: rtl;
  text-align: right;
}

.footer-social-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .footer-social-icon {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
}

.footer-social-icon:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.footer-social-icon svg {
  display: block;
}

.footer-social-icon:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

.footer-contact-email {
  margin-block-start: 12px;
}

.footer-email-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 180ms ease, opacity 180ms ease;
}

.footer-email-link span {
  direction: ltr;
  unicode-bidi: embed;
}

.footer-email-link svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 180ms ease;
}

.footer-email-link:hover {
  color: #ffffff;
}

.footer-email-link:hover svg {
  color: var(--brand-primary-hover);
}

.footer-email-link:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.footer-nav-col {
  display: flex;
  flex-direction: column;
}

[dir="rtl"] .footer-nav-col {
  direction: rtl;
  text-align: right;
}

[dir="ltr"] .footer-nav-col {
  direction: ltr;
  text-align: left;
}

.footer-col-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #ffffff;
  margin-block-end: 14px;
  letter-spacing: -0.01em;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links-list a {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
  display: inline-block;
}

.footer-links-list a:hover {
  color: #ffffff;
  transform: translateX(-2px);
}

[dir="ltr"] .footer-links-list a:hover {
  transform: translateX(2px);
}

.footer-actions-col {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.footer-controls-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 36px;
  min-width: 48px;
}

[data-theme="light"] .footer-lang-pill,
[data-theme="light"] .footer-theme-btn {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
  color: var(--text-main);
}

.footer-lang-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.footer-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .footer-bottom {
  border-block-start-color: rgba(15, 23, 42, 0.08);
}

.footer-theme-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Light/Dark Toggle state */
[data-theme="dark"] .footer-theme-btn .icon-svg-sun {
  display: none;
}
[data-theme="dark"] .footer-theme-btn .icon-svg-moon {
  display: block;
}
[data-theme="light"] .footer-theme-btn .icon-svg-moon {
  display: none;
}
[data-theme="light"] .footer-theme-btn .icon-svg-sun {
  display: block;
}

.footer-bottom {
  margin-block-start: var(--space-8);
  padding-block-start: var(--space-5);
  border-block-start: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-copy-text {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-subtle);
  letter-spacing: 0.01em;
}

/* Light Theme Footer */
[data-theme="light"] .footer-glass {
  background: linear-gradient(180deg, rgba(240, 244, 250, 0.85) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-block-start-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .footer-brand-title {
  color: #0f172a;
}

[data-theme="light"] .footer-col-title {
  color: #0f172a;
}

[data-theme="light"] .footer-social-icon {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
  color: var(--text-muted);
}

[data-theme="light"] .footer-social-icon:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.2);
  color: #0f172a;
}

[data-theme="light"] .footer-email-link {
  color: var(--text-muted);
}

[data-theme="light"] .footer-email-link:hover {
  color: var(--text-main);
}

[data-theme="light"] .footer-email-link:hover svg {
  color: var(--brand-primary);
}

[data-theme="light"] .footer-lang-pill {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

[data-theme="light"] .footer-lang-pill:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .footer-theme-btn {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
  color: var(--text-muted);
}

[data-theme="light"] .footer-theme-btn:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.18);
  color: #0f172a;
}

[data-theme="light"] .footer-bottom {
  border-block-start-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .footer-links-list a:hover {
  color: var(--brand-primary);
}

@media (max-width: 640px) {
  .footer-glass {
    padding-block: 16px calc(12px + env(safe-area-inset-bottom));
  }

  .footer-container {
    padding-inline: 14px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .footer-brand-col {
    grid-column: 1 / -1;
    padding: 13px;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.075), transparent 68%), var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  }

  .footer-brand-header {
    gap: 9px;
    margin-block-end: 8px;
  }

  .footer-brand-header .brand-icon {
    width: 30px;
    height: 30px;
  }

  .footer-brand-title {
    font-size: 0.98rem;
  }

  .footer-brand-desc {
    max-width: none;
    margin-block: 0 10px;
    font-size: 0.75rem;
    line-height: 1.6;
  }

  .footer-social-links {
    gap: 8px;
  }

  .footer-social-icon {
    width: 32px;
    height: 32px;
  }

  .footer-contact-email {
    margin-block-start: 10px;
  }

  .footer-email-link {
    font-size: 0.775rem;
  }

  .footer-nav-col {
    min-width: 0;
    padding: 11px 11px 9px;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.035), transparent 72%), var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 17px;
  }

  .footer-col-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-block: 0 7px;
    padding-block-end: 7px;
    border-block-end: 1px solid var(--border-subtle);
    font-size: 0.78rem;
  }

  .footer-col-title::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--brand-primary);
    box-shadow: 0 0 10px var(--brand-primary-border);
  }

  .footer-links-list {
    gap: 3px;
  }

  .footer-links-list li {
    min-width: 0;
  }

  .footer-links-list a,
  .footer-links-list .footer-about-open {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 29px;
    box-sizing: border-box;
    padding: 4px 7px;
    border-radius: 9px;
    font-size: 0.71rem;
    line-height: 1.4;
  }

  .footer-links-list a:hover,
  .footer-links-list .footer-about-open:hover {
    background: var(--bg-subtle);
    transform: none;
  }

  .footer-actions-col {
    grid-column: 1 / -1;
    justify-content: flex-start;
    align-items: center;
    padding-block-start: 0;
  }

  .footer-controls-row {
    gap: 6px;
    padding: 3px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
  }

  .footer-lang-pill {
    min-width: 40px;
    min-height: 34px;
    padding-inline: 11px;
    font-size: 0.75rem;
  }

  .footer-theme-btn {
    width: 34px;
    height: 34px;
  }

  .footer-bottom {
    justify-content: center;
    margin-block-start: 12px;
    padding-block-start: 10px;
    text-align: center;
  }

  .footer-copy-text {
    font-size: 0.65rem;
    line-height: 1.5;
  }
}

@media (max-width: 360px) {
  .footer-container {
    padding-inline: 10px;
  }

  .footer-grid {
    gap: 8px;
  }

  .footer-brand-col {
    padding: 13px;
  }

  .footer-nav-col {
    padding-inline: 9px;
  }

  .footer-links-list a,
  .footer-links-list .footer-about-open {
    padding-inline: 5px;
    font-size: 0.66rem;
  }
}

/* Keep the mega menu inside the viewport as the navigation gets narrower. */
@media (max-width: 900px) and (min-width: 761px) {
  .trust-badges-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .mega-menu-wrapper {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .mega-callout-card {
    padding: 14px;
  }

  .mega-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
  }

  .mega-tool-item {
    gap: 8px;
    padding: 5px 8px;
  }

  .mega-tool-icon {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 760px) and (min-width: 641px) {
  .trust-badges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mega-menu-wrapper {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    width: min(620px, calc(100vw - 24px));
    max-height: min(76vh, 600px);
    max-height: min(76dvh, 600px);
  }

  .mega-callout-card {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 14px;
  }

  .mega-callout-card > div {
    min-width: 0;
  }

  .mega-menu-all-tools {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .mega-callout-desc {
    margin-block-end: 0;
  }

  .mega-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .mega-tool-item {
    min-width: 0;
    gap: 8px;
    padding: 8px;
  }

  .mega-tool-icon {
    width: 30px;
    height: 30px;
  }
}

/* Compact glass layout used by the narrow reference viewport. */
@media (max-width: 640px) {
  .site-main {
    padding-block: 0;
  }

  .header-container {
    padding: 8px 14px;
    gap: 8px;
  }

  .container {
    padding-inline: 24px;
  }

  .brand-link {
    gap: 7px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .brand-icon {
    width: 25px;
    height: 25px;
  }

  .header-nav {
    gap: 0;
    flex-shrink: 1;
  }

  .nav-link-btn {
    padding-inline: 7px;
    font-size: 0.7rem;
    min-height: 32px;
    white-space: nowrap;
  }

  .header-actions {
    gap: 6px;
  }

  .lang-switch-pill {
    height: 26px;
    padding-inline: 9px;
    font-size: 0.7rem;
  }

  .theme-toggle-pill {
    width: 48px;
    height: 26px;
    padding-inline: 5px;
  }

  .theme-toggle-pill .icon-svg {
    width: 11px;
    height: 11px;
  }

  .theme-toggle-knob {
    width: 20px;
    height: 20px;
    top: 2px;
    left: 2px;
  }

  [data-theme="dark"] .theme-toggle-knob,
  .theme-toggle-pill.is-dark .theme-toggle-knob {
    transform: translateX(22px) !important;
  }

  .hero-glass {
    padding-block-start: 24px;
    padding-block-end: 12px;
  }

  .hero-pill-badge {
    margin-block-end: 10px;
    font-size: 0.68rem;
    padding: 4px 11px;
  }

  .hero-title {
    font-size: clamp(1.35rem, 5.4vw, 1.7rem);
    line-height: 1.3;
    margin-block-end: 6px;
  }

  .hero-desc {
    font-size: 0.76rem;
    line-height: 1.55;
    margin-block-end: 14px;
  }

  .search-pill-wrapper {
    max-width: 380px;
    margin-block-end: 12px;
  }

  .search-pill-input {
    height: 42px;
    font-size: 0.78rem;
    padding-inline-start: 40px;
    padding-inline-end: 16px;
  }

  .search-pill-icon {
    width: 17px;
    height: 17px;
    inset-inline-start: 14px;
  }

  .category-pills-bar {
    gap: 6px;
    margin-block-end: 14px;
  }

  .category-filter-btn {
    height: 29px;
    padding-inline: 10px;
    font-size: 0.68rem;
  }

  .tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-block-end: 14px;
  }

  .tool-card-glass {
    min-height: 158px;
    padding: 11px 9px 9px;
    border-radius: 16px;
  }

  .tool-card-img-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 1.65 / 1;
    margin-block-end: 6px;
  }

  .tool-card-img-wrap img {
    width: min(58%, 128px);
    height: auto;
  }

  .tool-card-title {
    font-size: 0.78rem;
    line-height: 1.3;
    margin-block-end: 3px;
  }

  .tool-card-desc {
    font-size: 0.61rem;
    line-height: 1.35;
    margin-block-end: 5px;
  }

  .tool-action-circle {
    width: 27px;
    height: 27px;
  }

  .tool-action-circle svg {
    width: 12px;
    height: 12px;
  }

  .view-all-tools-wrap {
    margin-block: 28px 36px;
  }

  .view-all-tools-btn {
    min-height: 48px;
    padding-block: 6px;
    padding-inline-start: 24px;
    padding-inline-end: 8px;
    font-size: 0.95rem;
    gap: 12px;
  }

  .view-all-tools-icon {
    width: 32px;
    height: 32px;
  }

  .view-all-tools-icon svg {
    width: 15px;
    height: 15px;
  }

  .trust-badges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-block-end: 20px;
  }

  .trust-badge-pill {
    min-height: 76px;
    gap: 9px;
    padding: 10px;
    border-radius: 15px;
  }

  .trust-badge-title {
    font-size: 0.75rem;
  }

  .trust-badge-subtitle {
    font-size: 0.64rem;
  }

  .store-showcase-banner {
    min-height: 148px;
    padding: 14px;
    gap: 9px;
    border-radius: 16px;
    margin-block-end: 22px;
  }

  .store-banner-media img {
    width: 138px;
    max-height: 108px;
  }

  .store-banner-title {
    font-size: 1.05rem;
    margin-block-end: 4px;
  }

  .store-banner-desc {
    font-size: 0.68rem;
    line-height: 1.45;
    margin-block-end: 9px;
  }

  .store-cta-btn {
    min-height: 32px;
    padding-inline: 17px;
    font-size: 0.7rem;
  }

  .articles-section {
    margin-block-end: 24px;
  }

  .articles-header {
    margin-block-end: 10px;
  }

  .articles-title {
    font-size: 1rem;
  }

  .articles-view-all {
    font-size: 0.68rem;
  }

  .articles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .article-card {
    min-height: 82px;
    padding: 10px 8px;
    border-radius: 13px;
  }

  .article-card-title {
    font-size: 0.7rem;
    line-height: 1.35;
    margin-block-end: 4px;
  }

  .article-card-desc {
    font-size: 0.57rem;
    line-height: 1.35;
  }

  .article-action-circle {
    width: 21px;
    height: 21px;
    margin-block-start: 5px;
  }

}

@media (max-width: 480px) {
  .mega-menu-wrapper {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .mega-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trust-badges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-showcase-banner {
    flex-direction: column-reverse;
    text-align: center;
  }

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

@media (max-width: 360px) {
  .header-container {
    padding-inline: 9px;
    gap: 4px;
  }

  .trust-badges-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .trust-badge-pill {
    min-height: 68px;
    padding-inline: 12px;
  }

  .brand-link {
    font-size: 0.72rem;
    gap: 4px;
  }

  .brand-icon {
    width: 21px;
    height: 21px;
  }

  .header-actions {
    gap: 4px;
  }

  .lang-switch-pill {
    padding-inline: 7px;
  }

  .theme-toggle-pill {
    width: 43px;
  }

  [data-theme="dark"] .theme-toggle-knob,
  .theme-toggle-pill.is-dark .theme-toggle-knob {
    transform: translateX(17px) !important;
  }
}


/* ==========================================================================
   Tool Page Modern Glass Components & Dropzone System
   ========================================================================== */

/* Universal Hide on Raw File Inputs */
input[type="file"],
.dropzone input[type="file"],
.hidden-file-input {
  display: none !important;
  opacity: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  visibility: hidden !important;
}

/* Modern Frosted Glass Dropzone */
.dropzone {
  min-height: 260px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(40px, 6vw, 62px) 24px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.65);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

[data-theme="dark"] .dropzone {
  background-color: rgba(15, 23, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.15);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary-light);
  transform: scale(1.008);
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  color: var(--brand-primary);
  margin-block-end: 18px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-3px);
}

.dropzone-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-block-end: 10px;
  line-height: 1.4;
}

.dropzone-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-block-end: 20px;
  max-width: 580px;
}

.dropzone-subtitle:last-child {
  margin-block-end: 0;
}

.dropzone-browse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  background-color: var(--brand-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--brand-primary-light);
  transition: all 0.18s ease;
  pointer-events: auto;
  margin-block-start: 6px;
}

.dropzone-browse-btn:hover {
  background-color: var(--brand-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--brand-primary-light);
}

/* Tool Page Feature Pills Grid (Vision Matching) */
.tool-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-block-start: var(--space-8);
  margin-block-end: var(--space-6);
}

@media (max-width: 768px) {
  .tool-feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .tool-feature-grid {
    grid-template-columns: 1fr;
  }
}

.tool-feature-pill {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
}

.tool-feature-pill-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background-color: var(--brand-primary-light);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-feature-pill-title {
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.tool-feature-pill-desc {
  color: var(--text-muted);
  font-size: 0.75rem;
  display: block;
}

/* Sleek Collapsible iOS Glass Accordion (Fixes Dead Weight) */
.tool-disclosures {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-block-start: var(--space-4);
  margin-block-end: var(--space-8);
}

.glass-accordion {
  background: rgba(18, 24, 38, 0.65);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.glass-accordion:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(22, 29, 46, 0.75);
}

.glass-accordion[open] {
  background: rgba(20, 26, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.14);
}

.glass-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s ease;
}

.glass-accordion-header::-webkit-details-marker {
  display: none;
}

.glass-accordion-header:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: -2px;
  border-radius: 18px;
}

.glass-accordion-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.12);
  color: var(--brand-primary);
  border: 1px solid rgba(14, 165, 233, 0.2);
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.glass-accordion[open] .accordion-icon-wrap {
  background: rgba(14, 165, 233, 0.2);
}

.accordion-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.accordion-chevron {
  width: 18px;
  height: 18px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
  color: var(--text-muted);
  flex-shrink: 0;
}

.glass-accordion[open] .accordion-chevron {
  transform: rotate(180deg);
  color: var(--brand-primary);
}

.glass-accordion-body {
  padding: 0 20px 20px 20px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
  border-block-start: 1px solid rgba(255, 255, 255, 0.06);
  padding-block-start: 16px;
}

.glass-accordion-body p {
  margin: 0 0 12px 0;
  line-height: 1.7;
}

.glass-accordion-body p:last-child {
  margin-bottom: 0;
}

.glass-accordion-body strong {
  color: #ffffff;
  font-weight: 600;
}

/* Modern Numbered Step List */
.glass-accordion-body ol,
.glass-accordion-body .tool-steps {
  list-style: none;
  counter-reset: acc-step;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.glass-accordion-body ol > li,
.glass-accordion-body .tool-steps > li {
  counter-increment: acc-step;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.65;
  padding: 2px 0;
}

.glass-accordion-body ol > li::before,
.glass-accordion-body .tool-steps > li::before {
  content: counter(acc-step, decimal-leading-zero);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(255, 255, 255, 0.06);
  color: var(--brand-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  margin-block-start: 2px;
}

/* Modern Unordered Bullet List */
.glass-accordion-body ul {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.glass-accordion-body ul > li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.65;
}

.glass-accordion-body ul > li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-primary);
  flex-shrink: 0;
  margin-block-start: 10px;
  opacity: 0.85;
}

.glass-accordion-body .privacy-note {
  margin: 0;
  line-height: 1.7;
  font-size: 0.92rem;
}

/* Light Theme Accordion Overhaul */
[data-theme="light"] .glass-accordion {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .glass-accordion:hover {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 24px -2px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .glass-accordion[open] {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 30px -4px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .glass-accordion-header:hover {
  background: rgba(0, 0, 0, 0.015);
}

[data-theme="light"] .accordion-icon-wrap {
  background: rgba(14, 165, 233, 0.08);
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.18);
}

[data-theme="light"] .glass-accordion[open] .accordion-icon-wrap {
  background: rgba(14, 165, 233, 0.15);
}

[data-theme="light"] .accordion-title-text {
  color: #0f172a;
}

[data-theme="light"] .accordion-chevron {
  color: #64748b;
}

[data-theme="light"] .glass-accordion[open] .accordion-chevron {
  color: #0284c7;
}

[data-theme="light"] .glass-accordion-body {
  border-block-start-color: rgba(0, 0, 0, 0.06);
  color: #334155;
}

[data-theme="light"] .glass-accordion-body strong {
  color: #0f172a;
}

[data-theme="light"] .glass-accordion-body ol > li::before,
[data-theme="light"] .glass-accordion-body .tool-steps > li::before {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.22);
  color: #0284c7;
}

[data-theme="light"] .glass-accordion-body ul > li::before {
  background: #0284c7;
}

/* 13. Categorized All Tools Page Accordions */
.all-categories-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-block-end: var(--space-14);
}

.category-accordion {
  background-color: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 28px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
}

.category-accordion:hover {
  border-color: var(--border-medium);
}

.category-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 0.15s ease;
}

.category-accordion-header::-webkit-details-marker {
  display: none;
}

.category-accordion-header:hover {
  background-color: var(--bg-subtle);
}

.cat-header-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cat-header-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background-color: var(--brand-primary-light);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-header-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.cat-header-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: block;
}

.cat-header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.cat-count-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-primary);
  background-color: var(--brand-primary-light);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.category-accordion .accordion-chevron {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
}

.category-accordion[open] .accordion-chevron {
  transform: rotate(180deg);
}

.category-accordion-body {
  padding: var(--space-4) var(--space-6) var(--space-6) var(--space-6);
  border-block-start: 1px solid var(--border-subtle);
}


/* Articles library, enhanced view-all action, and privacy modal details */
.articles-view-all {
  min-height: 42px;
  padding: 0 15px;
  color: var(--text-main);
  background: color-mix(in srgb, var(--bg-card) 76%, var(--brand-primary-light));
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.articles-view-all:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary-border);
  box-shadow: 0 9px 22px rgba(37, 99, 235, .14);
}
.articles-view-all svg { color: var(--brand-primary); transition: transform .18s ease; }
.articles-view-all:hover svg { transform: translateX(3px); }
[dir="rtl"] .articles-view-all:hover svg { transform: translateX(-3px); }
.articles-view-all:focus-visible,
.articles-search input:focus-visible,
.article-index-card:focus-visible,
.article-reading-cta:focus-visible,
.footer-privacy-open:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-primary) 55%, transparent); outline-offset: 3px; }

.articles-page { padding-block: clamp(20px, 4vw, 44px) clamp(56px, 8vw, 90px); }
.articles-page-hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 0 auto clamp(36px, 5vw, 58px);
  padding: clamp(26px, 5vw, 52px) 22px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary-light) 76%, var(--bg-card)), color-mix(in srgb, var(--bg-surface) 82%, transparent));
  border: 1px solid var(--border-subtle);
  border-radius: clamp(22px, 3vw, 34px);
  box-shadow: 0 18px 50px rgba(31, 52, 92, .08), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.articles-page-hero::before { position: absolute; inset: auto -8% -180px; height: 260px; content: ""; background: radial-gradient(ellipse, color-mix(in srgb, var(--brand-primary) 16%, transparent), transparent 68%); pointer-events: none; }
.articles-page-eyebrow { position: relative; padding: 6px 11px; color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary-light) 74%, white); border: 1px solid var(--brand-primary-border); border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; }
.articles-page-hero h1 { position: relative; max-width: 850px; margin: 0; color: var(--text-main); font-size: clamp(1.8rem, 4vw, 3.1rem); font-weight: 850; line-height: 1.18; }
.articles-page-hero > p { position: relative; max-width: 680px; margin: 0; color: var(--text-muted); font-size: clamp(.94rem, 1.5vw, 1.08rem); line-height: 1.75; }
.articles-page-count { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-block-start: 5px; padding: 8px 13px; color: var(--text-muted); background: color-mix(in srgb, var(--bg-card) 82%, transparent); border: 1px solid var(--border-subtle); border-radius: 999px; font-size: .8rem; }
.articles-page-count span:first-child { color: var(--brand-primary); font-size: 1rem; font-weight: 850; }
.articles-index-section, .articles-reading-section { margin-block-end: clamp(42px, 6vw, 72px); }
.articles-index-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-block-end: 18px; }
.articles-index-heading-row h2, .articles-reading-section > h2 { margin: 0 0 6px; color: var(--text-main); font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 820; }
.articles-index-heading-row p { margin: 0; color: var(--text-muted); font-size: .88rem; line-height: 1.6; }
.articles-search { display: flex; flex: 0 1 310px; align-items: center; gap: 9px; min-height: 44px; padding: 0 12px; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 14px; box-shadow: 0 5px 18px rgba(15, 23, 42, .05); }
.articles-search svg { flex: 0 0 19px; width: 19px; height: 19px; color: var(--brand-primary); }
.articles-search input { width: 100%; min-width: 0; height: 42px; color: var(--text-main); background: transparent; border: 0; outline: 0; font: inherit; font-size: .85rem; }
.articles-search input::placeholder { color: var(--text-muted); opacity: .82; }
.articles-index-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.article-index-card { min-height: 205px; text-decoration: none; }
.article-index-card .article-card-body { position: relative; }
.article-index-number { display: inline-grid; place-items: center; width: 31px; height: 31px; margin-block-end: 12px; color: var(--brand-primary); background: var(--brand-primary-light); border-radius: 10px; font: 800 .72rem/1 var(--font-mono); }
.article-index-time { float: inline-end; margin-block-start: 6px; color: var(--text-muted); font-size: .72rem; font-weight: 650; }
.article-index-card .article-card-title { font-size: 1.03rem; }
.article-index-card .article-card-desc { font-size: .82rem; }
.article-index-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-block-start: 15px; color: var(--brand-primary); font-size: .8rem; font-weight: 750; }
.article-card-featured .article-index-number { color: #fff; background: rgba(255, 255, 255, .2); }
.article-card-featured .article-index-time, .article-card-featured .article-index-cta { color: rgba(255, 255, 255, .88); }
.articles-reading-section { margin-block-end: clamp(42px, 6vw, 72px); }
.articles-reading-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block-end: 18px; }
.articles-reading-heading-row > h2 { margin: 0; color: var(--text-main); font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 820; }
.articles-toggle-all-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; min-height: 38px; background-color: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); color: var(--text-muted); font-size: 0.8125rem; font-weight: 650; cursor: pointer; transition: all 0.15s ease; user-select: none; }
.articles-toggle-all-btn:hover { color: var(--text-main); border-color: var(--border-medium); background-color: var(--bg-subtle); }
.articles-toggle-all-btn:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.articles-toggle-all-btn .toggle-all-icon { transition: transform 0.22s ease; }
.articles-toggle-all-btn.is-expanded .toggle-all-icon { transform: rotate(180deg); }

.articles-reading-list { display: grid; gap: 16px; }
.article-reading-card { scroll-margin-block-start: 36px; background: color-mix(in srgb, var(--bg-card) 90%, var(--brand-primary-light)); border: 1px solid var(--border-subtle); border-radius: 22px; box-shadow: 0 8px 24px rgba(31, 52, 92, .05), inset 0 1px 0 rgba(255, 255, 255, .5); overflow: hidden; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.article-reading-card:hover { border-color: var(--border-medium); }
.article-reading-card[open] { border-color: color-mix(in srgb, var(--brand-primary) 38%, var(--border-subtle)); box-shadow: 0 16px 36px rgba(31, 52, 92, .09), inset 0 1px 0 rgba(255, 255, 255, .6); }
.article-reading-card[hidden], .article-index-card[hidden] { display: none !important; }

.article-reading-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: clamp(16px, 2.2vw, 24px) clamp(18px, 2.8vw, 30px); cursor: pointer; list-style: none; user-select: none; transition: background-color 0.15s ease; }
.article-reading-summary::-webkit-details-marker { display: none; }
.article-reading-summary:hover { background-color: var(--bg-subtle); }
.article-reading-summary:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; }

.article-reading-summary-content { flex: 1; min-width: 0; }
.article-reading-topline { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font: 750 .7rem/1.3 var(--font-mono); letter-spacing: .04em; margin-block-end: 6px; }
.article-reading-topline span:first-child { color: var(--brand-primary); font-weight: 800; }
.article-reading-title { margin: 0 0 6px; color: var(--text-main); font-size: clamp(1.15rem, 2vw, 1.45rem); font-weight: 800; line-height: 1.35; }
.article-reading-intro { max-width: 860px; margin: 0; color: var(--text-muted); font-size: .9rem; line-height: 1.65; }

.article-reading-chevron { width: 38px; height: 38px; border-radius: var(--radius-pill); background-color: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.article-reading-summary:hover .article-reading-chevron { color: var(--brand-primary); border-color: var(--brand-primary-border); background-color: var(--brand-primary-light); }
.article-reading-card[open] .article-reading-chevron { transform: rotate(180deg); color: var(--brand-primary); border-color: var(--brand-primary-border); background-color: var(--brand-primary-light); }

.article-reading-body { padding: 0 clamp(18px, 2.8vw, 30px) clamp(20px, 2.8vw, 32px); border-block-start: 1px solid var(--border-subtle); animation: articleFadeIn 0.2s ease-out; }
@keyframes articleFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.article-reading-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-block: 20px; }
.article-reading-point { padding: 16px; background: color-mix(in srgb, var(--bg-surface) 88%, transparent); border: 1px solid var(--border-subtle); border-radius: 16px; }
.article-reading-point h4 { margin: 0 0 7px; color: var(--text-main); font-size: .92rem; font-weight: 750; }
.article-reading-point p { margin: 0; color: var(--text-muted); font-size: .84rem; line-height: 1.7; }
.article-reading-footer { display: flex; align-items: center; margin-block-start: 6px; }
.article-reading-cta { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 16px; color: #fff; background: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 78%, #172554)); border-radius: 999px; box-shadow: 0 8px 18px color-mix(in srgb, var(--brand-primary) 24%, transparent); font-size: .82rem; font-weight: 750; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.article-reading-cta:hover { transform: translateY(-2px); box-shadow: 0 11px 24px color-mix(in srgb, var(--brand-primary) 30%, transparent); }
.articles-search-empty { margin: 0 0 14px; padding: 14px; color: var(--text-muted); background: var(--bg-card); border: 1px dashed var(--border-medium); border-radius: 14px; text-align: center; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.privacy-dialog-note { margin: 18px 0 0; padding: 14px 16px; color: var(--text-muted); background: color-mix(in srgb, var(--bg-surface) 84%, transparent); border: 1px solid var(--border-subtle); border-radius: 14px; font-size: .78rem; line-height: 1.7; }
.privacy-dialog .about-dialog-actions { justify-content: end; }

@media (max-width: 900px) {
  .articles-index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-reading-points { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .articles-index-heading-row { align-items: stretch; flex-direction: column; }
  .articles-reading-heading-row { align-items: stretch; }
  .articles-search { flex-basis: auto; }
  .articles-index-grid { grid-template-columns: minmax(0, 1fr); }
  .article-index-card { min-height: 170px; }
  .articles-view-all { min-height: 38px; padding-inline: 12px; font-size: .78rem; }
  .privacy-dialog .about-dialog-features { grid-template-columns: minmax(0, 1fr); }
}

/* Universal Reusable Modal Dialog & Toast System */
.kz-modal-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  max-width: min(440px, calc(100vw - 32px));
  width: 100%;
  overflow: visible;
  color: var(--text-main);
  z-index: 99999;
}

.kz-modal-dialog::backdrop {
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
}

.kz-modal-dialog[open] {
  animation: kz-modal-pop 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes kz-modal-pop {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.kz-modal-card {
  position: relative;
  padding: clamp(20px, 4.5vw, 28px);
  background:
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.12), transparent 55%),
    var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 26px;
  box-shadow: 0 28px 70px -15px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.kz-modal-card[data-type="error"] {
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.15), transparent 55%),
    var(--bg-surface);
  border-color: rgba(239, 68, 68, 0.3);
}

.kz-modal-card[data-type="warning"] {
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.15), transparent 55%),
    var(--bg-surface);
  border-color: rgba(245, 158, 11, 0.3);
}

.kz-modal-card[data-type="success"] {
  background:
    radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.15), transparent 55%),
    var(--bg-surface);
  border-color: rgba(16, 185, 129, 0.3);
}

.kz-modal-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.kz-modal-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: transform 0.2s ease;
}

.kz-modal-icon-badge svg {
  width: 24px;
  height: 24px;
}

.kz-icon-info,
.kz-icon-confirm {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.28);
}

.kz-icon-warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.kz-icon-error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}

.kz-icon-success {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.28);
}

.kz-modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.16s ease;
}

.kz-modal-close-btn svg {
  width: 17px;
  height: 17px;
}

.kz-modal-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
  transform: scale(1.05);
}

.kz-modal-close-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.kz-modal-content {
  margin-bottom: 22px;
}

.kz-modal-title {
  margin: 0 0 8px 0;
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.kz-modal-desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  word-break: break-word;
}

.kz-modal-prompt-wrap {
  margin-top: 14px;
}

.kz-modal-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.18s ease;
}

.kz-modal-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  background: var(--bg-surface);
}

.kz-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kz-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.kz-modal-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

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

.kz-modal-btn-cancel {
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-main);
}

.kz-modal-btn-cancel:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
}

.kz-modal-btn-confirm.is-primary {
  border: none;
  background: linear-gradient(135deg, var(--brand-primary), color-mix(in srgb, var(--brand-primary) 82%, #1e3a8a));
  color: #ffffff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-primary) 32%, transparent);
}

.kz-modal-btn-confirm.is-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand-primary) 42%, transparent);
}

.kz-modal-btn-confirm.is-danger {
  border: none;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.32);
}

.kz-modal-btn-confirm.is-danger:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.42);
}

.kz-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 32px));
}

[dir="rtl"] .kz-toast-container {
  right: auto;
  left: 24px;
}

.kz-toast-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.35);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  animation: kz-toast-slide 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.kz-toast-item.is-leaving {
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: all 0.2s ease;
}

@keyframes kz-toast-slide {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.kz-toast-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.kz-toast-info .kz-toast-icon { color: #3b82f6; }
.kz-toast-success .kz-toast-icon { color: #10b981; }
.kz-toast-warning .kz-toast-icon { color: #f59e0b; }
.kz-toast-error .kz-toast-icon { color: #ef4444; }

@media (max-width: 480px) {
  .kz-modal-actions {
    flex-direction: column-reverse;
  }
  .kz-modal-btn {
    width: 100%;
  }
  .kz-toast-container {
    left: 16px !important;
    right: 16px !important;
    bottom: 16px;
    max-width: none;
  }
}

/* ==========================================================================
   Universal Custom Dropdown Select System (Apple / Linear Aesthetic)
   Replaces native browser option lists with a sleek floating glass menu.
   Fixes selector arrow sticking to the edge with generous, balanced insets.
   ========================================================================== */

.kz-native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.kz-select-wrapper {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.kz-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 9px 16px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  font: 600 .9rem/1.3 var(--font-system);
  text-align: start;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
  outline: none;
}

[dir="rtl"] .kz-select-trigger {
  text-align: right;
}

.kz-select-trigger:hover {
  border-color: var(--brand-primary-border);
  background: var(--bg-card);
}

.kz-select-trigger:focus-visible,
.kz-select-wrapper.is-active .kz-select-trigger {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}

.kz-select-trigger.is-disabled,
.kz-select-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.kz-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-main);
}

.kz-select-arrow {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), color .18s ease;
}

.kz-select-trigger[aria-expanded="true"] .kz-select-arrow {
  transform: rotate(180deg);
  color: var(--brand-primary);
}

.kz-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 270px;
  max-width: 380px;
  width: max-content;
  z-index: 1050;
  background: var(--bg-surface, #ffffff);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  box-shadow: 0 16px 42px -6px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 6px;
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.kz-select-dropdown.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.kz-select-dropdown.is-open-upwards {
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(6px) scale(0.98);
}

.kz-select-dropdown.is-open.is-open-upwards {
  transform: translateY(0) scale(1);
}

.kz-select-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kz-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  min-height: 36px;
  border-radius: 8px;
  color: var(--text-main);
  font-size: .86rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background-color .14s ease, color .14s ease;
  box-sizing: border-box;
}

.kz-select-option.is-in-group {
  padding-inline-start: 20px;
  position: relative;
}

.kz-select-option.is-in-group::before {
  content: '';
  position: absolute;
  inset-inline-start: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-medium, rgba(0, 0, 0, 0.25));
  opacity: 0.35;
  transition: opacity .15s ease, transform .15s ease, background-color .15s ease;
}

.kz-select-option.is-in-group:hover::before,
.kz-select-option.is-in-group.is-focused::before,
.kz-select-option.is-in-group.is-selected::before {
  opacity: 1;
  background: var(--brand-primary, #2563eb);
  transform: translateY(-50%) scale(1.3);
}

.kz-select-option:hover,
.kz-select-option.is-focused {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

.kz-select-option.is-selected {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  font-weight: 750;
}

.kz-select-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.kz-option-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kz-font-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.kz-font-name {
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
}

.kz-font-sub {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  font-weight: normal;
  white-space: nowrap;
  opacity: 0.85;
  font-family: inherit;
}

.kz-font-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-inline-start: auto;
}

.kz-badge-extracted {
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand-primary, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.kz-badge-default {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.kz-option-check {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--brand-primary);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity .14s ease, transform .14s ease;
  flex-shrink: 0;
}

.kz-select-option.is-selected .kz-option-check {
  opacity: 1;
  transform: scale(1);
}

.kz-select-optgroup {
  list-style: none;
  position: sticky;
  top: -6px;
  z-index: 5;
  padding: 8px 6px 4px;
  background: var(--bg-surface, #ffffff);
  border-top: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.08));
  margin-top: 6px;
  border-radius: 4px;
}

.kz-select-optgroup:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 2px;
}

.kz-select-optgroup-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.03em;
  user-select: none;
}

.kz-select-optgroup-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle, rgba(0, 0, 0, 0.07));
}

/* Fallback for native selects across the entire site */
select:not(.kz-native-select-hidden) {
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 9px 42px 9px 16px;
  color: var(--text-main);
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  font: inherit;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}

[dir="rtl"] select:not(.kz-native-select-hidden),
select[dir="rtl"]:not(.kz-native-select-hidden) {
  padding: 9px 16px 9px 42px;
  background-position: left 14px center;
}


