:root {
  --topbar-h: 50px;
  --gold-hairline: rgba(194, 150, 59, 0.28);
  --gold-glow: rgba(227, 194, 111, 0.16);
}

html, body {
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

/* === MOD BACAAN SEPIA === */
body.sepia {
  --paper: #F4ECD8;
  --surface: #FBF6EA;
  --surface-alt: #EFE5CE;
  --ink: #2C2115;
  --ink-soft: #63513B;
  --border: rgba(92, 68, 36, 0.16);
  --border-gold: rgba(168, 122, 42, 0.42);
}
body.sepia .topbar { background: rgba(44, 33, 21, 0.96) !important; }

/* === BEZEL ATAS ULTRANIPIS & ELEGAN === */
.topbar {
  padding: 6px 20px !important;
  background: rgba(5, 24, 18, 0.94) !important;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(227, 194, 111, 0.22) !important;
}
.topbar-inner {
  max-width: 1280px !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
}
.brand-lockup { gap: 9px !important; flex-shrink: 0; }
.brand-crest {
  width: 28px !important; height: 28px !important; border-radius: 7px !important;
  font-size: 0.8rem !important; border: 1px solid rgba(227, 194, 111, 0.65) !important;
}
.brand-name { font-size: 1.02rem !important; letter-spacing: 0.12em !important; }

.nav-scroll-wrap {
  display: flex; align-items: center; gap: 3px;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding: 2px 0;
}
.nav-scroll-wrap::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 5px 11px !important; font-size: 0.78rem !important;
  white-space: nowrap; border-radius: 7px !important; letter-spacing: 0.01em;
}
.tab-btn.active {
  background: var(--gold-400) !important; color: var(--emerald-950) !important;
  box-shadow: 0 2px 12px rgba(227, 194, 111, 0.26);
}
.nav-utils {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  padding-left: 8px; border-left: 1px solid rgba(227, 194, 111, 0.2);
}
.util-btn {
  padding: 4px 8px !important; font-size: 0.72rem !important;
  border: 1px solid rgba(227, 194, 111, 0.3) !important; border-radius: 6px !important;
  background: transparent; color: rgba(248, 245, 238, 0.86); cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: all 0.16s ease;
}
.util-btn:hover, .util-btn.active {
  background: rgba(227, 194, 111, 0.18); color: #fff; border-color: var(--gold-400) !important;
}
#svInstallBtn { display: none; }
#svInstallBtn.ready { display: inline-flex; }

@media (max-width: 1060px) {
  .topbar-inner { flex-wrap: wrap !important; }
  .nav-scroll-wrap { order: 3; width: 100%; border-top: 1px solid rgba(227, 194, 111, 0.14); padding-top: 6px; }
}

.container {
  max-width: 1200px !important;
  padding: 24px 22px calc(72px + env(safe-area-inset-bottom, 0px)) !important;
}

/* === LANDING PAGE EDITORIAL ($1,000+ HERO) === */
.lp-hero {
  position: relative;
  min-height: clamp(480px, 74dvh, 720px);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(36px, 5.5vw, 64px) clamp(20px, 4vw, 48px) 28px;
  border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(227, 194, 111, 0.32);
  background-image:
    linear-gradient(120deg, rgba(4, 20, 15, 0.93) 0%, rgba(6, 28, 21, 0.76) 52%, rgba(5, 20, 15, 0.88) 100%),
    url('https://files.catbox.moe/6ot2nm.png');
  background-size: cover; background-position: center;
  box-shadow: 0 24px 60px rgba(5, 20, 15, 0.24);
  color: #F8F5EE;
}
.lp-hero-grid {
  display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 32px; align-items: center;
}
@media (max-width: 900px) { .lp-hero-grid { grid-template-columns: 1fr; } }

.lp-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid rgba(227, 194, 111, 0.38);
  background: rgba(5, 29, 22, 0.55);
  color: var(--gold-200); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px;
}
.lp-arabic {
  font-family: 'Amiri', serif; font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  color: var(--gold-200); display: block; margin-bottom: 10px;
}
.lp-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2.1rem, 4.3vw, 3.5rem);
  line-height: 1.1; color: #FBF7EC; margin: 0 0 16px;
}
.lp-lead {
  max-width: 610px; color: rgba(248, 245, 238, 0.86);
  font-size: 1.01rem; line-height: 1.72; margin: 0 0 26px;
}
.lp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lp-btn-ghost {
  background: rgba(255, 255, 255, 0.06); color: #F8F5EE;
  border: 1px solid rgba(248, 234, 196, 0.36);
}
.lp-btn-ghost:hover { border-color: var(--gold-400); background: rgba(227, 194, 111, 0.14); }

