/* ===== Shop — тёмная тема по умолчанию, светлая через кнопку в шапке ===== */

:root {
  --bg: #0a0d14;
  --bg-soft: #0d1322;
  --surface: #121828;
  --card: #151c2e;
  --card-hover: #182136;
  --bubble: #151c2e;
  --border: #1f2a44;
  --border-light: #2a3a5f;
  --accent: #2e7cf6;
  --accent-hover: #4b8ffa;
  --accent-dim: rgba(46, 124, 246, 0.13);
  --text: #e9edf6;
  --muted: #8b94ac;
  --muted-2: #5f6a85;
  --success: #2fbf71;
  --danger: #f04a5e;
  --hover: rgba(255, 255, 255, 0.06);
  --topbar-bg: rgba(10, 13, 20, 0.86);
  --input-bg: #0d1322;
  --scroll-thumb: #24304e;
  --backdrop: rgba(5, 8, 14, 0.72);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.45);
  --st-pending-c: #f5c26b; --st-pending-bg: rgba(245, 166, 35, 0.12);
  --st-checking-c: #7db4ff; --st-checking-bg: rgba(46, 124, 246, 0.14);
  --st-paid-c: #4cd68d; --st-paid-bg: rgba(47, 191, 113, 0.12);
  --st-canceled-c: #98a1b8; --st-canceled-bg: rgba(152, 161, 184, 0.12);
  --hint-c: #b9d4ff;
  --toast-bg: #1a2336;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f3f6fb;
  --surface: #ffffff;
  --card: #f8fafd;
  --card-hover: #eef3fa;
  --bubble: #ffffff;
  --border: #e3e9f2;
  --border-light: #d3dcea;
  --accent: #2e7cf6;
  --accent-hover: #1e6ce6;
  --accent-dim: rgba(46, 124, 246, 0.10);
  --text: #1c2536;
  --muted: #67718a;
  --muted-2: #9aa4bb;
  --success: #1ea35c;
  --danger: #e0344a;
  --hover: rgba(16, 24, 40, 0.05);
  --topbar-bg: rgba(255, 255, 255, 0.88);
  --input-bg: #ffffff;
  --scroll-thumb: #cfd9e8;
  --backdrop: rgba(20, 28, 48, 0.42);
  --shadow-sm: 0 6px 20px rgba(23, 34, 56, 0.07);
  --shadow-lg: 0 20px 60px rgba(23, 34, 56, 0.13);
  --st-pending-c: #a97400; --st-pending-bg: rgba(217, 138, 0, 0.14);
  --st-checking-c: #1e6ce6; --st-checking-bg: rgba(46, 124, 246, 0.13);
  --st-paid-c: #178a51; --st-paid-bg: rgba(30, 163, 92, 0.13);
  --st-canceled-c: #67718a; --st-canceled-bg: rgba(103, 113, 138, 0.13);
  --hint-c: #1c5fca;
  --toast-bg: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.2px; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }

.muted { color: var(--muted); }
.sm { font-size: 12.5px; }
.hidden { display: none !important; }


.link {
  background: none; border: none; color: var(--accent);
  font: inherit; cursor: pointer; padding: 0;
}
.link:hover { color: var(--accent-hover); text-decoration: underline; }

/* ===== Кнопки ===== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 10px; padding: 10px 16px;
  font: 600 14px/1 inherit; color: #fff;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost { background: transparent; border: 1px solid var(--border-light); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-dim); }

.btn-danger { background: transparent; border: 1px solid rgba(224, 52, 74, .45); color: var(--danger); }
.btn-danger:hover { background: rgba(224, 52, 74, .08); }

.btn-text-danger { background: none; border: none; color: var(--muted); font: 500 13px inherit; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.btn-text-danger:hover { color: var(--danger); background: rgba(224, 52, 74, .08); }

.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ===== Шапка (как у Playerok: прилипает сверху при прокрутке) ===== */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.tb-inner { display: flex; align-items: center; gap: 14px; height: 62px; }

.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; flex: 0 0 auto; }
.logo-tile {
  width: 31px; height: 31px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  font-size: 17px; font-weight: 800; letter-spacing: -0.5px;
}
.logo-name { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }

