﻿/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition:
    transform var(--transition),
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  font-weight: 600;
}
:root[data-theme='dark'] .btn {
  background: transparent;
}
:root[data-theme='oled'] .btn {
  background: rgba(255, 255, 255, 0.04);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: rgba(109, 74, 255, 0.24);
}
.btn:active {
  transform: translateY(0px);
}
.btn-primary {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.96), rgba(124, 92, 255, 0.92));
  border-color: rgba(109, 74, 255, 0.3);
  color: white;
  box-shadow: 0 12px 26px rgba(109, 74, 255, 0.22);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(109, 74, 255, 1), rgba(124, 92, 255, 0.98));
  border-color: rgba(109, 74, 255, 0.4);
}
.btn-icon {
  width: 40px;
  padding: 0;
}
.btn-small {
  height: 34px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 13px;
}
.btn-sm {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.btn-secondary {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.14), rgba(124, 92, 255, 0.1));
  border-color: rgba(109, 74, 255, 0.35);
  color: var(--text);
}
.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.22), rgba(124, 92, 255, 0.16));
  border-color: rgba(109, 74, 255, 0.5);
}
.btn-ghost {
  background: transparent;
  border-color: var(--line2);
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--panel2);
  border-color: var(--line);
  color: var(--text);
}
.notify-btn {
  position: relative;
}
.notify-btn[hidden] {
  display: none !important;
}
.notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}
.notify-badge[hidden] {
  display: none !important;
}
#panelNotifyBtn.has-unread .notify-icon {
  animation: notifyPulse 1.6s ease-in-out infinite;
  color: #ff7a00;
}
.notify-panel-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.notify-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 20px));
  max-height: min(420px, calc(100dvh - 120px));
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
  z-index: 400;
  display: flex;
  flex-direction: column;
  overflow: visible;
  text-align: left;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transform-origin: top right;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.26s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0s linear 0.26s;
}
.notify-dropdown.notify-dropdown--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.24s ease,
    transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0s;
}
@media (prefers-reduced-motion: reduce) and (min-width: 769px) {
  .notify-dropdown {
    transition-duration: 0.01ms;
    transition-delay: 0s !important;
    transform: translateY(-4px);
  }
  .notify-dropdown.notify-dropdown--open {
    transform: none;
  }
}
:root:is([data-theme='dark'], [data-theme='oled']) .notify-dropdown {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.notify-dropdown-bulk {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.notify-dropdown-bulk[hidden] {
  display: none !important;
}
.notify-sheet-backdrop {
  display: none;
}
.notify-sheet-handle {
  display: none;
}
@media (max-width: 768px) {
  .notify-sheet-backdrop {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: calc(env(safe-area-inset-top, 0px) + 56px);
    z-index: 480;
    background: rgba(15, 23, 42, 0.48);
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.22s ease,
      visibility 0s linear 0.26s;
  }
  :root:is([data-theme='dark'], [data-theme='oled']) .notify-sheet-backdrop {
    background: rgba(0, 0, 0, 0.56);
  }
  .notify-panel-wrap:has(.notify-dropdown--open) .notify-sheet-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      opacity 0.24s ease,
      visibility 0s;
  }
  body.notify-sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
  }
  .notify-sheet-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    padding: 10px 0 6px;
    touch-action: none;
    cursor: grab;
  }
  .notify-sheet-handle:active {
    cursor: grabbing;
  }
  .notify-sheet-handle::before {
    content: '';
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: var(--line);
    opacity: 0.88;
  }
  .notify-dropdown {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: none;
    max-height: min(82vh, calc(100dvh - env(safe-area-inset-top, 0px) - 10px));
    margin: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-radius: 22px 22px 0 0;
    transform: translate3d(0, calc(100% + 28px), 0);
    transform-origin: bottom center;
    z-index: 490;
    box-shadow: 0 -16px 52px rgba(15, 23, 42, 0.2);
  }
  .notify-dropdown.notify-dropdown--open {
    transform: translate3d(0, 0, 0);
  }
  :root:is([data-theme='dark'], [data-theme='oled']) .notify-dropdown.notify-dropdown--open {
    box-shadow: 0 -16px 52px rgba(0, 0, 0, 0.48);
  }
  .notify-dropdown-body {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .notify-sheet-backdrop {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .notify-dropdown {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
.notify-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 12px 14px;
  border-bottom: 1px solid var(--line2);
  flex-shrink: 0;
}
.notify-dropdown-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}
.notify-dropdown-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.notify-header-iconbtn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--muted);
  flex-shrink: 0;
  text-decoration: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.18s ease,
    box-shadow 0.2s ease;
}
.notify-header-iconbtn:hover {
  background: var(--chip);
  color: var(--text);
  border-color: rgba(109, 74, 255, 0.3);
  box-shadow: 0 4px 14px rgba(109, 74, 255, 0.1);
}
.notify-header-iconbtn:active {
  transform: scale(0.94);
}
.notify-header-iconbtn .i {
  width: 18px;
  height: 18px;
}
.notify-dropdown-settings.notify-header-iconbtn .i {
  width: 20px;
  height: 20px;
}
/* Кастомный тултип (не браузерный title) */
.panel-tip-wrap {
  position: relative;
}
.panel-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 460;
  transform: translateX(-50%) translateY(6px);
  padding: 8px 11px;
  min-width: max-content;
  max-width: 220px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  border-radius: 11px;
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.12);
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0s linear 0.14s;
}
:root:is([data-theme='dark'], [data-theme='oled']) .panel-tip {
  background: #f1f5f9;
  color: #0f172a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.panel-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #0f172a;
}
:root:is([data-theme='dark'], [data-theme='oled']) .panel-tip::after {
  border-top-color: #f1f5f9;
}
.panel-tip-wrap:hover .panel-tip,
.panel-tip-wrap:focus-visible .panel-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0s;
}
body:has(#modal.show) #panelNotifyBtn.panel-tip-wrap:hover .panel-tip,
body:has(#modal.show) #panelNotifyBtn.panel-tip-wrap:focus-visible .panel-tip {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateX(-50%) translateY(6px);
  transition: none;
}
body:has(#modal.show) #panelNotifyBtn.panel-tip-wrap:hover .panel-tip.panel-tip--below,
body:has(#modal.show) #panelNotifyBtn.panel-tip-wrap:focus-visible .panel-tip.panel-tip--below {
  transform: translateX(-50%) translateY(-8px);
}
body:has(#modal.show) #panelNotifyBtn.panel-tip-wrap--align-end:hover .panel-tip,
body:has(#modal.show) #panelNotifyBtn.panel-tip-wrap--align-end:focus-visible .panel-tip {
  transform: translateX(0) translateY(6px);
}
body:has(#modal.show) #panelNotifyBtn.panel-tip-wrap--align-end:hover .panel-tip.panel-tip--below,
body:has(#modal.show)
  #panelNotifyBtn.panel-tip-wrap--align-end:focus-visible
  .panel-tip.panel-tip--below {
  transform: translateX(0) translateY(-8px);
}
/* Панель открыта: тултип колокольчика отключён (иначе хвостик/пузырь оказываются под dropdown z-index 400) */
#panelNotifyBtn[aria-expanded='true'].panel-tip-wrap:hover .panel-tip,
#panelNotifyBtn[aria-expanded='true'].panel-tip-wrap:focus-visible .panel-tip {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: none !important;
}
#panelNotifyBtn[aria-expanded='true'].panel-tip-wrap:hover .panel-tip.panel-tip--below,
#panelNotifyBtn[aria-expanded='true'].panel-tip-wrap:focus-visible .panel-tip.panel-tip--below {
  opacity: 0 !important;
  visibility: hidden !important;
}
#panelNotifyBtn[aria-expanded='true'].panel-tip-wrap--align-end:hover .panel-tip,
#panelNotifyBtn[aria-expanded='true'].panel-tip-wrap--align-end:focus-visible .panel-tip {
  opacity: 0 !important;
  visibility: hidden !important;
}
.top-actions #themeToggleTop.panel-tip-wrap {
  position: relative;
  z-index: 450;
}
.top-actions #themeToggleTop .panel-tip {
  z-index: 460;
}
.panel-tip-wrap--align-end .panel-tip {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(6px);
  text-align: right;
}
.panel-tip-wrap--align-end:hover .panel-tip,
.panel-tip-wrap--align-end:focus-visible .panel-tip {
  transform: translateX(0) translateY(0);
}
.panel-tip-wrap--align-end .panel-tip::after {
  left: auto;
  right: 12px;
  margin-left: 0;
}
.panel-tip.panel-tip--below {
  bottom: auto;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(-8px);
}
.panel-tip-wrap:hover .panel-tip.panel-tip--below,
.panel-tip-wrap:focus-visible .panel-tip.panel-tip--below {
  transform: translateX(-50%) translateY(0);
}
.panel-tip.panel-tip--below::after {
  top: auto;
  bottom: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-bottom-color: #0f172a;
  border-top-color: transparent;
}
:root:is([data-theme='dark'], [data-theme='oled']) .panel-tip.panel-tip--below::after {
  border-bottom-color: #f1f5f9;
}
.panel-tip-wrap--align-end .panel-tip.panel-tip--below {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(-8px);
  text-align: right;
}
.panel-tip-wrap--align-end:hover .panel-tip.panel-tip--below,
.panel-tip-wrap--align-end:focus-visible .panel-tip.panel-tip--below {
  transform: translateX(0) translateY(0);
}
.panel-tip-wrap--align-end .panel-tip.panel-tip--below::after {
  left: auto;
  right: 12px;
  margin-left: 0;
}
/* Левый край триггера: тултип вправо (кнопка «назад» у кромки обложки) */
.panel-tip-wrap--align-start .panel-tip {
  left: 0;
  right: auto;
  transform: translateX(0) translateY(6px);
  text-align: left;
}
.panel-tip-wrap--align-start:hover .panel-tip,
.panel-tip-wrap--align-start:focus-visible .panel-tip {
  transform: translateX(0) translateY(0);
}
.panel-tip-wrap--align-start .panel-tip::after {
  left: 12px;
  right: auto;
  margin-left: 0;
}
.panel-tip-wrap--align-start .panel-tip.panel-tip--below {
  left: 0;
  right: auto;
  transform: translateX(0) translateY(-8px);
  text-align: left;
}
.panel-tip-wrap--align-start:hover .panel-tip.panel-tip--below,
.panel-tip-wrap--align-start:focus-visible .panel-tip.panel-tip--below {
  transform: translateX(0) translateY(0);
}
.panel-tip-wrap--align-start .panel-tip.panel-tip--below::after {
  left: 12px;
  right: auto;
  margin-left: 0;
}
.top-balance-chip.panel-tip-wrap {
  position: relative;
}

