body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5;
    margin: 0;
    color: #333;
}

.converter-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 400px;
}

h1 {
    color: #0056b3;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

/* Specific styling for the binary input group to accommodate the button */
.input-group.binary-group {
    display: flex;
    align-items: flex-end; /* Align input and button to their bottom (for label alignment) */
    gap: 10px; /* Space between input and button */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.input-group.binary-group label {
    flex-basis: 100%; /* Label takes full width */
    margin-bottom: 8px; /* Standard spacing below label */
}

.input-group.binary-group input[type="text"] {
    flex-grow: 1; /* Allow input to take available space */
    width: auto; /* Override default width */
}

input[type="text"] {
    width: calc(100% - 20px);
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1.1em;
    box-sizing: border-box; /* Include padding in width */
}

input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.invert-button {
    padding: 12px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.0em;
    white-space: nowrap; /* Prevent text from wrapping */
    transition: background-color 0.2s ease;
    align-self: stretch; /* Make button fill height if input changes height due to padding */
    height: 46px; /* Match input height roughly */
}

.invert-button:hover {
    background-color: #0056b3;
}

.binary-info {
    text-align: left;
    margin-top: -15px; /* Pull it closer to the input */
    margin-bottom: 20px;
    padding-left: 5px; /* Align with input's visual padding */
}

.length-counter {
    font-size: 0.85em;
    color: #666;
}

.error-message {
    color: #dc3545;
    margin-top: 15px;
    font-weight: bold;
    min-height: 20px; /* Reserve space for error message */
}