:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f3f6fb;
    color: #172033;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { width: min(780px, calc(100% - 28px)); margin: 36px auto; }
.card {
    background: #fff;
    border: 1px solid #dfe6f1;
    border-radius: 18px;
    padding: clamp(20px, 4vw, 34px);
    box-shadow: 0 18px 55px rgba(31, 45, 74, .09);
}
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e8f1ff;
    color: #075fce;
    font-size: 13px;
    font-weight: 700;
}
h1 { margin: 12px 0 8px; font-size: clamp(26px, 5vw, 38px); }
header p, footer, .notice, .field-help, .boundary p { color: #667085; line-height: 1.65; }
form { display: grid; gap: 12px; margin-top: 28px; }
label { font-weight: 700; }
fieldset { min-width: 0; }
.mode-grid { display: grid; gap: 9px; margin: 3px 0; padding: 12px; border: 1px solid #dfe6f1; border-radius: 12px; }
.mode-grid legend { padding: 0 7px; font-weight: 800; }
.mode-option { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; padding: 10px; border: 1px solid #e3e9f2; border-radius: 10px; background: #fbfcfe; cursor: pointer; }
.mode-option input { margin-top: 4px; }
.mode-option span { display: grid; gap: 4px; }
.mode-option small { color: #667085; font-weight: 500; line-height: 1.5; }
.field-help { margin: -5px 0 3px; font-size: 13px; }
code { padding: 2px 5px; border-radius: 5px; background: #eef2f7; color: #334155; }
textarea, input[type="password"] {
    width: 100%;
    border: 1px solid #cfd8e6;
    border-radius: 12px;
    padding: 13px 14px;
    background: #fbfcfe;
    color: #172033;
    font: 14px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}
textarea { min-height: 150px; resize: vertical; overflow-wrap: anywhere; }
textarea:focus, input:focus { outline: 3px solid rgba(30, 116, 224, .16); border-color: #1e74e0; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; }
button, .link-button {
    border: 0;
    border-radius: 11px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}
.submit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.submit-actions form { margin: 0; }
.primary { background: #126cdb; color: #fff; }
.primary:hover { background: #075bbd; }
.secondary { background: #e9eef6; color: #172033; }
.result { margin-top: 24px; border-radius: 14px; padding: 18px; }
.result.success { background: #f0f8f4; border: 1px solid #bce1cd; }
.result.warning { background: #fffaf0; border: 1px solid #f0d394; }
.result.error { background: #fff4f3; border: 1px solid #f1c2be; }
.result-title { margin-bottom: 12px; font-weight: 800; }
.result textarea { min-height: 118px; margin-top: 8px; }
.facts { display: grid; gap: 8px; margin: 0 0 14px; }
.facts div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; }
.facts dt { color: #667085; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.boundary { margin-top: 24px; padding: 16px 18px; border: 1px solid #f0d394; border-radius: 14px; background: #fffaf0; }
.boundary p { margin: 8px 0 0; }
.gateway-card { margin-top: 26px; padding-top: 26px; border-top: 1px solid #e8edf4; }
.gateway-card h2 { margin: 12px 0 8px; font-size: clamp(21px, 4vw, 28px); }
.gateway-card > p { color: #667085; line-height: 1.65; }
.diagnostic-card { padding-bottom: 2px; }
.diagnostics { margin-top: 14px; padding: 12px 14px; border: 1px solid #dfe6f1; border-radius: 10px; background: #fff; }
.diagnostics summary { cursor: pointer; font-weight: 750; }
.diagnostics p { color: #667085; overflow-wrap: anywhere; }
footer { margin-top: 26px; border-top: 1px solid #e8edf4; padding-top: 18px; font-size: 13px; }
@media (max-width: 560px) {
    main { margin: 14px auto; }
    .card { border-radius: 14px; }
    .actions, .submit-actions { grid-template-columns: 1fr; }
    .facts div { grid-template-columns: 1fr; gap: 2px; }
}
