:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --border: #ececec;
  --border-strong: #dcdcdc;
  --ink: #0a0a0a;
  --ink-2: #3a3a3a;
  --muted: #8a8a8a;
  --muted-2: #b4b4b4;

  --accent: #0a0a0a;
  --grok: #43b581;
  --grok-bg: #eaf7f0;
  --google: #4285f4;
  --yandex: #fc3f1d;

  /* Те же цвета, что и в расширении — чтобы попап выглядел 1:1 */
  --popup-bg: #444;
  --popup-inner-bg: #3a3a3a;
  --popup-result-bg: #2c2c2c;
  --popup-text: #e8e8e8;
  --popup-muted: #888;
  --popup-radius: 8px;
  --popup-inner-radius: 6px;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.04), 0 4px 16px rgba(10, 10, 10, 0.05);
  --shadow-md: 0 6px 20px rgba(10, 10, 10, 0.07), 0 24px 48px rgba(10, 10, 10, 0.08);
  --shadow-lg: 0 30px 60px rgba(10, 10, 10, 0.12);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.skip-link { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 12px; top: 12px; width: auto; height: auto; padding: 8px 12px; background: var(--ink); color: #fff; border-radius: 8px; z-index: 100; }

/* ─── NAV ───────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 28px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.nav__brand-mark { width: 30px; height: 30px; }
.nav__brand-mark svg { width: 100%; height: 100%; }

.nav__github {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); text-decoration: none;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__github svg { width: 16px; height: 16px; }
.nav__github:hover { color: var(--ink); border-color: var(--ink); background: var(--bg-soft); }

@media (max-width: 680px) {
  .nav { padding: 14px 16px; }
  .nav__github span { display: none; }
  .nav__github { padding: 7px; }
  .nav__github svg { width: 18px; height: 18px; }
}

/* ─── HERO ──────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 72px 24px 48px; max-width: 840px; margin: 0 auto; }
.hero__title { font-size: clamp(42px, 7vw, 80px); font-weight: 800; letter-spacing: -0.035em; line-height: 1; margin: 0 0 18px; }
.hero__subtitle { font-size: clamp(16px, 2.2vw, 20px); color: var(--ink-2); margin: 0 0 28px; line-height: 1.45; }
.hero__br { display: inline; }
@media (max-width: 520px) { .hero__br { display: none; } }
.hero__cta { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { background: var(--bg-soft); color: var(--ink); border: 1px solid var(--border); }
.btn--ghost:hover { background: #efeff0; }
.btn--lg { padding: 14px 24px; font-size: 16px; }

/* ─── DEMO (central stage) ──────────────────────────────────────────────── */
.demo {
  position: relative; margin: 60px auto 40px; max-width: 900px;
  padding: 0 24px; min-height: 520px;
}

.demo__source {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.demo__source-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px; background: #fff;
  border-bottom: 1px solid var(--border);
}
.demo__dot { width: 10px; height: 10px; border-radius: 50%; }
.demo__dot--r { background: #ff5f56; }
.demo__dot--y { background: #ffbd2e; }
.demo__dot--g { background: #27c93f; }
.demo__source-url {
  margin-left: 10px; font-size: 12px; color: var(--muted);
  font-family: 'Google Sans Mono', ui-monospace, monospace;
}

.demo__source-body {
  padding: 40px 44px 96px;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.6; color: var(--ink); letter-spacing: -0.005em;
}

.demo__source-body .hl { position: relative; background: transparent; transition: background 0.35s var(--ease); }
.demo__source-body .hl--active {
  background: rgba(64, 120, 240, 0.18);
  animation: selection-sweep 0.7s var(--ease) 1;
}
@keyframes selection-sweep {
  0%   { background: rgba(64, 120, 240, 0); }
  40%  { background: rgba(64, 120, 240, 0.35); }
  100% { background: rgba(64, 120, 240, 0.18); }
}

/* ════════════════════════════════════════════════════════════════════════
   POPUP — 1:1 копия стилей расширения (см. src/styles/_translator-popup.scss)
   ════════════════════════════════════════════════════════════════════════ */

.translator-popup-shell {
  position: absolute;
  left: 50%;
  bottom: -20px;
  transform: translate(-50%, 10px);
  width: min(450px, calc(100% - 48px));
  font-family: 'Google Sans', 'Inter', system-ui, sans-serif;
  color: var(--popup-text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease-spring);
  z-index: 4;
}
.translator-popup-shell.is-visible { opacity: 1; transform: translate(-50%, 0); }

.translator-popup-body {
  box-sizing: border-box;
  position: relative;
  background-color: var(--popup-bg);
  width: 100%;
  border-radius: var(--popup-radius);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 6px 5px 6px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.translator-popup-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.translator-popup-history {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  margin: 0; padding: 0;
  border: none; border-radius: 6px;
  background: transparent;
  color: var(--popup-text);
  opacity: 0.92;
}
.translator-popup-history svg { display: block; width: 70%; height: 70%; }

.translator-source-lang {
  flex-shrink: 0;
  display: flex; align-items: center;
  width: max-content; max-width: 100%;
  height: 26px; padding: 5px 10px;
  border: none; border-radius: var(--popup-inner-radius);
  background-color: var(--popup-inner-bg);
  color: var(--popup-text);
  font-size: 13px; line-height: 1.3;
  cursor: default; user-select: none;
}
.translator-source-lang__label { flex: 0 0 auto; white-space: nowrap; }

.translator-header-arrow {
  flex-shrink: 0; width: 22px; height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8e8e8'%3E%3Cpath d='M13.3 5.3a1 1 0 0 1 1.4 0l6 6a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4-1.4L17.6 13H4a1 1 0 1 1 0-2h13.6l-4.3-4.3a1 1 0 0 1 0-1.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.9;
}

.translator-select-wrap {
  position: relative;
  width: 130px;
  align-self: flex-start;
}
.translator-select-wrap::after {
  content: '';
  position: absolute; top: 50%; right: 10px;
  width: 12px; height: 8px; margin-top: -4px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c8c8c8' d='M1.4 0 6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.translator-select-trigger {
  display: flex; align-items: center; box-sizing: border-box;
  width: 100%; margin: 0; height: 26px;
  padding: 5px 30px 5px 10px;
  border: none; border-radius: var(--popup-inner-radius);
  background-color: var(--popup-inner-bg);
  color: var(--popup-text);
  font-size: 13px; line-height: 1.3;
  text-align: left; cursor: pointer; user-select: none;
}
.translator-select-trigger__label {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.translator-ai-status {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 3px;
  max-width: 135px; margin: 0; padding: 3px 5px;
  border: none; border-radius: 6px;
  background: transparent;
  color: var(--popup-text);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.translator-ai-status--authenticated.translator-ai-status--google,
.translator-ai-status--authenticated.translator-ai-status--yandex {
  background: rgb(255 153 83 / 14%);
  color: var(--popup-text);
}
.translator-ai-status--authenticated.translator-ai-status--ai {
  background: rgb(67, 181, 129);
  color: #fff;
}
.translator-ai-status__icon {
  flex: 0 0 auto; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
}
.translator-ai-status__icon svg { width: 100%; height: 100%; display: block; }
.translator-ai-status__tokens {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; line-height: 1;
}

.translator-font-size {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  margin: 0 0 0 auto; padding: 0;
  border: none; border-radius: 6px;
  background: transparent;
  color: var(--popup-text);
  opacity: 0.55;
}
.translator-font-size svg { display: block; width: 16px; height: 16px; }

.translator-pin,
.translator-report-button {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  margin: 0; padding: 0;
  border: none; border-radius: 6px;
  background: transparent;
  color: var(--popup-text);
  opacity: 0.55;
}
.translator-pin svg,
.translator-report-button svg { display: block; width: 15px; height: 15px; }

.translator-popup-close {
  margin: 0; align-self: center; flex-shrink: 0;
  width: 26px; height: 26px; padding: 0;
  border: none; border-radius: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8e8e8'%3E%3Cpath d='M18.3 5.71a1 1 0 0 0-1.41 0L12 10.59 7.11 5.7a1 1 0 0 0-1.42 1.42L10.59 12l-4.9 4.89a1 1 0 1 0 1.42 1.41L12 13.41l4.89 4.89a1 1 0 0 0 1.41-1.41L13.41 12l4.89-4.88a1 1 0 0 0 0-1.41Z'/%3E%3C/svg%3E") center / 18px 18px no-repeat transparent;
}

/* ── RESULT ─────────────────────────────────────────────────────────────── */
.translator-popup-content {
  position: relative; flex: 0 0 auto;
  display: flex; flex-direction: column;
  overflow: hidden; border-radius: 8px;
}

.translator-result {
  position: relative;
  display: flex; flex-direction: column;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  min-height: 6.5rem;
  max-height: min(52vh, 380px);
  border-radius: 8px;
  background: var(--popup-result-bg);
  overflow: hidden;
  isolation: isolate;
}

.translator-result--loading::before {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background-color: #363636;
  background-image: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.085) 50%, rgba(255,255,255,0) 100%);
  background-size: 55% 100%;
  background-repeat: no-repeat;
  background-position: -100% 0;
  animation: translator-result-shine 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.translator-result--loading .translator-result__body { position: relative; z-index: 2; background: transparent; }

@keyframes translator-result-shine {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

.translator-result__body {
  position: relative;
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto;
  padding: 0 8px 0 0;
}

.translator-result__text {
  flex: 0 0 auto; box-sizing: border-box;
  padding: 10px 8px 14px 12px;
  color: var(--popup-text);
  font-size: 14px; line-height: 1.4;
  white-space: pre-line;
}

.translator-result__copy {
  position: absolute; right: 6px; bottom: 6px; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  margin: 0; padding: 0;
  border: none; border-radius: 6px;
  background: transparent;
  opacity: 0.5;
}
.translator-result__copy-icon {
  display: block; width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8e8e8'%3E%3Cpath d='M16 1H4a2 2 0 0 0-2 2v14h2V3h12V1zm3 4H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ── AI PANEL (bottom bar) ──────────────────────────────────────────────── */
.translator-ai-panel {
  display: flex; flex-direction: column; gap: 5px;
  flex-shrink: 0; min-width: 0;
}

.translator-ai-panel__bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px; min-width: 0;
}

.translator-ai-panel__bar-side {
  display: flex; align-items: center; min-width: 0; width: max-content; gap: 5px;
}
.translator-ai-panel__bar-side--left { justify-self: start; }
.translator-ai-panel__bar-side--right { justify-self: end; }

.translator-ai-panel__telegram-link {
  color: rgba(232, 232, 232, 0.72);
  text-decoration: none;
  font-size: 11px; font-weight: 500;
  padding: 2px 4px; border-radius: 4px;
}
.translator-ai-panel__telegram-link:hover { color: var(--popup-text); }

.translator-ai-panel__toggle {
  justify-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 0;
  background: transparent; border: none;
}
.translator-ai-panel__toggle-arrow {
  flex: 0 0 auto;
  width: 8px; height: 5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c8c8c8' d='M1.4 0 6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E") no-repeat center / contain;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
}

.translator-ai-panel__version {
  color: rgba(232, 232, 232, 0.48);
  font-size: 7px; letter-spacing: 0.02em;
}

.translator-result-size {
  flex-shrink: 0;
  display: inline-block; position: relative;
  width: 5px; height: 7px;
  margin: 0 2px 0 0;
  opacity: 0.85;
  cursor: nwse-resize;
  user-select: none;
}
.translator-result-size__arrow {
  display: block; width: 100%; height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c8c8c8' d='M1.4 0 6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E") no-repeat center / contain;
  transform: rotate(-45deg);
  pointer-events: none;
}

/* ─── FEATURES ──────────────────────────────────────────────────────────── */
.features { max-width: 1040px; margin: 80px auto; padding: 0 24px; }
.features__title { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; text-align: center; }
.features__lead { text-align: center; color: var(--muted); font-size: 16px; max-width: 640px; margin: 0 auto 36px; }
.features__grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 840px) { .features__grid { grid-template-columns: 1fr; } }

.feature-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.feature-card--accent { background: linear-gradient(180deg, #f6fbf8 0%, #fff 100%); border-color: #d8eee1; }
.feature-card__badge {
  position: absolute; top: -10px; left: 24px;
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  background: var(--grok); color: #fff;
  font-size: 11px; font-weight: 600;
}
.feature-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.feature-card__head h3 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.feature-card__logo { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.feature-card__logo svg { width: 100%; height: 100%; }
.feature-card__caption { color: var(--ink-2); font-size: 14px; margin: 0 0 16px; line-height: 1.55; }
.feature-card__example { padding: 14px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--border); }
.feature-card__ex-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-family: 'Google Sans', system-ui, sans-serif; font-style: italic; }
.feature-card__ex-translation { font-size: 14px; line-height: 1.5; color: var(--ink); }
.feature-card__ex-translation--best { font-weight: 500; }

/* ─── INPUT DEMO ────────────────────────────────────────────────────────── */
.input-demo { max-width: 900px; margin: 80px auto; padding: 0 24px; text-align: center; }
.input-demo__title { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
.input-demo__lead { color: var(--muted); max-width: 620px; margin: 0 auto 36px; }
.input-demo__stage { position: relative; text-align: left; }

.editor {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.editor__toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 10px;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
}
.editor__btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--ink-2);
  border-radius: 6px; user-select: none;
}
.editor__btn--i { font-style: italic; font-weight: 500; }
.editor__btn--u { text-decoration: underline; font-weight: 500; }

.editor__body {
  padding: 22px 24px; min-height: 140px;
  font-size: 15px; line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
}
.editor__text .sel {
  background: rgba(64, 120, 240, 0.22);
  animation: selection-sweep 0.7s var(--ease);
  border-radius: 2px;
}
.editor__text .replaced {
  background: rgba(67, 181, 129, 0.18);
  transition: background 0.6s var(--ease);
  border-radius: 2px; padding: 0 1px;
}
.editor__caret {
  display: inline-block; width: 2px; height: 1.1em;
  background: var(--ink); vertical-align: -2px;
  animation: caret-blink 1s steps(2) infinite;
  margin-left: 1px;
}
.editor__caret.is-hidden { opacity: 0; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* ── INLINE POPUP (editable-bubble) — 1:1 копия расширения ───────────── */
.translator-inline-popup {
  box-sizing: border-box;
  position: absolute;
  top: 100%; left: 50%;
  transform: translate(-50%, 6px) scale(0.96);
  display: inline-flex; align-items: center;
  gap: 5px; min-width: 0;
  padding: 5px;
  border-radius: var(--popup-radius);
  background: var(--popup-bg);
  font-family: 'Google Sans', 'Inter', system-ui, sans-serif;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease-spring);
  z-index: 3;
  white-space: nowrap;
}
.translator-inline-popup.is-visible { opacity: 1; transform: translate(-50%, 12px) scale(1); }

.translator-inline-popup__icon {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  margin: 0; padding: 2px;
  border: none; border-radius: 4px;
  background: transparent;
  color: rgba(232, 232, 232, 0.7);
  opacity: 0.85;
  transition: opacity 0.15s ease;
}
.translator-inline-popup__icon svg { width: 100%; height: 100%; display: block; }
.translator-inline-popup__icon--clickable:hover { opacity: 1; }
.translator-inline-popup__icon--ai { color: rgba(232, 232, 232, 0.9); opacity: 1; }

.translator-inline-popup__select { width: 126px; }

.translator-inline-popup__apply {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  margin: 0; padding: 0;
  border: none; border-radius: var(--popup-inner-radius);
  background-color: var(--popup-inner-bg);
  color: var(--popup-text);
}
.translator-inline-popup__apply:disabled { opacity: 0.55; }

.translator-inline-popup__apply-icon {
  display: block; width: 24px; height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e8e8e8'%3E%3Cpath d='M13.3 5.3a1 1 0 0 1 1.4 0l6 6a1 1 0 0 1 0 1.4l-6 6a1 1 0 0 1-1.4-1.4L17.6 13H4a1 1 0 1 1 0-2h13.6l-4.3-4.3a1 1 0 0 1 0-1.4Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ─── LANGUAGES ─────────────────────────────────────────────────────────── */
.langs { padding: 60px 24px 40px; text-align: center; max-width: 1040px; margin: 0 auto; }
.langs__title { font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 18px; }
.langs__cloud { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.langs__chip {
  padding: 8px 14px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 13px; color: var(--ink-2);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.langs__chip:hover { background: var(--ink); color: #fff; }

/* ─── INSTALL CTA ───────────────────────────────────────────────────────── */
.install {
  max-width: 720px; margin: 60px auto 100px; padding: 44px 32px;
  background: var(--bg-soft); border-radius: var(--radius-lg);
  text-align: center; border: 1px solid var(--border);
}
.install__title { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -0.015em; margin: 0 0 24px; }
.install__steps {
  list-style: none; padding: 0; margin: 0 auto 28px;
  display: grid; gap: 12px; text-align: left;
  counter-reset: step; max-width: 480px;
}
.install__steps li {
  position: relative;
  padding: 12px 16px 12px 46px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; counter-increment: step;
}
.install__steps li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px;
  background: var(--ink); color: #fff; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.install__steps code {
  background: var(--bg-soft); padding: 1px 6px; border-radius: 4px;
  font-size: 12px; font-family: 'Google Sans Mono', ui-monospace, monospace;
}

/* ─── FOOTER ────────────────────────────────────────────────────────────── */
.foot { padding: 28px 24px 44px; text-align: center; border-top: 1px solid var(--border); }
.foot__row { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-size: 13px; color: var(--muted); }
.foot__row a { text-decoration: none; }
.foot__row a:hover { color: var(--ink); }
.foot__sep { color: var(--muted-2); }

/* ─── MOBILE ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 48px 20px 32px; }
  .demo { margin: 36px auto 24px; padding: 0 16px; min-height: 460px; }
  .demo__source-body { padding: 24px 20px 86px; font-size: 16px; line-height: 1.55; }
  .demo__source-chrome { padding: 10px 12px; }
  .demo__source-url { font-size: 10px; }

  /* Попап на мобильных: прячем второстепенные кнопки, чтобы header не
     переполнялся. Порядок важности совпадает с расширением. */
  .translator-popup-shell { width: calc(100% - 32px); }
  .translator-report-button { display: none; }
  .translator-ai-status__tokens { display: none; }
  .translator-select-wrap { width: 110px; }

  .features { margin: 48px auto; }
  .feature-card { padding: 20px; }

  .input-demo { margin: 48px auto; padding: 0 16px; }
  .editor__body { padding: 18px; min-height: 120px; font-size: 14px; }
  .translator-inline-popup__select { width: 120px; }

  .install { padding: 32px 20px; margin: 40px auto 60px; }
}

@media (max-width: 420px) {
  .hero__title { font-size: 38px; }
  .translator-popup-history,
  .translator-font-size,
  .translator-pin { display: none; }
  .translator-source-lang { padding: 5px 8px; font-size: 12px; }
  .translator-select-wrap { width: 95px; }
  .translator-select-trigger { font-size: 12px; padding: 5px 26px 5px 8px; }
}

/* ─── REDUCED MOTION ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
