/* ============ AAD Hub — gaya portal ============ */

:root {
  --bg: #fdfdfc;
  --panel: #ffffff;
  --hover: #f2f2f0;
  --text: #1c1c1e;
  --muted: #77777d;
  --line: #e9e9e7;
  --tile-robot: #fdf0e6;  --ink-robot: #b45309;
  --tile-app:   #e9f1fd;  --ink-app:   #1d5fd6;
  --tile-file:  #e9f6ee;  --ink-file:  #157347;
  --code-bg: #f7f7f5;
  --tk-k: #1d5fd6;  /* keyword  */
  --tk-s: #157347;  /* string   */
  --tk-n: #b45309;  /* angka    */
  --tk-c: #9b9ba1;  /* komentar */
}
:root[data-theme="dark"] {
  --bg: #131315;
  --panel: #18181b;
  --hover: #222225;
  --text: #f2f2f3;
  --muted: #9b9ba1;
  --line: #2a2a2e;
  --tile-robot: #2b1f13;  --ink-robot: #fbbf76;
  --tile-app:   #16223a;  --ink-app:   #8fbcff;
  --tile-file:  #14281d;  --ink-file:  #7fe0a7;
  --code-bg: #1d1d20;
  --tk-k: #8fbcff;
  --tk-s: #7fe0a7;
  --tk-n: #fbbf76;
  --tk-c: #6f6f76;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
body {
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: background .2s, color .2s;
}

/* ================= Header ================= */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: stretch;
  height: 56px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
/* brand mengisi kolom selebar sidebar & tampil di tengahnya */
.brand {
  width: 252px; flex: none;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em;
  border-right: 1px solid var(--line);
}
.brand-logo { display: block; border-radius: 7px; }
.brand-caret { color: var(--muted); font-size: .7rem; margin-left: -2px; }
/* Menu aplikasi (dropdown dari brand, hanya muncul di exe) */
.brand-wrap { position: relative; flex: none; display: flex; align-items: stretch; }
.app-menu {
  position: absolute; top: calc(100% + 4px); left: 16px; z-index: 60;
  min-width: 230px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
  display: flex; flex-direction: column; gap: 2px;
}
.app-menu button {
  text-align: left; background: none; border: none; color: var(--text);
  font: inherit; font-size: .88rem; padding: 9px 12px; border-radius: 8px; cursor: pointer;
}
.app-menu button:hover { background: var(--hover); }
.topbar-right {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0; justify-content: flex-end;
  padding: 0 clamp(16px, 2vw, 24px);
}

#search {
  width: min(320px, 100%); padding: 7px 12px;
  font-size: .88rem; font-family: inherit;
  background: var(--hover); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; outline: none;
  transition: border-color .12s, background .12s, width .15s;
}
#search:focus { border-color: var(--muted); background: var(--panel); }
#search::placeholder { color: var(--muted); }

#themeToggle, #langToggle {
  height: 36px; flex: none;
  display: grid; place-items: center;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-family: inherit; cursor: pointer;
  transition: background .12s;
}
#themeToggle { width: 36px; padding: 0; font-size: 1rem; }
#langToggle { min-width: 40px; padding: 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
#themeToggle:hover, #langToggle:hover { background: var(--hover); }

/* ================= Sidebar ================= */
.shell { display: flex; flex: 1; align-items: stretch; }
.sidebar {
  width: 252px; flex: none;
  position: sticky; top: 56px; height: calc(100vh - 56px);
  border-right: 1px solid var(--line);
  padding: 16px 14px 18px;
  display: flex; flex-direction: column;
}

.snav { display: flex; flex-direction: column; gap: 2px; }
.snav-label {
  font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 16px 12px 6px;
}
.snav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  font-size: .92rem; color: var(--muted);
  transition: background .12s, color .12s;
}
.snav a:hover { background: var(--hover); color: var(--text); }
.snav a.active { background: var(--hover); color: var(--text); font-weight: 600; }
.snav .num {
  margin-left: auto; font-size: .72rem; color: var(--muted);
  background: var(--hover); border: 1px solid var(--line);
  border-radius: 99px; padding: 0 8px;
}
.snav a.active .num { background: var(--bg); }

