/* Стили для страниц аккаунта, входа, регистрации и админки. */
.auth-wrap {
  width: min(calc(100% - 32px), 1180px);
  margin: 28px auto 60px;
}

.auth-card {
  width: min(100%, 460px);
  margin: 40px auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 34px 30px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.auth-card .sub {
  color: var(--muted);
  margin: 0 0 22px;
  font-size: 15px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
}
.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="text"] {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
  transition: .2s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,159,104,.16); }

.code-input {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 8px;
  font-variant-numeric: tabular-nums;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-dark);
  font-weight: 800;
  cursor: pointer;
  font: inherit;
}
.link-btn:disabled { opacity: .5; cursor: not-allowed; }

.legal-doc { max-width: 820px; margin: 20px auto; }
.legal-doc h2 { font-size: 18px; margin: 22px 0 10px; }
.legal-doc ul { margin: 0 0 12px; padding-left: 1.25em; color: var(--ink, #3a2418); }
.legal-doc li { margin-bottom: 6px; line-height: 1.5; }
.legal-doc p { line-height: 1.55; margin: 0 0 12px; }
.legal-updated { color: var(--muted); font-size: 13px; margin-bottom: 16px !important; }

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.checkbox-row input { margin-top: 3px; flex: 0 0 auto; }
.checkbox-text { line-height: 1.45; }
.checkbox-row a.legal-link,
.checkbox-text a.legal-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.checkbox-row a.legal-link:hover,
.checkbox-text a.legal-link:hover { color: var(--choco); }

.btn-block { width: 100%; justify-content: center; }

.auth-alt {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}
.auth-alt a { color: var(--accent-dark); font-weight: 800; }

.msg {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  display: none;
}
.msg.show { display: block; }
.msg.error { background: #ffe7e0; color: #b3341a; }
.msg.ok { background: #e3f6e8; color: #1f7a45; }

/* Шапка с аккаунтом */
.auth-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,248,239,.9);
  border: 1px solid var(--line);
  font-weight: 900;
  font-size: 14px;
}

/* Кабинет / админка — таблицы и карточки */
.panel {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 22px;
}
.panel h2 { margin: 0 0 16px; font-size: 20px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.stat-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}
.stat-box .num { font-size: 24px; font-weight: 950; }
.stat-box .lbl { color: var(--muted); font-size: 13px; font-weight: 800; }
a.tariff-ceny-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 159, 104, .4);
  border-radius: var(--radius-md);
  background: linear-gradient(105deg, rgba(255, 248, 239, .98) 0%, #fff 55%, rgba(255, 236, 220, .9) 100%);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(255, 159, 104, .1);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
a.tariff-ceny-banner:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(255, 159, 104, .18);
  transform: translateY(-1px);
}
a.tariff-ceny-banner:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tariff-ceny-banner__body {
  flex: 1;
  min-width: 0;
}
.tariff-ceny-banner__eyebrow {
  display: block;
  margin: 0 0 4px;
  color: var(--accent-dark, #c45a00);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tariff-ceny-banner__title {
  display: block;
  font-size: 17px;
  font-weight: 900;
  color: var(--choco);
  line-height: 1.25;
}
.tariff-ceny-banner__desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.tariff-ceny-banner__arrow {
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 900;
  color: var(--accent-dark, #e07a3a);
  line-height: 1;
}
.account-fav-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 180, 60, .35);
  background: rgba(255, 248, 236, .85);
  font-size: 13px;
  line-height: 1.45;
  color: var(--choco);
}
.account-fav-note a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.account-fav-note a:hover {
  color: var(--choco);
}
.stat-box-free {
  padding: 12px 14px;
}
.stat-box-free .num {
  font-size: 20px;
}
.stat-box-free .lbl {
  font-size: 12px;
  line-height: 1.3;
}
.stat-box-free.is-empty {
  border-color: rgba(214,69,69,.25);
  background: rgba(255,245,245,.85);
}
.stat-box-free.is-empty .num { color: #d64545; }
.stat-box-free .free-limit-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  overflow: hidden;
  margin-top: 8px;
}
.stat-box-free .free-limit-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb347, #ff9f68);
}
.stat-box-free.is-empty .free-limit-fill { background: #d64545; }
.stat-box-free-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.stat-box-free.is-empty .stat-box-free-note { color: #d64545; }
.stat-box-free-wm {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.price-list-panel {
  background:
    radial-gradient(circle at 18% 0%, rgba(255,214,223,.5), transparent 34%),
    radial-gradient(circle at 95% 10%, rgba(255,159,104,.2), transparent 30%),
    var(--bg-soft);
}
.price-list-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.price-list-head h2 { margin-bottom: 0; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.price-rate {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 950;
  color: var(--choco);
}
.price-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.price-list-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
}
.price-list-item strong,
.price-list-item span,
.price-list-item small {
  display: block;
}
.price-list-item strong {
  font-size: 15px;
  margin-bottom: 10px;
}
.price-list-item span {
  color: var(--choco);
  font-size: 24px;
  font-weight: 950;
  margin-bottom: 8px;
}
.price-list-item small,
.price-list-note {
  color: var(--muted);
  line-height: 1.5;
}
.price-list-note { margin: 14px 0 0; }

.free-limit-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  overflow: hidden;
}
.free-limit-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb347, #ff9f68);
  transition: width .25s ease;
}

.price-section-title {
  margin: 24px 0 12px;
  font-size: 17px;
}
.price-packages-table td,
.price-packages-table th {
  white-space: nowrap;
}
.price-packages-table td:nth-child(2) {
  font-weight: 900;
  color: var(--choco);
}
.btn-buy-package {
  background: var(--cream);
  border-color: rgba(255,159,104,.35);
}
.price-packages-table tr.pkg-starter-row {
  background: rgba(255, 159, 104, 0.12);
}
.price-packages-table tr.pkg-starter-row td:first-child {
  font-weight: 800;
  white-space: normal;
  line-height: 1.35;
}
.pkg-starter-badge {
  display: inline-block;
  margin: 4px 0 0;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  background: var(--accent);
  color: #fff;
}
.btn-buy-package.is-starter {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
}
.btn-buy-package.is-starter:hover {
  background: var(--accent-dark);
}

/* История генераций / пополнений */
.res-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.res-link:hover { text-decoration: underline; }
.res-link:disabled { opacity: .55; cursor: wait; }
.res-multi { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; width: 100%; max-width: 100%; vertical-align: top; }
.res-multi > .res-link,
.res-multi > .res-chip,
.res-multi > .res-muted {
  flex: 0 0 auto;
}
.res-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}
.res-actions > .hist-del-link,
.res-actions > .hist-fav-link {
  flex: 0 0 auto;
}
.hist-cell-result .res-multi {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.res-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent-dark);
  transition: background .15s ease, border-color .15s ease;
  background: #fff;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.res-chip:hover { border-color: var(--accent); background: rgba(255, 159, 104, .12); }
