/* ==========================================================================
   SeeMe Agent | RPA AI Solver UI - Premium Design System
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-primary: #0a0c10;
    --bg-secondary: #11141c;
    --bg-card: rgba(22, 26, 37, 0.7);
    --bg-card-hover: rgba(30, 36, 50, 0.85);
    --bg-glass: rgba(18, 22, 33, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(110, 86, 255, 0.4);

    /* Brand Colors */
    --accent-primary: #6e56ff;
    --accent-secondary: #00d2ff;
    --accent-gradient: linear-gradient(135deg, #6e56ff 0%, #00d2ff 100%);
    --accent-gradient-hover: linear-gradient(135deg, #7c66ff 0%, #1ae0ff 100%);
    --accent-glow: rgba(110, 86, 255, 0.35);

    /* Status Colors */
    --status-success: #10b981;
    --status-success-bg: rgba(16, 185, 129, 0.15);
    --status-warning: #f59e0b;
    --status-error: #ef4444;

    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Typography & Spacing */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Glow Effects */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    left: -150px;
    background: radial-gradient(circle, rgba(110, 86, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
}

.bg-glow-2 {
    width: 700px;
    height: 700px;
    bottom: -250px;
    right: -150px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 12, 16, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Header / Navbar
   ========================================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
    background: rgba(10, 12, 16, 0.75);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.logo-icon {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.pulse-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--status-success);
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
}

.logo-text h1 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text .subtitle {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 99px;
    background: var(--status-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--status-success);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.dot.online {
    background: var(--status-success);
    box-shadow: 0 0 8px var(--status-success);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.badge-count {
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.12rem 0.45rem;
    border-radius: 99px;
    font-weight: 700;
}

/* ==========================================================================
   Workspace & Panels
   ========================================================================== */
.workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 1.5rem;
    padding: 1.5rem 2.5rem;
    position: relative;
    z-index: 1;
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .workspace {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

/* Left Panel: Inputs */
.input-panel {
    padding: 1.75rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-primary);
}
.panel-title i {
    color: var(--accent-secondary);
    font-size: 1.15rem;
}
.panel-title h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-clear {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--transition-fast);
}
.btn-clear:hover {
    color: var(--status-error);
}

/* Forms */
.solver-form {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

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

.form-group label {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: fit-content;
}

.required {
    color: var(--accent-secondary);
    font-weight: 700;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.label-row > label {
    display: inline-flex !important;
    align-items: center;
    gap: 0.25rem;
    width: auto !important;
    flex: 0 0 auto;
}

.action-links {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

/* File Upload Button & Badge */
.btn-file-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-secondary);
    cursor: pointer;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.25);
    transition: all var(--transition-fast);
}

.btn-file-upload:hover {
    background: rgba(0, 210, 255, 0.18);
    border-color: rgba(0, 210, 255, 0.45);
    transform: translateY(-1px);
}

.btn-file-upload input[type="file"] {
    display: none;
}

.file-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    background: rgba(110, 86, 255, 0.12);
    border: 1px solid rgba(110, 86, 255, 0.4);
    border-radius: var(--radius-sm);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-badge-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: #fff;
    font-weight: 500;
    overflow: hidden;
}

.file-badge-info i {
    color: var(--accent-secondary);
}

.file-badge-info small {
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.btn-remove-file {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.2rem 0.4rem;
    transition: color var(--transition-fast);
}
.btn-remove-file:hover {
    color: var(--status-error);
}

/* Drag and drop zone */
.dropzone-wrapper {
    position: relative;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dropzone-wrapper.drag-over .code-textarea {
    border-color: var(--accent-secondary);
    background: rgba(0, 210, 255, 0.06);
}

.dropzone-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 16, 0.88);
    backdrop-filter: blur(4px);
    border: 2px dashed var(--accent-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--accent-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.dropzone-wrapper.drag-over .dropzone-overlay {
    opacity: 1;
}

.dropzone-overlay i {
    font-size: 1.75rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.btn-link:hover {
    text-decoration: underline;
}

.hint-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Inputs */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.95rem;
}

.input-with-icon input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.7rem;
    background: rgba(10, 12, 16, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.93rem;
    transition: all var(--transition-fast);
}

.input-with-icon input:focus,
.code-textarea:focus,
.full-width-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(110, 86, 255, 0.15);
}

/* Quick Pills */
.quick-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.pill-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 0.2rem;
}

.preset-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-pill:hover {
    background: rgba(110, 86, 255, 0.15);
    border-color: rgba(110, 86, 255, 0.4);
    color: #fff;
}

/* Switch Card */
.switch-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1rem;
    background: rgba(10, 12, 16, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.switch-info {
    max-width: 80%;
}

.switch-title {
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    cursor: pointer;
}

.switch-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: var(--transition-fast);
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition-fast);
}
input:checked + .slider {
    background: var(--accent-gradient);
}
input:checked + .slider:before {
    transform: translateX(20px);
}

/* Code / Textarea */
.code-editor-wrapper {
    position: relative;
}

.code-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(10, 12, 16, 0.75);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.83rem;
    line-height: 1.5;
    resize: vertical;
    transition: all var(--transition-fast);
}

/* Submit Button */
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 28px rgba(110, 86, 255, 0.55);
    transform: translateY(-1px);
}

