/* =========================================================
   AI CENTER / MAIN STYLES
   Единый styles.css для:
   - index.html (старый auth-start layout)
   - app.html
   - home.html
   - my-agent.html
   - shared-chat.html
   - modules.html
   - partner.html
   - payments.html
   - settings.html

   Подход:
   - один shell, много брендов
   - единые дизайн-токены
   - стартовый экран визуально совпадает с shell
========================================================= */

/* =========================================================
   1. ROOT TOKENS
========================================================= */

:root {
  --brand-primary: #64748b;
  --brand-primary-dark: #334155;
  --brand-primary-soft: #cbd5e1;

  --brand-bg-start: #f8fafc;
  --brand-bg-mid: #f1f5f9;
  --brand-bg-accent: #e2e8f0;
  --brand-bg-end: #cbd5e1;

  --tenant-primary: var(--brand-primary);
  --tenant-primary-dark: var(--brand-primary-dark);
  --tenant-primary-soft: var(--brand-primary-soft);
  --tenant-bg-start: var(--brand-bg-start);
  --tenant-bg-mid: var(--brand-bg-mid);
  --tenant-bg-accent: var(--brand-bg-accent);
  --tenant-bg-end: var(--brand-bg-end);

  --tenant-primary-rgb: 100, 116, 139;
  --tenant-primary-dark-rgb: 51, 65, 85;
  --tenant-primary-soft-rgb: 203, 213, 225;

  --brand-text-on-primary: #ffffff;
  --brand-danger: #ef4444;
  --brand-success: #10b981;
  --brand-success-dark: #059669;

  --surface-white: #ffffff;
  --surface-white-soft: rgba(255, 255, 255, 0.68);
  --surface-white-strong: rgba(255, 255, 255, 0.86);
  --surface-app: #ffffff;

  --text-primary: #1a1a1a;
  --text-heading: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;
  --text-soft: #4b5563;

  --border-soft: #e5e7eb;
  --border-mid: rgba(148, 163, 184, 0.45);

  --shadow-brand-sm: 0 4px 12px rgba(100, 116, 139, 0.22);
  --shadow-brand-md: 0 8px 22px rgba(100, 116, 139, 0.28);
  --shadow-dark-md: 0 8px 24px rgba(15, 23, 42, 0.14);
  --shadow-shell: 0 10px 32px rgba(15, 23, 42, 0.10);

  --app-max-width: 480px;
  --shell-radius: 24px;
  --content-radius: 16px;
  --bottom-nav-height: 68px;
}

/* =========================================================
   1a. THEME LOADING GATE (neutral start)
   UI скрыт за нейтральной заставкой, пока tenant theme не
   применена. Гейт управляется классом html.theme-gate.
   ========================================================= */

html.theme-gate body > :not(.theme-gate-overlay) {
  visibility: hidden;
}

html.theme-gate .theme-gate-overlay {
  display: flex;
}

html:not(.theme-gate) .theme-gate-overlay {
  display: none;
}

.theme-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  transition: opacity 0.2s ease;
}

.theme-gate-overlay.theme-gate-hide {
  opacity: 0;
  pointer-events: none;
}

.theme-gate-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: #64748b;
  animation: theme-gate-spin 0.8s linear infinite;
}

.theme-gate-loading-text {
  margin: 0;
}

.theme-gate-error-text {
  display: none;
  margin: 0;
}

.theme-gate-overlay.theme-gate-error .theme-gate-spinner,
.theme-gate-overlay.theme-gate-error .theme-gate-loading-text {
  display: none;
}

.theme-gate-overlay.theme-gate-error .theme-gate-error-text {
  display: block;
}

@keyframes theme-gate-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   2. BASE
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--text-primary);
  background:
    linear-gradient(
      135deg,
      var(--tenant-bg-start),
      var(--tenant-bg-mid),
      var(--tenant-bg-accent),
      var(--tenant-bg-end)
    );
  background-size: 200% 200%;
  background-attachment: fixed;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.hidden {
  display: none !important;
}

/* =========================================================
   3. GENERIC PAGE CONTAINERS
========================================================= */

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: transparent;
}

.page {
  width: 100%;
  max-width: 456px;
  margin: 0 auto;
  background: transparent;
}

.page-my-agent {
  padding: 12px 16px 16px;
}

/* =========================================================
   4. APP SHELL
========================================================= */

.app-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  max-width: var(--app-max-width);
  width: 100%;
  margin: 0 auto;
  background: #ffffff;
  border-radius: var(--shell-radius);
  box-shadow:
    0 14px 42px rgba(15, 23, 42, 0.18),
    0 4px 14px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.92);
}

.app-header {
  min-height: 68px;
  padding: 12px 14px 10px;
  padding-top: calc(12px + var(--tg-safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(
      135deg,
      var(--tenant-primary-dark) 0%,
      var(--tenant-primary) 100%
    );
  color: var(--brand-text-on-primary);
  box-shadow:
    0 10px 24px rgba(11, 60, 120, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.10);
  position: relative;
  z-index: 3;
}

.app-header-left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 8px;
}

.app-logo-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}

.app-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 0 calc(var(--bottom-nav-height) + 8px);
  display: flex;
  flex-direction: column;
  background: transparent;
}

#pageFrame,
.pageFrame {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  display: block;
  border: none;
  border-radius: var(--content-radius);
  background: transparent;
}

