/* General Styling */
body {
    background-color: #1A202C; /* Dark background */
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    color: #E2E8F0; /* Light text */
}

/* Navbar Styling */
.navbar-brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: #F7FAFC;
}

/* Main Content */
.container {
    background-color: #2D3748; /* Dark container */
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 5px;
    color: #F7FAFC;
}

/* Footer */
.footer {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #CBD5E0;
}

/* Form Styling */
.form-group label {
    font-weight: bold;
    color: #E2E8F0;
}

/* Dashboard Specific Styling */
.dashboard-content h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    margin-bottom: 20px;
    color: #F7FAFC;
}

.copy-container {
    text-align: right;
}

.copy-container label {
    font-size: 0.95rem;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    display: inline-block;
}

.form-referral {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    color: #63B3ED;
}

/* Animations */
a.btn {
    transition: all 0.3s ease-in-out;
}
a.btn:hover {
    transform: scale(1.05);
}

/* Dashboard Styles */
.dashboard-container {
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Card Styling */
.card {
    background-color: #2D3748;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* Form Group Styling */

.form-group label {
    font-weight: 600;
    color: #63B3ED;
}

.form-control {
    border-radius: 8px;
    padding: 2px;
    background-color: #4A5568;
    color: #E2E8F0;
}

.risk-form {
    border-radius: 8px;
    padding: 2px;
    background-color: #4A5568;
    color: #E2E8F0;
}

/* Button Styles */
.btn-primary {
    background-color: #2B6CB0;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #3182CE;
    transform: scale(1.03);
}

/* Hero Section with Video */
.hero-container {
    position: relative;
    height: 100vh;
    overflow: hidden;
    text-align: center;
}

.video-header {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
}

.video-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: zoomIn 15s infinite alternate ease-in-out;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.hero-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #F7FAFC;
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
    z-index: 1;
}

/* Features Section */
.features-section {
    background-color: #2D3748;
    padding: 60px 0;
}

.feature-card {
    background: #4A5568;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: scale(1.05);
}

/* Feature Icons */
.feature-icon {
    font-size: 40px;
    color: #63B3ED;
    margin-bottom: 20px;
}

/* Button Animations */
.btn-primary {
    background-color: #2B6CB0;
    padding: 12px 25px;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease-in-out;
}

.btn-primary:hover {
    background-color: #3182CE;
    transform: scale(1.05);
}

/* Get Started Page Styles */
.get-started-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 20px;
    background-color: #2D3748;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.get-started-container h1,
.get-started-container h2,
.get-started-container h3 {
    text-align: center;
    color: #E2E8F0;
}

.get-started-container p {
    text-align: center;
    line-height: 1.6;
    color: #CBD5E0;
}

/* Diagram Section */
.diagram-container {
    text-align: center;
    margin: 20px 0;
}

.diagram-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Step Boxes */
.steps {
    margin-top: 30px;
}

.step-box {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #4A5568;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.step-box h3 {
    margin-top: 0;
    color: #63B3ED;
}

/* Button Container */
.btn-container {
    text-align: center;
    margin-top: 30px;
}

.btn-get-started {
    padding: 10px 20px;
    background-color: #2B6CB0;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease-in-out;
}

.btn-get-started:hover {
    background-color: #3182CE;
    transform: scale(1.05);
}

.pricing-card h5 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #63B3ED;
}

.logo {
    height: 50px;
    width: auto;
    margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 20px;
    }

    .hero-text {
        width: 90%;
    }

    .features-section {
        padding: 40px 20px;
    }
}

.box {
    border: 2px solid #ffffff; /* White border for visibility */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); /* Soft glow effect */
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    background-color: #2c2c2c; /* Dark grey background */
}

.form-control[readonly] {
    border-radius: 8px;
    padding: 12px;
    background-color: #4A5568;
    color: #E2E8F0;
}

.boxx {
  /* Existing styles */
  margin-bottom: 4;
  padding: 4;
  background-color: dark;
  color: white;
  border-radius: .25rem;
  display: flex;
  flex-direction: column; /* Keep the overall box as a column */
}

/* Style for the container of the two list boxes */
.d-flex {
  display: flex;
  flex-direction: row; /* Arrange children (the two form-group divs) in a row */
  gap: 1em; /* Optional: Add some space between the list boxes */
}

