:root {
    /* Green Color Palette */
    --primary-green: #10b981; /* Emerald green */
    --primary-green-hover: #059669; /* Darker emerald */
    --secondary-green: #34d399; /* Light emerald */
    --accent-green: #6ee7b7; /* Mint green */
    --background-green: #ecfdf5; /* Very light mint */
    --dark-green: #047857; /* Deep green */
    --forest-green: #065f46; /* Forest green */
    
    /* Supporting Colors */
    --white: #ffffff;
    --text-dark: #1f2937; /* Dark gray for text */
    --text-medium: #4b5563; /* Medium gray */
    --text-light: #6b7280; /* Light gray */
    --border-color: #d1d5db;
    --error-color: #ef4444;
    --success-color: var(--primary-green);
    --warning-color: #f59e0b;
    --background-light: #f9fafb;
    
    /* Accent color for buttons */
    --accent-color: var(--primary-green);
    --accent-dark: var(--primary-green-hover);
    
    /* Design System */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease-in-out;
    
    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--white) 0%, var(--background-green) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 95%;
}

/* Logo container and styling */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.logo {
    max-height: 120px;
    max-width: 100%;
    height: auto;
    width: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    filter: drop-shadow(0 4px 8px rgba(16, 185, 129, 0.1));
}

.logo:hover {
    transform: scale(1.02);
    box-shadow: var(--box-shadow-lg);
    filter: drop-shadow(0 6px 12px rgba(16, 185, 129, 0.15));
}

/* H1 styling for other pages */
h1 {
    text-align: center;
    font-size: var(--font-size-3xl);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green), var(--accent-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 2rem;
    padding: 1rem 0;
    text-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

h2 {
    color: var(--dark-green);
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

h3 {
    color: var(--primary-green);
    font-size: var(--font-size-xl);
    font-weight: 500;
    margin-bottom: 1rem;
}

.card {
    background: var(--white);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green), var(--accent-green));
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
    border-color: rgba(16, 185, 129, 0.2);
}

/* Enhanced form controls */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-green);
    font-size: var(--font-size-sm);
}

input, button {
    font-family: inherit;
    font-size: var(--font-size-base);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-dark);
}

input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background-color: var(--background-green);
}

input:hover {
    border-color: var(--secondary-green);
}

/* Multi-green button styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    color: var(--white);
    border: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-green), var(--accent-green));
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced loading spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--background-green);
    border-top: 4px solid var(--primary-green);
    border-right: 4px solid var(--secondary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
    box-shadow: var(--box-shadow);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* App content area */
#app, #app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

/* Enhanced animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideInFromLeft 0.5s ease-out;
}

/* Gradient text utility */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Error message styling */
.error-message {
    background-color: #fef2f2; /* Light red background */
    border: 1px solid var(--error-color);
    border-left: 4px solid var(--error-color);
    color: #991b1b; /* Dark red text */
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    font-size: var(--font-size-sm);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
    animation: slideInError 0.3s ease-out;
    position: relative;
}

.error-message::before {
    content: "⚠️";
    margin-right: 0.5rem;
    font-size: var(--font-size-base);
}

.error-message.hidden {
    display: none;
}

/* Success message styling (for consistency) */
.success-message {
    background-color: var(--background-green);
    border: 1px solid var(--primary-green);
    border-left: 4px solid var(--primary-green);
    color: var(--dark-green);
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    font-size: var(--font-size-sm);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
    animation: slideInError 0.3s ease-out;
}

.success-message::before {
    content: "✅";
    margin-right: 0.5rem;
    font-size: var(--font-size-base);
}

.success-message.hidden {
    display: none;
}

/* Error animation */
@keyframes slideInError {
    from { 
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
        padding: 0 1rem;
    }
    to { 
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
        padding: 0.875rem 1rem;
    }
}

/* Footer - sticky to bottom */
footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--forest-green), var(--dark-green));
    color: var(--white);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

footer p {
    margin: 0.5rem 0;
    opacity: 0.9;
}

footer p:first-child {
    font-weight: 500;
    font-size: var(--font-size-lg);
}

/* Quick Symbol Button Styles */
.quick-symbol-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-symbol-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 120px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quick-symbol-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.quick-symbol-btn:hover::before {
    left: 100%;
}

