/* styles.css - Premium Redesign */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* =========================================================
   Design System Tokens
   ========================================================= */
:root {
    /* =========================================================
       Krishnarpan Institutional Obsidian Sapphire Design Tokens
       ========================================================= */
    /* Brand Azure / Sapphire (brand) */
    --brand-50:  #f0f9ff; /* Soft highlight & specular gleam */
    --brand-100: #e0f2fe; /* Pill & icon container fills */
    --brand-200: #bae6fd; /* Subtle card highlights */
    --brand-300: #7dd3fc; /* Dark-bg highlights & accents */
    --brand-400: #38bdf8; /* Icons & links on dark backgrounds */
    --brand-500: #0ea5e9; /* Primary brand azure (CTAs, buttons) */
    --brand-600: #0284c7; /* Button hover states & icons */
    --brand-700: #0369a1; /* Deep sapphire links */
    --brand-800: #075985; /* High-contrast cobalt labels */
    --brand-900: #0c4a6e; /* Deep ocean gradients */
    --brand-950: #082f49; /* Darkest sapphire shade */

    /* Obsidian Midnight Glass Surfaces (forest token slots preserved for compatibility) */
    --forest-800: #151e34; /* Elevated slate-navy subtle cards */
    --forest-900: #0a101f; /* Top utility bar, calculator header, theme color */
    --forest-950: #050811; /* Ultra-deep obsidian backdrop */

    /* Neutral Ink & Cool Slate (slateink) */
    --slateink-50:  #f8fafc; /* Primary bright text */
    --slateink-100: #f1f5f9; /* Subtle highlights */
    --slateink-200: #cbd5e1; /* Secondary body text */
    --slateink-400: #94a3b8; /* Muted labels & placeholders */
    --slateink-600: #475569; /* Secondary muted copy */
    --slateink-700: #334155; /* Borders & dividers */
    --slateink-800: #1e293b; /* Elevated surfaces */
    --slateink-900: #0f172a; /* Deep ink */

    /* Financial Semantic Accents (Mint Emerald, Champagne Gold, Coral Rose) */
    --amberaccent-400: #fbbf24; /* Gold / SGB / Pending highlight */
    --amberaccent-500: #f59e0b; /* Champagne amber accent */
    --amberaccent-600: #d97706; /* Deep gold accent */
    --logo-crimson:    #f43f5e; /* Coral crimson for sells/outflows/alerts */

    /* =========================================================
       Semantic Application Theme Mapping (Obsidian Crystal Glass)
       ========================================================= */
    /* Background Layers */
    --bg-base:      var(--forest-950);
    --bg-surface:   rgba(10, 16, 31, 0.58);
    --bg-surface-2: rgba(19, 28, 50, 0.46);
    --bg-elevated:  rgba(9, 14, 27, 0.86);

    /* Borders & Glass Specular Rim */
    --border:         rgba(148, 163, 184, 0.15);
    --border-strong:  rgba(148, 163, 184, 0.26);
    --border-focus:   var(--brand-400);
    --border-success: rgba(16, 185, 129, 0.6);
    --glass-rim:      inset 0 1px 0 rgba(224, 242, 254, 0.16), inset 1px 0 0 rgba(148, 163, 184, 0.06);

    /* Text */
    --text-primary:   var(--slateink-50);
    --text-secondary: var(--slateink-200);
    --text-muted:     var(--slateink-400);
    --text-accent:    var(--brand-400);

    /* Accents */
    --indigo:      var(--brand-500);
    --indigo-500:  var(--brand-600);
    --violet:      #6366f1;
    --purple:      #818cf8;
    --fuchsia:     var(--amberaccent-500);
    --emerald:     #10b981;
    --amber:       var(--amberaccent-400);
    --rose:        var(--logo-crimson);
    --cyan:        #22d3ee;
    --sky:         var(--brand-400);

    /* Gradients */
    --grad-primary:   linear-gradient(135deg, #3b82f6 0%, #0ea5e9 55%, #0284c7 100%);
    --grad-primary-h: linear-gradient(135deg, #60a5fa 0%, #38bdf8 55%, #0ea5e9 100%);
    --grad-hero-ytm:  linear-gradient(135deg, rgba(16, 185, 129, 0.20) 0%, rgba(14, 165, 233, 0.15) 100%);
    --grad-hero-px:   linear-gradient(135deg, rgba(14, 165, 233, 0.18) 0%, rgba(245, 158, 11, 0.15) 100%);
    --grad-success:   linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(52, 211, 153, 0.14) 100%);
    --grad-danger:    linear-gradient(135deg, rgba(244, 63, 94, 0.2) 0%, rgba(245, 158, 11, 0.14) 100%);

    /* Glow Effects */
    --glow-primary: 0 0 32px rgba(14, 165, 233, 0.40), 0 0 14px rgba(56, 189, 248, 0.22);
    --glow-violet:  0 0 32px rgba(99, 102, 241, 0.35);
    --glow-success: 0 0 25px rgba(16, 185, 129, 0.35);

    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.48);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.56);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.65);

    /* Typography */
    --font-display: 'Space Grotesk', 'Inter Tight', 'Inter', system-ui, sans-serif;
    --font-body:    'Inter Tight', 'Inter', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    /* Radii */
    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-full: 9999px;

    /* Transitions */
    --ease-snappy: cubic-bezier(0.175, 0.885, 0.32, 1.1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 0.15s;
    --t-base: 0.25s;
    --t-slow: 0.4s;
}

/* =========================================================
   Reset & Base
   ========================================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--forest-950);
    background-image:
        radial-gradient(ellipse 80% 55% at 8% -5%,   rgba(59, 130, 246, 0.24) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 92% 5%,   rgba(20, 184, 166, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 70% 60% at 50% 105%, rgba(30, 58, 138, 0.34) 0%, transparent 65%),
        radial-gradient(ellipse 40% 45% at 78% 58%,  rgba(245, 158, 11, 0.08) 0%, transparent 55%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    letter-spacing: -0.015em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* =========================================================
   Header
   ========================================================= */
header {
    background: rgba(9, 14, 27, 0.72);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), inset 0 -1px 0 rgba(148, 163, 184, 0.08);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    display: flex;
    align-items: center;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.5) 50%, transparent 100%);
}

.header-container {
    max-width: 1760px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    height: 38px;
    width: auto;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: box-shadow var(--t-base) var(--ease-smooth), transform var(--t-fast) var(--ease-snappy);
    padding: 3px 8px;
    flex-shrink: 0;
}

.logo-icon:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
    transform: scale(1.03) rotate(-1deg);
}

.logo-icon img {
    height: 28px;
    width: auto;
    display: block;
    object-fit: contain;
}

.logo-text h1 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(120deg, #ffffff 40%, var(--brand-200) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.6875rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: 1px;
}

.badge {
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: var(--brand-300);
    padding: 0.3rem 0.75rem;
    border-radius: var(--r-full);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all var(--t-base) var(--ease-smooth);
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--brand-400);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.8);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(56, 189, 248, 0.8); }
    50% { opacity: 0.5; box-shadow: 0 0 2px rgba(56, 189, 248, 0.4); }
}

/* =========================================================
   Main Layout
   ========================================================= */
main {
    max-width: 1760px;
    margin: 0 auto;
    width: 100%;
    padding: 1.25rem 2rem;
    position: relative;
    z-index: 1;
    flex: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) 2.2fr;
    gap: 1.25rem;
    align-items: start;
}

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

/* =========================================================
   Card — Glassmorphism
   ========================================================= */
.card {
    background: linear-gradient(145deg, rgba(19, 28, 50, 0.62) 0%, rgba(10, 16, 31, 0.56) 100%);
    backdrop-filter: blur(28px) saturate(185%);
    -webkit-backdrop-filter: blur(28px) saturate(185%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(224, 242, 254, 0.15), inset 0 0 32px rgba(14, 165, 233, 0.03);
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--t-base) var(--ease-smooth),
                box-shadow var(--t-base) var(--ease-smooth),
                transform var(--t-base) var(--ease-smooth);
    min-width: 0;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.09) 0%, rgba(148, 163, 184, 0.02) 38%, transparent 65%);
    pointer-events: none;
}

.card:hover {
    border-color: rgba(56, 189, 248, 0.38);
    box-shadow: var(--shadow-xl), 
                0 0 36px rgba(14, 165, 233, 0.14),
                inset 0 1px 0 rgba(224, 242, 254, 0.22);
    transform: translateY(-2px);
}

/* =========================================================
   Main Calculator Tabs & Search Top Bar (Single Row on Wide Display)
   ========================================================= */
.search-top-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    position: relative;
    width: 100%;
}

@media (min-width: 640px) {
    .search-top-bar {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .search-top-bar .calc-main-tabs {
        margin-bottom: 0 !important;
        width: 220px;
        min-width: 190px;
        flex-shrink: 0;
        height: 42px;
        box-sizing: border-box;
        align-items: center;
    }

    .search-top-bar .calc-main-btn {
        height: 100%;
        padding: 0 0.65rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
    }

    .search-top-bar .search-container {
        flex: 1;
        margin-bottom: 0 !important;
        position: relative;
    }

    .search-top-bar .search-container label {
        display: none !important;
    }

    .search-top-bar .db-status-container {
        margin-top: 3px !important;
    }
}

.calc-main-tabs {
    display: flex;
    background: rgba(5, 8, 17, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
    border-radius: var(--r-md);
    padding: 0.25rem;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
}

.calc-main-btn {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 0.825rem;
    font-weight: 700;
    padding: 0.6rem 0.85rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--t-base) var(--ease-smooth);
    text-align: center;
    font-family: var(--font-display);
}

.calc-main-btn:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.06);
}

.calc-main-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.34) 0%, rgba(7, 89, 133, 0.45) 100%);
    border: 1px solid rgba(125, 211, 252, 0.48);
    box-shadow: 0 2px 18px rgba(14, 165, 233, 0.24), inset 0 1px 0 rgba(224, 242, 254, 0.2);
}

/* =========================================================
   Tabs
   ========================================================= */
.tabs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(5, 8, 17, 0.48);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--r-md);
    padding: 3px;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
    gap: 4px;
}

.tab-btn {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 0.6rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--t-base) var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.tab-btn.active {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.5), 0 0 20px rgba(56, 189, 248, 0.25);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* =========================================================
   Form Elements
   ========================================================= */
.form-group {
    margin-bottom: 1rem;
}

.form-group.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    min-width: 0;
    background: rgba(5, 8, 17, 0.48);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.28);
    border-radius: var(--r-sm);
    padding: 0.72rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--t-base) var(--ease-smooth);
    -webkit-appearance: none;
    -moz-appearance: none;
}

.input-wrapper input:hover,
.input-wrapper select:hover {
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(10, 16, 31, 0.56);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22), 0 0 22px rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(224, 242, 254, 0.12);
    background: rgba(10, 16, 31, 0.78);
}

.input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
    opacity: 0.6;
}

.input-wrapper .input-prefix {
    position: absolute;
    left: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1;
}

.input-wrapper .input-suffix {
    position: absolute;
    right: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    pointer-events: none;
    z-index: 1;
}

