/* Ukir Cerita — mobile-first */
:root {
  --brand: #13505f;
  --brand-2: #1d6a7c;
  --brand-3: #0c3a46;
  --soft: #d3dee1;
  --soft-2: #eaf1f3;
  --bg: #f6f9fa;
  --card: #ffffff;
  --ink: #1d2a2f;
  --ink-2: #566870;
  --line: #dbe5e8;
  --gold: #d9a441;
  --gold-ink: #6b4a05;
  --ok: #17803d;
  --ok-bg: #e4f6ea;
  --warn: #9a5b00;
  --warn-bg: #fff2d9;
  --bad: #b3261e;
  --bad-bg: #fde8e6;
  --wa: #1fa855;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(19, 80, 95, 0.12);
  --shadow-sm: 0 2px 8px rgba(19, 80, 95, 0.1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.55; -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-2); }
button { font-family: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 .6em; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); font-weight: 800; font-size: 18px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 800;
}
.menu-btn {
  border: 1px solid var(--line); background: #fff; color: var(--brand); height: 40px; padding: 0 14px;
  border-radius: 12px; font-weight: 700; font-size: 13px; letter-spacing: .06em; cursor: pointer;
}
.nav { display: none; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { background: var(--soft-2); }
.menu-sheet { border: 0; padding: 0; width: 100%; max-width: 100%; margin: 0; background: transparent; }
.menu-sheet::backdrop { background: rgba(10, 30, 36, .5); }
.menu-panel {
  position: fixed; left: 0; right: 0; top: 0; background: #fff; padding: 12px 16px 20px;
  border-radius: 0 0 22px 22px; box-shadow: var(--shadow);
}
.menu-panel a { display: block; padding: 14px 8px; font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.menu-panel a:last-of-type { border-bottom: 0; }
.menu-panel .close { float: right; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 14px; border: 0; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
  background: var(--brand); color: #fff; transition: transform .08s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--brand-2); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.btn.ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.ghost:hover { background: var(--soft-2); }
.btn.soft { background: var(--soft-2); color: var(--brand); }
.btn.soft:hover { background: var(--soft); }
.btn.wa { background: var(--wa); }
.btn.wa:hover { background: #178f48; }
.btn.gold { background: var(--gold); color: #3a2a00; }
.btn.gold:hover { background: #c8942f; }
.btn.danger { background: var(--bad); }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 400px at 80% -10%, rgba(255, 255, 255, .16), transparent 60%),
    linear-gradient(160deg, var(--brand-3), var(--brand) 55%, var(--brand-2));
  color: #fff; padding: 34px 0 54px; position: relative; overflow: hidden;
}
.hero .eyebrow {
  display: inline-block; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; margin-bottom: 14px;
}
.hero h1 { font-size: 32px; font-weight: 800; }
.hero h1 span { color: #ffd98a; }
.hero p.lead { margin: 12px 0 22px; color: #d7e8ec; font-size: 15.5px; max-width: 520px; }
.hero .cta { display: grid; gap: 10px; max-width: 420px; }
.hero .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.trust { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 22px; font-size: 13px; color: #cfe3e8; }
.trust span::before { content: '✓ '; color: #ffd98a; font-weight: 800; }

/* ---------- Sections ---------- */
section { padding: 34px 0; }
.sec-head { margin-bottom: 18px; }
.sec-head h2 { font-size: 23px; font-weight: 800; color: var(--brand-3); }
.sec-head p { color: var(--ink-2); margin-top: 6px; }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; font-size: 13px; font-weight: 600;
  display: flex; gap: 8px; align-items: flex-start;
}
.feat::before { content: '✦'; color: var(--gold); }

/* Promo affiliate */
.promo {
  background: linear-gradient(135deg, #fff7e2, #ffe9b3); border: 1px solid #f0d58a; border-radius: 22px; padding: 22px 18px;
  display: grid; gap: 14px;
}
.promo h2 { font-size: 21px; color: #4a3300; }
.promo ul { margin: 0; padding-left: 18px; color: #5a4300; }
.promo li { margin: 4px 0; }

/* ---------- Catalog ---------- */
.filters {
  position: sticky; top: 58px; z-index: 20; background: var(--bg); padding: 10px 0 8px; margin: 0 -16px;
  border-bottom: 1px solid var(--line);
}
.filters > * { padding-left: 16px; padding-right: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1.5px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 99px;
  font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed='true'] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tools { display: flex; gap: 8px; margin-top: 6px; }
.field, select.field, input.field {
  width: 100%; min-height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit;
  font-size: 16px; background: #fff; color: var(--ink);
}
textarea.field { padding: 10px 14px; min-height: 90px; }
.field:focus { outline: 3px solid rgba(29, 106, 124, .25); border-color: var(--brand-2); }
.tools select { flex: 0 0 46%; }
.count { font-size: 12.5px; color: var(--ink-2); margin: 12px 0 10px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.card .pic { position: relative; aspect-ratio: 3 / 4; background: linear-gradient(135deg, var(--soft), var(--soft-2)); }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.card .pic .ph {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 10px; color: var(--brand);
  font-weight: 800; font-size: 14px;
}
.card .pic.broken .ph { display: grid; }
.card .pic.broken img { display: none; }
.badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.badge { font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--gold); color: #3a2a00; }
.badge.new { background: #fff; color: var(--brand); }
.badge.tf { background: rgba(19, 80, 95, .88); color: #fff; }
.card .body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 13.5px; font-weight: 700; min-height: 2.4em; }
.card .price { font-weight: 800; color: var(--brand); font-size: 15px; }
.card .price small { color: var(--ink-2); font-weight: 500; font-size: 11px; }
.card .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: auto; }
.card .acts .btn { min-height: 38px; padding: 0 6px; font-size: 12.5px; border-radius: 10px; }
.more { margin: 22px auto 0; display: flex; }
.empty { text-align: center; padding: 40px 10px; color: var(--ink-2); }

/* Price table */
.ptable { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.ptable th, .ptable td { padding: 11px 12px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.ptable th { background: var(--brand); color: #fff; font-size: 12.5px; }
.ptable td:last-child, .ptable th:last-child { text-align: right; font-weight: 800; color: var(--brand); }
.ptable th:last-child { color: #fff; }
.ptable tr:last-child td { border-bottom: 0; }

/* Steps */
.steps { counter-reset: s; display: grid; gap: 10px; padding: 0; list-style: none; margin: 0; }
.steps li {
  counter-increment: s; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 12px 56px; position: relative; font-weight: 600;
}
.steps li::before {
  content: counter(s); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800;
}
.steps li span { display: block; font-weight: 400; color: var(--ink-2); font-size: 13px; }

footer { background: var(--brand-3); color: #b9d2d8; padding: 28px 0 90px; font-size: 13.5px; }
footer a { color: #fff; }
footer .brand { color: #fff; }

.fab {
  position: fixed; right: 14px; bottom: 14px; z-index: 25; background: var(--wa); color: #fff; border-radius: 99px; padding: 0 18px;
  height: 50px; display: flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
}

/* ---------- Sheet (dialog) ---------- */
dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 100%; margin: auto 0 0; background: transparent; max-height: 100dvh; }
dialog.sheet::backdrop { background: rgba(10, 30, 36, .55); }
.sheet-in {
  background: #fff; border-radius: 24px 24px 0 0; padding: 8px 18px 22px; max-height: 92dvh; overflow-y: auto; width: 100%; max-width: 560px; margin: 0 auto;
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.grab { width: 44px; height: 5px; border-radius: 9px; background: var(--soft); margin: 4px auto 12px; }
.sheet-in h2 { font-size: 20px; color: var(--brand-3); }
.sheet-theme { display: flex; gap: 12px; align-items: center; background: var(--soft-2); border-radius: 14px; padding: 10px; margin: 12px 0 14px; }
.sheet-theme img { width: 56px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.sheet-theme b { display: block; }
.fld { display: grid; gap: 6px; margin-bottom: 12px; }
.fld label { font-weight: 700; font-size: 13px; }
.fld .hint { font-size: 12px; color: var(--ink-2); }
.codebox { display: flex; gap: 8px; }
.codebox .field { text-transform: uppercase; }
.codemsg { font-size: 12.5px; font-weight: 700; min-height: 1.2em; }
.codemsg.ok { color: var(--ok); }
.codemsg.bad { color: var(--bad); }
.sum { background: var(--soft-2); border-radius: 14px; padding: 12px 14px; margin: 6px 0 14px; display: grid; gap: 6px; }
.sum .row { display: flex; justify-content: space-between; font-size: 14px; }
.sum .row.total { font-size: 17px; font-weight: 800; color: var(--brand-3); border-top: 1px dashed #aac0c6; padding-top: 8px; margin-top: 2px; }
.sum .row.disc { color: var(--ok); font-weight: 700; }
.pm { display: grid; gap: 8px; }
.pm label {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; font-weight: 600; font-size: 14px; cursor: pointer;
}
.pm label:has(input:checked) { border-color: var(--brand); background: var(--soft-2); }
.pm .g { font-size: 11px; color: var(--ink-2); font-weight: 500; margin-left: auto; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 13.5px; margin-bottom: 12px; }
.note { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.okbox { background: var(--ok-bg); color: var(--ok); border-radius: 12px; padding: 10px 12px; font-weight: 600; margin-bottom: 12px; }

/* ---------- Pages (status, affiliate, dashboard, admin) ---------- */
.page { padding: 22px 0 80px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.panel h1 { font-size: 22px; color: var(--brand-3); }
.panel h2 { font-size: 17px; color: var(--brand-3); margin-bottom: 10px; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 800; background: var(--soft); color: var(--brand-3); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.kv { display: grid; gap: 8px; margin: 14px 0; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; font-size: 14px; }
.kv > div span:first-child { color: var(--ink-2); }
.kv > div span:last-child { font-weight: 700; text-align: right; word-break: break-word; }
.bigcode {
  font-size: 30px; font-weight: 800; letter-spacing: .12em; text-align: center; background: var(--soft-2); border: 2px dashed var(--brand-2);
  border-radius: 16px; padding: 14px; color: var(--brand-3); word-break: break-all;
}
.stack { display: grid; gap: 10px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--soft-2); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 18px; color: var(--brand-3); }
.stat span { font-size: 12px; color: var(--ink-2); }
.stat.hl { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.stat.hl b, .stat.hl span { color: #fff; }
.list { display: grid; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; display: grid; gap: 4px; font-size: 13.5px; background: #fff; }
.item .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.item .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.tabs button { flex: 0 0 auto; }
.spin { width: 22px; height: 22px; border: 3px solid var(--soft); border-top-color: var(--brand); border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes sp { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: #14282e; color: #fff; padding: 10px 16px; border-radius: 12px;
  font-weight: 600; font-size: 13.5px; z-index: 100; max-width: 90vw; box-shadow: var(--shadow);
}
.copyrow { display: flex; gap: 8px; align-items: center; }
.copyrow .field { flex: 1; }

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .hero h1 { font-size: 44px; }
  dialog.sheet { margin: auto; }
  .sheet-in { border-radius: 24px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .nav { display: flex; gap: 4px; }
  .menu-btn { display: none; }
  .filters { margin: 0; border-radius: 0 0 14px 14px; }
  .promo { grid-template-columns: 1.4fr 1fr; align-items: center; padding: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
