/**
 * PORTAL BUKU SAKU DIGITAL KEKARANTINAAN KESEHATAN — BKK KARIMUN
 * Global Design System & Design Tokens (css/portal.css)
 * Identitas Resmi Kemenkes RI & Balai Kekarantinaan Kesehatan
 */

:root {
  /* =========================================================================
     1. PALET WARNA IDENTITAS RESMI KEMENKES RI (STANDAR CMYK RESMI)
     ========================================================================= */
  --kemenkes-teal: #01b8a6;      /* C 75, M 0, Y 45, K 0  (Toska Kemenkes Primer) */
  --kemenkes-lime: #d4df25;      /* C 20, M 0, Y 100, K 0 (Hijau Pupus Kemenkes) */
  --kemenkes-cyan: #0cbccc;      /* C 74, M 0, Y 21, K 0  (Toska Muda Aksen) */
  --kemenkes-deep: #007c85;      /* C 100, M 31, Y 46, K 8 (Deep Teal Laut Dalam) */
  --karantina-navy: #0d1b3e;     /* Warna Perisai Karantina Kesehatan */
  --karantina-gold: #f5b800;     /* Emas Sayap & Lambang Husada Adyatama */

  /* =========================================================================
     2. TIPOGRAFI NASIONAL BERKOMPETENSI TINGGI
     ========================================================================= */
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Geometri & Elevasi */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --header-height: 72px;
  --touch-min: 44px;
  --transition-smooth: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-theme: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* ===========================================================================
   3. TEMA TERANG (DEFAULT / LIGHT INSTITUTIONAL KEMENKES)
   Sesuai aturan wajib /col-proyek & /col-light-default: Light Mode adalah default.
   =========================================================================== */
:root,
[data-theme="light"] {
  --bg-main: #f3f8f7;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e2f4f0 0%, #f3f8f7 65%, #edf4f3 100%);
  --bg-ambient-dot: rgba(0, 124, 133, 0.07);
  --bg-header: rgba(255, 255, 255, 0.94);
  --bg-header-border: rgba(0, 124, 133, 0.2);

  --surface-card: #ffffff;
  --surface-card-hover: #f8fdfc;
  --surface-elevated: #ffffff;
  --surface-modal: #ffffff;
  --surface-input: #ffffff;
  --surface-subtle: rgba(0, 124, 133, 0.05);
  --surface-card-muted: rgba(0, 124, 133, 0.04);

  --border-subtle: rgba(0, 124, 133, 0.18);
  --border-hover: rgba(0, 124, 133, 0.55);
  --border-active: #007c85;

  --shadow-card: 0 4px 18px rgba(7, 34, 44, 0.06), 0 1px 3px rgba(7, 34, 44, 0.04);
  --shadow-card-hover: 0 12px 30px rgba(0, 124, 133, 0.14), 0 2px 6px rgba(0, 124, 133, 0.06);

  --text-primary: #07222c;
  --text-secondary: #24414e;
  --text-muted: #456370;
  --text-dim: #52707c;

  --brand-primary: #007c85;
  --brand-primary-hover: #00636a;
  --brand-primary-text: #ffffff;
  --brand-accent: #4d5900;
  --brand-gradient: linear-gradient(135deg, #007c85 0%, #01b8a6 100%);
  --hero-gradient: linear-gradient(135deg, #007c85 0%, #01b8a6 45%, #4d5900 100%);

  --pill-bg: rgba(1, 184, 166, 0.14);
  --pill-border: rgba(0, 124, 133, 0.28);
  --pill-text: #006870;

  --btn-sec-bg: #ffffff;
  --btn-sec-border: rgba(0, 124, 133, 0.24);
  --btn-sec-hover: #f1f8f7;

  --status-verified: #047857;
  --status-verified-bg: rgba(4, 120, 87, 0.12);
  --status-draft: #b45309;
  --status-draft-bg: rgba(180, 83, 9, 0.12);
  --status-revoked: #b91c1c;
  --status-revoked-bg: rgba(185, 28, 28, 0.12);

  --icon-box-bg: rgba(1, 184, 166, 0.12);
  --icon-box-border: rgba(0, 124, 133, 0.28);
  --icon-box-color: #007c85;

  --badge-verification-border: rgba(4, 120, 87, 0.38);
}

/* ===========================================================================
   4. TEMA GELAP (DARK MARINE KEMENKES — DIAKTIFKAN VIA TOGGLE)
   Dipertahankan utuh dan harmonis bagi kenyamanan pengguna di malam hari.
   =========================================================================== */
[data-theme="dark"] {
  --bg-main: #030d14;
  --bg-gradient: radial-gradient(circle at 50% 0%, #061f2c 0%, #030d14 60%, #01060a 100%);
  --bg-ambient-dot: rgba(1, 184, 166, 0.08);
  --bg-header: rgba(4, 16, 25, 0.88);
  --bg-header-border: rgba(1, 184, 166, 0.22);
  
  --surface-card: rgba(8, 28, 41, 0.72);
  --surface-card-hover: rgba(12, 42, 60, 0.9);
  --surface-elevated: #082130;
  --surface-modal: #071c29;
  --surface-input: rgba(4, 16, 24, 0.8);
  --surface-subtle: rgba(1, 184, 166, 0.08);
  --surface-card-muted: rgba(15, 23, 42, 0.6);
  
  --border-subtle: rgba(1, 184, 166, 0.18);
  --border-hover: rgba(1, 184, 166, 0.52);
  --border-active: #01b8a6;
  
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 16px 40px rgba(1, 184, 166, 0.18);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #7c8da3;

  --brand-primary: #01b8a6;
  --brand-primary-hover: #0cbccc;
  --brand-primary-text: #030d14;
  --brand-accent: #d4df25;
  --brand-gradient: linear-gradient(135deg, #01b8a6 0%, #0cbccc 100%);
  --hero-gradient: linear-gradient(135deg, #01b8a6 0%, #d4df25 100%);
  
  --pill-bg: rgba(1, 184, 166, 0.12);
  --pill-border: rgba(1, 184, 166, 0.32);
  --pill-text: #01b8a6;

  --btn-sec-bg: rgba(255, 255, 255, 0.05);
  --btn-sec-border: rgba(1, 184, 166, 0.25);
  --btn-sec-hover: rgba(255, 255, 255, 0.09);

  --status-verified: #6ee7b7;
  --status-verified-bg: rgba(16, 185, 129, 0.14);
  --status-draft: #fcd34d;
  --status-draft-bg: rgba(245, 158, 11, 0.14);
  --status-revoked: #fecaca;
  --status-revoked-bg: rgba(220, 38, 38, 0.14);
  
  --icon-box-bg: rgba(1, 184, 166, 0.14);
  --icon-box-border: rgba(1, 184, 166, 0.35);
  --icon-box-color: #0cbccc;

  --badge-verification-border: rgba(16, 185, 129, 0.35);
}

/* ===========================================================================
   5. BASE RESET & BODY
   =========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: var(--transition-theme);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border-width: 0 !important;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  transition: var(--transition-theme);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
}

/* Base Headings & Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* Theme Adaptive Surfaces & Boxes */
.surface-subtle {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.surface-card-subtle {
  background: var(--surface-card-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.card-subtle {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: var(--transition-theme);
}

/* Ambient Dot Grid */
.portal-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--bg-ambient-dot) 1px, transparent 1.2px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
  z-index: 0;
  transition: var(--transition-theme);
}

/* ===========================================================================
   6. GLOBAL HEADER & DUAL BRAND LOGOS
   =========================================================================== */
.portal-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-header-border);
  z-index: 100;
  transition: var(--transition-theme);
}

.portal-nav-container {
  max-width: 1360px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-brand-logos {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  flex-shrink: 0;
  max-width: 96px;
  overflow: hidden;
}

.portal-logo-kemenkes {
  height: 38px;
  max-width: 44px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  font-size: 0;
}

.portal-logo-karantina {
  height: 40px;
  max-width: 44px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  font-size: 0;
}

.portal-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-brand-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.15;
  white-space: nowrap;
}

.portal-brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

@media (max-width: 1240px) {
  .portal-brand-subtitle {
    display: none;
  }
}

@media (max-width: 1200px) {
  .portal-menu {
    display: none;
  }
  .portal-brand-title {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .portal-nav-container {
    padding: 0 14px;
  }
  .portal-search-trigger span,
  .portal-search-trigger .portal-search-kbd {
    display: none;
  }
  .portal-search-trigger {
    padding: 8px 10px;
  }
}

/* Nav Menu Items */
.portal-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.portal-menu-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portal-menu-link:hover, .portal-menu-link.active {
  color: var(--text-primary);
  background: var(--btn-sec-hover);
}

.portal-menu-link.highlight {
  color: #030d14;
  background: var(--brand-primary);
  font-weight: 700;
}

[data-theme="light"] .portal-menu-link.highlight {
  color: #ffffff;
  background: var(--brand-primary);
}

.portal-menu-link.highlight:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Header Action Right (Theme Toggle + Search) */
.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme Toggle Button */
.portal-theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--btn-sec-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.portal-theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--btn-sec-hover);
  transform: rotate(15deg);
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
  color: var(--kemenkes-lime);
}
[data-theme="dark"] .theme-icon-moon {
  display: none;
}
[data-theme="light"] .theme-icon-sun {
  display: none;
}
[data-theme="light"] .theme-icon-moon {
  display: block;
  color: var(--kemenkes-deep);
}

/* Quick Search Button */
.portal-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--btn-sec-bg);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.portal-search-trigger:hover {
  border-color: var(--border-hover);
  background: var(--btn-sec-hover);
  color: var(--text-primary);
}

.portal-search-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

[data-theme="dark"] .portal-search-kbd {
  background: rgba(255, 255, 255, 0.1);
}

/* ===========================================================================
   7. BREADCRUMB BAR
   =========================================================================== */
.portal-breadcrumb-bar {
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  z-index: 10;
  transition: var(--transition-theme);
}

.portal-breadcrumb-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-trail a {
  color: var(--brand-primary);
  font-weight: 500;
  transition: var(--transition-smooth);
}

.breadcrumb-trail a:hover {
  text-decoration: underline;
}

.breadcrumb-trail span {
  color: var(--text-primary);
  font-weight: 600;
}

/* Verification Badges: lihat komponen badge bersama di bagian 18 */

/* Quick Guide Card Styles (Clean & Theme-Adaptive) */
.quick-guide-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-theme);
}

.quick-guide-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.quick-guide-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.quick-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.quick-guide-step {
  background: var(--btn-sec-bg);
  border: 1px solid var(--border-subtle);
  padding: 18px;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.quick-guide-step:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.step-title {
  font-size: 0.92rem;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* General Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--touch-min);
  padding: 0 24px;
  background: var(--brand-primary);
  color: var(--brand-primary-text);
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(1, 184, 166, 0.28);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(1, 184, 166, 0.38);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--touch-min);
  padding: 0 22px;
  background: var(--btn-sec-bg);
  border: 1px solid var(--btn-sec-border);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: var(--btn-sec-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

/* ===========================================================================
   9. SECTIONS & MODULES GRID
   =========================================================================== */
.section-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  position: relative;
  z-index: 1;
}

.section-head {
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.68rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Category Filter Tabs */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
  scrollbar-width: thin;
}

.filter-btn {
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--btn-sec-bg);
  border: 1px solid var(--border-subtle);
  padding: 8px 18px;
  border-radius: 9999px;
  transition: var(--transition-smooth);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.filter-btn.active {
  color: var(--brand-primary-text);
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  box-shadow: 0 4px 14px rgba(1, 184, 166, 0.3);
}

/* Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.module-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.module-card:hover {
  background: var(--surface-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

.module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.module-icon-wrap {
  width: 48px;
  height: 48px;
  background: var(--icon-box-bg);
  border: 1px solid var(--icon-box-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-box-color);
}

.module-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.module-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 18px;
  flex-grow: 1;
}

.module-card-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.module-chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--btn-sec-bg);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.module-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.module-card-action svg {
  transition: transform 0.2s ease;
}

.module-card:hover .module-card-action svg {
  transform: translateX(4px);
}

/* ===========================================================================
   10. SEARCH MODAL OVERLAY
   =========================================================================== */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 13, 20, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 20px 20px;
}

