/* ==========================================================================
   My account — hero, tabs, and the handful of small components (stat tiles,
   segmented control, code block, steps, key/session rows) the four tabs share.
   Built from the project's own tokens/components (.card/.btn/.badge/.field-*),
   not the visual reference's own hardcoded palette — only the layout density
   and component shapes follow the reference closely.
   ========================================================================== */
.account-tabs {
  display: flex;
  /* Not stretch: a tab holding a count badge would otherwise set the height for the
     whole row, and the sliding pill is drawn to the tab it covers. */
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem;
  margin: 1rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted);
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}
.account-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  /* Fixed, not a minimum, and matching .dm-view-tab (0.5rem padding + 0.85rem text):
     every tab strip in the product is one height, whatever a tab happens to contain. */
  height: 2.05rem;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 0.9rem;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background var(--transition-fast) var(--ease), color var(--transition-fast) var(--ease);
}
.account-tab .icon { width: 1rem; height: 1rem; flex-shrink: 0; }
.account-tab:hover { color: var(--color-text); background: var(--color-primary-bg); }
.account-tab.is-active {
  color: var(--color-on-primary);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  box-shadow: 0 6px 14px color-mix(in srgb, var(--color-primary-hover) 25%, transparent);
}
.account-panel { animation: accountPanelIn 0.2s var(--ease); }
@keyframes accountPanelIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .account-panel { animation: none; }
}

.account-grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.75fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1024px) {
  .account-grid-2col { grid-template-columns: 1fr; }
}

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
@media (max-width: 480px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
.stat-tile {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}
.stat-tile span { display: block; color: var(--color-text-faint); font-size: 0.68rem; }
.stat-tile strong { display: block; margin-top: 0.4rem; font-size: 0.85rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }


/* История заказов: фильтр-чипы и пагинация */
.order-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.order-filter-chip {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  color: var(--color-text-muted); background: var(--color-surface-muted);
  border: 1px solid var(--color-border); text-decoration: none; white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}
.order-filter-chip:hover { color: var(--color-text); border-color: var(--color-primary); }
.order-filter-chip.is-active {
  color: #fff; background: var(--color-primary); border-color: var(--color-primary);
}
.order-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.order-pager-info { font-size: 12px; font-weight: 600; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.order-pager-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 9px; border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text-muted); text-decoration: none; transition: color .15s, border-color .15s, background .15s;
}
.order-pager-btn:hover { color: var(--color-primary); border-color: var(--color-primary); }
.order-pager-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.order-pager-btn.is-disabled { opacity: .4; pointer-events: none; }

/* ==========================================================================
   Мой аккаунт — редизайн 2026-09: шапка профиля, значки у каждой карточки,
   строки-факты с иконками, метрики лимитов, кольцо лицензии, устройства.
   ========================================================================== */
.st { display: flex; flex-direction: column; }
.st .card { animation: st-rise .45s var(--ease, cubic-bezier(.22,.61,.36,1)) both; }
@keyframes st-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .st .card { animation: none; } }

/* Шапка профиля */
.st-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 18px 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 10%, var(--color-surface)), var(--color-surface) 60%); }
@media (max-width: 900px) { .st-hero { grid-template-columns: auto 1fr; } .st-hero-stats { grid-column: 1 / -1; } }
.st-hero-ava { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover)); box-shadow: 0 8px 22px color-mix(in srgb, var(--color-primary) 35%, transparent); }
.st-hero-main { min-width: 0; }
.st-hero-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.st-hero-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 12.5px; color: var(--color-text-muted); }
.st-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.st-hero-meta svg, .st-fact svg, .st-row svg, .st-hero-stats svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.st-hero-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 8px; }
.st-stat { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface); color: inherit; text-decoration: none; font: inherit; cursor: pointer; text-align: left; min-width: 7.5rem; transition: border-color .15s ease, transform .15s ease; }
.st-stat:hover { border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border)); transform: translateY(-1px); }
.st-stat svg { grid-row: 1 / 3; color: var(--color-primary); width: 18px; height: 18px; }
.st-stat b { font-size: 17px; font-weight: 750; line-height: 1.1; }
.st-stat span { font-size: 11px; color: var(--color-text-muted); white-space: nowrap; }
.st-tab-cnt { margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: color-mix(in srgb, currentColor 18%, transparent); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.st-tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-warning); margin-left: 6px; }

