body, html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f7f7f7;
}

.topbar {
    background-color: #333;
    color: white;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
}

.brand {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1.5px;
}

.tools-nav {
    position: relative;
}

.tools-nav-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #eee;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.tools-nav-toggle:hover,
.tools-nav-toggle[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.45);
}

.tools-nav-toggle .chevron {
    font-size: 11px;
    margin-left: 2px;
    display: inline-block;
}

.tools-nav-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    min-width: 240px;
    padding: 6px;
    z-index: 20;
}

.tools-nav-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.tools-nav-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.tools-nav-tab:hover {
    background-color: #f2f2f2;
    color: #444;
}

.tools-nav-tab.active {
    background-color: #333;
    color: #fff;
}

.tools-nav-empty {
    margin: 0;
    padding: 12px;
    font-size: 13px;
    color: #999;
    text-align: center;
}

.tools-nav-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
}

a.tools-nav-item:hover {
    background-color: #f2f2f2;
}

.tools-nav-item.current {
    background-color: #f5f7ff;
    color: #666;
}

.tools-nav-item-label {
    font-weight: bold;
    font-size: 14px;
}

.tools-nav-item-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.container {
    display: flex;
    justify-content: space-between;
    padding: 50px;
    max-width: 1200px;
    margin: auto;
}

.input-box, .output-box {
    border-radius: 10px;
}

.input-box {
    flex: 1;
    background-color: #fff;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    height: 100%;
}

.output-box {
    flex: 2;
    background-color: #fff;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.label {
    display: block;
    margin-top: 25px;
    margin-bottom: 2px;
    font-size: 18px;
    font-weight: bold;
    color: #666;
}

label:first-of-type {
    margin-top: 0;
}

.subnet-option {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.or-text {
    width: 10%;
    text-align: center;
    margin: 0;
}

.input {
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: inline-block;
    width: 90%; 
    box-sizing: border-box;
    font-size: 16px;
    font-weight: normal;
    color: #666;
}

.button-container {
    text-align: center;
    margin-top: 40px;
}

button {
    padding: 10px 15px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #555;
}

#ip-address {
    width: 100%;
}

#subnet-mask-cidr, #new-subnet-mask-cidr {
    width: 20%;
    margin-right: 5px;
}

#subnet-mask, #new-subnet-mask {
    width: 75%;
}

.output-box h2 {
    font-size: 18px;
    margin-top: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    font-weight: bold;
    color: #666;
}

.output-box p {
    margin: 10px 0;
    font-size: 16px;
}

.output-box p:last-child {
    margin-bottom: 25px;
}

.result-value {
    color: blue;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

td {
    padding: 10px;
    vertical-align: top;
}

.result-name {
    font-weight: normal;
    text-align: left;
    padding-right: 15px;
    color: #333;
    border-right: 1px solid #ddd;
    width: 200px;
}

.result-value {
    font-weight: bold;
    text-align: left;
    padding: 2px 6px 2px 15px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.15s, color 0.15s;
}

.result-value:hover {
    background-color: #e8edff;
}

.result-value.copied {
    background-color: #d7f5d7;
    color: #1f7a1f;
}

table tr:nth-child(odd) {
    background-color: #f7f7f7;
}

table tr:nth-child(even) {
    background-color: #fff;
}

table tr:hover {
    background-color: #e9e9e9;
}

.error-message {
    color: #b00020;
    font-size: 16px;
    font-weight: bold;
}

.note {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.footer {
    margin-top: 40px;
    padding: 20px 0 40px 0;
    text-align: center;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    color: #888;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer a {
    color: #555;
    text-decoration: underline;
}

.imprint-box {
    margin: 15px auto 0 auto;
    width: 100%;
    max-width: 500px;
    text-align: center;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    box-sizing: border-box;
}

.imprint-box h3 {
    margin-top: 0;
    color: #333;
}

.imprint-box p {
    margin: 5px 0;
    color: #555;
    text-align: center;
}

.imprint-desc {
    margin-top: 10px !important;
    font-size: 0.85em;
    color: #777;
}

@media (max-width: 768px) {
    .topbar-inner {
        padding: 15px 20px;
    }

    .container {
        flex-direction: column;
        padding: 15px 10px;
    }

    .input-box {
        order: 1;
        margin: 0 0 15px 0;
        width: 100%;
        box-sizing: border-box;
    }

    .output-box {
        order: 2;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
    }

    .subnet-option {
        flex-direction: column;
        align-items: stretch;
    }

    .or-text {
        width: 100%;
        margin: 8px 0;
    }

    #subnet-mask-cidr, #new-subnet-mask-cidr,
    #subnet-mask, #new-subnet-mask {
        width: 100% !important;
        margin-right: 0;
    }

    .input {
        width: 100% !important;
        box-sizing: border-box;
    }

    button {
        width: 100%;
        height: 48px;
        font-size: 16px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .result-name {
        width: auto;
        min-width: 110px;
    }
}
