/* AstraPro — палитра панели.
   Подключается поверх бандла new-api. Светлая тема — в тон главной странице,
   тёмная — своя (графит с синим акцентом бренда). Переключатель темы в панели
   работает: html.light → светлая, html.dark → тёмная. */

:root,
html,
html.light {
  color-scheme: light;

  --background: #ffffff;
  --foreground: #101826;

  --card: #ffffff;
  --card-foreground: #101826;
  --popover: #ffffff;
  --popover-foreground: #101826;

  --primary: #2f6fed;
  --primary-foreground: #ffffff;
  --secondary: #e9f4ee;
  --secondary-foreground: #0b3b2e;

  --muted: #f6fbf8;
  --muted-foreground: #5c6b64;

  --accent: #e4f3ec;
  --accent-foreground: #0b6b4f;

  --destructive: #d92d20;
  --destructive-foreground: #ffffff;
  --success: #0e9f6e;
  --success-foreground: #ffffff;
  --warning: #c07a00;
  --warning-foreground: #ffffff;
  --info: #2f6fed;
  --info-foreground: #ffffff;
  --neutral: #b6c0cd;
  --neutral-foreground: #101826;

  --border: #e2eee8;
  --input: #e2eee8;
  --ring: #2f6fed;

  --chart-1: #3b82f6;
  --chart-2: #6366f1;
  --chart-3: #2f6fed;
  --chart-4: #8b5cf6;
  --chart-5: #0ea5e9;
  --overview-accent-1: #3b82f6;
  --overview-accent-2: #6366f1;
  --overview-accent-3: #2f6fed;

  --sidebar: #fbfefc;
  --sidebar-foreground: #101826;
  --sidebar-primary: #2f6fed;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #e4f3ec;
  --sidebar-accent-foreground: #0b6b4f;
  --sidebar-border: #e2eee8;
  --sidebar-ring: #2f6fed;

  --skeleton-base: #e8f2ec;
  --skeleton-highlight: #f7fcf9;
  --table-row: #ffffff;
  --table-header: #f8fcf9;
  --table-header-hover: #edf7f1;
  --table-disabled: #f8fcf9;
  --table-disabled-hover: #edf7f1;
  --table-disabled-border: #e2eee8;

  /* поля ввода в карточках авторизации */
  --field-bg: #ffffff;
  --field-border: #bfd3c9;
  --field-placeholder: #7d8f87;
  --scroll-thumb: #c3d8ce;
  --scroll-track: #f0f8f4;

  --radius: 0.75rem;

  --font-ui-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: var(--font-ui-sans);
}
/* Фон кабинета: тот же мягкий переход мяты в белый, что на главной
   (radial + linear как в style.css сайта). Лёгкий, чтобы карточки читались. */