.search-modal-backdrop.open {
  display: flex;
}

.search-modal-box {
  width: 100%;
  max-width: 680px;
  background: var(--surface-modal);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-card);
}

.search-modal-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-family: inherit;
}

.search-modal-input::placeholder {
  color: var(--text-muted);
}

.search-results-list {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.search-result-item:hover {
  background: var(--btn-sec-hover);
}

.search-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* ===========================================================================
   11. MODULE WORKSPACE STANDARD (SUBPAGES)
   =========================================================================== */
.module-workspace {
  max-width: 1360px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  flex: 1;
}

.workspace-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-theme);
}

.workspace-header {
  margin-bottom: 24px;
}

.workspace-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.workspace-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 900px;
}

.legal-callout {
  background: var(--pill-bg);
  border-left: 4px solid var(--brand-primary);
  padding: 14px 18px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Form Controls Inside Workspaces */
.form-control-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.form-control-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(1, 184, 166, 0.18);
}

/* ===========================================================================
   12. FOOTER
   =========================================================================== */
.portal-footer {
  margin-top: auto;
  background: var(--surface-card);
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  transition: var(--transition-theme);
}

.footer-bottom {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

/* ===========================================================================
   13. MEDIA QUERIES (RESPONSIF MOBILE)
   =========================================================================== */
@media (max-width: 992px) {
  .portal-menu {
    display: none; /* Mobile navigation simplified */
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }
  .portal-brand-subtitle {
    display: none;
  }
  .portal-brand-title {
    font-size: 0.92rem;
  }
  .portal-logo-kemenkes {
    height: 32px;
  }
  .portal-logo-karantina {
    height: 34px;
  }
  .hero-section {
    padding: 40px 16px 32px;
  }
  .workspace-card {
    padding: 20px 16px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ===========================================================================
   14. SIGNATURE DETAILS (SELECTION, SCROLLBAR & BRAND POLISH)
   =========================================================================== */
::selection {
  background: var(--brand-primary);
  color: var(--brand-primary-text);
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

/* ===========================================================================
   15. MARITIME TELEMETRY STRIP
   =========================================================================== */
.telemetry-strip {
  margin-top: 36px;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: var(--transition-theme);
}

.telemetry-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.telemetry-indicator-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: telemetryPulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
  flex-shrink: 0;
}

@keyframes telemetryPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.telemetry-icon {
  color: var(--brand-primary);
  flex-shrink: 0;
}

.telemetry-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.telemetry-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.telemetry-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.telemetry-divider {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
}

@media (max-width: 768px) {
  .telemetry-divider { display: none; }
  .telemetry-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

@media (max-width: 480px) {
  .telemetry-inner { grid-template-columns: 1fr; }
}

/* ===========================================================================
   16. COMMAND PALETTE ENHANCED STYLING
   =========================================================================== */
.command-palette-filters {
  background: var(--surface-card);
}

.cp-pill {
  white-space: nowrap;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--btn-sec-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.cp-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.cp-pill.active {
  background: var(--brand-primary);
  color: var(--brand-primary-text);
  border-color: var(--brand-primary);
}

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.selected {
  background: var(--btn-sec-hover);
  border-color: var(--border-hover);
  transform: translateX(3px);
}

.cp-type-badge {
  font-size: 0.64rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ===========================================================================
   11. GLOBAL PORTAL FOOTER
   =========================================================================== */
.portal-footer {
  background: var(--surface-card);
  border-top: 1px solid var(--border-subtle);
  padding: 64px 24px 32px;
  margin-top: 64px;
  transition: var(--transition-theme);
}

.portal-footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 1024px) {
  .portal-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .portal-footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.footer-brand-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.35;
}

.footer-brand-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links li a {
  font-size: 0.84rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.footer-links li a:hover {
  color: var(--brand-primary);
  transform: translateX(3px);
  display: inline-block;
}

.footer-bottom {
  max-width: 1360px;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}


/* ===========================================================================
   17. PORTAL v3 — LAPISAN ANTARMUKA MODERN
   Shell bersama (header, drawer mobile, progres baca, kembali ke atas),
   animasi kemunculan, katalog, kartu regulasi, alur kerja, dan palet pencarian.
   =========================================================================== */
:root {
  /* Alias untuk nama lama yang masih dipakai di gaya inline beberapa halaman */
  --brand-cyan-400: var(--brand-primary);
  --brand-blue-400: var(--brand-primary);
  --brand-blue-500: var(--brand-primary);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --focus-ring: 0 0 0 3px var(--bg-main), 0 0 0 5px var(--brand-primary);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 124, 133, 0.16);
  --mark-bg: rgba(1, 184, 166, 0.22);
}

[data-theme="dark"] {
  --glass-bg: rgba(8, 28, 41, 0.6);
  --glass-border: rgba(1, 184, 166, 0.2);
  --mark-bg: rgba(1, 184, 166, 0.32);
}

/* Fokus keyboard yang jelas (WCAG 2.4.7). Memakai outline: box-shadow dekoratif pada tombol tidak menimpanya. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Tautan lewati ke konten (disisipkan portalShell.js) */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 400;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: var(--brand-primary-text);
  font-weight: 700;
  font-size: 0.88rem;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: none;
  outline-color: var(--text-primary);
}

/* Target sentuh tautan mandiri minimal 24px (WCAG 2.5.8) */
.breadcrumb-trail a,
.footer-bottom a,
.guide-step-link,
.link-standalone {
  display: inline-block;
  padding-block: 4px;
}

body.drawer-open,
body.modal-open {
  overflow: hidden;
}

/*
 * body adalah flex-column; kontainer ber-margin auto akan menyusut ke lebar fit-content
 * sehingga deretan tab yang dapat digulir memperlebar layout viewport di ponsel.
 */
.section-container,
.module-workspace {
  width: 100%;
}

/* Breadcrumb ringkas di layar sempit */
@media (max-width: 640px) {
  .portal-breadcrumb-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
  }
  .breadcrumb-trail {
    flex-wrap: wrap;
    gap: 4px 8px;
  }
}

/* ---------- Header ---------- */
.portal-header {
  transition: var(--transition-theme), box-shadow 0.3s ease;
}

.portal-header.is-scrolled {
  box-shadow: 0 8px 30px -12px rgba(7, 34, 44, 0.18);
}

[data-theme="dark"] .portal-header.is-scrolled {
  box-shadow: 0 10px 34px -12px rgba(0, 0, 0, 0.6);
}

.portal-scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--kemenkes-deep), var(--kemenkes-teal), var(--kemenkes-lime));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.portal-menu {
  gap: 2px;
}

.portal-menu-link {
  position: relative;
  white-space: nowrap;
  padding: 8px 12px;
}

.portal-menu-link.active:not(.highlight)::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-primary);
}

