/* ==========================================================================
   ASTRUM — Minecraft RGB & MiniMessage Generator
   Фирменный визуальный стиль ASTRUM (как Гардероб / cartoon-polish)
   ========================================================================== */

/* 1. ПОДКЛЮЧЕНИЕ ШРИФТОВ */
@font-face {
  font-family: Onest;
  src: url(fonts/onest.woff2) format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Rubik;
  src: url(fonts/rubik.woff2) format('woff2');
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

/* Настоящий Minecraft шрифт с поддержкой кириллицы (русских букв) */
@font-face {
  font-family: 'Minecraft';
  src: url(fonts/MinecraftDefault-Regular.woff2) format('woff2'),
       url(fonts/MinecraftDefault-Regular.ttf) format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Minecraft';
  src: url(fonts/MinecraftDefault-Bold.woff2) format('woff2'),
       url(fonts/MinecraftDefault-Bold.ttf) format('truetype');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* 2. ДИЗАЙН-ТОКЕНЫ: СВЕТЛАЯ ТЕМА ASTRUM */
:root {
  color-scheme: light;
  --bg: #fff7fd;
  --surface: #ffffff;
  --panel: #ffffff;
  --card-bg: #ffffff;
  --input-bg: #fff7fd;
  --ink: #2b1c31;
  --muted: #78667d;
  --line: #2b1c311a;
  --soft: #2b1c310a;
  --soft-hover: #2b1c3114;
  --coral: #b91b9f;
  --coral-d: #8b117a;
  --gold: #9253d4;
  --rose: #ef91d7;
  --sky: #9b62e0;
  --leaf: #ba50b2;
  --shadow: 0 18px 50px -18px rgba(55, 24, 62, 0.28);
  --shadow-sm: 0 4px 14px rgba(55, 24, 62, 0.08);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --mc-font: 'Minecraft', monospace;
  --mc-box-bg: #150f19;
  --mc-box-ink: #f8f1f8;
}

/* 3. ДИЗАЙН-ТОКЕНЫ: ТЁМНАЯ ТЕМА ASTRUM */
html[data-sky="night"] {
  color-scheme: dark;
  --bg: #010101;
  --surface: #121212;
  --panel: #121212;
  --card-bg: #121212;
  --input-bg: #080808;
  --ink: #f8f1f8;
  --muted: #ababab;
  --line: #ffffff1c;
  --soft: #ffffff0d;
  --soft-hover: #ffffff18;
  --coral: #f071db;
  --coral-d: #f8a1e9;
  --gold: #bd96f3;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --mc-box-bg: #000000;
  --mc-box-ink: #f8f1f8;
}

/* 4. БАЗОВЫЕ СТИЛИ СТРАНИЦЫ */
* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  background: var(--bg) !important;
  color: var(--ink);
}

body {
  font-family: Onest, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg) !important;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, .brand {
  font-family: Rubik, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}

.rgb-page {
  flex: 1 0 auto;
  padding: 110px 0 60px;
  position: relative;
  z-index: 2;
}

/* 5. ШАПКА СТРАНИЦЫ (КАК В ГАРДЕРОБЕ) */
.rgb-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 36px;
}

.rgb-head .kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--coral);
  background: color-mix(in srgb, var(--coral) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--coral) 25%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.rgb-head h1 {
  font-size: clamp(34px, 4.5vw, 54px);
  margin-bottom: 12px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}

.rgb-head h1 span {
  background: linear-gradient(135deg, var(--coral) 0%, var(--gold) 50%, var(--sky) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rgb-head p {
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.6;
}

/* 6. ГЛАВНАЯ КАРТОЧКА ГЕНЕРАТОРА */
.rgb-app-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 7. ТОПОВАЯ СЕКЦИЯ: INPUT TEXT + TOOLBAR */
.rgb-input-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.rgb-input-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rgb-prompt-symbol {
  font-family: monospace;
  font-size: 18px;
  font-weight: 800;
  color: var(--coral);
}

.rgb-input-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.rgb-input-hint {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
}

/* Тулбар стилей и шрифтов */
.rgb-formatting-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--surface) 90%, var(--bg));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 4px 6px;
}

