/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

/* Layout */
header {
  background-color: #2c3e50;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

main {
  padding: 1rem;
}

.container {
  display: flex;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
}

.content {
  flex-grow: 1;
}

.section {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
  padding: 1rem;
}

footer {
  text-align: center;
  padding: 1rem;
  color: #666;
  font-size: 0.8rem;
  border-top: 1px solid #ddd;
  margin-top: 2rem;
}

/* Status */
.status {
  display: flex;
  align-items: center;
}

.status-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #e74c3c;
  margin-right: 0.5rem;
}

.status-icon.connected {
  background-color: #2ecc71;
}

.reset-button {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  color: white;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  cursor: pointer;
}
.reset-button:hover {
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Headings */
h1 {
  font-size: 1.5rem;
  font-weight: 500;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #2c3e50;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

/* Heading container for Reconnaissance Data */
.heading-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 15px;
}

.heading-container h2 {
  margin: 0;
}

/* Refresh button */
.refresh-button {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.2s;
}

.refresh-button:hover {
  background-color: #2980b9;
}

.refresh-button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
  opacity: 0.7;
}

.refresh-button.loading {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Tab notifications */
.tab-button.has-new-data {
  position: relative;
}

.tab-indicator-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background-color: #e74c3c;
  border-radius: 50%;
  display: inline-block;
}

/* Clients list */
.clients-list {
  max-height: 200px;
  overflow-y: auto;
}

.client-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 4px;
  background-color: #f5f5f5;
  margin-bottom: 8px;
  transition: background-color 0.2s;
}

.client-item:hover {
  background-color: #eee;
}

.client-item.selected {
  background-color: #e3f2fd;
  border-left: 3px solid #2196f3;
}

.client-item.connected .client-status {
  color: #4caf50;
}

.client-item.connected .client-status::before {
  content: "●";
  margin-right: 4px;
}

.client-info {
  flex: 1;
}

.client-id {
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-all;
}

.client-details {
  font-size: 12px;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-actions {
  display: flex;
  gap: 5px;
}

.client-actions button,
.domain-actions button {
  padding: 5px 8px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s;
}

.view-client,
.view-domain {
  background-color: #2196f3;
  color: white;
}

.export-client,
.export-domain {
  background-color: #4caf50;
  color: white;
}

.delete-client,
.delete-domain {
  background-color: #f44336;
  color: white;
}

.view-client:hover,
.view-domain:hover {
  background-color: #1976d2;
}

.export-client:hover,
.export-domain:hover {
  background-color: #388e3c;
}

.delete-client:hover,
.delete-domain:hover {
  background-color: #d32f2f;
}

/* Injection code */
.injection-instructions {
  margin-top: 1rem;
}

.code-container {
  position: relative;
  margin-top: 0.5rem;
}

pre {
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  max-height: 200px;
}

#copyButton {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
}

#copyButton:hover {
  background-color: #f5f5f5;
}

/* Client info */
.client-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.info-card {
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 0.75rem;
  background-color: #fafafa;
}

.info-label {
  font-weight: bold;
  color: #666;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.info-value {
  font-size: 1rem;
  word-break: break-all;
}

/* Tab system for sidebar (Connected/Domains) */
.tab-container {
  width: 100%;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 10px;
}

.tab {
  padding: 8px 15px;
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  outline: none;
  font-size: 14px;
}

.tab:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.tab.active {
  border-bottom: 2px solid #3498db;
  color: #3498db;
}

/* Content for sidebar tabs */
.sidebar .tab-content {
  display: none;
}

.sidebar .tab-content.active {
  display: block;
}

/* Tab system for data tabs */
.data-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 1rem;
}

.tab-button {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  border-bottom: 2px solid transparent;
}

.tab-button:hover {
  color: #3498db;
}

.tab-button.active {
  color: #3498db;
  border-bottom-color: #3498db;
}

.tab-button.has-new-data {
  position: relative;
}

