/* CSS Reset and Variables – Professional Navy/White Theme */
:root {
    --bg-color: #060c1a;
    --bg-secondary: #0d1526;
    --card-bg: rgba(13, 21, 38, 0.92);
    --card-border: rgba(59, 130, 246, 0.18);
    --text-primary: #f0f4ff;
    --text-secondary: #8899b8;
    --accent-color: #3b82f6;   /* professional blue */
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.12);
    --success-color: #22c55e;
    --success-hover: #16a34a;
    --danger-color:  #ef4444;
    --danger-hover:  #dc2626;
    --warning-color: #f59e0b;
    --gold-color:    #f59e0b;
    --font-family: 'Outfit', 'Noto Sans Gujarati', sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.55);
    --radius: 10px;
}

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

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(ellipse at 20% 0%, rgba(59,130,246,0.07) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 100%, rgba(30,64,175,0.06) 0%, transparent 60%);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    padding: 0.75rem;
    overflow-x: hidden;
    position: relative;
    font-size: 0.85rem;
}

/* Background decorations */
.background-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.18;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.5) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(30,64,175,0.5) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
}

/* App Container */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
}

/* FIX: Prevent grid/flex children from overflowing container width */
.card,
.results-grid > *,
.portfolio-grid > *,
.movement-column-wrapper,
.dashboard-grid > * {
    min-width: 0;
    max-width: 100%;
}

/* Header */
.app-header {
    margin-bottom: 0.25rem;
    padding: 0.5rem 0;
}

/* Remove duplicate .logo rule */
.logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.logo-image {
    height: 44px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #93c5fd 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    white-space: nowrap;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 300;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem;
}

/* Cards styling */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 8px 30px 0 rgba(0, 0, 0, 0.5);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.step-badge {
    background: var(--accent-light);
    color: var(--accent-color);
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.card h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-color);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1) inset;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.drop-icon {
    font-size: 1.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.drop-zone:hover .drop-icon {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.drop-text {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.drop-text span {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 500;
}

.file-limit {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* File Status */
.file-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    margin-top: 0.5rem;
    animation: fadeIn 0.3s ease;
}

.file-status.local-loaded {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.success-icon {
    color: var(--success-color);
    font-size: 1.25rem;
}

.success-icon.blue-icon {
    color: var(--accent-color);
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.file-name {
    font-size: 0.95rem;
    font-weight: 500;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.storage-badge {
    align-self: flex-start;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-color);
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.remove-btn:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Data Preview Table */
.data-preview {
    margin-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
    animation: fadeIn 0.4s ease;
}

.data-preview h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.table-wrapper {
    overflow-x: auto;
    max-height: 250px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

thead {
    position: sticky;
    top: 0;
    background: #111827;
    z-index: 1;
    border-bottom: 2px solid var(--card-border);
}

th {
    padding: 0.4rem 0.5rem;
    font-weight: 600;
    color: var(--accent-color);
    border-bottom: 1px solid var(--card-border);
}

td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    white-space: nowrap;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.row-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 0.5rem;
}

/* Actions Section */
.actions-section {
    margin-top: 1rem;
}

.actions-card h2 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.actions-btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.35);
}

.btn-primary:not(:disabled):hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.45);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.btn-success:not(:disabled):hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

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

/* Process Log */
.process-log {
    margin-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.process-log h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.log-console {
    background: #030712;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    height: 100px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.log-entry {
    line-height: 1.4;
}

.log-info {
    color: var(--text-secondary);
}

.log-success {
    color: var(--success-color);
}

.log-warning {
    color: var(--warning-color);
}

.log-error {
    color: var(--danger-color);
}

/* Research & Filters Section */
.research-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

.filters-card {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(6, 182, 212, 0.2);
}

.filters-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.filter-icon {
    font-size: 1.4rem;
    color: var(--accent-color);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3;
}

.filter-group input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    outline: none;
    transition: var(--transition);
    font-size: 0.8rem;
}

.filter-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-inputs input {
    flex: 1;
    min-width: 0;
}

.range-separator {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.filter-actions {
    display: flex;
    justify-content: flex-end;
}

/* Results Grid Layout (Two Column) */
.results-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.3fr);
    gap: 0.75rem;
    align-items: start;
}

.results-table-card {
    border-color: rgba(255, 255, 255, 0.08);
}

.results-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.results-badge {
    background: var(--accent-light);
    color: var(--accent-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Scrollable to view ALL data */
.results-table-wrapper {
    max-height: 450px;
}

/* Top Movement Card Styling */
.movement-card {
    border-color: rgba(16, 185, 129, 0.2);
}

.movement-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.movement-icon {
    font-size: 1.4rem;
    color: var(--success-color);
}

.movement-table-wrapper {
    max-height: 600px;
}

.movement-table-wrapper th {
    color: var(--success-color);
}

.movement-table-wrapper td {
    font-weight: 500;
}

/* Volatility badge colors */
.volatility-pct {
    font-weight: bold;
    color: var(--success-color);
}

/* Notifications */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.notification {
    background: rgba(22, 28, 45, 0.96);
    border-left: 4px solid var(--accent-color);
    box-shadow: var(--shadow);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

/* Utilities & Animations */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsiveness */
@media (max-width: 1250px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem 1rem;
    }
    
    .app-header h1 {
        font-size: 1.8rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
}
}

/* Top Performer Card Styles */
.movement-column-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-performer-card {
    border-color: #f59e0b !important; /* Gold/Amber */
    background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), var(--card-bg)) !important;
    box-shadow: 0 8px 32px 0 rgba(245, 158, 11, 0.15) !important;
    animation: goldGlow 3s infinite alternate;
}

.performer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.performer-header h2 {
    color: #fbbf24; /* gold text */
    font-size: 1.05rem;
}

.gold-trophy {
    font-size: 1.4rem;
    color: #fbbf24; /* gold */
    animation: bounce 2s infinite ease-in-out;
}

.performer-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.performer-symbol {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.3));
}