.lp-telemetry {
  margin-top: 34px; padding-top: 20px;
  border-top: 1px solid rgba(227, 194, 111, 0.22);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
@media (max-width: 780px) { .lp-telemetry { grid-template-columns: repeat(2, 1fr); } }
.lp-stat {
  text-align: left; font-family: inherit; color: #F8F5EE;
  background: rgba(5, 24, 18, 0.56); border: 1px solid rgba(227, 194, 111, 0.22);
  border-radius: 12px; padding: 14px 16px; cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.lp-stat:hover { transform: translateY(-2px); border-color: var(--gold-400); }
.lp-stat-num { font-family: 'Fraunces', serif; font-size: 1.48rem; color: var(--gold-200); line-height: 1.1; }
.lp-stat-lbl { font-size: 0.77rem; color: rgba(248, 245, 238, 0.78); margin-top: 4px; }

/* === BAR KEMAJUAN GLOBAL === */
.sv-prog-card {
  margin-top: 26px; background: var(--surface);
  border: 1px solid var(--border-gold); border-radius: 16px;
  padding: 20px 24px; box-shadow: var(--shadow-sm);
}
.sv-prog-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.sv-prog-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sv-prog-pill {
  font-size: 0.78rem; padding: 4px 11px; border-radius: 999px;
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--ink-soft);
}
.sv-prog-pill strong { color: var(--ink); }

/* === TEATER VIDEO PENGENALAN === */
.lp-theater {
  margin-top: 28px; padding: clamp(20px, 3vw, 32px);
  border-radius: 18px; border: 1px solid var(--border-gold);
  background: linear-gradient(155deg, var(--emerald-950) 0%, var(--emerald-900) 100%);
  color: #F8F5EE; display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 26px; align-items: center;
  box-shadow: var(--shadow-md);
}
@media (max-width: 900px) { .lp-theater { grid-template-columns: 1fr; } }
.lp-video-frame {
  position: relative; width: 100%; padding-bottom: 56.25%;
  border-radius: 12px; overflow: hidden; border: 1px solid rgba(227, 194, 111, 0.36); background: #000;
}
.lp-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* === BENTO GRID HAB INOVASI === */
.bento-section { margin-top: 38px; }
.bento-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 18px;
}
@media (max-width: 1020px) { .bento-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .bento-grid { grid-template-columns: 1fr; } }

.bento-card {
  text-align: left; font-family: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.bento-card:hover { transform: translateY(-3px); border-color: var(--gold-500); box-shadow: var(--shadow-md); }
.bento-card.flagship {
  grid-column: span 2;
  background: linear-gradient(145deg, var(--emerald-950), var(--emerald-900));
  color: #F8F5EE; border-color: var(--gold-400);
}
@media (max-width: 600px) { .bento-card.flagship { grid-column: span 1; } }
.bento-card.flagship .muted { color: rgba(248, 245, 238, 0.78); }
.bento-tag {
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold-500);
}
.bento-card.flagship .bento-tag { color: var(--gold-200); }
.bento-cta { font-size: 0.82rem; font-weight: 700; color: var(--gold-500); }
.bento-card.flagship .bento-cta { color: var(--gold-400); }

/* === STUDIO KEMBARA 3D & AR (BERSIH, TANPA BAR BAB/1-12 SEMAK) === */
.km-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px;
}
.km-layout { display: grid; grid-template-columns: 1.52fr 0.88fr; gap: 22px; align-items: start; }
@media (max-width: 980px) { .km-layout { grid-template-columns: 1fr; } }

