.tool-fullwidth {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Tool shell */
.develop-tool {
    max-width: 100%;
    margin: 0 auto;
}

.develop-tool.editor-section,
.editor-section.develop-tool {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.develop-tool .card:not(.result-card) {
    border: 1px solid var(--color-border, #e5e7eb);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
    border-radius: var(--radius, 12px);
    background: var(--color-surface, #fff);
}

.develop-tool .card-body {
    padding: 1.25rem 1.35rem;
}

.develop-tool .card-title {
    color: var(--color-text, #1f2937);
    font-weight: 700;
    font-size: 1.05rem;
}

.develop-tool .form-control,
.develop-tool .form-select,
.develop-tool .select-input,
.develop-tool textarea {
    border-radius: 8px;
    border: 1px solid var(--color-border, #e5e7eb);
}

.develop-tool .form-control:focus,
.develop-tool .form-select:focus,
.develop-tool textarea:focus {
    border-color: var(--color-primary, #0d9488);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.develop-tool .btn-primary {
    background: var(--color-primary, #0d9488);
    border-color: var(--color-primary, #0d9488);
}

.develop-tool .btn-primary:hover {
    background: var(--color-primary-hover, #0f766e);
    border-color: var(--color-primary-hover, #0f766e);
}

.develop-tool .alert {
    border-radius: 10px;
}

[data-theme="dark"] .develop-tool .card:not(.result-card) {
    background: var(--color-surface, #1f2937);
    border-color: var(--color-border, #374151);
}

[data-theme="dark"] .develop-tool .card-title,
[data-theme="dark"] .develop-tool .form-label,
[data-theme="dark"] .develop-tool {
    color: var(--color-text, #f9fafb);
}

[data-theme="dark"] .develop-tool .text-muted,
[data-theme="dark"] .develop-tool .form-text {
    color: var(--color-text-secondary, #9ca3af) !important;
}

[data-theme="dark"] .develop-tool .form-control,
[data-theme="dark"] .develop-tool .form-select,
[data-theme="dark"] .develop-tool textarea {
    background: #111827;
    color: var(--color-text, #f9fafb);
    border-color: var(--color-border, #374151);
}

/* --- tool: twos-complement-calculator --- */
.twos-complement-converter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: auto;
    padding: 2rem 0;
}

.calculator-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.twos-complement-preview {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    color: white;
    margin-bottom: 2rem;
}

.twos-complement-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.input-group-custom {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group-custom .form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 50px 12px 15px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.input-group-custom .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.unit-label {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-calculate {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.quick-input-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #495057;
    transition: all 0.3s ease;
}

.quick-input-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
}

.result-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 1.5rem;
    color: white;
    margin-top: 2rem;
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.result-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.result-unit {
    font-size: 0.9rem;
    opacity: 0.8;
}

.formula-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 15px;
    border: none;
}

.formula-item {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.twos-complement-types {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.twos-complement-type-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: white;
    padding: 0.8rem 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.twos-complement-type-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border-color: white;
}

.twos-complement-type-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.binary-display {
    background: #1a1a1a;
    color: #00ff00;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    margin: 1rem 0;
    border: 2px solid #333;
}

.arithmetic-operations {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.operation-item {
    display: inline-block;
    margin: 2px;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

@media (max-width: 768px) {
    .twos-complement-converter {
        padding: 1rem 0;
    }
    
    .twos-complement-icon {
        font-size: 3rem;
    }
    
    .twos-complement-types {
        gap: 0.5rem;
    }
    
    .twos-complement-type-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}
