/* ==========================================================================
   Nusa Politik — style.css
   Tema: Merah UMNO + Emas + Putih, Dark Mode UI
   Pendekatan: mobile-first (asas = skrin kecil). Peningkatan skrin besar
   berada dalam responsive.css.
   ========================================================================== */

/* ---------- 1. Token Rekabentuk ---------- */
:root {
  /* Warna jenama */
  --red: #C8102E;
  --red-dark: #9B0C23;
  --red-light: #E8344F;
  --gold: #F2B705;
  --gold-dark: #C99700;
  --gold-light: #FFD84D;
  --white: #FFFFFF;

  /* Permukaan gelap */
  --bg: #0E0F13;
  --bg-elev-1: #16181E;
  --bg-elev-2: #1D2028;
  --bg-elev-3: #262A34;
  --border: #2E333F;
  --border-soft: #232731;

  /* Teks */
  --text: #F4F5F7;
  --text-muted: #A3A9B8;
  --text-dim: #717789;

  /* Semantik */
  --success: #2ECC71;
  --warning: #F2B705;
  --danger: #FF4D5E;
  --info: #4DA3FF;

  /* Bentuk */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .35);
  --shadow: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-red: 0 6px 22px rgba(200, 16, 46, .35);
  --shadow-gold: 0 6px 22px rgba(242, 183, 5, .28);

  /* Jarak */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Taip */
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;   /* v13.0: fon tempatan (assets/fonts, css/tema.css) */
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;

  --header-h: 60px;
  --bottom-nav-h: 64px;
  --transition: .2s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- 2. Reset & Asas ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(200, 16, 46, .22), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(242, 183, 5, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

img, svg, video { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 var(--space-3);
  letter-spacing: -.01em;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p  { margin: 0 0 var(--space-3); color: var(--text-muted); }

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--red); color: var(--white); }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--bg-elev-3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-elev-3); border-radius: 8px; }

/* ---------- 3. Susun Atur ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: var(--space-4);
}

.page { padding-block: var(--space-4) var(--space-6); }

.page-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
}
.page-title h1 { margin: 0; }
.page-title p  { margin: 0; }

.grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row--between { justify-content: space-between; }

.text-gold   { color: var(--gold); }
.text-red    { color: var(--red-light); }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.hidden      { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- 4. Header & Navigasi ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding-inline: var(--space-4);
  background: rgba(14, 15, 19, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.app-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
}
.brand:hover { color: var(--white); }
.brand__logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: var(--gold);
  font-weight: 800;
  box-shadow: var(--shadow-red);
}
.brand__sub { color: var(--gold); font-weight: 600; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }

.nav { display: none; }                 /* dipaparkan pada skrin lebar */
.nav-link {
  padding: .5rem .9rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: .95rem;
}
.nav-link:hover { color: var(--white); background: var(--bg-elev-2); }
.nav-link.is-active { color: var(--bg); background: var(--gold); }

/* Navigasi bawah (telefon) */
.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  height: var(--bottom-nav-h);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgba(22, 24, 30, .95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  font-size: .7rem;
  color: var(--text-dim);
}
.bottom-nav a .icon { font-size: 1.3rem; line-height: 1; }
.bottom-nav a.is-active { color: var(--gold); }
body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }

/* ---------- 5. Hero (index.html) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-6) var(--space-4);
  border-radius: var(--radius-lg);
  text-align: center;
  background:
    linear-gradient(160deg, rgba(200, 16, 46, .92), rgba(120, 8, 28, .95)),
    var(--red);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: var(--shadow-red);
}
.hero::before {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  right: -80px; top: -80px;
  background: radial-gradient(circle, rgba(242, 183, 5, .45), transparent 65%);
  pointer-events: none;
}
.hero__eyebrow {
  display: inline-block;
  padding: .25rem .8rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .3);
  color: var(--gold-light);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.hero h1 { font-size: 2rem; color: #fff; margin-bottom: var(--space-3); }
.hero h1 span { color: var(--gold-light); }
.hero p { color: rgba(255, 255, 255, .85); max-width: 52ch; margin-inline: auto; }
.hero__cta { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-5); }

/* ---------- 6. Butang ---------- */
.btn {
  --btn-bg: var(--bg-elev-3);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;                      /* sasaran sentuh mesra jari */
  padding: .65rem 1.25rem;
  font: 600 .95rem/1 var(--font-body);
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition), box-shadow var(--transition),
              background var(--transition), filter var(--transition);
}
.btn:hover  { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .45; cursor: not-allowed; transform: none; filter: none;
}

.btn--primary {
  --btn-bg: linear-gradient(135deg, var(--red-light), var(--red) 55%, var(--red-dark));
  --btn-fg: var(--white);
  box-shadow: var(--shadow-red);
}
.btn--gold {
  --btn-bg: linear-gradient(135deg, var(--gold-light), var(--gold) 55%, var(--gold-dark));
  --btn-fg: #2B2100;
  box-shadow: var(--shadow-gold);
}
.btn--ghost {
  --btn-bg: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(242, 183, 5, .06); }
.btn--danger { --btn-bg: #3A1218; --btn-fg: var(--danger); border-color: rgba(255, 77, 94, .4); }
.btn--sm    { min-height: 36px; padding: .4rem .85rem; font-size: .85rem; border-radius: 10px; }
.btn--lg    { min-height: 54px; padding: .9rem 1.75rem; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn--icon  { min-width: 46px; padding: .6rem; }

.btn-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- 7. Kad (Dashboard Cards) ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card--interactive { cursor: pointer; }
.card--interactive:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow), 0 0 0 1px rgba(242, 183, 5, .25);
}