.km-stage-wrap {
  position: sticky; top: calc(var(--topbar-h, 50px) + 10px);
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border-gold); background: #05130E; box-shadow: var(--shadow-md);
}
.km-viewport {
  position: relative; width: 100%; height: clamp(320px, 56dvh, 560px);
  overflow: hidden; cursor: grab; touch-action: pan-y;
}
.km-viewport:active { cursor: grabbing; }
#kmVideo, #kmCanvas {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block;
}
#kmVideo { object-fit: cover; display: none; z-index: 1; }
#kmCanvas { z-index: 2; }
.km-ar-active #kmVideo, .km-ar-active .km-ar-frame { display: block; }
.km-ar-frame {
  position: absolute; inset: 14% 12%; z-index: 3; pointer-events: none;
  border: 1.5px dashed rgba(227, 194, 111, 0.78); border-radius: 14px; display: none;
}
.km-fallback {
  position: absolute; inset: 0; z-index: 4; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; color: #F8F5EE;
  background: radial-gradient(circle at 50% 40%, #134839 0%, #051D16 100%);
}

/* HUD Atas & Kawalan AR */
.km-hud-top {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 6;
  display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none;
}
.km-hud-right { display: flex; align-items: center; gap: 6px; pointer-events: auto; }
.km-pill {
  pointer-events: auto; padding: 5px 11px; border-radius: 999px;
  background: rgba(5, 22, 16, 0.84); border: 1px solid rgba(227, 194, 111, 0.42);
  color: #F8EAC4; font-size: 0.73rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}
.km-hud-btn { cursor: pointer; font-family: inherit; transition: all 0.16s ease; }
.km-hud-btn:hover, .km-hud-btn.active {
  background: var(--gold-400) !important; color: var(--emerald-950) !important; border-color: var(--gold-400) !important;
}
.km-ar-controls {
  position: absolute; top: 52px; right: 12px; z-index: 6;
  background: rgba(5, 22, 16, 0.86); border: 1px solid rgba(227, 194, 111, 0.36);
  border-radius: 10px; padding: 5px 8px; display: none; gap: 5px; align-items: center;
}
.km-ar-active .km-ar-controls { display: flex; }
.km-ar-light-alert {
  position: absolute; top: 52px; left: 12px; z-index: 6; max-width: 280px;
  padding: 7px 11px; border-radius: 9px; background: rgba(168, 96, 11, 0.92); color: #FFF8EB;
  border: 1px solid rgba(248, 234, 196, 0.5); font-size: 0.73rem; font-weight: 600;
  line-height: 1.4; display: none; pointer-events: none;
}
.km-ar-active .km-ar-light-alert.show { display: block; }

/* Dok Info Bawah Minimalis (Kapsyen Muzium + Butang Simbol ‹ ›) */
.km-hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; pointer-events: none;
  padding: 28px 16px 14px;
  background: linear-gradient(to top, rgba(5, 20, 15, 0.95) 0%, rgba(5, 20, 15, 0.74) 65%, rgba(5, 20, 15, 0) 100%);
  display: flex; flex-direction: column; gap: 8px;
}
.km-dock-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; pointer-events: auto; }
.km-dock-info { flex: 1; min-width: 0; color: #F8F5EE; }
.km-dock-eyebrow {
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold-400); margin-bottom: 3px;
}
.km-dock-title {
  font-family: 'Fraunces', Georgia, serif; font-size: clamp(0.98rem, 1.7vw, 1.24rem);
  font-weight: 600; line-height: 1.25; color: #FBF7EC; margin: 0 0 4px;
}
.km-dock-summary {
  margin: 0; font-size: 0.81rem; line-height: 1.48; color: rgba(248, 245, 238, 0.84);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 680px;
}
.km-dock-nav { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.km-sym-btn {
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid rgba(227, 194, 111, 0.5); background: rgba(5, 29, 22, 0.84);
  color: #F8EAC4; font-size: 1.25rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: all 0.16s ease;
}
.km-sym-btn:hover { background: var(--gold-400); color: var(--emerald-950); border-color: var(--gold-400); }
.km-info-toggle {
  padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(227, 194, 111, 0.36);
  background: rgba(5, 29, 22, 0.8); color: #F8EAC4; font-size: 0.73rem; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap; transition: all 0.16s ease;
}
.km-info-toggle:hover, .km-info-toggle.playing {
  background: var(--gold-400); color: var(--emerald-950); border-color: var(--gold-400);
}
.km-info-drawer {
  display: none; pointer-events: auto; max-height: 44%; overflow-y: auto;
  background: rgba(5, 22, 16, 0.95); border: 1px solid rgba(227, 194, 111, 0.34);
  border-radius: 12px; padding: 12px 14px; color: rgba(248, 245, 238, 0.9);
  font-size: 0.8rem; line-height: 1.55;
}
.km-info-drawer.open { display: block; }
.km-drawer-row { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(227, 194, 111, 0.16); }
.km-drawer-row strong { color: var(--gold-200); }
.km-dock-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.1); z-index: 7; }
.km-dock-progress-fill { height: 100%; width: 8%; background: var(--gold-400); transition: width 0.35s ease; }

