:root {
  --bg: #0c0d10;
  --bg-2: #15171c;
  --panel: #12141a;
  --panel-2: #1c1f27;
  --panel-3: #0a0b0e;
  --ink: #eef1f6;
  --muted: #9aa3b2;
  --line: rgba(238, 241, 246, 0.12);
  --acid: #ffc14a;
  --acid-ink: #1a1404;
  --danger: #ff6b7a;
  --ok: #5dffc0;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 74, 0.38) rgba(238, 241, 246, 0.06);
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: rgba(238, 241, 246, 0.05);
  border-radius: 99px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ffc14a 0%, #e09a20 100%);
  border-radius: 99px;
  border: 2px solid var(--panel);
}
*::-webkit-scrollbar-thumb:hover { background: var(--acid); }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
*::-webkit-scrollbar-corner { background: transparent; }

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 10% -10%, #5a4308 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: Manrope, sans-serif;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1 {
  margin: 0.15rem 0 0;
  font-family: Unbounded, sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0;
  color: var(--acid);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-mark {
  text-transform: none;
  letter-spacing: 0.08em;
}

.brand-title {
  margin: 0.12rem 0 0;
  width: 108px;
  height: 54px;
  position: relative;
  overflow: hidden;
  mix-blend-mode: lighten;
}

.brand-title img {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 208px;
  height: auto;
  transform: translate(-50%, -50%);
}

.lede, .hint, .empty, .error, .banner {
  color: var(--muted);
  line-height: 1.5;
}

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.gate-card, .progress-card, .toolbar, .table-wrap, .top {
  background: color-mix(in srgb, var(--bg-2) 88%, black);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.gate-card {
  width: min(520px, 100%);
  margin: 0;
  padding: 2rem;
  border-radius: 28px;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.gate-card .lede {
  margin: 0;
}

.gate-card .field {
  margin: 0;
}

.gate-card .check {
  margin: 0.15rem 0 0.1rem;
}

.gate-card .btn {
  justify-self: start;
  margin-top: 0.15rem;
}

.field, .search, .toolbar label {
  display: grid;
  gap: 0.4rem;
}

.field span, .search span, label span {
  font-size: 0.78rem;
  color: var(--muted);
}

input, select, button {
  font: inherit;
}

input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-3);
  color: var(--ink);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
}

input:focus, select:focus {
  outline: 2px solid var(--acid);
  outline-offset: 1px;
}

input[type="number"],
input[inputmode="decimal"],
.price-input {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0.9rem 0 1.1rem;
  color: var(--muted);
}

.check input { width: auto; }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  cursor: pointer;
  font-weight: 700;
}

.btn.primary {
  background: var(--acid);
  color: var(--acid-ink);
}

.btn.publish {
  background: #3dce73;
  color: #062414;
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.compact {
  padding: 0.42rem 0.9rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.error { color: var(--danger); }
.hint { font-size: 0.82rem; }

#app {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.5rem auto 4rem;
  display: grid;
  gap: 1rem;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: 1.3rem 1.4rem;
  border-radius: 24px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-actions {
  flex-shrink: 0;
}

.btn.icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr 0.7fr auto;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 20px;
  align-items: end;
}

.toolbar-end {
  display: flex;
  gap: 0.8rem;
  align-items: end;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: grid;
  gap: 0.4rem;
  justify-items: stretch;
}


.stats {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  color: var(--muted);
}

.stats strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.6rem;
  color: var(--ink);
}

.table-wrap {
  border-radius: 24px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}


.nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.nav [aria-current] { border-color: var(--acid); color: var(--acid); }
a { color: var(--acid); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.panel, .stack { display: grid; gap: 1rem; min-width: 0; }
.form-body { padding: 1.1rem; }
.form-body summary { cursor: pointer; }
.form-body > .stack { margin-top: 1rem; }
h2 { margin: 0; font-size: 1.06rem; }
#notice, #login-status, #lot-status { margin: 0; }
#notice { padding: 0.4rem 0.6rem; }
.demo-banner { margin: 0; padding: 0.7rem 1rem; border: 1px solid var(--line); border-radius: 14px; }
.toolbar { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.toolbar > .btn { justify-self: end; }
td small { display: block; color: var(--muted); margin-top: 0.25rem; }
td .actions { display: flex; gap: 0.4rem; }
td input[type=checkbox] { width: auto; }
table tbody tr:last-child td { border-bottom: 0; }
.mono { white-space: nowrap; font-family: "IBM Plex Mono", monospace; }
.self-start { justify-self: start; }
textarea { width: 100%; color: var(--ink); background: var(--panel-3); border-radius: 14px; border: 1px solid var(--line); padding: .7rem .85rem; font: inherit; resize: vertical; }
textarea:focus,
textarea:focus-visible {
  outline: none;
  border-color: var(--acid);
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; }
dialog { background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); border-radius: 24px; padding: 1.3rem; width: min(680px, calc(100% - 1rem)); max-height: 90dvh; }
dialog::backdrop { background: rgba(10, 7, 5, 0.85); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
@media (max-width: 700px) {
  .top { align-items: start; flex-direction: column; }
  .top-actions { flex-wrap: wrap; }
  th, td { padding: .65rem; }
}

.menu { position: relative; }
.menu-items { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 5; min-width: 10rem; padding: .3rem; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); box-shadow: var(--shadow); }
.menu-items button { display: block; width: 100%; border: 0; background: transparent; padding: .65rem .8rem; color: var(--ink); text-align: left; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.menu-items button:hover, .menu-items button:focus-visible { background: var(--panel-2); }
.menu-items [aria-current] { color: var(--acid); }
/* Game sheet uses the original Plati header, sidebar and parameters layout. */
#card-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(1240px, calc(100% - 2.4rem));
  height: min(88dvh, 900px);
  max-height: none;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#card-dialog[open] { display: flex; flex-direction: column; }
#card-dialog::backdrop { background: rgba(6, 5, 3, 0.72); }
.sheet-head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.sheet-head > div:first-child { min-width: 0; flex: 1; }
.sheet-head h2 { margin: .15rem 0 0; font-size: 1.5rem; overflow-wrap: anywhere; }
.sheet-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.45rem;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.18rem 0.28rem 0.18rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}
.cat-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 0.35rem 0.05rem;
}
.cat-chip button:hover,
.cat-chip button:focus-visible {
  color: var(--danger);
}
.cat-add-wrap { position: relative; }
.cat-add {
  height: 1.85rem;
  padding: 0 0.7rem;
  font-size: 0.78rem;
}
.cat-add-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  padding: 0.35rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.2rem;
  z-index: 40;
}
.cat-add-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cat-add-menu button:hover,
.cat-add-menu button:focus-visible {
  background: rgba(255, 193, 74, 0.12);
}
.sheet-head-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: flex-end;
  justify-content: flex-end;
}
.sheet-profit-stack { display: flex; flex-direction: column; align-items: stretch; gap: .32rem; }
.sheet-profit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .2rem;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sheet-profit .price-input { width: 88px; padding: .38rem .6rem; }
.add-submit { display: flex; flex-direction: column; gap: .35rem; min-width: 168px; }
.add-submit .btn { width: 100%; }
.sheet-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.sheet-info {
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem 1.1rem;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.sheet-info > * { flex-shrink: 0; }
.sheet-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}
.sheet-cover-img, .cover-lottie { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet-cover-img { object-fit: contain; }
.add-search { position: relative; z-index: 2; margin-top: .45rem; }
.add-dropdown {
  position: absolute;
  inset: calc(100% + 4px) 0 auto;
  z-index: 3;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.add-dropdown button, .add-dropdown p { margin: 0; padding: .7rem .85rem; }
.add-dropdown button {
  display: grid;
  width: 100%;
  gap: .15rem;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.add-dropdown button:last-child { border-bottom: 0; }
.add-dropdown button:hover, .add-dropdown button:focus-visible { background: rgba(255, 193, 74, 0.1); }
.add-regions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .32rem; }
.add-region {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: .28rem .2rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: uppercase;
  cursor: pointer;
}
.add-region[aria-pressed="true"], .sale-toggle[aria-pressed="true"], .add-copy-row [aria-pressed="true"] {
  color: var(--acid-ink);
  background: var(--acid);
  border-color: var(--acid);
}
.add-copy { display: grid; gap: .45rem; }
.add-copy-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .4rem; }
.add-copy-row span, #card-settings { color: var(--muted); font-size: .78rem; }
.card-meta { margin: 0; display: grid; gap: .55rem; }
.card-meta > div { display: grid; gap: .1rem; }
.card-meta dt { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.card-meta dd { margin: 0; }
.card-settings-fields { margin-top: .75rem; }
.sheet-params { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.sheet-params-head {
  flex-shrink: 0;
  padding: 1.2rem 1.3rem .7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}
.sheet-params-head h3, .param-block h4 { margin: 0; }
.sheet-options { flex: 1; min-height: 0; overflow: auto; padding: 0 .7rem 1.6rem 1.3rem; }
#card-dialog .sheet-options { padding-top: 1.1rem; }
.sheet-options .hint { margin-top: 0; }
.param-block h4 { margin-bottom: .45rem; }
.card-version-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .2rem;
}
.card-version-head h4 { margin: 0; }
.card-table-scroll { overflow-x: auto; }
.param-table { width: 100%; min-width: 530px; table-layout: fixed; }
.card-money-col, .card-markup-col { width: 128px; }
.param-table th, .param-table td { padding: .75rem .65rem; }
.param-table th:first-child, .param-table td:first-child { padding-left: 0; }
.param-table th { font-size: .72rem; }
.zakup-head {
  vertical-align: bottom;
}
.zakup-head #card-refresh-zakup {
  display: inline-flex;
  margin: 0 0 .28rem;
  padding: .18rem .55rem;
  font-size: .68rem;
  white-space: nowrap;
}
.zakup-head #card-base-heading { display: block; }
.param-table .price-input { width: 100%; padding: .38rem .55rem; font-family: "IBM Plex Mono", monospace; }
.param-table [data-markup] { font-size: .82rem; }
.card-final-col { width: 168px; }
.card-final { display: flex; flex-direction: column; align-items: stretch; gap: .18rem; }
.final-profit {
  color: var(--ok);
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: right;
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
}
.final-profit.is-down { color: var(--danger); }
#card-base-price .final-profit, #offer-rows .final-profit { display: block; margin-top: .15rem; text-align: left; }
.variant-name { display: flex; align-items: center; gap: .4rem; }
.variant-name input[type="checkbox"] { flex: 0 0 auto; margin-left: 0; }
.variant-name input[type="text"] { min-width: 0; padding: .3rem .28rem; background: transparent; border-color: transparent; }
.variant-name input[type="text"]:hover, .variant-name input[type="text"]:focus { border-color: var(--line); }
.variant-tools { display: flex; flex: 0 0 auto; gap: .3rem; }
.variant-tools .btn { padding: .18rem .55rem; font-size: .72rem; }
.buy-cell { white-space: nowrap; }
.buy-cell-main { display: inline-flex; align-items: center; }
.buy-value { font-family: "IBM Plex Mono", monospace; }
.buy-cell.is-min .buy-value { color: var(--ok); }
.buy-sale-note {
  display: block;
  margin-top: .18rem;
  color: var(--acid);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.15;
}
.sale-switch {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .35rem;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sale-switch input { position: absolute; opacity: 0; pointer-events: none; }
.sale-switch-track {
  position: relative;
  width: 1.72rem;
  height: .96rem;
  flex-shrink: 0;
  border-radius: 99px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.sale-switch-track::after {
  content: "";
  position: absolute;
  top: .13rem;
  left: .13rem;
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: #cfcfcf;
}
.sale-switch input:checked + .sale-switch-track { background: var(--acid); }
.sale-switch input:checked + .sale-switch-track::after { transform: translateX(.74rem); background: var(--bg); }
.sale-switch:has(input:checked) { color: var(--acid); }
.variant-tools .variant-remove { opacity: 0; }
.param-table tr:hover .variant-remove, .param-table tr:focus-within .variant-remove { opacity: 1; }
@media (hover: none) { .variant-tools .variant-remove { opacity: 1; } }
.variant-link { margin-left: 1.3rem; font-size: .78rem; }
.card-field-overrides { gap: .4rem; margin-top: .4rem; }
.card-field-overrides .check { margin: 0 0 .5rem; font-size: .78rem; }
.p2p3-add { margin: .75rem .4rem 0 0; padding: .55rem .8rem; color: var(--ink); background: transparent; border: 1px dashed var(--line); border-radius: 10px; font-weight: 700; cursor: pointer; }
#card-dialog .p2p3-add {
  flex-shrink: 0;
  align-self: start;
  margin: 0 1.3rem 1.1rem;
}
.p2p3-add:hover { border-color: var(--acid); color: var(--acid); }
#card-status { margin: 0; }
#card-dialog summary { cursor: pointer; }
.card-copy-editor {
  position: absolute;
  right: 1rem;
  top: 7rem;
  bottom: 1rem;
  width: min(380px, calc(100% - 2rem));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 4;
}
.card-copy-editor .sheet-head { padding: .7rem; align-items: center; }
.card-copy-editor h3 { margin: 0; font-size: .92rem; }
.card-copy-editor .template-tabs { padding: .45rem .7rem 0; }
.card-copy-editor textarea { flex: 1; min-height: 0; border: 0; border-radius: 0; resize: none; }
.lot-copy-editor {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  z-index: 6;
}
.lot-copy-editor .sheet-head { padding: .85rem 1.2rem; }
.lot-copy-editor h3 { margin: .15rem 0 0; font-size: 1.15rem; }
.lot-copy-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lot-copy-fields {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto minmax(10rem, 1fr) auto;
  align-content: stretch;
  gap: .75rem 1rem;
  padding: 1rem 1.2rem;
}
.lot-copy-fields .field:nth-child(n+3) { grid-column: 1 / -1; }
@media (min-width: 860px) {
  .lot-copy-fields .field:nth-child(n+3) { grid-column: auto; }
  .lot-copy-fields .field:nth-child(3),
  .lot-copy-fields .field:nth-child(5) { grid-column: 1; }
  .lot-copy-fields .field:nth-child(4),
  .lot-copy-fields .field:nth-child(6) { grid-column: 2; }
  .lot-copy-fields .field:nth-child(3),
  .lot-copy-fields .field:nth-child(4) {
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }
  .lot-copy-form textarea[name^="description"] {
    min-height: 0;
    height: 100%;
    resize: none;
  }
}
.lot-copy-form textarea { min-height: 4.5rem; resize: vertical; }
.lot-copy-form textarea[name^="description"] { min-height: 10rem; }
.lot-copy-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  padding: .85rem 1.2rem 1.1rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.lot-copy-open {
  border: 0;
  padding: 0;
  background: none;
  color: var(--acid);
  font: inherit;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  border-radius: 0;
  text-decoration: none;
}
.lot-copy-open:hover { text-decoration: underline; }
.lot-copy-open:focus,
.lot-copy-open:focus-visible { outline: none; }
.variant-name .lot-copy-label {
  min-width: 0;
  flex: 1;
  padding: .3rem .28rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  border-radius: 0;
}
.variant-name .lot-copy-label:hover,
.variant-name .lot-copy-label:focus,
.variant-name .lot-copy-label:focus-visible {
  color: var(--acid);
  outline: none;
  box-shadow: none;
}
.card-name { display: grid; gap: .2rem; }
.card-name > button { justify-self: start; border: 0; padding: 0; color: var(--acid); background: none; text-align: left; cursor: pointer; font-weight: 700; }
#card-dialog.is-live #card-search,
#card-dialog.is-live #card-regions,
#card-dialog.is-live #card-publish,
#card-dialog.is-live #card-save,
#card-dialog.is-live .add-submit,
#card-dialog.is-live #card-settings,
#card-dialog.is-live #card-copy,
#card-dialog.is-live #card-copy-editor { display: none; }
#card-save-live { align-self: start; margin-top: auto; }
.variant-drop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--danger);
  background: transparent;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  opacity: .28;
  cursor: pointer;
}
.variant-drop:hover,
.variant-drop:focus-visible { opacity: 1; }
.param-table tr.is-drop { opacity: .55; }
.param-table tr.is-drop .variant-drop { opacity: 1; }
.hide-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: .1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: .45;
}
.hide-flag:hover:not(:disabled) {
  opacity: 1;
  color: var(--ink);
}
.hide-flag.is-hidden {
  opacity: 1;
  color: var(--muted);
}
.param-table tr.is-variant-hidden .lot-copy-label {
  color: var(--muted);
  text-decoration: line-through;
}
.sheet-id-row { display: flex; flex-wrap: wrap; gap: .35rem .7rem; align-items: center; }
.product { display: grid; grid-template-columns: 42px 1fr; gap: .8rem; align-items: center; }
.product .cover { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.product-title { border: 0; padding: 0; color: var(--acid); background: none; text-align: left; cursor: pointer; font-weight: 700; }
.product .meta { display: block; color: var(--muted); font-size: .78rem; font-family: "IBM Plex Mono", monospace; }
.product-sales {
  display: block;
  margin-top: .12rem;
  color: var(--muted);
  font-size: .78rem;
  font-family: "IBM Plex Mono", monospace;
}
.product-sales-plus { margin-left: .18em; }
.product-sales .is-today { color: var(--acid); }
.row-main { cursor: pointer; }
.row-main:hover { background: rgba(255, 193, 74, .04); }
.status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: .2rem .55rem;
  font-size: .75rem;
  font-weight: 600;
  background: rgba(238, 241, 246, .08);
}
.status.active { color: var(--ok); }
.status.paused, .status.draft { color: #ffd27a; }
button.status-btn {
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
}
button.status-btn:hover,
button.status-btn:focus-visible {
  background: rgba(255, 210, 122, 0.18);
}
button.status-btn.status.active:hover,
button.status-btn.status.active:focus-visible {
  background: rgba(125, 255, 179, 0.16);
}
.draft-status {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem 0.7rem;
  width: 100%;
}
.sale-when {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.08rem;
  text-align: right;
}
.draft-when {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}
.sale-switch-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.04rem;
  margin: 0 0 0.06rem;
  max-width: 100%;
}
.sale-switch-wrap .sale-switch { margin: 0; }
.sale-switch-wrap .draft-when {
  cursor: default;
  font-size: 0.68rem;
  line-height: 1.15;
}
.sale-switch-wrap .sale-when {
  align-items: flex-start;
  text-align: left;
  max-width: 100%;
  gap: 0;
}
.draft-menu {
  position: fixed;
  min-width: 220px;
  padding: 0.35rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.2rem;
  z-index: 80;
}
.draft-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 12px;
  padding: 0.72rem 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.draft-menu button:hover,
