.unit-tool-wrapper { --p-bg: #ffffff; --p-border: #e2e8f0; --p-primary: #4f46e5; --p-text: #0f172a; width: 100%; max-width: 900px; margin: 0 auto; background: var(--p-bg); border-radius: 24px; padding: 32px; border: 1px solid var(--p-border); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); transition: 0.3s; }
.unit-header { font-size: 1.5rem; font-weight: 600; color: var(--p-text); margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.unit-badge { background: #e0e7ff; color: #3730a3; padding: 4px 12px; border-radius: 30px; font-size: 0.8rem; font-weight: 500; }
.unit-subtitle { color: #64748b; font-size: 0.95rem; padding-bottom: 16px; border-bottom: 1px solid var(--p-border); margin-bottom: 24px; }

.unit-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.unit-tab-btn { padding: 8px 16px; border-radius: 20px; font-weight: 500; font-size: 0.95rem; cursor: pointer; border: 1px solid #cbd5e1; background: var(--p-bg); color: #64748b; transition: 0.2s; }
.unit-tab-btn:hover { border-color: var(--p-primary); color: var(--p-primary); }
.unit-tab-btn.active { background: var(--p-primary); color: white; border-color: var(--p-primary); box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }

.unit-converter-layout { display: flex; align-items: center; gap: 20px; }
@media(max-width: 768px) { 
    .unit-converter-layout { flex-direction: column; } 
    .unit-tool-wrapper { padding: 20px; border-radius: 16px; }
}

.unit-box { flex: 1; width: 100%; background: #f8fafc; padding: 24px; border-radius: 16px; border: 1px solid var(--p-border); transition: 0.3s; }
.unit-input { width: 100%; padding: 12px 0; background: transparent; border: none; border-bottom: 2px solid #cbd5e1; color: var(--p-text); font-size: 2rem; font-weight: 700; outline: none; transition: 0.2s; text-align: center; }
.unit-input:focus { border-bottom-color: var(--p-primary); }
.unit-select { width: 100%; padding: 12px; margin-top: 16px; background: var(--p-bg); border: 1px solid #cbd5e1; color: var(--p-text); border-radius: 8px; outline: none; font-size: 1rem; cursor: pointer; }
.unit-select:focus { border-color: var(--p-primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }

.unit-swap-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--p-primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; border: none; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); transition: 0.2s; flex-shrink: 0; }
.unit-swap-btn:hover { transform: rotate(180deg); }

[data-theme="dark"] .unit-tool-wrapper { background: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] .unit-tab-btn { background: #0f172a; border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .unit-tab-btn.active { background: var(--p-primary); color: white; border-color: var(--p-primary); }
[data-theme="dark"] .unit-box { background: #0f172a !important; border-color: #475569 !important; }
[data-theme="dark"] .unit-input { border-bottom-color: #475569; color: #f8fafc; }
[data-theme="dark"] .unit-select { background: #1e293b !important; border-color: #475569 !important; color: #f8fafc !important; }