/* =============================================================================
   lh-tools-global.css
   Base styles for all LabHouse Tools.
   Design tokens extracted from /Compressor/video-compressor.html
   All component classes use the .lht- prefix (BEM-lite).
   Zero hardcoded colors or fonts in component rules — only CSS variables.
   ============================================================================= */

/* =============================================================================
   1. DESIGN TOKENS
   ============================================================================= */

:root {
  /* ── Palette — exact values from video-compressor.html ── */
  --lht-clr-ink: #3f3f46;
  --lht-clr-ink-strong: #2f2f33;
  --lht-clr-muted: #7c8088;
  --lht-clr-muted-2: #a7acb5;
  --lht-clr-border: #e2e6ee;
  --lht-clr-border-outer: #e5e7eb;
  --lht-clr-border-blue: #bfd1f6;
  --lht-clr-white: #ffffff;

  /* Primary blue */
  --lht-clr-primary: #2f66e5;
  --lht-clr-primary-light: #3369e8;
  --lht-clr-primary-dark: #2b61df;
  --lht-clr-primary-soft: rgba(47, 102, 229, 0.1);
  --lht-clr-primary-soft-2: rgba(47, 102, 229, 0.12);

  /* Semantic greens & reds */
  --lht-clr-green: #059669;
  --lht-clr-green-soft: #d1fae5;
  --lht-clr-red: #dc2626;
  --lht-clr-red-soft: #fee2e2;

  /* Backgrounds */
  --lht-clr-bg-page: #f4f4f5;
  --lht-clr-bg-section: #f8fafc;
  --lht-clr-bg-card: #ffffff;
  --lht-clr-bg-dropzone-a: rgba(240, 243, 249, 0.98);
  --lht-clr-bg-dropzone-b: rgba(236, 240, 246, 0.98);
  --lht-clr-bg-dropzone-hover-a: #eef3fb;
  --lht-clr-bg-dropzone-hover-b: #e9eef7;

  /* ── Semantic aliases (used in component rules) ── */
  --lht-bg: var(--lht-clr-bg-page);
  --lht-bg-card: var(--lht-clr-bg-card);
  --lht-bg-input: var(--lht-clr-bg-section);
  --lht-color-primary: var(--lht-clr-primary);
  --lht-color-primary-hover: var(--lht-clr-primary-dark);
  --lht-color-text: var(--lht-clr-ink);
  --lht-color-muted: var(--lht-clr-muted);
  --lht-color-border: var(--lht-clr-border);
  --lht-color-success: var(--lht-clr-green);
  --lht-color-error: var(--lht-clr-red);

  /* ── Gradients ── */
  --lht-gradient-btn:
    linear-gradient(180deg, var(--lht-clr-primary-light) 0%, var(--lht-clr-primary-dark) 100%);
  --lht-gradient-dropzone:
    linear-gradient(180deg, var(--lht-clr-bg-dropzone-a) 0%, var(--lht-clr-bg-dropzone-b) 100%);
  --lht-gradient-dropzone-hover:
    linear-gradient(180deg, var(--lht-clr-bg-dropzone-hover-a) 0%, var(--lht-clr-bg-dropzone-hover-b) 100%);
  --lht-gradient-bar-primary:
    linear-gradient(90deg, var(--lht-clr-primary) 0%, #6ea0ff 100%);
  --lht-gradient-bar-success:
    linear-gradient(90deg, var(--lht-clr-green) 0%, #34d399 100%);

  /* ── Typography ── */
  --lht-font: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --lht-font-size-base: 16px;
  --lht-font-size-sm: 14px;
  --lht-font-size-xs: 13px;
  --lht-font-size-2xs: 12px;
  --lht-font-size-11: 12px;
  --lht-font-size-title: clamp(22px, 2.4vw, 30px);
  --lht-font-weight-regular: 400;
  --lht-font-weight-medium: 500;
  --lht-font-weight-semibold: 600;
  --lht-font-weight-bold: 700;
  --lht-letter-spacing-tight: -0.02em;
  --lht-letter-spacing-wide: 0.07em;

  /* ── Border radii ── */
  --lht-radius-card: 42px;
  --lht-radius-dropzone: 34px;
  --lht-radius: 24px;
  --lht-radius-btn: 18px;
  --lht-radius-upload-btn: 22px;
  --lht-radius-sm: 16px;
  --lht-radius-xs: 14px;
  --lht-radius-2xs: 12px;
  --lht-radius-pill: 999px;

  /* ── Shadows ── */
  --lht-shadow:
    0 10px 30px rgba(20, 26, 40, 0.05), 0 2px 8px rgba(20, 26, 40, 0.03);
  --lht-shadow-card: 0 12px 40px rgba(33, 37, 41, 0.06);
  --lht-shadow-btn: 0 8px 18px rgba(47, 102, 229, 0.26);
  --lht-shadow-btn-hover: 0 12px 22px rgba(47, 102, 229, 0.32);
  --lht-shadow-popup: 0 20px 60px rgba(20, 26, 40, 0.2), 0 4px 16px rgba(20, 26, 40, 0.1);

  /* ── Transitions ── */
  --lht-transition: 0.15s ease;
  --lht-transition-btn: transform 0.16s, box-shadow 0.16s, opacity 0.16s;
  --lht-transition-color: color 0.15s, background 0.15s, border-color 0.15s;
}


/* =============================================================================
   2. BASE RESET (scoped to .lht-tool-page and .lht-popup-overlay)
   ============================================================================= */

.lht-tool-page *,
.lht-tool-page *::before,
.lht-tool-page *::after,
.lht-popup-overlay *,
.lht-popup-overlay *::before,
.lht-popup-overlay *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.lht-tool-page button,
.lht-popup-overlay button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

.lht-tool-page svg,
.lht-popup-overlay svg {
  display: block;
  flex-shrink: 0;
}

.lht-tool-page a,
.lht-popup-overlay a {
  text-decoration: none;
  color: inherit;
}


/* =============================================================================
   3. TOOL PAGE LAYOUT
   ============================================================================= */

.lht-tool-page {
  font-family: var(--lht-font);
  font-size: var(--lht-font-size-base);
  -webkit-font-smoothing: antialiased;
  color: var(--lht-color-text);
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  background: #F0F4FF;
  border: 1px solid var(--lht-clr-border-outer);
  border-radius: var(--lht-radius-card);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.04);
  padding: 26px 30px 40px;
}

/* ── Tool header ── */

.lht-tool-header {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: center;
  flex-direction: column;
  padding: 8px 0 22px;
}

.lht-tool-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--lht-radius-2xs);
  background: var(--lht-clr-primary-soft);
  color: var(--lht-color-primary);
  flex-shrink: 0;
}

