/**
 * Kajarbi 54 Institute Dashboard Styles
 * The Digital Federation: Control Room
 */

/* ================================
   CSS Variables
   ================================ */
:root {
    --inst-bg-primary: #0d0d1a;
    --inst-bg-secondary: #1a1a2e;
    --inst-bg-tertiary: #16213e;
    --inst-border: #2d2d44;
    --inst-gold: #c9a227;
    --inst-gold-light: #d4af37;
    --inst-gold-dark: #b8942a;
    --inst-blue: #4a9eff;
    --inst-blue-dark: #1e3a5f;
    --inst-text-primary: #ffffff;
    --inst-text-secondary: #a0a0a0;
    --inst-text-muted: #666666;
    --inst-success: #4ade80;
    --inst-warning: #fbbf24;
    --inst-danger: #ef4444;
    --inst-chart-bar: #3b82f6;
}

/* ================================
   Dashboard Container
   ================================ */
.institute-dashboard {
    min-height: 100vh;
    background: var(--inst-bg-primary);
    color: var(--inst-text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    position: relative;
}

/* ================================
   Dashboard Header
   ================================ */
.dashboard-header {
    grid-column: 1 / -1;
    background: var(--inst-bg-secondary);
    border-bottom: 1px solid var(--inst-border);
    padding: 16px 24px;
}

.dashboard-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

.dashboard-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-prefix {
    font-size: 12px;
    color: var(--inst-text-secondary);
    font-weight: 400;
}

.title-main {
    color: var(--inst-text-primary);
}

.settings-btn {
    background: transparent;
    border: 1px solid var(--inst-border);
    border-radius: 8px;
    padding: 8px;
    color: var(--inst-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    color: var(--inst-gold);
    border-color: var(--inst-gold);
}

/* ================================
   Dashboard Main Content
   ================================ */
.dashboard-main {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 70px);
}

/* ================================
   Section Base Styles
   ================================ */
.dashboard-section {
    background: var(--inst-bg-secondary);
    border: 1px solid var(--inst-border);
    border-radius: 12px;
    padding: 20px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--inst-text-secondary);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    text-align: center;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-progress {
    background: var(--inst-gold);
    color: var(--inst-bg-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
}

/* ================================
   Comparative Mirror Section
   ================================ */
.comparative-mirror {
    padding: 24px;
}

.mirror-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 24px;
}

.gdp-panel {
    position: relative;
}

.gdp-chart-container {
    height: 220px;
    position: relative;
}

.gdp-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 16px;
    text-align: center;
}

.gdp-label {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--inst-text-secondary);
    text-transform: uppercase;
}

.gdp-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--inst-gold);
    margin-top: 4px;
}

/* GDP Tooltip */
.gdp-tooltip {
    position: absolute;
    background: var(--inst-bg-tertiary);
    border: 1px solid var(--inst-gold);
    border-radius: 8px;
    padding: 12px 16px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    min-width: 180px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.gdp-tooltip.active {
    display: flex;
}

.tooltip-country {
    font-weight: 600;
    color: var(--inst-text-primary);
    font-size: 14px;
}

.tooltip-value {
    color: var(--inst-gold);
    font-size: 18px;
    font-weight: 700;
}

.tooltip-percent {
    color: var(--inst-text-secondary);
    font-size: 12px;
}

/* Comparison Slideshow - Flickity */
.comparison-carousel {
    width: 100%;
    overflow: hidden;
}

.comparison-carousel .carousel-cell {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.comparison-bar {
    width: 100%;
    height: 200px;
    border-radius: 4px 4px 0 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.25) 100%);
    pointer-events: none;
    z-index: 1;
}

.flag-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.flag-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 15px;
}

.china-bar {
    background: #DD998F;
}

.usa-bar {
    background: #E394A5;
}

.europe-bar {
    background: #819bd0;
}

/* Responsive flag sizes */
@media (max-width: 768px) {
    .comparison-bar {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .comparison-bar {
        height: 120px;
    }
}

/* Flickity Page Dots */
.comparison-carousel .flickity-page-dots {
    bottom: -10px;
}

.comparison-carousel .flickity-page-dots .dot {
    width: 10px;
    height: 10px;
    background: var(--inst-text-muted);
    opacity: 1;
}

.comparison-carousel .flickity-page-dots .dot.is-selected {
    background: var(--inst-gold);
}

.flickity-prev-next-button.previous {
  left: 0px;
}

.flickity-prev-next-button.next {
  right: 0px;
}

/* Hide Flickity prev/next buttons */
.comparison-carousel .flickity-button {
    padding: 0;
    width: 30px;
    height: 30px;
    bottom:10px;
    top: auto;
}

/* Simulate Unity Button */
.simulate-unity-container {
    display: flex;
    justify-content: center;
}

.simulate-unity-btn {
    background: transparent;
    border: 2px solid var(--inst-text-secondary);
    color: var(--inst-text-primary);
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.simulate-unity-btn:hover {
    border-color: var(--inst-gold);
    color: var(--inst-gold);
    box-shadow: 0 0 20px rgba(201, 162, 39, 0.3);
}

/* ================================
   Middle Row Layout
   ================================ */
.middle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ================================
   The Future Lab
   ================================ */
.future-lab-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---- Afro Currency Section ---- */
.afro-currency-section {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    border: 1px solid var(--inst-gold);
    border-radius: 12px;
    padding: 1.5rem;
}

.afro-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.afro-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--inst-gold);
    margin: 0 0 0.5rem 0;
    letter-spacing: 2px;
}

