/* Orthanc Dashboard Styles */

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

body {
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    max-width: 720px;
    margin: 40px auto;
    padding: 0 20px;
    color: #1a1a1a;
    background: #fafafa;
}

h1 {
    margin-bottom: 24px;
    font-size: 1.6rem;
}

h2 {
    margin-bottom: 16px;
    font-size: 1.2rem;
    color: #333;
}

/* Buttons */

button {
    padding: 8px 16px;
    margin: 4px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    transition: background 0.15s;
}

button:hover {
    background: #f0f0f0;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

button.primary:hover {
    background: #1d4ed8;
}

button.danger {
    color: #dc2626;
    border-color: #dc2626;
}

button.danger:hover {
    background: #fef2f2;
}

button.small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Cards */

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-static {
    cursor: default;
}

.card-static:hover {
    box-shadow: none;
}

.card-title {
    font-weight: 600;
    font-size: 1rem;
}

.card-meta {
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Role badge */

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-owner {
    background: #dbeafe;
    color: #1e40af;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.badge-member {
    background: #d1fae5;
    color: #065f46;
}

.badge-viewer {
    background: #f3f4f6;
    color: #4b5563;
}

/* Node status badges */

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-draining {
    background: #fef3c7;
    color: #92400e;
}

.badge-decommissioned {
    background: #f3f4f6;
    color: #4b5563;
}

.badge-stale {
    background: #fed7aa;
    color: #9a3412;
}

/* Node card layout */

.node-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.node-hostname {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.node-card-details {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6b7280;
}

.node-version {
    color: #9ca3af;
}

/* Forms */

.form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 12px 0;
}

.form-inline input[type="text"],
.form-inline input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
}

.form-inline input[type="text"]:focus,
.form-inline input[type="number"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Messages */

.error {
    color: #dc2626;
    font-size: 0.875rem;
    margin: 8px 0;
}

.success {
    color: #059669;
    font-size: 0.875rem;
    margin: 8px 0;
}

.info {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 8px 0;
}

/* Empty state */

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: #9ca3af;
}

.empty-state p {
    margin-bottom: 12px;
}

/* Section */

.section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
}

.section-chevron {
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.25s ease;
}

.section.collapsed .section-chevron {
    transform: rotate(-90deg);
}

.section-body {
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.section.collapsed .section-body {
    max-height: 0 !important;
}

.section.collapsed {
    margin-bottom: 4px;
}

.section.collapsed .section-header button,
.ai-subsection.collapsed .ai-subsection-header button {
    display: none;
}

.section-count {
    font-size: 0.85em;
    font-weight: normal;
    color: #888;
    margin-left: 4px;
}

/* AI subsections */

.ai-subsection {
    margin-bottom: 20px;
}

.ai-subsection:last-child {
    margin-bottom: 0;
}

.ai-subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
    user-select: none;
}

.ai-subsection-header h3 {
    font-size: 1rem;
    color: #555;
    font-weight: 600;
}

.subsection-chevron {
    display: inline-block;
    margin-right: 4px;
    transition: transform 0.25s ease;
    font-size: 0.85em;
}

.ai-subsection.collapsed .subsection-chevron {
    transform: rotate(-90deg);
}

.ai-subsection.collapsed .ai-subsection-body {
    display: none;
}

.ai-subsection-header h3 span:not(.subsection-chevron) {
    font-size: 0.85em;
    font-weight: normal;
    color: #888;
}

/* Role badges */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.75em;
    font-weight: 500;
    line-height: 1.4;
}

.role-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.role-context-preview {
    font-size: 0.8em;
    color: #6b7280;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.role-card-context {
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 4px;
    white-space: pre-wrap;
    max-height: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inline credential fields inside provider form grid */
#aiNewCredFields {
    display: contents;
}

#aiNewCredFields.hidden {
    display: none;
}

/* Toolbar */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.project-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.project-nav-actions {
    display: flex;
    gap: 6px;
}

/* Loading */

.loading {
    text-align: center;
    padding: 24px;
    color: #9ca3af;
}

.loading-more {
    text-align: center;
    padding: 12px;
    color: #9ca3af;
    font-size: 0.85em;
}

/* Hidden utility */

.hidden {
    display: none;
}