.tab-button.has-new-data::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background-color: #e74c3c;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.7;
  }
}

/* Content for data tabs */
#dataTabsContent .tab-content {
  min-height: 200px;
  padding: 0.5rem;
}

#dataTabsContent .tab-content.hidden {
  display: none;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 0.5rem;
  text-align: left;
  border: 1px solid #eee;
}

.data-table th {
  background-color: #f8f8f8;
  font-weight: 500;
}

.data-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Command execution */
.command-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.command-selection, .command-params {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-weight: 500;
  color: #333;
}

select, textarea {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 100%;
}

textarea {
  min-height: 100px;
  font-family: 'Courier New', Courier, monospace;
}

button {
  padding: 0.5rem 1rem;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

button:hover {
  background-color: #2980b9;
}

button:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

#executeButton {
  align-self: flex-start;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: #7f8c8d;
  font-style: italic;
}

/* JSON formatting */
.json-viewer {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #eee;
  overflow-x: auto;
  max-height: 300px;
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
  }
  
  .client-info {
    grid-template-columns: 1fr;
  }
}

/* Network monitoring styles */
.network-info-banner {
  background-color: #e8f4f8;
  border-left: 4px solid #03a9f4;
  padding: 10px 15px;
  margin-bottom: 15px;
  font-size: 14px;
  border-radius: 4px;
}

.network-filters {
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.filter-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex-grow: 1;
}

.realtime-indicator {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #2ecc71;
  padding: 4px 8px;
  background-color: #f0fff4;
  border-radius: 4px;
  border: 1px solid #d0f0d9;
  white-space: nowrap;
}

.realtime-indicator .status-icon {
  width: 8px;
  height: 8px;
  margin-right: 6px;
}

/* Add animation for the real-time status indicator */
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.realtime-indicator .status-icon {
  animation: pulse 2s infinite ease-in-out;
}

.note-pill {
  display: inline-block;
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  color: #666;
}

.warning-pill {
  display: inline-block;
  background-color: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  color: #e65100;
}

/* Styles for new network requests */
@keyframes highlight-row {
  0% { background-color: rgba(46, 204, 113, 0.3); }
  100% { background-color: transparent; }
}

.network-table tr.new-request {
  animation: highlight-row 2s ease-out;
}

.info-tooltip {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: #03a9f4;
  color: white;
  border-radius: 50%;
  text-align: center;
  font-size: 11px;
  line-height: 16px;
  cursor: help;
  margin-left: 5px;
}

.custom-tooltip {
  position: absolute;
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  max-width: 250px;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.custom-tooltip:after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  margin-left: -5px;
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: #333 transparent transparent;
}

.network-table {
  table-layout: fixed;
}

.network-table th:nth-child(1) {
  width: 50%;
}

.network-table th:nth-child(2),
.network-table th:nth-child(3),
.network-table th:nth-child(4) {
  width: 12%;
}

.network-table th:nth-child(5) {
  width: 14%;
}

