:root {
  --bg:#ffffff; --bg2:#f5f5f7; --panel:#ffffff; --panel2:#fafafa;
  --line:#e5e5ea; --line2:#f0f0f2; --ink:#1d1d1f; --ink2:#86868b; --ink3:#aeaeb2;
  --uzum:#8B5CF6; --uzum-d:rgba(139,92,246,.12); --uzum-g:rgba(139,92,246,.25);
  --yandex:#F5C518; --yandex-d:rgba(245,197,24,.12); --yandex-g:rgba(245,197,24,.25);
  --wb:#E11D74; --wb-d:rgba(225,29,116,.12); --wb-g:rgba(225,29,116,.25);
  --ok:#34c759; --err:#ff3b30; --r:14px; --r-sm:9px;
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:14px;-webkit-font-smoothing:antialiased}
body{
  min-height:100vh; background:var(--bg2); color:var(--ink);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
}

/* ===== MENU BAR (same as main site) ===== */
.top-menu-bar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  padding: 0 20px;
}
.menu-bar-content {
  max-width: 1200px;
  margin: 0 auto;
}
.menu-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  overflow-x: auto;
}
.menu-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: #718096;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.menu-link:hover {
  background: #f7fafc;
  color: #1a202c;
}
.menu-link.active {
  background: rgba(139,92,246,.1);
  color: #805ad5;
}
.menu-link span:first-child {
  font-size: 18px;
}
.menu-lang-switch {
  display: flex;
  margin-left: auto;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 2px;
}
.lang-btn-menu {
  padding: 6px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.lang-btn-menu.active {
  background: #805ad5;
  color: white;
}
.lang-btn-menu:hover:not(.active) {
  background: #e2e8f0;
}

/* ===== TOP AD BLOCK ===== */
.top-ad-block {
  width: 100%;
  height: 90px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #a0aec0;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ===== HEADER ===== */
.page-header { text-align: center; }
.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.page-subtitle {
  color: var(--ink2);
  margin-bottom: 0;
}

/* ===== LABELS ===== */
.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--ink3);
  font-family: 'SF Mono', Monaco, monospace;
  margin-bottom: 10px;
}

/* ===== MARKETPLACE CARDS ===== */
.mps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mp {
  position: relative;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  user-select: none;
}
.mp::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.25s;
}
.mp::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.mp[data-mp=uzum]::before { background: var(--uzum); }
.mp[data-mp=yandex]::before { background: var(--yandex); }
.mp[data-mp=wildberries]::before { background: var(--wb); }
.mp[data-mp=uzum]::after { background: radial-gradient(ellipse at 0% 0%, var(--uzum-d), transparent 65%); }
.mp[data-mp=yandex]::after { background: radial-gradient(ellipse at 0% 0%, var(--yandex-d), transparent 65%); }
.mp[data-mp=wildberries]::after { background: radial-gradient(ellipse at 0% 0%, var(--wb-d), transparent 65%); }
.mp:hover { transform: translateY(-2px); }
.mp:hover::before, .mp.active::before, .mp:hover::after, .mp.active::after { opacity: 1; }
.mp.active[data-mp=uzum] { border-color: var(--uzum); box-shadow: 0 0 0 1px var(--uzum), 0 8px 28px var(--uzum-g); }
.mp.active[data-mp=yandex] { border-color: var(--yandex); box-shadow: 0 0 0 1px var(--yandex), 0 8px 28px var(--yandex-g); }
.mp.active[data-mp=wildberries] { border-color: var(--wb); box-shadow: 0 0 0 1px var(--wb), 0 8px 28px var(--wb-g); }
.mp-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.mp-name {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.mp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mp-chk {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.mp[data-mp=uzum] .mp-chk { background: var(--uzum); color: #fff; }
.mp[data-mp=yandex] .mp-chk { background: var(--yandex); color: #000; }
.mp[data-mp=wildberries] .mp-chk { background: var(--wb); color: #fff; }
.mp.active .mp-chk { opacity: 1; }
.mp-specs {
  color: var(--ink2);
  font-size: 11.5px;
  line-height: 1.75;
  position: relative;
  z-index: 1;
}
.mp-specs b { color: var(--ink); font-weight: 600; }
.mp-tags {
  margin-top: 9px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.ftag {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 9.5px;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
  border: 1px solid transparent;
}
.mp[data-mp=uzum] .ftag { background: var(--uzum-d); color: var(--uzum); border-color: rgba(139,92,246,.2); }
.mp[data-mp=yandex] .ftag { background: var(--yandex-d); color: #b8860b; border-color: rgba(245,197,24,.2); }
.mp[data-mp=wildberries] .ftag { background: var(--wb-d); color: var(--wb); border-color: rgba(225,29,116,.2); }

/* ===== DROPZONE ===== */
.dz {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: var(--r);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s;
  padding: 38px 24px;
  text-align: center;
  overflow: hidden;
}
.dz::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--uzum-d), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.dz:hover::before, .dz.drag::before { opacity: 1; }
.dz:hover, .dz.drag { border-color: var(--uzum); }
.dz.drag { background: var(--uzum-d); transform: scale(1.003); }
.dz input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.dz-ico {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--panel2);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
  z-index: 1;
}
.dz:hover .dz-ico, .dz.drag .dz-ico {
  transform: scale(1.1) rotate(-5deg);
  border-color: var(--uzum);
}
.dz-title { font-size: 15px; font-weight: 600; position: relative; z-index: 1; }
.dz-sub { font-size: 12px; color: var(--ink3); position: relative; z-index: 1; }

/* ===== FILE LIST ===== */
.fl-wrap {
  border-radius: var(--r);
  background: var(--panel);
  border: 1.5px solid var(--line);
  overflow: hidden;
  min-height: 160px;
  display: flex;
  flex-direction: column;
}
.fl-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink3);
  gap: 8px;
  padding: 40px;
  font-size: 13px;
}
.fl-empty span { font-size: 34px; opacity: 0.35; }
.fl { list-style: none; overflow-y: auto; max-height: 360px; }
.fl::-webkit-scrollbar { width: 4px; }
.fl::-webkit-scrollbar-track { background: transparent; }
.fl::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.fi {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line2);
  transition: background 0.15s;
  animation: fiIn 0.22s ease both;
}
@keyframes fiIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
.fi:last-child { border-bottom: none; }
.fi:hover { background: var(--panel2); }
.fi-thumb {
  width: 58px;
  height: 58px;
  border-radius: var(--r-sm);
  background: var(--bg2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
  flex-shrink: 0;
}
.fi-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); }
.fi-info { min-width: 0; }
.fi-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fi-meta {
  color: var(--ink3);
  font-size: 11px;
  font-family: 'SF Mono', Monaco, monospace;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fi-sizes {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink2);
  font-size: 11px;
  margin-top: 5px;
  font-family: 'SF Mono', Monaco, monospace;
}
.sz-arr { color: var(--ink3); }
.sz-ok { color: var(--ok); font-weight: 600; }
.prog-track {
  height: 2px;
  border-radius: 2px;
  background: var(--line);
  margin-top: 7px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.35s ease;
  background: linear-gradient(90deg, var(--uzum), var(--wb));
}
.fi-acts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  flex-shrink: 0;
}