.card--red  { border-color: rgba(200, 16, 46, .55); background: linear-gradient(180deg, rgba(200, 16, 46, .16), var(--bg-elev-1)); }
.card--gold { border-color: rgba(242, 183, 5, .5);  background: linear-gradient(180deg, rgba(242, 183, 5, .12), var(--bg-elev-1)); }
.card--accent::before {
  content: "";
  position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(var(--red), var(--gold));
}

.card__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.card__title {
  display: flex; align-items: center; gap: var(--space-2);
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.card__icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(242, 183, 5, .12);
  color: var(--gold);
  font-size: 1.15rem;
}
.card__body   { color: var(--text-muted); font-size: .95rem; }
.card__footer {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border);
  display: flex; gap: var(--space-2); flex-wrap: wrap;
}

/* Profil pemain */
.profile-card { display: flex; gap: var(--space-4); align-items: center; }
.avatar {
  flex: none;
  width: 68px; height: 68px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border: 3px solid var(--gold);
  box-shadow: var(--shadow-red);
}
.profile-card__name { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--white); }
.profile-card__meta { font-size: .85rem; color: var(--text-muted); margin: 2px 0 var(--space-2); }

/* ---------- 8. Panel Statistik ---------- */
.stats-panel {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.stats-panel__title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 var(--space-3);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
}

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.stat {
  padding: var(--space-3);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.stat__label {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stat__value {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat__value--gold { color: var(--gold); }
.stat__value--red  { color: var(--red-light); }
.stat__delta { font-size: .75rem; font-weight: 600; }
.stat__delta.is-up   { color: var(--success); }
.stat__delta.is-up::before   { content: "▲ "; }
.stat__delta.is-down { color: var(--danger); }
.stat__delta.is-down::before { content: "▼ "; }

/* Senarai statistik berbaris */
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li {
  display: flex; justify-content: space-between; gap: var(--space-3);
  padding: .6rem 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: .92rem;
}
.stat-list li:last-child { border-bottom: 0; }
.stat-list b { color: var(--white); }

/* ---------- 9. Lencana Jawatan (Office Badges) ---------- */
.badge-office {
  --badge-c1: var(--bg-elev-3);
  --badge-c2: var(--border);
  --badge-fg: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .3rem .75rem .3rem .45rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--badge-fg);
  background: linear-gradient(135deg, var(--badge-c1), var(--badge-c2));
  border: 1px solid rgba(255, 255, 255, .12);
  white-space: nowrap;
}
.badge-office::before {
  content: "★";
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .28);
  font-size: .7rem;
}
/* Hierarki jawatan */
.badge-office--ahli        { --badge-c1: #E4E8F2; --badge-c2: #E4E8F2; --badge-fg: #111; border: 2px solid #111; }   /* v7.19: kontras pada latar putih */
.badge-office--ahli::before { background: #3A3F4C; color: #fff; }
.badge-office--cawangan    { --badge-c1: #2B6CB0; --badge-c2: #1E4E82; --badge-fg: #fff; }
.badge-office--bahagian    { --badge-c1: #2F9E6B; --badge-c2: #1F7550; --badge-fg: #fff; }
.badge-office--mt          { --badge-c1: #7A4DD8; --badge-c2: #5A34A8; --badge-fg: #fff; }
.badge-office--menteri     { --badge-c1: var(--red-light); --badge-c2: var(--red-dark); --badge-fg: #fff; }
.badge-office--naib        { --badge-c1: #FF8A3D; --badge-c2: #D85F12; --badge-fg: #fff; }
.badge-office--timbalan    { --badge-c1: var(--gold-light); --badge-c2: var(--gold-dark); --badge-fg: #2B2100; }
.badge-office--presiden,
.badge-office--pm {
  --badge-c1: var(--gold-light); --badge-c2: var(--red);
  --badge-fg: #fff;
  box-shadow: 0 0 0 2px rgba(242, 183, 5, .35), var(--shadow-gold);
  animation: glow 2.6s ease-in-out infinite;
}

.badge {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--bg-elev-3);
  color: var(--text-muted);
}
.badge--success { background: rgba(46, 204, 113, .15); color: var(--success); }
.badge--danger  { background: rgba(255, 77, 94, .15);  color: var(--danger); }
.badge--gold    { background: rgba(242, 183, 5, .15);  color: var(--gold); }
.badge--red     { background: rgba(200, 16, 46, .2);   color: var(--red-light); }

/* Tangga kerjaya */
.career-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.career-ladder li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: .65rem .85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
}
.career-ladder li.is-done    { color: var(--text-muted); border-color: rgba(46, 204, 113, .35); }
.career-ladder li.is-current { color: var(--white); border-color: var(--gold); background: rgba(242, 183, 5, .08); }

/* ---------- 10. Bar Kemajuan ---------- */
.progress-wrap { display: grid; gap: 6px; }
.progress__label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .82rem;
  color: var(--text-muted);
}
.progress__label b { color: var(--white); font-variant-numeric: tabular-nums; }

.progress {
  --progress: 0%;
  --bar-a: var(--gold);
  --bar-b: var(--gold-dark);
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--bg-elev-3);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5);
}
.progress__bar {
  height: 100%;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bar-b), var(--bar-a));
  transition: width .8s cubic-bezier(.22, 1, .36, 1);
  position: relative;
}
.progress__bar::after {                 /* kilauan bergerak */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 2.2s linear infinite;
}
.progress--lg { height: 18px; }
.progress--sm { height: 7px; }

.progress--red     { --bar-a: var(--red-light); --bar-b: var(--red-dark); }
.progress--success { --bar-a: #5BE38F; --bar-b: #1E9A52; }
.progress--info    { --bar-a: #7DBEFF; --bar-b: #2B73C4; }
.progress--danger  { --bar-a: #FF7A87; --bar-b: #C21F30; }

/* Bar mengikut tahap (gunakan data-level di JS) */
.progress[data-level="low"]  { --bar-a: #FF7A87; --bar-b: #C21F30; }
.progress[data-level="mid"]  { --bar-a: var(--gold-light); --bar-b: var(--gold-dark); }
.progress[data-level="high"] { --bar-a: #5BE38F; --bar-b: #1E9A52; }

/* ---------- 11. Borang ---------- */
.field { display: grid; gap: 6px; margin-bottom: var(--space-4); }
.field[hidden] { display: none; }                          /* v13.2: medan tersembunyi (cth. Sayap dalaman PBB) tidak lagi muncul untuk parti lain */
.field label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: .65rem .9rem;
  font: inherit;
  font-size: 16px;                       /* elak zoom automatik iOS */
  color: var(--text);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 183, 5, .2);
}

/* ---------- 12. Pilihan Keputusan & Log ---------- */
.choice-list { display: grid; gap: var(--space-3); }
.choice {
  display: flex; flex-direction: column; gap: 4px;
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  color: var(--text);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}
.choice:hover { border-color: var(--gold); background: var(--bg-elev-3); transform: translateX(3px); }
.choice__title { font-weight: 700; color: var(--white); }
.choice__desc  { font-size: .85rem; color: var(--text-muted); }
.choice__fx    { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.event-log {
  max-height: 280px;
  overflow-y: auto;
  display: grid; gap: var(--space-2);
  padding-right: 4px;
}
.event-log__item {
  padding: .65rem .85rem;
  border-left: 3px solid var(--gold);
  background: var(--bg-elev-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .88rem;
  color: var(--text-muted);
  animation: slide-in .35s ease both;
}
.event-log__item time { display: block; font-size: .72rem; color: var(--text-dim); }
.event-log__item.is-good { border-left-color: var(--success); }
.event-log__item.is-bad  { border-left-color: var(--danger); }

/* ---------- 13. Jadual ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 480px; }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-soft); }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); background: var(--bg-elev-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(242, 183, 5, .05); }

/* ---------- 14. Modal Popup ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(5, 6, 9, .75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s ease;
}
.modal-overlay.is-open { display: flex; opacity: 1; }

.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--border);
  border-top: 4px solid var(--red);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), 0 0 60px rgba(200, 16, 46, .18);
  animation: modal-in .3s cubic-bezier(.22, 1, .36, 1) both;
}
.modal--gold { border-top-color: var(--gold); }
.modal--wide { max-width: 760px; }

.modal__header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-3);
}
.modal__title { margin: 0; font-size: 1.2rem; color: var(--white); }
.modal__close {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 1.3rem; line-height: 1;
  color: var(--text-muted);
  background: var(--bg-elev-3);
  border: 0; border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.modal__close:hover { background: var(--red); color: var(--white); }
.modal__body {
  padding: 0 var(--space-4) var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal__footer {
  display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: 1px solid var(--border-soft);
}
body.modal-open { overflow: hidden; }

/* Modal peristiwa (event) */
.modal__banner {
  display: grid; place-items: center;
  height: 110px;
  margin: 0 var(--space-4) var(--space-3);
  border-radius: var(--radius);
  font-size: 3rem;
  background: linear-gradient(135deg, var(--red), var(--red-dark) 60%, #4a0612);
}
.modal__banner--gold { background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)); }

/* ---------- 15. Toast / Notifikasi ---------- */
.toast-stack {
  position: fixed;
  top: calc(var(--header-h) + 10px);
  right: var(--space-3);
  left: var(--space-3);
  z-index: 200;
  display: grid; gap: var(--space-2);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--space-3);
  padding: .8rem 1rem;
  background: var(--bg-elev-3);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: .9rem;
  animation: slide-in .3s ease both;
}
.toast--success { border-left-color: var(--success); }
.toast--danger  { border-left-color: var(--danger); }

/* ---------- 16. Animasi ---------- */
@keyframes shimmer  { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes glow     { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.2); } }
@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade-up  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.fade-up { animation: fade-up .5s ease both; }
.fade-up:nth-child(2) { animation-delay: .06s; }
.fade-up:nth-child(3) { animation-delay: .12s; }
.fade-up:nth-child(4) { animation-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 17. Footer ---------- */
.app-footer {
  padding: var(--space-5) var(--space-4);
  text-align: center;
  font-size: .8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-soft);
}

/* ---------- 18. Pendaftaran (index.html) — v3.0 ---------- */
/* Gaya khusus borang pendaftaran */
:root { color-scheme: dark; }
option { background: var(--bg-elev-2); color: var(--text); }

.form-section { border: 0; margin: 0 0 var(--space-5); padding: 0; min-width: 0; }
.form-section legend {
  padding: 0; margin-bottom: var(--space-3);
  font: 700 .8rem var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}
.form-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
.form-grid .field { margin-bottom: 0; min-width: 0; }
.field label { display: flex; align-items: center; gap: var(--space-2); }

.step {
  flex: none; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: var(--gold); color: #2B2100;
  font: 700 .72rem var(--font-body);
}
.select:disabled, .input:disabled { opacity: .5; cursor: not-allowed; }
.select { appearance: auto; cursor: pointer; }

.field__error { margin: 0; min-height: 0; font-size: .8rem; color: var(--danger); }
.field__error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--danger) !important; }

.pill-group { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.field label.pill { position: relative; display: block; gap: 0; font-size: inherit; color: var(--text); }
.pill input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pill span {
  display: flex; width: 100%; align-items: center; justify-content: center; min-height: 46px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev-2);
  font-weight: 600; transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.pill input:checked + span { border-color: var(--gold); background: rgba(242, 183, 5, .12); color: var(--gold); }
.pill input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.status { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0 0 var(--space-4); font-size: .85rem; color: var(--text-muted); }
.status__dot { flex: none; width: 9px; height: 9px; margin-top: .45em; border-radius: 50%; background: var(--text-dim); }
.status[data-state="loading"] .status__dot { animation: glow 1s ease-in-out infinite; background: var(--info); }
.status[data-state="sheet"] .status__dot { background: var(--success); }
.status[data-state="cache"] .status__dot,
.status[data-state="fallback"] .status__dot { background: var(--warning); }
.status__text { min-width: 0; flex: 1; }

.info { margin-top: var(--space-4); }
.info[hidden], .status [hidden], #resume[hidden] { display: none; }
.info__name { margin: 0 0 var(--space-3); font-size: 1rem; font-weight: 700; color: var(--white); }
.stat__value { font-size: 1.3rem; }

.form-actions { display: grid; gap: var(--space-3); }
.form-error { margin: 0; font-size: .9rem; color: var(--danger); }
.form-error:empty { display: none; }
.form-note { margin: 0; font-size: .8rem; color: var(--text-dim); }

#resume { margin-bottom: var(--space-4); }
.page > .stack > * + * { margin-top: var(--space-5); }
.hero h1 { margin-bottom: var(--space-2); }
.hero { text-align: left; }
.hero p { margin-inline: 0; }


/* ---- Header bertema ---- */
.brand__img { width: 34px; height: 34px; border-radius: 10px; object-fit: contain; background: rgba(255,255,255,.06); }
.flagbar { height: 6px; background: linear-gradient(90deg, #C8102E 0 33.3%, #FFFFFF 33.3% 66.6%, #1F8A4C 66.6% 100%); }
.hero { padding-top: var(--space-6); }
.hero__band { position: absolute; inset: auto 0 0 0; height: 34px; opacity: .35; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M17 2 32 17 17 32 2 17Z' fill='none' stroke='%23F2B705' stroke-width='1.5'/%3E%3Cpath d='M17 9 25 17 17 25 9 17Z' fill='%23F2B705' fill-opacity='.55'/%3E%3C/svg%3E");
  background-repeat: repeat-x; }
.hero__top { position: relative; display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-3); }
.hero__emblem { flex: none; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 22px;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.18); box-shadow: 0 6px 22px rgba(0,0,0,.35); }
.hero__emblem img { width: 66px; height: 66px; object-fit: contain; }
.hero > *:not(.hero__band) { position: relative; }
.hero { padding-bottom: calc(var(--space-6) + 24px); }

/* ---- Pilihan avatar ---- */
.avatar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
@media (min-width: 640px) { .avatar-grid { grid-template-columns: repeat(5, 1fr); } }
.av { position: relative; display: block; margin: 0; }
.av input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.av__box { display: grid; justify-items: center; gap: 4px; padding: 12px 8px; text-align: center;
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev-2);
  transition: border-color var(--transition), background var(--transition), transform var(--transition); }
.av__box svg { width: 72px; height: 72px; }
.av__nama { font-weight: 700; color: var(--white); }
.av__desc { font-size: .72rem; color: var(--text-muted); line-height: 1.25; }
.av input:checked + .av__box { border-color: var(--gold); background: rgba(242,183,5,.12); transform: translateY(-2px); }
.av input:focus-visible + .av__box { outline: 3px solid var(--gold); outline-offset: 2px; }
.av__saran { display: none; margin-top: 4px; font-size: .68rem; font-weight: 700; color: var(--gold); }
.av.is-saran .av__saran { display: block; }
.avatar-hint { margin: var(--space-3) 0 0; font-size: .8rem; color: var(--text-dim); }
.preview-avatar { display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-3); }
.preview-avatar svg { width: 64px; height: 64px; flex: none; }
.preview-avatar b { color: var(--white); display: block; }
.preview-avatar span { font-size: .8rem; color: var(--text-muted); }

@media (min-width: 640px) {
  .form-grid--nama { grid-template-columns: 1fr 1fr; }
  .form-grid--nama .field--wide { grid-column: 1 / -1; }
  .form-grid--lokasi { grid-template-columns: 1fr 1fr; }
}

/* ---- v3.0: Hero bertema dengan ilustrasi ---- */
.hero--reg { display: grid; gap: var(--space-4); align-items: center; padding-bottom: calc(var(--space-6) + 30px);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(242,183,5,.28), transparent 55%),
    linear-gradient(160deg, #D3142F 0%, #8E0B22 62%, #5A0716 100%); }
.hero--reg::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.4px); background-size: 18px 18px; }
.hero__copy { position: relative; z-index: 1; }
.hero__art { position: relative; z-index: 1; width: 100%; max-width: 420px; margin-inline: auto; }
.hero__art svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 22px rgba(0,0,0,.4)); }
.hero__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: .35rem .75rem; border-radius: 999px;
  background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.16); color: #fff;   /* v7.19: hero sentiasa gelap, jadi teks mesti putih (tema cerah menetapkan --white ke hitam) */
  font: 600 .78rem var(--font-body); }
