/* ============================================================
   Netzwerkrechner
   Baut auf tools.css auf, eigenes Präfix nz-.
   ============================================================ */

/* ---------- Eingabe ----------------------------------------- */
.nz-eingabe {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.nz-feld { min-width: 0; }
.nz-feld label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.nz-input {
    width: 100%;
    font-family: var(--mono);
    font-size: 1.02rem;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 14px;
    min-height: 48px;
    transition: border-color var(--t), box-shadow var(--t);
}
.nz-input:hover { border-color: var(--indigo-light); }
.nz-input:focus-visible { border-color: var(--indigo); }
.nz-input--zahl { max-width: 190px; }
.nz-hilfe {
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.6;
    margin-top: 8px;
}
.nz-hilfe code,
.nz-erklaerung code {
    font-family: var(--mono);
    font-size: .92em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
}

/* Schieberegler fürs Präfix */
.nz-schieber {
    display: flex;
    align-items: center;
    gap: 14px;
}
.nz-range {
    flex: 1;
    min-width: 0;
    height: 44px;
    accent-color: var(--indigo);
    cursor: pointer;
}
.nz-praefix-wert {
    font-family: var(--mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--indigo-deep);
    min-width: 3.4ch;
    text-align: right;
}

/* Beispiele */
.nz-schnellwahl {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}
.nz-schnellwahl-titel {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    margin-right: 4px;
}
.nz-chip {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-round);
    padding: 7px 14px;
    min-height: 38px;
    cursor: pointer;
    transition: var(--t);
}
.nz-chip:hover {
    border-color: var(--indigo);
    background: var(--indigo-xlight);
    color: var(--indigo-deep);
}

/* ---------- Aufteilen --------------------------------------- */
.nz-teilwahl {
    border: 0;
    padding: 0;
    margin: 0 0 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}
.nz-teilkarte {
    position: relative;
    display: block;
    padding: 14px 16px 14px 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
    transition: border-color var(--t), background var(--t);
}
.nz-teilkarte:hover { border-color: var(--indigo-light); }
.nz-teilkarte input {
    position: absolute;
    left: 15px; top: 16px;
    width: 18px; height: 18px;
    accent-color: var(--indigo);
    cursor: pointer;
}
.nz-teilkarte.is-aktiv { border-color: var(--indigo); background: var(--indigo-xlight); }
.nz-teilkarte-name {
    display: block;
    font-size: .92rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.nz-teilkarte-text {
    display: block;
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.5;
}
.nz-zielwerte { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- Ergebnis: Eckdaten ------------------------------- */
.nz-ergebnis[aria-busy="true"] { opacity: .55; }

.nz-karten {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}
.nz-karte {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px 20px;
}
.nz-karte--haupt { background: var(--indigo-xlight); border-color: var(--indigo-border); }
.nz-label {
    display: block;
    font-size: .73rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
}
.nz-karte strong {
    display: block;
    font-family: var(--mono);
    font-size: 1.18rem;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--text);
    line-height: 1.2;
    word-break: break-all;
}
.nz-karte--haupt strong { color: var(--indigo-deep); }
.nz-karte strong span { color: var(--muted); font-weight: 500; }
.nz-zusatz {
    display: block;
    font-size: .79rem;
    color: var(--muted);
    line-height: 1.55;
    margin-top: 7px;
}

.nz-daten {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 28px;
    margin-bottom: 26px;
    border-top: 1px solid var(--border);
}
.nz-daten > div {
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.nz-daten dt {
    font-size: .73rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 5px;
}
.nz-daten dd {
    font-size: .9rem;
    color: var(--text-2);
    line-height: 1.55;
}
.nz-daten dd code {
    font-family: var(--mono);
    font-weight: 500;
    color: var(--text);
}
.nz-daten dd small {
    display: block;
    font-size: .78rem;
    color: var(--muted);
    margin-top: 2px;
}

/* ---------- Binärdarstellung --------------------------------- */
.nz-binaer { margin-bottom: 28px; }
.nz-binaer-text {
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.7;
    max-width: 72ch;
    margin-bottom: 16px;
}
.nz-bitreihen {
    list-style: none;
    margin: 0;
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow-x: auto;
}
.nz-bitreihen li {
    display: grid;
    grid-template-columns: 92px auto 122px;
    align-items: center;
    gap: 14px;
    padding: 5px 0;
    min-width: 520px;
}
.nz-bitname {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    text-align: right;
}
.nz-bits { display: flex; gap: 1px; }
.nz-bit {
    width: 15px;
    font-family: var(--mono);
    font-size: .68rem;
    line-height: 1.9;
    text-align: center;
    border-radius: 2px;
}
.nz-bit.is-netz { background: var(--indigo); color: #fff; }
.nz-bit.is-host { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.nz-bit.is-oktett { margin-right: 6px; }
.nz-bitwert {
    font-family: var(--mono);
    font-size: .76rem;
    color: var(--text-2);
}

/* ---------- Subnetz-Tabelle ---------------------------------- */
.nz-subnetze { margin-bottom: 26px; }
.nz-tabelle-rahmen {
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: auto;
    max-height: 460px;
}
.nz-tabelle {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    min-width: 620px;
}
.nz-tabelle th,
.nz-tabelle td {
    text-align: left;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}
.nz-tabelle thead th {
    position: sticky;
    top: 0;
    background: var(--surface-2);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    z-index: 1;
}
.nz-tabelle td code {
    font-family: var(--mono);
    color: var(--text-2);
}
.nz-tabelle tbody tr:hover { background: var(--surface-2); }
/* Das Subnetz, in dem die eingegebene Adresse liegt */
.nz-tabelle tr.is-hier { background: var(--indigo-xlight); }
.nz-tabelle tr.is-hier td { font-weight: 600; }
.nz-tabelle tr.is-hier td code { color: var(--indigo-deep); }
.nz-tabelle-fuss {
    font-size: .8rem;
    color: var(--muted);
    margin-top: 10px;
    line-height: 1.6;
}

/* ---------- Adressprüfung ------------------------------------ */
.nz-pruefung {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--r);
    border: 1px solid transparent;
}
.nz-pruefung.is-drin {
    background: var(--green-xlight);
    border-color: var(--green-border);
}
.nz-pruefung.is-draussen {
    background: var(--amber-xlight);
    border-color: var(--amber-border);
}
.nz-pruefung-marke {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    flex-shrink: 0;
}
.nz-pruefung.is-drin .nz-pruefung-marke { color: var(--green-deep); }
.nz-pruefung.is-draussen .nz-pruefung-marke { color: var(--amber-deep); }
.nz-pruefung p {
    font-size: .9rem;
    line-height: 1.65;
    color: var(--text-2);
}
.nz-pruefung code {
    font-family: var(--mono);
    font-size: .92em;
}

@media (max-width: 860px) {
    .nz-eingabe { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .nz-bitreihen li { grid-template-columns: 78px auto 112px; gap: 10px; }
    .nz-bit { width: 13px; }
}