.input-wrapper.has-prefix input { padding-left: 2.1rem; }
.input-wrapper.has-suffix input { padding-right: 2.1rem; }

/* Number input: hide arrows */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }

/* Custom select arrow */
.input-wrapper select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.input-wrapper select option {
    background: var(--forest-900);
    color: var(--text-primary);
}

/* Slider */
.slider-group { margin-top: 0.625rem; }

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--r-full);
    outline: none;
    cursor: pointer;
    transition: background var(--t-base);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--grad-primary);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.6), 0 0 0 2px rgba(14, 165, 233, 0.3);
    cursor: grab;
    transition: transform var(--t-fast) var(--ease-snappy),
                box-shadow var(--t-fast) var(--ease-smooth);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 0 16px rgba(14, 165, 233, 0.8), 0 0 0 3px rgba(14, 165, 233, 0.35);
}

input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }

/* Divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    margin: 1.5rem 0;
}

/* =========================================================
   Primary Button
   ========================================================= */
.btn-primary {
    width: 100%;
    background: var(--grad-primary);
    border: none;
    color: white;
    padding: 0.8rem;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 700;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-base) var(--ease-smooth);
    box-shadow: var(--glow-primary), inset 0 1px 0 rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.btn-primary:hover {
    background: var(--grad-primary-h);
    box-shadow: 0 0 40px rgba(14, 165, 233, 0.65), 0 0 15px rgba(56, 189, 248, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.45);
}

/* =========================================================
   Action Buttons in One Row (Evaluate + Manual Edit)
   ========================================================= */
.action-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    align-items: stretch;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
}

.action-buttons-row .btn-primary {
    margin-top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 42px;
    padding: 0.65rem 0.6rem !important;
    font-size: 0.85rem !important;
    white-space: nowrap;
    box-sizing: border-box;
}

.action-buttons-row .btn-toggle-manual {
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 42px;
    padding: 0.65rem 0.6rem !important;
    font-size: 0.78rem !important;
    white-space: nowrap;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .action-buttons-row {
        gap: 0.45rem;
    }
    .action-buttons-row .btn-primary {
        font-size: 0.78rem !important;
        padding: 0.6rem 0.35rem !important;
    }
    .action-buttons-row .btn-toggle-manual {
        font-size: 0.74rem !important;
        padding: 0.6rem 0.35rem !important;
    }
}



/* =========================================================
   Outputs Panel
   ========================================================= */
.outputs-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

/* Large display: 2x2 grid for metrics cards to prevent truncation */
@media (min-width: 1280px) {
    .outputs-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.75rem;
    }
    .outputs-panel .metrics-row {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    /* Large screen (calculator pages only): all 4 cards in one row */
    .page-calculator .metrics-row {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem !important;
    }
    .page-calculator .main-metrics,
    .page-calculator .stats-grid {
        display: contents !important;
    }

    /* Large screen (trader portal page only): 2x2 grid (two rows) */
    .page-trader-portal .metrics-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .page-trader-portal .main-metrics,
    .page-trader-portal .stats-grid {
        display: contents !important;
    }


    /* In 4-col row: stat-cards match hero-stat look and exact height */
    .metrics-row .hero-stat,
    .metrics-row .stat-card {
        border-radius: var(--r-lg);
        padding: 0.85rem 1.1rem;
        min-height: 94px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-sizing: border-box;
    }

    .metrics-row .stat-card {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(14, 165, 233, 0.12) 100%);
        backdrop-filter: blur(22px) saturate(175%);
        -webkit-backdrop-filter: blur(22px) saturate(175%);
        border-color: rgba(52, 211, 153, 0.3);
        box-shadow: inset 0 1px 0 rgba(224, 242, 254, 0.14);
    }
    .metrics-row .stat-card:not(.accent-success) {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(14, 165, 233, 0.10) 100%);
        border-color: rgba(251, 191, 36, 0.3);
    }
    /* Orb glow for stat-cards in row */
    .metrics-row .stat-card::after {
        content: '';
        position: absolute;
        width: 100px;
        height: 100px;
        border-radius: 50%;
        right: -15px;
        bottom: -25px;
        filter: blur(35px);
        opacity: 0.28;
        pointer-events: none;
    }
    .metrics-row .stat-card.accent-success::after  { background: var(--emerald); }
    .metrics-row .stat-card:not(.accent-success)::after { background: var(--amberaccent-500); }
    /* Remove the left-border strip in row mode */
    .metrics-row .stat-card::before { display: none; }

    /* In row mode: match label/value/sub to hero-stat typography */
    .metrics-row .stat-card .stat-label {
        font-size: 0.625rem;
        color: rgba(248, 250, 252, 0.62);
        margin-bottom: 0.2rem;
    }
    .metrics-row .stat-card .stat-value {
        font-size: clamp(0.95rem, 1.8vw, 1.4rem);
        font-weight: 800;
        line-height: 1.1;
        letter-spacing: -0.03em;
    }
    .metrics-row .stat-card.accent-success .stat-value {
        background: linear-gradient(120deg, #f8fafc 15%, #6ee7b7 65%, #38bdf8 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        color: unset;
    }
    .metrics-row .stat-card:not(.accent-success) .stat-value {
        background: linear-gradient(120deg, #f8fafc 20%, #fbbf24 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        color: unset;
    }
    .metrics-row .stat-card .stat-sub {
        font-size: 0.6rem;
        color: rgba(255,255,255,0.35);
        margin-top: 0.2rem;
    }
}

/* Medium: 2×2 grid (calculator & trader portal) */
@media (max-width: 1279px) {
    .page-calculator .metrics-row,
    .page-trader-portal .metrics-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .page-calculator .main-metrics,
    .page-calculator .stats-grid,
    .page-trader-portal .main-metrics,
    .page-trader-portal .stats-grid {
        display: contents !important;
    }
}

/* Small: 2×2 grid (calculator & trader portal) for compact mobile results */
@media (max-width: 640px) {
    .page-calculator .metrics-row,
    .page-trader-portal .metrics-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .page-calculator .main-metrics,
    .page-calculator .stats-grid,
    .page-trader-portal .main-metrics,
    .page-trader-portal .stats-grid {
        display: contents !important;
    }
}


.hero-stat {
    border-radius: var(--r-lg);
    padding: 0.9rem 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    position: relative;
    overflow: hidden;
    min-width: 0;
    transition: all var(--t-base) var(--ease-smooth);
}

.hero-stat:first-child {
    background: var(--grad-hero-ytm);
    border-color: rgba(52, 211, 153, 0.34);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(224, 242, 254, 0.16);
}

.hero-stat:last-child {
    background: var(--grad-hero-px);
    border-color: rgba(251, 191, 36, 0.32);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(224, 242, 254, 0.14);
}

.hero-stat::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Glowing orb behind hero cards */
.hero-stat::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    right: -20px;
    bottom: -30px;
    filter: blur(40px);
    opacity: 0.32;
    pointer-events: none;
}

.hero-stat:first-child::after  { background: var(--emerald); }
.hero-stat:last-child::after   { background: var(--amberaccent-500); }

.hero-stat:hover { 
    transform: translateY(-2px); 
}

.hero-stat:first-child:hover {
    border-color: rgba(52, 211, 153, 0.65);
    box-shadow: 0 4px 25px rgba(16, 185, 129, 0.25), 0 0 15px rgba(56, 189, 248, 0.15);
}

.hero-stat:last-child:hover {
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 4px 25px rgba(245, 158, 11, 0.22), 0 0 15px rgba(56, 189, 248, 0.12);
}

