/**
 * Kazakan Tools 2.0 — Universal Tool Page Core Framework
 * Contains: Tool Hero, Breadcrumbs, Workspace, Inputs, Action Buttons, Dropzone System, Custom Dropdown Select,
 * Results Display, Instructions/FAQ Accordion, Native Promo Card, Related Tools, Universal Print
 */
/* Zero-latency system font stack (eliminates layout shifts from font swapping) */

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-block-end: var(--space-4);
  list-style: none;
}

.breadcrumbs a {
  color: var(--text-muted);
  min-height: var(--min-touch-size);
  display: inline-flex;
  align-items: center;
}

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

.breadcrumbs-separator {
  color: var(--text-subtle);
}

/* Tool Hero Liquid Glass Section */
.tool-hero-glass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  margin-block-end: var(--space-8);
  padding: var(--space-6) var(--space-7);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  -webkit-backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  box-shadow: 0 16px 38px -8px rgba(0, 0, 0, 0.52), 0 4px 12px -2px rgba(0, 0, 0, 0.28), inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.2);
}

.tool-hero-content {
  flex: 1;
  min-width: 0;
}

.tool-hero-title {
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-block-end: var(--space-2);
  color: var(--text-main);
  line-height: 1.25;
}

.tool-hero-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 780px;
  margin-block-end: var(--space-4);
}

.tool-hero-badges {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.tool-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.tool-badge-pill.primary {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.tool-badge-pill.subtle {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-hero-art {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-hero-art img {
  width: 148px;
  height: 148px;
  max-width: 95%;
  max-height: 95%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.45));
}

@media (max-width: 640px) {
  .tool-hero-glass {
    flex-direction: column-reverse;
    text-align: center;
    padding: var(--space-5);
  }

  .tool-hero-badges {
    justify-content: center;
  }

  .tool-hero-art img {
    width: 90px;
    height: 90px;
    aspect-ratio: 1 / 1;
  }
}


/* Tool Workspace */
.tool-workspace {
  position: relative;
  z-index: 25;
  min-height: 280px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  -webkit-backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-block-end: var(--space-6);
  box-shadow: 0 16px 38px -8px rgba(0, 0, 0, 0.48), 0 4px 12px -2px rgba(0, 0, 0, 0.25), inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.22);
}

.tool-feature-grid {
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .tool-workspace {
    padding: var(--space-4);
  }
}

/* Liquid Glass Form Inputs & Textareas */
.glass-textarea,
textarea.search-input,
.tool-workspace textarea {
  width: 100%;
  min-height: 200px;
  padding: 16px 20px;
  background: rgba(8, 13, 25, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  font-family: var(--font-system);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-main);
  resize: vertical;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.glass-textarea:focus,
textarea.search-input:focus,
.tool-workspace textarea:focus {
  outline: none;
  background: rgba(14, 22, 42, 0.9);
  border-color: #3b82f6;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Inputs across workspaces */
.tool-workspace input[type="text"],
.tool-workspace input[type="number"],
.tool-workspace input[type="date"],
.tool-workspace select {
  height: 48px;
  padding: 0 16px;
  background: rgba(8, 13, 25, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  font-family: var(--font-system);
  font-size: 0.95rem;
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.tool-workspace input[type="text"]:focus,
.tool-workspace input[type="number"]:focus,
.tool-workspace input[type="date"]:focus,
.tool-workspace select:focus {
  outline: none;
  background: rgba(14, 22, 42, 0.9);
  border-color: #3b82f6;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Common Interactive Area */
.interactive-area {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(20, 30, 52, 0.6);
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  user-select: none;
  touch-action: manipulation;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.interactive-area.active {
  background-color: rgba(59, 130, 246, 0.15);
  border-color: #3b82f6;
}

/* Primary Action Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-touch-size);
  padding-inline: var(--space-6);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-pill);
  border: none;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-touch-size);
  padding-inline: var(--space-5);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-pill);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Results Display */
.results-box {
  margin-block-start: var(--space-5);
  padding: 16px 20px;
  background: rgba(10, 16, 32, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-4);
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  transition: all 0.2s ease;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-block-start: 4px;
}

/* Light Theme Variants for Tool Pages */
[data-theme="light"] .tool-hero-glass {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.38) 100%);
  backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  -webkit-backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 36px -8px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04), inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 1px 0 rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .tool-workspace {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.4) 100%);
  backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  -webkit-backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px -6px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04), inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 1px 0 rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .glass-textarea,
[data-theme="light"] textarea.search-input,
[data-theme="light"] .tool-workspace textarea {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text-main);
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .glass-textarea:focus,
[data-theme="light"] textarea.search-input:focus,
[data-theme="light"] .tool-workspace textarea:focus {
  background: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04), 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .tool-workspace input[type="text"],
[data-theme="light"] .tool-workspace input[type="number"],
[data-theme="light"] .tool-workspace input[type="date"],
[data-theme="light"] .tool-workspace select {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text-main);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .tool-workspace input[type="text"]:focus,
[data-theme="light"] .tool-workspace input[type="number"]:focus,
[data-theme="light"] .tool-workspace input[type="date"]:focus,
[data-theme="light"] .tool-workspace select:focus {
  background: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04), 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .interactive-area {
  background-color: rgba(240, 244, 250, 0.7);
  border-color: rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .results-box {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .stat-item {
  background: rgba(240, 244, 250, 0.8);
  border-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .stat-value {
  color: var(--brand-primary);
}

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

[data-theme="light"] .btn-secondary:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(15, 23, 42, 0.2);
}

[data-theme="light"] .tool-badge-pill.primary {
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  border-color: var(--brand-primary-border);
}

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

/* Tool Instructions & FAQ */
.tool-info-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-block-end: var(--space-6);
}

.tool-info-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-block-end: var(--space-3);
  color: var(--text-main);
}

.tool-info-content {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.tool-info-content p {
  margin-block-end: var(--space-3);
}

.tool-info-content ul {
  padding-inline-start: var(--space-5);
  margin-block-end: var(--space-3);
}

/* =======================================================
   Suggested Related Tools Section (Clean, Store-Aligned)
   ======================================================= */
.related-tools-section {
  margin-block: var(--space-8) var(--space-4);
  padding: 0;
  position: relative;
}

.related-tools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-block-end: var(--space-4);
  flex-wrap: wrap;
}

.related-tools-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.related-tools-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.775rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #0f1e3d;
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

[data-theme="light"] .related-tools-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.related-tools-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.35;
}

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

.related-tools-cat-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 9999px;
  min-height: 42px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  border: 1.5px solid rgba(37, 99, 235, 0.24);
  box-shadow: 0 2px 8px -2px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .related-tools-cat-link {
  background: #ffffff;
  color: #2563eb;
  border: 1.5px solid rgba(37, 99, 235, 0.26);
  box-shadow: 0 2px 10px -2px rgba(37, 99, 235, 0.14);
}

[data-theme="dark"] .related-tools-cat-link {
  background: rgba(30, 58, 138, 0.25);
  color: #93c5fd;
  border: 1.5px solid rgba(96, 165, 250, 0.32);
  box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.4);
}

.related-tools-cat-link:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 6px 18px -3px rgba(37, 99, 235, 0.35);
  transform: translateY(-1.5px);
}

[data-theme="dark"] .related-tools-cat-link:hover {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 6px 20px -3px rgba(59, 130, 246, 0.45);
  transform: translateY(-1.5px);
}

.related-tools-cat-link svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.related-tools-cat-link:hover svg {
  transform: translateX(4px);
}

[dir="rtl"] .related-tools-cat-link:hover svg {
  transform: translateX(-4px);
}

.related-tools-cat-link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

/* Compact Glass Tool Card for Related Tools Section (Image & Name Only - 100% Uniform Size) */
.tool-card-glass.related-tool-card {
  height: 185px;
  min-height: 185px;
  box-sizing: border-box;
  padding: 20px 16px 16px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  -webkit-backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 16px 38px -8px rgba(0, 0, 0, 0.52), 0 4px 12px -2px rgba(0, 0, 0, 0.28), inset 0 1px 1px 0 rgba(255, 255, 255, 0.32), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

[data-theme="light"] .tool-card-glass.related-tool-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.38) 100%);
  backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  -webkit-backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 32px -6px rgba(37, 99, 235, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.04), inset 0 1px 2px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 1px 0 rgba(15, 23, 42, 0.03);
  color: var(--text-main);
}