/* =========================================================
   5. HEADER BUTTONS
========================================================= */

.icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--brand-text-on-primary);
  cursor: pointer;
  padding: 0;
  border: none;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.icon-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 4px 10px rgba(15, 23, 42, 0.12);
  pointer-events: none;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.icon-button:active::before {
  transform: translate(-50%, -50%) scale(0.96);
}

.icon-button:hover::before {
  background: rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 6px 14px rgba(15, 23, 42, 0.16);
}

.icon-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.icon-button .icon-svg {
  position: relative;
  z-index: 1;
}

.icon-svg {
  width: 16px;
  height: 16px;
  opacity: 0.98;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-svg path,
.icon-svg circle {
  stroke: inherit;
  fill: none;
}

.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 2px #ffffff,
    0 4px 8px rgba(239, 68, 68, 0.28);
}

.notif-badge[hidden] {
  display: none;
}

.header-user-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--brand-text-on-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.app-header-right .header-user-count {
  margin-left: 0;
}

.header-user-count .icon-svg {
  width: 14px;
  height: 14px;
}

.header-user-count-value {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

@media (max-width: 380px) {
  .header-user-count-value {
    display: none;
  }

  .header-user-count {
    padding: 3px 6px;
    gap: 0;
  }
}

/* =========================================================
   6. BOTTOM NAV
========================================================= */

.bottom-nav {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  min-height: var(--bottom-nav-height);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 4px;
  padding: 8px 6px calc(8px + var(--tg-safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.16),
    0 3px 10px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 4;
}

.nav-btn {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 12px;
  cursor: pointer;
  color: #64748b;
  background: transparent;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.nav-btn:hover {
  background: rgba(var(--tenant-primary-rgb), 0.10);
  color: var(--tenant-primary-dark);
}

.nav-btn.active {
  color: var(--tenant-primary-dark);
  background: linear-gradient(
    135deg,
    rgba(var(--tenant-primary-rgb), 0.16),
    rgba(var(--tenant-primary-soft-rgb), 0.24)
  );
  box-shadow:
    inset 0 0 0 1px rgba(var(--tenant-primary-rgb), 0.14),
    0 4px 12px rgba(var(--tenant-primary-rgb), 0.14);
}

.nav-btn svg {
  width: 21px;
  height: 21px;
  display: block;
}

.nav-btn svg path,
.nav-btn svg rect,
.nav-btn svg circle,
.nav-btn svg line,
.nav-btn svg polyline {
  stroke: currentColor;
}

.nav-btn.active {
  color: var(--tenant-primary);
}

.nav-btn-icon-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-btn-label {
  font-size: 11px;
  line-height: 1.1;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.nav-btn-badge {
  position: absolute;
  top: -2px;
  right: -6px;
  min-width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand-danger);
  box-shadow: 0 0 0 2px #ffffff;
  display: none;
}

.nav-btn-badge--dot {
  padding: 0;
}

/* =========================================================
   7. GENERIC CARDS
========================================================= */

.card,
.profile-card,
.module-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 10px 26px rgba(15, 23, 42, 0.10),
    0 3px 10px rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.82);
}

.card {
  border-radius: 14px;
  padding: 16px 18px;
}

.profile-card {
  border-radius: 18px;
  padding: 16px 18px;
}

.module-card {
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.module-header {
  margin-bottom: 8px;
}

.module-header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 4px;
}

.module-header-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* =========================================================
   8. BUTTONS
========================================================= */

.btn {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--tenant-primary),
    var(--tenant-primary-dark)
  );
  box-shadow:
    0 4px 12px rgba(var(--tenant-primary-rgb), 0.35),
    0 2px 4px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    filter 0.18s ease,
    background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--brand-success),
    var(--brand-success-dark)
  );
  box-shadow:
    0 4px 12px rgba(16, 185, 129, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn-logout {
  background: linear-gradient(135deg, #f97373, var(--brand-danger));
  box-shadow:
    0 4px 12px rgba(239, 68, 68, 0.35),
    0 2px 4px rgba(0, 0, 0, 0.08);
}

.btn-block {
  width: 100%;
}

/* =========================================================
   9. CARD SECTION
========================================================= */

.card-section {
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.90);
  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.12),
    0 4px 12px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  margin-bottom: 14px;
}

.card-section-header {
  padding: 13px 16px;
  background:
    linear-gradient(
      135deg,
      var(--tenant-primary-dark) 0%,
      var(--tenant-primary) 100%
    );
  color: #ffffff;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.card-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.card-section-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.35;
  opacity: 0.94;
}

.card-section-body {
  padding: 15px 16px 16px;
  background: transparent;
  font-size: 14px;
  color: #374151;
}

.card:hover,
.profile-card:hover,
.module-card:hover,
.card-section:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.13),
    0 6px 16px rgba(15, 23, 42, 0.06);
}

.card,
.profile-card,
.module-card,
.card-section {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

/* =========================================================
   10. SHARED COMPONENTS / ACCORDION CARDS
   Общий стиль аккордеонов для всех главных страниц
   (partner, payments и др.)
========================================================= */

.accordion-card {
  width: 100%;
  max-width: 100%;
  margin: 0 0 14px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.12),
    0 4px 12px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.accordion-card:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.13),
    0 6px 16px rgba(15, 23, 42, 0.06);
}

