/* MANEKEN — читаемая тёмная тема. Максимальный контраст, крупные шрифты.
   Приоритет: чтобы на телефоне ВСЁ было чётко видно.
*/

/* Полностью перекрываем TG-переменные, чтобы TG не подсунул белый фон / серые цвета */
:root,
:root[data-theme],
:root[data-theme="light"],
:root[data-theme="dark"] {
  color-scheme: dark !important;

  --tg-theme-bg-color: #0A0A0B !important;
  --tg-theme-secondary-bg-color: #242430 !important;
  --tg-theme-text-color: #FFFFFF !important;
  --tg-theme-hint-color: #C0C0CC !important;
  --tg-theme-link-color: #E8C97A !important;
  --tg-theme-button-color: #D4B876 !important;
  --tg-theme-button-text-color: #0A0A0B !important;
  --tg-theme-header-bg-color: #0A0A0B !important;
  --tg-theme-accent-text-color: #E8C97A !important;
  --tg-theme-section-bg-color: #242430 !important;
  --tg-theme-section-header-text-color: #E8C97A !important;
  --tg-theme-subtitle-text-color: #C0C0CC !important;
  --tg-theme-destructive-text-color: #FF6B6B !important;
}

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

/* Максимально жёсткий force dark на всех уровнях */
html, body {
  background: #0A0A0B !important;
  background-color: #0A0A0B !important;
  color: #FFFFFF !important;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============= Видимый скроллбар (на десктопе TG-webview прячет по умолчанию) ============= */
html {
  scrollbar-width: thin;               /* Firefox */
  scrollbar-color: #E8C97A #14141A;    /* Firefox */
}
body::-webkit-scrollbar,
.pane::-webkit-scrollbar {
  width: 10px;
}
body::-webkit-scrollbar-track,
.pane::-webkit-scrollbar-track {
  background: #14141A;
}
body::-webkit-scrollbar-thumb,
.pane::-webkit-scrollbar-thumb {
  background: #E8C97A;
  border-radius: 6px;
  border: 2px solid #14141A;
}
body::-webkit-scrollbar-thumb:hover,
.pane::-webkit-scrollbar-thumb:hover {
  background: #F5D98A;
}

main, section, .pane, .block {
  background-color: #0A0A0B;
}

/* ============= TopBar ============= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  gap: 12px;
  background: #0A0A0B !important;
  border-bottom: 1px solid #5A5A6C;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.brand-name {
  font-weight: 800;
  font-size: 24px;
  color: #FFFFFF !important;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand-sub {
  color: #E8C97A !important;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border: 2px solid #E8C97A;
  background: #2E2E3A !important;
  border-radius: 999px;
  color: #E8C97A !important;
  font-size: 16px;
  font-weight: 800;
  min-height: 44px;
}

.chip-icon {
  font-size: 14px;
  color: #E8C97A;
}

/* ============= Tabs ============= */
.tabs {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #0A0A0B !important;
  border-bottom: 1px solid #5A5A6C;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 11px 20px;
  border: 2px solid #5A5A6C;
  background: #2E2E3A !important;
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  font-family: inherit;
}

.tab-active {
  background: #E8C97A !important;
  color: #0A0A0B !important;
  border-color: #E8C97A;
  font-weight: 800;
}

/* ============= Panes ============= */
.pane {
  display: none;
  padding: 20px 20px 140px;
  background: #0A0A0B !important;
  max-width: 720px;
  margin: 0 auto;
}
.pane-active { display: block; }

/* На больших экранах — центрировать контент, не растягивать на всю ширину */
@media (min-width: 900px) {
  main {
    max-width: 780px;
    margin: 0 auto;
  }
  .topbar {
    max-width: 780px;
    margin: 0 auto;
  }
  .scroll-wrap {
    max-width: 780px;
    margin: 0 auto;
  }
}
/* На очень больших — оставляем 780, а по бокам — тёмная рамка */
@media (min-width: 1400px) {
  body::before,
  body::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: calc((100vw - 780px) / 2);
    background: linear-gradient(to right, #0A0A0B, #14141A);
    z-index: -1;
    pointer-events: none;
  }
  body::before { left: 0; }
  body::after { right: 0; background: linear-gradient(to left, #0A0A0B, #14141A); }
}

.block {
  background: #242430 !important;
  border: 1px solid #5A5A6C;
  padding: 20px 18px;
  margin-bottom: 16px;
  border-radius: 14px;
}

.block-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: #FFFFFF !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  font-weight: 800;
}

.hint {
  color: #E8C97A !important;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}

/* ============= Preset grid ============= */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.preset-btn {
  padding: 18px 14px;
  border: 2px solid #5A5A6C;
  background: #3A3A48 !important;
  color: #FFFFFF !important;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  font-family: inherit;
}
.preset-btn:active { transform: scale(0.97); }

.preset-btn .preset-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF !important;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.preset-btn .preset-cat {
  font-size: 11px;
  color: #C0C0CC !important;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 700;
}

.preset-btn.active {
  border-color: #E8C97A;
  background: #4A4A5A !important;
  border-width: 2px;
}
.preset-btn.active .preset-title { color: #E8C97A !important; }
.preset-btn.active .preset-cat { color: #F5D98A !important; }

/* ============= Prompt ============= */
textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid #5A5A6C;
  background: #3A3A48 !important;
  color: #FFFFFF !important;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
}

textarea::placeholder {
  color: #9090A0 !important;
  opacity: 1;
  font-weight: 500;
}

textarea:focus {
  outline: none;
  border-color: #E8C97A;
  background: #4A4A5A !important;
}

/* ============= Modes ============= */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mode-btn {
  padding: 14px 10px 12px;
  border-radius: 12px;
  border: 2px solid #5A5A6C;
  background: #3A3A48 !important;
  color: #FFFFFF !important;
  cursor: pointer;
  text-align: center;
  min-height: 160px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  align-items: start;
  justify-items: center;
  font-family: inherit;
}
.mode-btn:active { transform: scale(0.97); }

.mode-btn.active {
  border-color: #E8C97A;
  background: #4A4A5A !important;
}

.mode-btn .mode-title {
  font-weight: 800;
  color: #FFFFFF !important;
  font-size: 15px;
  letter-spacing: -0.01em;
  min-height: 20px;
  display: flex;
  align-items: center;
}
.mode-btn.active .mode-title { color: #E8C97A !important; }

.mode-btn .mode-sub {
  font-size: 12px;
  color: #D0D0DA !important;
  line-height: 1.35;
  font-weight: 500;
  align-self: center;
  padding: 0 2px;
}

.mode-btn .mode-time {
  color: #E8C97A !important;
  font-weight: 800;
  font-size: 12px;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid rgba(232, 201, 122, 0.25);
  width: 100%;
  letter-spacing: 0.02em;
  margin-top: 2px;
  display: block;
}

/* ============= Aspects ============= */
.aspect-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.aspect-btn {
  padding: 14px 4px;
  border-radius: 10px;
  border: 2px solid #5A5A6C;
  background: #3A3A48 !important;
  color: #FFFFFF !important;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  min-height: 48px;
  font-family: inherit;
}
.aspect-btn:active { transform: scale(0.95); }

.aspect-btn.active {
  background: #E8C97A !important;
  color: #0A0A0B !important;
  border-color: #E8C97A;
}

/* ============= History ============= */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: #FFFFFF !important;
}

.empty-icon {
  font-size: 44px;
  margin-bottom: 18px;
  color: #E8C97A !important;
}

.empty-title {
  font-size: 18px;
  font-weight: 800;
  color: #FFFFFF !important;
  margin-bottom: 8px;
}

.empty-sub {
  color: #D0D0DA !important;
  font-size: 14px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.history-card {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3/4;
  background: #3A3A48 !important;
  cursor: pointer;
  position: relative;
  border: 2px solid #5A5A6C;
}

.history-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-card .meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.9));
  font-size: 12px;
  color: #FFFFFF !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.history-card.broken {
  display: grid;
  place-items: center;
  padding: 12px;
  color: #C0C0CC !important;
  font-size: 13px;
  text-align: center;
}

/* ============= Topup ============= */
.topup-hero {
  background: #3A3A48 !important;
  border: 2px solid #5A5A6C;
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 15px;
  color: #FFFFFF !important;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}

.topup-hero.discount {
  border-color: #E8C97A;
  background: #4A4A5A !important;
  border-width: 2px;
}

.topup-hero.discount b {
  color: #E8C97A !important;
  font-size: 17px;
  font-weight: 800;
}

.pkg-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pkg-card {
  border: 2px solid #5A5A6C;
  background: #3A3A48 !important;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  min-height: 82px;
}
.pkg-card:active { transform: scale(0.99); }
.pkg-card:hover {
  border-color: #E8C97A;
  background: #4A4A5A !important;
}

.pkg-card.popular {
  border-color: #E8C97A;
  position: relative;
}

.pkg-card.popular::before {
  content: "ПОПУЛЯРНОЕ";
  position: absolute;
  top: -11px;
  left: 18px;
  padding: 4px 12px;
  background: #E8C97A !important;
  color: #0A0A0B !important;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  border-radius: 4px;
}

.pkg-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pkg-left .pkg-tokens {
  font-weight: 900;
  font-size: 22px;
  color: #FFFFFF !important;
  letter-spacing: -0.01em;
}

.pkg-left .pkg-desc {
  color: #D0D0DA !important;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.pkg-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.pkg-right .pkg-price {
  font-weight: 900;
  font-size: 22px;
  color: #E8C97A !important;
}

.pkg-right .pkg-price-old {
  color: #9090A0 !important;
  text-decoration: line-through;
  font-size: 13px;
  font-weight: 600;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: #D0D0DA !important;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #5A5A6C;
}

/* ============= Toast ============= */
.toast {
  position: fixed;
  left: 50%; bottom: 100px;
  transform: translateX(-50%) translateY(100px);
  background: #3A3A48 !important;
  border: 2px solid #E8C97A;
  color: #FFFFFF !important;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  transition: transform 0.3s, opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  max-width: 92vw;
  text-align: center;
}

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

.toast.error {
  border-color: #FF6B6B;
  color: #FF6B6B !important;
}

.toast.success {
  border-color: #4ADE80;
  color: #4ADE80 !important;
}

/* ============= Lightbox — по умолчанию СКРЫТ ============= */
.lightbox {
  display: none;
}
.lightbox.open {
  display: grid;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.98) !important;
  place-items: center;
  padding: 20px;
  z-index: 100;
}
/* Защита: если hidden-атрибут стоит — точно скрыт */
.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.9);
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #E8C97A;
  background: #0A0A0B !important;
  color: #E8C97A !important;
  font-size: 24px;
  cursor: pointer;
  font-weight: 700;
  z-index: 101;
}