html.light body {
  background-color: #ffffff;
  background-image:
    radial-gradient(1100px 540px at 50% -160px, rgba(5, 150, 105, 0.16), rgba(5, 150, 105, 0) 74%),
    linear-gradient(180deg, #e2f1e9 0%, #f2faf6 26%, #ffffff 62%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover, 100% 100%;
}

@media (max-width: 767px) {
  html.light body {
    background-attachment: scroll;
    background-size: 100% 620px, 100% 620px;
  }
}


/* Тёмная тема: графит с синим акцентом бренда. Текст на карточках ≥ 7:1. */
html.dark {
  color-scheme: dark;

  --background: #10151c;
  --foreground: #e8eef7;

  --card: #18202b;
  --card-foreground: #e8eef7;
  --popover: #1b2431;
  --popover-foreground: #e8eef7;

  --primary: #4d86ff;
  --primary-foreground: #08111f;
  --secondary: #222d3b;
  --secondary-foreground: #cfdcee;

  --muted: #1d2733;
  --muted-foreground: #9cabbd;

  --accent: #202c3b;
  --accent-foreground: #dbe7f7;

  --destructive: #ff6b6e;
  --destructive-foreground: #180a0a;
  --success: #2fd08a;
  --success-foreground: #05130d;
  --warning: #ffb020;
  --warning-foreground: #181004;
  --info: #4d9fff;
  --info-foreground: #05101c;
  --neutral: #7f8da1;
  --neutral-foreground: #e8eef7;

  --border: #26313f;
  --input: #2c3846;
  --ring: #4d86ff;

  --chart-1: #6ea8ff;
  --chart-2: #8b8cf7;
  --chart-3: #4d86ff;
  --chart-4: #b18cff;
  --chart-5: #3ec4f2;
  --overview-accent-1: #6ea8ff;
  --overview-accent-2: #8b8cf7;
  --overview-accent-3: #4d86ff;

  --sidebar: #141b24;
  --sidebar-foreground: #dbe6f3;
  --sidebar-primary: #4d86ff;
  --sidebar-primary-foreground: #08111f;
  --sidebar-accent: #22303f;
  --sidebar-accent-foreground: #d8e6f8;
  --sidebar-border: #212c39;
  --sidebar-ring: #4d86ff;

  --skeleton-base: #243040;
  --skeleton-highlight: #2f3d4f;
  --table-row: #18202b;
  --table-header: #1d2733;
  --table-header-hover: #22303f;
  --table-disabled: #161e28;
  --table-disabled-hover: #1c2632;
  --table-disabled-border: #2a3543;

  --field-bg: #18202b;
  --field-border: #33414f;
  --field-placeholder: #7c8b9d;
  --scroll-thumb: #37455a;
  --scroll-track: #141b24;
}

html,
body {
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

/* Типографика крупнее: панель new-api построена на rem, поэтому достаточно
   поднять корневой размер (16px → 17px). Текст, кнопки и отступы растут
   пропорционально — вёрстка не разъезжается. */
html,
html.light,
html.dark {
  font-size: 106.25%;
}

/* Телефон: ещё чуть крупнее для читаемости, но без перебора */
@media (max-width: 640px) {
  html,
  html.light,
  html.dark {
    font-size: 112.5%;
  }
}

/* мягкие тени вместо чёрных «провалов» тёмной темы */
* {
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}


/* ------------------------------------------------------------------
   Кнопки в формах — как на главной: крупные, со скруглением 12px,
   синяя заливка у главного действия. Панель построена на Tailwind,
   поэтому размеры задаём в px с !important: утилиты имеют тот же
   вес каскада, а порядок их подключения нам не принадлежит.
   ------------------------------------------------------------------ */

/* главное действие формы */
form button[type='submit'] {
  min-height: 54px !important;
  height: auto !important;
  padding: 12px 24px !important;
  border-radius: 12px !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  letter-spacing: 0;
  transition: background-color 0.2s, box-shadow 0.2s;
}

form button[type='submit']:not(:disabled):hover {
  background-color: #2558d6 !important;
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.24);
}

/* Карточка входа, регистрации и сброса пароля: все действия — один
   крупный блок, как на главной. Кнопки-иконки (глаз пароля) не трогаем. */
div[class*='sm:w-[480px]'] button:not([class*='absolute']) {
  width: 100% !important;
  min-height: 56px !important;
  height: auto !important;
  padding: 12px 24px !important;
  border-radius: 12px !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

/* главное действие — синяя заливка, как «Получить ключ» на главной */
div[class*='sm:w-[480px]'] button[class*='bg-primary'] {
  color: #ffffff !important;
}

div[class*='sm:w-[480px]'] button[class*='bg-primary']:hover {
  background-color: #2558d6 !important;
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.24);
}

/* Поля ввода в карточках авторизации: рамка заметная, геометрия как у кнопок */
div[class*='sm:w-[480px]'] input:not([type='checkbox']):not([type='radio']):not([type='hidden']) {
  min-height: 44px !important;
  border: 1px solid var(--field-border) !important;
  border-radius: 12px !important;
  background-color: var(--field-bg) !important;
}

div[class*='sm:w-[480px]'] input:not([type='checkbox']):not([type='radio']):not([type='hidden']):focus,
div[class*='sm:w-[480px]'] input:not([type='checkbox']):not([type='radio']):not([type='hidden']):focus-visible {
  border-color: #2f6fed !important;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16) !important;
  outline: none !important;
}

/* поле пароля: место под кнопку «глаз», чтобы текст не заезжал под неё */
div[class*='sm:w-[480px]'] input[type='password'] {
  padding-right: 46px !important;
}

div[class*='sm:w-[480px]'] input::placeholder {
  color: var(--field-placeholder) !important;
}

/* Send code в форме регистрации стоит рядом с полем кода:
   не растягиваем её на всю строку, иначе поле кода схлопывается */
div[class*='sm:w-[480px]'] div[class*='items-end'] > button {
  width: auto !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 0 16px !important;
  font-size: 15px !important;
}

/* второстепенные действия — белая карточка с рамкой, как «Документы» */
div[class*='sm:w-[480px]'] button:not([class*='bg-primary']):not([class*='absolute']) {
  background: var(--field-bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--foreground) !important;
}

/* На узких экранах главное действие формы всегда на всю ширину */
@media (max-width: 640px) {
  form button[type='submit'] {
    width: 100%;
  }
}

/* Верхнее меню кабинета: подчёркивание при наведении (как на главной странице) */
nav[class*="space-x-4"] a {
  position: relative;
}
nav[class*="space-x-4"] a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
nav[class*="space-x-4"] a:hover::after,
nav[class*="space-x-4"] a.active::after {
  opacity: 1;
  transform: scaleX(1);
}


/* ------------------------------------------------------------------
   Playground: блок ввода и его «дополнения».
   Штатная рамка #e5eaf1 на белом фоне почти не читалась — делаем
   поверхность, рамку, плейсхолдер, выбор модели и кнопки заметными.
   Правка только для композера (input-group, внутри которого textarea),
   поэтому поиск, формы входа и прочие поля не затронуты.
   ------------------------------------------------------------------ */

/* new-api вешает has-disabled:opacity-50 на всю коробку, а кнопка
   «Отправить» disabled, пока поле пустое — из-за этого весь композер
   показывался в полсилы. Гасим это правило именно здесь. */
html.light [data-slot='input-group']:has(> textarea) {
  opacity: 1 !important;
  background-color: #f7fafd !important;
  border: 1px solid #b3c5da !important;
  border-radius: 16px !important;
  box-shadow:
    0 1px 2px rgba(16, 24, 38, 0.05),
    0 14px 30px -22px rgba(16, 24, 38, 0.45) !important;
}

html.light [data-slot='input-group']:has(> textarea):hover {
  border-color: #93a8c1 !important;
}

html.light [data-slot='input-group']:has(> textarea):focus-within {
  border-color: #2f6fed !important;
  box-shadow:
    0 0 0 3px rgba(47, 111, 237, 0.14),
    0 16px 34px -22px rgba(16, 24, 38, 0.4) !important;
}

/* текст запроса и плейсхолдер */
html.light [data-slot='input-group']:has(> textarea) textarea {
  color: #16202e !important;
}

html.light [data-slot='input-group']:has(> textarea) textarea::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}