/* Заголовки карточек с иконкой */
.st-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.st-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--color-primary) 13%, transparent); color: var(--color-primary); }
.st-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st-ic.is-violet { background: color-mix(in srgb, #8b7bf0 16%, transparent); color: #8b7bf0; }
.st-ic.is-cyan { background: color-mix(in srgb, #25c2d6 15%, transparent); color: #1aa7b9; }
.st-ic.is-green { background: color-mix(in srgb, var(--color-success) 15%, transparent); color: var(--color-success-text); }
.st-ic.is-amber { background: color-mix(in srgb, var(--color-warning) 18%, transparent); color: var(--color-warning-text); }
.st-ic.is-red { background: color-mix(in srgb, var(--color-danger) 14%, transparent); color: var(--color-danger); }
.st-head-copy { flex: 1; min-width: 0; }
.st-head-copy h3 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-head-copy p { margin: 2px 0 0; font-size: 12px; color: var(--color-text-muted); line-height: 1.4; }
.st-price { font-size: 18px; font-weight: 750; text-align: right; line-height: 1; }
.st-price small { display: block; font-size: 10.5px; font-weight: 500; color: var(--color-text-faint); margin-top: 3px; }

/* Формы и поля */
.st-inline-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.st-field { flex: 1; min-width: 12rem; }
.st-input-ic { position: relative; }
.st-input-ic > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: none; stroke: var(--color-text-faint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.st-input-ic .input { padding-left: 2.3rem; }
.st-input-ic.is-pass .input { padding-right: 2.6rem; }
.st-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.st-facts.is-lic { margin-top: 0; flex: 1; }
@media (max-width: 560px) { .st-facts { grid-template-columns: 1fr; } }
.st-fact { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; padding: 9px 11px; border-radius: 11px; background: var(--color-surface-muted); border: 1px solid var(--color-border); min-width: 0; }
.st-fact svg { grid-row: 1 / 3; color: var(--color-text-faint); }
.st-fact span { font-size: 11px; color: var(--color-text-faint); }
.st-fact b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .st-two { grid-template-columns: 1fr; } }
.st-lang { display: flex; flex-wrap: wrap; gap: 6px; }
.st-lang-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted); font: inherit; cursor: pointer; min-width: 5.2rem; transition: border-color .15s ease, background .15s ease; }
.st-lang-btn b { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.st-lang-btn span { font-size: 11px; }
.st-lang-btn:hover { border-color: var(--color-primary); color: var(--color-text); }
.st-lang-btn.is-active { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 10%, transparent); color: var(--color-primary); }
.st-seg { display: inline-flex; background: var(--color-surface-muted); border: 1px solid var(--color-border); border-radius: 11px; padding: 3px; }
.st-seg-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--color-text-muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.st-seg-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.st-seg-btn.is-active { background: var(--color-surface); color: var(--color-text); box-shadow: 0 1px 3px rgba(0,0,0,.18); }

/* Строки, списки, метрики */
.st-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.st-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--color-text-muted); }
.st-row svg { color: var(--color-text-faint); }
.st-row b { margin-left: auto; color: var(--color-text); font-weight: 650; text-align: right; }
.st-meter { height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--color-text) 8%, transparent); overflow: hidden; margin: 2px 0 14px; }
.st-meter span { display: block; height: 100%; border-radius: 4px; background: var(--color-primary); transition: width .8s var(--ease, ease); }
.st-meter span.is-full { background: var(--color-warning); }
.st-usage { margin-bottom: 4px; }
.st-usage-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.st-usage-top b { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.st-usage-top span { font-size: 12px; color: var(--color-text-muted); }
.st-list { display: flex; flex-direction: column; gap: 8px; }
.st-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface-muted); }
.st-item.is-current { border-color: color-mix(in srgb, var(--color-success) 45%, var(--color-border)); }
.st-item.is-muted { opacity: .75; }
.st-item-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-primary); }
.st-item-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st-item-main { flex: 1; min-width: 0; }
.st-item-title { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-item-sub { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; line-height: 1.4; }
.st-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text-muted); }
.st-steps { list-style: none; margin: 0 0 14px; padding: 0; counter-reset: st; display: grid; gap: 8px; }
.st-steps li { position: relative; padding-left: 34px; counter-increment: st; }
.st-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--color-primary); }
.st-steps b { display: block; font-size: 13px; font-weight: 650; }
.st-steps span { display: block; font-size: 12px; color: var(--color-text-muted); }
.st-copy { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted); font: inherit; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 7px; cursor: pointer; }
.st-copy:hover { color: var(--color-text); border-color: var(--color-primary); }
.st-copy svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.st-codebox { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-muted); }
.st-codebox code { flex: 1; font-size: 16px; font-weight: 700; letter-spacing: .08em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.st-note { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 11px; margin-bottom: 12px; font-size: 12.5px; line-height: 1.4; }
.st-note.ok { background: color-mix(in srgb, var(--color-success) 12%, transparent); }
.st-note.warn { background: color-mix(in srgb, var(--color-warning) 14%, transparent); }
.st-note svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.st-note.ok svg { color: var(--color-success-text); } .st-note.warn svg { color: var(--color-warning-text); }
.st-note b { display: block; font-size: 13px; } .st-note span { display: block; color: var(--color-text-muted); margin-top: 1px; }
.st-method { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--color-border); }
.st-method form { margin-top: 8px; }
.st-disable { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--color-border); }