.tool-card-glass.related-tool-card:hover {
  transform: translateY(-5px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(37, 99, 235, 0.12) 100%), rgba(18, 28, 52, 0.55);
  border-color: rgba(96, 165, 250, 0.45);
  border-top-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 24px 48px -10px rgba(0, 0, 0, 0.68), 0 0 28px -4px rgba(59, 130, 246, 0.25), inset 0 1px 2px 0 rgba(255, 255, 255, 0.45);
}

[data-theme="light"] .tool-card-glass.related-tool-card:hover {
  transform: translateY(-5px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 100%);
  border-color: rgba(255, 255, 255, 0.9);
  border-top-color: #ffffff;
  box-shadow: 0 20px 42px -8px rgba(37, 99, 235, 0.16), 0 6px 16px -2px rgba(15, 23, 42, 0.06), inset 0 1px 2px 0 #ffffff;
}

.related-tool-card .tool-card-img-wrap {
  width: 100%;
  height: 98px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block-end: 10px;
}

.related-tool-card .tool-card-img-wrap img {
  max-width: 110px;
  max-height: 92px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), filter 0.28s ease;
}

.related-tool-card:hover .tool-card-img-wrap img {
  transform: scale(1.1) translateY(-3px);
  filter: drop-shadow(0 12px 22px rgba(37, 99, 235, 0.3));
}

.related-tool-card .tool-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  line-height: 1.35;
  text-align: center;
  height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

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

.tool-card-glass.related-tool-card:active {
  transform: scale(0.97);
}

.related-tools-cat-link:active {
  transform: scale(0.97);
}

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

  .tool-card-glass.related-tool-card {
    height: auto !important;
    min-height: 172px;
    padding: 16px 14px 14px;
    border-radius: 18px;
    justify-content: center;
    gap: 8px;
  }

  .related-tool-card .tool-card-img-wrap {
    height: 82px;
    margin-block-end: 0;
  }

  .related-tool-card .tool-card-img-wrap img {
    max-width: 92px;
    max-height: 76px;
  }

  .related-tool-card .tool-card-title {
    font-size: 0.88rem;
    height: 2.6em;
  }
}

@media (max-width: 768px) {
  .related-tools-section {
    margin-block: var(--space-6) var(--space-3);
  }

  .related-tools-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "badge link"
      "title title";
    gap: 8px 12px;
    align-items: center;
    margin-block-end: 12px;
  }

  .related-tools-title-group {
    display: contents;
  }

  .related-tools-badge {
    grid-area: badge;
    justify-self: start;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    gap: 5px;
  }

  .related-tools-cat-link {
    grid-area: link;
    justify-self: end;
    min-height: 34px;
    padding: 5px 14px;
    font-size: 0.78rem;
    gap: 6px;
    border-radius: 9999px;
  }

  .related-tools-title {
    grid-area: title;
    font-size: 1.05rem;
    line-height: 1.32;
    margin: 0;
  }
}

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

  .tool-card-glass.related-tool-card {
    height: auto !important;
    min-height: 132px;
    padding: 11px 8px 8px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.35);
  }

  .related-tool-card .tool-card-img-wrap {
    width: 100%;
    height: 70px;
    margin-block-end: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .related-tool-card .tool-card-img-wrap img {
    max-width: 78px;
    max-height: 66px;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .related-tool-card .tool-card-title {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25;
    height: 2.5em;
    margin: 0;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .related-tools-cat-link {
    min-height: 32px;
    padding: 4px 11px;
    font-size: 0.74rem;
  }

  .related-tools-cat-link svg {
    width: 12px;
    height: 12px;
  }

  .related-tools-title {
    font-size: 1rem;
  }
}

@media (max-width: 420px) {
  .related-tools-grid {
    gap: 6px;
  }

  .tool-card-glass.related-tool-card {
    min-height: 136px;
    padding: 9px 6px 6px;
    border-radius: 12px;
    gap: 4px;
  }

  .related-tool-card .tool-card-img-wrap {
    height: 60px;
  }

  .related-tool-card .tool-card-img-wrap img {
    max-width: 66px;
    max-height: 56px;
  }

  .related-tool-card .tool-card-title {
    font-size: 0.64rem;
    line-height: 1.22;
    height: 2.45em;
  }

  .related-tools-header {
    gap: 6px 8px;
    margin-block-end: 10px;
  }

  .related-tools-badge {
    padding: 3px 8px;
    font-size: 0.725rem;
    font-weight: 700;
  }

  .related-tools-badge svg {
    width: 11px;
    height: 11px;
  }

  .related-tools-cat-link {
    min-height: 30px;
    padding: 3px 9px;
    font-size: 0.7rem;
    gap: 4px;
  }

  .related-tools-title {
    font-size: 0.94rem;
  }
}

@media (max-width: 360px) {
  .tool-card-glass.related-tool-card {
    min-height: 128px;
    padding: 8px 5px 5px;
    border-radius: 10px;
  }

  .related-tool-card .tool-card-img-wrap {
    height: 54px;
  }

  .related-tool-card .tool-card-img-wrap img {
    max-width: 58px;
    max-height: 50px;
  }

  .related-tool-card .tool-card-title {
    font-size: 0.60rem;
    line-height: 1.2;
    height: 2.4em;
  }

  .related-tools-cat-link {
    font-size: 0.66rem;
    padding: 2px 7px;
  }

  .related-tools-title {
    font-size: 0.88rem;
  }
}

/* =======================================================
   Modern Glass Kazakan Native Store Promo Banner
   ======================================================= */
.promo-card {
  display: none; /* Activated only when geo-validated via JS */
  margin-block: var(--space-8);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Dark Mode Appearance (Default) */
[data-theme="dark"] .promo-card,
.promo-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 58, 138, 0.32) 100%);
  border: 1px solid rgba(59, 130, 246, 0.28);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 36px -10px rgba(15, 23, 42, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Light Mode Appearance */
[data-theme="light"] .promo-card {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.94) 0%, rgba(219, 234, 254, 0.78) 100%);
  border: 1px solid rgba(59, 130, 246, 0.22);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 36px -10px rgba(37, 99, 235, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.75) inset;
}

.promo-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 20px 42px -10px rgba(37, 99, 235, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

/* Ambient Radial Accent */
.promo-card::before {
  content: '';
  position: absolute;
  top: -35%;
  inset-inline-end: -8%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle Top Rim Highlight */
.promo-card::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
  pointer-events: none;
}

.promo-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: 24px 32px;
  position: relative;
  z-index: 1;
}

.promo-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.promo-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-primary);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.26);
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1;
}

.promo-badge-icon {
  display: inline-block;
  flex-shrink: 0;
}

.promo-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.24);
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1;
}

.promo-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.promo-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

[data-theme="dark"] .promo-title,
.promo-title {
  color: #ffffff;
}

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

.promo-desc {
  font-size: 0.925rem;
  line-height: 1.6;
  margin: 0;
  max-width: 600px;
  transition: color 0.2s ease;
}

[data-theme="dark"] .promo-desc,
.promo-desc {
  color: #94a3b8;
}

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

.promo-footer-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.promo-card .promo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  font-size: 0.935rem;
  font-weight: 700;
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
}

[dir="rtl"] .promo-card .promo-btn::after {
  content: '←';
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.2s ease;
}

[dir="ltr"] .promo-card .promo-btn::after {
  content: '→';
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.2s ease;
}

.promo-card .promo-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45);
}

[dir="rtl"] .promo-card .promo-btn:hover::after {
  transform: translateX(-4px);
}

[dir="ltr"] .promo-card .promo-btn:hover::after {
  transform: translateX(4px);
}

.promo-card .promo-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.promo-card .promo-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

.promo-trust-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.825rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

[data-theme="dark"] .promo-trust-note,
.promo-trust-note {
  color: #cbd5e1;
}

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

.promo-trust-note svg {
  color: #3b82f6;
  flex-shrink: 0;
}