.afro-tagline {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Flickity Afro Slider */
.afro-slider {
    margin-bottom: 1rem;
}

.afro-slider .flickity-viewport {
    overflow: hidden;
}

.afro-slider .carousel-cell {
    width: 100%;
    padding: 0 10px;
}

.afro-note-card {
    background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 100%);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.afro-note-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
}

.afro-note-img {
    width: 100%;
    max-width: 360px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    display: block;
    margin: 0 auto;
}

.afro-denomination {
    margin-top: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--inst-gold);
    letter-spacing: 1px;
}

/* Slider Navigation */
.afro-slider-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.afro-nav-btn {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--inst-gold);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--inst-gold);
    flex-shrink: 0;
}

.afro-nav-btn:hover {
    background: var(--inst-gold);
    color: #000;
}

.afro-dots {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.afro-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.afro-dot.active,
.afro-dot:hover {
    background: var(--inst-gold);
    transform: scale(1.3);
}

/* Note Info (inside each carousel cell) */
.afro-note-info {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.afro-note-info .info-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--inst-gold);
    margin: 0 0 0.5rem 0;
}

.afro-note-info .info-figures {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 0.5rem 0;
    font-style: italic;
}

.afro-note-info .info-description {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.6;
}

.afro-slider .flickity-button{
    padding: 0;
}
.afro-slider .flickity-button.previous {
    left: -40px;
}
.afro-slider .flickity-button.next {
    right: -40px;
}
/* Afro Actions */
.afro-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.afro-converter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--inst-gold) 0%, #b8860b 100%);
    color: #000;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-sizing: border-box;
}

.afro-converter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

.gold-price-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.gold-price-display .gold-label {
    color: rgba(255, 255, 255, 0.5);
}

.gold-price-display .gold-value {
    color: var(--inst-gold);
    font-weight: 600;
}

.gold-price-display .afro-value {
    color: rgba(255, 255, 255, 0.9);
    padding-left: 0.5rem;
}

/* ---- Afro Converter Modal ---- */
.afro-converter-modal .modal-content {
    max-width: 520px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.converter-header {
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 1.5rem;
}

.converter-header .modal-title {
    color: var(--inst-gold);
    font-size: 1.4rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.converter-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin: 0;
}

.converter-input-group {
    margin-bottom: 1rem;
}

.converter-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.converter-input-row {
    display: flex;
    gap: 0.75rem;
}

.converter-select {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    -webkit-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='%23d4af37' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.converter-select:focus {
    outline: none;
    border-color: var(--inst-gold);
}

.converter-select option {
    background: #1a1a1a;
    color: #fff;
}

.converter-amount {
    width: 130px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
}

.converter-amount:focus {
    outline: none;
    border-color: var(--inst-gold);
}

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

.converter-swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--inst-gold);
    border-radius: 50%;
    color: var(--inst-gold);
    cursor: pointer;
    transition: all 0.4s ease;
}

.converter-swap-btn:hover {
    background: var(--inst-gold);
    color: #000;
    transform: rotate(180deg);
}

