/* =========================================================
   ГЕНЕРАТОР ГРАДИЕНТА CSS (/tools/css-gradient-generator)
   Палитра и переменные — из style.css.

   Принципы интерфейса:
   — одна белая карточка, внутри нет рамок вокруг групп: разделяют
     воздух и заголовки, а не линии;
   — три вида кнопок: главная (зелёная, одна на экран), обычная
     (светло-серая заливка без обводки) и прозрачная для второстепенных;
   — обводка только у полей ввода: серая, при фокусе зелёная;
   — зелёный цвет — только главное действие и фокус.
   Раскладка переключается контейнерными запросами: с 1024px у сайта
   фиксированный сайдбар 332px, ширина окна ≠ ширине инструмента.
   ========================================================= */

[hidden] { display: none !important; }

.gg-tool {
  --gg-line: #E2E6EA;       /* обводка полей */
  --gg-line-hover: #C8CED5;
  --gg-fill: #F2F4F6;       /* заливка кнопок и дорожек внутри белой карточки */
  --gg-fill-hover: #E7EAEE;
  --gg-soft: #F7F8FA;       /* подложка кода и выбранной строки */
  --gg-danger: #D14343;
  margin: 0 0 8px;
  padding: 28px;
  background: var(--color-surface);
  border: 1px solid rgba(25, 27, 30, 0.06);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.04);
  container: ggtool / inline-size;
}
.gg-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.gg-col { display: flex; flex-direction: column; gap: 28px; min-width: 0; }

/* ---------- Типографика ---------- */
.gg-title { margin: 0; font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--color-text-strong); }
.gg-title label { cursor: default; }
.gg-hint { margin: 0; font-size: 13px; line-height: 1.5; color: var(--color-muted); }
.gg-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gg-field > label { font-size: 13px; font-weight: 500; color: var(--color-muted); }
.gg-field--grow { flex: 1 1 auto; }