.portal-menu-link.highlight {
  box-shadow: 0 4px 14px -4px rgba(1, 184, 166, 0.55);
}

.portal-search-trigger {
  white-space: nowrap;
}

@media (max-width: 1360px) and (min-width: 1201px) {
  .portal-search-trigger > span {
    display: none;
  }
}

/* Tombol hamburger */
.portal-burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--btn-sec-bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition-smooth);
}

.portal-burger span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
}

.portal-burger:hover {
  border-color: var(--border-hover);
  background: var(--btn-sec-hover);
}

@media (max-width: 1200px) {
  .portal-burger {
    display: inline-flex;
  }
}

/* Header sempit: judul brand boleh dua baris agar tombol aksi tetap terlihat */
.portal-nav-container {
  gap: 12px;
}

.portal-brand {
  min-width: 0;
}

@media (max-width: 560px) {
  .portal-brand {
    gap: 8px;
  }
  .portal-brand-logos {
    gap: 4px;
  }
  .portal-logo-kemenkes,
  .portal-logo-karantina {
    height: 30px;
  }
  .portal-brand-title {
    font-size: 0.78rem;
    white-space: normal;
    line-height: 1.15;
    max-width: 120px;
  }
  .portal-header-actions {
    gap: 6px;
  }
  .portal-theme-toggle,
  .portal-burger {
    width: 38px;
    height: 38px;
  }
}