.promo-media-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-mascot-img {
  max-height: 155px;
  width: auto;
  aspect-ratio: 170 / 155;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.promo-card:hover .promo-mascot-img {
  transform: translateY(-3px) scale(1.05);
}

/* Mobile & Small Screens Responsiveness */
@media (max-width: 768px) {
  .promo-card {
    border-radius: 20px;
    margin-block: var(--space-6);
  }

  .promo-inner {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    padding: 22px 18px;
    gap: 16px;
  }

  .promo-header-row {
    justify-content: center;
  }

  .promo-title {
    font-size: 1.15rem;
  }

  .promo-desc {
    font-size: 0.875rem;
  }

  .promo-footer-row {
    justify-content: center;
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .promo-card .promo-btn {
    width: 100%;
  }

  .promo-mascot-img {
    max-height: 120px;
  }
}


/* Shared iPhone-style system for every tool page */
.container.tool-page,
.tool-page {
  width: 100%;
  max-width: var(--container-tool, 1380px);
  margin-inline: auto;
  min-width: 0;
  padding-block: clamp(20px, 3.5vw, 44px);
  padding-inline: clamp(16px, 2.5vw, 36px);
}

@media (min-width: 1440px) {
  .container.tool-page,
  .tool-page {
    max-width: 1440px;
  }
}

@media (min-width: 1680px) {
  .container.tool-page,
  .tool-page {
    max-width: 1540px;
  }
}

.tool-page > nav {
  margin-block-end: 18px;
}

.tool-page .breadcrumbs-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-color: var(--border-glass);
}

.tool-page .breadcrumbs-glass::-webkit-scrollbar {
  display: none;
}

.tool-hero-glass {
  align-items: center;
  min-height: 196px;
  padding: clamp(20px, 3.5vw, 34px);
  margin-block-end: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  -webkit-backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  box-shadow: 0 16px 38px -8px rgba(0, 0, 0, 0.52), 0 4px 12px -2px rgba(0, 0, 0, 0.28), inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.25), inset 0 -1px 1px 0 rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .tool-hero-glass {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.38) 100%);
  backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  -webkit-backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 36px -8px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04), inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 1px 0 rgba(15, 23, 42, 0.03);
}

.tool-hero-title {
  margin-block-end: 6px;
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  line-height: 1.25;
}

.tool-hero-desc {
  margin-block-end: 16px;
  font-size: 0.98rem;
}

.tool-hero-art {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.16), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 14px 32px rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .tool-hero-art {
  background: linear-gradient(145deg, rgba(219, 234, 254, 0.82), rgba(255, 255, 255, 0.78));
  border-color: rgba(59, 130, 246, 0.18);
  box-shadow: inset 0 1px 0 #fff, 0 14px 32px rgba(37, 99, 235, 0.14);
}

.tool-hero-art img {
  width: 148px;
  height: 148px;
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.22));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-hero-art:hover img {
  transform: scale(1.04);
}

.tool-workspace {
  min-width: 0;
  padding: clamp(18px, 3.2vw, 30px);
  margin-block-end: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  -webkit-backdrop-filter: blur(28px) saturate(210%) contrast(105%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 28px;
  box-shadow: 0 16px 38px -8px rgba(0, 0, 0, 0.48), 0 4px 12px -2px rgba(0, 0, 0, 0.25), inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.22);
}

[data-theme="light"] .tool-workspace {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.4) 100%);
  backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  -webkit-backdrop-filter: blur(28px) saturate(200%) contrast(102%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px -6px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04), inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 1px 0 rgba(15, 23, 42, 0.03);
}

.tool-workspace input:not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  color: var(--text-main);
  background: rgba(8, 13, 25, 0.58);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 3px 10px rgba(0, 0, 0, 0.06);
  font: 500 0.95rem/1.4 var(--font-system);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.tool-workspace select:not(.kz-native-select-hidden) {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 44px 0 16px;
  color: var(--text-main);
  background-color: rgba(8, 13, 25, 0.58);
  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;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 3px 10px rgba(0, 0, 0, 0.06);
  font: 500 0.95rem/1.4 var(--font-system);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

[dir="rtl"] .tool-workspace select:not(.kz-native-select-hidden) {
  padding: 0 16px 0 44px;
  background-position: left 14px center;
}

[data-theme="light"] .tool-workspace input:not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(100, 116, 139, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 10px rgba(15, 23, 42, 0.035);
}

[data-theme="light"] .tool-workspace select:not(.kz-native-select-hidden) {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.78);
  border-color: rgba(100, 116, 139, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 10px rgba(15, 23, 42, 0.035);
}

.tool-workspace textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 164px;
  padding: 15px 16px;
  color: var(--text-main);
  background: rgba(8, 13, 25, 0.58);
  border: 1px solid var(--border-medium);
  border-radius: 17px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 3px 10px rgba(0, 0, 0, 0.06);
  font: 400 1rem/1.7 var(--font-system);
  resize: vertical;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

[data-theme="light"] .tool-workspace textarea {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(100, 116, 139, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 10px rgba(15, 23, 42, 0.035);
}

.tool-workspace input::placeholder,
.tool-workspace textarea::placeholder {
  color: var(--text-subtle);
  opacity: 1;
}

.tool-workspace input:not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):focus,
.tool-workspace select:focus,
.tool-workspace textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px var(--brand-primary-light), 0 5px 18px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .tool-workspace input,
[data-theme="dark"] .tool-workspace textarea,
[data-theme="dark"] .tool-workspace select {
  color-scheme: dark;
}

[data-theme="light"] .tool-workspace input,
[data-theme="light"] .tool-workspace textarea,
[data-theme="light"] .tool-workspace select {
  color-scheme: light;
}

.tool-workspace input[type="checkbox"],
.tool-workspace input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
  vertical-align: middle;
}

.tool-workspace input[type="range"] {
  width: 100%;
  accent-color: var(--brand-primary);
  direction: ltr !important;
}

.tool-workspace input[type="color"] {
  width: 48px;
  height: 48px;
  padding: 4px;
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  background: var(--bg-glass);
}

.tool-workspace label {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
}

.tool-workspace .btn-primary,
.tool-workspace .btn-secondary,
.tool-workspace .dropzone-browse-btn,
.promo-btn {
  min-height: 44px;
  border-radius: var(--radius-pill);
  font-family: var(--font-system);
  font-weight: 700;
  letter-spacing: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.tool-workspace .btn-primary,
.tool-workspace .dropzone-browse-btn,
.promo-btn {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.tool-workspace .btn-secondary {
  color: var(--text-main);
  background: var(--bg-glass);
  border: 1px solid var(--border-medium);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tool-workspace .btn-secondary:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
  border-color: var(--border-medium);
}

.tool-workspace .btn-primary:hover,
.tool-workspace .btn-secondary:hover,
.tool-workspace .dropzone-browse-btn:hover,
.promo-btn:hover {
  transform: translateY(-1px);
}

.tool-workspace button:focus-visible,
.tool-workspace a:focus-visible,
.promo-btn:focus-visible {
  outline: 3px solid var(--brand-primary-border);
  outline-offset: 3px;
}

.tool-workspace button:disabled,
.tool-workspace input:disabled,
.tool-workspace select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.interactive-area {
  color: var(--text-main);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.08), rgba(255, 255, 255, 0.025)), var(--bg-glass);
  border: 1px solid var(--border-medium);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .interactive-area {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(230, 242, 255, 0.64));
  border-color: rgba(96, 165, 250, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 28px rgba(37, 99, 235, 0.07);
}

.results-box {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 138px), 1fr));
  gap: 12px;
  padding: 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .results-box {
  background: rgba(228, 239, 255, 0.54);
  border-color: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stat-item {
  min-width: 0;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .stat-item {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.045), inset 0 1px 0 #fff;
}

.stat-value {
  max-width: 100%;
  color: var(--brand-primary);
  font-size: clamp(1.25rem, 3.8vw, 1.8rem);
  overflow-wrap: anywhere;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}

.age-calculator {
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
}

.age-date-field {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  margin-block-end: 24px;
}

.age-date-field label {
  font-size: 0.92rem;
  font-weight: 700;
}

.age-date-input {
  text-align: center;
  font-weight: 650;
}

.age-results {
  display: none;
}

.age-summary-panel {
  margin-block-end: 20px;
  padding: clamp(20px, 3.5vw, 30px);
  text-align: center;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.09), rgba(255, 255, 255, 0.025)), var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .age-summary-panel {
  background: linear-gradient(145deg, rgba(232, 243, 255, 0.78), rgba(255, 255, 255, 0.68));
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 #fff, 0 8px 20px rgba(37, 99, 235, 0.05);
}