/* поиск */

.search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; max-width: 430px; min-width: 0; height: 38px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 12px;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.search-ico { display: inline-flex; flex: 0 0 auto; color: var(--muted-2); }
.search-ico svg { width: 15px; height: 15px; }
.search input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  color: var(--text); font: 400 14px inherit;
}
.search input::placeholder { color: var(--muted-2); }

.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; }
.nav::-webkit-scrollbar { display: none; }

.nav-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font: 600 13.5px inherit;
  padding: 8px 10px; border-radius: 9px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav-btn svg { width: 16px; height: 16px; }
.nav-btn:hover { color: var(--text); background: var(--hover); }
.nav-btn.active { color: var(--accent); background: var(--accent-dim); }

.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px;
  background: var(--accent); color: #fff;
  border-radius: 999px; font-size: 10.5px; font-weight: 700;
}

.tb-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }

.icon-btn {
  width: 37px; height: 37px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border-light);
  color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.icon-btn svg { width: 17px; height: 17px; }

/* профиль */

.profile { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 9px;
  background: none; border: none; cursor: pointer;
  color: var(--text); font: 600 13.5px inherit;
  padding: 6px 8px; border-radius: 9px;
}
.profile-btn:hover { background: var(--hover); }
.avatar {
  width: 31px; height: 31px; border-radius: 9px;
  background: var(--accent-dim); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.profile-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; min-width: 170px;
  box-shadow: var(--shadow-lg);
}
.profile-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  color: var(--text); font: 500 13.5px inherit;
  padding: 9px 12px; border-radius: 8px;
}
.profile-menu button:hover { background: var(--hover); }
.profile-menu button.danger { color: var(--danger); }

/* ===== Контент ===== */

#main { padding: 26px 16px 60px; }

.page-head { margin-bottom: 20px; }
.page-head p { margin-top: 4px; font-size: 13.5px; }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }

.err-box {
  margin: 40px auto; max-width: 420px; text-align: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
}
.err-box .empty-title { color: var(--danger); }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 70px 20px; text-align: center;
  border: 1px dashed var(--border-light); border-radius: 14px;
  background: var(--bg-soft);
}
.empty svg { width: 34px; height: 34px; color: var(--muted-2); margin-bottom: 4px; }
.empty-title { font-size: 15.5px; font-weight: 700; }
.empty .muted { max-width: 380px; font-size: 13.5px; }
.empty .btn { margin-top: 12px; }

/* ===== Товары ===== */

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.card:hover { border-color: var(--border-light); background: var(--card-hover); box-shadow: var(--shadow-sm); }

.card-media {
  aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.card:hover .card-media img { transform: scale(1.05); }
.tile-big { font-size: 34px; font-weight: 800; color: var(--accent); user-select: none; }

.card-title { font-size: 14.5px; font-weight: 700; line-height: 1.35; cursor: pointer; }
.card-title:hover { color: var(--accent); }
.card-desc {
  color: var(--muted); font-size: 12.5px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; flex: 1;
}
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-size: 16px; font-weight: 800; white-space: nowrap; }

/* ===== Поля ===== */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }

.input {
  width: 100%;
  background: var(--input-bg); border: 1px solid var(--border-light);
  border-radius: 10px; padding: 11px 13px;
  color: var(--text); font: 400 14px inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input::placeholder { color: var(--muted-2); }
textarea.input { resize: vertical; min-height: 70px; }

input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; flex: 0 0 auto; }

.check-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; cursor: pointer; user-select: none; line-height: 1.45; }

.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* ===== Авторизация ===== */

.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(1000px 500px at 50% -10%, var(--accent-dim), transparent 65%),
    var(--bg);
}

.auth-card {
  width: 100%; max-width: 390px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 28px;
  box-shadow: var(--shadow-lg);
}

.auth-logo { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 22px; }
.auth-logo .logo-tile { width: 38px; height: 38px; border-radius: 11px; font-size: 21px; }
.auth-logo span:last-child { font-size: 21px; font-weight: 800; letter-spacing: -0.4px; }

