:root {
  --bg: #f3f5fb;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --surface: #ffffff;
  --surface-alt: #eef1f8;
  --text: #0f172a;
  --text-muted: #334155;
  --text-soft: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #4338ca;
  --primary-hover: #3730a3;
  --primary-soft: #eef2ff;
  --primary-rgb: 67, 56, 202;
  --accent: #0891b2;
  --accent-hover: #0e7490;
  --accent-soft: #ecfeff;
  --accent-rgb: 8, 145, 178;
  --dark-pill: #1e1b4b;
  --success: #047857;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(67, 56, 202, 0.06);
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.07), 0 2px 8px rgba(67, 56, 202, 0.05);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.10);
  --font-sans: 'Noto Sans Georgian', 'Noto Sans', 'Sylfaen', 'DejaVu Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1200px;
  --header-bg: rgba(255, 255, 255, 0.82);
  --hero-spot-1: rgba(67, 56, 202, 0.10);
  --hero-spot-2: rgba(8, 145, 178, 0.10);
  --icon-grad: linear-gradient(145deg, #4338ca 0%, #6366f1 52%, #06b6d4 100%);
}

html[data-theme="dark"] {
  --bg: #0b1020;
  --bg-elevated: rgba(22, 27, 46, 0.72);
  --surface: #161b2e;
  --surface-alt: #1e2540;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --border: #2a3354;
  --border-strong: #3d4a72;
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --primary-soft: rgba(99, 102, 241, 0.16);
  --primary-rgb: 129, 140, 248;
  --accent: #22d3ee;
  --accent-hover: #67e8f9;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --accent-rgb: 34, 211, 238;
  --dark-pill: #e0e7ff;
  --success: #34d399;
  --success-soft: rgba(16, 185, 129, 0.16);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 14px rgba(0, 0, 0, 0.28);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(11, 16, 32, 0.84);
  --hero-spot-1: rgba(99, 102, 241, 0.18);
  --hero-spot-2: rgba(34, 211, 238, 0.12);
  --icon-grad: linear-gradient(145deg, #6366f1 0%, #22d3ee 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .container { padding: 0 24px; }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--icon-grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.28);
}
.brand span.tld { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.main-nav {
  display: none;
  position: absolute;
  top: 66px;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px 18px;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow);
  max-height: 80vh;
  overflow-y: auto;
}
.main-nav.open { display: flex; }

.nav-link {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  padding-left: 12px;
  gap: 2px;
}
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-dropdown-menu a:hover { background: var(--surface-alt); color: var(--primary); }


@media (min-width: 1060px) {
  .nav-toggle { display: none; }
  .main-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    background: transparent;
    border-bottom: none;
    padding: 0;
    box-shadow: none;
    gap: 2px;
    overflow: visible;
    max-height: none;
    flex: 1;
    justify-content: flex-start;
    margin-left: 16px;
  }
  .nav-links-group { display: flex; align-items: center; gap: 2px; }
  .nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 250px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 80;
  }
  .nav-dropdown-mega {
    min-width: 540px;
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 10px;
  }
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown.open .nav-dropdown-menu { display: flex; }
  .nav-dropdown:hover .nav-dropdown-mega,
  .nav-dropdown.open .nav-dropdown-mega { display: grid; }
}

main { flex: 1; }

/* Hero */
.hero-home {
  position: relative;
  overflow: hidden;
  padding: 44px 0 8px;
  text-align: center;
  background:
    radial-gradient(circle at 86% 8%, var(--hero-spot-1), transparent 38%),
    radial-gradient(circle at 10% 28%, var(--hero-spot-2), transparent 36%),
    var(--bg);
}
.hero-home h1 {
  margin: 0 auto 12px;
  max-width: 820px;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.2;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}
.hero-home p {
  margin: 0 auto 22px;
  max-width: 700px;
  font-size: 1.02rem;
  color: var(--text-muted);
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 22px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid transparent;
}
html[data-theme="dark"] .privacy-note { color: var(--accent); border-color: rgba(34, 211, 238, 0.2); }

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 22px;
}
.hero-notes .privacy-note { margin: 0; }
.free-note {
  background: var(--success-soft);
  color: var(--success);
}
html[data-theme="dark"] .free-note { color: var(--success); border-color: rgba(16, 185, 129, 0.28); }

