* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #172033;
    background: #eef3f8;
}

.page {
    width: 100%;
    min-height: 100vh;
    padding: 32px 16px;
}

.diagnose-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.intro {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-end;
    padding: 30px;
    color: #ffffff;
    background: linear-gradient(135deg, #15375f, #1f7a8c);
    border-radius: 8px 8px 0 0;
}

.intro h1 {
    margin: 6px 0 8px;
    font-size: 34px;
    line-height: 1.15;
}

.intro p {
    margin: 0;
    color: #dcecf4;
}

.eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
    font-weight: 700;
}

.diagnose-form,
.results {
    background: #ffffff;
    border: 1px solid #d8e1ea;
}

.diagnose-form {
    padding: 24px 30px 28px;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

.diagnose-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px;
    gap: 12px;
}

.input-row input {
    width: 100%;
    min-height: 48px;
    padding: 0 15px;
    border: 1px solid #b9c7d6;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
}

.input-row input:focus {
    border-color: #1f7a8c;
    box-shadow: 0 0 0 3px rgba(31,122,140,.16);
}

.input-row button {
    min-height: 48px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: #d34f2f;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.input-row button:disabled {
    opacity: .62;
    cursor: wait;
}

.loader {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: #405066;
}

.loader span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #1f7a8c;
    animation: pulse 1s infinite ease-in-out;
}

.loader span:nth-child(2) {
    animation-delay: .15s;
}

.loader span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes pulse {
    0%, 80%, 100% { transform: scale(.65); opacity: .45; }
    40% { transform: scale(1); opacity: 1; }
}

.message {
    margin-top: 14px;
    color: #b42318;
    font-weight: 700;
}

.results {
    margin-top: 18px;
    border-radius: 8px;
    overflow: hidden;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid #d8e1ea;
    background: #f7fafc;
}

.tab {
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-right: 1px solid #d8e1ea;
    background: transparent;
    color: #405066;
    font-weight: 700;
    cursor: pointer;
}

.tab.active {
    color: #15375f;
    background: #ffffff;
    box-shadow: inset 0 -3px 0 #d34f2f;
}

.tab-panel {
    display: none;
    padding: 24px;
}

.tab-panel.active {
    display: block;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.box {
    border: 1px solid #d8e1ea;
    border-radius: 8px;
    padding: 18px;
    background: #ffffff;
}

.box h3 {
    margin: 0 0 14px;
    font-size: 18px;
    color: #15375f;
}

.kv {
    width: 100%;
    border-collapse: collapse;
}

.kv th,
.kv td {
    padding: 9px 0;
    border-bottom: 1px solid #edf1f5;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.kv th {
    width: 190px;
    color: #637083;
    font-weight: 700;
}

.kv tr:last-child th,
.kv tr:last-child td {
    border-bottom: 0;
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    background: #e9f5f7;
    color: #14596a;
    font-weight: 700;
    font-size: 13px;
}

.badge.warn {
    background: #fff1e8;
    color: #b54708;
}

.badge.ok {
    background: #e8f5ee;
    color: #087443;
}

pre.raw {
    max-height: 420px;
    overflow: auto;
    padding: 16px;
    margin: 0;
    border: 1px solid #d8e1ea;
    border-radius: 8px;
    background: #0f1724;
    color: #dcecf4;
    white-space: pre-wrap;
    word-break: break-word;
}

.heading-list {
    margin: 0;
    padding-left: 20px;
}

.muted {
    color: #637083;
}

@media (max-width: 760px) {
    .page {
        padding: 14px;
    }

    .intro {
        display: block;
        padding: 22px;
    }

    .intro h1 {
        font-size: 26px;
    }

    .diagnose-form {
        padding: 20px;
    }

    .input-row,
    .grid {
        grid-template-columns: 1fr;
    }

    .tab {
        flex: 1 1 100%;
        border-right: 0;
        border-bottom: 1px solid #d8e1ea;
    }

    .tab-panel {
        padding: 16px;
    }

    .kv th,
    .kv td {
        display: block;
        width: 100%;
    }

    .kv th {
        padding-bottom: 2px;
    }

    .kv td {
        padding-top: 2px;
    }
}