.gg-block { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.gg-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.gg-block-actions { display: flex; align-items: center; gap: 4px; }

/* ---------- Кнопки ---------- */
.gg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--gg-fill);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text-strong);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.gg-btn i { display: inline-flex; font-size: 16px; }
.gg-btn:hover { background: var(--gg-fill-hover); }
.gg-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--gg-fill); }
.gg-btn--ghost { background: transparent; color: var(--color-text); }
.gg-btn--ghost:hover { background: var(--gg-fill); color: var(--color-text-strong); }
.gg-btn--ghost:disabled { background: transparent; }
.gg-btn--primary { background: var(--color-accent); color: #06231A; }
.gg-btn--primary:hover { background: var(--color-accent-dark); color: #fff; }
.gg-btn--sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
.gg-btn--sm i { font-size: 15px; }
.gg-btn--icon { width: 40px; padding: 0; }
.gg-btn--sm.gg-btn--icon { width: 34px; }
.gg-btn.is-done { background: #E3F7EC; color: var(--color-accent-dark); }
.gg-btn--primary.is-done { background: var(--color-accent-dark); color: #fff; }
.gg-btn.is-busy { cursor: progress; opacity: 1; }
.gg-btn.is-busy i { animation: gg-spin 0.9s linear infinite; }
@keyframes gg-spin { to { transform: rotate(360deg); } }

/* Сегментный переключатель */
.gg-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--gg-fill); border-radius: 12px; }
.gg-seg--full { display: flex; }
.gg-seg-btn {
  flex: 1 1 0;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--color-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}
.gg-seg-btn:hover { color: var(--color-text-strong); }
.gg-seg-btn.is-active { background: var(--color-surface); font-weight: 600; color: var(--color-text-strong); box-shadow: 0 1px 2px rgba(16, 20, 24, 0.08), 0 0 0 0.5px rgba(16, 20, 24, 0.06); }

/* ---------- Поля ---------- */
.gg-input, .gg-select {
  height: 40px;
  padding: 0 12px;
  background: var(--color-surface);
  border: 1px solid var(--gg-line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text-strong);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.gg-input:hover, .gg-select:hover { border-color: var(--gg-line-hover); }
.gg-input:focus, .gg-select:focus-visible { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(29, 217, 122, 0.16); }
.gg-input.is-invalid { border-color: var(--gg-danger); box-shadow: 0 0 0 3px rgba(209, 67, 67, 0.12); }
.gg-input::placeholder { color: #A3AEB4; }
.gg-input--mono, .gg-input--hex { font-family: var(--font-mono); font-size: 13px; }
.gg-input--num { width: 76px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.gg-input--num::-webkit-inner-spin-button, .gg-input--num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gg-select {
  --select-pad: 12px;
  width: 100%;
  background-color: var(--color-surface);
  cursor: pointer;
}
.gg-select--sm { --select-pad: 10px; width: auto; height: 34px; font-size: 13.5px; }
/* Ширина — по самому длинному пункту. Настраиваемый селект (style.css)
   без явной ширины подстраивается под выбранный пункт и «прыгает»
   при каждом выборе; обычный селект сам брал ширину самого длинного. */
#ggSteps { width: 59px; }
#ggDur { width: 110px; }
/* Единица измерения внутри поля: «135 °», «50 %» */
.gg-affix { position: relative; display: inline-flex; align-self: flex-start; }
.gg-affix .gg-input { padding-right: 26px; }
.gg-affix > span { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); font-size: 14px; color: var(--color-muted); pointer-events: none; }
.gg-pair { display: inline-flex; align-items: center; gap: 8px; }
.gg-times { color: var(--color-muted); }
.gg-color-field { position: relative; display: block; width: 76px; height: 40px; border: 1px solid var(--gg-line); border-radius: 10px; overflow: hidden; }
.gg-color-field:hover { border-color: var(--gg-line-hover); }
.gg-color-field:focus-within { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(29, 217, 122, 0.16); }
.gg-color-field input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); padding: 0; border: 0; cursor: pointer; }

.gg-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.gg-row-set { display: flex; align-items: center; gap: 16px; }
.gg-row-set .gg-hint { flex: 1 1 140px; }
.gg-mode-opts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.gg-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gg-line .gg-select, .gg-line .gg-input:not(.gg-input--num) { flex: 1 1 200px; width: auto; min-width: 0; }

.gg-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; min-height: 34px; }
.gg-check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--color-text-strong); cursor: pointer; }
.gg-check input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--color-accent-dark); cursor: pointer; }
.gg-inline { display: inline-flex; }

.gg-btn:focus-visible, .gg-seg-btn:focus-visible, .gg-pos-btn:focus-visible, .gg-preset:focus-visible, .gg-shade:focus-visible, .gg-stop-del:focus-visible, .gg-code:focus-visible, .gg-dial:focus-visible, .gg-handle:focus-visible {
  outline: 2px solid var(--color-accent-dark); outline-offset: 2px;
}