.side-bottom { margin-top: auto; padding: 8px 12px 0; text-align: center; }
.version { font-size: .75rem; color: var(--muted); }

/* ================= Konten ================= */
.main { flex: 1; min-width: 0; padding: clamp(24px, 3vw, 44px) clamp(24px, 3.5vw, 56px); transition: padding-right .18s ease; }
.main > section { animation: fade .22s ease; }
/* Saat panel penampil (dock) terbuka, konten menggeser ke kiri agar tidak tertutup */
body.viewer-dock .main { padding-right: calc(clamp(320px, var(--viewer-w, 460px), 55vw) + clamp(24px, 3.5vw, 56px)); }
body.viewer-resizing .main { transition: none; }   /* saat drag: konten ikut panel tanpa jeda */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.page-head h1 { font-size: clamp(1.5rem, 2.2vw, 1.9rem); font-weight: 750; letter-spacing: -.01em; }
.page-head p { color: var(--muted); margin-top: 4px; }

.banner {
  margin-bottom: 20px; padding: 12px 16px;
  border: 1px solid #e0b25a; border-radius: 10px;
  background: rgba(224, 178, 90, .1);
  font-size: .87rem;
}
.banner code, .note code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem;
  background: var(--hover); border-radius: 5px; padding: 1px 6px;
}

.head-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }
.breadcrumb b { color: var(--text); font-weight: 600; }
.crumb-back {
  display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none;
  margin-right: 10px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel);
  color: var(--muted); cursor: pointer; font-size: .95rem; line-height: 1; font-family: inherit;
  transition: border-color .12s, color .12s, background .12s;
}
.crumb-back:hover { color: var(--text); border-color: var(--muted); background: var(--hover); }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.tile {
  border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 4px; min-height: 168px;
  transition: transform .15s ease;
}
.tile:hover { transform: scale(1.012); }
.tile .emoji { font-size: 1.6rem; margin-bottom: auto; }
.tile h2 { font-size: 1.12rem; font-weight: 700; margin-top: 16px; }
.tile > p { font-size: .86rem; opacity: .75; }
.tile .count { font-size: .85rem; font-weight: 650; margin-top: 10px; }
.t-robot { background: var(--tile-robot); } .t-robot .count { color: var(--ink-robot); }
.t-app   { background: var(--tile-app); }   .t-app .count   { color: var(--ink-app); }
.t-file  { background: var(--tile-file); }  .t-file .count  { color: var(--ink-file); }

/* Panel dashboard */
.panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: .92rem; font-weight: 650; }
.panel-head a { font-size: .8rem; color: var(--muted); }
.panel-head a:hover { color: var(--text); }
.prow {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line); font-size: .88rem;
  box-shadow: inset 3px 0 0 transparent;
}
.prow:first-of-type { border-top: none; }
.prow .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .sub { color: var(--muted); font-size: .8rem; white-space: nowrap; }
/* baris yang bisa diklik: penanda hover */
a.prow { cursor: pointer; transition: background .12s, box-shadow .12s, color .12s; }
a.prow:hover { background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
a.prow:hover .grow { color: var(--text); font-weight: 600; }
a.prow:hover .sub { color: var(--text); }

/* Kartu */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 28px; }
/* Kartu tahun di halaman robot: isi lebar merata (2 tahun → 2 kolom penuh) */
.cards-year { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 22px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s;
}
.card:hover { border-color: var(--muted); }
.card h3 { font-size: 1.02rem; font-weight: 650; }
.card p { font-size: .87rem; color: var(--muted); flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tag { font-size: .78rem; color: var(--muted); }
.btn {
  font-size: .84rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 999px;
  background: none; color: inherit; cursor: pointer;
  padding: 7px 18px; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--muted); background: var(--hover); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: .76rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px;
}

.note { margin-top: 26px; font-size: .84rem; color: var(--muted); }