.afro-result {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    border: 2px solid var(--inst-gold) !important;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.afro-result-icon {
    width: 50px;
    height: 50px;
    background: var(--inst-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.afro-symbol {
    font-size: 1.75rem;
    font-weight: 700;
    color: #000;
}

.afro-result-value {
    flex: 1;
}

.result-amount {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--inst-gold);
    line-height: 1;
}

.result-currency {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.conversion-breakdown {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.25rem;
}

.breakdown-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.breakdown-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.breakdown-step {
    text-align: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    min-width: 70px;
}

.breakdown-step.highlight {
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--inst-gold);
}

.breakdown-step .step-label {
    display: block;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.breakdown-step .step-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.breakdown-step.highlight .step-value {
    color: var(--inst-gold);
}

.breakdown-arrow {
    color: var(--inst-gold);
    font-size: 1.2rem;
}

.breakdown-note {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 1rem 0 0 0;
    font-style: italic;
}

.converter-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

.rate-info {
    text-align: center;
    font-size: 0.75rem;
}

.rate-info .rate-label {
    color: rgba(255, 255, 255, 0.5);
}

.rate-info .rate-value {
    color: var(--inst-gold);
    font-weight: 600;
    margin-left: 0.25rem;
}

.converter-cta {
    text-align: center;
    padding-top: 1rem;
}

.cta-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 0.5rem 0;
}

.cta-link {
    color: var(--inst-gold);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.cta-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Rail Map Toggle */
.rail-map-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--inst-bg-tertiary);
    border: 1px solid var(--inst-border);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--inst-text-secondary);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--inst-gold);
    border-color: var(--inst-gold);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: var(--inst-bg-primary);
}

.toggle-label {
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--inst-text-secondary);
}

/* ================================
   Solutionist Library
   ================================ */
.library-content {
    max-height: 400px;
    overflow-y: auto;
}

.library-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: var(--inst-text-primary);
    margin: 0 0 16px 0;
}

/* Document Type Tabs */
.library-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--inst-border);
    padding-bottom: 12px;
}

.library-tab {
    padding: 0px 16px;
    background: var(--inst-bg-tertiary);
    border: 1px solid var(--inst-border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--inst-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.library-tab:hover {
    background: rgba(201, 162, 39, 0.1);
    border-color: rgba(201, 162, 39, 0.3);
    color: var(--inst-text-primary);
}

.library-tab.active {
    background: var(--inst-gold);
    border-color: var(--inst-gold);
    color: #000;
    font-weight: 600;
}

.library-tab-panels {
    position: relative;
}

.library-tab-content {
    display: none;
}

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

.blueprints-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.blueprint-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: var(--inst-bg-tertiary);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.blueprint-item:hover {
    background: rgba(201, 162, 39, 0.08);
    border-color: rgba(201, 162, 39, 0.3);
}

.blueprint-item.is-read {
    border-left: 3px solid var(--inst-gold);
}

.blueprint-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.blueprint-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--inst-text-primary);
    margin: 0;
    line-height: 1.3;
}

.blueprint-title a {
    color: inherit;
    text-decoration: none;
}

.blueprint-title a:hover {
    color: var(--inst-gold);
}

.blueprint-impact {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--inst-gold);
    white-space: nowrap;
}

.blueprint-impact svg {
    fill: var(--inst-gold);
}

.blueprint-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.blueprint-category {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    background: rgba(201, 162, 39, 0.15);
    color: var(--inst-gold);
    border-radius: 4px;
}

.blueprint-summary {
    font-size: 12px;
    line-height: 1.5;
    color: var(--inst-text-secondary);
    margin: 0;
}

.blueprint-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.blueprint-status {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
}

.blueprint-status.status-draft {
    background: rgba(156, 163, 175, 0.2);
    color: #9CA3AF;
}

.blueprint-status.status-proposed {
    background: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
}

.blueprint-status.status-under_review {
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
}

.blueprint-status.status-piloting {
    background: rgba(139, 92, 246, 0.2);
    color: #A78BFA;
}

.blueprint-status.status-implemented {
    background: rgba(16, 185, 129, 0.2);
    color: #34D399;
}

.blueprint-status.locked {
    background: var(--inst-bg-primary);
    color: var(--inst-text-muted);
}

.blueprint-status.read {
    background: rgba(201, 162, 39, 0.2);
    color: var(--inst-gold);
    cursor: pointer;
}

.blueprint-actions {
    display: flex;
    gap: 8px;
}

.blueprint-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--inst-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.blueprint-action:hover {
    background: var(--inst-gold);
    color: var(--inst-bg-primary);
}

.blueprint-action svg {
    width: 14px;
    height: 14px;
}

.library-footer {
    margin-top: 16px;
    text-align: center;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--inst-gold);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.view-all-link:hover {
    opacity: 0.8;
}

.no-blueprints {
    padding: 24px;
    text-align: center;
    color: var(--inst-text-secondary);
}

.no-blueprints p {
    margin: 0;
    font-size: 13px;
}

/* ================================
   Ambassador Network & Unity Leaderboard (v2)
   ================================ */

/* Scrolling Ticker Bar */
.lb-ticker-bar {
    overflow: hidden;
    background: rgba(34, 197, 94, 0.08);
    border-bottom: 1px solid rgba(34, 197, 94, 0.18);
    padding: 8px 0;
    position: relative;
}

.lb-ticker-track {
    display: flex;
    gap: 40px;
    white-space: nowrap;
    animation: tickerScroll 30s linear infinite;
    width: max-content;
}