/* нижняя панель: кнопки инструментов, выбор модели, отправка */
html.light [data-slot='input-group']:has(> textarea) > [data-slot='input-group-addon'][data-align='block-end'] {
  background-color: #e9f0f9 !important;
  border-top: 1px solid #d2dfef !important;
}

/* группа кнопок-инструментов (скрепка, микрофон, параметры) */
html.light [data-slot='input-group']:has(> textarea) [data-slot='input-group-addon'] > div > div.rounded-lg {
  background-color: #ffffff !important;
  border-color: #c6d5e6 !important;
}

html.light [data-slot='input-group']:has(> textarea) [data-slot='input-group-addon'] button[data-size]:not([type='submit']) {
  color: #52627a !important;
}

html.light [data-slot='input-group']:has(> textarea) [data-slot='input-group-addon'] button[data-size]:not([type='submit']):hover {
  background-color: #e8eefa !important;
  color: #16202e !important;
}

/* «чип» выбора модели/группы: был серым текстом без рамки */
html.light [data-slot='input-group']:has(> textarea) button[role='combobox'] {
  background-color: #ffffff !important;
  border: 1px solid #b3c5da !important;
  color: #22334a !important;
  box-shadow: none !important;
}

html.light [data-slot='input-group']:has(> textarea) button[role='combobox']:hover {
  background-color: #f4f8ff !important;
  border-color: #a9bbd0 !important;
}

html.light [data-slot='input-group']:has(> textarea) button[role='combobox'] span {
  color: #2b3d52 !important;
}

html.light [data-slot='input-group']:has(> textarea) button[role='combobox'] svg {
  color: #63748b !important;
  opacity: 1 !important;
}