.chip b { color: var(--gold-light); }
.chip svg { width: 14px; height: 14px; flex: none; }
.hero--reg .hero__top { margin-bottom: var(--space-2); }
.hero--reg .hero__emblem { width: 64px; height: 64px; border-radius: 18px; }
.hero--reg .hero__emblem img { width: 50px; height: 50px; }
.hero--reg h1 { font-size: 1.85rem; line-height: 1.15; }
@media (min-width: 760px) {
  .hero--reg { grid-template-columns: 1.15fr .85fr; }
  .hero--reg h1 { font-size: 2.4rem; }
}

/* ---- Cara bermain ---- */
.howto { display: grid; gap: var(--space-3); grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
.howto li { position: relative; display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4);
  border-radius: var(--radius); background: var(--bg-elev-1); border: 1px solid var(--border);
  overflow: hidden; }
.howto li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--gold)); }
.howto__ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  background: color-mix(in srgb, var(--c, var(--gold)) 18%, transparent); color: var(--c, var(--gold)); }
.howto__ico svg { width: 24px; height: 24px; }
.howto h3 { margin: 0 0 2px; font-size: .95rem; color: var(--white); }
.howto p { margin: 0; font-size: .82rem; color: var(--text-muted); line-height: 1.4; }
@media (min-width: 760px) { .howto { grid-template-columns: repeat(3, 1fr); } }