.performer-stats {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.performer-stats span {
    font-weight: 600;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes goldGlow {
    from {
        border-color: rgba(245, 158, 11, 0.2) !important;
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    }
    to {
        border-color: rgba(245, 158, 11, 0.5) !important;
        box-shadow: 0 8px 32px 0 rgba(245, 158, 11, 0.2);
    }
}

/* Clickable Table Rows */
tr.clickable-row {
    cursor: pointer;
    transition: var(--transition);
}

tr.clickable-row:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

/* Modal Overlay styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.82);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    /* FIX: Fit any screen cleanly with scrollable modal body */
    width: 95vw;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.25rem;
}

.modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 85px);
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
}

#modal-company-isin {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger-color);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
    margin-bottom: 1rem;
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.modal-stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* Header Row */
.header-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Login Screen Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.15);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-header {
    text-align: center;
}

.login-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.4));
}

.login-header h2 {
    font-size: 1.4rem;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
}

.input-wrapper input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    background: rgba(3, 7, 18, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--danger-color);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-btn {
    width: 100%;
    padding: 0.7rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #1e40af 100%);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.login-footer {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
    margin-top: 0.5rem;
    border-top: 1px solid var(--card-border);
    padding-top: 0.75rem;
}

/* Cloud Sync Status Badge */
.cloud-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.cloud-sync-badge.sync-connecting {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.07);
    color: var(--warning-color);
}

.cloud-sync-badge.sync-success {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.07);
    color: var(--success-color);
}

.cloud-sync-badge.sync-error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.07);
    color: var(--danger-color);
}

.sync-icon {
    font-size: 0.95rem;
}

.sync-icon.spin {
    animation: fa-spin 2s linear infinite;
}

/* Navigation Tabs */
.app-nav {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.5rem 0 1rem 0;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.75rem;
    width: 100%;
    max-width: 100%;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, #1d4ed8 100%);
    color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.3);
}

/* Portfolio Summary Grid */
.portfolio-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

#portfolio-total-profit {
    color: var(--success-color); /* will be updated dynamically via JS if negative */
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: start;
}

