.mode-selector {
    text-align: center;
    display: flex;
}

.mode-btn {
	flex: 1;
    padding: 10px 4px;
    font-size: clamp(0.72rem, 2.8vw, 1.1rem);
    white-space: nowrap;
    cursor: pointer;
    background: #eee;
    border: 1px solid #ccc;
    border-bottom: none;
    margin: 0 2px;
    border-radius: 5px 5px 0 0;
    color: #555;
}

.mode-btn.active {
    background: #fff;
    border-bottom: 2px solid #fff;
    font-weight: bold;
    color: #000;
}

.btn-short { display: none; }

@media (max-width: 340px) {
    .btn-full { display: none; }
    .btn-short { display: inline; }
}

.encoding-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.enc-btn {
    padding: 4px 12px;
    font-size: 85%;
    cursor: pointer;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #555;
    font-weight: normal;
    transition: background-color 0.15s, color 0.15s;
}

.enc-btn.active {
    background: #444;
    color: #fff;
    border-color: #444;
    font-weight: bold;
}

.container-box {
    border: 1px solid #ccc;
    padding: 15px;
    background: #fff;
    margin-top: -1px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.key-box {
    width: 100%;
    font-family: monospace;
    font-size: 90%;
    resize: vertical;
    padding: 5px;
    box-sizing: border-box;
    word-break: break-all;
    overflow-wrap: break-word;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.label-row .step-label {
    flex: 1;
    min-width: 0;
}

.copy-btn {
    font-size: 80%;
    padding: 2px 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.copy-btn.copy-success {
    background-color: #28a745;
    border-color: #28a745;
}

.copy-btn.copy-fail {
    background-color: #dc3545;
    border-color: #dc3545;
}

.step-badge {
    background: #444;
    color: #fff;
    border-radius: 50%;
    width: clamp(18px, 3vw, 22px);
    height: clamp(18px, 3vw, 22px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(11px, 2vw, 13px);
    margin-right: 5px;
    margin-bottom: 2px;
    font-weight: bold;
}

details {
    margin-top: 15px;
    border: 1px dashed #aaa;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
}
summary {
    cursor: pointer;
    font-size: 85%;
    color: #555;
    font-weight: bold;
}
.blur-sensitive {
    filter: blur(4px);
    transition: filter 0.2s;
}
.blur-sensitive:hover,
.blur-sensitive:focus {
    filter: none;
}
.password-highlight {
    border: 2px solid #DD0000;
    color: #DD0000;
    font-weight: bold;
    background-color: #fff5f5;
}

#errorOverlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}
#errorBox {
    background-color: #fff;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 2px solid #DD0000;
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
}
#errorBox h3 {
    margin-top: 0;
    color: #DD0000;
}
#errorMessage {
    color: #333;
    font-size: 110%;
    margin: 15px 0 25px 0;
}
#errorClose {
    background-color: #DD0000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
#errorClose:hover {
    background-color: #aa0000;
}