/* Token creation banner */

.token-result {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.token-warning {
    color: #92400e;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.token-secret-row,
.enroll-command-row {
    margin-bottom: 10px;
}

.token-secret-row label,
.enroll-command-row label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.token-secret {
    display: block;
    font-family: monospace;
    font-size: 0.9rem;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    word-break: break-all;
    user-select: all;
}

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

.enroll-command code {
    flex: 1;
    font-family: monospace;
    font-size: 0.8rem;
    padding: 8px 12px;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 4px;
    overflow-x: auto;
    white-space: nowrap;
}

.copy-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
}

.copy-btn:hover {
    background: #f3f4f6;
}

.token-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.token-form-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 4px;
    margin-bottom: 2px;
}

.token-resource-row input[type="number"] {
    min-width: 0;
}

/* Project card layout */

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card-header .card-title {
    margin-right: 8px;
}

.project-actions {
    flex-shrink: 0;
}

.project-card-error:empty {
    display: none;
}

/* Project toolbar */

#project-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    font-size: 0.85rem;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    margin-right: 4px;
    cursor: pointer;
}

/* Git Repository form */

.repo-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.repo-form-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.repo-form-grid {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 8px;
    align-items: start;
}

.repo-form-grid input[type="text"],
.repo-form-grid input[type="password"],
.repo-form-grid select,
.repo-form-grid textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    background: #fff;
}

.repo-form-grid input[type="text"]:focus,
.repo-form-grid input[type="password"]:focus,
.repo-form-grid select:focus,
.repo-form-grid textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.repo-form-grid select {
    appearance: auto;
    cursor: pointer;
}

.repo-form-row {
    display: contents;
}

.repo-form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
    padding-top: 10px;
}

.repo-cred-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.repo-cred-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.repo-cred-fields {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    align-items: start;
}

.repo-cred-fields input[type="text"],
.repo-cred-fields input[type="password"],
.repo-cred-fields textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    background: #fff;
}

.repo-cred-fields input[type="text"]:focus,
.repo-cred-fields input[type="password"]:focus,
.repo-cred-fields textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.repo-cred-fields textarea {
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    resize: vertical;
}

.repo-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.repo-form-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 8px;
}

.ai-model-hint {
    color: #6b7280;
    font-size: 0.75rem;
}
.ai-model-hint code {
    background: #f3f4f6;
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-size: 0.7rem;
}

#aiModelContainer select,
#aiModelContainer input {
    width: 100%;
}

/* Git Repository card */

.repo-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: border-color 0.15s;
}

.repo-card:hover {
    border-color: #d1d5db;
}

.repo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.repo-card-info {
    min-width: 0;
    flex: 1;
}