.age-summary-title {
  margin-block-end: 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.age-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 16px);
}

.age-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: clamp(16px, 2.5vw, 22px) 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.age-summary-item:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="light"] .age-summary-item {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.04);
}

[data-theme="light"] .age-summary-item:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.age-summary-value {
  color: var(--brand-primary);
  font: 800 clamp(1.75rem, 5vw, 2.5rem)/1.1 var(--font-mono);
}

.age-summary-label {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
}


/* Results Grid - Spacious & Balanced */
.age-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-block-end: 0;
}

.age-calculator .stat-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 18px 16px;
  min-height: 98px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.age-calculator .stat-item:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="light"] .age-calculator .stat-item:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
}

.age-calculator .stat-item .stat-value {
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 800;
  line-height: 1.2;
}

.stat-value-text {
  font-family: var(--font-system);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
}

.file-list-item,
.preview-card,
.qr-preview-box,
.audio-trimmer-wrapper,
.svg-preview-pane {
  background: var(--bg-glass);
  border-color: var(--border-glass);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .file-list-item,
[data-theme="light"] .preview-card,
[data-theme="light"] .qr-preview-box,
[data-theme="light"] .audio-trimmer-wrapper,
[data-theme="light"] .svg-preview-pane {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.88);
}

.tool-disclosures {
  gap: 10px;
  margin-block-start: 18px;
}

/* Accordion inherits rich liquid glass styling from glass.css */

@media (max-width: 640px) {
  .tool-page {
    padding-block: 18px 28px;
  }

  .tool-page > nav {
    margin-block-end: 12px;
  }

  .tool-hero-glass {
    flex-direction: column-reverse;
    min-height: 0;
    gap: 12px;
    padding: 18px;
    text-align: center;
  }

  .tool-hero-art {
    width: 112px;
    height: 112px;
    border-radius: 24px;
    padding: 4px;
  }

  .tool-hero-art img {
    width: 102px;
    height: 102px;
    max-width: 95%;
    max-height: 95%;
  }

  .tool-hero-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin-block-end: 4px;
  }

  .tool-hero-desc {
    margin-inline: auto;
    font-size: 0.9rem;
  }

  .tool-hero-badges {
    justify-content: center;
  }

  .tool-workspace {
    padding: 16px;
    border-radius: 22px;
  }

  .age-calendars-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .age-cal-header {
    flex-wrap: wrap;
    gap: 8px;
  }

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

  .age-calculator .stat-item {
    padding: 14px 12px;
    min-height: 84px;
  }

  .dropzone {
    min-height: 200px;
  }

  .time-input-group {
    flex: 1 1 150px;
    min-width: 0;
  }
}


/* ==========================================================================
   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: 275px;
  border: 2px dashed rgba(37, 99, 235, 0.48);
  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: linear-gradient(145deg, rgba(239, 246, 255, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 8px 30px -4px rgba(37, 99, 235, 0.12), 0 2px 8px -1px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  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: linear-gradient(145deg, rgba(30, 58, 138, 0.22) 0%, rgba(15, 23, 42, 0.7) 100%);
  border-color: rgba(96, 165, 250, 0.48);
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #2563eb;
  background: linear-gradient(145deg, rgba(224, 238, 255, 0.98) 0%, rgba(240, 246, 255, 1) 100%);
  box-shadow: 0 12px 36px -4px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
}

[data-theme="dark"] .dropzone:hover,
[data-theme="dark"] .dropzone.dragover {
  border-color: #60a5fa;
  background: linear-gradient(145deg, rgba(30, 58, 138, 0.35) 0%, rgba(15, 23, 42, 0.8) 100%);
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(96, 165, 250, 0.35) inset;
  transform: translateY(-2px);
}

.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;
}


/* ==========================================================================
   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%;
  max-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%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  min-height: 48px;
  height: 48px;
  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-wrapper.is-active {
  z-index: 1200;
}

.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 1 0%;
  min-width: 0;
  max-width: 100%;
  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;
  inset-inline-end: 0;
  min-width: 100%;
  width: 100%;
  box-sizing: border-box;
  z-index: 1250;
  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;
}

/* ==========================================================================
   Shared Calculator & Dual-Card Tool Architecture
   ========================================================================== */
.kz-calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--space-6, 24px);
  align-items: start;
}

@media (max-width: 880px) {
  .kz-calc-layout {
    grid-template-columns: 1fr;
    gap: var(--space-4, 16px);
  }
}

#hijri-converter-app .kz-calc-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  margin-inline: auto;
  grid-template-columns: none;
}

.kz-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card, 20px);
  padding: clamp(18px, 2.5vw, 26px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

[data-theme="dark"] .kz-card {
  background: rgba(14, 21, 38, 0.78);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .kz-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Universal Print Styles for Calculator Summaries & Invoices
   ========================================================================== */
@media print {
  header, footer, nav, .site-header, .site-footer, .breadcrumb-nav, .tool-hero,
  .privacy-guarantee, .instructions-section, .related-tools-section, .feedback-section,
  .kz-segmented, button:not(.print-preserve), .btn-secondary, .inv-field-hide-toggle,
  .inv-template-chips, .pct-preset-chip, .fuel-preset-chip {
    display: none !important;
  }
  body, .tool-container, .tool-workspace, .extra-tool {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }
  .kz-calc-layout {
    display: block !important;
  }
  .kz-card {
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    page-break-inside: avoid;
    margin-block-end: 16px !important;
  }
  .kz-result-hero {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #000000 !important;
  }
  .kz-result-val,
  .kz-breakdown-row strong {
    color: #000000 !important;
  }
}

/* ==========================================================================
   Universal Dropzone Architecture (Batch Image, Subtitle Editor, PDF Toolkit, etc.)
   ========================================================================== */
.batch-file-input { display: none !important; }
.batch-dropzone,
.dropzone {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 275px;
  padding: clamp(42px, 6vw, 64px) 24px;
  color: var(--text-main);
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 2px dashed rgba(37, 99, 235, 0.48);
  border-radius: 22px;
  box-shadow: 0 8px 30px -4px rgba(37, 99, 235, 0.12), 0 2px 8px -1px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, transform .2s ease;
  user-select: none;
}

[data-theme="light"] .batch-dropzone,
[data-theme="light"] .dropzone {
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 2px dashed rgba(37, 99, 235, 0.48);
  box-shadow: 0 8px 30px -4px rgba(37, 99, 235, 0.12), 0 2px 8px -1px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .batch-dropzone,
[data-theme="dark"] .dropzone {
  background: linear-gradient(145deg, rgba(30, 58, 138, 0.22) 0%, rgba(15, 23, 42, 0.7) 100%);
  border: 2px dashed rgba(96, 165, 250, 0.48);
  box-shadow: 0 8px 32px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.batch-dropzone:hover,
.batch-dropzone.is-dragging,
.batch-dropzone.dragover,
.dropzone:hover,
.dropzone.dragover,
.dropzone.is-dragging {
  border-color: #2563eb !important;
  background: linear-gradient(145deg, rgba(224, 238, 255, 0.98) 0%, rgba(240, 246, 255, 1) 100%) !important;
  box-shadow: 0 12px 36px -4px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  transform: translateY(-2px);
}

[data-theme="dark"] .batch-dropzone:hover,
[data-theme="dark"] .batch-dropzone.is-dragging,
[data-theme="dark"] .batch-dropzone.dragover,
[data-theme="dark"] .dropzone:hover,
[data-theme="dark"] .dropzone.dragover,
[data-theme="dark"] .dropzone.is-dragging {
  border-color: #60a5fa !important;
  background: linear-gradient(145deg, rgba(30, 58, 138, 0.35) 0%, rgba(15, 23, 42, 0.8) 100%) !important;
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(96, 165, 250, 0.35) inset !important;
  transform: translateY(-2px);
}

.dropzone-icon {
  display: block;
  margin-inline: auto;
  width: 58px;
  height: 58px;
  color: #2563eb;
  padding: 12px;
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.1);
  margin-block-end: 18px;
  transition: transform .25s ease, background-color .2s ease;
  flex-shrink: 0;
}

[data-theme="dark"] .dropzone-icon {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.16);
}

.dropzone:hover .dropzone-icon,
.batch-dropzone:hover .dropzone-icon {
  transform: translateY(-3px) scale(1.05);
  background: rgba(37, 99, 235, 0.18);
}

.dropzone-content-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.dropzone-loading-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  pointer-events: none;
}

.dropzone-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid rgba(37, 99, 235, 0.2);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: dropzone-spin 0.75s linear infinite;
}

