:root {
  --header-bg: #1a1a2e;
  --accent: #00d4ff;
  --accent-hover: #00a8cc;
  --menu-bg: #16213e;
  --menu-selected: #00d4ff;
  --main-bg: #0f0f1e;
  --surface: #1a1a2e;
  --border: #2a2a3e;
  --text: #e8e8ed;
  --text-muted: #888;
  --error: #ff6b6b;
}

.poweredby{
  color:#00d4ff !important;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.5px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--main-bg);
}
.clear { clear: both; }
.app-row {
  display: flex;
  width: 80%;
  max-width: none;
  margin: 0 auto;
  min-height: calc(100vh - 120px);
}
.left-column {
  display: flex;
  flex: 1;
  min-width: 0;
  background: var(--main-bg);
}

#header {
  width: 80%;
  margin: 0 auto;
  padding: 10px 20px;
  background: var(--header-bg);
  border-bottom: 5px solid var(--accent);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#header h1 {
  margin: 0;
  font-size: 1.25rem;
  color: #fff;
}
#header a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
}
#header a:hover { text-decoration: underline; }
#session_info {
  display: flex;
  align-items: center;
  gap: 12px;
}
#session_info .user { color: var(--text-muted); }
#session_info button, .btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  background: var(--menu-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
}
#session_info button:hover, .btn:hover {
  background: var(--accent);
  color: #1e1e1e;
  border-color: var(--accent);
}

#container {
  flex: 1;
  display: flex;
  min-width: 0;
  background: var(--main-bg);
}
#main_menu {
  width: 200px;
  flex-shrink: 0;
  padding: 15px 0;
  background: var(--main-bg);
}
#main_menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#main_menu li {
  border: 1px solid var(--border);
  margin-bottom: 3px;
  background: var(--menu-bg);
}
#main_menu li a {
  display: block;
  padding: 8px 15px;
  color: var(--text);
  text-decoration: none;
}
#main_menu li:hover, #main_menu li:hover a {
  background: #444;
  color: #fff;
}
#main_menu li.selected {
  background: var(--menu-selected);
  border-color: var(--menu-selected);
}
#main_menu li.selected a { color: #1e1e1e; font-weight: bold; }

#main_body {
  flex: 1;
  min-width: 0;
  padding: 20px;
  min-height: 400px;
}
.body_padded { padding-left: 20px; padding-right: 20px; }

.panel { display: none; }
.panel.active { display: block; }

.payload-line-tabs { display: flex; gap: 2px; margin-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.payload-line-tabs button { padding: 6px 12px; font: inherit; cursor: pointer; background: var(--menu-bg); border: 1px solid var(--border); border-bottom: none; border-radius: 4px 4px 0 0; color: var(--text); }
.payload-line-tabs button:hover { background: #444; }
.payload-line-tabs button.active { background: var(--menu-selected); color: #1e1e1e; font-weight: bold; }
.payload-line-tab { display: none; padding: 12px 0; border: 1px solid var(--border); border-top: none; border-radius: 0 0 4px 4px; padding: 12px; }
.payload-line-tab.active { display: block; }

h2 { font-size: 160%; margin-top: 0; color: var(--text); }
h3 { font-size: 130%; margin-top: 1em; }
label { display: block; margin-bottom: 4px; color: var(--text-muted); }
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 80%;
  max-width: 500px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}
select { cursor: pointer; }
textarea { min-height: 100px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
.form-group { margin-bottom: 1rem; }
button[type="submit"], .btn-primary {
  padding: 8px 16px;
  font-weight: bold;
  cursor: pointer;
  background: var(--accent);
  color: #1e1e1e;
  border: none;
  border-radius: 4px;
}
button[type="submit"]:hover, .btn-primary:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.text-muted { color: var(--text-muted); margin-bottom: 0.5rem; }
.message { margin: 10px 0; padding: 10px; border: 1px solid var(--border); background: var(--surface); }
.message.error { border-color: var(--error); color: var(--error); }
.message.success { border-color: var(--accent); color: var(--accent); }

.output-box {
  min-height: 80px;
  padding: 12px;
  margin-top: 1rem;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}
.output-box.empty { color: var(--text-muted); }
.output-box.error { border-color: var(--error); color: var(--error); }
.output-box.loading { color: var(--text-muted); }

/* Tabbed output area */
.output-container {
  margin-top: 1.5rem;
}
.output-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
}
.output-tabs .tab-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  color: var(--text-muted);
  transition: all 0.2s;
}
.output-tabs .tab-btn:hover {
  background: #333;
  color: var(--text);
}
.output-tabs .tab-btn.active {
  background: var(--accent);
  color: #1e1e1e;
  border-color: var(--accent);
}
.output-tabs .tab-btn.has-content {
  color: var(--text);
}
.output-container .output-box {
  margin-top: 0;
  border-top-left-radius: 0;
}
.output-box.thinking {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--border);
  color: #c0c0c0;
  font-style: italic;
}

