/* Network Tools — базовые стили */
.nt-widget {
    --nt-bg: #ffffff;
    --nt-fg: #1a1a2e;
    --nt-border: #d9dee6;
    --nt-accent: #2563eb;
    --nt-accent-hover: #1d4ed8;
    --nt-muted: #6b7280;
    --nt-error: #dc2626;
    --nt-code-bg: #f3f4f6;

    max-width: 640px;
    margin: 1.5em auto;
    padding: 1.5rem;
    background: var(--nt-bg);
    color: var(--nt-fg);
    border: 1px solid var(--nt-border);
    border-radius: 12px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .05);
}

.nt-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.nt-form label {
    display: block;
    margin-bottom: .85rem;
}

.nt-form label span {
    display: block;
    margin-bottom: .3rem;
    font-size: .85rem;
    color: var(--nt-muted);
}

.nt-form input,
.nt-form select {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--nt-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--nt-bg);
    color: var(--nt-fg);
    box-sizing: border-box;
}

.nt-form input:focus,
.nt-form select:focus {
    outline: none;
    border-color: var(--nt-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.nt-btn,
.nt-btn-add {
    display: inline-block;
    padding: .6rem 1.25rem;
    background: var(--nt-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s ease;
}

.nt-btn:hover,
.nt-btn-add:hover { background: var(--nt-accent-hover); }

.nt-btn-add {
    background: transparent;
    color: var(--nt-accent);
    border: 1px dashed var(--nt-accent);
    margin-bottom: .85rem;
}

.nt-vlsm-row {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: .5rem;
    margin-bottom: .5rem;
}

.nt-result {
    margin-top: 1.25rem;
    border-top: 1px solid var(--nt-border);
    padding-top: 1rem;
}

.nt-result table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.nt-result th,
.nt-result td {
    text-align: left;
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--nt-border);
}

.nt-result th {
    color: var(--nt-muted);
    font-weight: 500;
    width: 40%;
}

.nt-result td { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.nt-error {
    margin-top: 1rem;
    padding: .75rem 1rem;
    background: #fef2f2;
    color: var(--nt-error);
    border-radius: 8px;
    font-size: .9rem;
}

.nt-badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    background: var(--nt-code-bg);
}

@media (max-width: 480px) {
    .nt-widget { padding: 1rem; }
    .nt-vlsm-row { grid-template-columns: 1fr; }
}