/* ============================================================
   Kepolisian Nexotis — style.css (v3)
   Arah desain: formulir/arsip kepolisian. Merah-putih, datar,
   sudut tegas, garis tipis, nol efek kaca/glow/gradient.
   Animasi dipakai seperlunya: muncul halus, garis bawah menu,
   angka naik, progress, pop modal. Semua mati kalau OS set
   "kurangi gerakan".
   ============================================================ */

:root {
  --bg: #fff1f6;
  --card: #ffffff;
  --ink: #4a2433;
  --border: #efc6d5;
  --border-strong: #4a2433;

  --red: #e0467c;
  --red-light: #ff8fb5;
  --rose-deep: #b5305f;
  --pink-soft: #fde4ee;

  --text: #432a35;
  --muted: #85626f;
  --faint: #b295a3;

  --green: #12804f;
  --amber: #b45f06;
  --blue: #1f4fb4;
  --danger: #d6283f;

  --f-body: "Barlow", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-disp: "Barlow Condensed", "Arial Narrow", "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.25, .8, .3, 1);
  --r: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--f-disp); color: var(--ink); }
::selection { background: var(--red); color: #fff; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes marqueeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes drawLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse { 50% { opacity: .5; } }

/* muncul berurutan, cepat dan kalem */
.container > *, #isi > * { animation: rise .4s var(--ease) both; }
.container > *:nth-child(2), #isi > *:nth-child(2) { animation-delay: .05s; }
.container > *:nth-child(3), #isi > *:nth-child(3) { animation-delay: .1s; }
.container > *:nth-child(4), #isi > *:nth-child(4) { animation-delay: .15s; }
.container > *:nth-child(n+5), #isi > *:nth-child(n+5) { animation-delay: .2s; }

/* ====== Header (satu blok sticky) ====== */
#navbar-mount { display: contents; }
.site-header { position: sticky; top: 0; z-index: 30; background: #fff8fb; border-bottom: 3px solid var(--red); }
.siren, .siren-top { display: none; }

.navbar { position: relative; display: flex; align-items: center; gap: 16px; padding: 8px 22px; color: var(--ink); }
.navbar .brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; white-space: nowrap; font-family: var(--f-disp); font-weight: 700; font-size: 20px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.navbar .brand .flag { display: inline-flex; color: var(--red); }
.navbar .brand .logo-svg { width: 28px; height: 28px; }
.logo-img { display: block; height: 34px; width: auto; max-width: 140px; object-fit: contain; }

#nav-links { display: flex; flex: 1 1 auto; min-width: 0; justify-content: center; gap: 2px; white-space: nowrap; }
.nav-measure { position: absolute; left: 0; top: 0; display: flex; gap: 2px; width: max-content; height: 0; overflow: hidden; visibility: hidden; pointer-events: none; white-space: nowrap; }
#nav-links a, #nav-links span.active, .nav-measure a, .nav-measure span.active { position: relative; padding: 9px 11px; font-size: 14px; font-weight: 500; color: var(--muted); }
#nav-links a { transition: color .15s; }
#nav-links a::after, #nav-links span.active::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 0; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
#nav-links span.active, .nav-measure span.active { color: var(--ink); font-weight: 700; }
#nav-links span.active::after { transform: scaleX(1); animation: drawLine .35s var(--ease) both; }

.nav-toggle-wrap { position: relative; flex: 0 0 auto; margin-left: auto; }
.nav-toggle-wrap button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; width: 40px; height: 36px; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r); cursor: pointer; }
.nav-toggle-wrap button span { display: block; width: 17px; height: 2px; background: var(--ink); transition: transform .2s var(--ease), opacity .15s; }
.nav-toggle-wrap:has(#nav-menu.open) button span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle-wrap:has(#nav-menu.open) button span:nth-child(2) { opacity: 0; }
.nav-toggle-wrap:has(#nav-menu.open) button span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

#nav-menu, #profile-menu { position: absolute; top: 100%; right: 0; margin-top: 8px; min-width: 220px; max-width: calc(100vw - 20px); background: #fff; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; z-index: 50; box-shadow: 4px 4px 0 rgba(20, 32, 47, .12); }
#nav-menu { display: none; }
#nav-menu.open { display: block; animation: pop .18s var(--ease) both; }
#profile-menu { min-width: 180px; animation: pop .18s var(--ease) both; }
#nav-menu a, #nav-menu span.active, #profile-menu button { display: block; width: 100%; padding: 12px 16px; font-family: inherit; font-size: 14px; text-align: left; color: var(--text); background: none; border: 0; border-top: 1px solid var(--border); cursor: pointer; }
#nav-menu a:first-child, #nav-menu span.active:first-child, #profile-menu button:first-child { border-top: 0; }
#nav-menu span.active { color: var(--red); font-weight: 700; box-shadow: inset 3px 0 0 var(--red); }

.navbar .user { display: flex; align-items: center; flex: 0 0 auto; gap: 10px; }
.navbar .user .info { text-align: right; line-height: 1.25; }
.navbar .user .info .name { font-size: 14px; font-weight: 700; color: var(--ink); }
.navbar .user .info .rank { font-size: 11.5px; color: var(--muted); }
.navbar .user .avatar, .member-card .avatar-circle, .profile-view-avatar, .ava { display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%; background: var(--ink); background-size: cover; background-position: center; color: #fff; font-weight: 700; }
.navbar .user .avatar { width: 34px; height: 34px; font-size: 12px; }
.member-card .avatar-circle { width: 56px; height: 56px; font-size: 16px; margin: 0 auto 10px; }
.profile-view-avatar { width: 84px; height: 84px; font-size: 26px; margin: 0 auto 12px; }

/* teks berjalan */
.marquee-bar { overflow: hidden; white-space: nowrap; padding: 5px 0; background: var(--red); contain: layout paint; }
.marquee-track { display: inline-flex; animation: marqueeScroll 30s linear infinite; }
.marquee-bar:hover .marquee-track { animation-play-state: paused; }
.marquee-text { display: inline-block; padding-right: 48px; font-size: 12px; font-weight: 500; color: #fff; }
.marquee-text::after { content: "|"; margin-left: 48px; color: #ffd3e3; }

/* ====== Layout ====== */
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 26px 18px 70px; }

.card { min-width: 0; margin-bottom: 16px; padding: 20px 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); }
.card h2 { margin: 0 0 4px; padding-bottom: 8px; font-size: 22px; font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); }
.card .sub { margin: 8px 0 16px; font-size: 13px; color: var(--muted); }
.card h2 + .sub { margin-top: 10px; }

.stats-grid, .pill-row { display: grid; gap: 12px; margin-bottom: 16px; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); }
.pill-row { grid-template-columns: repeat(auto-fit, minmax(min(78px, 100%), 1fr)); }

.stat-card { min-width: 0; padding: 16px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); }
.stat-card .label { margin-bottom: 2px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat-card .value { font-family: var(--f-disp); font-size: 36px; font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-card.money .value { color: var(--green); }
.stat-card.hours .value { color: var(--blue); }

.pill { padding: 12px 8px; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); }
.pill .num { font-family: var(--f-disp); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.pill .lbl { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pill.hadir .num { color: var(--green); }
.pill.izin .num { color: var(--amber); }
.pill.cuti .num { color: var(--blue); }
.pill.alpa .num { color: var(--danger); }

/* ====== Tabel ====== */
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13px; }
thead th { padding: 8px 12px 8px 0; text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 2px solid var(--ink); white-space: nowrap; }
tbody td { padding: 10px 12px 10px 0; vertical-align: middle; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 3px; font-size: 11.5px; font-weight: 700; }
.badge.pending { background: #fdf0dc; color: var(--amber); }
.badge.pending::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 1.3s ease-in-out infinite; }
.badge.diterima { background: #e2f4ea; color: var(--green); }
.badge.ditolak { background: #fbe3e7; color: var(--danger); }
.badge.rank { background: #e4ebfa; color: var(--blue); }

/* ====== Leaderboard ====== */
.lb-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.lb-row:last-child { border-bottom: none; }
.lb-main { flex: 1; min-width: 0; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.lb-sub { font-size: 11.5px; color: var(--faint); }
.lb-rank { flex-shrink: 0; min-width: 54px; text-align: center; }
.lb-jam { flex-shrink: 0; text-align: right; }
.lb-jam b { display: block; font-size: 14px; color: var(--blue); }
.pos { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 3px; font-family: var(--f-disp); font-size: 16px; font-weight: 700; color: var(--muted); background: #f8e5ec; }
.pos.p1 { background: #e8b52c; color: #3d2c00; }
.pos.p2 { background: #c3c8d0; color: #222a35; }
.pos.p3 { background: #c98857; color: #fff; }
.rank-pill { display: inline-block; padding: 2px 8px; border-radius: 3px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; }
.rank-pill.kosong { background: none; border: 1px solid var(--border); color: var(--faint); }

/* ====== Progress ====== */
.progress-track { width: 100%; height: 10px; overflow: hidden; background: #f7dde7; border-radius: 2px; }
.progress-fill { height: 100%; background: var(--red); transition: width .8s var(--ease); }
.progress-fill.done { background: var(--green); }

/* ====== Undang-Undang ====== */
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filter-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.filter-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-btn .swatch { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pasal-section { display: none; }
.pasal-section.show { display: block; animation: fade .3s ease both; }
.pasal-section h3 { margin: 0 0 12px; font-size: 20px; color: var(--red); }
table.pasal-table td.chk { width: 30px; text-align: center; }
table.pasal-table td.chk input[type="checkbox"], .row-check, .select-all-check { width: 16px; height: 16px; accent-color: var(--red); cursor: pointer; }
table.pasal-table td.deskripsi { max-width: 280px; font-size: 12px; color: var(--muted); }
table.pasal-table td.denda { font-weight: 700; color: var(--green); white-space: nowrap; }
table.pasal-table td.hukuman { white-space: nowrap; }
.kalkulator-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.kalkulator-summary .stat-card { flex: 1; min-width: min(140px, 100%); margin-bottom: 0; }
.kalkulator-empty { padding: 10px 0; font-size: 13px; color: var(--faint); }
.pasal-tag { display: inline-flex; align-items: center; gap: 6px; margin: 3px 4px 3px 0; padding: 3px 8px; font-size: 12px; background: #fde4ee; border: 1px solid #f2b6cc; border-radius: 3px; animation: pop .2s var(--ease) both; }
.pasal-tag button { padding: 0; font-size: 14px; line-height: 1; color: var(--danger); background: none; border: none; cursor: pointer; }

/* ====== Tombol ====== */
.btn { padding: 9px 18px; font-family: inherit; font-size: 14px; font-weight: 600; border: 1px solid transparent; border-radius: var(--r); cursor: pointer; transition: background-color .15s, border-color .15s, transform .1s; }
.btn-primary { background: var(--red); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--border-strong); }
.btn-link { padding: 4px 0; font-size: 13px; color: var(--blue); background: none; }
.btn-link:hover { text-decoration: underline; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn:focus-visible, .filter-btn:focus-visible, .nav-toggle-wrap button:focus-visible, #nav-links a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ====== Form ====== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--text); }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; }
.form-row > * { flex: 1; min-width: min(150px, 100%); }
input[type=text], input[type=date], input[type=time], input[type=password], input[type=file], select, textarea { width: 100%; padding: 9px 11px; font-family: inherit; font-size: 14px; color: var(--text); background: #fff; border: 1px solid #dcafc1; border-radius: var(--r); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 32, 47, .14); }
textarea { min-height: 64px; resize: vertical; }
.radio-group { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-option { flex: 1; min-width: min(150px, 100%); padding: 10px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid #dcafc1; border-radius: var(--r); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.radio-option input { display: none; }
.radio-option.selected { color: #fff; background: var(--ink); border-color: var(--ink); }
.dz-wrap, .warn-wrap { display: flex; justify-content: center; margin-bottom: 8px; color: var(--muted); }
.warn-wrap { color: var(--amber); }

/* ====== Login / Register / Setup ====== */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; padding: 34px 28px 26px; text-align: center; background: #fff; border: 1px solid var(--border-strong); border-top: 5px solid var(--red); border-radius: var(--r); animation: rise .45s var(--ease) both; }
.login-card .flag { display: flex; justify-content: center; margin: 0 auto 10px; color: var(--red); }
.login-card .flag .logo-svg { width: 56px; height: 56px; }
.login-card .flag .logo-img { height: 84px; max-width: 220px; }
.login-card h1 { margin: 6px 0 6px; font-size: 28px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.login-card p { margin-bottom: 22px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.login-card select { margin-bottom: 10px; }
.login-card .foot { margin-top: 18px; font-size: 12px; color: var(--faint); }
.error-msg { min-height: 16px; margin-top: 10px; font-size: 13px; color: var(--danger); }
.error-msg:not(:empty) { animation: pop .2s var(--ease) both; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.empty { padding: 10px 0; font-size: 13px; color: var(--faint); }

/* ====== Modal ====== */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: none; padding: 20px; overflow-y: auto; background: rgba(20, 32, 47, .6); }
.modal-overlay.open { display: flex; animation: fade .15s ease both; }
.modal-box { width: 100%; max-width: 440px; margin: auto; padding: 20px; text-align: center; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r); animation: pop .22s var(--ease) both; }
.modal-box img { max-width: 100%; margin-bottom: 10px; border-radius: 2px; }

/* ====== Struktur ====== */
.rank-group { margin-bottom: 22px; }
.rank-group-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; padding-bottom: 6px; font-family: var(--f-disp); font-size: 20px; font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); }
.rank-group-title .count { font-family: var(--f-body); font-size: 12px; font-weight: 500; color: var(--muted); }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; content-visibility: auto; contain-intrinsic-size: auto 400px; }
.member-card { padding: 14px 10px; text-align: center; background: #fff; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; transition: border-color .15s, background-color .15s; }
.member-card .m-name, .member-card .m-username { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-card .m-name { font-size: 13.5px; font-weight: 600; }
.member-card .m-username { margin-top: 2px; font-size: 11.5px; color: var(--faint); }
.avatar-upload-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 16px; }
.avatar-upload-circle { display: flex; align-items: center; justify-content: center; width: 90px; height: 90px; overflow: hidden; font-size: 11px; text-align: center; color: var(--faint); background-size: cover; background-position: center; border: 2px dashed #dcafc1; border-radius: 50%; cursor: pointer; transition: border-color .15s; }

/* ====== Hover (khusus perangkat bermouse) ====== */
@media (hover: hover) {
  .btn-primary:hover { background: var(--rose-deep); }
  .btn-secondary:hover { background: #fde4ee; }
  .filter-btn:hover { border-color: var(--ink); }
  .member-card:hover { border-color: var(--ink); background: #fff6f9; }
  .avatar-upload-circle:hover { border-color: var(--red); }
  #nav-links a:hover { color: var(--ink); }
  #nav-links a:hover::after { transform: scaleX(1); }
  #nav-menu a:hover, #profile-menu button:hover { background: #fde9f0; color: var(--red); }
  tbody tr:hover { background: #fff0f5; }
  .btn-dc:hover { background: #4752c4; }
  .panel-h a:hover { color: var(--red); }
}

/* ====== Profil / warga ====== */
.logo-svg { display: block; }
.wrap { width: 100%; max-width: 980px; margin: 22px auto 70px; padding: 0 16px; }
.lbl { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; line-height: 1.6; white-space: nowrap; border-radius: 3px; }
.lbl.sm { font-size: 10.5px; padding: 0 6px; }
.lbl.hc { background: var(--red); color: #fff; }
.lbl.anggota { background: #e4ebfa; color: var(--blue); }
.lbl.warga { background: #f8e5ec; color: var(--muted); }
.lbl.pangkat { background: #fff; color: var(--muted); border: 1px solid var(--border); }
.lbl.custom { background: #ece6fa; color: #5b3fb0; }
.lbl .dcdot { display: inline-block; width: 6px; height: 6px; background: #5865F2; border-radius: 50%; }
.lbls { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }

.hero { margin-bottom: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); }
.hero-banner { height: 120px; background-color: var(--ink); background-size: cover; background-position: center; border-bottom: 4px solid var(--red); }
.hero-body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; padding: 0 22px 20px; }
.hero-ava { position: relative; z-index: 1; width: 96px; height: 96px; margin-top: -48px; font-size: 30px; border: 4px solid #fff; }
.hero-main { flex: 1; min-width: min(220px, 100%); padding-top: 12px; }
.hero-name { margin: 0 0 6px; font-family: var(--f-disp); font-size: 28px; font-weight: 700; color: var(--ink); word-break: break-word; }
.hero-bio { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.hero-bio.kosong { font-style: italic; color: var(--faint); }
.hero-meta { margin-top: 10px; font-size: 12px; color: var(--faint); }
.hero-act { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
.btn-dc { background: #5865F2; color: #fff; }
.btn-a { display: inline-block; text-align: center; }

.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { min-width: 0; margin-bottom: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px; font-family: var(--f-disp); font-size: 19px; font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); }
.panel-h a { font-family: var(--f-body); font-size: 13px; font-weight: 600; color: var(--muted); }
.panel-b { padding: 16px 18px; }
.panel .kosong { padding: 22px 18px; font-size: 13px; text-align: center; color: var(--faint); }
.strip { display: flex; gap: 12px; padding: 14px 16px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: #e8c4d2; }
.ad { flex: 0 0 min(240px, 80%); overflow: hidden; scroll-snap-align: start; background: #fff; border: 1px solid var(--border); border-radius: var(--r); }
.ad img { display: block; width: 100%; height: 124px; object-fit: cover; }
.ad div { max-height: 96px; padding: 10px 12px; overflow: hidden; font-size: 13px; color: var(--muted); white-space: pre-wrap; }
.skel { background: #f6dce6; border-radius: var(--r); animation: pulse 1.2s ease-in-out infinite; }

.sw { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--r); }
.sw b { display: block; font-size: 14px; color: var(--text); }
.sw small { font-size: 12px; color: var(--muted); }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw .knob { position: relative; flex-shrink: 0; width: 44px; height: 24px; background: #e8c4d2; border-radius: 12px; cursor: pointer; transition: background-color .2s; }
.sw .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .25s var(--ease); }
.sw input:checked + .knob { background: var(--red); }
.sw input:checked + .knob::after { transform: translateX(20px); }
.sw input:focus-visible + .knob { outline: 2px solid var(--blue); outline-offset: 2px; }
.note { padding: 10px 13px; font-size: 13px; line-height: 1.6; color: var(--muted); background: #fff6f9; border: 1px dashed #dcafc1; border-radius: var(--r); }
.note b { color: var(--text); }
.okmsg { min-height: 16px; margin-top: 10px; font-size: 13px; color: var(--green); }
.counter { margin-top: 4px; font-size: 12px; text-align: right; color: var(--faint); }

/* ====== Responsif ====== */
@media (max-width: 820px) { .cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .navbar { gap: 10px; padding: 8px 12px; }
  .navbar .brand { font-size: 17px; }
  .navbar .user .info { display: none; }
  #nav-links a, #nav-links span.active { padding: 8px 9px; font-size: 13px; }
  .marquee-text { font-size: 11.5px; }
  .container { padding: 16px 12px 56px; }
  .card { padding: 16px; }
  .card h2 { font-size: 20px; }
  .stat-card .value { font-size: 32px; }
  .tabs { flex-wrap: wrap; gap: 6px; }
  .tabs .btn { flex: 1 1 calc(50% - 6px); padding: 10px 8px; font-size: 13px; }
  .card > div[style*="justify-content:space-between"] { flex-direction: column; align-items: stretch !important; }
  #reset-btn { width: 100%; }
  .form-row { flex-direction: column; }
  .form-row > *, .radio-option { min-width: 0; }
  /* 16px = iOS nggak auto-zoom saat input difokus */
  input[type=text], input[type=date], input[type=time], input[type=password], input[type=file], select, textarea { font-size: 16px; }
  table { font-size: 12.5px; }
  .wrap { margin-top: 14px; padding: 0 12px; }
  .hero-banner { height: 92px; }
  .hero-ava { width: 80px; height: 80px; margin-top: -40px; font-size: 24px; }
  .hero-body { gap: 12px; padding: 0 16px 18px; }
  .hero-name { font-size: 24px; }
  .modal-box { padding: 16px; }
  .login-card { padding: 28px 20px 22px; }
}
@media (max-width: 420px) {
  .navbar .brand .brand-name { display: none; }
  .tabs .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