.lb-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.ticker-flag {
    font-size: 16px;
    line-height: 1;
}

.ticker-name {
    color: var(--inst-text-primary);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.ticker-pct {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 11px;
}

.ticker-up .ticker-pct {
    color: #22c55e;
}

.ticker-down .ticker-pct {
    color: #ef4444;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Main Layout: Table + Sidebar */
.lb-main-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
    min-height: 440px;
}

/* Left: Table Panel */
.lb-table-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--inst-border);
}

.lb-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--inst-border);
    flex-wrap: wrap;
    gap: 10px;
}

.lb-table-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--inst-gold);
    margin: 0;
}

.lb-table-title span {
    color: var(--inst-text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Tabs */
.lb-tabs {
    display: flex;
    gap: 0;
}

.lb-tab {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--inst-border);
    border-radius: 6px;
    color: var(--inst-text-secondary);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    white-space: nowrap;
}

.lb-tab:hover {
    color: var(--inst-text-primary);
    background: rgba(201, 162, 39, 0.06);
    border-color: rgba(201, 162, 39, 0.2);
}

.lb-tab.active {
    color: var(--inst-gold);
    background: rgba(201, 162, 39, 0.1);
    border-color: rgba(201, 162, 39, 0.3);
}

/* Tab Content */
.lb-tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

/* Leaderboard Table */
.lb-table-wrap {
    min-width: 600px;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.lb-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.lb-table thead tr {
    background: rgba(255, 255, 255, 0.02);
}

.lb-table th {
    padding: 10px 12px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--inst-text-secondary);
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid var(--inst-border);
    white-space: nowrap;
}

.lb-th-rank { width: 56px; text-align: center; }
.lb-th-country { min-width: 130px; }
.lb-th-score { min-width: 130px; }
.lb-th-regional { width: 90px; text-align: center; }
.lb-th-trend { width: 100px; text-align: center; }
.lb-th-surge { width: 90px; text-align: center; }
.lb-th-active { width: 90px; text-align: center; }

/* Table Rows */
.lb-row {
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.lb-row:hover {
    background: rgba(201, 162, 39, 0.04);
}

.lb-row-top {
    border-left: 3px solid #22c55e;
}

.lb-row-rank-1 {
    background: rgba(34, 197, 94, 0.06);
}

.lb-row-rank-2 {
    background: rgba(34, 197, 94, 0.04);
}

.lb-row-rank-3 {
    background: rgba(34, 197, 94, 0.02);
}

.lb-row td {
    padding: 10px 12px;
    vertical-align: middle;
}

/* Rank Cell */
.lb-cell-rank {
    text-align: center;
}

.lb-rank-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--inst-text-secondary);
    font-variant-numeric: tabular-nums;
}

.lb-rank-highlight {
    font-size: 18px;
    font-weight: 800;
    color: var(--inst-text-primary);
}

/* Country Cell */
.lb-cell-country {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-c-flag {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.lb-c-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--inst-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Score Cell */
.lb-cell-score {
    white-space: nowrap;
}

.lb-score-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--inst-gold);
    font-variant-numeric: tabular-nums;
    margin-right: 6px;
}

.lb-score-pct {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

.lb-score-pct.pct-up {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

.lb-score-pct.pct-down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

/* Regional Rank Cell */
.lb-cell-regional {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--inst-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Trend / Sparkline Cell */
.lb-cell-trend {
    text-align: center;
}

.lb-sparkline {
    display: inline-block;
    width: 80px;
    height: 24px;
}

.lb-sparkline svg {
    width: 100%;
    height: 100%;
}

/* Surge Context Cell */
.lb-cell-surge {
    text-align: center;
}

.lb-surge-icon {
    font-size: 14px;
    cursor: default;
    margin: 0 2px;
}

.lb-surge-none {
    color: var(--inst-text-secondary);
    font-size: 12px;
}

/* Active Users Cell */
.lb-cell-active {
    text-align: center;
}

.lb-active-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--inst-blue);
    font-variant-numeric: tabular-nums;
}

/* ================================
   Most Active Citizens Tab
   ================================ */
.lb-active-header {
    padding: 14px 20px 8px;
}

.lb-active-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--inst-text-primary);
    margin: 0;
}

.lb-active-title span {
    color: var(--inst-text-secondary);
    font-weight: 400;
    font-size: 10px;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.lb-active-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 0;
}

.lb-active-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background 0.15s ease;
}

.lb-active-card:hover {
    background: rgba(201, 162, 39, 0.04);
}

.lb-active-top {
    border-left: 3px solid #22c55e;
}

