/* AIRA: Ruang Kerja Asisten AI */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  color-scheme: dark;
  --ink: #0c1220;
  --panel: #111a2c;
  --raised: #172238;
  --line: rgba(140, 165, 220, 0.11);
  --line-2: rgba(140, 165, 220, 0.22);
  --text: #e7edfb;
  --mute: #8896b4;
  --faint: #5d6b89;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, 0.15);
  --ok: #3ddc97;
  --warn: #f5b942;
  --err: #ff7b7b;
  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
}

body {
  background: var(--ink);
  color: var(--text);
  font: 400 13.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

.i {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- kerangka ---------- */
.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100dvh;
  min-height: 560px;
}

/* Kunci posisi baris grid: view aktif wajib menempati baris fleksibel (1fr).
   Tanpa ini item lain bisa menggeser view ke baris implicit berukuran auto,
   sehingga tinggi kontennya terpotong dan halaman tidak bisa di-scroll. */
.app > .top { grid-row: 1; }
.app > main,
.app > #viewChat { grid-row: 2; min-height: 0; }
.app > .foot { grid-row: 3; }

.top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 4px;
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto var(--chat-width, clamp(340px, 32vw, 500px));
  gap: 8px;
  padding: 6px 10px 10px 16px;
  min-height: 0;
  position: relative;
}

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 16px 10px;
  color: var(--faint);
  font-size: 11.5px;
}

/* ---------- bilah atas ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #bcd0ff, var(--accent) 55%, #2a4fd0);
  box-shadow: 0 0 10px rgba(91, 140, 255, 0.35);
}

.brand b {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
  font-size: 13.5px;
  transition: border-color 0.15s ease;
}

.pill:hover {
  border-color: var(--line-2);
}

.btn-popout-companion {
  background: rgba(91, 140, 255, 0.12) !important;
  border: 1px solid rgba(91, 140, 255, 0.35) !important;
  color: var(--accent, #5b8cff) !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 12px !important;
  height: 36px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
}

.btn-popout-companion:hover {
  background: rgba(91, 140, 255, 0.24) !important;
  border-color: rgba(91, 140, 255, 0.7) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(91, 140, 255, 0.3) !important;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

.pill .txt {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill .i {
  width: 16px;
  height: 16px;
  color: var(--mute);
}

.pill.mode[data-mode="yolo"] {
  color: var(--warn);
  background: rgba(245, 185, 66, 0.1);
  border-color: rgba(245, 185, 66, 0.4);
}

.pill.mode[data-mode="yolo"] .i {
  color: var(--warn);
}

.pill.mode[data-mode="manual"] {
  color: #ff9898;
  background: rgba(255, 123, 123, 0.1);
  border-color: rgba(255, 123, 123, 0.35);
}

.pill.mode[data-mode="manual"] .i {
  color: #ff9898;
}

.pill.thinking {
  cursor: pointer;
}

.pill.thinking .i:first-child {
  color: var(--accent);
}

.pill.thinking[data-level="low"] {
  border-color: rgba(91, 140, 255, 0.25);
}

.pill.thinking[data-level="low"] .i:first-child {
  color: #70a1ff;
}

.pill.thinking[data-level="medium"] {
  border-color: rgba(91, 140, 255, 0.4);
  background: rgba(91, 140, 255, 0.08);
}

.pill.thinking[data-level="medium"] .i:first-child {
  color: var(--accent);
}

.pill.thinking[data-level="high"] {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.1);
  color: #d8b4fe;
}

.pill.thinking[data-level="high"] .i:first-child {
  color: #c084fc;
}

.pill.thinking[data-level="ultra"] {
  border-color: rgba(245, 185, 66, 0.45);
  background: rgba(245, 185, 66, 0.1);
  color: #fde047;
}

.pill.thinking[data-level="ultra"] .i:first-child {
  color: var(--warn);
}

.pill.thinking[data-level="max"] {
  border-color: rgba(255, 123, 123, 0.5);
  background: rgba(255, 123, 123, 0.12);
  color: #ff9898;
}

.pill.thinking[data-level="max"] .i:first-child {
  color: #ff7b7b;
}

.icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--mute);
  transition: all 0.15s ease;
}

.icon:hover {
  background: var(--panel);
  color: var(--text);
}

.icon[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-logout-top:hover {
  color: var(--err);
  background: rgba(255, 123, 123, 0.12);
  border-color: rgba(255, 123, 123, 0.3);
}

.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  max-width: 380px;
  max-height: min(480px, calc(100vh - 100px));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 6px;
  z-index: 30;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 165, 220, 0.35) transparent;
}

.menu::-webkit-scrollbar {
  width: 6px;
}

.menu::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}

.menu::-webkit-scrollbar-thumb {
  background: rgba(140, 165, 220, 0.35);
  border-radius: 6px;
  transition: background 0.15s ease;
}

.menu::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

#menuModel {
  min-width: 280px;
}

#menuModel .menu-title {
  position: sticky;
  top: -6px;
  background: var(--raised);
  z-index: 2;
  margin: -6px -6px 4px -6px;
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--line);
}

.menu.right {
  left: auto;
  right: 0;
}

.menu-title {
  padding: 8px 10px 4px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  font-size: 13.5px;
  color: var(--text);
  transition: background 0.12s ease;
}

.menu-item:hover {
  background: var(--accent-soft);
}

.menu-item .i {
  width: 16px;
  height: 16px;
  color: var(--accent);
  visibility: hidden;
}

.menu-item[aria-checked="true"] .i {
  visibility: visible;
}

.menu-item small {
  display: block;
  color: var(--mute);
  font-size: 12px;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px;
  font-size: 13.5px;
  cursor: pointer;
  border-radius: 8px;
}

.switch:hover {
  background: rgba(255, 255, 255, 0.03);
}

.switch input {
  appearance: none;
  width: 36px;
  height: 21px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--mute);
  transition: transform 0.15s, background 0.15s;
}

.switch input:checked {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.switch input:checked::after {
  transform: translateX(15px);
  background: var(--accent);
}

/* ---------- kehadiran (orb) ---------- */
.presence {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  min-height: 0;
}

.stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#orb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}

.ws {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 12px;
  color: var(--mute);
  z-index: 2;
  background: rgba(17, 26, 44, 0.65);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.ws b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.say {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}

.say b {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
  line-height: 1.2;
}

.say span {
  color: var(--mute);
  font-size: 13.5px;
  margin-top: 2px;
  display: block;
  line-height: 1.3;
}

.stats {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  gap: 18px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.stat .k {
  font-size: 12.5px;
  color: var(--faint);
}

.stat .v {
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat .v small {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--mute);
}

.bar {
  height: 3px;
  border-radius: 2px;
  background: var(--raised);
  margin-top: 8px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

/* Split Resizer Divider */
.chat-resizer {
  width: 14px;
  margin: 0 -6px;
  cursor: col-resize;
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

.chat-resizer:hover .resizer-line,
.chat-resizer.is-dragging .resizer-line {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(91, 140, 255, 0.7);
  transform: scaleY(1.3);
}

.resizer-line {
  width: 3px;
  height: 42px;
  border-radius: 999px;
  background: var(--line-2);
  transition: all 0.15s ease;
}

/* ---------- percakapan ---------- */
.chat {
  --chat-zoom: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.chat.is-floating {
  position: fixed !important;
  z-index: 150 !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(91, 140, 255, 0.4);
  border-color: rgba(91, 140, 255, 0.5);
  border-radius: 16px;
  min-width: 340px;
  min-height: 420px;
  max-width: 98vw;
  max-height: 96vh;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  user-select: none;
}

.chat.is-floating .chat-head {
  cursor: grab;
  background: rgba(23, 34, 56, 0.85);
}

.chat.is-floating .chat-head:active {
  cursor: grabbing;
}

/* Chat Zoom Badge & Corner Resizer */
.chat-zoom-badge {
  position: absolute;
  top: 52px;
  right: 18px;
  z-index: 50;
  background: rgba(15, 23, 42, 0.92);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.45);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: fadeIn 0.15s ease-out;
}

.chat-corner-resizer {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 60;
  background: linear-gradient(135deg, transparent 50%, rgba(91, 140, 255, 0.6) 50%);
  border-bottom-right-radius: 14px;
}

#chat .thread {
  font-size: calc(14.5px * var(--chat-zoom, 1));
}

#chat .msg-body {
  font-size: calc(14px * var(--chat-zoom, 1));
  line-height: calc(1.55 * var(--chat-zoom, 1));
}

#chat .md-table {
  font-size: calc(13px * var(--chat-zoom, 1));
}

.icon-only {
  padding: 0 8px !important;
}

/* =====================================================================
   MARKDOWN TABLE RENDERING (HIGH CONTRAST & RESPONSIVE SCROLL)
   ===================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0;
  border-radius: 12px;
  border: 1px solid rgba(140, 165, 220, 0.22);
  background: rgba(10, 15, 29, 0.75);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  -webkit-overflow-scrolling: touch;
}

.md-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  text-align: left;
}

.md-table thead {
  background: rgba(23, 34, 56, 0.92);
  border-bottom: 2px solid rgba(140, 165, 220, 0.28);
}

.md-table th {
  padding: 10px 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.md-table tbody tr {
  border-bottom: 1px solid rgba(140, 165, 220, 0.12);
  transition: background 0.12s ease;
}

.md-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.md-table tbody tr:hover {
  background: rgba(91, 140, 255, 0.09);
}

.md-table td {
  padding: 10px 14px;
  vertical-align: top;
  color: #e2e8f0;
}

.md-table td code {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(140, 165, 220, 0.25);
  color: #93c5fd;
  font-family: var(--mono);
}

.chat-head .sp {
  flex: 1;
}

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 11px;
  background: var(--ink);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--mute);
  font-weight: 500;
  font-size: 12.5px;
  transition: all 0.12s ease;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  background: var(--raised);
  color: var(--text);
  font-weight: 600;
}

.tab .n {
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.sess {
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mute);
  font-weight: 500;
  font-size: 12px;
  transition: all 0.12s ease;
}

.ghost:hover {
  color: var(--text);
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.02);
}

.ghost .i {
  width: 14px;
  height: 14px;
}

.panels {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px 8px;
}

.thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
  margin: 0;
  padding-bottom: 12px;
}

/* Pesan User */
.msg.user {
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: min(82%, 680px);
  animation: in 0.18s ease-out;
}

.bubble {
  background: var(--accent-soft);
  border: 1px solid rgba(91, 140, 255, 0.28);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #f1f5f9;
  max-width: 100%;
  line-height: 1.55;
}

.msg-user-media {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
}

.msg.user .att {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 100%;
}

.user-attach-img-wrap {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.65);
  max-width: min(320px, 100%);
  max-height: 260px;
  line-height: 0;
  cursor: zoom-in;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.user-attach-img-wrap:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.msg-user-media.multi .user-attach-img-wrap {
  max-width: 180px;
  max-height: 160px;
}

.user-attach-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 11px;
}

.msg-user-media.multi .user-attach-img {
  max-height: 160px;
  object-fit: cover;
}

.fchip.img-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: auto;
  min-height: 34px;
  max-width: 240px;
  padding: 4px 8px;
}

.fchip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.chip-thumb {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--ink);
}

/* Pesan Aira */
.msg.aira {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  animation: in 0.18s ease-out;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #bcd0ff, var(--accent) 55%, #2a4fd0);
  flex: none;
}

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 13px;
}

.meta .name {
  font-weight: 600;
  color: #ffffff;
}

.meta .time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 12px;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mute);
  font-size: 12.5px;
}

.state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.state.busy {
  color: var(--warn);
}

.state.busy::before {
  animation: blink 1s infinite;
}

.state.done {
  color: var(--ok);
}

.state.stopped {
  color: var(--mute);
}

.state.err {
  color: var(--err);
}

@keyframes blink {
  50% { opacity: 0.25; }
}

@keyframes in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.dots {
  display: inline-flex;
  gap: 4px;
  padding: 6px 0;
}

.dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mute);
  animation: blink 1.1s infinite;
}

.dots i:nth-child(2) { animation-delay: 0.18s; }
.dots i:nth-child(3) { animation-delay: 0.36s; }

/* Markdown & Tipografi */
.prose {
  overflow-wrap: anywhere;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
}

.prose p {
  margin: 0 0 0.72em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose .md-h {
  margin: 1em 0 0.45em;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
}

.prose .md-h:first-child {
  margin-top: 0;
}

.prose .md-h1 { font-size: 1.2em; }
.prose .md-h2 { font-size: 1.1em; }
.prose .md-h3 { font-size: 1.02em; }
.prose .md-h4,
.prose .md-h5,
.prose .md-h6 { font-size: 0.96em; color: #e2e8f0; }

.prose .md-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

.prose .md-quote {
  margin: 0.65em 0;
  padding: 8px 14px;
  border-left: 3px solid var(--accent);
  background: rgba(91, 140, 255, 0.08);
  border-radius: 0 8px 8px 0;
  color: #dbeafe;
}

.prose ul, .prose ol {
  margin: 0.35em 0 0.8em;
  padding-left: 1.45em;
}

.prose li {
  margin: 0.28em 0;
  line-height: 1.6;
}

.prose li.md-li-sub {
  margin-left: 1.15em;
  list-style-type: circle;
}

.prose code {
  font: 12.5px var(--mono);
  background: var(--raised);
  padding: 2px 6px;
  border-radius: 6px;
  color: #d1e1ff;
}

.prose pre {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  overflow: auto;
  margin: 0.65em 0;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 12.5px;
  color: #e2e8f0;
}

.sys {
  align-self: center;
  color: var(--faint);
  font-size: 12.5px;
  padding: 3px 14px;
  border-radius: 999px;
  background: var(--ink);
  border: 1px solid var(--line);
}

/* Markdown Gambar & Tautan */
.msg-media-block {
  display: block;
  margin: 12px 0;
  clear: both;
}

.msg-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 10px 0;
  max-width: min(100%, 520px);
  line-height: normal;
  clear: both;
}

.msg-media-block .msg-img-wrap {
  margin: 0;
}

.msg-img-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  max-width: 100%;
  line-height: 0;
  cursor: zoom-in;
}

.msg-img-link:hover {
  transform: scale(1.01);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.msg-img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
}

.msg-img.img-err {
  display: inline-flex;
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--err);
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
}

.msg-img-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 480px;
  margin-top: 6px;
  padding: 0 4px;
  font-size: 12px;
  color: var(--muted);
}

.msg-img-caption .img-cap-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--fg);
}

.msg-img-caption .img-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.msg-img-caption .img-dl-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.msg-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg-link:hover {
  filter: brightness(1.2);
}

/* Kartu Lampiran Berkas */
.msg-file-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  vertical-align: middle;
}

.msg-file-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.msg-file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  user-select: none;
}

.msg-file-icon.badge-pdf {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.msg-file-icon.badge-sheet {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.msg-file-icon.badge-doc {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.msg-file-icon.badge-zip {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.msg-file-icon.badge-img {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.msg-file-icon.badge-file {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.msg-file-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.msg-file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.msg-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.msg-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, filter 0.15s ease;
}

.msg-file-btn.btn-view {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.msg-file-btn.btn-view:hover {
  background: rgba(255, 255, 255, 0.14);
}

.msg-file-btn.btn-download {
  background: var(--accent);
  color: #fff;
  border: none;
}

.msg-file-btn.btn-download:hover {
  filter: brightness(1.15);
}

.msg-file-mini-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  margin-left: 5px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  text-decoration: none;
  vertical-align: middle;
  transition: all 0.15s ease;
}

.msg-file-mini-btn:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #fff;
}

.code-btn.btn-open-file {
  text-decoration: none;
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.code-btn.btn-open-file:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #fff;
}

/* Tool execution details inside chat bubble */
.act {
  margin: 4px 0 10px;
  border-left: 2px solid var(--line-2);
  padding-left: 12px;
}

.act summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--mute);
  font-size: 13px;
  user-select: none;
}

.act summary::-webkit-details-marker {
  display: none;
}

.act summary:hover {
  color: var(--text);
}

.act summary .i {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}

.act[open] summary .i {
  transform: rotate(90deg);
}

.act .cnt {
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.act-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.trow-wrap {
  display: flex;
  flex-direction: column;
}

.trow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: baseline;
  font: 12px/1.5 var(--mono);
  padding: 3px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.trow.has-output {
  cursor: pointer;
}

.trow.has-output:hover {
  background: rgba(255, 255, 255, 0.05);
}

.trow.has-output.expanded {
  background: rgba(59, 130, 246, 0.08);
}

.trow-detail {
  margin: 4px 0 8px 12px;
  padding: 8px 12px;
  background: var(--bg, #0b0f19);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  font: 11.5px/1.55 var(--mono);
  max-height: 280px;
  overflow: auto;
  color: var(--text, #e2e8f0);
}

.trow-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  font-size: 11px;
  color: var(--faint, #94a3b8);
}

.trow-copy-btn {
  background: transparent;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.15));
  color: var(--text, #cbd5e1);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10.5px;
  cursor: pointer;
}

.trow-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.trow-detail-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.trow .tn {
  color: var(--text);
  font-weight: 500;
}

.trow .ta {
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ok { color: var(--ok); }
.bad { color: var(--err); }
.trow .tm { color: var(--faint); }

.trow.code-edit {
  background: rgba(59, 130, 246, 0.06);
  border-left: 2px solid #3b82f6;
  padding: 3px 6px;
  border-radius: 4px;
}
.trow .code-badge {
  color: #60a5fa;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.trow .code-file {
  color: var(--text);
  font-weight: 500;
}
.diff-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  margin-left: 6px;
}
.diff-add {
  color: #34d399;
}
.diff-del {
  color: #f87171;
}

/* Thinking / Reasoning Details Block */
.think-act {
  margin: 4px 0 10px;
  border-left: 2px solid rgba(245, 185, 66, 0.45);
  padding-left: 12px;
}

.think-act summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--warn);
  font-size: 13px;
  user-select: none;
}

.think-act summary::-webkit-details-marker {
  display: none;
}

.think-act summary:hover {
  color: #ffe6a3;
}

.think-act summary .i {
  width: 14px;
  height: 14px;
  color: var(--warn);
  transition: transform 0.15s;
}

.think-act[open] summary .i {
  transform: rotate(90deg);
}

.think-act .cnt {
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  font-size: 12px;
}

.think-body {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: 12.5px/1.6 var(--mono);
  color: #cbd5e1;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

/* Compacted Context Details Block */
.compact-block {
  margin: 8px 0 12px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease;
  width: 100%;
}

.compact-block:hover {
  border-color: var(--accent);
}

.compact-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-size: 13px;
  background: rgba(91, 140, 255, 0.05);
}

.compact-summary::-webkit-details-marker {
  display: none;
}

.compact-icon {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.compact-summary b {
  color: var(--text);
  font-weight: 600;
  flex: 1;
}

.compact-pill {
  font-size: 11.5px;
  font-family: var(--mono);
  background: rgba(91, 140, 255, 0.15);
  color: #9cbaff;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(91, 140, 255, 0.25);
}

.compact-body {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.compact-archive {
  margin-bottom: 10px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  font-size: 12px;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-archive code {
  color: var(--accent);
  font-family: var(--mono);
}

.compact-text {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Approval Card in Thread */
.appr-card {
  margin: 8px 0 12px;
  padding: 12px 14px;
  background: var(--raised);
  border: 1px solid rgba(245, 185, 66, 0.4);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: in 0.18s ease-out;
}

.appr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--warn);
}

.appr-head .i {
  color: var(--warn);
}

.appr-head code {
  font: 12px var(--mono);
  background: var(--ink);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text);
}

.appr-args {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: 11.5px/1.5 var(--mono);
  color: var(--mute);
  max-height: 140px;
  overflow: auto;
}

.appr-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.btn-appr {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-appr:hover {
  border-color: var(--line-2);
}

.btn-appr.ok {
  background: rgba(61, 220, 151, 0.15);
  border-color: rgba(61, 220, 151, 0.4);
  color: var(--ok);
}

.btn-appr.ok:hover {
  background: rgba(61, 220, 151, 0.25);
}

.btn-appr.bad {
  background: rgba(255, 123, 123, 0.12);
  border-color: rgba(255, 123, 123, 0.3);
  color: var(--err);
}

.btn-appr.bad:hover {
  background: rgba(255, 123, 123, 0.22);
}

/* Suggestion Chips */
.suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0 0;
}

.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  transition: all 0.15s ease;
}

.chip:hover {
  background: var(--accent-soft);
  border-color: rgba(91, 140, 255, 0.4);
}

/* Log Tab */
.tlog {
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
}

.tl {
  display: grid;
  grid-template-columns: 64px minmax(120px, 1fr) minmax(0, 2fr) 52px 64px;
  gap: 14px;
  align-items: baseline;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font: 12.5px/1.5 var(--mono);
}

.tl .ta {
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl .tt, .tl .tm {
  color: var(--faint);
}

.empty {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
  color: var(--mute);
}

.empty b {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 4px;
}

/* Notes Tab */
.notes {
  max-width: 740px;
  margin: 0 auto;
}

.notes .path {
  font: 12px var(--mono);
  color: var(--faint);
  margin-bottom: 14px;
  padding: 4px 10px;
  background: var(--ink);
  border-radius: 6px;
  border: 1px solid var(--line);
  display: inline-block;
}

/* Code Snippet Wrapper with Actions */
.code-wrap {
  position: relative;
  margin: 0.6em 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--ink);
}

.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 12px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  font: 11.5px var(--mono);
  color: var(--mute);
}

.code-btns {
  display: flex;
  gap: 6px;
}

.code-btn {
  background: transparent;
  border: 0;
  color: var(--faint);
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  transition: all 0.12s ease;
}

.code-btn:hover {
  color: var(--text);
  background: var(--panel);
}

.code-wrap pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}

