@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Minimal & Clean styling a la sre.ai */
body {
    font-family: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #030303;
    background-image:
        radial-gradient(ellipse at 50% -20%, rgba(120, 119, 198, 0.15), transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(62, 59, 161, 0.1), transparent 50%);
    padding: 40px 16px;
    min-height: 100vh;
    color: #ededed;
    cursor: none;
    /* Hide default cursor */
    overflow-x: hidden;
}

@media (max-width: 850px) {
    body {
        cursor: auto;
    }
}

/* Custom Cursor - GPU Optimized */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--c-w, 20px);
    height: var(--c-h, 20px);
    background-color: var(--c-bg, rgba(255, 255, 255, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--c-br, 50%);
    pointer-events: none;
    transform: translate3d(var(--c-x, 0), var(--c-y, 0), 0) translate(-50%, -50%);
    will-change: transform, width, height, border-radius;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                height 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                border-radius 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.25s ease;
    z-index: 9999;
}

@media (max-width: 850px) {
    .cursor {
        display: none !important;
    }
    * { cursor: auto !important; }
}

.cursor.hovering {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.cursor.hovering.cursor-danger {
    background-color: rgba(251, 113, 133, 0.1);
    border-color: rgba(251, 113, 133, 0.4);
    box-shadow: 0 0 20px rgba(251, 113, 133, 0.15);
}

.hover-invert {
    background: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.05) !important;
    transition: background 0.2s ease !important;
}

.hover-invert * {
    opacity: 1 !important;
}

/* Neutral preservation since we are not inverting anymore */
li.income .tx-card.hover-invert .tx-amount {
    color: #34d399 !important;
}

li.expense .tx-card.hover-invert .tx-amount {
    color: #fb7185 !important;
}

.hover-invert .tx-cat {
    color: #a1a1aa !important;
}

/* Danger Glow for Delete and Reset */
.del-btn-side.hover-invert,
.floating-reset.hover-invert,
.confirm-btn.hover-invert,
.calc-btn.utility.hover-invert {
    background: #fb7185 !important;
    color: #ffffff !important;
    border-color: #fb7185 !important;
    box-shadow: 0 0 50px rgba(251, 113, 133, 0.45) !important;
}

.del-btn-side.hover-invert *,
.floating-reset.hover-invert *,
.confirm-btn.hover-invert *,
.calc-btn.utility.hover-invert * {
    color: #ffffff !important;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.main-layout {
    display: flex;
    /* Changed to flex for easier resizing */
    gap: 0;
    align-items: stretch;
}

.left-panel {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 300px;
    padding-right: 15px;
}

.resizer {
    width: 6px;
    cursor: col-resize;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.3s, transform 0.2s;
    margin: 0 4px;
    border-radius: 3px;
    position: relative;
    z-index: 10;
}

.resizer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -10px;
    right: -10px;
    bottom: 0;
    cursor: col-resize;
}

.resizer:hover,
.resizer.dragging {
    background: rgba(139, 92, 246, 0.6);
    transform: scaleX(1.5);
}

body.resizing {
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: col-resize !important;
}

body.resizing * {
    pointer-events: none !important;
}

body.resizing .cursor,
body.resizing #resizer {
    pointer-events: auto !important;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 250px;
    padding-left: 15px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.header-title img {
    height: 36px;
    width: auto;
}

.icon-btn-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a1a1aa;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-btn-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

h1 {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -0.04em;
    background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0px;
}

h3 {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #a1a1aa;
    margin-bottom: 20px;
}

/* Base Card Style */
.summary-card,
.form-card,
.chart-card,
.list-card {
    background: rgba(15, 15, 17, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
}

.summary-card:hover,
.form-card:hover,
.chart-card:hover,
.list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 20px rgba(139, 92, 246, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-top: 10px;
}

/* Summary cards */
.summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    min-height: 120px;
    /* Use min-height to allow growth while maintaining baseline */
}

.summary-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card span {
    font-size: 12px;
    color: #8f8f9d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.summary-card h2 {
    font-size: 22px;
    /* Slightly smaller to fit full numbers */
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 8px;
    color: #ffffff;
    word-break: break-all;
    /* Allow breaking if extremely long, but show everything */
}

.summary-card.income h2 {
    color: #34d399;
    text-shadow: 0 0 20px rgba(52, 211, 153, 0.15);
}