/* Выпадающие меню в стиле .ip-drop с главной страницы */
.ip-drop {
  position: relative;
  display: inline-block;
}

.ip-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  user-select: none;
}

.ip-drop-btn:hover {
  border-color: var(--coral);
  background: color-mix(in srgb, var(--coral) 8%, var(--surface));
}

.ip-drop-btn[aria-expanded="true"] {
  border-color: var(--coral);
}

.ip-drop-btn[aria-expanded="true"] .ip-drop-caret {
  transform: rotate(180deg);
}

.ip-drop-caret {
  transition: transform .2s ease;
  display: inline-block;
  font-size: 11px;
  color: var(--coral);
}

.ip-drop-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 250px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px -10px rgba(30,14,40,0.28);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#rgb-font-drop .ip-drop-menu {
  left: 0;
  right: auto;
  min-width: 290px;
  max-height: 380px;
}

#rgb-format-drop .ip-drop-menu {
  right: 0;
  left: auto;
}

html[data-sky="night"] .ip-drop-menu {
  box-shadow: 0 20px 48px -8px rgba(0,0,0,0.72);
}

.ip-drop-menu[hidden] {
  display: none !important;
}

.ip-drop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.ip-drop-item span {
  font-size: 12px;
  font-weight: 600;
  color: var(--coral);
}

.ip-drop-item:hover, .ip-drop-item.active {
  background: color-mix(in srgb, var(--coral) 11%, var(--surface));
  color: var(--coral);
}

/* Кнопки стилей B, I, U, S, Magic, Reset */
.rgb-style-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  user-select: none;
}

.rgb-style-btn:hover {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral);
}

.rgb-style-btn.active {
  background: var(--coral);
  color: #ffffff;
  border-color: var(--coral);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--coral) 40%, transparent);
}

.rgb-bar-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 2px;
}

/* 8. ИНТЕРАКТИВНОЕ ОКНО РЕДАКТИРОВАНИЯ И ПРЕДПРОСМОТРА (WYSIWYG) */
.rgb-editor-box {
  position: relative;
  min-height: 104px;
  border-radius: 20px;
  background: var(--mc-box-bg);
  border: 1.5px solid var(--line);
  padding: 20px 100px 20px 24px;
  display: block;
  overflow: hidden;
  box-sizing: border-box;
  cursor: text;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.rgb-editor-box:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 25%, transparent), inset 0 2px 10px rgba(0, 0, 0, 0.4);
}

.rgb-editor-display {
  font-family: var(--mc-font);
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.45;
  letter-spacing: 0;
  font-kerning: none;
  font-feature-settings: "kern" 0;
  text-indent: 0;
  tab-size: 4;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  pointer-events: none;
  user-select: none;
  width: 100%;
  min-height: 52px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

.rgb-char-span {
  display: inline;
  text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.95);
  letter-spacing: 0;
}

.rgb-char-span.is-bold { font-weight: bold; }
.rgb-char-span.is-italic { font-style: italic; }
.rgb-char-span.is-underline { text-decoration: underline; }
.rgb-char-span.is-strikethrough { text-decoration: line-through; }
.rgb-char-span.is-underline.is-strikethrough { text-decoration: underline line-through; }

.rgb-editor-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 20px 100px 20px 24px;
  box-sizing: border-box;
  font-family: var(--mc-font);
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.45;
  letter-spacing: 0;
  font-kerning: none;
  font-feature-settings: "kern" 0;
  text-indent: 0;
  tab-size: 4;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--coral);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  margin: 0;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

.rgb-editor-box.is-bold .rgb-editor-input,
.rgb-editor-input.is-bold {
  font-weight: bold;
}

.rgb-editor-box.is-italic .rgb-editor-input,
.rgb-editor-input.is-italic {
  font-style: italic;
}

.rgb-editor-input::selection {
  background: color-mix(in srgb, var(--coral) 35%, transparent);
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.rgb-editor-box.raw-mode .rgb-editor-display {
  opacity: 0.15;
}

.rgb-editor-box.raw-mode .rgb-editor-input {
  color: var(--mc-box-ink);
  -webkit-text-fill-color: var(--mc-box-ink);
}

.rgb-editor-corner-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

.rgb-corner-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.rgb-corner-btn:hover {
  background: var(--surface);
  color: var(--coral);
  border-color: var(--coral);
  transform: translateY(-1px);
}

.rgb-corner-btn.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}

