:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --accent-color: #000000;
    --border-color: #e0e0e0;
    --hover-bg: #f5f5f5;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

/* Main Layout */
main {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    flex: 1;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Input Panel */
.input-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.main-expense {
    border-bottom: 2px solid var(--text-color);
    padding-bottom: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.btn-icon:hover {
    background: var(--hover-bg);
}

.amount-input-wrapper {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.currency-symbol {
    font-size: 2rem;
    font-weight: 300;
}

#total-expense {
    font-size: 3rem;
    font-weight: 600;
    border: none;
    outline: none;
    width: 100%;
    font-family: inherit;
    letter-spacing: -0.03em;
}

/* Accordion */
.accordion {
    border-top: 1px solid var(--border-color);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.accordion-header:hover {
    color: #666;
}

.accordion-content {
    display: none;
    padding-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

.accordion-content.open {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-row,
.param-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.input-row input {
    width: 120px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    text-align: right;
    transition: border-color 0.2s;
}

.input-row input:focus,
.param-row input:focus {
    border-color: var(--text-color);
    outline: none;
}

.label-group {
    display: flex;
    flex-direction: column;
}

.tooltip {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

.input-suffix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-suffix input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    text-align: right;
}

/* Result Panel */
.result-panel {
    background: #fdfdfd;
    border-radius: 12px;
    /* faint border mainly for visual separation if needed, but going for clean look */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.fi-number-container {
    margin-bottom: 3rem;
}

.fi-number-container .label {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

#fi-amount {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.subtext {
    color: #666;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-caption {
    font-size: 0.875rem;
    color: #888;
    text-align: center;
    margin-top: 1rem;
}

/* Hover Effects & Micro-interactions */
button:active {
    transform: scale(0.98);
}

/* Button Text */
.btn-text {
    background: none;
    border: none;
    color: #666;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    text-decoration: underline;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text-color);
}

/* Custom Rows */
.custom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.custom-row input.cat-name {
    flex: 1;
    border: none;
    border-bottom: 1px dashed var(--border-color);
    border-radius: 0;
    text-align: left;
    padding-left: 0;
    background: transparent;
}

.custom-row input.cat-name:focus {
    border-bottom-color: var(--text-color);
    outline: none;
}

.btn-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 0.5rem;
    transition: color 0.2s;
}

.btn-remove:hover {
    color: #ff4444;
}