.repo-card-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.repo-card-label .card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-card-url {
    color: #6b7280;
    font-size: 0.82rem;
    margin-top: 3px;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-card-cred {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 2px;
}

.repo-card-actions {
    flex-shrink: 0;
    display: flex;
    gap: 4px;
}

.repo-card-msg {
    font-size: 0.8rem;
    margin-top: 6px;
    min-height: 0;
    transition: all 0.2s;
}

.repo-card-msg:empty {
    display: none;
}

.repo-card-msg.success-msg {
    color: #059669;
}

.repo-card-msg.error {
    color: #dc2626;
}

.badge-ssh {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-https {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gitlab {
    background: #fce7f3;
    color: #9d174d;
}

.badge-github {
    background: #f3f4f6;
    color: #1f2937;
}

.forge-card-msg {
    padding: 0 12px;
    font-size: 0.85rem;
    min-height: 0;
    transition: all 0.2s;
}

.forge-card-msg:not(:empty) {
    padding: 6px 12px;
}

.stt-card-msg {
    padding: 0 12px;
    font-size: 0.85rem;
    min-height: 0;
    transition: all 0.2s;
}

.stt-card-msg:not(:empty) {
    padding: 6px 12px;
}

.stt-card-msg.success {
    color: #166534;
}

.stt-card-msg.error {
    color: #991b1b;
}

/* ==============================
   Chat view
   ============================== */

.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* Chat header */

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

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


.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.chat-header-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-feature-name {
  font-size: 0.75rem;
  color: #6b7280;
  display: block;
}

.chat-header-role {
  font-size: 0.75rem;
  color: #6b7280;
}

.chat-agent-select {
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: #1a1a1a;
  outline: none;
  appearance: auto;
}

.chat-provider-select {
  font-size: 0.8rem;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #f9fafb;
  cursor: pointer;
  padding: 2px 4px;
  color: #374151;
  outline: none;
  appearance: auto;
  margin-top: 2px;
}

.chat-provider-select.hidden {
  display: none;
}

/* Create Agent dialog */

.agent-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.agent-dialog {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.agent-dialog-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a1a;
}

.agent-dialog-field {
  margin-bottom: 14px;
}

.agent-dialog-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}

.agent-dialog-optional {
  font-weight: 400;
  color: #9ca3af;
}

.agent-dialog-field select,
.agent-dialog-field input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #1a1a1a;
  background: #fff;
  outline: none;
  box-sizing: border-box;
}

.agent-dialog-field select:focus,
.agent-dialog-field input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.agent-dialog-error {
  color: #dc2626;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-bottom: 8px;
}

.agent-dialog-empty {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.agent-dialog-empty p {
  margin: 0 0 8px;
}

.agent-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.agent-dialog-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
}

.agent-dialog-btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

.agent-dialog-btn-cancel:hover {
  background: #e5e7eb;
}

.agent-dialog-btn-create {
  background: #6366f1;
  color: #fff;
}

.agent-dialog-btn-create:hover {
  background: #4f46e5;
}

.agent-dialog-btn-create:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Connection status indicator */

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #6b7280;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.connected {
  background: #22c55e;
}

.status-dot.disconnected {
  background: #ef4444;
}

.status-dot.connecting {
  background: #f59e0b;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Messages area */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Message layout */

.message {
  display: flex;
  max-width: 80%;
}

.message-user {
  align-self: flex-end;
  justify-content: flex-end;
}

.message-agent {
  align-self: flex-start;
}

.message-system {
  align-self: center;
  max-width: 90%;
}

/* Message bubbles */

.message-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.45;
  font-size: 0.9rem;
}

.message-bubble-user {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message-bubble-agent {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
}

.message-bubble-system {
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 16px;
  text-align: left;
}

.system-msg-header {
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

.system-msg-body {
  margin-top: 6px;
}

/* Collapsible messages */

.collapsible {
  cursor: pointer;
}

.collapsible.collapsed .system-msg-body,
.collapsible.collapsed .orch-msg-content {
  display: none;
}

.collapse-indicator::before {
  content: "\25BC";
  font-size: 0.7em;
  margin-right: 4px;
}

.collapsible.collapsed .collapse-indicator::before {
  content: "\25B6";
}

/* Sender & meta */

.message-sender {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 2px;
}

.message-bubble-user .message-sender {
  color: rgba(255, 255, 255, 0.85);
}

.message-bubble-agent .message-sender {
  color: #3730a3;
}

.message-meta {
  font-size: 0.7rem;
  margin-top: 4px;
  opacity: 0.6;
  text-align: right;
}

/* Markdown in agent messages */

.message-bubble-agent code {
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.85em;
}

.message-bubble-agent pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.message-bubble-agent pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.message-bubble-agent ul,
.message-bubble-agent ol {
  margin-left: 20px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.message-bubble-agent li {
  margin-bottom: 2px;
}

.message-bubble-agent a {
  color: #2563eb;
  text-decoration: underline;
}

.message-bubble-agent strong {
  font-weight: 600;
}

.message-bubble-agent blockquote {
  border-left: 3px solid #d1d5db;
  padding-left: 12px;
  margin: 8px 0;
  color: #6b7280;
}

.message-bubble-agent table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 0.85em;
}

.message-bubble-agent th,
.message-bubble-agent td {
  border: 1px solid #d1d5db;
  padding: 4px 8px;
}

.message-bubble-agent th {
  background: #f1f5f9;
  font-weight: 600;
}

.message-bubble-agent p {
  margin-bottom: 6px;
}

.message-bubble-agent p:last-child {
  margin-bottom: 0;
}

/* Streaming message — blinking cursor animation */

.message-streaming .message-content::after {
  content: "\25CB";
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  opacity: 0.7;
}

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

.message-streaming .message-bubble {
  opacity: 0.9;
}

/* Error messages */

.message-error .message-bubble {
  border-left: 3px solid #e74c3c;
  background: #2c1a1a;
  color: #e8c0c0;
}

/* Input area */

.chat-input-area {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
  position: relative;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  outline: none;
  resize: none;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
}

.chat-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  transition: background 0.15s;
}

.send-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.send-btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

/* Responsive: chat fills available width from 768px to 2560px */

@media (min-width: 768px) {
  .chat-container {
    max-width: 100%;
  }

  .message {
    max-width: 70%;
  }
}

@media (min-width: 1200px) {
  .message {
    max-width: 60%;
  }
}

/* WebAuthn-specific (login view) */

#no-webauthn {
    color: #dc2626;
    font-weight: bold;
    margin-bottom: 16px;
}