.doc-list { margin: 10px 0; }
.doc-list select { max-width: 400px; padding: 6px; }
.vulnerable_code_area {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
}

/* Model selection box (Direct Injection) */
.model-select-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  max-width: 560px;
}
.model-select-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.model-select-row:last-child {
  margin-bottom: 0;
}
.model-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin: 0;
  font-weight: 600;
  color: var(--text);
  min-width: 10em;
}
.model-radio-label input {
  width: auto;
  max-width: none;
}
.model-select-input {
  width: auto;
  min-width: 12rem;
  max-width: 20rem;
  padding: 6px 8px;
  font-size: 0.9rem;
}

/* Sampling options help box (Direct Injection) */
.sampling-help-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  max-width: 560px;
  margin-top: 10px;
}
.sampling-help-box .sampling-help-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem 0;
  letter-spacing: 0.02em;
}
.sampling-option-row {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.sampling-option-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sampling-option-row .opt-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.sampling-option-row label {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  min-width: 7em;
}
.sampling-option-row input[type="number"] {
  width: 6rem;
  max-width: none;
  padding: 6px 8px;
  font-size: 0.9rem;
}
.sampling-option-row .opt-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-left: 0;
}
.sampling-option-row .opt-range {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 2px;
}
#footer {
  width: 80%;
  margin: 0 auto;
  padding: 10px;
  text-align: center;
  color: var(--text-muted);
  background: var(--header-bg);
  border-top: 5px solid var(--accent);
  font-size: 12px;
}
.results-table {
  width: 80%;
  border-collapse: collapse;
  font-size: 12px;
}
.results-table th, .results-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.results-table th { background: var(--menu-bg); }
.results-table .pass { color: var(--accent); }
.results-table .fail { color: var(--error); }
.results-table .preview { white-space: pre-wrap; word-break: break-word; max-width: 40em; }
.results-table .prompt-cell { white-space: pre-wrap; word-break: break-word; max-width: 36em; }
.results-table.response-table { margin-top: 1rem; }
.results-table.response-table .response-cell { white-space: pre-wrap; word-break: break-word; max-width: 60em; min-width: 20em; }

/* Experiment response Answer | Thinking tabs */
.exp-response-tabs-wrap { margin: 0; }
.exp-response-tabs { display: flex; gap: 2px; margin-bottom: 6px; }
.exp-response-tab {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px 4px 0 0;
  color: var(--text-muted);
}
.exp-response-tab:hover { color: var(--text); background: #333; }
.exp-response-tab.active { background: var(--accent); color: #1e1e1e; border-color: var(--accent); }
.exp-response-content {
  white-space: pre-wrap;
  word-break: break-word;
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
  margin-top: -1px;
}
.exp-response-thinking { font-style: italic; color: var(--text-muted); font-size: 0.95em; }

#terminal_sidebar {
  width: 32%;
  min-width: 280px;
  flex-shrink: 0;
  background: #0d0d0d;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
}
#terminal_sidebar h3 {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* Tabbed response history in Experiment output panel */
.terminal-response-history {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}
.terminal-response-item {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  margin: 0;
}
.terminal-response-item:last-child {
  border-bottom: none;
}
.terminal-output-tabs {
  margin: 0;
  padding: 8px 12px 0 12px;
  border-bottom: none;
  min-height: auto;
  display: flex;
  gap: 2px;
}
.terminal-output-tabs .tab-btn {
  padding: 6px 12px;
  font-size: 11px;
  background: rgba(0,0,0,0.3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px 4px 0 0;
  cursor: pointer;
}
.terminal-output-tabs .tab-btn:hover {
  background: #444;
  color: var(--text);
}
.terminal-output-tabs .tab-btn.active {
  background: var(--accent);
  color: #1e1e1e;
  border-color: var(--accent);
}
.terminal-response-box {
  padding: 10px 12px 12px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c0c0c0;
  max-height: 280px;
  overflow-y: auto;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  border-top: 1px solid var(--border);
}
.terminal-response-box.terminal-thinking {
  font-style: italic;
  color: #a0a0a0;
}
.terminal-response-label {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
}

#terminal_output {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c0c0c0;
  min-height: 200px;
}
#terminal_output .line-pass { color: var(--accent); }
#terminal_output .line-fail { color: var(--error); }
#terminal_output .line-muted { color: var(--text-muted); }
#terminal_output pre.terminal-json {
  margin: 0.5rem 0 0 0;
  padding: 10px;
  font-size: 11px;
  line-height: 1.35;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c0c0c0;
  max-height: none;
}