.summary-card.expense h2 {
    color: #fb7185;
    text-shadow: 0 0 20px rgba(251, 113, 133, 0.15);
}

/* Form & inputs */

.form-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr;
    gap: 10px;
    margin-bottom: 14px;
}

input {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    color: #ededed;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    cursor: none;
}

@media (max-width: 850px) {
    input {
        cursor: auto;
    }
}

input::placeholder {
    color: #71717a;
    font-weight: 400;
}

input:focus {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1), 0 0 15px rgba(139, 92, 246, 0.15);
}

/* Hide number spin buttons */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Custom Select Dropdown styles */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: #ededed;
    cursor: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

@media (max-width: 850px) {
    .custom-select-trigger {
        cursor: auto;
    }
}

.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.custom-select.open .custom-select-trigger {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1), 0 0 15px rgba(139, 92, 246, 0.15);
}

.arrow {
    width: 10px;
    height: 10px;
    position: relative;
}

.arrow::before,
.arrow::after {
    content: '';
    position: absolute;
    bottom: 0px;
    width: 0.15rem;
    height: 100%;
    transition: all 0.4s;
    border-radius: 2px;
}

.arrow::before {
    left: -2px;
    transform: rotate(-45deg);
    background-color: #8b5cf6;
}

.arrow::after {
    left: 4px;
    transform: rotate(45deg);
    background-color: #8b5cf6;
}

.custom-select.open .arrow::before {
    left: -2px;
    transform: rotate(45deg);
}

.custom-select.open .arrow::after {
    left: 4px;
    transform: rotate(-45deg);
}

.custom-options {
    position: absolute;
    display: block;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(15, 15, 17, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-8px);
    overflow: hidden;
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-option {
    position: relative;
    display: block;
    padding: 12px 14px;
    font-size: 14px;
    color: #a1a1aa;
    cursor: none;
    transition: background 0.3s, color 0.3s, padding-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ededed;
    padding-left: 18px;
}

.custom-option.selected {
    color: #ffffff;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.1);
}

button#addBtn {
    padding: 14px 24px;
    background: linear-gradient(to right, #ffffff, #dcdce0);
    color: #000000;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    width: 100%;
    cursor: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

button#addBtn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2), 0 0 15px rgba(255, 255, 255, 0.1);
    background: #ffffff;
}

button#addBtn:active {
    transform: translateY(0);
}

.list-card {
    height: 100%;
    min-height: 500px;
    /* Enforce substantial height to match left content */
    display: flex;
    flex-direction: column;
    position: relative;
    /* Restored for floating elements */
}

#transactionList {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 540px;
    padding: 10px 15px; 
    margin: 0 -15px; 
    padding-bottom: 80px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    content-visibility: auto; /* Optimization for long lists */
}

#transactionList::-webkit-scrollbar {
    display: none;
}

#noTx {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #a1a1aa;
    font-size: 14px;
    font-weight: 400;
    pointer-events: none;
    z-index: 5;
}

.list-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 4px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px;
}