.lht-tool-icon svg {
  width: 26px;
  height: 26px;
}

.lht-tool-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lht-tool-title {
  font-size: var(--lht-font-size-title) !important;
  font-weight: var(--lht-font-weight-bold) !important;
  letter-spacing: var(--lht-letter-spacing-tight);
  color: var(--lht-clr-ink-strong) !important;
  line-height: 1.2 !important;
  margin-bottom: 0px !important;
}

.lht-tool-desc {
  font-size: var(--lht-font-size-sm);
  color: var(--lht-color-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ── Tool body + sidebar grid ── */

.lht-tool-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lht-tool-main {
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

.lht-tool-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .lht-tool-layout {
    grid-template-columns: 1fr 280px;
  }

  .lht-tool-header {
    flex-direction: row;
    text-align: left;
  }

  .lht-tool-desc {
    margin: 0;
  }
}

/* ── Inner section card ── */

.lht-section {
  background: var(--lht-bg-card);
  border: 1px solid var(--lht-color-border);
  border-radius: var(--lht-radius);
  padding: 20px 22px;
}

.lht-section-label {
  font-size: var(--lht-font-size-2xs);
  font-weight: var(--lht-font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--lht-letter-spacing-wide);
  color: var(--lht-color-muted);
  margin-bottom: 16px !important;
}


/* =============================================================================
   4. UPLOAD AREA
   ============================================================================= */

.lht-upload-area {
  position: relative;
  min-height: 200px;
  border: 3px solid var(--lht-clr-border-blue);
  border-radius: var(--lht-radius-dropzone);
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 36px;
  text-align: center;
  transition: border-color var(--lht-transition), background var(--lht-transition);
  cursor: pointer;
  margin-bottom: 20px;
}

.lht-upload-area:hover,
.lht-upload-area.is-dragover {
  border-color: #3164FF;
}

.lht-upload-area.has-file {
  border-color: var(--lht-clr-border-blue);
}

.lht-file-input {
  display: none;
}

.lht-upload-icon {
  width: 48px;
  height: 48px;
  color: var(--lht-color-primary);
  margin-bottom: 14px;
}

.lht-upload-icon svg {
  width: 100%;
  height: 100%;
}

.lht-upload-label {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: var(--lht-font-weight-bold);
  letter-spacing: var(--lht-letter-spacing-tight);
  color: #4a4a4a;
  line-height: 1.25;
  margin-bottom: 6px !important;
}

.lht-upload-link {
  color: var(--lht-color-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lht-upload-hint {
  font-size: var(--lht-font-size-sm);
  color: var(--lht-color-muted);
  margin-bottom: 20px !important;
}

/* File name pill */
.lht-upload-filename {
  display: none;
  margin: 0 auto 14px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 14px;
  border-radius: var(--lht-radius-pill);
  font-size: var(--lht-font-size-xs);
  font-weight: var(--lht-font-weight-semibold);
  color: var(--lht-color-primary);
  background: var(--lht-clr-primary-soft);
  border: 1px solid var(--lht-clr-primary-soft-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lht-upload-area.has-file .lht-upload-filename {
  display: block;
}

/* has-file: hide default upload UI, show only the filename pill */
.lht-upload-area.has-file .lht-upload-icon,
.lht-upload-area.has-file .lht-upload-label,
.lht-upload-area.has-file .lht-upload-hint {
  display: none;
}

/* Drop "it here!" state label */
.lht-upload-area.is-dragover .lht-upload-label {
  color: var(--lht-color-primary);
}

/* Keyboard / programmatic focus ring on drop zones */
.lht-upload-area:focus,
.lht-upload-area:focus-visible,
.lht-upload-area:focus-within,
.lht-upload-area:active {
  outline: none;
  box-shadow: none;
}


/* =============================================================================
   5. BUTTONS
   ============================================================================= */

.lht-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px !important;
  padding: 0 22px !important;
  border-radius: var(--lht-radius-btn) !important;
  font-family: var(--lht-font) !important;
  font-size: var(--lht-font-size-base) !important;
  font-weight: var(--lht-font-weight-bold) !important;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: none;
  transition: var(--lht-transition-btn);
  text-decoration: none;
}

/* Primary */
.lht-btn-primary {
  background: #3164FF;
  color: #FFFFFF;
}

.lht-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--lht-shadow-btn-hover);
}

/* Secondary */
.lht-btn-secondary {
  background: var(--lht-clr-primary-soft);
  color: var(--lht-color-primary);
  border: 1px solid transparent;
  box-shadow: none;
}

.lht-btn-secondary:hover:not(:disabled) {
  background: #dfeaff;
  transform: translateY(-1px);
}

/* Ghost */
.lht-btn-ghost {
  background: transparent;
  color: var(--lht-color-muted);
  border: 1.5px solid var(--lht-color-border);
  box-shadow: none;
}

.lht-btn-ghost:hover:not(:disabled),
.lht-tool-page .lht-btn-ghost:hover {
  background: rgba(49, 100, 255, 0.08) !important;
  color: #3164FF !important;
  border-color: #3164FF !important;
}

/* Small variant */
.lht-btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: var(--lht-font-size-xs);
  border-radius: var(--lht-radius-xs);
}

/* Disabled state */
.lht-btn:disabled,
.lht-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

/* Full-width action button */
.lht-action-btn {
  width: 100%;
  height: 54px;
  border-radius: var(--lht-radius-btn);
  font-size: var(--lht-font-size-base);
}

/* Enabled state — scoped to override theme/Elementor */
.lht-tool-page .lht-btn,
.lht-tool-page .lht-action-btn {
  background: #3164FF;
  color: #FFFFFF;
}

/* Disabled state — explicit colors, opacity reset */
.lht-tool-page .lht-btn:disabled,
.lht-tool-page .lht-action-btn:disabled {
  background: #D1D5DB;
  color: #9CA3AF;
  cursor: not-allowed;
  opacity: 1;
}

/* Arrow span inside button */
.lht-btn-arrow {
  transition: transform var(--lht-transition);
}

.lht-btn:hover .lht-btn-arrow {
  transform: translateX(3px);
}

/* Upload button (inside drop zone) */
.lht-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
  height: 54px;
  padding: 0 28px;
  border-radius: var(--lht-radius-upload-btn);
  background: var(--lht-gradient-btn);
  color: var(--lht-clr-white);
  font-size: var(--lht-font-size-base);
  font-weight: var(--lht-font-weight-bold);
  letter-spacing: -0.01em;
  box-shadow: var(--lht-shadow-btn);
  transition: var(--lht-transition-btn);
  cursor: pointer;
  border: none;
  font-family: var(--lht-font);
}

.lht-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--lht-shadow-btn-hover);
}