/* Build footer */

.build-footer {
    text-align: center;
    padding: 24px 0 12px;
    font-size: 0.7rem;
    color: #9ca3af;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
}

/* ==============================
   Startup Wizard (CTA + Form)
   ============================== */

.startup-cta {
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-top: 20px;
}

.startup-cta h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: #1a1a1a;
}

.startup-cta p {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 20px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.startup-form {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}

.startup-form .repo-form-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

.startup-section {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.startup-section:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.startup-error {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 8px;
  min-height: 0;
}

.startup-error:empty {
  display: none;
}

.startup-form .repo-form-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.startup-form .hidden {
  display: none;
}

/* ==============================
   Flow Editor (Drawflow)
   ============================== */

#drawflow-container {
  width: 100%;
  height: 500px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  overflow: hidden;
}

.flow-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  flex-wrap: wrap;
}

.flow-editor-title {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
}

.flow-editor-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Node type accents */

.drawflow .drawflow-node.source {
  border-left: 4px solid #22c55e;
  background: #f0fdf4;
}

.drawflow .drawflow-node.action {
  border-left: 4px solid #3b82f6;
  background: #eff6ff;
}

.drawflow .drawflow-node.agent {
  border-left: 4px solid #8b5cf6;
  background: #f5f3ff;
}

.drawflow-node-content {
  padding: 4px 8px;
  font-size: 0.85rem;
}

.drawflow-node-content strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.drawflow-node-content label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 6px;
  margin-bottom: 2px;
}

.drawflow-node-content select {
  width: 100%;
  font-size: 0.8rem;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  outline: none;
  box-sizing: border-box;
}

.drawflow-node-content select:focus {
  border-color: #3b82f6;
}

.action-preview {
  font-size: 0.75rem;
  color: #9ca3af;
  font-style: italic;
  margin: 4px 0 6px;
  max-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-preview.has-text {
  color: #374151;
  font-style: normal;
}

.action-edit-btn {
  width: 100%;
}

/* Selected node — softer than Drawflow's default red */

.drawflow .drawflow-node.selected {
  box-shadow: 0 0 0 2px #60a5fa !important;
  background: white !important;
}

/* Textarea editing modal */

.textarea-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.textarea-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.textarea-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.textarea-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #666;
  padding: 0 4px;
}

.textarea-modal-close:hover {
  color: #1a1a1a;
}

.textarea-modal-input {
  width: 100%;
  min-height: 300px;
  padding: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  resize: vertical;
}

.textarea-modal-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}

.textarea-modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* Missing role warning */

.drawflow .drawflow-node.missing-role {
  border-color: #ef4444;
  background: #fef2f2;
}

.drawflow .drawflow-node.missing-role::after {
  content: "Missing role";
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: 600;
}

/* Toast notification */

.flow-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  transition: opacity 0.3s;
}

.flow-toast.hidden {
  opacity: 0;
  pointer-events: none;
}

.flow-toast.toast-success {
  background: #059669;
  color: #fff;
}

.flow-toast.toast-error {
  background: #dc2626;
  color: #fff;
}

/* Collapsible section headers */

.section-header.collapsible {
  cursor: pointer;
  user-select: none;
}

.section-header.collapsible:hover {
  opacity: 0.8;
}

.collapse-indicator {
  font-size: 0.7rem;
  margin-left: 8px;
  color: #9ca3af;
}

/* Webhook Endpoints */

