:root {
  --bg: #1a1218;
  --bg-2: #22171f;
  --panel: #2c1f27;
  --panel-2: #36262f;
  --line: #0f0a0e;
  --edge: #4a3540;
  --text: #f3e3c3;
  --text-2: #c9b49a;
  --muted: #8f7a72;
  --accent: #ff5fa2;
  --accent-d: #c2407a;
  --teal: #5ff2e0;
  --lamp: #ffd27a;
  --ok: #7bd389;
  --warn: #f0c24b;
  --bad: #ff7a7a;
  --wood: #8a5a3b;
  --pixel: 'Pixelify Sans', 'Courier New', monospace;
  --read: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--read); font-size: 15px; }
body {
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(255, 210, 122, .08), transparent 50%),
    radial-gradient(ellipse at 90% 0%, rgba(255, 95, 162, .06), transparent 45%);
  min-height: 100vh;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--pixel); font-weight: 700; letter-spacing: .02em; margin: 0; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.error { color: var(--bad); min-height: 1.2em; margin: 6px 0 0; font-size: 14px; }
a { color: var(--teal); }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- tombol & input bergaya pixel ---------- */
.btn {
  font-family: var(--pixel); font-size: 15px; font-weight: 500; letter-spacing: .03em;
  color: var(--text); background: var(--panel-2); border: 2px solid var(--line);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.08);
  padding: 7px 14px 9px; cursor: pointer; border-radius: 0; transition: transform .05s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: #423039; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.35); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: #2a0f1d; }