/* =============================================================================
   6. PROGRESS BAR
   ============================================================================= */

@keyframes lht-reveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lht-progress {
  background: var(--lht-bg-card);
  border: 1px solid var(--lht-color-border);
  border-radius: var(--lht-radius);
  padding: 20px 22px;
  animation: lht-reveal 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
  margin-top: 20px;
}

.lht-progress[hidden] {
  display: none;
}

.lht-progress-bar {
  width: 100%;
  height: 10px;
  background: #e3e9f3;
  border-radius: var(--lht-radius-pill);
  overflow: hidden;
  margin-bottom: 10px;
}

.lht-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--lht-gradient-bar-primary);
  border-radius: var(--lht-radius-pill);
  transition: width 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.lht-progress-label {
  font-size: var(--lht-font-size-xs);
  color: var(--lht-color-muted);
  text-align: center;
  font-weight: var(--lht-font-weight-medium);
}


/* =============================================================================
   7. RESULT AREA
   ============================================================================= */

.lht-result {
  background: var(--lht-bg-card);
  border: 1px solid var(--lht-color-border);
  border-radius: var(--lht-radius);
  padding: 20px 22px;
  animation: lht-reveal 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
  margin-top: 20px;
}

.lht-result[hidden] {
  display: none;
}

.lht-result-text {
  width: 100%;
  min-height: 140px;
  background: var(--lht-bg-input);
  border: 1px solid var(--lht-color-border);
  border-radius: var(--lht-radius-xs);
  padding: 14px 16px;
  font-family: var(--lht-font);
  font-size: var(--lht-font-size-sm);
  color: var(--lht-color-text);
  resize: vertical;
  outline: none;
  transition: border-color var(--lht-transition);
  line-height: 1.55;
}