.accordion-header {
  width: 100%;
  min-height: 56px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  border: none;
  text-align: left;
  background: linear-gradient(
    135deg,
    var(--tenant-primary-dark) 0%,
    var(--tenant-primary) 100%
  );
  color: #ffffff;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.accordion-header-title {
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
  color: #ffffff;
}

.accordion-header-icon {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  font-size: 0;
  line-height: 0;
  color: #ffffff;
}

.accordion-header-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: translate(-50%, -62%) rotate(45deg);
  transition: transform 0.18s ease;
}

.accordion-card.open > .accordion-header .accordion-header-icon::before {
  transform: translate(-50%, -38%) rotate(225deg);
}

.accordion-body {
  display: none;
  padding: 15px 16px 16px;
  background: transparent;
  color: #374151;
}

.accordion-card.open .accordion-body {
  display: block;
}

/* =========================================================
   11. INDEX / AUTH START
   Старая разметка, новый общий стиль
========================================================= */

.auth-start-card {
  width: 100%;
  max-width: 456px;
  margin: auto;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.16),
    0 6px 16px rgba(15, 23, 42, 0.08);
}

.auth-start-header {
  padding: 18px 18px 16px;
}

.auth-start-title {
  margin: 0;
  text-align: center;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  font-weight: 900;
  color: #ffffff;
  text-wrap: balance;
}

.auth-start-line {
  display: block;
}

.auth-start-line-light {
  color: rgba(255, 255, 255, 0.98);
}

.auth-start-line-accent {
  color: #ffffff;
  text-shadow:
    0 0 0 rgba(255, 255, 255, 0),
    0 2px 12px rgba(255, 255, 255, 0.10);
}

.auth-start-subtitle {
  margin: 10px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  text-wrap: pretty;
}

.auth-start-card .card-section-body {
  padding: 18px 18px 18px;
}

.auth-start-note {
  margin: 0 0 14px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #334155;
  font-size: 14px;
  line-height: 1.52;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.40);
}

.auth-consent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #0f172a;
  font-size: 14px;
  line-height: 1.48;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.auth-consent-item:last-of-type {
  margin-bottom: 16px;
}

.auth-consent-checkbox {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--tenant-primary);
  cursor: pointer;
}

.auth-consent-item span {
  display: block;
}

.auth-consent-link {
  color: var(--tenant-primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.auth-consent-link:hover {
  text-decoration: underline;
}

.auth-start-button {
  min-height: 46px;
  margin-top: 2px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  box-shadow:
    0 10px 22px rgba(16, 185, 129, 0.28),
    0 3px 8px rgba(15, 23, 42, 0.08);
}

.auth-start-button:disabled,
.auth-start-button.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.08);
}

.auth-start-footnote {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  color: #94a3b8;
}

/* =========================================================
   12. HOME
========================================================= */

.home-page {
  padding: 12px 16px 16px;
}

.home-card-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #374151;
  text-align: left;
}

.home-card-text + .home-card-text {
  margin-top: 10px;
}

.home-card-stack,
.home-module-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-module-item {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  padding: 14px;
  background: rgba(248, 252, 255, 0.92);
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.08),
    0 2px 8px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.home-module-item.is-frozen {
  background: rgba(243, 244, 246, 0.92);
  border-color: rgba(203, 213, 225, 0.9);
}

.home-module-item:hover {
  transform: translateY(-1px);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.10),
    0 4px 12px rgba(15, 23, 42, 0.05);
}

.home-module-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.home-module-title {
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  line-height: 1.3;
}

.home-module-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-module-badge.required {
  background: rgba(var(--tenant-primary-rgb), 0.14);
  color: var(--tenant-primary-dark);
  box-shadow: inset 0 0 0 1px rgba(var(--tenant-primary-rgb), 0.10);
}

.home-module-badge.free {
  background: rgba(16, 185, 129, 0.14);
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.10);
}

.home-module-badge.paid {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.10);
}

.home-module-status {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 12px;
  line-height: 1.45;
  text-align: left;
}

.home-module-status.is-warning {
  color: #b45309;
  font-weight: 700;
}

.home-module-status.is-free {
  color: #15803d;
  font-weight: 700;
}

.home-module-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.home-module-open-btn {
  min-height: 40px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  box-shadow:
    0 8px 18px rgba(var(--tenant-primary-rgb), 0.22),
    0 2px 6px rgba(15, 23, 42, 0.08);
}

.home-module-open-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.home-links-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.home-text-link {
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: var(--tenant-primary-dark);
  text-decoration: none;
}

.home-text-link:hover {
  color: var(--tenant-primary);
}

.home-empty-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
  text-align: left;
}

/* =========================================================
   13. HOME PROFILE
========================================================= */

.home-profile-card {
  margin-bottom: 16px;
}

.home-profile-card .card-section-body {
  padding: 16px;
}

.home-profile-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin: 0;
}

.home-profile-avatar {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background:
    linear-gradient(
      135deg,
      var(--tenant-primary-dark) 0%,
      var(--tenant-primary) 100%
    );
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow:
    0 10px 22px rgba(59, 130, 246, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.home-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-profile-main {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.home-profile-name {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  color: #111827;
  word-break: break-word;
}

.home-profile-username,
.home-profile-id,
.home-profile-email {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  color: #64748b;
  word-break: break-word;
}

.home-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.home-profile-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.home-profile-note-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.home-profile-note-gear {
  width: 16px;
  height: 16px;
}

.home-profile-note-gear path {
  stroke: #64748b;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-profile-extra {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* =========================================================
   HOME / PROFILE + ACCESS
   Одна верхняя карточка: профиль слева, статус доступа справа.
   На узком экране access panel переносится вниз, оставаясь
   внутри той же карточки.
   ========================================================= */

.home-profile-access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.72fr);
  gap: 16px;
  align-items: stretch;
}

.home-profile-card .home-profile-row {
  min-width: 0;
  align-self: center;
}

.home-access-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.045);
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.14);
}