/*
 * Мобилка: центрирование (left:50% + translateX(-50%)) выносит широкий тултип за край экрана
 * → горизонтальный скролл и «дыры». Прижимаем к краю триггера.
 * Не использовать overflow-wrap:anywhere — при width:auto у absolute это даёт ширину «в один знак».
 */
@media (max-width: 720px) {
  .panel-tip {
    max-width: min(320px, calc(100vw - 24px));
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: manual;
    white-space: normal;
    box-sizing: border-box;
  }
  .panel-tip-wrap:not(.panel-tip-wrap--align-end) .panel-tip {
    left: 0;
    right: auto;
    transform: translateY(6px);
    text-align: left;
  }
  .panel-tip-wrap:not(.panel-tip-wrap--align-end):hover .panel-tip,
  .panel-tip-wrap:not(.panel-tip-wrap--align-end):focus-visible .panel-tip {
    transform: translateY(0);
  }
  .panel-tip-wrap:not(.panel-tip-wrap--align-end) .panel-tip::after {
    left: 16px;
    right: auto;
    margin-left: 0;
  }
  .panel-tip-wrap:not(.panel-tip-wrap--align-end) .panel-tip.panel-tip--below {
    transform: translateY(-8px);
  }
  .panel-tip-wrap:not(.panel-tip-wrap--align-end):hover .panel-tip.panel-tip--below,
  .panel-tip-wrap:not(.panel-tip-wrap--align-end):focus-visible .panel-tip.panel-tip--below {
    transform: translateY(0);
  }
  .panel-tip-wrap:not(.panel-tip-wrap--align-end) .panel-tip.panel-tip--below::after {
    left: 16px;
    right: auto;
    margin-left: 0;
  }

  /*
   * Квадратные иконк-кнопки в узкой колонке справа (профиль и т.п.): общее left:0 растягивает
   * тултип вправо от левого края кнопки → обрезание у края экрана. Поведение как у align-end.
   */
  .notify-header-iconbtn.panel-tip-wrap .panel-tip {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(6px);
    text-align: right;
  }
  .notify-header-iconbtn.panel-tip-wrap:hover .panel-tip,
  .notify-header-iconbtn.panel-tip-wrap:focus-visible .panel-tip {
    transform: translateX(0) translateY(0);
  }
  .notify-header-iconbtn.panel-tip-wrap .panel-tip::after {
    left: auto;
    right: 12px;
    margin-left: 0;
  }
  .notify-header-iconbtn.panel-tip-wrap .panel-tip.panel-tip--below {
    transform: translateX(0) translateY(-8px);
  }
  .notify-header-iconbtn.panel-tip-wrap:hover .panel-tip.panel-tip--below,
  .notify-header-iconbtn.panel-tip-wrap:focus-visible .panel-tip.panel-tip--below {
    transform: translateX(0) translateY(0);
  }
  .notify-header-iconbtn.panel-tip-wrap .panel-tip.panel-tip--below::after {
    left: auto;
    right: 12px;
    margin-left: 0;
  }
}

.notify-dropdown-body {
  padding: 4px 10px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  border-radius: 0 0 15px 15px;
}
.notify-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notify-list:empty {
  display: none;
}
.notify-empty {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  padding: 16px 8px;
}
.notify-empty[hidden] {
  display: none !important;
}
.notify-item {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}
.notify-item:last-child {
  margin-bottom: 4px;
}
.notify-item-clip {
  overflow: hidden;
  border-radius: 16px;
}
.notify-item-track {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: calc(100% + 88px);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
}
.notify-item.is-dragging .notify-item-track {
  transition: none;
}
.notify-item-slide-cell {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
}
.notify-item-strip-plank {
  flex: 0 0 88px;
  width: 88px;
  align-self: stretch;
  background: linear-gradient(180deg, #fb7185 0%, #ef4444 50%, #dc2626 100%);
  box-shadow: inset 3px 0 12px rgba(0, 0, 0, 0.12);
}
.notify-item-strip-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  min-height: 72px;
  padding: 8px 4px;
  box-sizing: border-box;
}
.notify-item-strip-ic {
  flex-shrink: 0;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
.notify-item-strip-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.96);
  line-height: 1.15;
  text-align: center;
  max-width: 80px;
}
.notify-item-card {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  background: linear-gradient(145deg, var(--panel2) 0%, rgba(109, 74, 255, 0.04) 100%);
  border: 1px solid var(--line2);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.07);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}
@media (hover: hover) and (pointer: fine) and (min-width: 769px) {
  .notify-item-card:hover {
    border-color: rgba(109, 74, 255, 0.22);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.09);
  }
  .notify-item--read .notify-item-card:hover {
    border-color: rgba(148, 163, 184, 0.35);
  }
}
.notify-item-card-inner {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.notify-item--success .notify-item-card {
  border-left: 4px solid #22c55e;
}
.notify-item--warn .notify-item-card {
  border-left: 4px solid #ea580c;
}
.notify-item--broadcast.notify-item--unread .notify-item-card {
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.1);
}
/* Закреплённое в колокольчике: ссылка на Telegram-канал (без свайпа) */
.notify-item--pinned-tg .notify-item-card--pinned-tg {
  background: var(--panel2);
  border-color: var(--line2);
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
}
.notify-pinned-tg-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notify-pinned-tg-ic-wrap {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--chip);
  border: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.notify-pinned-tg-telegram-svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.notify-pinned-tg-copy {
  flex: 1;
  min-width: 0;
}
.notify-pinned-tg-msg {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}
.notify-item-link--pinned-tg {
  padding: 12px 14px 13px;
}
.notify-item--unread .notify-item-card {
  background: linear-gradient(145deg, rgba(109, 74, 255, 0.09) 0%, var(--panel2) 55%);
  border-color: rgba(109, 74, 255, 0.22);
  box-shadow: 0 4px 18px rgba(109, 74, 255, 0.12);
}
.notify-item--read .notify-item-card {
  opacity: 0.92;
  background: var(--panel2);
  border-color: var(--line2);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}
.notify-item-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 0;
}
.notify-item-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.2;
}
.notify-item-badge--new {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.95), rgba(99, 102, 241, 0.88));
  color: #fff;
  box-shadow: 0 2px 8px rgba(109, 74, 255, 0.35);
}
.notify-item-badge--read {
  background: var(--chip);
  color: var(--muted);
  border: 1px solid var(--line2);
}
.notify-item-link {
  flex: 1;
  min-width: 0;
  padding: 13px 40px 14px 14px;
  text-decoration: none;
  color: inherit;
  display: block;
  text-align: left;
}
@media (max-width: 768px) {
  .notify-item-link {
    padding-right: 14px;
  }
}
.notify-item-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
}
.notify-item--read .notify-item-title {
  font-weight: 700;
  color: var(--text);
}
.notify-item-sub {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
}
.notify-item-hint {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.85;
}
.notify-item-dismiss {
  position: absolute;
  top: 10px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
  transform: translateX(calc(100% + 10px));
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.25s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
@media (hover: hover) and (pointer: fine) and (min-width: 769px) {
  .notify-item-dismiss {
    display: flex;
  }
  .notify-item-card:hover .notify-item-dismiss,
  .notify-item-card:focus-within .notify-item-dismiss {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
}
.notify-item-dismiss:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}
.notify-item-dismiss:active {
  transform: translateX(0) scale(0.92);
}
@media (max-width: 768px) {
  .notify-item-dismiss {
    display: none !important;
  }
}
@media (min-width: 769px) {
  .notify-item-track {
    width: 100%;
  }
  .notify-item-strip-plank {
    display: none;
  }
}
@keyframes notifyPulse {
  0% {
    transform: rotate(0deg) scale(1);
  }
  20% {
    transform: rotate(-12deg) scale(1.03);
  }
  40% {
    transform: rotate(12deg) scale(1.03);
  }
  60% {
    transform: rotate(-8deg) scale(1.01);
  }
  80% {
    transform: rotate(8deg) scale(1.01);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

/* Order notify bell - compact, icon-based */
.notify-bell-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
}
.notify-bell-btn:hover {
  border-color: rgba(109, 74, 255, 0.4);
  color: var(--text);
}
.notify-bell-btn .i {
  flex-shrink: 0;
  opacity: 0.85;
}
.notify-bell-btn--active {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
}
.notify-bell-btn--active:hover {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.12);
}

/* Order detail: notify + «назад к заказам» — на всю ширину карточки */
.order-detail-footer-actions,
.order-notify-actions-stack {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  align-items: stretch;
  box-sizing: border-box;
}
.order-detail-footer-actions--flush {
  margin-top: 0;
}
.order-detail-footer-actions > *,
.order-notify-actions-stack > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.order-detail-footer-actions > .btn,
.order-detail-footer-actions > a.btn,
.order-detail-footer-actions > button.btn,
.order-notify-actions-stack > .btn,
.order-notify-actions-stack > a.btn,
.order-notify-actions-stack > button.btn {
  justify-content: center;
  min-height: 44px;
}
.order-detail-footer-actions .notify-bell-btn,
.order-notify-actions-stack .notify-bell-btn {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
}
.order-detail-footer-actions .order-notify-wide-btn,
.order-notify-actions-stack .order-notify-wide-btn {
  width: 100%;
  justify-content: center;
  min-height: 44px;
}

/* Inputs */
.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: var(--input);
  color: var(--text);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  font-weight: 500;
}
.input:focus {
  border-color: rgba(109, 74, 255, 0.35);
  box-shadow: 0 0 0 4px var(--ring);
  background: var(--panel);
}
.textarea {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
  min-height: 140px;
}

/* Chips / Segmented */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--chip);
  color: var(--chipText);
  font-size: 13px;
  white-space: nowrap;
  font-weight: 600;
}
.top-balance-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
a.chip.top-balance-chip {
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}
a.chip.top-balance-chip:hover {
  border-color: var(--line);
  background: var(--panel2);
  box-shadow: 0 0 0 3px var(--ring);
}
a.chip.top-balance-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line2);
  background: var(--chip);
  border-radius: 12px;
  overflow: hidden;
}
.seg button {
  height: 34px;
  padding: 0 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.seg button.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.1);
}