.rgb-corner-btn svg {
  width: 16px;
  height: 16px;
}

.rgb-preview-dropdown-wrap {
  position: relative;
}

.rgb-preview-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
  z-index: 50;
}

.rgb-preview-menu button {
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.rgb-preview-menu button:hover {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral);
}

.rgb-preview-menu button.active {
  background: var(--coral);
  color: #fff;
}

.rgb-editor-box.mode-sign {
  background: #c4995c;
  border: 6px solid #7c5225;
}

.rgb-editor-box.mode-sign .rgb-char-span {
  text-shadow: none;
  color: #211508 !important;
}

.rgb-editor-box.mode-tooltip {
  background: #100010;
  border: 3px solid #28004f;
  outline: 2px solid #5200a4;
}

.rgb-editor-box.mode-bossbar {
  background: #090510;
}

/* 9. ГОРИЗОНТАЛЬНЫЙ СЛАЙДЕР ГРАДИЕНТА С ТОЧКАМИ */
.rgb-slider-wrapper {
  position: relative;
  padding: 8px 10px;
  margin: 6px 0 10px;
}

.rgb-slider-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.rgb-slider-stop-handle {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.rgb-slider-stop-handle:hover,
.rgb-slider-stop-handle.active {
  transform: translate(-50%, -50%) scale(1.25);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 35%, transparent), 0 3px 10px rgba(0, 0, 0, 0.6);
}

.rgb-slider-stop-handle.is-dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--coral) 45%, transparent), 0 4px 14px rgba(0, 0, 0, 0.7);
  z-index: 10;
  transition: none;
}

/* 10. СЕТКА ИЗ 3 КОЛОНОК */
.rgb-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 960px) {
  .rgb-grid-3 {
    grid-template-columns: 1fr;
  }
}

.rgb-card {
  position: relative;
  background: color-mix(in srgb, var(--surface) 65%, var(--bg));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0;
  max-width: 100%;
}

.rgb-card:hover {
  border-color: color-mix(in srgb, var(--coral) 30%, var(--line));
}

.rgb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rgb-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.rgb-card-title .icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.rgb-card-title .icon-wrap svg {
  width: 18px;
  height: 18px;
}

/* Счетчик количества цветов [-] [ 4 ] [+] */
.rgb-counter-group {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 4px;
}

.rgb-counter-btn {
  background: transparent;
  border: none;
  color: var(--ink);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  transition: background 0.15s ease, color 0.15s ease;
}

.rgb-counter-btn:hover {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral);
}

.rgb-counter-val {
  padding: 0 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  min-width: 24px;
  text-align: center;
}

/* Тулбар панели цветов */
.rgb-colors-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rgb-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.rgb-mini-btn:hover {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  border-color: var(--coral);
  color: var(--coral);
  transform: translateY(-1px);
}

.rgb-mini-btn svg {
  width: 16px;
  height: 16px;
}

/* СПИСОК ЦВЕТОВ 1 В 1 (КАК НА SAKEVA.NET И СКРИНШОТЕ) */
.rgb-colors-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.rgb-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  position: relative;
  will-change: transform;
}

.rgb-color-row.is-dragging {
  z-index: 100 !important;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.rgb-color-num {
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  width: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Кнопка с 6 точками для перетаскивания (Grip vertical) */
.rgb-color-grip {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  padding: 0;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.15s var(--ease), border-color 0.15s, color 0.15s;
}

.rgb-color-grip:hover {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral);
  border-color: var(--coral);
}

.rgb-color-grip:active,
body.is-reordering-colors .rgb-color-grip {
  cursor: grabbing;
}

body.is-reordering-colors {
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing;
}

.rgb-color-grip svg {
  width: 16px;
  height: 16px;
}

/* Цветная плашка-капсула (Pill) */
.rgb-color-pill {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  position: relative;
  min-width: 0;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.rgb-color-pill:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.rgb-pill-hex-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: inherit;
  outline: none;
  padding: 0;
  margin: 0;
  cursor: text;
}

.rgb-pill-palette-btn {
  background: transparent;
  border: none;
  color: inherit;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 0.9;
}

.rgb-pill-palette-btn:hover {
  transform: scale(1.15);
  opacity: 1;
}

.rgb-pill-palette-btn svg {
  width: 18px;
  height: 18px;
}

/* Кнопка удаления (Trash) */
.rgb-color-del-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.15s var(--ease);
}

