/* ===== Token ===== */
:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --primary: #ea7a12;          /* oranye LAB, kontras teks putih memenuhi AA untuk teks tebal */
  --primary-hover: #d46b0a;
  --primary-soft: #fff4e8;
  --primary-ink: #9a4a05;
  --live: #16a34a;
  --live-soft: #e8f7ee;
  --wait: #b45309;
  --wait-soft: #fef3e2;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .05);
  --shadow-md: 0 4px 16px rgb(0 0 0 / .06), 0 1px 3px rgb(0 0 0 / .05);
  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f11;
    --surface: #18181b;
    --surface-2: #1d1d21;
    --ink: #f4f4f5;
    --ink-2: #d4d4d8;
    --muted: #a1a1aa;
    --line: #27272a;
    --line-strong: #3f3f46;
    --primary: #f28c28;
    --primary-hover: #f59e47;
    --primary-soft: #2b1d10;
    --primary-ink: #fbbf7a;
    --live: #4ade80;
    --live-soft: #12261a;
    --wait: #fbbf24;
    --wait-soft: #2a2110;
    --danger: #f87171;
    --danger-soft: #2c1414;
    --shadow-sm: none;
    --shadow-md: 0 0 0 1px var(--line);
    color-scheme: dark;
  }
}

/* ===== Dasar ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; margin: 0; }
a { color: inherit; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.muted { color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ===== Tombol ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 14px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); }
.btn-block { width: 100%; min-height: 44px; }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: 40px; padding: 0; }

/* ===== Layout ===== */
.app { display: grid; grid-template-columns: 288px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px; padding: 20px 16px;
  background: var(--surface); border-right: 1px solid var(--line);
}
main { padding: 32px clamp(16px, 5vw, 64px) 80px; outline: none; min-width: 0; overflow-x: clip; }
.menu-btn { display: none; }

/* ===== Sidebar ===== */
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 8px; }
.brand img { border-radius: 8px; object-fit: contain; }
.brand strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.brand span { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }

.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); transition: border-color .15s; }
.search:focus-within { border-color: var(--primary); }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); outline: none; }

.history { display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; }
.logout-btn { margin-top: auto; flex: none; }
.history-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.history-item {
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px;
  min-height: 44px; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2);
  transition: background-color .15s var(--ease);
}
.history-item:hover { background: var(--surface-2); }
.history-item[aria-current="page"] { background: var(--primary-soft); color: var(--ink); }
.history-item > span:nth-child(2) { min-width: 0; }
.history-item .t, .history-item .s { display: block; }
.history-item .t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .s { font-size: 12px; color: var(--muted); }
.history-item .when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history-empty { font-size: 13px; color: var(--muted); padding: 12px 10px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.dot.live { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 25%, transparent); }
.dot.wait { background: var(--wait); }
.dot.failed { background: var(--danger); }

/* ===== Beranda ===== */
.home {
  position: relative; isolation: isolate;
  max-width: 840px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  padding-top: clamp(24px, 7vh, 72px);
}
/* Latar bertitik halus yang memudar ke tepi */
.home::before {
  content: ""; position: absolute; z-index: -1; inset: -40px -15vw 0;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 11%, transparent) 1px, transparent 1.2px);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(ellipse 60% 45% at 50% 22%, #000 10%, transparent 75%);
          mask-image: radial-gradient(ellipse 60% 45% at 50% 22%, #000 10%, transparent 75%);
  pointer-events: none;
}
.home-title {
  font-family: "Newsreader", Georgia, serif; font-weight: 500; letter-spacing: -.01em;
  font-size: clamp(30px, 4.2vw, 42px); text-align: center; margin: 0 0 18px;
}

.launch {
  display: flex; align-items: center; gap: 4px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px;
  box-shadow: var(--shadow-md); transition: border-color .15s, box-shadow .15s;
}
.launch:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent), var(--shadow-md); }
.launch-lang {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 4px 18px 4px 12px; border-right: 1px solid var(--line); color: var(--ink-2);
}
.launch-lang small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.launch-lang { position: relative; padding: 0 8px 0 0; }
.lang-btn {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 10px 2px 8px;
  border: 0; border-radius: 10px; background: none; color: var(--ink-2); cursor: pointer; text-align: left; font: inherit;
  transition: background-color .15s;
}
.lang-btn:hover, .lang-btn[aria-expanded="true"] { background: var(--surface-2); }
.lang-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.lang-btn .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s var(--ease); }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lang-list {
  position: absolute; z-index: 20; top: calc(100% + 10px); left: -4px; width: 268px;
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md);
  animation: lang-pop .14s var(--ease);
}
.lang-list:focus { outline: none; }
.lang-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.lang-list li b { display: block; font-size: 14px; color: var(--ink); }
.lang-list li small { display: block; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.lang-list li:hover, .lang-list li.active { background: var(--surface-2); }
.lang-list li[aria-selected="true"] { background: var(--primary-soft); }
.lang-list li[aria-selected="true"] b { color: var(--primary-ink); }
.lang-list .check { width: 16px; height: 16px; color: var(--primary); visibility: hidden; }
.lang-list li[aria-selected="true"] .check { visibility: visible; }
@keyframes lang-pop { from { opacity: 0; transform: translateY(-4px); } }
.launch input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; background: none;
  font: inherit; font-size: 15px; color: var(--ink); outline: none;
}
.launch input::placeholder { color: var(--muted); }
.launch .btn { min-height: 44px; padding: 0 20px; border-radius: 11px; }
.launch-error { text-align: center; }
.launch-extra { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.launch-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }

/* Chip repo GitHub */
.repo-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.repo-chips:empty { display: none; }
.repo-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font: 600 12px var(--font); color: var(--ink-2);
}
.repo-chip.static { padding-right: 10px; }
.repo-chip button {
  display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1;
}
.repo-chip button:hover { background: var(--danger-soft); color: var(--danger); }
.repo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; color: var(--muted); }
.repo-row > .ic { width: 16px; height: 16px; }
.repo-row .repo-chips { justify-content: flex-start; }

/* Popover pemilih repo */
.repo-picker {
  position: fixed; z-index: 60; width: min(380px, calc(100vw - 24px)); max-height: min(440px, 70vh);
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 16px 48px rgb(0 0 0 / .16);
}
.repo-picker[hidden] { display: none; }
.repo-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.repo-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.repo-list { flex: 1; overflow-y: auto; padding: 6px; }
.repo-opt {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.repo-opt:hover { background: var(--surface-2); }
.repo-opt input { margin: 3px 0 0; accent-color: var(--primary); width: 16px; height: 16px; }
.repo-opt b { display: block; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-opt small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-opt .lock { font-weight: 600; color: var(--wait); }
.repo-msg { padding: 16px; text-align: center; font-size: 13px; color: var(--muted); }
.repo-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.repo-foot .btn { min-height: 34px; padding: 0 14px; }
.repo-foot .link-btn { margin-left: auto; text-decoration: none; }
.repo-foot[hidden] { display: none; }
.gh-connect { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 14px; }
.gh-connect h3 { font-size: 16px; color: var(--ink); margin: 0; }
.gh-connect p { margin: 0; font-size: 13px; color: var(--muted); max-width: 36ch; }
.gh-connect small { font-size: 12px; color: var(--muted); }
.gh-connect .btn { width: 100%; }
.gh-org { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; }
.gh-org span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.gh-org input { height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.gh-org input:focus { outline: none; border-color: var(--primary); }

/* Aktivitas AI membaca repo di chat */
.tool-log { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.tool-log:empty { display: none; }
.tool-step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.tool-step .ic { width: 13px; height: 13px; color: var(--primary); }
.msg-body > :first-child { margin-top: 0; }
.msg-body > :last-child { margin-bottom: 0; }
.launch-extra input {
  width: min(420px, 100%); height: 40px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
}
.launch-extra input:focus { outline: none; border-color: var(--primary); }
.launch-hint { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.launch-hint b { color: var(--ink-2); }
#lang-hint { display: block; margin-top: 2px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border: 0; border-radius: 6px;
  background: none; font: 600 13px var(--font); color: var(--primary-ink); cursor: pointer;
}
.link-btn:hover { background: var(--primary-soft); }
.link-btn .ic { width: 14px; height: 14px; }

.recent { margin-top: 26px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 4px; }
.recent-head h2 { font-size: 15px; font-weight: 700; }
.recent-list { display: flex; flex-direction: column; gap: 6px; }
.recent-item {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 46px; padding: 10px 14px; border-radius: 10px; text-decoration: none;
  background: color-mix(in srgb, var(--surface-2) 85%, var(--line)); color: var(--ink);
  transition: background-color .15s var(--ease);
}
.recent-item:hover { background: var(--primary-soft); }
.recent-item .t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .m { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.recent-empty { margin: 0; padding: 18px; text-align: center; font-size: 14px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; }

/* Sidebar: aksi utama sebagai item nav berwarna lembut */
.nav-primary {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px;
  border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-ink);
  font-size: 14px; font-weight: 700; text-decoration: none; transition: background-color .15s;
}
.nav-primary:hover { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }

@media (max-width: 640px) {
  .launch { flex-wrap: wrap; padding: 6px; }
  .launch-lang { border-right: 0; border-bottom: 1px solid var(--line); width: 100%; padding: 6px 10px 10px; }
  .launch .btn { width: 100%; }
}
.step-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-ink); flex: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.install { padding: 22px; }
.install-head { display: flex; gap: 14px; align-items: center; }
.install-head h2 { font-size: 18px; }
.install-head .grow { flex: 1; min-width: 0; }
.step-ic.ok { background: var(--live-soft); color: var(--live); }
.install-ok { border-color: color-mix(in srgb, var(--live) 30%, var(--line)); }
@media (max-width: 640px) { .install-head { flex-wrap: wrap; } .install-head .btn { width: 100%; } }
.install-head p { margin: 2px 0 0; font-size: 14px; }
.install-list { margin: 18px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); }
.install-list li::marker { color: var(--muted); font-weight: 700; }
.kbd { display: inline-flex; align-items: center; gap: 6px; font: 600 13px ui-monospace, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 8px; color: var(--ink); cursor: pointer; }
.kbd:hover { border-color: var(--primary); }
.kbd .ic { width: 14px; height: 14px; color: var(--muted); }
.tip { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--wait-soft); color: var(--ink-2); font-size: 14px; }
.tip .ic { color: var(--wait); margin-top: 2px; }

/* ===== Detail ===== */
.detail { max-width: 860px; margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; margin-top: -12px; background: var(--bg); }
.topbar-actions { display: flex; gap: 8px; }

.status { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.status.live { background: var(--live-soft); border-color: transparent; color: var(--live); }
.status.live .status-dot { background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
.status.wait { background: var(--wait-soft); border-color: transparent; color: var(--wait); }
.status.wait .status-dot { background: var(--wait); }
.status.failed { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.status.failed .status-dot { background: var(--danger); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 50%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }

.detail-head { padding: 20px 0 8px; }
.date { margin: 0 0 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
.detail-head h1 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 800; }
.meta { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); }
.meta li { display: inline-flex; align-items: center; gap: 6px; }
.meta .ic { width: 16px; height: 16px; }
.meta a { text-decoration: none; }
.meta a:hover { color: var(--ink); text-decoration: underline; }

.alert { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 14px; }
.alert .ic { margin-top: 2px; }

.screen { margin: 16px 0 0; padding: 10px; }
.screen img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: contain; border-radius: var(--radius-sm); background: #000; }
.screen figcaption { font-size: 12px; margin-top: 8px; }

.tabs { display: flex; align-items: center; gap: 4px; margin: 24px 0 20px; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; margin-bottom: -1px;
  background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 600 14px var(--font); cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--primary); }
.tabs .ic { width: 16px; height: 16px; }
.badge { font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; line-height: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.screen-btn { margin-left: auto; }

/* ===== Notula ===== */
.notes-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-height: 20px; margin-bottom: 8px; }
.notes-status .ic { width: 15px; height: 15px; color: var(--primary); }
.notes { font-size: 16px; line-height: 1.75; color: var(--ink-2); max-width: 72ch; }
.notes h1, .notes h2 { font-size: 20px; font-weight: 800; color: var(--ink); margin: 32px 0 10px; }
.notes > :first-child { margin-top: 0; }
.notes h3 { font-size: 16px; color: var(--ink); margin: 20px 0 6px; }
.notes ul, .notes ol { padding-left: 22px; margin: 0 0 12px; }
.notes li { margin: 4px 0; }
.notes li::marker { color: var(--primary); }
.notes strong { color: var(--ink); }
.notes table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.5; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin: 8px 0 16px; }
.notes th, .notes td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.notes tr:last-child td { border-bottom: 0; }
.notes th { background: var(--surface-2); font-weight: 700; color: var(--ink); font-size: 13px; }
.notes .updated { animation: glow 1.4s var(--ease); }
@keyframes glow { from { background: var(--primary-soft); } to { background: transparent; } }

/* ===== Kosong & skeleton ===== */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 16px; color: var(--muted); }
.empty .step-ic { width: 48px; height: 48px; border-radius: 14px; }
.empty h3 { color: var(--ink); font-size: 16px; }
.empty p { margin: 0; max-width: 42ch; font-size: 14px; }
.skeleton { display: flex; flex-direction: column; gap: 12px; }
.skeleton span { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
.skeleton span:nth-child(1) { width: 40%; height: 20px; }
.skeleton span:nth-child(2) { width: 92%; }
.skeleton span:nth-child(3) { width: 78%; }
.skeleton span:nth-child(4) { width: 85%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== Transkrip ===== */
.transcript { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.seg { display: grid; grid-template-columns: 36px 1fr; gap: 12px; animation: rise .25s var(--ease); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; }
.seg-head { display: flex; align-items: baseline; gap: 8px; }
.seg-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.seg-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg-text { margin: 2px 0 0; color: var(--ink-2); }
.seg.partial .seg-text::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--primary); vertical-align: middle; animation: blink 1s infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
@keyframes blink { 50% { opacity: .2; } }

.btn-delete:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); background: var(--danger-soft); }