/* Limit reached notice */
.limit-reached-notice {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(245, 185, 66, 0.1);
  border: 1px solid rgba(245, 185, 66, 0.35);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.limit-reached-notice strong {
  display: block;
  color: var(--warn);
}

.limit-reached-notice span {
  color: var(--mute);
  font-size: 12px;
}

.btn-continue-run {
  background: var(--accent);
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
}

/* ---------- input ---------- */
.composer {
  position: relative;
  padding: 6px 12px 12px;
}

.slash-menu {
  position: absolute;
  bottom: calc(100% - 2px);
  left: 12px;
  right: 12px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.45);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slash-menu[hidden] {
  display: none;
}

.slash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  width: 100%;
}

.slash-item:hover,
.slash-item.selected {
  background: var(--accent-soft);
}

.slash-cmd {
  font-family: var(--mono, monospace);
  font-weight: 600;
  color: var(--accent);
  font-size: 13px;
  flex: none;
}

.slash-badge {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 6px;
  flex: none;
}

.slash-badge.system {
  background: rgba(91, 140, 255, 0.15);
  color: #70a1ff;
}

.slash-badge.skill {
  background: rgba(61, 220, 151, 0.15);
  color: var(--ok);
}

.slash-desc {
  color: var(--mute);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 6px 0 10px;
  border-radius: 9px;
  background: var(--raised);
  font-size: 12.5px;
  color: var(--text);
}

.fchip .i {
  width: 14px;
  height: 14px;
  color: var(--mute);
}

.fchip .fs {
  color: var(--faint);
}

.fchip button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mute);
}

.fchip button:hover {
  background: var(--panel);
  color: var(--text);
}

.field {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  padding: 7px 6px;
  max-height: 160px;
  line-height: 1.5;
  color: var(--text);
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.field textarea::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.field textarea::placeholder {
  color: var(--faint);
}

.field .icon {
  width: 38px;
  height: 38px;
  flex: none;
}

.field .icon[aria-pressed="true"] {
  color: var(--ok);
  background: rgba(61, 220, 151, 0.14);
}

.send {
  width: 38px;
  height: 38px;
  flex: none;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.send:hover {
  background: #7aa1ff;
}

.send:disabled {
  background: var(--raised);
  color: var(--faint);
  cursor: default;
}

.send.stop {
  background: rgba(255, 123, 123, 0.16);
  color: var(--err);
}

.send.stop:hover {
  background: rgba(255, 123, 123, 0.26);
}

.hint {
  margin-top: 6px;
  color: var(--faint);
  font-size: 11.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

kbd {
  font: 500 11.5px var(--font);
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  color: var(--mute);
}

.drop {
  position: absolute;
  inset: 0;
  z-index: 20;
  border-radius: 20px;
  border: 2px dashed var(--accent);
  background: rgba(17, 26, 44, 0.9);
  display: grid;
  place-items: center;
  font-weight: 600;
  pointer-events: none;
}

/* ---------- bawah ---------- */
.foot .live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.foot .live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.foot .keys {
  display: flex;
  gap: 18px;
}

.foot .keys span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.toast.show {
  opacity: 1;
}

/* Task Completion Popup (Gemini-Style Floating Notification) */
.task-popup {
  position: fixed;
  top: 68px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(17, 26, 44, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(140, 165, 220, 0.22);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 310px;
  max-width: 440px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.3);
  pointer-events: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px) scale(0.96);
  transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.26s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.26s;
}

.task-popup[hidden] {
  display: none !important;
}

.task-popup.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.task-popup:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 16px rgba(124, 92, 255, 0.2);
}

.task-popup.success {
  border-left: 3px solid var(--accent, #7c5cff);
}

.task-popup.warn {
  border-left: 3px solid var(--warn, #f59e0b);
}

.task-popup-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.24), rgba(56, 189, 248, 0.16));
  border: 1px solid rgba(124, 92, 255, 0.3);
  flex-shrink: 0;
}

.task-popup.warn .task-popup-badge {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.35);
}

.task-popup-icon {
  font-size: 18px;
  line-height: 1;
}

.task-popup-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.task-popup-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-popup-head b {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #f1f5f9);
  letter-spacing: -0.01em;
}

.task-popup-time {
  font-size: 10.5px;
  color: var(--mute, #94a3b8);
  font-family: var(--mono, inherit);
}

.task-popup-evidence {
  font-size: 11.5px;
  color: var(--mute, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.task-popup-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.task-popup-view {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text, #f1f5f9);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}

.task-popup-view:hover {
  background: var(--accent, #7c5cff);
  color: #fff;
  border-color: transparent;
}

.task-popup-close {
  background: none;
  border: none;
  color: var(--faint, #64748b);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.task-popup-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text, #f1f5f9);
}

@media (max-width: 640px) {
  .task-popup {
    top: 56px;
    bottom: auto;
    left: 12px;
    right: 12px;
    min-width: auto;
    max-width: none;
  }
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 32, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head b {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-sec {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-text-box {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: 12.5px/1.6 var(--mono);
  color: var(--text);
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.modal-list {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--mute);
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-vrow {
  display: flex;
  gap: 8px;
}

.modal-input {
  flex: 1;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  outline: 0;
}

.modal-input:focus {
  border-color: var(--accent);
}

/* Responsif */
@media (max-width: 900px) {
  .top {
    padding: 10px 14px 4px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .main {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 8px 14px 10px;
  }
  .chat-resizer,
  .chat-corner-resizer {
    display: none !important;
  }
  .stage {
    min-height: 210px;
  }
  .chat {
    min-height: 460px;
  }
  .foot {
    padding: 6px 14px 10px;
  }
  .foot .keys {
    display: none;
  }
  .pill .txt {
    max-width: 140px;
  }
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
  }
  .stat:first-child {
    grid-column: auto;
  }
  .say b {
    font-size: 20px;
  }
  .tab {
    padding: 0 10px;
  }
  .chat-head .ghost {
    padding: 0 9px;
  }
}

@media (max-width: 640px) {
  html,
  body {
    height: 100dvh;
    overflow: hidden;
  }
  .app {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }
  .app > main:not([hidden]):not(#viewChat) {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .main,
  #viewChat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 8px 6px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .msg.user, .msg.aira {
    animation: none;
  }
  .state.busy::before, .dots i {
    animation: none;
  }
  .pulse-dot {
    animation: none !important;
  }
}

/* =====================================================================
   HALAMAN MANAJEMEN SESI (SESSION MANAGEMENT VIEW)
   ===================================================================== */

/* Navigasi View di Bilah Atas */
.nav-views {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  margin-right: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--mute);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  position: relative;
}

.nav-btn .i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn:hover .i {
  opacity: 1;
}

.nav-btn.active {
  background: var(--raised);
  color: #ffffff;
  border-color: var(--line-2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nav-btn.active .i {
  color: var(--accent, #5b8cff);
  opacity: 1;
}

.nav-btn .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(61, 220, 151, 0.7);
  flex: none;
  margin-left: -1px;
}

.sess-tag-btn {
  font-size: 12.5px;
  color: var(--mute);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sess-tag-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ==========================================================================
   DROPDOWN PEMILIH SESI (CHAT WINDOW HEADER)
   ========================================================================== */
.sess-picker-dropdown {
  position: relative;
  display: inline-block;
  user-select: none;
}

.sess-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--raised, #1c1d22);
  border: 1px solid var(--line, #2d2e36);
  color: var(--text, #e2e8f0);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.sess-picker-btn:hover {
  border-color: var(--accent, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-bright, #ffffff);
}

.sess-picker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  flex-shrink: 0;
}

.sess-picker-title {
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.sess-picker-chevron {
  color: var(--mute, #94a3b8);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.sess-picker-dropdown.is-open .sess-picker-chevron {
  transform: rotate(180deg);
}

.sess-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-height: 440px;
  overflow-y: auto;
  background: var(--bg-card, #16171d);
  border: 1px solid var(--line, #2a2b36);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 1200;
  padding: 6px;
  backdrop-filter: blur(14px);
  animation: sessMenuIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sessMenuIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.sess-picker-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mute, #71717a);
  padding: 8px 10px 4px;
}

.sess-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sess-picker-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.sess-picker-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sess-picker-item.active {
  background: rgba(99, 102, 241, 0.12);
  border-left: 3px solid var(--accent, #6366f1);
  padding-left: 7px;
}

.sess-picker-item .sess-item-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.sess-picker-item .sess-item-meta {
  flex: 1;
  min-width: 0;
}

.sess-picker-item .sess-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sess-picker-item .sess-item-sub {
  font-size: 10.5px;
  color: var(--mute, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sess-item-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface, #23242c);
  color: var(--mute, #a1a1aa);
  font-weight: 500;
  flex-shrink: 0;
}

.sess-item-badge.badge-primary {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.sess-picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line, #2a2b36);
}

.btn-picker-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 6px;
  background: var(--raised, #1f2028);
  border: 1px solid var(--line, #2d2e38);
  color: var(--text, #cbd5e1);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-picker-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: var(--accent, #6366f1);
}

/* Kontainer Utama Halaman Sesi */
.main-sessions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 16px 16px;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
}

.sess-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.sess-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.sess-subtitle {
  font-size: 12.5px;
  color: var(--mute);
  margin-top: 2px;
}

.sess-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Grid Layout */
.sess-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 12px;
  align-items: start;
}

.sess-col-main,
.sess-col-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Kartu-Kartu Sesi */
.sess-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.sess-card.active-card {
  border-color: rgba(91, 140, 255, 0.35);
  background: linear-gradient(180deg, rgba(91, 140, 255, 0.06) 0%, var(--panel) 100%);
}

.sess-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sess-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sess-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.sess-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-tag {
  font-size: 12px;
  color: var(--faint);
  background: var(--raised);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-family: var(--mono);
}

/* Badge Status Sesi */
.sess-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--mute);
  text-transform: capitalize;
}

.sess-badge.active {
  color: var(--ok);
  background: rgba(61, 220, 151, 0.12);
  border-color: rgba(61, 220, 151, 0.35);
}

.sess-badge.closed {
  color: var(--mute);
  background: rgba(136, 150, 180, 0.1);
  border-color: rgba(136, 150, 180, 0.25);
}

.sess-badge.auto-closed,
.sess-badge.interrupted_closed {
  color: var(--warn);
  background: rgba(245, 185, 66, 0.12);
  border-color: rgba(245, 185, 66, 0.3);
}

/* Source-type badges for live session cards */
.sess-badge-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
}
.sess-badge-source.hb {
  color: #f06;
  background: rgba(255, 0, 102, 0.1);
  border-color: rgba(255, 0, 102, 0.25);
}
.sess-badge-source.auto {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.3);
}
.sess-badge-source.tg {
  color: #38b2f5;
  background: rgba(56, 178, 245, 0.12);
  border-color: rgba(56, 178, 245, 0.3);
}
.sess-badge-source.gw {
  color: #f5a623;
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.3);
}
.sess-badge-source.usr {
  color: var(--mute);
  background: rgba(136, 150, 180, 0.1);
  border-color: rgba(136, 150, 180, 0.2);
}

/* Running session card highlight */
.sess-item-card.sess-item-running {
  border-color: rgba(61, 220, 151, 0.3);
  background: linear-gradient(135deg, rgba(61, 220, 151, 0.05) 0%, var(--raised) 80%);
}

/* Sub-ID display under labeled sessions */
.sess-item-subid {
  font-size: 10.5px;
  color: var(--faint);
  font-family: var(--mono);
  margin-top: 1px;
  opacity: 0.7;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: sessPulse 1.8s infinite ease-in-out;
}

@keyframes sessPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px currentColor; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Grid Informasi Sesi Aktif */
.sess-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px) {
  .sess-info-grid {
    grid-template-columns: 1fr;
  }
}

.info-block {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 11.5px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.info-value {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.info-value.strong {
  font-weight: 600;
  color: #ffffff;
}

/* Bar Kapasitas Sesi */
.sess-capacity-row {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cap-info {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--mute);
}

.cap-info b {
  color: var(--text);
}

.cap-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--raised);
  overflow: hidden;
  border: 1px solid var(--line);
}

.cap-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #3ddc97 100%);
  transition: width 0.3s ease;
}

/* Tombol Aksi */
.sess-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--line-2);
  background: var(--raised);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  border-color: var(--accent);
  background: rgba(91, 140, 255, 0.12);
  color: #ffffff;
}

.pill-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.pill-btn.primary:hover {
  filter: brightness(1.12);
}

.pill-btn.accent {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #bcd0ff;
}

.pill-btn.danger {
  border-color: rgba(255, 123, 123, 0.35);
  color: #ff9898;
  background: rgba(255, 123, 123, 0.08);
}

.pill-btn.danger:hover {
  background: rgba(255, 123, 123, 0.2);
  color: #ffffff;
}

.pill-btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--mute);
}

.pill-btn.ghost:hover {
  color: var(--text);
  border-color: var(--line-2);
}

.pill-btn.full-width {
  width: 100%;
}

.count-pill {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--mute);
  font-weight: 600;
}

.count-pill.warn {
  color: var(--warn);
  background: rgba(245, 185, 66, 0.12);
  border-color: rgba(245, 185, 66, 0.35);
}

/* Toolbar & Pencarian */
.sess-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 220px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  height: 38px;
  color: var(--text);
}

.search-box .i {
  color: var(--mute);
  width: 16px;
  height: 16px;
}

.search-box input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--text);
  font-size: 13.5px;
}

.search-box input::placeholder {
  color: var(--faint);
}

.filter-chips {
  display: inline-flex;
  gap: 6px;
}

.filter-chips .chip {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--mute);
  cursor: pointer;
  transition: all 0.12s ease;
}

.filter-chips .chip:hover {
  color: var(--text);
}

.filter-chips .chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

/* Daftar Item Sesi */
.sess-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.sess-item-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.sess-item-card:hover {
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.sess-item-card.is-active {
  border-color: rgba(91, 140, 255, 0.4);
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.08) 0%, var(--raised) 100%);
}

.sess-item-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sess-item-id-date {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sess-item-id {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}

.sess-item-date {
  font-size: 12px;
  color: var(--faint);
}

.sess-item-meta {
  font-size: 12px;
  color: var(--faint);
  margin-top: 2px;
}

.sess-item-topic {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.4;
}

.sess-item-summary {
  font-size: 12.5px;
  color: var(--mute);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sess-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.sess-item-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--faint);
}

.sess-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-item-action {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mute);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-item-action:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-item-action.resume {
  color: #70a1ff;
  border-color: rgba(91, 140, 255, 0.3);
}

.btn-item-action.resume:hover {
  background: var(--accent-soft);
  color: #ffffff;
}

/* Form Sesi Baru */
.new-sess-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sess-desc {
  font-size: 13px;
  color: var(--mute);
  line-height: 1.45;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.form-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: var(--accent);
}

/* Checklist Tugas Tertunda */
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.pending-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--line);
  transition: border-color 0.12s ease;
}

.pending-item:hover {
  border-color: var(--line-2);
}

.pending-item.done {
  opacity: 0.55;
}

.pending-item.done .pending-text {
  text-decoration: line-through;
}

.pending-check {
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex: none;
}

.pending-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pending-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.pending-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--faint);
  font-family: var(--mono);
}

/* Modal Detail Sesi */
.sess-detail-box {
  max-width: 760px !important;
  width: 90vw;
  max-height: 86vh;
}

.modal-head-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sess-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--mute);
  flex-wrap: wrap;
}

.sess-detail-topic {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  padding: 8px 12px;
  background: var(--raised);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.det-tasks-list,
.det-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.det-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  padding: 6px 10px;
  background: var(--raised);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.det-item-bullet {
  font-size: 13px;
  color: var(--text);
  padding: 6px 10px;
  background: var(--raised);
  border-radius: 6px;
  line-height: 1.4;
}

.sess-markdown-pre {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  max-height: 240px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  resize: vertical;
  line-height: 1.45;
}

.modal-textarea:focus {
  border-color: var(--accent);
}

.modal-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}

.modal-input:focus {
  border-color: var(--accent);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* Empty State & Skeleton */
.sess-empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--mute);
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sess-empty-state .i {
  width: 32px;
  height: 32px;
  color: var(--faint);
}

.sess-skeleton {
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--raised) 25%, rgba(23, 34, 56, 0.6) 50%, var(--raised) 75%);
  background-size: 200% 100%;
  animation: sessShimmer 1.5s infinite ease-in-out;
}

@keyframes sessShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 980px) {
  .sess-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   MEMORY GRAPH
   ===================================================================== */
.main-memory {
  min-height: 0;
  height: 100%;
  padding: 10px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.memory-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.memory-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.memory-title {
  color: #fff;
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.memory-subtitle {
  color: var(--mute);
  font-size: 13px;
  margin-top: 3px;
}

.memory-head-actions {
  display: flex;
  gap: 8px;
}

.memory-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(105px, 1fr));
  gap: 9px;
}

.memory-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(17, 26, 44, .78);
}

