/* ============ Kairalmas Scripts — Design System ============ */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --green: #16a34a;
  --green-50: #f0fdf4;
  --amber: #b45309;
  --amber-50: #fffbeb;
  --red: #dc2626;
  --red-50: #fef2f2;
  --purple: #7c3aed;
  --purple-50: #f5f3ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(37, 99, 235, .12), 0 4px 10px rgba(15, 23, 42, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
code { background: var(--primary-50); color: var(--primary-dark); padding: 2px 6px; border-radius: 6px; font-size: .85em; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.pt-0 { padding-top: 0; }
.muted { color: var(--muted); font-weight: 400; }
.center { text-align: center; }
.text-primary { color: var(--primary); }
.link-more { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.link { color: var(--primary); font-weight: 500; }

/* ============ Announcement & Header ============ */
.announcement {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: .88rem;
  font-weight: 500;
}
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; flex-shrink: 0;
}
.brand-mark svg { width: 20px; height: 20px; }
.main-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link {
  padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 500; font-size: .95rem;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--primary-50); color: var(--primary-dark); }
.nav-link.active { color: var(--primary-dark); font-weight: 600; }
.nav-actions { display: flex; gap: 8px; margin-left: 10px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; cursor: pointer; color: var(--ink); align-items: center; justify-content: center; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .95rem; border: 1px solid transparent;
  cursor: pointer; transition: all .15s ease; text-align: center; white-space: nowrap;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .3); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37, 99, 235, .35); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-red { background: var(--red-50); color: var(--red); border-color: #fecaca; }
.btn-red:hover { background: var(--red); color: #fff; }
.btn-green { background: var(--green-50); color: var(--green); border-color: #bbf7d0; }
.btn-green:hover { background: var(--green); color: #fff; }
.btn-white { background: #fff; color: var(--primary-dark); }
.btn-white:hover { background: var(--primary-50); }
.btn-sm { padding: 7px 13px; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-50) 100%);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 56px;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--primary-200);
  color: var(--primary-dark); font-weight: 600; font-size: .85rem;
  padding: 7px 16px; border-radius: 999px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.hero-sub { color: var(--muted); font-size: 1.1rem; margin: 18px 0 28px; max-width: 540px; }
.hero-search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 8px 8px 20px; box-shadow: var(--shadow-md); max-width: 560px;
}
.hero-search svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.hero-search input { flex: 1; border: none; outline: none; font-size: .98rem; font-family: inherit; background: transparent; min-width: 0; }
.hero-stats { display: flex; gap: 44px; margin-top: 34px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.hero-stats span { color: var(--muted); font-size: .88rem; }
.hero-art { position: relative; }
.hero-art-frame {
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid var(--primary-100); background: #fff;
}
.hero-art-frame img { width: 100%; height: 320px; object-fit: cover; }
.hero-float-card {
  position: absolute; display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 14px; padding: 12px 18px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.hero-float-card strong { display: block; font-size: .92rem; }
.hero-float-card small { color: var(--muted); font-size: .78rem; }
.hero-float-1 { top: -18px; left: -26px; }
.hero-float-2 { bottom: -18px; right: -14px; }
.float-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.float-icon svg { width: 20px; height: 20px; }
.float-icon.green { background: var(--green-50); color: var(--green); }
.float-icon.blue { background: var(--primary-50); color: var(--primary); }

/* ============ Sections ============ */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; gap: 16px; }
.section-head h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; }
.center-title { text-align: center; font-size: 1.8rem; font-weight: 800; margin-bottom: 34px; }
.page-head {
  background: linear-gradient(180deg, #fff, var(--primary-50));
  border-bottom: 1px solid var(--line);
  padding: 34px 0 30px;
}
.page-head .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; }
.page-head p { color: var(--muted); margin-top: 4px; }

/* ============ Category chips ============ */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.category-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; transition: all .18s ease;
}
.category-chip:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.category-name { font-weight: 600; color: var(--ink); }
.category-count { font-size: .8rem; color: var(--muted); background: var(--primary-50); padding: 3px 10px; border-radius: 999px; }

/* ============ Script cards ============ */
.script-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.script-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: all .2s ease; display: flex; flex-direction: column;
  color: var(--ink);
}
.script-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-200); }
.card-img { position: relative; aspect-ratio: 16/9; background: var(--primary-50); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.script-card:hover .card-img img { transform: scale(1.05); }
.card-img-placeholder, .detail-img-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--primary-200); background: linear-gradient(135deg, var(--primary-50), #f8fafc);
}
.card-img-placeholder svg { width: 48px; height: 48px; }
.card-price {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(255, 255, 255, .95); color: var(--primary-dark);
  font-weight: 700; font-size: .85rem; padding: 5px 12px; border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.card-price.free { background: var(--green); color: #fff; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 1.02rem; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-desc { color: var(--muted); font-size: .87rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.chip { background: var(--primary-50); color: var(--primary-dark); font-size: .76rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; }
.card-stats { display: flex; gap: 12px; color: var(--muted); font-size: .8rem; font-weight: 500; }
.card-stats span { display: inline-flex; align-items: center; gap: 4px; }
.card-stats svg { width: 14px; height: 14px; }

/* ============ How it works ============ */
.how-it-works { background: linear-gradient(180deg, var(--primary-50), #fff); }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; position: relative; box-shadow: var(--shadow-sm);
}
.step-num {
  width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 1.15rem; margin-bottom: 16px;
}
.step-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: .92rem; }
.sell-cta {
  margin-top: 40px; background: linear-gradient(120deg, #1d4ed8, #3b82f6);
  border-radius: 20px; padding: 36px 40px; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.sell-cta h3 { font-size: 1.45rem; margin-bottom: 6px; }
.sell-cta p { opacity: .92; max-width: 520px; }

/* ============ Forms ============ */
.field { margin-bottom: 18px; }
.label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 7px; }
.input {
  width: 100%; padding: 11px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .95rem; font-family: inherit; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.select-auto { width: auto; }
.file-input { padding: 9px; cursor: pointer; }
.file-input::-webkit-file-upload-button {
  background: var(--primary-50); color: var(--primary-dark); border: none; border-radius: 7px;
  padding: 7px 14px; font-weight: 600; margin-right: 10px; cursor: pointer; font-family: inherit;
}
.file-preview { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.file-preview img { width: 110px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack-form { display: flex; flex-direction: column; gap: 4px; }
.card-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow-sm);
}
.max-w { max-width: 900px; }

/* ============ Alerts / toasts ============ */
.alert { padding: 13px 17px; border-radius: var(--radius-sm); font-size: .92rem; margin-bottom: 18px; font-weight: 500; }
.alert-error { background: var(--red-50); color: var(--red); border: 1px solid #fecaca; }
.alert-success { background: var(--green-50); color: var(--green); border: 1px solid #bbf7d0; }
.alert-info { background: var(--primary-50); color: var(--primary-dark); border: 1px solid var(--primary-200); }
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 999;
  padding: 14px 44px 14px 18px; border-radius: 12px; color: #fff;
  font-weight: 500; font-size: .92rem; box-shadow: var(--shadow-lg);
  max-width: 380px; animation: toastIn .25s ease;
}
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: var(--primary); }
.toast-close { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; opacity: .8; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============ Auth ============ */
.auth-wrap { display: flex; justify-content: center; padding: 64px 20px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 36px; box-shadow: var(--shadow-md); }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .brand-mark { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 14px; }
.auth-head .brand-mark svg { width: 26px; height: 26px; }
.auth-head h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.auth-head p { color: var(--muted); font-size: .93rem; }
.auth-alt { text-align: center; margin-top: 22px; color: var(--muted); font-size: .92rem; }

/* ============ Browse ============ */
.browse-layout { display: grid; grid-template-columns: 230px 1fr; gap: 32px; align-items: start; }
.browse-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 4px; }
.browse-side h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.side-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 13px; border-radius: var(--radius-sm); color: var(--ink);
  font-weight: 500; font-size: .93rem; transition: all .13s;
}
.side-link:hover { background: var(--primary-50); }
.side-link.active { background: var(--primary); color: #fff; }
.side-link.active .side-count { background: rgba(255,255,255,.2); color: #fff; }
.side-count { background: var(--primary-50); color: var(--primary-dark); font-size: .75rem; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.browse-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.browse-filters .input { width: auto; flex: 1; min-width: 170px; }
.checkbox-label { display: flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 500; white-space: nowrap; cursor: pointer; }
.checkbox-label input { accent-color: var(--primary); width: 16px; height: 16px; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.page-link {
  min-width: 38px; height: 38px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; color: var(--ink);
  transition: all .13s;
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============ Detail ============ */
.detail-page { padding: 28px 20px 56px; max-width: 1200px; }
.breadcrumb { font-size: .86rem; color: var(--muted); margin-bottom: 22px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 34px; align-items: start; }
.detail-image { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); position: relative; background: var(--primary-50); }
.detail-image img { width: 100%; max-height: 460px; object-fit: cover; }
.detail-img-placeholder { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; color: var(--primary-200); }
.detail-img-placeholder svg { width: 90px; height: 90px; }
.detail-status-badge {
  position: absolute; top: 14px; left: 14px; background: var(--amber); color: #fff;
  padding: 5px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700;
}
.detail-description { margin-top: 30px; }
.detail-description h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 14px; }
.desc-text { color: #334155; white-space: pre-line; line-height: 1.75; }
.detail-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.detail-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 88px; }
.detail-price { margin-bottom: 16px; }
.free-badge { background: var(--green); color: #fff; font-weight: 800; padding: 8px 18px; border-radius: 10px; font-size: 1.1rem; }
.price-big { font-size: 2rem; font-weight: 800; color: var(--primary-dark); }
.detail-meta { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 11px; }
.detail-meta > div { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.meta-label { color: var(--muted); }
.meta-value { font-weight: 600; text-align: right; }
.detail-payment-info { border-color: var(--amber); background: var(--amber-50); }
.detail-payment-info h3 { font-size: 1.05rem; margin-bottom: 8px; }
.detail-payment-info p { font-size: .9rem; margin-bottom: 14px; }
.related-section { margin-top: 52px; }
.related-section h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; }

/* ============ Buy page ============ */
.buy-card { margin-bottom: 22px; }
.buy-card h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 16px; }
.script-summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--primary-50); border: 1px solid var(--primary-200);
  padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 18px;
}
.script-summary strong { color: var(--primary-dark); font-size: 1.15rem; }
.payment-instructions p { color: var(--muted); margin-bottom: 12px; }
.pm-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 17px; margin-bottom: 12px; background: #fff; }
.pm-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.pm-details { font-size: .93rem; color: #334155; }
.pm-note { margin-top: 8px; font-size: .85rem; color: var(--amber); background: var(--amber-50); border-radius: 8px; padding: 7px 11px; }
.copy-btn { background: var(--primary-50); border: 1px solid var(--primary-200); color: var(--primary-dark); border-radius: 8px; padding: 5px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.copy-btn:hover { background: var(--primary); color: #fff; }
.order-summary { display: flex; flex-direction: column; gap: 10px; }
.order-summary div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 10px; font-size: .93rem; }
.order-summary span { color: var(--muted); }
.buy-card.paid { border-color: #bbf7d0; }
.buy-card.rejected { border-color: #fecaca; }

/* ============ Tables ============ */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .9rem; }
.table th {
  text-align: left; padding: 12px 15px; background: var(--primary-50); color: var(--primary-dark);
  font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.table td { padding: 12px 15px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: #f8fafc; }
.actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline-flex; gap: 7px; align-items: center; margin: 0; }
.tip { cursor: help; color: var(--amber); font-weight: 700; }

/* ============ Badges ============ */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.blue { background: var(--primary-50); color: var(--primary-dark); }
.badge.purple { background: var(--purple-50); color: var(--purple); }
.badge.gray { background: #f1f5f9; color: var(--muted); }

/* ============ Dashboard ============ */
.dashboard-layout { display: grid; grid-template-columns: 250px 1fr; gap: 30px; align-items: start; padding: 30px 20px 60px; }
.dashboard-side { position: sticky; top: 88px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.dash-user { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.dash-user small { display: block; color: var(--muted); font-size: .78rem; }
.dash-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem;
}
.dash-nav { display: flex; flex-direction: column; gap: 3px; }
.dash-nav a {
  padding: 10px 13px; border-radius: var(--radius-sm); color: var(--ink);
  font-weight: 500; font-size: .93rem; transition: all .13s;
}
.dash-nav a:hover { background: var(--primary-50); color: var(--primary-dark); }
.dash-nav a.active { background: var(--primary); color: #fff; }
.dash-nav .dash-admin-link { color: var(--purple); font-weight: 600; }
.dash-divider { border: none; border-top: 1px solid var(--line); margin: 10px 0; }
.dashboard-main { min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 30px; }
.stat-grid.four { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.stat-icon svg { width: 21px; height: 21px; }
.stat-icon.blue { background: var(--primary-50); color: var(--primary); }
.stat-icon.green { background: var(--green-50); color: var(--green); }
.stat-icon.purple { background: var(--purple-50); color: var(--purple); }
.stat-num { font-size: 1.65rem; font-weight: 800; line-height: 1.2; }
.stat-label { color: var(--muted); font-size: .87rem; font-weight: 500; }
.stat-sub { color: var(--amber); font-size: .8rem; font-weight: 600; margin-top: 4px; }
.dash-section { margin-bottom: 30px; }
.section-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }
.dash-section .table { font-size: .86rem; }

/* ============ Admin ============ */
.admin-layout { display: grid; grid-template-columns: 235px 1fr; min-height: 70vh; }
.admin-side {
  background: #0f172a; color: #cbd5e1; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 18px; position: sticky; top: 68px; height: calc(100vh - 68px);
}
.admin-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.05rem; padding: 0 6px; }
.admin-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.admin-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px;
  border-radius: var(--radius-sm); color: #cbd5e1; font-weight: 500; font-size: .92rem; transition: all .13s;
}
.admin-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: var(--primary); color: #fff; }
.admin-foot { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; }
.admin-foot .btn-ghost { background: transparent; color: #cbd5e1; border-color: rgba(255,255,255,.2); }
.admin-main { padding: 28px 30px 60px; min-width: 0; background: #f8fafc; min-height: calc(100vh - 68px); }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-head h1 { font-size: 1.5rem; font-weight: 800; }
.admin-tabs { display: flex; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.admin-tabs .tab { padding: 7px 15px; border-radius: 8px; font-weight: 600; font-size: .86rem; color: var(--muted); transition: all .13s; }
.admin-tabs .tab:hover { color: var(--primary); }
.admin-tabs .tab.active { background: var(--primary); color: #fff; }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.admin-col { min-width: 0; }
.admin-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.admin-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px;
}
.admin-list small { display: block; color: var(--muted); font-size: .8rem; }
.admin-search { display: flex; gap: 8px; }
.reject-box { display: inline-flex; gap: 6px; }
.pm-row { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 14px; background: #fff; }
.pm-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* ============ Empty / 404 ============ */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }
.page-404 { padding: 90px 20px; }
.code-404 { font-size: 5rem; font-weight: 800; color: var(--primary-100); line-height: 1; margin-bottom: 10px; }

/* ============ Footer ============ */
.site-footer { background: #0f172a; color: #94a3b8; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; padding: 52px 20px 40px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: 14px; }
.footer-about { font-size: .9rem; max-width: 300px; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: .9rem; margin-bottom: 16px; text-transform: uppercase; letter-spacing: .06em; }
.footer-col a { display: block; color: #94a3b8; font-size: .92rem; padding: 5px 0; transition: color .13s; }
.footer-col a:hover { color: #fff; }
.footer-col p { font-size: .9rem; line-height: 1.7; }
.footer-muted { opacity: .75; font-size: .85rem !important; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.09); }
.footer-bottom-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px; font-size: .85rem; }

/* ============ Table scroll (mobile) ============ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table-scroll .table { min-width: 780px; }

/* ============ Fee / earnings helpers ============ */
.fee-note { font-size: .85rem; color: var(--muted); margin: 0 0 16px; }
.earnings-line strong { font-size: 1.2rem; }
.earnings-line .muted { font-size: .9rem; }

/* ============ Mobile buy bar (script detail) ============ */
.mobile-buy-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  align-items: center; justify-content: space-between; gap: 14px;
  box-shadow: 0 -4px 20px rgba(15,23,42,.08);
}
.mobile-buy-bar .mb-price { display: block; font-weight: 800; font-size: 1.15rem; color: var(--primary-dark); }
.mobile-buy-bar .mb-price.free { color: var(--green); }
.mobile-buy-bar small { color: var(--muted); font-size: .78rem; }
.mobile-buy-bar .btn { flex-shrink: 0; min-width: 140px; }

/* ============ Floating support widget ============ */
.support-fab { position: fixed; right: 16px; bottom: 16px; z-index: 9999; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.support-actions { display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: all .22s ease; }
.support-fab.open .support-actions { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.support-btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 12px 18px;
  border-radius: 999px; color: #fff; font-weight: 600; font-size: .9rem;
  box-shadow: 0 8px 22px rgba(15,23,42,.22); text-decoration: none; animation: supportIn .25s ease;
}
.support-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.support-btn.whatsapp { background: #25d366; }
.support-btn.whatsapp:hover { background: #1eb856; }
.support-btn.telegram { background: #229ed9; }
.support-btn.telegram:hover { background: #1a8ac0; }
@keyframes supportIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.support-fab-btn {
  position: relative; width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #25d366, #128c7e); color: #fff;
  box-shadow: 0 8px 26px rgba(18,140,126,.45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease;
}
.support-fab-btn:hover { transform: scale(1.07); }
.support-fab-btn svg { width: 28px; height: 28px; }
.support-fab-btn .fab-close { display: none; }
.support-fab.open .support-fab-btn { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 8px 26px rgba(220,38,38,.4); }
.support-fab.open .support-fab-btn .fab-chat { display: none; }
.support-fab.open .support-fab-btn .fab-close { display: block; }
.support-fab-btn.pulse::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 3px solid rgba(37,211,102,.55); animation: fabPulse 2s infinite;
}
.support-fab.open .support-fab-btn.pulse::before { display: none; }
@keyframes fabPulse { 0% { transform: scale(.85); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-art { max-width: 560px; margin: 0 auto; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px 18px; gap: 12px; }
  .admin-brand { margin-right: 6px; }
  .admin-brand .brand-mark { width: 32px; height: 32px; }
  .admin-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .admin-nav a { white-space: nowrap; padding: 9px 13px; }
  .admin-nav a svg { display: none; }
  .admin-foot { border: none; padding: 0; }
  .admin-foot .btn { padding: 7px 12px; font-size: .8rem; }
  .admin-main { min-height: 0; }
  .browse-layout { grid-template-columns: 1fr; }
  .browse-side { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .browse-side h3 { width: 100%; margin-bottom: 0; }
  .admin-cols { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .header-inner { height: 62px; }
  .brand-text { font-size: 1rem; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 20px 22px; gap: 2px;
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; animation: navSlide .22s ease; }
  @keyframes navSlide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
  .nav-link { padding: 13px 10px; font-size: 1rem; }
  .nav-actions { margin: 12px 0 0; gap: 10px; }
  .nav-actions .btn { flex: 1; min-height: 46px; }

  /* Touch-friendly controls */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .input, .textarea { min-height: 46px; font-size: 1rem; }
  .file-input { min-height: 48px; }

  .hero { padding: 30px 0 36px; }
  .hero h1 { font-size: 1.85rem; }
  .hero-sub { font-size: .98rem; margin: 12px 0 20px; }
  .hero-stats { gap: 24px; margin-top: 22px; }
  .hero-stats strong { font-size: 1.3rem; }
  .hero-art-frame img { height: 220px; }
  .hero-float-card { display: none; }
  .hero-search { border-radius: 14px; padding: 8px; flex-wrap: wrap; }
  .hero-search input { flex: 1 1 100%; padding: 6px 6px 10px; font-size: .95rem; }
  .hero-search .btn { width: 100%; min-height: 46px; }

  /* Category chips scroll horizontally */
  .category-grid { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 10px; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
  .category-chip { min-width: 172px; flex-shrink: 0; }

  .steps-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-side { position: static; }
  .dash-nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .dash-nav a { white-space: nowrap; }
  .section { padding: 38px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .table { font-size: .85rem; }
  .table-scroll { margin: 0 -4px; padding: 0 4px; }
  .browse-filters .input { flex: 1 1 100%; }
  .card-form { padding: 22px; }
  .sell-cta { padding: 26px 22px; }
  .auth-wrap { padding: 40px 16px; }
  .auth-card { padding: 28px 22px; }
  .detail-page { padding: 20px 14px 90px; }
  .section-head h2 { font-size: 1.25rem; }
  .page-head { padding: 26px 0 24px; }
  .page-head h1 { font-size: 1.55rem; }
  .mobile-buy-bar { display: flex; }
}

@media (max-width: 520px) {
  .script-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 11px 12px 13px; }
  .card-title { font-size: .86rem; line-height: 1.3; }
  .card-desc { display: none; }
  .card-meta .chip { display: none; }
  .card-meta { margin-top: 2px; }
  .card-stats { gap: 10px; font-size: .72rem; }
  .card-stats svg { width: 12px; height: 12px; }
  .card-price { font-size: .74rem; padding: 4px 9px; bottom: 8px; left: 8px; }
  .card-img-placeholder svg { width: 34px; height: 34px; }
  .admin-main { padding: 18px 12px 46px; }
  .admin-head { flex-direction: column; align-items: stretch; }
  .admin-tabs { flex-wrap: wrap; }
  .admin-search { width: 100%; }
  .admin-search .input { width: 100% !important; }
  .footer-bottom-inner { justify-content: center; text-align: center; }
  .support-fab { right: 12px; bottom: 12px; }
  .support-fab-btn { width: 54px; height: 54px; }
  .pm-row { padding: 13px; }
  .detail-price .price-big { font-size: 1.7rem; }
}