.hero-stat .stat-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(248, 250, 252, 0.58);
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.hero-stat .stat-value {
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 1.8vw, 1.4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(120deg, #ffffff 15%, #6ee7b7 65%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stat:last-child .stat-value {
    background: linear-gradient(120deg, #ffffff 15%, #bae6fd 60%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stat .stat-sub {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.35);
    margin-top: 0.2rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* =========================================================
   Stat Cards
   ========================================================= */

.stat-card {
    background: linear-gradient(145deg, rgba(19, 28, 50, 0.56) 0%, rgba(10, 16, 31, 0.5) 100%);
    backdrop-filter: blur(20px) saturate(175%);
    -webkit-backdrop-filter: blur(20px) saturate(175%);
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(224, 242, 254, 0.14);
    border-radius: var(--r-md);
    padding: 0.65rem 0.875rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-width: 0;
    transition: all var(--t-base) var(--ease-smooth);
}

.stat-card:hover {
    border-color: rgba(56, 189, 248, 0.42);
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(14, 165, 233, 0.16), inset 0 1px 0 rgba(224, 242, 254, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    border-radius: 0 2px 2px 0;
}

.stat-card.accent-success::before { background: linear-gradient(180deg, #34d399, #10b981); }
.stat-card:not(.accent-success)::before { background: var(--grad-primary); }

.stat-card .stat-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.15rem;
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-card.accent-success .stat-value { color: #34d399; }

.stat-card .stat-sub {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* =========================================================
   Charts
   ========================================================= */
.charts-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1rem;
}

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

.chart-card {
    height: 300px;
    display: flex;
    flex-direction: column;
    padding: 1.375rem;
}

.chart-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.chart-title {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.chart-canvas-container {
    flex: 1;
    position: relative;
    min-height: 0;
}

/* =========================================================
   Pricing Breakdown
   ========================================================= */
.pricing-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.25rem 1.5rem;
}

.pricing-breakdown > div:not(.pricing-detail-item) {
    display: contents;
}

.pricing-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.8125rem;
    gap: 0.5rem;
}

.pricing-detail-item:last-child { border-bottom: none; }

/* Bond Name spans the full grid width */
.pricing-detail-item.full-width {
    grid-column: 1 / -1;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding-bottom: 0.65rem;
    margin-bottom: 0.1rem;
}

.pricing-detail-item.full-width span:last-child {
    max-width: none;
    text-align: right;
    font-size: 0.8125rem;
    white-space: normal;
    word-break: break-word;
}

.pricing-detail-item span:first-child {
    color: var(--text-muted);
    font-weight: 500;
}

.pricing-detail-item span:last-child {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    white-space: normal;
    word-break: break-word;
    max-width: 70%;
}

/* =========================================================
   Two-Card Structured Pricing Breakdown (Deal & Specs)
   ========================================================= */
.pricing-breakdown-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
    align-items: stretch;
}

@media (max-width: 860px) {
    .pricing-breakdown-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.breakdown-subcard {
    background: linear-gradient(145deg, rgba(19, 28, 50, 0.56) 0%, rgba(10, 16, 31, 0.5) 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--r-lg, 12px);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(224, 242, 254, 0.12);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    transition: all 0.2s ease;
}

.breakdown-subcard:hover {
    border-color: rgba(56, 189, 248, 0.36);
    box-shadow: 0 10px 28px rgba(14, 165, 233, 0.12), inset 0 1px 0 rgba(224, 242, 254, 0.16);
}

.breakdown-subcard-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding-bottom: 0.7rem;
    margin-bottom: 0.7rem;
}

.deal-invoice-subcard .breakdown-subcard-header {
    color: #34d399;
}

.deal-invoice-subcard .breakdown-subcard-header svg {
    stroke: #10b981;
}

.bond-specs-subcard .breakdown-subcard-header {
    color: var(--brand-300);
}

.bond-specs-subcard .breakdown-subcard-header svg {
    stroke: var(--brand-400);
}

.pricing-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    flex-grow: 1;
}

.pricing-detail-list .pricing-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.48rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8125rem;
}

.pricing-detail-list .pricing-detail-item:last-child {
    border-bottom: none;
}

.pricing-detail-list .pricing-detail-item span:first-child {
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
    font-size: 0.8rem;
}

.pricing-detail-list .pricing-detail-item span:last-child {
    font-family: var(--font-mono, monospace);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    text-align: right;
}

.pricing-detail-item.full-width-name {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.pricing-detail-item.full-width-name span:last-child {
    text-align: left;
    font-family: var(--font-display, inherit);
    font-size: 0.84rem;
    color: #e2e8f0;
    line-height: 1.35;
    word-break: break-word;
    max-width: 100%;
}

.total-consideration-item {
    margin-top: 0.75rem !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(14, 165, 233, 0.12) 100%) !important;
    border: 1px solid rgba(52, 211, 153, 0.36) !important;
    box-shadow: inset 0 1px 0 rgba(224, 242, 254, 0.14) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.75rem !important;
    flex-wrap: nowrap !important;
}

.total-consideration-item .total-label {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #6ee7b7 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.total-consideration-item .total-value {
    font-family: var(--font-display, inherit) !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #34d399 !important;
    letter-spacing: -0.02em;
    text-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-variant-numeric: tabular-nums !important;
    text-align: right !important;
}

/* Section headings inside cards */
.card-section-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.9rem;
    letter-spacing: -0.01em;
}

.card-section-heading svg { flex-shrink: 0; }

/* =========================================================
   Cash Flow Schedule Table
   ========================================================= */
.schedule-container {
    overflow-x: auto;
    margin-top: 0.75rem;
    max-height: 420px;
    overflow-y: auto;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: rgba(5, 8, 17, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

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

.schedule-table thead { position: sticky; top: 0; z-index: 10; }

.schedule-table th {
    background: rgba(10, 16, 31, 0.85);
    backdrop-filter: blur(16px);
    padding: 0.6rem 0.85rem;
    font-size: 0.63rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    white-space: nowrap;
}

.schedule-table td {
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.04);
    color: var(--text-primary);
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.73rem;
    font-weight: 400;
    vertical-align: middle;
}

.schedule-table th:nth-child(4),
.schedule-table td:nth-child(4) {
    white-space: normal;
    min-width: 75px;
}

.schedule-table tbody tr {
    transition: background var(--t-fast) var(--ease-smooth);
}

.schedule-table tbody tr:hover td {
    background: rgba(14, 165, 233, 0.1);
    color: #ffffff;
}

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

/* Row status styles */
.schedule-table tbody tr[data-status="past"] td {
    opacity: 0.4;
}

.schedule-table tbody tr[data-status="next"] td {
    background: rgba(14, 165, 233, 0.1);
}

.schedule-table tbody tr[data-status="maturity"] td {
    background: rgba(245, 158, 11, 0.08);
}

.schedule-table tbody tr[data-status="ex-coupon"] td {
    background: rgba(234, 179, 8, 0.08);
}

/* Cash Flow Type Badges */
.cash-flow-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.15rem;
    font-family: var(--font-body);
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.05rem 0.2rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    white-space: normal;
    word-break: normal;
    min-width: 65px;
    margin: 0;
}

.type-outflow {
    color: #f87171;
    background: rgba(244, 63, 94, 0.14);
    border-color: rgba(244, 63, 94, 0.3);
}

.type-coupon {
    color: var(--brand-200);
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(14, 165, 233, 0.3);
}

.type-principal {
    color: #34d399;
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(52, 211, 153, 0.35);
}

.type-ex-coupon {
    color: var(--amberaccent-400);
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.32);
}

.amount-ex-coupon {
    display: block;
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.72rem;
}

.amount-buyer-ex-coupon {
    display: block;
    color: var(--amberaccent-400);
    font-weight: 700;
}

.mobile-only {
    display: none !important;
}

.desktop-only {
    /* visible on desktop */
}

@media (max-width: 600px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: block !important;
    }
    .table-date-sub {
        font-size: 0.625rem;
        color: var(--text-muted);
        margin-top: 0.15rem;
        font-family: var(--font-body);
    }
    .table-days-sub {
        font-size: 0.6rem;
        color: var(--text-muted);
        margin-top: 0.1rem;
        font-family: var(--font-mono);
        font-weight: 600;
    }
}

/* =========================================================
   Tooltip
   ========================================================= */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--text-secondary);
    font-size: 8px;
    font-weight: 800;
    cursor: help;
    transition: all var(--t-fast) var(--ease-smooth);
    vertical-align: middle;
    flex-shrink: 0;
}

.tooltip-icon:hover {
    background: rgba(14, 165, 233, 0.22);
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--brand-200);
}

/* =========================================================
   Badges (header & inline)
   ========================================================= */
.badge-live {
    background: rgba(16, 185, 129, 0.13) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: #34d399 !important;
}

.badge-live::before {
    background: #10b981 !important;
    box-shadow: 0 0 6px rgba(16,185,129,0.8) !important;
}

.badge-simulated {
    background: rgba(245, 158, 11, 0.13) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #fbbf24 !important;
}

.badge-simulated::before {
    background: #f59e0b !important;
    box-shadow: 0 0 6px rgba(245,158,11,0.7) !important;
}

/* =========================================================
   NSDL Search
   ========================================================= */
.search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.clear-btn {
    position: absolute !important;
    right: 0.75rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    width: 22px !important;
    height: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-secondary) !important;
    font-size: 1.1rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    z-index: 10 !important;
    transition: all var(--t-fast) var(--ease-smooth) !important;
    pointer-events: auto !important;
}

.clear-btn:hover {
    background: rgba(244, 63, 94, 0.25) !important;
    border-color: rgba(244, 63, 94, 0.6) !important;
    color: #fca5a5 !important;
    transform: translateY(-50%) scale(1.15) !important;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    max-height: 300px;
    background: rgba(9, 14, 27, 0.85);
    backdrop-filter: blur(28px) saturate(185%);
    -webkit-backdrop-filter: blur(28px) saturate(185%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--r-md);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(224, 242, 254, 0.14);
    z-index: 999;
    overflow-y: auto;
    animation: dropdown-enter var(--t-base) var(--ease-snappy);
}

@keyframes dropdown-enter {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.search-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
    transition: all var(--t-fast) var(--ease-smooth);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    position: relative;
}

.search-item:last-child { border-bottom: none; }

.search-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--grad-primary);
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity var(--t-fast) var(--ease-smooth);
}

.search-item:hover, .search-item.highlighted {
    background: rgba(14, 165, 233, 0.12);
    padding-left: calc(1rem + 3px);
}

.search-item:hover::before, .search-item.highlighted::before { opacity: 1; }

.search-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.search-item-issuer {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 68%;
}

.search-item-isin {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--brand-300);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.search-item-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-details {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
    flex-wrap: wrap;
}

.search-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: var(--r-xs);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-coupon {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-freq {
    background: rgba(245, 158, 11, 0.12);
    color: var(--amberaccent-400);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* =========================================================
   Scrollbars
   ========================================================= */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* =========================================================
   Utility — fade-in for output panels
   ========================================================= */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.outputs-panel > * {
    animation: fade-up 0.4s var(--ease-smooth) both;
}

.outputs-panel > *:nth-child(1) { animation-delay: 0.05s; }
.outputs-panel > *:nth-child(2) { animation-delay: 0.10s; }
.outputs-panel > *:nth-child(3) { animation-delay: 0.15s; }
.outputs-panel > *:nth-child(4) { animation-delay: 0.20s; }
.outputs-panel > *:nth-child(5) { animation-delay: 0.25s; }

/* =========================================================
   Bond Info Strip (shown after NSDL bond selection)
   ========================================================= */
.bond-info-strip {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.14) 0%, rgba(7, 89, 133, 0.18) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(125, 211, 252, 0.3);
    border-radius: var(--r-md);
    padding: 0.9rem 1rem 0.75rem;
    margin-bottom: 1.25rem;
    animation: fade-up 0.3s var(--ease-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(224, 242, 254, 0.14);
}

/* Cut / Close Button at Top Right Corner of Bond Card */
.bond-card-close-btn {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    padding: 0;
    outline: none;
}

.bond-card-close-btn:hover {
    background: rgba(244, 63, 94, 0.24);
    border-color: rgba(244, 63, 94, 0.55);
    color: #fca5a5;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.35);
}

.bond-card-close-btn:active {
    transform: scale(0.95);
}

.bond-info-header {
    padding-right: 2.2rem;
}

/* Shimmer top-left corner */
.bond-info-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.08) 0%, transparent 55%);
    pointer-events: none;
    border-radius: inherit;
}

/* Left accent glow bar */
.bond-info-strip::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--grad-primary);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.65);
}

.bond-info-details-table {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 0.7rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    padding-top: 0.65rem;
}

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

.bid-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: rgba(211, 223, 228, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.bid-value {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.bid-coupon-select {
    font-family: var(--font-display, inherit);
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(10, 16, 31, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 6px;
    padding: 2px 20px 2px 6px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2347c187' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 10px;
    line-height: 1.2;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.2);
    width: auto;
    max-width: 145px;
}

.bid-coupon-select:hover {
    border-color: var(--brand-400);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.bid-coupon-select:focus {
    border-color: var(--brand-300);
    box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.35);
}

.bid-coupon-select option {
    background-color: var(--forest-900);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 4px;
}

.bond-info-name {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    background: linear-gradient(120deg, #ffffff 30%, var(--brand-200) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bond-info-isin {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--brand-300);
    font-weight: 600;
    margin-top: 0.15rem;
    letter-spacing: 0.06em;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.35);
}

.bond-info-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.bond-chip {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: rgba(5, 8, 17, 0.42);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--r-sm);
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border);
}

.chip-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
}

.chip-value {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.chip-value.accent { color: var(--brand-400); }

/* =========================================================
   Number of Bonds Stepper
   ========================================================= */
.stepper-wrapper {
    display: flex;
    align-items: center;
    background: rgba(5, 8, 17, 0.48);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    overflow: hidden;
    height: 46px;
    transition: border-color var(--t-fast) var(--ease-smooth);
}

.stepper-wrapper:focus-within {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22);
}

.stepper-btn {
    width: 40px;
    height: 100%;
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--t-fast) var(--ease-smooth);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.stepper-btn:hover {
    background: rgba(148, 163, 184, 0.08);
}

.stepper-btn:active {
    background: rgba(148, 163, 184, 0.14);
}