/* Лицензии */
.st-lic.is-active { border-color: color-mix(in srgb, #8b7bf0 40%, var(--color-border)); }
.st-lic-body { display: flex; align-items: center; gap: 18px; }
.st-ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; flex: none; display: grid; place-items: center; text-align: center; background: conic-gradient(#8b7bf0 calc(var(--p) * 1%), color-mix(in srgb, var(--color-text) 8%, transparent) 0); position: relative; }
.st-ring::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--color-surface); }
.st-ring b, .st-ring span { position: relative; }
.st-ring b { font-size: 22px; font-weight: 800; line-height: 1; }
.st-ring span { display: block; font-size: 9.5px; color: var(--color-text-faint); margin-top: 2px; }
.st-orders { display: flex; flex-direction: column; gap: 8px; }
.st-order { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 11px; background: var(--color-surface-muted); }
.st-order-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 2px; }
.st-order-ic svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.st-order-ic.ok { background: color-mix(in srgb, var(--color-success) 16%, transparent); color: var(--color-success-text); }
.st-order-ic.bad { background: color-mix(in srgb, var(--color-danger) 14%, transparent); color: var(--color-danger); }
.st-order-ic.wait { background: color-mix(in srgb, var(--color-warning) 16%, transparent); color: var(--color-warning-text); }
.st-danger { border-color: color-mix(in srgb, var(--color-danger) 35%, var(--color-border)); }

