.base64-tool-container {
    max-width: 100%;
}

/* Controls */
.tool-controls {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.mode-toggle {
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
    display: inline-flex;
    gap: 8px;
}

.mode-btn {
    border: none;
    background: transparent;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.mode-btn.active {
    background: #ffffff;
    color: var(--ast-global-color-0, #0274be);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mode-btn:hover:not(.active) {
    color: #334155;
}

/* Input/Output Grid */
.io-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .io-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.io-box {
    display: flex;
    flex-direction: column;
}

.io-box label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.2s;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--ast-global-color-0, #0274be);
}

textarea[readonly] {
    background: #f8fafc;
    color: #475569;
}

/* Actions */
.io-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.action-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.secondary {
    background: #e2e8f0;
    color: #475569;
}

.action-btn.secondary:hover {
    background: #cbd5e1;
    color: #1e293b;
}

.action-btn.primary {
    background: var(--ast-global-color-0, #0274be);
    color: #ffffff;
    margin-left: auto;
}

.action-btn.primary:hover {
    opacity: 0.9;
}

/* Error Toast */
.error-toast {
    margin-top: 20px;
    padding: 12px 16px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.hidden {
    display: none;
}