* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', 'Segoe UI', 'Poppins', system-ui, -apple-system, monospace;
        }

        /* FULL VIEWPORT, NO SCROLL EVER */
        body {
            height: 100vh;
            width: 100vw;
            overflow: hidden;
            background: radial-gradient(circle at 20% 30%, #0b1120, #03060c);
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 1rem;
        }

        /* MAIN CARD — PERFECT FIT, NO EXTERNAL SCROLL */
        .impressive-calc {
            width: 100%;
            max-width: 1400px;
            height: 100%;
            max-height: 96vh;
            background: rgba(12, 18, 28, 0.7);
            backdrop-filter: blur(20px);
            border-radius: 2rem;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.12);
            padding: 1.2rem;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        /* FLEX ROW — TAKES ALL SPACE, NO OVERFLOW */
        .dashboard {
            display: flex;
            flex-wrap: nowrap;
            gap: 1.5rem;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }

        /* LEFT: CALCULATOR CORE */
        .calc-core {
            flex: 2;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            min-width: 260px;
            overflow: hidden;
        }

        /* RIGHT: NOTES PANEL — INTERNAL SCROLL ONLY */
        .notes-panel {
            flex: 1.2;
            background: rgba(0, 0, 0, 0.45);
            border-radius: 1.8rem;
            backdrop-filter: blur(12px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
            overflow: hidden;
            min-width: 240px;
        }

        .panel-header {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            border-bottom: 2px solid rgba(241, 152, 62, 0.5);
            padding-bottom: 0.4rem;
            flex-shrink: 0;
        }

        .panel-header h3 {
            color: #f8e3b0;
            font-weight: 600;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .clear-history {
            background: none;
            border: none;
            color: #ff9f6e;
            cursor: pointer;
            font-size: 0.65rem;
            font-weight: 500;
            padding: 4px 8px;
            border-radius: 30px;
            background: rgba(255, 100, 50, 0.2);
            transition: 0.2s;
        }

        .clear-history:hover {
            background: rgba(255, 100, 50, 0.5);
            color: white;
        }

        /* SCROLLABLE HISTORY — ONLY THIS SCROLLS */
        .history-list {
            flex: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-right: 4px;
            min-height: 0;
        }

        .history-list::-webkit-scrollbar {
            width: 4px;
        }
        .history-list::-webkit-scrollbar-track {
            background: #1e293b;
            border-radius: 10px;
        }
        .history-list::-webkit-scrollbar-thumb {
            background: #f39c12;
            border-radius: 10px;
        }

        .history-item {
            background: rgba(20, 28, 40, 0.7);
            border-radius: 1rem;
            padding: 0.5rem 0.8rem;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.15s;
            border-left: 3px solid #f39c12;
            color: #ccddf8;
        }
        .history-item:hover {
            background: rgba(243, 156, 18, 0.2);
            transform: translateX(4px);
        }
        .history-expr {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 500;
            word-break: break-word;
        }
        .history-result {
            font-size: 0.65rem;
            color: #f1c40f;
            margin-top: 3px;
        }
        .empty-msg {
            color: #6c7a91;
            text-align: center;
            padding: 1rem;
            font-style: italic;
            font-size: 0.75rem;
        }

        /* DISPLAY STYLES */
        .main-display {
            background: #03070fcc;
            border-radius: 1.6rem;
            padding: 1rem 1.2rem;
            box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.05);
            flex-shrink: 0;
        }
        .expression {
            font-size: 0.8rem;
            color: #9ab3d5;
            min-height: 22px;
            font-family: monospace;
            word-break: break-all;
        }
        .current-value {
            font-size: 2.4rem;
            font-weight: 700;
            color: #f5f9ff;
            font-family: 'JetBrains Mono', monospace;
            word-break: break-word;
            line-height: 1.2;
        }

        /* BUTTON GRID — RESPONSIVE & TIGHT */
        .button-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 0.6rem;
            flex-shrink: 0;
        }
        .calc-btn {
            background: #1e293b;
            border: none;
            padding: 0.8rem 0;
            border-radius: 1.5rem;
            font-size: 1.1rem;
            font-weight: 600;
            color: #eef3ff;
            cursor: pointer;
            transition: all 0.08s linear;
            box-shadow: 0 3px 0 #0f1119;
        }
        .calc-btn:active {
            transform: translateY(2px);
            box-shadow: 0 1px 0 #0f1119;
        }
        .operator {
            background: #f39c12;
            color: #1f1b0c;
            box-shadow: 0 3px 0 #b45f06;
        }
        .equals {
            background: #2ecc71;
            color: #0a2f1a;
            box-shadow: 0 3px 0 #1f8a4c;
        }
        .clear-btn {
            background: #e67e22;
            color: #2c1a08;
        }
        .func-btn {
            background: #2c3e66;
            color: #ffdc97;
        }
        .span-2 {
            grid-column: span 2;
        }

        /* MEMORY BAR */
        .memory-bar {
            background: #0f1420cc;
            border-radius: 1.2rem;
            padding: 0.6rem;
            flex-shrink: 0;
        }
        .memory-title {
            font-size: 0.65rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: #ffb347;
            margin-bottom: 6px;
        }
        .memory-buttons {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }
        .mem-btn {
            background: #1e293b;
            border: none;
            color: #f0e6a0;
            padding: 4px 10px;
            border-radius: 30px;
            font-size: 0.65rem;
            font-weight: 600;
            cursor: pointer;
            transition: 0.05s linear;
        }
        .mem-btn:active {
            transform: scale(0.96);
        }
        .memory-value {
            font-size: 0.7rem;
            color: #f7d44a;
            background: #00000055;
            padding: 4px 8px;
            border-radius: 30px;
            text-align: center;
            margin-top: 6px;
            font-family: monospace;
        }

        .brand {
            text-align: center;
            margin-top: 0.6rem;
            font-size: 0.65rem;
            color: #5e6f8d;
            flex-shrink: 0;
        }

        /* PERFECT RESPONSIVE: ADJUST FOR SMALL SCREENS */
        @media (max-width: 780px) {
            body { padding: 0.5rem; }
            .impressive-calc { padding: 0.8rem; max-height: 98vh; }
            .current-value { font-size: 1.8rem; }
            .calc-btn { padding: 0.5rem 0; font-size: 0.9rem; }
            .button-grid { gap: 0.4rem; }
            .notes-panel { padding: 0.7rem; min-width: 200px; }
            .panel-header h3 { font-size: 0.75rem; }
        }

        /* LARGE SCREENS: BETTER PROPORTIONS */
        @media (min-width: 1400px) {
            .impressive-calc { max-width: 1600px; max-height: 90vh; }
            .current-value { font-size: 2.8rem; }
            .calc-btn { padding: 1rem 0; font-size: 1.2rem; }
        }