.draft-menu button:focus-visible {
  background: rgba(255, 193, 74, 0.12);
}
.confirm {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 90;
  padding: 1.2rem;
}
.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 7, 5, .78);
}
.confirm-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 1.35rem 1.4rem 1.2rem;
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.confirm-card h3 { margin: 0 0 .35rem; }
.update-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.35rem;
}
.update-form .confirm-actions { margin-top: 0.2rem; }
#update-error { margin: 0; }
.slot-confirm {
  position: absolute;
  z-index: 8;
}
.slot-card {
  width: min(460px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
}
.slot-fields { margin: .85rem 0 1rem; gap: .7rem; }
.slot-fields .field span { color: var(--muted); }
.slot-title-sample {
  margin: 0 0 .65rem;
  font-size: .82rem;
  line-height: 1.35;
  word-break: break-word;
}
.slot-title-previews .is-over { color: #ff7a7a; }
.schedule-card {
  width: min(560px, 100%);
  max-height: min(92vh, 760px);
  overflow: auto;
}
.schedule-pick {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  margin-top: .85rem;
}
.schedule-cal-wrap { min-width: 0; }
.schedule-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .55rem;
}
.schedule-cal-head p {
  margin: 0;
  font-weight: 700;
  text-transform: capitalize;
}
.schedule-cal-head button {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}
.schedule-cal-head button:hover:not(:disabled) {
  border-color: var(--acid);
  color: var(--acid);
}
.schedule-cal-head button:disabled {
  opacity: .35;
  cursor: default;
}
.schedule-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .2rem;
}
.schedule-cal span,
.schedule-cal button {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: .82rem;
}
.schedule-cal span {
  color: var(--muted);
  font-weight: 600;
  font-size: .68rem;
}
.schedule-cal button {
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.schedule-cal button:hover:not(:disabled) {
  background: rgba(255, 193, 74, .12);
}
.schedule-cal button.is-today {
  box-shadow: inset 0 0 0 1px var(--line);
}
.schedule-cal button.is-on {
  background: var(--acid);
  color: var(--acid-ink);
  font-weight: 700;
}
.schedule-cal button:disabled {
  color: var(--muted);
  opacity: .35;
  cursor: default;
}
.schedule-clock {
  width: 9.2rem;
  padding: .85rem .7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-2);
  text-align: center;
}
.schedule-clock-title {
  margin: 0 0 .7rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
}
.schedule-clock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .2rem;
}
.schedule-colon {
  font-size: 1.6rem;
  font-weight: 700;
  padding-bottom: .15rem;
}
.schedule-spin {
  display: grid;
  justify-items: center;
  gap: .15rem;
}
.schedule-spin input {
  width: 2.4ch;
  min-width: 2.4ch;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
}
.schedule-spin input:focus {
  color: var(--acid);
  box-shadow: inset 0 -2px 0 var(--acid);
}
.schedule-spin button {
  width: 2.2rem;
  height: 1.5rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.schedule-spin button:hover { color: var(--acid); }
.schedule-summary {
  margin: .95rem 0 0;
  font-weight: 700;
}
@media (max-width: 640px) {
  .schedule-pick { grid-template-columns: 1fr; }
  .schedule-clock { width: 100%; }
  .schedule-clock-row { gap: 1rem; }
}
td.price {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  white-space: nowrap;
}
th.profit-col {
  min-width: 8.4rem;
  max-width: 10.5rem;
  white-space: normal;
  line-height: 1.25;
}
td.profit {
  white-space: nowrap;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
}
.profit-chart-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: default;
  white-space: nowrap;
}
.profit-chart-btn.is-neg { color: var(--danger); }
.visually-hidden:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 900px) {
  #card-dialog { width: calc(100% - 1rem); height: 94dvh; }
  .sheet-head { flex-wrap: wrap; padding: .8rem; }
  .sheet-head-actions { flex-shrink: 1; justify-content: flex-start; }
  .sheet-body { grid-template-columns: 1fr; overflow-y: auto; }
  .sheet-info { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .sheet-cover { width: min(100%, 14rem); }
  .sheet-params { min-height: auto; }
  .sheet-options { overflow-y: visible; }
}

/* Controls and layout shared with the Plati windows. */
.sale-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.38rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sale-switch input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.sale-switch-track {
  position: relative;
  width: 1.72rem;
  height: 0.96rem;
  flex-shrink: 0;
  border-radius: 99px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.sale-switch-track::after {
  content: "";
  position: absolute;
  top: 0.13rem;
  left: 0.13rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: #cfcfcf;
  transition: transform 0.16s ease, background 0.16s ease;
}

.sale-switch input:checked + .sale-switch-track {
  background: var(--acid);
}

.sale-switch input:checked + .sale-switch-track::after {
  transform: translateX(0.74rem);
  background: var(--bg);
}

.sale-switch:has(input:checked) {
  color: var(--acid);
}

.sheet-info .rates-refresh {
  width: 100%;
}

.sheet-info .rates-crm-switch {
  margin: 0.75rem 0 0;
  white-space: normal;
}

.sheet-info .rates-save {
  width: 100%;
  margin-top: 0.45rem;
}

.rates-edit {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rates-edit:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
}

.rates-add {
  margin-top: 0.4rem;
}

.rates-row-act {
  width: 2rem;
  text-align: right;
}

.sheet-info .rates-refresh-log {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.sheet-info .rates-refresh-log dd.ok {
  color: var(--ok);
}

.sheet-info .rates-refresh-log dd.fail {
  color: var(--danger);
}


.api-key-list {
  display: grid;
  gap: 0.75rem;
}

.api-key-card {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.65rem;
}

.api-key-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.api-key-head {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.api-key-head label {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.api-key-head input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: var(--acid);
}


.api-key-add {
  display: grid;
  gap: 0.75rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line);
}

.api-key-add h3 {
  margin: 0;
  font-size: 0.95rem;
}

.api-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}


.templates-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.templates-head-actions .hint {
  margin: 0;
}

.templates-body.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.3rem 1.2rem;
  overflow: hidden;
}

.templates-editor {
  flex: 1;
  min-height: 180px;
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0.9rem 1rem;
}

.templates-editor:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--acid) 55%, var(--line));
}