.btn-primary:hover { background: #ff7ab3; }
.btn-ghost { background: transparent; border-color: var(--edge); box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-danger { background: transparent; border-color: #6a2c35; color: var(--bad); box-shadow: none; }
.btn-danger:hover { background: rgba(255,122,122,.1); }
.btn-sm { font-size: 13px; padding: 4px 10px 5px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tab:focus-visible, .seat:focus-visible {
  outline: 2px solid var(--lamp); outline-offset: 2px;
}

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 2px solid var(--line);
  box-shadow: inset 0 2px 0 rgba(0,0,0,.3); padding: 8px 10px; border-radius: 0; width: 100%;
}
textarea { resize: vertical; line-height: 1.5; }
select { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-family: var(--pixel); font-size: 14px; color: var(--text-2); }
.input-row { display: flex; gap: 6px; }
.input-row input { flex: 1; }
details summary { cursor: pointer; font-family: var(--pixel); color: var(--text-2); margin: 4px 0 10px; }

.card {
  background: var(--panel); border: 2px solid var(--line);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.05), 0 4px 0 rgba(0,0,0,.35);
  padding: 18px;
}

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--panel); border: 2px solid var(--line); padding: 28px; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.4); }
.login-card canvas { width: 192px; height: 128px; margin-bottom: 8px; }
.login-card h1 { font-size: 34px; color: var(--accent); text-shadow: 0 0 12px rgba(255,95,162,.45); }
.login-card .field { text-align: left; margin-top: 18px; }
.login-card .btn { width: 100%; justify-content: center; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 10px 20px;
  background: #140d12; border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 22px; font-weight: 700; color: var(--accent); text-shadow: 0 0 10px rgba(255,95,162,.5); }
.brand-cup { width: 20px; height: 18px; background:
  linear-gradient(var(--text), var(--text)) 2px 6px / 12px 10px no-repeat,
  linear-gradient(var(--text), var(--text)) 14px 8px / 4px 5px no-repeat,
  linear-gradient(#5a3a22, #5a3a22) 4px 7px / 8px 3px no-repeat,
  linear-gradient(var(--accent), var(--accent)) 6px 0 / 2px 4px no-repeat,
  linear-gradient(var(--accent), var(--accent)) 10px 1px / 2px 3px no-repeat; }
.tabs { display: flex; gap: 4px; }
.tab {
  font-family: var(--pixel); font-size: 16px; background: none; border: 2px solid transparent; color: var(--text-2);
  padding: 6px 12px; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--lamp); border-color: var(--line); background: var(--panel); box-shadow: inset 0 -3px 0 var(--lamp); }
.topstats { margin-left: auto; font-family: var(--pixel); font-size: 14px; color: var(--muted); display: flex; gap: 14px; }
.topstats b { color: var(--text); font-weight: 500; }

main { padding: 20px; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }

/* ---------- kedai ---------- */
.kedai { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
.scene-wrap { position: relative; border: 2px solid var(--line); box-shadow: 0 6px 0 rgba(0,0,0,.4); background: #000; line-height: 0; }
#scene { width: 100%; height: auto; aspect-ratio: 384 / 216; display: block; }
.seat-layer { position: absolute; inset: 0; }
.seat { position: absolute; background: none; border: 0; padding: 0; cursor: pointer; }
.seat-name {
  position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%);
  font-family: var(--pixel); font-size: clamp(10px, 1vw, 13px); line-height: 1.2; white-space: nowrap;
  background: rgba(15,10,14,.85); color: var(--text); padding: 1px 6px; border: 1px solid var(--line);
  pointer-events: none;
}
.seat.empty .seat-name { color: var(--muted); }
.seat.selected .seat-name { background: var(--lamp); color: #2a1a10; }
.seat-badge { position: absolute; top: -4px; right: 2px; background: var(--accent); color: #2a0f1d; font: 700 11px var(--pixel); padding: 0 4px; line-height: 1.4; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 2px; font-size: 13px; color: var(--muted); font-family: var(--pixel); }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border: 1px solid var(--line); vertical-align: 0; }
.dot-working { background: var(--teal); } .dot-queued { background: var(--warn); } .dot-done { background: var(--ok); }
.dot-error { background: var(--bad); } .dot-idle { background: var(--muted); } .dot-nokey { background: #555; }

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.roster-item {
  display: flex; gap: 10px; align-items: center; text-align: left; background: var(--panel); border: 2px solid var(--line);
  padding: 8px; cursor: pointer; color: var(--text); font: inherit;
}
.roster-item:hover { background: var(--panel-2); }
.roster-item.selected { border-color: var(--lamp); }
.roster-item canvas { width: 40px; height: 48px; flex: none; }
.roster-item .r-name { font-family: var(--pixel); font-size: 16px; }
.roster-item .r-sub { font-size: 12px; color: var(--muted); }
.state { font: 500 12px var(--pixel); display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }

/* ---------- meja kerja (panel kanan) ---------- */
.desk {
  background: var(--panel); border: 2px solid var(--line); box-shadow: 0 6px 0 rgba(0,0,0,.4);
  position: sticky; top: 76px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; overflow: hidden;
}
.desk-head { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--panel-2); border-bottom: 2px solid var(--line); }
.desk-head canvas { width: 50px; height: 60px; border: 2px solid var(--line); flex: none; }
.desk-head h3 { font-size: 22px; }
.desk-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.desk-head .actions { margin-left: auto; display: flex; gap: 6px; }
.desk-body { padding: 16px; overflow-y: auto; flex: 1; }
.desk-empty { padding: 28px 22px; }
.desk-empty h3 { font-size: 22px; color: var(--lamp); margin-bottom: 8px; }
.desk-empty ol { padding-left: 20px; line-height: 1.7; color: var(--text-2); }
.desk-empty .btn { margin-top: 8px; }

.composer { border: 2px solid var(--line); background: var(--bg-2); }
.composer textarea { border: 0; box-shadow: none; background: transparent; min-height: 96px; max-height: 300px; }
.composer.dragging { border-color: var(--teal); background: #1d2a2a; }
.composer-bar { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 2px solid var(--line); background: rgba(0,0,0,.15); flex-wrap: wrap; }
.composer-bar .spacer { flex: 1; }
.composer-bar .kbd { font-size: 12px; color: var(--muted); font-family: var(--pixel); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px; }
.chips:not(:empty) { padding: 8px 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--edge); padding: 2px 4px 2px 8px; max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.chip button:hover { color: var(--bad); }
.chip.reply { border-color: var(--lamp); color: var(--lamp); }

.result { margin-top: 18px; }
.result-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.result-head h4 { font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-meta { font-size: 12px; color: var(--muted); font-family: var(--pixel); margin: 6px 0 0; }
.prompt-echo { font-size: 13px; color: var(--text-2); background: rgba(0,0,0,.18); border-left: 3px solid var(--edge); padding: 8px 10px; margin-bottom: 10px; white-space: pre-wrap; max-height: 120px; overflow: auto; }
.result-files { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.result-files a { font-size: 12px; text-decoration: none; }
.result-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.err-box { border: 2px solid #6a2c35; background: rgba(255,122,122,.07); color: var(--bad); padding: 10px 12px; font-size: 14px; margin-top: 10px; white-space: pre-wrap; }

.pill { font: 500 12px var(--pixel); padding: 1px 8px; border: 1px solid var(--line); white-space: nowrap; }
.pill-running, .pill-working { background: var(--teal); color: #072623; }
.pill-web { background: #7fb2ff; color: #0b1a33; }
.pill-arsip { background: #e8a27a; color: #2a1408; }
.pill-queued { background: var(--warn); color: #2a2005; }
.pill-done { background: var(--ok); color: #0b2a12; }
.pill-error { background: var(--bad); color: #2a0b0b; }
.pill-cancelled, .pill-idle, .pill-nokey { background: var(--panel-2); color: var(--text-2); }

/* jawaban AI: font yang enak dibaca */
.md { font-family: var(--read); font-size: 15px; line-height: 1.65; color: #f5ead6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h2, .md h3, .md h4, .md h5, .md h6 { font-family: var(--read); font-weight: 600; letter-spacing: 0; margin: 1.2em 0 .4em; color: var(--lamp); }
.md h2 { font-size: 20px; } .md h3 { font-size: 17px; } .md h4, .md h5, .md h6 { font-size: 15px; }
.md p { margin: .6em 0; }
.md ul, .md ol { padding-left: 1.4em; margin: .5em 0; }
.md li { margin: .2em 0; }
.md code { font-family: var(--mono); font-size: .88em; background: rgba(0,0,0,.3); padding: 1px 5px; }
.md .code { border: 2px solid var(--line); margin: .8em 0; background: #120c10; }
.md .code-head { display: flex; justify-content: space-between; align-items: center; padding: 3px 8px; font: 12px var(--pixel); color: var(--muted); border-bottom: 1px solid var(--line); }
.md .code-copy { background: none; border: 0; color: var(--text-2); cursor: pointer; font: 12px var(--pixel); }
.md pre { margin: 0; padding: 10px 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; font-size: 13px; line-height: 1.55; }
.md blockquote { border-left: 3px solid var(--accent); margin: .8em 0; padding: 2px 12px; color: var(--text-2); }
.md hr { border: 0; border-top: 2px dashed var(--edge); margin: 1.2em 0; }
.md .table-wrap { overflow-x: auto; margin: .8em 0; }
.md table { border-collapse: collapse; font-size: 14px; min-width: 50%; }
.md th, .md td { border: 1px solid var(--edge); padding: 5px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--panel-2); font-weight: 600; }
.md.streaming::after { content: ''; display: inline-block; width: 8px; height: 15px; background: var(--teal); margin-left: 3px; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.thinking { font-family: var(--pixel); color: var(--muted); font-size: 14px; }

.recent { margin-top: 22px; border-top: 2px dashed var(--edge); padding-top: 14px; }
.recent h4 { font-size: 15px; color: var(--text-2); margin-bottom: 8px; }
.recent-item { display: flex; gap: 8px; align-items: center; width: 100%; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text); padding: 7px 4px; cursor: pointer; text-align: left; font: inherit; font-size: 14px; }
.recent-item:hover { background: rgba(255,255,255,.04); }
.recent-item.active { background: rgba(255,210,122,.08); }
.recent-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .when { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- karyawan ---------- */
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.emp-card { display: flex; flex-direction: column; gap: 12px; }
.emp-card .top { display: flex; gap: 14px; align-items: center; }
.emp-card canvas { width: 70px; height: 84px; border: 2px solid var(--line); flex: none; }
.emp-card h3 { font-size: 21px; }
.emp-card .role { color: var(--text-2); font-size: 14px; }
.emp-card .meta { font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.emp-card .meta b { color: var(--text-2); font-weight: 500; }
.emp-card .row { display: flex; gap: 6px; margin-top: auto; }
.emp-card.add { align-items: center; justify-content: center; border-style: dashed; border-color: var(--edge); cursor: pointer; min-height: 200px; color: var(--muted); font-family: var(--pixel); font-size: 17px; background: transparent; box-shadow: none; }
.emp-card.add:hover { color: var(--lamp); border-color: var(--lamp); }

/* ---------- kunci API ---------- */
.keys-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.key-form h3 { margin-bottom: 14px; }
.key-form .btn-primary { width: 100%; justify-content: center; }
.key-list { display: grid; gap: 12px; }
.key-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.key-icon { width: 44px; height: 44px; display: grid; place-items: center; font: 700 15px var(--pixel); color: #1a1218; border: 2px solid var(--line); }
.key-card h3 { font-size: 18px; }
.key-card .sub { font-size: 13px; color: var(--muted); margin-top: 3px; font-family: var(--mono); overflow-wrap: anywhere; }
.key-card .used { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.key-card .test { font-size: 13px; margin-top: 4px; }
.key-card .test.ok { color: var(--ok); } .key-card .test.bad { color: var(--bad); }
.key-card .row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty-note { border: 2px dashed var(--edge); padding: 28px; text-align: center; color: var(--muted); font-family: var(--pixel); }

/* ---------- riwayat ---------- */
.filters { display: flex; gap: 8px; }
.filters input { width: 260px; } .filters select { width: 180px; }
.table-card { padding: 0; overflow-x: auto; }
.htable { width: 100%; border-collapse: collapse; font-size: 14px; }
.htable th { text-align: left; font: 500 13px var(--pixel); color: var(--text-2); padding: 10px 12px; border-bottom: 2px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.htable td { padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
.htable tbody tr { cursor: pointer; }
.htable tbody tr:hover { background: rgba(255,255,255,.03); }
.htable .t { max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htable .num { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.unseen-dot { display: inline-block; width: 7px; height: 7px; background: var(--accent); margin-right: 6px; }

/* ---------- modal ---------- */
dialog { padding: 0; border: 2px solid var(--line); background: var(--panel); color: var(--text); box-shadow: 0 8px 0 rgba(0,0,0,.5); width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(10,6,9,.75); }
.modal-inner { padding: 22px; }
.modal-inner > h3 { font-size: 22px; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--edge); }
.emp-form { display: grid; grid-template-columns: 1fr 260px; gap: 22px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.templates { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.av-editor { background: var(--bg-2); border: 2px solid var(--line); padding: 14px; }
.av-editor canvas { width: 140px; height: 168px; display: block; margin: 0 auto 12px; border: 2px solid var(--line); }
.av-group { margin-bottom: 10px; }
.av-group > span { display: block; font: 13px var(--pixel); color: var(--text-2); margin-bottom: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.swatch { width: 22px; height: 22px; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--lamp); outline-offset: 1px; }
.opt { font: 12px var(--pixel); background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); padding: 2px 7px; cursor: pointer; }
.opt[aria-pressed="true"] { background: var(--lamp); color: #2a1a10; }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--panel-2); border: 2px solid var(--line); border-left: 6px solid var(--teal); padding: 10px 14px; font-size: 14px; max-width: 340px; box-shadow: 0 4px 0 rgba(0,0,0,.4); cursor: pointer; animation: pop .2s steps(3); }
.toast.bad { border-left-color: var(--bad); } .toast.ok { border-left-color: var(--ok); }
.toast b { font-family: var(--pixel); font-weight: 500; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- v0.2: aktivitas, sumber ---------- */
.activity { margin: 10px 0; border: 2px solid var(--line); background: rgba(0,0,0,.18); }
.activity summary { padding: 6px 10px; font: 13px var(--pixel); color: var(--text-2); margin: 0; }
.activity ol { list-style: none; margin: 0; padding: 4px 10px 8px; font-size: 13px; max-height: 180px; overflow: auto; }
.activity li { display: flex; gap: 8px; padding: 2px 0; color: var(--text-2); }
.activity li .ic { width: 18px; flex: none; text-align: center; }
.activity li.warn { color: var(--warn); }
.activity li.info { color: var(--muted); }
.sources { margin-top: 14px; border-top: 2px dashed var(--edge); padding-top: 10px; }
.sources h5 { font: 500 13px var(--pixel); color: var(--text-2); margin: 0 0 6px; }
.sources ol { margin: 0 0 8px; padding-left: 22px; font-size: 13px; line-height: 1.55; }
.sources li { overflow-wrap: anywhere; }
.sources a { text-decoration: none; }
.sources a:hover { text-decoration: underline; }
.sources .dom { color: var(--muted); font-size: 12px; margin-left: 4px; }
.sources .skim { color: var(--muted); font-size: 11px; font-family: var(--pixel); margin-left: 4px; }
.inet-badge { font: 11px var(--pixel); color: var(--teal); border: 1px solid #2d5b57; padding: 0 5px; white-space: nowrap; }

/* ---------- arsip ---------- */
.arsip-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.rack-col h3 { margin-bottom: 10px; }
.rack-list { display: grid; gap: 6px; }
.rack-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--bg-2); border: 2px solid var(--line); color: var(--text); padding: 8px 10px; cursor: pointer; font: inherit; }
.rack-item:hover { background: var(--panel-2); }
.rack-item.active { border-color: var(--lamp); }
.rack-item .spine { width: 8px; height: 26px; border: 1px solid var(--line); flex: none; }
.rack-item .nm { flex: 1; font-family: var(--pixel); font-size: 15px; }
.rack-item .ct { font-size: 12px; color: var(--muted); }
.rack-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.rack-head h3 { flex: 1; font-size: 22px; }
.dropzone { border: 2px dashed var(--edge); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; font-family: var(--pixel); margin-bottom: 14px; }
.dropzone:hover, .dropzone.dragging { border-color: var(--teal); color: var(--teal); background: rgba(95,242,224,.04); }
.doc-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 14px; }
.doc-row .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row .meta { font-size: 12px; color: var(--muted); }
.doc-row .row { display: flex; gap: 6px; }
.asearch-res { margin-top: 12px; display: grid; gap: 8px; }
.hit { border-left: 3px solid var(--edge); padding: 6px 10px; background: rgba(0,0,0,.15); font-size: 13px; }
.hit b { font-family: var(--pixel); font-weight: 500; color: var(--lamp); }
.hit p { margin: 4px 0 0; color: var(--text-2); white-space: pre-wrap; }
.hit a { font-size: 12px; overflow-wrap: anywhere; }

/* ---------- pengaturan ---------- */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-layout h3 { margin-bottom: 10px; }
.engine-list { display: grid; gap: 8px; }
.engine { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); background: var(--bg-2); padding: 10px 12px; cursor: pointer; }
.engine:has(input:checked) { border-color: var(--lamp); }
.engine input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.engine b { font-family: var(--pixel); font-weight: 500; font-size: 15px; }
.engine span { display: block; font-size: 13px; color: var(--muted); }
.check-row { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check-row input { width: auto; accent-color: var(--accent); }
.mode-help { padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.rack-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* ---------- v0.3: kerja tim ---------- */
.tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; background: var(--accent); color: #2a0f1d; font: 700 12px var(--pixel); line-height: 18px; text-align: center; animation: blink 1.2s steps(2) infinite; }
.tim-layout { display: grid; grid-template-columns: 470px minmax(0, 1fr); gap: 20px; align-items: start; }
.tim-left { display: grid; gap: 16px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--line); background: var(--bg-2); }
.seg button { font: 500 14px var(--pixel); color: var(--text-2); background: none; border: 0; border-right: 2px solid var(--line); padding: 9px 6px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--lamp); color: #2a1a10; }
.tim-form h3 { margin-bottom: 10px; }
.step-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: start; padding: 10px; border: 2px solid var(--line); background: var(--bg-2); margin-bottom: 8px; position: relative; }
.step-row::after { content: '↓'; position: absolute; left: 18px; bottom: -14px; color: var(--muted); font-size: 12px; z-index: 1; }
.step-row:last-of-type::after { display: none; }
.step-num { width: 28px; height: 28px; display: grid; place-items: center; background: var(--lamp); color: #2a1a10; font: 700 14px var(--pixel); border: 2px solid var(--line); }
.step-num.rev { background: #e8a27a; }
.step-body { display: grid; gap: 6px; min-width: 0; }
.step-body textarea { min-height: 54px; font-size: 14px; }
.step-ctl { display: flex; flex-direction: column; gap: 4px; }
.step-ctl button { background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); cursor: pointer; width: 26px; height: 24px; font-size: 12px; }
.step-ctl button:hover { color: var(--text); }
.tim-sub { border-top: 2px dashed var(--edge); margin-top: 14px; padding-top: 14px; }
.part-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.part-row canvas { width: 26px; height: 31px; border: 1px solid var(--line); }
.part-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.part-row input[type=checkbox] { width: auto; accent-color: var(--accent); }
.part-row input.stance { grid-column: 2; font-size: 13px; padding: 5px 8px; }
.run-list { display: grid; gap: 4px; max-height: 360px; overflow: auto; }
.run-item { display: flex; gap: 8px; align-items: center; width: 100%; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text); padding: 7px 4px; cursor: pointer; text-align: left; font: inherit; font-size: 14px; }
.run-item:hover { background: rgba(255,255,255,.04); }
.run-item.active { background: rgba(255,210,122,.08); }
.run-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-item .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pill-planning { background: var(--teal); color: #072623; }
.pill-awaiting_approval { background: var(--accent); color: #2a0f1d; }
.pill-teamwait { background: var(--panel-2); color: var(--lamp); }
.run-view { min-height: 420px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.run-empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.run-empty h3 { color: var(--lamp); font-size: 22px; margin-bottom: 8px; }
.run-head { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.run-head h3 { flex: 1; min-width: 200px; font-size: 21px; }
.kind-badge { font: 500 12px var(--pixel); border: 1px solid var(--edge); padding: 2px 7px; color: var(--text-2); white-space: nowrap; }
.run-meta { font: 13px var(--pixel); color: var(--muted); margin-bottom: 12px; }
.run-prompt { font-size: 14px; color: var(--text-2); background: rgba(0,0,0,.18); border-left: 3px solid var(--lamp); padding: 8px 10px; white-space: pre-wrap; margin-bottom: 14px; max-height: 140px; overflow: auto; }
.final-card { border: 2px solid var(--ok); background: rgba(123,211,137,.05); padding: 14px 16px; margin-bottom: 16px; }
.final-card > h4 { font-size: 16px; color: var(--ok); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.plan-card { border: 2px solid var(--accent); background: rgba(255,95,162,.05); padding: 14px; margin-bottom: 16px; }
.plan-card h4 { font-size: 17px; color: var(--accent); margin-bottom: 4px; }
.plan-row { display: grid; grid-template-columns: 28px 170px 1fr 70px 28px; gap: 6px; align-items: start; margin-top: 8px; }
.plan-row textarea { min-height: 50px; font-size: 13px; }
.plan-row input, .plan-row select { font-size: 13px; padding: 6px; }
.plan-row .x { background: none; border: 1px solid var(--line); color: var(--bad); cursor: pointer; height: 30px; }
.plan-head { display: grid; grid-template-columns: 28px 170px 1fr 70px 28px; gap: 6px; font: 12px var(--pixel); color: var(--muted); margin-top: 10px; }
.tl-info { text-align: center; font: 13px var(--pixel); color: var(--muted); margin: 10px 0; }
.tl-info span { background: var(--bg-2); border: 1px solid var(--edge); padding: 3px 10px; display: inline-block; }
.step-card { border: 2px solid var(--line); background: var(--bg-2); margin-bottom: 10px; }
.step-card > summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; margin: 0; }
.step-card > summary::-webkit-details-marker { display: none; }
.step-card > summary canvas { width: 28px; height: 34px; border: 1px solid var(--line); flex: none; }
.step-card .who { flex: 1; min-width: 0; }
.step-card .who b { font: 500 15px var(--pixel); display: block; }
.step-card .who span { font-size: 12px; color: var(--muted); }
.step-card .tok { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.step-card .step-out { padding: 4px 14px 12px; border-top: 1px solid var(--line); }
.chat { display: grid; gap: 10px; }
.bubble-row { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: start; }
.bubble-row canvas { width: 34px; height: 41px; border: 1px solid var(--line); }
.bubble { background: var(--bg-2); border: 2px solid var(--line); padding: 8px 12px; }
.bubble .nm { font: 500 13px var(--pixel); color: var(--lamp); margin-bottom: 2px; }
.bubble .nm span { color: var(--muted); font-weight: 400; margin-left: 6px; }
.bubble .md { font-size: 14px; }
.bubble-row.bos { grid-template-columns: 1fr; justify-items: end; }
.bubble-row.bos .bubble { border-color: var(--accent); background: rgba(255,95,162,.08); max-width: 85%; }
.interject { display: flex; gap: 8px; margin-top: 14px; position: sticky; bottom: 0; background: var(--panel); padding-top: 8px; }
.interject input { flex: 1; }

/* ---------- responsif ---------- */
@media (max-width: 1100px) {
  .kedai { grid-template-columns: 1fr; }
  .desk { position: static; max-height: none; }
  .keys-layout, .arsip-layout, .settings-layout, .tim-layout { grid-template-columns: 1fr; }
  .run-view { position: static; max-height: none; }
  .plan-row, .plan-head { grid-template-columns: 24px 1fr 60px 26px; }
  .plan-row select { grid-column: 2 / 5; }
  .plan-head { display: none; }
}
@media (max-width: 720px) {
  main { padding: 16px; }
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tab { font-size: 15px; padding: 5px 9px; white-space: nowrap; }
  .roster { grid-template-columns: 1fr 1fr; gap: 8px; }
  .roster-item { padding: 6px; gap: 8px; }
  .roster-item canvas { width: 30px; height: 36px; }
  .roster-item .r-name { font-size: 14px; }
  .legend { font-size: 11px; gap: 4px 10px; }
  .composer-bar .kbd { display: none; }
  .desk-head { padding: 12px; gap: 10px; }
  .desk-head canvas { width: 40px; height: 48px; }
  .desk-head .actions { flex-direction: column; }
  .topstats { display: none; }
  #logout { margin-left: auto; }
  .seat-name { font-size: 9px; padding: 0 3px; }
  .emp-form { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .filters { width: 100%; flex-direction: column; } .filters input, .filters select { width: 100%; }
  .key-card { grid-template-columns: auto 1fr; } .key-card .row { grid-column: 1 / -1; justify-content: flex-start; }
  .htable th:nth-child(5), .htable td:nth-child(5), .htable th:nth-child(1), .htable td:nth-child(1) { display: none; }
  .modal-inner { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
.dot-teamwait { background: var(--lamp); }
.tim-left, .tim-left > *, .run-list, .tim-form { min-width: 0; }
.tim-left > .card { overflow: hidden; }
.run-item, .roster-item, .recent-item { min-width: 0; }
@media (max-width: 1100px) { .run-view { min-height: 0; } .run-empty { padding: 24px 16px; } }
@media (max-width: 720px) {
  .plan-row { grid-template-columns: 28px 1fr 64px 28px; }
  .plan-row select { grid-column: 2 / 5; }
  .plan-row textarea { grid-column: 1 / 3; }
}

/* ---------- v0.4: lonceng, biaya, rutin ---------- */
.bell-wrap { position: relative; }
.bell { position: relative; width: 36px; height: 32px; background: transparent; border: 2px solid var(--edge); cursor: pointer; display: grid; place-items: center; }
.bell:hover { background: rgba(255,255,255,.05); }
.bell-ic { width: 14px; height: 15px; background:
  linear-gradient(var(--lamp), var(--lamp)) 5px 0 / 4px 2px no-repeat,
  linear-gradient(var(--lamp), var(--lamp)) 3px 2px / 8px 2px no-repeat,
  linear-gradient(var(--lamp), var(--lamp)) 2px 4px / 10px 6px no-repeat,
  linear-gradient(var(--lamp), var(--lamp)) 0 10px / 14px 2px no-repeat,
  linear-gradient(var(--lamp), var(--lamp)) 5px 13px / 4px 2px no-repeat; }
.bell-badge { position: absolute; top: -7px; right: -7px; min-width: 17px; padding: 0 4px; background: var(--accent); color: #2a0f1d; font: 700 11px var(--pixel); line-height: 16px; text-align: center; border: 1px solid var(--line); }
.bell-panel { position: absolute; right: 0; top: 42px; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; padding: 0; z-index: 50; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 2px solid var(--line); background: var(--panel-2); position: sticky; top: 0; }
.bell-head b { font: 500 15px var(--pixel); }
.notif { display: grid; grid-template-columns: 22px 1fr; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text); padding: 9px 14px; cursor: pointer; font: inherit; font-size: 13px; }
.notif:hover { background: rgba(255,255,255,.04); }
.notif.unread { background: rgba(255,210,122,.06); }
.notif .ttl { font-weight: 500; }
.notif .bd { color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.notif .when { color: var(--muted); font-size: 11px; font-family: var(--pixel); margin-top: 2px; }
.pill-held { background: var(--warn); color: #2a2005; }
.hold-box { border: 2px solid var(--warn); background: rgba(240,194,75,.07); padding: 10px 12px; margin: 10px 0; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hold-box span { flex: 1; min-width: 180px; }
.money-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 2px solid var(--line); padding: 12px 14px; }
.tile .lb { font: 13px var(--pixel); color: var(--muted); }
.tile .vl { font: 700 24px var(--pixel); color: var(--text); margin-top: 2px; }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.meter { height: 8px; background: var(--bg-2); border: 1px solid var(--line); margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--ok); }
.meter i.warn { background: var(--warn); } .meter i.bad { background: var(--bad); }
.price-head, .price-row { display: grid; grid-template-columns: 1fr 100px 100px 28px; gap: 6px; align-items: center; }
.price-head { font: 12px var(--pixel); color: var(--muted); margin: 8px 0 4px; }
.price-row { margin-bottom: 6px; }
.price-row input { padding: 6px 8px; font-size: 13px; }
.price-row .x { background: none; border: 1px solid var(--line); color: var(--bad); cursor: pointer; height: 30px; }
.price-row.missing input:first-child { border-color: var(--warn); }
.backup-list { margin-top: 12px; font-size: 13px; display: grid; gap: 4px; }
.backup-list div { display: flex; justify-content: space-between; color: var(--text-2); border-bottom: 1px solid rgba(255,255,255,.05); padding: 4px 0; }
.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.rt-card { display: flex; flex-direction: column; gap: 10px; }
.rt-card.off { opacity: .6; }
.rt-card .top { display: flex; gap: 10px; align-items: flex-start; }
.rt-card h3 { font-size: 19px; flex: 1; }
.rt-card .prompt { font-size: 13px; color: var(--text-2); background: rgba(0,0,0,.18); padding: 8px 10px; border-left: 3px solid var(--edge); white-space: pre-wrap; max-height: 90px; overflow: hidden; }
.rt-card .meta { font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.rt-card .meta b { color: var(--text-2); font-weight: 500; }
.rt-card .row { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 6px; font: 13px var(--pixel); color: var(--text-2); cursor: pointer; }
.switch input { width: auto; accent-color: var(--ok); }
.var-chip { font: 12px var(--mono); background: var(--panel-2); border: 1px solid var(--edge); color: var(--teal); padding: 1px 6px; cursor: pointer; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { font: 12px var(--pixel); border: 1px solid var(--line); background: var(--bg-2); padding: 3px 7px; cursor: pointer; }
.days input { display: none; }
.days label:has(input:checked) { background: var(--lamp); color: #2a1a10; }
@media (max-width: 720px) {
  .money-tiles { grid-template-columns: 1fr 1fr; }
  .price-head, .price-row { grid-template-columns: 1fr 70px 70px 26px; }
  .bell-panel { position: fixed; right: 16px; top: 64px; }
}
.brand, .tab { white-space: nowrap; }
.topbar { gap: 14px; }
.tab { padding: 6px 9px; font-size: 15px; }
.topstats { gap: 12px; font-size: 13px; white-space: nowrap; }
@media (max-width: 1500px) { .topstats .opt-stat { display: none; } }
@media (max-width: 1250px) { .topstats { display: none; } }
.dlc-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.dlc-row:last-child { border-bottom: 0; }
.dlc-row b { font-family: var(--pixel); font-weight: 500; font-size: 16px; }

/* ---------- v0.5: Sang Mentor, ingatan, riwayat versi ---------- */
.mentor-pill { display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--pixel); color: var(--muted); background: var(--bg-2);
  border: 2px solid var(--line); padding: 4px 9px 5px; cursor: pointer; white-space: nowrap; }
.mentor-pill b { font-weight: 700; color: var(--muted); }
.mentor-pill:hover { color: var(--text); }
.mentor-pill .mp-cap { width: 14px; height: 10px; background:
  linear-gradient(#3b3548, #3b3548) 0 2px / 14px 2px no-repeat, linear-gradient(#3b3548, #3b3548) 3px 4px / 8px 4px no-repeat,
  linear-gradient(var(--muted), var(--muted)) 12px 3px / 1px 5px no-repeat; }
.mentor-pill.on { border-color: #6b5418; color: var(--text-2); }
.mentor-pill.on b { color: var(--ok); }
.mentor-pill.on .mp-cap { background:
  linear-gradient(#e8c766, #e8c766) 0 2px / 14px 2px no-repeat, linear-gradient(#c9a227, #c9a227) 3px 4px / 8px 4px no-repeat,
  linear-gradient(var(--lamp), var(--lamp)) 12px 3px / 1px 5px no-repeat; }
.mentor-pill.busy { border-color: var(--teal); box-shadow: 0 0 10px rgba(95,242,224,.25); }
.mentor-pill.busy b { color: var(--teal); animation: blink 1s steps(2) infinite; }
.mentor-badge { display: inline-block; font: 500 11px var(--pixel); color: #2a1a10; background: #e8c766; padding: 0 5px; vertical-align: 2px; letter-spacing: .03em; }

.mentor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.mentor-main, .mentor-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.mentor-side { position: sticky; top: 76px; }
.mentor-main h3, .mentor-side h3 { margin-bottom: 10px; }
.mentor-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px;
  background: linear-gradient(180deg, #2f2130, var(--panel)); border-color: #2a1d17; box-shadow: inset 0 0 0 2px rgba(201,162,39,.18), 0 4px 0 rgba(0,0,0,.35); }
#m-canvas { width: 100%; height: auto; aspect-ratio: 192 / 80; display: block; border: 2px solid var(--line); background: #2a1d2b; }
.m-hero-side { display: grid; gap: 14px; }
.m-switch-row { display: flex; gap: 14px; align-items: center; }
.m-switch { width: 74px; height: 36px; flex: none; position: relative; background: #3a2a32; border: 2px solid var(--line); cursor: pointer;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.4); padding: 0; transition: background .15s; }
.m-switch .knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; background: #8f7a72; border: 2px solid var(--line);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); transition: left .15s, background .15s; }
.m-switch.on { background: #1f4a33; }
.m-switch.on .knob { left: 41px; background: var(--ok); }
.m-switch:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.m-switch-lbl { font: 700 20px var(--pixel); }
.m-switch-lbl b { color: var(--bad); margin-left: 4px; }
.m-switch-lbl b.on { color: var(--ok); text-shadow: 0 0 10px rgba(123,211,137,.4); }
.m-status { font-size: 14px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.m-auto-tag { display: inline-block; font: 12px var(--pixel); border: 1px solid var(--edge); color: var(--muted); padding: 0 6px; margin-left: 2px; }
.m-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 6px; }
#m-auto { grid-template-columns: repeat(3, 1fr); }
.mentor-main .count { display: inline-block; min-width: 22px; text-align: center; background: var(--accent); color: #2a0f1d; font-size: 14px; padding: 0 5px; margin-left: 4px; }

.m-live-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.m-live-head h3 { margin: 0; }
.m-live-head .muted { font: 13px var(--pixel); }
.m-live-dot { width: 10px; height: 10px; background: var(--teal); box-shadow: 0 0 8px var(--teal); animation: blink 1s steps(2) infinite; }
#m-live { border-color: #1e4a46; }
.m-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 14px; color: var(--text-2); max-height: 260px; overflow: auto; }
.m-acts li { display: grid; grid-template-columns: 22px 1fr; gap: 4px; overflow-wrap: anywhere; }
.m-acts li:last-child { color: var(--text); }

.upg { border: 2px solid var(--line); background: var(--bg-2); padding: 10px 12px; margin-bottom: 8px; }
.upg-proposed { border-color: #6a3350; background: rgba(255,95,162,.05); }
.upg-reverted, .upg-rejected, .upg-superseded { opacity: .72; }
.upg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; font-size: 14px; }
.upg-head b { font: 500 15px var(--pixel); }
.upg-title { flex: 1; min-width: 160px; color: var(--text); overflow-wrap: anywhere; }
.upg-kind { font: 500 11px var(--pixel); text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; background: var(--panel-2); color: var(--text-2); }
.upg-kind.k-instruksi { background: #3d3157; color: #d9cbff; } .upg-kind.k-model { background: #4a3a14; color: #ffd27a; }
.upg-kind.k-ingatan, .upg-kind.k-lupakan { background: #1e4140; color: #9ff5ea; } .upg-kind.k-pustaka { background: #3e2e12; color: #e8c766; }
.upg-kind.k-playbook { background: #4a2a1e; color: #ffb38a; }
.upg-st { font: 12px var(--pixel); color: var(--muted); white-space: nowrap; }
.upg-st.st-proposed { color: var(--accent); } .upg-st.st-applied { color: var(--ok); } .upg-st.st-reverted { color: var(--warn); }
.upg-why { font-size: 13px; color: var(--text-2); margin-top: 5px; overflow-wrap: anywhere; }
.upg-note { font-size: 13px; color: var(--warn); margin-top: 5px; }
.upg-ch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 7px; font: 14px var(--mono); }
.upg-ch .old { color: var(--muted); text-decoration: line-through; } .upg-ch .arr { color: var(--lamp); } .upg-ch .new { color: var(--ok); }
.upg-mem { margin-top: 7px; font-size: 14px; padding: 4px 8px; border-left: 3px solid; }
.upg-mem.add { border-color: var(--ok); color: #cfeed6; } .upg-mem.del { border-color: var(--bad); color: #f2c4c4; }
.upg-more { margin-top: 6px; }
.upg-more > summary { font-size: 13px; margin: 0 0 6px; color: var(--teal); }
.upg-doc { max-height: 320px; overflow: auto; background: rgba(0,0,0,.18); padding: 8px 12px; font-size: 14px; }
.upg-acts { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.upg-reject { display: flex; gap: 6px; margin-top: 8px; }
.upg-reject input { font-size: 13px; padding: 5px 8px; }
.diff { font: 12.5px/1.5 var(--mono); background: #120c10; border: 1px solid var(--line); max-height: 360px; overflow: auto; }
.diff .d { display: grid; grid-template-columns: 16px 1fr; padding: 0 8px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .d i { font-style: normal; color: var(--muted); user-select: none; }
.diff .d-add { background: rgba(123,211,137,.12); color: #cfeed6; } .diff .d-add i { color: var(--ok); }
.diff .d-del { background: rgba(255,122,122,.10); color: #f2c4c4; } .diff .d-del i { color: var(--bad); }
.diff .d-eq { color: #a8988c; } .diff .d-gap { color: var(--muted); font-style: italic; background: rgba(255,255,255,.03); }

.m-cycle { border: 2px solid var(--line); background: var(--bg-2); margin-bottom: 8px; }
.m-cycle > summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0; list-style: none; flex-wrap: wrap; color: var(--text); font: 14px var(--read); }
.m-cycle > summary::-webkit-details-marker { display: none; }
.m-cycle > summary b { font: 500 15px var(--pixel); }
.m-cycle .when { color: var(--text-2); font-size: 13px; }
.m-cycle .trig { font: 12px var(--pixel); color: var(--muted); }
.m-cycle .chips { display: flex; gap: 4px; flex: 1; }
.chip-s { font: 12px var(--pixel); padding: 0 6px; border: 1px solid var(--edge); }
.chip-s.ok { color: var(--ok); border-color: #2f6b3e; } .chip-s.pend { color: var(--accent); border-color: #6a3350; }
.m-cycle .lbl { font: 12px var(--pixel); color: var(--muted); }
.m-cycle.st-error .lbl { color: var(--bad); } .m-cycle.st-running .lbl { color: var(--teal); }
.m-cycle .cost { font: 12px var(--mono); color: var(--muted); min-width: 56px; text-align: right; }
.m-cycle[open] { border-color: var(--edge); }
.m-cycle-body { padding: 4px 14px 12px; border-top: 1px solid var(--line); }
.m-sub { font: 500 14px var(--pixel); color: var(--lamp); margin: 14px 0 8px; }
.m-empty { text-align: center; padding: 26px 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.m-empty b { color: var(--text-2); }

.side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.m-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.m-stats div { background: var(--bg-2); border: 2px solid var(--line); padding: 7px 10px; }
.m-stats div:last-child { grid-column: span 2; }
.m-stats b { display: block; font: 700 20px var(--pixel); color: var(--lamp); }
.m-stats span { font-size: 12px; color: var(--muted); }
.m-playbook { max-height: 300px; overflow: auto; background: rgba(0,0,0,.18); padding: 8px 12px; font-size: 13.5px; }
.m-playbook h1 { font-size: 17px; margin: 0 0 .4em; color: var(--lamp); }
.m-pus { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.m-pus li { display: flex; justify-content: space-between; gap: 8px; }
.m-pus a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.m-pus span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.m-locked ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text-2); line-height: 1.7; }

.mem-add { border: 2px dashed var(--edge); padding: 10px; margin-bottom: 12px; }
.mem-add-bar { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.mem-add-bar select { width: auto; font-size: 13px; padding: 5px 8px; }
.mem-list { display: grid; gap: 4px; max-height: 46vh; overflow: auto; }
.mem-row { display: grid; grid-template-columns: auto auto 1fr auto auto auto; gap: 8px; align-items: center; padding: 6px 8px; background: var(--bg-2); border: 1px solid var(--line); }
.mem-kind { font: 11px var(--pixel); text-transform: uppercase; padding: 1px 5px; background: var(--panel-2); color: var(--text-2); }
.mem-kind.k-kebiasaan { background: #3d3157; color: #d9cbff; } .mem-kind.k-pelajaran { background: #1e4140; color: #9ff5ea; }
.mem-txt { font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.mem-row .ic { background: none; border: 0; cursor: pointer; opacity: .45; font-size: 14px; padding: 2px; }
.mem-row .ic:hover, .mem-row .ic.on { opacity: 1; }
.mem-empty { text-align: center; padding: 16px; margin: 0; }
.ver-list { display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.ver { border: 2px solid var(--line); background: var(--bg-2); }
.ver.cur { border-color: #2f6b3e; }
.ver > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 10px; margin: 0; list-style: none; color: var(--text); font: 14px var(--read); }
.ver > summary::-webkit-details-marker { display: none; }
.ver-n { font: 700 14px var(--pixel); color: var(--lamp); min-width: 28px; }
.ver-note { flex: 1; min-width: 150px; overflow-wrap: anywhere; }
.ver-ch { display: flex; gap: 4px; flex-wrap: wrap; }
.ver-ch i { font: normal 11px var(--pixel); border: 1px solid var(--edge); padding: 0 5px; color: var(--text-2); }
.ver-when { font-size: 12px; color: var(--muted); }
.ver-cur { font: 11px var(--pixel); background: var(--ok); color: #0b2a12; padding: 0 5px; }
.ver-body { padding: 4px 12px 12px; border-top: 1px solid var(--line); }
.ver-body dl { display: grid; grid-template-columns: 90px 1fr; gap: 3px 10px; font-size: 13px; margin: 8px 0; }
.ver-body dt { color: var(--muted); } .ver-body dd { margin: 0; overflow-wrap: anywhere; }
.ver-pre { font: 12.5px/1.5 var(--mono); white-space: pre-wrap; background: #120c10; border: 1px solid var(--line); padding: 8px; max-height: 260px; overflow: auto; margin: 0; }
#modal:has(.ver-list), #modal:has(.mem-list) { width: min(760px, calc(100vw - 32px)); }

@media (max-width: 1600px) { .mentor-pill .mp-lbl { display: none; } }
@media (max-width: 1100px) { .mentor-layout { grid-template-columns: 1fr; } .mentor-side { position: static; } }
@media (max-width: 720px) {
  .mentor-hero { grid-template-columns: 1fr; }
  .mem-row { grid-template-columns: auto 1fr auto auto auto; } .mem-row .mem-src { display: none; }
  .m-cycle .cost { min-width: 0; }
}

/* v0.5: topbar muat 9 tab + tombol Self-Upgrade */
#logout .lo-ic { display: none; }
@media (max-width: 1500px) { .tab { padding: 6px 8px; font-size: 15px; } .tabs { gap: 2px; } .topbar { gap: 12px; } }
@media (max-width: 1400px) { .topstats { display: none; } .mentor-pill { margin-left: auto; } }
@media (max-width: 1300px) { .brand-txt { display: none; } #logout .lo-txt { display: none; } #logout .lo-ic { display: inline; } }
@media (max-width: 1020px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .brand-txt { display: inline; } .mentor-pill { margin-left: auto; }
}
.desk-head > div:not(.actions) { min-width: 0; }
.desk-head .actions { flex-wrap: wrap; justify-content: flex-end; max-width: 150px; flex: none; }
.desk-head .actions #dh-mem, .desk-head .actions #dh-ver { padding: 4px 7px 5px; }
.m-pus { grid-template-columns: minmax(0, 1fr); }
.m-pus li { min-width: 0; }
.m-pus span { flex: none; }