.seg {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 11px;
  margin-bottom: 20px;
}
.seg button {
  flex: 1; padding: 9px; border: none; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--muted); font: 600 13.5px inherit;
  transition: background .15s, color .15s;
}
.seg button.active { background: var(--accent); color: #fff; }
.seg button:not(.active):hover { color: var(--text); }

.auth-note { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--muted-2); }

/* ===== Модальные окна ===== */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: var(--backdrop);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fadeIn .16s ease;
}
.modal {
  width: 100%; max-width: 440px; max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: pop .18s ease;
}
.modal.wide { max-width: min(92vw, 820px); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }

.m-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.m-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 16px; line-height: 1;
  width: 30px; height: 30px; border-radius: 8px;
}
.m-close:hover { color: var(--text); background: var(--hover); }

.co-product {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px; margin-bottom: 16px;
}
.tile {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-dim); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; flex: 0 0 auto;
}
.co-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.co-product .muted { font-size: 12.5px; }
.co-product .price { margin-left: auto; }

.methods { display: flex; flex-direction: column; gap: 9px; }
.method {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border-light); border-radius: 12px;
  padding: 12px 14px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.method:hover { border-color: var(--accent); }
.method.sel { border-color: var(--accent); background: var(--accent-dim); }
.method input { accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.method .m-name { font-weight: 700; font-size: 14px; }
.method .muted { font-size: 12.5px; }
.m-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-dim); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.m-ico svg { width: 17px; height: 17px; }


/* страница товара */

.pp { display: grid; grid-template-columns: 280px 1fr; gap: 22px; }
.pp-media {
  aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden;
  background: var(--bg-soft); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.pp-media img { width: 100%; height: 100%; object-fit: cover; }
.pp-title { font-size: 19px; font-weight: 800; line-height: 1.3; }
.pp-price { font-size: 24px; font-weight: 800; margin: 10px 0; }
.pp-seller {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 11px; padding: 10px 13px; margin: 14px 0;
  font-weight: 700; font-size: 13.5px;
}
.pp-desc-title {
  font-weight: 700; font-size: 11.5px; margin: 18px 0 8px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .4px;
}
.pp-desc { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }

.pimg {
  border: 1px dashed var(--border-light); border-radius: 10px; padding: 10px;
  display: flex; align-items: center; justify-content: center; min-height: 90px;
  background: var(--bg-soft); text-align: center;
}
.pimg img { max-width: 100%; max-height: 150px; border-radius: 8px; }

/* оплата */

.pay-summary { border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px; margin-bottom: 16px; }
.pay-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; font-size: 13.5px; }
.pay-line + .pay-line { border-top: 1px solid var(--border); }
.pay-amount { font-weight: 800; font-size: 15px; }
.pay-amount .muted { font-weight: 500; }

.copy-box { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 13px; margin-bottom: 12px; }
.copy-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code {
  flex: 1; font: 500 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bubble); border: 1px solid var(--border-light); border-radius: 8px;
  padding: 9px 11px; color: var(--text); word-break: break-all;
}
.pay-actions { display: flex; gap: 10px; margin-top: 12px; }
.pay-checking {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--text);
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--accent-dim); border-top-color: var(--accent);
  animation: spin .8s linear infinite; flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pay-actions .btn { flex: 1; text-decoration: none; }
.pay-note { font-size: 12.5px; margin-bottom: 10px; }

.pay-status-box { margin-top: 6px; }
.pay-status-box .btn { margin-top: 6px; }
.pay-ok { text-align: center; padding: 14px 0 4px; }
.pay-ok svg { width: 40px; height: 40px; color: var(--success); margin-bottom: 8px; }
.pay-ok .empty-title { color: var(--success); }

/* ===== Заказы ===== */

.orders { display: flex; flex-direction: column; gap: 10px; }

.order-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 13px; padding: 14px 16px;
  flex-wrap: wrap;
}
.order-main { flex: 1; min-width: 200px; }
.order-title { font-weight: 700; font-size: 14.5px; }
.order-meta { font-size: 12.5px; margin-top: 3px; }
.order-price { font-weight: 800; font-size: 15px; white-space: nowrap; }
.order-actions { display: flex; align-items: center; gap: 8px; }