/* ===== Tanya AI ===== */
.chat { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.chat-log { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 92%; line-height: 1.65; font-size: 15px; }
.msg.user {
  align-self: flex-end; padding: 10px 14px; border-radius: 14px 14px 4px 14px;
  background: var(--primary-soft); color: var(--ink); white-space: pre-wrap;
}
.msg.ai { align-self: flex-start; color: var(--ink-2); }
.msg.ai > :first-child { margin-top: 0; }
.msg.ai > :last-child { margin-bottom: 0; }
.msg.ai ul, .msg.ai ol { padding-left: 20px; margin: 6px 0; }
.msg.ai li::marker { color: var(--primary); }
.msg.ai strong { color: var(--ink); }
.msg.ai table { border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.msg.ai th, .msg.ai td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.msg.ai.pending::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: blink 1s infinite; margin-left: 4px; }
.ts, .ts-demo {
  display: inline-block; padding: 0 6px; border-radius: 6px; border: 0;
  background: var(--surface-2); color: var(--primary-ink); font: 600 12px/1.6 var(--font); font-variant-numeric: tabular-nums;
}
.ts { cursor: pointer; }
.ts:hover { background: var(--primary-soft); }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font: 500 13px var(--font); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.chat-form {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-sm);
  position: sticky; bottom: 12px;
}
.chat-form:focus-within { border-color: var(--primary); }
.chat-form textarea {
  flex: 1; min-width: 0; max-height: 160px; padding: 9px 0; border: 0; background: none; resize: none;
  font: inherit; font-size: 15px; line-height: 1.5; color: var(--ink); outline: none;
}
.chat-form .btn { flex: none; width: 40px; min-height: 40px; padding: 0; border-radius: 10px; }
.chat-note { margin: 0; font-size: 12px; color: var(--muted); }
.seg.flash { animation: seg-flash 2s var(--ease); border-radius: 10px; }
@keyframes seg-flash { 0%, 40% { background: var(--primary-soft); box-shadow: 0 0 0 8px var(--primary-soft); } }

