:root {
    --b24-primary: #2fc6f6;
    --b24-primary-dark: #1aa9d9;
    --b24-success: #9dcf00;
    --b24-danger: #ff5752;
    --b24-warning: #ffa900;
    --b24-bg: #eef2f4;
    --b24-surface: #ffffff;
    --b24-border: #dfe2e6;
    --b24-text: #333333;
    --b24-text-muted: #828282;
    --b24-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--b24-bg);
    color: var(--b24-text);
    line-height: 1.5;
}

.app {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.app-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.app-header h1 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 600;
}

.app-header p {
    margin: 0;
    color: var(--b24-text-muted);
    font-size: 14px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.stub {
    background: #fff8e6;
    color: #b37b00;
}

.status-badge.native {
    background: #edf7e6;
    color: #5a8f00;
}

.card {
    background: var(--b24-surface);
    border: 1px solid var(--b24-border);
    border-radius: var(--radius);
    box-shadow: var(--b24-shadow);
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--b24-border);
    background: #fafbfc;
}

.tab {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--b24-text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
    color: var(--b24-text);
}

.tab.active {
    color: var(--b24-primary-dark);
    border-bottom-color: var(--b24-primary);
    background: var(--b24-surface);
}

.panel {
    display: none;
    padding: 24px;
}

.panel.active {
    display: block;
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.field-hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--b24-text-muted);
}

select,
textarea,
input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--b24-border);
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    background: #fff;
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
}

.dropzone {
    border: 2px dashed var(--b24-border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--b24-primary);
    background: #f0fbff;
}

.dropzone-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.dropzone-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.dropzone-subtitle {
    font-size: 13px;
    color: var(--b24-text-muted);
}

.file-info {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f5f7f8;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

.file-info.visible {
    display: block;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--b24-primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--b24-primary-dark);
}

.btn-secondary {
    background: #eef2f4;
    color: var(--b24-text);
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e6ea;
}

.result-box {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--b24-border);
    background: #fafbfc;
    display: none;
}

.result-box.visible {
    display: block;
}

.result-box.success {
    border-color: #c5e1a5;
    background: #f7fbf0;
}

.result-box.error {
    border-color: #ffb4b0;
    background: #fff5f4;
}

.result-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.result-meta {
    font-size: 13px;
    color: var(--b24-text-muted);
    margin-bottom: 12px;
    white-space: pre-line;
}

.result-output {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid var(--b24-border);
    border-radius: 6px;
    background: #fff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    word-break: break-all;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.info-item {
    padding: 16px;
    border: 1px solid var(--b24-border);
    border-radius: var(--radius);
    background: #fafbfc;
}

.info-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.info-item span {
    font-size: 14px;
    color: var(--b24-text-muted);
}

.user-bar {
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--b24-surface);
    border: 1px solid var(--b24-border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--b24-text-muted);
}

.loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
    .app-header {
        flex-direction: column;
    }

    .tabs {
        flex-direction: column;
    }
}