/* ---- Stepper borang ---- */
.stepper { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font: 600 .74rem var(--font-body); color: var(--text-dim); }
.stepper li:first-child { flex: none; }
.stepper li + li::before { content: ""; flex: 1; height: 2px; min-width: 10px; background: var(--border); border-radius: 2px; }
.stepper__n { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--border); background: var(--bg-elev-2); color: var(--text-muted); transition: all var(--transition); }
.stepper__t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper li.is-done { color: var(--gold); }
.stepper li.is-done .stepper__n { background: var(--gold); border-color: var(--gold); color: #2B2100; }
.stepper li.is-done + li::before { background: var(--gold); }
@media (max-width: 479.98px) { .stepper__t { display: none; } }

/* ---- Seksyen borang sebagai panel ---- */
#reg-form .form-section { padding: var(--space-4); border: 1px solid var(--border-soft); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.025), transparent); }
#reg-form .form-section legend { display: flex; align-items: center; gap: 8px; padding: 0 var(--space-2); margin-left: calc(var(--space-2) * -1); }
.legend-ico { width: 18px; height: 18px; flex: none; }
#reg-form .input, #reg-form .select { min-height: 46px; }

/* ---- Panel sisi: takwim ringkas ---- */
.mini-takwim { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 0 0 var(--space-3); }
.mini-takwim i { display: block; height: 26px; border-radius: 5px; background: var(--c); opacity: .9;
  font: 700 .62rem/26px var(--font-body); font-style: normal; text-align: center; color: rgba(0,0,0,.65); }
.mini-legend { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .78rem; color: var(--text-muted); }
.mini-legend li { display: flex; align-items: center; gap: 8px; }
.mini-legend b { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.mini-legend span { color: var(--white); font-weight: 600; margin-right: 4px; }
.career-ladder li { position: relative; }

/* ---- v3.5: logo header lebih seimbang ---- */
.brand { gap: 10px; }
.brand__img { width: 40px; height: 40px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.brand > span { font-weight: 800; letter-spacing: .01em; }
@media (max-width: 480px) { .brand__img { width: 34px; height: 34px; } }

/* ---- v3.5: kad Lagu Rasmi & Pemain Audio (Spotify) ---- */
.lagu { position: relative; overflow: hidden; }
.lagu__kepala { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; padding: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; }
.lagu__ikon { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(30,215,96,.14); color: #1ED760; }
.lagu__ikon svg { width: 18px; height: 18px; }
.lagu__tajuk { flex: 1; min-width: 0; margin: 0; font: 700 .95rem var(--font-body, inherit); color: var(--white, #fff); line-height: 1.25; }
.lagu__tajuk small { display: block; font-weight: 500; font-size: .74rem; color: var(--text-muted, #A3A9B8); }
.lagu__tog { flex: none; font-size: .8rem; color: var(--gold, #F5B800); transition: transform .2s; }
.lagu.is-buka .lagu__tog { transform: rotate(180deg); }
.lagu__badan { margin-top: 12px; border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.25); min-height: 152px; }
.lagu__badan[hidden] { display: none; }
.lagu__badan iframe { display: block; width: 100%; height: 152px; border: 0; border-radius: 12px; color-scheme: normal; }
.lagu__nota { margin: 10px 2px 0; font-size: .72rem; line-height: 1.45; color: var(--text-muted, #A3A9B8); }
/* Dashboard: panel terapung bawah header */
.lagu-btn { display: inline-flex; align-items: center; gap: 6px; }
.lagu-btn svg { width: 14px; height: 14px; color: #1ED760; }
.lagu-pop { position: fixed; z-index: 60; top: 64px; right: 16px; width: min(380px, calc(100vw - 32px)); box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.lagu-pop[hidden] { display: none; }
@media (max-width: 600px) { .lagu-btn span { display: none; } .lagu-pop { top: 58px; right: 16px; left: 16px; width: auto; } }
/* v3.5: lambang pada hero perlu latar cerah supaya merah logo jelas */
.hero__emblem { background: rgba(255,255,255,.95) !important; box-shadow: 0 6px 18px rgba(0,0,0,.35) !important; }
.lagu__kepala[hidden]{display:none}.lagu-pop .lagu__badan{margin-top:0}

/* ---- v3.6: Tataetika & Disiplin ---- */
.etika .meter { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin: 2px 0 10px; }
.etika .meter > i { display: block; height: 100%; border-radius: inherit; background: var(--gold, #F5B800); transition: width .3s; }
.etika .meter--baik > i { background: #34C27A; }
.etika .meter--amaran > i { background: #F5B800; }
.etika .meter--bahaya > i { background: #E5484D; }
.badge--bersih { background: rgba(52,194,122,.16); color: #4FD28F; }
.badge--kelabu { background: rgba(245,184,0,.15); color: #F5B800; }
.badge--kotor { background: rgba(229,72,77,.16); color: #FF6B70; }
.choice--bersih { border-left: 3px solid #34C27A; }
.choice--kelabu { border-left: 3px solid #F5B800; }
.choice--kotor { border-left: 3px solid #E5484D; }

/* ==========================================================================
   v4.4 — Menu utama bergaya kertas undi (index.html #menu)
   Latar (inline pada #menu): foto menara-dato-onn.jpg jika ada, di atas ilustrasi menara-dato-onn.svg.
   ========================================================================== */
body.menu-aktif { overflow: hidden; }
.menu {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background-color: #0E0F13;
  background-size: cover; background-repeat: no-repeat;
  background-position: center, 55% 30%, center bottom;
}
@media (min-aspect-ratio: 1/1) { .menu { background-position: center, center 30%, center 78%; } }
.menu[hidden] { display: none; }
.menu__dalam { max-width: 480px; margin: 0 auto; padding: 28px 16px 96px; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }

/* kertas undi */
.kertas {
  --dakwat: #1b1a22; --kertas: #f5efdd; --merah: #c8102e;
  position: relative; color: var(--dakwat); background-color: var(--kertas);
  background-image: radial-gradient(rgba(120, 100, 60, .10) 1px, transparent 1.2px), linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(0, 0, 0, .04));
  background-size: 5px 5px, 100% 100%;
  border-radius: 4px; padding: 0 20px 18px; transform: rotate(-.6deg);
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 rgba(0, 0, 0, .15), 0 22px 44px rgba(0, 0, 0, .55);
}
.kertas__jalur { height: 10px; margin: 0 -20px 16px; border-radius: 4px 4px 0 0;
  background: repeating-linear-gradient(90deg, var(--merah) 0 22px, #fff 22px 30px, #f2b705 30px 52px, var(--dakwat) 52px 60px); }
.kertas__kepala { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 3px double var(--dakwat); position: relative; }
.kertas__logo { width: 56px; height: 56px; object-fit: contain; flex: none; border-radius: 8px; background: #fff; padding: 4px; box-shadow: 0 0 0 2px var(--dakwat); }
.kertas__kecil { margin: 0; font: 700 .7rem/1 var(--font-body); letter-spacing: .28em; text-transform: uppercase; color: #5a5545; }
.kertas__tajuk { margin: 5px 0 0; font: 800 clamp(1.5rem, 7vw, 2rem)/1 var(--font-display); text-transform: uppercase; letter-spacing: .02em; color: var(--dakwat); }
.kertas__cop { position: absolute; right: 0; top: -2px; transform: rotate(8deg); font: 800 .72rem/1 var(--font-display); letter-spacing: .18em; text-transform: uppercase;
  color: var(--merah); border: 2px solid var(--merah); border-radius: 4px; padding: 4px 7px; opacity: .8; }
.kertas__arahan { margin: 12px 0 6px; font-size: .92rem; line-height: 1.5; color: #3a3729; }

.baris {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; text-decoration: none; color: inherit; font: inherit;
  padding: 12px 6px; background: transparent; border: 0; border-bottom: 1.5px dashed rgba(27, 26, 34, .35); border-radius: 0; position: relative;
  transition: background .12s ease;
}
.baris[hidden] { display: none; }
.baris:hover, .baris:focus-visible { background: linear-gradient(90deg, rgba(242, 183, 5, .35), rgba(242, 183, 5, .12)); }
.baris:focus-visible { outline: 3px solid var(--dakwat); outline-offset: -3px; }
.baris__no { flex: none; width: 26px; font: 800 1.35rem/1 var(--font-display); color: var(--merah); text-align: center; }
.baris__teks { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.baris__teks b { font: 700 1.08rem/1.15 var(--font-display); color: var(--dakwat); }
.baris__teks small { font-size: .84rem; line-height: 1.35; color: #5a5545; }
.baris__kotak { flex: none; position: relative; width: 30px; height: 30px; border: 2.5px solid var(--dakwat); border-radius: 3px; background: rgba(255, 255, 255, .55); }
.baris__kotak::before, .baris__kotak::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3.5px; height: 30px; margin: -15px 0 0 -1.75px; background: var(--merah); border-radius: 2px;
  transform: rotate(45deg) scaleY(0); transition: transform .14s ease; }
.baris__kotak::after { transform: rotate(-45deg) scaleY(0); }
.baris:hover .baris__kotak::before, .baris:focus-visible .baris__kotak::before, .baris:active .baris__kotak::before { transform: rotate(45deg) scaleY(1); }
.baris:hover .baris__kotak::after, .baris:focus-visible .baris__kotak::after, .baris:active .baris__kotak::after { transform: rotate(-45deg) scaleY(1); }

/* Sambung: dicop 'disimpan', dicetak lebih menonjol */
.baris--sambung { background: rgba(200, 16, 46, .07); border-bottom: 2px solid var(--dakwat); padding: 14px 6px; }
.baris--sambung .baris__teks b { font-size: 1.3rem; }
.baris--sambung .baris__teks small { color: var(--merah); font-weight: 600; font-style: italic; }

.kertas__nota { margin: 8px 0 4px; padding: 10px 12px 10px 12px; background: #fff2a8; border: 1px solid #e0c64d; transform: rotate(.5deg); box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.kertas__nota[hidden] { display: none; }
.kertas__nota ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .86rem; line-height: 1.45; color: #3a3320; }

.kertas__kerat { position: relative; margin: 16px -20px 12px; height: 0; border-top: 2px dashed rgba(27, 26, 34, .55); }
.kertas__kerat span { position: absolute; left: 10px; top: -12px; width: 20px; height: 20px; opacity: .7;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1a22' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M20 4 8.1 15.9M14.5 14.5 20 20M8.1 8.1 12 12'/%3E%3C/svg%3E"); }
.kertas__nota-kaki { margin: 0; font-size: .72rem; line-height: 1.5; color: #5a5545; }
@media (prefers-reduced-motion: reduce) { .baris, .baris__kotak::before, .baris__kotak::after { transition: none; } .kertas { transform: none; } }

/* v7.61: butang bahasa BM | EN */
.lang-switch { white-space: nowrap; letter-spacing: .02em; }
.lang-switch [data-lang] { opacity: .55; }
.lang-switch [data-lang].is-on { opacity: 1; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.lang-switch__sep { opacity: .4; }
.menu__bahasa { position: fixed; top: 12px; right: 64px; z-index: 60; }

/* ---------- v12.1: Jemaah Menteri (js/jemaah-ui.js) ---------- */
.jm-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (max-width: 899px) { .jm-imbangan { order: -1; position: sticky; top: 0; z-index: 2; background: var(--bg-elev-1); padding: 8px 0 2px; border-bottom: 2px solid var(--border); } .jm-imbangan .jm-meter { margin-bottom: 6px; } }
@media (min-width: 900px) { .jm-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } .jm-imbangan { position: sticky; top: 12px; } }
.jm-slot { border: 2px solid var(--border); border-radius: var(--radius); padding: 8px 10px 4px; margin: 0 0 10px; }
.jm-slot legend { font-weight: 800; padding: 0 4px; }
.jm-calon { display: flex; gap: 10px; align-items: flex-start; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.jm-calon:hover { background: var(--bg-elev-3); }
.jm-calon input { margin-top: 4px; accent-color: #5B2A86; width: 18px; height: 18px; flex: none; }
.jm-calon small { display: block; color: var(--text-muted); font-size: .8rem; }
.jm-tag { display: inline-block; border: 1.5px solid var(--border); border-radius: 999px; padding: 0 7px; font-size: .72rem; font-weight: 700; margin: 0 3px 0 0; white-space: nowrap; color: #111; }
.jm-tag--anda { background: #FFD6DD; } .jm-tag--rakan { background: #D6E6FF; } .jm-tag--borneo { background: #D8F2E0; } .jm-tag--pencabar { background: #FFE0B3; }
.jm-meter { margin: 0 0 10px; }
/* v13.46: pilih TPM, portfolio (select), semakan struktur parti */
.jm-grid > div, .jm-slot { min-width: 0; } .jm-port span { flex: 1 1 auto; min-width: 0; } .jm-port select { flex: 0 1 62%; width: 62%; }
.jm-port { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 2px; border-top: 1.5px dashed var(--border); font-size: .88rem; }
.jm-port select { max-width: 62%; min-width: 0; font: inherit; font-size: .8rem; padding: 4px 6px; border: 2px solid var(--border); border-radius: 8px; background: var(--bg-elev-1); color: var(--text); }
.jm-lain summary { font-weight: 800; cursor: pointer; padding: 4px 0 6px; }
.jm-semak { list-style: none; margin: 4px 0 8px; padding: 0; font-size: .82rem; }
.jm-semak li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.jm-ok { color: var(--success); } .jm-amaran { color: var(--danger); }
.jm-jp { display: block; color: var(--text-muted); font-size: .72rem; }
.jm-meter__t { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 700; }
.jm-meter__b { height: 12px; border: 2px solid var(--border); border-radius: 4px; overflow: hidden; margin-top: 3px; background: var(--bg-elev-2); }
.jm-meter__b i { display: block; height: 100%; }
.jm-meter small { color: var(--text-muted); font-size: .78rem; }
.jm-senarai { margin-top: 10px; }
.jm-senarai summary { cursor: pointer; font-weight: 700; }
.jm-jadual { overflow-x: auto; }
.jm-jadual table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 560px; }
.jm-jadual th, .jm-jadual td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.jm-jadual tr.is-anda td { background: var(--bg-elev-3); font-weight: 700; }

/* ---------- v12.2: Isu Semasa (js/isu-ui.js) ---------- */
.isu-kad { border-left: 8px solid var(--red); }
.isu-label { margin: 0 0 4px; font-size: .78rem; font-weight: 800; color: var(--text-muted); }

/* v13.7: butang maklum balas disembunyikan sehingga pautan borang ditetapkan (js/maklumbalas.js) */
[data-maklumbalas][hidden] { display: none !important; }

/* v13.10: lencana jawatan yang panjang (cth. portfolio Menteri) dibalut ke baris seterusnya supaya halaman tidak melebar ke kanan di telefon */
.badge-office { white-space: normal; max-width: 100%; text-align: left; line-height: 1.25; overflow-wrap: anywhere; }
.badge-office::before { flex: none; }
.dash-profile__info, #p-jawatan-lain { min-width: 0; max-width: 100%; }
#p-jawatan-lain { display: inline-flex; flex-wrap: wrap; gap: 8px; }
#p-jawatan-lain[hidden] { display: none; }
html, body { overflow-x: clip; }

/* v13.47: PRK luar kawasan */
.prkl-aktif { border: 2px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin: 6px 0; background: var(--bg-elev-2); }
.prkl-aktif small, .prkl-act small, .prkl-sejarah small { display: block; color: var(--text-muted); font-size: .78rem; }
.prkl-bar { height: 14px; border: 2px solid var(--border); border-radius: 6px; overflow: hidden; background: #6B7387; margin: 3px 0; }
.prkl-bar i { display: block; height: 100%; background: var(--danger, #E8344F); }
.prkl-act { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1.5px dashed var(--border); padding: 7px 0; font-size: .88rem; }
.prkl-sejarah { margin-top: 8px; } .prkl-sejarah summary { font-weight: 700; cursor: pointer; } .prkl-sejarah ul { list-style: none; padding: 0; margin: 6px 0 0; font-size: .85rem; } .prkl-sejarah li { padding: 4px 0; border-top: 1.5px dashed var(--border); }

/* v13.50: Ketua Pembangkang */
.pbg-ban { background: #1D3A6E; color: #fff; border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; }
.pbg-ban small { display: block; color: #DBE4FF; font-size: .78rem; }
.pbg-3 { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* v13.51: Lompat Parti */
.lp-opt { display: flex; gap: 8px; align-items: center; border: 2px solid var(--border); border-radius: var(--radius); padding: 7px 10px; margin: 6px 0; cursor: pointer; }
.lp-opt small { display: block; color: var(--text-muted); font-size: .78rem; } .lp-opt--x { opacity: .5; cursor: default; }
.lp-amaran { background: rgba(179, 18, 43, .12); border: 2px solid var(--danger); border-radius: var(--radius); padding: 8px 10px; font-size: .85rem; margin: 6px 0; }
.lp-k { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; padding: 4px 0; border-top: 1.5px dashed var(--border); } .lp-k b { text-align: right; }
.lp-g { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 10px 0 4px; display: flex; align-items: center; gap: 6px; } .lp-g img { height: 14px; width: auto; } .lp-g__m { font-weight: 600; text-transform: none; letter-spacing: 0; }
.lp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lp-chip { position: relative; display: flex; align-items: center; gap: 6px; border: 2px solid var(--border); border-radius: var(--radius); padding: 6px 8px; font-weight: 700; font-size: .85rem; cursor: pointer; min-width: 0; }
.lp-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; } .lp-chip:focus-within { outline: 2px solid var(--accent, #2b6cb0); outline-offset: 1px; }
.lp-chip img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; background: #fff; flex: none; } .lp-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-chip__m { margin-left: auto; font-style: normal; font-size: .8rem; } .lp-chip--on { border-color: var(--danger); background: rgba(179, 18, 43, .08); } .lp-chip--x { opacity: .5; cursor: default; }
.lp-kunci { margin-top: 8px; font-size: .8rem; border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 6px 10px; } .lp-kunci summary { cursor: pointer; font-weight: 700; }
.lp-ring { font-size: .82rem; margin: 6px 0; }

/* v13.52: Yang di-Pertua Negeri (Istana) */
.tyt-ban { background: linear-gradient(135deg, #5B1A6E, #2B0F3A); color: #fff; border-radius: var(--radius); padding: 10px; margin-bottom: 8px; }
.tyt-ban small { display: block; color: #E8D5F2; font-size: .78rem; }
.tyt-bar i { background: #F5C518 !important; }
.tyt-ev { border: 2px solid #5B1A6E; border-radius: var(--radius); padding: 8px 10px; margin: 8px 0; background: rgba(91, 26, 110, .08); }
.tyt-ev small { display: block; color: var(--text-muted); font-size: .8rem; margin-top: 2px; }
.tyt-sy { list-style: none; padding: 0; margin: 0 0 4px; font-size: .85rem; }

/* v13.53: kad BERJASA (Parti Kecil) */
.bj-ban { display: flex; gap: 10px; align-items: center; background: #76094A; color: #fff; border: 2px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.bj-ban img { width: 40px; height: 40px; border-radius: 8px; background: #fff; object-fit: contain; flex: none; }
.bj-ban b { display: block; }
.bj-ban small { color: #F3D1E3; font-size: .78rem; }
.bj-bar i { background: #B0377A; }

/* v13.54: kad GRS (Kerajaan Negeri Sabah) */
.grs-ban { display: flex; gap: 10px; align-items: center; background: #1E5AA8; color: #fff; border: 2px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.grs-ban img { width: 44px; height: 44px; border-radius: 8px; background: #fff; object-fit: contain; flex: none; }
.grs-ban b { display: block; }
.grs-ban small { color: #D6E8FA; font-size: .78rem; }
.grs-dun { display: flex; height: 14px; border: 2px solid var(--border); border-radius: 6px; overflow: hidden; }
.grs-dun i { display: block; height: 100%; }
.grs-bar i { background: #1E5AA8; }

/* v13.55: kad Warisan */
.war-ban { display: flex; gap: 10px; align-items: center; background: #16325C; color: #fff; border: 2px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.war-ban img { width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: contain; flex: none; }
.war-ban b { display: block; }
.war-ban small { color: #BFE3F7; font-size: .78rem; }
.war-bar i { background: #4FB3E8; }