.quick-symbol-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.quick-symbol-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.quick-symbol-btn.selected {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Secondary button styles for market range buttons */
.btn-secondary {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--font-size-md);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    min-width: 140px;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-secondary:hover {
    background-color: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-secondary:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* User action button overrides */
.user-actions .btn-secondary {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    min-width: auto;
}

/* Market Range Analyzer Styles */
#market-range-analyzer {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

#market-range-analyzer h2 {
    color: white;
    margin-bottom: 1rem;
}

.quick-symbols {
    margin-top: 1rem;
}

.quick-symbols label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

/* Position Sizing Calculator Styles */
#position-sizing-calculator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#position-sizing-calculator h2 {
    color: white;
    margin-bottom: 1rem;
}

/* Input Group Styles for Position Calculator */
.calculator-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calculator-input {
    flex: 1;
}

.calculator-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: white;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    z-index: 2;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    z-index: 2;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.balance-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.balance-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.balance-input:focus ~ .input-prefix {
    color: white;
    transform: scale(1.05);
}

.balance-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.risk-percent-input {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.risk-percent-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.risk-percent-input:focus ~ .input-suffix {
    color: white;
    transform: scale(1.05);
}

.risk-percent-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.multiplier-input {
    width: 100%;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.multiplier-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.multiplier-input:focus ~ .input-suffix {
    color: white;
    transform: scale(1.05);
}

.multiplier-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Range Display Table Styles */
.ranges-table-container {
    margin-bottom: 1.5rem;
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ranges-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.ranges-table thead {
    background: rgba(255, 255, 255, 0.15);
}

.ranges-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 700;
    color: white;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.ranges-table th:first-child {
    border-top-left-radius: 12px;
}

.ranges-table th:last-child {
    border-top-right-radius: 12px;
}

.ranges-table td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.ranges-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ranges-table tbody tr:last-child td {
    border-bottom: none;
}

.ranges-table .stat-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    min-width: 140px;
}

.ranges-table .stat-value {
    font-weight: 700;
    color: white;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    min-width: 80px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Special row highlighting */
.ranges-table .highlight-row {
    background: rgba(255, 255, 255, 0.08);
}

.ranges-table .highlight-row .stat-label {
    color: white;
    font-weight: 700;
}

.ranges-table .highlight-row .stat-value {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    font-weight: 800;
}

.ranges-table .total-row {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.ranges-table .total-row .stat-value {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 800;
}

/* Calculations Table Styles */
.calculations-table-container {
    margin-bottom: 1.5rem;
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.calculations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.calculations-table thead {
    background: rgba(0, 150, 255, 0.2);
}

.calculations-table th {
    padding: 1rem 0.75rem;
    text-align: left;
    font-weight: 700;
    color: white;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(0, 150, 255, 0.4);
}

.calculations-table th:first-child {
    border-top-left-radius: 12px;
}

.calculations-table th:last-child {
    border-top-right-radius: 12px;
}

.calculations-table td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.calculations-table tbody tr:hover {
    background: rgba(0, 150, 255, 0.05);
}

.calculations-table tbody tr:last-child td {
    border-bottom: none;
}

.calculations-table .stat-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    min-width: 140px;
}

.calculations-table .stat-value {
    font-weight: 700;
    color: white;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    min-width: 80px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.calculations-table .stat-value.positive {
    background: rgba(76, 175, 80, 0.2);
    color: #a5d6a7;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.2);
}

/* Special row highlighting for calculations */
.calculations-table .highlight-row {
    background: rgba(0, 150, 255, 0.08);
}

.calculations-table .highlight-row .stat-label {
    color: white;
    font-weight: 700;
}

.calculations-table .highlight-row .stat-value {
    background: rgba(0, 150, 255, 0.3);
    box-shadow: 0 0 8px rgba(0, 150, 255, 0.3);
    font-weight: 800;
}

.calculations-table .total-row {
    background: rgba(255, 152, 0, 0.08);
    border-top: 1px solid rgba(255, 152, 0, 0.3);
}

.calculations-table .total-row .stat-value {
    background: rgba(255, 152, 0, 0.2);
    color: #ffcc80;
    font-weight: 800;
}

/* Position Buttons Styles */
.position-buttons-cell {
    padding: 0.5rem 0.75rem;
    text-align: center;
}

.position-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: stretch;
}

.position-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 38px;
    position: relative;
    overflow: hidden;
}

.position-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.position-btn:hover::before {
    left: 100%;
}

.buy-btn {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(0, 150, 255, 0.3));
    color: #a5d6a7;
    border: 1px solid rgba(76, 175, 80, 0.5);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.buy-btn:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4), rgba(0, 150, 255, 0.4));
    color: #c8e6c9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.buy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
}