.st-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; background: transparent; color: var(--color-text-faint); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.st-eye:hover { color: var(--color-text); background: var(--color-surface-muted); }
.st-eye svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---- Вкладка «ИИ-модели» ---- */
.st-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface-muted); margin-bottom: 16px; }
.st-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.st-switch-track { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--color-border); transition: background .18s; }
.st-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s; }
.st-switch input:checked + .st-switch-track { background: var(--color-primary); }
.st-switch input:checked + .st-switch-track::after { transform: translateX(16px); }
.st-switch input:focus-visible + .st-switch-track { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.st-switch-copy b { display: block; font-size: 13.5px; }
.st-switch-copy small { display: block; color: var(--color-text-muted); font-size: 12px; margin-top: 1px; }

.st-ai-fields { display: grid; gap: 16px; transition: opacity .18s; }
.st-ai-fields.is-off { opacity: .5; }
.st-ai-step { display: grid; gap: 8px; }
.st-ai-step-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.st-ai-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--color-primary); flex: none; }
.st-ai-chip { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--color-success) 14%, transparent); color: var(--color-success-text); font-family: var(--font-data, inherit); }
.st-ai-providers { width: 100%; }
.st-ai-providers .st-seg-btn { flex: 1; justify-content: center; position: relative; }
.st-ai-providers input { position: absolute; opacity: 0; width: 0; height: 0; }
.st-ai-baseurl { margin-top: 4px; }
.st-ai-keyrow { display: flex; gap: 8px; align-items: stretch; }
.st-ai-keyrow .st-input-ic { flex: 1; }
.st-ai-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.st-ai-test { font-size: 12.5px; padding: 6px 10px; border-radius: 9px; background: var(--color-surface-muted); color: var(--color-text-muted); }
.st-ai-test.is-ok { color: var(--color-success-text); background: color-mix(in srgb, var(--color-success) 14%, transparent); }
.st-ai-test.is-fail { color: var(--color-danger-text); background: color-mix(in srgb, var(--color-danger) 14%, transparent); }

.st-ai-reset-link { margin-left: auto; background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; cursor: pointer; }

/* ---- Мобильная раскладка «Моего аккаунта» ----
   Колонка 1fr = minmax(auto,1fr): ряд из четырёх плиток сводки не сжимался и раздвигал
   всю страницу за экран (486px при 390). Плитки — 2×2, сетки страницы — minmax(0,1fr). */
.account-grid-2col > * { min-width: 0; }
@media (max-width: 640px) {
  .st-hero { padding: 14px; gap: 12px; }
  .st-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-stat { min-width: 0; }
  .st-stat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .st-inline-form { flex-direction: column; align-items: stretch; }
  .st-inline-form .st-field { min-width: 0; }
  .st-inline-form .btn { width: 100%; justify-content: center; }
  .st-ai-providers .st-seg-btn { padding: 7px 6px; font-size: 12px; }
}
@media (max-width: 640px) {
  .st-lic-body { flex-wrap: wrap; gap: 10px; }
  .st-lic-body > * { min-width: 0; }
  .st-plan .st-row, .st-plan .st-row b, .st-lic * { white-space: normal; }
  .st-row b { text-align: right; overflow-wrap: anywhere; }
  .st .card, .account-panel, .account-grid-2col { min-width: 0; max-width: 100%; }
  .account-panel .card > * { min-width: 0; }
}
/* Полоса вкладок (общая для Мой аккаунт/Задачи/модулей): на узком экране прокручивается,
   а не раздвигает страницу. */
@media (max-width: 640px) { .account-tabs { max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; } .account-tabs::-webkit-scrollbar { display: none; } }
@media (max-width: 640px) {
  .st-two > * { min-width: 0; }
  .st-lang { flex-wrap: wrap; }
  .st-seg { display: flex; width: 100%; max-width: 100%; }
  .st-seg-btn { flex: 1 1 0; min-width: 0; justify-content: center; white-space: normal; padding: 7px 8px; }
}

/* Состояние подгрузки списка моделей провайдера под полем «Модель». */
.st-ai-models-state.is-loaded { color: var(--color-success, #2b9348); }
.st-ai-models-state.is-failed { color: var(--color-danger); }
.st-ai-models-state.is-need-key { color: var(--color-warning-text); }

/* Расход по своему ключу ИИ (OpenRouter) — показывается только когда данные есть. */
.st-aiuse { margin-top: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface-muted); }
.st-aiuse-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.st-aiuse-head span { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--color-text-faint); }
.st-aiuse-head b { font-size: 20px; font-weight: 750; color: var(--color-text); line-height: 1; }
.st-aiuse-bar { margin-top: 10px; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--color-text) 10%, transparent); overflow: hidden; }
.st-aiuse-bar span { display: block; height: 100%; border-radius: 999px; background: var(--color-primary); transition: width .4s ease; }
.st-aiuse-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 11.5px; color: var(--color-text-muted); }
.st-aiuse-badge { display: inline-block; margin-top: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--color-success-text); background: color-mix(in srgb, var(--color-success) 14%, transparent); padding: 2px 8px; border-radius: 6px; }
.st-aiuse-tokens { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.st-aiuse-tokens span { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--color-text-faint); }
.st-aiuse-tokens b { font-size: 16px; font-weight: 700; color: var(--color-text); }
.st-aiuse-tokens small { margin-left: auto; font-size: 11.5px; color: var(--color-text-muted); }

