/* Kenny Admin — dark panel */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  color-scheme: dark;
  --bg: #0e0e0e;
  --bg-deep: #121212;
  --ink: #f3f3f3;
  --ink-soft: rgba(255, 255, 255, 0.55);
  --paper: rgba(255, 255, 255, 0.05);
  --paper-solid: #1a1a1a;
  --line: rgba(255, 255, 255, 0.1);
  --copper: #fe5e10;
  --copper-deep: #d44a08;
  --moss: #6bb56a;
  --danger: #ff6b5a;
  --ok: #5dba6a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -12%, rgba(254, 94, 16, 0.16), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(255, 255, 255, 0.04), transparent 50%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  isolation: isolate;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
}

.hidden {
  display: none !important;
}

/* ——— Login ——— */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.login-card {
  width: min(440px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 36px 32px 28px;
  text-align: center;
  backdrop-filter: blur(10px);
  animation: rise 0.55s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  line-height: 0.95;
  color: var(--ink);
}

.brand-mark span {
  display: block;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
  margin-top: 10px;
}

.login-lead {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.45;
}

.qr-wrap {
  margin: 28px auto 12px;
  width: 220px;
  height: 220px;
  border-radius: 20px;
  background: var(--paper-solid);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.qr-wrap img {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

.qr-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.login-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.login-error {
  margin-top: 14px;
  color: var(--danger);
  font-size: 0.9rem;
}

/* ——— Shell ——— */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.topbar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
}

.topbar-brand small {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.whoami {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.nav {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.nav button {
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav button.active {
  background: rgba(254, 94, 16, 0.14);
  border-color: rgba(254, 94, 16, 0.35);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.nav button.nav-alert {
  color: var(--danger);
  border-color: rgba(255, 107, 90, 0.45);
}

.boosty-alert {
  cursor: pointer;
  text-align: left;
}

.shell-main {
  min-height: 420px;
}

.login-oauth {
  display: grid;
  gap: 10px;
  margin: 22px 0 8px;
}

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

.btn-oauth-vk {
  background: #0077ff;
  border-color: transparent;
  color: #fff;
}

.btn-oauth-vk:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-oauth-ya {
  background: #fc3f1d;
  border-color: transparent;
  color: #fff;
}

.btn-oauth-ya:hover:not(:disabled) {
  filter: brightness(1.05);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 8px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper-solid);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(254, 94, 16, 0.45);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--copper) 0%, var(--copper-deep) 100%);
  border-color: transparent;
  color: #fffaf3;
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  background: rgba(255, 107, 90, 0.12);
  border-color: rgba(255, 107, 90, 0.35);
  color: var(--danger);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.field,
.select {
  border: 1px solid var(--line);
  background: var(--paper-solid);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  min-width: 0;
}

.select {
  cursor: pointer;
}

.field:focus,
.select:focus,
textarea.field:focus {
  outline: 2px solid rgba(254, 94, 16, 0.45);
  outline-offset: 1px;
}

/* ——— Product grid ——— */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(26, 31, 24, 0.06);
  display: flex;
  flex-direction: column;
  animation: rise 0.45s ease both;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-cover {
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(145deg, #2a3128, #4a3a2a),
    var(--moss);
  background-size: cover;
  background-position: center;
}

.card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.card-desc {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.pill.ok {
  background: rgba(93, 186, 106, 0.14);
  color: var(--ok);
}

.pill.warn {
  background: rgba(254, 94, 16, 0.14);
  color: #ffb089;
}

.card-actions {
  margin-top: 8px;
}

.empty,
.loading,
.error-banner {
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.error-banner {
  color: var(--danger);
  border-style: solid;
  margin-bottom: 16px;
}

/* ——— Drawer ——— */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 40;
  animation: fade 0.2s ease both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100%;
  background: var(--paper-solid);
  z-index: 50;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  animation: slide 0.28s ease both;
  border-left: 1px solid var(--line);
}

.drawer.drawer-wide {
  width: min(560px, 100%);
}

@keyframes slide {
  from {
    transform: translateX(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.drawer-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.drawer-body {
  padding: 18px 22px 28px;
  overflow: auto;
  flex: 1;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  gap: 6px;
}

.form-row label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.form-row.two {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row.two > div {
  display: grid;
  gap: 6px;
}

.tag-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

.tag-check:hover {
  border-color: rgba(254, 94, 16, 0.55);
  background: rgba(254, 94, 16, 0.12);
}

.tag-check.is-used {
  border-color: rgba(254, 94, 16, 0.7);
  background: rgba(254, 94, 16, 0.16);
  color: var(--ink);
}

.tag-check input {
  accent-color: var(--copper);
  margin: 0;
  cursor: pointer;
}

.tag-preset {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
}

.tag-preset:hover:not(:disabled) {
  border-color: rgba(254, 94, 16, 0.55);
  background: rgba(254, 94, 16, 0.12);
}

.tag-preset:disabled,
.tag-preset.is-used {
  opacity: 0.42;
  cursor: not-allowed;
}

    .page-block {
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      margin-bottom: 10px;
      display: grid;
      gap: 8px;
    }
    .translation-editor {
      max-height: 78vh;
      overflow: auto;
    }
    .page-preview {
      padding: 14px;
      border-radius: 12px;
      background: color-mix(in srgb, var(--ink) 4%, transparent);
      border: 1px solid var(--line);
    }

.drawer-foot {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.drawer-foot-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.sub-box {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.sub-current {
  font-size: 0.92rem;
  font-weight: 600;
}

.bucket-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.bucket-tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.bucket-tab:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 35%, transparent);
}

.bucket-tab.active {
  background: var(--ink);
  color: var(--paper-solid);
  border-color: var(--ink);
}

.products-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.products-main {
  min-width: 0;
}

.products-side-rail {
  position: sticky;
  top: 12px;
}

.side-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70vh;
  overflow: auto;
}

.side-product-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}

.side-product-title {
  font-weight: 650;
  font-size: 0.92rem;
}

@media (max-width: 1000px) {
  .products-layout {
    grid-template-columns: 1fr;
  }
  .products-side-rail {
    position: static;
  }
}

/* ——— Catalog (groups) ——— */
.group-card {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.group-card:hover {
  border-color: color-mix(in srgb, var(--copper) 55%, var(--line));
  transform: translateY(-2px);
}

.card-cover.is-empty,
.media-preview.is-empty,
.catalog-hero-cover.is-empty {
  background:
    linear-gradient(135deg, rgba(254, 94, 16, 0.18), transparent 60%),
    color-mix(in srgb, var(--ink) 6%, transparent);
}

.catalog-modal {
  width: min(680px, 100%);
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}

.form-section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.media-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}

.media-preview {
  width: 140px;
  min-height: 88px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.catalog-detail {
  display: grid;
  gap: 0;
}

.catalog-hero {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.catalog-hero-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.catalog-hero-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.catalog-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.catalog-hero-desc {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
  white-space: pre-wrap;
}

.catalog-changelog {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.catalog-changelog summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
}

.catalog-changelog pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.product-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subtype-grid {
  display: grid;
  gap: 14px;
  align-items: start;
}

.subtype-grid.cols-1 {
  grid-template-columns: minmax(0, 1fr);
}

.subtype-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subtype-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .subtype-grid.cols-2,
  .subtype-grid.cols-3 {
    grid-template-columns: 1fr;
  }
}

.subtype-slot {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: color-mix(in srgb, var(--ink) 2.5%, transparent);
  min-height: 140px;
}

.subtype-slot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.subtype-slot-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.subtype-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}
.subtype-meta .form-row {
  margin: 0;
}
  color: var(--muted, #8a8a8a);
  font-size: 0.86rem;
  padding: 8px 2px 4px;
}

.product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.product-row:hover {
  border-color: color-mix(in srgb, var(--copper) 50%, var(--line));
  background: color-mix(in srgb, var(--copper) 8%, transparent);
}

.product-row-name {
  font-weight: 650;
  font-size: 0.98rem;
}

.product-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.product-row-go {
  color: var(--ink-soft);
  font-size: 1.1rem;
}

@media (max-width: 720px) {
  .catalog-hero {
    grid-template-columns: 1fr;
  }
  .product-row {
    grid-template-columns: 1fr;
  }
  .product-row-tags {
    justify-content: flex-start;
  }
  .product-row-go {
    display: none;
  }
}

/* ——— Centered create modal ——— */
.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  pointer-events: none;
}

.modal {
  pointer-events: auto;
  width: min(640px, 100%);
  max-height: min(92vh, 900px);
  background: var(--paper-solid);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(26, 31, 24, 0.28);
  display: flex;
  flex-direction: column;
  animation: modal-in 0.26s ease both;
}

@keyframes modal-in {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0.5;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal .drawer-head,
.modal .drawer-foot {
  flex-shrink: 0;
}

.modal .drawer-body {
  overflow: auto;
}

.file-drop {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed color-mix(in srgb, var(--ink-soft) 35%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-solid) 80%, var(--ink) 4%);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.file-drop.has-preview {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.file-drop-copy {
  flex: 1;
  display: grid;
  gap: 8px;
  min-width: 140px;
}

.file-drop strong {
  font-size: 0.92rem;
}

.file-drop .hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.file-drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-drop:hover,
.file-drop.is-dragover,
body.is-file-drag .file-drop {
  border-color: color-mix(in srgb, var(--copper) 70%, var(--line));
  background: color-mix(in srgb, var(--copper) 10%, var(--paper-solid));
}

.file-drop.is-dragover {
  border-style: solid;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--copper) 55%, transparent);
}

.catalog-hero-media {
  display: grid;
  gap: 10px;
}

.catalog-hero-bg {
  aspect-ratio: 16 / 9;
}

.home-shelves {
  margin-bottom: 16px;
}

.home-shelves-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .home-shelves-grid {
    grid-template-columns: 1fr;
  }
}

.home-shelf {
  display: grid;
  gap: 8px;
}

.home-shelf-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.home-shelf-cover {
  width: 44px;
  height: 28px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.home-shelf-name {
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-shelf-actions {
  display: flex;
  gap: 2px;
}

.home-shelf-actions .btn {
  min-width: 32px;
  padding: 0 8px;
}

.path-preview {
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  word-break: break-all;
}

.mc-meta {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.mc-meta[hidden] {
  display: none;
}

.agent-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.agent-box .agent-flag {
  font-weight: 600;
}

.agent-key-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.agent-key-row .field {
  flex: 1;
  min-width: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.85rem;
}

.agent-key-row .field:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hint,
.agent-box .hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.35;
  margin: 0 0 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}

.type-checks {
  display: grid;
  gap: 8px;
  margin: 10px 0 8px;
}

.feature-check-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  max-height: 48vh;
  overflow: auto;
  padding-right: 4px;
}

.feature-check-row {
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-solid);
  cursor: pointer;
}

.feature-check-row:has(input:checked) {
  border-color: rgba(184, 106, 43, 0.45);
  background: rgba(184, 106, 43, 0.06);
}

.feature-check-row input {
  margin-top: 3px;
}

.feature-check-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.feature-check-text strong {
  font-family: var(--font-display);
  font-weight: 650;
}

.feature-check-text .meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

.feature-check-desc {
  font-size: 0.84rem;
  color: var(--ink-soft);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plan-meta-form {
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.plan-meta-form .form-row.two > .form-row {
  margin: 0;
}

.plan-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .plan-price-grid {
    grid-template-columns: 1fr;
  }
}

.search-pick {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.search-hits {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-solid);
  max-height: 220px;
  overflow: auto;
}

.search-hits:empty {
  display: none;
}

.search-hits li button {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.search-hits li:last-child button {
  border-bottom: 0;
}

.search-hits li button:hover,
.search-hits li button.active {
  background: rgba(184, 106, 43, 0.08);
}

.search-hits strong {
  font-family: var(--font-display);
}

.search-hits span {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

.grant-pick {
  font-size: 0.88rem;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(184, 106, 43, 0.1);
  border: 1px solid rgba(184, 106, 43, 0.35);
}

/* ——— Users ——— */
.search-bar {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 520px;
}

.search-bar .field {
  flex: 1;
}

.user-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
}

@media (max-width: 860px) {
  .user-layout {
    grid-template-columns: 1fr;
  }
  .form-row.two {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(26, 31, 24, 0.06);
}

.user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 70vh;
  overflow: auto;
}

.user-list button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper-solid);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

.user-list button.active {
  border-color: rgba(184, 106, 43, 0.55);
  box-shadow: inset 0 0 0 1px rgba(184, 106, 43, 0.25);
}

.user-list .name {
  font-weight: 650;
  font-family: var(--font-display);
}

.user-list .meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.detail-title {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.detail-sub {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 18px;
  font-family: var(--font-mono);
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 12px;
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.kv dt {
  color: var(--ink-soft);
}

.kv dd {
  margin: 0;
  word-break: break-word;
}

.product-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(26, 31, 24, 0.05);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.chip button {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
  padding: 0 2px;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  color: #fff;
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 80;
  box-shadow: var(--shadow);
  animation: rise 0.25s ease both;
}

/* Фоновые загрузки — слева снизу, чтобы не перекрывать drawer справа */
.upload-dock {
  position: fixed;
  left: 18px;
  right: auto;
  bottom: 18px;
  width: min(420px, calc(100vw - 28px));
  max-height: min(70vh, 640px);
  overflow: auto;
  z-index: 45;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--paper-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

body:has(aside.drawer) .upload-dock {
  left: 18px;
  right: auto;
  z-index: 45;
}

.upload-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  background: var(--paper-solid);
  z-index: 1;
  padding-bottom: 4px;
}

.upload-dock-title {
  font: 700 11px/1.2 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.upload-dock-count {
  font: 500 11px/1 var(--font-body);
  color: var(--ink-soft);
}

.upload-job {
  padding: 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--line);
}

.upload-job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.upload-job-name {
  font: 700 13px/1.3 var(--font-body);
  color: var(--ink);
  word-break: break-word;
}

.upload-job-status {
  margin-top: 3px;
  font: 500 12px/1.35 var(--font-body);
  color: var(--ink-soft);
}

.upload-job-done .upload-job-status {
  color: var(--ok);
}

.upload-job-error .upload-job-status {
  color: var(--danger);
}

.upload-job-sub {
  margin-top: 4px;
  font: 400 11px/1.3 var(--font-body);
  color: var(--ink-soft);
}

.upload-job-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.upload-job-step {
  padding: 6px 6px 7px;
  border-radius: 8px;
  border: 1px solid var(--line);
  text-align: center;
  font: 600 10px/1.25 var(--font-body);
  color: var(--ink-soft);
  background: transparent;
}

.upload-job-step small {
  display: block;
  margin-top: 2px;
  font: 400 9px/1.2 var(--font-body);
  color: var(--ink-soft);
  font-weight: 500;
}

.upload-job-step.is-on {
  border-color: var(--copper);
  color: var(--ink);
  background: color-mix(in srgb, var(--copper) 16%, transparent);
}

.upload-job-step.is-done {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  color: var(--ok);
}

.upload-job-step.is-fail {
  border-color: var(--danger);
  color: var(--danger);
}

.upload-job-x {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.upload-job-x:hover {
  color: var(--ink);
}

.upload-job-log {
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font: 400 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: rgba(255, 255, 255, 0.72);
}

.upload-job-log.muted {
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

.upload-job-log-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.upload-job-log-line + .upload-job-log-line {
  margin-top: 3px;
}

.upload-job-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 999px;
  background: rgba(26, 31, 24, 0.1);
  overflow: hidden;
}

.upload-job-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--copper);
  transition: width 0.2s ease;
}

.upload-job-bar-fill.is-pulse {
  animation: upload-pulse 1.2s linear infinite;
}

@keyframes upload-pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
  100% {
    opacity: 1;
  }
}

.upload-dock-hint {
  font: 400 11px/1.35 var(--font-body);
  color: var(--ink-soft);
  margin: -2px 0 2px;
}

.upload-dock-jobs {
  display: grid;
  gap: 10px;
}

/* ——— Stats ——— */
.stats-section {
  display: grid;
  gap: 16px;
}

.stats-toolbar {
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.stats-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-range .field {
  width: auto;
  min-width: 140px;
}

.stats-kpi {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stats-kpi-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(26, 31, 24, 0.06);
}

.stats-kpi-label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.stats-kpi-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stats-kpi-split {
  font-size: 1.05rem;
}

.stats-sub-kpi .stats-kpi-item .meta {
  margin-top: 6px;
}

.stats-sub-split {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.stats-sub-split-a {
  background: var(--ok);
  min-width: 0;
  flex: 0 1 0;
}

.stats-sub-split-c {
  background: var(--copper);
  min-width: 0;
  flex: 0 1 0;
}

.stats-sub-period-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.stats-chart-panel {
  overflow: hidden;
}

.stats-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.stats-chart-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stats-chart {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 220px;
  display: block;
  aspect-ratio: 760 / 240;
}

.stats-bar {
  fill: var(--copper);
  opacity: 0.9;
}

.stats-bar:hover {
  fill: var(--copper-deep);
}

.stats-grid {
  stroke: rgba(26, 31, 24, 0.08);
  stroke-width: 1;
}

.stats-axis {
  fill: var(--ink-soft);
  font-size: 10px;
  font-family: var(--font-mono);
}

.stats-chart-empty {
  padding: 40px 12px;
  text-align: center;
  color: var(--ink-soft);
}

.stats-tops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stats-top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.stats-top-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
}

.stats-top-rank {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--copper-deep);
}

.stats-top-rev {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: nowrap;
}

.stats-top-track {
  margin-top: 6px;
  height: 4px;
  background: rgba(26, 31, 24, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.stats-top-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--moss), var(--copper));
  border-radius: 999px;
}

@media (max-width: 960px) {
  .stats-kpi {
    grid-template-columns: 1fr 1fr;
  }

  .stats-tops {
    grid-template-columns: 1fr;
  }

  .stats-sub-period-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .stats-kpi {
    grid-template-columns: 1fr;
  }

  .stats-sub-period-row {
    grid-template-columns: 1fr;
  }
}

.stats-view-tabs {
  margin-bottom: 4px;
}

.stats-body {
  display: grid;
  gap: 16px;
}

.stats-breakdown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stats-table-wrap {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.stats-table th,
.stats-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.stats-table th {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-table td:nth-child(1),
.stats-table th:nth-child(1) {
  width: 36px;
  color: var(--ink-soft);
}

/* Рефералы: не наследуем узкую первую колонку статистики */
.refui-table.stats-table td:nth-child(1),
.refui-table.stats-table th:nth-child(1) {
  width: auto;
  min-width: 140px;
  color: var(--ink);
}

.refui-section {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 280px;
}

.refui-link-list {
  display: grid;
  gap: 12px;
}

.refui-link-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.refui-link-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
}

.refui-link-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.refui-link-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.stats-json {
  width: 100%;
  min-height: 320px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
  white-space: pre;
}

.stats-analytics .toolbar {
  flex-wrap: wrap;
}

/* ——— Launcher stats ——— */
.launcher-stats {
  display: grid;
  gap: 14px;
}

.launcher-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.launcher-layer-tabs,
.launcher-kind-tabs {
  margin-bottom: 0;
}

.launcher-top-panel {
  margin-bottom: 0;
}

.launcher-toolbar {
  margin-bottom: 4px;
}

.launcher-kpi-wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.launcher-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.launcher-product-table tbody tr.launcher-row-click {
  cursor: pointer;
  transition: background 0.15s ease;
}

.launcher-product-table tbody tr.launcher-row-click:hover {
  background: rgba(180, 120, 70, 0.08);
}

.launcher-chevron {
  color: var(--ink-soft);
  font-weight: 600;
  width: 28px;
  text-align: right;
}

.launcher-bar {
  fill: var(--moss);
}

.launcher-bar:hover {
  fill: var(--copper-deep);
}

.launcher-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.launcher-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2f9e6b;
  box-shadow: 0 0 0 0 rgba(47, 158, 107, 0.55);
  animation: launcher-pulse 1.6s ease-out infinite;
}

@keyframes launcher-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 158, 107, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(47, 158, 107, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 158, 107, 0);
  }
}

.launcher-hot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 960px) {
  .launcher-kpi-wide {
    grid-template-columns: 1fr 1fr;
  }

  .launcher-hot-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Ads / referral ——— */
.stats-mode-tabs {
  margin-bottom: 14px;
}

.stats-mode-tabs .bucket-tab {
  min-width: 120px;
  justify-content: center;
}

.refui-empty {
  text-align: center;
  padding: 36px 24px;
}

.refui-empty .btn {
  margin-top: 4px;
}

.refui-kpi {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.refui-url-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
}

.refui-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.refui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 10px;
}

.refui-analytics {
  display: grid;
  gap: 14px;
}

.refui-analytics-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 12px;
  align-items: start;
}

.refui-funnel-row {
  display: grid;
  grid-template-columns: 90px 1fr 64px;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.refui-funnel-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.refui-funnel-track {
  height: 14px;
  background: rgba(26, 31, 24, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.refui-funnel-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
}

.refui-funnel-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: right;
}

.refui-funnel-pct {
  margin: -2px 0 8px 100px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.refui-conv-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.plan-boosty-levels,
.plan-boosty-catalog {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.plan-boosty-levels li,
.plan-boosty-catalog li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.plan-boosty-catalog {
  padding-left: 0 !important;
}

@media (max-width: 1100px) {
  .refui-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .refui-analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* ——— Статистика (общий вид) ——— */
.dash-page-head {
  margin-bottom: 6px;
}

.dash-page-head .detail-title {
  margin: 0;
}

.dash-lead {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 46rem;
}

.dash-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}

.dash-range-hint {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.dash-hero--live {
  background:
    linear-gradient(165deg, rgba(93, 186, 106, 0.16), transparent 42%),
    var(--paper);
}

.dash-live-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-hero-n {
  white-space: nowrap;
}

.dash-bar-seg.is-sub,
.dash-dot.is-sub {
  background: var(--copper);
}
.dash-bar-seg.is-buy,
.dash-dot.is-buy {
  background: var(--ok);
}
.dash-bar-seg.is-time,
.dash-dot.is-time {
  background: var(--moss);
}
.dash-bar-seg.is-people,
.dash-dot.is-people {
  background: #4aa8e8;
}

.dash-kpis--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-rank-panel .dash-section-head {
  margin-bottom: 10px;
}

.dash-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.dash-rank-item {
  padding: 8px 4px 10px;
  border-bottom: 1px solid var(--line);
}

.dash-rank-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.dash-rank-item.is-click {
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 10px 12px;
  border-bottom: 0;
}

.dash-rank-item.is-click:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.dash-rank-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
}

.dash-rank-n {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--copper);
}

.dash-rank-pulse {
  width: 8px;
  height: 8px;
  justify-self: center;
}

.dash-rank-val {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: nowrap;
}

.stats-mode-tabs {
  margin-bottom: 12px;
}
.dash-bar-seg.is-boosty,
.dash-dot.is-boosty {
  background: #4aa8e8;
}
.dash-bar-seg.is-card,
.dash-dot.is-card {
  background: var(--ok);
}
.dash-bar-seg.is-cancel,
.dash-dot.is-cancel {
  background: var(--copper);
}
.dash-bar-seg.is-grant,
.dash-dot.is-grant {
  background: #c4a574;
}
.dash-bar-seg.is-email,
.dash-dot.is-email {
  background: var(--ok);
}
.dash-bar-seg.is-vk,
.dash-dot.is-vk {
  background: #4a76a8;
}
.dash-bar-seg.is-yandex,
.dash-dot.is-yandex {
  background: #fc3f1d;
}
.dash-bar-seg.is-tg,
.dash-dot.is-tg {
  background: #2aabee;
}
.dash-bar-seg.is-rest,
.dash-dot.is-rest {
  background: var(--line);
}

.dash-hero {
  background:
    linear-gradient(165deg, rgba(254, 94, 16, 0.14), transparent 42%),
    var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 18px;
}

.dash-hero-label {
  color: var(--ink-soft);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.dash-hero-n {
  font-family: var(--font-display);
  font-size: 3.1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 4px 0 12px;
}

.dash-hero-note {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.dash-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.dash-bar--empty {
  opacity: 0.35;
}

.dash-bar-seg {
  min-width: 0;
}

.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
}

.dash-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
}

.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dash-kpi,
.dash-plan,
.dash-period {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.dash-kpi-label,
.dash-plan-key {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.dash-kpi-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 2px;
}

.dash-kpi-meta {
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin-top: 4px;
  line-height: 1.35;
}

.dash-kpi .dash-bar {
  height: 8px;
  margin-top: 10px;
}

.dash-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.dash-plans-wrap .dash-section-head {
  margin-bottom: 10px;
}

.dash-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.dash-plan {
  padding: 16px;
  border-top-width: 3px;
}

.dash-plan--iron { border-top-color: #a8a29e; }
.dash-plan--gold { border-top-color: #e8c547; }
.dash-plan--diamond { border-top-color: #5ec8e8; }
.dash-plan--netherite { border-top-color: #9b7dff; }
.dash-plan--other { border-top-color: var(--copper); }

.dash-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-plan-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.dash-plan-total {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dash-plan .dash-bar {
  height: 8px;
  margin-bottom: 10px;
}

.dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  padding: 3px 0;
}

.dash-row-l {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
}

.dash-row-n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.dash-period-note {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.4;
}

.dash-period-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 960px) {
  .dash-kpis,
  .dash-kpis--3,
  .dash-period-row {
    grid-template-columns: 1fr 1fr;
  }

  .dash-hero-n {
    font-size: 2.4rem;
  }
}

@media (max-width: 640px) {
  .dash-kpis,
  .dash-period-row {
    grid-template-columns: 1fr;
  }
}