@media (max-width: 1150px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

.portfolio-form-card {
    border-color: rgba(59, 130, 246, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-row .form-group {
    min-width: 0;
}

.optional-row {
    border-top: 1px dashed var(--card-border);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

/* Calculations Preview */
.form-calculations {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.form-calculations .calc-box:nth-child(5) {
    grid-column: span 2;
}

.calc-box {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: center;
    text-align: center;
}

.calc-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.calc-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
}

.form-actions button {
    flex: 1;
}

/* Portfolio List */
.portfolio-list-card {
    border-color: rgba(255, 255, 255, 0.08);
}

.portfolio-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portfolio-table-wrapper {
    max-height: 550px;
}

/* Row colors based on profit/loss */
.profit-text {
    color: var(--success-color) !important;
    font-weight: 600;
}

.loss-text {
    color: var(--danger-color) !important;
    font-weight: 600;
}

/* Badges for status */
.badge-active {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

.badge-sold {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Edit / Delete action buttons */
.action-btn-group {
    display: flex;
    gap: 0.35rem;
}

.action-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: var(--transition);
}

.action-icon-btn.edit-btn {
    color: var(--accent-color);
}

.action-icon-btn.edit-btn:hover {
    background: rgba(6, 182, 212, 0.1);
}

.action-icon-btn.delete-btn {
    color: var(--danger-color);
}

.action-icon-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Gainer Toggle Group */
.gainer-toggle-group {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.15rem;
    border-radius: 6px;
    border: 1px solid var(--card-border);
}

.gainer-toggle-group .toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.gainer-toggle-group .toggle-btn:hover {
    color: var(--text-primary);
}

.gainer-toggle-group .toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

/* Beautiful Portfolio Form Field styling */
.portfolio-form-card input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(6, 14, 30, 0.8) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-size: 0.88rem !important;
    transition: var(--transition) !important;
    font-family: var(--font-family) !important;
}

.portfolio-form-card input:focus {
    outline: none !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25) !important;
    background: rgba(6, 14, 30, 0.95) !important;
}

/* Portfolio table footer totals formatting */
#portfolio-table tfoot td {
    padding: 0.55rem 0.5rem;
    color: #ffffff;
    font-size: 0.85rem;
}

/* Compact movement table styling to prevent screen cutoff */
#movement-table {
    table-layout: auto;
    width: 100%;
}

#movement-table th, #movement-table td {
    padding: 0.35rem 0.25rem !important;
    font-size: 0.78rem !important;
}

.performer-stats div {
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

/* Fetch Status Bar */
.fetch-status-bar {
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.fetch-status-bar.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}
.fetch-status-bar.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}
.fetch-status-bar.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

/* Live Pulse Indicator */
.live-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* ==========================================
   COMPREHENSIVE MOBILE RESPONSIVE RULES
   ========================================== */

/* Ensure all table wrappers are horizontally scrollable */
.table-wrapper,
.portfolio-table-wrapper,
.movement-table-wrapper,
.results-table-wrapper {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

table {
    min-width: 600px;
}

#movement-table {
    min-width: 400px;
}

/* Tablet adjustments (≤ 1200px) */
@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 1100px) {
    .portfolio-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Small desktop / large tablet (≤ 900px) */
@media (max-width: 900px) {
    body {
        padding: 0.6rem;
    }

    .app-container {
        gap: 0.7rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 0.7rem;
    }

    .results-grid,
    .portfolio-grid {
        grid-template-columns: 1fr !important;
        gap: 0.7rem;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }

    .header-main-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .logo-text {
        font-size: 1.35rem !important;
    }

    .logo-image {
        height: 38px;
    }

    .app-nav {
        width: 100%;
        gap: 0.5rem;
    }

    .nav-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.55rem 0.3rem;
    }

    .actions-btn-group {
        flex-direction: column;
    }

    .gainer-toggle-group {
        margin-left: 0;
        margin-top: 0.4rem;
    }

    .movement-header {
        flex-wrap: wrap;
    }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    body {
        padding: 0.4rem;
    }

    .card {
        padding: 0.75rem 0.9rem;
        border-radius: 8px;
    }

    .logo-text {
        font-size: 1.2rem !important;
    }

    .logo-image {
        height: 34px;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    /* Modal fully responsive */
    .modal-card {
        width: 96vw !important;
        max-width: 96vw !important;
        margin: 8px auto !important;
        padding: 0.75rem !important;
        border-radius: 8px !important;
    }

    .modal-body {
        max-height: 78vh !important;
        gap: 0.6rem !important;
    }

    /* Stack all modal interior grids */
    .modal-sidebar-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-stat-box {
        padding: 0.35rem 0.5rem !important;
    }

    .btn {
        padding: 0.45rem 0.7rem;
        font-size: 0.78rem;
    }

    #pwa-install-btn {
        width: 100%;
        justify-content: center;
    }

    .portfolio-summary-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }

    .summary-value {
        font-size: 1.15rem;
    }

    .form-calculations {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .notification {
        min-width: unset;
        width: calc(100vw - 2rem);
        right: 1rem;
    }

    .gainer-toggle-group {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .movement-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .movement-header h2 {
        font-size: 0.9rem;
    }
}

/* Market Indices Header Widget */
.header-indices-widget {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    margin-left: auto;
    margin-right: 1.5rem;
}

.header-indices-widget .index-card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(59, 130, 246, 0.16);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 130px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.header-indices-widget .index-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.header-indices-widget .index-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.header-indices-widget .index-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0.08rem 0;
    letter-spacing: -0.01em;
}