/* Optional: Add some right margin to the first list box for spacing */
.mr-2 {
  margin-right: 0.5em; /* Adjust as needed */
}

/* Optional: Adjust the flex-grow of the list boxes to make them take equal width */
.d-flex > .form-group {
  flex-grow: 1;
}

body {
    background-color: #1a1a1a; /* Dark background similar to OKX */
    color: #e0e0e0;
    font-family: Arial, sans-serif;
}

.d-flex { display: flex; }
.flex-row { flex-direction: row; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.gap-2 { gap: 0.5rem; } /* Or use column-gap in CSS */
.gap-3 { gap: 1rem; } /* Or use column-gap in CSS */
.card {
    background-color: #2D3748;
    color: #E2E8F0;
    border-radius: 8px;
    padding: 1rem;
}


.input-error {
    border-color: #dc3545; /* Red border, matches Bootstrap's danger color */
}

    .crefresher-container {
        position: relative;
        display: inline-block;
    }

    .crefresher-text {
        visibility: hidden;
        width: 150px;
        background-color: black;
        color: #fff;
        text-align: center;
        padding: 7px 0;
        border-radius: 6px;
        position: absolute;
        z-index: 1;
        bottom: 125%; /* Position above the button */
        left: 50%;
        margin-left: -60px; /* Center the tooltip */
    }

    .crefresher-container:hover .crefresher-text {
        visibility: visible;
    }

    .crefresher-button {
        /* Background color based on the image */
        background-color: #34373F; /* Dark grey/blue */

        /* Text color */
        color: #E0E0E0; /* Very light grey, close to white */

        /* Padding to give space around the text */
        padding: 6px 14px; /* Vertical and horizontal padding */

        /* Rounded corners */
        border-radius: 8px; /* Noticeably rounded corners */

        /* Subtle box shadow for depth */
        box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4), /* Bottom shadow */
                    0px 0px 0px 1px rgba(255, 255, 255, 0.1) inset; /* Inner subtle highlight */

        /* Text styling */
        font-family: sans-serif; /* General sans-serif, adjust if you have a specific font */
        font-size: 22px; /* Example font size, adjust as needed */
        font-weight: bold; /* Bold text */
        text-align: center;
        text-decoration: none; /* No underline for links */
        cursor: pointer;
        border: none; /* No default border */
        transition: background-color 0.2s ease, box-shadow 0.2s ease; /* Smooth transitions for hover */
    }

    .crefresher-button:hover {
        background-color: #3F434D; /* Slightly lighter on hover for interaction feedback */
        box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.5),
                    0px 0px 0px 1px rgba(255, 255, 255, 0.15) inset;
    }

/* klinechart styles */
#chart-container {
    width: 100%;
    height: 60vh; /* Adjust based on how much UI you want below the chart */
    background-color: #131722;
    margin-top: 10px;
}

/* Ensure alerts don't push the chart off-screen */
.alert {
    margin: 10px;
    font-size: 0.85rem;
}

/* Base styles for the chart container */
.klinecharts-pro {
    /* Default Light Theme Variables */
    --klinecharts-pro-primary-color: #1677ff;
    --klinecharts-pro-background-color: #FFFFFF;
    --klinecharts-pro-text-color: #051441;
    --klinecharts-pro-border-color: #eeeeee;
    --klinecharts-pro-watermark-alpha: 0.1;
}

/* Official Dark Theme Variables */
.klinecharts-pro[data-theme="dark"] {
    --klinecharts-pro-background-color: #151517;
    --klinecharts-pro-text-color: #F8F8F8;
    --klinecharts-pro-text-second-color: #929AA5;
    --klinecharts-pro-border-color: #2a2e39;
    --klinecharts-pro-hover-background-color: rgba(22, 119, 255, 0.15);
    --klinecharts-pro-watermark-alpha: 0.15;
}

/* LONG SHORT BUTTON */
.input-row {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    font-family: sans-serif;
}

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

/* The Swap Button Styling */
.toggle-btn {
    height: 38px; /* Matches standard input heights */
    padding: 0 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: background-color 0.2s, transform 0.1s;
    min-width: 100px;
}

.toggle-btn:active {
    transform: scale(0.95);
}