/* ===== BADGES ===== */
.bdg {
  font-size: 10px;
  font-family: 'SF Mono', Monaco, monospace;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.bdg-wait { background: var(--panel2); color: var(--ink2); border-color: var(--line); }
.bdg-proc { background: var(--uzum-d); color: var(--uzum); border-color: rgba(139,92,246,.25); }
.bdg-done { background: rgba(52,199,89,.12); color: var(--ok); border-color: rgba(52,199,89,.25); }
.bdg-err { background: rgba(255,59,48,.12); color: var(--err); border-color: rgba(255,59,48,.25); }

/* ===== BUTTONS ===== */
.btn-dl {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--ink2);
  padding: 5px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-dl:hover { background: var(--uzum-d); border-color: var(--uzum); color: var(--uzum); }
.btn-rm {
  background: none;
  border: none;
  color: var(--ink3);
  cursor: pointer;
  font-size: 13px;
  padding: 3px 5px;
  transition: all 0.15s;
  line-height: 1;
  border-radius: 4px;
}
.btn-rm:hover { color: var(--err); background: rgba(255,59,48,.1); }

/* ===== FOOTER ===== */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.f-stats { color: var(--ink3); font-size: 12px; font-family: 'SF Mono', Monaco, monospace; }
.btn-zip {
  position: relative;
  background: var(--panel);
  border: 1.5px solid var(--line);
  color: var(--ink);
  padding: 11px 26px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.2s;
  overflow: hidden;
}
.btn-zip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--uzum), var(--wb));
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-zip:not(:disabled):hover::before { opacity: 1; }
.btn-zip:not(:disabled):hover { border-color: transparent; box-shadow: 0 6px 24px var(--uzum-g); color: white; }
.btn-zip span { position: relative; z-index: 1; }
.btn-zip:disabled { opacity: 0.35; cursor: not-allowed; }

/* ===== MODAL ===== */
.modal-ov {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-ov.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 32px 80px rgba(0,0,0,.15);
}
.modal-ov.show .modal { transform: none; }
.modal-ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--uzum-d);
  border: 1px solid rgba(139,92,246,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.modal p { color: var(--ink2); font-size: 13px; line-height: 1.65; margin-bottom: 18px; }
.modal-track { background: var(--bg2); border-radius: 6px; height: 5px; overflow: hidden; margin-bottom: 10px; }
.modal-fill { height: 100%; background: linear-gradient(90deg, var(--uzum), var(--wb)); border-radius: 6px; transition: width 0.4s ease; }
.modal-st { font-size: 11px; font-family: 'SF Mono', Monaco, monospace; color: var(--ink3); text-align: center; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 22px;
  border-radius: 30px;
  font-size: 13px;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  white-space: nowrap;
  font-weight: 500;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 620px) {
  .container { padding: 16px 14px 32px; gap: 16px; }
  .mps { grid-template-columns: 1fr; gap: 8px; }
  .mp-specs { display: none; }
  .fi { grid-template-columns: 44px 1fr auto; gap: 9px; padding: 10px 12px; }
  .fi-thumb { width: 44px; height: 44px; }
  .fl { max-height: 280px; }
}