/* Раскрывающаяся плашка расхода (details) + разбивка по моделям. */
details.st-aiuse-exp { padding: 0; overflow: hidden; }
.st-aiuse-sum { list-style: none; cursor: pointer; padding: 12px 14px; position: relative; display: block; }
.st-aiuse-sum::-webkit-details-marker { display: none; }
.st-aiuse-sum:hover { background: color-mix(in srgb, var(--color-text) 3%, transparent); }
.st-aiuse-headright { display: inline-flex; align-items: center; gap: 9px; }
.st-aiuse-chev { display: inline-flex; color: var(--color-text-faint); transition: transform .28s cubic-bezier(.4,0,.2,1); }
.st-aiuse-chev svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.st-aiuse-sum:hover .st-aiuse-chev { color: var(--color-primary); }
details.st-aiuse-exp[open] .st-aiuse-chev { transform: rotate(180deg); color: var(--color-primary); }
.st-aiuse-detail { padding: 4px 14px 14px; border-top: 1px solid var(--color-border); }
@keyframes st-aiuse-reveal { from { opacity: 0; transform: translateY(-8px) scaleY(.98); } to { opacity: 1; transform: none; } }
.st-aiuse-detail .st-aiuse-model, .st-aiuse-detail .st-aiuse-tokens { animation: st-aiuse-item .3s ease both; }
.st-aiuse-detail .st-aiuse-model:nth-child(2) { animation-delay: .04s; }
.st-aiuse-detail .st-aiuse-model:nth-child(3) { animation-delay: .08s; }
.st-aiuse-detail .st-aiuse-model:nth-child(4) { animation-delay: .12s; }
@keyframes st-aiuse-item { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .st-aiuse-detail, .st-aiuse-detail * { animation: none !important; } .st-aiuse-chev { transition: none; } }
.st-aiuse-model { margin-top: 12px; }
.st-aiuse-model-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.st-aiuse-model-head b { font-size: 12.5px; font-weight: 650; color: var(--color-text); overflow-wrap: anywhere; }
.st-aiuse-model-head span { font-size: 13px; font-weight: 700; color: var(--color-text); white-space: nowrap; }
.st-aiuse-model-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
.st-aiuse-model-grid > div { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 9px; padding: 6px 8px; }
.st-aiuse-model-grid span { display: block; font-size: 10px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--color-text-faint); }
.st-aiuse-model-grid b { font-size: 13px; font-weight: 700; color: var(--color-text); }
.st-aiuse-reset { margin-top: 14px; width: 100%; background: transparent; color: var(--color-danger); border: 1px solid color-mix(in srgb, var(--color-danger) 35%, var(--color-border)); border-radius: 10px; padding: 9px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.st-aiuse-reset:hover { background: color-mix(in srgb, var(--color-danger) 10%, transparent); }


/* Уведомления: строка с тумблером звука («Мой аккаунт») */
.st-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.st-toggle-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-toggle-copy b { font-size: .92rem; color: var(--color-text); }
.st-toggle-copy small { font-size: .8rem; color: var(--color-text-muted); }
.st-sound-switch { position: relative; flex: none; width: 44px; height: 26px; }
.st-sound-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.st-sound-switch i {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--color-border-strong, var(--color-border));
  transition: background .18s ease;
}
.st-sound-switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35);
  transition: transform .18s ease;
}
.st-sound-switch input:checked + i { background: var(--color-violet, #7c6cff); }
.st-sound-switch input:checked + i::after { transform: translateX(18px); }
.st-sound-switch input:focus-visible + i { outline: 2px solid var(--color-violet, #7c6cff); outline-offset: 2px; }