.memory-stat span {
  color: var(--mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.memory-stat strong {
  color: #fff;
  font-size: 20px;
}

.memory-shell {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 230px minmax(360px, 1fr) 260px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .23);
}

.memory-controls,
.memory-detail {
  min-width: 0;
  overflow-y: auto;
  padding: 16px;
  background: rgba(12, 18, 32, .58);
}

.memory-controls {
  border-right: 1px solid var(--line);
}

.memory-detail {
  border-left: 1px solid var(--line);
}

.memory-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 13px;
}

.memory-field > span:first-child,
.legend-title {
  color: var(--mute);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.memory-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 37px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--raised);
}

.memory-search-wrap .i {
  width: 15px;
  height: 15px;
  color: var(--faint);
}

.memory-search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.memory-field select {
  width: 100%;
  height: 37px;
  padding: 0 9px;
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--raised);
  font-size: 12px;
  outline: 0;
}

.memory-search-wrap:focus-within,
.memory-field select:focus {
  border-color: var(--accent);
}

.memory-legend,
.memory-help {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.memory-legend > span:not(.legend-title) {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mute);
  font-size: 11.5px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot.note { background: var(--accent); }
.legend-dot.memory { background: #22c55e; }
.legend-dot.concept { background: #f97316; }
.legend-line { width: 15px; height: 2px; }
.legend-line.wiki { background: rgba(124, 156, 255, .8); }
.legend-line.tag { background: rgba(249, 115, 22, .62); }
.legend-line.memory { background: rgba(34, 197, 94, .72); }

.memory-help b {
  color: var(--text);
  font-size: 11.5px;
}

.memory-help span {
  color: var(--faint);
  font-size: 10.5px;
}

.memory-node-index {
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.memory-index-head {
  display: flex;
  justify-content: space-between;
  color: var(--mute);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.memory-node-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  max-height: 190px;
  overflow-y: auto;
}

.memory-node-item {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  color: var(--mute);
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 11px;
}

.memory-node-item:hover {
  color: var(--text);
  background: var(--raised);
}

.memory-node-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.memory-node-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-node-item b {
  color: var(--faint);
  font-size: 10px;
}

.memory-canvas-wrap {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(91, 140, 255, .075), transparent 48%),
    radial-gradient(rgba(140, 165, 220, .1) .75px, transparent .75px);
  background-size: auto, 18px 18px;
}

#memoryGraphCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#memoryGraphCanvas.dragging-node { cursor: grabbing; }

.memory-canvas-toolbar {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(12, 18, 32, .88);
  backdrop-filter: blur(10px);
}

.memory-canvas-toolbar button {
  min-width: 29px;
  height: 29px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  color: var(--mute);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.memory-canvas-toolbar button:hover {
  color: #fff;
  background: var(--raised);
}

.memory-loading,
.memory-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 320px;
  padding: 11px 15px;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 18, 32, .9);
  font-size: 11.5px;
  text-align: center;
}

.memory-detail-empty {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--faint);
  text-align: center;
}

.memory-detail-empty .i {
  width: 31px;
  height: 31px;
  color: var(--accent);
  opacity: .7;
}

.memory-detail-empty b { color: var(--text); font-size: 13px; }
.memory-detail-empty span { font-size: 11px; }

.memory-detail-kind {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
}

.memory-detail h2 {
  color: #fff;
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.memory-detail > code {
  display: block;
  margin-top: 7px;
  color: var(--faint);
  font: 10.5px/1.4 var(--mono);
  overflow-wrap: anywhere;
}

.memory-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 13px 0;
}

.memory-detail-meta span {
  padding: 4px 7px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--raised);
  font-size: 9.5px;
}

.memory-detail-meta b { color: var(--text); }

.memory-detail > p {
  color: var(--mute);
  font-size: 11.5px;
  line-height: 1.6;
}

.memory-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.memory-detail-tags span {
  padding: 3px 7px;
  color: #fca66b;
  border-radius: 999px;
  background: rgba(249, 115, 22, .1);
  font-size: 9.5px;
}

.memory-detail h3 {
  margin: 18px 0 8px;
  color: var(--mute);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.memory-detail-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.memory-detail-links button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px;
  color: var(--mute);
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 10.5px;
}

.memory-detail-links button:hover {
  color: #fff;
  background: var(--raised);
}

.memory-detail-links i {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
}

.memory-no-links {
  color: var(--faint);
  font-size: 10.5px;
}

/* Rencana runtime tampil di bubble dan terus diperbarui oleh plan tool. */
.plan-card {
  margin: 8px 0 10px;
  overflow: hidden;
  border: 1px solid rgba(91, 140, 255, .22);
  border-radius: 10px;
  background: rgba(91, 140, 255, .055);
}

.plan-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.plan-card-head .i { width: 14px; height: 14px; color: var(--accent); }
.plan-card-summary { margin-left: auto; color: var(--faint); font-size: 9.5px; }
.plan-card-list { display: flex; flex-direction: column; padding: 5px; }

.checkpoint-card {
  margin: 8px 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.checkpoint-head { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.checkpoint-head .i { width: 14px; height: 14px; color: var(--accent); }
.checkpoint-paths {
  margin: 7px 0;
  white-space: pre-wrap;
  color: var(--faint);
  font: 9.5px/1.5 var(--mono);
}
.checkpoint-undo {
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 7px;
  padding: 5px 9px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}
.checkpoint-undo:disabled { opacity: .65; cursor: default; }
.checkpoint-card.is-undone { opacity: .7; }

.plan-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px;
  padding: 5px 6px;
  color: var(--mute);
  border-radius: 6px;
  font-size: 10.5px;
}

.plan-step.in_progress { color: #fff; background: rgba(91, 140, 255, .1); }
.plan-step.completed { color: var(--faint); }
.plan-step.completed .plan-step-text { text-decoration: line-through; }
.plan-step-marker { color: var(--accent); font-weight: 800; text-align: center; }
.plan-step.completed .plan-step-marker { color: var(--ok); }

@media (max-width: 1120px) {
  .memory-shell { grid-template-columns: 210px minmax(320px, 1fr); }
  .memory-detail { display: none; }
}

@media (max-width: 760px) {
  .top { flex-wrap: wrap; }
  .nav-views { order: 3; width: 100%; overflow-x: auto; }
  .nav-btn { flex: 1 0 auto; justify-content: center; }
  .main-memory { padding: 8px 12px 14px; overflow-y: auto; }
  .memory-head { flex-direction: column; }
  .memory-stats { grid-template-columns: repeat(2, 1fr); }
  .memory-shell { min-height: 680px; grid-template-columns: 1fr; grid-template-rows: auto minmax(430px, 1fr); overflow: visible; }
  .memory-controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .memory-help, .memory-node-index { display: none; }
  .memory-canvas-wrap { min-height: 430px; }
}

/* Steering Bar & Background Tasks Panel (Fase 2 Runtime) */
.steering-bar {
  display: none !important;
}
.tasks-panel {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 0;
}
.tasks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.tasks-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
}
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-item {
  background: rgba(6, 20, 32, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}
.task-item:hover {
  border-color: rgba(77, 225, 255, 0.4);
}
.task-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.task-tool {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.task-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--mono);
}
.task-badge.status-completed {
  background: rgba(93, 255, 176, 0.15);
  color: var(--ok);
  border: 1px solid rgba(93, 255, 176, 0.3);
}
.task-badge.status-running {
  background: rgba(77, 225, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(77, 225, 255, 0.3);
}
.task-badge.status-queued {
  background: rgba(255, 184, 77, 0.15);
  color: var(--warn);
  border: 1px solid rgba(255, 184, 77, 0.3);
}
.task-badge.status-cancelled, .task-badge.status-lost, .task-badge.status-failed {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger, #ff6b6b);
  border: 1px solid rgba(255, 107, 107, 0.3);
}
.task-item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--mute);
}
.task-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.task-result-preview {
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--mono);
  color: var(--text);
  max-height: 100px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.task-item-foot {
  display: flex;
  justify-content: flex-end;
}

/* =====================================================================
   HERMES-STYLE COMPREHENSIVE SETTINGS DASHBOARD
   ===================================================================== */
.hermes-settings-box {
  max-width: 940px;
  width: 95%;
  height: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #0d1527;
  color: #e2e8f0;
  border: 1px solid rgba(140, 165, 220, 0.25);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.hermes-settings-box .modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(140, 165, 220, 0.15);
  background: rgba(13, 21, 39, 0.95);
}

.hermes-settings-box .modal-head b {
  font-size: 16.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.hermes-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.38);
  margin-left: 10px;
  letter-spacing: 0.02em;
}

.hermes-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  background: #0a0f1d;
}

.hermes-nav {
  width: 230px;
  border-right: 1px solid rgba(140, 165, 220, 0.14);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px;
  background: rgba(10, 15, 29, 0.85);
  flex-shrink: 0;
  overflow-y: auto;
}

.hermes-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.hermes-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.hermes-tab.active {
  background: rgba(91, 140, 255, 0.14);
  border-color: rgba(91, 140, 255, 0.35);
  color: #ffffff;
  font-weight: 600;
}

.hermes-tab svg.i {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: #94a3b8;
}

.hermes-tab:hover svg.i {
  color: #e2e8f0;
}

.hermes-tab.active svg.i {
  color: #60a5fa;
}

.hermes-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 24px 28px;
  background: #0a0f1d;
}

.hermes-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hermes-panel[hidden] {
  display: none !important;
}

.hermes-sec-header {
  margin-bottom: 2px;
}

.hermes-sec-title {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}

.hermes-sec-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
}

.hermes-card {
  background: #111a2e;
  border: 1px solid rgba(140, 165, 220, 0.18);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.hermes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
}

.hermes-row:not(:last-child) {
  border-bottom: 1px solid rgba(140, 165, 220, 0.12);
}

.hermes-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.hermes-row-title {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.01em;
}

.hermes-row-desc {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.45;
}

.hermes-input, .hermes-select {
  background: #19243b;
  color: #f8fafc;
  border: 1px solid rgba(140, 165, 220, 0.28);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all 0.15s ease;
}

.hermes-input::placeholder {
  color: #64748b;
}

.hermes-select option {
  background: #151e32;
  color: #f8fafc;
  padding: 6px 10px;
}

.hermes-input:focus, .hermes-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
  background: #1c2a47;
}

.hermes-card button.pill {
  background: rgba(91, 140, 255, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(91, 140, 255, 0.4);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hermes-card button.pill:hover {
  background: rgba(91, 140, 255, 0.32);
  color: #ffffff;
  border-color: rgba(91, 140, 255, 0.65);
}

.hermes-card button.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border: 1px solid rgba(140, 165, 220, 0.22);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hermes-card button.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.hermes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 6px;
}

.hermes-table th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(10, 15, 29, 0.7);
  color: #94a3b8;
  font-weight: 600;
  border-bottom: 1px solid rgba(140, 165, 220, 0.2);
}

.hermes-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(140, 165, 220, 0.12);
  color: #f1f5f9;
}

.hermes-guard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

@media (max-width: 680px) {
  .hermes-layout {
    flex-direction: column;
  }
  .hermes-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(140, 165, 220, 0.15);
  }
  .hermes-tab {
    white-space: nowrap;
  }
}

/* =====================================================================
   HALAMAN CHECKPOINT & TIME-TRAVEL WORKSPACE (VIEW 4)
   ===================================================================== */
.main-checkpoints {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 24px 24px;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
}

.cp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.cp-kicker {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.cp-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.cp-subtitle {
  font-size: 13.5px;
  color: var(--mute);
  margin-top: 4px;
  max-width: 780px;
  line-height: 1.5;
}

.cp-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Statistik Grid */
.cp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.cp-stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cp-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cp-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.cp-stat-card.status-good .cp-stat-val {
  color: var(--ok);
}

.cp-stat-hint {
  font-size: 12px;
  color: var(--faint);
}

/* Toolbar Pencarian & Filter */
.cp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Feed Daftar Checkpoint */
.cp-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 200px;
}

.cp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 16px;
  background: var(--panel);
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  color: var(--mute);
  text-align: center;
}

.cp-empty-state .i {
  width: 32px;
  height: 32px;
  color: var(--faint);
}

.cp-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}

.cp-card:hover {
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.cp-card.is-undone {
  opacity: 0.7;
  border-style: dashed;
  background: rgba(17, 26, 44, 0.6);
}

.cp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cp-card-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cp-card-id {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--mono);
}

.cp-card-time {
  font-size: 12px;
  color: var(--faint);
}

.cp-card-run {
  font-size: 12px;
  color: var(--mute);
  background: var(--raised);
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-family: var(--mono);
}

.cp-badge-changes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(91, 140, 255, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(91, 140, 255, 0.35);
}

.cp-badge-undone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* File changes list */
.cp-files-box {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.cp-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  word-break: break-all;
}

.cp-tag-kind {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  flex: none;
}

.cp-tag-kind.created {
  background: rgba(61, 220, 151, 0.18);
  color: #3ddc97;
  border: 1px solid rgba(61, 220, 151, 0.4);
}

.cp-tag-kind.modified {
  background: rgba(91, 140, 255, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(91, 140, 255, 0.4);
}

.cp-tag-kind.deleted {
  background: rgba(255, 123, 123, 0.18);
  color: #ff9898;
  border: 1px solid rgba(255, 123, 123, 0.4);
}

.cp-file-path {
  color: #e2e8f0;
}

/* Card Actions */
.cp-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.cp-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =====================================================================
   FLOATING COMPANION LAUNCHER BUTTONS (NAV, CHAT-HEAD, FAB)
   ===================================================================== */
.nav-btn-floating {
  background: rgba(59, 130, 246, 0.14) !important;
  border: 1px solid rgba(96, 165, 250, 0.45) !important;
  color: #bfdbfe !important;
  font-weight: 600 !important;
  flex-shrink: 0;
}

.nav-btn-floating:hover {
  background: rgba(59, 130, 246, 0.28) !important;
  border-color: rgba(147, 197, 253, 0.8) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.35);
}

.badge-pop {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: #3b82f6;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.btn-popout-companion {
  background: rgba(59, 130, 246, 0.12) !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  color: #93c5fd !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 10px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.btn-popout-companion:hover {
  background: rgba(59, 130, 246, 0.25) !important;
  border-color: rgba(147, 197, 253, 0.75) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.hint-floating-link {
  color: #60a5fa !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.25);
  transition: all 0.15s ease;
}

.hint-floating-link:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(96, 165, 250, 0.6);
  color: #ffffff !important;
}

/* Skill Store (skills.js) */
.skill-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.skill-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.skill-tab { background: transparent; border: 1px solid rgba(255,255,255,0.18); color: inherit; padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 12px; }
.skill-tab.is-active { border-color: #6ee7ff; color: #6ee7ff; }
.skill-freeze { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.skill-form { display: grid; gap: 6px; margin-bottom: 12px; }
.skill-form-title { font-size: 12px; opacity: 0.75; }
.skill-input { width: 100%; box-sizing: border-box; padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.18); background: rgba(0,0,0,0.25); color: inherit; font-size: 12px; }
.skill-textarea { min-height: 64px; resize: vertical; }
.skill-rows { display: grid; gap: 6px; }
.skill-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,0.04); }
.skill-info { min-width: 0; }
.skill-name { font-size: 13px; }
.skill-desc { font-size: 11px; opacity: 0.7; overflow: hidden; text-overflow: ellipsis; }
.skill-actions { display: flex; gap: 6px; flex-shrink: 0; }
.skill-action { background: rgba(110,231,255,0.12); border: 1px solid rgba(110,231,255,0.35); color: inherit; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.skill-action:disabled { opacity: 0.5; cursor: default; }
.skill-submit { margin-top: 4px; }
.skill-empty { font-size: 12px; opacity: 0.7; }

/* =====================================================================
   ARSITEKTUR KOGNITIF 9-FASE (VIEW 5 & WIDGET PRESENCE & INNER WORKSPACE)
   ===================================================================== */


.cog-badge-mode {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(136, 150, 180, 0.15);
  color: var(--mute);
  border: 1px solid var(--line);
}

.cog-badge-mode.idle {
  color: var(--mute);
  background: rgba(136, 150, 180, 0.12);
}

.cog-badge-mode.reasoning {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
}

.cog-badge-mode.acting {
  color: var(--ok);
  background: rgba(61, 220, 151, 0.16);
  border-color: rgba(61, 220, 151, 0.35);
}

.cog-badge-mode.evaluating,
.cog-badge-mode.reflecting {
  color: var(--warn);
  background: rgba(245, 185, 66, 0.16);
  border-color: rgba(245, 185, 66, 0.35);
}


.cog-unc-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.cog-unc-bar {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* 2. Quick Inner Workspace Tab Panel (Inside Chat Head) */
.cognition-quick-panel {
  padding: 16px 20px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cog-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
  flex-wrap: wrap;
}

.cog-quick-title {
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.cog-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.cog-quick-tile {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cog-tile-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.cog-tile-body {
  font-size: 12.5px;
  color: var(--text);
  word-break: break-word;
}

/* 3. Main Cognition View (#viewCognition) */
.main-cognition {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 12px 24px 32px;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
}

.cog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.cog-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cog-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cog-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.cog-badge-accent {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(91, 140, 255, 0.35);
  font-family: var(--mono);
}

.cog-subtitle {
  font-size: 13.5px;
  color: var(--mute);
  margin-top: 4px;
  max-width: 840px;
  line-height: 1.5;
}

.cog-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* KPI Executive Cards */
.cog-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.cog-stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cog-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cog-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--mono);
}

.cog-stat-sub {
  font-size: 12px;
  color: var(--faint);
}

/* Sub-Navigation Tabs */
.cog-tabs-bar {
  border-bottom: 1px solid var(--line);
  margin-top: 2px;
}

.cog-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.cog-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cog-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.cog-tab-btn.active {
  color: var(--accent);
  background: var(--raised);
  border-color: var(--line-2);
}

/* Cognition Panels & Content Containers */
.cog-container {
  min-height: 320px;
}

.cog-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cog-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cog-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cog-sec-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.cog-sec-desc {
  font-size: 12.5px;
  color: var(--mute);
}

/* Grids */
.cog-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.cog-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

/* Cards & Tables */
.cog-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.cog-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cog-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.cog-table th {
  background: var(--raised);
  color: var(--mute);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--line);
}

.cog-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.cog-table tr:last-child td {
  border-bottom: none;
}

/* Status Badges / Tags */
.cog-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
}

.cog-tag-ok {
  background: rgba(61, 220, 151, 0.12);
  color: var(--ok);
  border: 1px solid rgba(61, 220, 151, 0.3);
}

.cog-tag-warn {
  background: rgba(245, 185, 66, 0.12);
  color: var(--warn);
  border: 1px solid rgba(245, 185, 66, 0.3);
}

.cog-tag-danger {
  background: rgba(255, 123, 123, 0.12);
  color: var(--err);
  border: 1px solid rgba(255, 123, 123, 0.3);
}

.cog-tag-accent {
  background: rgba(91, 140, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(91, 140, 255, 0.3);
}

/* Evaluation Matrix & Reports */
.cog-eval-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.cog-eval-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cog-eval-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cog-eval-cat {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.cog-eval-diff-badge {
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--mono);
  padding: 2px 6px;
  border-radius: 4px;
}

.cog-diff-pos {
  color: var(--ok);
  background: rgba(61, 220, 151, 0.14);
}

.cog-diff-neu {
  color: var(--mute);
  background: rgba(136, 150, 180, 0.14);
}

.cog-report-markdown {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 12.5px;
  font-family: var(--mono);
  line-height: 1.6;
  color: var(--text);
  max-height: 480px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Helper Layouts & Sub-components in View Cognition */
.cog-kpi-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cog-kpi-sub {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--faint);
}

.cog-kpi-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--mute);
}