.rgb-color-del-btn:hover:not(:disabled) {
  background: color-mix(in srgb, #ef4444 15%, var(--surface));
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.rgb-color-del-btn:disabled {
  opacity: 0.22;
  cursor: not-allowed;
  pointer-events: none;
}

.rgb-color-del-btn svg {
  width: 16px;
  height: 16px;
}

/* ==============================================================
   КАСТОМНОЕ МЕНЮ ВЫБОРА ЦВЕТА (COLOR PICKER POPOVER 1 В 1 SAKEVA)
   ============================================================== */
.rgb-color-popover {
  position: absolute;
  z-index: 1000;
  width: 286px;
  background: #141720;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 4px 14px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
  animation: popoverFadeIn 0.15s ease-out;
}

.rgb-color-popover[hidden] {
  display: none !important;
}

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

/* 2D поле Saturation / Brightness */
.rgb-picker-sb {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
  background-color: #ff0000;
}

.rgb-picker-sb-white {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #ffffff, transparent);
  pointer-events: none;
}

.rgb-picker-sb-black {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #000000, transparent);
  pointer-events: none;
}

.rgb-picker-sb-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.9), inset 0 0 2px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, -50%);
  pointer-events: none;
  left: 100%;
  top: 0%;
}

/* Средняя строка управления: пипетка, свотч, радужный слайдер */
.rgb-picker-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.rgb-picker-pipette-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #1c202a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.15s ease;
}

.rgb-picker-pipette-btn:hover {
  background: #272d3b;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.rgb-picker-swatch {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  background: #ff6000;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.rgb-picker-hue {
  flex: 1;
  height: 14px;
  border-radius: 7px;
  position: relative;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  background: linear-gradient(
    to right,
    #ff0000 0%,
    #ffff00 17%,
    #00ff00 33%,
    #00ffff 50%,
    #0000ff 67%,
    #ff00ff 83%,
    #ff0000 100%
  );
}

.rgb-picker-hue-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: #ff0000;
}

/* Нижняя сетка полей: HEX, R, G, B */
.rgb-picker-inputs {
  display: grid;
  grid-template-columns: 1.65fr 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
}

.rgb-picker-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rgb-picker-field label {
  font-size: 11px;
  font-weight: 700;
  color: #7f889b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.rgb-picker-field input {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  background: #1c202a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  outline: none;
  padding: 0 2px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rgb-picker-field input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--coral) 30%, transparent);
}

.rgb-picker-field input::-webkit-outer-spin-button,
.rgb-picker-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rgb-picker-field input[type=number] {
  -moz-appearance: textfield;
}

/* 11. КОЛОНКА 2: OUTPUT */
.rgb-output-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rgb-badge-btn {
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s var(--ease);
}

.rgb-badge-btn:hover {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  border-color: var(--coral);
  color: var(--coral);
}

.rgb-badge-btn.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}

/* Поле вывода кода */
.rgb-output-wrap {
  position: relative;
}

.rgb-output-textarea {
  width: 100%;
  min-height: 140px;
  max-height: 220px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--mc-box-bg);
  color: var(--coral);
  font-family: var(--mc-font), monospace;
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
  resize: vertical;
  outline: none;
  word-break: break-all;
  white-space: pre-wrap;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rgb-output-textarea:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 25%, transparent);
}

/* Раскрывающийся блок Decode */
.rgb-expandable-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rgb-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.rgb-details[open] {
  border-color: var(--coral);
}

.rgb-details-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.rgb-details-summary::-webkit-details-marker {
  display: none;
}

.rgb-details-summary svg {
  color: var(--coral);
}

