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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Helvetica", "Arial", sans-serif;
  background-color: #f5f5f5;
  color: #2e2e38;
}

.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  background-color: #1a1a24;
  border-color: #000;
  border-style: none;
  border-width: 0;
  display: flex;
  height: 2.8571428571rem;
  min-width: 2.8571428571rem;
  width: 2.8571428571rem;
}

.header-logo a {
  display: inline-flex;
  height: 100%;
  padding: 0.3571428571rem 5px;
  text-decoration: none;
  width: 100%;
  align-items: center;
  border-radius: 0.1785714286rem;
  box-sizing: border-box;
  justify-content: center;
}

.app-title {
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.icon {
  font-size: 20px;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Top Header */
.top-header {
  background-color: #ffffff;
  padding: 16px 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #747480;
}

.breadcrumb a {
  color: #747480;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #2e2e38;
}

.separator {
  color: #c4c4c4;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-label {
  font-size: 14px;
  color: #747480;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e0e0;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2e2e38;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.more-menu {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #747480;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Settings Container */
.settings-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  width: 100%;
}

.settings-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #2e2e38;
  margin-top: 25px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 32px;
}

.tab {
  background: none;
  border: none;
  padding: 12px 0;
  font-size: 15px;
  color: #747480;
  cursor: pointer;
  position: relative;
  font-weight: 500;
}

.tab.active {
  color: #2e2e38;
}

.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #2e2e38;
}

/* Profile Image Section */
.profile-image-section {
  position: relative;
  margin-bottom: 40px;
  border-radius: 12px;
  overflow: hidden;
}

.profile-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.image-toggle {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.toggle-dot {
  width: 20px;
  height: 20px;
  background-color: #2e2e38;
  border-radius: 50%;
  transition: transform 0.3s;
}

/* Personal Info */
.personal-info {
  background-color: #ffffff;
  padding: 32px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2e2e38;
}

.section-description {
  font-size: 14px;
  color: #747480;
  margin-bottom: 24px;
}

.info-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: #747480;
  font-size: 18px;
}

.form-input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  color: #2e2e38;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #2e2e38;
}

.form-input::placeholder {
  color: #c4c4c4;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-secondary {
  background-color: #f5f5f5;
  color: #2e2e38;
  border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
  background-color: #ebebeb;
}

.btn-primary {
  background-color: #2e2e38;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #1e1e28;
}

/* Design Section */
.design-section {
  background-color: #ffffff;
  padding: 32px;
  border-radius: 12px;
}

.section-label {
  font-size: 12px;
  color: #747480;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.design-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2e2e38;
}

.design-description {
  font-size: 14px;
  color: #747480;
  line-height: 1.6;
}

footer {
  background-color: #fff;
  border-color: #e6e6e9;
  border-width: 1px 0 0 0;
  padding-top: 0.7142857143rem;
  padding-right: 2.2857142857rem;
  padding-bottom: 0.7142857143rem;
  padding-left: 2.2857142857rem;
  color: #2e2e38;
}

.text-link {
  color: #2e2e38;
  display: inline-flex;
  font-style: normal;
  background: transparent;
  outline: none;
  position: relative;
  text-decoration: none;
  align-items: center;
  border: none;
  padding: 0px;
  border-radius: 2px;
  font-size: 14px;
}

.body-3-light {
  font-weight: 300;
  font-size: 0.857rem;
}

.mt-5 {
  margin-top: 5px;
}