/* Drawer navigasi mobile */
.portal-drawer {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s 0.4s;
}

.portal-drawer.open {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s;
}

.portal-drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 13, 20, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portal-drawer.open .portal-drawer-scrim {
  opacity: 1;
}

.portal-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88vw);
  background: var(--surface-modal);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -24px 0 60px -20px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out-expo);
}

.portal-drawer.open .portal-drawer-panel {
  transform: translateX(0);
}

.portal-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.portal-drawer-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.portal-drawer-close {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.portal-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0;
  transform: translateX(16px);
  transition: background-color 0.2s ease, opacity 0.35s ease, transform 0.45s var(--ease-out-expo);
}

.portal-drawer.open .portal-drawer-link {
  opacity: 1;
  transform: none;
  transition-delay: calc(80ms + var(--i) * 35ms);
}

.portal-drawer-link svg {
  color: var(--text-dim);
}

.portal-drawer-link:hover,
.portal-drawer-link.active {
  background: var(--surface-subtle);
}

.portal-drawer-link.active {
  color: var(--brand-primary);
  box-shadow: inset 3px 0 0 var(--brand-primary);
}

.portal-drawer-link.highlight {
  background: var(--brand-primary);
  color: var(--brand-primary-text);
  margin: 6px 0;
}

.portal-drawer-link.highlight svg {
  color: currentColor;
}

.portal-drawer-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Tombol kembali ke atas */
.portal-to-top {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s var(--ease-out-expo), border-color 0.2s ease;
}

