.undef-hijack, .undef-hijack * { box-sizing: border-box; }

.undef-hijack {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #0b0f14;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 13px;
  overflow: hidden;
}

/* ── Toolbar ── */
.undef-hijack .hijack-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #141920;
  border-bottom: 1px solid #1e2530;
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 38px;
}

.undef-hijack .hijack-status {
  font-size: 12px;
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.undef-hijack .hijack-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #444;
  flex-shrink: 0;
}
.undef-hijack .hijack-status-dot.live { background: #22c55e; box-shadow: 0 0 4px #22c55e; }
.undef-hijack .hijack-status-dot.warn { background: #f59e0b; box-shadow: 0 0 4px #f59e0b; }
.undef-hijack .hijack-status-dot.bad  { background: #ef4444; box-shadow: 0 0 4px #ef4444; }

.undef-hijack .hijack-controls {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.undef-hijack .hbtn {
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid #2a3040;
  background: #1e2530;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.5;
}
.undef-hijack .hbtn:hover:not(:disabled) { border-color: #3a4555; background: #253040; color: #fff; }
.undef-hijack .hbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.undef-hijack .hbtn.primary { border-color: #22c55e55; color: #22c55e; }
.undef-hijack .hbtn.primary:hover:not(:disabled) { background: #22c55e22; border-color: #22c55e; }
.undef-hijack .hbtn.danger { border-color: #ef444455; color: #ef4444; }
.undef-hijack .hbtn.danger:hover:not(:disabled) { background: #ef444422; border-color: #ef4444; }

.undef-hijack .hijack-prompt {
  margin-left: auto;
  font-size: 11px;
  color: #4a6080;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* ── Terminal area ── */
.undef-hijack .hijack-terminal {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ── Text input row (visible when hijacked by me) ── */
.undef-hijack .hijack-input-row {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #141920;
  border-top: 1px solid #1e2530;
  flex-shrink: 0;
}
.undef-hijack .hijack-input-row.visible { display: flex; }
.undef-hijack .hijack-input-field {
  flex: 1;
  background: #0d1117;
  border: 1px solid #2a3040;
  border-radius: 4px;
  color: #e2e8f0;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  padding: 3px 8px;
  outline: none;
}
.undef-hijack .hijack-input-field:focus { border-color: #22c55e66; }
.undef-hijack .hijack-input-send {
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid #22c55e55;
  background: #22c55e22;
  color: #22c55e;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.undef-hijack .hijack-input-send:hover { background: #22c55e33; border-color: #22c55e; }

/* ── Analysis panel ── */
.undef-hijack .hijack-analysis {
  border-top: 1px solid #1e2530;
  flex-shrink: 0;
  max-height: 130px;
  overflow-y: auto;
  background: #0d1117;
}
.undef-hijack .hijack-analysis summary {
  padding: 4px 10px;
  font-size: 11px;
  color: #4a6080;
  cursor: pointer;
  user-select: none;
  background: #141920;
  border-bottom: 1px solid #1e2530;
  list-style: none;
}
.undef-hijack .hijack-analysis summary::-webkit-details-marker { display: none; }
.undef-hijack .hijack-analysis summary::before { content: '▶ '; font-size: 9px; }
.undef-hijack .hijack-analysis[open] summary::before { content: '▼ '; font-size: 9px; }
.undef-hijack .hijack-analysis summary:hover { color: #8899aa; }
.undef-hijack .hijack-analysis pre {
  margin: 0;
  padding: 6px 10px;
  font-size: 11px;
  color: #8899aa;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
}

/* ── Scrollbar ── */
.undef-hijack .hijack-analysis::-webkit-scrollbar { width: 5px; }
.undef-hijack .hijack-analysis::-webkit-scrollbar-track { background: transparent; }
.undef-hijack .hijack-analysis::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 3px; }

/* ── Mobile key toolbar ── */
.undef-hijack .mobile-keys {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px 8px;
  background: #141920;
  border-top: 1px solid #1e2530;
  flex-shrink: 0;
}
.undef-hijack .mobile-keys.visible { display: flex; }
.undef-hijack .mkey {
  padding: 4px 9px;
  border-radius: 4px;
  border: 1px solid #2a3040;
  background: #1e2530;
  color: #ccd6e8;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
  transition: background 0.1s, border-color 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.undef-hijack .mkey:hover { background: #253040; border-color: #3a4555; color: #fff; }
.undef-hijack .mkey:active { background: #22c55e22; border-color: #22c55e66; }