/* Network Details Panel */
.network-details {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.network-details.hidden {
  display: none;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f8f8f8;
  border-bottom: 1px solid #ddd;
}

.details-header h3 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.close-details {
  background: none;
  border: none;
  color: #666;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 5px;
}

.close-details:hover {
  color: #333;
}

.details-content {
  padding: 15px;
  max-height: 500px;
  overflow-y: auto;
}

.details-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.details-section {
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 10px;
  background-color: #fafafa;
}

.details-section h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #333;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

.details-section h5 {
  margin: 15px 0 5px 0;
  font-size: 13px;
  color: #555;
}

.details-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.details-table th, .details-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.details-table th {
  width: 120px;
  color: #666;
  font-weight: 500;
}

.code-block {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 10px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  max-height: 200px;
}

.note-box {
  background-color: #fffde7;
  border: 1px solid #fff9c4;
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 12px;
  color: #5d4037;
  margin-top: 10px;
}

.warning-box {
  background-color: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 12px;
  color: #e65100;
  margin-top: 10px;
}

.error-box {
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 3px;
  padding: 8px 12px;
  font-size: 12px;
  color: #c62828;
  margin-top: 10px;
}

.binary-notice {
  background-color: #e8eaf6;
  border: 1px solid #c5cae9;
  border-radius: 3px;
  padding: 10px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #3f51b5;
}

.error-section {
  background-color: #ffebee;
  border-color: #ffcdd2;
}

.error-section h4 {
  color: #c62828;
}

/* Network row hover effect */
.network-row {
  cursor: pointer;
  transition: background-color 0.2s;
}

.network-row:hover {
  background-color: #e8f4f8;
}

/* Update Banner */
.update-banner {
  background-color: #e1f5fe;
  border-left: 4px solid #03a9f4;
  padding: 10px 15px;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.update-banner strong {
  color: #0288d1;
}

.close-button {
  background: none;
  border: none;
  color: #555;
  font-size: 18px;
  cursor: pointer;
  padding: 0 5px;
}

.close-button:hover {
  color: #000;
}

/* Domain List */
.domains-list {
  margin-top: 10px;
}

.domain-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 4px;
  background-color: #f5f5f5;
  margin-bottom: 8px;
  transition: background-color 0.2s;
}

.domain-item:hover {
  background-color: #eee;
}

.domain-info {
  flex: 1;
}

.domain-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.domain-stats {
  font-size: 12px;
  color: #666;
}

.domain-stats span {
  margin-right: 10px;
}

.domain-actions {
  display: flex;
  gap: 5px;
}

/* Client status indicators */
.client-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
}

.client-status.connected {
  background-color: rgba(76, 175, 80, 0.1);
  color: #4caf50;
}