/* === SKRIN PENUH SEBENAR PC & LANDSKAP TELEFON === */
body.km-fs-lock { overflow: hidden !important; }
#kmStageWrap:fullscreen,
#kmStageWrap:-webkit-full-screen,
#kmStageWrap.km-fs-active {
  position: fixed !important; inset: 0 !important; top: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important; height: 100dvh !important;
  max-width: none !important; max-height: none !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
  z-index: 99999 !important; display: flex !important; flex-direction: column !important; background: #05130E !important;
}
#kmStageWrap:fullscreen #kmViewport,
#kmStageWrap:-webkit-full-screen #kmViewport,
#kmStageWrap.km-fs-active #kmViewport {
  width: 100% !important; height: 100% !important; max-height: none !important; flex: 1 1 100% !important;
}
#kmStageWrap.km-fs-landscape {
  position: fixed !important; top: 0 !important; left: 100vw !important;
  right: auto !important; bottom: auto !important;
  width: 100dvh !important; height: 100vw !important;
  transform: rotate(90deg) !important; transform-origin: top left !important; z-index: 99999 !important;
}

/* Senarai Kad Stesen & QR */
.km-station-list { display: flex; flex-direction: column; gap: 14px; }
.km-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px; cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.km-card.active { border-color: var(--gold-500); box-shadow: var(--shadow-md); }
.km-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.km-meta-block {
  margin-top: 10px; padding: 9px 12px; border-radius: 9px;
  background: var(--surface-alt); border-left: 3px solid var(--gold-500); font-size: 0.85rem;
}
.km-meta-khilaf { border-left-color: var(--warn); }
.km-meta-ibrah { border-left-color: var(--ok); }
.km-card-foot { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.km-qr-box {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 15px; border-radius: 12px; background: var(--surface-alt);
  border: 1px solid var(--border-gold); margin-top: 16px;
}

/* === MODAL e-SIJIL, KAD FAKTA & PROJEKTOR PODIUM === */
.sv-modal-backdrop {
  position: fixed; inset: 0; z-index: 100000; background: rgba(5, 20, 15, 0.8);
  display: none; align-items: center; justify-content: center; padding: 18px;
}
.sv-modal-backdrop.open { display: flex; }
.sv-modal {
  width: 100%; max-width: 540px; background: var(--surface);
  border: 1px solid var(--border-gold); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-md);
}
.sv-cert-preview { width: 100%; border-radius: 10px; border: 1px solid var(--border-gold); margin: 12px 0; display: none; }
.sv-share-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

#svPodiumCard.sv-proj-active,
#svPodiumCard:fullscreen,
#svPodiumCard:-webkit-full-screen {
  position: fixed !important; inset: 0 !important; z-index: 99998 !important;
  width: 100vw !important; height: 100dvh !important; margin: 0 !important; border-radius: 0 !important; border: 0 !important;
  padding: clamp(24px, 4vw, 48px) !important;
  background: linear-gradient(150deg, #051D16 0%, #0A3025 100%) !important;
  color: #F8F5EE !important; overflow-y: auto; display: flex; flex-direction: column; justify-content: center;
}
#svPodiumCard.sv-proj-active h3, #svPodiumCard:fullscreen h3 { color: #F8EAC4 !important; font-size: clamp(1.6rem, 3vw, 2.4rem); }
#svPodiumCard.sv-proj-active .pod-col, #svPodiumCard:fullscreen .pod-col {
  width: clamp(140px, 20vw, 230px); background: rgba(255,255,255,0.08);
  border: 1px solid rgba(227,194,111,0.45); border-top: 4px solid #E3C26F;
}
#svPodiumCard.sv-proj-active table, #svPodiumCard:fullscreen table { max-width: 860px; margin: 0 auto; color: #F8F5EE; }
#svPodiumCard.sv-proj-active th, #svPodiumCard:fullscreen th { background: rgba(255,255,255,0.08); color: #F8EAC4; }
#svPodiumCard.sv-proj-active td, #svPodiumCard:fullscreen td { border-color: rgba(227,194,111,0.2); }

/* Footer Editorial */
.sv-footer {
  margin-top: 52px; padding: 26px 0 10px;
  border-top: 1px solid var(--border-gold);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px;
  font-size: 0.83rem; color: var(--ink-soft);
}

/* Responsif Jadual & Telefon */
.card table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  input, textarea, select { font-size: 16px !important; }
  .card { padding: 18px 16px !important; }
  .lp-actions .btn { flex: 1 1 100%; }
  #map { height: 320px !important; }
  .km-viewport { height: clamp(250px, 42dvh, 360px); }
  .km-dock-summary { -webkit-line-clamp: 1; font-size: 0.76rem; }
  .km-sym-btn { width: 34px; height: 34px; font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.sv-map-modebar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 8px; padding: 6px 4px 12px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
@media (max-width: 768px) {
  #svMapIframe { height: 340px !important; }
}