/* Keadaan kosong */
.empty {
  margin-top: 28px; padding: 36px 24px; text-align: center;
  border: 1px dashed var(--line); border-radius: 14px; color: var(--muted);
  font-size: .9rem;
}
.empty code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem;
  background: var(--hover); border-radius: 5px; padding: 1px 6px;
}

/* ================= README (markdown) ================= */
.md {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: clamp(18px, 2.5vw, 32px); margin-top: 24px;
  font-size: .93rem;
}
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.3em 0 .45em; line-height: 1.25; letter-spacing: -.01em; scroll-margin-top: 68px; }
.md h1 { font-size: 1.45rem; }
.md h2 { font-size: 1.2rem; border-bottom: 1px solid var(--line); padding-bottom: .3em; }
.md h3 { font-size: 1.05rem; }
.md p, .md ul, .md ol, .md table, .md blockquote { margin: .6em 0; }
.md ul, .md ol { padding-left: 1.5em; }
.md li { margin: .2em 0; }
.md a { color: var(--ink-app); }
.md a:hover { text-decoration: underline; }
.md code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .84em;
  background: var(--hover); border-radius: 5px; padding: 1px 6px;
}
.md pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; margin: .8em 0;
}
.md pre code { background: none; padding: 0; font-size: .82rem; line-height: 1.55; }
.md blockquote { border-left: 3px solid var(--line); padding: .1em 1em; color: var(--muted); }
.md hr { border: none; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; }
.md th { background: var(--hover); font-weight: 650; }
.md img { max-width: 100%; border-radius: 10px; }

/* ================= Galeri gambar ================= */
.gallery-label, .tree-label {
  font-size: .8rem; font-weight: 650; color: var(--muted);
  margin: 28px 0 10px; text-transform: uppercase; letter-spacing: .06em;
}
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.shot {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 0; cursor: zoom-in; overflow: hidden;
  transition: border-color .15s;
}
.shot:hover { border-color: var(--muted); }
.shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.shot figcaption {
  font-size: .74rem; color: var(--muted); padding: 6px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ================= Pohon file ================= */
.tree {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 8px;
}
.tree details { margin: 0; }
.tree summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px;
  font-size: .89rem; font-weight: 550;
}
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: "▸"; color: var(--muted); font-size: .8em; transition: transform .12s; }
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree summary:hover { background: var(--hover); }
.tree .dir-in { padding-left: 20px; border-left: 1px solid var(--line); margin-left: 16px; }
.tree .file {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; color: inherit;
  padding: 6px 10px; border-radius: 8px; font-size: .88rem;
}
.tree .file:hover { background: var(--hover); }
.tree .file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .file em { font-style: normal; font-size: .76rem; color: var(--muted); }

/* ================= Penampil file (panel kanan / fullscreen) ================= */
#viewer { position: fixed; inset: 0; z-index: 50; display: block; }
#viewer[hidden] { display: none !important; }
.v-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.v-panel {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line);
  overflow: hidden;
}
.v-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
#vName {
  font-weight: 650; font-size: .9rem; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
#vMeta { font-size: .78rem; color: var(--muted); white-space: nowrap; }
#vDownload { flex: none; }
.v-icon {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 1rem; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
}
.v-icon:hover { background: var(--hover); color: var(--text); }
.v-body { overflow: auto; flex: 1; min-height: 0; }
.v-body > img { display: block; max-width: 100%; margin: 0 auto; }
.v-body .v-center { padding: 48px 24px; text-align: center; color: var(--muted); font-size: .9rem; }
.v-body audio { display: block; width: min(480px, 90%); margin: 48px auto; }
.v-body video { display: block; max-width: 100%; max-height: calc(100vh - 180px); margin: 0 auto; background: #000; }
.v-body iframe { display: block; width: 100%; height: 100%; border: none; }

/* Handle resize (hanya di mode dock) */
.v-resize {
  display: none; position: absolute; left: -4px; top: 0; bottom: 0; width: 10px;
  cursor: ew-resize; z-index: 3; touch-action: none;
}
.v-resize::after {
  content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent;
  transition: background .12s;
}
.v-resize:hover::after, .v-resize.active::after { background: var(--accent); }

/* ---- Mode DOCK: drawer kanan, konten kiri tetap bisa diklik ---- */
#viewer.dock { pointer-events: none; }
#viewer.dock .v-backdrop { display: none; }
#viewer.dock .v-panel {
  pointer-events: auto; position: absolute; top: 56px; right: 0; bottom: 0;
  width: clamp(320px, var(--viewer-w, 460px), 55vw);
  border-top: none; border-right: none; border-bottom: none;
  box-shadow: -12px 0 32px rgba(0, 0, 0, .16);
}
#viewer.dock .v-resize { display: block; }