.lht-result-text:focus {
  border-color: var(--lht-clr-border-blue);
}

.lht-result-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.lht-result-preview {
  width: 100%;
  border-radius: var(--lht-radius-2xs);
  background: #000;
  accent-color: var(--lht-color-primary);
  max-height: 280px;
  object-fit: contain;
  margin-bottom: 14px;
}


/* =============================================================================
   8. BADGES / TAGS
   ============================================================================= */

.lht-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--lht-radius-pill);
  font-size: var(--lht-font-size-11);
  font-weight: var(--lht-font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lht-badge-success {
  background: var(--lht-clr-green-soft);
  color: var(--lht-clr-green);
  border: 1px solid rgba(5, 150, 105, 0.18);
}

.lht-badge-warning {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.18);
}

.lht-badge-info {
  background: var(--lht-clr-primary-soft);
  color: var(--lht-color-primary);
  border: 1px solid rgba(47, 102, 229, 0.12);
}


/* =============================================================================
   9. SIDEBAR INFO CARD
   ============================================================================= */

.lht-tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.lht-info-card {
  background: var(--lht-bg-card);
  border: 1px solid var(--lht-color-border);
  border-radius: var(--lht-radius);
  padding: 20px 22px;
}

.lht-info-card h3 {
  font-size: var(--lht-font-size-sm);
  font-weight: var(--lht-font-weight-bold);
  color: var(--lht-clr-ink-strong);
  margin-bottom: 14px;
}

.lht-info-card p {
  font-size: 13px !important;
  color: var(--lht-color-muted);
  line-height: 1.5;
}

.lht-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: lht-steps;
  padding: 0px !important;
}

.lht-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--lht-font-size-sm);
  color: var(--lht-color-muted);
  line-height: 1.45;
  counter-increment: lht-steps;
}

.lht-steps li::before {
  content: counter(lht-steps);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: var(--lht-clr-primary-soft);
  color: var(--lht-color-primary);
  font-size: var(--lht-font-size-11);
  font-weight: var(--lht-font-weight-bold);
  margin-top: 1px;
}

/* ── Tool options block ── */

.lht-tool-options {
  background: var(--lht-bg-card);
  border: 1px solid var(--lht-color-border);
  border-radius: var(--lht-radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}

.lht-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
}