.stepper-input {
    flex: 1;
    width: 0;
    min-width: 0;
    height: 100%;
    background: none;
    border: none !important;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0 !important;
    outline: none;
    -moz-appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* =========================================================
   Result Summary Card
   ========================================================= */
.result-summary-card {
    background: var(--grad-hero-ytm);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid rgba(125, 211, 252, 0.28);
    box-shadow: inset 0 1px 0 rgba(224, 242, 254, 0.14);
    border-radius: var(--r-md);
    padding: 1.125rem 1.25rem;
    margin-top: 1.25rem;
    animation: fade-up 0.35s var(--ease-smooth);
}

.rsc-top {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
    flex-wrap: wrap;
}

.rsc-price {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.rsc-at {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rsc-ytm {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--brand-400);
    letter-spacing: -0.02em;
}

.rsc-bottom {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(5, 8, 17, 0.42);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.rsc-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.625rem 0.5rem;
    gap: 0.25rem;
}

.rsc-divider {
    width: 1px;
    background: var(--border);
    margin: 0.375rem 0;
    flex-shrink: 0;
}

.rsc-lbl {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
}

.rsc-val {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

/* =========================================================
   Separator (HR)
   ========================================================= */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    margin: 1.5rem 0;
}

/* =========================================================
   Sticky Result Strip (shows after calculation)
   ========================================================= */
.result-strip {
    display: none; /* shown on mobile only via media query */
    position: sticky;
    top: 64px;
    z-index: 90;
    background: rgba(9, 14, 27, 0.78);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 0.625rem 1rem;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
    pointer-events: none;
}

.result-strip::-webkit-scrollbar { display: none; }

.result-strip.has-data {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.result-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0.875rem;
    min-width: max-content;
    flex-shrink: 0;
}

.result-chip-divider {
    width: 1px;
    align-self: stretch;
    background: var(--border);
    margin: 0.125rem 0;
    flex-shrink: 0;
}

.rc-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.rc-value {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.rc-value.accent-green { color: #6ee7b7; }

/* =========================================================
   Collapsible Sections
   ========================================================= */
.collapsible-section {
    display: flex;
    flex-direction: column;
}

.collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 0.875rem 1.125rem;
    cursor: pointer;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: all var(--t-base) var(--ease-smooth);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.collapse-toggle:hover {
    background: var(--bg-surface-2);
    border-color: var(--border-strong);
}

.collapse-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapse-chevron {
    flex-shrink: 0;
    transition: transform var(--t-base) var(--ease-smooth);
    color: var(--text-muted);
}

.collapsible-section.collapsed .collapse-chevron {
    transform: rotate(180deg);
}

.collapsible-body {
    overflow: hidden;
    transition: max-height 0.35s var(--ease-smooth);
    display: flex;
    flex-direction: column;
    gap: 0; /* handled by children */
}

/* =========================================================
   Floating Action Button (Removed across all devices per user preference)
   ========================================================= */
.fab {
    display: none !important;
}

/* =========================================================
   Slider Group (Hidden per user preference)
   ========================================================= */
.slider-form-group {
    display: none !important;
}

/* =========================================================
   MOBILE — Main breakpoints
   ========================================================= */

/* ── ≤ 1100px: Stack side-by-side to full column ── */
@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── ≤ 768px: Tablet portrait ── */
@media (max-width: 768px) {
    /* Layout */
    main {
        padding: 1rem;
        padding-bottom: 5.5rem; /* space for FAB */
    }

    .dashboard-grid { gap: 1rem; }

    /* Header */
    header { height: 56px; padding: 0 1rem; }
    .logo-text h1 { font-size: 1rem; }
    .logo-text p  { display: none; }
    .logo-icon    { height: 32px; border-radius: 6px; padding: 2px 6px; }
    .logo-icon img { height: 22px; }
    .badge { display: none !important; }
    .btn-mobile-menu { display: inline-flex !important; margin-left: auto !important; }
    .nav-tabs { display: none !important; }
    .rbac-user-nav { display: none !important; }

    /* Result strip becomes visible */
    .result-strip {
        display: none;
        top: 56px;
    }
    .result-strip.has-data {
        display: flex;
    }

    /* Cards */
    .card { padding: 1.25rem; border-radius: var(--r-md); }
    .input-card { border-radius: var(--r-md); }

    /* Primary Metrics: display executive 2x2 grid on mobile */
    .metrics-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        margin-bottom: 0.85rem !important;
    }
    .main-metrics,
    .stats-grid {
        display: contents !important;
    }
    .hero-stat,
    .metrics-row .stat-card {
        padding: 0.7rem 0.8rem !important;
        min-height: 72px !important;
        border-radius: var(--r-md) !important;
    }
    .hero-stat .stat-label,
    .metrics-row .stat-card .stat-label {
        font-size: 0.62rem !important;
        letter-spacing: 0.05em !important;
        margin-bottom: 0.18rem !important;
    }
    .hero-stat .stat-value,
    .metrics-row .stat-card .stat-value {
        font-size: clamp(1.05rem, 4vw, 1.35rem) !important;
        line-height: 1.15 !important;
        font-weight: 800 !important;
    }
    .hero-stat .stat-sub,
    .metrics-row .stat-card .stat-sub {
        font-size: 0.58rem !important;
        margin-top: 0.18rem !important;
    }

    /* Charts */
    .charts-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .chart-card  { height: 320px; padding: 1.125rem; }

    /* Collapsible sections */
    .collapsible-section { gap: 0.625rem; }
    .collapse-toggle { padding: 0.75rem 1rem; font-size: 0.8125rem; }

    /* Collapsible body spacing */
    .collapsible-body .card { margin-top: 0.5rem; }
    .collapsible-body .charts-grid { margin-top: 0.5rem; }

    /* Pricing breakdown → 2 col */
    .pricing-breakdown { grid-template-columns: 1fr 1fr; gap: 0 1rem; }

    /* Schedule table: momentum swipe with sticky headers */
    .schedule-container {
        max-height: 400px;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-x: contain;
    }
    .schedule-table thead {
        position: sticky;
        top: 0;
        z-index: 5;
    }
    .schedule-table th {
        background: rgba(6, 9, 17, 0.96) !important;
        backdrop-filter: blur(10px);
        padding: 0.55rem 0.65rem;
        font-size: 0.65rem;
        white-space: nowrap;
    }
    .schedule-table td {
        padding: 0.5rem 0.65rem;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    /* Tabs: bigger touch targets */
    .tabs-container { margin-bottom: 1.25rem; }
    .tab-btn { padding: 0.75rem 0.5rem; font-size: 0.8rem; }

    /* Form & Input: Strictly 16px to prevent iOS Safari auto-zoom */
    .form-group { margin-bottom: 0.75rem; }
    label { font-size: 0.68rem; margin-bottom: 0.3rem; }
    input,
    select,
    textarea,
    .input-wrapper input,
    .input-wrapper select,
    .stepper-input,
    .inline-input,
    #bondSearchInput {
        font-size: 16px !important; /* Eliminates iOS Safari auto-zoom */
        touch-action: manipulation;
    }
    .input-wrapper input,
    .input-wrapper select {
        padding: 0.75rem 0.9rem;
        border-radius: var(--r-sm);
        min-height: 44px;
    }

    /* Stepper button touch targets */
    .stepper-btn {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Search dropdown virtual keyboard fit */
    .search-dropdown {
        max-height: 46vh !important;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75) !important;
    }
    .search-item {
        padding: 0.75rem 0.9rem !important;
        min-height: 46px !important;
        touch-action: manipulation;
    }

    /* Slider — bigger thumb for touch */
    input[type="range"] { height: 4px; }
    input[type="range"]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    /* Button */
    .btn-primary {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
        font-weight: 700;
        margin-top: 0.9rem;
        min-height: 48px;
        border-radius: var(--r-md);
        touch-action: manipulation;
    }

    /* FAB */
    .fab { display: flex; }

    /* Outputs panel animations: disable on mobile for perf */
    .outputs-panel > * { animation: none; }
}

/* ── ≤ 480px: Small phones ── */
@media (max-width: 480px) {
    main { padding: 0.75rem; padding-bottom: 5.5rem; }
    .dashboard-grid { gap: 0.75rem; }

    /* Header */
    header {
        height: 52px;
        padding: 0 0.75rem;
        padding-top: max(0px, env(safe-area-inset-top));
    }
    .logo-text h1 {
        font-size: 0.85rem;
        line-height: 1.1;
        white-space: nowrap;
    }
    .logo-text p {
        display: none !important;
    }
    .logo-icon {
        height: 28px;
        padding: 1px 4px;
    }
    .logo-icon img {
        height: 20px;
    }
    .btn-mobile-menu {
        width: 38px !important;
        height: 38px !important;
        margin-left: auto;
    }
    .nav-tabs {
        display: none !important;
    }
    .badge#conventionBadge {
        display: none !important;
    }

    /* Card */
    .card { padding: 0.85rem; }

    /* Metrics card padding on small screens */
    .hero-stat,
    .metrics-row .stat-card {
        padding: 0.65rem 0.75rem !important;
    }

    /* Charts */
    .chart-card  { height: 280px; }

    /* Stack row-2 elements (Bonds & Dates, Maturity & Day count, Coupon & Freq) on mobile */
    .form-group.row-2 {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }

    /* Pricing: single column on tiny phones */
    .pricing-breakdown { grid-template-columns: 1fr; gap: 0; }

    /* Schedule: compressed */
    .schedule-table th,
    .schedule-table td { padding: 0.4rem 0.5rem; font-size: 0.65rem; }

    /* FAB size */
    .fab { width: 52px; height: 52px; right: 1rem; }

    /* Collapse toggle */
    .collapse-toggle { padding: 0.7rem 0.875rem; font-size: 0.775rem; }
    .collapse-title svg { display: none; } /* save space */

    /* Result strip */
    .result-strip {
        top: 52px;
        padding: 0.45rem 0.65rem;
    }
    .rc-value { font-size: 0.75rem; }
    .rc-label { font-size: 0.56rem; }
    .result-chip { padding: 0 0.55rem; }

    /* Result summary card mobile stacking */
    .rsc-bottom {
        flex-direction: column;
    }
    .rsc-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }
    .rsc-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        width: 100%;
    }
    .rsc-val {
        text-align: right;
    }
}

/* ── ≤ 360px: Very small phones ── */
@media (max-width: 360px) {
    .form-group.row-2 { grid-template-columns: 1fr; }
    .metrics-row { gap: 0.35rem !important; }
    .hero-stat,
    .metrics-row .stat-card {
        padding: 0.55rem 0.55rem !important;
        min-height: 65px !important;
    }
    .hero-stat .stat-value,
    .metrics-row .stat-card .stat-value {
        font-size: 1.02rem !important;
    }
    .nav-tab {
        padding: 0.3rem 0.4rem !important;
        font-size: 0.65rem !important;
    }
}

/* =========================================================
   Touch / Hover: remove hover states on touch devices
   ========================================================= */
@media (hover: none) {
    .card:hover         { transform: none; border-color: var(--border); }
    .hero-stat:hover    { transform: none; }
    .stat-card:hover    { transform: none; border-color: var(--border); }
    .btn-primary:hover  { transform: none; }
    .search-item:hover  { background: rgba(14, 165, 233, 0.12); }
}