.home-access-status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: normal;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.home-access-status-badge.is-vip {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.22);
}

.home-access-status-badge.is-promo {
  background: rgba(16, 185, 129, 0.14);
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.16);
}

.home-access-status-badge.is-neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.16);
}

.home-access-status-text {
  margin: 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.4;
}

.home-access-status-date {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 519px) {
  .home-profile-access-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-access-panel {
    padding: 13px 14px;
    border-radius: 14px;
  }
}

/* =========================================================
   14. HOME / AFFILIATE CARD
   Партнёрская карточка на Home:
   - нейтральный текст без привязки к бренду
   - более "дорогой" фон в стиле miniapp
   - выделенная строка баланса в muted-summary стиле
========================================================= */

#homeAffiliateCard {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(246, 250, 255, 0.95) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.08),
    0 4px 14px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

#homeAffiliateCard::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 72px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(255, 255, 255, 0) 100%
    );
  pointer-events: none;
}

#homeAffiliateCard::after {
  content: "";
  position: absolute;
  top: -42px;
  right: -36px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background:
    radial-gradient(
      circle,
      rgba(59, 130, 246, 0.14) 0%,
      rgba(59, 130, 246, 0.05) 42%,
      rgba(59, 130, 246, 0) 74%
    );
  pointer-events: none;
}

#homeAffiliateCard .card-section-header,
#homeAffiliateCard .card-section-body {
  position: relative;
  z-index: 1;
}

#homeAffiliateCard .card-section-body {
  padding: 16px;
}

#homeAffiliateCard .home-card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#homeAffiliateCard .home-card-text {
  max-width: none;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  text-wrap: pretty;
}

#homeAffiliateCard .home-affiliate-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background:
    linear-gradient(
      180deg,
      rgba(15, 23, 42, 0.038) 0%,
      rgba(15, 23, 42, 0.055) 100%
    );
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 1px 2px rgba(15, 23, 42, 0.03);
}

#homeAffiliateCard .home-affiliate-balance-label {
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

#homeAffiliateCard .home-affiliate-balance-value {
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 800;
  color: #111827;
  text-align: right;
  word-break: break-word;
}

#openAffiliateButton {
  min-height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  background:
    linear-gradient(
      135deg,
      var(--tenant-primary-dark) 0%,
      var(--tenant-primary) 100%
    );
  box-shadow:
    0 10px 22px rgba(59, 130, 246, 0.24),
    0 3px 8px rgba(15, 23, 42, 0.08);
}

#openAffiliateButton:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(59, 130, 246, 0.28),
    0 5px 12px rgba(15, 23, 42, 0.10);
}

#openAffiliateButton:active {
  transform: translateY(0);
}

@media (max-width: 380px) {
  #homeAffiliateCard .home-affiliate-balance {
    flex-direction: column;
    align-items: flex-start;
  }

  #homeAffiliateCard .home-affiliate-balance-value {
    text-align: left;
  }
}