.cog-kpi-status-pill.status-good {
  color: var(--ok);
  background: rgba(61, 220, 151, 0.12);
  border: 1px solid rgba(61, 220, 151, 0.3);
}

.cog-stat-hint {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 2px;
}

.cog-toolbar {
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.cog-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cog-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.cog-col-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cog-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cog-card-desc {
  font-size: 12.5px;
  color: var(--mute);
  margin-top: -4px;
  margin-bottom: 4px;
  line-height: 1.45;
}

.count-pill {
  font-size: 11px;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--mute);
  border: 1px solid var(--line);
}

.count-pill.status-good {
  color: var(--ok);
  border-color: rgba(61, 220, 151, 0.35);
  background: rgba(61, 220, 151, 0.1);
}

.cog-dim-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cog-dim-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--raised);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.cog-dim-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  min-width: 140px;
  letter-spacing: 0.02em;
}

.cog-dim-val {
  font-size: 12.5px;
  color: var(--text);
  flex: 1;
  word-break: break-word;
  font-family: var(--mono);
}

/* Isi batin: kalimat orang pertama dari tension yang menyala */
.vol-qualia-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--mute);
}

.vol-qualia-session {
  font-family: var(--mono);
  opacity: 0.8;
}

.vol-qualia-intensity {
  font-family: var(--mono);
  color: var(--faint);
}

.vol-qualia-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

/* Matriks ketegangan: intensitas sebagai bar fisik */
.vol-matrix-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 12px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.vol-matrix-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vol-matrix-band {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--mute);
}

.vol-matrix-band.band-kritis {
  color: #ff8f8f;
  border-color: rgba(255, 92, 92, 0.45);
  background: rgba(255, 92, 92, 0.12);
}

.vol-matrix-band.band-tinggi {
  color: #ffc078;
  border-color: rgba(255, 165, 64, 0.4);
  background: rgba(255, 165, 64, 0.1);
}

.vol-matrix-band.band-sedang {
  color: #ffe08a;
  border-color: rgba(255, 214, 102, 0.35);
  background: rgba(255, 214, 102, 0.08);
}

.vol-matrix-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.vol-matrix-title {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.vol-matrix-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.vol-matrix-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 165, 64, 0.75), rgba(255, 92, 92, 0.95));
}

.cog-items-scroll {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cog-items-scroll.compact {
  max-height: 160px;
}

.cog-item-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cog-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cog-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.cog-item-meta {
  font-size: 11px;
  color: var(--faint);
  font-family: var(--mono);
}

.cog-item-body {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.4;
}

.cog-sub-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cog-sub-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cog-belief-chips,
.cog-benchmark-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cog-belief-chip,
.cog-cat-chip {
  font-size: 11px;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
}

.cog-react-cycle-view {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 14px;
  background: var(--raised);
  border-radius: 8px;
  border: 1px solid var(--line);
  flex-wrap: wrap;
}

.react-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.react-step .r-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  transition: all 0.2s ease;
}

.react-step.active {
  color: var(--accent);
}

.react-step.active .r-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.cog-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 2px solid var(--line-2);
  padding-left: 16px;
  margin-left: 8px;
}

.cog-timeline-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
}

.cog-timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(91, 140, 255, 0.5);
}

.cog-timeline-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.cog-timeline-time {
  font-size: 11px;
  color: var(--faint);
  font-family: var(--mono);
}

.cog-timeline-desc {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.4;
}

.cog-eval-intro-box {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--mute);
}

.cog-eval-intro-box ul {
  margin-top: 8px;
  padding-left: 20px;
}

.cog-eval-intro-box li {
  margin-bottom: 4px;
}

.empty-cell {
  text-align: center;
  color: var(--faint);
  padding: 20px !important;
}

@media (max-width: 860px) {
  .cog-grid-2,
  .cog-grid-3,
  .cog-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   7. SUBCONSCIOUS STREAM & COGNITIVE CORTEX PANEL (#cogPanel-subconscious)
   ========================================================================== */

.subcon-header-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.subcon-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subcon-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.subcon-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.subcon-desc {
  font-size: 12.5px;
  color: var(--mute);
  line-height: 1.45;
  max-width: 780px;
}

.subcon-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: 0.05em;
  background: rgba(61, 220, 151, 0.12);
  color: var(--ok);
  border: 1px solid rgba(61, 220, 151, 0.35);
  transition: all 0.2s ease;
}

.subcon-live-pill.skipped {
  background: rgba(136, 150, 180, 0.12);
  color: var(--mute);
  border-color: var(--line);
}

.subcon-live-pill .pulse-dot {
  width: 7px;
  height: 7px;
}

.subcon-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.subcon-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: var(--mute);
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}

.subcon-filter-toggle:hover {
  border-color: var(--line-2);
  color: var(--text);
}

.subcon-filter-toggle input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

/* Drive gauges container */
.subcon-gauge-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.subcon-gauge-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}

.subcon-gauge-card.gauge-zeigarnik::before {
  background: linear-gradient(90deg, #f5b942, #ff7b7b);
}

.subcon-gauge-card.gauge-epistemic::before {
  background: linear-gradient(90deg, #5b8cff, #3ddc97);
}

.subcon-gauge-card.gauge-coherence::before {
  background: linear-gradient(90deg, #a78bfa, #818cf8);
}

.subcon-gauge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subcon-gauge-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subcon-gauge-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.subcon-gauge-value {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--mono);
  color: #ffffff;
  line-height: 1;
}

.subcon-gauge-track-wrap {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 2px;
}

.subcon-gauge-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease, background-color 0.4s ease;
}

.subcon-gauge-fill.fill-zeigarnik {
  background: linear-gradient(90deg, #f5b942, #ff7b7b);
}

.subcon-gauge-fill.fill-epistemic {
  background: linear-gradient(90deg, #38bdf8, #5b8cff);
}

.subcon-gauge-fill.fill-coherence {
  background: linear-gradient(90deg, #a78bfa, #818cf8);
}

.subcon-gauge-threshold-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.6);
  z-index: 2;
}

.subcon-gauge-meta {
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.4;
  margin-top: 2px;
}

/* Spotlight Cards */
.subcon-spotlight-box {
  background: var(--raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subcon-spotlight-box.box-gap {
  border-left-color: var(--warn);
}

.subcon-spotlight-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mute);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subcon-spotlight-text {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.45;
  word-break: break-word;
}

.subcon-spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--mute);
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* Timeline Feed */
.subcon-feed-container {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.subcon-entry-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s ease;
}

.subcon-entry-card:hover {
  border-color: var(--line-2);
  background: rgba(23, 34, 56, 0.95);
}

.subcon-entry-card.skipped {
  border-left-color: var(--faint);
  opacity: 0.75;
}

.subcon-entry-card.skipped:hover {
  opacity: 1;
}

.subcon-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.subcon-entry-time {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 6px;
}

.subcon-entry-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.subcon-entry-context {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subcon-entry-mutations {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 4px;
}

.subcon-mutation-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.subcon-mutation-bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.subcon-mutation-bullet.bullet-mem {
  background: #38bdf8;
}

.subcon-mutation-bullet.bullet-calib {
  background: #3ddc97;
}

.subcon-mutation-bullet.bullet-bio {
  background: #a78bfa;
}

.subcon-empty-notice {
  padding: 32px 16px;
  text-align: center;
  color: var(--mute);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   VIEW 6: AUTOMATIONS & JADWAL SISTEM (#viewAutomations)
   ========================================================================== */

.main-automations {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 28px 40px;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
  overscroll-behavior: contain;
}

/* Anak flex dilarang menyusut. Dengan flex-shrink bawaan (1), panel setinggi
   Riwayat Sesi terkompresi mengikuti tinggi induk lalu isinya dipotong oleh
   overflow:hidden internalnya, sehingga area scroll tidak pernah terbentuk. */
.main-automations > * {
  flex: 0 0 auto;
}

.auto-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.auto-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auto-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.auto-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.auto-subtitle {
  font-size: 13.5px;
  color: var(--mute);
  margin-top: 2px;
  max-width: 820px;
  line-height: 1.5;
}

.auto-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* KPI Stats Grid */
.auto-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.auto-stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.auto-stat-card:hover {
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.auto-stat-card.has-alert {
  border-color: rgba(255, 123, 123, 0.4);
  background: linear-gradient(180deg, var(--panel) 0%, rgba(255, 123, 123, 0.05) 100%);
}

.auto-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mute);
}

.auto-kpi-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.auto-kpi-val {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
  line-height: 1;
}

.auto-kpi-sub {
  font-size: 12px;
  color: var(--faint);
}

.auto-stat-hint {
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.4;
}

.auto-kpi-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.badge-ok,
.badge-success {
  background: rgba(61, 220, 151, 0.15);
  color: var(--ok);
  border: 1px solid rgba(61, 220, 151, 0.3);
}

.badge-warn {
  background: rgba(245, 185, 66, 0.15);
  color: var(--warn);
  border: 1px solid rgba(245, 185, 66, 0.3);
}

.badge-danger {
  background: rgba(255, 123, 123, 0.15);
  color: var(--err);
  border: 1px solid rgba(255, 123, 123, 0.3);
}

.badge-disabled,
.badge-mute {
  background: rgba(136, 150, 180, 0.12);
  color: var(--mute);
  border: 1px solid rgba(136, 150, 180, 0.2);
}

/* Filter & Search Bar */
.auto-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.auto-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

.auto-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}

.auto-search-inp {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auto-search-inp:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auto-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auto-chip {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--mute);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auto-chip:hover {
  color: var(--text);
  border-color: var(--line-2);
}

.auto-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(91, 140, 255, 0.4);
  font-weight: 600;
}

/* Job Cards List */
.auto-job-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auto-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.auto-card:hover {
  border-color: rgba(91, 140, 255, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.auto-card.is-disabled {
  opacity: 0.65;
  border-style: dashed;
}

.auto-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.auto-card-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.auto-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auto-card-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.auto-pill-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: capitalize;
}

.auto-card-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--mute);
}

.auto-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--raised);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.auto-meta-target {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

.auto-card-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.15s ease, color 0.15s ease;
}

.auto-card-id:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.auto-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-card-body {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.auto-card-payload b {
  color: var(--accent);
  font-weight: 600;
  margin-right: 4px;
}

.auto-card-payload code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ok);
}

.auto-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
  font-size: 12px;
  color: var(--mute);
}

.auto-foot-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auto-foot-label {
  color: var(--faint);
}

.auto-foot-val {
  color: var(--text);
  font-weight: 500;
}

.auto-foot-badge {
  font-size: 11px;
  font-weight: 600;
}

/* Empty State */
.auto-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--line-2);
  border-radius: 12px;
}

.auto-empty-icon {
  width: 48px;
  height: 48px;
  color: var(--faint);
  margin-bottom: 14px;
  opacity: 0.6;
}

.auto-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.auto-empty-desc {
  font-size: 13.5px;
  color: var(--mute);
  max-width: 420px;
  line-height: 1.5;
  margin-bottom: 18px;
}

/* Run History Drawer / Modal */
.auto-run-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.auto-run-item {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auto-run-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auto-run-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-run-time {
  font-size: 12px;
  color: var(--mute);
}

.auto-run-dur {
  font-size: 11.5px;
  font-family: var(--mono);
  color: var(--faint);
}

.auto-run-error {
  font-size: 12.5px;
  color: var(--err);
  background: rgba(255, 123, 123, 0.08);
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 3px solid var(--err);
}

.auto-run-output pre {
  font-family: var(--mono);
  font-size: 11.5px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 140px;
  overflow-y: auto;
  color: var(--text);
}

.auto-drawer-loading,
.auto-drawer-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 16px;
  color: var(--mute);
  font-size: 13.5px;
}

.i-sm {
  width: 14px;
  height: 14px;
  vertical-align: middle;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
/* AIRA density fix 2026-10-02: nyaman di 100 persen */
html { font-size: 14px; }
body { font-size: 13.5px; line-height: 1.5; }
.app { min-height: 520px; }
.top { padding: 8px 16px 4px; gap: 6px; }
.brand b { font-size: 16px; }
.pill { height: 30px; padding: 0 12px; font-size: 12.5px; gap: 6px; }
.nav-views { transform: scale(0.92); transform-origin: left center; }
.nav-btn { height: 28px; padding: 0 10px; font-size: 12px; }
.main { padding: 6px 10px 10px 16px; gap: 8px; }
.foot { padding: 4px 16px 8px; font-size: 11px; }
.main-sessions { gap: 12px; padding: 8px 16px 16px; }
.sess-title { font-size: 17px; }
.sess-subtitle { font-size: 12px; margin-top: 2px; }
.sess-grid { gap: 12px; }
.sess-card { padding: 12px 14px; gap: 10px; border-radius: 12px; }
.sess-card-title { font-size: 14px; }
.info-block { padding: 8px 10px; gap: 2px; border-radius: 8px; }
.info-label { font-size: 10.5px; }
.info-value { font-size: 12.5px; }
.pill-btn { min-height: 32px; padding: 0 14px; font-size: 12.5px; gap: 6px; }
.search-box { height: 32px; }
.search-box input { font-size: 12.5px; }
.filter-chips .chip { height: 28px; font-size: 12px; }
.sess-item-card { padding: 10px 12px; gap: 6px; }
.sess-item-topic { font-size: 13px; }
.form-input { height: 34px; font-size: 12.5px; }
.pending-text { font-size: 12.5px; }
@media (max-height: 800px) {
  .sess-items-list { max-height: 380px; }
  .pending-list { max-height: 320px; }
}
@media (max-width: 1100px) {
  .sess-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   DROPDOWN NAVBAR & TOKEN ANALYTICS VIEW
   ===================================================================== */

/* 1. Nav Page Dropdown */
.nav-page-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-dropdown-btn:hover {
  border-color: rgba(91, 140, 255, 0.45);
  background: rgba(91, 140, 255, 0.08);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 140, 255, 0.2);
}

.nav-dropdown-btn[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #fff;
}

.nav-dropdown-btn .nav-active-icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-dropdown-btn:hover .nav-active-icon {
  transform: scale(1.1);
}

.nav-dropdown-btn .nav-chevron {
  width: 13px;
  height: 13px;
  color: var(--mute);
  transition: transform 0.2s ease;
}

.nav-dropdown-btn[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.nav-active-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.nav-page-menu {
  min-width: 320px;
  padding: 8px;
  background: rgba(18, 26, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(91, 140, 255, 0.22);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: navMenuAppear 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes navMenuAppear {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-page-menu .menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-page-menu .menu-item:hover {
  background: rgba(91, 140, 255, 0.12);
  border-color: rgba(91, 140, 255, 0.2);
  color: #fff;
  transform: translateX(2px);
}

.nav-page-menu .menu-item.active {
  background: rgba(91, 140, 255, 0.18);
  border-color: rgba(91, 140, 255, 0.35);
  color: #fff;
}

.nav-page-menu .menu-item.active::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.nav-page-menu .menu-item .i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-page-menu .menu-item span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-page-menu .menu-item small {
  font-size: 11px;
  color: var(--mute);
  font-weight: 400;
  line-height: 1.3;
}

.nav-page-menu .menu-item:hover small {
  color: #cbd5e1;
}

/* 2. Main Tokens View */
.main-tokens {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 24px 40px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(11,17,33,0.95) 0%, rgba(8,13,26,0.98) 100%);
}

.tokens-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tokens-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.tokens-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.tokens-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--mute);
  line-height: 1.5;
  max-width: 760px;
}

.tokens-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Live Context Window Banner */
.tokens-live-banner {
  background: linear-gradient(135deg, rgba(38, 58, 100, 0.98) 0%, rgba(22, 34, 68, 0.98) 100%);
  border: 1px solid rgba(91, 140, 255, 0.55);
  border-radius: 14px;
  padding: 16px 20px 18px;
  box-shadow: 0 2px 0 rgba(91,140,255,0.22) inset, 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(91,140,255,0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
  margin-bottom: 4px;
  z-index: 2;
}

.tokens-live-banner::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14px;
  right: 14px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #a78bfa 50%, var(--ok) 100%);
  opacity: 1;
}

.tokens-banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 26px;
  line-height: 1.45;
}

.tokens-banner-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
  color: #fff;
  min-width: 0;
  flex: 1 1 auto;
}

.tokens-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: tokenPulse 2s infinite ease-in-out;
}

@keyframes tokenPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.25); }
}

.tokens-banner-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.tokens-live-banner .meta-tag {
  color: #eef3ff;
  background: rgba(8, 14, 30, 0.95);
  border-color: rgba(140, 165, 220, 0.45);
  font-weight: 600;
  white-space: nowrap;
}

.tokens-live-banner .tokens-banner-title b {
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.tokens-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tokens-bar-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text);
}

.tokens-thresh-hint {
  font-size: 12px;
  color: var(--mute);
}

.tokens-progress-track {
  position: relative;
  height: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  border: 1px solid var(--line);
  overflow: visible;
}

.tokens-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6 0%, var(--accent) 60%, #a855f7 100%);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(91, 140, 255, 0.5);
}

.tokens-progress-fill.warn {
  background: linear-gradient(90deg, var(--accent) 0%, var(--warn) 100%);
  box-shadow: 0 0 14px rgba(245, 185, 66, 0.6);
}

.tokens-progress-fill.danger {
  background: linear-gradient(90deg, var(--warn) 0%, var(--err) 100%);
  box-shadow: 0 0 16px rgba(255, 107, 107, 0.7);
}

.tokens-progress-threshold {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  border-radius: 2px;
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
  z-index: 5;
}

.tokens-progress-threshold::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--warn);
}

.tokens-sub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tok-sub-item {
  font-size: 12px;
  color: var(--mute);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 18, 38, 0.65);
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(91, 140, 255, 0.10);
}

.tok-sub-item b {
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* KPI Cards Grid */
.tokens-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.tokens-kpi-card {
  background: linear-gradient(145deg, rgba(22, 33, 60, 0.95) 0%, rgba(15, 22, 45, 0.98) 100%);
  border: 1px solid rgba(91, 140, 255, 0.20);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 6px 24px rgba(0, 0, 0, 0.45);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tokens-kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91,140,255,0.35), transparent);
}

.tokens-kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(91, 140, 255, 0.45);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 14px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(91,140,255,0.08);
}

.tokens-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tokens-kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mute);
}

.tokens-kpi-icon {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.tokens-kpi-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 8px 0 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tokens-kpi-desc {
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.4;
  margin-bottom: 12px;
}

.tokens-kpi-breakdown {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
}

.tok-break-row {
  display: flex;
  justify-content: space-between;
  color: var(--mute);
}

.tok-break-row b {
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tokens-cache-bar-box {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tokens-cache-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.tokens-cache-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 100%);
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.tokens-cache-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--mute);
}

.dot-cached {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ok);
  margin-right: 4px;
}

.dot-fresh {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  margin-right: 4px;
}

.tok-note {
  font-size: 11px;
  color: var(--faint);
  margin-top: 6px;
}

.tokens-percentiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.tok-p-box {
  background: rgba(10, 18, 38, 0.65);
  border: 1px solid rgba(91, 140, 255, 0.12);
  border-radius: 8px;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tok-p-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--mute);
  text-transform: uppercase;
}