.client-status.disconnected {
  background-color: rgba(158, 158, 158, 0.1);
  color: #9e9e9e;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: white;
  border-radius: 5px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.close-modal {
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.close-modal:hover {
  color: #333;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.domain-clients-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tab-indicator-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #e74c3c;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

/* Main section tabs (Recon | Teach Mode) */
.main-section-tabs {
  display: flex;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto 1rem;
  border-bottom: 2px solid #ddd;
}

.main-section-tab {
  padding: 0.6rem 1.2rem;
  border: none;
  background: #eee;
  color: #555;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-right: 2px;
}

.main-section-tab:hover {
  background: #e0e0e0;
  color: #333;
}

.main-section-tab.active {
  background: white;
  color: #2c3e50;
  font-weight: 600;
  border: 1px solid #ddd;
  border-bottom-color: white;
  margin-bottom: -2px;
}

.main-section {
  display: none;
  max-width: 1400px;
  margin: 0 auto;
}

.main-section.active {
  display: block;
}

/* Teach Mode panel */
.teach-mode-container {
  flex-direction: column;
}

.teach-mode-desc {
  color: #666;
  margin-top: 0.25rem;
}

.teach-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.teach-mode-row label {
  font-weight: 500;
}

.teach-mode-row select {
  min-width: 200px;
  padding: 0.4rem 0.6rem;
}

.teach-mode-status {
  min-height: 1.5rem;
  color: #666;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.teach-mode-status.error {
  color: #c0392b;
}

.teach-mode-status.success {
  color: #27ae60;
}

.teach-mode-summary {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

.teach-mode-flow-wrap {
  margin: 1rem 0;
}

.teach-mode-flow-title {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.teach-mode-flow-graph {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-height: 80px;
  padding: 0.5rem 0;
}

.teach-mode-flow-graph:empty::before {
  content: 'Process a capture to see the flow.';
  color: #999;
  font-size: 0.9rem;
}

/* Start / End nodes */
.tm-flow-node {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.tm-flow-start {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: #fff;
  box-shadow: 0 1px 3px rgba(39, 174, 96, 0.3);
}

.tm-flow-end {
  background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
  color: #fff;
  box-shadow: 0 1px 3px rgba(41, 128, 185, 0.3);
}

/* Step nodes */
.tm-flow-step {
  background: #fff;
  border: 1px solid #bdc3c7;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  min-width: 200px;
  max-width: 420px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.tm-flow-step-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.tm-flow-step-id {
  background: #34495e;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}

.tm-flow-step-method {
  font-size: 0.8rem;
  font-weight: 700;
  color: #2980b9;
}

.tm-flow-step-name {
  font-size: 0.8rem;
  color: #7f8c8d;
}

.tm-flow-step-url {
  font-size: 0.75rem;
  color: #555;
  word-break: break-all;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.tm-flow-step-vars {
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

.tm-flow-step-vars-title {
  color: #7f8c8d;
  margin-bottom: 0.2rem;
}

.tm-var-pill {
  display: inline-block;
  background: #ecf0f1;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  margin: 0.1rem 0.2rem 0.1rem 0;
  font-size: 0.7rem;
}

.tm-var-pill.input {
  border-color: #3498db;
  background: #ebf5fb;
}

.tm-var-pill.output {
  border-color: #27ae60;
  background: #eafaf1;
}

.tm-flow-edge {
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  color: #95a5a6;
  font-size: 0.8rem;
  min-height: 24px;
}

.tm-flow-edge::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #bdc3c7;
  margin-right: 0.35rem;
}

.tm-dep-badge {
  font-size: 0.65rem;
  color: #8e44ad;
  background: #f5eef8;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: auto;
}

.teach-mode-json-details {
  margin-top: 0.75rem;
}

.teach-mode-json-details summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: #7f8c8d;
}

.teach-mode-json {
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.75rem;
  font-size: 0.8rem;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.teach-mode-variables {
  margin-bottom: 0.75rem;
}

.teach-mode-variables-panel {
  margin-bottom: 0.75rem;
}

.teach-mode-variables-panel h4 {
  margin: 0 0 0.35rem 0;
  font-size: 0.95rem;
}

.teach-mode-variables-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.teach-mode-variables-table th,
.teach-mode-variables-table td {
  border: 1px solid #3d4f5c;
  padding: 0.35rem 0.5rem;
  text-align: left;
}

.teach-mode-variables-table th {
  background: rgba(0,0,0,0.2);
}

.teach-mode-variable-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.teach-mode-replay-blocks {
  margin-top: 0.5rem;
}

.teach-mode-replay-block {
  margin-bottom: 1rem;
}

.teach-mode-replay-block h4 {
  margin: 0 0 0.35rem 0;
  font-size: 0.95rem;
}

.teach-mode-variables .teach-mode-variable-inputs label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.teach-mode-hint {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin: 0 0 0.5rem 0;
}

.teach-mode-replay-action {
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
}

.teach-mode-variables input {
  padding: 0.35rem 0.5rem;
  width: 160px;
}

.teach-mode-variable-inputs input {
  padding: 0.35rem 0.5rem;
  width: 160px;
}

/* Replay section tabs (Node View | Chat View) */
.teach-mode-replay-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #3d4f5c;
}
.teach-mode-replay-tab {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  color: #b0b0b0;
  cursor: pointer;
  font-size: 0.9rem;
}
.teach-mode-replay-tab:hover {
  color: #fff;
  background: rgba(4, 164, 146, 0.15);
}
.teach-mode-replay-tab.active {
  background: #1a1e24;
  color: #04A492;
  border-color: #3d4f5c;
  border-bottom: 1px solid #1a1e24;
  margin-bottom: -1px;
}
.teach-mode-replay-panel {
  margin-top: 0.5rem;
}
.teach-mode-replay-panel[hidden] {
  display: none !important;
}

/* Chat View */
.teach-mode-chat-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.teach-mode-schema-status {
  font-size: 0.85rem;
  color: #7f8c8d;
}
.teach-mode-chat-list {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #3d4f5c;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #0d1117;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.teach-mode-chat-msg {
  max-width: 85%;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}
.teach-mode-chat-msg.user {
  align-self: flex-end;
  background: #04A492;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.teach-mode-chat-msg.assistant {
  align-self: flex-start;
  background: #2d3748;
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}
.teach-mode-chat-input-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.teach-mode-chat-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #3d4f5c;
  border-radius: 6px;
  background: #1a1e24;
  color: #fff;
  font-size: 0.9rem;
}
.teach-mode-chat-input:focus {
  outline: none;
  border-color: #04A492;
}
.teach-mode-chat-input::placeholder {
  color: #888;
}

/* Replay view (step-first tree) */
.teach-mode-replay-view-toolbar {
  margin-bottom: 0.75rem;
}
.teach-mode-replay-tree-wrap {
  margin-top: 0.5rem;
  position: relative;
  min-height: 120px;
}
.teach-mode-replay-tree-wrap .teach-mode-replay-tree-svg-edges {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.teach-mode-replay-tree-wrap .teach-mode-replay-tree-edge {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.teach-mode-replay-tree-wrap .teach-mode-replay-tree-edge.teach-mode-replay-tree-edge-visible {
  opacity: 1;
}
.teach-mode-replay-tree-steps-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 4rem;
  position: relative;
  z-index: 1;
}
.teach-mode-replay-tree-step {
  padding: 0.4rem 0.75rem;
  border: 1px solid #555;
  border-radius: 6px;
  background: #2a2a2a;
  color: #e8e8e8;
  font-size: 0.9rem;
  min-width: 2.5rem;
  text-align: center;
}
.teach-mode-replay-tree-step.completed {
  background: #0d5c0d;
  border-color: #0a4a0a;
  color: #fff;
}
.teach-mode-replay-tree-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}
.teach-mode-replay-tree-node {
  padding: 0.5rem 1rem;
  border: 1px solid #04A492;
  border-radius: 6px;
  background: #1a1e24;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
.teach-mode-replay-tree-node:hover {
  background: #04A492;
  color: #fff;
}
.teach-mode-run-replay-output-wrap {
  margin-top: 1rem;
}
.teach-mode-run-replay-output-wrap h4 {
  margin-bottom: 0.5rem;
}
.teach-mode-prompt-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.teach-mode-prompt-modal-inner {
  background: #1a1e24;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 1.25rem;
  min-width: 320px;
  color: #e8e8e8;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.teach-mode-prompt-modal-inner h4 {
  margin-top: 0;
  color: #fff;
  font-size: 1.1rem;
}
.teach-mode-prompt-modal-inner p {
  margin: 0.5rem 0;
  color: #d0d0d0;
  font-size: 0.95rem;
}
.teach-mode-prompt-modal-inner input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  box-sizing: border-box;
  background: #2a2a2a;
  border: 1px solid #555;
  border-radius: 6px;
  color: #fff;
  font-size: 1rem;
}
.teach-mode-prompt-modal-inner input::placeholder {
  color: #888;
}
.teach-mode-prompt-modal-inner input:focus {
  outline: none;
  border-color: #04A492;
  box-shadow: 0 0 0 2px rgba(4, 164, 146, 0.25);
}
.teach-mode-prompt-modal-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.teach-mode-prompt-modal-actions button {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid #555;
  background: #2a2a2a;
  color: #e8e8e8;
}
.teach-mode-prompt-modal-actions button:hover {
  background: #04A492;
  border-color: #04A492;
  color: #fff;
}
.teach-mode-prompt-modal-actions button:first-of-type {
  background: #04A492;
  border-color: #04A492;
  color: #fff;
}
.teach-mode-prompt-modal-actions button:first-of-type:hover {
  background: #059b8a;
  border-color: #059b8a;
} 