/* 15. SETTINGS */
.settings-page {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-page .card-section-body {
  color: #334155;
}

.settings-page .card-section-title {
  letter-spacing: 0.01em;
}

.settings-page .card-section-subtitle {
  color: rgba(255, 255, 255, 0.94);
  font-size: 12px;
  line-height: 1.4;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.settings-input {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--border-mid);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
  color: #0f172a;
  font: inherit;
  line-height: 1.4;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}

.settings-input::placeholder {
  color: #64748b;
  opacity: 1;
}

.settings-input:hover {
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(255, 255, 255, 0.96);
}

.settings-input:focus {
  border-color: var(--brand-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.settings-input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: rgba(241, 245, 249, 0.95);
}

.settings-input:invalid {
  box-shadow: none;
}

.settings-helper-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}

.settings-success-text,
.settings-error-text {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}

.settings-success-text {
  color: #15803d;
}

.settings-error-text {
  color: #b42318;
}

.settings-info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.settings-info-row:first-child {
  padding-top: 0;
}

.settings-info-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.settings-info-label {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  color: #475569;
}

.settings-info-value {
  margin: 0;
  max-width: 58%;
  text-align: right;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

@media (max-width: 380px) {
  .settings-info-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .settings-info-value {
    max-width: 100%;
    text-align: left;
  }
}

/* =========================================================
   16. CHAT / MY AGENT / SHARED CHAT
   - полноценная страница my-agent
   - единый язык с modules / partner / settings
   - естественный рост окна сообщений без искусственной высоты
   - более контрастная кнопка голосового сообщения
========================================================= */

.page-my-agent {
  padding: 12px 16px 16px;
}

.my-agent-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.my-agent-page .card-section-body {
  color: #334155;
}

.my-agent-page .card-section-subtitle {
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.4;
}

.my-agent-lead {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #475569;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-access-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(245, 158, 11, 0.12) 0%,
    rgba(251, 191, 36, 0.08) 100%
  );
  border: 1px solid rgba(245, 158, 11, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 4px 12px rgba(15, 23, 42, 0.04);
}

.agent-access-banner[hidden] {
  display: none !important;
}

.agent-access-banner__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #92400e;
}

.agent-access-banner__button {
  width: auto;
  min-width: 180px;
  align-self: flex-start;
  min-height: 42px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px 4px 0;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.chat-message-agent {
  align-self: flex-start;
}

.chat-message-client {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-message-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 11px;
  line-height: 1.2;
  color: #64748b;
}

.chat-message-client .chat-message-meta {
  justify-content: flex-end;
}

.chat-bubble {
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.06),
    0 2px 6px rgba(15, 23, 42, 0.03);
}

.chat-message-agent .chat-bubble {
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-top-left-radius: 10px;
}

.chat-message-client .chat-bubble {
  background: linear-gradient(
    135deg,
    rgba(var(--tenant-primary-rgb), 0.14),
    rgba(var(--tenant-primary-soft-rgb), 0.22)
  );
  color: #0f172a;
  border: 1px solid rgba(var(--tenant-primary-rgb), 0.14);
  border-top-right-radius: 10px;
}

.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.chat-input {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-mid);
  background: rgba(248, 250, 252, 0.92);
  color: #0f172a;
  font-size: 14px;
  line-height: 1.45;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.chat-input::placeholder {
  color: #64748b;
  opacity: 1;
}

.chat-input:hover {
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(255, 255, 255, 0.96);
}

.chat-input:focus {
  border-color: var(--brand-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.chat-input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: rgba(241, 245, 249, 0.95);
}

.chat-input:disabled::placeholder {
  color: #94a3b8;
}

.btn.btn-send:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  filter: grayscale(0.08);
}

.chat-input-actions-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.btn.btn-send {
  flex: 1 1 auto;
  min-height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.btn.btn-icon {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tenant-primary-dark);
  color: #ffffff;
  border: 1px solid rgba(11, 60, 120, 0.22);
  box-shadow:
    0 10px 22px rgba(11, 60, 120, 0.24),
    0 3px 8px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    filter 0.18s ease,
    background 0.18s ease;
}

.btn.btn-icon:hover {
  transform: translateY(-1px);
  background: var(--tenant-primary);
  box-shadow:
    0 14px 28px rgba(11, 60, 120, 0.28),
    0 5px 12px rgba(15, 23, 42, 0.10);
}

.btn.btn-icon:active {
  transform: translateY(0);
}

.btn.btn-icon:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.btn-icon.recording {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: rgba(127, 29, 29, 0.32);
  box-shadow:
    0 10px 22px rgba(220, 38, 38, 0.24),
    0 3px 8px rgba(15, 23, 42, 0.08);
}

.btn.btn-icon .icon-mic {
  width: 18px;
  height: 18px;
  display: block;
}

.btn.btn-icon .icon-mic path {
  fill: #ffffff;
}

.connect-status-msg {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  color: #64748b;
}

.connect-status-msg.success {
  color: #15803d;
}

.connect-status-msg.error {
  color: #b42318;
}

.shared-chat-coming {
  text-align: center;
}

.shared-chat-coming-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    var(--tenant-primary-dark),
    var(--tenant-primary)
  );
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.shared-chat-coming-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.shared-chat-coming-text {
  margin: 0 auto 18px;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563;
}

.shared-chat-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  text-align: left;
}

@media (max-width: 420px) {
  .page-my-agent {
    padding: 10px 14px 14px;
  }

  .agent-access-banner {
    padding: 12px;
    gap: 10px;
  }

  .agent-access-banner__text {
    font-size: 12px;
    line-height: 1.5;
  }

  .agent-access-banner__button {
    width: 100%;
    min-width: 0;
  }
   
  .chat-messages {
    max-height: 360px;
  }

  .chat-message {
    max-width: 92%;
  }

  .chat-input {
    min-height: 82px;
  }
}

/* =========================================================
   17. MODULES CATALOG CARDS
   Для modules.html:
   - в синем header название в одну строку
   - в белой части сверху: короткое описание слева, badge справа
   - ниже кнопка
   - summary-card в начале: каталог и статус модулей
========================================================= */

.module-accordion-card {
  overflow: hidden;
}

.module-card-toggle {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.module-card-header-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.module-card-title {
  display: inline;
  margin: 0;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: 0.01em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-card-title-ru {
  display: inline;
  margin: 0;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.84);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-card-toggle .accordion-header-icon {
  flex: 0 0 auto;
  margin-left: 2px;
}

.module-card-main {
  padding-top: 14px;
}

.module-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 10px;
  row-gap: 8px;
  margin-bottom: 14px;
  width: 100%;
}

.module-card-short-description {
  margin: 0;
  min-width: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
  text-align: left;
}

.module-card-top .module-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  align-self: start;
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  border: none;
  box-shadow: inset 0 0 0 1px transparent;
}

.module-card-badge.is-base {
  background: rgba(var(--tenant-primary-rgb), 0.14);
  color: var(--tenant-primary-dark);
  box-shadow: inset 0 0 0 1px rgba(var(--tenant-primary-rgb), 0.10);
}

.module-card-badge.is-free {
  background: rgba(16, 185, 129, 0.14);
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.10);
}

.module-card-badge.is-optional {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.module-card-badge.external {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.10);
}