.header-indices-widget .index-chg {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Badge styles for Results & Dividends Tab */
.badge-sold, .badge-active, .badge-dividend {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    margin-left: 0.35rem;
    display: inline-block;
}

.badge-dividend {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Responsive adjust for index widget - keep visible on every screen size */
@media (max-width: 1024px) {
    .header-indices-widget {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        width: 100%;
    }
    .header-indices-widget .index-card {
        min-width: 0;
        padding: 0.45rem 0.65rem;
    }
}

/* Screen Protection Blur removed so AI Studio preview / window focus switches never blur or freeze input */

/* Print/PDF Export Protection */
@media print {
    body, html, #main-app, .login-overlay, .modal-overlay, #chart-modal, #advice-details-modal {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

/* ==========================================
   FIX: BUG 6 - RESPONSIVE & STICKY TABLES
   ========================================== */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

.table-wrapper,
.portfolio-table-wrapper,
.movement-table-wrapper,
.results-table-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Sticky header row and sticky first column (Symbol) */
.table-wrapper table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #111827;
}

.table-wrapper table th:first-child,
.table-wrapper table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #0d1526;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.35);
}

.table-wrapper table thead th:first-child {
    z-index: 4;
    background: #111827;
}

.table-wrapper table tr.clickable-row:hover td:first-child {
    background: #14233d;
}

.table-wrapper table tfoot td:first-child {
    background: #090e1a;
}

/* Login card responsive fit */
.login-card {
    max-width: min(400px, 95vw);
    max-height: 92vh;
    overflow-y: auto;
}

/* Horizontally scrollable top tab bar on tablet & mobile (<= 1100px) */
@media (max-width: 1100px) {
    .app-nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 0.65rem;
        gap: 0.5rem;
    }

    .nav-btn {
        flex: 0 0 auto;
        width: auto !important;
        white-space: nowrap;
        padding: 0.55rem 0.9rem;
    }
}

/* Minimum 40px touch targets on mobile (<= 768px) */
@media (max-width: 768px) {
    .btn,
    .nav-btn,
    .login-btn,
    .gainer-toggle-group .toggle-btn,
    .remove-btn,
    .action-icon-btn,
    .modal-close,
    .filter-group input,
    #results-search-input,
    #portfolio-search-input,
    #morning-search-input,
    #advice-search-input,
    #advice-model-select,
    #watchlist-search-input,
    #vol-promoter-search-input,
    #circuits-search-input,
    #intraday-search-input,
    #cp-symbol-select,
    #cp-expiry-select,
    #cp-refresh-btn {
        min-height: 40px;
    }

    .remove-btn,
    .action-icon-btn,
    .modal-close {
        min-width: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    table td button {
        min-height: 40px;
        min-width: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .modal-card {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
    }
}

/* Prevent search bars & header controls from overflowing on 360px phones */
@media (max-width: 600px) {
    .app-header .header-main-row > button,
    .app-header .cloud-sync-badge {
        width: 100%;
        justify-content: center;
        margin-right: 0 !important;
    }

    #results-search-input,
    #portfolio-search-input,
    #morning-search-input,
    #advice-search-input,
    #advice-model-select,
    #watchlist-search-input,
    #vol-promoter-search-input,
    #circuits-search-input,
    #intraday-search-input,
    #cp-symbol-select,
    #cp-expiry-select {
        width: 100% !important;
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .modal-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================
   CALL PUT (કોલ પુટ) & MARKET MOOD INDEX TAB
   ========================================== */
.nav-btn.active {
    color: #ffffff !important;
}

.call-put-card {
    padding: 1.5rem;
}

.cp-header-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.cp-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.cp-select {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-family);
    cursor: pointer;
}

.cp-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.75rem;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    font-size: 0.78rem;
    font-weight: 600;
}

.cp-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    animation: pulse 1.2s infinite;
}

.cp-refresh-btn {
    padding: 0.48rem 0.85rem;
    font-size: 0.82rem;
}

.cp-status-banner {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.cp-top-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.cp-panel {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
}

.cp-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cp-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.cp-mmi-headline,
.cp-spot-headline {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.cp-mmi-number,
.cp-spot-number {
    font-size: 1.85rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.1;
}

.cp-mmi-zone-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.cp-mmi-chg,
.cp-spot-chg {
    font-size: 0.85rem;
    font-weight: 600;
}

.cp-source-link {
    color: #38bdf8;
    font-size: 0.76rem;
    text-decoration: none;
    white-space: nowrap;
}

.cp-source-link:hover {
    text-decoration: underline;
}

.mmi-gauge-wrap {
    margin: 0.95rem 0 0.85rem;
}

.mmi-gauge-bar {
    position: relative;
    height: 12px;
    border-radius: 6px;
    display: flex;
    overflow: visible;
    background: #1e293b;
}

.mmi-seg {
    height: 100%;
}

.mmi-seg-ef {
    width: 30%;
    background: #ef4444;
    border-radius: 6px 0 0 6px;
}

.mmi-seg-f {
    width: 20%;
    background: #f97316;
}

.mmi-seg-g {
    width: 20%;
    background: #eab308;
}

.mmi-seg-eg {
    width: 30%;
    background: #22c55e;
    border-radius: 0 6px 6px 0;
}

.mmi-gauge-marker {
    position: absolute;
    top: -4px;
    width: 6px;
    height: 20px;
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 3px;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.75);
    transition: left 0.25s ease;
}

.mmi-gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    gap: 0.25rem;
}