/* кнопка отправки: в неактивном состоянии была почти невидимой */
/* неактивная кнопка тоже синяя и с белой надписью: она не «появляется»
   после ввода текста, а видна всегда; курсор и отсутствие реакции говорят,
   что нажимать пока рано */
html.light [data-slot='input-group']:has(> textarea) button[type='submit']:disabled {
  background-color: #4f83ea !important;
  color: #ffffff !important;
  border: 1px solid #3f74d8 !important;
  opacity: 1 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

html.light [data-slot='input-group']:has(> textarea) button[type='submit']:disabled * {
  color: #ffffff !important;
  opacity: 1 !important;
}

html.light [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled) {
  box-shadow: 0 6px 14px -6px rgba(47, 111, 237, 0.45) !important;
}

/* кнопка «Отправить»: белая надпись, синяя заливка без «выцветания»
   на hover (у new-api hover:bg-primary/90 — альфа 0.9, кнопка бледнеет),
   и лёгкое нажатие, как у настоящей кнопки */
html.light [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled) {
  background-color: #2563eb !important;
  color: #ffffff !important;
  opacity: 1 !important;
  border: 1px solid #1d4ed8 !important;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, 0.5) !important;
  transition: background-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.1s ease !important;
}

html.light [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled) * {
  color: #ffffff !important;
  opacity: 1 !important;
}

html.light [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled) svg {
  color: #ffffff !important;
  fill: currentColor !important;
}

html.light [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled):hover {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
  border-color: #1e40af !important;
  transform: translateY(1px) !important;
  box-shadow: 0 3px 8px -5px rgba(29, 78, 216, 0.55) !important;
}

html.light [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled):active {
  background-color: #1a45c0 !important;
  color: #ffffff !important;
  transform: translateY(2px) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.18) !important;
}

html.light [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled):focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3) !important;
}

/* --- тёмная тема: тот же акцент контраста --- */

html.dark [data-slot='input-group']:has(> textarea) {
  opacity: 1 !important;
  background-color: #18212c !important;
  border: 1px solid #39495c !important;
  border-radius: 16px !important;
  box-shadow: 0 14px 30px -24px rgba(0, 0, 0, 0.8) !important;
}

html.dark [data-slot='input-group']:has(> textarea):focus-within {
  border-color: #4d86ff !important;
  box-shadow: 0 0 0 3px rgba(77, 134, 255, 0.18) !important;
}

html.dark [data-slot='input-group']:has(> textarea) textarea::placeholder {
  color: #93a2b5 !important;
  opacity: 1 !important;
}

html.dark [data-slot='input-group']:has(> textarea) > [data-slot='input-group-addon'][data-align='block-end'] {
  background-color: #141c26 !important;
  border-top: 1px solid #2c3846 !important;
}

html.dark [data-slot='input-group']:has(> textarea) [data-slot='input-group-addon'] > div > div.rounded-lg {
  background-color: #1d2733 !important;
  border-color: #39495c !important;
}

html.dark [data-slot='input-group']:has(> textarea) button[role='combobox'] {
  background-color: #1d2733 !important;
  border: 1px solid #39495c !important;
  color: #dbe7f7 !important;
}

html.dark [data-slot='input-group']:has(> textarea) button[role='combobox'] span {
  color: #dbe7f7 !important;
}


html.dark [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled) {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
  opacity: 1 !important;
  border: 1px solid #2563eb !important;
  box-shadow: 0 6px 14px -8px rgba(59, 130, 246, 0.6) !important;
  transition: background-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.1s ease !important;
}

html.dark [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled) * {
  color: #ffffff !important;
  opacity: 1 !important;
}

html.dark [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled):hover {
  background-color: #2563eb !important;
  color: #ffffff !important;
  transform: translateY(1px) !important;
  box-shadow: 0 3px 8px -6px rgba(37, 99, 235, 0.7) !important;
}

html.dark [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled):active {
  background-color: #1d4ed8 !important;
  transform: translateY(2px) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35) !important;
}