.footer-spacer { height: 24px; }

/* ============= Loading ============= */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,10,11,0.96) !important;
  display: grid;
  place-items: center;
  z-index: 200;
  gap: 20px;
  backdrop-filter: blur(6px);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #5A5A6C;
  border-top-color: #E8C97A;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-overlay .txt {
  color: #FFFFFF !important;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============= ADMIN PANEL ============= */
.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #5A5A6C;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  padding: 8px 14px;
  border: 1px solid #5A5A6C;
  background: #2E2E3A !important;
  color: #C0C0CC !important;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  font-family: inherit;
}
.admin-tab-active {
  background: #E8C97A !important;
  color: #0A0A0B !important;
  border-color: #E8C97A;
}

.admin-panel { display: none; }
.admin-panel-active { display: block; }

.admin-block {
  background: #242430;
  border: 1px solid #5A5A6C;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.admin-block-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: #E8C97A;
  font-weight: 800;
  margin-bottom: 12px;
}

.admin-hint {
  font-size: 12px;
  color: #A8A8B3;
  margin: 6px 0 10px;
}

.admin-input,
.admin-textarea,
select.admin-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #5A5A6C;
  background: #3A3A48 !important;
  color: #FFFFFF !important;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.admin-textarea {
  min-height: 100px;
  resize: vertical;
}