@keyframes dropzone-spin {
  to { transform: rotate(360deg); }
}

.dropzone-loading-filename {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone-progress-wrap {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .dropzone-progress-wrap {
  background: rgba(255, 255, 255, 0.08);
}

.dropzone-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 99px;
  transition: width 0.18s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.45);
}

.dropzone-loading-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dropzone-loading-pct {
  font-weight: 700;
  font-family: var(--font-mono);
  color: #2563eb;
}

.dropzone-loading-status {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.dropzone-error-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
}

.dropzone-error-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
}

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

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

.dropzone-content-default > :last-child,
.dropzone-subtitle:last-child,
.batch-dropzone small: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: 9999px;
  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);
}

.batch-drop-icon { display: none; }

/* ==========================================================================
   Compact Dropzone & Mini Dropzone (Shared Component for All Tools)
   ========================================================================== */
.batch-dropzone.is-compact,
.dropzone.is-compact,
.kz-mini-dropzone {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-height: 68px !important;
  max-height: 82px !important;
  padding: 12px 20px !important;
  border-radius: 16px !important;
  border: 2px dashed rgba(37, 99, 235, 0.48) !important;
  gap: 16px !important;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  box-shadow: 0 4px 18px -2px rgba(37, 99, 235, 0.1), 0 2px 6px -1px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  cursor: pointer;
  margin-block: 8px 14px;
  box-sizing: border-box !important;
  text-align: start !important;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

[data-theme="light"] .batch-dropzone.is-compact,
[data-theme="light"] .dropzone.is-compact,
[data-theme="light"] .kz-mini-dropzone {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%) !important;
  border: 2px dashed rgba(37, 99, 235, 0.48) !important;
  box-shadow: 0 4px 18px -2px rgba(37, 99, 235, 0.1), 0 2px 6px -1px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

[data-theme="dark"] .batch-dropzone.is-compact,
[data-theme="dark"] .dropzone.is-compact,
[data-theme="dark"] .kz-mini-dropzone {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.25) 0%, rgba(15, 23, 42, 0.78) 100%) !important;
  border: 2px dashed rgba(96, 165, 250, 0.48) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
}

.batch-dropzone.is-compact:hover,
.batch-dropzone.is-compact.is-dragging,
.batch-dropzone.is-compact.dragover,
.dropzone.is-compact:hover,
.dropzone.is-compact.dragover,
.dropzone.is-compact.is-dragging,
.kz-mini-dropzone:hover,
.kz-mini-dropzone.dragover {
  border-color: #2563eb !important;
  background: linear-gradient(135deg, rgba(224, 238, 255, 0.98) 0%, rgba(240, 246, 255, 1) 100%) !important;
  box-shadow: 0 8px 24px -2px rgba(37, 99, 235, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  transform: translateY(-2px);
}

[data-theme="dark"] .batch-dropzone.is-compact:hover,
[data-theme="dark"] .batch-dropzone.is-compact.is-dragging,
[data-theme="dark"] .batch-dropzone.is-compact.dragover,
[data-theme="dark"] .dropzone.is-compact:hover,
[data-theme="dark"] .dropzone.is-compact.dragover,
[data-theme="dark"] .dropzone.is-compact.is-dragging,
[data-theme="dark"] .kz-mini-dropzone:hover,
[data-theme="dark"] .kz-mini-dropzone.dragover {
  border-color: #60a5fa !important;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.38) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
  box-shadow: 0 8px 26px -2px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(96, 165, 250, 0.35) inset !important;
  transform: translateY(-2px);
}

.batch-dropzone.is-compact .dropzone-icon,
.dropzone.is-compact .dropzone-icon,
.kz-mini-icon-wrap {
  width: 40px !important;
  height: 40px !important;
  padding: 8px !important;
  border-radius: 12px !important;
  background: rgba(37, 99, 235, 0.12) !important;
  color: #2563eb !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-block-end: 0 !important;
  margin-inline: 0 !important;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease !important;
}

[data-theme="dark"] .batch-dropzone.is-compact .dropzone-icon,
[data-theme="dark"] .dropzone.is-compact .dropzone-icon,
[data-theme="dark"] .kz-mini-icon-wrap {
  background: rgba(59, 130, 246, 0.18) !important;
  color: #60a5fa !important;
}

.batch-dropzone.is-compact:hover .dropzone-icon,
.dropzone.is-compact:hover .dropzone-icon,
.kz-mini-dropzone:hover .kz-mini-icon-wrap {
  transform: translateY(-2px) scale(1.06) !important;
  background: rgba(37, 99, 235, 0.2) !important;
}

.batch-dropzone.is-compact .dropzone-content-default,
.dropzone.is-compact .dropzone-content-default,
.kz-mini-dropzone-empty {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 14px !important;
  min-width: 0;
  flex: 1;
  text-align: start !important;
}

[dir="rtl"] .batch-dropzone.is-compact .dropzone-content-default,
[dir="rtl"] .dropzone.is-compact .dropzone-content-default,
[dir="rtl"] .kz-mini-dropzone-empty {
  text-align: right !important;
}

.batch-dropzone.is-compact strong,
.dropzone.is-compact strong,
.batch-dropzone.is-compact .dropzone-title,
.dropzone.is-compact .dropzone-title,
.kz-mini-dropzone-title {
  font-size: 0.95rem !important;
  font-weight: 750 !important;
  margin-block-end: 2px !important;
  color: var(--text-main) !important;
  white-space: nowrap;
}

.batch-dropzone.is-compact small,
.dropzone.is-compact small,
.batch-dropzone.is-compact .dropzone-subtitle,
.dropzone.is-compact .dropzone-subtitle,
.kz-mini-dropzone-sub {
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  margin-block-end: 0 !important;
  color: var(--text-muted) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kz-mini-dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: start;
  min-width: 0;
}

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

@media (max-width: 640px) {
  .batch-dropzone.is-compact,
  .dropzone.is-compact,
  .kz-mini-dropzone {
    min-height: 58px !important;
    padding: 10px 14px !important;
  }
  .batch-dropzone.is-compact .dropzone-icon,
  .dropzone.is-compact .dropzone-icon,
  .kz-mini-icon-wrap {
    width: 34px !important;
    height: 34px !important;
    padding: 7px !important;
  }
  .batch-dropzone.is-compact strong,
  .dropzone.is-compact strong,
  .batch-dropzone.is-compact .dropzone-title,
  .dropzone.is-compact .dropzone-title,
  .kz-mini-dropzone-title {
    font-size: 0.88rem !important;
  }
  .batch-dropzone.is-compact small,
  .dropzone.is-compact small,
  .batch-dropzone.is-compact .dropzone-subtitle,
  .dropzone.is-compact .dropzone-subtitle,
  .kz-mini-dropzone-sub {
    display: none !important;
  }
}

/* Small / Secondary File Picker & Chosen File Pill */
.kz-file-picker-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
  margin-block-start: 6px;
}