/* summary card in the top of modules page */

.modules-summary-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modules-summary-body .profile-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.40);
}

.modules-summary-body .profile-label {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tenant-primary-dark);
}

.modules-summary-body .profile-value {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
  color: #334155;
  text-align: left;
  word-break: break-word;
}

.modules-summary-body .profile-value strong {
  color: #0f172a;
  font-weight: 800;
}

.module-card-expanded {
  display: none;
  padding-top: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  margin-top: 2px;
}

.module-card-expanded.open {
  display: block;
}

.module-card-expanded-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.module-card-description-list {
  margin: 0;
  padding-left: 18px;
  color: #334155;
}

.module-card-description-list li {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}

.module-card-description-list li:last-child {
  margin-bottom: 0;
}

.module-card-main .btn,
.module-card-expanded .btn {
  width: 100%;
}

.module-card-main .btn.btn-disabled,
.module-card-main .btn:disabled {
  background: #e2e8f0;
  color: #64748b;
  border: 1px solid #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 1;
  transform: none;
}

.module-card-main .btn.btn-disabled:hover,
.module-card-main .btn:disabled:hover {
  background: #e2e8f0;
  color: #64748b;
  box-shadow: none;
  transform: none;
}

@media (max-width: 480px) {
  .module-card-toggle {
    min-height: 50px;
    gap: 8px;
  }

  .module-card-header-main {
    gap: 4px;
  }

  .module-card-title {
    font-size: 16px;
  }

  .module-card-title-ru {
    font-size: 13px;
  }

  .module-card-top {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .module-card-top .module-card-badge {
    justify-self: start;
    min-height: 22px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .modules-summary-body .profile-row {
    padding: 11px 12px;
    gap: 5px;
  }

  .modules-summary-body .profile-label {
    font-size: 11px;
  }

  .modules-summary-body .profile-value,
  .module-card-description-list li,
  .module-card-short-description {
    font-size: 13px;
  }
}

/* =========================================================
   18. SKELETONS
========================================================= */

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #ececec 25%, #f6f6f6 50%, #ececec 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-line {
  height: 1em;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-line:last-child {
  width: 60%;
}

.skeleton-btn {
  height: 38px;
  width: 100%;
  border-radius: 8px;
  margin-top: 8px;
}

.home-modules-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.home-modules-skeleton-item {
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

/* =========================================================
   19. SERVICE LAYERS / FALLBACK UI
========================================================= */

#pwaBanner {
  display: none;
}

#pwaBanner.visible {
  display: block;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.90);
  color: #1f2937;
  box-shadow: var(--shadow-dark-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#pwaBannerClose {
  margin-top: 8px;
  color: var(--tenant-primary);
  font-weight: 700;
  cursor: pointer;
}

#shellLoading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(207, 233, 255, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
}

#shellLoading.hidden {
  display: none !important;
}

#shellLoading > * {
  width: 100%;
  max-width: 320px;
  padding: 20px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-dark-md);
  text-align: center;
}

#shellLoaderMark,
#appBrandMark {
  font-size: 28px;
  font-weight: 800;
  color: var(--tenant-primary-dark);
}

#shellLoadingText,
#appBrandSubtitle {
  margin-top: 8px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.4;
}

/* =========================================================
   20. RESPONSIVE
========================================================= */

@media (max-width: 520px) {
  .auth-start-card {
    border-radius: 20px;
  }

  .auth-start-header {
    padding: 17px 16px 15px;
  }

  .auth-start-card .card-section-body {
    padding: 16px;
  }

  .auth-start-note {
    padding: 12px 13px;
  }

  .auth-consent-item {
    gap: 9px;
    padding: 11px 12px;
  }
}

@media (max-width: 380px) {
  .screen {
    padding: 12px;
  }

  .app-shell {
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
  }

  .auth-start-title {
    font-size: 38px;
  }

  .auth-start-subtitle {
    font-size: 13px;
  }

  .auth-start-note,
  .auth-consent-item {
    font-size: 13px;
  }

  .home-page {
    padding: 10px 12px 16px;
  }

  .home-module-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-links-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .settings-page {
    padding: 10px 14px 14px;
  }

  .settings-info-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .settings-info-value {
    max-width: 100%;
    text-align: left;
  }

  .nav-btn-label {
    font-size: 10px;
  }
}

@media (min-width: 768px) {
  .screen {
    align-items: center;
  }

  .app-shell {
    max-width: var(--app-max-width);
  }
}

/* =========================================================
   21. GLOBAL / SCROLLBARS
========================================================= */

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 60, 120, 0.28) transparent;
}

body {
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 60, 120, 0.28) transparent;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 60, 120, 0.28) transparent;
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.70) 0%,
      rgba(126, 200, 255, 0.55) 45%,
      rgba(59, 130, 246, 0.38) 100%
    );
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 1px 4px rgba(15, 23, 42, 0.10);
}

*::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.82) 0%,
      rgba(96, 165, 250, 0.68) 45%,
      rgba(11, 60, 120, 0.46) 100%
    );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    0 2px 6px rgba(15, 23, 42, 0.12);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* =========================================================
   22. PARTNER PAGE
========================================================= */

.partner-page {
  padding: 12px 16px 16px;
}

.partner-hero-card {
  margin-bottom: 14px;
}

.partner-hero-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.partner-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
}