.status {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.status-pending { color: var(--st-pending-c); background: var(--st-pending-bg); }
.status-checking { color: var(--st-checking-c); background: var(--st-checking-bg); }
.status-paid { color: var(--st-paid-c); background: var(--st-paid-bg); }
.status-canceled { color: var(--st-canceled-c); background: var(--st-canceled-bg); }

/* ===== Чат ===== */

.chat-wrap {
  display: flex; flex-direction: column;
  height: calc(100vh - 220px); min-height: 440px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 17px; border-bottom: 1px solid var(--border);
  background: var(--card);
}
.online-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 8px rgba(30, 163, 92, .55);
  flex: 0 0 auto;
}
.chat-title { font-weight: 700; font-size: 14.5px; }

.chat-msgs {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-soft);
}

.msg { display: flex; flex-direction: column; max-width: 72%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }

.bubble {
  padding: 9px 13px; border-radius: 14px;
  font-size: 14px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.msg.mine .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.msg.theirs .bubble { background: var(--bubble); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg .time { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; padding: 0 4px; }

/* картинка в сообщении */
.bubble-img { cursor: zoom-in; }
.bubble-img img {
  display: block; width: auto; height: auto;
  max-width: min(280px, 72vw); max-height: 280px;
  border-radius: 14px; border: 1px solid var(--border);
  background: var(--bubble);
}
.msg.mine .bubble-img img { border-bottom-right-radius: 5px; }
.msg.theirs .bubble-img img { border-bottom-left-radius: 5px; }
.msg .bubble-img + .bubble { margin-top: 4px; }

/* видео в сообщении */
.bubble-video video {
  display: block;
  max-width: min(300px, 76vw); max-height: 320px;
  border-radius: 14px; border: 1px solid var(--border);
  background: #000;
}
.msg.mine .bubble-video video { border-bottom-right-radius: 5px; }
.msg.theirs .bubble-video video { border-bottom-left-radius: 5px; }
.msg .bubble-video + .bubble { margin-top: 4px; }

/* просмотр картинки на весь экран */
.img-view { text-align: center; cursor: zoom-out; }
.img-view img { max-width: 100%; max-height: calc(100vh - 90px); border-radius: 12px; }

.msg-system {
  align-self: center; text-align: center; max-width: 92%;
  font-size: 12px; color: var(--muted);
  background: var(--bubble); border: 1px solid var(--border);
  padding: 7px 13px; border-radius: 999px;
}

/* поле ввода с прикреплением картинки */

.chat-input, .ac-input {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border);
  align-items: center; background: var(--surface);
}
.chat-input .input, .ac-input .input { flex: 1; border-radius: 12px; }

.attach-btn {
  width: 40px; height: 40px; border-radius: 12px;
  background: transparent; border: 1px solid var(--border-light);
  color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; transition: color .15s, border-color .15s, background .15s;
}
.attach-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.attach-btn svg { width: 18px; height: 18px; }

.btn-send {
  width: 40px; height: 40px; padding: 0;
  border-radius: 12px; flex: 0 0 auto;
}
.btn-send svg { width: 17px; height: 17px; }

.attach-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.attach-preview img {
  width: 42px; height: 42px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border-light);
}
.attach-preview.is-video img { display: none; }
.attach-preview.is-video .attach-name { color: var(--accent); font-weight: 500; }
.attach-name {
  flex: 1; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-remove {
  background: none; border: none; color: var(--muted); cursor: pointer;
  width: 26px; height: 26px; border-radius: 7px; font-size: 13px;
}
.attach-remove:hover { color: var(--danger); background: rgba(224, 52, 74, .1); }

/* ===== Админка ===== */

.admin-seg { margin-bottom: 20px; max-width: 560px; }
.admin-seg button { position: relative; display: inline-flex; align-items: center; gap: 6px; }

.stats {
  display: grid; gap: 13px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 20px;
}
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 13px; padding: 17px 18px;
}
.stat-value { font-size: 23px; font-weight: 800; letter-spacing: -0.4px; margin-top: 6px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 13px; }
.panel.pad { padding: 18px; margin-bottom: 16px; }
.panel.pad h3 { margin-bottom: 14px; }

