:root {
    --telemetry-panel-width: 340px;
    --telemetry-panel-gap: 4px;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
    background: #f0f0f0;
    color: #323130;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Theme - Support both class and data-theme attribute */
body.dark-theme,
body[data-theme="dark"] {
    background: #1e1e1e;
    color: #e8e8e8;
}

body.dark-theme .top-bar,
body[data-theme="dark"] .top-bar {
    background: linear-gradient(135deg, #1e1e1e 0%, #2d2d30 100%);
    border-bottom: 1px solid #3e3e42;
}

body.dark-theme .section,
body[data-theme="dark"] .section {
    background: #252526;
    border-color: #3e3e42;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark-theme .section-header,
body[data-theme="dark"] .section-header {
    background: #2d2d30;
    border-bottom-color: #3e3e42;
    color: #e8e8e8;
}

body.dark-theme .section-body,
body[data-theme="dark"] .section-body {
    background: #252526;
}

body.dark-theme .form-group label,
body[data-theme="dark"] .form-group label {
    color: #cccccc;
}

body.dark-theme .form-control, 
body.dark-theme .form-select,
body.dark-theme .form-textarea,
body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select,
body[data-theme="dark"] .form-textarea {
    background: #3c3c3c;
    border-color: #5a5a5a;
    color: #e8e8e8;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus,
body.dark-theme .form-textarea:focus,
body[data-theme="dark"] .form-control:focus,
body[data-theme="dark"] .form-select:focus,
body[data-theme="dark"] .form-textarea:focus {
    background: #3c3c3c;
    border-color: #0078d4;
}

body.dark-theme .status-box,
body[data-theme="dark"] .status-box {
    background: #2d2d30;
    border-color: #5a5a5a;
}

body.dark-theme .status-box.info,
body[data-theme="dark"] .status-box.info {
    background: #1e3a5f;
    border-color: #0078d4;
}

body.dark-theme .status-box.success,
body[data-theme="dark"] .status-box.success {
    background: #1e3a1e;
    border-color: #107c10;
}

body.dark-theme .status-box.error,
body[data-theme="dark"] .status-box.error {
    background: #5a1e1e;
    border-color: #a4262c;
}

body.dark-theme .chat-message.user,
body[data-theme="dark"] .chat-message.user {
    background: #1e3a5f;
    color: #f0f0f0;
    border: 1px solid #2d5a87;
}

body.dark-theme .chat-message.assistant,
body[data-theme="dark"] .chat-message.assistant {
    background: #3c3c3c;
    border-color: #5a5a5a;
    color: #e8e8e8;
}

body.dark-theme #logsContainer,
body[data-theme="dark"] #logsContainer {
    background: #1e1e1e;
    border-color: #3e3e42;
}

body.dark-theme .page-title,
body[data-theme="dark"] .page-title {
    color: #e8e8e8;
}

body.dark-theme .page-subtitle,
body[data-theme="dark"] .page-subtitle {
    color: #a0a0a0;
}

body.dark-theme .header,
body[data-theme="dark"] .header {
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark-theme .header h1,
body[data-theme="dark"] .header h1 {
    color: #3794ff;
}

body.dark-theme .subtitle,
body[data-theme="dark"] .subtitle {
    color: #a0a0a0;
}

body.dark-theme .breadcrumb,
body[data-theme="dark"] .breadcrumb {
    border-top-color: #3e3e42;
}

body.dark-theme .breadcrumb a,
body[data-theme="dark"] .breadcrumb a {
    color: #3794ff;
}

body.dark-theme .breadcrumb-separator,
body[data-theme="dark"] .breadcrumb-separator {
    color: #a0a0a0;
}

/* Dark theme - Input and form elements */
body.dark-theme input[type='text'],
body.dark-theme input[type='number'],
body.dark-theme textarea,
body.dark-theme select,
body[data-theme="dark"] input[type='text'],
body[data-theme="dark"] input[type='number'],
body[data-theme="dark"] textarea,
body[data-theme="dark"] select {
    background: #3c3c3c;
    border-color: #5a5a5a;
    color: #e8e8e8;
}

body.dark-theme input[type='text']:hover,
body.dark-theme input[type='number']:hover,
body.dark-theme textarea:hover,
body.dark-theme select:hover,
body[data-theme="dark"] input[type='text']:hover,
body[data-theme="dark"] input[type='number']:hover,
body[data-theme="dark"] textarea:hover,
body[data-theme="dark"] select:hover {
    border-color: #6e6e6e;
}

body.dark-theme input[type='text']:focus,
body.dark-theme input[type='number']:focus,
body.dark-theme textarea:focus,
body.dark-theme select:focus,
body[data-theme="dark"] input[type='text']:focus,
body[data-theme="dark"] input[type='number']:focus,
body[data-theme="dark"] textarea:focus,
body[data-theme="dark"] select:focus {
    background: #3c3c3c;
    border-color: #0078d4;
    color: #e8e8e8;
}

body.dark-theme input::placeholder,
body.dark-theme textarea::placeholder,
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
    color: #8a8a8a;
}

/* Dark theme optgroup styling */
body.dark-theme optgroup,
body[data-theme="dark"] optgroup {
    color: #4db8ff;
    background: #2d2d30;
}

body.dark-theme optgroup option,
body[data-theme="dark"] optgroup option {
    background: #3c3c3c;
    color: #e8e8e8;
}

/* Dark theme - Small text and hints */
body.dark-theme small,
body[data-theme="dark"] small {
    color: #b0b0b0;
}

/* Dark theme - Buttons */
body.dark-theme .btn-primary,
body[data-theme="dark"] .btn-primary {
    background: #0078d4;
    color: white;
    border-color: #0078d4;
}

body.dark-theme .btn-primary:hover,
body[data-theme="dark"] .btn-primary:hover {
    background: #106ebe;
    border-color: #106ebe;
}

body.dark-theme .btn-primary:disabled,
body[data-theme="dark"] .btn-primary:disabled {
    background: #2d5a7b;
    border-color: #2d5a7b;
    color: #a0a0a0;
    opacity: 0.6;
}

body.dark-theme .btn-secondary,
body[data-theme="dark"] .btn-secondary {
    background: #3c3c3c;
    color: #e8e8e8;
    border-color: #5a5a5a;
}

body.dark-theme .btn-secondary:hover,
body[data-theme="dark"] .btn-secondary:hover {
    background: #4a4a4a;
    border-color: #6e6e6e;
}

body.dark-theme .btn-danger,
body[data-theme="dark"] .btn-danger {
    background: #3c3c3c;
    color: #f48771;
    border-color: #a4262c;
}

body.dark-theme .btn-success,
body[data-theme="dark"] .btn-success {
    background: #107c10;
    color: white;
    border-color: #107c10;
}

body.dark-theme .btn-success:hover,
body[data-theme="dark"] .btn-success:hover {
    background: #0e6b0e;
    border-color: #0e6b0e;
}

body.dark-theme .btn-success:disabled,
body[data-theme="dark"] .btn-success:disabled {
    background: #1e4620;
    border-color: #1e4620;
    color: #a0a0a0;
    opacity: 0.6;
}

body.dark-theme .btn-danger:hover,
body[data-theme="dark"] .btn-danger:hover {
    background: #5a1e1e;
    border-color: #d13438;
}

/* Dark theme - Status boxes */
body.dark-theme .status-box,
body[data-theme="dark"] .status-box {
    background: #2d2d30;
    border-color: #5a5a5a;
    color: #e8e8e8;
}

body.dark-theme .status-box.status-info,
body.dark-theme .status-info,
body[data-theme="dark"] .status-box.status-info,
body[data-theme="dark"] .status-info {
    background: #1e3a5f;
    border-color: #0078d4;
    color: #e8e8e8;
}

body.dark-theme .status-box.status-success,
body.dark-theme .status-success,
body[data-theme="dark"] .status-box.status-success,
body[data-theme="dark"] .status-success {
    background: #1e3a1e;
    border-color: #107c10;
    color: #c8f5c8;
}

body.dark-theme .status-box.status-error,
body.dark-theme .status-error,
body[data-theme="dark"] .status-box.status-error,
body[data-theme="dark"] .status-error {
    background: #5a1e1e;
    border-color: #a4262c;
    color: #ffcccb;
}

body.dark-theme .status-box.status-warning,
body.dark-theme .status-warning,
body[data-theme="dark"] .status-box.status-warning,
body[data-theme="dark"] .status-warning {
    background: #5a4a1e;
    border-color: #ffb900;
    color: #fff4ce;
}

/* Dark theme - Timer */
body.dark-theme .timer,
body[data-theme="dark"] .timer {
    color: #4fc3f7;
    background: #1e3a5f;
    border-left-color: #0078d4;
}

/* Dark theme - HR separator */
body.dark-theme hr,
body[data-theme="dark"] hr {
    border-top-color: #3e3e42 !important;
}

/* Dark theme - Messages */
body.dark-theme .message-user,
body[data-theme="dark"] .message-user {
    background: #1e3a5f;
    color: #f0f0f0;
    border: 1px solid #2d5a87;
}

body.dark-theme .message-assistant,
body[data-theme="dark"] .message-assistant {
    background: #3c3c3c;
    border-color: #5a5a5a;
    color: #e8e8e8;
}

body.dark-theme .messages,
body[data-theme="dark"] .messages {
    background: #2d2d30;
    border-color: #3e3e42;
}

body.dark-theme .message-sender,
body[data-theme="dark"] .message-sender {
    color: #4cc2ff;
}

body.dark-theme .message-user .message-sender,
body[data-theme="dark"] .message-user .message-sender {
    color: #7dd3fc;
}

body.dark-theme .message-assistant .message-sender,
body[data-theme="dark"] .message-assistant .message-sender {
    color: #6ccb5f;
}

body.dark-theme .message-time,
body[data-theme="dark"] .message-time {
    opacity: 0.7;
}

/* Dark theme - Chat placeholder */
body.dark-theme #chatPlaceholder,
body[data-theme="dark"] #chatPlaceholder {
    background: #1e3a5f;
    border-color: #0078d4;
    color: #e8e8e8;
}

body.dark-theme #logsPlaceholder,
body[data-theme="dark"] #logsPlaceholder {
    background: #1e3a5f;
    border-color: #0078d4;
    color: #e8e8e8;
}

/* Sleek Top Navigation Bar */
.top-bar {
    background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1001;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

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

.logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.viki-brand {
    color: white;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.page-title-bar {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    font-weight: 400;
    padding-left: 12px;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-link {
    color: white;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.1);
}

.top-bar-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.container {
    max-width: calc(1600px + var(--telemetry-panel-width) + var(--telemetry-panel-gap));
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Main Content Grid - 2 columns: agent setup + chat */
.content {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 16px;
    min-height: calc(100vh - 200px);
    position: relative;
    transition: padding-right 0.3s ease;
    align-items: stretch;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1200px) {
    .content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
}

/* Footer */
.footer {
    background: var(--bg-card, white);
    border-top: 1px solid var(--border-color, #edebe9);
    padding: 24px;
    margin-top: 40px;
    border-radius: 8px;
    position: relative;
    z-index: 999;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.footer-logo {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.footer-text {
    font-size: 13px;
    color: var(--text-secondary, #605e5c);
    text-align: left;
}

.footer-text strong {
    color: var(--text-primary, #323130);
    font-size: 14px;
}

body.dark-theme .footer,
body[data-theme="dark"] .footer {
    background: #252526;
    border-top-color: #3e3e42;
}

body.dark-theme .footer-text,
body[data-theme="dark"] .footer-text {
    color: #a0a0a0;
}

body.dark-theme .footer-text strong,
body[data-theme="dark"] .footer-text strong {
    color: #e8e8e8;
}

/* Card Sections */
.section {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1.6px 3.6px rgba(0,0,0,0.132), 0 0.3px 0.9px rgba(0,0,0,0.108);
    overflow: hidden;
}

.section-header {
    font-size: 16px;
    font-weight: 600;
    padding: 16px 20px;
    background: #faf9f8;
    border-bottom: 1px solid #edebe9;
    color: #323130;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-body {
    padding: 18px;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #323130;
}

input[type='text'],
input[type='number'],
textarea,
select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #8a8886;
    border-radius: 2px;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    transition: border-color 0.2s;
    background: white;
}

input:hover,
textarea:hover,
select:hover {
    border-color: #323130;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0078d4;
    border-width: 2px;
    padding: 7px 9px;
}

textarea {
    resize: vertical;
    min-height: 80px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
}

/* Optgroup styling for better visual distinction */
optgroup {
    font-weight: 600;
    font-style: normal;
    color: #0078d4;
    background: #f3f2f1;
    padding: 4px 0;
}

optgroup option {
    font-weight: normal;
    padding-left: 8px;
}

small {
    font-size: 12px;
    color: #605e5c;
    display: block;
    margin-top: 4px;
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.2s;
    margin-right: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: #0078d4;
    color: white;
    border-color: #0078d4;
}

.btn-primary:hover {
    background: #106ebe;
    border-color: #106ebe;
}

.btn-primary:active {
    background: #005a9e;
    border-color: #005a9e;
}

.btn-danger {
    background: white;
    color: #a4262c;
    border-color: #a4262c;
}

.btn-danger:hover {
    background: #f3f2f1;
}

.btn-danger:active {
    background: #edebe9;
}

.btn-secondary {
    background: white;
    color: #323130;
    border-color: #8a8886;
}

.btn-secondary:hover {
    background: #f3f2f1;
    border-color: #323130;
}

.btn-secondary:active {
    background: #edebe9;
}

.btn-success {
    background: #107c10;
    color: white;
    border-color: #107c10;
}

.btn-success:hover {
    background: #0e6b0e;
    border-color: #0e6b0e;
}

.btn-success:active {
    background: #0c5a0c;
    border-color: #0c5a0c;
}

/* Status Boxes */
.status-box {
    padding: 12px 16px;
    border-radius: 2px;
    margin-bottom: 16px;
    font-size: 13px;
    border-left: 4px solid;
}

.status-info {
    background: #f3f9fd;
    border-left-color: #0078d4;
    color: #323130;
}

.status-success {
    background: #dff6dd;
    border-left-color: #107c10;
    color: #323130;
    word-wrap: break-word;
    word-break: break-word;
}

.status-error {
    background: #fde7e9;
    border-left-color: #a4262c;
    color: #323130;
    word-wrap: break-word;
    word-break: break-word;
}

.status-warning {
    background: #fff4ce;
    border-left-color: #ffb900;
    color: #323130;
}

.timer {
    font-size: 14px;
    font-weight: 600;
    color: #0078d4;
    margin: 12px 0;
    padding: 8px 12px;
    background: #f3f9fd;
    border-radius: 2px;
    border-left: 4px solid #0078d4;
}

/* Chat Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 950px;
    max-height: 950px;
    width: 100%;
}

.messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: #faf9f8;
    border: 1px solid #edebe9;
    margin-bottom: 16px;
    width: 100%;
}

.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    max-width: 100%;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    overflow: hidden;
    display: block;
}

.message pre {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
    word-break: break-word;
}

.message code {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message-user {
    background: #0078d4;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message-assistant {
    background: white;
    color: #323130;
    border: 1px solid #edebe9;
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 4px;
    color: #0078d4;
}

.message-assistant .message-sender {
    color: #107c10;
}

/* Markdown content styling */
.markdown-content {
    font-family: inherit;
}

.markdown-content p {
    margin: 8px 0;
    line-height: 1.6;
}

.markdown-content pre {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.markdown-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    font-size: 13px;
}

.markdown-content table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
    border: 1px solid #ddd;
}

.markdown-content table th,
.markdown-content table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.markdown-content table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #323130;
}

.markdown-content table tr:nth-child(even) {
    background: #fafafa;
}

.markdown-content a {
    color: #0078d4;
    text-decoration: none;
    cursor: pointer;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content strong {
    font-weight: 600;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content ul,
.markdown-content ol {
    margin: 8px 0 8px 24px;
    line-height: 1.6;
}

.markdown-content li {
    margin: 4px 0;
}

/* Dark theme markdown styling */
body.dark-theme .markdown-content pre,
body[data-theme="dark"] .markdown-content pre {
    background: #2d2d30;
    border-color: #3e3e42;
    color: #d4d4d4;
}

body.dark-theme .markdown-content code,
body[data-theme="dark"] .markdown-content code {
    background: #2d2d30;
    color: #d4d4d4;
}

body.dark-theme .markdown-content table,
body[data-theme="dark"] .markdown-content table {
    border-color: #3e3e42;
}

body.dark-theme .markdown-content table th,
body[data-theme="dark"] .markdown-content table th {
    background: #3e3e42;
    color: #d4d4d4;
}

body.dark-theme .markdown-content table td,
body[data-theme="dark"] .markdown-content table td {
    border-color: #3e3e42;
}

body.dark-theme .markdown-content table tr:nth-child(even),
body[data-theme="dark"] .markdown-content table tr:nth-child(even) {
    background: #252526;
}

body.dark-theme .markdown-content a,
body[data-theme="dark"] .markdown-content a {
    color: #4dc7ff;
}

.message-time {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 6px;
}

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

.chat-input-container textarea {
    flex: 1;
    resize: vertical;
    min-height: 60px;
    max-height: 200px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.chat-input-container textarea:focus {
    outline: none;
    border-color: #0078d4;
}

.dark-theme .chat-input-container textarea,
body[data-theme="dark"] .chat-input-container textarea {
    background: #2d2d30;
    color: #d4d4d4;
    border-color: #3c3c3c;
}

.dark-theme .chat-input-container textarea:focus,
body[data-theme="dark"] .chat-input-container textarea:focus {
    border-color: #0078d4;
}

/* Logs Styles */
.logs-container {
    height: calc(100vh - 340px);
    overflow-y: auto;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border: 1px solid #3c3c3c;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
}

.log-entry {
    margin-bottom: 8px;
    padding: 6px 8px;
    border-left: 3px solid #0078d4;
    background: #252526;
    border-radius: 2px;
}

.log-time {
    color: #4ec9b0;
    font-weight: 600;
}

.log-level-info,
.log-level-information {
    color: #4fc3f7;
    font-weight: 600;
}

.log-level-error {
    color: #f48771;
    font-weight: 600;
}

.log-level-warning {
    color: #ffd54f;
    font-weight: 600;
}

.log-level-verbose {
    color: #b5cea8;
    font-weight: 600;
}

.log-level-critical {
    color: #ff6b6b;
    font-weight: 600;
}

.refresh-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}

.refresh-controls > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-controls button,
.refresh-controls select {
    padding: 6px 12px;
    font-size: 13px;
}

/* Log Labels */
.log-label {
    font-weight: bold;
    white-space: nowrap;
    color: #323130;
}

body.dark-theme .log-label,
body[data-theme="dark"] .log-label {
    color: #e8e8e8;
}

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
}

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

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Conversation Panel Styles */
.conversation-panel {
    width: 300px;
    height: 750px;
    flex-shrink: 0;
}

#conversationPanel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    overflow-y: auto;
}

.conversation-item {
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: white;
    transition: all 0.2s ease;
}

.conversation-item:hover {
    background: #f5f5f5;
    border-color: #0078d4;
}

.conversation-item.active {
    border-color: #0078d4;
    background: #f0f6ff;
}

/* Dark Theme for Conversation Panel */
body.dark-theme #conversationPanel,
body[data-theme="dark"] #conversationPanel {
    background: #252526;
    border-color: #3e3e42;
}

body.dark-theme .conversation-item,
body[data-theme="dark"] .conversation-item {
    background: #2d2d30;
    border-color: #3e3e42;
    color: #e8e8e8;
}

body.dark-theme .conversation-item:hover,
body[data-theme="dark"] .conversation-item:hover {
    background: #333337;
    border-color: #0078d4;
}

body.dark-theme .conversation-item.active,
body[data-theme="dark"] .conversation-item.active {
    background: #1e3a5f;
    border-color: #0078d4;
}

/* Session Info Bar Styles (Collapsible) */
#sessionInfoBar,
.session-info-bar {
    background: #f3f2f1;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    border: 1px solid #e1dfdd;
    overflow: hidden;
}

.session-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.session-info-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.session-info-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12px;
}

.session-info-toggle {
    font-size: 10px;
    color: #605e5c;
    transition: transform 0.2s ease;
}

.session-info-summary {
    font-weight: normal;
    color: #605e5c;
    font-size: 11px;
    margin-left: 8px;
}

.session-info-details {
    padding: 0 12px 12px 12px;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
    max-height: 200px;
    opacity: 1;
}

.session-info-bar.collapsed .session-info-details {
    max-height: 0;
    opacity: 0;
    padding: 0 12px;
    overflow: hidden;
}

#sessionIdDisplay,
#conversationIdDisplay {
    background: white;
    border: 1px solid #ddd;
    color: #323130;
}

/* Session Info Bar Dark Theme */
body.dark-theme #sessionInfoBar,
body[data-theme="dark"] #sessionInfoBar,
body.dark-theme .session-info-bar,
body[data-theme="dark"] .session-info-bar {
    background: #2d2d30;
    border: 1px solid #3e3e42;
}

body.dark-theme .session-info-header:hover,
body[data-theme="dark"] .session-info-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .session-info-toggle,
body[data-theme="dark"] .session-info-toggle {
    color: #a0a0a0;
}

body.dark-theme .session-info-summary,
body[data-theme="dark"] .session-info-summary {
    color: #a0a0a0;
}

body.dark-theme .session-info-title,
body[data-theme="dark"] .session-info-title {
    color: #e8e8e8;
}

body.dark-theme #sessionInfoBar strong,
body[data-theme="dark"] #sessionInfoBar strong {
    color: #cccccc;
}

body.dark-theme #sessionIdDisplay,
body.dark-theme #conversationIdDisplay,
body[data-theme="dark"] #sessionIdDisplay,
body[data-theme="dark"] #conversationIdDisplay {
    background: #3c3c3c !important;
    border-color: #5a5a5a !important;
    color: #e8e8e8 !important;
}

body.dark-theme #messageCount,
body[data-theme="dark"] #messageCount {
    color: #cccccc;
}