/* =========================================================
   iOS Safe Area insets
   ========================================================= */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    main {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }
    .fab {
        bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* =========================================================
   Print: hide chrome, show content
   ========================================================= */
@media print {
    header, .fab, .result-strip, .collapse-toggle,
    .btn-primary, .tabs-container { display: none !important; }
    main { padding: 0; }
    .dashboard-grid { display: block; }
    .collapsible-body { max-height: none !important; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    body { background: white; color: black; }
}

/* =========================================================
   Manual Overrides Toggle Styles
   ========================================================= */
.manual-toggle-container {
    margin: 1rem 0 0.75rem 0;
    display: flex;
    justify-content: center;
}

.btn-toggle-manual {
    background: rgba(14, 165, 233, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.24);
    color: var(--brand-300);
    padding: 0.5rem 0.8rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all var(--t-base) var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    outline: none;
}

.btn-toggle-manual:hover {
    background: rgba(14, 165, 233, 0.16);
    border-color: rgba(56, 189, 248, 0.45);
    color: var(--brand-200);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.14);
}

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

.btn-toggle-manual.active {
    background: rgba(2, 132, 199, 0.18);
    border-color: rgba(125, 211, 252, 0.42);
    color: var(--brand-300);
}

.btn-toggle-manual.active:hover {
    background: rgba(14, 165, 233, 0.24);
    border-color: rgba(125, 211, 252, 0.55);
    color: var(--brand-100);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.16);
}

.btn-toggle-manual svg {
    transition: transform var(--t-base) var(--ease-smooth);
}

.btn-toggle-manual.active svg {
    transform: rotate(180deg);
}

.manual-bond-params {
    transition: all var(--t-base) var(--ease-smooth);
}

/* =========================================================
   Side-by-Side Mode Selector & Inputs
   ========================================================= */
.mode-selector-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mode-input-card {
    background: rgba(5, 8, 17, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    padding: 0.85rem;
    border-radius: var(--r-md);
    transition: all var(--t-base) var(--ease-smooth);
    position: relative;
}

.mode-input-card.active {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(14, 165, 233, 0.08);
    box-shadow: 0 0 18px rgba(14, 165, 233, 0.1), inset 0 1px 0 rgba(224, 242, 254, 0.12);
}

.or-separator {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.05em;
    user-select: none;
}

.mode-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    user-select: none;
}

.mode-radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 12px;
    height: 12px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: border-color var(--t-fast) var(--ease-smooth);
    flex-shrink: 0;
}

.mode-radio-label input[type="radio"]:checked + .radio-custom {
    border-color: var(--indigo);
}

.mode-radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--indigo);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mode-helper-text {
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 0.4rem;
    letter-spacing: 0.02em;
}

.success-text {
    color: #34d399; /* Green calculated output text */
}

/* Style for read-only input fields acting as outputs */
.readonly-input {
    background: rgba(0, 0, 0, 0.15) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
    cursor: default !important;
    font-weight: 600 !important;
}

.slider-form-group {
    margin-bottom: 1.25rem;
}

/* =========================================================
   Bond Info Details Table Styles
   ========================================================= */
.bond-info-isin-desc {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.45);
    margin-top: 0.2rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    letter-spacing: 0.01em;
}



@media (max-width: 600px) {
    .mode-selector-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .or-separator {
        margin: 0.25rem 0;
    }
}

/* Premium design overrides to remove inner input borders/box and make text large & bold */
.mode-input-card .input-wrapper {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin-top: 0.25rem !important;
    gap: 0.35rem !important;
}

.mode-input-card .input-wrapper input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    padding: 0.2rem 0 !important;
    height: auto !important;
    flex: 1 !important;
    width: 0 !important;
    min-width: 0 !important;
    font-family: var(--font-body) !important;
    line-height: 1.2 !important;
}

.mode-input-card .input-wrapper input:focus {
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

.mode-input-card .input-wrapper .input-prefix,
.mode-input-card .input-wrapper .input-suffix {
    position: static !important;
    font-size: 1.35rem !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.mode-input-card .input-wrapper.has-prefix input {
    padding-left: 0 !important;
}

.mode-input-card .input-wrapper.has-suffix input {
    padding-right: 0 !important;
}

/* Inactive card input overrides */
.mode-input-card:not(.active) .input-wrapper input {
    color: var(--text-muted) !important;
}

.mode-input-card:not(.active) .input-wrapper .input-prefix,
.mode-input-card:not(.active) .input-wrapper .input-suffix {
    color: var(--text-muted) !important;
}

/* View More Details Link styles */
.view-more-details-wrapper {
    margin-top: 0.6rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.view-more-link {
    color: var(--brand-400);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--t-fast) var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.view-more-link::after {
    content: '→';
    font-size: 0.8em;
    transition: transform var(--t-fast) var(--ease-snappy);
}

.view-more-link:hover {
    color: var(--brand-200);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.view-more-link:hover::after {
    transform: translateX(3px);
}

/* =========================================================
   Top Navigation Tabs
   ========================================================= */
.nav-tabs {
    display: flex;
    align-items: center;
    background: rgba(5, 8, 17, 0.46);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
    border-radius: var(--r-md);
    padding: 0.2rem;
    gap: 0.2rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    transition: all var(--t-base) var(--ease-smooth);
}

.nav-tab svg {
    opacity: 0.65;
    transition: opacity var(--t-base) var(--ease-smooth);
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab:hover svg {
    opacity: 1;
}

.nav-tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.3) 0%, rgba(2, 132, 199, 0.25) 100%);
    border: 1px solid rgba(14, 165, 233, 0.5);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.22), 0 0 10px rgba(56, 189, 248, 0.15);
}

.nav-tab.active svg {
    color: var(--brand-300);
    opacity: 1;
}

/* =========================================================
   SGB Gold Theme
   ========================================================= */
.accent-gold {
    border-left: 3px solid #eab308 !important;
}

.mode-input-card.gold-active {
    border: 1px solid rgba(234, 179, 8, 0.35) !important;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.08) 0%, rgba(202, 138, 4, 0.06) 100%) !important;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.08) !important;
}

.mode-input-card.gold-active::before {
    background: radial-gradient(circle at 0% 0%, rgba(234, 179, 8, 0.15) 0%, transparent 60%) !important;
}

.mode-input-card.gold-active .input-prefix {
    color: #f59e0b !important;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.mode-input-card.gold-active .input-wrapper input {
    color: #ffffff !important;
}

/* =========================================================
   Responsive Overrides for Nav Tabs
   ========================================================= */
@media (max-width: 600px) {
    .nav-tabs {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .logo-text p {
        display: none !important;
    }
    .badge#conventionBadge {
        display: none !important;
    }
}

/* =========================================================
   Database Status Container & Badge
   ========================================================= */
.db-status-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.db-status-badge {
    background: rgba(14, 165, 233, 0.12);
    color: var(--brand-300);
    border: 1px solid rgba(14, 165, 233, 0.25);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================================
   Admin Panel Styles
   ========================================================= */
.admin-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    animation: fade-up 0.4s var(--ease-smooth);
}

.admin-login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(80vh - 120px);
}

.admin-login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(10, 16, 31, 0.62);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--r-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(14, 165, 233, 0.08), inset 0 1px 0 rgba(224, 242, 254, 0.14);
    animation: fade-up 0.3s var(--ease-smooth);
}

.admin-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-login-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.admin-login-header p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.admin-login-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: var(--r-sm);
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
    display: none;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Terminal Window */
.terminal-window {
    background: rgba(5, 8, 17, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(224, 242, 254, 0.08);
}

.terminal-header {
    background: rgba(10, 16, 31, 0.85);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    padding: 0.75rem 1.125rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-dots {
    display: flex;
    gap: 0.4rem;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.terminal-body {
    padding: 1.25rem;
    height: 380px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
}
.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}
.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.terminal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.terminal-status-bar {
    background: rgba(10, 16, 31, 0.85);
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    padding: 0.65rem 1.125rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6b7280;
}
.status-dot.active {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 1.5s infinite alternate;
}
.status-dot.syncing {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    animation: pulse 0.7s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

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

.btn-admin-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--grad-primary);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--t-base) var(--ease-smooth);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.28), inset 0 1px 0 rgba(224, 242, 254, 0.16);
}

.btn-admin-action:hover {
    background: var(--grad-primary-h);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(14, 165, 233, 0.4), inset 0 1px 0 rgba(224, 242, 254, 0.2);
}

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

.btn-admin-action.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-admin-action.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.btn-admin-action.secondary:active {
    background: rgba(255, 255, 255, 0.04);
}

.btn-admin-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.admin-link-container {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.admin-link {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--t-base) var(--ease-smooth);
}
.admin-link:hover {
    color: var(--primary-light);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.spin-icon {
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* =========================================================
   Trader Portal Layout Override & Table Rules
   ========================================================= */
.trader-portal-grid {
    grid-template-columns: 1.55fr 1fr !important;
}

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

.search-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.db-toggle-group {
    display: inline-flex;
    background: rgba(5, 8, 17, 0.48);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 3px;
    gap: 4px;
}

.db-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-smooth);
}

.db-toggle-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.05);
}

.db-toggle-btn.active {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
}

.add-custom-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--r-sm);
    cursor: pointer;
    background: rgba(19, 28, 50, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: all var(--t-fast);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.add-custom-btn:hover {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(56, 189, 248, 0.35);
}

.global-settings-row {
    margin-top: 1rem;
    background: rgba(5, 8, 17, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0.75rem 1rem;
}

.global-settings-row label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
}

.global-settings-row input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.quote-sheet-wrapper {
    margin-top: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: rgba(5, 8, 17, 0.44);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    position: relative;
}

.table-scroll-container {
    width: 100%;
    overflow-x: auto;
}

.quote-sheet-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.8125rem;
}

.quote-sheet-table th {
    background: rgba(10, 16, 31, 0.88);
    backdrop-filter: blur(16px);
    padding: 0.85rem 0.75rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-strong);
}

.quote-sheet-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-primary);
}

@media (min-width: 601px) {
    .quote-sheet-table td:nth-child(3),
    .quote-sheet-table td:nth-child(4),
    .quote-sheet-table td:nth-child(5) {
        padding-left: 0.4rem !important;
        padding-right: 0.4rem !important;
    }
}

.quote-sheet-table tr.selected-row {
    background: rgba(14, 165, 233, 0.12);
}

.quote-sheet-table tr.selected-row td {
    border-bottom-color: rgba(14, 165, 233, 0.35);
}

.quote-sheet-table tr:hover:not(.selected-row) {
    background: rgba(148, 163, 184, 0.04);
}

.table-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Inline inputs inside table */
.inline-input {
    background: rgba(5, 8, 17, 0.52) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--r-xs) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-mono) !important;
    font-size: 0.8125rem !important;
    padding: 0.35rem 0.35rem !important;
    text-align: right !important;
    transition: all var(--t-fast) !important;
}

.inline-input:focus {
    border-color: var(--border-focus) !important;
    outline: none !important;
    background: rgba(10, 16, 31, 0.78) !important;
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.35) !important;
}

/* Buy/Sell toggle cell */
.trade-type-toggle {
    display: inline-flex;
    border-radius: var(--r-xs);
    overflow: hidden;
    border: 1px solid var(--border);
    padding: 1px;
    background: rgba(5, 8, 17, 0.45);
}