/* Search */
.tools-search-wrap {
  max-width: 640px;
  margin: 0 auto 8px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  padding: 4px 4px 4px 0;
  text-align: left;
}
.tools-search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.22);
}
.tools-search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}
.tools-search {
  flex: 1;
  min-width: 0;
  width: auto;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 12px 10px 12px 44px;
  font-size: 0.95rem;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.tools-search::-webkit-search-decoration,
.tools-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.tools-search:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}
.tools-search-ai {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}
.tools-search-ai:hover { filter: brightness(1.06); }
.tools-search-ai:focus-visible { outline: 3px solid #a5f3fc; outline-offset: 2px; }
.tools-search-ai-ico { font-size: 14px; line-height: 1; }
.tools-search-hint {
  max-width: 640px;
  margin: 0 auto 28px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-muted);
  font-weight: 500;
}
.tools-search-empty {
  display: none;
  text-align: center;
  color: var(--text-muted);
  padding: 8px 0 16px;
  font-weight: 600;
}

/* Grouped tool sections */
.tools-section {
  text-align: left;
  margin-bottom: 36px;
}
.tools-section.hidden-by-search { display: none; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.section-heading h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-heading span {
  font-size: 0.8rem;
  color: var(--text-soft);
  font-weight: 600;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  .tools-grid { grid-template-columns: repeat(4, 1fr); }
  .tools-grid-featured { grid-template-columns: repeat(3, 1fr); }
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  text-align: left;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(var(--primary-rgb), 0.35);
}
.tool-card.hidden-by-filter,
.tool-card.hidden-by-search { display: none; }

.tool-card-featured {
  background: linear-gradient(180deg, var(--surface) 0%, var(--primary-soft) 160%);
  border-color: rgba(var(--primary-rgb), 0.18);
}

.tool-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--icon-grad);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.28);
}
.tool-icon-wrap svg { width: 24px; height: 24px; }

.tool-card-body { min-width: 0; flex: 1; }
.tool-card-body h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-card-body p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-live { background: var(--success-soft); color: var(--success); }
.badge-soon { background: var(--warning-soft); color: var(--warning); }
.badge-popular {
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.7rem;
}

.section { padding: 32px 0; }

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 768px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}
.feature-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.feature-box h3 { margin: 0 0 6px; font-size: 1rem; }
.feature-box p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }

/* Tool pages */
.tool-stage-header {
  text-align: center;
  padding: 32px 0 18px;
  background:
    radial-gradient(circle at 80% 0%, var(--hero-spot-1), transparent 40%),
    var(--bg);
}
.breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.breadcrumbs a:hover { color: var(--primary); }
.tool-stage-header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.55rem, 3.2vw, 2.3rem);
  font-weight: 800;
  color: var(--text);
}
.tool-stage-header p {
  margin: 0 auto;
  max-width: 680px;
  color: var(--text-muted);
  font-size: 1rem;
}

.upload-hero-box {
  max-width: 680px;
  margin: 18px auto 26px;
  padding: 38px 24px;
  border-radius: 18px;
  border: 2px dashed var(--border-strong);
  background: var(--bg-elevated);
  backdrop-filter: blur(10px);
  text-align: center;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
  cursor: pointer;
}
.upload-hero-box:hover,
.upload-hero-box.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-sm);
}
.upload-hero-box input[type="file"] { display: none; }

.cta-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--icon-grad);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 18px 40px;
  font-size: 1.12rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.32);
  transition: filter 0.15s, transform 0.1s;
}
.cta-upload-btn:hover { filter: brightness(1.06); }
.cta-upload-btn:active { transform: translateY(1px); }
.upload-hint { margin-top: 12px; color: var(--text-soft); font-size: 0.9rem; }

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (min-width: 960px) {
  .workspace-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
.workspace-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  min-height: 280px;
}
.workspace-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 82px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sidebar-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.thumb-card {
  background: var(--surface-alt);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}