.lht-tab {
  padding: 0px 20px;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--lht-color-muted);
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 2px solid transparent !important;
  background: none !important;
  cursor: pointer !important;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  box-shadow: none;
}

.lht-tab.is-active {
  color: var(--lht-color-primary);
  border-bottom-color: var(--lht-color-primary) !important;
}

.lht-tab:hover {
  color: var(--lht-color-primary);
}

.lht-tab-panel {
  display: none;
}

.lht-tab-panel.is-active {
  display: block;
  margin-bottom: 20px;
}


/* =============================================================================
   10. ERROR / STATUS MESSAGES
   ============================================================================= */

@keyframes lht-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lht-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--lht-radius-sm);
  border: 1px solid rgba(220, 38, 38, 0.15);
  background: var(--lht-clr-red-soft);
  color: var(--lht-clr-red);
  font-size: var(--lht-font-size-xs);
  font-weight: var(--lht-font-weight-medium);
  line-height: 1.45;
}

.lht-error.is-visible {
  display: flex;
  animation: lht-fade-in 0.22s ease;
}

.lht-success-msg {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: var(--lht-font-size-xs);
  font-weight: var(--lht-font-weight-bold);
  color: var(--lht-clr-green);
}

.lht-success-msg.is-visible {
  display: flex;
  animation: lht-fade-in 0.22s ease;
}

/* ── Spinner ── */

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

.lht-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: lht-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.lht-spinner-lg {
  width: 20px;
  height: 20px;
  border-width: 2.5px;
}


/* =============================================================================
   11. POPUP
   ============================================================================= */

.lht-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 26, 40, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: lht-overlay-in 0.2s ease;
}

.lht-popup-overlay[hidden] {
  display: none;
}

@keyframes lht-overlay-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Prevent body scroll when popup is open */
body.lht-popup-open {
  overflow: hidden;
}

.lht-popup-modal {
  position: relative;
  background: var(--lht-bg-card);
  border: 1px solid var(--lht-clr-border-outer);
  border-radius: var(--lht-radius-card);
  box-shadow: var(--lht-shadow-popup);
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 460px;
  text-align: center;
  animation: lht-modal-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  font-family: var(--lht-font);
  -webkit-font-smoothing: antialiased;
}

@keyframes lht-modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lht-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--lht-radius-pill);
  background: var(--lht-bg-input);
  border: 1px solid var(--lht-color-border);
  color: var(--lht-color-muted);
  font-size: 14px;
  cursor: pointer;
  transition: var(--lht-transition-color);
  line-height: 1;
}

.lht-popup-close:hover {
  background: var(--lht-clr-primary-soft);
  color: var(--lht-color-primary);
  border-color: var(--lht-clr-border-blue);
}

.lht-popup-logo {
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 52px;
  margin-bottom: 18px;
}

.lht-popup-logo img {
  max-height: 100%;
  max-width: 180px;
  object-fit: contain;
}

.lht-popup-title {
  font-size: clamp(18px, 2vw, 22px) !important;
  font-weight: var(--lht-font-weight-bold) !important;
  letter-spacing: var(--lht-letter-spacing-tight) !important;
  color: var(--lht-clr-ink-strong);
  line-height: 1.25 !important;
  margin-bottom: 10px;
}

.lht-popup-body {
  font-size: var(--lht-font-size-sm) !important;
  color: var(--lht-color-muted);
  line-height: 1.55 !important;
  margin-block-end: 20px !important;
}

/* Mobile/tablet: show mobile actions, hide desktop actions */
.lht-popup-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-bottom: 20px;
}

.lht-popup-mobile-actions .lht-btn {
  width: 100%;
  height: 50px !important;
  font-size: var(--lht-font-size-sm) !important;
  border-radius: var(--lht-radius-btn) !important;
}

.lht-popup-cta-app {
  color: white;
}

.lht-popup-desktop-actions {
  display: none;
}

/* Desktop: hide mobile actions, show desktop actions */
@media (min-width: 1024px) {
  .lht-popup-mobile-actions {
    display: none !important;
  }

  .lht-popup-desktop-actions {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 20px;
  }

  .lht-popup-modal {
    max-width: 400px !important;
  }
}

.lht-popup-counter {
  font-size: var(--lht-font-size-xs) !important;
  color: var(--lht-color-muted);
  line-height: 1.5 !important;
}