.rgb-arrow-icon {
  margin-left: auto;
  transition: transform 0.2s ease;
  color: var(--muted) !important;
}

.rgb-details[open] .rgb-arrow-icon {
  transform: rotate(180deg);
}

.rgb-details-content {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Стандартные поля ввода с обычным шрифтом сайта Onest (как во всем сайте) */
.rgb-adv-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: Onest, system-ui, -apple-system, sans-serif !important;
  font-size: 14.5px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.rgb-adv-input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 18%, transparent);
}

.rgb-adv-input::placeholder {
  color: var(--muted);
  font-family: Onest, system-ui, -apple-system, sans-serif !important;
  font-size: 14px;
}

/* 12. КОЛОНКА 3: PRESETS (СОХРАНЁННЫЕ ПРЕСЕТЫ В СТИЛЕ ГАРДЕРОБА) */
.rgb-presets-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rgb-presets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 10px 8px 2px;
  scrollbar-gutter: stable;
  min-width: 0;
  width: 100%;
}

.rgb-presets-empty {
  text-align: center;
  padding: 36px 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 40%, transparent);
}

.rgb-presets-empty strong {
  color: var(--coral);
}

.rgb-preset-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s var(--ease), border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.rgb-preset-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--coral) 50%, var(--line));
  box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--coral) 25%, transparent);
}

.rgb-preset-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.rgb-preset-card-preview {
  width: 48px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.rgb-preset-card-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.rgb-preset-card-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  min-width: 0;
  max-width: 100%;
}

.rgb-preset-card-text {
  font-size: 12px;
  color: var(--muted);
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
  font-weight: 500;
  min-width: 0;
  max-width: 100%;
}

.rgb-preset-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.rgb-preset-tag {
  background: color-mix(in srgb, var(--ink) 8%, var(--surface));
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--coral);
  white-space: nowrap;
}

.rgb-preset-tag.font-tag {
  color: var(--sky);
  background: color-mix(in srgb, var(--sky) 14%, var(--surface));
  text-transform: none;
}

.rgb-preset-style-badges {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.rgb-preset-style-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  background: color-mix(in srgb, var(--ink) 10%, var(--surface));
  color: var(--ink);
  line-height: 1;
}

.rgb-preset-style-badge.is-bold { font-weight: 900; }
.rgb-preset-style-badge.is-italic { font-style: italic; }
.rgb-preset-style-badge.is-underline { text-decoration: underline; }
.rgb-preset-style-badge.is-strike { text-decoration: line-through; }
.rgb-preset-style-badge.is-obf { font-family: monospace; }

.rgb-preset-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.rgb-preset-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.rgb-preset-card-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rgb-preset-btn {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.rgb-preset-apply {
  flex: 1;
  text-align: center;
}

.rgb-preset-apply:hover {
  background: var(--coral);
  color: #ffffff;
  border-color: var(--coral);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--coral) 35%, transparent);
}

.rgb-preset-del,
.rgb-preset-copy {
  width: 34px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}

.rgb-preset-copy:hover {
  background: color-mix(in srgb, var(--sky) 14%, var(--surface));
  color: var(--sky);
  border-color: var(--sky);
}

.rgb-preset-del:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.rgb-preset-del svg,
.rgb-preset-copy svg {
  width: 14px;
  height: 14px;
}

/* Кнопки Copy и Get Url */
.rgb-output-actions,
.rgb-presets-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .rgb-output-actions,
  .rgb-presets-actions {
    grid-template-columns: 1fr;
  }
}

.rgb-action-pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  font-family: Rubik, sans-serif;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.rgb-action-pill-btn.btn-copy-main {
  background: var(--coral);
  color: #ffffff;
  border: none;
  box-shadow: 0 5px 0 var(--coral-d), 0 10px 20px -6px color-mix(in srgb, var(--coral) 50%, transparent);
}

.rgb-action-pill-btn.btn-copy-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--coral-d), 0 14px 26px -6px color-mix(in srgb, var(--coral) 60%, transparent);
}

.rgb-action-pill-btn.btn-copy-main:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--coral-d);
}

.rgb-action-pill-btn.btn-url-sub {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--coral) 28%, transparent);
  color: var(--coral);
}