/* Warning banner for intentionally vulnerable app */
#warning-banner {
  width: 80%;
  margin: 0 auto;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
  border-bottom: 3px solid #c92a2a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: pulse-warning 2s ease-in-out infinite;
}

.warning-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  gap: 12px;
}

.warning-icon {
  font-size: 24px;
  animation: shake 0.5s ease-in-out infinite;
}

.warning-text {
  font-size: 14px;
  color: #fff;
  text-align: center;
  letter-spacing: 0.5px;
}

.warning-text strong {
  font-weight: bold;
  text-transform: uppercase;
}

@keyframes pulse-warning {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.85;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px) rotate(-2deg);
  }
  75% {
    transform: translateX(2px) rotate(2deg);
  }
}

/* Genbounty promotional box */
.promo-box {
  margin: 15px 0 0 0;
  padding: 15px;
  background: #1f132e;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  width: 100%;
  box-sizing: border-box;
}

.promo-text {
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.promo-logo {
  max-width: 140px;
  height: auto;
  display: block;
  margin: 0 auto 12px auto;
  border-radius: 4px;
  background: #fff;
  padding: 6px;
}

.promo-button {
  display: inline-block;
  padding: 8px 16px;
  background: #fff;
  color: #1e3a8a;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.promo-button:hover {
  background: #f0f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.promo-button:active {
  transform: translateY(0);
}

/* Agentic: multi-round conversation and structured steps */
.agentic-conversation {
  min-height: 120px;
  max-height: 360px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.agentic-round {
  margin-bottom: 1rem;
}
.agentic-round:last-child { margin-bottom: 0; }
.agentic-msg-user {
  margin-bottom: 0.5rem;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.2);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}
.agentic-msg-user .agentic-role { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.agentic-msg-assistant {
  margin-bottom: 0.5rem;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 4px solid #22c55e;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}
.agentic-msg-assistant .agentic-role { font-size: 10px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.agentic-thinking-toggle {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.agentic-thinking-toggle:hover { color: var(--accent); }
.agentic-thinking-steps {
  margin-top: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 11px;
  line-height: 1.4;
  color: #c0c0c0;
}
.agentic-step-block {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}
.agentic-step-block:last-child { margin-bottom: 0; }
.agentic-step-title { font-weight: 600; color: var(--accent); margin-bottom: 6px; font-size: 11px; }
.agentic-step-reasoning, .agentic-step-thought, .agentic-step-action, .agentic-step-observation {
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}
.agentic-step-reasoning { font-style: italic; color: #a0a0a0; }
.agentic-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 1rem; }
.agentic-tool-checkboxes { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.agentic-tool-checkboxes label { font-size: 12px; cursor: pointer; }
.agentic-options-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.agentic-prompt-row { display: flex; flex-direction: column; gap: 8px; }
.agentic-scenarios { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.agentic-scenarios .text-muted { margin-right: 4px; }
.agentic-scenario-btn { font-size: 11px; padding: 4px 8px; }
.agentic-tools-used { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