/* Responsive */
@media (max-width: 768px) {
  .settings-container {
    padding: 20px 16px;
  }

  .profile-image {
    height: 200px;
  }

  .tabs {
    gap: 16px;
  }

  .tab {
    font-size: 14px;
  }
}
/* Status Dashboard Styles */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.status-card, .subsystem-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.subsystem-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.subsystem-card h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2e2e38;
}

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.up {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.degraded {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.down {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.status-detail:last-child {
    border-bottom: none;
}

.status-detail-label {
    color: #666;
    font-weight: 500;
}

.status-detail-value {
    color: #2e2e38;
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: break-word;
}

.status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-icon.up {
    background-color: #28a745;
}

.status-icon.degraded {
    background-color: #ffc107;
}

.status-icon.down {
    background-color: #dc3545;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FFE600;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.refresh-info {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 12px;
}

/* Code Block Styles */
.code-block-container {
    background: #2e2e38;
    border-radius: 8px;
    overflow: hidden;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.code-block-header {
    background: #1a1a24;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3a48;
}

.code-block-header span {
    color: #a8a8b8;
    font-size: 13px;
    font-weight: 500;
}

.copy-btn {
    background: transparent;
    border: 1px solid #4a4a58;
    color: #a8a8b8;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #3a3a48;
    border-color: #FFE600;
    color: #FFE600;
}

.copy-btn.copied {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.code-block {
    background: #2e2e38;
    color: #e8e8e8;
    padding: 20px;
    margin: 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* Configuration Section Styles */
.config-section {
    margin-top: 16px;
}

.config-title {
    font-size: 16px;
    font-weight: 600;
    color: #2e2e38;
    margin: 0 0 12px 0;
}

.config-description {
    color: #666;
    margin: 0 0 16px 0;
    font-size: 14px;
}

/* Parameter Table Styles */
.param-table-container {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.param-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.param-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #2e2e38;
    white-space: nowrap;
}

.param-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #495057;
}

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

.param-table tr:hover {
    background: #f8f9fa;
}

.param-table .section-header {
    background: #e9ecef;
    font-weight: 600;
}

.param-table .section-header:hover {
    background: #e9ecef;
}

.param-table .section-header td {
    padding: 10px 16px;
    color: #2e2e38;
    border-bottom: 1px solid #dee2e6;
}

.param-table code {
    background: #f8f9fa;
    padding: 3px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    color: #e83e8c;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.required {
    background: #f8d7da;
    color: #721c24;
}

.badge.optional {
    background: #d4edda;
    color: #155724;
}

.config-table {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.config-row {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.config-row:last-child {
    border-bottom: none;
}

.config-key {
    flex: 0 0 250px;
    font-weight: 600;
    color: #2e2e38;
}

.config-key code {
    background: #2e2e38;
    color: #FFE600;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
}

.config-value {
    flex: 1;
    color: #666;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 16px;
    margin-top: 20px;
    border-radius: 4px;
}

.info-box a {
    color: #2196F3;
    text-decoration: none;
    font-weight: 500;
}

.info-box a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .config-row {
        flex-direction: column;
        gap: 8px;
    }

    .config-key {
        flex: none;
    }
}

/* Technology Links */
.tech-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #2e2e38;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.tech-link:hover {
    background: #0078D4;
    color: white;
    border-color: #0078D4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 120, 212, 0.2);
}

.tech-link svg {
    flex-shrink: 0;
}

/* Embedded chat UI */
.chat-shell {
  border: 1px solid #d8d8e2;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fc 100%);
  overflow: hidden;
}

/* Maximized chat shell — fills viewport */
.chat-shell--maximized {
  position: fixed;
  inset: 0;
  z-index: 900;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
}

.chat-shell--maximized .chat-log {
  flex: 1;
  max-height: none;
  min-height: 0;
}

.chat-shell--maximized .chat-form {
  flex-shrink: 0;
}

body.chat-maximized {
  overflow: hidden;
}

.chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e4e5ef;
  background: #f1f2f9;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-status {
  font-size: 13px;
  color: #5a5a69;
  font-weight: 600;
}

.chat-status-inline {
  padding: 9px 12px;
  border-top: 1px solid #e4e5ef;
  background: #f7f8fc;
  color: #4e5567;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.diagram-validation-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #bfdcc5;
  background: #edf9f0;
  color: #1d6b34;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.agent-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
}

.agent-selector-label {
  font-size: 12px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
  color: #4f566d;
  white-space: nowrap;
  line-height: 1;
}

.agent-selector {
  padding: 0 18px 0 0;
  border: none;
  border-radius: 0;
  background-color: transparent;
  color: #2e2e38;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-width: 190px;
  max-width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
  line-height: 1;
  height: 18px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' stroke='%23666b7e' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1px center;
}

.agent-selector:hover {
  background-color: transparent;
}

.agent-selector:focus {
  outline: none;
  box-shadow: none;
}

.chat-log {
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 90%;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  font-size: 12px;
}

.chat-msg.user {
  align-self: flex-end;
  background: #2e2e38;
  color: #ffffff;
  border-color: #1f1f27;
}

.chat-msg.agent {
  align-self: flex-start;
  background: #ffffff;
  color: #24242b;
  border-color: #dfe1ee;
}

.chat-msg-label {
  font-size: 11px;
  opacity: 0.8;
  margin-bottom: 4px;
  font-weight: 700;
}

.chat-msg-text {
  font-size: 12px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}

.chat-form {
  border-top: 1px solid #e4e5ef;
  padding: 10px;
  background: #ffffff;
}

.chat-input-wrap {
  position: relative;
  border: 1px solid #cfd3e6;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.chat-input-wrap:focus-within {
  border-color: #6f738c;
  box-shadow: 0 0 0 2px rgba(111, 115, 140, 0.12);
}

.agent-inline-picker {
  position: absolute;
  top: 9px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  border: 1px solid #d8dced;
  border-radius: 8px;
  background: #f9fafe;
  max-width: calc(100% - 24px);
}

.agent-inline-picker:focus-within {
  border-color: #6f738c;
  box-shadow: 0 0 0 2px rgba(111, 115, 140, 0.12);
}

.chat-input {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  border: none;
  border-radius: 10px;
  padding: 40px 12px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #23232a;
  background: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
}

.chat-input:focus {
  outline: none;
  box-shadow: none;
}

.chat-actions {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eceef7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-hint {
  font-size: 11px;
  color: #8a8ea4;
}

/* Attachment UI */
.attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 0;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef0f8;
  border: 1px solid #d0d2df;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  color: #2e2e38;
  max-width: 220px;
}

.attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-remove {
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #747480;
  padding: 0 2px;
}

.attachment-remove:hover {
  color: #dc3545;
}

.chat-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-control-divider {
  width: 1px;
  height: 18px;
  background: #d9dceb;
  display: inline-block;
}

.attach-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-icon-btn svg {
  display: block;
}

@media (max-width: 768px) {
  .chat-log {
    max-height: 340px;
    min-height: 220px;
  }

  .chat-msg {
    max-width: 100%;
  }
}

/* ---- Mermaid diagram in chat messages ---- */
.mermaid-container {
  margin: 10px 0 4px;
  border: 1px solid #d0d2df;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.mermaid-loading {
  padding: 12px 16px;
  font-size: 13px;
  color: #747480;
  font-style: italic;
}

.mermaid-diagram {
  padding: 16px;
  overflow-x: auto;
  display: flex;
  justify-content: center;
}

.mermaid-diagram svg {
  max-width: 100%;
  height: auto;
}

.mermaid-diagram-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #e4e5ef;
  background: #f7f8fc;
}

.mermaid-diagram-actions .btn {
  font-size: 12px;
  padding: 5px 12px;
}

.mermaid-error {
  padding: 10px 14px;
  font-size: 13px;
  color: #721c24;
  background: #f8d7da;
  border-bottom: 1px solid #f5c6cb;
}

.mermaid-source-fallback {
  padding: 12px 14px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #2e2e38;
  background: #f4f4f4;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ---- Full-screen diagram modal ---- */
.diagram-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow: hidden;
  min-height: 0;
}

.diagram-modal {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
}

.diagram-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f1f2f9;
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
  gap: 10px;
}

.diagram-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #2e2e38;
  margin: 0;
}

.diagram-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.diagram-modal-scope-badge {
  font-size: 11px;
}

.diagram-modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.diagram-modal-actions .btn {
  font-size: 13px;
  padding: 6px 14px;
}

.diagram-modal-body {
  padding: 16px;
  overflow: hidden;
  min-height: 200px;
}

.diagram-modal-svg {
  transform-origin: center center;
  display: flex;
  justify-content: center;
}

.diagram-modal-svg svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .diagram-modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  .diagram-modal {
    border-radius: 0;
    min-height: 100vh;
  }
}