.position-btn.clicked {
    animation: buttonPulse 0.3s ease;
}

@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.sell-btn {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.3), rgba(255, 87, 34, 0.3));
    color: #ffcdd2;
    border: 1px solid rgba(244, 67, 54, 0.5);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2);
}

.sell-btn:hover {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.4), rgba(255, 87, 34, 0.4));
    color: #ffebee;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.sell-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.2);
}

.position-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.position-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-label {
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    line-height: 1;
}

.btn-amount {
    font-weight: 600;
    font-size: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1;
    margin-top: 0.2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .logo {
        max-height: 80px;
    }
    
    h1 {
        font-size: var(--font-size-2xl);
    }
    
    .card {
        padding: 1.5rem;
    }
    
    input, .btn-primary {
        width: 100%;
    }
    
    .error-message, .success-message {
        font-size: var(--font-size-xs);
        padding: 0.75rem;
    }
    
    footer {
        padding: 1.5rem 1rem;
    }
    
    /* Quick symbol button responsive styles */
    .quick-symbol-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .quick-symbol-btn {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-width: unset;
    }
    
    /* Secondary button responsive styles */
    .btn-secondary {
        min-width: 100%;
    }
    
    /* Table responsive styles */
    .ranges-table-container {
        margin: 0 -0.5rem 1.5rem -0.5rem;
        border-radius: 8px;
    }
    
    .ranges-table {
        font-size: 0.85rem;
    }
    
    .ranges-table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .ranges-table td {
        padding: 0.625rem 0.5rem;
    }
    
    .ranges-table .stat-label {
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .ranges-table .stat-value {
        font-size: 0.8rem;
        padding: 0.3rem 0.4rem;
        min-width: 60px;
    }
    
    /* Calculations table responsive styles */
    .calculations-table-container {
        margin: 0 -0.5rem 1.5rem -0.5rem;
        border-radius: 8px;
    }
    
    .calculations-table {
        font-size: 0.85rem;
    }
    
    .calculations-table th {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .calculations-table td {
        padding: 0.625rem 0.5rem;
    }
    
    .calculations-table .stat-label {
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .calculations-table .stat-value {
        font-size: 0.8rem;
        padding: 0.3rem 0.4rem;
        min-width: 60px;
    }
    
    /* Position buttons responsive styles */
    .position-buttons-cell {
        padding: 0.4rem 0.5rem;
    }
    
    .position-buttons {
        gap: 0.3rem;
    }
    
    .position-btn {
        padding: 0.35rem 0.4rem;
        min-height: 32px;
        font-size: 0.75rem;
    }
    
    .btn-label {
        font-size: 0.65rem;
    }
    
    .btn-amount {
        font-size: 0.7rem;
    }
    
    /* Calculator input responsive styles */
    .calculator-inputs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .input-prefix {
        left: 0.875rem;
        font-size: 0.9rem;
    }
    
    .input-suffix {
        right: 0.875rem;
        font-size: 0.9rem;
    }
    
    .balance-input {
        padding: 0.75rem 1rem 0.75rem 2.25rem;
        font-size: 0.95rem;
    }
    
    .risk-percent-input {
        padding: 0.75rem 2.25rem 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .multiplier-input {
        padding: 0.75rem 2.25rem 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .logo {
        max-height: 60px;
    }
    
    h1 {
        font-size: var(--font-size-xl);
    }
    
    .container {
        padding: 0.5rem;
    }
}

/* Home page card layout */
.home-cards {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
}

.home-cards .card {
    flex: 1;
    min-height: 600px;
    margin: 0;
    max-width: 50%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card-content {
    width: 100%;
}

.summary-item {
    margin-bottom: 1rem;
    width: 100%;
}

.summary-item .label {
    display: block;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.summary-item .value {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
}

.activity-list {
    width: 100%;
}

.empty-state {
    color: var(--text-light);
    text-align: center;
    word-break: break-all;
}

@media (max-width: 768px) {
    .home-cards {
        flex-direction: column;
        padding: 0 10px;
    }
    
    .home-cards .card {
        min-height: 400px;
        max-width: 100%;
    }
}

.full-width-card {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    padding: 0.75rem 2rem;
}

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

.user-actions .btn-primary {
    min-width: 120px;
    padding: 0.5rem 1.5rem;
}

/* Account Balance Styles */
.account-balance-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.balance-status-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.positions-status-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.auto-refresh-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-medium);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.refresh-icon {
    font-size: 1rem;
    animation: rotate 2s linear infinite;
}

.refresh-text {
    font-style: italic;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.last-updated {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    font-style: italic;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.account-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.account-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
}

.account-card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}

.account-service {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--dark-green);
}

.account-id {
    font-size: var(--font-size-xs);
    color: var(--text-medium);
    background-color: var(--background-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.account-age {
    font-size: var(--font-size-xs);
    color: var(--text-light);
    font-style: italic;
    flex-basis: 100%;
    text-align: right;
}

.cache-info {
    color: var(--warning-color);
    font-weight: 500;
}

.fresh-info {
    color: var(--success-color);
    font-weight: 500;
}

.balance-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.balance-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.balance-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-dark);
}

.balance-value.positive {
    color: var(--success-color);
}

.balance-value.negative {
    color: var(--error-color);
}

.balance-currency {
    font-size: var(--font-size-xs);
    color: var(--text-light);
    font-weight: normal;
}

.account-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.account-summary .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: var(--font-size-sm);
}

.account-summary .summary-label {
    color: var(--text-medium);
    font-weight: 500;
}

.account-summary .summary-value {
    color: var(--text-dark);
    font-weight: 600;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.open-trades {
    font-size: var(--font-size-sm);
    color: var(--text-medium);
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
}

.error-message-balance {
    text-align: center;
    padding: 40px;
    color: var(--error-color);
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Secondary button styling */
.btn-secondary {
    background: linear-gradient(135deg, var(--text-medium), var(--text-light));
    color: var(--white);
    border: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--text-dark), var(--text-medium));
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: var(--box-shadow);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Button spacing in user actions */
.user-actions .btn-secondary {
    margin-left: 1rem;
}

/* Position Cards Grid Layout */
.positions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.position-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.position-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
}

.position-card:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.position-instrument {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.position-card .instrument-name {
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--dark-green);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    letter-spacing: 0.5px;
}

.exchange-badge {
    font-size: var(--font-size-xs);
    color: var(--text-medium);
    background-color: var(--background-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    width: fit-content;
}

.direction-badge {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-align: center;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.direction-badge.long {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.25));
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.direction-badge.short {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.25));
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.direction-badge.flat {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.15), rgba(107, 114, 128, 0.25));
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.position-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 15px;
}

.position-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.metric {
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.metric-label {
    font-size: var(--font-size-xs);
    color: var(--text-medium);
    margin-bottom: 5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.position-pnl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.pnl-item {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.pnl-label {
    font-size: var(--font-size-xs);
    color: var(--text-medium);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pnl-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    padding: 4px 8px;
    border-radius: 4px;
}

.pnl-value.positive-pnl {
    color: #16a34a;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.15));
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.pnl-value.negative-pnl {
    color: #dc2626;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.15));
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.position-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    gap: 10px;
}

.trade-ids {
    font-size: var(--font-size-xs);
    color: var(--text-medium);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: rgba(0, 0, 0, 0.02);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.position-count {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.last-updated {
    font-size: var(--font-size-xs);
    color: var(--text-light);
    white-space: nowrap;
    font-weight: 500;
}

.positions-grid .loading-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-medium);
    font-style: italic;
    font-size: var(--font-size-lg);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Responsive adjustments for position cards */
@media (max-width: 768px) {
    .positions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .position-metrics {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .position-pnl {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .position-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .trade-ids {
        width: 100%;
    }
}