/* ===== Dialog ===== */
.dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgb(0 0 0 / .2); }
.dialog::backdrop { background: rgb(0 0 0 / .45); }
.dialog[open] { animation: pop .2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.dialog-head { display: flex; gap: 14px; align-items: flex-start; }
.dialog-head h2 { font-size: 18px; }
.dialog-head p { margin: 4px 0 0; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input { height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; transition: border-color .15s; }
.field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; }
.alert.warn { margin: 0; background: var(--wait-soft); color: var(--ink-2); }
.alert.warn .ic { color: var(--wait); }
.alert a { color: var(--primary-ink); font-weight: 600; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
@media (max-width: 480px) { .dialog-actions { flex-direction: column-reverse; } .dialog-actions .btn { width: 100%; } }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Responsif ===== */
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-md); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; margin-bottom: 12px; }
  main { padding: 16px 16px 64px; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { width: 40px; padding: 0; }
}

/* ===== Asisten AI (bola + gelembung) ===== */
.ai-dock {
  position: fixed; right: 28px; bottom: 24px; z-index: 30;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  pointer-events: none;
}
main:has(.ai-dock:not([hidden])) { padding-bottom: 200px; }
.ai-bubble {
  max-width: min(320px, calc(100vw - 48px)); padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: color-mix(in srgb, var(--ink) 90%, transparent); color: var(--bg);
  backdrop-filter: blur(8px); box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(8px) scale(.97); transform-origin: bottom right;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.ai-bubble.show { opacity: 1; transform: none; }
.ai-bubble-name { display: block; font-size: 11px; font-weight: 700; letter-spacing: .03em; opacity: .6; }
.ai-bubble-text { margin: 2px 0 0; font-size: 14px; font-weight: 600; line-height: 1.45; }

.ai-orb { position: relative; width: 112px; height: 112px; display: grid; place-items: center; }
.ai-orb::before {
  content: ""; position: absolute; inset: 10%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 60%, transparent), transparent 70%);
  filter: blur(14px); animation: orb-glow 3s ease-in-out infinite;
}
.ai-orb canvas { position: relative; width: 100%; height: 100%; }
/* Cadangan kalau WebGL/three.js tidak tersedia */
.ai-orb-core {
  position: absolute; inset: 22%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd08a, #ef7d1a 45%, #b8430a 100%);
  animation: orb-breathe 3s ease-in-out infinite;
}
.ai-orb.webgl .ai-orb-core { display: none; }
.ai-orb-label {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.ai-dock[data-mode="writing"] .ai-orb::before { animation-duration: 1.2s; }
.ai-dock[data-mode="waiting"] .ai-orb { opacity: .75; }
@keyframes orb-glow { 50% { transform: scale(1.18); opacity: .65; } }
@keyframes orb-breathe { 50% { transform: scale(1.06); } }

/* Efek mengetik notula */
.tw-wait { display: none !important; }
td.tw-wait, th.tw-wait { display: table-cell !important; visibility: hidden; }
.tw-caret {
  display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -.18em;
  background: var(--primary); border-radius: 1px; animation: caret-blink .8s steps(2) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

@media (max-width: 640px) {
  .ai-dock { right: 16px; bottom: 16px; }
  .ai-orb { width: 84px; height: 84px; }
}

/* =====================================================================
   Tampilan v2 (pola tata letak meeting.ai, identitas LAB)
   Lapisan ini sengaja di akhir supaya menimpa gaya lama.
   ===================================================================== */
:root { --side-w: 272px; --serif: "Newsreader", Georgia, serif; }

/* ── Kerangka + sidebar ─────────────────────────────────────────────── */
.app { grid-template-columns: var(--side-w) minmax(0, 1fr); transition: grid-template-columns .2s var(--ease); }
/* Dilipat = rel ikon (bukan hilang total) */
.app.collapsed { --side-w: 68px; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.app.collapsed .sidebar { padding: 14px 10px 10px; align-items: center; overflow-x: hidden; }
.app.collapsed .side-top { flex-direction: column; gap: 10px; padding: 2px 0 14px; }
.app.collapsed .side-top .brand strong,
.app.collapsed .side-search,
.app.collapsed .history,
.app.collapsed .side-who,
.app.collapsed .side-nav .nav-badge { display: none; }
.app.collapsed #collapse-btn .ic { transform: scaleX(-1); }
.app.collapsed .side-nav { align-items: center; }
.app.collapsed .nav-item { width: 44px; min-height: 44px; padding: 0; justify-content: center; font-size: 0; gap: 0; position: relative; }
.app.collapsed .nav-item .ic { width: 20px; height: 20px; }
/* Titik status GitHub tetap terlihat di rel */
.app.collapsed #nav-github:has(.nav-badge.on)::after {
  content: ""; position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--live);
}
.app.collapsed .side-sep { margin: 12px -10px auto; }
.app.collapsed .side-foot { flex-direction: column; gap: 8px; margin: 8px -10px 0; padding: 12px 0 4px; }
.sidebar { gap: 0; padding: 14px 12px 10px; background: var(--surface); }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 14px 6px; }
.side-top .brand { padding: 0; text-decoration: none; color: var(--ink); gap: 8px; }
.side-top .brand strong { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.side-top .brand strong span { display: inline; font-size: inherit; line-height: inherit; color: var(--primary); }
.side-top .brand img { border-radius: 7px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border: 1px solid transparent; border-radius: 10px; background: none; color: var(--muted); cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-danger:hover { background: var(--danger-soft); color: var(--danger); }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px;
  border: 0; border-radius: 10px; background: none; color: var(--ink-2); text-decoration: none; text-align: left;
  font: 500 15px var(--font); cursor: pointer; transition: background-color .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.nav-item .ic { width: 19px; height: 19px; }
.nav-badge {
  margin-left: auto; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.nav-badge.on { background: var(--live-soft); color: var(--live); border-color: transparent; }
.side-sep { height: 1px; background: var(--line); margin: 12px -12px; }
.side-search { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; color: var(--muted); border-radius: 10px; }
.side-search:focus-within { background: var(--surface-2); color: var(--ink); }
.side-search input { flex: 1; min-width: 0; border: 0; background: none; font: 500 15px var(--font); color: var(--ink); outline: none; }
.side-search input::placeholder { color: var(--ink-2); }
.history { margin: 4px 0 0; flex: 1; overflow-y: auto; min-height: 0; }
.history-group { padding: 14px 12px 6px; font-size: 11px; letter-spacing: .08em; }
.history-item { grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; min-height: 38px; padding: 6px 12px; border-radius: 10px; }
.history-item .doc { width: 16px; height: 16px; color: var(--muted); }
.history-item .t { font-size: 14px; font-weight: 500; color: var(--ink); }
.history-item .when { font-size: 12px; }
.history-item.failed .t { color: var(--muted); }
.history-item.failed .doc { color: var(--danger); }
.history-item.live .when { color: var(--danger); font-weight: 700; }
.history-item .live-dot { width: 8px; height: 8px; margin: 0 4px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 12px 6px 4px; margin: 8px -12px 0; padding-left: 18px; padding-right: 12px; border-top: 1px solid var(--line); }
.side-avatar { border-radius: 50%; background: var(--surface-2); padding: 3px; object-fit: contain; }
.side-who { flex: 1; min-width: 0; line-height: 1.25; }
.side-who b { display: block; font-size: 14px; color: var(--ink); }
.side-who small { font-size: 12px; color: var(--muted); }
.logout-btn { display: none; }

/* ── Beranda ───────────────────────────────────────────────────────── */
.home { max-width: 860px; gap: 12px; padding-top: clamp(28px, 9vh, 96px); }
.home-title { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; font-size: clamp(32px, 4.4vw, 44px); }
.info-tip { position: relative; display: inline-grid; place-items: center; color: var(--muted); cursor: help; }
.info-tip .ic { width: 18px; height: 18px; }
.info-tip::after {
  content: attr(aria-label); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 260px; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--bg);
  font: 500 13px/1.45 var(--font); letter-spacing: 0; text-align: left; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5;
}
.info-tip:hover::after, .info-tip:focus-visible::after { opacity: 1; }
.launch { border-radius: 18px; padding: 10px; }
.launch .btn { border-radius: 12px; padding: 0 22px; }
.launch.is-empty .btn { background: color-mix(in srgb, var(--primary) 40%, var(--surface)); box-shadow: none; }
.launch-hint { margin-top: 2px; font-size: 13px; }
#lang-hint { display: block; margin: 0; }

.context-line {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 10px;
  font-size: 13px; color: var(--ink-2);
}
.ctx-ic { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); }
.ctx-ic .ic { width: 15px; height: 15px; }
.context-line .repo-chips { justify-content: center; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font: 600 12.5px var(--font); color: var(--ink); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.pill-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.title-input {
  align-self: center; width: min(520px, 100%); height: 42px; padding: 0 14px; margin-top: 2px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
}
.title-input:focus { outline: none; border-color: var(--primary); }

.recent { margin-top: 34px; }
.recent-head { padding: 0 2px; }
.recent-head h2 { font-size: 16px; font-weight: 600; }
.text-link { border: 0; background: none; padding: 0; font: 600 13px var(--font); color: var(--primary-ink); cursor: pointer; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.recent-item { grid-template-columns: minmax(0, 1fr) auto; min-height: 50px; padding: 12px 16px; background: color-mix(in srgb, var(--ink) 4%, var(--bg)); }
.recent-item .dot { display: none; }
.recent-item.live .dot { display: inline-block; margin-right: 8px; vertical-align: middle; }
.recent-item .t { font-weight: 500; }
.recent-item > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .t { display: inline; }
.recent-item.live .m { color: var(--danger); font-weight: 700; }

/* ── Halaman rapat ─────────────────────────────────────────────────── */
.detail { position: relative; max-width: 780px; padding-bottom: 120px; }
.page-actions { position: absolute; top: -8px; right: 0; display: flex; gap: 2px; z-index: 5; }
.detail-head { padding: 20px 0 22px; }
.detail-head .date { font-weight: 600; color: var(--ink-2); }
.detail-head h1 { font-size: clamp(26px, 3.4vw, 34px); padding-right: 120px; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.meta-line .sep { color: var(--line-strong); font-weight: 400; }
.meta-line .ic { width: 14px; height: 14px; vertical-align: -2px; color: var(--muted); }
.meta-line a { color: inherit; text-decoration: none; }
.meta-line a:hover { color: var(--primary-ink); text-decoration: underline; }
/* Status jadi teks dengan titik, bukan pil */
.meta-line .status { height: auto; padding: 0; border: 0; background: none !important; font-size: 13px; }
.meta-line .status.live { color: var(--live); }
.meta-line .status.wait { color: var(--wait); }
.meta-line .status.failed { color: var(--danger); }
.repo-row { margin-top: 14px; }

.notes h1, .notes h2 { font-family: var(--serif); font-weight: 600; font-size: 23px; letter-spacing: -.005em; margin-top: 30px; }
.notes h3 { font-family: var(--serif); font-weight: 600; font-size: 18px; }
.notes { font-size: 16px; max-width: none; }

/* Toolbar melayang (tab + hentikan) */
.dock-bar {
  position: fixed; z-index: 25; bottom: 20px; left: calc(var(--side-w) + (100vw - var(--side-w)) / 2); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgb(0 0 0 / .10);
}
.app.collapsed .dock-bar { left: 50%; }
.dock-tabs { display: flex; gap: 2px; }
.dock-tabs [role="tab"] {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 0; border-radius: 12px; background: none; color: var(--ink-2); font: 600 14px var(--font); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.dock-tabs [role="tab"]:hover { background: var(--surface-2); color: var(--ink); }
.dock-tabs [role="tab"][aria-selected="true"] { background: var(--primary-soft); color: var(--primary-ink); }
.dock-tabs .ic { width: 18px; height: 18px; }
.dock-tabs .badge { line-height: 18px; padding: 0 7px; }
.stop-btn {
  display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: var(--danger); color: #fff; cursor: pointer; box-shadow: 0 4px 14px color-mix(in srgb, var(--danger) 40%, transparent);
  transition: transform .1s, filter .15s;
}
.stop-btn:hover { filter: brightness(1.08); }
.stop-btn:active { transform: scale(.95); }
.stop-btn .ic { width: 18px; height: 18px; fill: currentColor; }
.ai-dock { bottom: 96px; }
.chat-form { bottom: 92px; }

/* ── Popover repo & GitHub ─────────────────────────────────────────── */
.repo-picker, .gh-panel { border-radius: 16px; box-shadow: 0 20px 50px rgb(0 0 0 / .16); }
.gh-panel {
  position: fixed; z-index: 60; width: min(340px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line);
}
.pop-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; font-size: 14px; color: var(--ink); }
.pop-head .ic { width: 17px; height: 17px; }
.repo-search { margin: 0 12px 8px; padding: 0 12px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.repo-search:focus-within { border-color: var(--primary); }
.repo-list { padding: 0 8px 8px; }
.repo-owner { display: flex; align-items: center; gap: 8px; padding: 12px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.repo-owner img { width: 18px; height: 18px; border-radius: 5px; background: var(--surface-2); }
.repo-opt { padding: 9px 10px; border-radius: 10px; }
.repo-opt:has(input:checked) { background: var(--primary-soft); }
.repo-foot { gap: 12px; }
.repo-foot .text-link { margin-left: auto; }
.gh-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; color: var(--ink-2); }
.gh-acc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.gh-acc img { width: 24px; height: 24px; border-radius: 6px; }
.gh-acc b { font-size: 14px; color: var(--ink); }
.gh-actions { display: flex; gap: 8px; }
.gh-actions .btn { flex: 1; min-height: 38px; }
.gh-connect { padding: 8px 18px 22px; }
.gh-connect h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; }

/* ── Halaman riwayat ───────────────────────────────────────────────── */
.hist-page { max-width: 860px; margin: 0 auto; padding-top: 12px; }
.hist-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.page-title { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 3.6vw, 36px); letter-spacing: -.01em; }
.hist-count { font-size: 14px; color: var(--muted); }
.hist-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.hist-search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; color: var(--muted);
}
.hist-search:focus-within { border-color: var(--primary); }
.hist-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.seg-ctl { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.seg-ctl button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: none; font: 600 13px var(--font); color: var(--ink-2); cursor: pointer; }
.seg-ctl button:hover { background: var(--surface-2); }
.seg-ctl button[aria-checked="true"] { background: var(--primary-soft); color: var(--primary-ink); }
.hist-group { padding: 20px 4px 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hist-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 12px 10px 12px 14px; margin-bottom: 6px; border-radius: 12px; text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--ink) 4%, var(--bg)); transition: background-color .15s;
}
.hist-row:hover { background: var(--primary-soft); }
.hist-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.hist-ic .ic { width: 17px; height: 17px; }
.hist-row.live .hist-ic { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.hist-row.failed .hist-ic { color: var(--danger); }
.hist-main { min-width: 0; }
.hist-main b { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-main small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.hist-badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.hist-badge.live { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.hist-badge.failed { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.hist-badge.wait { background: var(--wait-soft); color: var(--wait); border-color: transparent; }
.page-lead { margin: -6px 0 22px; max-width: 64ch; font-size: 15px; color: var(--ink-2); }
.gh-card { padding: 20px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.gh-card h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.gh-card p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }
.gh-steps { margin: 0 0 18px; padding-left: 20px; font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.gh-steps li::marker { color: var(--primary); font-weight: 700; }
.gh-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gh-accounts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.gh-acc { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.gh-acc img { width: 28px; height: 28px; border-radius: 7px; }
.gh-acc b { display: block; font-size: 14px; }
.gh-acc small { display: block; font-size: 12px; color: var(--muted); }
.gh-acc .pill-btn { margin-left: 10px; text-decoration: none; }
#gh-page-badge { margin-left: 0; align-self: center; }
.gh-repos .hist-empty { grid-column: 1 / -1; padding: 16px; }
.gh-note { margin: 14px 0 0 !important; padding: 10px 12px; border-radius: 10px; background: var(--wait-soft); font-size: 13px !important; color: var(--ink-2); }
.gh-note a:not(.btn) { color: var(--primary-ink); font-weight: 600; }
.gh-note .btn-primary { color: #fff; text-decoration: none; }
.gh-repos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.gh-repo { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.gh-repo b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-repo small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.nav-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
@media (max-width: 640px) {
  .hist-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .hist-badge { display: none; }
  .seg-ctl { width: 100%; }
  .seg-ctl button { flex: 1; padding: 0 6px; }
}

/* ── Peserta ──────────────────────────────────────────────────────── */
.people-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; color: var(--muted); }
.people-row > .ic { width: 16px; height: 16px; margin-top: 5px; flex: none; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.person .avatar { width: 22px; height: 22px; font-size: 10px; }
.person.left { opacity: .55; }

/* ── Rekaman ──────────────────────────────────────────────────────── */
.rec { display: flex; flex-direction: column; gap: 10px; }
.rec video { width: 100%; max-height: 62vh; border-radius: 14px; background: #000; box-shadow: var(--shadow-md); }
.rec-msg { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--wait-soft); color: var(--ink-2); font-size: 14px; }
.seg-time { cursor: default; }
#detail:has(#tab-btn-recording:not([hidden])) .seg-time { cursor: pointer; text-decoration: underline dotted; }
#detail:has(#tab-btn-recording:not([hidden])) .seg-time:hover { color: var(--primary-ink); }

/* ── Pengaturan & Kalender ────────────────────────────────────────── */
.set-form { display: flex; flex-direction: column; gap: 0; }
.set-form .field { margin-bottom: 12px; }
.set-form .field input:not([type="radio"]):not([type="checkbox"]) { width: 100%; }
.set-opt { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.set-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.set-opt input { margin: 3px 0 0; accent-color: var(--primary); width: 16px; height: 16px; }
.set-opt b { display: block; font-size: 14px; color: var(--ink); }
.set-opt small { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.set-opt a, .gh-card p a, .gh-steps a { color: var(--primary-ink); font-weight: 600; }
.set-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.copy-row input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); font: 13px ui-monospace, Consolas, monospace; }
.gh-steps code { font-size: 12.5px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); }
.switch-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; padding: 12px; margin: 4px 0 14px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.switch-row input { margin: 3px 0 0; accent-color: var(--primary); width: 16px; height: 16px; }
.switch-row b { display: block; font-size: 14px; }
.switch-row small { display: block; font-size: 13px; color: var(--muted); }
.cal-row { grid-template-columns: 36px minmax(0, 1fr) auto auto; background: var(--surface-2); }
.mini-switch { position: relative; display: inline-block; width: 40px; height: 24px; flex: none; cursor: pointer; }
.mini-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mini-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background-color .15s; pointer-events: none; }
.mini-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease); }
.mini-switch input:checked + span { background: var(--primary); }
.mini-switch input:checked + span::after { transform: translateX(16px); }
.mini-switch input:disabled + span { opacity: .5; }
.mini-switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Responsif v2 ─────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .app, .app.collapsed { --side-w: 0px; grid-template-columns: minmax(0, 1fr); }
  #collapse-btn { display: none; }
  /* Di HP sidebar selalu versi lengkap (laci geser), abaikan mode rel. */
  .app.collapsed .sidebar { padding: 14px 12px 10px; align-items: stretch; }
  .app.collapsed .side-top { flex-direction: row; padding: 2px 4px 14px 6px; }
  .app.collapsed .side-top .brand strong, .app.collapsed .history, .app.collapsed .side-who, .app.collapsed .side-nav .nav-badge { display: revert; }
  .app.collapsed .side-search { display: flex; }
  .app.collapsed .history { display: flex; }
  .app.collapsed .side-who { display: block; }
  .app.collapsed .nav-item { width: 100%; padding: 0 12px; justify-content: flex-start; font-size: 15px; gap: 12px; }
  .app.collapsed .side-foot { flex-direction: row; }
  .dock-bar, .app.collapsed .dock-bar { left: 50%; bottom: 12px; }
  .dock-tabs [role="tab"] span:not(.badge) { display: none; }
  .detail-head h1 { padding-right: 0; }
  .page-actions { position: static; justify-content: flex-end; margin-bottom: -8px; }
  .context-line .ctx-text { flex-basis: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- rapat offline (mikrofon) ---------- */
.mic-form { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mic-form .btn { gap: 8px; }
.mic-form .btn .ic { width: 16px; height: 16px; }
.mic-form small { max-width: 520px; text-align: center; font-size: 12.5px; line-height: 1.5; }

.mic-panel {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
  font-size: 13px; color: var(--ink-2);
}
.mic-panel[hidden] { display: none; }
.mic-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--muted); }
.mic-panel.on .mic-dot { background: var(--danger); animation: mic-pulse 1.4s ease-in-out infinite; }
.mic-panel.on.offline .mic-dot { background: var(--wait); animation: none; }
.mic-meter { width: 72px; height: 6px; flex: none; overflow: hidden; border-radius: 999px; background: var(--line); }
.mic-meter span { display: block; height: 100%; background: var(--live); transform: scaleX(0); transform-origin: left; transition: transform .08s linear; }
.mic-panel:not(.on) .mic-meter { display: none; }
.mic-panel.offline { border-color: color-mix(in srgb, var(--wait) 45%, var(--line)); background: var(--wait-soft); }
.mic-text { flex: 1 1 220px; min-width: 0; }
.mic-panel .pill-btn .ic { width: 14px; height: 14px; }
@keyframes mic-pulse { 50% { opacity: .35; } }

.rec-parts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.rec-parts[hidden] { display: none; }
.rec-parts .pill-btn[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.mic-form[hidden] { display: none; }
.mic-panel.warn { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--danger-soft); color: var(--ink); }
.mic-panel.warn .mic-dot { background: var(--danger); animation: none; }
.mic-tips { width: min(520px, 100%); font-size: 12.5px; color: var(--ink-2); }
.mic-tips summary { cursor: pointer; text-align: center; font-weight: 600; color: var(--primary-ink); }
.mic-tips ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.55; }
.mic-tips li + li { margin-top: 4px; }