/* App layout */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Topbar (sticky) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--panel);
  border-bottom: 1px solid var(--line2);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.mobile-only {
  display: none;
}
.sidebar-backdrop {
  display: none;
}
.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
}
.topup-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 14px;
  align-items: start;
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(109, 74, 255, 0.1);
  border: 1px solid rgba(109, 74, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.brand-mark img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name {
  font-weight: 700;
  font-size: 14px;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 2px;
  font-weight: 500;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Main layout */
.layout {
  flex: 1;
  display: flex;
  min-height: 0;
}
.sidebar {
  width: 320px;
  padding: 14px;
  min-height: 0;
  position: sticky;
  top: 82px;
  margin-left: 14px;
  align-self: flex-start;
  z-index: 120;
  flex-shrink: 0;
}
.sidebar-inner {
  max-height: calc(100vh - 120px);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.side-section-title {
  margin: 10px 6px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted2);
}

.side-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: rgba(109, 74, 255, 0);
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}
.side-item:hover {
  background: rgba(109, 74, 255, 0.06);
  border-color: rgba(109, 74, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.06);
}
.side-item.active {
  background: rgba(109, 74, 255, 0.1);
  border-color: rgba(109, 74, 255, 0.24);
}

.side-item.side-item--sub-locked {
  opacity: 0.52;
  cursor: not-allowed;
}
.side-item.side-item--sub-locked:hover {
  transform: none;
  box-shadow: none;
  background: rgba(109, 74, 255, 0);
  border-color: var(--line2);
}

.side-item.side-item--service-locked {
  opacity: 0.52;
  cursor: not-allowed;
}
.side-item.side-item--service-locked:hover {
  transform: none;
  box-shadow: none;
  background: rgba(109, 74, 255, 0);
  border-color: var(--line2);
}

.panel-global-api-maintenance a[data-link] {
  pointer-events: none;
  opacity: 0.48;
  cursor: not-allowed;
}

.global-api-maintenance-page {
  min-height: min(72vh, 640px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.07);
}
.global-api-maintenance-page__inner {
  max-width: 480px;
  text-align: center;
}
.global-api-maintenance-page__icon {
  margin-bottom: 16px;
}
.global-api-maintenance-page__icon .i {
  width: 44px;
  height: 44px;
  opacity: 0.85;
  color: rgba(245, 158, 11, 0.95);
}
.global-api-maintenance-page__title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.25;
}
.global-api-maintenance-page__body {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.global-api-maintenance-page__mini-title {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink, #1a1d24);
}
[data-theme='dark'] .global-api-maintenance-page__mini-title {
  color: var(--ink, #e8eaed);
}
.global-api-maintenance-page__game-frame {
  margin: 0 auto 8px;
  max-width: 360px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(16, 24, 40, 0.08);
}
[data-theme='dark'] .global-api-maintenance-page__game-frame {
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
}
.global-api-maintenance-game-canvas {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  touch-action: none;
  cursor: pointer;
  outline: none;
}
.global-api-maintenance-page__game-controls {
  margin: 0 0 18px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.subscription-gate-page {
  padding: 20px 18px;
}

.main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-left: 14px;
}

@media (min-width: 1081px) {
  .main {
    min-height: calc(100dvh - 62px);
  }
}

.main-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  /* Нижний padding здесь давал полоску «пустоты» под футером; отступ снизу — у .footer */
  padding: 14px 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#pageRoot {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  align-self: stretch;
  /* Воздух перед футером в общем скролле (.main-scroll без padding-bottom у контента) */
  padding-bottom: 28px;
}

.card {
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  box-shadow: var(--shadow2);
  padding: 14px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-title {
  font-weight: 700;
  font-size: 16px;
}
.muted {
  color: var(--muted);
}
.muted2 {
  color: var(--muted2);
}

/*
  Узкий экран: контент в #pageRoot без тяжёлых box-shadow и hover-transform —
  меньше мерцания и нагрузки на композитор при скролле (home, заказы, транзакции, детали…).
  Модалки/оверлеи вне #pageRoot не затрагиваются.
*/
@media (max-width: 640px) {
  #pageRoot .card {
    box-shadow: none !important;
  }
  #pageRoot .list-card {
    box-shadow: none !important;
    transition:
      border-color 0.2s ease,
      background 0.2s ease;
  }
  #pageRoot .list-card:hover,
  #pageRoot .list-card:focus-visible {
    transform: none !important;
    box-shadow: none !important;
  }
  #pageRoot .status-card {
    box-shadow: none !important;
    animation: none !important;
  }
  #pageRoot .quick-item {
    transition:
      border-color 0.2s ease,
      background 0.2s ease;
  }
  #pageRoot .quick-item:hover {
    box-shadow: none !important;
  }
  #pageRoot a.home-subscription-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  .home-subscription-bar.home-subscription-bar--pulse {
    animation: none !important;
  }
  /* Баланс, подарочные заказы и прочие блоки без .card / .list-card */
  #pageRoot .balance-method-card,
  #pageRoot .balance-method-card:hover,
  #pageRoot .balance-method-card:focus-visible {
    box-shadow: none !important;
    transform: none !important;
  }
  #pageRoot .pay-opt.active {
    box-shadow: none !important;
  }
  #pageRoot .gift-panels > * {
    box-shadow: none !important;
    animation: none !important;
  }
  #pageRoot .gift-card,
  #pageRoot .gift-card:hover,
  #pageRoot .gift-card:focus-visible,
  #pageRoot .gift-card.active {
    transform: none !important;
    box-shadow: none !important;
  }
  /* Telegram (стили подключаются позже общих правил страницы — фиксируем отдельно) */
  #pageRoot .tg-tab.active {
    box-shadow: none !important;
  }
  #pageRoot .tg-tabs.toggle .tg-indicator {
    box-shadow: none !important;
  }
  #pageRoot .tg-pack:hover,
  #pageRoot .tg-pack:focus-visible,
  #pageRoot .tg-pack.active {
    transform: none !important;
    box-shadow: none !important;
  }
  #pageRoot .tg-prem-pack:hover,
  #pageRoot .tg-prem-pack:focus-visible,
  #pageRoot .tg-prem-pack.active {
    transform: none !important;
    box-shadow: none !important;
  }
  /* Поддержка: список тикетов */
  #pageRoot .support-ticket-card,
  #pageRoot .support-ticket-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  #pageRoot .support-ticket-card.active {
    box-shadow: none !important;
  }
}

/* Footer внутри .main-scroll — общий скролл с #pageRoot */
.footer {
  border-top: 1px solid var(--line2);
  padding: 12px 14px max(14px, env(safe-area-inset-bottom, 0px)) 14px;
  background: var(--panel);
  margin-top: auto;
  flex-shrink: 0;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px 14px 0 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 16px;
  flex-wrap: wrap;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 500;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.footer a {
  color: var(--muted);
  font-weight: 600;
}

@media (min-width: 720px) {
  .footer-links {
    margin-left: auto;
    justify-content: flex-end;
  }
}

/* Table */
.table-wrap {
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line2);
  background: var(--panel);
}
.table th,
.table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line2);
  font-size: 13px;
  vertical-align: middle;
}
.table th {
  color: var(--muted2);
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.table tr:last-child td {
  border-bottom: none;
}

/* Status */
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--chip);
  color: var(--chipText);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}
.status.processing {
  border-color: rgba(249, 115, 22, 0.25);
  background: rgba(249, 115, 22, 0.1);
  color: #b45309;
}
:root:is([data-theme='dark'], [data-theme='oled']) .status.processing {
  color: rgba(255, 190, 90, 0.95);
}
.status.completed {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}
:root:is([data-theme='dark'], [data-theme='oled']) .status.completed {
  color: rgba(140, 255, 190, 0.95);
}
.status.error {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}
:root:is([data-theme='dark'], [data-theme='oled']) .status.error {
  color: rgba(255, 169, 169, 0.95);
}

/* Skeleton */
.skeleton {
  background: var(--skeleton);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: shimmer 1.1s infinite;
}
:root[data-theme='light'] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(16, 24, 40, 0.1), transparent);
}
@keyframes shimmer {
  0% {
    left: -50%;
  }
  100% {
    left: 110%;
  }
}

.pill {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--chip);
  color: var(--chipText);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
/* Responsive */
@media (max-width: 1360px) {
  .topup-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 980px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .mobile-only {
    display: inline-flex;
  }
  .sidebar-mobile-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 8px;
    padding: 4px 2px 12px;
    border-bottom: 1px solid var(--line2);
  }

  /* Full-viewport drawer (mobile): panel covers the whole screen, slides in from the left */
  .sidebar {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 300;
    align-self: stretch;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    inset-inline-start: 0;
    background: rgba(15, 23, 42, 0.52);
    z-index: 250;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 240ms ease,
      visibility 0s linear 240ms;
    -webkit-tap-highlight-color: transparent;
  }
  :root:is([data-theme='dark'], [data-theme='oled']) .sidebar-backdrop {
    background: rgba(0, 0, 0, 0.62);
  }
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      opacity 240ms ease,
      visibility 0s linear 0s;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar-inner {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top, 0px));
    padding-bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }

  /* Убираем внутренний скролл main-scroll — общий скролл документа */
  .layout {
    min-height: auto;
  }
  .main {
    padding-left: 0;
    min-height: auto;
  }
  /*
   * Короткая страница: футер с margin-top:auto должен прижиматься к низу вьюпорта — для этого
   * .main-scroll должен забирать свободную высоту внутри .main. min-height:auto ломал растягивание
   * и оставлял «мертвую» полосу под футером (общий скролл документа при этом сохраняется).
   */
  .main-scroll {
    flex: 1 0 auto;
    align-items: stretch;
    overflow-y: visible;
    overflow-x: clip;
    padding: 14px 14px 0;
  }

  /* Воздух между последним блоком и футером на узкой вёрстке */
  #pageRoot {
    padding-bottom: 22px;
  }
}

@media (max-width: 1080px) and (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-backdrop {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    flex-wrap: nowrap;
    gap: 10px;
  }
  .brand-area {
    min-width: 0;
  }
  .brand-area .brand {
    display: none;
  }
  .brand-text {
    display: none;
  }
  #topBalanceChip {
    display: none;
  }
  .top-actions {
    flex-wrap: nowrap;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .currency-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card {
    padding: 12px;
  }
}
@media (max-width: 520px) {
  .orders-list,
  .tx-list,
  .home-order-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
  .list-toolbar-compact {
    padding: 10px;
  }
}
@media (max-width: 640px) {
  .orders-list,
  .tx-list,
  .home-order-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}
.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted2);
  margin-bottom: 6px;
}
.help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}

