/* =========================================================
   WaralabaKu — style.css
   Mobile-first: gaya dasar untuk HP, lalu diperbesar untuk
   tablet (>=640px), laptop (>=960px), dan layar lebar.
   ========================================================= */

/* ---------- Warna & ukuran (tema terang) ---------- */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --navy: #0b1e3a;
  --navy-2: #132f57;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --green: #22c55e;
  --green-dark: #16a34a;
  --danger-bg: #fef2f2;
  --danger: #b91c1c;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --header-h: 64px;
  --gutter: 16px;
  color-scheme: light;
}

/* ---------- Tema gelap ---------- */
html.dark {
  --bg: #0b1220;
  --surface: #111c33;
  --surface-2: #0b1220;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #243350;
  --danger-bg: #3b1219;
  --danger: #fca5a5;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .2s, color .2s;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--orange); color: #fff; padding: 10px 16px; border-radius: 10px;
}
.skip:focus { left: 8px; }

/* ---------- Utilitas ---------- */
.flex1 { flex: 1; }
.w-full { width: 100%; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.orange { color: var(--orange); }
.row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.row > * { min-width: 0; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 0; border-radius: var(--radius-sm);
  font-weight: 800; font-size: 14px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dark); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
html.dark .btn-dark { background: #1e3a66; }
.btn-wa { background: var(--green); color: #fff; }
.btn-wa:hover { background: var(--green-dark); }
.btn-white { background: #fff; color: var(--navy); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.w-full + .w-full { margin-top: 10px; }

.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 99px;
  background: var(--surface); cursor: pointer; font-size: 18px;
}
.link {
  border: 0; background: none; padding: 6px 0; cursor: pointer;
  color: var(--orange); font-weight: 800; white-space: nowrap;
}
.link:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: var(--header-h); }
.logo { display: flex; gap: 10px; align-items: center; cursor: pointer; min-width: 0; }
.logo b { display: block; font-size: 18px; line-height: 1.1; }
.logo small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.logo-badge {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px;
  background: var(--orange); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 22px;
}
.head-actions { display: flex; gap: 8px; align-items: center; }
.login-label { display: none; }

/* Menu HP: panel turun dari atas */
.nav {
  position: fixed; left: 0; right: 0; top: var(--header-h);
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px var(--gutter) 18px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity .18s, transform .18s, visibility .18s;
}
.nav.open { transform: none; opacity: 1; visibility: visible; }
.nav-btn {
  border: 0; background: transparent; text-align: left;
  padding: 12px 14px; border-radius: 12px; min-height: 44px;
  font-weight: 700; cursor: pointer; color: var(--text);
}
.nav-btn:hover { background: var(--surface-2); }
.nav-btn.active { background: var(--navy); color: #fff; }
html.dark .nav-btn.active { background: #1e3a66; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; padding: 32px 0 36px; }
.hero-grid { display: grid; gap: 24px; align-items: center; }
.hero h1 { font-size: clamp(28px, 7vw, 56px); line-height: 1.08; margin: 14px 0; letter-spacing: -.02em; }
.lead { color: #cbd5e1; font-size: 16px; margin: 0; }
.pill {
  display: inline-block; background: #fff7ed; color: var(--orange-dark);
  border: 1px solid #fed7aa; padding: 6px 12px; border-radius: 99px;
  font-weight: 700; font-size: 12px;
}
.hero-search { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.hero-search > span { display: none; }
.hero-search input {
  border: 0; outline: 0; min-width: 0; width: 100%;
  background: #fff; color: #0f172a; border-radius: var(--radius-sm);
  padding: 13px 14px; font-size: 16px;
}
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hero-stats div {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 14px; padding: 12px;
}
.hero-stats b { display: block; font-size: 19px; }
.hero-stats span { font-size: 11px; color: #cbd5e1; }
.hero-card { background: #fff; color: #0f172a; border-radius: 20px; padding: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.hero-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 14px; }
.hero-card h3 { margin: 12px 0 2px; }
.hero-card p { margin: 0; color: #475569; font-size: 14px; }
.hero-card-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 800; margin-bottom: 10px; }
.badge-green { color: var(--green-dark); white-space: nowrap; }

/* ---------- Section ---------- */
.section-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 32px 0 16px; }
.section-head h2 { margin: 0; font-size: 22px; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.page { display: none; padding-bottom: 8px; }
.page.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-title { margin: 24px 0 16px; }
.page-title h1 { margin: 0; font-size: clamp(24px, 6vw, 34px); }
.page-title p { margin: 6px 0 0; color: var(--muted); }

/* ---------- Kategori ---------- */
.cats { display: grid; grid-template-columns: 1fr; gap: 12px; }
.cat-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.cat-group-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.cat-group-head small { color: var(--muted); font-weight: 600; }
.cat-subs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cat-subs button {
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 10px 6px; min-height: 44px;
  cursor: pointer; font-weight: 700; font-size: 13px; line-height: 1.3;
  transition: border-color .15s, transform .1s;
}
.cat-subs button:hover { border-color: var(--orange); }
.cat-subs button:active { transform: scale(.97); }
.cat-subs button span { font-size: 22px; display: block; }
.cat-subs button small { color: var(--muted); font-weight: 600; }

/* ---------- Kartu & grid ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; min-width: 0; }
.brand-card, .article-card { display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.brand-card:hover, .article-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.brand-card img, .article-card img {
  width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: cover;
  border-radius: 12px; margin-bottom: 12px; background: var(--surface-2);
}
.brand-card h3, .article-card h3 { margin: 10px 0 4px; font-size: 17px; }
.brand-card .muted, .article-card .muted { flex: 1; }
.brand-card .row { margin-top: auto; padding-top: 4px; }
.article-card .btn { margin-top: auto; }
.brand-meta { color: var(--muted); font-size: 13px; margin: 0; }
.price { font-size: 22px; font-weight: 800; margin: 6px 0 2px; }
.tag {
  display: inline-block; background: var(--surface-2); color: var(--text);
  padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
  margin: 0 2px 4px 0;
}
html.dark .tag { background: #1b2a47; }

/* ---------- CTA ---------- */
.cta-band {
  margin-top: 40px; background: var(--orange); color: #fff;
  border-radius: 20px; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.cta-band h2 { margin: 0 0 6px; }
.cta-band p { margin: 0; }
.cta-band .btn { align-self: stretch; }

/* ---------- Toolbar & filter ---------- */
.toolbar { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.search-box {
  display: flex; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px;
}
.search-box input { flex: 1; border: 0; outline: 0; padding: 12px 0; background: transparent; min-width: 0; }
select, input, textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; background: var(--surface); color: var(--text);
  font-size: 16px; /* 16px mencegah zoom otomatis di iPhone */
}
textarea { resize: vertical; }
select { min-height: 46px; }
.chips {
  display: flex; gap: 8px; margin-bottom: 12px;
  overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chips > span { display: none; }
.chips button {
  flex-shrink: 0; border: 1px solid var(--border); background: var(--surface);
  border-radius: 99px; padding: 8px 14px; min-height: 38px;
  cursor: pointer; font-weight: 700; font-size: 13px;
}
.chips button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.result-count { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.empty { text-align: center; padding: 40px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- Kontak & form ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.contact-grid h3 { margin-top: 0; }
.form h3 { margin-top: 0; }
.form label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.form label input, .form label select, .form label textarea { margin-top: 6px; font-weight: 400; }
.faq { margin-top: 18px; }
details { border-top: 1px solid var(--border); padding: 10px 0; }
summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
details p { margin: 6px 0 0; color: var(--muted); }

/* ---------- Admin ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.admin-stats div { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 14px; min-width: 0; }
html.dark .admin-stats div { background: #1e3a66; }
.admin-stats b { display: block; font-size: 24px; }
.admin-stats span { font-size: 12px; color: #cbd5e1; }
.admin-title { display: flex; flex-direction: column; gap: 12px; }
.admin-account { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-account .btn { flex: 1; min-height: 40px; font-size: 13px; }
.admin-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 5px; margin-bottom: 16px;
}
.admin-tabs button {
  border: 0; background: transparent; border-radius: 10px;
  min-height: 44px; font-weight: 800; cursor: pointer; color: var(--muted);
}
.admin-tabs button.active { background: var(--orange); color: #fff; }
/* ---------- Upload foto ---------- */
.form-field { margin-bottom: 14px; }
.field-label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.img-drop { display: block; position: relative; margin: 0 !important; }
.img-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0 !important; }
.img-drop-text {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 110px; padding: 14px; text-align: center;
  border: 2px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.img-drop-icon { font-size: 30px; line-height: 1; }
.img-drop-text b { color: var(--orange); font-size: 15px; }
.img-drop-text small { color: var(--muted); font-weight: 400; font-size: 12px; }
.img-drop:hover .img-drop-text, .img-drop.drag .img-drop-text, .img-drop input:focus-visible + .img-drop-text {
  border-color: var(--orange); background: color-mix(in srgb, var(--orange) 8%, var(--surface));
}
.img-drop.busy { pointer-events: none; opacity: .6; }
.img-preview { position: relative; margin-bottom: 8px; }
.img-preview img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.img-preview:not([hidden]) + .img-drop .img-drop-text { min-height: 56px; flex-direction: row; gap: 8px; }
.img-preview:not([hidden]) + .img-drop .img-drop-text small { display: none; }
.img-preview:not([hidden]) + .img-drop .img-drop-icon { font-size: 20px; }
.img-preview:not([hidden]) + .img-drop .img-drop-text b::after { content: ' (ganti)'; font-weight: 600; }
.img-remove {
  position: absolute; right: 8px; top: 8px; border: 0; cursor: pointer;
  background: rgba(15, 23, 42, .75); color: #fff; font-weight: 700; font-size: 12px;
  padding: 7px 10px; border-radius: 99px;
}
.img-status { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--green-dark); }
.img-status.error { color: var(--danger); }
.img-url { margin: 8px 0 4px; border: 0; padding: 0; }
.img-url summary { font-size: 13px; color: var(--muted); font-weight: 600; }
.img-url input { margin-top: 8px; }
.form-field > small { display: block; margin-top: 4px; }

.admin-tabs { grid-template-columns: repeat(3, 1fr); }
.admin-tabs button { font-size: 14px; padding: 0 4px; }
.file-pick { display: block; position: relative; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-pick span {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  font-weight: 800; color: var(--muted);
}
.file-pick:hover span, .file-pick input:focus-visible + span { border-color: var(--orange); color: var(--orange); }
.backup-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.backup-head h3 { margin: 0; }
.backup-head .btn { min-height: 38px; padding: 6px 12px; font-size: 13px; }
.backup-item { grid-template-columns: 1fr !important; }
.backup-item .admin-actions { grid-column: auto; }
.backup-item b { display: block; }
.badge-new { display: inline-block; background: var(--green); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.admin-grid h3 { margin-top: 0; }
.admin-list { display: grid; gap: 10px; margin-bottom: 14px; }
.admin-item {
  display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px;
}
.admin-item > span { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.admin-item small { color: var(--muted); }
.admin-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; }
.admin-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.admin-actions .btn { min-height: 38px; padding: 8px 12px; font-size: 13px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .6); animation: fadeIn .2s; }
.modal-box {
  position: relative; width: 100%; max-width: 680px;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-box.modal-sm { max-width: 440px; }
.modal-box img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 14px; margin-bottom: 12px; }
.modal-box h2 { margin: 10px 0 6px; padding-right: 40px; }
.modal-box ul { padding-left: 20px; }
.modal-x {
  position: absolute; right: 12px; top: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 16px;
}
.login-head { display: flex; gap: 12px; align-items: center; padding-right: 44px; }
.login-head h2 { margin: 0; padding: 0; font-size: 22px; }
.login-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.login-head > span { font-size: 30px; }
.login-head .modal-x { top: 16px; }
form.modal-box label { display: block; font-weight: 700; font-size: 13px; margin: 12px 0; }
form.modal-box label input { margin-top: 6px; font-weight: 400; }
.alert {
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 700; font-size: 13px; margin: 12px 0 0;
}
.article-body p { white-space: pre-line; margin: 0 0 14px; font-size: 16px; line-height: 1.75; }
.calc-rows { margin: 12px 0; }
.calc-rows div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--border); padding: 10px 0; }

/* ---------- Footer ---------- */
footer { background: var(--navy); color: #cbd5e1; margin-top: 48px; padding: 32px 0 calc(90px + env(safe-area-inset-bottom)); }
html.dark footer { background: #08111f; }
footer .logo { color: #fff; cursor: default; }
footer .logo small { color: #94a3b8; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.footer-grid > div:first-child { grid-column: 1 / -1; }
footer h4 { color: #fff; margin: 0 0 8px; }
footer a, .footer-link {
  display: block; margin: 6px 0; padding: 2px 0;
  background: none; border: 0; text-align: left;
  color: #cbd5e1; text-decoration: none; cursor: pointer; font-size: 14px;
}
footer a:hover, .footer-link:hover { color: #fff; }
footer p { margin: 8px 0 0; font-size: 14px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 24px; padding-top: 16px; font-size: 13px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px;
}
/* Tombol login admin: kecil & samar, baru jelas saat disentuh/diarahkan mouse */
.admin-link {
  background: none; border: 0; padding: 6px 2px; cursor: pointer;
  color: #cbd5e1; font-size: 11px; letter-spacing: .02em;
  opacity: .3; transition: opacity .2s;
}
.admin-link:hover, .admin-link:focus-visible { opacity: .9; }

/* ---------- Tombol WhatsApp melayang ---------- */
#waFloat {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 90;
  display: flex; align-items: center; gap: 6px;
  min-width: 52px; height: 52px; justify-content: center; padding: 0 16px;
  background: var(--green); color: #fff; text-decoration: none;
  border-radius: 99px; font-weight: 800; font-size: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
#waFloat span { display: none; font-size: 14px; }

/* =========================================================
   Layar sangat kecil (HP mini, <=360px)
   ========================================================= */
@media (max-width: 360px) {
  :root { --gutter: 12px; }
  .logo small { display: none; }
  .hero-stats b { font-size: 17px; }
  .admin-stats { grid-template-columns: 1fr; }
  .row .btn { flex-basis: 100%; }
}

/* =========================================================
   Tablet kecil / HP landscape (>=640px)
   ========================================================= */
@media (min-width: 640px) {
  :root { --gutter: 20px; }
  .hero-search {
    flex-direction: row; align-items: center; gap: 8px;
    background: #fff; border-radius: 14px; padding: 6px 6px 6px 14px;
  }
  .hero-search > span { display: inline; color: #0f172a; }
  .hero-search input { flex: 1; padding: 8px 0; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .section-head { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .cta-band { flex-direction: row; align-items: center; justify-content: space-between; padding: 28px; }
  .cta-band .btn { align-self: center; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search-box { grid-column: 1 / -1; }
  .chips { flex-wrap: wrap; overflow: visible; }
  .chips > span { display: block; }
  .admin-item { grid-template-columns: 52px 1fr auto; }
  .admin-title { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .admin-account .btn { flex: none; }
  .admin-tabs { display: inline-grid; min-width: 440px; }
  .backup-item { grid-template-columns: 1fr auto !important; }
  .admin-actions { grid-column: auto; display: flex; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: auto; }
  #waFloat span { display: inline; }
  /* modal tampil di tengah */
  .modal { align-items: center; padding: 20px; }
  .modal-box { border-radius: 22px; padding: 24px; max-height: 90vh; max-height: 90dvh; }
}

/* =========================================================
   Laptop / desktop (>=960px)
   ========================================================= */
@media (min-width: 960px) {
  :root { --header-h: 72px; }
  .login-label { display: inline; }
  .burger { display: none; }
  .nav {
    position: static; flex-direction: row; gap: 4px; padding: 0;
    background: transparent; border: 0; box-shadow: none;
    transform: none; opacity: 1; visibility: visible;
  }
  .nav-btn { padding: 9px 16px; border-radius: 99px; text-align: center; }
  .hero { padding: 56px 0; }
  .hero-grid { grid-template-columns: 1.35fr .9fr; gap: 40px; }
  .lead { font-size: 18px; }
  .hero-card img { height: 200px; }
  .section-head h2 { font-size: 28px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .cats { grid-template-columns: repeat(3, 1fr); }
  .toolbar { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .toolbar .search-box { grid-column: auto; }
  #page-artikel .toolbar { grid-template-columns: 2fr 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr 1.2fr; gap: 20px; }
  .admin-grid { grid-template-columns: 1fr 1.2fr; gap: 20px; }
  .admin-list { max-height: 65vh; overflow-y: auto; padding-right: 4px; }
  .admin-grid > form { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; }
  .admin-stats div { padding: 18px; }
  .admin-stats b { font-size: 28px; }
}

/* ---------- Kurangi animasi bila diminta pengguna ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Cetak ---------- */
@media print {
  .topbar, #waFloat, .modal, footer, .cta-band { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Saat data sedang dimuat ---------- */
body.loading .stat-num { display: inline-block; min-width: 1.2em; opacity: .5; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.loading-msg { grid-column: 1 / -1; text-align: center; padding: 24px 0; }

/* ---------- Nama website panjang: jangan tabrakan dengan tombol di HP ---------- */
.topbar .logo { flex: 1 1 auto; min-width: 0; }
.topbar .logo > span:last-child { min-width: 0; overflow: hidden; }
.topbar .logo b { font-size: clamp(15px, 4.4vw, 18px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .logo small { overflow: hidden; text-overflow: ellipsis; }
.head-actions { flex-shrink: 0; }
@media (min-width: 960px) { .topbar .logo { flex: 0 1 auto; } }

/* ---------- Tombol "Saya Ingin Bergabung" di detail brand ---------- */
.join-cta { display: grid; gap: 10px; margin-top: 16px; }
.join-cta .w-full + .w-full { margin-top: 0; }
.btn-join {
  flex-direction: column; gap: 2px; min-height: 60px; font-size: 17px;
  box-shadow: 0 8px 20px rgba(34, 197, 94, .35);
  animation: joinPulse 2.4s ease-in-out infinite;
}
.btn-join small { font-size: 12px; font-weight: 600; opacity: .9; }
@keyframes joinPulse { 0%, 100% { box-shadow: 0 8px 20px rgba(34, 197, 94, .35); } 50% { box-shadow: 0 8px 28px rgba(34, 197, 94, .6); } }

/* Subkategori terakhir yang sendirian di barisnya dibuat selebar penuh */
.cat-subs button:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Jumlah hasil + tombol salin link (halaman Franchise) ---------- */
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.result-bar .result-count { margin: 0; }
.copy-link {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 99px; padding: 6px 14px; min-height: 36px;
  font-weight: 700; font-size: 13px; cursor: pointer;
}
.copy-link:hover { border-color: var(--orange); color: var(--orange); }

/* =========================================================
   HALAMAN BACA ARTIKEL
   Tipografi: isi 17-18px, jarak baris 1.8, lebar baris +-68 karakter
   ========================================================= */
.read-progress {
  position: fixed; left: 0; right: 0; top: var(--header-h); z-index: 59; height: 3px;
  background: var(--orange); transform-origin: 0 50%; transform: scaleX(0);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.reader { max-width: 760px; margin: 0 auto; padding: 20px 0 8px; }
.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--orange); font-weight: 700; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.tag-orange { background: #fff7ed; color: var(--orange-dark); }
html.dark .tag-orange { background: #3a2210; color: #fdba74; }
.reader-head h1 {
  font-size: clamp(26px, 6.2vw, 42px); line-height: 1.2; letter-spacing: -.02em;
  margin: 12px 0 16px; text-wrap: balance;
}
.reader-meta { display: flex; align-items: center; gap: 12px; }
.reader-meta .avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; background: var(--orange); color: #fff; font-weight: 800; font-size: 18px;
}
.reader-meta b { display: block; line-height: 1.3; }
.reader-meta small { color: var(--muted); font-size: 13px; }
.reader-hero { margin: 24px 0 28px; }
.reader-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; background: var(--surface-2); }

/* Daftar isi */
.toc {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--orange);
  border-radius: 14px; padding: 14px 18px; margin: 0 0 28px;
}
.toc summary { font-weight: 800; font-size: 16px; cursor: pointer; }
.toc summary small { color: var(--muted); font-weight: 600; }
.toc ol { list-style: none; margin: 10px 0 0; padding: 0; }
.toc li { margin: 2px 0; }
.toc li.toc-l3 { padding-left: 20px; font-size: 14px; }
.toc a { display: block; padding: 6px 0; color: var(--text); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--orange); }

/* Isi artikel */
.reader-body { font-size: 17px; line-height: 1.8; color: var(--text); max-width: 68ch; overflow-wrap: break-word; }
.reader-body > :first-child { margin-top: 0; }
.reader-body p { margin: 0 0 1.25em; }
.reader-body h2 { font-size: clamp(22px, 5vw, 28px); line-height: 1.3; margin: 1.9em 0 .6em; scroll-margin-top: calc(var(--header-h) + 16px); }
.reader-body h3 { font-size: clamp(19px, 4.4vw, 22px); line-height: 1.35; margin: 1.6em 0 .5em; scroll-margin-top: calc(var(--header-h) + 16px); }
.reader-body a { color: var(--orange-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
html.dark .reader-body a { color: #fdba74; }
.reader-body strong { font-weight: 800; }
.reader-body ul, .reader-body ol { margin: 0 0 1.25em; padding-left: 1.4em; }
.reader-body li { margin: .35em 0; padding-left: .2em; }
.reader-body ul li::marker { color: var(--orange); }
.reader-body ol li::marker { color: var(--orange); font-weight: 800; }
.reader-body blockquote {
  margin: 1.5em 0; padding: 14px 18px; border-left: 4px solid var(--orange);
  background: color-mix(in srgb, var(--orange) 8%, var(--surface)); border-radius: 0 12px 12px 0;
  font-weight: 600;
}
.reader-body figure { margin: 1.8em 0; }
.reader-body figure img { width: 100%; height: auto; border-radius: 14px; background: var(--surface-2); }
.reader-body figcaption { text-align: center; color: var(--muted); font-size: 14px; margin-top: 8px; line-height: 1.5; }
.table-wrap { overflow-x: auto; margin: 1.5em 0; border: 1px solid var(--border); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.reader-body table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; min-width: 420px; }
.reader-body th, .reader-body td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.reader-body th { background: var(--surface-2); font-weight: 800; }
.reader-body tr:last-child td { border-bottom: 0; }

/* Bagikan */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 32px 0; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.share-label { font-weight: 800; margin-right: 4px; }
.share-btn {
  display: inline-flex; align-items: center; min-height: 38px; padding: 6px 14px;
  border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.share-btn:hover { border-color: var(--orange); }
.share-btn.s-wa { background: #22c55e; border-color: #22c55e; color: #fff; }
.share-btn.s-fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.share-btn.s-x { background: #0f172a; border-color: #0f172a; color: #fff; }
.share-btn.s-tg { background: #229ed9; border-color: #229ed9; color: #fff; }

/* Ajakan (CTA) di akhir artikel */
.reader-cta {
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff;
  border-radius: 20px; padding: 24px; display: grid; gap: 16px; margin: 8px 0;
}
.reader-cta h2 { margin: 0 0 6px; font-size: 22px; }
.reader-cta p { margin: 0; color: #cbd5e1; }
.reader-cta-btns { display: grid; gap: 10px; }
.related { margin-top: 40px; }
.related h2 { font-size: 22px; margin: 0 0 16px; }
.reader-empty { text-align: center; padding: 60px 0; }

/* Kartu artikel: gambar & judul bisa diklik */
.article-thumb { display: block; }
.article-card h3 a { color: inherit; text-decoration: none; }
.article-card h3 a:hover { color: var(--orange); }

@media (min-width: 640px) {
  .reader { padding-top: 28px; }
  .reader-body { font-size: 18px; }
  .reader-cta { grid-template-columns: 1fr auto; align-items: center; padding: 28px; }
  .reader-cta-btns { min-width: 240px; }
}

/* =========================================================
   ADMIN: toolbar format isi artikel
   ========================================================= */
.md-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 12px 12px 0 0;
}
.md-toolbar button {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; min-height: 36px; padding: 4px 10px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.md-toolbar button:hover { border-color: var(--orange); color: var(--orange); }
.md-toolbar .md-preview-btn { margin-left: auto; }
.md-toolbar .md-preview-btn.active { background: var(--orange); border-color: var(--orange); color: #fff; }
#arIsi { border-radius: 0 0 12px 12px; margin-top: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6; }
.md-preview {
  margin-top: 10px; padding: 18px; border: 2px dashed var(--orange); border-radius: 12px;
  background: var(--surface); max-width: none; font-size: 16px;
}
.md-preview-label { font-size: 12px; font-weight: 800; color: var(--orange); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.md-help { margin-top: 10px; border: 0; padding: 0; }
.md-help summary { font-size: 13px; color: var(--muted); font-weight: 700; }
.md-help table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.md-help th, .md-help td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.md-help code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 12px; white-space: nowrap; }

/* Jarak isi artikel ke kotak ajakan (setelah tombol share dihapus) */
.reader-body + .reader-cta { margin-top: 36px; }

/* Kartu brand: deskripsi 14px (naik dari 12px), harga disamakan 14px */
.brand-card p.muted.small { font-size: 14px; line-height: 1.55; }
.brand-card .price { font-size: 14px; font-weight: 800; color: var(--text); margin: 8px 0 4px; }

/* =====================================================================
   TEMA "RACIKAN B" — krem hangat, hijau, terakota
   Ramah pembaca dewasa & orang tua: huruf lebih besar, kontras tinggi,
   tombol besar (min. 50px), tanpa animasi berdenyut.
   (Hapus seluruh blok ini untuk kembali ke tampilan lama.)
   ===================================================================== */
:root {
  --bg: #FAEEDA;            /* krem hangat (latar halaman) */
  --surface: #FFFFFF;       /* kartu */
  --surface-2: #FFF8EE;     /* krem sangat muda */
  --text: #412402;          /* cokelat tua (teks isi) */
  --heading: #4A1B0C;       /* cokelat paling tua (judul) */
  --muted: #633806;         /* teks pendukung, tetap kontras */
  --border: #F2D9A8;
  --navy: #27500A;          /* hijau tua (header, tombol utama) */
  --navy-2: #173404;
  --orange: #993C1D;        /* terakota (aksen, harga, link) */
  --orange-dark: #712B13;
  --green: #3B6D11;         /* hijau WhatsApp & nama brand */
  --green-dark: #27500A;
  --green-tint: #EAF3DE;
  --header-h: 68px;
}
html.dark {
  --bg: #1d1710;
  --surface: #2a2118;
  --surface-2: #231c14;
  --text: #FAEEDA;
  --heading: #FFF8EE;
  --muted: #E8C99A;
  --border: #4a3a28;
  --navy: #27500A;
  --navy-2: #173404;
  --orange: #F0997B;
  --orange-dark: #F5C4B3;
  --green: #97C459;
  --green-dark: #C0DD97;
  --green-tint: #27500A;
}

/* ---------- Huruf dasar lebih besar ---------- */
body { font-size: 17px; line-height: 1.65; }
h1, h2, h3, h4 { color: var(--heading); }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.result-count, .brand-meta { font-size: 15px; color: var(--muted); }

/* ---------- Tombol besar ---------- */
.btn { min-height: 50px; font-size: 16px; padding: 12px 18px; }
.btn-orange { background: var(--orange); }
.btn-orange:hover { background: var(--orange-dark); }
.btn-dark, html.dark .btn-dark { background: var(--navy); }
.btn-dark:hover { background: var(--navy-2); }
.btn-wa { background: var(--green); }
html.dark .btn-wa { background: #3B6D11; color: #fff; }
.btn-outline { border: 1.5px solid var(--border); }
.icon-btn { width: 48px; height: 48px; border-color: rgba(255,255,255,.5); background: transparent; color: #fff; }
.btn-join { animation: none; box-shadow: none; }

/* ---------- Header hijau ---------- */
.topbar, html.dark .topbar { background: var(--navy); border-bottom: 1px solid var(--navy-2); color: #fff; }
.topbar .logo b { color: #fff; }
.topbar .logo small { color: #C0DD97; }
.topbar .logo-badge { background: #FAEEDA; color: var(--navy); }
.burger { width: auto; padding: 0 14px; border-radius: 12px; gap: 6px; font-size: 16px; font-weight: 800; display: flex; align-items: center; }
.nav { background: var(--surface); }
.nav-btn { font-size: 17px; min-height: 50px; color: var(--text); }
.nav-btn:hover { background: var(--surface-2); }
.nav-btn.active, html.dark .nav-btn.active { background: var(--green-tint); color: var(--navy); }
html.dark .nav-btn.active { color: #EAF3DE; }
@media (min-width: 960px) {
  .nav { background: transparent; }
  .nav-btn { color: #EAF3DE; font-size: 16px; min-height: 44px; }
  .nav-btn:hover { background: rgba(255,255,255,.12); }
  .nav-btn.active, html.dark .nav-btn.active { background: #FAEEDA; color: var(--navy); }
}
.read-progress { background: var(--orange); }

/* ---------- Beranda (hero) krem, bukan biru gelap ---------- */
.hero { background: var(--bg); color: var(--text); border-bottom: 1px solid var(--border); }
.hero h1 { color: var(--heading); }
.hero .orange { color: var(--green); }
.lead { color: var(--text); font-size: 18px; }
.pill { background: var(--surface); color: var(--orange-dark); border: 1px solid var(--border); font-size: 14px; }
.hero-search input { border: 1.5px solid #BA7517; font-size: 17px; min-height: 50px; }
@media (min-width: 640px) {
  .hero-search { border: 1.5px solid #BA7517; background: #fff; }
  .hero-search input { border: 0; min-height: 0; }
  .hero-search > span { color: var(--text); }
}
.hero-stats div { background: var(--surface); border: 1px solid var(--border); }
.hero-stats b { color: var(--orange); font-size: 21px; }
.hero-stats span { color: var(--muted); font-size: 14px; }
.hero-card { background: var(--surface); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.hero-card h3 { color: var(--green); }
.hero-card p { color: var(--text); font-size: 16px; }
.hero-card-top { font-size: 13px; color: var(--orange-dark); }

/* ---------- Kartu brand: nama hijau, harga terakota ---------- */
.card { border-color: var(--border); }
.brand-card h3 { color: var(--green); font-size: 20px; }
.brand-card p.muted.small { font-size: 16px; color: var(--text); line-height: 1.55; }
.brand-card .price { font-size: 16px; color: var(--orange); }
.brand-card .btn-orange { background: var(--surface); color: var(--orange); border: 1.5px solid var(--orange); }
.brand-card .btn-orange:hover { background: var(--surface-2); }
.tag { background: var(--green-tint); color: var(--navy); font-size: 14px; }
html.dark .tag { background: var(--green-tint); color: #EAF3DE; }

/* ---------- Kategori ---------- */
.cat-group { border-color: var(--border); }
.cat-group-head { font-size: 17px; color: var(--heading); }
.cat-subs button { font-size: 15px; min-height: 64px; background: var(--surface-2); border-color: var(--border); color: var(--text); }
.cat-subs button small { font-size: 13px; }
.chips button { font-size: 15px; min-height: 44px; border-color: var(--border); color: var(--text); }
.chips button.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.link { color: var(--orange); font-size: 16px; }

/* ---------- Form & pencarian ---------- */
select, input, textarea { font-size: 17px; border: 1.5px solid #D9B77A; }
select { min-height: 50px; }
.search-box { border: 1.5px solid #D9B77A; }
.search-box input { border: 0; }
.form label, form.modal-box label { font-size: 15px; }

/* ---------- CTA, admin, popup ---------- */
.cta-band { background: var(--orange); }
.btn-white { color: var(--orange-dark); }
.admin-stats div, html.dark .admin-stats div { background: var(--navy); }
.admin-stats span { color: #C0DD97; }
.calc-rows div { border-bottom-color: var(--border); }
.modal-box h2 { color: var(--green); }

/* ---------- Artikel ---------- */
.tag-orange { background: var(--surface); color: var(--orange-dark); border: 1px solid var(--border); }
html.dark .tag-orange { background: var(--surface); color: var(--orange-dark); }
.article-card h3 a { color: var(--heading); }
.reader-body a, html.dark .reader-body a { color: var(--orange); }
.reader-cta { background: var(--navy); }
.reader-cta p { color: #EAF3DE; }

/* ---------- Footer hijau tua ---------- */
footer, html.dark footer { background: var(--navy-2); color: #EAF3DE; }
footer h4 { color: #fff; }
footer a, .footer-link { color: #EAF3DE; font-size: 16px; }
footer p { font-size: 16px; }
footer .logo small { color: #C0DD97; }
.footer-bottom { border-top-color: rgba(255,255,255,.2); font-size: 14px; }
.admin-link { color: #EAF3DE; }

/* ---------- Tombol WhatsApp melayang ---------- */
#waFloat { background: var(--green); height: 56px; min-width: 56px; }
html.dark #waFloat { background: #3B6D11; }

/* HP: beri ruang untuk nama website + tombol Menu */
@media (max-width: 480px) {
  .head-actions { gap: 6px; }
  #themeBtn { width: 42px; height: 42px; font-size: 16px; }
  .burger { padding: 0 10px; font-size: 15px; height: 44px; }
  .topbar .logo { gap: 8px; }
  .topbar .logo-badge { width: 34px; height: 34px; font-size: 19px; }
  .topbar .logo small { display: none; }
  .topbar .logo b { font-size: 17px; }
}

/* Desktop: menu sudah tampil penuh, tombol Menu tidak perlu */
@media (min-width: 960px) { .burger { display: none; } }