/* State Colors */
.btn-long { background-color: #28a745; } /* Green */
.btn-short { background-color: #dc3545; } /* Red */
.btn-modify { background-color: #192eeb; } /* Dark Blue */
.btn-modify:hover { background-color: #3146fd; color : white} /* Darker Blue */
.btn-save { background-color: #4083ff; } /* Light Blue */
.btn-save:hover { background-color: #3473e7; color: white;} /* Dimmer Blue */
.btn-cancel { background-color: #159e09; } /* Green */
.btn-cancel:hover { background-color: #0fad5e; color: white;} /* Dimmer Green */


/* Prefix: rparams- */
.rparams-container {
    background: #121417; /* Deep Charcoal */
    padding: 5px;
    border-radius: 8px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    border: 1px solid #2d3139;
    color: #e0e0e0;
}

.rparams-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    align-items: flex-end;
}


.rparams-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 50px;
}

.rparams-label {
    font-weight: 600;
    color: #94a3b8; /* Muted Slate */
    margin-bottom: 5px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dark Inputs */
.rparams-input {
    height: 32px;
    padding: 4px 5px;
    border: 1px solid #334155;
    border-radius: 4px;
    font-size: 13px;
    background-color: #1e293b; /* Dark Slate Blue */
    color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}


.rparams-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.rparams-input:disabled {
    border-color: #5f5f5f !important; /* Bright Red */
    background-color: #6a6a6a !important; /* Slight red tint to the background */
    box-shadow: 0 0 8px rgba(95, 95, 95, 0.4); /* Red outer glow */
    color: #ffffff; /* Light pinkish text for readability */
}

/* Readonly fields - more subtle in dark mode */
.rparams-input[readonly] {
    background-color: #0f172a;
    color: #94a3b8;
    border: 1px solid #1e293b;
    cursor: default;
}

/* Remove spinners for Chrome, Safari, Edge, and Opera */
.rparams-input::-webkit-outer-spin-button,
.rparams-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove spinners for Firefox */
.rparams-input[type=number] {
    -moz-appearance: textfield;
}

/* Header Bar */
.rparams-header {
    background: #1e293b;
    padding: 3px 6px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid #3b82f6; /* Accent strip */
}

/* Trading Toggles */
.rparams-toggle {
    height: 32px;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    min-width: 70px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.rparams-btn-long { 
    background-color: #10b981; /* Emerald Green */
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.rparams-btn-short { 
    background-color: #ef4444; /* Bright Red */
    box-shadow: 0 0 10px
}

/* Highly specific selector to override the default dark border */
.rparams-input.rparams-error {
    border-color: #ef4444 !important; /* Bright Red */
    background-color: #2d1a1a !important; /* Slight red tint to the background */
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); /* Red outer glow */
    color: #fee2e2; /* Light pinkish text for readability */
}

/* Optional: Animation to catch the user's eye */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.rparams-error-shake {
    animation: shake 0.2s ease-in-out 0s 2;
}

/* Container for the whole dashboard */
.rparams-dashboard-wrapper {
    display: flex;
    flex-direction: row; /* Default for Desktop */
    gap: 5px;
    width: 100%;
}

/* Stack vertically on Mobile */
@media (max-width: 767px) {
    .rparams-dashboard-wrapper {
        flex-direction: column;
        gap: 15px; /* Increased gap for better touch spacing on mobile */
    }

    /* Optional: Ensure the children take up full width when stacked */
    .rparams-dashboard-wrapper > div {
        width: 100% !important;
    }
}

.rparams-main-chart {
    flex: 3;
    min-height: 500px;
    height: auto; /* Let the height be flexible */
    transition: all 0.3s ease-in-out;
}

/* Force the widget container to be exactly as tall as the wrapper */
#tradingview_advanced {
    height: 100% !important;
    min-height: inherit; 
}

/* This class will be added via JS when the journal opens */
.rparams-main-chart.chart-expanded {
    min-height: 750px; /* Adjust this value to match your journal's depth */
}

/* Desktop remains as you have it */
.rparams-sidebar {
    flex: 1;
    min-width: 320px;
    max-width: 400px;
    background: #1a1d21;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #2d3139;
}

/* Mobile Overrides */
@media (max-width: 767px) {
    .rparams-sidebar {
        /* Remove the width restrictions */
        max-width: none !important; 
        min-width: 0 !important;
        width: 100% !important;
        
        /* Optional: Flatten the bottom corners if it's the top item */
        /* or add a margin to separate it from the chart below */
        margin-bottom: 10px;
        
        /* Ensure the flex container doesn't try to shrink it */
        flex: none; 
    }
}

/* Compact the labels and rows further for the sidebar */
.rparams-sidebar .rparams-group {
    margin-bottom: 8px;
}

/* Container to sit input and button side-by-side */
.rparams-input-with-btn {
    display: flex;
    gap: 4px;
    align-items: center;
}


/* The tiny refresh button */
.rparams-inline-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    border-radius: 4px;
    height: 32px; /* Match your input height */
    width: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}

.rparams-inline-btn:hover {
    background: #334155;
    color: #fbbf24; /* Amber glow on hover */
    border-color: #475569;
}

.rparams-inline-btn:active {
    transform: scale(0.9);
}

/* Optional: Spin animation when clicked */
.rparams-spin {
    animation: rparams-spin-anim 0.5s ease-in-out;
}

@keyframes rparams-spin-anim {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Update this container */
.rparams-input-with-btn {
    display: flex;
    gap: 2px; /* Reduced gap to save pixels */
    align-items: center;
    width: 100%;
}

/* Ensure the input takes up the remaining space but doesn't shrink to zero */
.rparams-input-with-btn .rparams-input {
    flex: 1;
    min-width: 0; /* Critical for flexbox math */
    padding: 4px 5px; /* Slightly tighter padding for small boxes */
}

/* Keep the button size fixed so it doesn't get squished */
.rparams-inline-btn {
    flex-shrink: 0; 
    width: 28px; /* Slightly smaller button to fit the row */
    height: 32px;
}

/* Update your row to prevent overlapping items */
.rparams-row {
    display: flex;
    flex-wrap: nowrap; /* Keep them on one line */
    gap: 8px; /* Control space between columns */
    overflow: hidden; /* Prevent items from bleeding out */
}


/* Container for Label + Button */
.rparams-label-row {
    display: flex;
    justify-content: space-between; /* Pushes button to the far right of the label area */
    align-items: center;
    margin-bottom: 4px;
    width: 100%;
}

/* A smaller, cleaner refresh button for the header */
.rparams-mini-refresh {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    font-size: 12px; /* Smaller to match the label size */
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.rparams-mini-refresh:hover {
    color: #fbbf24; /* Amber glow */
}

.rparams-mini-refresh:active {
    transform: rotate(90deg); /* Slight rotation feel on click */
}

/* The spin animation from before */
.rparams-spin {
    animation: rparams-spin-anim 0.5s ease-in-out;
}

@keyframes rparams-spin-anim {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- DESKTOP VIEW --- */
.rparams-mobile-trigger {
    display: none !important; /* Always hide trigger on desktop */
}

/* Base Style for your Custom Buttons */
.rparams-btn {
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    border-radius: 4px;
    font-size: 13px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rparams-btn:hover {
    background-color: #334155;
    color: #f8fafc;
    border-color: #475569;
}

/* Active/Selected State (e.g., current timeframe) */
.rparams-btn.active {
    background-color: #3b82f6; /* Trading Blue */
    color: #ffffff;
    border-color: #60a5fa;
    font-weight: 600;
}

/* --- MOBILE SPECIFIC OVERRIDES --- */
@media (max-width: 767px) {
    /* Container must be relative so the drawer anchors to it */
    .rparams-timeframe-container {
        position: relative;
        display: flex;
        justify-content: flex-end; /* Keeps trigger on the right */
    }

    .rparams-mobile-trigger {
        display: flex !important;
        min-width: 50px;
        margin-bottom: 5px;
        justify-content: space-between;
        gap: 8px;
    }

    .rparams-drawer {
        display: none; 
        width: 180px;
        background: #0f172a;
        padding: 6px;
        border-radius: 4px;
        border: 1px solid #334155;
        position: absolute; 
        top: 100%;    /* Sits right below the trigger */
        right: 0;     /* ANCHOR TO RIGHT: Grows leftward */
        z-index: 1000; /* High z-index to float over charts */
        box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.5);
    }

    .rparams-drawer.open { 
        display: block !important; 
    }

    .resolution-selector {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
    }

    /* Make buttons square-ish and tight on mobile */
    .resolution-selector .rparams-btn {
        padding: 10px 0 !important;
        font-size: 11px !important;
        width: 100% !important;
        min-width: 0 !important; /* Prevents button from bloating the grid */
    }
}

/* --- DESKTOP VIEW --- */
@media (min-width: 768px) {
    .rparams-mobile-trigger { display: none !important; }
    .rparams-drawer { display: block !important; }
    .resolution-selector {
        display: flex;
        gap: 6px;
    }
}

/* -- risk parameter buttons -- */
.rparams-group-with-sidebar {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px;
    align-items: stretch; /* This forces the buttons to match the height */
}

.rparams-input-stack {
    display: flex;
    flex-direction: column;
    flex: 1; /* Takes up remaining width */
}

.rparams-vertical-controls {
    display: flex;
    flex-direction: column;
    width: 35px; /* Adjust width as needed */
    gap: 2px;
    padding-top: 18px; /* Optional: Aligns top button closer to the center of the input height */
}

/* Specific styling for the full-height buttons */
.rparams-control-btn-full {
    flex: 1; /* Each button takes 50% height */
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: background 0.2s;
}

.rparams-control-btn-full:hover {
    background: #334155;
    color: #fff;
}

.rparams-control-btn-full:active {
    background: #3b82f6;
}

/* Balance Lot size and summary of trade possible outcome */
/* Container holding the two main sections */
.rparams-summary-container {
    display: flex;
    flex-direction: row;
    gap: 5px;
    background: #1a1d21;
    padding: 5px;
    border-radius: 8px;
    border: 1px solid #2d3139;
}

/* Left side - Normal vertical stack */
.rparams-summary-main {
    flex: 1.2; /* Slightly wider */
    display: flex;
    flex-direction: column;
    max-width: 120px;
}

.rparams-big-input {
    font-size: 14px !important;
    font-weight: bold;
    color: #fbbf24 !important; /* Gold/Yellow for visibility */
}

/* Right side - Compact table style */
.rparams-summary-metrics {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid #334155;
    padding-left: 15px;    
    margin-left: 10px;
}

/* Individual table rows */
.rparams-compact-row {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Push content to right */
    margin-left: 5px;
    padding-top: 0;
    padding-bottom: 0;
    row-gap: 0;
}

.rparams-compact-row label {
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
    align-content: center;
    white-space: nowrap;
    text-transform: uppercase;
    margin: 0;
    padding: 0;
}

.rparams-compact-row input {
    width: 80px;
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 11px;
    text-align: left;
    font-family: monospace;
    pointer-events: none; /* Looks like text, not a box */
    margin-left: 5px;
    margin: 0;
    padding: 0;
    padding-left: 5px;
    line-height: 1;
}

.rparams-compact-row input.warning {
    color: #ed2102 !important;
}
.rparams-compact-row label.warning {
    color: #ed2102 !important;
}

.rparams-onp-row {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Push content to right */
    margin-left: 5px;
    padding-top: 0;
    padding-bottom: 0;
    row-gap: 0;
}
/* The Gear Icon */
.rparams-settings-icon {
    position: absolute;
    top: 5px;    /* 5 pixels from the top of the DIV */
    right: 5px;  /* 5 pixels from the right of the DIV */
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    z-index: 100;
    line-height: 1;
    padding: 0;
    margin: 0;
}


.rparams-settings-icon:hover {
    opacity: 1;
}

/* Position the dropdown so it also stays inside/near the div */
.rparams-settings-dropdown {
    display: none;
    position: absolute;
    top: 25px;   /* Appears just below the gear */
    right: 0px;
    background: #0f172a;
    border: 1px solid #334155;
    padding: 10px;
    border-radius: 4px;
    z-index: 101;
    width: 180px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.rparams-settings-dropdown.show {
    display: block;
}

/* Ensure the input inside doesn't look weird */
#max-fee-threshold {
    width: 60px !important;
    text-align: center;
}

/* Responsive adjustment for small screens */
@media (max-width: 600px) {
    .rparams-summary-container {
        flex-direction: row;
    }
    .rparams-summary-metrics {
        border-left: none;
        border-top: 1px solid #334155;
        padding-left: 0;
        padding-top: 10px;
    }
}

/* Journal Toggle Button */
.rparams-journal-toggle {
    width: 100%;
    background: #2d3139;
    border: 1px solid #3d424d;
    color: #94a3b8;
    padding: 8px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* The Drawer Logic */
.rparams-journal-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    background: #16191d;
    border-radius: 0 0 8px 8px;
    padding: 0 10px; /* Padding is 0 while closed */
}

.rparams-journal-drawer.open {
    max-height: 400px; /* Enough for all fields */
    padding: 15px 10px;
    border: 1px solid #2d3139;
    border-top: none;
}

/* Large Textarea Styling */
.rparams-textarea {
    resize: none; /* Prevents user from breaking layout */
    min-height: 60px;
    font-size: 12px;
    line-height: 1.4;
}

.rparams-char-count {
    font-size: 10px;
    color: #4b5563;
    text-align: right;
    margin-top: 4px;
}

/* Sidebar Container */
.rparams-sidebar {
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px;
    width: 100%;
}

/* Tab Header Buttons */
.rparams-tab-header {
    display: flex;
    background-color: #1e293b;
    border-radius: 4px;
    padding: 3px;
    margin-bottom: 10px;
}

.rparams-tab-link {
    flex: 1;
    background: transparent;
    border: none;
    padding: 6px 6px;
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rparams-tab-link.active {
    background-color: #334155;
    color: #ffffff;
}

/* Tab Content Areas */
.rparams-tab-content {
    display: none;
}

.rparams-tab-content.active {
    display: block;
}

/* The main container that limits height */
.rparams-scroll-viewport {
    max-height: 500px; /* Adjust this value based on your sidebar height */
    overflow-y: auto;  /* Enable vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal jitter */
    padding-right: 4px; /* Space for the scrollbar */
}

/* Section spacing */
.rparams-section {
    margin-bottom: 16px;
}

/* Custom Scrollbar Styling (Webkit browsers like Chrome/Edge/Safari) */
.rparams-scroll-viewport::-webkit-scrollbar {
    width: 4px;
}

.rparams-scroll-viewport::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.rparams-scroll-viewport::-webkit-scrollbar-thumb {
    background: #475569; /* Slate-500 */
    border-radius: 10px;
}

.rparams-scroll-viewport::-webkit-scrollbar-thumb:hover {
    background: #64748b; /* Slate-400 */
}

/* Firefox Support */
.rparams-scroll-viewport {
    scrollbar-width: thin;
    scrollbar-color: #475569 rgba(255, 255, 255, 0.02);
}

/**********************************/
/**********************************/
/****** Orders and position *******/
/**********************************/
/**********************************/
/* Container for Symbol + Price */
.order-info {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.order-price {
    font-size: 11px;
    color: #94a3b8; /* Muted slate color */
}

/* Button Group on the right */
.order-actions {
    display: flex;
    gap: 8px;
    margin-left: auto; /* Pushes the buttons to the far right */
    align-items: center;
}

.order-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    color: #64748b;
    transition: color 0.2s ease;
    line-height: 1;
}

.order-btn:hover {
    color: #ffffff;
}

.delete-btn:hover {
    color: #f87171; /* Red on hover for delete */
}

/* Ensure the row doesn't collapse */
.order-row {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.position-row {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rparams-onp-label {
    font-weight: 600;
    color: #94a3b8; /* Muted Slate */
    margin: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px;
    position: relative;
}

.section-header h6 {
    margin: 0;
}

.menu-dots {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    line-height: 1;
}

.menu-dots:hover {
    color: #ffffff;
}

/* Dropdown Menu Container */
.rparams-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #1e293b; /* Dark slate */
    min-width: 140px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 100;
    border: 1px solid #334155;
    border-radius: 4px;
}

.dropdown-content a {
    color: #f87171; /* Red for danger actions */
    padding: 8px 12px;
    text-decoration: none;
    display: block;
    font-size: 11px;
}

.dropdown-content a:hover {
    background-color: #334155;
}

/* Show class */
.show { display: block; }

.pnl-positive {
    color: green
}
.pnl-negative {
    color: red
}
.side-buy {
    color: green
}
.side-sell {
    color: red
}
.order-info {
    text-align: left !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
}

/**********************************/
/**********************************/
/****** Orders and position *******/
/**********************************/
/**********************************/