.currency-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.currency-btn {
  display: flex;
  color: var(--text);
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: var(--panel);
  cursor: pointer;
  font-weight: 600;
  transition:
    background var(--transition),
    border-color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}
:root:is([data-theme='dark'], [data-theme='oled']) .currency-btn {
  background: rgba(255, 255, 255, 0.04);
}
.currency-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(109, 74, 255, 0.25);
  box-shadow: 0 12px 22px rgba(16, 24, 40, 0.08);
}
.currency-btn.active {
  background: rgba(109, 74, 255, 0.1);
  border-color: rgba(109, 74, 255, 0.3);
}
.currency-flag {
  display: inline-flex;
  width: 18px;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
}
.currency-flag .fi {
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: var(--panel);
}
:root:is([data-theme='dark'], [data-theme='oled']) .summary-row {
  background: transparent;
}
.summary-row .k {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .summary-row .k {
    white-space: normal;
  }
}
.summary-row .v {
  font-weight: 700;
  font-size: 13px;
  text-align: right;
  margin-left: auto;
}

/* Заказ Steam Gift / ключи: регион — флаг и текст по центру строки, без «провисания» флага */
.summary-row .v.order-detail-region-value,
.summary-row .v .order-detail-region-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
  text-align: right;
}
.summary-row .order-detail-region-flag {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}
.summary-row .order-detail-region-flag img {
  width: 20px;
  height: 13px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--line2);
  display: block;
  vertical-align: middle;
}
.summary-row .order-detail-region-value .gamekey-catalog-region-icon {
  flex-shrink: 0;
}
.summary-row .order-detail-region-label {
  line-height: 1.35;
}

.summary-row .v .order-detail-platform-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
  text-align: right;
}
.summary-row .order-detail-platform-value .gamekey-catalog-platform-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.summary-row .order-detail-platform-label {
  line-height: 1.35;
}

.summary-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notice {
  border: 1px solid rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.1);
  color: var(--text);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}
.notice.warn {
  border-color: rgba(249, 115, 22, 0.25);
  background: rgba(249, 115, 22, 0.1);
}

.currency-btn * {
  color: inherit;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 500;
}
.modal.show {
  display: flex;
  animation: modalFade 180ms ease;
}
.modal-card {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 22px;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.28),
    var(--shadow2);
  padding: 18px;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  animation: modalPop 200ms ease forwards;
}
.modal-card--busy {
  text-align: center;
  padding: 26px 22px 28px;
}
.modal-card--busy .modal-actions {
  display: none;
}
.modal-card--busy .modal-icon.processing {
  width: 58px;
  height: 58px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
}
.modal-card--busy .modal-title {
  line-height: 1.3;
}
.modal-card--busy .modal-text {
  margin-top: 10px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.modal-icon.success {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: rgba(34, 197, 94, 1);
}
.modal-icon.error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: rgba(239, 68, 68, 1);
}
.modal-icon.error {
  width: 72px;
  height: 72px;
}
.modal-backdrop-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.28), rgba(239, 68, 68, 0.08));
  border: 1px solid rgba(239, 68, 68, 0.24);
  color: #ef4444;
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.06);
}
.modal-backdrop-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.28), rgba(239, 68, 68, 0.08));
  border: 1px solid rgba(239, 68, 68, 0.24);
  color: #ef4444;
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.06);
}
.modal-icon.processing {
  background: rgba(109, 74, 255, 0.12);
  border: 1px solid rgba(109, 74, 255, 0.28);
  color: rgba(109, 74, 255, 0.95);
  position: relative;
}
:root:is([data-theme='dark'], [data-theme='oled']) .modal-icon.processing {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(167, 139, 250, 0.32);
  color: #c4b5fd;
}
.modal-card--busy .modal-icon.processing svg {
  display: none;
}
.modal-icon.processing::after {
  content: '';
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: currentColor;
  animation: spin 0.85s linear infinite;
}
:root:is([data-theme='dark'], [data-theme='oled']) .modal-icon.processing::after {
  border-color: rgba(255, 255, 255, 0.12);
  border-top-color: currentColor;
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.modal-text {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}
.modal-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Steam gift validation modal (scoped) */
.gift-error-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 450;
  padding: 16px;
  opacity: 0;
  animation: modalFade 180ms ease forwards;
}
/* Поверх глобального #modal (z-index 500) при необходимости */
.gift-error-overlay.panel-gift-style-alert {
  z-index: 520;
}
.gift-error-overlay.hide {
  animation: modalFadeOut 160ms ease forwards;
}
.gift-error-modal {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid rgba(239, 68, 68, 0.26);
  border-radius: 20px;
  box-shadow: 0 26px 68px rgba(0, 0, 0, 0.28);
  padding: 20px 18px 18px;
  position: relative;
  transform: translateY(10px) scale(0.96);
  opacity: 0;
  animation: modalPop 200ms ease forwards;
  text-align: center;
}
.gift-error-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}
.gift-error-close:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.28);
}
.gift-error-icon {
  width: 80px;
  height: 80px;
  margin: 6px auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.28), rgba(239, 68, 68, 0.08));
  border: 1px solid rgba(239, 68, 68, 0.26);
  box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
}
.gift-error-icon .i {
  width: 32px;
  height: 32px;
}
.gift-success-icon {
  width: 80px;
  height: 80px;
  margin: 6px auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(34, 197, 94, 0.28), rgba(34, 197, 94, 0.08));
  border: 1px solid rgba(34, 197, 94, 0.26);
  box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22c55e;
}
.gift-success-icon.error {
  background: radial-gradient(circle at 30% 30%, rgba(239, 68, 68, 0.32), rgba(239, 68, 68, 0.12));
  border: 1px solid rgba(239, 68, 68, 0.28);
  box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.08);
  color: #ef4444;
}
.gift-success-icon.loading {
  width: 76px;
  height: 76px;
  background: transparent;
  border: 6px solid rgba(255, 255, 255, 0.18);
  border-top-color: #8b5cf6;
  box-shadow: none;
  animation: spin 1s linear infinite;
  position: relative;
}
.gift-success-icon.loading .i {
  display: none;
}
.gift-success-icon.loading::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.12);
}
.gift-success-icon .i {
  width: 32px;
  height: 32px;
}
.gift-summary-modal {
  width: min(480px, 100%);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 20px;
  box-shadow: 0 26px 68px rgba(0, 0, 0, 0.28);
  padding: 20px 18px 18px;
  position: relative;
  transform: translateY(10px) scale(0.96);
  opacity: 0;
  animation: modalPop 200ms ease forwards;
  text-align: center;
}
.gift-summary-list {
  margin: 12px 0;
  border: 1px solid var(--line2);
  border-radius: 14px;
  overflow: hidden;
}
.gift-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  gap: 10px;
  border-bottom: 1px solid var(--line2);
}
.gift-summary-row:last-child {
  border-bottom: none;
}
.gift-summary-row .k {
  font-weight: 600;
  color: var(--muted2);
}
.gift-summary-row .v {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gift-region-flag-inline img {
  width: 20px;
  height: 14px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  margin: 0;
  vertical-align: middle;
}
/* Модалка подтверждения: одна линия «метка — значение», как на странице игры (не flex-wrap с колонок .gift-summary) */
.gift-summary-modal .gift-summary-row {
  flex-wrap: nowrap;
  align-items: flex-start;
}
.gift-summary-modal .gift-summary-row .k {
  flex: 0 1 auto;
  max-width: 44%;
  text-align: left;
}
.gift-summary-modal .gift-summary-row .v {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  text-align: right;
}
.gift-summary-modal .gift-summary-row .game-detail-summary-region-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
}
.gift-summary-modal .gift-summary-row .game-detail-summary-platform-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
}
.gift-summary-modal
  .gift-summary-row
  .game-detail-summary-platform-value
  .gamekey-catalog-platform-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.gift-summary-modal .gift-summary-row .game-detail-summary-platform-label {
  font-weight: 600;
  text-align: right;
}
.gift-summary-modal .gift-summary-row .gamekey-catalog-region-label {
  word-break: normal;
  overflow-wrap: break-word;
}
.gift-recipient {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: rgba(109, 74, 255, 0.06);
  margin-bottom: 12px;
}
.gift-recipient-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}
.gift-recipient-name {
  font-weight: 700;
  line-height: 1.2;
}
.gift-recipient-invite {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.gift-recipient-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}
.gift-recipient-loader {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid rgba(109, 74, 255, 0.22);
  border-top-color: #6d4aff;
  animation: spin 0.8s linear infinite;
  margin: 4px 0;
}
.gift-profile-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  margin: 10px 0;
  background: rgba(109, 74, 255, 0.06);
}
.gift-process-modal {
  width: min(360px, 100%);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  padding: 18px;
  text-align: center;
}
.gift-process-icon.spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 6px solid rgba(109, 74, 255, 0.18);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}
.gift-success-icon.small {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
}
.gift-recipient-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.gift-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.gift-confirm-actions .btn {
  flex: 1;
  justify-content: center;
}
.gift-confirm-actions .btn-ghost {
  background: transparent;
  color: var(--muted);
}
.gift-confirm-actions .gift-error-ok {
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  box-shadow: 0 14px 32px rgba(109, 74, 255, 0.35);
  border: none;
}
.gift-confirm-actions .gift-error-ok:hover {
  filter: brightness(1.06);
}
.gift-error-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}
.gift-error-text {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
  white-space: pre-line;
}
.gift-error-ok {
  width: 100%;
  justify-content: center;
  background: var(--accent);
  color: #fff;
}
.gift-error-ok:hover {
  filter: brightness(1.05);
}

@keyframes giftErrorSheetIn {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes giftErrorSheetOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(100%);
  }
}