/* ---------- Превью ---------- */
.gg-stage { display: flex; flex-direction: column; gap: 14px; }
.gg-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px;
  background: repeating-conic-gradient(#EDEFF2 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
  container: ggprev / inline-size;
}
/* Тонкая внутренняя кромка поверх градиента — светлые градиенты не растворяются в белой карточке */
.gg-preview::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(16, 20, 24, 0.06); pointer-events: none; z-index: 2; }
.gg-preview.is-pickable { cursor: crosshair; touch-action: none; }
.gg-preview:has(.gg-sample--text), .gg-preview:has(.gg-sample--border) { background: var(--gg-soft); }
.gg-preview.is-dark { background: #191B1E; }
.gg-sample--background { position: absolute; inset: 0; }
.gg-sample--text {
  max-width: 90%;
  padding: 0.08em 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: clamp(36px, 15cqi, 88px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-align: center;
  overflow-wrap: anywhere;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gg-sample--border {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60%;
  height: 50%;
  border-style: solid;
  border-color: transparent;
  font-family: var(--font-display);
  font-size: clamp(16px, 5cqi, 22px);
  font-weight: 700;
  color: var(--color-text-strong);
  text-align: center;
}
.gg-sample.is-anim { animation: gg-shift 8s ease infinite; }
@keyframes gg-shift { 0%, 100% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } }
/* Превью анимируется и при «уменьшении движения» в системе: анимацию включил сам
   пользователь галочкой и может её выключить. В готовом коде для посетителей
   сайта prefers-reduced-motion учитывается */
.gg-center {
  position: absolute;
  z-index: 3;
  width: 20px;
  height: 20px;
  /* Маркер не уходит за край превью, даже когда центр на самой границе */
  left: clamp(12px, var(--x, 50%), calc(100% - 12px));
  top: clamp(12px, var(--y, 50%), calc(100% - 12px));
  margin: -10px 0 0 -10px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(16, 20, 24, 0.2), 0 2px 6px rgba(16, 20, 24, 0.25);
  pointer-events: none;
}
.gg-stage-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.gg-stage-actions { display: flex; gap: 2px; }

/* ---------- Код ---------- */
.gg-code-box { background: var(--gg-soft); border-radius: 18px; }
.gg-code {
  margin: 0;
  padding: 20px 22px 6px;
  max-height: 320px;
  overflow: auto;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--color-text-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 18px 18px 0 0;
}
.gg-code-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px 16px; }
.gg-code-bar .gg-btn:not(.gg-btn--primary) { background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--gg-line); }
.gg-code-bar .gg-btn:not(.gg-btn--primary):hover { box-shadow: inset 0 0 0 1px var(--gg-line-hover); }
.gg-code-bar .gg-btn.is-done:not(.gg-btn--primary) { background: #E3F7EC; box-shadow: none; }

/* ---------- Угол: круговой регулятор ---------- */
.gg-dial {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gg-fill);
  cursor: grab;
  touch-action: none;
  transition: background-color var(--transition-fast);
}
.gg-dial:hover { background: var(--gg-fill-hover); }
.gg-dial.is-drag { cursor: grabbing; }
.gg-dial::before { content: ""; position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--color-text-strong); }
.gg-dial-hand { position: absolute; inset: 0; transform: rotate(var(--deg, 0deg)); transition: transform 60ms linear; }
.gg-dial-hand::before { content: ""; position: absolute; left: 50%; top: 10px; bottom: 50%; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--color-text-strong); }
.gg-dial-hand::after { content: ""; position: absolute; left: 50%; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--color-text-strong); box-shadow: 0 0 0 2px #fff; }

/* ---------- Центр: 9 точек ---------- */
.gg-pos-grid { display: grid; grid-template-columns: repeat(3, 32px); gap: 2px; flex-shrink: 0; padding: 4px; background: var(--gg-fill); border-radius: 12px; }
.gg-pos-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.gg-pos-btn::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #B4BCC4; transition: transform var(--transition-fast), background-color var(--transition-fast); }
.gg-pos-btn:hover::after { background: var(--color-text-strong); }
.gg-pos-btn.is-active { background: var(--color-surface); box-shadow: 0 1px 2px rgba(16, 20, 24, 0.1); }
.gg-pos-btn.is-active::after { background: var(--color-text-strong); transform: scale(1.35); }

/* ---------- Полоса цветов ---------- */
.gg-bar {
  position: relative;
  height: 32px;
  border-radius: 10px;
  background-size: 100% 100%, 12px 12px;
  box-shadow: inset 0 0 0 1px rgba(16, 20, 24, 0.08);
  cursor: copy;
  touch-action: none;
}
.gg-handle {
  position: absolute;
  top: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(var(--c), var(--c)), repeating-conic-gradient(#D5D9DE 0% 25%, #fff 0% 50%) 0 0 / 8px 8px;
  box-shadow: 0 0 0 1px rgba(16, 20, 24, 0.16), 0 2px 5px rgba(16, 20, 24, 0.22);
  cursor: grab;
  touch-action: none;
  transition: box-shadow var(--transition-fast);
}
.gg-handle::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; } /* зона захвата для пальца */
.gg-handle.is-selected { z-index: 2; box-shadow: 0 0 0 2px var(--color-text-strong), 0 2px 6px rgba(16, 20, 24, 0.28); }
.gg-handle.is-drag { cursor: grabbing; }