.webhook-settings-panel {
  padding: 16px 0;
}

.webhook-endpoint-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: box-shadow 0.15s;
}

.webhook-endpoint-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.webhook-endpoint-header .endpoint-name {
  font-size: 0.9rem;
}

.webhook-endpoint-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.webhook-ep-secret {
  margin-top: 8px;
  padding: 6px 10px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.webhook-field {
  margin-bottom: 14px;
}

.webhook-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 4px;
}

.webhook-url-row,
.webhook-secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.webhook-url-row code,
.webhook-secret-row code {
  background: #f3f4f6;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  word-break: break-all;
  flex: 1;
}

.webhook-instructions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.webhook-instructions h4 {
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: #374151;
}

.webhook-instructions ol {
  margin-left: 20px;
  font-size: 0.82rem;
  color: #4b5563;
  line-height: 1.7;
}

.webhook-instructions code {
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.78rem;
}

.webhook-msg {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 8px;
}

.webhook-msg:empty {
  display: none;
}

/* Webhook Activity Log */

.webhook-activity-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.webhook-activity-filters select {
  padding: 6px 10px;
  font-size: 0.82rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  outline: none;
  cursor: pointer;
}

.webhook-events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.webhook-events-table th,
.webhook-events-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.webhook-events-table th {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.webhook-events-table a {
  color: #2563eb;
  text-decoration: none;
}

.webhook-events-table a:hover {
  text-decoration: underline;
}

.webhook-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: #6b7280;
}

/* Outcome badges */

.outcome-spawned {
  background: #dcfce7 !important;
  color: #166534 !important;
}

.outcome-nomatch {
  background: #f3f4f6 !important;
  color: #6b7280 !important;
}

.outcome-warn {
  background: #fef3c7 !important;
  color: #92400e !important;
}

.outcome-error {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

/* --- Microphone / Voice Input --- */

.mic-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #6b7280;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
  transition: background 0.15s;
}

.mic-btn:hover:not(:disabled) {
  background: #4b5563;
}

.mic-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

.mic-btn.recording {
  background: #dc2626;
  animation: mic-pulse 1.5s ease-in-out infinite;
}