/* Ошибки / превью заказа в gift-error-overlay: на ПК — как раньше, на мобилке — bottom sheet снизу */
@media (max-width: 767px) {
  .gift-error-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .gift-error-overlay > .gift-error-modal,
  .gift-error-overlay > .gift-summary-modal,
  .gift-error-overlay > .gift-process-modal {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
    opacity: 0;
    animation: giftErrorSheetIn 320ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
    box-shadow:
      0 -12px 48px rgba(0, 0, 0, 0.22),
      0 -2px 12px rgba(0, 0, 0, 0.06);
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .gift-error-overlay.hide > .gift-error-modal,
  .gift-error-overlay.hide > .gift-summary-modal,
  .gift-error-overlay.hide > .gift-process-modal {
    animation: giftErrorSheetOut 140ms ease-in forwards;
  }

  /* Укладываемся в типичный setTimeout(..., 160–180) перед overlay.remove() */
  .gift-error-overlay.hide {
    animation: modalFadeOut 155ms ease forwards;
  }
}

@keyframes modalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.modal.show {
  display: flex;
  animation: modalFade 180ms ease;
}
.modal-card {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 22px;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.28),
    var(--shadow2);
  padding: 18px;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  animation: modalPop 200ms ease forwards;
}
@keyframes modalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Order details */
.order-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}
.order-hero > div:first-child {
  flex: 1;
  min-width: 0;
}
.order-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.order-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line2);
  background: rgba(109, 74, 255, 0.06);
}
.status-icon {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.03);
}
.status-icon.success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.25);
  color: rgba(34, 197, 94, 1);
}
.status-icon.error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.25);
  color: rgba(239, 68, 68, 1);
}
.status-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: var(--chip);
  flex-shrink: 0;
  max-width: 100%;
}
.status-stack .status-main {
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}
.status-stack .status-sub {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
.order-hero .status-stack .dot-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.order-hero .status-stack .dot-icon .i {
  width: 13px;
  height: 13px;
}
.order-hero .status-stack > div:last-child {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.order-hero .status-stack .status-sub::before {
  content: '·';
  display: inline-block;
  margin-right: 2px;
  font-weight: 800;
  color: var(--muted2);
  opacity: 0.75;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(160, 140, 255, 1);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Narrow layout fixes */
@media (max-width: 700px) {
  #pageRoot {
    max-width: 100%;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }
  .main-scroll {
    padding: 10px 10px 0;
  }
  .gift-two-col {
    grid-template-columns: 1fr;
  }
  .gift-aside .gift-summary {
    position: relative;
    top: 0;
  }
  .list-cards,
  .orders-list,
  .tx-list,
  .home-order-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .list-card {
    width: 100%;
    box-sizing: border-box;
  }
  .list-toolbar-compact {
    padding: 10px;
  }
}

/* Status timeline */
.status-timeline {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-title {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.status-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line2);
  background: var(--chip);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
  animation: fadeUp 0.28s ease both;
}
.status-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.status-card-head > .dot-icon {
  flex: 0 0 auto;
  align-self: flex-start;
}
.status-card-head > div:last-child {
  min-width: 0;
  flex: 1;
}
.status-card-title {
  font-weight: 800;
}
.status-card-text {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.status-card-meta {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-top: 8px;
}
.status-card.created {
  border-color: rgba(113, 113, 122, 0.4);
  background: linear-gradient(135deg, #f4f4f5, #fafafa);
}
:root:is([data-theme='dark'], [data-theme='oled']) .status-card.created {
  background: linear-gradient(135deg, rgba(161, 161, 170, 0.12), rgba(82, 82, 91, 0.1));
  border-color: rgba(161, 161, 170, 0.45);
}
.status-card.processing {
  border-color: rgba(249, 115, 22, 0.35);
  background: linear-gradient(135deg, #fff3e0, #fffaf3);
}
:root:is([data-theme='dark'], [data-theme='oled']) .status-card.processing {
  background: linear-gradient(135deg, rgba(255, 158, 74, 0.12), rgba(255, 190, 120, 0.08));
  border-color: rgba(255, 190, 120, 0.45);
}
.status-card.completed {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, #f0fff4, #f7fffb);
}
:root:is([data-theme='dark'], [data-theme='oled']) .status-card.completed {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(22, 163, 74, 0.08));
  border-color: rgba(74, 222, 128, 0.45);
}
.status-card.error {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(135deg, #fff1f0, #fff6f6);
}
:root:is([data-theme='dark'], [data-theme='oled']) .status-card.error {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(248, 180, 180, 0.08));
  border-color: rgba(248, 113, 113, 0.45);
}
.status-card.refund {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
}
:root:is([data-theme='dark'], [data-theme='oled']) .status-card.refund {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.14), rgba(59, 130, 246, 0.1));
  border-color: rgba(96, 165, 250, 0.45);
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.order-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 14px;
  align-items: start;
}
.order-grid.order-grid-timeline {
  grid-template-columns: minmax(0, 1.3fr) 360px;
  align-items: start;
}
.order-grid.order-grid-timeline.gift-layout {
  grid-template-columns: 65% 35%;
  gap: 10px;
  align-items: start;
}
.gift-layout .gift-summary-card .gift-summary {
  position: sticky;
  top: 10px;
}
@media (max-width: 900px) {
  .order-grid.order-grid-timeline.gift-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .gift-layout .gift-summary-card .gift-summary {
    position: relative;
    top: 0;
  }
}
@media (max-width: 940px) {
  .order-grid.order-grid-timeline {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .order-grid {
    grid-template-columns: 1fr;
  }
}

/* Order detail — no horizontal scroll on narrow viewports */
.order-grid,
.order-left-col {
  min-width: 0;
  max-width: 100%;
}
.keys-card .keys-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line2);
}
.keys-card .keys-header.keys-header--toolbar {
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.keys-card .keys-header.keys-header--toolbar .keys-header-title {
  font-weight: 600;
  min-width: 0;
}
.keys-card .keys-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.keys-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  color: var(--text);
  cursor: pointer;
  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform 0.15s ease;
}
.keys-toolbar-btn:hover {
  border-color: rgba(109, 74, 255, 0.35);
  background: rgba(109, 74, 255, 0.08);
  color: var(--text);
}
.keys-toolbar-btn:active {
  transform: scale(0.96);
}
.keys-toolbar-btn.keys-toolbar-btn--ghost {
  background: transparent;
}
.keys-toolbar-btn.keys-toolbar-btn--done {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}
.keys-toolbar-btn .keys-toolbar-icon {
  display: block;
}
:root:is([data-theme='dark'], [data-theme='oled']) .keys-toolbar-btn {
  background: rgba(255, 255, 255, 0.04);
}
:root:is([data-theme='dark'], [data-theme='oled']) .keys-toolbar-btn.keys-toolbar-btn--ghost {
  background: transparent;
}
@media (max-width: 700px) {
  #pageRoot {
    max-width: 100%;
    min-width: 0;
  }
  .order-hero {
    flex-wrap: wrap;
  }
  .order-hero > div:first-child {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }
  .order-title {
    word-break: break-word;
  }
  .order-sub {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
  .order-hero .status-stack {
    flex: 1 1 auto;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    width: 100%;
  }
  .order-hero .status-stack > div:last-child {
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }
  .order-hero .status-stack .status-main {
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .order-hero .status-stack .status-sub {
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
  }
  .order-hero .status-stack .status-sub::before {
    display: none;
  }
  .summary-row {
    min-width: 0;
    align-items: flex-start;
  }
  .summary-row .k {
    white-space: normal;
    flex: 0 1 auto;
    min-width: 0;
  }
  .summary-row .v {
    flex: 1 1 0;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .keys-card .keys-header:not(.keys-header--toolbar) {
    flex-direction: column;
    align-items: stretch;
  }
  /* Toolbar: одна строка — заголовок слева, кнопки справа вверху (без второго ряда и «пустоты»). */
  .keys-card .keys-header.keys-header--toolbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .keys-card .keys-header.keys-header--toolbar .keys-header-title {
    flex: 1 1 auto;
    min-width: 0;
  }
  .keys-card .keys-header.keys-header--toolbar .keys-header-actions {
    align-self: auto;
    flex-shrink: 0;
    flex-direction: row;
  }
  .keys-card .key-row .key-text {
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .table-wrap {
    overflow-x: hidden;
    max-width: 100%;
  }
  .table th,
  .table td {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .status-card .status-card-title,
  .status-card .status-card-text {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* List toolbar + cards */
.list-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.list-toolbar-compact {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 14px;
  padding: 10px;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.filter-row-lg {
  align-items: stretch;
}
.filter-row-lg .input-compact {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 420px;
}
.filter-row-lg .dd {
  flex: 0 0 auto;
}
.input-compact {
  height: 38px;
  border-radius: 12px;
  padding: 0 12px;
}
.select-modern {
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(180deg, var(--panel) 0%, var(--input) 100%);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 38px 10px 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  transition:
    border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M1.41 0.59 6 5.17l4.59-4.58L12 2 6 8 0 2z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--panel) 0%, var(--input) 100%);
  background-repeat: no-repeat, no-repeat;
  background-position:
    right 14px center,
    left top;
}
/* Без усиления тени и смены контура — иначе выглядит как «чёрная обводка» (особенно на светлой теме). */
.select-modern:focus,
.select-modern:hover {
  border-color: var(--line2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, var(--panel) 0%, var(--input) 100%);
}
:root:is([data-theme='dark'], [data-theme='oled']) .select-modern:focus,
:root:is([data-theme='dark'], [data-theme='oled']) .select-modern:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.select-modern:focus-visible,
.select-modern:focus,
.select-modern:active {
  outline: none !important;
}
.select-modern::-ms-expand {
  display: none;
}
.select-modern option {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  padding: 8px 12px;
}

.dd {
  position: relative;
  width: 190px;
}
.dd .dd-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  background-image: none;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  font: inherit;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
/* Кнопка дропдауна: без широкой внешней тени — на светлой теме она выглядит как «чёрное кольцо». */
.dd .dd-toggle.select-modern {
  padding-right: 12px;
  border: 1px solid var(--line2);
  border-style: solid;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
:root:is([data-theme='dark'], [data-theme='oled']) .dd .dd-toggle.select-modern {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}
.dd .dd-toggle::-moz-focus-inner {
  border: 0;
}
.dd .dd-toggle:focus,
.dd .dd-toggle:focus-visible,
.dd .dd-toggle:active,
.dd .dd-toggle:hover,
.dd.open > .dd-toggle {
  outline: none !important;
  outline-width: 0 !important;
  outline-style: none !important;
  outline-offset: 0 !important;
  border-color: var(--line2) !important;
  border-style: solid !important;
  border-width: 1px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
:root:is([data-theme='dark'], [data-theme='oled']) .dd .dd-toggle:focus,
:root:is([data-theme='dark'], [data-theme='oled']) .dd .dd-toggle:focus-visible,
:root:is([data-theme='dark'], [data-theme='oled']) .dd .dd-toggle:active,
:root:is([data-theme='dark'], [data-theme='oled']) .dd .dd-toggle:hover,
:root:is([data-theme='dark'], [data-theme='oled']) .dd.open > .dd-toggle {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22) !important;
}
.dd .dd-item::-moz-focus-inner {
  border: 0;
}
.dd .dd-item:focus,
.dd .dd-item:focus-visible,
.dd .dd-item:active {
  outline: none !important;
  outline-width: 0 !important;
}
@media (forced-colors: active) {
  .dd .dd-toggle:focus,
  .dd .dd-toggle:focus-visible,
  .dd .dd-item:focus,
  .dd .dd-item:focus-visible {
    outline: none !important;
  }
}
.dd .dd-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dd .dd-caret {
  flex-shrink: 0;
  margin-left: 2px;
  font-size: 18px;
  line-height: 1;
  transform: rotate(-90deg);
  opacity: 0.7;
  transition:
    transform 0.26s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease;
}
.dd.open .dd-caret {
  transform: rotate(90deg);
  opacity: 1;
}
.dd .dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(420px, calc(100vw - 24px));
  /* Длинный список не должен уходить за экран — ограничиваем высоту и листаем внутри.
     Для fixed-меню (fixedMenuToViewport) точную высоту под вьюпорт задаёт initDropdown. */
  max-height: min(320px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition:
    opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  box-sizing: border-box;
}
.dd.open .dd-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.dd .dd-item {
  border: none;
  background: transparent;
  color: var(--text);
  padding: 9px 10px;
  border-radius: 10px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.2s ease;
}
.dd .dd-item:hover {
  background: var(--chip);
}
.dd .dd-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.select {
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, var(--panel) 0%, var(--input) 100%);
  color: var(--text);
  padding: 0 10px;
  font-weight: 600;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(180deg, var(--panel) 0%, var(--input) 100%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-repeat: no-repeat;
  background-size:
    6px 6px,
    6px 6px,
    auto;
  padding-right: 32px;
}
:root:is([data-theme='dark'], [data-theme='oled']) .select {
  background: rgba(255, 255, 255, 0.04);
}
input[type='date'] {
  appearance: none;
  background: var(--panel);
  position: relative;
}
input[type='date']::-webkit-calendar-picker-indicator {
  color: transparent;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394A3B8' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v2H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2V2h-2v2H9V2H7Zm12 6H5v10h14V8Z'/%3E%3C/svg%3E")
    no-repeat center;
  opacity: 0.8;
}
.list-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.orders-list {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}
.tx-list {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.home-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  /* Иначе левая карточка тянется по высоте «Быстрые действия» и снизу пустота */
  align-items: start;
}
.hero-card {
  padding: 18px;
}
.hero-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-title {
  font-size: 22px;
  font-weight: 800;
  margin: 2px 0;
}
.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-stats {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.stat-card {
  border: 1px solid var(--line2);
  background: var(--panel2);
  border-radius: 14px;
  padding: 12px;
}
.stat-value {
  font-weight: 800;
  font-size: 20px;
  margin: 4px 0;
}
.quick-card {
  padding: 14px;
}
.quick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quick-item {
  border: 1px solid var(--line2);
  background: var(--panel2);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.quick-item:hover {
  border-color: rgba(109, 74, 255, 0.28);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}
.quick-title {
  font-weight: 700;
}
.home-section {
  margin-top: 14px;
  padding: 10px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.home-order-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}
/* Home / overview (reseller dashboard) */
.home-overview {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card.page-hero {
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.06), var(--panel));
}
.card.page-hero-spaced {
  margin-bottom: 14px;
}
:root[data-theme='dark'] .card.page-hero {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.14), rgba(15, 23, 42, 0.94));
}
:root[data-theme='oled'] .card.page-hero {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.12), #1c1f27);
}
.card.page-hero .card-head.page-hero-head {
  align-items: flex-start;
  margin-bottom: 0;
}
.page-hero-copy {
  flex: 1;
  min-width: 0;
}
.home-intro-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.home-intro-copy {
  flex: 1;
  min-width: min(100%, 280px);
}
.home-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}
.home-page-title {
  margin: 0 0 8px 0;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}
.home-page-desc {
  margin: 0;
  max-width: 54ch;
  line-height: 1.5;
}
.home-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.btn-touch {
  min-height: 44px;
  padding-left: 18px;
  padding-right: 18px;
}
.hero-card-accent {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.1), rgba(99, 102, 241, 0.05));
}
:root[data-theme='dark'] .hero-card-accent {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.14), rgba(15, 23, 42, 0.92));
}
:root[data-theme='oled'] .hero-card-accent {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.12), #1c1f27);
}
.hero-header-tight {
  margin-bottom: 4px;
}
/* Подписка: полоса на всю ширину под KPI (клик → профиль) */
.home-profile-card {
  position: relative;
}
.home-user-card {
  display: block;
}
.hero-user-text {
  min-width: 0;
}
.hero-email {
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.home-kpi-heading {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted2);
  margin: 14px 0 10px 0;
}
.home-kpi-grid {
  margin-top: 0;
}
.home-stat-tile {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home-stat-tile .stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.home-subscription-bar {
  display: block;
  color: inherit;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  box-sizing: border-box;
  width: 100%;
}
.home-subscription-bar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 12px;
  align-items: start;
}
.home-subscription-bar-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
.home-subscription-bar-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 4px;
}
.home-subscription-bar-plan {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.home-subscription-bar-expiry {
  font-size: 12px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}
.home-subscription-bar-price-top {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  max-width: min(200px, 46vw);
  text-align: right;
  word-break: break-word;
}
.home-subscription-status-badge {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  align-self: end;
  border-radius: 9px;
  padding: 6px 10px;
  gap: 8px;
}
.home-subscription-status-badge .dot-icon {
  width: 24px;
  height: 24px;
}
.home-subscription-status-badge .dot-icon .i {
  width: 14px;
  height: 14px;
}
.home-subscription-status-badge .status-main {
  font-size: 13px;
}
.home-subscription-bar-action {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: end;
  white-space: nowrap;
}
.home-subscription-bar.status-card.completed.home-subscription-bar--pulse {
  animation: homeSubscriptionBlinkOk 2.25s ease-in-out infinite;
}
.home-subscription-bar.status-card.error.home-subscription-bar--pulse {
  animation: homeSubscriptionBlinkBad 2.25s ease-in-out infinite;
}
@keyframes homeSubscriptionBlinkOk {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 1px 2px rgba(34, 197, 94, 0.06);
  }
  45% {
    opacity: 0.94;
    box-shadow: 0 0 18px 3px rgba(34, 197, 94, 0.35);
  }
  55% {
    opacity: 0.94;
    box-shadow: 0 0 18px 3px rgba(34, 197, 94, 0.35);
  }
}
@keyframes homeSubscriptionBlinkBad {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 1px 2px rgba(239, 68, 68, 0.06);
  }
  45% {
    opacity: 0.93;
    box-shadow: 0 0 18px 3px rgba(239, 68, 68, 0.38);
  }
  55% {
    opacity: 0.93;
    box-shadow: 0 0 18px 3px rgba(239, 68, 68, 0.38);
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-subscription-bar.home-subscription-bar--pulse {
    animation: none !important;
  }
}

