:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* New modern tokens */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --portal-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Subtle background glow effect */
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 25%);
    background-attachment: fixed;
}


/* --- Typography --- */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* --- Glass Header --- */
.top-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

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

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), #818cf8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 18px;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, #0f172a, #334155);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #818cf8);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    background: linear-gradient(135deg, var(--accent-hover), #6366f1);
}

.btn-primary:active {
    transform: translateY(0);
}

/* --- Portal Styles --- */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.portal-item {
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.portal-item--external::after {
    content: '';
    position: absolute;
    left: -25%;
    bottom: -22%;
    width: 125%;
    height: 72%;
    background: rgba(156, 163, 175, 0.16);
    clip-path: polygon(0 35%, 66% 35%, 66% 4%, 100% 50%, 66% 96%, 66% 65%, 0 65%);
    pointer-events: none;
    transform: rotate(-28deg);
}

.portal-item--external > * {
    position: relative;
    z-index: 1;
}

.portal-item--external .portal-icon {
    background: #e5f4f1;
    color: #159b8c;
}

.portal-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--portal-shadow);
    border-color: var(--accent-primary);
}

.portal-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.portal-item:hover::before {
    opacity: 1;
}

.portal-icon {
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.portal-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.portal-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.portal-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s;
}

.portal-item:hover .portal-btn-sm {
    background: var(--accent-primary);
    color: white;
}

.portal-item--external:hover {
    border-color: #159b8c;
    box-shadow: 0 8px 24px rgba(21, 155, 140, 0.2);
}

.portal-item--external:hover::before {
    background: #159b8c;
}

.portal-item--external:hover .portal-icon {
    background: #d2efeb;
    color: #087f72;
}

.portal-item--external:hover .portal-btn-sm {
    background: #159b8c;
    color: white;
}

/* --- Main Content --- */
main.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 2.5rem 4rem;
    width: 100%;
    flex: 1;
}

/* --- Sections --- */
.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Task List & Tree --- */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

.task-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-sm);
}

.task-header {
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.task-info h3 {
    font-size: 1rem;
    margin: 0;
}

.task-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

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

.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-priority {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.badge-status {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.badge-cost {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.task-expanded-content {
    display: none;
    padding: 0 1.25rem 1rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    background: rgba(0, 0, 0, 0.01);
}

.task-card.is-expanded .task-expanded-content {
    display: block;
}

/* Tree Structure */
.sequence-item {
    margin-top: 0.75rem;
    border-left: 2px solid rgba(99, 102, 241, 0.2);
    padding-left: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.2rem;
}

.sequence-header {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.sequence-header:hover {
    color: var(--accent-primary);
}


.action-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.action-item {
    display: grid;
    grid-template-columns: 160px 140px 1fr 80px 130px 80px 28px;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background 0.2s ease;
    border-left: 3px solid transparent;
}

.action-item:hover {
    background: rgba(99, 102, 241, 0.02);
}

.action-id {
    font-weight: bold;
    color: var(--accent);
    opacity: 0.7;
    font-family: monospace;
}

.action-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-summary {
    opacity: 0.6;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    padding-left: 10px;
}

.action-attempts {
    font-size: 0.85em;
    opacity: 0.5;
    text-align: center;
    font-family: monospace;
}

.action-status-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 800;
    text-align: center;
    border-radius: 4px;
    padding: 3px 8px;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 130px;
    white-space: nowrap;
}

.action-status-label.status-completed {
    background: #10b981;
}

/* Green */
.action-status-label.status-pending {
    background: #94a3b8;
}

/* Blue-Gray */
.action-status-label.status-retrying {
    background: #f59e0b;
}

/* Amber */
.action-status-label.status-error {
    background: #ef4444;
}

/* Red */
.action-status-label.status-plan-proposed {
    background: #8b5cf6;
}

/* Purple */
.action-status-label.status-running {
    background: #3b82f6;
}

/* Blue */
.action-cost {
    text-align: right;
    font-family: monospace;
    font-weight: bold;
    opacity: 0.8;
}

.action-item.status-completed {
    border-left-color: #10b981;
}

.action-item.status-running {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.02);
}

.action-item.status-pending {
    border-left-color: #cbd5e1;
}

/* --- Action Grouping --- */
/* All rows now use 7 columns (last = toggle slot) — no override needed */

.action-group-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    flex-shrink: 0;
}

.action-group-toggle:hover {
    background: rgba(99, 102, 241, 0.22);
    transform: scale(1.12);
}

.action-group-toggle.is-open {
    content: '−';
    transform: rotate(45deg);
}

.action-group-children {
    display: none;
    flex-direction: column;
    gap: 0.2rem;
    margin-left: 20px;
    padding-left: 12px;
    border-left: 2px dashed rgba(99, 102, 241, 0.2);
    margin-top: 2px;
    margin-bottom: 2px;
}

.action-group-children.is-open {
    display: flex;
}

.action-child-item {
    opacity: 0.88;
    font-size: 0.82rem;
}

.action-child-item:hover {
    opacity: 1;
}

/* --- Deletion Icons --- */
.delete-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--text-secondary);
    opacity: 0.4;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-icon:hover {
    opacity: 1;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}
/* Unified Icon Buttons */
.icon-btn, .delete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-secondary);
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    line-height: 1;
}