.mic-btn.transcribing {
  background: #f59e0b;
  animation: mic-spin 1s linear infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

@keyframes mic-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.stt-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.stt-toast-retry {
  margin-left: 12px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.stt-toast-retry:hover {
  background: rgba(255,255,255,0.3);
}

/* ── Executor collapsible blocks (093) ── */

.message-executor {
  align-self: stretch;
  max-width: 85%;
  margin: 4px 0;
}

.executor-block {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  background: #fafbfc;
}

.executor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.executor-header:hover {
  background: #e5e7eb;
}

.executor-chevron {
  font-size: 0.7rem;
  color: #6b7280;
  transition: transform 0.15s ease;
  display: inline-block;
}

.executor-chevron.expanded {
  transform: rotate(90deg);
}

.executor-persona {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  flex: 1;
}

.executor-status {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.executor-status.streaming {
  background: #dbeafe;
  color: #1d4ed8;
  animation: executor-pulse 1.5s ease-in-out infinite;
}

.executor-status.running {
  background: #dbeafe;
  color: #1d4ed8;
  animation: executor-pulse 1.5s ease-in-out infinite;
}

.executor-status.completed {
  background: #d1fae5;
  color: #065f46;
}

.executor-status.failed {
  background: #fee2e2;
  color: #991b1b;
}

.executor-status.timed-out {
  background: #ffedd5;
  color: #9a3412;
}

.executor-status.cancelled {
  background: #f3f4f6;
  color: #6b7280;
}

@keyframes executor-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.executor-content {
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  max-height: 400px;
  overflow-y: auto;
}

.executor-content.collapsed {
  display: none;
}

.executor-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #1a1a1a;
}

.executor-body p { margin: 0.4em 0; }
.executor-body pre { background: #f3f4f6; padding: 8px; border-radius: 4px; overflow-x: auto; }
.executor-body code { font-size: 0.82rem; }

/* Nested sub-executor blocks (feature 094) */
.executor-block.nested {
  margin-left: 16px;
  margin-top: 6px;
  border-color: #e5e7eb;
  background: #f9fafb;
}

.executor-block.nested .executor-header {
  background: #f0f1f3;
  padding: 6px 10px;
}

.executor-block.nested .executor-persona {
  font-size: 0.78rem;
}

/* ── Orchestration Dashboard ───────────────────────────────── */

.orch-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 12px 0;
}

.orch-select {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  outline: none;
  appearance: auto;
}

.orch-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.orch-auto-poll-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}

.orch-session-card {
  margin-bottom: 16px;
  padding: 0;
  overflow: hidden;
}

.orch-session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

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

.orch-session-organizer {
  font-weight: 600;
  font-size: 0.95rem;
}

.orch-session-meta {
  color: #6b7280;
  font-size: 0.8rem;
}

.orch-session-actions {
  display: flex;
  gap: 8px;
}

.orch-executor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.orch-executor-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.orch-executor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.orch-executor-name {
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orch-executor-summary {
  font-size: 0.78rem;
  color: #374151;
  line-height: 1.35;
  max-height: 3.6em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orch-executor-meta {
  font-size: 0.72rem;
  color: #9ca3af;
}

.orch-sub-session {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #d1d5db;
}

.orch-sub-session-header {
  margin-bottom: 6px;
}

.orch-sub-session .orch-executor-grid {
  padding: 0;
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.orch-sub-session .orch-executor-card {
  background: #f9fafb;
  border-color: #e5e7eb;
}

.orch-cancel-btn {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.orch-cancel-btn:hover {
  background: #fecaca;
}

.orch-chat-btn {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.orch-chat-btn:hover {
  background: #bfdbfe;
}

.loading-small {
  font-size: 0.8rem;
  color: #9ca3af;
  padding: 8px;
}

/* Clickable executor cards */
.orch-executor-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.orch-executor-clickable:hover {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Conversation modal overlay */
.orch-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.orch-modal {
  background: #fff;
  border-radius: 12px;
  width: min(720px, 90vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.orch-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.orch-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  padding: 0 4px;
  margin: 0;
  line-height: 1;
}

.orch-modal-close:hover {
  color: #111;
  background: none;
}

.orch-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.orch-modal-footer {
  padding: 8px 20px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

.orch-modal-load-more {
  font-size: 0.85rem;
  padding: 4px 12px;
}

/* Message bubbles */
.orch-msg {
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 85%;
}

.orch-msg-user {
  background: #eff6ff;
  align-self: flex-end;
  border: 1px solid #dbeafe;
}

.orch-msg-agent {
  background: #f3f4f6;
  align-self: flex-start;
  border: 1px solid #e5e7eb;
}

.orch-msg-system {
  background: #fefce8;
  align-self: center;
  border: 1px solid #fef08a;
  font-size: 0.85rem;
}

.orch-msg-sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
}

.orch-msg-time {
  font-weight: 400;
  color: #9ca3af;
}

.orch-msg-content {
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.orch-msg-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 0.85rem;
}

.orch-msg-content code {
  background: #e5e7eb;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.85em;
}

.orch-msg-content pre code {
  background: none;
  padding: 0;
}

/* --- Chat Attachments --- */

.attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  padding: 0;
  font-size: 0;
}
.attach-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.attach-btn:hover {
  background: #f3f4f6;
  color: #2563eb;
  border-color: #2563eb;
}

.chat-drop-zone {
  position: absolute;
  inset: 0;
  background: rgba(37, 99, 235, 0.08);
  border: 2px dashed #2563eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.1s;
  font-size: 0.9rem;
  color: #2563eb;
  font-weight: 500;
}

.chat-pending-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 0.78rem;
  max-width: 220px;
  position: relative;
  overflow: hidden;
}
.attachment-chip.chip-error {
  background: #fef2f2;
  border-color: #fca5a5;
}
.chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.chip-size {
  color: #9ca3af;
  white-space: nowrap;
}
.chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.chip-remove:hover {
  color: #ef4444;
}
.chip-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #e5e7eb;
}
.chip-progress-bar {
  height: 100%;
  background: #2563eb;
  transition: width 0.2s;
}
.chip-icon {
  flex-shrink: 0;
}

/* Attachment chips in message history */
.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.attachment-history {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.attachment-history.clickable:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