.tok-p-val {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.badge-status.badge-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.badge-warn {
  background: rgba(245, 185, 66, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 185, 66, 0.3);
}

.badge-status.badge-neutral {
  background: rgba(91, 140, 255, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(91, 140, 255, 0.3);
}

/* Detail Grid */
.tokens-details-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}

@media (max-width: 1024px) {
  .tokens-details-grid {
    grid-template-columns: 1fr;
  }
}

.tokens-panel {
  background: linear-gradient(145deg, rgba(22, 33, 60, 0.95) 0%, rgba(15, 22, 45, 0.98) 100%);
  border: 1px solid rgba(91, 140, 255, 0.18);
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 6px 28px rgba(0, 0, 0, 0.50);
  position: relative;
}

.tokens-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tokens-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.tokens-panel-sub {
  font-size: 12px;
  color: var(--mute);
}

.tokens-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tok-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  border-radius: 8px;
  background: rgba(10, 18, 38, 0.7);
  border: 1px solid rgba(91, 140, 255, 0.10);
}

.tok-s-label {
  font-size: 12px;
  color: var(--mute);
}

.tok-s-val {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Tables */
.tokens-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(91, 140, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.40);
}

.tokens-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.tokens-table th {
  background: rgba(8, 14, 30, 0.80);
  color: var(--mute);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(91,140,255,0.12);
  white-space: nowrap;
}

.tokens-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tokens-table tbody tr:hover td {
  background: rgba(91, 140, 255, 0.06);
  color: #fff;
}

.tokens-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tokens-empty {
  text-align: center !important;
  color: var(--faint);
  padding: 24px 12px !important;
}

.tokens-table-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tokens-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  height: 32px;
}

.tokens-search-box input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  outline: none;
  width: 170px;
}

.tokens-search-box input::placeholder {
  color: var(--faint);
}

.tokens-select {
  height: 32px;
  border-radius: 8px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  padding: 0 8px;
  outline: none;
  cursor: pointer;
}




/* =====================================================================
   RESPONSIF MOBILE & TABLET - Aira Mobile Polish
   ===================================================================== */

/* ---------- Tablet: navigasi & panel padat ---------- */
@media (max-width: 1024px) {
  .memory-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .main-memory {
    padding: 10px 16px 16px;
  }
  .auto-header,
  .tokens-panel {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ---------- HP Lanskap / Tablet kecil ---------- */
@media (max-width: 820px) {
  .memory-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tl {
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    row-gap: 2px;
  }
  .tl .tm,
  .tl .tt {
    text-align: right;
  }
  .tokens-panel-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tokens-search-box,
  .tokens-search-box input {
    width: 100%;
    min-width: 0;
  }
}

/* ---------- HP Portrait standar ---------- */
@media (max-width: 640px) {
  :root {
    --chat-width: 100%;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  .top {
    padding: 6px 8px 4px;
    gap: 5px;
    align-items: center;
    width: 100%;
    max-width: 100%;
  }

  .brand {
    gap: 6px;
    margin-right: auto;
    flex: none;
  }

  .brand b {
    font-size: 14.5px;
  }

  .logo {
    width: 18px;
    height: 18px;
  }

  .pill,
  .nav-dropdown-btn {
    height: 28px;
    padding: 0 8px;
    font-size: 11.5px;
    gap: 4px;
    max-width: 100%;
    min-width: 0;
  }

  .pill .txt,
  #modeTxt {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #btnPopoutFloating,
  #btnPopoutFloating.btn-popout-companion {
    display: none !important;
  }

  .top .ghost,
  .top .icon {
    height: 28px;
    font-size: 11.5px;
  }

  .top .ghost {
    padding: 0 8px;
  }

  .top .icon {
    width: 28px;
  }

  .chat-resizer,
  .chat-corner-resizer {
    display: none !important;
  }

  /* Presence HUD ringkas agar obrolan & composer selalu muat di atas lipatan */
  .presence {
    flex: none;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 14px;
    background: rgba(16, 22, 36, 0.72);
    border: 1px solid var(--line);
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .stage {
    flex: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 1px 0 3px !important;
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "orb say"
      "orb ws";
    align-items: center;
    column-gap: 9px;
    row-gap: 2px;
  }

  .stage #orb {
    grid-area: orb;
    position: relative !important;
    inset: auto !important;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
  }

  .stage .say {
    grid-area: say;
    position: static !important;
    inset: auto !important;
    text-align: left !important;
    padding: 0 !important;
    min-width: 0;
  }

  .stage .ws {
    grid-area: ws;
    position: static !important;
    inset: auto !important;
    justify-self: start;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 !important;
    font-size: 10px;
    padding: 2px 7px;
  }

  .stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .stat {
    min-width: 0;
    padding: 3px 5px;
  }

  .stat:first-child {
    grid-column: auto;
  }

  .stat .k {
    font-size: 9.5px;
  }

  .stat .v {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat .v small {
    font-size: 9.5px;
  }

  .stat .bar {
    margin-top: 2px;
    height: 3px;
  }

  .chat {
    flex: 1 1 0;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .chat > *,
  .panels,
  .panel,
  .thread {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .panels {
    flex: 1 1 0;
    min-height: 0;
  }

  .chat-head {
    flex: none;
    padding: 6px 8px;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
  }

  .chat-head .tabs {
    order: 1;
    width: 100%;
    min-width: 0;
    padding-right: 16px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 16px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 16px), transparent 100%);
  }

  .chat-head .sess-picker-dropdown {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
  }

  .chat-head .sess-picker-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 11px;
  }

  .chat-head .sp {
    display: none;
  }

  .chat-head #btnCompact,
  .chat-head #btnNew {
    order: 3;
    flex: none;
    padding: 0 7px;
    height: 26px;
    font-size: 11px;
    white-space: nowrap;
  }

  .chat-head #btnFloatChat {
    display: none;
  }

  .aira-brief-strip {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 5px 8px;
    gap: 5px;
  }

  .aira-brief-left {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
    overflow: hidden;
    gap: 6px;
    font-size: 11px;
  }

  .aira-brief-meta {
    min-width: 0;
    flex: 1 1 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .aira-brief-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .aira-brief-actions .pill-btn.small {
    height: 24px;
    padding: 0 9px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* Area gulir horizontal untuk tab yang banyak */
  .tabs,
  .chips,
  .tabbar,
  .segmented {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
  }
  .tabs::-webkit-scrollbar,
  .chips::-webkit-scrollbar,
  .tabbar::-webkit-scrollbar,
  .segmented::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: none;
    padding: 0 9px;
    height: 26px;
    font-size: 11px;
  }

  .composer,
  .input-bar {
    flex: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 5px 8px;
    gap: 5px;
    box-sizing: border-box;
  }

  .field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 5px 6px;
    gap: 4px;
    border-radius: 13px;
    box-sizing: border-box;
  }

  .field .icon,
  .field .send {
    width: 34px;
    height: 34px;
    flex: none;
  }

  .composer textarea,
  .field textarea,
  .input-bar textarea,
  .composer input[type="text"] {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: 100%;
    font-size: 16px; /* cegah auto-zoom iOS */
    min-height: 34px;
    padding: 5px 4px;
  }

  #hint {
    display: none;
  }

  .msg,
  .bubble,
  .say {
    max-width: 100%;
    font-size: 13.5px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .say b {
    font-size: 14.5px;
  }

  .say span {
    font-size: 11.5px;
  }

  pre,
  .code-wrap,
  .code-wrap pre,
  .code-wrap code {
    max-width: 100%;
    overflow-x: auto;
    font-size: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .memory-title {
    font-size: 20px;
  }

  .memory-head {
    flex-direction: column;
    gap: 10px;
  }

  .memory-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .main-automations,
  .main-memory,
  .cog,
  .tokens-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal,
  .modal-card,
  .dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88dvh;
    overflow-y: auto;
    border-radius: 14px;
  }

  .foot {
    border-top: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 10px 8px;
    font-size: 10.5px;
    opacity: 0.78;
  }

  .empty {
    margin: 24px auto;
    padding: 0 12px;
  }

  /* Sembunyikan elemen dekoratif yang memakan ruang */
  .foot .keys,
  .stage-hint {
    display: none;
  }
}

/* ---------- HP layar kecil (<=420px) ---------- */
@media (max-width: 420px) {
  .brand b {
    font-size: 14.5px;
  }
  .brand {
    gap: 6px;
  }
  /* Jangan pernah sembunyikan navigasi halaman (#btnNavDropdown) maupun pill mode di HP kecil */
  #btnNavDropdown.pill,
  #btnThinking.pill,
  #btnMode.pill {
    display: inline-flex;
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }
  #btnThinking.pill .txt,
  #btnMode #modeTxt,
  #btnMode.pill .txt {
    max-width: 58px;
  }
  #btnNavDropdown.pill .txt {
    max-width: 74px;
  }
  .top {
    padding: 5px 7px 3px;
    gap: 4px;
  }
  .chat-head {
    padding: 5px 7px;
  }
  .chat-head #btnCompact,
  .chat-head #btnNew {
    height: 26px;
    padding: 0 7px;
    font-size: 11px;
  }
  .tab {
    padding: 0 8px;
    font-size: 11px;
  }
  .msg,
  .bubble,
  .say {
    font-size: 13px;
  }
  .main-automations,
  .main-memory,
  .cog,
  .tokens-panel {
    padding-left: 8px;
    padding-right: 8px;
  }
  .memory-stats {
    grid-template-columns: 1fr;
  }
}

/* ---------- HP sangat pendek (landscape) ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .app {
    height: auto;
    min-height: 100dvh;
  }
  .stage {
    display: none;
  }
  .chat {
    height: 86dvh;
    min-height: 0;
  }
  .top {
    padding: 6px 12px 0;
  }
}

/* ---------- Sentuhan: target tap lebih lega ---------- */
@media (hover: none) and (pointer: coarse) {
  .tab,
  .ghost,
  .pill,
  .chip,
  button.btn,
  .icon-btn {
    min-height: 38px;
  }
  .list-row,
  .skill-row,
  .sess-row,
  .tl {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* ── Evaluation Center ───────────────────────────────────────────── */
.main-benchmarks { padding: 18px 22px 40px; overflow-y: auto; height: 100%; }
.bench-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.bench-head h2 { margin: 0; font-size: 20px; }
.bench-sub { margin: 4px 0 0; font-size: 12.5px; opacity: .72; }
.bench-status, .bench-runtime { font-size: 12.5px; padding: 7px 10px; border-radius: 8px; margin-bottom: 10px; border: 1px solid rgba(127,127,127,.28); }
.bench-status[data-kind="ok"] { border-color: rgba(64,180,120,.55); }
.bench-status[data-kind="error"] { border-color: rgba(220,80,80,.6); }
.bench-runtime[data-kind="warn"] { border-color: rgba(220,160,60,.6); }
.bench-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .bench-layout { grid-template-columns: 1fr; } }
.bench-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 12px; }
.bench-card { border: 1px solid rgba(127,127,127,.26); border-radius: 12px; padding: 12px; background: rgba(127,127,127,.05); display: flex; flex-direction: column; gap: 8px; }
.bench-card.is-dim { opacity: .55; }
.bench-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.bench-card-title { font-size: 14px; }
.bench-card-id { display: block; font-size: 11px; opacity: .6; font-family: ui-monospace, monospace; }
.bench-card-desc { margin: 0; font-size: 12.5px; opacity: .78; line-height: 1.45; }
.bench-card-meta { display: flex; gap: 12px; font-size: 11.5px; opacity: .75; flex-wrap: wrap; }
.bench-card-score { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bench-score-value { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.bench-delta { font-size: 12px; margin-left: 6px; font-weight: 600; }
.bench-delta.up { color: #3fbf7f; } .bench-delta.down { color: #e05b5b; } .bench-delta.flat { opacity: .6; }
.bench-spark { color: #5b9be0; opacity: .9; }
.bench-chart-wrap { color: #8aa0b8; padding: 4px 0; overflow-x: auto; }
.bench-chart { display: block; width: 100%; max-width: 100%; height: auto; }
.bench-chart text { font-family: ui-monospace, monospace; }
.bench-series-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.bench-ask { margin-top: 6px; font-size: 11.5px; }
.bench-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bench-chip { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; padding: 2px 7px; border-radius: 999px; border: 1px solid rgba(127,127,127,.4); }
.bench-chip-published { border-color: rgba(64,180,120,.6); }
.bench-chip-draft { border-color: rgba(220,160,60,.6); }
.bench-chip-failed { border-color: rgba(220,80,80,.6); }
.bench-detail { margin-top: 16px; border: 1px solid rgba(127,127,127,.26); border-radius: 12px; padding: 14px; }
.bench-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.bench-detail-score { text-align: right; }
.bench-detail-score small { display: block; font-size: 11px; opacity: .65; }
.bench-detail h4 { margin: 16px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }
.bench-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bench-table th, .bench-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(127,127,127,.18); }
.bench-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; opacity: .7; }
.bench-table .mono { font-family: ui-monospace, monospace; font-size: 11.5px; }
.bench-series-list { display: flex; flex-direction: column; gap: 8px; }
.bench-series { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.bench-series-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bench-series-count { opacity: .6; font-size: 11px; }
.bench-right { display: flex; flex-direction: column; gap: 12px; }
.bench-panel { border: 1px solid rgba(127,127,127,.26); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bench-panel h3 { margin: 0 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.bench-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; opacity: .9; }
.bench-panel input[type="text"], .bench-panel input[type="number"], .bench-panel textarea, .bench-panel select {
  width: 100%; padding: 6px 8px; border-radius: 7px; border: 1px solid rgba(127,127,127,.35);
  background: rgba(127,127,127,.08); color: inherit; font-size: 12.5px; font-family: inherit;
}
.bench-panel textarea { resize: vertical; font-family: ui-monospace, monospace; font-size: 11.5px; }
.bench-check { flex-direction: row !important; align-items: center; gap: 7px !important; }
.bench-hint { margin: 0 0 4px; font-size: 11.5px; opacity: .68; line-height: 1.4; }
.bench-case-rows { display: flex; flex-direction: column; gap: 8px; }
.bench-case-row { display: flex; flex-direction: column; gap: 5px; border: 1px dashed rgba(127,127,127,.32); border-radius: 8px; padding: 8px; }
.bench-case-line { display: flex; gap: 5px; }
.bench-case-line input { flex: 1; min-width: 0; }
.bench-case-del { padding: 2px 8px; line-height: 1; }
.bench-opt { margin: 0; padding: 8px; border-radius: 8px; background: rgba(127,127,127,.12); font-size: 11px; white-space: pre-wrap; max-height: 220px; overflow: auto; }
.bench-empty { padding: 18px; text-align: center; font-size: 12.5px; opacity: .62; border: 1px dashed rgba(127,127,127,.3); border-radius: 10px; }

/* ── User Management & RBAC Dashboard ────────────────────────────── */
.main-users {
  padding: 20px 24px 48px;
  overflow-y: auto;
  height: 100%;
}
.users-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.users-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.users-sub {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: .75;
}
.users-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.user-stat-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mute);
}
.user-stat-card .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}
.users-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1080px) {
  .users-layout {
    grid-template-columns: 1fr;
  }
}
.users-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.users-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.users-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text);
}
.users-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.users-table th, .users-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.users-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mute);
  background: rgba(0, 0, 0, 0.2);
}
.users-table tr:last-child td {
  border-bottom: none;
}
.users-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.user-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.user-names {
  display: flex;
  flex-direction: column;
}
.user-uname {
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
}
.user-dname {
  font-size: 11.5px;
  color: var(--mute);
}
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.role-badge.owner {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}
.role-badge.operator {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.role-badge.guest {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.35);
}
.btn-delete-user {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  transition: all .15s ease;
}
.btn-delete-user:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.45);
}
.btn-delete-user:disabled {
  opacity: .35;
  cursor: not-allowed;
  border-color: transparent;
  background: transparent;
}
.user-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.user-form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.user-form-group label small {
  color: var(--mute);
  font-weight: normal;
}
.user-form-group input, .user-form-group select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color .15s ease;
}
.user-form-group input:focus, .user-form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.user-msg {
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  margin-top: 4px;
}
.user-msg.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.user-msg.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}
.user-guide-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--mute);
}
.user-guide-box b {
  color: var(--text);
}

/* ==========================================================================
   PUSAT KONTROL & KESEHATAN SISTEM (ADMIN ONLY)
   ========================================================================== */
.main-control-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 24px;
  overflow-y: auto;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.ctrl-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.ctrl-head h2 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  margin-bottom: 4px;
}

.ctrl-badge-admin {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #c084fc;
}

.ctrl-sub {
  font-size: 12.5px;
  color: var(--mute);
  max-width: 650px;
  line-height: 1.45;
}

.ctrl-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Glass & Ghost Buttons */
.btn-ctrl-glass {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 15px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  font-family: var(--font) !important;
  border-radius: 10px !important;
  background: rgba(23, 34, 56, 0.75) !important;
  border: 1px solid rgba(140, 165, 220, 0.22) !important;
  color: #e7edfb !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 1.2 !important;
}

.btn-ctrl-glass:hover {
  background: rgba(30, 44, 72, 0.9) !important;
  border-color: rgba(91, 140, 255, 0.45) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(91, 140, 255, 0.15) !important;
  transform: translateY(-1.5px) !important;
}

.btn-ctrl-glass svg.i {
  color: var(--accent);
  transition: transform 0.4s ease !important;
}

.btn-ctrl-glass:hover svg.i {
  transform: rotate(180deg) !important;
}

/* Premium 1-Click Clean Button: Modern Indigo-Violet Gradient with Glowing Aura */
.btn-one-click-clean {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 18px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: var(--font) !important;
  letter-spacing: 0.2px !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 1.2 !important;
}

.btn-one-click-clean:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  transform: translateY(-1.5px) !important;
}

.btn-one-click-clean:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;
}

.btn-one-click-clean svg.i {
  color: #ffffff !important;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
}

/* Alert Banner */
.ctrl-alert-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  animation: pulseAlert 2.5s infinite;
}

@keyframes pulseAlert {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 16px 2px rgba(239, 68, 68, 0.25); }
}

.ctrl-alert-icon {
  font-size: 22px;
}

.ctrl-alert-content {
  flex: 1;
}

.ctrl-alert-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 2px;
}

.ctrl-alert-desc {
  font-size: 12px;
  color: var(--mute);
}

.ctrl-alert-actions {
  display: flex;
  gap: 8px;
}

/* 4-Stat Grid */
.ctrl-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.ctrl-stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.ctrl-stat-card:hover {
  border-color: var(--line-2);
}

.ctrl-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ctrl-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-stat-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.ctrl-stat-badge.info {
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.35);
  color: #c084fc;
}

.ctrl-stat-badge.success {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.ctrl-stat-badge.warning {
  background: rgba(245, 185, 66, 0.15);
  border-color: rgba(245, 185, 66, 0.4);
  color: #fbbf24;
}

.ctrl-stat-badge.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.ctrl-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}

.ctrl-stat-val small {
  font-size: 13px;
  color: var(--mute);
  font-weight: 400;
}

.ctrl-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin: 2px 0;
}

.ctrl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.ctrl-progress-fill.info {
  background: linear-gradient(90deg, #6366f1 0%, #a855f7 100%);
}

.ctrl-progress-fill.warn {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.ctrl-progress-fill.danger {
  background: #ef4444;
}

.ctrl-stat-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--faint);
}

.ctrl-stat-sub b {
  color: var(--text);
}

/* 2-Column Body Layout */
.ctrl-body-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 900px) {
  .ctrl-body-layout {
    grid-template-columns: 1fr;
  }
}