.kz-file-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 16px;
  background: var(--bg-card, #ffffff);
  border: 1.5px dashed var(--border-medium, #cbd5e1);
  border-radius: var(--radius-sm, 8px);
  color: var(--text-main, #1e293b);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.kz-file-picker-btn:hover {
  border-color: var(--brand-primary, #3b82f6);
  background: var(--brand-primary-light, rgba(59, 130, 246, 0.08));
  color: var(--brand-primary, #3b82f6);
}

.kz-file-picker-btn:focus-within {
  outline: 2px solid var(--brand-primary, #3b82f6);
  outline-offset: 2px;
}

.kz-file-picker-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
}

.kz-file-picker-btn input[type="file"] {
  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;
}

.kz-file-chosen-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 12px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main, #1e293b);
  max-width: 100%;
}

.kz-file-chosen-pill img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--border-subtle, #e2e8f0);
}

.kz-file-chosen-pill span {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kz-file-chosen-remove {
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  font-size: 1rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.kz-file-chosen-remove:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* ==========================================================================
   Refined Text Editor & Accessible Date Picker / Calendar System
   ========================================================================== */
.word-counter-app {
  width: 100%;
}

.word-counter-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 10px;
}

.word-counter-editor-header label {
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 700;
}

.word-counter-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: var(--text-muted);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.word-counter-live > span {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: #3b82f6;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.tool-workspace textarea.word-counter-input {
  min-height: 176px;
  max-height: min(60vh, 520px);
  padding: 17px 18px;
  color: var(--text-main);
  background: radial-gradient(ellipse at 100% 0%, rgba(59, 130, 246, 0.09), transparent 48%), rgba(8, 13, 25, 0.58);
  border-radius: 20px;
  font-size: 1rem;
  line-height: 1.75;
  text-align: start;
  caret-color: var(--brand-primary);
  resize: vertical;
  scrollbar-color: rgba(100, 116, 139, 0.55) transparent;
}

.tool-workspace textarea.word-counter-input::placeholder {
  color: var(--text-subtle);
  opacity: 0.88;
}

.tool-workspace textarea.word-counter-input:focus {
  background: radial-gradient(ellipse at 100% 0%, rgba(59, 130, 246, 0.13), transparent 50%), rgba(12, 20, 37, 0.84);
  border-color: rgba(59, 130, 246, 0.68);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14), 0 12px 30px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .tool-workspace textarea.word-counter-input {
  background: radial-gradient(ellipse at 100% 0%, rgba(59, 130, 246, 0.07), transparent 50%), rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 #fff, 0 5px 18px rgba(15, 23, 42, 0.045);
}

[data-theme="light"] .tool-workspace textarea.word-counter-input:focus {
  background: radial-gradient(ellipse at 100% 0%, rgba(59, 130, 246, 0.09), transparent 52%), #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 10px 24px rgba(15, 23, 42, 0.07);
}

.age-date-field {
  position: relative;
  z-index: 2;
}

.age-date-field > label {
  color: var(--text-main);
  text-align: start;
}

.age-date-picker {
  position: relative;
  z-index: 50;
  width: 100%;
}

.age-date-trigger {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 0 17px;
  color: var(--text-main);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.09), transparent 68%), rgba(8, 13, 25, 0.58);
  border: 1px solid var(--border-medium);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 5px 16px rgba(0, 0, 0, 0.08);
  font: 600 0.98rem/1.4 var(--font-system);
  text-align: start;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.age-date-trigger:hover {
  border-color: rgba(59, 130, 246, 0.48);
  transform: translateY(-1px);
}

.age-date-trigger:focus-visible,
.age-calendar-nav:focus-visible,
.age-calendar-day:focus-visible,
.age-calendar-this-month:focus-visible,
.age-calendar-footer-btn:focus-visible,
.age-calendar-select:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.32);
  outline-offset: 2px;
}

[data-theme="light"] .age-date-trigger {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.06), transparent 68%), #ffffff;
  box-shadow: inset 0 1px 0 #ffffff, 0 5px 18px rgba(15, 23, 42, 0.045);
}

.age-date-trigger-icon {
  width: 22px;
  height: 22px;
  color: var(--brand-primary);
}

.age-date-trigger-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-subtle);
  transition: transform 180ms ease;
}

.age-date-trigger[aria-expanded="true"] .age-date-trigger-chevron {
  transform: rotate(180deg);
}

.age-date-trigger-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.age-date-trigger-value.is-placeholder {
  color: var(--text-subtle);
  font-weight: 500;
}

.age-calendar-popover[hidden] {
  display: none !important;
}