.lb-active-rank-flag {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lb-active-rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--inst-text-secondary);
    font-variant-numeric: tabular-nums;
    width: 24px;
    text-align: center;
}

.lb-active-flag {
    font-size: 22px;
    line-height: 1;
}

.lb-active-info {
    flex: 1;
    min-width: 0;
}

.lb-active-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--inst-text-primary);
    margin-bottom: 4px;
}

.lb-active-bar-wrap {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.lb-active-val {
    text-align: right;
    flex-shrink: 0;
}

.lb-active-num {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--inst-blue);
    font-variant-numeric: tabular-nums;
}

.lb-active-label {
    display: block;
    font-size: 9px;
    color: var(--inst-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================
   Top Ambassadors Tab
   ================================ */
.lb-region-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 0;
}

.lb-region-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    transition: background 0.15s ease;
}

.lb-region-card:hover {
    background: rgba(34, 197, 94, 0.04);
}

.lb-region-top {
    border-left: 3px solid #22c55e;
}

.lb-region-rank-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lb-region-rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--inst-text-secondary);
    font-variant-numeric: tabular-nums;
    width: 24px;
    text-align: center;
}

.lb-region-icon {
    font-size: 22px;
    line-height: 1;
}

.lb-region-info {
    flex: 1;
    min-width: 0;
}

.lb-region-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--inst-text-primary);
    margin-bottom: 4px;
}

.lb-region-bar-wrap {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.lb-region-stats {
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.lb-region-amb-count {
    font-size: 16px;
    font-weight: 700;
    color: #22c55e;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.lb-region-amb-label {
    font-size: 9px;
    color: var(--inst-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lb-region-total {
    font-size: 10px;
    color: var(--inst-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Shared bar fill */
.lb-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--inst-gold), #d4af37);
    border-radius: 2px;
    transition: width 0.6s ease;
    min-width: 2px;
}

.lb-bar-fill.lb-bar-green {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

/* ================================
   Right Sidebar Cards
   ================================ */
.lb-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 16px;
}

/* Country of the Month Card */
.lb-cotm-card {
    background: rgba(201, 162, 39, 0.06);
    border: 1px solid rgba(201, 162, 39, 0.25);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.lb-cotm-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 8px;
}

.lb-cotm-crown {
    font-size: 18px;
    line-height: 1;
}

.lb-cotm-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--inst-gold);
    text-transform: uppercase;
}

.lb-cotm-body {
    padding: 4px 16px 12px;
}

.lb-cotm-country {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.lb-cotm-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--inst-text-primary);
    letter-spacing: 1px;
}

.lb-cotm-flag {
    font-size: 28px;
    line-height: 1;
}

.lb-cotm-desc {
    display: block;
    font-size: 11px;
    color: var(--inst-text-secondary);
    font-style: italic;
}

.lb-cotm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(201, 162, 39, 0.06);
    border-top: 1px solid rgba(201, 162, 39, 0.15);
}

.lb-cotm-pts-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.lb-cotm-pts-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--inst-gold);
    font-variant-numeric: tabular-nums;
}

.lb-cotm-pts-unit {
    font-size: 10px;
    font-weight: 700;
    color: var(--inst-gold);
    opacity: 0.7;
    letter-spacing: 1px;
}

.lb-cotm-engagement {
    font-size: 11px;
    font-weight: 700;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.lb-cotm-empty .lb-cotm-body {
    padding: 16px;
    text-align: center;
}

/* Your National Contribution Card */
.lb-contribution-card {
    background: rgba(74, 158, 255, 0.06);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.lb-contrib-header {
    padding: 10px 16px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--inst-blue);
    text-transform: uppercase;
    border-bottom: 1px solid rgba(74, 158, 255, 0.1);
}

.lb-contrib-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.lb-contrib-avatar {
    flex-shrink: 0;
}

.lb-contrib-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--inst-blue);
}

.lb-contrib-info {
    flex: 1;
    min-width: 0;
}

.lb-contrib-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--inst-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-contrib-country {
    font-weight: 400;
    color: var(--inst-text-secondary);
    font-size: 11px;
}

.lb-contrib-pts {
    display: block;
    font-size: 11px;
    color: var(--inst-blue);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

.lb-contrib-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid rgba(74, 158, 255, 0.1);
    border-bottom: 1px solid rgba(74, 158, 255, 0.1);
}

.lb-contrib-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
}

.lb-contrib-stat:not(:last-child) {
    border-right: 1px solid rgba(74, 158, 255, 0.1);
}

.lb-contrib-stat-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--inst-text-primary);
    font-variant-numeric: tabular-nums;
}