body.show-to-top .portal-to-top {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.portal-to-top:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

/* ---------- Animasi kemunculan ---------- */
.reveal-ready [data-reveal] {
  transition: opacity 0.7s ease, transform 0.8s var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-ready [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(22px);
}

/* ---------- Kepala seksi ---------- */
.section-container--tight {
  padding-top: 8px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.eyebrow-index {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.eyebrow-index::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  margin-left: 10px;
  vertical-align: middle;
  background: var(--border-hover);
}

.section-title {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-subtitle {
  font-size: 0.96rem;
  max-width: 640px;
}

/* ---------- Katalog modul ---------- */
.filter-tabs {
  margin-bottom: 12px;
  padding: 4px 2px 8px;
  scrollbar-width: none;
  /* Lebar intrinsik deretan tab tidak boleh memperlebar layout viewport mobile */
  contain: inline-size;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
}

.modules-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.module-card {
  isolation: isolate;
  animation: cardIn 0.6s var(--stagger, 0ms) var(--ease-out-expo) backwards;
}

/* Cahaya sorot mengikuti kursor */
.module-card:hover {
  transform: translateY(-4px);
}

.module-card:focus-within {
  border-color: var(--brand-primary);
}

.module-icon-wrap {
  transition: transform 0.4s var(--ease-out-expo), background-color 0.3s ease;
}

/* Seluruh kartu dapat diklik melalui tautan tunggal (target sentuh lebih besar) */
/* ---------- Daftar isi Buku Saku ---------- */
.toc-book {
  position: relative;
  column-count: 2;
  column-gap: 64px;
  column-rule: 1px solid var(--border-subtle);
  padding: clamp(24px, 4vw, 44px) clamp(20px, 4vw, 48px);
  border-radius: var(--radius-xl);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

@media (max-width: 860px) {
  .toc-book {
    column-count: 1;
  }
}

.toc-part {
  break-inside: avoid;
  padding-bottom: 26px;
}

.toc-part-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toc-part-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-primary);
  min-width: 78px;
}

.toc-list {
  list-style: none;
}

.toc-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 10px;
  margin: 0 -10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.toc-num {
  flex-shrink: 0;
  min-width: 78px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.toc-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Garis titik penuntun khas daftar isi */
.toc-leader {
  flex: 1;
  min-width: 24px;
  border-bottom: 2px dotted var(--border-subtle);
  transform: translateY(-4px);
}

.toc-arrow {
  flex-shrink: 0;
  align-self: center;
  color: var(--text-dim);
  transition: transform 0.25s var(--ease-out-expo), color 0.2s ease;
}

.toc-item:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
}

.toc-item:hover .toc-num,
.toc-item:hover .toc-arrow {
  color: var(--brand-primary);
}

.toc-item:hover .toc-arrow {
  transform: translateX(3px);
}

.toc-item:hover .toc-leader {
  border-bottom-color: var(--border-hover);
}

@media (max-width: 560px) {
  .toc-part-num,
  .toc-num {
    min-width: 0;
  }
  .toc-num {
    width: 24px;
  }
}

/* ---------- Halaman modul sebagai bab buku ---------- */
.chapter-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chapter-no {
  color: var(--brand-primary);
}

.chapter-no + .chapter-part::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.9em;
  margin-right: 14px;
  vertical-align: -0.1em;
  background: var(--border-hover);
}

.chapter-part {
  color: var(--text-muted);
}

.workspace-title {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.workspace-desc {
  max-width: 760px;
}

/* Rujukan regulasi sebagai catatan kaki buku */
.legal-callout {
  background: transparent;
  border-left: 2px solid var(--brand-primary);
  border-radius: 0;
  padding: 4px 0 4px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legal-callout strong {
  color: var(--text-secondary);
}

/*
 * Tab utama modul → indeks sub-bab bernomor.
 * Selektor .chapter-subnav > button sengaja lebih spesifik dari gaya tab bawaan tiap halaman.
 */
.chapter-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  overflow: visible;
  padding: 0 0 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.chapter-subnav > button {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  height: auto;
  min-height: 44px;
  padding: 10px 12px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transform: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.chapter-subnav > button:hover {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: none;
}

.chapter-subnav > button.active {
  background: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  box-shadow: none;
}

.sub-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-dim);
  pointer-events: none;
}

.chapter-subnav > button.active .sub-num {
  color: var(--brand-primary);
}

@media (max-width: 640px) {
  .chapter-subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    contain: inline-size;
  }
  .chapter-subnav::-webkit-scrollbar {
    display: none;
  }
}

/* Navigasi antarbab */
.chapter-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
  margin-top: 24px;
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  transition: border-color 0.2s ease, transform 0.3s var(--ease-out-expo);
}

.pager-link:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.pager-next {
  text-align: right;
  align-items: flex-end;
}

.pager-empty {
  border: none;
  background: none;
}

.pager-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.pager-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pager-no {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--brand-primary);
  margin-right: 8px;
}

.pager-toc {
  align-self: center;
  padding: 10px 16px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-primary);
  white-space: nowrap;
}

.pager-toc:hover {
  border-color: var(--border-hover);
  background: var(--surface-subtle);
}

@media (max-width: 640px) {
  .chapter-pager {
    grid-template-columns: 1fr 1fr;
  }
  .pager-toc {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }
  .pager-empty {
    display: none;
  }
}

/* Tab kategori: lebih ringan, satu baris */
.filter-tabs {
  gap: 4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  contain: none;
  border-radius: 9999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
}

.filter-btn {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid transparent;
  background: transparent;
  gap: 6px;
}

.filter-btn:hover {
  border-color: transparent;
  background: var(--surface-card);
}

.filter-btn.active {
  box-shadow: 0 4px 12px -4px rgba(1, 184, 166, 0.5);
}

.filter-count {
  min-width: 0;
  height: auto;
  padding: 0;
  background: none;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.filter-btn.active .filter-count {
  background: none;
  opacity: 0.75;
}

/* ---------- Alur kerja lapangan ---------- */
.quick-guide-card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 44px);
  background:
    radial-gradient(80% 120% at 100% 0%, var(--surface-subtle), transparent 60%),
    var(--surface-card);
}

.quick-guide-title {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.guide-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.guide-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Garis penghubung antarlangkah */
.guide-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 52px;
  right: -12px;
  height: 2px;
  background: linear-gradient(90deg, var(--border-hover), var(--border-subtle));
}

.guide-step-num {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--brand-gradient);
  box-shadow: 0 8px 20px -6px rgba(0, 124, 133, 0.55);
}

[data-theme="dark"] .guide-step-num {
  color: #030d14;
}

.guide-step .step-title {
  font-size: 0.98rem;
  color: var(--text-primary);
}

.guide-step .step-desc {
  display: block;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.guide-step-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.guide-step-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 960px) {
  .guide-steps {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .guide-step {
    flex-direction: row;
    padding-bottom: 22px;
  }
  .guide-step:not(:last-child)::after {
    top: 48px;
    bottom: 4px;
    left: 19px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--border-hover), var(--border-subtle));
  }
  .guide-step-num {
    flex-shrink: 0;
  }
}

/* ---------- Palet pencarian ---------- */
.search-modal-backdrop {
  padding-top: clamp(24px, 12vh, 110px);
}