.icon-btn:hover {
    opacity: 1;
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-primary);
    transform: scale(1.1);
}

.delete-icon:hover {
    background: rgba(239, 68, 68, 0.05);
}

.icon-btn.small, .delete-icon.small {
    width: 24px;
    height: 24px;
    font-size: 0.95rem;
}

.delete-icon.small {
    width: 20px;
    height: 20px;
}

.task-card.is-expanded .expand-icon {
    transform: rotate(180deg);
}

.expand-icon {
    transition: transform 0.3s ease;
    opacity: 0.5;
}

.sequence-item.is-collapsed .action-list {
    display: none;
}

.sequence-item.is-collapsed .sequence-header svg:first-child {
    transform: rotate(-90deg);
}

.sequence-item .sequence-header svg:first-child {
    transition: transform 0.3s ease;
}


/* --- Empty States --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* --- Utility Classes --- */
.alert {
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.mt-4 {
    margin-top: 4rem;
}

/* --- Modal & Form Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 2rem;
    width: 95%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    background: white;
    color: #1e293b;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-wide {
    max-width: 1100px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-header h3 {
    color: #1e293b;
    margin: 0;
}

.close-modal {
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.4;
    color: #1e293b;
    transition: opacity 0.2s;
}

.close-modal:hover {
    opacity: 0.8;
}

.form-group {
    margin-bottom: 0.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-family: inherit;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* --- Compact Forms for Workflow Settings --- */
.form-group-compact {
    margin-bottom: 0.5rem;
}

.form-group-compact label {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-group-compact input,
.form-group-compact select {
    display: block;
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.context-fields-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 0.5rem;
    padding: 12px;
    background: rgba(0, 0, 0, 0.015);
    border-radius: 8px;
    border: 1px dashed #e2e8f0;
}

.sequence-row {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.2s;
}

.sequence-row:hover {
    border-color: #cbd5e1;
    background: #e2e8f0;
}

.remove-sequence {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    opacity: 0.4;
    font-size: 1.5rem;
    transition: opacity 0.2s;
}

.remove-sequence:hover {
    opacity: 1;
    color: #ef4444;
}

.workflow-context-fields {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px dashed #cbd5e1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.workflow-context-fields h5 {
    grid-column: 1 / -1;
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

/* --- Action Detail View --- */
.json-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.json-pretty {
    margin: 0;
    color: #1e293b;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    margin: 0 0 0.8rem 0;
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: 0.95rem;
}

.action-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.asset-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    background: #f8fafc;
}

.asset-item img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.asset-item a {
    font-size: 0.8rem;
    color: #3b82f6;
    text-decoration: none;
}

.detail-large {
    width: 98% !important;
    max-width: 1600px !important;
    margin: 10px auto !important;
    height: calc(100vh - 20px) !important;
    max-height: none !important;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    table-layout: fixed;
}

.params-table th,
.params-table td {
    padding: 6px 10px;
    text-align: left;
    border: 1px solid #e2e8f0;
    vertical-align: top;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}

.params-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
}

.params-table th:first-child {
    width: 200px;
}

.params-table td {
    background: white;
    overflow-x: auto;
}

.json-key {
    color: #8b5cf6;
    font-weight: 600;
}

.json-string {
    color: #059669;
}

.json-number {
    color: #d97706;
}

.json-boolean {
    color: #2563eb;
}

.json-null {
    color: #94a3b8;
}

.sequence-item.is-active {
    border-left: 3px solid #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.sequence-item.is-completed {
    border-left: 3px solid #10b981;
    background: rgba(16, 185, 129, 0.03);
}

.sequence-item.is-active .sequence-header {
    color: #3b82f6;
    font-weight: 600;
}

@media (max-width: 600px) {
    .workflow-context-fields {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* --- Animations --- */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


/* --- AI Chat History Bubbles --- */
.ai-chat-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

.ai-history-interaction {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
}

.ai-history-interaction.collapsed {
    max-height: 50px;
}

.ai-interaction-header {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    user-select: none;
}

.ai-interaction-header:hover {
    background: #f1f5f9;
}

.ai-interaction-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-bubble {
    max-width: 85%;
    padding: 0.85rem 1.25rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
}

.ai-bubble-prompt {
    align-self: flex-end;
    background: #3b82f6;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-bubble-response {
    align-self: flex-start;
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
}

.ai-bubble pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

.ai-bubble-prompt pre {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.interaction-toggle-icon {
    transition: transform 0.3s;
}

.collapsed .interaction-toggle-icon {
    transform: rotate(-90deg);
}

/* --- Action Detail Tabs (Restored) --- */
.detail-tabs-header {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.detail-tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    font-weight: 600;
    cursor: pointer;
    color: #64748b;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.detail-tab-btn:hover {
    color: #334155;
}

.detail-tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.detail-tab-content {
    display: none;
}

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

/* HTML Syntax Highlighting */
.html-pretty {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    color: #1e293b;
    margin: 10px 0;
}

.html-tag {
    color: #2563eb;
    font-weight: bold;
}

.html-attr {
    color: #9333ea;
}

.html-string {
    color: #16a34a;
}

.html-comment {
    color: #64748b;
    font-style: italic;
}

/* --- Auto-Run Animations --- */
@keyframes btn-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        transform: scale(1);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        transform: scale(1);
    }
}

.btn-autorun {
    animation: btn-pulse 2s infinite !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    position: relative;
    border: 2px solid #fff !important;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39) !important;
}

.btn-autorun:hover {
    transform: scale(1.05) translateY(-2px) !important;
}

.btn-autorun::after {
    content: "AUTO";
    position: absolute;
    top: -12px;
    right: -12px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 900;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}
/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.dash-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dash-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.dash-card:hover::before {
    opacity: 1;
}

.dash-card-icon {
    width: 64px;
    height: 64px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.dash-card:hover .dash-card-icon {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.dash-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.dash-card-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.dash-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Log Viewer --- */
.log-viewer-container {
    background: #1e293b;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-family: 'Fira Code', 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #e2e8f0;
    height: calc(100vh - 250px);
    overflow-y: auto;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.log-entry {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    white-space: pre-wrap;
    word-break: break-all;
}

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

.log-ts {
    color: #64748b;
    margin-right: 10px;
}

.log-prefix {
    color: #818cf8;
    font-weight: 600;
    margin-right: 10px;
}

.log-msg {
    color: #cbd5e1;
}

.log-error .log-msg {
    color: #fca5a5;
}

.log-success .log-msg {
    color: #86efac;
}

.log-action {
    color: #fbbf24;
}

/* --- Navigation & Header Tweaks --- */
.brand {
    cursor: pointer;
    text-decoration: none;
}

/* --- Debug Plan Overlay --- */
#debug-plan-overlay {
    position: fixed;
    top: 80px;
    right: -650px; /* Hidden by default */
    width: 600px;
    height: calc(100vh - 100px);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px 0 0 20px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

#debug-plan-overlay.is-visible {
    right: 0;
}

#debug-plan-overlay.is-dragged {
    transition: none;
    box-shadow: -15px 15px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    border-radius: 16px;
}

#debug-plan-overlay.is-minimized {
    height: 56px !important;
    width: 250px;
    overflow: hidden;
}

.debug-plan-header {
    padding: 0.8rem 1.2rem;
    background: rgba(99, 102, 241, 0.08);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.debug-plan-header h3 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
}

.debug-plan-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.debug-control-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
}

.debug-control-btn:hover {
    background: var(--accent-primary);
    color: white;
}

.debug-plan-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
}

