  :root {
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);

    --paper: #efe9db;
    --paper-raised: #f8f4ea;
    --ink: #23201a;
    --ink-soft: #5c5647;
    --ink-faint: #928c79;
    --line: #cfc6ac;
    --line-soft: #ddd4bc;
    --accent: #a1462f;
    --well: #e4dcc4;
    --shadow: rgba(40, 33, 18, 0.14);
    --chip-bg: #e6ddc3;
    --focus: #1d4f5c;
    --warn: #9c6b1f;
    --warn-bg: #f1e2bd;

    --g-ergonomi_rekayasa_kerja: #5f7a3d;
    --g-manajemen_industri: #2f5f7a;
    --g-sistem_industri_rantai_nilai: #a8402f;
    --g-sistem_informasi_keputusan: #6c4272;
    --g-sistem_manufaktur: #b1712c;
    --g-tidak_terklasifikasi: #857f6c;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --paper: #1c1a16;
      --paper-raised: #262319;
      --ink: #efe8d8;
      --ink-soft: #bcb29a;
      --ink-faint: #8b8371;
      --line: #43402f;
      --line-soft: #34311f;
      --accent: #e08361;
      --well: #292518;
      --shadow: rgba(0, 0, 0, 0.45);
      --chip-bg: #2e2b1d;
      --focus: #7fb8c9;
      --warn: #e0b458;
      --warn-bg: #332a13;

      --g-ergonomi_rekayasa_kerja: #93b26a;
      --g-manajemen_industri: #6fa2bd;
      --g-sistem_industri_rantai_nilai: #d97a63;
      --g-sistem_informasi_keputusan: #a983b3;
      --g-sistem_manufaktur: #d9a35c;
      --g-tidak_terklasifikasi: #a39c88;
    }
  }
  :root[data-theme="dark"] {
    --paper: #1c1a16;
    --paper-raised: #262319;
    --ink: #efe8d8;
    --ink-soft: #bcb29a;
    --ink-faint: #8b8371;
    --line: #43402f;
    --line-soft: #34311f;
    --accent: #e08361;
    --well: #292518;
    --shadow: rgba(0, 0, 0, 0.45);
    --chip-bg: #2e2b1d;
    --focus: #7fb8c9;
    --warn: #e0b458;
    --warn-bg: #332a13;

    --g-ergonomi_rekayasa_kerja: #93b26a;
    --g-manajemen_industri: #6fa2bd;
    --g-sistem_industri_rantai_nilai: #d97a63;
    --g-sistem_informasi_keputusan: #a983b3;
    --g-sistem_manufaktur: #d9a35c;
    --g-tidak_terklasifikasi: #a39c88;
  }

  * { box-sizing: border-box; }
  html { scroll-padding-top: env(safe-area-inset-top, 0px); }
  html, body { height: 100%; }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  a { color: inherit; }
  ::selection { background: var(--accent); color: var(--paper-raised); }

  .wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 22px 80px;
  }

  .navbar {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    color: var(--ink-faint);
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line-soft);

    display: flex;
    align-items: center;
    gap: 12px;
  }

  .nav-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
  }

  .nav-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    line-height: 1.15;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
  }

  /* .nav-text div:first-child {
    font-size: 0.62rem;
  }

  .nav-text div:nth-child(2) {
    font-size: 0.82rem;
    font-weight: 600;
  }

  .nav-text div:last-child {
    font-size: 0.62rem;
  } */

  /* ---------- Masthead ---------- */
  .masthead {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 18px;
    margin-bottom: 22px;
    flex-wrap: wrap;
  }
  .masthead h1 {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.05;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
  }
  .masthead .dek {
    max-width: 58ch;
    color: var(--ink-soft);
    font-size: 0.98rem;
    line-height: 1.55;
    margin: 0;
  }
  .masthead .meta {
    text-align: right;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    color: var(--ink-faint);
    white-space: nowrap;
  }
  .masthead .meta strong {
    display: block;
    font-size: 1.9rem;
    font-family: 'Fraunces', serif;
    font-weight: 500;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 4px;
  }

  /* ---------- Spectrum bar ---------- */
  .spectrum {
    display: flex;
    height: 40px;
    border: 1px solid var(--ink);
    margin-bottom: 6px;
    overflow: hidden;
  }
  .spectrum button {
    border: none;
    border-right: 1px solid var(--paper);
    cursor: pointer;
    height: 100%;
    position: relative;
    transition: flex-grow 0.35s ease, filter 0.15s ease;
    padding: 0;
  }
  .spectrum button:last-child { border-right: none; }
  .spectrum button:hover { filter: brightness(1.12); }
  .spectrum button.dim { flex-grow: 0.35 !important; filter: grayscale(0.55) brightness(0.85); }
  .spectrum-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--ink-faint);
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 18px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .caption-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
  }
  .caption-legend .lg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  .caption-legend .lg .sw { width: 7px; height: 7px; border-radius: 50%; flex: none; }

  /* ---------- Overlap strip ---------- */
  .overlap-strip {
    border: 1px dashed var(--line);
    background: var(--paper-raised);
    padding: 12px 14px 14px;
    margin-bottom: 22px;
    border-radius: 3px;
  }
  .overlap-strip .ov-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }
  .overlap-strip .ov-head h2 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
  }
  .overlap-strip .ov-head .ov-sub {
    font-size: 0.76rem;
    color: var(--ink-faint);
  }
  .pair-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .pair-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    background: var(--well);
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 0.76rem;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
  }
  .pair-chip:hover { border-color: var(--ink-faint); color: var(--ink); }
  .pair-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .pair-chip .sw { width: 8px; height: 8px; border-radius: 50%; flex: none; }
  .pair-chip .cross { color: var(--ink-faint); font-size: 0.7rem; }
  .pair-chip .n {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--ink-faint);
  }
  .pair-chip.active .n { color: var(--paper); opacity: 0.75; }

  /* ---------- Controls ---------- */
  .controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
  .search-box {
    flex: 1 1 240px;
    position: relative;
  }
  .search-box input {
    width: 100%;
    padding: 10px 14px 10px 34px;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.92rem;
    border-radius: 3px;
  }
  .search-box input:focus {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
  }
  .search-box svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    stroke: var(--ink-faint);
    pointer-events: none;
  }
  select#sortSelect, select#advisorSelect {
    padding: 10px 12px;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.85rem;
    border-radius: 3px;
    cursor: pointer;
  }
  .review-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 3px;
    font-size: 0.82rem;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
  }
  .review-toggle input { accent-color: var(--warn); cursor: pointer; }
  .review-toggle:hover { color: var(--ink); }

  /* ---------- Tabs ---------- */
  .tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { height: 4px; }
  .tab {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px 8px;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.83rem;
    color: var(--ink-soft);
    white-space: nowrap;
    border-radius: 3px 3px 0 0;
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .tab .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
  .tab .n { color: var(--ink-faint); font-family: 'IBM Plex Mono', monospace; font-size: 0.76rem; }
  .tab:hover { color: var(--ink); }
  .tab.active {
    color: var(--ink);
    font-weight: 500;
    border-bottom-color: var(--tab-color, var(--accent));
    background: var(--well);
  }
  .tabs-note {
    font-size: 0.74rem;
    color: var(--ink-faint);
    margin-bottom: 24px;
    line-height: 1.5;
  }

  /* ---------- Layout ---------- */
  .layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    align-items: start;
  }
  @media (max-width: 820px) {
    .layout { grid-template-columns: 1fr; }
  }

  .panel {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  @media (max-width: 820px) {
    .panel { position: static; max-height: none; overflow-y: visible; }
  }

  .panel-block {
    border: 1px solid var(--line);
    background: var(--paper-raised);
    padding: 16px 16px 18px;
    margin-bottom: 16px;
    border-radius: 3px;
  }
  .panel-block h2 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .panel-block h2 .sw { width: 11px; height: 11px; border-radius: 50%; flex: none; }
  .panel-block p.desc {
    font-size: 0.83rem;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0 0 10px;
  }
  .role-split {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 0.78rem;
  }
  .role-split .rs {
    display: flex;
    align-items: baseline;
    gap: 5px;
  }
  .role-split .rs b {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    color: var(--ink);
    font-weight: 500;
  }
  .role-split .rs span { color: var(--ink-faint); }

  .kw-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 10px;
  }
  .kw-row .kw-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
  }
  .kw-row .kw-name {
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .kw-row .kw-bar-track {
    height: 5px;
    background: var(--well);
    border-radius: 3px;
    overflow: hidden;
  }
  .kw-row .kw-bar-fill { height: 100%; border-radius: 3px; }
  .kw-row .kw-count {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--ink-faint);
    font-size: 0.74rem;
  }

  .legend-note {
    font-size: 0.76rem;
    color: var(--ink-faint);
    line-height: 1.5;
    border-top: 1px dashed var(--line);
    padding-top: 12px;
    margin-top: 4px;
  }

  /* ---------- KK overview accordion ---------- */
  .kk-overview {
    border-top: 1px dashed var(--line);
    padding-top: 12px;
    margin-top: 4px;
    margin-bottom: 14px;
  }
  .kk-overview .kko-lead {
    font-size: 0.83rem;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0 0 4px;
  }
  .kk-overview .kko-chair {
    font-size: 0.76rem;
    color: var(--ink-faint);
    margin: 0 0 8px;
  }
  .kk-overview .kko-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.76rem;
    color: var(--focus);
    cursor: pointer;
  }
  .kk-overview .kko-toggle svg {
    width: 11px;
    height: 11px;
    transition: transform 0.15s ease;
  }
  .kk-overview.open .kko-toggle svg { transform: rotate(90deg); }
  .kk-overview .kko-body {
    display: none;
    margin-top: 10px;
  }
  .kk-overview.open .kko-body { display: block; }
  .kk-overview .kko-body ul {
    margin: 0;
    padding-left: 16px;
  }
  .kk-overview .kko-body li {
    font-size: 0.8rem;
    color: var(--ink-soft);
    line-height: 1.45;
    margin-bottom: 6px;
  }

  .kwm-panel {
    border-top: 1px dashed var(--line);
    padding-top: 10px;
    margin-top: 10px;
  }
  .kwm-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    margin-top: 4px;
    font-family: inherit;
    font-size: 0.76rem;
    color: var(--focus);
    cursor: pointer;
  }
  .kwm-toggle svg {
    width: 11px;
    height: 11px;
    transition: transform 0.15s ease;
  }
  .kwm-panel.open .kwm-toggle svg { transform: rotate(90deg); }
  .kwm-body { display: none; margin-top: 10px; }
  .kwm-panel.open .kwm-body { display: block; }
  .kwm-note {
    font-size: 0.74rem;
    color: var(--ink-faint);
    line-height: 1.45;
    margin: 0 0 10px;
  }
  .kwm-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
    margin: 0 0 6px;
  }
  .kwm-section-label:not(:first-child) { margin-top: 12px; }
  .kwm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }
  .kwm-chip {
    font-size: 0.71rem;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid transparent;
    white-space: nowrap;
  }
  .kwm-chip.strong {
    background: var(--chip-bg);
    color: var(--ink);
    font-weight: 500;
  }
  .kwm-chip.weak {
    background: transparent;
    color: var(--ink-faint);
    border-color: var(--line);
  }

  /* ---------- List ---------- */
  .list-meta {
    font-size: 0.8rem;
    color: var(--ink-faint);
    margin-bottom: 12px;
    font-family: 'IBM Plex Mono', monospace;
  }

  .card {
    display: flex;
    border: 1px solid var(--line);
    background: var(--paper-raised);
    margin-bottom: 10px;
    border-radius: 0 3px 3px 0;
    box-shadow: 2px 2px 0 var(--shadow);
  }
  .card .spine {
    flex: none;
    width: 6px;
    display: flex;
    flex-direction: column;
  }
  .card .spine i { display: block; flex: 1 1 0; }
  .card .body {
    padding: 13px 16px 14px;
    flex: 1;
    min-width: 0;
  }
  .card .row1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 7px;
    flex-wrap: wrap;
  }
  .card .idx {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    color: var(--ink-faint);
    padding-top: 3px;
  }
  .card .membership-pills {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .mpill {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 3px 8px;
    border-radius: 5px;
    border: 1.5px solid transparent;
    white-space: nowrap;
  }
  .mpill .sw { width: 6px; height: 6px; border-radius: 50%; flex: none; }
  .mpill.role-utama { color: var(--paper-raised); }
  .mpill.role-sekunder { background: transparent; }

  .list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }
  .list-head .list-meta { margin-bottom: 0; }
  .role-legend {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .role-legend .mpill {
    font-size: 0.64rem;
    padding: 3px 8px;
  }
  .role-legend .mpill.role-utama {
    background: var(--ink-faint);
    color: var(--paper-raised);
    border-color: var(--ink-faint);
  }
  .role-legend .mpill.role-sekunder {
    background: transparent;
    color: var(--ink-faint);
    border-color: var(--ink-faint);
  }
  .review-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--warn-bg);
    color: var(--warn);
    white-space: nowrap;
  }
  .card h3 {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.38;
    margin: 0 0 9px;
    color: var(--ink);
  }
  .card h3 a.title-link {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.15s ease;
  }
  .card h3 a.title-link:hover { color: var(--accent); }
  .card .tagrow {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .chip {
    font-size: 0.72rem;
    padding: 3px 9px;
    background: var(--chip-bg);
    border-radius: 20px;
    color: var(--ink-soft);
  }

  .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-faint);
    border: 1px dashed var(--line);
  }
  .empty-state p { margin: 6px 0 0; font-size: 0.85rem; }

  #loadMoreWrap { text-align: center; margin-top: 18px; }
  #loadMoreBtn {
    background: var(--paper-raised);
    border: 1px solid var(--ink);
    color: var(--ink);
    padding: 10px 22px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 3px;
  }
  #loadMoreBtn:hover { background: var(--well); }

  footer {
    margin-top: 50px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--ink-faint);
    line-height: 1.6;
  }

  :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

  @media (max-width: 480px) {
    .masthead { flex-direction: column; align-items: flex-start; }
    .masthead .meta { text-align: left; }
  }

  /* ---- kartu: meta, abstrak ---- */
  .card .meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    margin: 2px 0 9px;
    font-size: 0.78rem;
    color: var(--ink-faint);
  }
  .card .meta-line .adv { color: var(--ink-soft); }
  .abs-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;               /* ke kanan, sejajar dengan baris kata kunci */
    padding: 4px 11px 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--ink-faint);
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 0.72rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }
  .abs-btn svg { width: 12px; height: 12px; flex: none; stroke: currentColor; }
  .abs-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
  .abs-btn:hover,
  .abs-btn[aria-expanded="true"]:hover {
    background: var(--accent);       /* isi = warna primer; garis & teks = krem (warna teks-di-atas-aksen situs) */
    border-color: var(--accent);
    color: var(--paper-raised);
  }
  .abs-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  .abs-body {
    margin-top: 10px;
    padding: 11px 13px;
    background: var(--chip-bg);
    border-radius: 3px;
    font-size: 0.86rem;
    line-height: 1.65;
    color: var(--ink-soft);
    max-width: 72ch;
  }
  .abs-body[hidden] { display: none; }
  select#advisorSelect { max-width: 230px; }