.age-calendar-popover {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 100;
  width: 360px;
  max-width: min(360px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 16px;
  background: rgba(10, 16, 31, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  animation: age-calendar-in 150ms ease-out both;
}

[data-theme="light"] .age-calendar-popover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(59, 130, 246, 0.22);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

@keyframes age-calendar-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.age-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block-end: 14px;
}

.age-calendar-selects {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.tool-workspace select.age-calendar-select,
.extra-tool select.age-calendar-select,
select.age-calendar-select,
.age-calendar-select {
  height: 38px !important;
  min-height: 38px !important;
  padding-block: 0 !important;
  padding-inline-start: 10px !important;
  padding-inline-end: 24px !important;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.16));
  border-radius: 10px;
  font: 600 0.88rem/1.3 var(--font-system);
  cursor: pointer;
  box-shadow: none !important;
  box-sizing: border-box !important;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.age-calendar-select option {
  background: #0b1222;
  color: #ffffff;
}

[data-theme="light"] .tool-workspace select.age-calendar-select option,
[data-theme="light"] .extra-tool select.age-calendar-select option,
[data-theme="light"] select.age-calendar-select option,
[data-theme="light"] .age-calendar-select option {
  background: #ffffff;
  color: #0f172a;
}

.tool-workspace select.age-calendar-select:hover,
.extra-tool select.age-calendar-select:hover,
select.age-calendar-select:hover,
.age-calendar-select:hover {
  border-color: rgba(59, 130, 246, 0.45);
}

.age-calendar-selects > .kz-select-wrapper:first-child,
.age-calendar-selects > .kz-select-wrapper[data-for-id*="month"],
.tool-workspace select.age-calendar-select-month,
.extra-tool select.age-calendar-select-month,
select.age-calendar-select-month,
.age-calendar-select-month {
  flex: 1 1 125px !important;
  min-width: 105px !important;
  max-width: 155px !important;
  width: auto !important;
}

.age-calendar-selects > .kz-select-wrapper:last-child,
.age-calendar-selects > .kz-select-wrapper[data-for-id*="year"],
.tool-workspace select.age-calendar-select-year,
.extra-tool select.age-calendar-select-year,
select.age-calendar-select-year,
.age-calendar-select-year {
  flex: 0 0 102px !important;
  min-width: 98px !important;
  max-width: 108px !important;
  width: 102px !important;
}

.age-calendar-selects .kz-select-trigger {
  min-height: 38px !important;
  height: 38px !important;
  padding-block: 0 !important;
  padding-inline: 8px !important;
  gap: 5px !important;
  border-radius: 10px !important;
  font: 600 0.88rem/1.3 var(--font-system) !important;
}

.age-calendar-selects .kz-select-value {
  font-size: 0.88rem !important;
  font-weight: 650 !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

.age-calendar-selects .kz-select-arrow {
  width: 14px !important;
  height: 14px !important;
  flex: 0 0 14px !important;
}

.age-calendar-selects .kz-select-arrow svg {
  width: 12px !important;
  height: 12px !important;
}

.age-calendar-selects > .kz-select-wrapper:first-child .kz-select-dropdown,
.age-calendar-selects > .kz-select-wrapper[data-for-id*="month"] .kz-select-dropdown {
  inset-inline-start: 0 !important;
  inset-inline-end: auto !important;
  width: max-content !important;
  min-width: 100% !important;
  max-width: 200px !important;
}

.age-calendar-selects > .kz-select-wrapper:last-child .kz-select-dropdown,
.age-calendar-selects > .kz-select-wrapper[data-for-id*="year"] .kz-select-dropdown {
  inset-inline-start: auto !important;
  inset-inline-end: 0 !important;
  width: 100% !important;
  min-width: 98px !important;
  max-width: 115px !important;
}

.age-calendar-selects .kz-select-option {
  padding: 8px 12px !important;
  min-height: 34px !important;
  white-space: nowrap !important;
}

.age-calendar-selects .kz-option-label {
  flex: 1 1 auto !important;
  min-width: max-content !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

[data-theme="light"] .tool-workspace select.age-calendar-select,
[data-theme="light"] .extra-tool select.age-calendar-select,
[data-theme="light"] select.age-calendar-select,
[data-theme="light"] .age-calendar-select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.age-calendar-month {
  margin: 0;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 700;
}

.age-calendar-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: all 140ms ease;
}

.age-calendar-nav:hover:not(:disabled) {
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}

.age-calendar-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.age-calendar-nav svg {
  width: 16px;
  height: 16px;
}

.age-calendar-weekdays,
.age-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.age-calendar-weekdays {
  margin-block-end: 6px;
}

.age-calendar-weekdays > span {
  padding: 4px 0;
  color: var(--text-subtle);
  font: 700 0.72rem/1 var(--font-system);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.age-calendar-day,
.age-calendar-empty {
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.age-calendar-day {
  padding: 0;
  color: var(--text-main);
  background: transparent;
  border: 1px solid transparent;
  font: 600 0.85rem/1 var(--font-mono);
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.age-calendar-day:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.35);
  transform: scale(1.06);
}

.age-calendar-day.is-today {
  border-color: rgba(59, 130, 246, 0.45);
  font-weight: 750;
}

.age-calendar-day.is-selected,
.age-calendar-day.is-selected:hover {
  color: #ffffff !important;
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  font-weight: 800;
  transform: none;
}

.age-calendar-day:disabled {
  color: var(--text-subtle);
  opacity: 0.32;
  cursor: not-allowed;
}

.age-calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-block-start: 12px;
  padding-block-start: 10px;
  border-block-start: 1px solid var(--border-subtle);
}

.age-calendar-footer-btn,
.age-calendar-this-month {
  padding: 6px 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font: 600 0.78rem/1.3 var(--font-system);
  cursor: pointer;
  transition: all 140ms ease;
}

.age-calendar-footer-btn:hover,
.age-calendar-this-month:hover {
  color: var(--brand-primary);
  border-color: rgba(59, 130, 246, 0.35);
}

.age-calendar-footer-btn.btn-clear {
  color: var(--text-subtle);
}

.age-calendar-footer-btn.btn-clear:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}

@media (max-width: 480px) {
  .age-calendar-popover {
    position: absolute;
    top: calc(100% + 8px);
    bottom: auto;
    inset-inline-start: 0;
    inset-inline-end: 0;
    width: 100%;
    max-width: 100%;
    padding: 12px;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.52);
  }

  .age-calendar-header {
    gap: 6px;
    margin-block-end: 10px;
  }

  .age-calendar-nav {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .age-calendar-selects {
    gap: 6px;
    min-width: 0;
    justify-content: center;
  }

  .age-calendar-selects > .kz-select-wrapper:first-child,
  .age-calendar-selects > .kz-select-wrapper[data-for-id*="month"],
  .tool-workspace select.age-calendar-select-month,
  .extra-tool select.age-calendar-select-month,
  select.age-calendar-select-month,
  .age-calendar-select-month {
    flex: 1 1 115px !important;
    min-width: 95px !important;
    max-width: 140px !important;
    width: auto !important;
  }

  .age-calendar-selects > .kz-select-wrapper:last-child,
  .age-calendar-selects > .kz-select-wrapper[data-for-id*="year"],
  .tool-workspace select.age-calendar-select-year,
  .extra-tool select.age-calendar-select-year,
  select.age-calendar-select-year,
  .age-calendar-select-year {
    flex: 0 0 98px !important;
    min-width: 94px !important;
    max-width: 104px !important;
    width: 98px !important;
  }

  .age-calendar-selects .kz-select-trigger {
    padding-inline: 7px !important;
    gap: 4px !important;
  }

  .age-calendar-weekdays,
  .age-calendar-days {
    gap: 2px;
  }

  .age-calendar-day {
    font-size: 0.82rem;
  }

  .age-calendar-footer {
    margin-block-start: 10px;
    padding-block-start: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .age-calendar-popover {
    animation: none;
  }
}

/* ==========================================================================
   Shared Native Workspaces for the Tool Catalog (.extra-tool)
   ========================================================================== */
.extra-tool {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.extra-tool [hidden] { display: none !important; }

.extra-tool > label,
.extra-tool .control-row > label,
.extra-two-col > label,
.extra-two-col > div {
  display: flex;
  flex: 1 1 190px;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 650;
}

.extra-tool textarea,
.extra-tool input[type="text"],
.extra-tool input[type="number"],
.extra-tool input:not([type]),
.extra-tool select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 14px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 14px;
  font: 500 0.94rem/1.55 var(--font-system);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.extra-tool textarea {
  min-height: 132px;
  resize: vertical;
  font-family: var(--font-system);
}

.extra-tool textarea[dir="ltr"],
.extra-tool input[dir="ltr"] {
  font-family: var(--font-mono);
}

.extra-tool textarea:focus-visible,
.extra-tool input:focus-visible,
.extra-tool select:focus-visible,
.extra-tool button:focus-visible,
.extra-tool a:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.32);
  outline-offset: 2px;
}

.extra-tool input[type="color"] {
  width: 56px;
  height: 46px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 13px;
  cursor: pointer;
}

.extra-tool input[type="range"] {
  min-height: 32px;
  accent-color: var(--brand-primary);
  cursor: pointer;
  direction: ltr !important;
}

.extra-tool input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-primary);
}

.extra-tool input[type="file"] {
  display: none !important;
}

.control-row {
  display: flex;
  align-items: end;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.control-row > label {
  flex: 1 1 140px;
}

.control-row > button,
.control-row > a,
.control-row > .file-button {
  flex: 0 0 auto;
}

.extra-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.extra-status {
  display: block;
  min-height: 1.35em;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.extra-status[data-kind="success"] { color: #16a34a; }
.extra-status[data-kind="warning"] { color: #d97706; }
.extra-status[data-kind="error"] { color: #dc2626; }

.extra-hint,
.field-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-touch-size);
  padding: 0 18px;
  overflow: hidden;
  cursor: pointer;
}

.extra-file-list {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.extra-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 13px;
  overflow-wrap: anywhere;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  font-size: 0.86rem;
}

.extra-file-item > span { min-width: 0; }
.extra-file-item .btn-secondary { min-height: 38px; padding-inline: 13px; }
.extra-file-item button:disabled { opacity: 0.45; }

.color-swatch {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--border-medium);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 24px rgba(15, 23, 42, 0.12);
}

.color-value {
  padding: 0;
  color: var(--text-main);
  background: transparent;
  border: 0;
  font: 700 1rem/1.5 var(--font-mono);
  cursor: pointer;
}

.color-copy { width: 100%; cursor: pointer; }
.color-picker-stage { display: grid; gap: 12px; justify-items: start; }
.color-picker-stage canvas { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; border: 1px solid var(--border-medium); border-radius: 16px; cursor: crosshair; }
.color-picker-stage .color-swatch { width: 74px; min-height: 54px; }

.qr-preview-box { display: grid; min-height: 240px; place-items: center; padding: 20px; background: var(--bg-subtle); border: 1px solid var(--border-subtle); border-radius: 20px; }
.qr-output img { display: block; width: min(100%, 280px); height: auto; image-rendering: pixelated; }
.scanner-video { width: min(100%, 620px); max-height: 55vh; margin-inline: auto; background: #050810; border-radius: 18px; }
.ocr-preview { display: block; max-width: min(100%, 480px); max-height: 320px; margin-inline: auto; object-fit: contain; border-radius: 16px; }
.ocr-progress-wrap { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.85rem; }
.ocr-progress-wrap progress { width: min(100%, 420px); accent-color: var(--brand-primary); }
.pdf-preview { display: block; max-width: min(100%, 480px); height: auto; margin: 14px auto; border: 1px solid var(--border-subtle); border-radius: 12px; }


/* ==========================================================================
   Universal Dropzone Loading, Progress & Error States
   ========================================================================== */
.dropzone-loading-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  pointer-events: none;
}

.dropzone-loading-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid rgba(37, 99, 235, 0.2);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: dropzone-spin 0.75s linear infinite;
}

@keyframes dropzone-spin {
  to { transform: rotate(360deg); }
}

.dropzone-loading-filename {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone-progress-wrap {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .dropzone-progress-wrap {
  background: rgba(255, 255, 255, 0.08);
}

.dropzone-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 99px;
  transition: width 0.18s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.45);
}

.dropzone-loading-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dropzone-loading-pct {
  font-weight: 700;
  font-family: var(--font-mono);
  color: #2563eb;
}

.dropzone-loading-status {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

.dropzone-error-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
}

.dropzone-error-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
}

.dropzone-error-msg {
  font-size: 0.88rem;
  color: #ef4444;
  text-align: center;
  margin: 0;
  line-height: 1.5;
}


/* ==========================================================================
   Universal Card Title & Badges
   ========================================================================== */