html.dark [data-slot='input-group']:has(> textarea) button[type='submit']:disabled {
  background-color: #3f6fd8 !important;
  color: #ffffff !important;
  border: 1px solid #3560c2 !important;
  opacity: 1 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

html.dark [data-slot='input-group']:has(> textarea) button[type='submit']:disabled * {
  color: #ffffff !important;
  opacity: 1 !important;
}


html.light [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:hover,
html.light [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:active,
html.light [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:focus,
html.light [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:focus-visible {
  background-color: #4f83ea !important;
  color: #ffffff !important;
  border: 1px solid #3f74d8 !important;
  opacity: 1 !important;
  box-shadow: none !important;
  transform: none !important;
}

html.light [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:hover * {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* ------------------------------------------------------------------
   Playground: мятная палитра в тон главной странице astrapro.shop.
   Раньше здесь была тёплая песочная гамма с терракотовой кнопкой —
   владелец попросил тот же оттенок, что на сайте, и без оранжевого.
   Токены взяты с сайта: фон #e2f1e9…#f2faf6, мята #e8f4ed/#d9ecdf,
   акцент бренда — синий #2563eb (кнопка «Отправить»).
   ------------------------------------------------------------------ */

html.light body:has([data-slot='input-group'] > textarea),
html.light body:has([class*='is-assistant']) {
  --background: transparent;
  --foreground: #0f172a;

  --card: #ffffff;
  --card-foreground: #0f172a;
  --popover: #ffffff;
  --popover-foreground: #0f172a;

  --secondary: #f3faf6;
  --secondary-foreground: #0b3b2e;

  --muted: #f3faf6;
  --muted-foreground: #475569;

  --accent: #e4f3ec;
  --accent-foreground: #0b6b4f;

  --border: var(--border-card);
  --input: var(--border-card-soft);

  --table-header: #f7fcf9;
  --table-header-hover: #eef8f2;
  --field-border: #c2d8cc;

  --scroll-thumb: #c6d9d0;
  --scroll-track: #eaf5ef;
}

/* холст переписки — самый светлый тон мяты, как верх главной */
/* Шторки/диалоги внутри чата: у них bg-background, а в чате этот токен
   прозрачный (чтобы был виден градиент страницы) — из-за этого «Выбрать
   модель» просвечивала. Даём поверхностям плотный матовый фон. */
[data-slot='sheet-content'],
[data-slot='dialog-content'] {
  background-color: #ffffff !important;
  background-image: none !important;
  color: var(--foreground);
  box-shadow: 0 -12px 34px rgba(15, 23, 42, 0.10);
}

[data-slot='sheet-content'] [data-slot='input-group'],
[data-slot='dialog-content'] [data-slot='input-group'] {
  background-color: #f6fbf8;
  border-color: #e2eee8;
}

[data-slot='sheet-content'] [data-slot='sheet-header'],
[data-slot='dialog-content'] [data-slot='dialog-header'] {
  background-color: #ffffff;
}

html.light body:has([data-slot='input-group'] > textarea) [role='log'],
html.light body:has([class*='is-assistant']) [role='log'] {
  background-color: #ffffff !important;
  background-image:
    radial-gradient(1100px 540px at 50% -160px, rgba(5, 150, 105, 0.16), rgba(5, 150, 105, 0) 74%),
    linear-gradient(180deg, #e2f1e9 0%, #f2faf6 26%, #ffffff 62%) !important;
  background-repeat: no-repeat !important;
  background-attachment: local !important;
  background-size: cover, 100% 100% !important;
}

/* пузырь пользователя: мятная плашка, скругление как у Claude */
html.light [class*='group-[.is-user]:bg-muted'] {
  background-color: #e2f1e9 !important;
  border-color: #cfe4da !important;
  border-radius: 18px 18px 6px 18px !important;
  padding: 9px 15px !important;
  color: #12251d !important;
  box-shadow: 0 1px 2px rgba(5, 60, 40, 0.06) !important;
}

/* ответ модели: без плашки, обычный текст на светлом мятном холсте */
html.light [class*='group-[.is-assistant]:bg-transparent'] {
  color: #0f172a !important;
}

/* композер в мятной гамме (кнопка «Отправить» — синяя, как на сайте) */
html.light [data-slot='input-group']:has(> textarea) {
  background-color: #ffffff !important;
  border: 1px solid #cfe2d8 !important;
}

html.light [data-slot='input-group']:has(> textarea):hover {
  border-color: #b7d4c5 !important;
}

html.light [data-slot='input-group']:has(> textarea):focus-within {
  border-color: #7fc7a8 !important;
  box-shadow:
    0 0 0 3px rgba(5, 150, 105, 0.18),
    0 16px 34px -22px rgba(6, 60, 45, 0.28) !important;
}

html.light [data-slot='input-group']:has(> textarea) textarea::placeholder {
  color: #6b7d74 !important;
}

html.light [data-slot='input-group']:has(> textarea) > [data-slot='input-group-addon'][data-align='block-end'] {
  background-color: #f3faf6 !important;
  border-top-color: #dcece4 !important;
}

html.light [data-slot='input-group']:has(> textarea) [data-slot='input-group-addon'] button[data-size]:not([type='submit']):hover {
  background-color: #e6f4ed !important;
  color: #0f172a !important;
}

html.light [data-slot='input-group']:has(> textarea) button[role='combobox'] {
  border-color: #cfe2d8 !important;
  color: #0f172a !important;
}

html.light [data-slot='input-group']:has(> textarea) button[role='combobox']:hover {
  background-color: #f8fdfa !important;
  border-color: #b7d4c5 !important;
}

/* плашки ошибок/служебных блоков: мягкие, без тёплой песочности */
html.light [class*='border-destructive/30'][class*='bg-destructive/5'] {
  background-color: #fdf3f2 !important;
  border-color: #f2d2cd !important;
}

html.light [class*='bg-muted/60'][class*='rounded-lg'][class*='border'] {
  background-color: #f3faf6 !important;
  border-color: #dfeee7 !important;
}

/* подсветка выделения текста — мятная, в тон */
html.light body:has([data-slot='input-group'] > textarea) ::selection {
  background: #cdeadd;
  color: #0f172a;
}

/* кнопка «Отправить»: синяя (бренд сайта), видна всегда, inert — приглушённая */
html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:disabled,
html.light body:has([class*='is-assistant']) [data-slot='input-group']:has(> textarea) button[type='submit']:disabled,
html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:hover,
html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:active,
html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:focus,
html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:focus-visible {
  background-color: #9db9ea !important;
  color: #ffffff !important;
  border: 1px solid #8aa8e0 !important;
  opacity: 1 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:disabled *,
html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:disabled:hover * {
  color: #ffffff !important;
  opacity: 1 !important;
}

html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled) {
  background-color: #2f6fed !important;
  color: #ffffff !important;
  border: 1px solid #265fc9 !important;
  box-shadow: 0 6px 14px -6px rgba(47, 111, 237, 0.5) !important;
  transition: background-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.1s ease !important;
}

html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled) * {
  color: #ffffff !important;
  opacity: 1 !important;
}

html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled) svg {
  color: #ffffff !important;
  fill: currentColor !important;
}

html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled):hover {
  background-color: #265fc9 !important;
  color: #ffffff !important;
  border-color: #1f51ad !important;
  transform: translateY(1px) !important;
  box-shadow: 0 3px 8px -5px rgba(31, 81, 173, 0.5) !important;
}

html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled):active {
  background-color: #1f51ad !important;
  color: #ffffff !important;
  transform: translateY(2px) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

html.light body:has([data-slot='input-group'] > textarea) [data-slot='input-group']:has(> textarea) button[type='submit']:not(:disabled):focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.3) !important;
}

/* ── Витрина моделей (/pricing): карточка модели при наведении ──────────────
   Лёгкий 3D-подъём: карточка приподнимается, чуть наклоняется и получает тень.
   Базовый вариант делает сам CSS по :hover — он работает всегда.
   Если загружен panel-models-3d.js, наклон идёт вслед за курсором
   (inline transform перекрывает CSS).
   На тач-устройствах и при prefers-reduced-motion эффекта нет. */
[data-slot='card'][class*='hover:ring-foreground/20'] {
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.25s ease-out;
  will-change: transform;
}

[data-slot='card'][class*='hover:ring-foreground/20']:hover {
  position: relative;
  z-index: 2;
  transform: perspective(1100px) rotateX(1.6deg) rotateY(-1.8deg) translateY(-5px) scale(1.012);
  box-shadow:
    0 18px 36px -20px rgba(16, 24, 40, 0.38),
    0 4px 12px -6px rgba(16, 24, 40, 0.14);
}

html.dark [data-slot='card'][class*='hover:ring-foreground/20']:hover {
  box-shadow:
    0 18px 36px -20px rgba(0, 0, 0, 0.7),
    0 4px 12px -6px rgba(0, 0, 0, 0.45);
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  [data-slot='card'][class*='hover:ring-foreground/20'],
  [data-slot='card'][class*='hover:ring-foreground/20']:hover {
    transition: none;
    transform: none;
  }
}


/* ── Кнопка «Руководство по настройке» в шапке «Обзора» ────────────────────
   new-api рисует её ghost-кнопкой («Setup guide»): клик сворачивает и
   разворачивает подсказку, ссылки у неё нет. Оформляем как контурную
   secondary-кнопку того же синего, что у «Кошелёк»: рамка, иконка книги,
   стрелка, заливка при наведении. Класс ставит panel-guide-btn.js по тексту;
   скругление он же берёт у «Кошелька» (--astra-guide-radius).
   В светлой теме текст на заливке белый (--primary-foreground), в тёмной —
   тёмный: на светлом синем #4d86ff белый не проходит по контрасту. */
.astra-guide-btn.astra-guide-btn {
  --astra-guide-icon: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M2%203h6a4%204%200%200%201%204%204v14a3%203%200%200%200-3-3H2z%27%2F%3E%3Cpath%20d%3D%27M22%203h-6a4%204%200%200%200-4%204v14a3%203%200%200%201%203-3h7z%27%2F%3E%3C%2Fsvg%3E");
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: auto;
  min-height: 40px;
  max-width: none;
  padding: 10px 18px;
  border: 1.5px solid var(--primary);
  border-radius: var(--astra-guide-radius, 8px);
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.astra-guide-btn.astra-guide-btn::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: var(--astra-guide-icon) center / 18px 18px no-repeat;
  mask: var(--astra-guide-icon) center / 18px 18px no-repeat;
}
.astra-guide-btn.astra-guide-btn::after {
  content: "→";
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}
.astra-guide-btn.astra-guide-btn:hover,
.astra-guide-btn.astra-guide-btn[aria-expanded="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}
.astra-guide-btn.astra-guide-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
@media (max-width: 640px) {
  .astra-guide-btn.astra-guide-btn {
    width: 40px;
    min-width: 40px;
    padding: 0;
    gap: 0;
    font-size: 0;
  }
  .astra-guide-btn.astra-guide-btn::after { display: none; }
  .astra-guide-btn.astra-guide-btn::before { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .astra-guide-btn.astra-guide-btn { transition: none; }
}

/* ── Карточки «Рекомендуемые действия» на «Обзоре» ──────────────────────────
   new-api строит их на базе кнопки, а у кнопки в базовых классах
   white-space: nowrap. Подпись наследует nowrap, line-clamp-2 не переносит
   строки — карточка растягивается по ширине текста и выдавливает страницу
   вбок (на узком окне текст уезжает за экран). Возвращаем перенос:
   line-clamp рассчитан именно на многострочный текст. */
.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
  white-space: normal;
}

/* ── Шаги «Начало работы» на «Обзоре» ───────────────────────────────────────
   new-api помечает выполненный шаг светло-зелёной плашкой (bg-success/10,
   border-success/30) и зелёной галочкой. На светлом фоне это читается как
   серое, поэтому выполненный шаг делаем явно зелёным: залитый кружок в цвете
   --success и контрастная галочка. Невыполненные шаги не меняются. */
ol > li > span.bg-success\/10 {
  background: var(--success);
  border-color: var(--success);
  color: var(--success-foreground);
}

ol > li > span.bg-success\/10 svg {
  color: var(--success-foreground);
  stroke-width: 3;
}

/* =========================================================================
   AstraPro — единый контур блоков для всей панели (2026-11-28)
   Один общий стиль на все страницы кабинета. Цвет и толщина живут в
   переменных ниже, а панельные токены (--border / --input / --sidebar-border)
   ссылаются на них — правка одной строки меняет вид везде.
   ========================================================================= */
:root,
html.light {
  /* карточки, крупные блоки, таблицы, меню, всплывающие окна */
  --border-card: rgba(16, 24, 38, 0.21);
  /* вложенные блоки, поля, разделители — мягче внешних */
  --border-card-soft: rgba(16, 24, 38, 0.15);
  /* наведение */
  --border-card-hover: rgba(16, 24, 38, 0.34);
  --border-width-card: 1px;
  --border-width-card-strong: 1.5px;
  --border-card-shadow: 0 1px 3px rgba(16, 24, 38, 0.05);

  --border: var(--border-card);
  --input: var(--border-card-soft);
  --sidebar-border: var(--border-card-soft);
  --table-disabled-border: var(--border-card-soft);
}

html.dark {
  --border-card: rgba(233, 240, 250, 0.18);
  --border-card-soft: rgba(233, 240, 250, 0.12);
  --border-card-hover: rgba(233, 240, 250, 0.32);
  --border-width-card: 1px;
  --border-width-card-strong: 1.5px;
  --border-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);

  --border: var(--border-card);
  --input: var(--border-card-soft);
  --sidebar-border: var(--border-card-soft);
  --table-disabled-border: var(--border-card-soft);
}

/* Карточки панели рисуют рамку ring-ом (ring-1 ring-foreground/10), а не
   border: цвет такого ring-а задаётся в --tw-ring-color. Берём тот же ring,
   но заметнее. Акцентные состояния (ring-primary / ring-destructive) не
   ломаем: варианты состояний перебивают это правило своей специфичностью. */
[class~="ring-foreground/10"] {
  --tw-ring-color: var(--border-card);
}
[class~="ring-foreground/5"] {
  --tw-ring-color: var(--border-card-soft);
}

/* вложенные карточки мягче внешних — без эффекта «рамка в рамке» */
[data-slot="card"] [data-slot="card"],
[class~="ring-foreground/10"] [class~="ring-foreground/10"] {
  --tw-ring-color: var(--border-card-soft);
  border-color: var(--border-card-soft);
}

/* таблицы: линии между строками мягче рамки вокруг таблицы */
table thead tr,
table tbody tr {
  border-color: var(--border-card-soft);
}

/* всплывающие окна, меню и выпадающие панели — как карточки, не мягче */
[data-slot="dialog-content"],
[data-slot="sheet-content"],
[data-slot="dropdown-menu-content"],
[data-slot="select-content"],
[data-slot="popover-content"] {
  border-color: var(--border-card);
}

/* боковое меню: аккуратная граница с содержимым (тенью — без сдвига вёрстки) */
[data-slot="sidebar-container"] {
  box-shadow: inset calc(-1 * var(--border-width-card)) 0 0 var(--border-card-soft);
}
/* активный пункт меню — выделение чуть заметнее */
[data-slot="sidebar-menu-button"][data-active],
[data-slot="sidebar-menu-button"][aria-current="page"] {
  box-shadow: inset 0 0 0 var(--border-width-card) var(--border-card-soft);
}

/* переключатели: выключенная дорожка читается на фоне */
[data-slot="switch"][data-unchecked],
html.dark [data-slot="switch"][data-unchecked] {
  background-color: var(--border-card);
}

/* поля, списки, поиск и второстепенные кнопки: при наведении граница темнее.
   Акцентные (primary/destructive) и прозрачные рамки не трогаем. */
@media (hover: hover) {
  [data-slot="input"]:hover:not(:focus):not(:focus-visible),
  [data-slot="select-trigger"]:hover:not(:focus-visible),
  [data-slot="button"]:hover:not(:disabled):not([class*="border-transparent"]):not([class*="border-primary"]):not([class*="border-destructive"]):not([class*="bg-primary"]) {
    border-color: var(--border-card-hover);
  }
}

/* Логотип в шапке: без плашки при наведении, фокусе и нажатии.
   Классы hover:bg-accent и focus-visible:ring-* приходят из общего стиля
   ссылок панели (--accent = зелёный #e4f3ec), поэтому гасим только этот
   блок, оставляя пункты меню и остальные ссылки нетронутыми. */
header [class*="system-brand"] a[href="/"],
header [class*="system-brand"] a[href="/"]:hover,
header [class*="system-brand"] a[href="/"]:focus,
header [class*="system-brand"] a[href="/"]:focus-visible,
header [class*="system-brand"] a[href="/"]:active {
  background-color: transparent;
  box-shadow: none;
  outline: none;
}