.trade-type-btn {
    border: none;
    background: transparent;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--t-fast);
}

.trade-type-btn.active.buy {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.25), inset 0 0 0 1px rgba(52, 211, 153, 0.38);
}

.trade-type-btn.active.sell {
    background: rgba(244, 63, 94, 0.2);
    color: #f87171;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.25), inset 0 0 0 1px rgba(244, 63, 94, 0.38);
}

/* Action buttons */
.row-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.row-action-btn.details-btn:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.08);
}

.row-action-btn.delete-btn:hover {
    color: var(--rose);
    background: rgba(244, 63, 94, 0.12);
}

/* Totals Strip */
.summary-metrics-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.summary-metric-card {
    background: rgba(19, 28, 50, 0.46);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(224, 242, 254, 0.1);
    border-radius: var(--r-md);
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
}

.summary-metric-card .sm-lbl {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.15rem;
}

.summary-metric-card .sm-val {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.summary-metric-card.buy-card {
    border-left: 3px solid var(--emerald);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1), inset 0 1px 0 rgba(224, 242, 254, 0.1);
}

.summary-metric-card.buy-card .sm-val {
    color: #34d399;
}

.summary-metric-card.sell-card {
    border-left: 3px solid var(--logo-crimson);
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.1), inset 0 1px 0 rgba(224, 242, 254, 0.1);
}

.summary-metric-card.sell-card .sm-val {
    color: #f87171;
}

.summary-metric-card.net-card {
    border-left: 3px solid var(--brand-300);
    box-shadow: 0 0 15px rgba(125, 211, 252, 0.1), inset 0 1px 0 rgba(224, 242, 254, 0.1);
}

.summary-metric-card.yield-card {
    border-left: 3px solid var(--amberaccent-500);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.1), inset 0 1px 0 rgba(224, 242, 254, 0.1);
}

.sharing-actions-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.sharing-actions-row .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(19, 28, 50, 0.48);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-base);
}

.sharing-actions-row .btn-secondary:hover {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
}

/* Placeholder and Active View States */
.details-placeholder-card {
    padding: 4.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-style: dashed !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}

.selected-bond-header {
    background: rgba(14, 165, 233, 0.06) !important;
    border-color: rgba(14, 165, 233, 0.22) !important;
}

.override-card .override-grid label {
    margin-bottom: 0.25rem;
}

.override-card .override-grid input,
.override-card .override-grid select {
    padding: 0.5rem 0.75rem;
    font-size: 0.825rem;
}

/* =========================================================
   Print Stylesheet
   ========================================================= */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
        font-size: 10pt !important;
        padding: 0.5in !important;
        margin: 0 !important;
    }
    
    body::before {
        display: none !important;
    }
    
    header, 
    footer,
    .search-section, 
    .global-settings-row, 
    .sharing-actions-row, 
    .admin-link-container, 
    .outputs-panel, 
    .fab,
    .row-action-btn.delete-btn,
    #btnBondsMinus,
    #btnBondsPlus,
    th:last-child,
    td:last-child {
        display: none !important;
    }
    
    main {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    .dashboard-grid {
        display: block !important;
    }
    
    .quote-builder-card {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    
    /* Add Print Invoice Header */
    .quote-builder-card::before {
        content: "BOND PORTFOLIO QUOTATION\nKrishnarpan Investments\nGenerated: " attr(data-date) "\nPrepared For: " attr(data-client) !important;
        display: block !important;
        white-space: pre-wrap !important;
        font-family: 'Space Grotesk', -apple-system, sans-serif !important;
        font-size: 14pt !important;
        font-weight: 700 !important;
        margin-bottom: 2rem !important;
        border-bottom: 2px solid #000000 !important;
        padding-bottom: 1rem !important;
        color: #000000 !important;
    }
    
    .quote-sheet-wrapper {
        border: 1px solid #000000 !important;
        background: none !important;
        border-radius: 0 !important;
    }
    
    .quote-sheet-table {
        font-size: 8.5pt !important;
    }
    
    .quote-sheet-table th {
        background: #f3f4f6 !important;
        color: #000000 !important;
        border-bottom: 2px solid #000000 !important;
        font-weight: bold !important;
    }
    
    .quote-sheet-table td {
        border-bottom: 1px solid #e5e7eb !important;
        color: #000000 !important;
        background: none !important;
    }
    
    /* Hide inputs and show values in print */
    .quote-sheet-table input,
    .quote-sheet-table select {
        border: none !important;
        background: none !important;
        padding: 0 !important;
        text-align: right !important;
        font-family: inherit !important;
        font-size: inherit !important;
        color: #000000 !important;
    }
    
    .summary-metrics-strip {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 1rem !important;
        margin-top: 2rem !important;
    }
    
    .summary-metric-card {
        flex: 1 !important;
        min-width: 120px !important;
        background: #f9fafb !important;
        border: 1px solid #e5e7eb !important;
        border-left: 4px solid #4b5563 !important;
        border-radius: 0 !important;
        padding: 0.5rem !important;
    }
    
    .summary-metric-card.buy-card {
        border-left-color: #10b981 !important;
    }
    
    .summary-metric-card.sell-card {
        border-left-color: #f43f5e !important;
    }
    
    .summary-metric-card.net-card {
        border-left-color: #38bdf8 !important;
    }
    
    .summary-metric-card.yield-card {
        border-left-color: #c8962e !important;
    }
    
    .summary-metric-card .sm-lbl {
        color: #4b5563 !important;
    }
    
    .summary-metric-card .sm-val {
        color: #000000 !important;
        font-size: 11pt !important;
    }
}

/* =========================================================
   Footer
   ========================================================= */
footer {
    background: rgba(5, 8, 17, 0.72);
    backdrop-filter: blur(28px) saturate(185%);
    -webkit-backdrop-filter: blur(28px) saturate(185%);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem 2rem 2rem;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.35) 50%, transparent 100%);
}

.footer-container {
    max-width: 1520px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 3rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-brand .logo-section {
    align-self: flex-start;
}

.footer-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 320px;
}

.footer-links-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.footer-links-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    transition: color var(--t-base) var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-link:hover {
    color: var(--brand-300);
}

.footer-compliance {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.footer-compliance-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

.footer-disclaimer {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 1.25rem 0;
}

.footer-bottom {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: var(--r-sm);
}

.footer-status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
    .footer-compliance {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    footer {
        padding: 2rem 1rem 1.5rem 1rem;
    }
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================================================
   Mobile Overrides for Quote Sheet Table Rows
   ========================================================= */
@media (max-width: 600px) {
    .quote-sheet-table thead {
        display: none !important;
    }
    
    .quote-sheet-table tbody {
        display: block !important;
    }
    
    .quote-sheet-table tr {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) auto !important;
        grid-template-areas:
            "type type type type"
            "desc desc desc desc"
            "qty px ytm actions" !important;
        gap: 0.65rem !important;
        padding: 0.75rem 0.9rem !important;
        margin-bottom: 0.75rem !important;
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid var(--border) !important;
        border-radius: var(--r-md) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .quote-sheet-table td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        width: 100% !important;
        text-align: left !important;
    }
    
    .quote-sheet-table td:nth-child(1) {
        grid-area: type !important;
    }
    
    .quote-sheet-table td:nth-child(2) {
        grid-area: desc !important;
        margin-bottom: 0.35rem !important;
    }
    
    .quote-sheet-table td:nth-child(3) {
        grid-area: qty !important;
    }
    
    .quote-sheet-table td:nth-child(4) {
        grid-area: px !important;
    }
    
    .quote-sheet-table td:nth-child(5) {
        grid-area: ytm !important;
    }
    
    .quote-sheet-table td:nth-child(6) {
        grid-area: actions !important;
        justify-self: end !important;
        align-self: center !important;
    }
    
    /* Input sizing inside quote table cells */
    .quote-sheet-table td .inline-input {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Inject labels above fields */
    .quote-sheet-table td:nth-child(3)::before {
        content: "Qty" !important;
        display: block !important;
        font-size: 0.65rem !important;
        color: var(--text-secondary) !important;
        margin-bottom: 0.2rem !important;
        text-transform: uppercase !important;
        font-weight: 600 !important;
        letter-spacing: 0.05em !important;
    }
    
    .quote-sheet-table td:nth-child(4)::before {
        content: "Price" !important;
        display: block !important;
        font-size: 0.65rem !important;
        color: var(--text-secondary) !important;
        margin-bottom: 0.2rem !important;
        text-transform: uppercase !important;
        font-weight: 600 !important;
        letter-spacing: 0.05em !important;
    }
    
    .quote-sheet-table td:nth-child(5)::before {
        content: "YTM" !important;
        display: block !important;
        font-size: 0.65rem !important;
        color: var(--text-secondary) !important;
        margin-bottom: 0.2rem !important;
        text-transform: uppercase !important;
        font-weight: 600 !important;
        letter-spacing: 0.05em !important;
    }
    
    .quote-sheet-table td:nth-child(6)::before {
        content: "Actions" !important;
        display: block !important;
        font-size: 0.65rem !important;
        visibility: hidden !important;
        margin-bottom: 0.2rem !important;
    }
}

/* --- Pre-Search Dropdown Tabs & Presearch Styling --- */
.search-dropdown-tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(10, 16, 31, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 0.25rem 0.5rem 0;
    gap: 0.25rem;
}

.search-dropdown-tab {
    padding: 0.55rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--t-fast) var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    user-select: none;
    background: transparent;
    border-radius: 4px 4px 0 0;
}

.search-dropdown-tab:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.04);
}

.search-dropdown-tab.active {
    color: var(--brand-300);
    border-bottom-color: var(--brand-500);
    background: rgba(14, 165, 233, 0.12);
}

.presearch-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.presearch-clear-btn {
    color: var(--rose);
    font-size: 0.7rem;
    cursor: pointer;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}
.presearch-clear-btn:hover { text-decoration: underline; }

.search-item-yield-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(52, 211, 153, 0.28);
    white-space: nowrap;
}

/* Initial Landing Mode: Before searching or selecting, show ONLY search bar + discovery grid */
#dashboardGrid.initial-landing-mode .card > *:not(.search-top-bar):not(.calc-main-tabs):not(.search-container):not(.db-status-container):not(#searchDropdown):not(#discoveryGrid),
#dashboardGrid.initial-landing-mode #calculatorCardLeft > *:not(.search-top-bar):not(.calc-main-tabs):not(.search-container):not(.db-status-container):not(#searchDropdown):not(#discoveryGrid),
#dashboardGrid.initial-landing-mode #calculatorCardRight {
    display: none !important;
}

#dashboardGrid.initial-landing-mode {
    display: block !important;
}

/* Discovery Grid (3-Column Landing Interface) */
.discovery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 992px) {
    .discovery-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
}

.discovery-card {
    background: linear-gradient(145deg, rgba(19, 28, 50, 0.56) 0%, rgba(10, 16, 31, 0.5) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: var(--r-md);
    padding: 0.7rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(224, 242, 254, 0.14);
    transition: transform var(--t-fast) var(--ease-smooth), border-color var(--t-fast) var(--ease-smooth);
}

.discovery-card:hover {
    border-color: rgba(56, 189, 248, 0.38);
}

.discovery-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.discovery-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.discovery-card-badge {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--brand-300);
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(14, 165, 233, 0.25);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.discovery-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 310px;
    overflow-y: auto;
    padding-right: 2px;
}