.thumb-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.thumb-img-wrap {
  width: 100%;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.thumb-img-wrap img, .thumb-img-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.thumb-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  word-break: break-word;
}
.thumb-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }

.pdf-stage-wrap {
  position: relative;
  display: inline-block;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  max-width: 100%;
  cursor: crosshair;
}
.pdf-stage-wrap canvas { display: block; max-width: 100%; height: auto; }
.overlay-marker {
  position: absolute;
  border: 2px dashed var(--primary);
  background: rgba(var(--primary-rgb), 0.10);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-weight: 700;
}
.sig-pad {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  width: 100%;
  height: 130px;
  touch-action: none;
  cursor: crosshair;
}

.result-box {
  max-width: 620px;
  margin: 20px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.result-check {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-size: 1.6rem;
  font-weight: 800;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s, filter 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--icon-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.28);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-blue { background: var(--accent); color: #042f2e; font-weight: 800; }
html[data-theme="dark"] .btn-blue { color: #082f49; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-alt); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 0.79rem; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; width: 100%; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.93rem;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.22);
}
.textarea { resize: vertical; min-height: 190px; line-height: 1.65; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 820px) {
  .two-col { grid-template-columns: 1fr 1fr; }
}

.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-alt);
}
.file-item-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; }
.file-thumb {
  width: 50px; height: 50px; border-radius: 8px;
  object-fit: cover; border: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
}
.file-name { font-weight: 700; font-size: 0.9rem; word-break: break-word; }
.file-meta { font-size: 0.8rem; color: var(--text-muted); }

/* Legacy icon classes used in JS-generated file lists */
.tool-icon {
  width: 42px; height: 42px; border-radius: 12px;
  color: #fff; display: grid; place-items: center;
  flex-shrink: 0; font-weight: 800; font-size: 0.82rem;
  background: var(--icon-grad);
}
.ic-coral, .ic-green, .ic-blue, .ic-amber, .ic-purple,
.ic-crimson, .ic-teal, .ic-indigo, .ic-slate, .ic-orange {
  background: var(--icon-grad);
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .stats-grid { grid-template-columns: repeat(6, 1fr); } }
.stat-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.stat-value { font-size: 1.38rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.78rem; color: var(--text-muted); }

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.map-chip {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.83rem;
}
.map-chip b { color: var(--primary); }

.ad-slot {
  margin: 24px 0;
  border: 1px dashed var(--border-strong);
  background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 10px, var(--surface-alt) 10px, var(--surface-alt) 20px);
  border-radius: var(--radius-sm);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  color: var(--text-soft);
  text-align: center;
  font-size: 0.82rem;
}
.ad-slot strong { color: var(--text-muted); }

.howto-box {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.howto-box h2 { margin: 0 0 10px; font-size: 1.12rem; }
.howto-box p, .howto-box li { color: var(--text-muted); font-size: 0.92rem; }
.howto-box ol, .howto-box ul { margin: 8px 0 0; padding-left: 20px; }

.pricing-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 820px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}
.pricing-card.featured {
  border: 2px solid var(--primary);
  box-shadow: var(--shadow);
  background: linear-gradient(180deg, var(--surface) 0%, var(--primary-soft) 180%);
}
.price-tag { font-size: 2rem; font-weight: 800; }
.price-tag span { font-size: 0.92rem; font-weight: 500; color: var(--text-muted); }
.pricing-list {
  margin: 0; padding-left: 18px; color: var(--text-muted);
  font-size: 0.91rem; display: flex; flex-direction: column; gap: 8px; flex: 1;
}