.search-modal-backdrop.open .search-modal-box {
  animation: paletteIn 0.32s var(--ease-out-expo) backwards;
}

@keyframes paletteIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.search-modal-box {
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-subtle);
  border-color: var(--border-subtle);
}

.search-modal-input:focus-visible {
  box-shadow: none;
}

.search-modal-icon {
  color: var(--brand-primary);
  flex-shrink: 0;
}

.search-modal-close {
  cursor: pointer;
  flex-shrink: 0;
}

.search-modal-results {
  flex: 1;
  min-height: 0;
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
}

.search-result-item {
  align-items: stretch;
  margin-bottom: 2px;
}

.search-result-item:hover,
.search-result-item.selected {
  transform: none;
  box-shadow: inset 3px 0 0 var(--brand-primary);
}

.search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
}

.search-result-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.search-result-snippet {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.search-result-meta {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--brand-primary);
}

.search-result-item mark {
  background: var(--mark-bg);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.search-empty {
  padding: 36px 20px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.search-empty-hint {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.search-modal-footer {
  align-items: center;
  gap: 12px;
  background: var(--surface-card);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.search-modal-hints {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.search-modal-hints kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  min-width: 20px;
  padding: 1px 5px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .search-modal-backdrop {
    padding: 0;
  }
  .search-modal-box {
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
  }
  .search-modal-results {
    max-height: none;
  }
  .search-modal-hints {
    display: none;
  }
}

/* ---------- Footer ---------- */
.portal-footer {
  position: relative;
}

.portal-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--kemenkes-teal), var(--kemenkes-lime), transparent);
  opacity: 0.7;
}

/* ---------- Gerak minimal (prefers-reduced-motion) ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===========================================================================
   18. KOMPONEN BADGE & TAG (BERSAMA)
   .tag    = label kategori netral (nama alat, lampiran, spesifikasi). Tidak membawa makna status.
   .badge  = status/hasil dengan titik warna. Warna HANYA untuk makna: ok, warn, alert, danger, info.
   Dipakai di seluruh halaman; jangan menulis gaya badge inline atau mewarnai label sekadar untuk variasi.
   =========================================================================== */
:root {
  --tone-ok: #047857;
  --tone-warn: #92400e;
  --tone-alert: #9a3412;
  --tone-danger: #b91c1c;
  --tone-info: #075985;
  --tone-accent: #6b21a8;
}

[data-theme="dark"] {
  --tone-ok: #6ee7b7;
  --tone-warn: #fcd34d;
  --tone-alert: #fdba74;
  --tone-danger: #fca5a5;
  --tone-info: #7dd3fc;
  --tone-accent: #d8b4fe;
}

/* Label kategori: teks redup bergaya catatan pinggir buku — tanpa kotak, latar, atau titik */
.tag {
  display: inline;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: var(--text-muted);
}

/*
 * Penanda status/hasil (kelas lama dipetakan ke komponen yang sama).
 * Berupa teks berwarna saja. Warna hanya untuk makna (ok/waspada/bahaya), dan teksnya sendiri
 * selalu menyebut maknanya, jadi arti tidak bergantung pada warna.
 */
.badge,
.badge-status-pill,
.badge-verification {
  --tone: var(--text-muted);
  display: inline;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  color: var(--tone);
}

/* Hasil kalkulator berisi kalimat: garis penanda di kiri, boleh turun baris */
.badge[id],
.badge-status-pill[id] {
  display: block;
  padding: 3px 0 3px 12px;
  border-left: 3px solid var(--tone);
  font-size: 0.84rem;
  letter-spacing: 0;
  white-space: normal;
  text-align: left;
}

.badge[data-tone="ok"], .badge-status-ok { --tone: var(--tone-ok); }
.badge[data-tone="warn"], .badge-status-warn, .badge-verification.draft { --tone: var(--tone-warn); }
.badge[data-tone="alert"] { --tone: var(--tone-alert); }
.badge[data-tone="danger"], .badge-status-danger { --tone: var(--tone-danger); }
.badge[data-tone="info"] { --tone: var(--tone-info); }
.badge[data-tone="accent"] { --tone: var(--tone-accent); }

/* Label sumber/rujukan ("Pedoman Ditjen P2P & WHO") bukan status: teks tenang, bukan hijau "terverifikasi" */
.badge-verification.verified {
  --tone: var(--text-secondary);
  font-weight: 600;
}

/* Kode/nomor pendek di dalam kartu (SKDR, langkah SOP) */
.skdr-code-badge,
.step-badge {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

/* ===========================================================================
   19. SAMPUL BUKU (BERANDA)
   Halaman pembuka bergaya halaman judul buku: identitas, penerbit, dasar hukum.
   Satu ajakan utama (Buka Daftar Isi); pencarian memakai palet yang sama dengan header.
   =========================================================================== */
.title-page {
  position: relative;
  z-index: 1;
  padding: clamp(48px, 8vw, 96px) 24px clamp(40px, 6vw, 72px);
}

.title-page-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
}

.title-page-eyebrow {
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.title-page-heading {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
  margin-bottom: 20px;
}

.title-page-lead {
  max-width: 560px;
  font-size: clamp(0.98rem, 1.5vw, 1.1rem);
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.title-page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 40px;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 28px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: var(--brand-primary-text);
  font-weight: 700;
  font-size: 0.96rem;
  box-shadow: 0 10px 24px -10px rgba(0, 124, 133, 0.6);
  transition: background-color 0.2s ease, transform 0.3s var(--ease-out-expo);
}

.btn-hero-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-2px);
}

.title-page-search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.title-page-search:hover {
  color: var(--brand-primary);
}

/* Kolofon: keterangan bibliografis seperti halaman hak cipta buku */
.colophon {
  display: grid;
  gap: 10px;
  max-width: 560px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.colophon > div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.colophon dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-top: 2px;
}

