:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --soft: #f8fafc;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    color: var(--text);
}

.page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
    flex: 0 0 auto;
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

    .status.green {
        background: #dcfce7;
        color: #166534;
    }

    .status.red {
        background: #fee2e2;
        color: #991b1b;
    }

.shell {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
}

.card {
    background: var(--card);
    border: 1px solid rgba(226,232,240,0.95);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.card-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.card-body {
    padding: 18px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field {
    margin-bottom: 14px;
}

    .field.full {
        grid-column: 1 / -1;
    }

label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

input, select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    font-size: 14px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

    input:focus, select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
    }

    input[disabled] {
        background: #f8fafc;
        color: #64748b;
    }

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

    .btn-secondary:hover {
        background: #cbd5e1;
    }

.btn-success {
    background: var(--success);
    color: #fff;
}

    .btn-success:hover {
        filter: brightness(0.97);
    }

.info-box {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    margin-top: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 14px;
}

    .info-row:last-child {
        border-bottom: none;
    }

.info-key {
    color: var(--muted);
    font-weight: 700;
}

.info-val {
    font-weight: 800;
    text-align: right;
    word-break: break-word;
    font-family: "Courier New", monospace;
}

.result-json {
    background: #0b1220;
    color: #d1fae5;
    border-radius: 16px;
    padding: 16px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.7;
    min-height: 320px;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
}

.small {
    font-size: 12px;
    color: var(--muted);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.summary-box {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
}

.summary-k {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 6px;
}

.summary-v {
    font-size: 14px;
    font-weight: 800;
    word-break: break-word;
}

@media (max-width: 1024px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page {
        padding: 12px;
    }

    .topbar {
        align-items: flex-start;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        padding: 16px;
    }

    .card-body {
        padding: 16px;
    }

    .btn {
        width: 100%;
    }

    .actions {
        flex-direction: column;
    }

    .info-row {
        flex-direction: column;
        gap: 6px;
    }

    .info-val {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 18px;
    }

    .brand-subtitle {
        font-size: 12px;
    }

    .brand-badge {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .card-title {
        font-size: 16px;
    }

    .status {
        width: 100%;
        justify-content: center;
    }
}