/* ─── Coaching workspace two-panel layout ─── */
.coaching-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.coaching-chat-col {
  width: 420px;
  min-width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e0e0e0;
  background: #fff;
  overflow: hidden;
  min-height: 0;
}

.coaching-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #e4e5ef;
  background: #f1f2f9;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.coaching-col-title {
  font-size: 15px;
  font-weight: 600;
  color: #2e2e38;
  margin: 0;
}

/* Chat shell fills the remaining height in the left column */
.coaching-chat-col .chat-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  background: #fff;
  overflow: hidden;
  min-height: 0;
}

.coaching-chat-col .chat-log {
  flex: 1;
  max-height: none;
  min-height: 0;
}

/* Right coaching content column */
.coaching-content-col {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f5f5f8;
}

/* ─── Agent activity widget ─── */
.agent-activity-card {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.25s;
  flex-shrink: 0;
}

.agent-activity-card.aac--thinking { border-color: #ffe600; }
.agent-activity-card.aac--responding { border-color: #5a9eed; }
.agent-activity-card.aac--error { border-color: #dc3545; }

.aac-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aac-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  background: #2e2e38;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aac-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.25s;
}

.aac--thinking .aac-pulse,
.aac--responding .aac-pulse {
  animation: aac-pulse-anim 1.2s ease-in-out infinite;
}

.aac--thinking .aac-pulse { border-color: #ffe600; }
.aac--responding .aac-pulse { border-color: #5a9eed; }

@keyframes aac-pulse-anim {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.55; }
}

.aac-name {
  font-size: 13px;
  font-weight: 700;
  color: #2e2e38;
}

.aac-status {
  font-size: 12px;
  color: #747480;
  margin-top: 2px;
  min-width: 90px;
  transition: color 0.2s;
}

.aac--thinking .aac-status,
.aac--responding .aac-status {
  color: #2e2e38;
  font-weight: 600;
}

/* Three-dot thinking animation */
.thinking-indicator {
  display: none;
  align-items: center;
  gap: 5px;
}

.thinking-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffe600;
  display: inline-block;
  animation: bounce-dot 1.2s ease-in-out infinite;
}

.thinking-indicator span:nth-child(2) { animation-delay: 0.2s; }
.thinking-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce-dot {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── Coaching section cards (activity log, diagram preview) ─── */
.coaching-section-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.coaching-activity-card {
  margin-top: auto;
}

.coaching-activity-card.is-collapsed .activity-log {
  display: none;
}

.coaching-activity-card.is-collapsed .csc-header {
  border-bottom: none;
}

.coaching-activity-card.is-expanded .activity-log {
  display: block;
}

.csc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #f7f8fc;
}

.csc-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.csc-title {
  font-size: 11px;
  font-weight: 700;
  color: #5a5a69;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.csc-scope-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #c9ddff;
  background: #ecf3ff;
  color: #0f3d8a;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.btn-link {
  background: none;
  border: none;
  font-size: 12px;
  color: #747480;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: inherit;
}

.btn-link:hover {
  background: #ebebeb;
  color: #2e2e38;
}

/* Activity log */
.activity-log {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}

.activity-log-empty {
  padding: 12px 16px;
  font-size: 13px;
  color: #a0a0a8;
  font-style: italic;
}

.activity-entry {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 16px;
  font-size: 12px;
  border-bottom: 1px solid #f5f5f5;
  animation: entry-fade 0.25s ease;
}

.activity-entry:last-child { border-bottom: none; }

@keyframes entry-fade {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ae-icon { font-size: 13px; flex-shrink: 0; line-height: 1.6; }
.ae-time { color: #a0a0a8; white-space: nowrap; flex-shrink: 0; }
.ae-msg  { color: #2e2e38; flex: 1; word-break: break-word; }

.diagram-chat-hint {
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid #e4e5ef;
  border-radius: 6px;
  background: #f7f8fc;
  color: #5a5a69;
  font-size: 12px;
}

/* Diagram preview in right panel */
.diagram-preview-body {
  padding: 10px 12px 12px;
  overflow: hidden;
}

.diagram-preview-svg {
  display: flex;
  justify-content: center;
}

.diagram-preview-svg svg {
  max-width: 100%;
  height: auto;
}

.diagram-viewport {
  position: relative;
  width: 100%;
  min-height: 480px;
  overflow: hidden;
  border: 1px solid #e2e5f2;
  border-radius: 8px;
  background: #ffffff;
  cursor: grab;
  touch-action: none;
}

.diagram-modal-viewport {
  min-height: 70vh;
}

.diagram-viewport.is-dragging {
  cursor: grabbing;
}

.diagram-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.diagram-canvas svg {
  display: block;
  max-width: none;
  height: auto;
  text-rendering: geometricPrecision;
  shape-rendering: geometricPrecision;
}

.diagram-viewport-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #7e8498;
}

/* ─── Responsive: stack on small screens ─── */
@media (max-width: 900px) {
  .coaching-workspace {
    flex-direction: column;
  }

  .coaching-chat-col {
    width: 100%;
    max-height: 55vh;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }

  .coaching-content-col {
    max-height: 45vh;
  }
}