/* ---------- Список точек ---------- */
.gg-stops { display: flex; flex-direction: column; gap: 2px; }
.gg-stop, .gg-stops-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) 84px 76px 28px; align-items: center; gap: 8px; }
.gg-stop { padding: 3px 0; }
.gg-stops-head { margin-bottom: -6px; font-size: 12.5px; font-weight: 500; color: var(--color-muted); white-space: nowrap; }
.gg-stop .gg-input { height: 36px; }
.gg-stop .gg-input--num { width: 100%; }
.gg-long { display: none; } /* короткие подписи колонок везде: длинные не влезают при ширине колонки 370px */
.gg-swatch { position: relative; width: 36px; height: 36px; border-radius: 10px; overflow: hidden; cursor: pointer; background: repeating-conic-gradient(#D5D9DE 0% 25%, #fff 0% 50%) 0 0 / 10px 10px; }
.gg-swatch span { position: absolute; inset: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(16, 20, 24, 0.1); border-radius: inherit; }
.gg-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.gg-swatch:focus-within { outline: 2px solid var(--color-accent-dark); outline-offset: 2px; }
/* Выбранная точка — кольцо вокруг образца цвета, как у ручки на полосе */
.gg-stop.is-selected .gg-swatch { overflow: visible; }
.gg-stop.is-selected .gg-swatch::after { content: ""; position: absolute; inset: -4px; border: 2px solid var(--color-text-strong); border-radius: 13px; pointer-events: none; }
.gg-stop-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 18px;
  color: #9AA6AD;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}
.gg-stop-del:hover { background: var(--gg-fill); color: var(--gg-danger); }
.gg-stop-del:disabled { visibility: hidden; }

/* ---------- Оттенки: одна полоса ---------- */
.gg-shades { position: relative; display: flex; gap: 0; }
/* Кромка вокруг всей полосы: светлые оттенки не теряются на белом */
.gg-shades::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 44px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(16, 20, 24, 0.07); pointer-events: none; }
.gg-shade { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer; }
.gg-shade-color { height: 44px; background: linear-gradient(var(--c), var(--c)), repeating-conic-gradient(#D5D9DE 0% 25%, #fff 0% 50%) 0 0 / 8px 8px; transition: transform var(--transition-fast); }
.gg-shade:first-child .gg-shade-color { border-radius: 12px 0 0 12px; }
.gg-shade:last-child .gg-shade-color { border-radius: 0 12px 12px 0; }
.gg-shade:hover .gg-shade-color { transform: translateY(-3px); }
.gg-shade-code { font-family: var(--font-mono); font-size: 11px; line-height: 1.2; color: var(--color-muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--transition-fast); }
.gg-shade:hover .gg-shade-code { color: var(--color-text-strong); }
.gg-shade.is-done .gg-shade-code { color: var(--color-accent-dark); }
/* Коды видны, пока им хватает места; иначе — подсказка при наведении */
.gg-shades[data-n="10"] .gg-shade-code { display: none; }

/* ---------- Готовые градиенты ---------- */
.gg-presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px 12px; } /* 12 образцов: 6 или 4 в ряд, без «хвостов» */
.gg-preset { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.gg-preset-swatch { display: block; aspect-ratio: 4 / 3; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(16, 20, 24, 0.06); transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.gg-preset-name { font-size: 13px; font-weight: 500; color: var(--color-muted); transition: color var(--transition-fast); }
.gg-preset:hover .gg-preset-swatch { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(16, 20, 24, 0.06), 0 6px 14px -8px rgba(16, 20, 24, 0.35); }
.gg-preset:hover .gg-preset-name { color: var(--color-text-strong); }

/* ---------- Уведомление: всплывает внизу экрана, видно откуда угодно ---------- */
.gg-msg {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: max-content;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: #191B1E;
  box-shadow: 0 10px 30px -10px rgba(16, 20, 24, 0.45);
  font-size: 14px;
  line-height: 1.5;
  color: #fff;
  transform: translateX(-50%);
  animation: gg-toast 180ms ease-out;
}
.gg-msg i { display: inline-flex; margin-top: 2px; font-size: 16px; color: var(--color-accent); flex-shrink: 0; }
.gg-msg--error i { color: #FF8F8F; }
@keyframes gg-toast { from { opacity: 0; transform: translate(-50%, 8px); } }
/* С 1024px слева сайдбар — центрируем по области контента, а не по окну */
@media (min-width: 1024px) { .gg-msg { left: calc(50% + var(--sidebar-width, 332px) / 2); } }

/* ---------- Адаптив по ширине инструмента ----------
   На узком экране колонки «растворяются» (display: contents),
   и блоки встают в порядке работы: превью → тип → цвета → код → остальное */
@container ggtool (max-width: 960px) and (min-width: 721px) {
  .gg-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container ggtool (max-width: 720px) {
  .gg-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .gg-col { display: contents; }
  .gg-stage { order: 1; }
  .gg-block--type { order: 2; }
  .gg-block--stops { order: 3; }
  .gg-code-box { order: 4; }
  .gg-col--side > .gg-block:not(.gg-block--type):not(.gg-block--stops) { order: 5; }
  .gg-block--presets { order: 6; }
  .gg-preview { aspect-ratio: 16 / 10; }
}
@container ggtool (max-width: 460px) {
  .gg-preview { aspect-ratio: 4 / 3; }
  .gg-stage-bar .gg-seg { flex: 1 1 100%; }
  .gg-stage-actions { flex: 1 1 100%; }
  .gg-stage-actions #ggRandom { flex: 1 1 auto; background: var(--gg-fill); }
  .gg-stage-actions #ggReset { background: var(--gg-fill); }
  .gg-code-bar .gg-btn:not(.gg-btn--icon) { flex: 1 1 0; padding: 0 10px; }
  .gg-code-bar #ggCopy { flex-basis: 100%; }
  .gg-stop, .gg-stops-head { grid-template-columns: 36px minmax(0, 1fr) 72px 66px 28px; gap: 6px; }
  .gg-stops-head { font-size: 11.5px; }
  .gg-stop-del { width: 28px; }
  .gg-row-set { flex-wrap: wrap; }
  .gg-row-set .gg-hint { flex-basis: 100%; }
  .gg-shades[data-n="7"] .gg-shade-code { display: none; }
  .gg-seg-btn { padding: 0 8px; }
  .gg-presets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 10px; }
  .gg-preset-name { font-size: 12px; }
  .gg-line .gg-btn { flex: 1 1 100%; }
}
@media (max-width: 480px) { .gg-tool { padding: 18px 16px 20px; border-radius: 20px; } }
@supports not (container-type: inline-size) {
  @media (max-width: 1180px) { .gg-layout { grid-template-columns: minmax(0, 1fr); } }
}

/* =========================================================
   SEO-БЛОКИ — белые панели со строками, как на остальных
   доработанных страницах
   ========================================================= */
.gg-seo { container-type: inline-size; container-name: ggseo; }
.gg-seo-panel {
  padding: 8px 32px;
  background: var(--color-surface);
  border: 1px solid rgba(43, 47, 51, 0.07);
  border-radius: var(--radius-lg);
}
.gg-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid rgba(43, 47, 51, 0.08);
}
.gg-row:first-child { border-top: none; }
.gg-row-mark { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.5; letter-spacing: -0.01em; color: var(--color-accent-dark); }
.gg-row h3 { font-size: 17px; line-height: 1.35; margin: 0 0 8px; color: var(--color-text-strong); }
.gg-row p { font-size: 14.5px; line-height: 1.75; color: var(--color-muted); margin: 0 0 10px; }
.gg-row p:last-child { margin-bottom: 0; }
.gg-row strong { color: var(--color-text-strong); font-weight: 600; }

/* Примеры кода с мини-превью */
.gg-example { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 12px; }
.gg-example-demo { height: 64px; border-radius: 10px; }
.gg-example pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #F7F8FA;
  border: 1px solid rgba(43, 47, 51, 0.08);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--color-text-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@container ggseo (max-width: 700px) {
  .gg-seo-panel { padding: 4px 20px; }
  .gg-row { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
}
@container ggseo (max-width: 460px) {
  .gg-example { grid-template-columns: 1fr; gap: 8px; }
  .gg-example-demo { height: 48px; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 952px) { .gg-row { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; } }
  @media (max-width: 1180px) { .gg-layout { grid-template-columns: minmax(0, 1fr); } .gg-view { position: static; } }
}