.admin-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}
.admin-row .admin-input { margin-bottom: 0; flex: 1; }

.admin-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #5A5A6C;
  background: #3A3A48;
  color: #FFFFFF;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  white-space: nowrap;
}

.admin-btn-primary {
  background: #E8C97A;
  border-color: #E8C97A;
  color: #0A0A0B;
}

.admin-btn-danger {
  background: transparent;
  border-color: #C8534A;
  color: #FF8C82;
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.admin-btn-danger:hover {
  background: #C8534A;
  color: #FFFFFF;
}

/* Дата в промо-панели: нативный date-picker */
.admin-input[type="date"] {
  color-scheme: dark;
  font-family: inherit;
  cursor: pointer;
}
.admin-field-label {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8B8B99;
  margin: 8px 0 4px;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.admin-metric {
  background: #2E2E3A;
  border: 1px solid #5A5A6C;
  border-radius: 10px;
  padding: 14px 12px;
}
.admin-metric-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #A8A8B3;
  margin-bottom: 6px;
  font-weight: 700;
}
.admin-metric-value {
  font-size: 22px;
  font-weight: 800;
  color: #E8C97A;
  line-height: 1;
  letter-spacing: -0.01em;
}
.admin-metric-sub {
  font-size: 11px;
  color: #C0C0CC;
  margin-top: 5px;
}

.admin-feed {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 500px;
  overflow-y: auto;
}
.admin-feed-item {
  background: #2E2E3A;
  border-left: 3px solid #E8C97A;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #F5F5F7;
}
.admin-feed-item.twa { border-left-color: #7EE0A8; }
.admin-feed-item .fe-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 3px;
}
.admin-feed-item .fe-type { color: #E8C97A; }
.admin-feed-item .fe-time {
  color: #8E8E9C;
  font-size: 10px;
}
.admin-feed-item .fe-body {
  color: #C0C0CC;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  word-break: break-all;
}

.admin-funnel {
  margin-bottom: 20px;
}
.admin-funnel-name {
  font-size: 14px;
  color: #E8C97A;
  font-weight: 800;
  margin-bottom: 10px;
}
.admin-funnel-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.admin-funnel-label {
  font-size: 12px;
  color: #FFFFFF;
  min-width: 140px;
  font-weight: 700;
}
.admin-funnel-bar-wrap {
  flex: 1;
  background: #2E2E3A;
  border-radius: 6px;
  height: 18px;
  overflow: hidden;
  position: relative;
}
.admin-funnel-bar {
  height: 100%;
  background: linear-gradient(90deg, #E8C97A, #C9A961);
  border-radius: 6px;
  transition: width 0.4s ease;
}
.admin-funnel-value {
  font-size: 12px;
  color: #FFFFFF;
  font-weight: 700;
  min-width: 70px;
  text-align: right;
}
.admin-funnel-drop {
  color: #FF6B6B;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.admin-table th,
.admin-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #3A3A48;
  text-align: left;
  color: #FFFFFF;
}
.admin-table th {
  color: #E8C97A;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-table td.num { text-align: right; font-family: ui-monospace, monospace; }

/* Список юзеров с фильтрами */
.admin-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.admin-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: #2A2A34;
  color: #B0B0BC;
  border: 1px solid #3A3A48;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.admin-chip:hover {
  background: #3A3A48;
  color: #FFFFFF;
}
.admin-chip-active {
  background: #E8C97A;
  color: #1A1A22;
  border-color: #E8C97A;
  font-weight: 700;
}
.admin-users-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
}
.admin-users-table {
  min-width: 720px;
}
.admin-users-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}
.admin-users-table tbody tr:hover {
  background: #2A2A34;
}
.admin-users-table td {
  vertical-align: middle;
  white-space: nowrap;
}
.admin-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 3px;
}
.admin-badge-red   { background: #4A1F1F; color: #FF7B7B; }
.admin-badge-green { background: #1F3A28; color: #6DE6A5; }
.admin-badge-gold  { background: #3A2E14; color: #E8C97A; }

/* Выравнивание Live feed */
.fe-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fe-type { font-weight: 700; color: #FFFFFF; }
.fe-time { color: #8B8B99; font-size: 11px; font-family: ui-monospace, monospace; white-space: nowrap; }

.admin-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-error {
  color: #FF6B6B;
  font-size: 12px;
  padding: 8px 0;
}

.admin-pill {
  display: inline-block;
  padding: 3px 8px;
  background: #3A3A48;
  color: #E8C97A;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 6px;
}


/* ============= Admin: кликабельная метрика + модалка со списком юзеров ============= */
.admin-metric-clickable {
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.admin-metric-clickable:hover {
  border-color: #E8C97A !important;
  background: #4A4A5A !important;
}
.admin-metric-clickable:active {
  transform: scale(0.98);
}
.admin-metric-hint {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 9px;
  color: #E8C97A;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

.admin-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 150;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px;
  backdrop-filter: blur(4px);
}
.admin-modal.open { display: flex; }
.admin-modal-inner {
  background: #14141A;
  border: 2px solid #E8C97A;
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.admin-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #5A5A6C;
}
.admin-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: #E8C97A;
  letter-spacing: 0.02em;
}
.admin-modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid #5A5A6C;
  background: transparent;
  color: #FFFFFF;
  font-size: 20px;
  cursor: pointer;
}
.admin-modal-close:hover {
  border-color: #E8C97A;
  color: #E8C97A;
}
.admin-modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  color: #FFFFFF;
}

.am-list { display: flex; flex-direction: column; gap: 6px; }
.am-row {
  padding: 10px 12px;
  border-radius: 8px;
  background: #22222C;
  border: 1px solid #33333F;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.am-row:hover {
  border-color: #E8C97A;
  background: #2E2E38;
}
.am-row-who {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}
.am-row-meta {
  font-size: 12px;
  color: #B0B0BC;
}

/* ============= Стрелки скролла для длинных таб-полос (ПК) ============= */
.scroll-wrap { position: relative; }
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid #E8C97A;
  background: rgba(10, 10, 11, 0.85);
  color: #E8C97A;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  backdrop-filter: blur(4px);
}
.scroll-arrow:hover { background: #E8C97A; color: #0A0A0B; transform: translateY(-50%) scale(1.05); }
.scroll-arrow-left  { left: 4px; }
.scroll-arrow-right { right: 4px; }
/* Показываем стрелки только на десктопе (при наведении мыши и >= 700px) */
@media (min-width: 700px) and (hover: hover) {
  .scroll-arrow.visible { display: flex; }
  .scroll-arrow { width: 36px; height: 36px; font-size: 18px; border-width: 2px; }
}

/* Универсальная админ-модалка (drill-down по отвалу, юзерам) */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.admin-modal.open { display: flex; }
.admin-modal-content {
  background: #14121A;
  border: 1px solid #2A2530;
  border-radius: 8px;
  padding: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
}
.admin-modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #2A2530;
  background: transparent;
  color: #B0B0BC;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.admin-modal-close:hover { background: #2A2530; color: #FFFFFF; }
.admin-modal-header {
  margin-bottom: 14px;
  color: #E8C97A;
  font-size: 14px;
}
.dropoff-row:hover {
  background: rgba(232, 201, 122, 0.06);
  border-radius: 6px;
}

/* Примеры промптов под textarea */
.prompt-examples-label {
  font-size: 12px;
  color: #B0B0BC;
  margin: 12px 0 8px;
  letter-spacing: 0.02em;
}
.prompt-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prompt-example-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #2A2A34;
  color: #E8C97A;
  border: 1px solid #4A4A5A;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.prompt-example-chip:hover {
  background: #E8C97A;
  color: #0A0A0B;
  border-color: #E8C97A;
}
.prompt-example-chip:active {
  transform: scale(0.97);
}

/* Кнопка «Наверх» — появляется на ПК после прокрутки */
.scroll-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #E8C97A;
  background: rgba(20, 18, 26, 0.92);
  color: #E8C97A;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: transform 0.15s, background 0.15s;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}
.scroll-to-top:hover {
  background: #E8C97A;
  color: #0A0A0B;
  transform: scale(1.08);
}
.scroll-to-top.visible { display: flex; }
@media (max-width: 699px) {
  .scroll-to-top { display: none !important; }
}