.ctrl-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ctrl-panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.ctrl-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ctrl-panel-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-pill-quota {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(91, 140, 255, 0.1);
  color: var(--accent);
  border: 1px solid var(--line-2);
}

.ctrl-table-wrap {
  overflow-x: auto;
}

.ctrl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ctrl-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--mute);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ctrl-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(140, 165, 220, 0.06);
  color: var(--text);
}

.ctrl-table tr:last-child td {
  border-bottom: none;
}

.ctrl-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ctrl-mini-metric {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ctrl-mini-metric .label {
  font-size: 11px;
  color: var(--mute);
}

.ctrl-mini-metric .val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
}

/* Diagnostics Terminal */
.ctrl-terminal-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.ctrl-cmd-input {
  flex: 2;
  background: #080c14;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: #38bdf8;
  padding: 8px 12px;
  font-size: 12.5px;
  font-family: var(--mono);
  outline: none;
  min-width: 220px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ctrl-cmd-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(91, 140, 255, 0.25);
}

.ctrl-select-quick {
  flex: 1;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 11.5px;
  max-width: 210px;
  cursor: pointer;
}

.ctrl-select {
  flex: 1;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--mono);
}

.ctrl-tag-aira {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ctrl-terminal-output {
  background: #080c14;
  border: 1px solid rgba(140, 165, 220, 0.15);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: #38bdf8;
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Panel Admin Subtabs Navigation ─────────────────────────────────── */
.ctrl-subtabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 5px;
  background: rgba(13, 19, 33, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(140, 165, 220, 0.14);
  border-radius: 12px;
  width: fit-content;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.ctrl-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--mute);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.ctrl-subtab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.ctrl-subtab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.22) 0%, rgba(139, 92, 246, 0.3) 100%);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 2px 14px rgba(139, 92, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ctrl-tab-pane {
  animation: ctrlPaneFadeIn 0.25s ease-out;
}

@keyframes ctrlPaneFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── RBAC Tools Matrix Styling ─────────────────────────────────────── */
.ctrl-rbac-header-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.75) 0%, rgba(13, 18, 30, 0.85) 100%);
  border: 1px solid rgba(140, 165, 220, 0.14);
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}

.ctrl-rbac-header-box h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.ctrl-rbac-header-box p {
  margin: 0;
  font-size: 12.5px;
  color: var(--mute);
  max-width: 680px;
  line-height: 1.45;
}

.ctrl-rbac-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ctrl-rbac-roles-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.ctrl-rbac-role-card {
  padding: 14px 16px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ctrl-role-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ctrl-role-icon-box.owner {
  background: rgba(192, 132, 252, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: #c084fc;
}

.ctrl-role-icon-box.operator {
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #60a5fa;
}

.ctrl-role-icon-box.guest {
  background: rgba(156, 163, 175, 0.15);
  border: 1px solid rgba(156, 163, 175, 0.35);
  color: #9ca3af;
}

.ctrl-role-info-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text);
}

.ctrl-role-info-desc {
  font-size: 11.5px;
  color: var(--mute);
  line-height: 1.4;
  margin: 0;
}

.ctrl-rbac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.ctrl-rbac-card {
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.8) 0%, rgba(11, 15, 25, 0.95) 100%);
  border: 1px solid rgba(140, 165, 220, 0.12);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ctrl-rbac-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(139, 92, 246, 0.1);
}