a.home-subscription-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.14s ease;
  min-height: 88px;
}
a.home-subscription-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}
:root:is([data-theme='dark'], [data-theme='oled']) a.home-subscription-card:hover {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}
a.home-subscription-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.home-subscription-copy {
  flex: 1;
  min-width: 0;
}
.status-card-head > .home-subscription-chev {
  flex: 0 0 auto;
  align-self: center;
  font-weight: 800;
}
.pill-tier {
  background: rgba(109, 74, 255, 0.12);
  color: var(--primary);
  border: 1px solid rgba(109, 74, 255, 0.25);
}
.home-quick-head {
  margin-bottom: 10px;
}
.home-integrations-card {
  padding: 14px 16px;
}
.home-integration-cta {
  text-decoration: none;
  color: inherit;
  margin-top: 2px;
}
.quick-item--integration {
  text-decoration: none;
  color: inherit;
}
.quick-item--integration .home-integration-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.home-integration-copy {
  min-width: 0;
}
.home-integration-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--line2);
}
.home-integration-logo--funpay {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: transparent;
  border: none;
}
.quick-item-touch {
  min-height: 52px;
  padding: 14px;
}
.home-recent-card {
  padding: 16px 18px;
}
.home-section-head {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.home-section-head .section-title {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text);
}
.section-head-text {
  flex: 1;
  min-width: 0;
}
.home-section-head .section-sub {
  margin-top: 4px;
  line-height: 1.4;
}
.section-action {
  flex-shrink: 0;
}
.home-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 20px;
  border: 1px dashed var(--line2);
  border-radius: 16px;
  background: var(--panel2);
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.home-empty-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px auto;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.2), rgba(99, 102, 241, 0.08));
  border: 1px solid rgba(109, 74, 255, 0.2);
}
.home-empty-visual .home-empty-icon {
  width: 26px;
  height: 26px;
  color: color-mix(in srgb, var(--accent) 82%, var(--muted2));
}
.home-empty-title {
  font-weight: 900;
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}
.home-empty-sub {
  margin: 0 0 18px 0;
  line-height: 1.55;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}
.home-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.home-order-card {
  padding: 14px;
}
.home-order-card .thumb {
  width: 62px;
  height: 62px;
}