.discovery-list::-webkit-scrollbar {
    width: 4px;
}
.discovery-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.16);
    border-radius: 4px;
}

.discovery-item {
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    background: rgba(5, 8, 17, 0.38);
    border: 1px solid rgba(148, 163, 184, 0.06);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-smooth);
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

.discovery-item:hover {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateX(2px);
}

.discovery-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
}

.discovery-item-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.discovery-item-yield {
    font-size: 0.72rem;
    font-weight: 700;
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.discovery-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Full Screen Initial Landing Mode before bond selection */
.dashboard-grid.initial-landing-mode {
    grid-template-columns: 1fr !important;
}

.dashboard-grid.initial-landing-mode .output-section,
.dashboard-grid.initial-landing-mode .results-panel {
    display: none !important;
}

.dashboard-grid.initial-landing-mode .input-card {
    max-width: 100% !important;
    width: 100% !important;
}

.dashboard-grid.initial-landing-mode .discovery-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.25rem !important;
}

@media (max-width: 992px) {
    .dashboard-grid.initial-landing-mode .discovery-grid {
        grid-template-columns: 1fr !important;
    }
}

/* GOI Type Filter Buttons (disc-type-btn) */
.disc-type-btn {
    background: rgba(5, 8, 17, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 5px;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-smooth);
    white-space: nowrap;
    font-family: inherit;
}

.disc-type-btn:hover {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(56, 189, 248, 0.4);
    color: var(--brand-300);
}

.disc-type-btn.active {
    background: rgba(14, 165, 233, 0.22);
    border-color: rgba(125, 211, 252, 0.55);
    color: var(--brand-100);
    font-weight: 700;
}

/* discovery-item-isin (ISIN line under name) */
.discovery-item-isin {
    font-size: 0.67rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SDL State dropdown styling */
#sdlStateSelect option {
    background: var(--forest-900);
    color: var(--text-primary);
}

/* G-Bond landing mode: full-width card + wider discovery grid */
#dashboardGrid.initial-landing-mode .discovery-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    #dashboardGrid.initial-landing-mode .discovery-grid {
        grid-template-columns: 1fr !important;
    }
}

/* G-Bond landing mode: remove card box so discovery grid can take full width */
#dashboardGrid.initial-landing-mode .input-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Keep search bar and type tabs styled even without card background */
#dashboardGrid.initial-landing-mode .search-top-bar,
#dashboardGrid.initial-landing-mode .calc-main-tabs,
#dashboardGrid.initial-landing-mode .search-container {
    /* Let them inherit their own styles */
    margin-bottom: 0;
}

/* Discovery grid on g-bond landing mode: proper spacing */
#dashboardGrid.initial-landing-mode .discovery-grid {
    margin-top: 0.75rem;
    width: 100%;
    gap: 0.85rem;
}

/* Compact the corporate/gov tab switcher */
#dashboardGrid.initial-landing-mode .calc-main-tabs {
    margin-bottom: 0.5rem !important;
}

/* Compact search label + container */
#dashboardGrid.initial-landing-mode .search-container label {
    font-size: 0.72rem;
    margin-bottom: 0.3rem;
}
#dashboardGrid.initial-landing-mode .search-container {
    margin-bottom: 0 !important;
}
#dashboardGrid.initial-landing-mode .db-status-container {
    margin-top: 3px !important;
    font-size: 0.68rem !important;
}

/* Compact discovery cards */
#dashboardGrid.initial-landing-mode .discovery-card {
    padding: 0.65rem 0.75rem;
    gap: 0.35rem;
}
#dashboardGrid.initial-landing-mode .discovery-card-header {
    padding-bottom: 0.35rem;
}

/* Compact discovery items */
#dashboardGrid.initial-landing-mode .discovery-item {
    padding: 0.38rem 0.5rem;
    gap: 0.12rem;
}
#dashboardGrid.initial-landing-mode .discovery-item-name {
    font-size: 0.73rem;
}
#dashboardGrid.initial-landing-mode .discovery-item-isin {
    font-size: 0.64rem;
}
#dashboardGrid.initial-landing-mode .discovery-list {
    gap: 0.28rem;
    max-height: 300px;
}

/* Compact GOI type filter row */
#dashboardGrid.initial-landing-mode #goiTypeFilter {
    gap: 0.2rem !important;
    margin-bottom: 0.35rem !important;
}
#dashboardGrid.initial-landing-mode .disc-type-btn {
    padding: 0.18rem 0.4rem;
    font-size: 0.64rem;
}

/* Compact SDL state select */
#dashboardGrid.initial-landing-mode #sdlStateSelect {
    padding: 0.28rem 0.4rem !important;
    font-size: 0.72rem !important;
    margin-bottom: 0.35rem !important;
}

/* =========================================================
   RBAC UI Visibility: Hide developer bypass & admin override badge for viewers
   ========================================================= */
body.role-viewer .nsdl-override-container,
body.role-client .nsdl-override-container,
body.role-guest .nsdl-override-container,
body:not(.role-super-admin):not(.role-dealer) .nsdl-override-container {
    display: none !important;
}

/* =========================================================
   Mobile Navigation Drawer & Hamburger Menu
   ========================================================= */
.btn-mobile-menu {
    display: none; /* Desktop default: hidden */
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(19, 28, 50, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #ffffff;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-smooth);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 0;
    flex-shrink: 0;
    z-index: 101;
}

.btn-mobile-menu svg {
    display: block;
    width: 22px;
    height: 22px;
    stroke: #ffffff;
}

.btn-mobile-menu:hover,
.btn-mobile-menu:active {
    background: rgba(14, 165, 233, 0.25);
    border-color: rgba(56, 189, 248, 0.5);
    color: #ffffff;
    transform: scale(1.05);
}

body.mobile-menu-open {
    overflow: hidden !important;
    touch-action: none !important;
}

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 15, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease-smooth), visibility 0.3s var(--ease-smooth);
}

.mobile-menu-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 86vw);
    background: rgba(9, 14, 27, 0.88);
    backdrop-filter: blur(32px) saturate(190%);
    -webkit-backdrop-filter: blur(32px) saturate(190%);
    border-left: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: -12px 0 45px rgba(0, 0, 0, 0.85), inset 1px 0 0 rgba(224, 242, 254, 0.08);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: max(1.25rem, env(safe-area-inset-top)) 1.15rem max(1.5rem, env(safe-area-inset-bottom));
}

.mobile-menu-drawer.open {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
}

.mobile-menu-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.mobile-menu-brand .logo-icon {
    height: 32px;
    padding: 2px 6px;
    border-radius: 6px;
    background: #ffffff;
}

.mobile-menu-brand .logo-icon img {
    height: 22px;
}

.mobile-menu-brand-text h3 {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: #ffffff;
    line-height: 1.15;
    margin: 0;
}

.mobile-menu-brand-text p {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mobile-menu-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-smooth);
    touch-action: manipulation;
}

.mobile-menu-close-btn:hover,
.mobile-menu-close-btn:active {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.4);
    color: #fda4af;
    transform: scale(1.08);
}

/* User Card */
.mobile-menu-user-card {
    background: rgba(19, 28, 50, 0.45);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 0 rgba(224, 242, 254, 0.1);
    border-radius: var(--r-md);
    padding: 0.85rem;
    margin-bottom: 1.25rem;
}

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

.mm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-700) 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
    flex-shrink: 0;
}

.mm-user-details {
    flex: 1;
    min-width: 0;
}

.mm-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-user-email {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-badge-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.mm-role-badge {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.mm-guest-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.mm-btn-signin {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.75rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(2, 132, 199, 0.2) 100%);
    border: 1px solid rgba(14, 165, 233, 0.4);
    border-radius: var(--r-sm);
    color: var(--brand-300);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all var(--t-fast);
}

.mm-btn-signup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.75rem;
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid rgba(14, 165, 233, 0.35);
    border-radius: var(--r-sm);
    color: var(--brand-400);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all var(--t-fast);
}

.mm-user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mm-action-btn {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: var(--r-sm);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transition: all var(--t-fast);
}

.mm-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mm-btn-logout {
    color: #fda4af !important;
    background: rgba(244, 63, 94, 0.08) !important;
    border-color: rgba(244, 63, 94, 0.25) !important;
}

/* Navigation List */
.mobile-menu-section-label {
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.mobile-menu-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
}

.mobile-menu-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--t-fast) var(--ease-smooth);
    min-height: 52px;
    touch-action: manipulation;
}

.mobile-menu-nav-item:hover,
.mobile-menu-nav-item:active {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.3);
    transform: translateX(3px);
}

.mobile-menu-nav-item.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(12, 74, 110, 0.2) 100%);
    border: 1px solid rgba(14, 165, 233, 0.45);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.15);
}

.mm-nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-400);
    flex-shrink: 0;
}

.mobile-menu-nav-item.active .mm-nav-icon {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.4);
}

.mm-nav-text {
    flex: 1;
    min-width: 0;
}

.mm-nav-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.mm-nav-desc {
    font-size: 0.67rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-active-pill {
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    background: rgba(14, 165, 233, 0.25);
    color: var(--brand-200);
    border: 1px solid rgba(14, 165, 233, 0.4);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.mm-nav-chevron {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.6;
}

/* Tools Section */
.mobile-menu-tools {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.mm-tool-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--r-sm);
    background: rgba(19, 28, 50, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all var(--t-fast);
    text-decoration: none;
    touch-action: manipulation;
    font-family: inherit;
    width: 100%;
}

.mm-tool-item:hover,
.mm-tool-item:active {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(56, 189, 248, 0.35);
    color: var(--brand-300);
}

/* Footer */
.mobile-menu-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.mm-footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #34d399;
    font-weight: 600;
}

/* ==========================================================================
   Investor Category Selector for Tax-Free Dual-Coupon Bonds
   ========================================================================== */
.investor-category-group {
    background: rgba(19, 28, 50, 0.52);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 0.6rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(224, 242, 254, 0.08);
}

.investor-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 6px;
}

.tax-free-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.investor-btn-toggle-wrap {
    display: flex;
    gap: 6px;
}

.btn-category-toggle {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(5, 8, 17, 0.5);
    color: var(--text-secondary, #d3dfe4);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-category-toggle:hover {
    border-color: var(--brand-400);
    color: #fff;
    background: rgba(14, 165, 233, 0.14);
}

.btn-category-toggle.active {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    border-color: var(--brand-400);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
}

.btn-category-toggle .badge-rate {
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.72rem;
}

/* =========================================================
   Profit Calculator Layout & Styles
   ========================================================= */
.profit-calculator-grid {
    grid-template-columns: 1.25fr 1fr !important;
}

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

.trade-legs-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .trade-legs-container {
        grid-template-columns: 1fr;
    }
}

