/* unit_converter.css — extracted verbatim from unit_converter.html's original inline <style>; logic/behavior unchanged, only relocated */
/* ==========================================================================
           1. DESIGN SYSTEM & VARIABLES (Synced with Dashboard & Calculator)
           ========================================================================== */
        :root {
            --font-main: 'Plus Jakarta Sans', sans-serif;
            --transition-speed: 0.4s;
            --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            
            --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            --calc-bg: #ffffff;
            --calc-border: rgba(15, 23, 42, 0.06);
            --calc-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.04);
            --text-main: #0f172a;
            --text-secondary: #64748b;
            
            --input-bg: rgba(241, 245, 249, 0.8);
            --accent-color: #4f46e5;
            --accent-hover: #4338ca;
            --panel-bg: #ffffff;
            --scrollbar-thumb: rgba(15, 23, 42, 0.15);
        }

        body.dark-mode {
            --bg-gradient: linear-gradient(135deg, #020617 0%, #0f172a 100%);
            --calc-bg: rgba(15, 23, 42, 0.6);
            --calc-border: rgba(255, 255, 255, 0.06);
            --calc-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            --text-main: #f8fafc;
            --text-secondary: #94a3b8;
            
            --input-bg: rgba(30, 41, 59, 0.5);
            --accent-color: #c084fc;
            --accent-hover: #a855f7;
            --panel-bg: rgba(15, 23, 42, 0.95);
            --scrollbar-thumb: rgba(255, 255, 255, 0.1);
        }

        /* ==========================================================================
           2. GLOBAL STYLES & RESET
           ========================================================================== */
        * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }
        body {
            font-family: var(--font-main); background: var(--bg-gradient); min-height: 100vh;
            display: flex; justify-content: center; align-items: center; padding: 40px 20px;
            color: var(--text-main); transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
            overflow-x: hidden; position: relative;
        }
        body::before {
            content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%;
            filter: blur(150px); opacity: 0.15; z-index: -1; top: -10%; left: -10%; background: #4f46e5;
        }

        /* ==========================================================================
           3. APPLICATION CONTAINER & HEADER
           ========================================================================== */
        .calc-container {
            position: relative; width: 100%; max-width: 450px; 
            max-height: calc(100vh - 80px); /* FIXED: Generates desktop constraint boundaries */
            background: var(--calc-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--calc-border); border-radius: 28px; box-shadow: var(--calc-shadow);
            display: flex; flex-direction: column; overflow: hidden; transition: var(--transition-smooth);
        }
        .calc-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 20px 24px 10px 24px; z-index: 10; flex-shrink: 0;
        }
        .calc-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.5px; }
        .header-controls { display: flex; gap: 10px; align-items: center; }
        
        .icon-btn {
            background: var(--input-bg); border: 1px solid var(--calc-border);
            width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
            display: flex; justify-content: center; align-items: center;
            color: var(--text-main); transition: var(--transition-smooth);
        }
        .icon-btn:hover { transform: scale(1.05); border-color: var(--accent-color); }
        .icon-btn:active { transform: scale(0.95); }
        .icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

        .theme-btn .sun-icon, body.dark-mode .theme-btn .moon-icon { display: none; }
        body.dark-mode .theme-btn .sun-icon { display: block; }

        /* ==========================================================================
           4. CONVERTER WORKSPACE LAYOUT
           ========================================================================== */
        .converter-body {
            padding: 10px 24px 24px 24px; flex-grow: 1; display: flex;
            flex-direction: column; gap: 16px; 
            overflow-y: auto; /* FIXED: Enables inner scroll viewports across smaller monitors */
        }
        .converter-body::-webkit-scrollbar { width: 5px; }
        .converter-body::-webkit-scrollbar-track { background: transparent; }
        .converter-body::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; }

        label { font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; display: block; }
        
        .form-group { display: flex; flex-direction: column; position: relative; }
        
        select, input {
            width: 100%; background: var(--input-bg); border: 1px solid var(--calc-border);
            padding: 14px 16px; border-radius: 14px; font-family: var(--font-main);
            font-size: 1rem; font-weight: 600; color: var(--text-main); outline: none;
            transition: var(--transition-smooth); -webkit-user-select: text; user-select: text;
        }
        select { cursor: pointer; -webkit-appearance: none; appearance: none; }
        select:focus, input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }

        .select-wrapper { position: relative; }
        .select-wrapper::after {
            content: '\f107'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
            position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
            color: var(--text-secondary); pointer-events: none;
        }

        .swap-container { display: flex; justify-content: center; margin: 4px 0; }
        .swap-btn {
            background: var(--accent-color); color: #ffffff; border: none;
            width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25); transition: var(--transition-smooth);
        }
        .swap-btn:hover { transform: scale(1.1) rotate(180deg); background: var(--accent-hover); }

        .output-card {
            background: var(--input-bg); border: 1px solid var(--calc-border);
            padding: 18px; border-radius: 16px; min-height: 90px;
            display: flex; flex-direction: column; justify-content: center; position: relative;
        }
        .output-value {
            font-family: 'Space Grotesk', sans-serif; font-size: 1.8rem;
            font-weight: 700; word-break: break-all; margin-top: 4px;
        }

        .config-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

        .info-card {
            background: rgba(79, 70, 229, 0.04); border: 1px dashed rgba(79, 70, 229, 0.2);
            padding: 14px; border-radius: 14px; font-size: 0.85rem; line-height: 1.4;
        }
        body.dark-mode .info-card { background: rgba(192, 132, 252, 0.04); border-color: rgba(192, 132, 252, 0.2); }
        .info-title { font-weight: 700; color: var(--accent-color); margin-bottom: 2px; }

        .action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; flex-shrink: 0; }
        .btn-action {
            padding: 14px; border-radius: 14px; border: none; font-family: var(--font-main);
            font-size: 0.95rem; font-weight: 700; cursor: pointer; display: flex;
            align-items: center; justify-content: center; gap: 8px; transition: var(--transition-smooth);
        }
        .btn-clear { background: var(--input-bg); color: var(--text-main); border: 1px solid var(--calc-border); }
        .btn-clear:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }
        .btn-convert { background: var(--accent-color); color: #ffffff; }
        .btn-convert:hover { background: var(--accent-hover); transform: translateY(-2px); }

        /* ==========================================================================
           5. SLIDEOUT HISTORY PANEL
           ========================================================================== */
        .history-panel {
            position: absolute; top: 0; right: -100%; width: 100%; height: 100%;
            background: var(--panel-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
            z-index: 100; transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex; flex-direction: column;
        }
        .history-panel.open { right: 0; }
        .history-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 24px; border-bottom: 1px solid var(--calc-border);
        }
        .history-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 700; }
        .history-list { flex-grow: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
        .history-list::-webkit-scrollbar { width: 4px; }
        .history-list::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
        
        .history-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 12px 14px; background: var(--input-bg); border: 1px solid var(--calc-border);
            border-radius: 12px; cursor: pointer; transition: var(--transition-smooth);
        }
        .history-item:hover { transform: translateY(-1px); border-color: var(--accent-color); }
        .history-text { display: flex; flex-direction: column; text-align: left; gap: 2px; }
        .history-meta { font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; }
        .history-expr { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
        .btn-delete-item { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; font-size: 0.9rem; }
        .btn-delete-item:hover { color: #ef4444; }

        .history-footer { padding: 20px 24px; border-top: 1px solid var(--calc-border); display: flex; justify-content: flex-end; }
        .clear-hist-btn { background: transparent; border: none; color: var(--accent-color); font-size: 0.9rem; font-weight: 700; cursor: pointer; }

        .toast {
            position: absolute; bottom: 35px; left: 50%; transform: translate(-50%, 20px);
            background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 50px;
            font-size: 0.85rem; font-weight: 600; opacity: 0; pointer-events: none;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 200;
        }
        body.dark-mode .toast { background: #f8fafc; color: #0f172a; }
        .toast.show { transform: translate(-50%, 0); opacity: 1; }

        @media (max-width: 480px) {
            body { padding: 0; }
            .calc-container { max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; border: none; }
        }