.debug-worker-card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.debug-worker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-primary);
}

.debug-worker-cost {
    font-size: 0.75rem;
    opacity: 0.7;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.debug-action-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debug-action-mini {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(0,0,0,0.03);
    transition: transform 0.2s;
}

.debug-action-mini:hover {
    transform: translateX(-4px);
    border-color: rgba(99, 102, 241, 0.2);
}

.debug-action-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.debug-action-task {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.debug-action-name {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.debug-action-type {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: normal;
    background: rgba(0,0,0,0.04);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 5px;
}

.debug-action-params {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
    background: rgba(0,0,0,0.02);
    padding: 2px 6px;
    border-radius: 4px;
}

.debug-action-cost {
    font-family: monospace;
    font-weight: bold;
    color: #d97706;
    flex-shrink: 0;
}

.debug-plan-footer {
    padding: 1rem;
    background: rgba(0,0,0,0.02);
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}
.websites-overview .variant-info-trigger {
    padding: 0;
    font-family: inherit;
}

.websites-overview .variant-info-trigger.is-static {
    background: #111827;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.websites-overview .variant-info-trigger.is-static:hover {
    background: #000;
}

.websites-overview .variant-card:has(.variant-info-wrapper:hover),
.websites-overview .variant-card:focus-within {
    z-index: 110;
}

.websites-overview .variant-info-wrapper:focus-within .variant-metadata-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.websites-overview .variant-metadata-tooltip {
    box-sizing: border-box;
    width: min(290px, calc(100vw - 60px));
    max-height: min(650px, calc(100vh - 100px));
    overflow-y: auto;
}

.variant-preview-link {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: calc(100% - 20px);
    min-height: 24px;
    box-sizing: border-box;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    color: var(--accent-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
}

.variant-preview-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.variant-preview-link svg {
    flex-shrink: 0;
}

.variant-preview-link.is-realized {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}

.variant-preview-link:hover {
    background: #fff;
}

.variant-preview-link.is-realized:hover {
    background: #166534;
}

.variant-report-link {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid rgba(147, 197, 253, 0.25);
    border-radius: 6px;
    color: #bfdbfe;
    background: rgba(147, 197, 253, 0.1);
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
}

.variant-report-link:hover {
    background: rgba(147, 197, 253, 0.2);
}

.websites-overview .variant-screenshot-placeholder {
    border-radius: 16px 16px 0 0;
}
.airy-variant-count-badge {
    pointer-events: auto;
    padding: 2px 8px;
    border: 0;
    border-radius: 20px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

/* Task variant dialogs share the same cards on both website overviews. */
.modal-content.task-variants-dialog {
    box-sizing: border-box;
    width: calc(100% - 40px);
    max-width: 1160px;
    max-height: calc(100dvh - 64px);
    margin: 32px auto;
    padding: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.task-variants-dialog .modal-header {
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid #e2e8f0;
    align-items: flex-start;
}

.task-variants-dialog .modal-header h3 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.task-variants-close {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    font: 24px/1 sans-serif;
    cursor: pointer;
    transition: background 160ms, color 160ms;
}

.task-variants-close:hover { background: #eef2ff; color: #4338ca; }

.task-variant-card {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    align-items: start;
    gap: 18px 24px;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid #dfe5ee;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
    transition: border-color 180ms, box-shadow 180ms;
}

.task-variant-card:last-child { margin-bottom: 0; }
.task-variant-card:hover { border-color: #c7d2fe; box-shadow: 0 6px 22px rgba(15, 23, 42, 0.07); }

.task-variant-preview {
    position: relative;
    grid-row: 1 / span 2;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 200px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    cursor: zoom-in;
}

.task-variant-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 220ms;
}

.task-variant-preview:hover img { transform: scale(1.025); }
.task-variant-zoom {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    color: #334155;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.3;
}

.task-variant-preview-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: default; font-size: 0.8rem; }
.task-variant-preview-empty > svg { width: 28px; height: 28px; color: #94a3b8; }
.task-variant-content { min-width: 0; padding-top: 4px; }
.task-variant-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.task-variant-heading h4 { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.025em; color: #0f172a; }
.task-variant-realized { padding: 4px 8px; border: 1px solid #bbf7d0; border-radius: 6px; background: #f0fdf4; color: #15803d; font-size: 0.65rem; font-weight: 700; }
.task-variant-realized.is-pending { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }
.task-variant-realization { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 10px; color: #64748b; font-size: 0.8rem; }
.task-variant-realization a { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: #15803d; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.task-variant-realization a:hover { text-decoration: underline; }
.task-variant-realization a svg { width: 13px; height: 13px; flex-shrink: 0; }
.task-variant-realization a:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 3px; border-radius: 3px; }
.task-variant-host { margin-top: 6px; color: #475569; font-size: 0.85rem; overflow-wrap: anywhere; }
.task-variant-id { margin-top: 9px; color: #94a3b8; font: 0.7rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.task-variant-facts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: 0.75rem; color: #64748b; }
.task-variant-contact { margin-top: 9px; color: #64748b; font-size: 0.75rem; overflow-wrap: anywhere; }

.task-variant-actions {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.task-variants-dialog .task-variant-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-sizing: border-box;
    min-height: 36px;
    padding: 8px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: #475569;
    font: 600 0.75rem/1.3 Inter, system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background 160ms, border-color 160ms, color 160ms;
}

.task-variant-action svg { flex-shrink: 0; }
.task-variants-dialog .task-variant-action:hover { border-color: #c7d2fe; background: #f5f3ff; color: #4338ca; }
.task-variants-dialog .task-variant-action-primary { border-color: #6366f1; background: #6366f1; color: #fff; box-shadow: 0 2px 5px rgba(99, 102, 241, 0.15); }
.task-variants-dialog .task-variant-action-primary:hover { border-color: #4f46e5; background: #4f46e5; color: #fff; }
.task-variants-dialog .task-variant-action-delete { margin-left: auto; border-color: #fecdd3; background: #fff; color: #be123c; }
.task-variants-dialog .task-variant-action-delete:hover { border-color: #fda4af; background: #fff1f2; color: #9f1239; }
.task-variants-dialog :is(.task-variant-action, .task-variants-close, button.task-variant-preview):focus-visible { outline: 3px solid #a5b4fc; outline-offset: 3px; }

@media (max-width: 900px) {
    .task-variant-card { grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
    .task-variant-preview { height: 180px; }
    .task-variant-actions { grid-column: 1 / -1; }
    .task-variant-preview { grid-row: auto; }
}

@media (max-width: 600px) {
    .modal-content.task-variants-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); margin: 10px auto; padding: 16px; border-radius: 18px; }
    .task-variants-dialog .modal-header h3 { font-size: 1.15rem; }
    .task-variant-card { grid-template-columns: minmax(0, 1fr); padding: 12px; border-radius: 14px; }
    .task-variant-preview { height: auto; aspect-ratio: 3 / 2; }
    .task-variant-content { padding: 0 2px; }
    .task-variant-actions { gap: 8px; }
    .task-variants-dialog .task-variant-action { flex: 1 1 auto; }
    .task-variants-dialog .task-variant-action-delete { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .task-variant-card, .task-variant-preview img, .task-variant-action, .task-variants-close { transition: none; }
}

/* Import a static variant onto an existing website. */
@media (min-width: 901px) {
    .task-variant-card.has-create-action { grid-template-columns: 270px minmax(0, 1fr) 230px; }
    .has-create-action .task-variant-preview { grid-row: auto; height: 180px; }
    .has-create-action .task-variant-actions { grid-column: 1 / -1; }
    .task-variant-side-actions { grid-column: 3; grid-row: 1; padding-left: 18px; border-left: 1px solid #e2e8f0; }
    .task-variant-side-actions .task-variant-action { width: 100%; justify-content: flex-start; text-align: left; }
}
@media (max-width: 900px) {
    .task-variant-side-actions { grid-column: 1 / -1; }
}
.task-variants-dialog .task-variant-action-create { border-color: #c7d2fe; background: #eef2ff; color: #3730a3; }
.create-static-page-modal { z-index: 1200; }
.create-static-page-dialog { max-width: 540px; padding: 26px; border-radius: 20px; }
.create-static-page-dialog .modal-header { align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.create-static-page-dialog h3 { margin: 0; font-size: 1.2rem; }
.create-static-page-subtitle, .create-static-page-hint { color: #64748b; font-size: .8rem; margin: 6px 0 0; }
.create-static-page-dialog form { display: flex; flex-direction: column; gap: 10px; }
.create-static-page-dialog label { color: #334155; font-size: .85rem; font-weight: 700; margin-top: 8px; }
.create-static-page-dialog input { box-sizing: border-box; width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; padding: 11px 12px; background: #fff; color: #0f172a; font: inherit; }
.create-static-page-dialog input:focus { outline: 3px solid #c7d2fe; border-color: #6366f1; }
.create-static-page-dialog [hidden], .task-variant-side-actions button[hidden] { display: none; }
.create-static-page-hint { margin: -4px 0 3px; }
.create-static-page-result { margin-top: 10px; padding: 12px; border-radius: 9px; background: #eff6ff; color: #1e40af; font-size: .85rem; overflow-wrap: anywhere; }
.create-static-page-result.is-success { background: #f0fdf4; color: #166534; }
.create-static-page-result.is-error { background: #fff1f2; color: #9f1239; }
.create-static-page-result a { color: inherit; font-weight: 700; }
.create-static-page-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.create-static-page-footer button:disabled { opacity: .6; cursor: wait; }

/* JSON structure of a static variant. */
.task-variant-side-actions { display: flex; flex-direction: column; gap: 9px; }
.task-variant-side-actions .task-variant-action { width: 100%; justify-content: flex-start; text-align: left; }
.static-structure-modal { z-index: 1200; }
.modal-content.static-structure-dialog { box-sizing: border-box; width: calc(100% - 40px); max-width: 1100px; max-height: calc(100dvh - 48px); margin: 24px auto; padding: 24px; display: flex; flex-direction: column; overflow: hidden; }
.static-structure-dialog .modal-header { flex-shrink: 0; margin-bottom: 12px; padding-bottom: 16px; gap: 16px; }
.static-structure-description { margin: 0 0 10px; color: #64748b; font-size: .85rem; }
.static-structure-status { margin-bottom: 10px; color: #475569; font-size: .85rem; }
.static-structure-json { min-height: 180px; max-height: calc(100dvh - 260px); margin: 0; padding: 18px; overflow: auto; border-radius: 12px; background: #111827; color: #dbeafe; font: 13px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.static-structure-json[hidden] { display: none; }
.static-structure-json .json-key { color: #93c5fd; }
.static-structure-json .json-string { color: #a7f3d0; }
.static-structure-json .json-number { color: #fdba74; }
.static-structure-json .json-literal { color: #c4b5fd; }
@media (max-width: 600px) {
    .modal-content.static-structure-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); margin: 10px auto; padding: 16px; }
    .static-structure-json { max-height: calc(100dvh - 245px); font-size: 12px; }
}

/* Collapsible section source viewer. */
.static-structure-switch { display: inline-flex; align-self: flex-start; gap: 3px; padding: 4px; margin: 0 0 14px; border: 1px solid #e2e8f0; border-radius: 11px; background: #f1f5f9; }
.static-structure-switch button { padding: 7px 15px; border: 0; border-radius: 8px; background: transparent; color: #64748b; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.static-structure-switch button[aria-pressed="true"] { color: #4338ca; background: #fff; box-shadow: 0 1px 4px #0f172a1a; }
.static-structure-switch button:focus-visible, .static-section summary:focus-visible, .static-code:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.static-structure-list { min-height: 0; overflow: auto; padding: 2px; }
.static-structure-list[hidden] { display: none; }
.static-section { margin-bottom: 10px; border: 1px solid #e2e8f0; border-radius: 13px; background: #fff; overflow: hidden; }
.static-section-summary, .static-section-file-summary { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; }
.static-section-summary::-webkit-details-marker, .static-section-file-summary::-webkit-details-marker { display: none; }
.static-section-summary { min-height: 58px; padding: 13px 17px; color: #1e293b; }
.static-section-summary:hover { background: #f8fafc; }
.static-section[open] > .static-section-summary { border-bottom: 1px solid #e2e8f0; }
.static-section-title { flex: 1; min-width: 0; font-weight: 700; }
.static-section-name { margin-left: 10px; color: #64748b; font-size: .8rem; font-weight: 500; overflow-wrap: anywhere; }
.static-section-chevron { margin-left: auto; color: #94a3b8; font-size: 1.2rem; line-height: 1; transition: transform .15s; }
.static-section[open] > summary .static-section-chevron, .static-section-file[open] > summary .static-section-chevron { transform: rotate(180deg); }
.static-section-body { padding: 14px 16px 16px; background: #f8fafc; }
.static-section-info { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.static-section-info span { padding: 4px 8px; border-radius: 6px; background: #e9eef6; color: #64748b; font-size: .72rem; }
.static-section-file { margin-top: 8px; overflow: hidden; border: 1px solid #dce4ef; border-radius: 9px; background: #fff; }
.static-section-file-summary { padding: 10px 12px; }
.static-section-file-summary:hover { background: #f8fafc; }
.static-code-badge { min-width: 76px; color: #4338ca; font-size: .78rem; font-weight: 750; }
.static-code-size { color: #94a3b8; font-size: .75rem; }
.static-code { max-height: 50vh; margin: 0; padding: 15px; overflow: auto; background: #111827; color: #dbeafe; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.static-code.is-empty { color: #94a3b8; font-style: italic; }
.static-code .syntax-tag { color: #93c5fd; }
.static-code .syntax-string { color: #a7f3d0; }
.static-code .syntax-comment { color: #94a3b8; font-style: italic; }
.static-code .syntax-keyword { color: #c4b5fd; }
.static-code .syntax-property { color: #7dd3fc; }
.static-code .syntax-number { color: #fdba74; }
@media (max-width: 600px) {
    .static-section-name { display: block; margin: 3px 0 0; }
    .static-section-body { padding: 10px; }
}
