:root {
    --answerbox-bg: #f5f5f5;
    --next-btnbg: #1E40AF;
    --next-hover-btnbg: #1E3A8A;
    --show-btnbg: #0B7DBB;
    --show-hover-btnbg: #09679A;
    --check-btnbg: #1B9E77;
    --check-hover-btnbg: #157F61;
    --ip-pill-width: 25ch;
    --font-mono: "IBM Plex Mono", "Source Code Pro", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;
    --font-nomono: "IBM Plex Sans", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

input {
    font-family: var(--font-mono);
}

.color-next {
    color: var(--next-btnbg);
}

.color-show {
    color: var(--show-btnbg);
}

.color-check {
    color: var(--check-btnbg);
}


.text-sm {
    font-size: 16px;
}

/* Auto-filled read-only field styling */
.ip-octet.auto-filled-readonly {
    background-color: var(--answerbox-bg);
    color: #777;
    cursor: not-allowed !important;
}

.check-ok-icon {
    display: none;
}


.ok-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 40px;
}

/* Ensure SVG icons are perfectly centered */
.ok-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}


.mc-item {
    padding: 20px;
    border-radius: 8px;
    background-color: white;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;

}

.subnetipv4-content {}

.learning-container {}

.learning-container p {
    margin: 10px auto;
    max-width: 620px;
}

.info-text-container {
    background-color: #e6f8ff;
    border-radius: 8px;
    padding: 12px 20px 12px 30px;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
}

.info-text-container li {
    text-align: start;
    margin-bottom: 0.3em;

}

.info-text-container ul>li>ul {
    padding-left: 1em;
}

.info-text-container a,
.info-text-container a:visited {
    color: var(--next-btnbg);
    text-decoration: none;
}

.info-text-container a:hover {
    text-decoration: underline;
}

.soft-emphasis {
    font-weight: 500;
}

.learn-title-subnetting {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
}

.user-input-target:focus-visible {
    outline: none;
}

.auto-check-button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.sm-table {
    display: flex;
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    margin-top: 40px;
    gap: 40px;
    align-items: center;
    border: 1px solid #bfbfbf;
    border-radius: 8px;
    padding: 20px;
}

.sm-table .sm-cell-vid iframe {
    border-radius: 8px;
}

.sm-cell-text {
    text-align: start;
    font-size: 16px;
}


.subnetipv4-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 880px;
    width: 100%;
    margin: 24px auto;
}

.new-problem-button {
    background-color: var(--next-btnbg);
    color: white;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    height: 31px;
}

.new-problem-button:hover {
    background-color: var(--next-hover-btnbg);
}

.new-problem-button:active {
    background-color: var(--next-btnbg);
}

.new-problem-button:focus {
    outline: none;
}