.rgb-action-pill-btn.btn-url-sub:hover {
  background: var(--coral);
  color: #ffffff;
  border-color: var(--coral);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--coral) 30%, transparent);
}

.rgb-action-pill-btn.btn-url-sub:active {
  transform: translateY(1px);
}

.rgb-action-pill-btn svg {
  width: 18px;
  height: 18px;
}

/* 13. СЕКЦИЯ СПРАВКИ / FAQ */
.rgb-faq-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.rgb-faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .rgb-faq-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.rgb-faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rgb-faq-item:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--coral) 30%, var(--line));
}

.rgb-faq-item h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}

.rgb-faq-item p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
}

.rgb-faq-item a {
  color: var(--coral);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.rgb-faq-item a:hover {
  color: var(--coral-d);
  opacity: 0.85;
}

.rgb-faq-item code {
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
  color: var(--coral);
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  word-break: break-all;
  overflow-wrap: break-word;
}

/* 14. ТОСТ-УВЕДОМЛЕНИЕ */
.rgb-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.25s var(--ease), opacity 0.25s ease;
  z-index: 9999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.rgb-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.rgb-toast svg {
  width: 20px;
  height: 20px;
  color: var(--coral);
}

/* ==========================================================================
   15. МОБИЛЬНАЯ АДАПТАЦИЯ (RESPONSIVE ADAPTATION)
   ========================================================================== */

/* Увеличение зоны касания (hitbox) для ползунков градиента на смартфонах */
.rgb-slider-stop-handle::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

@media (max-width: 960px) {
  .rgb-grid-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .rgb-presets-list {
    max-height: 400px;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(1180px, 100% - 24px);
  }

  .rgb-page {
    padding-top: 76px;
    padding-bottom: 36px;
  }

  /* Шапка страницы */
  .rgb-head {
    margin-bottom: 20px;
  }

  .rgb-head .kicker {
    font-size: 10.5px;
    padding: 4px 10px;
    margin-bottom: 8px;
  }

  .rgb-head h1 {
    font-size: clamp(24px, 7vw, 32px);
    margin-bottom: 8px;
  }

  .rgb-head p {
    font-size: 13.5px;
    line-height: 1.5;
  }

  /* Главная карточка */
  .rgb-app-card {
    padding: 16px 14px;
    border-radius: 20px;
    gap: 16px;
  }

  /* Секция заголовка и тулбара */
  .rgb-input-head {
    gap: 8px;
  }

  .rgb-input-title-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .rgb-input-title {
    font-size: 16px;
  }

  .rgb-input-hint {
    font-size: 12px;
  }

  /* Тулбар форматирования: компактный и с плавным горизонтальным скроллом без вылетов */
  .rgb-formatting-bar {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-sizing: border-box;
    padding: 4px 6px;
    border-radius: 12px;
  }

  .rgb-formatting-bar::-webkit-scrollbar {
    display: none;
  }

  .ip-drop-btn {
    padding: 5px 8px;
    font-size: 12px;
    gap: 5px;
    flex-shrink: 0;
  }

  .ip-drop-menu {
    min-width: 0;
    max-width: calc(100vw - 32px);
    width: 270px;
  }

  .rgb-style-btn {
    width: 29px;
    height: 29px;
    font-size: 12.5px;
    border-radius: 7px;
    flex-shrink: 0;
  }

  .rgb-bar-divider {
    height: 16px;
    margin: 0 1px;
    flex-shrink: 0;
  }

  /* Поле ввода: свободная полезная ширина для текста без 100px сжатия */
  .rgb-editor-box {
    padding: 44px 14px 14px 14px;
    min-height: 94px;
    border-radius: 16px;
  }

  .rgb-editor-display {
    font-size: clamp(19px, 5.2vw, 26px);
    min-height: 40px;
    line-height: 1.4;
  }

  .rgb-editor-input {
    padding: 44px 14px 14px 14px;
    font-size: clamp(19px, 5.2vw, 26px);
    line-height: 1.4;
  }

  .rgb-editor-corner-actions {
    top: 8px;
    right: 8px;
    gap: 4px;
  }

  .rgb-corner-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .rgb-corner-btn svg {
    width: 15px;
    height: 15px;
  }

  /* 3 карточки */
  .rgb-card {
    padding: 16px 14px;
    border-radius: 18px;
    gap: 14px;
  }

  .rgb-card-head {
    gap: 8px;
  }

  .rgb-card-title {
    font-size: 15px;
    gap: 8px;
  }

  .rgb-card-title .icon-wrap {
    width: 30px;
    height: 30px;
  }

  .rgb-card-title .icon-wrap svg {
    width: 16px;
    height: 16px;
  }

  .rgb-colors-toolbar {
    gap: 5px;
  }

  .rgb-mini-btn {
    width: 31px;
    height: 31px;
    border-radius: 8px;
  }

  .rgb-mini-btn svg {
    width: 15px;
    height: 15px;
  }

  .rgb-counter {
    height: 31px;
  }

  .rgb-counter-btn {
    width: 25px;
    height: 25px;
    font-size: 13px;
  }

  .rgb-counter-val {
    font-size: 12.5px;
    padding: 0 4px;
    min-width: 18px;
  }

  /* Строки цветов */
  .rgb-color-row {
    gap: 6px;
  }

  .rgb-color-num {
    width: 12px;
    font-size: 12.5px;
  }

  .rgb-color-grip {
    width: 32px;
    height: 34px;
    border-radius: 8px;
  }

  .rgb-color-grip svg {
    width: 15px;
    height: 15px;
  }

  .rgb-color-pill {
    height: 34px;
    border-radius: 8px;
    padding: 0 8px 0 10px;
  }

  .rgb-pill-hex-input {
    font-size: 13px;
    letter-spacing: 0.2px;
  }

  .rgb-pill-palette-btn {
    padding: 3px;
  }

  .rgb-pill-palette-btn svg {
    width: 16px;
    height: 16px;
  }

  .rgb-color-del-btn {
    width: 32px;
    height: 34px;
    border-radius: 8px;
  }

  .rgb-color-del-btn svg {
    width: 15px;
    height: 15px;
  }

  /* Всплывающее меню выбора цвета на мобильных */
  .rgb-color-popover {
    width: min(286px, calc(100% - 16px));
    padding: 12px;
    border-radius: 14px;
    box-sizing: border-box;
  }

  .rgb-picker-sb {
    height: 130px;
  }

  .rgb-picker-fields {
    gap: 4px;
  }

  .rgb-picker-input-wrap input {
    font-size: 12px;
    padding: 6px 4px;
  }

  /* Колонка Вывод (Output) */
  .rgb-output-box {
    min-height: 90px;
    font-size: 12px;
    padding: 12px;
  }

  .rgb-output-actions,
  .rgb-presets-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rgb-action-pill-btn {
    height: 44px;
    font-size: 14px;
  }

  /* Пресеты */
  .rgb-presets-list {
    max-height: 360px;
    padding: 4px 8px 6px 2px;
    scrollbar-gutter: stable;
  }

  .rgb-preset-card {
    padding: 10px 12px;
    gap: 8px;
  }

  .rgb-preset-card-preview {
    width: 42px;
    height: 36px;
    border-radius: 8px;
  }

  .rgb-preset-card-name {
    font-size: 13px;
  }

  .rgb-preset-card-text {
    font-size: 11.5px;
  }

  .rgb-preset-btn {
    height: 32px;
  }

  .rgb-preset-apply {
    font-size: 12px;
    padding: 0 12px;
  }

  /* FAQ */
  .rgb-faq-section {
    margin-top: 24px;
    padding-top: 18px;
  }

  .rgb-faq-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .rgb-faq-item {
    padding: 16px 16px;
    border-radius: 16px;
  }

  .rgb-faq-item h3 {
    font-size: 15.5px;
  }

  .rgb-faq-item p {
    font-size: 13.5px;
  }

  .rgb-faq-item code {
    word-break: break-all;
    overflow-wrap: break-word;
    font-size: 12px;
  }

  /* Тост */
  .rgb-toast {
    bottom: 20px;
    padding: 10px 18px;
    font-size: 13px;
    max-width: calc(100vw - 32px);
    text-align: center;
    box-sizing: border-box;
  }
}