.partner-balance-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background:
    linear-gradient(
      180deg,
      rgba(15, 23, 42, 0.035) 0%,
      rgba(15, 23, 42, 0.055) 100%
    );
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 1px 2px rgba(15, 23, 42, 0.03);
}

.partner-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.partner-balance-label {
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

.partner-balance-value {
  min-width: 0;
  font-size: 16px;
  line-height: 1.2;
  color: #111827;
  font-weight: 800;
  text-align: right;
  word-break: break-word;
}

.partner-balance-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.partner-payout-btn {
  min-height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.partner-muted-text {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}

.partner-ref-link {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #0f172a;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.partner-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.partner-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.partner-stat-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.partner-stat-label {
  font-size: 14px;
  line-height: 1.4;
  color: #475569;
}

.partner-stat-value {
  font-size: 15px;
  line-height: 1.2;
  color: #111827;
  font-weight: 800;
}

.partner-tree-title {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--tenant-primary-dark);
}

.partner-list {
  margin: 0;
  padding-left: 18px;
  color: #374151;
  font-size: 13px;
  line-height: 1.55;
}

.partner-list li + li {
  margin-top: 6px;
}

@media (max-width: 380px) {
  .partner-balance-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .partner-balance-value {
    text-align: left;
  }
}

/* =========================================================
   23. PAYMENTS PAGE
========================================================= */

.payments-page {
  padding: 12px 16px 16px;
}

.payments-page .card-section,
.payments-page .accordion-card {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.payments-lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.payments-muted-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.payments-balance-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
}

.payments-balance-amount {
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  color: #111827;
}

.payments-balance-currency {
  font-size: 14px;
  line-height: 1.2;
  color: #475569;
}

.payments-accordion-body {
  padding-top: 14px;
}

.payments-module-intro {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(var(--tenant-primary-rgb), 0.08);
  border: 1px solid rgba(var(--tenant-primary-rgb), 0.14);
}

.payments-module-intro-main {
  min-width: 0;
}

.payments-module-intro-title {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
  color: #0f172a;
}

.payments-module-intro-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.payments-tariffs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.payments-tariff-card {
  position: relative;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.payments-tariff-card-featured {
  border-color: rgba(var(--tenant-primary-rgb), 0.28);
  background: linear-gradient(
    180deg,
    rgba(var(--tenant-primary-rgb), 0.06) 0%,
    rgba(255, 255, 255, 0.92) 100%
  );
}

.payments-tariff-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(var(--tenant-primary-rgb), 0.12);
  color: var(--tenant-primary-dark);
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.payments-tariff-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.payments-tariff-heading-group {
  min-width: 0;
  flex: 1 1 auto;
}

.payments-tariff-name {
  margin: 0 0 5px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
  color: #111827;
}

.payments-tariff-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.payments-tariff-price-wrap {
  flex: 0 0 auto;
  text-align: right;
}

.payments-tariff-price {
  display: inline-block;
  font-size: 20px;
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.payments-plan-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.payments-plan-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.035);
}

.payments-plan-meta-label {
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
}

.payments-plan-meta-value {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 800;
  color: #0f172a;
  text-align: right;
}

.payments-plan-meta-value-muted {
  color: #475569;
}

.payments-plan-meta-value-success {
  color: #16a34a;
}

.payments-tariff-divider {
  height: 1px;
  margin: 12px 0;
  background: rgba(148, 163, 184, 0.22);
}

.payments-offer-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  cursor: pointer;
}

.payments-offer-checkbox input[type="checkbox"] {
  margin-top: 2px;
  flex: 0 0 auto;
  cursor: pointer;
}

.payments-offer-text {
  font-size: 12px;
  line-height: 1.5;
  color: #334155;
}

.payments-offer-link {
  color: var(--tenant-primary);
  text-decoration: underline;
}

.payments-pay-button {
  font-size: 13px;
}

@media (max-width: 420px) {
  .payments-tariff-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .payments-tariff-price-wrap {
    text-align: left;
  }

  .payments-plan-meta-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .payments-plan-meta-value {
    text-align: left;
  }
}

/* =========================================================
   23B. PAYMENT CATALOG (API-driven)
   Стили для каталога тарифов на основе backend API:
   - selectable карточки с состоянием is-selected
   - catalog status (loading/error/empty/disabled)
   - checkout bar (consent + pay button + action status)
   БЕЗ inline styles: все состояния только через классы.
========================================================= */

.payments-catalog-status,
.checkout-catalog-status {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.payments-catalog-status.is-error,
.checkout-catalog-status.is-error {
  background: rgba(220, 38, 38, 0.07);
  border-color: rgba(220, 38, 38, 0.22);
  color: #b91c1c;
}

.payments-tariff-card.payments-selectable-card {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease,
    background-color 0.16s ease, transform 0.16s ease;
}

.payments-tariff-card.payments-selectable-card:focus-visible {
  outline: 2px solid rgba(var(--tenant-primary-rgb), 0.5);
  outline-offset: 2px;
}

.payments-tariff-card.payments-selectable-card:hover {
  border-color: rgba(var(--tenant-primary-rgb), 0.32);
}

.payments-tariff-card.payments-selectable-card.is-selected {
  border-color: var(--tenant-primary);
  background: rgba(var(--tenant-primary-rgb), 0.07);
  box-shadow: 0 4px 18px rgba(var(--tenant-primary-rgb), 0.18);
}

.payments-checkout-bar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.payments-pay-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.payments-action-status,
.checkout-action-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.035);
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