.cp-mmi-baselines {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.cp-mini-stat {
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cp-mini-stat span {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.cp-mini-stat strong {
    font-size: 0.9rem;
    color: #e2e8f0;
}

.cp-mmi-footer {
    margin-top: 0.55rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.cp-atm-pill-box {
    background: rgba(6, 182, 212, 0.14);
    border: 1px solid rgba(6, 182, 212, 0.45);
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    text-align: right;
}

.cp-atm-pill-label {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    color: #67e8f9;
}

.cp-atm-pill-val {
    font-size: 1.25rem;
    color: #ffffff;
}

.cp-spot-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0.65rem 0 0.8rem;
}

.cp-spot-meta strong {
    color: #e2e8f0;
}

.cp-combined-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.cp-combined-box {
    background: rgba(30, 41, 59, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cp-itm-accent {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
}

.cp-otm-accent {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
}

.cp-combined-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.cp-combined-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
}

.cp-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.cp-vol-card {
    border-radius: 12px;
    padding: 1rem 1.05rem;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.cp-vol-call-itm {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.08);
}

.cp-vol-call-otm {
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.08);
}

.cp-vol-put-itm {
    border-color: rgba(168, 85, 247, 0.45);
    background: rgba(168, 85, 247, 0.08);
}

.cp-vol-put-otm {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
}

.cp-vol-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #e2e8f0;
}

.cp-side-tag {
    font-size: 0.66rem;
    padding: 0.14rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

.cp-tag-itm {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.cp-tag-otm {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.cp-vol-value {
    font-size: 1.55rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
}

.cp-vol-sub {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.cp-vol-sub strong {
    color: #cbd5e1;
}

.cp-atm-row {
    background: rgba(6, 182, 212, 0.16) !important;
}

.cp-atm-row td:first-child {
    background: #0f2938 !important;
}

.cp-itm-cell {
    background: rgba(16, 185, 129, 0.07);
}

.cp-otm-cell {
    background: rgba(15, 23, 42, 0.25);
}

.cp-zone-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    display: inline-block;
}

.cp-zone-itm {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.cp-zone-otm {
    background: rgba(148, 163, 184, 0.14);
    color: #94a3b8;
}

.cp-zone-atm {
    background: rgba(6, 182, 212, 0.22);
    color: #67e8f9;
}

@media (max-width: 1024px) {
    .cp-top-grid {
        grid-template-columns: 1fr;
    }

    .cp-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .cp-summary-grid,
    .cp-mmi-baselines,
    .cp-combined-grid {
        grid-template-columns: 1fr;
    }

    .call-put-card {
        padding: 1rem;
    }
}

/* 1s Live Ticker Strip & Advance/Decline Breadth Cards */
.cp-live-strip-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cp-live-card {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cp-gold-card {
    border-color: rgba(245, 158, 11, 0.4);
}

.cp-silver-card {
    border-color: rgba(148, 163, 184, 0.4);
}

.cp-global-card {
    border-color: rgba(56, 189, 248, 0.35);
}

.cp-live-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.cp-live-title small {
    font-size: 0.62rem;
    font-weight: 600;
    opacity: 0.8;
}

.cp-live-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
}

.cp-live-chg {
    font-size: 0.74rem;
    font-weight: 600;
}

.cp-breadth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.cp-breadth-nums {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.cp-adv-pill {
    font-size: 0.82rem;
    color: #34d399;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
}

.cp-dec-pill {
    font-size: 0.82rem;
    color: #f87171;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
}

.cp-unch-pill {
    font-size: 0.8rem;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
}

.cp-breadth-ratio {
    font-size: 0.82rem;
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
}

.cp-ad-bar-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    overflow: hidden;
    margin-top: 0.75rem;
}

.cp-ad-bar-adv {
    height: 100%;
    background: #22c55e;
    transition: width 0.25s ease;
}

@media (max-width: 1200px) {
    .cp-live-strip-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .cp-live-strip-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cp-breadth-grid {
        grid-template-columns: 1fr;
    }
}