.zakup-db-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.zakup-db-side {
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.05rem 1.15rem;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.75rem;
}

.zakup-db-days {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 0.28rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 74, 0.38) rgba(238, 241, 246, 0.06);
}

.zakup-db-main {
  min-height: 0;
  overflow: auto;
  padding: 0.85rem 1.15rem 1.1rem;
  display: grid;
  align-content: start;
  gap: 0.7rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 74, 0.38) rgba(238, 241, 246, 0.06);
}

.zakup-db-games {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.zakup-db-game {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem 0.95rem 0.7rem;
  background: var(--bg-2);
}

.zakup-db-game.is-error,
.zakup-db-game.is-jump {
  border-color: #c45c5c;
}

.zakup-db-error {
  color: #f0a0a0;
  font-weight: 600;
}

.zakup-db-hidden {
  color: var(--muted);
}

.zakup-db-jump {
  color: #f0a0a0;
  font-weight: 600;
}

td .zakup-db-jump {
  display: block;
}

.zakup-db-game header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.zakup-db-game header b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zakup-db-game header span {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.zakup-db-meta {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.zakup-db-sale-end {
  color: #e7c56a;
  font-weight: 600;
}

.zakup-db-game .param-table col,
.zakup-db-game .param-table {
  table-layout: auto;
}

.zakup-db-game .param-table th.num,
.zakup-db-game .param-table td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.zakup-db-rub {
  display: block;
}

.zakup-db-local {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.zakup-db-days .stats-product {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.62rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.zakup-db-days .stats-product:hover,
.zakup-db-days .stats-product.is-active {
  background: var(--panel-2);
  border-color: var(--line);
}

.zakup-db-days .stats-product.is-active {
  border-color: var(--acid);
}

.zakup-db-days .stats-product b {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zakup-db-days .stats-product span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 900px) {
  .zakup-db-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .zakup-db-side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 220px;
  }
}


.stats-head-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  flex-shrink: 0;
}

.stats-range {
  position: relative;
}

.stats-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.48rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.stats-range-btn:hover,
.stats-range.is-open .stats-range-btn {
  border-color: var(--acid);
}

.stats-range-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(560px, calc(100vw - 3rem));
  padding: 0.9rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.stats-range-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.stats-range-presets button {
  margin: 0;
  padding: 0.38rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.stats-range-presets button.is-active {
  background: var(--acid);
  color: var(--acid-ink);
  border-color: var(--acid);
}

.stats-cal-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.stats-cal-nav button {
  width: 32px;
  height: 32px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.stats-cal-nav button:hover {
  background: var(--panel-2);
}

.stats-cal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.stats-cal-month h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 650;
}

.stats-cal-week,
.stats-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

.stats-cal-week span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0 0.45rem;
}

.stats-cal-day {
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.stats-cal-day.is-in {
  background: rgba(255, 193, 74, 0.12);
  border-radius: 0;
}

.stats-cal-day.is-in-start {
  border-radius: 50% 0 0 50%;
}

.stats-cal-day.is-in-end {
  border-radius: 0 50% 50% 0;
}

.stats-cal-day.is-pick {
  background: transparent;
  border-color: var(--ink);
  border-radius: 50%;
  font-weight: 700;
}

.stats-cal-day.is-today {
  color: var(--acid);
}

.stats-cal-day.is-future,
.stats-cal-day:disabled {
  opacity: 0.28;
  pointer-events: none;
}

.stats-cal-day.is-empty {
  pointer-events: none;
}

.stats-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.stats-side {
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.05rem 1.15rem;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.75rem;
}

.stats-products {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 0.28rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 74, 0.38) rgba(244, 239, 228, 0.06);
}

.stats-product {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.62rem 0.75rem;
  font: inherit;
  cursor: pointer;
}

.stats-product:hover,
.stats-product.is-active {
  background: var(--panel-2);
  border-color: var(--line);
}

.stats-product.is-active {
  border-color: var(--acid);
}

.stats-product b {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-product span {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.stats-main {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.7rem 1.15rem 0.85rem;
  display: grid;
  align-content: start;
  gap: 0.55rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 193, 74, 0.38) rgba(244, 239, 228, 0.06);
}


.stats-bars {
  position: relative;
  padding: 0.48rem 0.8rem 0.38rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
  overflow: visible;
}

.stats-bars-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.12rem;
}


dialog.sheet-card {
  --accent: var(--acid);
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(1240px, calc(100% - 2.4rem));
  height: min(88dvh, 900px);
  max-height: none;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}
dialog.sheet-card[open] { display: flex; flex-direction: column; }
dialog.sheet-card::backdrop { background: rgba(6, 5, 3, .72); }
body.sheet-open { overflow: hidden; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.2rem;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 3, 0.72);
}
.stats-sheet .sheet-stage {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.9rem;
  width: min(1620px, 100%);
  max-width: min(1620px, 100%);
  height: min(94vh, 980px);
}
.stats-sheet .stats-card {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  flex: 1 1 auto;
}
.stats-sheet.is-compare {
  justify-content: flex-start;
}
.stats-sheet.is-compare .sheet-stage {
  width: min(2000px, 100%);
  max-width: min(2000px, 100%);
  justify-content: flex-start;
}
.stats-sheet.is-compare .stats-card {
  width: min(1080px, calc(100% - 440px));
  flex: 1 1 auto;
}
.stats-sheet.is-compare .rival-panel {
  display: flex;
  width: min(420px, 100%);
}
#templates-dialog { width: min(920px, calc(100% - 2.4rem)); }
#shorts-dialog { width: min(720px, calc(100% - 2.4rem)); }
#shorts-dialog .param-table { min-width: 0; }
.shorts-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.templates-body .hint { margin: 0; }
.template-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.template-tabs .add-region { padding: .35rem .7rem; font-size: .72rem; }
.keys-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 1.1rem; padding: 1.1rem 1.3rem 1.4rem; }
.keys-body > .hint, .api-key-add .hint { margin: 0; }
.api-key-add { max-width: 36rem; }
.api-key-card .hint { margin: 0; }
.confirm-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.crm-key-card { width: min(460px, calc(100% - 1rem)); }
.rates-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.rates-head .hint { margin: 0; }
.rates-block + .rates-block { margin-top: 1.15rem; }
.rates-block .param-table { min-width: 0; }
.rates-block td, .rates-block th.num { font-variant-numeric: tabular-nums; }
.rates-block .rates-edit { padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; text-align: left; }
.rates-block .rates-row-act { width: 4.5rem; }
.rates-block h4 { margin-top: 0; }
.stats-main > .hint { margin: .15rem 0; }
#stats-orders.rival-panel {
  display: none;
  width: min(420px, 100%);
  flex-shrink: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.rival-head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: flex-start;
  padding: 1.1rem 1.15rem .85rem;
  border-bottom: 1px solid var(--line);
}
.rival-head h3 { margin: 0; font-size: 1rem; }
.rival-ours { margin: 0; color: var(--acid); font-weight: 700; font-size: .82rem; white-space: nowrap; }
.rival-list { flex: 1; min-height: 0; overflow: auto; padding: .4rem .5rem .7rem; }
.rival-empty { padding: 1rem .8rem; color: var(--muted); }
.stats-orders-head-right { display: grid; justify-items: end; gap: .45rem; }
.stats-orders-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.stats-orders-sum {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: .12rem .9rem;
  flex-shrink: 0;
  margin: 0 .65rem;
  padding: .55rem 0 .65rem;
  border-bottom: 1px solid var(--line);
  font-size: .75rem;
}
.stats-orders-sum[hidden] { display: none; }
.stats-orders-sum span { color: var(--muted); }
.stats-orders-sum b { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats-orders-sum .is-plus, .stats-order-calc .is-plus { color: #8dff8a; }
.stats-orders-sum .is-minus, .stats-order-calc .is-minus { color: #ff8a8a; }
.stats-order { padding: .72rem .65rem; border-bottom: 1px solid var(--line); }
.stats-order-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.stats-order-head-left { display: flex; align-items: baseline; gap: .45rem; min-width: 0; }
.stats-order-id { font-weight: 650; font-size: .82rem; color: inherit; text-decoration: none; }
a.stats-order-id:hover { color: var(--acid); }
.stats-order-time { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.stats-order-title, .stats-order-pos { margin: .18rem 0 0; color: var(--muted); font-size: .72rem; }
.stats-order-calc {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: space-between;
  gap: .12rem .9rem;
  margin-top: .45rem;
  font-size: .75rem;
}
.stats-order-calc span { color: var(--muted); }
.stats-order-calc b { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats-order.is-refund,
.stats-order.is-refund .stats-order-id,
.stats-order.is-refund .stats-order-time,
.stats-order.is-refund .stats-order-title { color: #ff5c5c; }
.stats-order-refund { color: #ff5c5c; font-size: .78rem; font-weight: 650; }
.stats-loading {
  display: none;
  min-height: min(52vh, 420px);
  align-items: center;
  justify-content: center;
}
.stats-main.is-loading { align-content: stretch; }
.stats-main.is-loading .stats-loading { display: flex; }
.stats-main.is-loading .stats-bars,
.stats-main.is-loading #stats-hint { display: none; }
.stats-loading-lottie { width: min(280px, 72%); height: min(280px, 72%); }
.stats-loading-lottie svg { width: 100% !important; height: 100% !important; }
.stats-bars-metric { position: relative; }
.stats-bars-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  padding: .22rem .62rem;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
}
.stats-bars-pill:hover,
.stats-bars-metric.is-open .stats-bars-pill { border-color: var(--acid); }
.stats-bars-pill svg { display: block; opacity: .72; }
.stats-metric-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 12;
  min-width: 210px;
  padding: .35rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: .2rem;
}
.stats-metric-menu[hidden] { display: none; }
.stats-metric-menu button {
  margin: 0;
  padding: .42rem .7rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.stats-metric-menu button:hover { background: var(--panel-2); border-color: var(--line); }
.stats-metric-menu button.is-active { background: var(--acid); border-color: var(--acid); color: var(--acid-ink); }
.stats-bars-total { margin: 0; color: var(--ink); font-family: Unbounded, sans-serif; font-size: 1.12rem; font-weight: 600; letter-spacing: -.03em; white-space: nowrap; }
.stats-bars-plot { position: relative; height: 158px; overflow: visible; }
.stats-bars-plot svg { display: block; width: 100%; height: 100%; }
.stats-bar { fill: var(--acid); }
.stats-bar.is-empty { fill: rgba(255, 193, 74, .22); }
.stats-bar.is-hover, .stats-bar.is-selected { fill: #d9fbff; }
.stats-bar-hit { cursor: pointer; }
.stats-bar-mark { fill: rgba(238, 241, 246, .14); }
.stats-tip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  min-width: 228px;
  padding: .72rem .9rem .78rem;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.stats-tip-date { margin: 0 0 .55rem; color: var(--ink); font-size: .92rem; font-weight: 600; }
.stats-tip-row { display: flex; align-items: center; gap: .45rem; }
.stats-tip-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--acid); }
.stats-tip-dot.is-refund { background: #ff5c5c; }
.stats-tip-name { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.stats-tip-line { flex: 1; min-width: 28px; height: 0; border-bottom: 1px dotted rgba(238, 241, 246, .32); }
.stats-tip-row + .stats-tip-row { margin-top: .4rem; }
.stats-tip-value, .stats-tip-refunds { color: var(--ink); font-size: .86rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats-tip-note { margin: .42rem 0 0; color: var(--muted); font-size: .78rem; }
.stats-columns { display: flex; height: 118px; gap: 3px; padding-top: .55rem; border-bottom: 1px solid var(--line); }
.stats-column { flex: 1; min-width: 6px; display: grid; grid-template-rows: repeat(20, 1fr); align-items: stretch; border: 0; padding: 0; background: none; cursor: pointer; }
.stats-column span { background: var(--acid); border-radius: 3px 3px 0 0; }
.stats-column[data-level="0"] span { opacity: .18; }
.stats-column:hover span, .stats-column:focus span { background: #d9fbff; }
.stats-axis { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem 0; color: var(--muted); font-size: .72rem; }
.stats-order-list { display: grid; gap: .55rem; }
.stats-order-list li { padding: .65rem .7rem; border: 1px solid var(--line); border-radius: 12px; }
.stats-order-list small { display: block; margin-top: .25rem; color: var(--muted); }
.stats-range-menu .stats-cal { max-height: 260px; }
#lot-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#lot-fields { align-content: start; }
#purchases-dialog .zakup-db-game > header b { white-space: normal; }
@media (max-width: 900px) {
  dialog.sheet-card, #templates-dialog { width: calc(100% - 1rem); height: 94dvh; }
  .zakup-db-layout, .stats-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .zakup-db-side, .stats-side { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stats-main, .zakup-db-main { overflow: visible; }
  .stats-range-menu { right: auto; left: 0; width: min(325px, calc(100vw - 2rem)); }
  .stats-sheet { padding: .6rem; }
  .stats-sheet .sheet-stage {
    width: 100%;
    max-width: 100%;
    height: min(94vh, 100%);
  }
  .stats-sheet.is-compare .stats-card,
  .stats-sheet .stats-card { width: 100%; }
  #stats-orders.rival-panel { width: 100%; max-height: 42%; }
}

.stats-column .is-negative { background: var(--danger); }
.stats-currency { width: auto; padding: .2rem .5rem; border-radius: 8px; }
.stats-order-list { margin: 0; padding: 0; list-style: none; }
.sale-switch:focus-within .sale-switch-track { outline: 2px solid var(--acid); outline-offset: 2px; }
.rates-crm-key.is-missing { border-color: var(--acid); }
.brand-row {
  display: flex;
  align-items: flex-end;
  gap: 1.15rem;
  min-width: 0;
}

.header-usd {
  display: grid;
  gap: 0.08rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.header-usd:hover .header-usd-value,
.header-usd:focus-visible .header-usd-value {
  color: var(--acid);
}

.header-usd-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-usd-value {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.15;
  white-space: nowrap;
}

.header-msk {
  display: grid;
  gap: 0.08rem;
  margin: 0;
  color: inherit;
  font: inherit;
}

#usd-dialog { width: min(760px, calc(100% - 1rem)); height: auto; min-height: 285px; max-height: 90dvh; }
.usd-chart-body { display: grid; gap: .75rem; padding: 1rem 1.25rem; overflow: auto; }
.usd-chart-stats dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.usd-chart { min-height: 145px; }
.usd-chart svg { display: block; width: 100%; max-height: 220px; }
.usd-chart polyline { fill: none; stroke: var(--acid); stroke-width: 2; }
.usd-chart circle { fill: var(--acid); }
.usd-chart-body .hint { margin: 0; }

.progress {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 5, 0.72);
  display: grid;
  place-items: center;
  z-index: 50;
}
.progress-card {
  width: min(460px, calc(100% - 2rem));
  padding: 1.4rem;
  border-radius: 22px;
}
.progress-card .error { margin: 0.85rem 0 0; }
.progress-failed {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 0.5rem;
}
.progress-failed li { font-size: 0.9rem; line-height: 1.35; }
.progress-failed .hint { display: block; margin-top: 0.15rem; }
.progress-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1rem;
}
.bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(238, 241, 246, 0.08);
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--acid);
}
.markups-profit-field {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1.1rem;
}
.markups-profit-field .price-input { width: 100%; }
#batch-markups-sheet .sheet-card.batch-markups-card {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-2) 88%, black);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.batch-markups-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.9rem 1.2rem 1.2rem;
  overflow: hidden;
}
.batch-markups-cols {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(340px, 1.2fr);
  gap: 0.9rem;
}
.batch-markups-lists { min-height: 0; overflow: auto; }
.batch-markups-lists h3 {
  margin: 0.7rem 0 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 650;
}
.batch-markups-lists h3:first-child { margin-top: 0; }
.batch-markups-list { display: grid; gap: 0.35rem; }
.batch-markups-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0.55rem 0.7rem;
}
.batch-markups-item:hover { background: rgba(255, 193, 74, 0.12); }
.batch-markups-item.is-active {
  outline: 1px solid var(--acid);
  outline-offset: -1px;
}
.batch-markups-item.is-error { border-color: rgba(255, 107, 74, 0.45); }
.batch-markups-item .title {
  display: block;
  font-weight: 650;
  font-size: 0.82rem;
  line-height: 1.3;
}
.batch-markups-item .meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.batch-markups-detail {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
}
.batch-markups-detail h3 { margin: 0 0 0.55rem; font-size: 0.95rem; }
.batch-diff {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.batch-diff th, .batch-diff td {
  padding: 0.4rem 0.35rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.batch-diff th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
}
.batch-diff .is-changed { color: var(--ok); }
.batch-diff .was { color: var(--muted); }
@media (max-width: 900px) {
  .batch-markups-cols { grid-template-columns: 1fr; }
}