.payments-action-status.is-error,
.checkout-action-status.is-error {
  background: rgba(220, 38, 38, 0.07);
  color: #b91c1c;
}

/* =========================================================
   23C. PAYMENT CHECKOUT (crypto flow)
   Стили страницы оплаты:
   - summary card (сумма, сеть, кошелёк, countdown)
   - hash form (64 hex)
   - submitted / manual-review panels
   - terminal states (confirmed / rejected / expired)
   - empty state
   БЕЗ inline styles.
========================================================= */

.checkout-accordion-body {
  padding-top: 14px;
}

.checkout-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 16px 34px;
}

.checkout-empty-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--tenant-primary-rgb), 0.1);
  color: var(--tenant-primary);
  font-size: 24px;
  line-height: 1;
}

.checkout-empty-title {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
  color: #111827;
}

.checkout-empty-text {
  max-width: 280px;
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.checkout-empty-button {
  font-size: 13px;
}

.checkout-summary-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.checkout-summary-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.checkout-summary-label {
  font-size: 13px;
  line-height: 1.4;
  color: #475569;
}

.checkout-summary-price {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.checkout-summary-plan-row {
  margin-top: 10px;
}

.checkout-summary-plan-value {
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
  color: #0f172a;
  text-align: right;
}

.checkout-summary-network-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.checkout-summary-network-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(var(--tenant-primary-rgb), 0.12);
  color: var(--tenant-primary-dark);
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.checkout-summary-network-note {
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

.checkout-wallet-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(148, 163, 184, 0.3);
}

.checkout-wallet-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
}

.checkout-wallet-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkout-wallet-value {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-family: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #0f172a;
  word-break: break-all;
}

.checkout-copy-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid rgba(var(--tenant-primary-rgb), 0.28);
  border-radius: 12px;
  background: rgba(var(--tenant-primary-rgb), 0.08);
  color: var(--tenant-primary-dark);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.16s ease, opacity 0.16s ease;
}

.checkout-copy-button:hover {
  background: rgba(var(--tenant-primary-rgb), 0.16);
}

.checkout-copy-button:active {
  opacity: 0.7;
}

.checkout-copy-feedback {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #16a34a;
}

.checkout-countdown-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(148, 163, 184, 0.3);
}

.checkout-countdown-label {
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
}

.checkout-countdown-value {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.checkout-hash-form {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.checkout-hash-label {
  display: block;
  margin-bottom: 8px;
}

.checkout-hash-label > span {
  display: block;
}

.checkout-hash-label-text {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  color: #0f172a;
}

.checkout-hash-hint {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
  color: #64748b;
}

.checkout-hash-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.9);
  font-family: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #0f172a;
}

.checkout-hash-input:focus {
  outline: 2px solid rgba(var(--tenant-primary-rgb), 0.45);
  outline-offset: 0;
  border-color: rgba(var(--tenant-primary-rgb), 0.5);
}

.checkout-hash-input[readonly] {
  background: rgba(15, 23, 42, 0.035);
  color: #64748b;
}

.checkout-hash-submit {
  font-size: 13px;
}

.checkout-hash-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkout-hash-status {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(var(--tenant-primary-rgb), 0.22);
  background: rgba(var(--tenant-primary-rgb), 0.07);
  text-align: center;
}

.checkout-hash-status-title {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 800;
  color: #0f172a;
}

.checkout-hash-status-text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.checkout-hash-check-button {
  font-size: 13px;
}

.checkout-manual-review-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  text-align: center;
}

.checkout-terminal-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px 26px;
}

.checkout-terminal-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.checkout-terminal-icon-success {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}

.checkout-terminal-icon-neutral {
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
}

.checkout-terminal-title {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
  color: #111827;
}

.checkout-terminal-text {
  max-width: 280px;
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
}

.clipboard-helper {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  opacity: 0;
}

/* =========================================================
   PREFERS-REDUCED-MOTION
   Минимизация анимаций для пользователей с настройкой
   prefers-reduced-motion. Применяется ко всему интерфейсу,
   включая новые payment/checkout состояния.
========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   24. MODULE PAGES BACKGROUND FIX
   Фикс фона для страниц модулей внутри iframe:
   - убирает паразитный белый фон на stats.html и других module pages
   - сохраняет текущий дизайн карточек без переопределения card-section
   - page/page-my-agent остаётся прозрачным, фон задаётся через body.module-body
========================================================= */

body.module-body {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--tenant-bg-start);
  background-image: linear-gradient(
    135deg,
    var(--tenant-bg-start),
    var(--tenant-bg-mid),
    var(--tenant-bg-accent),
    var(--tenant-bg-end)
  );
}

body.module-body .page.page-my-agent {
  background: transparent;
}

/* =========================================================
   25. NOTIFICATION CENTER (EMPTY STATE)
   Честный пустой экран уведомлений без backend:
   - только заголовок, нейтральная SVG-иллюстрация и пояснение
   - никаких fake feed-данных, фильтров, статусов или записей
   ========================================================= */

.notifications-page .card-section {
  margin-top: 12px;
}

.notifications-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 16px 36px;
}

.notifications-empty-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  color: var(--tenant-primary);
  opacity: 0.85;
}

.notifications-empty-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
}

.notifications-empty-note {
  max-width: 280px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