.lb-contrib-stat-label {
    font-size: 9px;
    color: var(--inst-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.lb-contrib-progress {
    padding: 10px 16px 12px;
}

.lb-contrib-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.lb-contrib-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--inst-blue), #60a5fa);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.lb-contrib-progress-label {
    font-size: 10px;
    color: var(--inst-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Empty State */
.lb-empty {
    padding: 32px 20px;
    text-align: center;
}

.lb-empty p {
    font-size: 12px;
    color: var(--inst-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Scrollbar inside tab content */
.lb-tab-content::-webkit-scrollbar {
    width: 4px;
}

.lb-tab-content::-webkit-scrollbar-track {
    background: transparent;
}

.lb-tab-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.lb-tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ================================
   Jobs Portal (Full Width)
   ================================ */
.jobs-portal-section {
    margin-top: 0;
}

.jobs-portal.full-width {
    background: var(--inst-bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--inst-border);
}

.jobs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--inst-border);
}

.jobs-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--inst-text-primary);
    margin: 0;
}

.jobs-view-all {
    font-size: 12px;
    color: var(--inst-gold);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: opacity 0.2s ease;
}

.jobs-view-all:hover {
    opacity: 0.8;
    color: var(--inst-gold);
    text-decoration: none;
}

.jobs-list {
    list-style: none;
    padding: 8px 16px 16px;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.job-item {
    background: var(--inst-bg-secondary);
    border: 1px solid var(--inst-border);
    border-radius: 10px;
    transition: all 0.25s ease;
    overflow: hidden;
}

.job-item:hover {
    background: rgba(201, 162, 39, 0.06);
    border-color: var(--inst-gold);
    transform: translateY(-2px);
}

.job-item-link {
    display: block;
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
}

.job-item-link:hover {
    text-decoration: none;
    color: inherit;
}

.job-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.job-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--inst-text-primary);
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.job-type-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--inst-gold);
    background: rgba(201, 162, 39, 0.12);
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.job-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.job-org {
    font-size: 12px;
    color: var(--inst-text-secondary);
    margin: 0;
    font-weight: 500;
}

.job-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--inst-text-secondary);
}

.job-location svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.jobs-empty-state {
    text-align: center;
    padding: 32px 24px;
    color: var(--inst-text-secondary);
    font-size: 13px;
}

.jobs-empty-state p {
    margin: 0;
}

/* ================================
   #My54Story Section
   ================================ */
.my54-stories-section {
    margin-top: 0;
}

.my54-stories-header {
    padding: 20px 24px 0;
}

.my54-stories-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.my54-stories-title-row .section-title {
    margin: 0;
}

.my54-stories-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.my54-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--inst-gold);
    color: #0d0d1a;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.my54-share-btn:hover {
    background: #d4af37;
    color: #0d0d1a;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

.my54-view-all {
    font-size: 12px;
    color: var(--inst-gold);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: opacity 0.2s ease;
}

.my54-view-all:hover {
    opacity: 0.8;
    color: var(--inst-gold);
    text-decoration: none;
}

.my54-stats-bar {
    display: flex;
    gap: 32px;
    padding: 14px 0;
    border-bottom: 1px solid var(--inst-border);
}

.my54-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.my54-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--inst-gold);
    font-variant-numeric: tabular-nums;
}

.my54-stat-label {
    font-size: 11px;
    color: var(--inst-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Stories Grid */
.my54-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px 24px 24px;
}

.my54-story-card {
    background: var(--inst-bg-secondary);
    border: 1px solid var(--inst-border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.my54-story-card:hover {
    border-color: rgba(201, 162, 39, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.my54-story-card.my54-featured {
    border-color: rgba(201, 162, 39, 0.3);
    box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.1);
}

.my54-card-image {
    display: block;
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.my54-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.my54-story-card:hover .my54-card-image img {
    transform: scale(1.05);
}

.my54-card-image.my54-no-image {
    height: 40px;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0.02));
}

.my54-featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(13, 13, 26, 0.85);
    color: var(--inst-gold);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.my54-card-body {
    padding: 16px;
}

.my54-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.my54-category {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--inst-gold);
    background: rgba(201, 162, 39, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.my54-mood {
    font-size: 14px;
    line-height: 1;
}

.my54-card-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.my54-card-title a {
    color: var(--inst-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.my54-card-title a:hover {
    color: var(--inst-gold);
}

.my54-card-excerpt {
    font-size: 13px;
    color: var(--inst-text-secondary);
    line-height: 1.5;
    margin: 0 0 14px 0;
}

.my54-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--inst-border);
}

.my54-author {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.my54-author-name {
    font-size: 12px;
    color: var(--inst-text-primary);
    font-weight: 500;
}

.my54-country {
    font-size: 11px;
    color: var(--inst-text-secondary);
}

.my54-card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.my54-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--inst-text-secondary);
}

.my54-likes svg {
    color: var(--inst-text-secondary);
}

.my54-time {
    font-size: 11px;
    color: var(--inst-text-secondary);
}

/* Empty State */
.my54-empty-state {
    text-align: center;
    padding: 40px 24px;
    color: var(--inst-text-secondary);
    font-size: 14px;
}

.my54-empty-state p {
    margin: 0 0 16px 0;
}

/* ================================
   Social Feed
   ================================ */
.social-feed {
    padding: 12px 20px;
    background: var(--inst-bg-tertiary);
}

.feed-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.feed-icon {
    color: var(--inst-text-secondary);
}

.feed-hashtag {
    color: var(--inst-blue);
    font-weight: 600;
}

.feed-text {
    color: var(--inst-text-primary);
    text-decoration: none;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.feed-text:hover {
    color: var(--inst-gold);
}

.feed-author {
    color: var(--inst-blue);
}

/* ================================
   Wire Archive Sidebar
   ================================ */
.wire-archive-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
}

.sidebar-toggle {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: var(--inst-gold);
    color: var(--inst-bg-primary);
    border: none;
    padding: 16px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
}

.sidebar-content {
    display: none;
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--inst-bg-secondary);
    border: 1px solid var(--inst-border);
    border-radius: 8px 0 0 8px;
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
}

.wire-archive-sidebar.open .sidebar-content {
    display: block;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--inst-text-primary);
}

.archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.archive-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--inst-border);
}

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