.colophon dd {
  color: var(--text-secondary);
}

.colophon a {
  color: var(--brand-primary);
  font-weight: 600;
}

.colophon a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Nomor bab pada rujukan (sampul & alur pemeriksaan) */
.chapter-ref-no {
  font-family: var(--font-mono);
  font-size: 0.86em;
  font-weight: 500;
  opacity: 0.8;
}

/* ---------- Ilustrasi buku ---------- */
.book-object {
  position: relative;
  display: block;
  width: min(100%, 320px);
  aspect-ratio: 5 / 7;
  margin: 0 auto;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: perspective(1400px) rotateY(-16deg) rotateX(4deg);
  transition: transform 0.8s var(--ease-out-expo);
}

.book-object:hover {
  transform: perspective(1400px) rotateY(-8deg) rotateX(2deg) translateY(-4px);
}

/* Lembar sampul: berputar pada punggung buku, membawa dua muka (depan & dalam) */
.book-leaf {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transform: translateZ(1px);
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.25, 1);
}

.book-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 34px 28px 30px 40px;
  border-radius: 4px 12px 12px 4px;
  color: #f3efe2;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.32) 0, rgba(0, 0, 0, 0.08) 14px, rgba(255, 255, 255, 0.07) 16px, transparent 22px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 4px),
    linear-gradient(160deg, #0a6b73 0%, #064f57 55%, #053d45 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 60px -24px rgba(5, 40, 46, 0.55),
    0 12px 24px -12px rgba(5, 40, 46, 0.4);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Sisi dalam sampul (kertas pelapis/endpaper), terlihat setelah buku terbuka */
.book-cover-back {
  position: absolute;
  inset: 0;
  border-radius: 12px 4px 4px 12px;
  background:
    linear-gradient(270deg, rgba(0, 0, 0, 0.3) 0, rgba(0, 0, 0, 0.06) 16px, transparent 24px),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 6px, transparent 6px 12px),
    linear-gradient(200deg, #0b6d75 0%, #075860 60%, #05474f 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: rotateY(180deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Petunjuk: sampul sedikit terangkat saat disorot */
.book-object:hover .book-leaf {
  transform: translateZ(1px) rotateY(-18deg);
}

/* Terbuka dan TETAP terbuka: setengah terbuka (±115°) agar sampul tidak menutupi teks di sebelah kiri.
   Aturan ini diletakkan setelah :hover supaya sorotan tidak menutup kembali sampul. */
.book-object.is-open {
  transform: perspective(1400px) translateX(12%) rotateY(-10deg) rotateX(3deg);
}

.book-object.is-open .book-leaf {
  transform: translateZ(1px) rotateY(-115deg);
}

/* Tumpukan halaman di sisi kanan */
.book-pages {
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: -10px;
  width: 22px;
  z-index: 1;
  border-radius: 0 6px 6px 0;
  background: repeating-linear-gradient(90deg, #f4f1e8 0 2px, #e2ddd0 2px 3px);
  box-shadow: 0 20px 40px -20px rgba(5, 40, 46, 0.45);
}

/* Halaman pertama di balik sampul */
.book-inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 34px 26px 30px 34px;
  border-radius: 4px 10px 10px 4px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0, transparent 18px),
    #f7f4ec;
  box-shadow: inset 0 0 0 1px rgba(5, 40, 46, 0.08);
}

.book-inner-title {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #064f57;
}

.book-inner-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.5s var(--ease-out-expo);
}

.book-inner-line i {
  width: 26px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: #0a6b73;
}

.book-inner-line b {
  flex: 1;
  border-bottom: 2px dotted rgba(6, 79, 87, 0.28);
}

.book-object.is-open .book-inner-line {
  opacity: 1;
  transform: none;
}

.book-object.is-open .book-inner-line:nth-child(2) { transition-delay: 0.35s; }
.book-object.is-open .book-inner-line:nth-child(3) { transition-delay: 0.41s; }
.book-object.is-open .book-inner-line:nth-child(4) { transition-delay: 0.47s; }
.book-object.is-open .book-inner-line:nth-child(5) { transition-delay: 0.53s; }
.book-object.is-open .book-inner-line:nth-child(6) { transition-delay: 0.59s; }
.book-object.is-open .book-inner-line:nth-child(7) { transition-delay: 0.65s; }
.book-object.is-open .book-inner-line:nth-child(8) { transition-delay: 0.71s; }

/* Penanda tujuan: daftar isi menyala sekilas setelah buku dibuka */
#daftar-isi {
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.toc-book.is-arrived {
  animation: tocArrive 1.4s var(--ease-out-expo);
}

@keyframes tocArrive {
  0% { box-shadow: 0 0 0 0 rgba(1, 184, 166, 0.5), var(--shadow-card); }
  40% { box-shadow: 0 0 0 6px rgba(1, 184, 166, 0.22), var(--shadow-card); }
  100% { box-shadow: 0 0 0 0 rgba(1, 184, 166, 0), var(--shadow-card); }
}

.book-cover-logos {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: auto;
}

.book-cover-logos img {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.book-cover-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--karantina-gold);
  margin-bottom: 10px;
}

.book-cover-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #fbf8ef;
}

.book-cover-sub {
  margin-top: 8px;
  font-size: 0.86rem;
  color: rgba(243, 239, 226, 0.8);
}

.book-cover-rule {
  width: 48px;
  height: 2px;
  margin: 22px 0 16px;
  background: var(--karantina-gold);
}

.book-cover-pub {
  font-size: 0.74rem;
  line-height: 1.45;
  color: rgba(243, 239, 226, 0.78);
}

.book-cover-ed {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 239, 226, 0.6);
}

@media (max-width: 900px) {
  .title-page-inner {
    grid-template-columns: 1fr;
  }
  .book-object {
    width: min(70%, 240px);
    order: -1;
  }
}