.ctrl-rbac-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ctrl-rbac-cat-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-rbac-risk-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ctrl-rbac-risk-badge.critical {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.ctrl-rbac-risk-badge.high {
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.ctrl-rbac-risk-badge.medium {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.ctrl-rbac-risk-badge.low {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.ctrl-rbac-cat-desc {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.45;
  margin: 0;
}

.ctrl-rbac-permissions-box {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid rgba(140, 165, 220, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ctrl-rbac-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 3px 0;
}

.ctrl-rbac-perm-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.ctrl-rbac-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.ctrl-rbac-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #8b5cf6;
  cursor: pointer;
}

.ctrl-rbac-tools-detail {
  margin-top: 4px;
}

.ctrl-rbac-tools-toggle {
  font-size: 11.5px;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.ctrl-rbac-tools-toggle:hover {
  color: #38bdf8;
}

.ctrl-rbac-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border: 1px dashed rgba(140, 165, 220, 0.15);
}

.ctrl-rbac-chip {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #cbd5e1;
}

/* ── Responsive Adjustment for Control Center Tabs ─────────────────── */
@media (max-width: 860px) {
  .ctrl-subtabs-bar {
    width: 100%;
    overflow-x: auto;
  }
  .ctrl-rbac-grid {
    grid-template-columns: 1fr;
  }
  .ctrl-rbac-header-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------------------------------------------------------------- Hive Aira */
.main-hive {
  padding: 20px 24px 48px;
  overflow-y: auto;
  height: 100%;
}
.hive-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.hive-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hive-sub {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: .75;
}
.hive-badge-owner {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--accent);
  border: 1px solid var(--accent);
  opacity: .9;
}
.hive-head-actions {
  display: flex;
  gap: 8px;
}
.hive-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.hive-stat-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hive-stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mute);
}
.hive-stat-card .value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}
.hive-stat-card .value.ok { color: #22c55e; }
.hive-stat-card .value.warn { color: #f59e0b; }
.hive-stat-card .value.err { color: #ef4444; }
.hive-node-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.hive-node-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hive-node-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hive-node-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.hive-node-title b {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hive-node-title code {
  font-size: 11px;
  color: var(--mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hive-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--mute);
}
.hive-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.hive-dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.hive-dot.err { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.hive-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.hive-status.ok { color: #22c55e; border-color: rgba(34, 197, 94, .45); }
.hive-status.warn { color: #f59e0b; border-color: rgba(245, 158, 11, .45); }
.hive-status.err { color: #ef4444; border-color: rgba(239, 68, 68, .45); }
.hive-status.mute { color: var(--mute); }
.hive-node-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}
.hive-node-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.hive-node-rows span {
  color: var(--mute);
}
.hive-node-rows b {
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hive-node-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hive-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.hive-trust-btn {
  font-size: 11px;
  padding: 4px 10px;
}
.hive-trust-btn.danger {
  color: var(--err);
  border-color: rgba(239, 68, 68, .45);
}
.hive-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--mute);
}
.hive-badge.self { color: var(--accent); border-color: rgba(59, 130, 246, .5); }
.hive-badge.master { color: #a855f7; border-color: rgba(168, 85, 247, .5); }
.hive-badge.trusted { color: #22c55e; border-color: rgba(34, 197, 94, .45); }
.hive-badge.observed { color: #f59e0b; border-color: rgba(245, 158, 11, .45); }
.hive-badge.blocked { color: #ef4444; border-color: rgba(239, 68, 68, .45); }
.hive-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 16px;
  color: var(--mute);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.hive-empty.err { color: var(--err); }
.hive-cmd-panel {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hive-cmd-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}
.hive-cmd-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--mute);
}
.hive-cmd-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.hive-cmd-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 200px;
  min-width: 180px;
}
.hive-cmd-field > span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mute);
}
.hive-cmd-field select {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}
.hive-cmd-field select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, .55);
}
.hive-cmd-send {
  height: 38px;
  white-space: nowrap;
}
.hive-cmd-send[disabled] {
  opacity: .55;
  cursor: progress;
}
.hive-cmd-output-wrap {
  margin-top: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hive-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.hive-output-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.hive-output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hive-output-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.hive-output-card {
  background: var(--raised, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.hive-output-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.hive-output-excerpt {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow: auto;
  color: var(--fg);
}

.hive-cmd-output {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 720px) {
  .hive-head {
    flex-direction: column;
  }
  .hive-node-list {
    grid-template-columns: 1fr;
  }
  .hive-cmd-form {
    flex-direction: column;
    align-items: stretch;
  }
  .hive-cmd-send {
    width: 100%;
  }
}



/* --- Tata Kelola Enterprise (owner only) --- */
.gov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.gov-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gov-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gov-card-head b { font-size: 14px; }
.gov-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gov-card ul li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.gov-card ul li span { color: var(--mute); flex: 0 0 auto; }
.gov-card ul li code {
  font-size: 11px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 62%;
}
.gov-card ul.gov-sub {
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.gov-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--mute);
  white-space: nowrap;
}
.gov-tag.ok { color: #22c55e; border-color: rgba(34, 197, 94, .45); }
.gov-tag.err { color: #ef4444; border-color: rgba(239, 68, 68, .45); }
.gov-tag.mute { color: var(--mute); }
.gov-warn {
  margin: 0;
  font-size: 11px;
  color: #f59e0b;
  word-break: break-word;
}
.gov-event-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}
.gov-event {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gov-event-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.gov-event-head b { font-size: 13px; }
.gov-event-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--mute);
}
.gov-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--mute);
}
.gov-event-meta code { font-size: 11px; }
.gov-event-payload {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 720px) {
  .gov-grid { grid-template-columns: 1fr; }
  .gov-card ul li { align-items: flex-start; }
  .gov-card ul li code { max-width: 60%; }
}

/* ------------------------------------------------------------------ */
/* Panel Riwayat Sesi: heartbeat, automation, jadwal cron              */
/* ------------------------------------------------------------------ */

.auto-history-section {
  margin-top: 28px;
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 14px;
  background: var(--panel, #14171d);
  overflow: hidden;
}

.auto-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line, #2a2f3a);
}

.auto-history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.auto-history-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--mute, #8b93a1);
  max-width: 640px;
  line-height: 1.5;
}

.auto-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auto-history-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  min-height: 320px;
}

@media (max-width: 860px) {
  .auto-history-layout { grid-template-columns: 1fr; }
}

.auto-history-sessions {
  border-right: 1px solid var(--line, #2a2f3a);
  max-height: 520px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 860px) {
  .auto-history-sessions { border-right: 0; border-bottom: 1px solid var(--line, #2a2f3a); max-height: 240px; }
}

.auto-history-loading,
.auto-history-empty {
  padding: 18px;
  font-size: 12.5px;
  color: var(--mute, #8b93a1);
  text-align: center;
  line-height: 1.5;
}

.hist-session {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.hist-session:hover { background: rgba(255, 255, 255, 0.04); }

.hist-session.is-active {
  background: rgba(93, 156, 236, 0.12);
  border-color: rgba(93, 156, 236, 0.45);
}

.hist-session-top {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
}

.hist-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.hist-dot-on { background: var(--ok, #3ddc97); }
.hist-dot-off { background: var(--mute, #8b93a1); }

.hist-session-label {
  font-size: 12.5px;
  font-weight: 600;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-type {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.hist-type-hb { background: rgba(93, 156, 236, 0.18); color: #8fbdf5; }
.hist-type-auto { background: rgba(61, 220, 151, 0.16); color: #74e3b3; }
.hist-type-sched { background: rgba(234, 179, 8, 0.16); color: #e5c05a; }
.hist-type-sys { background: rgba(168, 132, 234, 0.18); color: #c3aaf0; }

.hist-session-meta {
  display: flex;
  gap: 10px;
  font-size: 10.5px;
  color: var(--mute, #8b93a1);
  padding-left: 14px;
  flex-wrap: wrap;
}

.auto-history-detail {
  padding: 16px 18px;
  max-height: 520px;
  overflow-y: auto;
}

.hist-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line, #2a2f3a);
}

.hist-detail-title {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 5px;
}

.hist-detail-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hist-detail-id,
.hist-entry-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: var(--mute, #8b93a1);
}

.hist-detail-kpi { text-align: right; flex: 0 0 auto; }

.hist-kpi-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}

.hist-kpi-label {
  font-size: 10px;
  color: var(--mute, #8b93a1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hist-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.hist-entry-row {
  display: flex;
  gap: 10px;
  font-size: 11.5px;
  line-height: 1.5;
}

.hist-entry-key {
  flex: 0 0 84px;
  color: var(--mute, #8b93a1);
}

.hist-entry-val { flex: 1 1 auto; word-break: break-word; }

.hist-entry-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hist-entry {
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
}

.hist-entry-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  cursor: pointer;
  font-size: 11.5px;
  list-style: none;
  flex-wrap: wrap;
}

.hist-entry-head::-webkit-details-marker { display: none; }

.hist-entry-time { flex: 0 0 auto; color: var(--mute, #8b93a1); }

.hist-status {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: lowercase;
}

.hist-ok { background: rgba(61, 220, 151, 0.16); color: #74e3b3; }
.hist-err { background: rgba(255, 123, 123, 0.16); color: #ff9d9d; }
.hist-neutral { background: rgba(139, 147, 161, 0.16); color: #a7aebb; }

.hist-entry-kind { color: var(--mute, #8b93a1); font-size: 10.5px; }

.hist-entry-body {
  padding: 4px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hist-entry-output {
  margin: 4px 0 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}

/* ---------- Report Studio: Editor & Pratinjau Dossier Realtime ---------- */
.rep-studio-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100vh - 88px);
  overflow: hidden;
}

.rep-studio-head {
  padding-bottom: 6px;
}

.rep-sync-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--line, #2a2f3a);
  background: var(--raised, #141923);
  color: var(--mute, #8b93a1);
}

.rep-sync-badge[data-tone="ok"] {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #6ee7b7;
}

.rep-sync-badge[data-tone="warn"] {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
}

.rep-sync-badge[data-tone="err"] {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.rep-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.rep-select {
  min-width: 240px;
  max-width: 360px;
  height: 33px;
  padding: 0 10px;
  font-size: 12px;
}

.rep-autosave-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 7px;
  background: var(--raised, #141923);
  font-size: 11.5px;
  color: var(--text, #e6edf7);
  cursor: pointer;
  user-select: none;
}

.rep-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 8px;
  background: rgba(15, 22, 36, 0.72);
}

.rep-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.rep-metric-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11.5px;
}

.rep-metric-item .label {
  color: var(--mute, #8b93a1);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rep-metric-item .value {
  color: var(--text, #e6edf7);
  font-weight: 600;
}

.rep-metric-item .value.ok { color: #6ee7b7; }
.rep-metric-item .value.warn { color: #fcd34d; }
.rep-metric-item .value.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--mute, #8b93a1);
}

.rep-mode-group {
  display: inline-flex;
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 7px;
  overflow: hidden;
  background: var(--raised, #141923);
}

.rep-mode-btn {
  border: 0;
  background: transparent;
  color: var(--mute, #8b93a1);
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}

.rep-mode-btn:hover {
  color: var(--text, #e6edf7);
}

.rep-mode-btn.active {
  background: var(--accent, #5b8cff);
  color: #fff;
  font-weight: 600;
}

.rep-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rep-outline-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 2px;
}

.rep-sec-pill {
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 5px;
  background: rgba(20, 28, 46, 0.75);
  color: var(--mute, #8b93a1);
  padding: 3px 8px;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}

.rep-sec-pill:hover {
  border-color: var(--accent, #5b8cff);
  color: var(--text, #e6edf7);
}

.rep-outline-empty {
  font-size: 11px;
  color: var(--mute, #8b93a1);
}

.rep-snippet-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.rep-snip-btn {
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text, #e6edf7);
  padding: 3px 9px;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
}

.rep-snip-btn:hover {
  border-color: var(--accent, #5b8cff);
  background: rgba(91, 140, 255, 0.12);
}

.rep-studio-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.rep-studio-grid[data-mode="editor"] {
  grid-template-columns: 1fr;
}
.rep-studio-grid[data-mode="editor"] .rep-preview-pane {
  display: none;
}

.rep-studio-grid[data-mode="preview"],
.rep-studio-grid[data-mode="executive"] {
  grid-template-columns: 1fr;
}
.rep-studio-grid[data-mode="preview"] .rep-editor-pane,
.rep-studio-grid[data-mode="executive"] .rep-editor-pane {
  display: none;
}

.rep-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 9px;
  background: rgba(11, 16, 28, 0.86);
  overflow: hidden;
}

.rep-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 13px;
  border-bottom: 1px solid var(--line, #2a2f3a);
  background: rgba(18, 25, 42, 0.9);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text, #e6edf7);
}

.rep-shortcut-hint {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--mute, #8b93a1);
}

.rep-editor-textarea {
  flex: 1;
  width: 100%;
  min-height: 0;
  resize: none;
  border: 0;
  outline: 0;
  padding: 14px 16px;
  background: transparent;
  color: #e6edf7;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.62;
  overflow-y: auto;
}

.rep-preview-body {
  flex: 1;
  min-height: 0;
  padding: 18px 22px;
  overflow-y: auto;
  color: #dde6f4;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13.5px;
  line-height: 1.65;
}

.rep-executive-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.rep-h1 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #d4a74a;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.rep-h2 {
  margin: 20px 0 9px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(212, 167, 74, 0.35);
  font-size: 15.5px;
  font-weight: 700;
  color: #f3d285;
}

.rep-h3 {
  margin: 14px 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #9ec0ff;
}

.rep-p {
  margin: 6px 0 9px;
}

.rep-list {
  margin: 6px 0 12px;
  padding-left: 19px;
}

.rep-list li {
  margin-bottom: 6px;
}

.rep-quote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid #d4a74a;
  background: rgba(212, 167, 74, 0.08);
  color: #cbd5e1;
  font-size: 12.5px;
}

.rep-cite-tag {
  display: inline-block;
  padding: 0 5px;
  margin: 0 1px;
  border-radius: 3px;
  background: rgba(91, 140, 255, 0.18);
  border: 1px solid rgba(91, 140, 255, 0.38);
  color: #93c5fd;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}

.rep-cite-tag.ten {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.rep-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rep-badge.ok {
  background: rgba(34, 197, 94, 0.16);
  color: #6ee7b7;
}

.rep-badge.warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.rep-badge.err {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

.rep-inline-code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
}

.rep-code-block {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line, #2a2f3a);
  background: rgba(5, 9, 18, 0.85);
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  overflow-x: auto;
}

.rep-table-wrap {
  margin: 10px 0 14px;
  overflow-x: auto;
}

.rep-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.rep-table th {
  background: #13233f;
  color: #f3d285;
  text-align: left;
  font-weight: 600;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rep-table td {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

.rep-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

.rep-graph-card {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(212, 167, 74, 0.35);
  border-radius: 8px;
  background: rgba(15, 24, 42, 0.92);
}

.rep-graph-head {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f3d285;
  margin-bottom: 6px;
}

.rep-template-select {
  min-width: 215px;
  max-width: 270px;
  padding: 6px 10px;
  font-size: 12px;
}

/* Progress Bar Pembuatan Laporan Berdasarkan Template */
.rep-export-progress-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 31, 58, 0.95), rgba(20, 24, 38, 0.95));
  border: 1px solid rgba(212, 167, 74, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 167, 74, 0.15);
  animation: repFadeSlideDown 0.3s ease-out;
  margin-bottom: 6px;
}

.rep-export-progress-bar[hidden] {
  display: none !important;
}

.rep-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rep-progress-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.rep-progress-percent {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  color: #d4a74a;
}

.rep-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.rep-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4a74a 0%, #f59e0b 50%, #38bdf8 100%);
  border-radius: 999px;
  transition: width 0.35s ease;
  box-shadow: 0 0 10px rgba(212, 167, 74, 0.6);
  position: relative;
}

.rep-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: repProgressShimmer 1.5s infinite;
}

.rep-progress-sub {
  font-size: 11.5px;
  color: var(--mute, #94a3b8);
  display: flex;
  align-items: center;
  gap: 6px;
}

@keyframes repProgressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes repFadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.rep-template-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 12px;
  border: 1px solid var(--line, #2a2f3a);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
}

.rep-tpl-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute, #94a3b8);
}

.rep-tpl-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rep-tpl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line, #2a2f3a);
  background: rgba(255, 255, 255, 0.03);
  color: var(--mute, #94a3b8);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.rep-tpl-pill:hover {
  border-color: var(--accent, #5b8cff);
  color: var(--text, #f8fafc);
}

.rep-tpl-pill.active {
  background: rgba(91, 140, 255, 0.16);
  border-color: var(--accent, #5b8cff);
  color: #fff;
}

.rep-tpl-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.rep-tpl-swatch.navy { background: #d4a74a; box-shadow: 0 0 0 2px #0f1f3a; }
.rep-tpl-swatch.osint { background: #1d6b3a; box-shadow: 0 0 0 2px #0f1f3a; }
.rep-tpl-swatch.tactical { background: #9a7b2f; box-shadow: 0 0 0 2px #1f4e8c; }
.rep-tpl-swatch.ew { background: #9b1c1c; box-shadow: 0 0 0 2px #9a7b2f; }
.rep-tpl-swatch.dark { background: #38bdf8; box-shadow: 0 0 0 2px #0a0f1d; }
.rep-tpl-swatch.brief { background: #f59e0b; box-shadow: 0 0 0 2px #1f2937; }
.rep-tpl-swatch.pentest { background: #ef4444; box-shadow: 0 0 0 2px #450a0a; }
.rep-tpl-swatch.journal { background: #e2e8f0; box-shadow: 0 0 0 2px #334155; }

/* Komponen Standar laporan-intelijen-pdf di Live Preview */
.rep-preview-body[data-template="laporan_intelijen_pdf"],
.rep-preview-body[data-template="final_validation_osint"],
.rep-preview-body[data-template="tactical_dossier_hukum"],
.rep-preview-body[data-template="strategic_demo_ew"],
.rep-preview-body[data-template="executive_navy"] {
  background: #ffffff;
  color: #1c2230;
  font-family: "Inter", "Plus Jakarta Sans", Arial, sans-serif;
  font-size: 12.6px;
  line-height: 1.52;
}
.rep-preview-body[data-template="laporan_intelijen_pdf"] .rep-h1,
.rep-preview-body[data-template="final_validation_osint"] .rep-h1,
.rep-preview-body[data-template="tactical_dossier_hukum"] .rep-h1,
.rep-preview-body[data-template="strategic_demo_ew"] .rep-h1,
.rep-preview-body[data-template="executive_navy"] .rep-h1 {
  color: #0f1f3a;
  border-bottom: 2px solid #0f1f3a;
}
.rep-preview-body[data-template="laporan_intelijen_pdf"] .rep-h2,
.rep-preview-body[data-template="final_validation_osint"] .rep-h2,
.rep-preview-body[data-template="tactical_dossier_hukum"] .rep-h2,
.rep-preview-body[data-template="strategic_demo_ew"] .rep-h2,
.rep-preview-body[data-template="executive_navy"] .rep-h2 {
  color: #0f1f3a;
  border-bottom: 1.5px solid #0f1f3a;
}
.rep-preview-body[data-template="laporan_intelijen_pdf"] .rep-h3,
.rep-preview-body[data-template="final_validation_osint"] .rep-h3,
.rep-preview-body[data-template="tactical_dossier_hukum"] .rep-h3,
.rep-preview-body[data-template="strategic_demo_ew"] .rep-h3,
.rep-preview-body[data-template="executive_navy"] .rep-h3 {
  color: #0f1f3a;
}
.rep-preview-body .coverpage {
  border: 1px solid #c9ced8;
  margin-bottom: 20px;
  background: #fff;
  color: #1c2230;
}
.rep-preview-body .classbar {
  background: #0f1f3a;
  color: #fff;
  text-align: center;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 11px;
  padding: 5px 0;
}
.rep-preview-body .cover {
  padding: 20px 24px 16px;
}
.rep-preview-body .cover .kicker {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #9a7b2f;
  font-weight: 700;
  text-transform: uppercase;
}
.rep-preview-body .cover h1 {
  font-size: 24px;
  margin: 6px 0 4px;
  line-height: 1.18;
  color: #0f1f3a;
}
.rep-preview-body .cover .sub {
  font-size: 13px;
  color: #3a4558;
  margin-bottom: 14px;
}
.rep-preview-body .meta {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.rep-preview-body .meta td {
  padding: 5px 0;
  border-top: 1px solid #e3e6ec;
  vertical-align: top;
}
.rep-preview-body .meta td:first-child {
  width: 28%;
  color: #5a6475;
  font-weight: 600;
}
.rep-preview-body .section {
  padding-top: 14px;
  margin-top: 18px;
  border-top: 2px dashed #cbd5e1;
}
.rep-preview-body .section h2 {
  margin-top: 0;
  font-size: 19px;
  color: #0f1f3a;
  margin-bottom: 4px;
}
.rep-preview-body .section h2 .num {
  display: block;
  font-size: 10.5px;
  letter-spacing: 2px;
  color: #9a7b2f;
  margin-bottom: 2px;
}
.rep-preview-body .section h2 .num::before {
  content: "BAGIAN ";
}
.rep-preview-body .tagline {
  font-size: 12.5px;
  color: #3a4558;
  margin: 4px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #0f1f3a;
  font-style: italic;
}
.rep-preview-body .verdict {
  background: #f6f2e7;
  border-left: 4px solid #9a7b2f;
  padding: 10px 14px;
  margin: 8px 0 12px;
  color: #1c2230;
}
.rep-preview-body .verdict .lbl {
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #7a5f1f;
  font-weight: 700;
}
.rep-preview-body .verdict .val {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f1f3a;
}
.rep-preview-body .doccards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0 12px;
}
.rep-preview-body .card {
  border: 1px solid #d5dbe5;
  padding: 10px 12px;
  background: #fafbfc;
  color: #1c2230;
}
.rep-preview-body .card .id {
  font-size: 10px;
  font-weight: 700;
  color: #9a7b2f;
  letter-spacing: 1px;
}
.rep-preview-body .card .title {
  font-weight: 700;
  color: #0f1f3a;
  margin: 2px 0 6px;
  font-size: 12.5px;
}
.rep-preview-body .card .meta2 {
  font-size: 10.5px;
  color: #5a6475;
}
.rep-preview-body table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.2px;
  margin: 6px 0 10px;
}
.rep-preview-body table.data th {
  background: #0f1f3a;
  color: #fff;
  text-align: left;
  font-weight: 600;
  padding: 6px 7px;
}
.rep-preview-body table.data td {
  padding: 5px 7px;
  border-bottom: 1px solid #e1e4ea;
  vertical-align: top;
  color: #1c2230;
}
.rep-preview-body table.data tbody tr:nth-child(even) td {
  background: #f7f8fa;
}
.rep-preview-body .badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 2px 5px;
  border-radius: 2px;
  white-space: nowrap;
}
.rep-preview-body .v { background: #dcefe3; color: #1d6b3a; }
.rep-preview-body .c { background: #dde8f6; color: #1f4e8c; }
.rep-preview-body .p { background: #fbeccf; color: #8a5a00; }
.rep-preview-body .u { background: #f8dcdc; color: #9b1c1c; }
.rep-preview-body .n { background: #e8eaee; color: #444d5c; }
.rep-preview-body .tag {
  display: inline-block;
  background: #0f1f3a;
  color: #fff;
  font-weight: 700;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 2px;
  margin-right: 6px;
}
.rep-preview-body .twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rep-preview-body .score {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid #d5dbe5;
  padding: 10px 14px;
  margin: 6px 0;
  background: #fafbfc;
  color: #1c2230;
}
.rep-preview-body .score .sn {
  font-size: 22px;
  font-weight: 800;
  color: #0f1f3a;
  min-width: 68px;
  text-align: center;
  border-right: 2px solid #9a7b2f;
  padding-right: 12px;
}
.rep-preview-body .score .st {
  font-weight: 700;
  color: #0f1f3a;
}
.rep-preview-body .note {
  font-size: 11.4px;
  background: #f2f4f7;
  border: 1px solid #dfe3ea;
  padding: 8px 12px;
  margin: 8px 0;
  color: #1c2230;
}
.rep-preview-body .bars { margin: 8px 0 12px; }
.rep-preview-body .bar {
  display: grid;
  grid-template-columns: 150px 1fr 48px;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  font-size: 11.2px;
}
.rep-preview-body .bar .bt {
  background: #e9ecf2;
  height: 12px;
  border-radius: 2px;
  overflow: hidden;
}
.rep-preview-body .bar .bf { height: 100%; }
.rep-preview-body .bf.neg { background: #9b1c1c; }
.rep-preview-body .bf.neu { background: #6b7688; }
.rep-preview-body .bf.pos { background: #1d6b3a; }
.rep-preview-body .bar .bv { text-align: right; font-weight: 700; color: #0f1f3a; }
.rep-preview-body .stk {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid #d5dbe5;
}
.rep-preview-body .stk i,
.rep-preview-body .stk > div {
  font-size: 9.5px;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-style: normal;
}
.rep-preview-body .stk .s1 { background: #1d6b3a; }
.rep-preview-body .stk .s2 { background: #b6bcc7; }
.rep-preview-body .stk .s3 { background: #9b1c1c; }
.rep-preview-body .hb {
  height: 9px;
  width: 100%;
  background: #e9ecf2;
  border-radius: 2px;
  margin: 2px 0;
  overflow: hidden;
}
.rep-preview-body .hb i,
.rep-preview-body .hb > div { height: 100%; background: #0f1f3a; display: block; border-radius: 2px; }
.rep-preview-body .hb.proj i,
.rep-preview-body .hb.gold > div { background: repeating-linear-gradient(90deg, #9a7b2f 0 6px, #e6d7ae 6px 9px); }
.rep-preview-body .hb.red > div { background: #9b1c1c; }
.rep-preview-body .kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 6px 0 12px;
}
.rep-preview-body .kpi {
  border: 1px solid #d5dbe5;
  background: #fafbfc;
  padding: 8px 10px;
  text-align: center;
}
.rep-preview-body .kpi .kv { font-size: 19px; font-weight: 800; color: #0f1f3a; line-height: 1.1; }
.rep-preview-body .kpi .kl { font-size: 9.8px; color: #5a6475; text-transform: uppercase; letter-spacing: 0.6px; margin-top: 2px; }
.rep-preview-body .regions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 12px;
  align-items: stretch;
  clear: both;
}
.rep-preview-body .rg {
  border: 1px solid #d5dbe5;
  border-left: 4px solid #9b1c1c;
  padding: 8px 10px;
  background: #fafbfc;
  font-size: 10.8px;
  color: #1c2230;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 85px;
  box-sizing: border-box;
}
.rep-preview-body .rg.md { border-left-color: #c98a12; }
.rep-preview-body .rg.lo { border-left-color: #1d6b3a; }
.rep-preview-body .rg .rh { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 2px; }
.rep-preview-body .rg .rn { font-weight: 700; color: #0f1f3a; font-size: 11.4px; }
.rep-preview-body .rg .rd { color: #5a6475; font-size: 10.2px; line-height: 1.3; }
.rep-preview-body .rg .rp { font-weight: 800; color: #0f1f3a; font-size: 12px; margin-top: 3px; line-height: 1.2; }
.rep-preview-body .rg .rp::after { content: " peserta"; font-size: 9.5px; font-weight: 500; color: #5a6475; }
.rep-preview-body .fc4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 10px 0 14px;
  clear: both;
  align-items: stretch;
}
.rep-preview-body .fx {
  position: relative;
  border: 1px solid #d5dbe5;
  border-top: 4px solid #0f1f3a;
  padding: 10px 12px;
  background: #fafbfc;
  font-size: 10.8px;
  color: #1c2230;
  border-radius: 3px;
  min-height: 82px;
  box-sizing: border-box;
  clear: both;
}
.rep-preview-body .fx.crit { border-top-color: #9b1c1c; }
.rep-preview-body .fx.high { border-top-color: #c0392b; }
.rep-preview-body .fx.med { border-top-color: #c98a12; }
.rep-preview-body .fx.low { border-top-color: #1d6b3a; }
.rep-preview-body .fx .fl {
  font-size: 9.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #5a6475;
  font-weight: 700;
  padding-right: 60px;
}
.rep-preview-body .fx .fp {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 17px;
  font-weight: 800;
  color: #0f1f3a;
  line-height: 1;
  margin: 0;
  float: none;
}
.rep-preview-body .fx .ft {
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 11.5px;
  color: #0f1f3a;
  margin-bottom: 4px;
  padding-right: 60px;
}
.rep-preview-body .fx p {
  margin: 5px 0 0;
  font-size: 10.8px;
  line-height: 1.42;
  color: #334155;
  clear: both;
}
.rep-preview-body .recs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 14px;
  margin: 12px 0 14px;
  clear: both;
}
.rep-preview-body .recs > div {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 11px;
  line-height: 1.45;
  color: #1c2230;
}
.rep-preview-body .recs > div > b {
  background: #0f1f3a;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  flex-shrink: 0;
}
.rep-preview-body .recs .card h3 { margin: 0 0 5px; font-size: 12px; }
.rep-preview-body .chips span {
  display: inline-block;
  background: #eef1f6;
  color: #0f1f3a;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 2px;
  margin: 1px 3px 1px 0;
}
.rep-preview-body .rm {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 6px;
  align-items: center;
  margin: 8px 0 12px;
  border: 1px solid #d5dbe5;
  padding: 10px 12px;
  background: #fafbfc;
  color: #1c2230;
}
.rep-preview-body .rm .ylab {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-size: 9.8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #0f1f3a;
}
.rep-preview-body .rm .xlab {
  text-align: center;
  font-size: 9.8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #0f1f3a;
  margin-top: 5px;
}
.rep-preview-body .rm .grid {
  display: grid;
  grid-template-columns: 68px repeat(3, 1fr);
  gap: 4px;
  font-size: 10.5px;
}
.rep-preview-body .rm .rl { font-weight: 700; color: #0f1f3a; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-size: 10px; }
.rep-preview-body .rm .cl { font-weight: 700; color: #0f1f3a; text-align: center; padding: 3px 0; font-size: 10px; background: #eef1f6; }
.rep-preview-body .rm .cell { min-height: 44px; padding: 5px 7px; border-radius: 2px; font-size: 10px; line-height: 1.3; }
.rep-preview-body .rm .cell b { display: block; font-size: 9.8px; margin-bottom: 2px; }
.rep-preview-body .rm .l { background: #e5f2ea; color: #1d5b34; border: 1px solid #c5e0cf; }
.rep-preview-body .rm .m { background: #fbeccf; color: #7a5000; border: 1px solid #edd49c; }
.rep-preview-body .rm .h { background: #f9d9c6; color: #8c2f00; border: 1px solid #ebb899; }
.rep-preview-body .rm .c { background: #f5c6c6; color: #7f1515; border: 1px solid #e39a9a; }
.rep-preview-body .rm .rk { display: inline-block; background: #0f1f3a; color: #fff; font-weight: 700; font-size: 9px; padding: 1px 4px; border-radius: 2px; margin-right: 3px; }
.rep-preview-body .claims {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 6px 0 8px;
}
.rep-preview-body .cluster {
  border: 1px solid #d5dbe5;
  background: #fafbfc;
  padding: 6px 9px;
}
.rep-preview-body .cluster h3 {
  font-size: 11px;
  margin: 0 0 4px;
  color: #0f1f3a;
  border-bottom: 1px solid #e1e4ea;
  padding-bottom: 3px;
}
.rep-preview-body .claim { font-size: 10.5px; line-height: 1.35; margin: 2px 0; color: #1c2230; }
.rep-preview-body .claim b { color: #9a7b2f; font-family: "JetBrains Mono", monospace; margin-right: 3px; }
.rep-preview-body .srcl, .rep-preview-body .src {
  columns: 2;
  column-gap: 18px;
  font-size: 10.5px;
  line-height: 1.4;
  padding-left: 16px;
  margin: 4px 0;
}
.rep-preview-body .end {
  text-align: center;
  margin-top: 16px;
  font-size: 11px;
  color: #5a6475;
  font-style: italic;
}

/* Live Preview Template Visual Themes */
.rep-preview-body[data-template="palantir_dark"] {
  background: #070b14;
  color: #e2e8f0;
  font-family: "Inter", "JetBrains Mono", sans-serif;
}
.rep-preview-body[data-template="palantir_dark"] .rep-h1 {
  border-bottom-color: #38bdf8;
  color: #f8fafc;
}
.rep-preview-body[data-template="palantir_dark"] .rep-h2 {
  border-bottom-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.rep-preview-body[data-template="palantir_dark"] .rep-table th {
  background: #0f172a;
  color: #38bdf8;
  border-bottom: 1.5px solid #38bdf8;
}

.rep-preview-body[data-template="cabinet_brief"] {
  background: #fdfbf7;
  color: #111827;
}
.rep-preview-body[data-template="cabinet_brief"] .rep-h1 {
  color: #0f172a;
  border-bottom: 2px solid #111827;
}
.rep-preview-body[data-template="cabinet_brief"] .rep-h2 {
  color: #b45309;
  border-bottom-color: #d1d5db;
}
.rep-preview-body[data-template="cabinet_brief"] .rep-h3 {
  color: #1e3a8a;
}
.rep-preview-body[data-template="cabinet_brief"] .rep-table th {
  background: #1f2937;
  color: #fff;
}
.rep-preview-body[data-template="cabinet_brief"] .rep-table td {
  border-color: #d1d5db;
  color: #111827;
}

.rep-preview-body[data-template="pentest_dossier"] {
  background: #130b0e;
  color: #f1f5f9;
}
.rep-preview-body[data-template="pentest_dossier"] .rep-h1 {
  border-bottom-color: #ef4444;
  color: #fecaca;
}
.rep-preview-body[data-template="pentest_dossier"] .rep-h2 {
  border-bottom-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.rep-preview-body[data-template="pentest_dossier"] .rep-table th {
  background: #7f1d1d;
  color: #fee2e2;
}

.rep-preview-body[data-template="academic_journal"] {
  background: #fafaf9;
  color: #1c1917;
  font-family: "Georgia", "Times New Roman", serif;
}
.rep-preview-body[data-template="academic_journal"] .rep-h1 {
  color: #0c0a09;
  border-bottom: 2px double #1c1917;
}
.rep-preview-body[data-template="academic_journal"] .rep-h2 {
  color: #1c1917;
  border-bottom: 1px solid #57534e;
}
.rep-preview-body[data-template="academic_journal"] .rep-h3 {
  color: #292524;
}
.rep-preview-body[data-template="academic_journal"] .rep-table th {
  background: #292524;
  color: #fafaf9;
}
.rep-preview-body[data-template="academic_journal"] .rep-table td {
  border-color: #d6d3d1;
  color: #1c1917;
}

.msg-file-btn.btn-report-studio {
  background: rgba(212, 167, 74, 0.16);
  border: 1px solid rgba(212, 167, 74, 0.45);
  color: #f3d285;
  cursor: pointer;
  font-weight: 600;
}
.msg-file-btn.btn-report-studio:hover {
  background: rgba(212, 167, 74, 0.28);
  color: #fff;
}

/* Dark theme overrides for visual components */
.rep-preview-body[data-template="palantir_dark"] .fx,
.rep-preview-body[data-template="palantir_dark"] .rg,
.rep-preview-body[data-template="palantir_dark"] .kpi,
.rep-preview-body[data-template="palantir_dark"] .score,
.rep-preview-body[data-template="palantir_dark"] .cluster,
.rep-preview-body[data-template="pentest_dossier"] .fx,
.rep-preview-body[data-template="pentest_dossier"] .rg,
.rep-preview-body[data-template="pentest_dossier"] .kpi,
.rep-preview-body[data-template="pentest_dossier"] .score,
.rep-preview-body[data-template="pentest_dossier"] .cluster {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}
.rep-preview-body[data-template="palantir_dark"] .fx .ft,
.rep-preview-body[data-template="palantir_dark"] .fx .fp,
.rep-preview-body[data-template="palantir_dark"] .rg .rn,
.rep-preview-body[data-template="palantir_dark"] .rg .rp,
.rep-preview-body[data-template="palantir_dark"] .kpi .kv,
.rep-preview-body[data-template="pentest_dossier"] .fx .ft,
.rep-preview-body[data-template="pentest_dossier"] .fx .fp,
.rep-preview-body[data-template="pentest_dossier"] .rg .rn,
.rep-preview-body[data-template="pentest_dossier"] .rg .rp,
.rep-preview-body[data-template="pentest_dossier"] .kpi .kv {
  color: #f8fafc;
}
.rep-preview-body[data-template="palantir_dark"] .fx p,
.rep-preview-body[data-template="palantir_dark"] .recs > div,
.rep-preview-body[data-template="pentest_dossier"] .fx p,
.rep-preview-body[data-template="pentest_dossier"] .recs > div {
  color: #cbd5e1;
}
.rep-preview-body[data-template="palantir_dark"] .recs > div > b {
  background: #38bdf8;
  color: #0b1120;
}
.rep-preview-body[data-template="pentest_dossier"] .recs > div > b {
  background: #ef4444;
  color: #fff;
}

/* AI Section Builder Toolbar & Draggable Chips */
.rep-sec-builder-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(91, 140, 255, 0.22);
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.rep-sec-builder-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #9ec0ff;
  white-space: nowrap;
  flex-shrink: 0;
}

.rep-sec-builder-hint {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--mute, #8b93a1);
  margin-left: 4px;
}

.rep-sec-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.rep-sec-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 500;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.rep-sec-chip:active {
  cursor: grabbing;
}

.rep-sec-chip:hover {
  background: rgba(91, 140, 255, 0.18);
  border-color: #5b8cff;
  color: #fff;
  transform: translateY(-1px);
}

.rep-sec-chip.dragging {
  opacity: 0.45;
  border-style: dashed;
  border-color: #5b8cff;
}

.rep-sec-chip.loading {
  pointer-events: none;
  opacity: 0.75;
  background: rgba(91, 140, 255, 0.25);
  animation: pulse 1s infinite alternate;
}

.rep-sec-chip-icon {
  font-size: 12px;
  line-height: 1;
}

.rep-sec-chip-name {
  line-height: 1.2;
}

/* Drag-over target highlight states */
.rep-editor-textarea.drag-over {
  border: 2px dashed #5b8cff !important;
  background: rgba(91, 140, 255, 0.08) !important;
}

.rep-preview-body.drag-over {
  outline: 2px dashed #5b8cff !important;
  outline-offset: -3px;
  background: rgba(91, 140, 255, 0.06) !important;
}

@media (max-width: 960px) {
  .rep-studio-main {
    height: auto;
    overflow: visible;
  }
  .rep-studio-grid {
    grid-template-columns: 1fr;
  }
  .rep-pane {
    min-height: 420px;
  }
}

/* =====================================================================
   AIRA PERSONAL HUD, REPORT CUE & COMMAND PALETTE
   ===================================================================== */
.aira-report-cue {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(91, 140, 255, 0.08);
  border: 1px solid rgba(91, 140, 255, 0.25);
  font-size: 12px;
}

.aira-report-cue-txt {
  color: var(--text, #e8edf7);
  opacity: 0.9;
}

.aira-brief-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  flex-shrink: 0;
  padding: 6px 12px;
  margin: 0;
  background: rgba(15, 22, 36, 0.78);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  position: relative;
  z-index: 2;
}

.aira-brief-strip[hidden] {
  display: none !important;
}

.aira-brief-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 240px;
}

.aira-brief-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.aira-brief-badge.is-ok {
  background: rgba(52, 211, 153, 0.14);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.aira-brief-badge.is-warn {
  background: rgba(245, 185, 66, 0.16);
  color: #f5b942;
  border: 1px solid rgba(245, 185, 66, 0.38);
}

.aira-brief-badge.is-crit {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.42);
}

.aira-brief-meta {
  color: var(--mute, #9aa5b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aira-brief-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.aira-brief-actions .pill-btn.small {
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
  gap: 5px;
}

#airaHandsFreePill.is-active {
  background: rgba(61, 220, 151, 0.18);
  border-color: rgba(61, 220, 151, 0.5);
  color: #3ddc97;
}

.aira-pal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(6, 9, 16, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.aira-pal-backdrop[hidden] {
  display: none !important;
}

.aira-pal-card {
  width: min(620px, 92vw);
  background: #101624;
  border: 1px solid rgba(91, 140, 255, 0.32);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.aira-pal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.aira-pal-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #7aa7ff;
  background: rgba(91, 140, 255, 0.14);
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.aira-pal-inp {
  flex: 1;
  background: transparent;
  border: none;
  color: #eef3fb;
  font-size: 14px;
  outline: none;
}

.aira-pal-close {
  background: transparent;
  border: none;
  color: #9aa5b8;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}

.aira-pal-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aira-pal-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: #e8edf7;
}

.aira-pal-item:hover,
.aira-pal-item.is-selected {
  background: rgba(91, 140, 255, 0.16);
  border-color: rgba(91, 140, 255, 0.35);
}

.aira-pal-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aira-pal-text strong {
  font-size: 13px;
  font-weight: 600;
}

.aira-pal-text span {
  font-size: 11.5px;
  color: #9aa5b8;
}

.aira-pal-item kbd {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.aira-pal-empty {
  padding: 18px;
  text-align: center;
  color: #9aa5b8;
  font-size: 12.5px;
}

/* =====================================================================
   MODE TELEPON / LIVE VOICE CALL AIRA
   ===================================================================== */
.vc-pill {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.42);
  color: #6ee7b7;
}

.vc-pill:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.65);
}

.vc-pill.is-in-call,
.field .vc-trigger[aria-pressed="true"] {
  background: rgba(16, 185, 129, 0.24);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.vc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  background: radial-gradient(circle at 50% 24%, rgba(16, 185, 129, 0.14), rgba(6, 10, 18, 0.92) 62%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.vc-overlay[hidden] {
  display: none !important;
}

.vc-card {
  width: min(580px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(165deg, rgba(16, 23, 38, 0.96), rgba(9, 13, 24, 0.98));
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.vc-card[data-vc-phase="thinking"] {
  border-color: rgba(56, 189, 248, 0.4);
}

.vc-card[data-vc-phase="speaking"] {
  border-color: rgba(167, 139, 250, 0.45);
}

.vc-card[data-vc-phase="muted"] {
  border-color: rgba(251, 191, 36, 0.36);
}

.vc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vc-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vc-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.45);
}

.vc-card[data-vc-phase="thinking"] .vc-status-badge {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.45);
}

.vc-card[data-vc-phase="speaking"] .vc-status-badge {
  background: rgba(167, 139, 250, 0.2);
  color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.45);
}

.vc-card[data-vc-phase="muted"] .vc-status-badge {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.42);
}

.vc-title {
  font-size: 15px;
  font-weight: 600;
  color: #f1f5f9;
}

.vc-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: #94a3b8;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.vc-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 6px 0 2px;
}

.vc-halo {
  position: relative;
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
}

.vc-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(52, 211, 153, 0.42);
  animation: vcPulse 2.4s ease-out infinite;
}

.vc-ring-2 {
  inset: -10px;
  border-color: rgba(52, 211, 153, 0.2);
  animation-delay: 0.7s;
}

.vc-card[data-vc-phase="thinking"] .vc-ring {
  border-color: rgba(56, 189, 248, 0.5);
  animation-duration: 1.3s;
}

.vc-card[data-vc-phase="speaking"] .vc-ring {
  border-color: rgba(34, 211, 238, 0.6);
  animation-duration: 1.4s;
}

.vc-card[data-vc-phase="muted"] .vc-ring {
  border-color: rgba(251, 191, 36, 0.25);
  animation: none;
}

.vc-core {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #34d399, #0f766e 72%, #0b1322);
  box-shadow: 0 0 36px rgba(16, 185, 129, 0.36);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.28s ease, border-radius 0.32s ease;
}

.vc-card[data-vc-phase="thinking"] .vc-core {
  background: radial-gradient(circle at 35% 30%, #f5b942, #b45309 72%, #0b1322);
  box-shadow: 0 0 38px rgba(245, 185, 66, 0.4);
  border-radius: 28%;
  transform: rotate(45deg) scale(0.95);
}

.vc-card[data-vc-phase="thinking"] .vc-avatar {
  transform: rotate(-45deg);
}

.vc-card[data-vc-phase="speaking"] .vc-core {
  background: radial-gradient(circle at 35% 30%, #22d3ee, #0e7490 72%, #0b1322);
  box-shadow: 0 0 42px rgba(34, 211, 238, 0.45);
  border-radius: 44% 56% 52% 48% / 52% 46% 54% 48%;
  transform: scale(1.06);
}

.vc-card[data-vc-phase="muted"] .vc-core {
  background: radial-gradient(circle at 35% 30%, #fbbf24, #92400e 72%, #0b1322);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.22);
  border-radius: 36%;
}

.vc-avatar {
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  transition: transform 0.28s ease;
}

.vc-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 24px;
}

.vc-wave span {
  width: 3.5px;
  height: 6px;
  border-radius: 999px;
  background: #34d399;
  opacity: 0.72;
  transition: background 0.2s ease;
}

.vc-card[data-vc-phase="listening"] .vc-wave span,
.vc-card[data-vc-phase="speaking"] .vc-wave span {
  animation: vcWave 0.95s ease-in-out infinite;
}

.vc-card[data-vc-phase="speaking"] .vc-wave span {
  background: #22d3ee;
  animation-duration: 0.65s;
}

.vc-card[data-vc-phase="thinking"] .vc-wave span {
  background: #f5b942;
  animation: vcWave 1.25s ease-in-out infinite;
  opacity: 0.6;
}

.vc-card[data-vc-phase="muted"] .vc-wave span {
  background: #fbbf24;
  height: 4px;
  opacity: 0.35;
}

.vc-wave span:nth-child(2) { animation-delay: 0.1s; }
.vc-wave span:nth-child(3) { animation-delay: 0.22s; }
.vc-wave span:nth-child(4) { animation-delay: 0.34s; }
.vc-wave span:nth-child(5) { animation-delay: 0.45s; }
.vc-wave span:nth-child(6) { animation-delay: 0.34s; }
.vc-wave span:nth-child(7) { animation-delay: 0.22s; }
.vc-wave span:nth-child(8) { animation-delay: 0.1s; }
.vc-wave span:nth-child(9) { animation-delay: 0.04s; }

.vc-status-text {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
}

.vc-subhint {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}

.vc-transcripts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vc-msg {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 13px;
}

.vc-msg-user {
  border-color: rgba(52, 211, 153, 0.24);
}

.vc-msg-aira {
  border-color: rgba(91, 140, 255, 0.25);
}

.vc-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.vc-provider-tag {
  font-weight: 500;
  letter-spacing: normal;
  color: #7dd3fc;
}

.vc-msg-body {
  font-size: 13.5px;
  line-height: 1.5;
  color: #e2e8f0;
  max-height: 108px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.vc-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 2px;
}

.vc-ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 66px;
  padding: 10px 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.vc-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.vc-ctrl-btn[aria-pressed="true"].is-muted {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fde68a;
}

.vc-ctrl-primary {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.36);
  color: #bae6fd;
}

.vc-ctrl-hangup {
  background: linear-gradient(145deg, #ef4444, #b91c1c);
  border-color: rgba(248, 113, 113, 0.6);
  color: #ffffff;
}

.vc-ctrl-hangup:hover {
  background: linear-gradient(145deg, #f87171, #dc2626);
}

.vc-mini {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 10010;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 13px;
  border-radius: 999px;
  background: rgba(13, 20, 34, 0.94);
  border: 1px solid rgba(52, 211, 153, 0.45);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
}

.vc-mini[hidden] {
  display: none !important;
}

.vc-mini-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.vc-mini-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.85);
}

.vc-mini[data-vc-phase="speaking"] .vc-mini-dot {
  background: #22d3ee;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.85);
}

.vc-mini[data-vc-phase="thinking"] .vc-mini-dot {
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.85);
}

.vc-mini[data-vc-phase="muted"] .vc-mini-dot {
  background: #fbbf24;
  box-shadow: none;
}

.vc-mini-label {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
}

.vc-mini-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #94a3b8;
}

.vc-mini-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.vc-mini-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.vc-mini-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.vc-mini-btn.is-hangup {
  background: #dc2626;
  border-color: rgba(248, 113, 113, 0.55);
  color: #ffffff;
}

@keyframes vcPulse {
  0% { transform: scale(0.88); opacity: 0.78; }
  70% { transform: scale(1.18); opacity: 0.12; }
  100% { transform: scale(1.24); opacity: 0; }
}

@keyframes vcWave {
  0%, 100% { height: 6px; }
  50% { height: 22px; }
}

@media (max-width: 540px) {
  .vc-card {
    padding: 16px;
    border-radius: 18px;
  }
  .vc-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .vc-mini {
    left: 12px;
    right: 12px;
    bottom: 76px;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vc-ring,
  .vc-wave span {
    animation: none !important;
  }
}


/* ==========================================================================
   RBAC Role-Aware UI/UX (Owner/Komandan vs Clean Chatbot Mode)
   ========================================================================== */
.user-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(91, 140, 255, 0.14);
  border: 1px solid rgba(91, 140, 255, 0.32);
  color: #b7ccff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.user-role-pill[hidden] {
  display: none !important;
}

body.role-owner [data-owner-only="1"] {
  display: revert;
}

body.role-owner #btnTopTreasuryPortal,
body.role-owner #btnTopIntelPortal,
body.role-owner #btnPopoutFloating,
body.role-owner #btnEnterpriseHubTop {
  display: inline-flex !important;
}

body.role-owner #rowDreamIdle {
  display: flex !important;
}

/* Chatbot-Only Role Layout (Clean Avatar + Focused Conversation UI) */
body.role-chatbot [data-owner-only],
body.role-chatbot .presence .ws,
body.role-chatbot .presence .stats,
body.role-chatbot #chatResizer,
body.role-chatbot #tab-log,
body.role-chatbot #tab-notes,
body.role-chatbot #tab-tasks,
body.role-chatbot #tab-cognition,
body.role-chatbot #p-log,
body.role-chatbot #p-notes,
body.role-chatbot #p-tasks,
body.role-chatbot #p-cognition,
body.role-chatbot #airaBriefStrip,
body.role-chatbot #btnCompact,
body.role-chatbot #btnFloatChat,
body.role-chatbot #btnPickerCompact,
body.role-chatbot #btnPickerManage,
body.role-chatbot #sessVaultHeader,
body.role-chatbot #sessPickerVaultList,
body.role-chatbot #fabFloatingCompanion,
body.role-chatbot #wrapModel,
body.role-chatbot #btnModel,
body.role-chatbot #menuModel,
body.role-chatbot #btnSet,
body.role-chatbot #menuSet,
body.role-chatbot #btnCallMode,
body.role-chatbot #settingsDashboardModal,
body.role-chatbot #systemModal,
body.role-chatbot #sessDetailModal,
body.role-chatbot #checkpointModal,
body.role-chatbot #closeSessModal,
body.role-chatbot #autoJobModal,
body.role-chatbot #autoRunDrawer,
body.role-chatbot #repNewModal,
body.role-chatbot #airaEnterpriseHubBackdrop,
body.role-chatbot #airaCmdPalette,
body.role-chatbot [id^="view"]:not(#viewChat),
body.role-chatbot .hint-slash,
body.role-chatbot .hint-floating-link,
body.role-chatbot .aira-report-cue,
body.role-chatbot #slashMenu {
  display: none !important;
}

body.role-chatbot .top {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 6px;
}

body.role-chatbot .main {
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.35fr) !important;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 20px 14px;
  gap: 18px;
}

body.role-chatbot .presence {
  justify-content: center;
  max-width: 520px;
}

body.role-chatbot .chat {
  width: 100%;
  border-radius: 22px;
  border-color: rgba(140, 165, 220, 0.16);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

body.role-chatbot .chat-head {
  padding: 12px 16px;
}

body.role-chatbot .chat-head .tabs {
  gap: 0;
}

body.role-chatbot #tab-chat {
  font-weight: 600;
  cursor: default;
}

body.role-chatbot .foot {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 4px 20px 10px;
}

@media (max-width: 900px) {
  body.role-chatbot .main {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }

  body.role-chatbot .presence {
    flex: none;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 14px;
    background: rgba(16, 22, 36, 0.72);
    border: 1px solid var(--line);
  }

  body.role-chatbot .stage {
    flex: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 2px 0 !important;
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
  }

  body.role-chatbot .stage #orb {
    position: relative !important;
    inset: auto !important;
    width: 52px !important;
    height: 52px !important;
    margin: 0 !important;
  }

  body.role-chatbot .stage .say {
    position: static !important;
    inset: auto !important;
    text-align: left !important;
    padding: 0 !important;
  }
}

@media (max-width: 680px) {
  body.role-chatbot .top,
  body.role-chatbot .main,
  body.role-chatbot .foot {
    padding-left: 10px;
    padding-right: 10px;
  }

  body.role-chatbot .chat {
    border-radius: 16px;
  }
}

/* ==========================================================================
   Owner-Only User Activity & Security Audit Log View (#viewAuditLog)
   ========================================================================== */
.main-audit {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.audit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.audit-kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audit-kpi-label {
  font-size: 11.5px;
  color: var(--mute);
  font-weight: 500;
}

.audit-kpi-val {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
}

.audit-kpi-val.is-ok { color: var(--ok); }
.audit-kpi-val.is-warn { color: var(--warn); }
.audit-kpi-val.is-err { color: var(--err); }
.audit-kpi-val.is-info { color: var(--accent); }

.audit-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.audit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.audit-card-head h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.audit-filters select,
.audit-filters input {
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-family: inherit;
}

.audit-filters input {
  min-width: 210px;
  flex: 1 1 200px;
}

.audit-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.audit-table th,
.audit-table td {
  padding: 9px 11px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.audit-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mute);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.audit-user-row {
  cursor: pointer;
  transition: background 0.14s ease;
}

.audit-user-row:hover {
  background: rgba(91, 140, 255, 0.08);
}

.audit-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.audit-pill.is-ok { background: rgba(52, 226, 154, 0.14); color: #5ef0b4; border: 1px solid rgba(52, 226, 154, 0.3); }
.audit-pill.is-err { background: rgba(255, 92, 92, 0.15); color: #ff8a8a; border: 1px solid rgba(255, 92, 92, 0.34); }
.audit-pill.is-warn { background: rgba(245, 185, 66, 0.15); color: #ffd166; border: 1px solid rgba(245, 185, 66, 0.34); }
.audit-pill.is-info { background: rgba(91, 140, 255, 0.15); color: #9fc0ff; border: 1px solid rgba(91, 140, 255, 0.32); }
.audit-pill.is-neutral { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.25); }

@media (max-width: 960px) {
  .audit-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 580px) {
  .audit-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