.trade-leg-card {
    background: rgba(10, 16, 31, 0.56);
    backdrop-filter: blur(20px) saturate(170%);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: inset 0 1px 0 rgba(224, 242, 254, 0.12);
    border-radius: var(--r-md);
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.buy-leg-card {
    border-color: rgba(14, 165, 233, 0.35);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.08), inset 0 1px 0 rgba(224, 242, 254, 0.12);
}

.sell-leg-card {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08), inset 0 1px 0 rgba(224, 242, 254, 0.12);
}

.buy-leg-card:hover {
    border-color: rgba(56, 189, 248, 0.6);
}

.sell-leg-card:hover {
    border-color: rgba(234, 179, 8, 0.6);
}

.leg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding-bottom: 0.55rem;
    margin-bottom: 0.75rem;
}

.leg-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.leg-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.buy-badge {
    background: rgba(14, 165, 233, 0.18);
    color: var(--brand-300);
    border: 1px solid rgba(14, 165, 233, 0.4);
}

.sell-badge {
    background: rgba(245, 158, 11, 0.18);
    color: var(--amberaccent-400);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.leg-total-outflow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-300);
}

.leg-total-inflow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--amberaccent-400);
}

.leg-mini-summary {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px dashed rgba(148, 163, 184, 0.14);
    font-size: 0.76rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--text-muted);
}

.leg-mini-summary div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leg-mini-summary strong {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 600;
}

.accent-buy {
    color: var(--brand-300) !important;
}

.accent-sell {
    color: var(--amberaccent-400) !important;
}

/* Custom Security Form */
.custom-security-form {
    background: rgba(10, 16, 31, 0.64);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: var(--r-md);
    padding: 0.9rem;
    margin-top: 0.85rem;
    margin-bottom: 0.85rem;
}

/* Profit Metric Cards */
.page-profit-calculator .profit-metrics-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.65rem !important;
}

@media (max-width: 900px) {
    .page-profit-calculator .profit-metrics-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.stat-card-profit {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(5, 150, 105, 0.16) 100%) !important;
    border-color: rgba(52, 211, 153, 0.4) !important;
}

.stat-card-profit.pnl-loss {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.22) 0%, rgba(244, 63, 94, 0.15) 100%) !important;
    border-color: rgba(244, 63, 94, 0.4) !important;
}

.stat-card-profit .stat-value {
    background: linear-gradient(120deg, #34d399 20%, #6ee7b7 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.stat-card-profit.pnl-loss .stat-value {
    background: linear-gradient(120deg, var(--logo-crimson) 20%, #f87171 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.stat-card-spread {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.12) 100%) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}

.comparison-table td strong {
    font-family: var(--font-mono);
}

/* Profit Calculator Input Sizing & Dropdown Positioning */
.profit-calculator-grid .input-card {
    overflow: visible !important;
    z-index: 25;
}

.profit-calculator-grid .search-top-bar {
    position: relative;
    z-index: 30;
}

.profit-calculator-grid .mode-input-card .input-wrapper input {
    font-size: 1.25rem !important;
    letter-spacing: -0.01em !important;
}

.profit-calculator-grid .mode-input-card .input-wrapper .input-prefix,
.profit-calculator-grid .mode-input-card .input-wrapper .input-suffix {
    font-size: 1.15rem !important;
}

.profit-calculator-grid .search-dropdown {
    max-height: 380px !important;
    z-index: 1050 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(14, 165, 233, 0.35) !important;
}

@media (min-width: 640px) {
    .profit-calculator-grid .search-dropdown {
        width: max(100%, 440px) !important;
        right: 0 !important;
        left: auto !important;
        max-width: calc(100vw - 2.5rem) !important;
    }
}

.profit-calculator-grid .search-item.highlighted,
.profit-calculator-grid .search-item:hover {
    background: rgba(14, 165, 233, 0.16) !important;
}

/* =========================================================
   Bulk ISIN Importer & B2B Quote Cards Studio
   ========================================================= */
.row-listing-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.12s ease, opacity 0.15s ease;
}
.row-listing-pill.listed {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}
.row-listing-pill.unlisted {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}
.row-listing-pill.gov {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(14, 165, 233, 0.35);
    color: #38bdf8;
    cursor: default;
}
.row-listing-pill:hover {
    opacity: 0.9;
}

.btn-quote-cards {
    border-color: rgba(16, 185, 129, 0.38) !important;
    background: rgba(16, 185, 129, 0.12) !important;
    color: #6ee7b7 !important;
}
.btn-quote-cards:hover {
    background: rgba(16, 185, 129, 0.22) !important;
    border-color: rgba(52, 211, 153, 0.6) !important;
    color: #ecfdf5 !important;
}

.tp-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tp-modal-dialog {
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(155deg, rgba(19, 28, 50, 0.96) 0%, rgba(10, 16, 31, 0.98) 100%);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(224, 242, 254, 0.14);
    overflow: hidden;
}

.tp-modal-cards-studio {
    max-width: 1080px;
    height: 88vh;
}

.tp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.tp-modal-close {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.24);
    color: var(--text-primary);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tp-modal-close:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.45);
    color: #fda4af;
}

.tp-modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
}

.tp-modal-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 0.75rem;
}

.tp-modal-controls-grid select,
.tp-studio-sidebar select,
.tp-studio-sidebar input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(5, 8, 17, 0.65);
    color: var(--text-primary);
    font-size: 0.82rem;
}

#bulkIsinTextarea {
    width: 100%;
    min-height: 150px;
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: rgba(5, 8, 17, 0.75);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.5;
    resize: vertical;
}

.tp-link-btn {
    background: none;
    border: none;
    color: var(--brand-300);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.tp-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(5, 8, 17, 0.45);
}

.tp-studio-layout {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 280px 1fr;
}

@media (max-width: 820px) {
    .tp-studio-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .tp-studio-sidebar {
        max-height: 220px;
        border-right: none !important;
        border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    }
}

.tp-studio-sidebar {
    padding: 1rem;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.tp-studio-sidebar .form-group {
    margin-bottom: 0;
}

.tp-studio-sidebar label {
    font-size: 0.72rem;
    margin-bottom: 0.28rem;
}

.tp-studio-preview-pane {
    padding: 1.15rem;
    overflow-y: auto;
    background: rgba(5, 8, 17, 0.65);
}

.qc-preview-stage {
    display: flex;
    justify-content: center;
}

/* Quote Cards Preview Theme Rules */
.qc-sheet {
    width: 100%;
    max-width: 720px;
    padding: 14px;
    border-radius: 12px;
}
.qc-sheet.mode-mobile {
    max-width: 400px;
}
.qc-sheet.theme-emerald {
    background: #eef5f1;
    color: #121519;
}
.qc-sheet.theme-obsidian {
    background: #070d1c;
    color: #f8fafc;
}

.qc-sheet .qc-section-banner {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.48rem 0.85rem;
    border-radius: 8px;
    margin: 0.9rem 0 0.65rem 0;
}
.qc-sheet .qc-section-banner:first-child {
    margin-top: 0;
}
.qc-sheet.theme-emerald .qc-section-banner {
    background: #d6f5e3;
    border: 1px solid #b0eacc;
    color: #0e5a30;
}
.qc-sheet.theme-obsidian .qc-section-banner {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.22), rgba(16, 185, 129, 0.2));
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
}

.qc-sheet .qc-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.qc-sheet.mode-mobile .qc-cards-grid {
    grid-template-columns: 1fr;
}
@media (max-width: 640px) {
    .qc-sheet .qc-cards-grid {
        grid-template-columns: 1fr;
    }
}

.qc-sheet .qc-card {
    border-radius: 12px;
    padding: 0.85rem 1rem;
}
.qc-sheet.theme-emerald .qc-card {
    background: #ffffff;
    border: 1px solid #d3e5dc;
    box-shadow: 0 2px 8px rgba(13, 113, 56, 0.06);
}
.qc-sheet.theme-obsidian .qc-card {
    background: linear-gradient(155deg, rgba(19, 28, 50, 0.96), rgba(10, 16, 31, 0.98));
    border: 1px solid rgba(56, 189, 248, 0.24);
}

.qc-sheet .qc-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.qc-sheet .qc-counter {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #64748b;
    text-transform: uppercase;
}
.qc-sheet.theme-obsidian .qc-counter { color: #94a3b8; }

.qc-sheet .qc-rating-pill {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.62rem;
    border-radius: 999px;
    color: #ffffff;
    background: #0f9d58;
    white-space: nowrap;
}
.qc-sheet.theme-obsidian .qc-rating-pill { background: #0ea5e9; }

.qc-sheet .qc-issuer-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}
.qc-sheet .qc-monogram {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.qc-sheet.theme-emerald .qc-monogram {
    background: #eefbf3;
    border: 1px solid #b0eacc;
    color: #0d7138;
}
.qc-sheet.theme-obsidian .qc-monogram {
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

.qc-sheet .qc-issuer-meta { min-width: 0; flex: 1; }
.qc-sheet .qc-issuer-name {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.28;
    word-break: break-word;
}
.qc-sheet .qc-isin {
    font-size: 0.66rem;
    font-family: var(--font-mono);
    color: #64748b;
    margin-top: 2px;
}
.qc-sheet.theme-obsidian .qc-isin { color: #94a3b8; }

.qc-sheet .qc-ytm-hero {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0.2rem 0 0.55rem 0;
}
.qc-sheet.theme-emerald .qc-ytm-hero { color: #0e1a14; }
.qc-sheet.theme-obsidian .qc-ytm-hero { color: #38bdf8; }

.qc-sheet .qc-terms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.75rem;
    padding: 0.55rem 0;
    border-top: 1px solid #e7eff2;
    border-bottom: 1px solid #e7eff2;
}
.qc-sheet.theme-obsidian .qc-terms-grid {
    border-color: rgba(148, 163, 184, 0.18);
}

.qc-sheet .qc-term-cell { display: flex; flex-direction: column; gap: 1px; }
.qc-sheet .qc-term-lbl { font-size: 0.62rem; color: #64748b; }
.qc-sheet.theme-obsidian .qc-term-lbl { color: #94a3b8; }
.qc-sheet .qc-term-val { font-size: 0.75rem; font-weight: 700; }

.qc-sheet .qc-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.5rem;
    margin-top: 0.6rem;
}
.qc-sheet .qc-perks {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.66rem;
    line-height: 1.5;
}
.qc-sheet .qc-perks li::before {
    content: "✓ ";
    color: #0e8e44;
    font-weight: 800;
}
.qc-sheet.theme-obsidian .qc-perks li::before { color: #34d399; }

.qc-sheet .qc-inquire-btn {
    background: #0e8e44;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.42rem 0.95rem;
    border-radius: 999px;
    white-space: nowrap;
}
.qc-sheet.theme-obsidian .qc-inquire-btn { background: #0ea5e9; }

.qc-sheet .qc-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.68rem;
    font-weight: 600;
}
.qc-sheet.theme-emerald .qc-footer-bar {
    background: #ffffff;
    border: 1px solid #d3e5dc;
    color: #475569;
}
.qc-sheet.theme-obsidian .qc-footer-bar {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #94a3b8;
}
.qc-sheet .qc-footer-count {
    font-weight: 700;
    color: #0e8e44;
}
.qc-sheet.theme-obsidian .qc-footer-count { color: #34d399; }