.kz-card-title {
  font-size: 1.125rem;
  font-weight: 750;
  color: var(--text-main);
  margin-block-end: var(--space-4, 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.kz-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.kz-badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.kz-badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.kz-badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.kz-badge-danger,
.kz-badge-error {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   Universal Danger Button & Small Button Utilities
   ========================================================================== */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--min-touch-size, 48px);
  padding-inline: var(--space-5, 20px);
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-pill, 9999px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.btn-xs {
  min-height: 28px !important;
  padding: 2px 10px !important;
  font-size: 0.75rem !important;
}

/* ==========================================================================
   Studio Sub Buttons (Keyboard Layout, Subtitle Editor, etc.)
   ========================================================================== */
.sub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 650;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  user-select: none;
  white-space: nowrap;
}

.sub-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.sub-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.sub-btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

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

.sub-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main, #e2e8f0);
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.14));
}

[data-theme="light"] .sub-btn-secondary {
  background: #ffffff;
  color: #1e293b;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sub-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--brand-primary, #3b82f6);
  color: #ffffff;
  transform: translateY(-1px);
}

[data-theme="light"] .sub-btn-secondary:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.sub-btn-action {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
  padding: 5px 12px;
  min-height: 34px;
}

[data-theme="light"] .sub-btn-action {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.25);
}

.sub-btn-action:hover {
  background: var(--brand-primary, #3b82f6);
  color: #ffffff;
  border-color: var(--brand-primary, #3b82f6);
  transform: translateY(-1px);
}

/* ==========================================================================
   Unit Converter & Form Field Utilities
   ========================================================================== */
.unit-result {
  padding: 20px;
  color: var(--brand-primary);
  background: var(--brand-primary-light);
  border: 1px solid var(--brand-primary-border);
  border-radius: 18px;
  font: 750 clamp(1.25rem, 3vw, 2rem)/1.4 var(--font-mono);
  overflow-wrap: anywhere;
}

.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check-grid label { display: flex; align-items: center; gap: 9px; min-height: 42px; color: var(--text-main); font-size: 0.9rem; }
.extra-tool meter { width: min(100%, 400px); height: 14px; accent-color: var(--brand-primary); }

@media (max-width: 640px) {
  .extra-two-col { grid-template-columns: minmax(0, 1fr); }
  .control-row > label { flex-basis: 100%; }
  .control-row > button, .control-row > a, .control-row > .file-button { flex: 1 1 132px; }
  .check-grid { grid-template-columns: minmax(0, 1fr); }
  .extra-tool textarea { min-height: 120px; }
}

/* ==========================================================================
   File Advisory Pill
   ========================================================================== */
/* Subtle Modern File Size & Count Advisory Pill */
.file-advisory-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-block-start: 10px;
  margin-inline: auto;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: fit-content;
  box-sizing: border-box;
  animation: advisoryFadeSlide 0.22s ease-out;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

[data-theme="dark"] .file-advisory-pill {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.26);
}

.file-advisory-pill[hidden] {
  display: none !important;
}

.file-advisory-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: currentColor;
}

.file-advisory-text {
  word-break: break-word;
}

@keyframes advisoryFadeSlide {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ==========================================================================
   URL Encoder & Inspector Studio
   ========================================================================== */
/* URL Encoder & Studio */
.ue-inspector-card {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-subtle, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cs-section-title,
.ue-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}
.ue-params-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.ue-params-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ue-param-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.ue-empty-params {
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
  padding: 10px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}
.ue-utm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  .ue-param-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   720p AND SMALL SCREENS SCALE-DOWN (UNIVERSAL TOOL WORKSPACES & CONTROLS)
   ========================================================================== */
@media (max-width: 1280px), (max-height: 800px) {
  .tool-workspace {
    padding: 16px;
    border-radius: 18px;
    margin-block-end: 16px;
  }

  .tool-hero-glass {
    padding: 14px 18px;
    margin-block-end: 14px;
    border-radius: 18px;
    gap: 14px;
  }

  .tool-hero-title {
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    margin-block-end: 4px;
  }

  .tool-hero-desc {
    font-size: 0.82rem;
    line-height: 1.5;
    margin-block-end: 10px;
    max-width: 600px;
  }

  .tool-badge-pill {
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  .tool-hero-art img {
    width: 76px;
    height: 76px;
  }

  .tool-feature-grid {
    gap: 8px;
    margin-block-end: 14px;
  }

  .tool-feature-pill {
    padding: 10px 12px;
    border-radius: 14px;
  }

  .tool-feature-pill-title {
    font-size: 0.82rem;
  }

  .tool-feature-pill-desc {
    font-size: 0.69rem;
  }

  .promo-card {
    padding: 14px 18px;
    border-radius: 18px;
    margin-block-end: 14px;
  }

  .promo-title {
    font-size: 1.05rem;
  }

  .promo-desc {
    font-size: 0.8rem;
  }

  .promo-mascot-img {
    max-width: 100px;
    max-height: 90px;
  }

  .interactive-area {
    min-height: 160px;
    padding: 14px;
    border-radius: 14px;
  }

  .glass-textarea,
  textarea.search-input,
  .tool-workspace textarea {
    min-height: 140px;
    padding: 12px 14px;
    font-size: 0.94rem;
    border-radius: 14px;
  }

  .tool-workspace input[type="text"],
  .tool-workspace input[type="number"],
  .tool-workspace input[type="date"],
  .tool-workspace select {
    height: 42px;
    font-size: 0.88rem;
    padding: 0 12px;
    border-radius: 12px;
  }
}

@media (max-width: 640px) {
  .tool-workspace {
    padding: 12px 10px;
    border-radius: 14px;
    margin-block-end: 12px;
  }

  .tool-hero-glass {
    padding: 10px 12px;
    margin-block-end: 10px;
    border-radius: 14px;
    gap: 8px;
  }

  .tool-hero-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin-block-end: 4px;
  }

  .tool-hero-desc {
    font-size: 0.74rem;
    line-height: 1.4;
    margin-block-end: 6px;
  }

  .tool-hero-art img {
    width: 52px;
    height: 52px;
  }

  .tool-feature-grid {
    gap: 6px;
    margin-block-end: 10px;
  }

  .tool-feature-pill {
    padding: 8px 10px;
    border-radius: 12px;
  }

  .tool-feature-pill-title {
    font-size: 0.76rem;
  }

  .tool-feature-pill-desc {
    font-size: 0.64rem;
  }

  .interactive-area {
    min-height: 120px;
    padding: 10px;
    border-radius: 12px;
  }

  .glass-textarea,
  textarea.search-input,
  .tool-workspace textarea {
    min-height: 110px;
    padding: 10px 12px;
    font-size: 0.88rem;
    border-radius: 12px;
  }
}

/* Low-Spec & No-GPU Solid Fallback for Tool Workspace Elements */
html.no-glass .tool-workspace {
  background: #0c1322 !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

html.no-glass[data-theme="light"] .tool-workspace {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
}

@media (max-width: 480px) {
  .tool-hero-title {
    font-size: 0.94rem;
    line-height: 1.35;
  }
}

@media (max-width: 380px) {
  .tool-hero-title {
    font-size: 0.88rem;
    line-height: 1.32;
  }
}

html.no-glass .tool-hero-glass {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

html.no-glass[data-theme="light"] .tool-hero-glass {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
}

html.no-glass .tool-card-glass.related-tool-card {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

html.no-glass[data-theme="light"] .tool-card-glass.related-tool-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
}

html.no-glass .tool-feature-pill {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
}

html.no-glass[data-theme="light"] .tool-feature-pill {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

html.no-glass .promo-card {
  background: #0f172a !important;
  border: 1px solid #1e293b !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}

html.no-glass[data-theme="light"] .promo-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
}

@supports not (backdrop-filter: blur(10px)) {
  .tool-workspace {
    background: #0c1322 !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
  }
  [data-theme="light"] .tool-workspace {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
  }
  .tool-hero-glass {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
  }
  [data-theme="light"] .tool-hero-glass {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
  }
  .tool-card-glass.related-tool-card {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
  }
  [data-theme="light"] .tool-card-glass.related-tool-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
  }
  .tool-feature-pill {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
  }
  [data-theme="light"] .tool-feature-pill {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
  }
  .promo-card {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
  }
  [data-theme="light"] .promo-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05) !important;
  }
}