/* ===========================
   Tool Selector Styles
   =========================== */

/* Selected Tools Container (Tags Display) */
.selected-tools-container {
    min-height: 60px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

body.dark-theme .selected-tools-container,
body[data-theme="dark"] .selected-tools-container {
    background: #2d2d2d;
    border-color: #444;
}

.empty-tools-message {
    color: #999;
    font-style: italic;
    width: 100%;
    text-align: center;
    padding: 20px 0;
}

/* Tool Tag */
.tool-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: white;
    border: 1px solid #0078d4;
    border-radius: 16px;
    font-size: 13px;
    transition: all 0.2s ease;
}

body.dark-theme .tool-tag,
body[data-theme="dark"] .tool-tag {
    background: #1e1e1e;
    border-color: #0078d4;
}

.tool-tag:hover {
    box-shadow: 0 2px 6px rgba(0, 120, 212, 0.2);
}

.tool-tag-badge {
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.mcp-badge {
    background: #0078d4;
    color: white;
}

.remote-mcp-badge {
    background: #8764b8;
    color: white;
}

.kernel-badge {
    background: #107c10;
    color: white;
}

.tool-tag-name {
    color: #333;
    font-weight: 500;
}

body.dark-theme .tool-tag-name,
body[data-theme="dark"] .tool-tag-name {
    color: #e0e0e0;
}

.tool-tag-remove {
    background: transparent;
    border: none;
    color: #d13438;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tool-tag-remove:hover {
    background: #d13438;
    color: white;
}

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

body.dark-theme .modal-content,
body[data-theme="dark"] .modal-content {
    background: #1e1e1e;
    border: 1px solid #444;
}

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

body.dark-theme .modal-header,
body[data-theme="dark"] .modal-header {
    border-bottom-color: #444;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

body.dark-theme .modal-header h2,
body[data-theme="dark"] .modal-header h2 {
    color: #e0e0e0;
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

body.dark-theme .close-modal-btn,
body[data-theme="dark"] .close-modal-btn {
    color: #999;
}

body.dark-theme .close-modal-btn:hover,
body[data-theme="dark"] .close-modal-btn:hover {
    background: #2d2d2d;
    color: #e0e0e0;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #ddd;
}

body.dark-theme .modal-footer,
body[data-theme="dark"] .modal-footer {
    border-top-color: #444;
}

/* Search Input in Modal */
.modal-body .search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

body.dark-theme .modal-body .search-input,
body[data-theme="dark"] .modal-body .search-input {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

/* Tool Tabs */
.tool-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tool-tab {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

body.dark-theme .tool-tab,
body[data-theme="dark"] .tool-tab {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

.tool-tab:hover {
    background: #e0e0e0;
}

body.dark-theme .tool-tab:hover,
body[data-theme="dark"] .tool-tab:hover {
    background: #3d3d3d;
}

.tool-tab.active {
    background: #0078d4;
    color: white;
    border-color: #0078d4;
}

body.dark-theme .tool-tab.active,
body[data-theme="dark"] .tool-tab.active {
    background: #0078d4;
    border-color: #0078d4;
}

/* Interface Tabs (Chat/YAML) */
.interface-tabs {
    display: flex;
    gap: 4px;
}

.interface-tab {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

body.dark-theme .interface-tab,
body[data-theme="dark"] .interface-tab {
    color: #aaa;
}

.interface-tab:hover {
    background: rgba(0, 120, 212, 0.1);
    color: #0078d4;
}

body.dark-theme .interface-tab:hover,
body[data-theme="dark"] .interface-tab:hover {
    background: rgba(0, 120, 212, 0.2);
}

.interface-tab.active {
    background: rgba(0, 120, 212, 0.15);
    color: #0078d4;
    border-bottom-color: #0078d4;
    font-weight: 600;
}

body.dark-theme .interface-tab.active,
body[data-theme="dark"] .interface-tab.active {
    background: rgba(0, 120, 212, 0.25);
    color: #4da6ff;
    border-bottom-color: #4da6ff;
}

/* Tool Selector Loading */
.tool-selector-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

body.dark-theme .tool-selector-loading,
body[data-theme="dark"] .tool-selector-loading {
    color: #999;
}

/* Tool Selector List */
.tool-selector-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.tool-selector-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.dark-theme .tool-selector-item,
body[data-theme="dark"] .tool-selector-item {
    background: #2d2d2d;
    border-color: #444;
}

.tool-selector-item:hover {
    background: #f0f0f0;
    border-color: #0078d4;
}

body.dark-theme .tool-selector-item:hover,
body[data-theme="dark"] .tool-selector-item:hover {
    background: #3d3d3d;
    border-color: #0078d4;
}

.tool-selector-checkbox {
    flex-shrink: 0;
}

.tool-selector-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.tool-selector-info {
    flex: 1;
    min-width: 0;
}

.tool-selector-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-theme .tool-selector-name,
body[data-theme="dark"] .tool-selector-name {
    color: #e0e0e0;
}

.tool-selector-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    line-height: 1.4;
}

body.dark-theme .tool-selector-description,
body[data-theme="dark"] .tool-selector-description {
    color: #999;
}

.tool-selector-meta {
    font-size: 11px;
    color: #999;
}

body.dark-theme .tool-selector-meta,
body[data-theme="dark"] .tool-selector-meta {
    color: #666;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

body.dark-theme .spinner,
body[data-theme="dark"] .spinner {
    border-color: #444;
    border-top-color: #0078d4;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==============================
   YAML Preview Modal Styles
   ============================== */

.yaml-panel {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.yaml-header {
    border-bottom: 1px solid var(--border-color);
}

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

.btn-icon {
    padding: 8px 14px;
    background: #0078d4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-icon:hover {
    background: #005a9e;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

body.dark-theme .btn-icon,
body[data-theme="dark"] .btn-icon {
    background: #4a9eff;
    color: white;
}

body.dark-theme .btn-icon:hover,
body[data-theme="dark"] .btn-icon:hover {
    background: #357abd;
}

.yaml-preview {
    background: var(--input-bg);
    overflow-y: auto;
}

.yaml-preview pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

body.dark-theme .yaml-preview,
body[data-theme="dark"] .yaml-preview {
    background: #1e1e1e;
}

body.dark-theme .yaml-preview pre,
body[data-theme="dark"] .yaml-preview pre {
    color: #d4d4d4;
}

.yaml-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.btn-version {
    padding: 8px 14px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-version:hover {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

body.dark-theme .btn-version,
body[data-theme="dark"] .btn-version {
    background: #5a6978;
    color: white;
}

body.dark-theme .btn-version:hover,
body[data-theme="dark"] .btn-version:hover {
    background: #2d3748;
}

#yamlVersionInput {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

body.dark-theme #yamlVersionInput,
body[data-theme="dark"] #yamlVersionInput {
    background: #2d3748;
    border-color: #4a5568;
}

#yamlValidationStatus {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

#yamlPreviewEditor {
    background: var(--input-bg);
    color: var(--text-primary);
}

body.dark-theme #yamlPreviewEditor,
body[data-theme="dark"] #yamlPreviewEditor {
    background: #1e1e1e;
    color: #d4d4d4;
}

/* Load Options Section */
.load-options-section {
    background: #f3f2f1;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
}

body.dark-theme .load-options-section,
body[data-theme="dark"] .load-options-section {
    background: #2d2d30;
}

/* Advanced Settings */
.advanced-settings-summary {
    cursor: pointer;
    font-weight: 600;
    padding: 8px;
    background: #f3f2f1;
    border-radius: 4px;
}

body.dark-theme .advanced-settings-summary,
body[data-theme="dark"] .advanced-settings-summary {
    background: #2d2d30;
    color: #e8e8e8;
}

.advanced-settings-content {
    padding: 12px;
    border: 1px solid #edebe9;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

body.dark-theme .advanced-settings-content,
body[data-theme="dark"] .advanced-settings-content {
    border-color: #3e3e42;
    background: #252526;
}

/* Agent Section Details (Collapsible Groups) */
.agent-section-details {
    margin-bottom: 12px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    background: white;
}

body.dark-theme .agent-section-details,
body[data-theme="dark"] .agent-section-details {
    background: #252526;
    border-color: #3e3e42;
}

.agent-section-summary {
    cursor: pointer;
    font-weight: 600;
    padding: 12px;
    background: #f3f2f1;
    border-radius: 4px;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark-theme .agent-section-summary,
body[data-theme="dark"] .agent-section-summary {
    background: #2d2d30;
    color: #e8e8e8;
}

.agent-section-summary:hover {
    background: #e8e6e3;
}

body.dark-theme .agent-section-summary:hover,
body[data-theme="dark"] .agent-section-summary:hover {
    background: #3e3e42;
}

.agent-section-details[open] .agent-section-summary {
    border-radius: 4px 4px 0 0;
}

.agent-section-content {
    padding: 16px;
    border-top: 1px solid #edebe9;
}

body.dark-theme .agent-section-content,
body[data-theme="dark"] .agent-section-content {
    border-color: #3e3e42;
}

/* Action Buttons Section */
.action-buttons-section {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    background: #f3f2f1;
    border-radius: 6px;
}

body.dark-theme .action-buttons-section,
body[data-theme="dark"] .action-buttons-section {
    background: #2d2d30;
}
/* Dynamic Fields Styles */
.dynamic-field-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: #faf9f8;
    border: 1px solid #edebe9;
    border-radius: 4px;
    align-items: flex-end;
}

body.dark-theme .dynamic-field-row,
body[data-theme="dark"] .dynamic-field-row {
    background: #2d2d30;
    border-color: #3e3e42;
}

.dynamic-field-row input,
.dynamic-field-row textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

body.dark-theme .dynamic-field-row input,
body.dark-theme .dynamic-field-row textarea,
body[data-theme="dark"] .dynamic-field-row input,
body[data-theme="dark"] .dynamic-field-row textarea {
    background: #3e3e42;
    border-color: #555555;
    color: #e8e8e8;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    height: auto;
    min-height: 32px;
}

.btn-remove {
    padding: 6px 12px;
    background: #d83b01;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    min-width: 80px;
}

.btn-remove:hover {
    background: #b8360f;
}

body.dark-theme .btn-remove,
body[data-theme="dark"] .btn-remove {
    background: #e81123;
}

body.dark-theme .btn-remove:hover,
body[data-theme="dark"] .btn-remove:hover {
    background: #d13438;
}

/* Dynamic fields container */
#capabilitiesContainer,
#exampleCommandsContainer {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.capability-field,
.example-command-field {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: #faf9f8;
    border: 1px solid #edebe9;
    border-radius: 4px;
    align-items: flex-start;
}

body.dark-theme .capability-field,
body.dark-theme .example-command-field,
body[data-theme="dark"] .capability-field,
body[data-theme="dark"] .example-command-field {
    background: #2d2d30;
    border-color: #3e3e42;
}

.capability-field > input,
.capability-field > textarea,
.example-command-field > input,
.example-command-field > textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

body.dark-theme .capability-field > input,
body.dark-theme .capability-field > textarea,
body.dark-theme .example-command-field > input,
body.dark-theme .example-command-field > textarea,
body[data-theme="dark"] .capability-field > input,
body[data-theme="dark"] .capability-field > textarea,
body[data-theme="dark"] .example-command-field > input,
body[data-theme="dark"] .example-command-field > textarea {
    background: #3e3e42;
    border-color: #555555;
    color: #e8e8e8;
}

.capability-field {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    align-items: flex-start;
    gap: 8px;
}

.capability-field input:first-child {
    grid-column: 1;
    min-width: 120px;
}

.capability-field textarea {
    grid-column: 2;
    min-height: 60px;
    resize: vertical;
}

.capability-field .btn-remove {
    grid-column: 3;
    grid-row: 1 / 3;
}

/* Modal Capability Item Card */
.capability-item-card,
.example-command-item-card {
    padding: 16px;
    background: #faf9f8;
    border: 1px solid #edebe9;
    border-radius: 6px;
    display: grid;
    gap: 12px;
}

body.dark-theme .capability-item-card,
body.dark-theme .example-command-item-card,
body[data-theme="dark"] .capability-item-card,
body[data-theme="dark"] .example-command-item-card {
    background: #2d2d30;
    border-color: #3e3e42;
}

.capability-item-card > label,
.example-command-item-card > label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.capability-item-card input,
.capability-item-card textarea,
.example-command-item-card input,
.example-command-item-card textarea {
    padding: 10px 12px;
    border: 1px solid #edebe9;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
}

body.dark-theme .capability-item-card input,
body.dark-theme .capability-item-card textarea,
body.dark-theme .example-command-item-card input,
body.dark-theme .example-command-item-card textarea,
body[data-theme="dark"] .capability-item-card input,
body[data-theme="dark"] .capability-item-card textarea,
body[data-theme="dark"] .example-command-item-card input,
body[data-theme="dark"] .example-command-item-card textarea {
    background: #3e3e42;
    border-color: #555555;
    color: #e8e8e8;
}

.capability-item-card textarea {
    min-height: 80px;
    resize: vertical;
}

.capability-item-card-footer,
.example-command-item-card-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #edebe9;
}

body.dark-theme .capability-item-card-footer,
body.dark-theme .example-command-item-card-footer,
body[data-theme="dark"] .capability-item-card-footer,
body[data-theme="dark"] .example-command-item-card-footer {
    border-top-color: #3e3e42;
}

.capability-item-card .btn-remove {
    padding: 6px 12px;
    font-size: 12px;
}

/* Count Display Styles */
#capabilitiesCountDisplay,
#exampleCommandsCountDisplay {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

body.dark-theme #capabilitiesCountDisplay,
body.dark-theme #exampleCommandsCountDisplay,
body[data-theme="dark"] #capabilitiesCountDisplay,
body[data-theme="dark"] #exampleCommandsCountDisplay {
    background: #3e3e42;
    color: #cccccc;
}

/* Load Options Section - Collapsible */
.load-options-details {
    border: 1px solid #edebe9;
    border-radius: 4px;
    background: white;
    margin-bottom: 16px;
}

body.dark-theme .load-options-details,
body[data-theme="dark"] .load-options-details {
    background: #252526;
    border-color: #3e3e42;
}

.load-options-summary {
    cursor: pointer;
    font-weight: 600;
    padding: 12px 16px;
    background: #f3f2f1;
    border-radius: 4px;
    font-size: 13px;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.load-options-summary::-webkit-details-marker {
    display: none;
}

body.dark-theme .load-options-summary,
body[data-theme="dark"] .load-options-summary {
    background: #2d2d30;
    color: #e8e8e8;
}

.load-options-summary:hover {
    background: #e8e7e7;
}

body.dark-theme .load-options-summary:hover,
body[data-theme="dark"] .load-options-summary:hover {
    background: #3e3e42;
}

.load-options-details[open] .load-options-summary {
    border-radius: 4px 4px 0 0;
}

.load-options-content {
    padding: 16px;
    border-top: 1px solid #edebe9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body.dark-theme .load-options-content,
body[data-theme="dark"] .load-options-content {
    border-top-color: #3e3e42;
}

/* 2-Column Agent Setup Layout - DISABLED */
/* Previously used for 2-column form layout, now using single column */

/* Single column layout */
.agent-setup-column {
    display: none;
}

/* Step number styling */
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #0078d4;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    margin-right: 8px;
}

body.dark-theme .step-number,
body[data-theme="dark"] .step-number {
    background: #0078d4;
}

/* Telemetry Section Collapsible Styles */
.telemetry-collapsible.collapsed .telemetry-content {
    max-height: 0 !important;
    overflow: hidden;
}

.telemetry-header {
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.telemetry-header:hover {
    background: #f3f2f1;
}

body.dark-theme .telemetry-header:hover,
body[data-theme="dark"] .telemetry-header:hover {
    background: #2d2d30;
}

.telemetry-toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.telemetry-content {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

/* Right-side Telemetry Panel (Playground) */
.telemetry-toggle {
    position: fixed;
    right: 8px;
    top: 72px;
    width: 36px;
    height: auto;
    min-height: 120px;
    background: var(--bg-primary, white);
    border: 1px solid var(--border-color, #e1e1e1);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.telemetry-toggle:hover {
    background: var(--bg-primary, white);
    border-color: #0078d4;
    box-shadow: 0 4px 16px rgba(0,120,212,0.15);
    transform: translateY(-2px);
}

.telemetry-toggle.active {
    background: #0078d4;
    border-color: #0078d4;
}

.telemetry-toggle-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-primary, #323130);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.telemetry-toggle.active .telemetry-toggle-text {
    color: white;
}

.telemetry-panel {
    position: fixed;
    right: 0;
    top: 64px;
    bottom: 0;
    width: var(--telemetry-panel-width);
    max-width: 90vw;
    background: var(--bg-primary, white);
    border-left: 1px solid var(--border-color, #edebe9);
    box-shadow: -2px 0 12px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.telemetry-panel:not(.collapsed) {
    transform: translateX(0);
}

.telemetry-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #edebe9);
    background: var(--bg-secondary, #f8f9fa);
}

.telemetry-panel-title {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.telemetry-panel-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.telemetry-pin-toggle {
    background: none;
    border: 1px solid transparent;
    font-size: 16px;
    color: var(--text-secondary, #666);
    cursor: pointer;
    padding: 6px 10px;
    line-height: 1;
    transition: all 0.2s;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.telemetry-pin-toggle:hover {
    background: #f3f2f1;
    border-color: #e1e1e1;
}

.telemetry-pin-toggle.pinned {
    color: #0078d4;
    background: #e6f2ff;
    border-color: #0078d4;
}

.telemetry-pin-toggle .pin-label {
    font-size: 12px;
    font-weight: 500;
}

.telemetry-close-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-primary, #323130);
    padding: 6px 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.telemetry-close-btn:hover {
    background: rgba(0,0,0,0.05);
}

.telemetry-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-primary, white);
    color: var(--text-primary, #323130);
}

/* Dark theme for telemetry panel */
body.dark-theme .telemetry-panel,
body[data-theme="dark"] .telemetry-panel {
    background: #252526;
    border-color: #3e3e42;
}

body.dark-theme .telemetry-panel-header,
body[data-theme="dark"] .telemetry-panel-header {
    background: #2d2d30;
    border-color: #3e3e42;
}

body.dark-theme .telemetry-panel-content,
body[data-theme="dark"] .telemetry-panel-content {
    background: #1e1e1e;
    color: #e8e8e8;
}

body.dark-theme .telemetry-close-btn,
body[data-theme="dark"] .telemetry-close-btn {
    color: #e8e8e8;
}

body.dark-theme .telemetry-close-btn:hover,
body[data-theme="dark"] .telemetry-close-btn:hover {
    background: rgba(255,255,255,0.08);
}

body.dark-theme .telemetry-pin-toggle,
body[data-theme="dark"] .telemetry-pin-toggle {
    color: #cfcfcf;
}

body.dark-theme .telemetry-pin-toggle:hover,
body[data-theme="dark"] .telemetry-pin-toggle:hover {
    background: #333;
    border-color: #444;
}

body.dark-theme .telemetry-pin-toggle.pinned,
body[data-theme="dark"] .telemetry-pin-toggle.pinned {
    background: #1a3a5c;
    border-color: #0078d4;
    color: #e8f3ff;
}

body.dark-theme .telemetry-toggle,
body[data-theme="dark"] .telemetry-toggle {
    background: #2d2d30;
    border-color: #3e3e42;
}

body.dark-theme .telemetry-toggle:hover,
body[data-theme="dark"] .telemetry-toggle:hover {
    border-color: #0078d4;
    box-shadow: 0 4px 16px rgba(0,120,212,0.25);
}

body.dark-theme .telemetry-toggle-text,
body[data-theme="dark"] .telemetry-toggle-text {
    color: #e8e8e8;
}

body.dark-theme .telemetry-toggle.active,
body[data-theme="dark"] .telemetry-toggle.active {
    background: #0078d4;
    border-color: #0078d4;
}

body.dark-theme .telemetry-toggle.active .telemetry-toggle-text,
body[data-theme="dark"] .telemetry-toggle.active .telemetry-toggle-text {
    color: white;
}

/* Pinned state */
.telemetry-panel.pinned {
    transform: translateX(0);
}

body.telemetry-pinned .telemetry-toggle {
    display: none;
}

body.telemetry-pinned .content {
    padding-right: calc(var(--telemetry-panel-width) + var(--telemetry-panel-gap));
}

/* Reserve space in chat section for the floating toggle when unpinned */
.content .section:nth-of-type(2) {
    padding-right: 64px;
    transition: padding-right 0.3s ease;
}

/* When pinned, remove that padding since toggle is hidden and main content already has padding */
body.telemetry-pinned .content .section:nth-of-type(2) {
    padding-right: 0;
}

@media (max-width: 900px) {
    .telemetry-panel {
        width: 100%;
        top: 56px;
        bottom: 0;
    }

    .telemetry-toggle {
        right: 12px;
        top: 64px;
    }

    body.telemetry-pinned .content {
        padding-right: 0;
    }
}

/* Hierarchy badges for execution tree */
.hierarchy-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-right: 4px;
    font-weight: 500;
}

.hierarchy-badge-child {
    background: #fff4ce;
    color: #8a6d3b;
}

.hierarchy-badge-parent {
    background: #e5f5fd;
    color: #0078d4;
}

body.dark-theme .hierarchy-badge-child,
body[data-theme="dark"] .hierarchy-badge-child {
    background: #4a3c1f;
    color: #ffd966;
}

body.dark-theme .hierarchy-badge-parent,
body[data-theme="dark"] .hierarchy-badge-parent {
    background: #1a3a4a;
    color: #6db3f2;
}