/* Orders list — toolbar & pagination */
.orders-toolbar {
  gap: 10px;
}
.orders-toolbar-search .orders-search-input {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}
.orders-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  width: 100%;
  min-width: 0;
}
.orders-toolbar-dds {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 14px;
  row-gap: 6px;
  align-items: end;
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
}
.orders-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.orders-filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted2);
  line-height: 1.2;
}
.orders-toolbar-dds .orders-filter-field .dd {
  width: auto;
  min-width: 160px;
}
.orders-toolbar-dds .dd .dd-toggle.select-modern {
  width: auto;
  min-width: 160px;
  box-sizing: border-box;
  padding: 0 12px;
  min-height: 42px;
  height: 42px;
  line-height: 1.3;
  font-size: 14px;
}
.orders-toolbar-dds .dd .dd-label {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.orders-toolbar-dds .dd .dd-caret {
  flex-shrink: 0;
  margin-left: auto;
}
.orders-list-skeletons {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.orders-list-skeleton {
  height: 108px;
  border-radius: 16px;
}
.orders-empty {
  padding: 20px 12px 8px;
}
.orders-empty--filter {
  text-align: center;
  padding: 28px 16px;
}
.orders-empty--filter .orders-empty-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}
.orders-empty--first {
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}
.orders-empty--first .home-empty-actions {
  justify-content: center;
}
.orders-toolbar-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
}
.orders-status-dd.dd,
.orders-kind-dd.dd {
  width: auto;
  min-width: 160px;
}
.orders-pager-info {
  font-size: 13px;
  flex: 0 1 auto;
  min-width: 0;
  text-align: left;
}
.orders-list-page,
.tx-list-page {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.order-row-card .subtitle-line,
.tx-row-card .subtitle-line {
  white-space: normal;
}

@media (max-width: 640px) {
  .orders-page-shell .list-toolbar-compact.orders-toolbar {
    padding: 12px;
    gap: 10px;
    border-radius: 16px;
  }
  .orders-page-shell .orders-toolbar-search .orders-search-input {
    min-height: 44px;
    font-size: 15px;
  }
  .orders-toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .orders-toolbar-row > .orders-toolbar-pager {
    margin-left: 0;
  }
  .orders-toolbar-dds {
    max-width: 100%;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    column-gap: 10px;
    row-gap: 0;
  }
  .orders-filter-label {
    font-size: 10px;
  }
  .orders-toolbar-dds .orders-filter-field .dd {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .orders-toolbar-dds .dd .dd-toggle.select-modern {
    width: 100%;
    min-height: 42px;
    height: 42px;
    min-width: 0;
    padding: 0 12px;
    font-size: 14px;
  }
  .orders-status-dd.dd,
  .orders-kind-dd.dd {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .orders-toolbar-dds .orders-filter-field {
    max-width: none;
    min-width: 0;
  }
  .orders-toolbar-pager {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid var(--line2);
    margin-top: 2px;
  }
  .orders-page-shell .orders-pager {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 4px 4px 10px;
    box-sizing: border-box;
  }
  .orders-page-shell .orders-pager::-webkit-scrollbar {
    height: 4px;
  }
  .orders-page-shell .orders-pager::-webkit-scrollbar-thumb {
    background: var(--line2);
    border-radius: 4px;
  }
  .orders-pager-info {
    text-align: center;
    width: 100%;
  }
  .orders-list-skeletons {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .orders-list-skeleton {
    height: 100px;
  }
  .orders-list-page,
  .tx-list-page {
    gap: 10px;
  }
  .orders-list-page .list-card.order-row-card,
  .tx-list-page .list-card.tx-row-card {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 14px;
    align-items: flex-start;
  }
  .orders-list-page .list-card.order-row-card .thumb,
  .tx-list-page .list-card.tx-row-card .thumb {
    width: 50px;
    height: 50px;
    border-radius: 12px;
  }
  .tx-list-page .list-card.tx-row-card .thumb.tx .i {
    width: 22px;
    height: 22px;
  }
  .orders-list-page .list-card.order-row-card .title,
  .tx-list-page .list-card.tx-row-card .title {
    font-size: 13px;
    line-height: 1.25;
  }
  .orders-list-page .list-card.order-row-card .amount,
  .tx-list-page .list-card.tx-row-card .amount {
    font-size: 13px;
    font-weight: 800;
  }
  .orders-list-page .list-card.order-row-card .subtitle,
  .tx-list-page .list-card.tx-row-card .subtitle {
    font-size: 11px;
    margin-top: 2px;
  }
  .orders-list-page .list-card.order-row-card .meta-row,
  .tx-list-page .list-card.tx-row-card .meta-row {
    margin-top: 4px;
    gap: 6px;
  }
}
@media (max-width: 400px) {
  .orders-page-shell .orders-toolbar-dds {
    row-gap: 12px;
  }
}
@media (hover: none) and (max-width: 700px) {
  .orders-list-page .list-card.order-row-card:hover,
  .tx-list-page .list-card.tx-row-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--line2);
  }
}
@media (max-width: 520px) {
  .page-btn:not(.page-arrow) {
    min-width: 40px;
    min-height: 40px;
    font-size: 14px;
  }
  .page-btn.page-arrow {
    width: 40px;
    height: 40px;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}
.pill-processing {
  background: rgba(255, 193, 7, 0.16);
  color: #c47d0e;
}
.pill-completed {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}
.pill-error {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}
.pill-refund {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}
.pill-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  color: var(--muted);
  font-weight: 700;
  background: var(--panel);
}
.small {
  font-size: 12px;
}

@media (max-width: 1080px) {
  .home-hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .main {
    padding-left: 0;
  }
}

@media (max-width: 600px) {
  .hero-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-order-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .home-order-title {
    white-space: normal;
  }
  .main {
    padding-left: 0;
  }
  .home-intro-actions {
    width: 100%;
  }
  .home-intro-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }
  .home-section-head {
    flex-direction: column;
    align-items: stretch;
  }
  .section-action {
    width: 100%;
    text-align: center;
  }
}
.list-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line2);
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-sizing: border-box;
}
.list-card:hover {
  transform: translateY(-3px);
  border-color: rgba(109, 74, 255, 0.22);
  box-shadow: 0 16px 32px rgba(16, 24, 40, 0.11);
}
.list-card .thumb {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line2);
  background: var(--chip);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Заказы «ключи»: мини-арт при отсутствии обложки / ошибке загрузки (не стиль вертикальной карточки каталога) */
.list-card .thumb.thumb-gk {
  padding: 0;
  border-color: rgba(109, 74, 255, 0.28);
  background: transparent;
}
.order-thumb-gk-art {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
}
.order-thumb-gk-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}
.order-thumb-gk-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 3px 3px;
  box-sizing: border-box;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(
    128deg,
    rgba(109, 74, 255, 0.42) 0%,
    rgba(56, 189, 248, 0.18) 42%,
    rgba(15, 23, 42, 0.95) 100%
  );
}
:root[data-theme='oled'] .order-thumb-gk-fallback {
  background: linear-gradient(
    128deg,
    rgba(109, 74, 255, 0.42) 0%,
    rgba(56, 189, 248, 0.18) 42%,
    rgba(17, 19, 24, 0.96) 100%
  );
}
:root[data-theme='light'] .order-thumb-gk-fallback {
  background: linear-gradient(
    128deg,
    rgba(109, 74, 255, 0.26) 0%,
    rgba(56, 189, 248, 0.14) 38%,
    rgba(248, 250, 252, 0.98) 100%
  );
}
.order-thumb-gk-fallback-shine {
  position: absolute;
  inset: -45%;
  background: linear-gradient(
    115deg,
    transparent 36%,
    rgba(255, 255, 255, 0.13) 49%,
    transparent 61%
  );
  pointer-events: none;
  animation: orderThumbGkShine 7.5s ease-in-out infinite;
}
:root[data-theme='light'] .order-thumb-gk-fallback-shine {
  background: linear-gradient(
    115deg,
    transparent 38%,
    rgba(255, 255, 255, 0.52) 50%,
    transparent 61%
  );
}
@keyframes orderThumbGkShine {
  0%,
  100% {
    transform: translate(-5%, -3%);
    opacity: 0.5;
  }
  50% {
    transform: translate(5%, 5%);
    opacity: 0.88;
  }
}
@media (prefers-reduced-motion: reduce) {
  .order-thumb-gk-fallback-shine {
    animation: none;
    opacity: 0.36;
    transform: none;
  }
}
.order-thumb-gk-fallback-noise {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  pointer-events: none;
  mix-blend-mode: overlay;
  background-image:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.06) 2px,
      rgba(255, 255, 255, 0.06) 3px
    ),
    repeating-linear-gradient(
      72deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.05) 3px,
      rgba(0, 0, 0, 0.05) 4px
    );
}
:root[data-theme='light'] .order-thumb-gk-fallback-noise {
  opacity: 0.2;
  mix-blend-mode: multiply;
}
.order-thumb-gk-fallback-badge {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}
.list-card .thumb.thumb-gk .gamekey-catalog-platform-svg {
  width: 17px;
  height: 17px;
}
.order-thumb-gc-fallback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.order-thumb-gc-fallback-icon .gamekey-cover-placeholder-generic {
  display: flex;
  align-items: center;
  justify-content: center;
}
.order-thumb-gc-fallback-icon .gamekey-cover-placeholder-generic-svg {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.92);
}
:root[data-theme='light'] .order-thumb-gc-fallback-icon .gamekey-cover-placeholder-generic-svg {
  color: rgba(67, 56, 202, 0.88);
}
.order-thumb-gk-fallback-keyglyph {
  display: flex;
  color: rgba(255, 255, 255, 0.9);
  opacity: 0.95;
}
:root[data-theme='light'] .order-thumb-gk-fallback-keyglyph {
  color: rgba(67, 56, 202, 0.88);
}
.order-thumb-gk-fallback-title {
  position: relative;
  z-index: 1;
  font-size: 8px;
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.93);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  max-width: 100%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}
:root[data-theme='light'] .order-thumb-gk-fallback-title {
  color: rgba(30, 41, 59, 0.9);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.list-card .thumb.tx {
  background: linear-gradient(135deg, rgba(109, 74, 255, 0.16), rgba(124, 92, 255, 0.08));
}
.list-card .thumb.tx.tx-credit {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(34, 197, 94, 0.08));
}
.list-card .thumb.tx.tx-debit {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(248, 113, 113, 0.08));
}
.list-card .thumb.tx .i {
  width: 28px;
  height: 28px;
  color: var(--text);
}
.list-card .meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list-card .title {
  font-weight: 700;
  font-size: 14px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.list-card .title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.list-card .amount {
  font-weight: 800;
  white-space: nowrap;
}
.list-card .subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list-card .subtitle-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subtitle-line {
  display: block;
  word-break: break-word;
}
.list-card .row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.list-card .meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  justify-content: flex-start;
}
.list-card .meta-row.meta-row-left {
  justify-content: flex-start;
}
.list-card .right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 90px;
}
.list-card.compact {
  grid-template-columns: auto 1fr;
  align-items: stretch;
}
.badge-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.dot-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line2);
  background: var(--chip);
}
.dot-icon.created {
  border-color: rgba(113, 113, 122, 0.45);
  background: rgba(113, 113, 122, 0.1);
  color: #52525b;
}
:root:is([data-theme='dark'], [data-theme='oled']) .dot-icon.created {
  border-color: rgba(161, 161, 170, 0.5);
  background: rgba(82, 82, 91, 0.28);
  color: rgba(212, 212, 216, 0.92);
}
.dot-icon.processing {
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.12);
  color: #c2410c;
  animation: spin 1.4s linear infinite;
}
:root:is([data-theme='dark'], [data-theme='oled']) .dot-icon.processing {
  color: rgba(255, 201, 117, 0.95);
}
.dot-icon.completed {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
:root:is([data-theme='dark'], [data-theme='oled']) .dot-icon.completed {
  color: rgba(140, 255, 190, 0.95);
}
.dot-icon.error {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}
:root:is([data-theme='dark'], [data-theme='oled']) .dot-icon.error {
  color: rgba(255, 169, 169, 0.95);
}
.dot-icon.refund {
  border-color: rgba(59, 130, 246, 0.32);
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}
:root:is([data-theme='dark'], [data-theme='oled']) .dot-icon.refund {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.18);
  color: rgba(147, 197, 253, 0.95);
}
.dot-icon.cancelled {
  border-color: rgba(107, 114, 128, 0.45);
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}
:root:is([data-theme='dark'], [data-theme='oled']) .dot-icon.cancelled {
  border-color: rgba(156, 163, 175, 0.4);
  background: rgba(75, 85, 99, 0.2);
  color: rgba(229, 231, 235, 0.9);
}
.pill-ghost {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: var(--chip);
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.list-actions .meta-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  min-width: 120px;
}
.meta-small {
  color: var(--muted);
  font-size: 12px;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.pager-info {
  font-weight: 700;
  color: var(--text);
  background: var(--chip);
  border: 1px solid var(--line2);
  padding: 6px 10px;
  border-radius: 12px;
}
.page-btn {
  border: 1px solid var(--line2);
  background: var(--panel);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
  min-width: 32px;
  cursor: pointer;
  transition:
    border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.22s ease,
    transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}
.page-btn.page-arrow {
  border-radius: 50%;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn.active {
  background: var(--primary-soft);
  border-color: rgba(109, 74, 255, 0.32);
  color: var(--primary);
}
.page-btn:hover:not(:disabled) {
  border-color: var(--primary-soft);
  box-shadow: 0 6px 20px rgba(16, 24, 40, 0.1);
}
.page-btn:hover:not(:disabled):not(.active) {
  transform: translateY(-1px);
}
.page-btn:active:not(:disabled) {
  transform: translateY(0);
  transition-duration: 0.12s;
}
.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.pager-ellipsis {
  color: var(--muted);
  padding: 0 4px;
}
.divider-ghost {
  height: 1px;
  background: var(--line2);
  margin: 8px 0;
}

/* Final mobile clamp */
@media (max-width: 700px) {
  #pageRoot {
    max-width: 100%;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }
  .main-scroll {
    padding: 10px 10px 0;
  }
  .list-toolbar-compact {
    padding: 10px;
  }
  .list-cards,
  .orders-list,
  .tx-list,
  .home-order-list {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px;
  }
  .list-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}
.gift-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gift-main-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.gift-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.gift-panels > * {
  animation: fadeUp 0.28s ease both;
}
.gift-panels > * {
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--panel);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}
.gift-summary-card {
  display: flex;
}
.gift-summary-card .gift-summary {
  position: sticky;
  top: 0;
  width: 100%;
  min-height: 520px;
}
.gift-two-col {
  display: grid;
  grid-template-columns: 0.15fr 1.85fr;
  gap: 10px;
}
.gift-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gift-aside {
  min-width: 0;
}
.gift-aside .gift-summary {
  position: sticky;
  top: 12px;
}
.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.gift-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gift-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gift-games {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}
.gift-card {
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--panel2);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
  width: 100%;
}
.gift-card:hover,
.gift-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(109, 74, 255, 0.32);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}
.gift-card.active {
  border-color: rgba(109, 74, 255, 0.4);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}