/* ================================
   Modals
   ================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    background: var(--inst-bg-secondary);
    border: 1px solid var(--inst-border);
    border-radius: 16px;
    padding: 32px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--inst-text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--inst-text-primary);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 24px 0;
    color: var(--inst-text-primary);
}

/* Unity Simulation */
.unity-simulation {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 32px;
}

.unity-chart-container {
    height: 300px;
}

.unity-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.unity-stat {
    background: var(--inst-bg-tertiary);
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--inst-text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--inst-gold);
}

/* Rail Map Modal — Full-screen Trident Network */
.rail-map-modal .modal-overlay {
    background: rgba(0, 0, 0, 0.95);
}

.rail-modal-content {
    display: flex !important;
    flex-direction: row;
    max-width: 100vw !important;
    width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh;
    border-radius: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden;
}

.rail-modal-content .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #555;
    color: #fff;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: 0.3s;
    padding: 0;
}

.rail-modal-content .modal-close:hover {
    background: var(--inst-gold);
    color: #000;
    border-color: var(--inst-gold);
}

/* Rail Sidebar */
.rail-sidebar {
    width: 360px;
    min-width: 360px;
    height: 100vh;
    background: #1A1A1A;
    padding: 24px;
    box-sizing: border-box;
    border-right: 1px solid #333;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.9);
}

.rail-sidebar-title {
    color: var(--inst-gold);
    font-size: 1.4rem;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid #444;
    padding-bottom: 10px;
}