.lht-popup-counter strong {
  color: var(--lht-clr-ink-strong);
  font-weight: var(--lht-font-weight-bold);
}

.lht-popup-cta-ios:hover {
  box-shadow: none !important;
}


/* QR wrapper */
.lht-popup-qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* QR image */
.lht-popup-qr-img {
  width: 160px !important;
  height: 160px !important;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px;
  background: #ffffff;
  display: block;
}

/* QR label */
.lht-popup-qr-label {
  font-size: var(--lht-font-size-xs) !important;
  color: var(--lht-color-muted);
  text-align: center;
  margin: 0 !important;
}

/* Continue on Web App button */
.lht-popup-webapp-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  gap: 6px;
  color: var(--lht-color-text) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  background: transparent !important;
  font-size: var(--lht-font-size-sm) !important;
  height: 44px !important;
  border-radius: var(--lht-radius-btn) !important;
  transition: var(--lht-transition) !important;
}

.lht-popup-webapp-btn:hover {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
  color: var(--lht-color-text) !important;
}

.lht-popup-webapp-arrow {
  font-size: 14px;
  transition: transform 0.2s ease;
  display: inline-block;
}

.lht-popup-webapp-btn:hover .lht-popup-webapp-arrow {
  transform: translateX(3px);
}


/* =============================================================================
   12. RESPONSIVE
   ============================================================================= */

@media (max-width: 900px) {
  .lht-tool-page {
    border-radius: 28px;
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .lht-tool-layout {
    grid-template-columns: 1fr;
  }

  .lht-tool-header {
    flex-direction: column;
    text-align: center;
  }

  .lht-tool-desc {
    margin: 0 auto;
  }

  .lht-popup-modal {
    padding: 28px 20px 24px;
    border-radius: 28px;
  }
}

@media (max-width: 600px) {
  .lht-tool-page {
    border-radius: 24px;
    padding: 14px;
  }

  .lht-upload-area {
    min-height: 200px;
    padding: 30px 14px 28px;
    border-radius: 24px;
  }

  .lht-upload-btn {
    width: 100%;
    min-width: 0;
    height: 50px;
    font-size: 15px;
  }

  .lht-action-btn {
    height: 50px;
    font-size: 15px;
  }

  .lht-result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .lht-result-actions .lht-btn {
    width: 100%;
    justify-content: center;
  }
}

/* =============================================================================
   NEW TOOL COMPONENTS
   ============================================================================= */

/* ── Demo banner ── */
.lht-demo-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 16px;
  margin-bottom: 20px;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: var(--lht-radius-sm);
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.lht-demo-banner strong {
  font-weight: 700;
}

.lht-demo-banner a {
  color: var(--lht-color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Language badges ── */
.lht-lang-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--lht-clr-primary-soft);
  color: var(--lht-color-primary);
  letter-spacing: 0.03em;
}

.lht-lang-badge:empty {
  display: none;
}

.lht-lang-badge--target {
  background: var(--lht-clr-green-soft);
  color: var(--lht-clr-green);
}

/* ── Character counter ── */
.lht-char-counter-wrap {
  position: relative;
}

.lht-char-counter {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--lht-color-muted);
  margin-top: 6px;
}

/* =============================================================================
   SHARED TOOL COMPONENTS
   (Previously duplicated in per-tool <style> blocks — centralised here)
   ============================================================================= */

/* ── Option label (small caps label above a control) ── */
.lht-option-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--lht-color-muted);
  margin-bottom: 10px;
}

/* ── Styled select ── */
.lht-select {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 36px 0 14px;
  border: 1.5px solid var(--lht-color-border);
  border-radius: var(--lht-radius-sm);
  background: var(--lht-bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c8088' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  font-family: inherit;
  font-size: var(--lht-font-size-sm);
  font-weight: 500;
  color: var(--lht-color-text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
  outline: none;
}

.lht-select:focus {
  border-color: var(--lht-clr-border-blue);
}

/* ── Options grid ── */
.lht-options-grid {
  display: grid;
  gap: 16px;
}

/* ── Result top bar (badge + message row) ── */
.lht-result-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

/* ── Result success message ── */
.lht-result-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--lht-clr-green);
  margin: 0;
}

/* ── Result meta row (badges under the result) ── */
.lht-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

/* ── Reading time badge ── */
.lht-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--lht-clr-bg-section);
  color: var(--lht-color-muted);
}

.lht-reading-time:empty {
  display: none;
}