.schematics-body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.schematics-shell.container {
    max-width: 720px;
    padding: 24px 28px 32px;
}

.schematics-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.schematics-topbar-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.schematics-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.schematics-back-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.schematics-page-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.schematics-session {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.schematics-session.hidden {
    display: none;
}

.schematics-user-badge {
    display: inline-block;
    padding: 8px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schematics-logout-btn {
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.schematics-logout-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.schematics-auth {
    margin-bottom: 24px;
    padding: 18px 20px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    font-size: 14px;
    color: #9a3412;
}

.schematics-auth.hidden {
    display: none;
}

.schematics-auth p {
    margin: 8px 0 0;
    line-height: 1.5;
}

.schematics-auth form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.schematics-auth input {
    flex: 1 1 160px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
}

.schematics-auth button {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.schematics-card {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.schematics-lead {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.55;
}

.schematics-lead code {
    font-size: 12px;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.schematics-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    padding: 40px 24px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.schematics-dropzone:hover {
    border-color: #a5b4fc;
    background: #eef2ff;
}

.schematics-dropzone.is-dragover {
    border-color: #667eea;
    background: #eef2ff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.schematics-dropzone.is-busy {
    opacity: 0.65;
    pointer-events: none;
}

.schematics-dropzone-icon {
    font-size: 2.25rem;
    margin-bottom: 10px;
    line-height: 1;
}

.schematics-dropzone-title {
    margin: 0;
    color: #334155;
    font-size: 15px;
    font-weight: 600;
}

.schematics-dropzone-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: #64748b;
}

.schematics-file-input {
    display: none;
}

.schematics-selected {
    margin-top: 16px;
    padding: 12px 14px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 13px;
    color: #166534;
    word-break: break-all;
}

.schematics-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.schematics-btn-primary,
.schematics-btn-secondary {
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.schematics-btn-primary {
    background: #667eea;
    color: #fff;
}

.schematics-btn-primary:hover:not(:disabled) {
    background: #5a67d8;
}

.schematics-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.schematics-btn-secondary {
    background: #e2e8f0;
    color: #334155;
}

.schematics-btn-secondary:hover {
    background: #cbd5e1;
}

.schematics-status {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    display: none;
    white-space: pre-wrap;
}

.schematics-status.is-visible {
    display: block;
}

.schematics-status.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.schematics-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.schematics-status.info {
    background: #e0f2fe;
    color: #0c4a6e;
    border: 1px solid #bae6fd;
}

.schematics-debug {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #475569;
}

.schematics-debug.hidden {
    display: none;
}

.schematics-debug summary {
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.schematics-debug pre {
    margin: 0 0 10px;
    padding: 12px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
}

.schematics-debug-hint {
    margin: 0;
    font-size: 11px;
    color: #94a3b8;
}

.schematics-debug-hint code {
    font-size: 11px;
}

.schematics-history {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #475569;
}

.schematics-history.hidden {
    display: none;
}

.schematics-history summary {
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.schematics-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.schematics-history-item {
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.45;
}

.schematics-history-item.is-failed {
    background: #fef2f2;
    border-color: #fecaca;
}

.schematics-history-item strong {
    color: #0f172a;
}

.schematics-history-meta {
    color: #64748b;
    margin-top: 4px;
}

.schematics-history-empty {
    color: #94a3b8;
    font-style: italic;
    padding: 8px 0;
}

@media (max-width: 560px) {
    .schematics-shell.container {
        padding: 18px 16px 24px;
    }

    .schematics-topbar {
        flex-direction: column;
    }

    .schematics-session {
        width: 100%;
        justify-content: space-between;
    }

    .schematics-user-badge {
        max-width: none;
        flex: 1;
    }
}