.rail-sidebar-subtitle {
    font-size: 0.75rem;
    color: #888;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Rail Control Panels */
.rail-control-panel {
    background: #111;
    padding: 18px;
    border-radius: 6px;
    border: 1px solid #333;
    margin-bottom: 18px;
}

.rail-control-panel h3 {
    margin: 0 0 14px 0;
    font-size: 0.85rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rail-control-panel label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.7rem;
    color: var(--inst-gold);
    letter-spacing: 1px;
}

.rail-toggle-btn {
    width: 100%;
    padding: 0px;
    margin-bottom: 10px;
    background: transparent;
    color: #E0E0E0;
    border: 1px solid #007BFF;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
    height: auto;
}

.rail-toggle-btn:last-of-type {
    margin-bottom: 0;
}

.rail-toggle-btn.active {
    background: #007BFF;
    color: #fff;
    font-weight: bold;
}

.rail-select {
    width: 100%;
    padding: 10px;
    margin-bottom: 16px;
    background: #222;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

.rail-calc-btn {
    width: 100%;
    padding: 0px;
    background: var(--inst-gold);
    color: #000;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    transition: 0.3s;
    font-family: inherit;
    box-sizing: border-box;
}

.rail-calc-btn:hover {
    background: #fff;
    box-shadow: 0 0 10px var(--inst-gold);
}

.rail-result {
    margin-top: 16px;
    padding: 14px;
    background: rgba(0, 255, 51, 0.08);
    border-left: 4px solid #00FF33;
    font-size: 0.8rem;
    display: none;
    line-height: 1.7;
    border-radius: 0 4px 4px 0;
    color: #E0E0E0;
}

.rail-result.visible {
    display: block;
}

/* Rail Legend */
.rail-legend {
    margin-top: auto;
    padding-top: 16px;
}

.rail-legend h3 {
    margin: 0 0 14px 0;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.rail-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.75rem;
    color: #E0E0E0;
}

.rail-legend-color {
    width: 24px;
    height: 4px;
    margin-right: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.rail-legend-dashed {
    background: repeating-linear-gradient(
        90deg,
        #007BFF 0px,
        #007BFF 4px,
        transparent 4px,
        transparent 8px
    ) !important;
}

/* Rail Map Container — fills remaining space */
.rail-map-container {
    flex: 1;
    height: 100vh;
    min-height: 500px;
    background: #121212;
}

/* Leaflet Overrides for Rail Map */
.rail-map-container .leaflet-popup-content-wrapper {
    background: #111;
    color: #fff;
    border: 1px solid var(--inst-gold);
    border-radius: 4px;
    font-family: monospace;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.rail-map-container .leaflet-popup-tip {
    background: #111;
    border: 1px solid var(--inst-gold);
}

.rail-popup-header {
    color: var(--inst-gold);
    font-weight: bold;
    font-size: 1rem;
    border-bottom: 1px dashed #444;
    padding-bottom: 5px;
    margin-bottom: 8px;
}

.rail-popup-data span {
    color: #00C853;
    font-weight: bold;
}

/* Rail Animations */
.ghost-rail {
    pointer-events: none !important;
}

.animated-main {
    stroke-dasharray: 15 20 !important;
    animation: railFlow 1.0s linear infinite;
}

.animated-sub {
    stroke-dasharray: 6 10 !important;
    animation: railFlow 2.5s linear infinite;
}

@keyframes railFlow {
    to {
        stroke-dashoffset: -50;
    }
}

/* Rail Map Responsive */
@media (max-width: 900px) {
    .rail-modal-content {
        flex-direction: column;
    }

    .rail-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .rail-map-container {
        height: 60vh;
    }
}

/* ================================
   Responsive Styles
   ================================ */
@media (max-width: 1200px) {
    .mirror-content {
        grid-template-columns: 1fr;
    }
    
    .middle-row {
        grid-template-columns: 1fr;
    }
    
    .unity-simulation {
        grid-template-columns: 1fr;
    }
    
    .jobs-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .my54-stories-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    /* Ambassador & Leaderboard v2 */
    .lb-main-layout {
        grid-template-columns: 1fr;
    }
    
    .lb-table-panel {
        border-right: none;
        border-bottom: 1px solid var(--inst-border);
    }
    
    .lb-sidebar {
        flex-direction: row;
        gap: 12px;
    }
    
    .lb-cotm-card,
    .lb-contribution-card {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .dashboard-main {
        padding: 16px;
    }
    
    .dashboard-title {
        font-size: 14px;
    }
    
    .gdp-value {
        font-size: 22px;
    }
    
    /* My54 Stories Responsive */
    .my54-stories-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .my54-stats-bar {
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .my54-stat-value {
        font-size: 16px;
    }
    
    .my54-stories-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .my54-stories-header {
        padding: 16px 16px 0;
    }
    
    /* Ambassador & Leaderboard v2 Responsive */
    .lb-table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lb-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .lb-sidebar {
        flex-direction: column;
        padding: 12px;
    }
    
    .lb-cotm-card,
    .lb-contribution-card {
        flex: auto;
    }
    
    .lb-contrib-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Afro Section Responsive */
    .afro-currency-section {
        padding: 1rem;
    }
    
    .afro-title {
        font-size: 1.2rem;
    }
    
    .afro-note-img {
        max-width: 260px;
    }
    
    .afro-actions {
        flex-direction: column;
        text-align: center;
    }
    
    .afro-converter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .gold-price-display {
        justify-content: center;
    }
    
    .converter-input-row {
        flex-direction: column;
    }
    
    .converter-amount {
        width: 100%;
        text-align: left;
    }
    
    .breakdown-steps {
        flex-direction: column;
    }
    
    .breakdown-arrow {
        transform: rotate(90deg);
    }
    
    .breakdown-step {
        width: 100%;
    }
    
    .result-amount {
        font-size: 1.5rem;
    }
    
    .converter-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ================================
   Scrollbar Styling
   ================================ */
.institute-dashboard ::-webkit-scrollbar {
    width: 6px;
}

.institute-dashboard ::-webkit-scrollbar-track {
    background: var(--inst-bg-primary);
}

.institute-dashboard ::-webkit-scrollbar-thumb {
    background: var(--inst-border);
    border-radius: 3px;
}

.institute-dashboard ::-webkit-scrollbar-thumb:hover {
    background: var(--inst-gold);
}

canvas{
    max-width: 100% !important;
    width: 100% !important;
}