.gift-card img {
  width: 66px;
  height: 36px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line2);
  align-self: flex-start;
}
.gift-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.gift-card-title {
  font-weight: 700;
  color: var(--text);
}
.gift-editions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gift-edition {
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  background: var(--panel2);
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gift-edition:hover,
.gift-edition:focus-visible {
  border-color: rgba(109, 74, 255, 0.3);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}
.gift-edition.active {
  border-color: rgba(109, 74, 255, 0.4);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}
.gift-edition-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.gift-edition-sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.gift-edition {
  color: var(--text);
}
.gift-regions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 190px;
  overflow: auto;
  padding-right: 4px;
}
.gift-region {
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel2);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  color: var(--text);
}
.gift-region:hover,
.gift-region:focus-visible {
  border-color: rgba(109, 74, 255, 0.3);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}
.gift-region.active {
  border-color: rgba(109, 74, 255, 0.4);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}
.gift-region-flag img {
  width: 36px;
  height: 24px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line2);
}
.gift-region-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.gift-region-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gift-region-price {
  font-weight: 800;
  white-space: nowrap;
  margin-left: auto;
  min-width: 56px;
  text-align: right;
}
@media (max-width: 900px) {
  .gift-regions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .gift-region {
    padding: 12px;
    gap: 12px;
    height: auto;
  }
  .gift-region-price {
    font-size: 14px;
  }
}
.gift-summary {
  margin-top: 6px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gift-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.gift-summary-badge {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: var(--chip);
  font-weight: 700;
  font-size: 12px;
}
.gift-summary-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Только карточка сводки — не модалки (.gift-summary-modal), иначе строки ломаются в две колонки */
.gift-summary .gift-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gift-summary .gift-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: var(--panel);
  font-size: 14px;
}
.gift-summary .gift-summary-row .k {
  color: var(--muted);
  font-weight: 700;
}
.gift-summary .gift-summary-row .v {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gift-summary .gift-summary-row.total {
  border-color: rgba(109, 74, 255, 0.35);
  background: var(--primary-soft);
  color: var(--primary);
}
.gift-summary .gift-summary-flag img {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line2);
}
.gift-summary .gift-summary-row {
  flex-wrap: wrap;
}
.gift-summary-title {
  font-weight: 800;
}
.gift-summary-price {
  font-weight: 800;
}

/* Slim, subtle scrollbars for light UI */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 700px) {
  .gift-two-col {
    grid-template-columns: 1fr;
  }
  .gift-summary-card .gift-summary {
    position: relative;
    top: 0;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Transaction detail — ticket strip (no green frame; compact status) */
.tx-ticket-outer {
  --tx-matte: var(--bg);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 14px;
  box-sizing: border-box;
}
.tx-ticket {
  position: relative;
  margin: 0;
  background: var(--panel2);
  border-radius: var(--r);
  border: 1px solid var(--line2);
  box-shadow: var(--shadow2);
  overflow: hidden;
}
.tx-ticket-top {
  padding: 16px clamp(16px, 3vw, 22px) 10px;
  text-align: left;
}
.tx-ticket-head-row {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 12px;
}
.tx-ticket-status-wrap {
  flex-shrink: 0;
  max-width: min(100%, 420px);
}
.tx-ticket-status-wrap .status-stack {
  border-radius: 999px;
  padding: 4px 12px 4px 6px;
  gap: 8px;
}
.tx-ticket-status-wrap .status-stack .dot-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.tx-ticket-status-wrap .status-stack .dot-icon .i {
  width: 13px;
  height: 13px;
}
.tx-ticket-status-wrap .status-stack > div:last-child {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.tx-ticket-status-wrap .status-main {
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-ticket-facts {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tx-ticket-fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line2);
  font-size: 14px;
}
.tx-ticket-fact-k {
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
.tx-ticket-fact-v {
  font-weight: 700;
  text-align: right;
  min-width: 0;
  word-break: break-word;
  color: var(--text);
}
.tx-ticket-amt-block {
  margin-top: 4px;
  padding: 14px 0 4px;
}
.tx-ticket-amt-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted2);
}
.tx-ticket-amt {
  margin-top: 6px;
  font-size: clamp(26px, 3.8vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.tx-ticket-meta.tx-ticket-meta--upper {
  margin-top: 8px;
}
.tx-ticket-meta.tx-ticket-meta--upper .tx-ticket-meta-row:first-child {
  border-top: 1px solid var(--line2);
  margin-top: 6px;
  padding-top: 14px;
}
.tx-ticket-rip {
  display: flex;
  align-items: center;
  padding: 0 clamp(10px, 2.5vw, 16px);
  margin: 2px 0 0;
  height: 22px;
}
.tx-ticket-rip-notch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--tx-matte);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
}
:root:is([data-theme='dark'], [data-theme='oled']) .tx-ticket-rip-notch {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.tx-ticket-rip-line {
  flex: 1;
  border-top: 2px dashed rgba(16, 24, 40, 0.14);
  margin: 0 2px;
}
:root:is([data-theme='dark'], [data-theme='oled']) .tx-ticket-rip-line {
  border-top-color: rgba(255, 255, 255, 0.12);
}
.tx-ticket-stub {
  padding: 14px clamp(16px, 3vw, 22px) 8px;
}
.tx-ticket-stub-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted2);
  margin-bottom: 10px;
}
.tx-ticket-detail-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: var(--r2);
  background: var(--input);
  border: 1px solid var(--line2);
  text-align: left;
}
.tx-ticket-detail-centered {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}
.tx-ticket-detail-ico {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--chip);
  border: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.tx-ticket-detail-ico .i {
  width: 18px;
  height: 18px;
}
.tx-ticket-detail-main {
  min-width: 0;
  flex: 1;
  max-width: 100%;
  display: flex;
  align-items: center;
  min-height: 36px;
}
.tx-ticket-detail-body {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  text-align: left;
}
.tx-ticket-meta {
  display: flex;
  flex-direction: column;
}
.tx-ticket-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line2);
  font-size: 14px;
}
.tx-ticket-meta-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}
.tx-ticket-meta-k {
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
.tx-ticket-meta-v {
  font-weight: 700;
  text-align: right;
  min-width: 0;
  word-break: break-word;
  color: var(--text);
}
.tx-ticket-meta-row--stack {
  flex-direction: column;
  gap: 6px;
}
.tx-ticket-meta-row--stack .tx-ticket-meta-v {
  text-align: left;
}
.tx-ticket-pre {
  white-space: pre-wrap;
}
.tx-ticket-type-code {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--chip);
  border: 1px solid var(--line2);
  display: inline-block;
}
.tx-ticket-holes {
  height: 12px;
  margin: 2px clamp(12px, 2.5vw, 20px) 0;
  background: radial-gradient(circle at 10px 0, transparent 8px, var(--panel2) 8px);
  background-size: 20px 12px;
  background-repeat: repeat-x;
}
.tx-ticket-inner-foot {
  padding: 14px clamp(16px, 3vw, 22px) 16px;
  border-top: 1px solid var(--line2);
  background: var(--panel2);
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 12px;
}
.confirm-modal {
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 16px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.confirm-title {
  font-weight: 800;
  font-size: 16px;
}
.confirm-text {
  color: var(--muted);
  font-size: 14px;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Steam top-up: предупреждение «логин не проверен» в окне подтверждения заказа */
.steam-topup-flow-modal .steam-login-unverified {
  margin: 4px 0 10px;
  text-align: left;
}