.btn-submit {
    width: 100%;
    padding: 0.95rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-shortcut {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.25);
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Right Panel: Output States
   ========================================================================== */
.output-panel {
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.output-state {
    display: none;
    flex: 1;
    flex-direction: column;
}

.output-state.active {
    display: flex;
}

/* IDLE Card */
.idle-card {
    margin: auto;
    max-width: 600px;
    text-align: center;
    padding: 2rem;
}

.idle-icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: rgba(110, 86, 255, 0.1);
    border: 1px solid rgba(110, 86, 255, 0.3);
    color: var(--accent-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 35px rgba(110, 86, 255, 0.2);
}

.idle-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.idle-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(10, 12, 16, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.feature-item i {
    font-size: 1.25rem;
    color: var(--accent-secondary);
    margin-top: 0.15rem;
}

.feature-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.feature-item p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ==========================================================================
   LOADING / PROGRESS BAR STATE
   ========================================================================== */
.loading-container {
    margin: auto;
    max-width: 650px;
    width: 100%;
    text-align: center;
    padding: 1.5rem 0;
}

.ai-loader-icon {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(110, 86, 255, 0.2);
    border-top-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

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

.ai-loader-icon i {
    font-size: 2rem;
    color: #fff;
    z-index: 1;
}

.loading-container h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.progress-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Progress Box */
.progress-box {
    background: rgba(10, 12, 16, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.progress-percentage {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-secondary);
    font-size: 0.95rem;
}

.progress-track {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 99px;
    transition: width 0.4s ease;
    box-shadow: 0 0 12px var(--accent-glow);
}

.progress-timer {
    display: flex;
    justify-content: flex-end;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.progress-timer strong {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Steps Timeline */
.steps-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.15rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.step-item.active {
    background: rgba(110, 86, 255, 0.12);
    border-color: rgba(110, 86, 255, 0.45);
}

.step-item.completed {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.step-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.step-item.active .step-icon {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
}

.step-item.completed .step-icon {
    background: var(--status-success);
    color: #fff;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.step-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.step-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.step-item.active .step-status {
    background: rgba(0, 210, 255, 0.15);
    color: var(--accent-secondary);
}

.step-item.completed .step-status {
    background: var(--status-success-bg);
    color: var(--status-success);
}

/* ==========================================================================
   RESULT STATE
   ========================================================================== */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    background: var(--status-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--status-success);
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.result-title-box h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.result-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
}

/* Markdown Container Styling */
.markdown-container {
    flex: 1;
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text-primary);
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1.5rem;
}

.markdown-container h1,
.markdown-container h2,
.markdown-container h3,
.markdown-container h4 {
    color: #fff;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.markdown-container h1 { font-size: 1.45rem; }
.markdown-container h2 { font-size: 1.25rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.4rem; }
.markdown-container h3 { font-size: 1.1rem; color: var(--accent-secondary); }

.markdown-container p {
    margin-bottom: 1rem;
}

.markdown-container ul,
.markdown-container ol {
    margin-left: 1.5rem;
    margin-bottom: 1.2rem;
}

.markdown-container li {
    margin-bottom: 0.4rem;
}

.markdown-container pre {
    background: #06080c;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin: 1rem 0;
}

.markdown-container code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.86rem;
    color: #ffd700;
}

.markdown-container pre code {
    background: none;
    padding: 0;
    color: #e2e8f0;
}

.markdown-container blockquote {
    border-left: 4px solid var(--accent-primary);
    background: rgba(110, 86, 255, 0.08);
    padding: 0.9rem 1.2rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 1rem 0;
    color: #e2e8f0;
}

/* Raw JSON Accordion */
.raw-json-card {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.raw-json-toggle {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
}
.raw-json-toggle:hover {
    color: #fff;
}

.raw-json-body pre {
    margin-top: 0.75rem;
    background: #05070a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    max-height: 250px;
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-secondary);
}

/* ==========================================================================
   Drawer & Modals
   ========================================================================== */
.drawer,
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
}

.drawer.open,
.modal.open {
    display: block;
}

.drawer-backdrop,
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
}

.drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.5);
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.drawer-header,
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.3rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.drawer-header h3,
.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
}
.btn-close:hover { color: #fff; }

.drawer-actions {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* History Card */
.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: rgba(110, 86, 255, 0.1);
    border-color: rgba(110, 86, 255, 0.4);
    transform: translateX(3px);
}

.history-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.history-item-top h4 {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
}

.history-item-top span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.history-item p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal Box */
.modal-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.full-width-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(10, 12, 16, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    transform: translateY(120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateY(0);
}

.toast i {
    color: var(--accent-secondary);
    font-size: 1.15rem;
}
