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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    padding: 40px 20px;
    color: #1f2933;
}

.top-bar {
    max-width: 1100px;
    margin: 0 auto 20px;
    padding: 16px 24px;
    background: #111827;
    color: #f9fafb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
}

.brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.main-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    color: #cbd5f5;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    background: #6366f1;
    color: #fff;
}

main {
    max-width: 1100px;
    margin: 0 auto;
}

.container {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
}

h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.subtitle {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 28px;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.tab {
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #94a3b8;
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-bottom 0.2s ease;
}

.tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.tab-content {
    display: none;
}

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

.form-group {
    margin-bottom: 18px;
}

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

input,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    font-family: 'Monaco', 'Courier New', monospace;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.button-group {
    display: flex;
    gap: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

button {
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #4f46e5;
    color: #fff;
    transition: background 0.2s ease;
}

button:hover {
    background: #4338ca;
}

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

.btn-secondary {
    background: #eef2ff;
    color: #1f2937;
}

.result {
    margin-top: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #4f46e5;
    display: none;
}

.result.show {
    display: block;
}

.result.error {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.result pre {
    font-size: 12px;
    line-height: 1.5;
    max-height: 360px;
    overflow: auto;
}

.copy-button {
    margin-top: 12px;
    align-self: flex-start;
    background: #f3f4f6;
    color: #1f2937;
}

.loading {
    display: none;
    padding: 18px;
    color: #4f46e5;
}

.loading.show {
    display: block;
}

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(79, 70, 229, 0.3);
    border-top-color: #4f46e5;
    display: inline-block;
    margin-right: 8px;
    animation: spin 0.8s linear infinite;
}

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

.info-box {
    background: #eef2ff;
    border-left: 4px solid #4338ca;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: #312e81;
    margin-bottom: 18px;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.panel {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.panel h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

.call-list {
    margin-top: 16px;
    max-height: 460px;
    overflow-y: auto;
}

.list .call-item {
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.call-item:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
}

.call-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.call-item.selected {
    border-color: #4f46e5;
    background: #eef2ff;
}

.vector-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    display: block;
    margin-bottom: 4px;
}

.transcript-preview {
    background: #111827;
    color: #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 18px;
    max-height: 220px;
    overflow: auto;
}

.preview-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a5b4fc;
    margin-bottom: 6px;
}

.prompts-section {
    margin-top: 40px;
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
}

.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.prompts-panel {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.prompts-panel h3 {
    margin-bottom: 18px;
    font-size: 18px;
    border-bottom: 2px solid #e0e7ff;
    padding-bottom: 8px;
}

.muted {
    color: #94a3b8;
    font-size: 13px;
}

.muted.error {
    color: #dc2626;
}

.prompts-list {
    max-height: 420px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.prompt-item {
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.2s ease;
}

.prompt-item:last-child {
    border-bottom: none;
}

.prompt-item.selected {
    background: #4338ca;
    color: #fff;
}

.prompt-item-name {
    font-weight: 600;
}

.prompt-item-desc {
    font-size: 12px;
    opacity: 0.8;
}

.full-width {
    width: 100%;
    margin-top: 16px;
}

#managePromptResult {
    margin-top: 16px;
    display: none;
}

.overview-grid {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.overview-card {
    background: #111827;
    color: #f3f4f6;
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.overview-card h3 {
    margin-bottom: 8px;
}

.overview-card p {
    color: #94a3b8;
    font-size: 14px;
}

.overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.35);
}