@media (max-width: 520px) {
  .title-page {
    padding: 36px 16px 32px;
  }
  .colophon > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .title-page-search kbd {
    display: none;
  }
  .book-object {
    width: 150px;
  }
  .book-inner {
    gap: 6px;
    padding: 16px 12px 12px 18px;
  }
  .book-inner-title {
    margin-bottom: 2px;
    font-size: 0.78rem;
  }
  .book-cover {
    padding: 18px 14px 16px 22px;
  }
  .book-cover-logos img {
    height: 24px;
  }
  .book-cover-title {
    font-size: 1.05rem;
  }
  .book-cover-sub,
  .book-cover-pub,
  .book-cover-ed {
    display: none;
  }
  .book-cover-rule {
    margin: 10px 0 0;
  }
  .btn-hero-primary {
    width: 100%;
  }
}

/* Kolofon footer beranda */
.portal-colophon {
  margin-top: 32px;
  padding: 28px 24px;
}

.portal-colophon .footer-bottom {
  margin-top: 0;
}

.portal-colophon a {
  color: var(--brand-primary);
  font-weight: 600;
}

/* ===========================================================================
   20. KONTRAS TEMA TERANG UNTUK WARNA AKSEN INLINE
   Banyak halaman modul menulis warna aksen (#f59e0b, #10b981, ...) langsung di atribut style,
   dipilih untuk latar gelap sehingga gagal kontras (2:1–3:1) di tema terang.
   Di tema terang, warna itu dipetakan ke token --tone-* yang sudah lolos 4,5:1.
   Pemilih memakai " color:" (diawali spasi) agar border-color/background-color tidak ikut terkena.
   =========================================================================== */
:root:not([data-theme="dark"]) [style^="color: #f59e0b"],
:root:not([data-theme="dark"]) [style*=" color: #f59e0b"],
:root:not([data-theme="dark"]) [style^="color: #fcd34d"],
:root:not([data-theme="dark"]) [style*=" color: #fcd34d"],
:root:not([data-theme="dark"]) [style^="color: #d97706"],
:root:not([data-theme="dark"]) [style*=" color: #d97706"] {
  color: var(--tone-warn) !important;
}

:root:not([data-theme="dark"]) [style^="color: #10b981"],
:root:not([data-theme="dark"]) [style*=" color: #10b981"],
:root:not([data-theme="dark"]) [style^="color: #6ee7b7"],
:root:not([data-theme="dark"]) [style*=" color: #6ee7b7"],
:root:not([data-theme="dark"]) [style^="color: #34d399"],
:root:not([data-theme="dark"]) [style*=" color: #34d399"] {
  color: var(--tone-ok) !important;
}

:root:not([data-theme="dark"]) [style^="color: #ef4444"],
:root:not([data-theme="dark"]) [style*=" color: #ef4444"],
:root:not([data-theme="dark"]) [style^="color: #f87171"],
:root:not([data-theme="dark"]) [style*=" color: #f87171"],
:root:not([data-theme="dark"]) [style^="color: #fca5a5"],
:root:not([data-theme="dark"]) [style*=" color: #fca5a5"] {
  color: var(--tone-danger) !important;
}

:root:not([data-theme="dark"]) [style^="color: #0284c7"],
:root:not([data-theme="dark"]) [style*=" color: #0284c7"],
:root:not([data-theme="dark"]) [style^="color: #38bdf8"],
:root:not([data-theme="dark"]) [style*=" color: #38bdf8"],
:root:not([data-theme="dark"]) [style^="color: #7dd3fc"],
:root:not([data-theme="dark"]) [style*=" color: #7dd3fc"],
:root:not([data-theme="dark"]) [style^="color: #0ea5e9"],
:root:not([data-theme="dark"]) [style*=" color: #0ea5e9"] {
  color: var(--tone-info) !important;
}

:root:not([data-theme="dark"]) [style^="color: #f97316"],
:root:not([data-theme="dark"]) [style*=" color: #f97316"],
:root:not([data-theme="dark"]) [style^="color: #fdba74"],
:root:not([data-theme="dark"]) [style*=" color: #fdba74"] {
  color: var(--tone-alert) !important;
}

:root:not([data-theme="dark"]) [style^="color: #a855f7"],
:root:not([data-theme="dark"]) [style*=" color: #a855f7"],
:root:not([data-theme="dark"]) [style^="color: #c084fc"],
:root:not([data-theme="dark"]) [style*=" color: #c084fc"],
:root:not([data-theme="dark"]) [style^="color: #d8b4fe"],
:root:not([data-theme="dark"]) [style*=" color: #d8b4fe"] {
  color: var(--tone-accent) !important;
}

/* Sebaliknya: warna tua yang ditulis untuk tema terang dipetakan ke token tone di tema gelap */
[data-theme="dark"] [style^="color: #b45309"],
[data-theme="dark"] [style*=" color: #b45309"],
[data-theme="dark"] [style^="color: #92400e"],
[data-theme="dark"] [style*=" color: #92400e"] {
  color: var(--tone-warn) !important;
}

[data-theme="dark"] [style^="color: #047857"],
[data-theme="dark"] [style*=" color: #047857"],
[data-theme="dark"] [style^="color: #065f46"],
[data-theme="dark"] [style*=" color: #065f46"] {
  color: var(--tone-ok) !important;
}

[data-theme="dark"] [style^="color: #b91c1c"],
[data-theme="dark"] [style*=" color: #b91c1c"],
[data-theme="dark"] [style^="color: #991b1b"],
[data-theme="dark"] [style*=" color: #991b1b"] {
  color: var(--tone-danger) !important;
}

[data-theme="dark"] [style^="color: #075985"],
[data-theme="dark"] [style*=" color: #075985"],
[data-theme="dark"] [style^="color: #0369a1"],
[data-theme="dark"] [style*=" color: #0369a1"] {
  color: var(--tone-info) !important;
}