/* CV */
.cv-workspace { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 1024px) { .cv-workspace { grid-template-columns: 440px 1fr; } }
.cv-form-section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.cv-form-section h3 { margin: 0 0 10px; font-size: 0.96rem; }
.cv-entry-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cv-sheet-wrap { background: var(--surface-alt); padding: 16px; border-radius: var(--radius); overflow-x: auto; }
.cv-sheet {
  --cv-accent: #4338ca;
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 794px;
  min-height: 980px;
  margin: 0 auto;
  padding: 36px 40px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
  font-size: 13.5px;
  line-height: 1.55;
}
.cv-sheet.tpl-modern { display: grid; grid-template-columns: 235px 1fr; padding: 0; }
.cv-sheet.tpl-modern .cv-sidebar { background: var(--cv-accent); color: #fff; padding: 32px 22px; }
.cv-sheet.tpl-modern .cv-main { padding: 32px 30px; }
.cv-sheet.tpl-classic .cv-header { border-bottom: 3px solid var(--cv-accent); padding-bottom: 14px; margin-bottom: 18px; }
.cv-sheet.tpl-minimal .cv-header { border-bottom: 1px solid #cbd5e1; padding-bottom: 14px; margin-bottom: 18px; }
.cv-name { margin: 0; font-size: 1.7rem; font-weight: 800; line-height: 1.2; }
.cv-role { margin: 4px 0 0; font-size: 1.02rem; font-weight: 600; color: var(--cv-accent); }
.cv-sheet.tpl-modern .cv-sidebar .cv-role { color: rgba(255, 255, 255, 0.9); }
.cv-contacts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: 0.88rem; color: #475569; }
.cv-sheet.tpl-modern .cv-sidebar .cv-contacts { flex-direction: column; gap: 6px; color: rgba(255, 255, 255, 0.92); }
.cv-block { margin-top: 18px; }
.cv-block-title {
  margin: 0 0 8px; font-size: 0.92rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--cv-accent); border-bottom: 1px solid #e2e8f0; padding-bottom: 4px;
}
.cv-sheet.tpl-modern .cv-sidebar .cv-block-title { color: #ffffff; border-bottom-color: rgba(255, 255, 255, 0.3); }
.cv-item { margin-bottom: 12px; }
.cv-item-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.cv-item-sub { color: #475569; font-size: 0.9rem; font-weight: 600; }
.cv-skills-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-skill-tag { background: #eef2ff; color: #312e81; padding: 3px 9px; border-radius: 6px; font-size: 0.82rem; font-weight: 600; }
.cv-sheet.tpl-modern .cv-sidebar .cv-skill-tag { background: rgba(255, 255, 255, 0.18); color: #ffffff; }
@media (max-width: 720px) {
  .cv-sheet.tpl-modern { grid-template-columns: 1fr; }
  .cv-sheet { padding: 22px 18px; min-height: auto; }
}

.progress-bar-wrap {
  width: 100%; height: 10px; border-radius: 999px;
  background: var(--surface-alt); overflow: hidden; border: 1px solid var(--border);
}
.progress-bar-fill { height: 100%; width: 0%; background: var(--icon-grad); transition: width 0.2s; }

.licenses-list { display: grid; gap: 14px; }
.licenses-list article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.licenses-list h3 { margin: 0 0 6px; font-size: 1.02rem; }
.licenses-list p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.licenses-list a { color: var(--primary); font-weight: 700; }

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 26px 0;
  margin-top: 36px;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.footer-inner { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a:hover { color: var(--primary); }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e1b4b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 120;
}
html[data-theme="dark"] .toast { background: #e0e7ff; color: #1e1b4b; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media print {
  body { background: #fff !important; }
  .site-header, .site-footer, .tool-stage-header, .cv-form-panel, .cv-toolbar, .ad-slot, .howto-box, .no-print {
    display: none !important;
  }
  .container { max-width: 100% !important; padding: 0 !important; }
  .cv-workspace { display: block !important; }
  .cv-sheet-wrap { background: transparent !important; padding: 0 !important; }
  .cv-sheet { box-shadow: none !important; max-width: 100% !important; margin: 0 !important; min-height: auto !important; }
}

/* Compact amindus.ge ad strip — one line, used at the bottom of the homepage (and tool pages if present) */
.amindus-strip-wrap { margin: 4px auto 28px; }
.amindus-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  max-width: 880px;
  min-height: 40px;
  padding: 6px 10px 6px 8px;
  text-decoration: none;
  color: inherit;
  background:
    linear-gradient(var(--bg-elevated), var(--bg-elevated)) padding-box,
    linear-gradient(120deg, rgba(var(--primary-rgb), 0.45), rgba(var(--accent-rgb), 0.55)) border-box;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
  text-align: left;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.amindus-banner:hover { box-shadow: var(--shadow-sm); }
.amindus-banner:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.amindus-banner-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  padding: 2px;
}
.amindus-banner-icon svg { width: 100%; height: 100%; }
.amindus-banner-copy {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.amindus-banner-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 6px;
}
.amindus-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  white-space: nowrap;
}
.amindus-banner:hover .amindus-banner-cta { background: var(--accent-soft); color: var(--accent); }
/* If a tool page already has the strip in the sidebar, tighten it there */
.workspace-sidebar .amindus-banner { margin: 12px 0 0; max-width: none; }

/* Office converters & shared tool UI */
.ot-progress { margin-top: 14px; }
.ot-status { font-size: 0.86rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.ot-error {
  margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger); font-size: 0.88rem; font-weight: 600;
}
.ot-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.ot-check input { width: 17px; height: 17px; accent-color: var(--primary); flex: none; }
.ot-hint { margin: 0; color: var(--text-soft); font-size: 0.8rem; line-height: 1.45; }
.ot-preview {
  margin-top: 6px; max-height: 460px; overflow: auto; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; color: #111827;
}
.ot-doc-preview { padding: 26px 30px; }
.ot-sheet-preview { padding: 10px; font-size: 0.82rem; }
.ot-sheet-preview table { border-collapse: collapse; }
.ot-sheet-preview td, .ot-sheet-preview th { border: 1px solid #cbd5e1; padding: 3px 7px; white-space: nowrap; }
.ot-slide-preview { padding: 10px; background: var(--surface-alt); }
.ot-slide-holder { width: 100%; position: relative; overflow: hidden; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.upload-hero-box.dragover { border-color: var(--accent); background: var(--accent-soft); }

/* Translator */
.translator-status { margin-bottom: 16px; font-size: 0.92rem; }
.translator-status.is-info { background: var(--primary-soft); border-color: rgba(var(--primary-rgb), 0.2); color: var(--primary); }
.translator-status.is-warn { background: var(--warning-soft); border-color: rgba(180, 83, 9, 0.25); color: var(--warning); }
.translator-note { margin: 14px 0 0; font-size: 0.82rem; color: var(--text-soft); line-height: 1.5; }
.translator-note a { color: var(--primary); font-weight: 600; }

/* =====================================================================
   Mobile & touch polish (phones 320–640px, tablets up to 1059px)
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
h1, h2, h3, h4, p, li, label, .tool-card-body, .file-name, .thumb-label { overflow-wrap: break-word; word-break: normal; }
main { min-width: 0; }
[hidden] { display: none !important; }
.workspace-layout > *, .two-col > *, .tools-grid > *, .cv-workspace > * { min-width: 0; }

/* Hamburger icon morphs into a close (×) icon when the menu is open */
.nav-toggle svg line { transition: transform 0.2s ease, opacity 0.2s ease; transform-origin: 12px 12px; }
.nav-toggle.is-open svg line:nth-child(1) { transform: rotate(45deg) translateY(6px); }
.nav-toggle.is-open svg line:nth-child(2) { opacity: 0; }
.nav-toggle.is-open svg line:nth-child(3) { transform: rotate(-45deg) translateY(-6px); }

.h2p-code { min-height: 360px; font-family: monospace; font-size: 0.86rem; }
@media (max-width: 1059px) {
  .nav-toggle, .theme-toggle { width: 44px; height: 44px; }
  .brand { min-height: 44px; }
  .breadcrumbs { flex-wrap: wrap; justify-content: center; gap: 2px 6px; margin-bottom: 4px; }
  .breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  .header-actions { gap: 6px; min-width: 0; }
  .header-inner { min-width: 0; }
  .main-nav {
    top: 100%;
    max-height: calc(100vh - 66px);
    max-height: calc(100dvh - 66px);
    padding: 10px 16px 22px;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .nav-links-group { display: flex; flex-direction: column; gap: 2px; }
  .main-nav .nav-link {
    display: flex;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    font-size: 0.98rem;
    white-space: normal;
    text-align: left;
  }
  .nav-dropdown > .nav-link { justify-content: space-between; }
  .nav-dropdown-menu { padding: 2px 0 6px 10px; border-left: 2px solid var(--border); margin-left: 14px; }
  .nav-dropdown-menu a { min-height: 44px; font-size: 0.94rem; padding: 10px 12px; }
  body.nav-open { overflow: hidden; }
  .workspace-sidebar { position: static; }
}

/* Touch-friendly controls: 44px targets, 16px inputs (no iOS zoom) */
@media (max-width: 1059px), (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 44px; padding: 8px 14px; font-size: 0.86rem; }
  .file-item .btn-sm, .thumb-actions .btn-sm { min-width: 44px; padding: 8px 12px; font-size: 1rem; }
  .thumb-actions { gap: 6px; }
  .input, .select, .textarea, .tools-search,
  input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
  input[type="number"], input[type="password"], input[type="search"], select, textarea, .h2p-code {
    font-size: 16px;
  }
  .textarea.h2p-code { min-height: 260px; }
  .input, .select { min-height: 46px; }
  .ot-check { min-height: 44px; }
  .ot-check input, input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  input[type="range"] { min-height: 36px; }
  input[type="color"] { min-height: 44px; min-width: 44px; }
  .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 767px) {
  /* Home hero */
  .hero-home { padding: 28px 0 4px; }
  .hero-home h1 { font-size: clamp(1.45rem, 6.4vw, 1.75rem); letter-spacing: -0.02em; }
  .hero-home p { font-size: 0.95rem; margin-bottom: 18px; }
  .privacy-note { font-size: 0.8rem; border-radius: 14px; line-height: 1.45; padding: 8px 14px; }
  .tools-search-wrap { margin-bottom: 8px; }
  .tools-search { padding: 12px 8px 12px 42px; font-size: 16px; }
  .tools-search-hint { margin-bottom: 22px; font-size: 12px; padding: 0 8px; }
  .tools-search-ai { height: 38px; }

  /* Grouped tool sections: compact list cards */
  .tools-section { margin-bottom: 26px; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 10px; }
  .section-heading h2 { font-size: 1.1rem; }
  .tools-grid { gap: 10px; }
  .tool-card { padding: 14px; gap: 12px; align-items: center; min-height: 72px; }
  .tool-card:hover { transform: none; }
  .tool-icon-wrap { width: 44px; height: 44px; border-radius: 12px; }
  .tool-icon-wrap svg { width: 21px; height: 21px; }
  .tool-card-body h3 { font-size: 0.98rem; margin-bottom: 2px; }
  .tool-card-body p {
    font-size: 0.82rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .features-grid { gap: 10px; }
  .feature-box { padding: 16px; }
  .section { padding: 24px 0; }

  /* Slim amindus strip stays one line; text ellipsizes if needed */
  .amindus-strip-wrap { margin: 8px auto 22px; }
  .amindus-banner { padding: 6px 8px 6px 6px; gap: 8px; border-radius: 14px; min-height: 36px; }
  .amindus-banner-icon { width: 26px; height: 26px; border-radius: 7px; }
  .amindus-banner-copy { font-size: 12.5px; }
  .amindus-banner-kicker { display: none; }
  .amindus-banner-cta { padding: 4px 9px; font-size: 12px; }

  /* Tool pages */
  .tool-stage-header { padding: 18px 0 10px; }
  .tool-stage-header h1 { font-size: clamp(1.4rem, 6.2vw, 1.7rem); line-height: 1.25; }
  .tool-stage-header p { font-size: 0.94rem; }
  .upload-hero-box { padding: 24px 16px; margin: 12px auto 20px; border-radius: 16px; }
  .cta-upload-btn { width: 100%; padding: 16px 18px; font-size: 1.02rem; }
  .upload-hint { font-size: 0.86rem; }
  .workspace-layout { gap: 14px; }
  .workspace-canvas, .workspace-sidebar, .panel { padding: 16px; }
  .workspace-canvas { min-height: 0; }
  .toolbar { gap: 8px; }
  .toolbar-group { gap: 6px; }
  .thumb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .thumb-card { padding: 8px; }
  .thumb-img-wrap { height: 150px; }
  .file-item { padding: 10px; }
  .file-item-info { min-width: 0; flex-basis: 100%; }
  .result-box { padding: 24px 16px; margin: 14px auto; }
  .result-box .btn { width: 100%; }
  .ot-doc-preview { padding: 16px; }
  .textarea { min-height: 160px; }

  /* Footer */
  .site-footer { font-size: 0.88rem; }
  .footer-links { gap: 0 14px; }
}

@media (max-width: 380px) {
  .container { padding: 0 14px; }
  .brand { font-size: 1.05rem; gap: 7px; }
  .brand-mark { width: 34px; height: 34px; }
  .thumb-img-wrap { height: 130px; }
}

@media (max-width: 560px) {
  /* Toolbars: each group takes a full row; controls wrap and share it evenly */
  .toolbar > .toolbar-group { width: 100%; flex-wrap: wrap; }
  .toolbar > .toolbar-group > .select,
  .toolbar > .toolbar-group > .input { flex: 1 1 100%; min-width: 0; width: auto !important; }
  .toolbar > .toolbar-group > .btn { flex: 1 1 auto; white-space: normal; }
  .toolbar > .btn { width: 100%; }
  /* Language pair + icon-only swap button (translator): two selects stacked, swap on the side */
  .toolbar > .toolbar-group:has(> .btn[aria-label]) {
    display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px;
  }
  .toolbar > .toolbar-group:has(> .btn[aria-label]) > .btn[aria-label] { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; height: auto; padding: 8px; }
  .toolbar > .toolbar-group:has(> .btn[aria-label]) > .select { grid-column: 1; width: 100% !important; }
  /* Labelled field blocks inside a toolbar (image compressor) stack full width */
  .toolbar > .toolbar-group > div { flex: 1 1 100%; min-width: 0 !important; }
  .toolbar > .toolbar-group > div > .select { width: 100% !important; }
}

/* Translator: live translation state */
.translator-out-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.translator-live { font-size: 0.8rem; font-weight: 600; color: var(--text-soft); min-height: 1.2em; display: inline-flex; align-items: center; gap: 6px; }
.translator-live.is-busy { color: var(--primary); }
.translator-live.is-busy::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: tr-pulse 1s ease-in-out infinite;
}
.translator-live.is-error { color: var(--warning); }
@keyframes tr-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
#ai-out-text { transition: opacity 0.2s ease; }
#ai-out-text.is-stale { opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .translator-live.is-busy::before { animation: none; } }
@media (max-width: 819px) { #ai-src-text, #ai-out-text { min-height: 140px; } }

@media (max-width: 440px) {
  .tools-search-ai { width: 38px; padding: 0; gap: 0; }
  .tools-search-ai-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
}


/* Language switcher — compact dropdown (globe + current code) */
.lang-switch,
.lang-dd {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  overflow: visible;
  background: transparent;
  border: 0;
}
.lang-dd-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  line-height: 1;
}
.lang-dd-btn:hover,
.lang-dd-btn:focus-visible {
  color: var(--primary);
  border-color: var(--primary);
  outline: none;
}
.lang-dd-btn[aria-expanded="true"] {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.lang-dd-globe,
.lang-dd-caret { flex-shrink: 0; display: block; }
.lang-dd-caret { opacity: 0.7; }
.lang-dd-btn[aria-expanded="true"] .lang-dd-caret { transform: rotate(180deg); }
.lang-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  min-width: 188px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}
.lang-switch-menu .lang-dd-menu {
  right: auto;
  left: 0;
}
.lang-dd-menu[hidden] { display: none; }
.lang-dd-menu a {
  text-decoration: none;
  box-sizing: border-box;
}
.lang-dd-menu button,
.lang-dd-menu a {
  appearance: none;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-align: left;
  cursor: pointer;
  line-height: 1.2;
}
.lang-dd-menu button:hover,
.lang-dd-menu a:hover,
.lang-dd-menu button:focus-visible,
.lang-dd-menu a:focus-visible {
  background: var(--primary-soft);
  color: var(--primary);
  outline: none;
}
.lang-dd-menu button[aria-selected="true"],
.lang-dd-menu a[aria-selected="true"] {
  background: var(--primary-soft);
  color: var(--primary);
}
.lang-switch-menu {
  display: none;
  margin-top: 10px;
  align-self: flex-start;
}
@media (max-width: 1059px) {
  .lang-switch-menu { display: inline-flex; margin: 12px 0 4px; }
}
@media (max-width: 400px) {
  .lang-dd-btn { padding: 0 8px; gap: 4px; }
}

/* Avoid a Georgian flash when a stored/URL language is ru or en */
html.i18n-pending body { visibility: hidden; }
html.i18n-ready body { visibility: visible; }


/* —— Speed-test entry points (header + homepage banner) —— */
.st-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff !important;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: .01em;
  text-decoration: none;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(79, 70, 229, .28);
  flex-shrink: 0;
  white-space: nowrap;
}
.st-nav-btn:hover { filter: brightness(1.06); color: #fff !important; }
.st-nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.st-nav-btn[aria-current="page"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4f46e5; }
.nav-link.st-nav-link {
  background: linear-gradient(135deg, #4f46e5, #0891b2);
  color: #fff !important;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 800;
}
.nav-link.st-nav-link:hover { filter: brightness(1.06); color: #fff !important; }
.st-nav-bar {
  display: none;
  background: linear-gradient(90deg, #4f46e5, #0891b2);
  color: #fff;
}
.st-nav-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  color: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  text-decoration: none;
}
.st-nav-bar a:hover { color: #fff; }
.st-nav-bar svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Homepage promo — directly under the tool search, above Popular */
.st-home-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px 22px;
  align-items: center;
  margin: 22px 0 8px;
  padding: 22px 24px;
  border-radius: 20px;
  background:
    radial-gradient(1200px 180px at 100% 0%, rgba(6, 182, 212, .22), transparent 55%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 48%, #0e7490 100%);
  color: #eef2ff;
  box-shadow: 0 16px 40px rgba(30, 27, 75, .28);
  overflow: hidden;
}
.st-home-visual {
  width: 72px; height: 72px; border-radius: 20px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.12);
  color: #a5f3fc;
  flex-shrink: 0;
}
.st-home-visual svg { width: 40px; height: 40px; }
.st-home-kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #a5f3fc;
}
.st-home-banner h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: #fff;
}
.st-home-banner p.st-home-lead {
  margin: 0;
  color: rgba(238, 242, 255, .86);
  font-weight: 500;
  line-height: 1.45;
}
.st-home-cta {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  background: #fff;
  color: #1e1b4b !important;
  font-weight: 800;
  font-size: 1.02rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  white-space: nowrap;
}
.st-home-cta:hover { background: #ecfeff; color: #1e1b4b !important; filter: none; }

@media (min-width: 1060px) {
  /* Desktop nav already has the highlighted speed-test item; a second header
     button plus მიანა + language + theme overflow a 1200px bar (dropdown would be off-screen). */
  .header-actions .st-nav-btn { display: none; }
  .main-nav .nav-link { padding-left: 7px; padding-right: 7px; }
  .header-inner { gap: 8px; }
  .main-nav { margin-left: 6px; }
}
@media (max-width: 1059px) {
  /* Keep a highlighted control in the header row when there is room */
  .nav-link.st-nav-link { display: none; }
}
@media (max-width: 720px) {
  .st-nav-btn .st-nav-txt { display: none; }
  .st-nav-btn { padding: 0; width: 44px; }
  .st-home-banner { grid-template-columns: auto minmax(0, 1fr); padding: 18px 16px; margin-top: 18px; }
  .st-home-cta { grid-column: 1 / -1; width: 100%; min-height: 52px; }
  .st-home-banner h2 { font-size: 1.28rem; }
}
@media (max-width: 480px) {
  /* At 390px the top bar is already tight — keep speed test as a full-width bar under the header (always visible, not in the hamburger). */
  .header-actions .st-nav-btn { display: none; }
  .st-nav-bar { display: block; }
  .st-home-visual { width: 56px; height: 56px; border-radius: 16px; }
  .st-home-visual svg { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .st-nav-btn, .st-home-cta, .st-start-btn { transition: none; }
}