/* ---- Mode FULL: modal besar di tengah ---- */
#viewer.full { display: flex; align-items: center; justify-content: center; }
#viewer.full .v-panel {
  position: relative; width: min(1200px, calc(100vw - 48px));
  height: calc(100vh - 48px); border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
}

@media (max-width: 620px) {  /* layar kecil: dock jadi lebar penuh, konten tak digeser */
  #viewer.dock .v-panel { width: 100vw; }
  body.viewer-dock .main { padding-right: clamp(24px, 3.5vw, 56px); }
}

/* Penampil 3D STL */
.stl-wrap { position: relative; width: 100%; height: 100%; min-height: 260px; }
.stl-canvas {
  display: block; width: 100%; height: 100%; touch-action: none; cursor: grab;
  background:
    radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--accent) 7%, var(--panel)) 0%, var(--panel) 70%);
}
.stl-canvas:active { cursor: grabbing; }
.stl-load { padding: 64px 24px; text-align: center; color: var(--muted); font-size: .9rem; }
.stl-hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  padding: 6px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border: 1px solid var(--line); color: var(--muted); font-size: .76rem;
}
.stl-badge {
  position: absolute; right: 12px; top: 12px; pointer-events: none;
  padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border: 1px solid var(--line); color: var(--muted);
}
/* ===== Gerber viewer: toolbar 3 mode (2D/3D/Layers) + sidebar + 3D ===== */
.gbr-bar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; gap: 8px; align-items: center; max-width: calc(100% - 24px);
}
.gbr-btn {
  font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; color: var(--text);
  background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line);
}
.gbr-btn:hover { border-color: var(--accent); }
.gbr-tabs {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line);
}
.gbr-tab {
  font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
  padding: 5px 14px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--text);
}
.gbr-tab:hover { color: var(--accent); }
.gbr-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.gbr3d-stage {
  position: absolute; inset: 0; z-index: 3; touch-action: none; cursor: grab;
  display: flex; align-items: center; justify-content: center; perspective: 1500px;
  background: radial-gradient(130% 130% at 50% 12%, #1b2331 0%, #0b0f14 72%);
}
.gbr3d-stage:active { cursor: grabbing; }
.gbr3d-obj { position: relative; transform-style: preserve-3d; will-change: transform; }
.gbr3d-face {
  position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden;
  background: #0d6b3b; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
.gbr3d-face canvas { display: block; width: 100%; height: 100%; }
.gbr3d-edge { position: absolute; background: linear-gradient(#0f6c3a, #084b27); }

.gbr-layers {
  position: absolute; left: 0; top: 0; bottom: 0; width: 190px; z-index: 5;
  overflow-y: auto; padding: 50px 8px 12px; box-sizing: border-box;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
  border-right: 1px solid var(--line);
}
.gbr-layer {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
  font-size: .78rem; color: var(--text); cursor: pointer;
}
.gbr-layer:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.gbr-layer input { accent-color: var(--accent); flex: none; }
.gbr-sw { width: 13px; height: 13px; border-radius: 3px; flex: none; border: 1px solid rgba(0, 0, 0, .3); }
.gbr-lname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gbr-badge { top: auto !important; bottom: 12px; }

/* Kode dengan nomor baris */
.codewrap { display: flex; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.6; }
.gutter {
  flex: none; text-align: right; user-select: none;
  padding: 14px 10px 14px 16px; color: var(--muted);
  background: var(--panel); border-right: 1px solid var(--line);
  white-space: pre;
}
.codewrap pre { flex: 1; padding: 14px 18px; overflow-x: auto; margin: 0; }
.tk-k { color: var(--tk-k); font-weight: 600; }
.tk-s { color: var(--tk-s); }
.tk-n { color: var(--tk-n); }
.tk-c { color: var(--tk-c); font-style: italic; }

/* ================= Hasil pencarian ================= */
.sr-group {
  font-size: .72rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 22px 0 6px;
}
.sr-item {
  display: flex; gap: 10px; align-items: center;
  width: 100%; text-align: left; cursor: pointer;
  padding: 10px 14px; margin-bottom: 6px;
  background: var(--panel); color: inherit; font-size: .9rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .12s;
}
.sr-item:hover { border-color: var(--muted); }
.sr-item .sr-sub {
  margin-left: auto; color: var(--muted); font-size: .78rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%;
}

/* ================= Kelengkapan dokumentasi ================= */
.prog-summary { display: flex; gap: 16px; flex-wrap: wrap; margin: 26px 0 8px; }
.prog-big {
  flex: 1 1 340px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 22px 24px;
}
.prog-pct { font-size: 2.6rem; font-weight: 780; letter-spacing: -.02em; line-height: 1; }
.prog-track {
  height: 10px; border-radius: 999px; background: var(--hover);
  overflow: hidden; margin: 14px 0 8px;
}
.prog-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff9a4d, #ef5f10); transition: width .5s ease; }
.prog-cap { font-size: .85rem; color: var(--muted); }
.prog-stats { flex: 2 1 340px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pstat {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  padding: 18px; display: flex; flex-direction: column; gap: 4px;
  font-size: .8rem; color: var(--muted);
}
.pstat span { font-size: 1.7rem; font-weight: 750; color: var(--text); letter-spacing: -.01em; }

.yrow { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.yrow:first-of-type { border-top: none; margin-top: 6px; }
.yr { font-weight: 600; font-size: .9rem; min-width: 46px; }
.segs { display: flex; gap: 6px; margin-left: auto; }
.seg {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-size: .85rem;
  border: 1px solid var(--line); background: var(--bg);
  opacity: .38; filter: grayscale(.4); transition: transform .1s, opacity .1s;
}
.seg.on { opacity: 1; filter: none; border-color: transparent; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.seg:hover { transform: scale(1.1); opacity: 1; }
/* Bagian sengaja tidak dipakai (N/A) — dicoret, tidak bisa diklik */
.seg.na { opacity: .3; cursor: default; position: relative; }
.seg.na::after {
  content: ""; position: absolute; inset: 0; border-radius: 8px;
  background: linear-gradient(to top left, transparent 45%, var(--muted) 45%, var(--muted) 55%, transparent 55%);
}
.seg.na:hover { transform: none; opacity: .3; }
.card-na { opacity: .72; }
.na-tag { background: var(--hover); color: var(--muted); font-weight: 650; }
.gap-list { display: flex; flex-direction: column; gap: 8px; }

/* ================= Statistik & kontributor ================= */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 22px 0 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stat-table th, .stat-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.stat-table th { color: var(--muted); font-weight: 600; font-size: .78rem; letter-spacing: .02em; background: var(--panel); }
.stat-table tr:last-child td { border-bottom: none; }
.stat-table th:nth-child(n+2), .stat-table td:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.stat-table td:first-child { font-weight: 600; }
.contrib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.contrib {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.contrib-avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .82rem; color: #fff;
  background: linear-gradient(135deg, #ff9a4d, #ef5f10);
}
.contrib-info { flex: 1; min-width: 0; }
.contrib-name { font-weight: 650; font-size: .92rem; }
.contrib-where { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-count { flex: none; font-weight: 700; color: var(--accent); font-size: .95rem; }
.gap-list .sr-item { margin-bottom: 0; padding: 12px 16px; }
.gap-list .sr-item:hover { border-color: var(--accent); }

/* Judul seksi daftar (Status per robot / Still to fill / Warisan) */
.list-label {
  font-size: 1.02rem; font-weight: 680; color: var(--text);
  letter-spacing: -.01em; margin: 40px 0 16px;
}
.list-label + .cards { margin-top: 0; }
.list-label + .gap-list, .list-label + .empty { margin-top: 0; }

/* ================= Gerbang login (aplikasi) ================= */
.auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  padding: 24px;
}
.auth-card {
  width: min(420px, 100%); text-align: center;
  border: 1px solid var(--line); border-radius: 18px; background: var(--panel);
  padding: 40px 32px;
}
.auth-logo { border-radius: 16px; margin-bottom: 16px; }
.auth-card h1 { font-size: 1.5rem; font-weight: 780; letter-spacing: -.01em; }
.auth-msg { color: var(--muted); font-size: .92rem; margin-top: 8px; line-height: 1.55; }
.auth-code {
  font-family: var(--mono); font-size: 1.7rem; font-weight: 700; letter-spacing: .18em;
  color: var(--accent-ink); background: var(--hover);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin: 18px 0; user-select: all;
}
.auth-btn {
  width: 100%; margin-top: 18px;
  font-size: .95rem; font-weight: 650; color: #fff; background: var(--accent);
  border: none; border-radius: 999px; padding: 12px 20px; cursor: pointer;
  transition: background .15s;
}
.auth-btn:hover:not(:disabled) { background: var(--accent-press); }
.auth-btn:disabled { opacity: .6; cursor: default; }
.auth-hint { font-size: .8rem; color: var(--muted); margin-top: 14px; min-height: 1em; }

/* ================= Warisan: lini masa ================= */
.timeline { margin-top: 14px; }
.tl-year { display: flex; gap: 18px; align-items: flex-start; }
.tl-label {
  flex: none; width: 64px; text-align: right;
  font-weight: 750; font-size: 1.15rem; color: var(--accent-ink);
  padding-top: 12px;
}
.tl-items {
  flex: 1; min-width: 0;
  border-left: 2px solid var(--line);
  padding: 4px 0 20px 20px;
  position: relative;
}
.tl-year:last-child .tl-items { padding-bottom: 4px; }
.tl-items::before {
  content: ""; position: absolute; left: -7px; top: 14px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.tl-item {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.tl-win { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.tl-meta { font-size: .9rem; color: var(--muted); }
.tl-meta a { color: var(--text); }
.tl-meta a:hover { color: var(--accent-ink); }
.tl-people { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.card.lesson h3 a { color: var(--text); }
.card.lesson h3 a:hover { color: var(--accent-ink); }
.card.lesson p { color: var(--muted); font-size: .88rem; }

/* ================= Embed app ================= */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.app-frame {
  border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; background: var(--panel); margin-top: 10px;
}
.app-frame iframe {
  display: block; width: 100%; border: none;
  height: max(480px, calc(100vh - 380px));
}
.app-bar {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 60%, var(--panel));
}
.app-bar button, .app-bar a {
  font: inherit; font-size: 13px; line-height: 1; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px;
  background: var(--panel); color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.app-bar button:hover, .app-bar a:hover {
  border-color: var(--accent); color: var(--accent);
}
/* Layar penuh: menutupi seluruh viewport (di atas header & sidebar) */
.app-frame.fs {
  position: fixed; inset: 0; z-index: 200;
  margin: 0; border: none; border-radius: 0;
  display: flex; flex-direction: column; background: var(--panel);
}
.app-frame.fs iframe { flex: 1 1 auto; height: auto; }

/* ================= Responsif ================= */
@media (max-width: 820px) {
  .brand { width: auto; padding: 0 16px; justify-content: flex-start; }
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 2px;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 8px 12px; overflow-x: auto;
  }
  .snav { flex-direction: row; }
  .snav-label, .snav .num { display: none; }
  .side-bottom { display: none; }
  .tiles, .panels { grid-template-columns: 1fr; }
  .v-panel { width: 100vw; max-height: 100vh; border-radius: 0; }
}
