:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: Sora, system-ui, sans-serif;
  background: #07080b;
  color: #ece7d8;
}
body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(212, 175, 55, 0.08), transparent 55%),
    radial-gradient(900px 500px at 110% 10%, rgba(16, 185, 129, 0.06), transparent 50%);
  z-index: 0;
}
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: .035;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.shell { position: relative; z-index: 10; display: flex; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 256px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,.1);
  background: rgba(12,14,19,.8);
  padding: 28px 20px;
  display: none;
  flex-direction: column;
}
.logo { text-decoration: none; color: inherit; display: block; margin-bottom: 40px; padding: 0 8px; }
.logo-title { font-family: Syne, sans-serif; font-size: 24px; color: #e8c547; }
.logo-sub { margin-top: 4px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.35); }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a, .mobile nav a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}
.sidebar nav a.active, .mobile nav a.active { background: rgba(212,175,55,.15); color: #e8c547; }
.side-note { margin-top: auto; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 16px; font-size: 12px; color: rgba(255,255,255,.4); }
.side-note div { color: rgba(255,255,255,.5); margin-bottom: 8px; }
.mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding: 12px 16px;
}
.mobile > a { font-family: Syne, sans-serif; color: #e8c547; text-decoration: none; }
.mobile nav { display: flex; gap: 12px; font-size: 12px; }
main { flex: 1; min-width: 0; padding: 32px 24px; }
.wrap { max-width: 960px; margin: 0 auto; }
h1 { font-family: Syne, sans-serif; font-size: 30px; font-weight: 700; margin: 0; }
.lead { margin: 8px 0 0; color: rgba(255,255,255,.5); font-size: 14px; max-width: 640px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 32px; }
.steps button {
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
  color: inherit;
  padding: 12px;
  cursor: pointer;
}
.steps button.active { border-color: rgba(212,175,55,.5); background: rgba(212,175,55,.1); }
.steps button .n { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.35); }
.steps button .l { margin-top: 4px; font-family: Syne, sans-serif; }
.panel {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(27,32,48,.7);
  border-radius: 16px;
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.grid-2 { display: grid; gap: 16px; }
.cards { display: grid; gap: 16px; }
@media (min-width: 768px) {
  .grid-2, .cards { grid-template-columns: 1fr 1fr; }
  .cards.cats-3 { grid-template-columns: repeat(3, 1fr); }
  .brands { grid-template-columns: repeat(3, 1fr); }
}
.brands { display: grid; gap: 12px; }
.choice, .tpl, .domain {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(7,8,11,.5);
  border-radius: 14px;
  padding: 18px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.choice.sel-escort { border-color: rgba(251,113,133,.4); }
.choice.sel-esctek { border-color: rgba(251,191,36,.45); }
.choice.sel-bet { border-color: rgba(52,211,153,.4); }
.tpl.sel, .domain.sel, .brand.sel { border-color: rgba(212,175,55,.5); box-shadow: 0 0 0 1px rgba(212,175,55,.3); }
.choice .k { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.choice h2, .tpl b { font-family: Syne, sans-serif; margin: 8px 0 0; font-size: 22px; }
.muted { color: rgba(255,255,255,.45); font-size: 13px; }
label.field { display: block; margin-bottom: 8px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.45); }
input, textarea, select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(7,8,11,.8);
  color: #fff8e7;
  padding: 12px 16px;
  outline: none;
  font: inherit;
}
input:focus, textarea:focus, select:focus { border-color: rgba(212,175,55,.6); box-shadow: 0 0 0 3px rgba(212,175,55,.12); }
.domain-ext { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.domain-ext input { flex: 1; min-width: 180px; }
.domain-ext .btn-ghost { width: auto; }
.btn, .btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  border: 0;
  text-decoration: none;
}
.btn-primary { background: #d4af37; color: #07080b; min-width: 160px; }
.btn-ghost { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); color: rgba(255,255,255,.8); }
button:disabled { opacity: .4; cursor: not-allowed; }
.error { border: 1px solid rgba(251,113,133,.3); background: rgba(251,113,133,.1); color: #ffe4e6; padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.ok { color: #6ee7b7; }
.stack { display: grid; gap: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.space { margin-top: 16px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: rgba(255,255,255,.6); }
.check input { width: auto; }
.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255,255,255,.15);
  border-radius: 12px;
  min-height: 88px;
  cursor: pointer;
  color: rgba(255,255,255,.5);
  font-size: 14px;
}
.tabs { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tabs button.on { background: #d4af37; color: #07080b; }
.swap-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 8, 11, 0.82);
  overflow: auto;
  padding: 28px 20px 48px;
}
.swap-overlay[hidden] { display: none !important; }
.swap-overlay .swap-panel { max-width: 1180px; margin: 0 auto; }
.wrap-wide { max-width: 1280px; margin: 0 auto; }
.sablon-grid { display: grid; gap: 16px; }
@media (min-width: 960px) {
  .sablon-grid { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
}
.tpl-list { display: grid; gap: 10px; max-height: 620px; overflow: auto; padding-right: 4px; }
.tpl-group { margin: 0; }
.tpl-group h2 {
  font-family: Syne, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #e8c547;
  margin: 0 0 6px;
}
.tpl-items { display: grid; gap: 4px; }
.tpl-card {
  cursor: pointer;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(27,32,48,.55);
  border-radius: 8px;
  padding: 7px 10px;
  color: inherit;
}
.tpl-card b {
  display: block;
  font-family: Sora, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
}
.tpl-card .muted { font-size: 11px; margin-top: 2px; }
.tpl-card.sel { border-color: rgba(212,175,55,.5); background: rgba(212,175,55,.12); box-shadow: 0 0 0 1px rgba(212,175,55,.25); }
.preview-shell { min-height: 560px; }
.preview-frame {
  width: 100%;
  height: 620px;
  border: 0;
  border-radius: 12px;
  background: #fff;
}
.code-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.code-tabs button { font-size: 12px; }
.code-view {
  margin: 0;
  max-height: 620px;
  overflow: auto;
  padding: 16px;
  border-radius: 12px;
  background: #07080b;
  border: 1px solid rgba(255,255,255,.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
  color: #e8e4d4;
}
.choice.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; position: relative; padding-right: 36px; }
.brand-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.06);
}
.brand-del:hover { color: #fecdd3; background: rgba(251,113,133,.2); }
.brand-mini-wrap { width: 28px; height: 28px; flex-shrink: 0; }
.brand-mini { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; background: #0c0e13; }
.brand-assets { display: grid; gap: 16px; margin-top: 8px; }
.asset-thumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.asset-card {
  width: 72px;
  height: 72px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: #0c0e13;
  cursor: pointer;
}
.asset-card.fav { width: 56px; height: 56px; }
.asset-card.sel { border-color: rgba(212,175,55,.65); box-shadow: 0 0 0 1px rgba(212,175,55,.35); }
.asset-card { position: relative; overflow: hidden; }
.asset-card img { width: 100%; height: 100%; object-fit: contain; }
.asset-tag {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
  color: #ece8dc;
  background: rgba(7,8,11,.78);
  border-radius: 6px;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-picks button {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: inherit;
  border-radius: 12px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}
.theme-picks button.sel { border-color: rgba(212,175,55,.5); background: rgba(212,175,55,.12); }
#theme-opts[hidden], #palette-opts[hidden] { display: none !important; }
.palette-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.palette-swatch {
  display: flex;
  width: 76px;
  height: 34px;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer;
  background: transparent;
}
.palette-swatch span { flex: 1; display: block; min-width: 0; }
.palette-swatch.sel { border-color: rgba(212,175,55,.75); box-shadow: 0 0 0 2px rgba(212,175,55,.28); }
.asset-upload { min-height: 56px; min-width: 96px; padding: 8px 10px; font-size: 12px; }
.brand-assets code { color: rgba(232,197,71,.85); font-size: 12px; }
@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .mobile { display: none; }
  main { padding: 32px 40px; }
}
.side-user { margin: 16px 0 12px; display: grid; gap: 8px; }
.side-user[hidden] { display: none !important; }
.side-user-name { font-size: 12px; color: rgba(255,255,255,.55); padding: 0 4px; word-break: break-all; }
.side-user .btn-ghost { width: 100%; }
[data-admin-nav][hidden] { display: none !important; }
body.auth-only .sidebar,
body.auth-only .mobile { display: none !important; }
body.auth-only main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
}
.auth-card { width: min(420px, 100%); }