.res-muted { color: var(--muted); }
.res-multi .res-thumbs {
  margin-bottom: 0;
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}
.res-thumbs { display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: 6px; }
.res-thumb {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
  line-height: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.res-thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  display: block;
}
.res-thumb:hover { border-color: var(--accent); }
.res-thumb.is-loading {
  opacity: .55;
  pointer-events: none;
}

.hist-table { width: 100%; table-layout: auto; }
.hist-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.hist-panel-head h2 { margin: 0; }
.hist-clear-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.hist-del-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(200, 80, 80, .35);
  border-radius: 999px;
  background: #fff;
  color: #b3341a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}
.hist-del-link:hover:not(:disabled) {
  border-color: #d66;
  color: #922;
  background: #fff5f5;
}
.hist-del-link:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.hist-fav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(255, 180, 60, .45);
  border-radius: 999px;
  background: #fff;
  color: #9a6200;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  white-space: nowrap;
}
.hist-fav-glyph {
  font-size: 13px;
  line-height: 1;
}
.hist-fav-text--short {
  display: none;
}
.hist-mode-short {
  display: none;
}
.hist-fav-link:hover:not(:disabled) {
  border-color: #e6a020;
  color: #7a4d00;
  background: #fff9ef;
}
.hist-fav-link.is-fav {
  border-color: rgba(255, 180, 60, .7);
  background: #fff4dc;
  color: #7a4d00;
}
.hist-fav-link:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.hist-cell-result { min-width: 0; }
.hist-date-short { display: none; }
.hist-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hist-pill--done,
.hist-pill--succeeded { background: #e3f6e8; color: #1f7a45; }
.hist-pill--pending,
.hist-pill--queued { background: #fff4e0; color: #9a6200; }
.hist-pill--failed { background: #ffe7e0; color: #b3341a; }
.hist-pill--refunded { background: #eee; color: #555; }
.hist-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--choco);
  white-space: nowrap;
}
.hist-tag--free {
  background: rgba(120, 160, 255, .1);
  border-color: rgba(120, 160, 255, .25);
}
.hist-tag--paid {
  background: rgba(255, 159, 104, .12);
  border-color: rgba(255, 159, 104, .35);
}
.hist-amount { font-weight: 800; color: var(--choco); }
.hist-coins { font-weight: 800; color: var(--choco); }

.hist-more-wrap { margin-top: 14px; text-align: center; }
.hist-more-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.hist-more-btn {
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-weight: 800;
  color: var(--choco);
  cursor: pointer;
}
.hist-more-btn:hover { border-color: var(--accent); background: rgba(255, 159, 104, .08); }

.hist-confirm {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(58, 36, 24, .45);
}
.hist-confirm[hidden] {
  display: none !important;
}
body.hist-confirm-open {
  overflow: hidden;
}
.hist-confirm__card {
  width: 100%;
  max-width: 360px;
  padding: 20px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(58, 36, 24, .28);
}
.hist-confirm__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--choco);
}
.hist-confirm__text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.hist-confirm__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.hist-confirm-cancel {
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--choco);
}
.hist-confirm-ok {
  min-height: 44px;
  border: 1px solid rgba(200, 80, 80, .45);
  background: #fff5f5;
  color: #b3341a;
  font-weight: 800;
}
.hist-confirm-ok:hover {
  border-color: #d66;
  background: #ffecec;
}

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
table.tbl th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.tbl-wrap { overflow-x: auto; }

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}
.btn-sm:hover { background: var(--cream); }