.main-table-container {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.main-table-row {
    display: flex;
    justify-content: space-around;
    width: 100%;
    border-bottom: 1px solid #ccc;
    min-height: 45px;
    align-items: center;
    background: #fff;
    background: linear-gradient(to right, #fff 0%, #fff 70%, var(--answerbox-bg) 71%, var(--answerbox-bg) 100%);
}

.main-table-labels {
    width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    flex: 2 2 auto;
    min-height: 1em;
}

.main-table-ip-addresses {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    height: 100%;
    min-width: max-content;
    flex: 3 0 auto;
}

.ip-input {}

.ip-answer {
    border: 1px solid #ccc;
}

.ip-answer input:focus-visible {
    outline: none;
    /* background-color: transparent; */
}

.ip-input input:focus-visible {
    outline: none;
}



.sub-table-row {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background-color: var(--answerbox-bg);
    height: 100%;
    min-width: max-content;
    flex: 3 0 auto;
}

.main-table-answers {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background-color: var(--answerbox-bg);
    height: 100%;
    min-width: max-content;
    flex: 3 0 auto;
}

.main-table-answers p,
.main-table-ip-addresses p {
    width: 100%;
    font-weight: 500;
}

.main-table-show {
    width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    height: 100%;
    background-color: var(--answerbox-bg);
    flex: 1 5 auto;
}

.main-table-show p {
    font-weight: 500;
}

.main-table-correct {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    width: 120px;
    height: 100%;
    flex: 1 5 auto;
    min-width: 1ch;
}

.main-table-correct p {
    font-weight: 500;
}

.problem-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    background: #f9fdff;
    border: 1px solid #c5e6f3;
    padding: 10px 10px;
    width: auto;
    border-radius: 4px;
}

.pbox-item {
    align-self: stretch;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 1 auto;
}

.pbox-label {}

.pbox-label-text {
    font-weight: 600;
}

.pbox-next {}

.pbox-targetip {
    gap: 10px;
}

.pbox-targetip input {
    text-align: center;
}

.pbox-targetip .ip-dot {
    font-weight: 700;
}

.ip-pill {
    border: 1px solid #000;
    border-radius: 8px;
}

.sub-table-answer .ip-dot,
.main-table-answer .ip-dot,
.sub-table-answer .ip-pill,
.main-table-answers .ip-pill {
    border-color: #777;
    color:#777;
}

.ip-octet {
    background: inherit;
    border: none;
    border-radius: 8px;
    padding: 5px 0px;
    width: 4ch;
    text-align: center;
    font-size: inherit;
    font-weight: 500;
}

.ip-octet.ip-cidr {
    width: 3ch;
    margin-right:5px;
}

.ip-slash {
   margin-left:5px;
}

.problem-box .ip-target-cidr .ip-octet,
.problem-box .ip-target .ip-octet {
    font-weight:800;
    padding:2px;
}

.view-check-button {
    background: #f9fdff;
    border: 1px solid #c5e6f3;
    color: var(--show-btnbg);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    position: relative;
    top: 1px;
}

.view-check-button:hover {
    border: 1px solid var(--show-hover-btnbg);
    color: var(--show-hover-btnbg);
}

.check-button {
    border: 1px solid #d5f7cb;
    border-radius: 8px;
    background-color: #d5f7cb;
    padding: 6px 10px;
    cursor: pointer;
    position: relative;
    top: 1px;
}

.show-all-container {
    margin-top: 20px;
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.show-all-text {
    font-size: 14px;
    font-weight: 600;
    position: relative;
    top: 2px;
}

.show-all-button {
    background-color: var(--show-btnbg);
    color: white;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    padding: 5px 10px;
    margin-right: 10px;
    cursor: pointer;
}

.show-all-button:hover {
    background-color: var(--show-hover-btnbg);
}

.show-all-button:active {
    background-color: var(--show-btnbg);
}

.show-all-button:focus {
    outline: none;
}

.check-all-button {
    background-color: var(--check-btnbg);
    color: white;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

.check-all-button:hover {
    background-color: var(--check-hover-btnbg);
}

.check-all-button:active {
    background-color: var(--check-btnbg);
}

.check-all-button:focus {
    outline: none;
}


.learn-anchor-div {
    position: relative;
    top: -75px;
}


.sub-table-label {
    display: none;
}

.check-icon-mobile-view {
    display: none;
}

.sm-cell-text-title {
    font-size: 18px;
    margin-bottom: 24px;
}

.sm-cell-text-link {
    margin-top: 16px;
    color: #2374FF;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 16px;
    border-bottom: 1px solid #2374FF;
}

.sub-table {
    display: none;
}

.auto-check-button {
    margin-left: 10px;
    color: black;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    background: #f9fdff;
    border: 1px solid #c5e6f3;
}

.auto-check-button input[type="checkbox"] {
    accent-color: #c5e6f3;
    transform: scale(1.2);
    position: relative;
    top: -0.5px;
}

.auto-check-button input[type="checkbox"]:checked {
    border: 1px solid #000;
    border-radius: 8px;
}

.buttons-options-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.sub-table-show {
    display: none;
    width: 100px;
}

.next-problem-button-mobile-view {
    display: none;
}

.main-table-header-row-header {
    font-weight: 600;
    height: 48px;
}

.hidden-submit {
    border: 0;
    padding: 0;
    font-size: 0;
}

.auto-check-button-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.video-error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex-direction: column;
    color: #666;
}

.video-error-link {
    color: #2374FF;
    text-decoration: none;
    margin-top: 10px;
}

@media (max-width: 768px) {

    .ip-octet {
        width: 3.5ch;
    }
    .address-text {
        display: none;
    }

    .hide-answer-mobile-view {
        display: none !important;
    }

    .sub-table {
        display: block;
    }

    .ip-input {
        display: flex;
    }

    .ip-answer {
        display: flex;
    }

    .sub-table-answer {
        width: 200px;
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    .pbox-label-text {
        margin-right: 0px;
        font-size: 18px;
    }

    .main-table-container {
        box-shadow: none;
        border: none;
        border-radius: 0px;
    }

    .main-table-row {
        height: auto;
        border-bottom: none;
        background: inherit;
    }

    .main-table-correct {
        justify-content: center;

    }

    .check-icon-desktop-view {
        display: none;
    }

    .mc-item {}

    .subnetipv4-content {
        padding: 0px;
    }

    .learning-container {
        padding: 16px;
    }

    .learning-container .sm-table {
        flex-direction: column;
    }

    .sm-table .sm-cell-vid iframe {
        width: 100% !important;
    }

    .sm-cell-text {
        order: 1;
    }

    .ok-icon {
        width: 6ch;
    }

    .sub-table-row .sub-table-label {
        width: 100px !important;
        text-align: center;
        font-weight: 500;
    }

    .show-all-container {
        margin-top: 16px;
    }


    .main-table-answers {
        width: 100%;
        height: 45px;
        justify-content: space-around;
    }

    .sub-table-row {
        width: 100%;
        height: 45px;
        justify-content: space-around;
    }

    .sub-table-show {
        display: block;
    }


    /* Row wrappers — remove space distribution differences and normalize */
    .main-table-row {
        display: flex;
        align-items: center;
        justify-content: normal;
        /* override space-around from base */
        gap: 12px;
        width: 100%;
        padding-inline: 0;
        box-sizing: border-box;
    }

    .sub-table>.sub-table-row {
        display: flex;
        align-items: center;
        justify-content: normal;
        /* override any space-around */
        gap: 12px;
        width: 100%;
        padding-inline: 0;
        box-sizing: border-box;
    }

    /* Left column (labels) — equal left gutter */
    .main-table-row>.main-table-labels,
    .sub-table-row>.sub-table-label {
        flex: 1 1 0;
        /* split remaining width with the right side */
        min-width: 0;
        /* allow shrink; prevents header forcing the row wider */
        display: flex;
        justify-content: flex-end;
        /* hug the center */
        text-align: right;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
        padding: 0;
        width: auto;
        /* override fixed widths (140px, etc.) */
    }

    /* Center column (IP / Answer) — constant track width */
    .main-table-row>.main-table-ip-addresses,
    .sub-table-row>.sub-table-answer {
        /* Fixed center track: adjust ch up/down to taste */
        flex: 0 0 var(--ip-pill-width);
        min-width: 17ch;
        /* defeat min-width:max-content from base */
        max-width: var(--ip-pill-width);
        /* width: var(--ip-pill-width); */
        display: flex;
        align-items: center;
        justify-content: center;
        /* center the pill within the track */
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    /* Make sure inner widgets don't add horizontal margins that bloat the center */
    .main-table-row>.main-table-ip-addresses>*,
    .sub-table-row>.sub-table-answer>* {
        margin: 0;
        max-width: 100%;
        /* leave width:auto so your pill keeps its natural size;
       if you want it to fill the track: width: 100%; */
    }

    /* Right column (Correct? / Show) — equal right gutter */
    .main-table-row>.main-table-correct,
    .sub-table-row>.sub-table-show {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        justify-content: flex-start;
        /* hug the center */
        align-items: center;
        white-space: nowrap;
        margin: 0;
        padding: 0;
        width: auto;
        /* override fixed widths (100–160px) */
    }

}


@media (max-width: 576px) {
    .problem-box {
        width: 55%;
        min-width: 295px;
        margin-bottom: 8px;
    }

    .pbox-label {
        order: 1;
        flex: 0 1 auto;
    }

    .pbox-targetip {
        order: 3;
        flex: 0 0 100%;
    }

    .pbox-next {
        order: 2;
        flex: 0 1 auto;
    }

    .subnetipv4-form {
        padding: 10px 0px;
    }

    .sub-table-row .sub-table-label {
        width: 100px !important;
        text-align: center;
    }

    .sub-table-label {
        width: 100%;
        font-weight: 500;
    }

    .main-table-show {
        width: 120px;
    }

    .main-table-correct {
        width: 100px;
    }

    .show-all-container {
        flex-wrap: wrap;
    }

    .ip-answer {
        margin-left: 10px;
    }

    .main-table-answers {
        width: 100%;
        background-color: var(--answerbox-bg);
        padding: 5px 10px;
    }

    .sub-table-answers {
        width: 100%;
        background-color: var(--answerbox-bg);
        padding: 5px 10px;
    }

    .hide-mobile-view {
        display: none;
    }

    .hide-on-mobile-view-small {
        display: none;
    }

    .sub-table-row,
    .main-table-answers {
        border-bottom: none !important;
    }

    .content-placeholder {
        padding: 1rem 0;
    }

    .pbox-label-text {
        font-size: 16px;
    }

    .next-problem-button-mobile-view {
        display: block;
    }

    .main-table-row,
    .sub-table>.sub-table-row {
        gap: 1px;
    }

    .main-table-row>.main-table-ip-addresses,
    .sub-table-row>.sub-table-answer {
        flex: 0 0 17ch;
        min-width: 17ch;
        max-width: 17ch;
    }

}

/* Debug */

/* .main-table-labels {
    outline: 1px dotted blue;
}

.main-table-ip-addresses {
    outline: 1px dotted red;
}

.main-table-answers {
    outline: 1px dotted green;
}

.sub-table-row {
    outline: 1px dashed orange;
}

.main-table-show {
    outline: 1px dotted purple;
}

.main-table-correct {
    outline: 1px dotted aqua;
}

.main-table-answers>div {
    outline: 1px dotted teal;
    outline-offset: -1px;
} */

/* .pbox-item {
    outline: 1px dotted red;
} */

/* .ip-octet {
        outline: 1px dashed orange;
} */


/* #mainContainer {
    outline: 1px solid yellow;
}
.subnetipv4-content {
    outline: 2px dotted teal;
}
.learning-container {
    outline: 2px dotted red;
} */