/* podsieci.css: styles for the subnet calculator only, both language versions
   (the shared theme lives in ../wspolne/style.css) */

.ip-mono,
.ip-bits,
.ip-copy,
.ip-list,
.ip-field input,
.ip-row input {
    font-family: ui-monospace, "DejaVu Sans Mono", Consolas, monospace;
}

/* === Tabs at the top: the big segmented buttons === */
.ip-tabs .segmented {
    max-width: 760px;
}

.ip-tabs .segment {
    font-size: 14px;
    padding: 10px 12px;
}

/* phones: four tabs as two rows of two */
@media (max-width: 480px) {
    .ip-tabs .segmented {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* === The answer: one big number, then the details === */
.answer-value {
    font-size: 34px;
    font-weight: 700;
    color: var(--accent-text);
    margin: 6px 0 0;
}

.answer-value sup {
    font-size: 0.55em;
}

.answer-value.answer-none {
    color: var(--text-faint);
}

.answer-label {
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    margin: 4px 0 0;
}

.answer-hint {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
    margin: 8px 0 0;
}

.ip-kind {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.ip-kind b {
    color: var(--text);
    font-weight: 600;
}

.ip-kind .param-help,
.ip-table .param-help {
    display: inline-block;
    vertical-align: 1px;
    margin-left: 4px;
}

/* === Form: label above, wide text input (addresses are long) === */
.ip-field {
    margin-bottom: 10px;
}

.ip-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-size: 13px;
    margin-bottom: 6px;
}

.ip-field input,
.ip-row input {
    width: 100%;
    background: var(--input);
    color: var(--text-strong);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 9px 10px;
    font-size: 15px;
}

.ip-field input:focus,
.ip-row input:focus,
.ip-list:focus,
.ip-copy:focus {
    outline: none;
    border-color: #6d4aff;
    box-shadow: 0 0 0 2px rgba(109, 74, 255, 0.25);
}

.ip-examples {
    justify-content: flex-start;
    align-items: center;
    margin: 0 0 18px;
}

.ip-examples .preset {
    font-family: ui-monospace, "DejaVu Sans Mono", Consolas, monospace;
}

.ip-examples-named .preset {
    font-family: inherit;
}

.ip-examples-label {
    color: var(--text-muted);
    font-size: 12px;
    margin-right: 2px;
}

.ip-choice {
    margin-top: 6px;
}

.ip-choice .segmented {
    margin-bottom: 8px;
}

/* === Subnet list in "Podział": name, hosts, remove === */
.ip-rows {
    margin-bottom: 12px;
}

.ip-rows-head,
.ip-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.ip-rows-head {
    color: var(--text-muted);
    font-size: 12px;
}

.ip-rows-head span:nth-child(2) {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ip-row input.ip-row-hosts {
    text-align: right;
}

.ip-row-remove {
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-muted);
    font: inherit;
    font-size: 12px;
    padding: 6px 8px;
    cursor: pointer;
}

.ip-row-remove:hover {
    color: var(--text);
}

.ip-row-remove:focus-visible {
    outline: 2px solid var(--accent-soft);
    outline-offset: 2px;
}

.ip-add {
    flex: none;
    margin-top: 4px;
}

/* === Tables === */
.ip-table td:first-child b {
    color: var(--text);
}

.ip-table.ip-details td:last-child {
    white-space: normal;
    overflow-wrap: break-word;
}

.ip-table tr.ip-free td {
    color: var(--text-muted);
    font-style: italic;
}

.ip-copy-label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin: 16px 0 6px;
}

.ip-copy {
    width: 100%;
    max-width: 420px;
    background: var(--input);
    color: var(--text-strong);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

/* === Tab "Adres": "Szczegóły" and "Adresy specjalne" side by side (one column on phones and in other tabs) === */
.ip-detail-grid.single {
    grid-template-columns: 1fr;
}

.ip-detail-grid > .panel {
    min-width: 0;
    margin-bottom: 0;
}

.ip-special-intro {
    margin-top: 0;
}

.ip-special-group th {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 16px 0 4px;
}

.ip-special tr.ip-special-group:first-child th {
    padding-top: 4px;
}

#more .ip-steps {
    margin-top: 0;
}

/* "Jak działa IPv6": readable paragraphs, the sources of each in a small line below it */
.ip-ipv6 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.ip-ipv6-card {
    background: var(--panel-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
}

.ip-ipv6-card p {
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 8px;
    flex: 1;
}

.ip-more {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
}

.ip-more a {
    color: var(--accent-text);
}

.ip-special {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ip-special td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.ip-special td:first-child {
    white-space: nowrap;
    width: 1%;
    color: var(--text-strong);
}

.ip-special .param-help {
    display: inline-block;
    vertical-align: 1px;
    margin-left: 2px;
}

.ip-special tr.ip-yours td {
    background: var(--panel-grad-hi);
}

.ip-yours-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-text);
    border: 1px solid var(--accent-text);
    border-radius: 4px;
    padding: 0 5px;
    margin-left: 4px;
    white-space: nowrap;
}

/* === "Nagłówek pakietu": 32 columns = 32 bits, one row = 4 bytes; on phones only the list of fields === */
.ip-hdr {
    display: grid;
    grid-template-columns: 3em repeat(32, minmax(0, 1fr));
    grid-auto-rows: minmax(30px, auto);
    gap: 2px;
    margin: 12px 0 18px;
    font-size: 12px;
}

.ip-hdr-ruler,
.ip-hdr-offset {
    color: var(--text-muted);
    font-size: 11px;
    font-family: ui-monospace, "DejaVu Sans Mono", Consolas, monospace;
}

.ip-hdr-offset {
    align-self: center;
}

.ip-hdr-field {
    background: var(--input);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    color: var(--text);
    padding: 7px 4px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.ip-hdr-address {
    background: var(--panel-grad-hi);
    border-color: var(--accent-text);
    color: var(--text-strong);
    font-weight: 600;
}

.ip-hdr-data {
    color: var(--text-muted);
    border-style: dashed;
    background: transparent;
}

.ip-hdr-table tr.ip-hdr-address-row td {
    background: var(--panel-grad-hi);
}

.ip-hdr-table td:nth-child(2) {
    text-align: right;
}

.ip-hdr-table td:nth-child(3) {
    white-space: nowrap;
    font-family: ui-monospace, "DejaVu Sans Mono", Consolas, monospace;
    font-size: 12px;
}

.ip-hdr-table td:nth-child(4) {
    white-space: normal;
    min-width: 280px;
}

.ip-hex-title {
    color: var(--text);
    font-size: 14px;
    margin: 18px 0 4px;
}

.ip-hex {
    background: var(--input);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 6px 0 12px;
    font-size: 13px;
    line-height: 1.7;
}

.ip-hex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
}

.ip-hex-bytes {
    font-family: ui-monospace, "DejaVu Sans Mono", Consolas, monospace;
    white-space: nowrap;
}

.ip-hex-note {
    color: var(--text-soft);
}

/* colours of byte groups in the hex view (the same colour for the bytes and their description) */
.ip-hx0 { color: var(--accent-text); }
.ip-hx1 { color: var(--green); }
.ip-hx2 { color: var(--orange); }
.ip-hx3 { color: var(--pink); }

@media (max-width: 700px) {
    .ip-hdr {
        display: none;
    }

    /* phones: each field as a small card: name and bits, the description below */
    .ip-hdr-table thead {
        display: none;
    }

    .ip-hdr-table tr {
        display: grid;
        grid-template-columns: 1fr auto;
        border-bottom: 1px solid var(--border);
    }

    .ip-hdr-table td {
        border-bottom: none;
    }

    .ip-hdr-table td:nth-child(3) {
        grid-column: 1 / -1;
        padding-top: 0;
        color: var(--accent-text);
    }

    .ip-hdr-table td:nth-child(4) {
        grid-column: 1 / -1;
        padding-top: 0;
        color: var(--text-soft);
        white-space: normal;
    }
}

.ip-apply {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 13px;
}

/* === Tab "Lista → CIDR": the pasted list, blocks with addresses from outside the list, the list to copy === */
.ip-list {
    width: 100%;
    background: var(--input);
    color: var(--text-strong);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 9px 10px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.ip-warn {
    color: var(--orange);
}

.ip-table tr.ip-partial td:last-child {
    color: var(--orange);
}

.ip-copy-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    max-width: 420px;
    margin: 16px 0 6px;
}

.ip-copy-head .ip-copy-label {
    margin: 0;
}

/* === "Krok po kroku": bits / hex digits, the network part violet, the host part grey === */
.ip-steps {
    margin: 22px 0 0;
    padding: 0;
    border: none;
}

.ip-steps-table {
    border-collapse: collapse;
    font-size: 13px;
    margin: 6px 0;
}

.ip-steps-table th {
    color: var(--text-soft);
    font-weight: 600;
    text-align: left;
    padding: 8px 14px 2px 0;
    white-space: nowrap;
    vertical-align: top;
}

.ip-steps-table td {
    padding: 8px 14px 2px 0;
    white-space: nowrap;
    vertical-align: top;
}

.ip-steps-table td.ip-mono {
    color: var(--text);
}

.ip-steps-table tr.ip-step-note td {
    color: var(--text-muted);
    font-size: 12px;
    white-space: normal;
    padding-top: 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.ip-bits {
    letter-spacing: 0.5px;
}

.bit-net {
    color: var(--accent-soft);
    font-weight: 600;
}

.bit-host {
    color: var(--text-muted);
}

.bit-split {
    color: var(--orange);
    font-weight: 600;
}

.bit-dot {
    color: var(--text-faint);
}

/* === Phones: one column of fields, the table rows narrower === */
@media (max-width: 560px) {
    .ip-rows-head,
    .ip-row {
        grid-template-columns: minmax(0, 1fr) 84px auto;
        gap: 6px;
    }

    .ip-steps-table th {
        white-space: normal;
        min-width: 90px;
    }
}

/* the details table: two columns side by side, not spread over the whole width */
.ip-table.ip-details {
    width: auto;
    min-width: min(100%, 560px);
}

.ip-table.ip-details th {
    text-align: left;
}

/* addresses read better aligned to the left */
.ip-table th,
.ip-table td {
    text-align: left;
}

/* phones: in "Krok po kroku" the label, the bits and the value go one under another */
@media (max-width: 560px) {
    .ip-steps-table,
    .ip-steps-table tbody,
    .ip-steps-table tr,
    .ip-steps-table th,
    .ip-steps-table td {
        display: block;
    }

    .ip-steps-table th {
        padding: 10px 0 2px;
    }

    .ip-steps-table td {
        padding: 0 0 2px;
    }

    .ip-bits {
        font-size: 11px;
        letter-spacing: 0;
    }

    .ip-table.ip-details td:last-child {
        overflow-wrap: break-word;
        font-size: 12px;
    }
}
