:root {
  color-scheme: dark;
  --background: #101522;
  --panel: #171f30;
  --panel-soft: #1d273a;
  --text: #f5f7fb;
  --muted: #a1adbf;
  --accent: #70e1c1;
  --border: rgba(215, 228, 250, .1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 70% -20%, #263b51 0, transparent 38%), var(--background);
  color: var(--text);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
.site-header {
  min-height: 76px;
  padding: 0 max(5vw, 22px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 21, 34, .8);
}
.site-nav { display: flex; align-items: center; gap: 14px; font-size: .88rem; font-weight: 700; }
.site-nav a:hover, .auth-switch a { color: var(--accent); }
.site-nav form { margin: 0; }
.nav-button { min-height: 36px; padding: 0 12px; color: var(--text); background: var(--panel-soft); }
.nav-register { padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; }
.brand { font-size: 1.15rem; font-weight: 800; letter-spacing: -.03em; }
.header-note, .muted { color: var(--muted); }
.page { width: min(1200px, 90vw); margin: 0 auto; min-height: calc(100vh - 140px); }
.intro { padding: 64px 0 28px; }
.eyebrow { color: var(--accent); font-size: .73rem; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 8px 0; font-size: clamp(2.2rem, 5vw, 3.7rem); line-height: 1.06; letter-spacing: -.055em; }
.intro > p:last-child { margin-top: 14px; }
.search { display: flex; gap: 10px; margin: 8px 0 30px; }
.search input {
  width: min(520px, 100%); min-height: 48px; padding: 0 15px;
  color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
}
button { cursor: pointer; border: 0; border-radius: 12px; padding: 0 20px; font-weight: 750; color: #10251f; background: var(--accent); }
.notice { margin-top: 20px; padding: 12px 15px; border-radius: 10px; }
.notice-success { color: #b6f5dd; background: rgba(55, 169, 124, .15); }
.notice-error { color: #ffb9b9; background: rgba(235, 84, 84, .14); }
.catalog-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 34px; padding-bottom: 60px; }
.categories { align-self: start; padding: 10px 0; }
.categories h2, .section-heading h2 { font-size: 1rem; margin: 0 0 14px; }
.category-link { display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px; margin: 2px 0; color: var(--muted); border-radius: 9px; font-size: .9rem; }
.category-link span { opacity: .7; }
.category-link:hover, .category-link.active { background: var(--panel-soft); color: var(--text); }
.category-link.active { box-shadow: inset 2px 0 var(--accent); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 16px; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.product-card, .detail-card, .empty {
  background: linear-gradient(145deg, rgba(29,39,58,.92), rgba(22,29,44,.95));
  border: 1px solid var(--border); border-radius: 16px;
}
.product-card { min-height: 265px; padding: 18px; display: flex; flex-direction: column; transition: transform .18s ease, border-color .18s ease; }
.product-card:hover { transform: translateY(-3px); border-color: rgba(112,225,193,.45); }
.product-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--accent); background: rgba(112,225,193,.11); font-weight: 800; }
.product-category { margin: 14px 0 4px; color: var(--muted); font-size: .75rem; }
.product-card h3 { margin: 0; font-size: 1.08rem; }
.description { color: var(--muted); font-size: .88rem; margin: 8px 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.card-bottom strong, .detail-price { font-size: 1.16rem; }
.badge { display: inline-block; padding: 4px 8px; color: var(--accent); border: 1px solid rgba(112,225,193,.22); background: rgba(112,225,193,.08); border-radius: 99px; font-size: .7rem; font-weight: 700; }
.card-action { display: flex; justify-content: space-between; padding-top: 13px; margin-top: 12px; border-top: 1px solid var(--border); font-size: .84rem; font-weight: 700; }
.card-action span { color: var(--accent); }
.empty { padding: 32px; color: var(--muted); }
.empty h3 { color: var(--text); margin-top: 0; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 22px; color: var(--muted); padding: 28px 0; font-size: .9rem; }
.pagination a, .back-link { color: var(--accent); font-weight: 700; }
.back-link { display: inline-block; margin: 36px 0 16px; }
.detail-card { max-width: 760px; padding: clamp(24px, 6vw, 56px); margin: 0 auto 70px; }
.detail-card h1 { margin-bottom: 18px; font-size: clamp(2rem, 5vw, 3.2rem); }
.detail-description { white-space: pre-wrap; color: #c5ceda; margin-top: 25px; }
.detail-price { margin-top: 30px; font-weight: 800; }
.primary-link, .primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 11px; color: #10251f; background: var(--accent); font-weight: 800; }
.primary-link { margin-top: 20px; }
.checkout-panel { margin-top: 30px; padding: 20px; border: 1px solid var(--border); border-radius: 14px; }
.checkout-panel h2, .payment-instructions h2, .delivery-panel h2 { margin: 0 0 12px; font-size: 1.1rem; }
.balance-note { color: var(--muted); font-size: .88rem; }
.crypto-form { display: grid; gap: 10px; margin-top: 20px; }
.crypto-form label { font-size: .88rem; font-weight: 700; }
.crypto-form select { min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: #101725; }
.auth-card, .account-card { width: min(520px, 100%); margin: 54px auto 70px; padding: clamp(24px, 6vw, 42px); background: var(--panel); border: 1px solid var(--border); border-radius: 18px; }
.auth-card h1, .account-card h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: 8px 0; }
.auth-form { display: grid; gap: 10px; margin-top: 26px; }
.auth-form label { margin-top: 7px; font-size: .88rem; font-weight: 700; }
.auth-form input { min-height: 46px; padding: 0 12px; color: var(--text); background: #101725; border: 1px solid var(--border); border-radius: 9px; }
.auth-form input:focus, .search input:focus { outline: 2px solid rgba(112,225,193,.55); outline-offset: 1px; }
.primary-button { margin-top: 10px; }
.field-hint, .setup-note { color: var(--muted); font-size: .8rem; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 25px 0; color: var(--muted); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.telegram-widget { min-height: 42px; display: flex; justify-content: center; }
.auth-switch { margin-top: 24px; font-size: .88rem; color: var(--muted); }
.auth-switch a { font-weight: 700; }
.account-row { display: flex; justify-content: space-between; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.account-row span, .account-note { color: var(--muted); }
.account-row strong { text-align: right; overflow-wrap: anywhere; }
.link-panel { margin-top: 24px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; }
.link-panel h2 { margin: 0; font-size: 1.1rem; }
.link-panel p { color: var(--muted); font-size: .88rem; }
.account-note { margin-top: 24px; font-size: .82rem; }
.orders-page { padding: 50px 0 70px; }
.orders-page > h1 { margin-bottom: 24px; font-size: clamp(2rem, 5vw, 3rem); }
.order-list, .order-detail-card { border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.order-row { display: flex; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.order-row:last-child { border-bottom: 0; }
.order-row:hover { background: var(--panel-soft); }
.order-row span:first-child { display: grid; gap: 5px; }
.order-row small { color: var(--muted); font-size: .78rem; }
.order-meta { text-align: right; display: grid; justify-items: end; gap: 5px; }
.admin-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.admin-stats > div { display: grid; gap: 4px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.admin-stats span { color: var(--muted); font-size: .82rem; }
.admin-stats strong { font-size: 1.4rem; }
.admin-table-head, .admin-order-row { display: grid; grid-template-columns: 1.5fr 1.4fr .8fr .55fr; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.admin-table-head { color: var(--muted); font-size: .77rem; font-weight: 750; }
.admin-order-row:last-child { border-bottom: 0; }
.admin-order-row > span { min-width: 0; overflow-wrap: anywhere; }
.admin-order-row small { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.status { font-size: .8rem; font-weight: 750; }
.status-paid { color: var(--accent); }
.status-waiting { color: #f0c879; }
.status-failed, .status-review { color: #ff9a9a; }
.order-detail-card { max-width: 760px; padding: clamp(22px, 5vw, 40px); margin: 0 auto; }
.payment-instructions, .delivery-panel { margin-top: 26px; padding: 20px; border-radius: 12px; background: #101725; }
.payment-instructions p, .delivery-panel p { color: var(--muted); font-size: .9rem; }
.payment-value { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border); }
.payment-value span { color: var(--muted); font-size: .8rem; }
.payment-value code, .delivered-value { overflow-wrap: anywhere; color: var(--accent); font-size: .9rem; }
.delivered-value { display: block; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.site-footer { color: var(--muted); border-top: 1px solid var(--border); padding: 22px 5vw; text-align: center; font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .header-note { display: none; }
  .site-header { padding: 0 5vw; }
  .site-nav { gap: 9px; font-size: .8rem; }
  .intro { padding-top: 44px; }
  .catalog-layout { grid-template-columns: 1fr; gap: 20px; }
  .categories { display: flex; overflow-x: auto; gap: 6px; padding: 0 0 10px; }
  .categories h2 { display: none; }
  .category-link { white-space: nowrap; border: 1px solid var(--border); }
  .category-link.active { box-shadow: inset 0 -2px var(--accent); }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { min-height: 230px; }
  .admin-table-head { display: none; }
  .admin-order-row { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
}