.floating-filter {
    position: absolute;
    bottom: 24px;
    right: 28px;
    background: rgba(15, 15, 17, 0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 50;
}

.floating-reset {
    position: absolute;
    bottom: 24px;
    left: 28px;
    padding: 10px 18px;
    background: rgba(251, 113, 133, 0.1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(251, 113, 133, 0.3);
    border-radius: 12px;
    color: #fb7185;
    font-size: 13px;
    font-weight: 500;
    cursor: none;
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-reset:hover {
    background: rgba(251, 113, 133, 0.2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(251, 113, 133, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.filter-tab {
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #a1a1aa;
    font-size: 13px;
    font-weight: 500;
    cursor: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-tab:hover {
    color: #ededed;
}

.filter-tab.active {
    background: rgba(139, 92, 246, 0.15);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    /* Prevent sort from shrinking when header is tight */
}

.sort-label {
    font-size: 13px;
    color: #a0a0b0;
    font-weight: 500;
}

.list-header .custom-select-trigger {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 160px;
}

.list-header .custom-option {
    font-size: 13px;
}

/* Transaction list */
ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

li {
    display: flex;
    align-items: center;
    gap: 12px;
}

li.new-item {
    opacity: 0;
    animation: fadeSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tx-card {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}

li.income .tx-card .tx-amount {
    color: #34d399;
}

li.expense .tx-card .tx-amount {
    color: #fb7185;
}

.tx-card:hover {
    transform: scale(1.01) translateY(-1px);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.tx-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    /* Critical for truncation */
}

li .tx-desc {
    font-weight: 500;
    font-size: 14px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

li .tx-cat {
    font-size: 12px;
    color: #8f8f9d;
}

.tx-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 12px;
}

.tx-amount {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.02em;
}

.tx-card.income .tx-amount {
    color: #34d399;
    text-shadow: 0 0 15px rgba(52, 211, 153, 0.2);
}

.tx-card.expense .tx-amount {
    color: #fb7185;
    text-shadow: 0 0 15px rgba(251, 113, 133, 0.2);
}

.del-btn-side {
    background: rgba(251, 113, 133, 0.05);
    border: 1px solid rgba(251, 113, 133, 0.15);
    color: #fb7185;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: none;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.del-btn-side:hover {
    background: rgba(251, 113, 133, 0.15);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 15px rgba(251, 113, 133, 0.2);
}

/* Animations */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.top-row {
    opacity: 0;
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.summary {
    opacity: 0;
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.form-card {
    opacity: 0;
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    position: relative;
    z-index: 20;
}

.chart-card {
    opacity: 0;
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.list-card {
    opacity: 0;
    animation: fadeSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: rgba(15, 15, 17, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    opacity: 1;
    transform: scale(1) translateY(0);
}



.modal-card h3 {
    margin-bottom: 12px;
    color: #fff;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.modal-card p {
    color: #a1a1aa;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.cancel-btn,
.confirm-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: none;
    border: none;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #ededed;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.confirm-btn {
    background: rgba(251, 113, 133, 0.15);
    color: #fb7185;
    border: 1px solid rgba(251, 113, 133, 0.3);
}

.confirm-btn:hover {
    background: rgba(251, 113, 133, 0.25);
    box-shadow: 0 0 15px rgba(251, 113, 133, 0.2);
}

/* Calculator specific */
.calc-card {
    width: 320px;
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calc-top-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.close-btn {
    background: none;
    border: none;
    color: #71717a;
    font-size: 24px;
    cursor: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

.calc-display-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: right;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.calc-history {
    font-size: 12px;
    color: #71717a;
    min-height: 18px;
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.calc-display {
    font-size: 32px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03);
    color: #ededed;
    font-size: 16px;
    font-weight: 500;
    cursor: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.calc-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.calc-btn.operator {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.2);
}

.calc-btn.operator:hover {
    background: rgba(139, 92, 246, 0.2);
}

.calc-btn.utility {
    color: #fb7185;
    background: rgba(251, 113, 133, 0.05);
}

.calc-btn.operator[data-action="equal"] {
    grid-row: span 2;
    background: rgba(139, 92, 246, 0.2);
    color: #fff;
    font-weight: 700;
}

.calc-btn.double {
    grid-column: span 2;
}

.use-btn {
    width: 100%;
    margin-top: 14px;
    background: linear-gradient(to right, #ffffff, #dcdce0);
    color: #000;
    font-weight: 600;
    border: none;
    height: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.use-btn svg {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.use-btn:hover svg {
    transform: translateY(-4px);
}

/* Responsive */
@media (max-width: 850px) {
    .container {
        padding: 20px 10px;
    }

    .main-layout {
        flex-direction: column;
        padding-bottom: 40px;
    }

    .left-panel, .right-panel {
        flex: none !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .resizer {
        display: none !important;
    }

    .summary {
        grid-template-columns: 1fr;
        height: auto;
    }

    .summary-card {
        height: 100px;
        backdrop-filter: none; /* Disable expensive blur on mobile */
        -webkit-backdrop-filter: none;
        background: rgba(20, 20, 22, 0.9);
    }

    .list-card {
        min-height: auto;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(20, 20, 22, 0.9);
    }

    .chart-container {
        height: 300px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .floating-filter {
        position: static;
        margin-top: 16px;
        width: 100%;
        justify-content: center;
    }

    .floating-reset {
        position: static;
        margin-top: 12px;
        width: 100%;
        text-align: center;
    }

    .list-card {
        padding-bottom: 20px;
    }

    .modal-card {
        width: 90%;
        padding: 24px;
    }

    .modal-overlay {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(0, 0, 0, 0.85);
    }
}

@media (max-width: 500px) {
    h1 {
        font-size: 28px;
    }

    .summary-card h2 {
        font-size: 22px;
    }
}