:root {
    color: #172033;
    background: #f5f7fb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --border: #dfe4ec;
    --muted: #667085;
    --surface: #ffffff;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --ok: #16803c;
    --ok-bg: #edf9f0;
    --warning: #9a5b00;
    --warning-bg: #fff7e7;
    --error: #b42318;
    --error-bg: #fff0ee;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: #f5f7fb;
}

button {
    font: inherit;
}

.shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: max(20px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom));
}

.page-header {
    padding: 2px 2px 14px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 7px;
    font-size: clamp(25px, 7vw, 34px);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.lead {
    max-width: 620px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
}

.summary,
.panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
}

.summary {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 15px;
}

.summary__icon {
    display: inline-grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    background: #eef0f4;
    color: #667085;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.summary__icon.is-ok {
    background: var(--ok-bg);
    color: var(--ok);
}

.summary__icon.is-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.summary__icon.is-error {
    background: var(--error-bg);
    color: var(--error);
}

.summary h2,
.panel h2 {
    margin-bottom: 3px;
    font-size: 16px;
    line-height: 1.3;
}

.summary p,
.panel__header p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.panel {
    margin-bottom: 12px;
    overflow: hidden;
}

.panel__header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 15px 12px;
    border-bottom: 1px solid var(--border);
}

.network-state {
    flex: 0 0 auto;
    max-width: 130px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #f0f2f6;
    color: #475467;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
}

.checks {
    margin: 0;
    padding: 0;
    list-style: none;
}

.check {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
    align-items: center;
    min-height: 52px;
    padding: 10px 15px;
    border-top: 1px solid #edf0f4;
}

.check:first-child {
    border-top: 0;
}

.check__label {
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.check__meta {
    grid-column: 1;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.check__status {
    grid-row: 1 / span 2;
    grid-column: 2;
    min-width: 76px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f0f2f6;
    color: #475467;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.check__status.is-ok {
    background: var(--ok-bg);
    color: var(--ok);
}

.check__status.is-error {
    background: var(--error-bg);
    color: var(--error);
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: 14px 0 10px;
}

.button {
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #cfd5df;
    border-radius: 11px;
    background: #fff;
    color: #283247;
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
}

.button:hover {
    background: #f8f9fb;
}

.button:focus-visible {
    outline: 3px solid rgb(79 70 229 / 24%);
    outline-offset: 2px;
}

.button:disabled {
    cursor: wait;
    opacity: 0.58;
}

.button--primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.button--primary:hover {
    background: var(--primary-dark);
}

.copy-result {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.copy-result p {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.copy-result pre {
    max-height: 240px;
    margin: 0;
    padding: 10px;
    overflow: auto;
    border-radius: 8px;
    background: #f5f7fa;
    color: #344054;
    font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.footer {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    justify-content: space-between;
    padding: 5px 2px 0;
    color: #7c8699;
    font-size: 11px;
}

@media (min-width: 640px) {
    .shell {
        padding-right: 22px;
        padding-left: 22px;
    }

    .summary,
    .panel__header {
        padding-right: 18px;
        padding-left: 18px;
    }

    .check {
        padding-right: 18px;
        padding-left: 18px;
    }
}

@media (max-width: 390px) {
    .actions {
        grid-template-columns: 1fr;
    }

    .panel__header {
        display: block;
    }

    .network-state {
        display: inline-block;
        margin-top: 8px;
    }
}