.hint {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-dim); border: 1px solid rgba(46, 124, 246, .3);
  border-radius: 12px; padding: 13px 15px;
  font-size: 13px; color: var(--hint-c); margin-bottom: 16px;
}
.hint svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }

.hint-warn {
  background: var(--st-pending-bg); border-color: rgba(217, 138, 0, .4);
  color: var(--st-pending-c);
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  background: var(--surface); border: 1px solid var(--border-light); color: var(--muted);
  border-radius: 999px; padding: 6px 13px; cursor: pointer;
  font: 600 12.5px inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .15s, color .15s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { color: var(--accent); background: var(--accent-dim); border-color: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); font-weight: 700;
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--hover); }
.table .actions { display: flex; gap: 7px; justify-content: flex-end; }

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

/* чаты админа — две колонки */

.ac-layout {
  display: grid; grid-template-columns: 290px 1fr; gap: 14px;
  height: calc(100vh - 250px); min-height: 440px;
}
.ac-list { overflow-y: auto; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.ac-item { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--hover); }
.ac-item.active { background: var(--accent-dim); box-shadow: inset 2px 0 0 var(--accent); }
.ac-item-top { display: flex; align-items: center; gap: 8px; }
.ac-nick { font-weight: 700; font-size: 13.5px; flex: 1; }
.ac-preview { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-time { font-size: 11px; color: var(--muted-2); }
.ac-unread {
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--accent); color: #fff; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.ac-main { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); overflow: hidden; }
.ac-placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted-2); }
.ac-placeholder svg { width: 30px; height: 30px; }

.ac-thread-head { padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.ac-thread-head .nick { font-weight: 800; font-size: 14.5px; }

.ac-purchases { border-bottom: 1px solid var(--border); }
.ac-purchases summary {
  cursor: pointer; padding: 9px 16px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); list-style: none; user-select: none;
}
.ac-purchases summary::-webkit-details-marker { display: none; }
.ac-purchases summary:hover { color: var(--text); }
.purchase-rows { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 7px; }
.purchase-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 11px; font-size: 12.5px;
}
.purchase-row .p-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-row .p-price { font-weight: 700; }

.ac-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-soft); }

/* ===== Тосты ===== */

#toasts {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}
.toast {
  background: var(--toast-bg); border: 1px solid var(--border-light);
  border-radius: 11px; padding: 11px 15px;
  font-size: 13.5px; color: var(--text);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateX(12px);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { border-color: rgba(30, 163, 92, .5); }
.toast.error { border-color: rgba(224, 52, 74, .5); }

/* ===== Адаптив ===== */

@media (max-width: 900px) {
  .nav-label { display: none; }
  .search { max-width: none; }
  .pp { grid-template-columns: 1fr; }
  .pp-media { max-width: 300px; width: 100%; margin: 0 auto; }
}

@media (max-width: 860px) {
  .ac-layout { grid-template-columns: 1fr; height: auto; }
  .ac-list { max-height: 260px; }
  .ac-main { min-height: 460px; }
}

@media (max-width: 640px) {
  .tb-inner { gap: 8px; }
  .profile-nick { display: none; }
  .logo-name { display: none; }
  .nav-btn { padding: 8px; }
  .chat-wrap { height: calc(100vh - 240px); }
  .order-row { gap: 10px; }
  .order-price { order: 3; }
  .msg { max-width: 86%; }
  #main { padding: 18px 14px 50px; }
}

/* ---------- Правовые документы / подвал ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 18px 0 28px;
}
.footer-inner {
  display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap;
  font-size: 13px;
}
.footer-inner .muted { margin-right: auto; }

.doc-body { line-height: 1.7; font-size: 14px; }
.doc-body h3 { margin: 24px 0 10px; font-size: 15.5px; letter-spacing: -0.2px; }
.doc-body h3:first-child { margin-top: 0; }
.doc-body p { margin: 8px 0; }
.doc-body ul, .doc-body ol { margin: 8px 0 10px; padding-left: 24px; }
.doc-body li { margin: 5px 0; }

.doc-guest-wrap { max-width: 800px; margin: 0 auto; padding: 20px 16px 56px; }
.doc-guest-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 22px; cursor: default;
}
.auth-note.doc-agree { text-align: left; line-height: 1.55; }