.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.settings-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }

.billing-hint {
  flex: 1 1 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--choco);
}
.billing-hint.is-paid {
  border-color: rgba(255,159,104,.45);
  background: rgba(255,248,240,.95);
}
.billing-hint.is-free {
  border-color: rgba(120,160,255,.25);
  background: rgba(248,250,255,.95);
}
.billing-hint.is-blocked {
  border-color: rgba(214,69,69,.3);
  background: rgba(255,245,245,.9);
  color: #a33;
}
.billing-hint.is-link {
  padding: 0;
  border-color: rgba(255,159,104,.45);
  background: rgba(255,248,240,.95);
  color: var(--choco);
  transition: border-color .15s ease, background .15s ease;
}
.billing-hint.is-blocked.is-link {
  border-color: rgba(255,159,104,.45);
  background: rgba(255,248,240,.95);
  color: var(--choco);
}
.billing-hint.is-link:hover {
  border-color: var(--accent);
  background: rgba(255,159,104,.14);
}
.billing-hint-link {
  display: block;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  line-height: inherit;
  border-radius: inherit;
}
.billing-hint-link::after {
  content: ' →';
  font-weight: 800;
  color: var(--accent-dark);
}

.mode-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.mode-btn {
  flex: 1 1 200px;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: .2s;
}
.mode-btn.active { border-color: var(--accent); background: #fff7f1; }
.mode-btn strong { display: block; font-size: 15px; }
.mode-btn small { color: var(--muted); }
.mode-btn:disabled { opacity: .5; cursor: not-allowed; }

.tag { font-size: 12px; font-weight: 900; padding: 3px 9px; border-radius: 999px; }
.tag.green { background: #e3f6e8; color: #1f7a45; }
.tag.red { background: #ffe7e0; color: #b3341a; }
.tag.gray { background: #eee; color: #555; }

@media (max-width: 640px) {
  .auth-wrap {
    width: min(calc(100% - 20px), 1180px);
    margin: 16px auto 36px;
  }
  .panel {
    padding: 16px;
    margin-bottom: 14px;
  }
  .panel h2 {
    font-size: 17px;
    margin-bottom: 10px;
  }
  #tariff-stat-grid.stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
  }
  #tariff-stat-grid .stat-box {
    padding: 11px 12px;
    min-width: 0;
  }
  #tariff-stat-grid .stat-box .num {
    font-size: 20px;
  }
  #tariff-stat-grid .stat-box .lbl {
    font-size: 11px;
    line-height: 1.25;
  }
  #tariff-stat-grid .stat-box-free {
    padding: 10px 12px 9px;
  }
  #tariff-stat-grid .stat-box-free .num {
    font-size: 22px;
  }
  #tariff-stat-grid .stat-box-free .lbl {
    font-size: 12px;
  }
  .stat-box-free-wm,
  .stat-box-free-note {
    font-size: 10px;
  }
  a.tariff-ceny-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
  }
  .tariff-ceny-banner__arrow {
    align-self: flex-end;
    font-size: 20px;
  }
  .panel .row-inline {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 12px !important;
  }
  .panel .row-inline .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .tbl-wrap:has(.hist-table) {
    overflow-x: visible;
  }
  .hist-date-short { display: inline; }
  .hist-date-full { display: none; }
  .hist-more-wrap { padding: 0 2px; }
  .hist-more-btn { display: block; width: 100%; }

  .hist-table {
    border: 0;
  }
  .hist-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0  0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .hist-table tbody {
    display: block;
  }
  .hist-table tr.hist-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
  }
  .hist-table tr.hist-empty {
    display: block;
    border: 1px dashed var(--line);
    border-radius: 16px;
    padding: 18px 14px;
    margin-bottom: 0;
    background: rgba(255, 255, 255, .6);
    text-align: center;
  }
  .hist-table tr.hist-empty td {
    display: block;
    padding: 0;
    border: 0;
    color: var(--muted);
    text-align: center;
  }
  .hist-table td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .hist-table td::before {
    display: none !important;
    content: none !important;
  }

  /* Генерации: одна строка мета + блок результата */
  .hist-table--gens tr.hist-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-rows: auto auto;
    gap: 6px 8px;
    align-items: center;
  }
  .hist-table--gens tr.hist-row td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    font-weight: 700;
    font-size: 11px;
    color: var(--choco);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .hist-table--gens tr.hist-row td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
  }
  .hist-table--gens tr.hist-row td:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }
  .hist-table--gens tr.hist-row td:nth-child(2) {
    grid-column: 4;
    grid-row: 1;
    min-width: 0;
  }
  .hist-table--gens tr.hist-row td:nth-child(5) {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid var(--line);
    min-width: 0;
    overflow: visible;
  }
  .hist-table--gens tr.hist-row .hist-pill {
    font-size: 10px;
    padding: 2px 7px;
  }
  .hist-table--gens tr.hist-row .hist-tag {
    font-size: 10px;
    padding: 2px 7px;
  }
  .hist-mode-full {
    display: none;
  }
  .hist-mode-short {
    display: inline;
  }

  /* Генерации: превью+действия */
  .hist-cell-result::before {
    display: none !important;
  }
  .hist-cell-result .res-multi {
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    gap: 10px;
  }
  .hist-cell-result .res-thumbs {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .hist-cell-result .res-thumbs::-webkit-scrollbar {
    display: none;
  }
  .hist-cell-result .res-thumb img {
    width: 52px;
    height: 52px;
  }
  .hist-cell-result .res-actions {
    margin-left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .hist-cell-result .res-actions:has(:only-child) {
    grid-template-columns: 1fr;
  }
  .hist-cell-result .hist-fav-link,
  .hist-cell-result .hist-del-link {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }
  .hist-fav-text--full {
    display: none;
  }
  .hist-fav-text--short {
    display: inline;
  }
  .hist-del-link {
    min-height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }
  .hist-fav-link {
    min-height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }
  .hist-panel-head {
    align-items: flex-start;
    gap: 10px;
  }
  .hist-clear-btn {
    width: 100%;
    max-width: 100%;
    text-align: center;
  }
  .hist-cell-result .res-link {
    display: inline-flex;
    align-items: center;
    width: auto;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid rgba(255, 159, 104, .35);
    border-radius: 999px;
    background: rgba(255, 248, 240, .95);
    text-decoration: none;
  }
  .hist-cell-result .res-link:hover {
    background: rgba(255, 159, 104, .15);
    text-decoration: none;
  }
  .hist-cell-result .res-chip {
    min-height: 44px;
    min-width: 44px;
    font-size: 14px;
  }

  /* Пополнения: дата+статус → сумма+коины → способ */
  .hist-table--pays tr.hist-row td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    font-weight: 800;
    font-size: 13px;
    color: var(--choco);
  }
  .hist-table--pays tr.hist-row td:nth-child(5) {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }
  .hist-table--pays tr.hist-row td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
  }
  .hist-table--pays tr.hist-row td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: center;
  }
  .hist-table--pays tr.hist-row td:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 3;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
  }
  .hist-table--pays tr.hist-row td:nth-child(4)::before {
    display: inline !important;
    content: 'Способ · ';
    font-weight: 700;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
  }
}
