/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Inter for Latin, Heebo for Hebrew. Browser picks per codepoint;
       'system-ui' is the safety net before the webfont loads. */
    font-family: 'Inter', 'Heebo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    line-height: 1.6;
    color: #333;
}

.emoji {
    font-size: 1.5em;
}

/* ===== NAVIGATION STYLES ===== */
.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid #fff;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
}

.nav-brand .brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    transition: opacity 0.3s;
}

.nav-brand .brand-link:hover {
    opacity: 0.8;
    text-decoration: none;
    color: white;
}

.brand-icon {
    font-size: 1.8em;
    margin-right: 10px;
}

.brand-text {
    font-family: 'Inter', 'Heebo', sans-serif;
    letter-spacing: .5px;
    /* Lightened from 700 → 500 in the across-the-board sweep. The
       brand sizing already gives presence; the heavier weight made
       it feel shouty. */
    font-weight: 500;
}
.nav-brand .brand-link .brand-text.brand-en {
    font-size: .6em !important;
    letter-spacing: .3px;
    white-space: nowrap !important;
    line-height: 1;
    word-break: keep-all;
    overflow: visible;
}
.social-icons {
    display: flex;
    gap: 10px;
}

.social-icons a {
    color: white;
    font-size: 20px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: #ff4081; /* optional hover effect */
}
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0;
    flex-wrap: nowrap;
    align-items: center;
}

.nav-item {
    margin: 0;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding: 15px 12px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 2px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: bold;
}

.nav-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

.nav-toggle {
    display: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 10px;
}

/* ===== MAIN CONTENT STYLES ===== */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HERO/WELCOME SECTIONS ===== */
.hero-section, .welcome-section {
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    color: white;
    text-align: center;
    padding: 60px 20px 40px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-section h1, .welcome-section h1 {
    font-size: 3.5em;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-section p, .welcome-section p {
    font-size: 1.3em;
    margin: 0;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== CARD STYLES ===== */
.content-card {
    background: white;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    margin-bottom: 20px;
}

.content-card:hover {
    transform: translateY(-5px);
}

.content-card h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #000000;
    padding-bottom: 10px;
    display: block;
}

.content-card p {
    color: #555;
    font-size: 1.1em;
    margin-bottom: 15px;
}

html[dir="rtl"] .content-card h2,
html[dir="rtl"] .content-card p {
    text-align: right;
    direction: rtl;
}

html[dir="ltr"] .content-card h2,
html[dir="ltr"] .content-card p {
    text-align: left;
    direction: ltr;
    unicode-bidi: normal;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.full-width-card {
    grid-column: 1 / -1;
}

/* ===== SKILLS SECTION ===== */
.skills-section {
    background: linear-gradient(135deg, #2c3e50, #000000);
    color: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 40px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.skill-category {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.skill-category h4 {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    color: #fff;
}

.skill-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-list li:last-child {
    border-bottom: none;
}

.skill-level {
    background: rgba(255, 255, 255, 0.3);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
}

/* ===== TIMELINE STYLES ===== */
.timeline-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #2c3e50, #000000);
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 40px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2c3e50;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #2c3e50;
}

.timeline-item.current::before {
    background: #000000;
    box-shadow: 0 0 0 3px #000000;
}

.timeline-date {
    color: #2c3e50;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.timeline-title {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: bold;
}

.timeline-description {
    color: #555;
    line-height: 1.6;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
    background: linear-gradient(135deg, #2c3e50, #000000);
    color: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
}

.contact-section h2 {
    margin-bottom: 20px;
    font-size: 2.2em;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
}

/* ===== HIGHLIGHT STYLES ===== */
.highlight {
    background: linear-gradient(120deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2px 6px;
    border-radius: 4px;
    color: #2c3e50;
    font-weight: bold;
    border: 1px solid #dee2e6;
}

/* ===== BUTTON STYLES ===== */
.btn { 
    background-color: #2c3e50; 
    color: white; 
    padding: 12px 30px; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 16px;
    margin-right: 10px;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover { 
    background-color: #000000;
    text-decoration: none;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* ===== LINK STYLES ===== */
.back-link {
    text-decoration: none;
    color: #2c3e50;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
    color: #000000;
}

/* ===== FORM STYLES ===== */
.form-group { 
    margin-bottom: 20px; 
}

label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: bold; 
    color: #555;
}

input[type="text"], textarea { 
    width: 100%; 
    padding: 12px; 
    border: 2px solid #ddd; 
    border-radius: 6px; 
    font-size: 16px;
    box-sizing: border-box;
}

input[type="text"]:focus, textarea:focus {
    border-color: #2c3e50;
    outline: none;
}

textarea {
    height: 200px;
    resize: vertical;
    font-family: inherit;
}

/* ===== MESSAGE STYLES ===== */
.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* ===== FOOTER STYLES ===== */
.site-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    color: white;
    margin-top: 50px;
    padding: 40px 0 20px 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid #ffffff;
    padding-bottom: 5px;
    display: inline-block;
}
.footer-section h4.footer-brand-en {
    font-size: .95em;
    letter-spacing: .5px;
    white-space: nowrap;
}

.footer-section p {
    margin-bottom: 8px;
    color: #bdc3c7;
    line-height: 1.5;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.progress-item {
    margin-bottom: 10px;
}

.progress-item span {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #bdc3c7;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #34495e;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffffff, #bdc3c7);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: 0.9em;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .hero-section h1, .welcome-section h1 {
        font-size: 2.5em;
    }
    
    .hero-section, .welcome-section {
        padding: 50px 20px;
    }
    
    .content-card {
        padding: 25px;
    }
    
    .skills-section {
        padding: 25px;
    }
    
    .timeline-section {
        padding: 25px;
    }
    
    .contact-info {
        gap: 20px;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    /* Mobile Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        transition: left 0.3s ease;
        padding-top: 50px;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        padding: 20px;
        font-size: 1.2em;
        width: 80%;
        text-align: center;
        margin: 10px 0;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .brand-text {
        display: none;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .site-footer {
        padding: 30px 0 15px 0;
    }
    .hebrew-heading {
    direction: rtl;
    text-align: right;
    }
}

/* ============================================================
   ACCESSIBILITY (תפריט נגישות)
   ============================================================ */

/* Font scale — applied via JS. Base bumped from 16px → 17.5px on 2026-05-06
   for global readability ("make writing bigger across the entire website").
   The accessibility menu's font-size slider multiplies on top via the CSS var. */
html { font-size: calc(17.5px * var(--a11y-font-scale, 1)); }

/* High contrast — body + menus + chrome.
   The chrome bars (platform bar, realm navbar, admin nav, footer, modals,
   chat bubble) all have their own backgrounds defined inline or in
   component-local styles, so the html-level `filter:contrast(150%)`
   doesn't change their appearance enough to read as "high contrast".
   Force black bg + white text + yellow links on every common chrome
   surface explicitly so the mode actually delivers what it advertises. */
html.a11y-high-contrast {
    filter: contrast(150%);
}
html.a11y-high-contrast body {
    background: #000 !important;
    color: #fff !important;
}
html.a11y-high-contrast a { color: #ffff00 !important; }

/* Public-site chrome */
html.a11y-high-contrast .platform-bar,
html.a11y-high-contrast .navbar,
html.a11y-high-contrast .nav-menu,
html.a11y-high-contrast .nav-link,
html.a11y-high-contrast .pb-link,
html.a11y-high-contrast .pb-brand,
html.a11y-high-contrast footer,
html.a11y-high-contrast .footer {
    background: #000 !important;
    color: #fff !important;
    border-color: #ffff00 !important;
}
html.a11y-high-contrast .pb-brand,
html.a11y-high-contrast .nav-link.active,
html.a11y-high-contrast .pb-link:hover,
html.a11y-high-contrast .nav-link:hover {
    color: #ffff00 !important;
}

/* Admin chrome */
html.a11y-high-contrast .admin-nav,
html.a11y-high-contrast .admin-nav a,
html.a11y-high-contrast .admin-header,
html.a11y-high-contrast .wallet-tabs,
html.a11y-high-contrast .wallet-tab,
html.a11y-high-contrast .council-bar,
html.a11y-high-contrast .council-pill {
    background: #000 !important;
    color: #fff !important;
    border-color: #ffff00 !important;
}
html.a11y-high-contrast .admin-nav a:hover,
html.a11y-high-contrast .wallet-tab.active,
html.a11y-high-contrast .council-pill.active {
    color: #ffff00 !important;
    background: #1a1a1a !important;
}

/* Cards + content surfaces */
html.a11y-high-contrast .section-card,
html.a11y-high-contrast .add-card,
html.a11y-high-contrast .stock-table,
html.a11y-high-contrast .stock-table th,
html.a11y-high-contrast .stock-table td,
html.a11y-high-contrast .news-card,
html.a11y-high-contrast .takes-card,
html.a11y-high-contrast .news-row,
html.a11y-high-contrast .takes-ticker,
html.a11y-high-contrast .hub-card,
html.a11y-high-contrast .stat-card,
html.a11y-high-contrast .agent-suggest,
html.a11y-high-contrast .agent-chip,
html.a11y-high-contrast .future-card,
html.a11y-high-contrast .alert,
html.a11y-high-contrast .container,
html.a11y-high-contrast .main-content {
    background: #000 !important;
    color: #fff !important;
    border-color: #ffff00 !important;
}
html.a11y-high-contrast input,
html.a11y-high-contrast select,
html.a11y-high-contrast textarea,
html.a11y-high-contrast button {
    background: #000 !important;
    color: #fff !important;
    border: 1px solid #ffff00 !important;
}

/* Chat bubble + accessibility FAB stay branded so they remain
   recognizable; high-contrast still bumps their contrast via the
   html-level filter. */

/* Invert + grayscale — the html-level filter cascades to most children,
   but `position:fixed` ancestors create a containing block that can
   escape the filter in some browsers. Force the same effect on the
   common fixed/sticky chrome so the page reads cohesively. */
html.a11y-invert    { filter: invert(100%) hue-rotate(180deg); }
html.a11y-invert .platform-bar,
html.a11y-invert .navbar,
html.a11y-invert .admin-nav,
html.a11y-invert .elesh-chat,
html.a11y-invert #a11y-fab,
html.a11y-invert #a11y-panel {
    filter: invert(100%) hue-rotate(180deg);
}

html.a11y-grayscale { filter: grayscale(100%); }
html.a11y-grayscale .platform-bar,
html.a11y-grayscale .navbar,
html.a11y-grayscale .admin-nav,
html.a11y-grayscale .elesh-chat,
html.a11y-grayscale #a11y-fab,
html.a11y-grayscale #a11y-panel {
    filter: grayscale(100%);
}

/* Stop animations */
html.a11y-no-animations *, html.a11y-no-animations *::before, html.a11y-no-animations *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
}

/* Underline links */
html.a11y-underline-links a { text-decoration: underline !important; }

/* Large cursor */
html.a11y-large-cursor, html.a11y-large-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='8' cy='8' r='7' fill='black' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 8 8, auto !important; }

/* Readable font */
html.a11y-readable-font body, html.a11y-readable-font * { font-family: Arial, Helvetica, sans-serif !important; }

/* Accessibility FAB button */
#a11y-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9998;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #2c3e50;
    color: #fff;
    border: 2px solid #fff;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s, background .2s;
}
#a11y-fab:hover { background: #1a252f; transform: scale(1.08); }
#a11y-fab:focus { outline: 3px solid #f39c12; outline-offset: 2px; }

/* Accessibility panel */
#a11y-panel {
    position: fixed;
    bottom: 90px;
    left: 24px;
    z-index: 9999;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.28);
    border: 1px solid #ddd;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
    direction: rtl;
}
#a11y-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.a11y-header {
    background: linear-gradient(135deg, #2c3e50, #000);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
}
.a11y-close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 4px;
}
.a11y-close:hover { background: rgba(255,255,255,.15); }
.a11y-body { padding: 14px; }
.a11y-section-label { font-size: 0.8rem; font-weight: 500; color: #999; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; margin-top: 4px; }
.a11y-row { display: flex; gap: 8px; margin-bottom: 10px; }
.a11y-row.a11y-wrap { flex-wrap: wrap; }
.a11y-btn {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background .15s;
}
.a11y-btn:hover { background: #e9ecef; }
.a11y-toggle-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background .15s, border-color .15s;
    margin-bottom: 4px;
}
.a11y-toggle-btn.active { background: #2c3e50; color: #fff; border-color: #2c3e50; }
.a11y-toggle-btn:hover { background: #e9ecef; }
.a11y-toggle-btn.active:hover { background: #1a252f; }
.a11y-reset-all {
    width: 100%;
    padding: 8px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 4px;
}
.a11y-reset-all:hover { background: #c0392b; }
.a11y-footer-links { text-align: center; margin-top: 10px; font-size: 0.75rem; }
.a11y-footer-links a { color: #666; text-decoration: underline; }

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: rgba(20, 30, 40, 0.97);
    color: #e0e0e0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transform: translateY(100%);
    transition: transform .35s ease;
    direction: rtl;
    font-size: 0.88rem;
    border-top: 2px solid #2c3e50;
    flex-wrap: wrap;
}
#cookie-banner.visible { transform: translateY(0); }
.cookie-text { flex: 1; min-width: 200px; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}
.cookie-btn.accept { background: #27ae60; color: #fff; }
.cookie-btn.accept:hover { background: #219a52; }
.cookie-btn.decline { background: transparent; color: #aaa; border: 1px solid #555; }
.cookie-btn.decline:hover { background: #333; color: #fff; }

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
}
.lang-btn {
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,.3);
    background: transparent;
    color: #ccc;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background .15s, color .15s;
}
.lang-btn.active, .lang-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.lang-btn.active { border-color: rgba(255,255,255,.6); }

/* Lock the visual order of nav-container children so they never swap when
   language toggles between LTR and RTL (which flips flex-direction to
   row-reverse). With explicit `order`, the visual sequence is fixed:
   brand → menu → lang-switcher → admin-icon-box, in BOTH languages.
   So the padlock / cog / logout always sit on the right edge. */
.navbar .nav-brand        { order: 1; }
.navbar .nav-menu         { order: 2; }
.navbar .lang-toggle-wrap { order: 3; }
.navbar .admin-icon-box   { order: 4; }

/* ============================================================
   Chatbot widget — floating bubble + slide-up panel.
   See js/chatbot.js for the runtime; this file owns the visual.
   ============================================================ */
.elesh-chat {
  position: fixed;
  /* Pushes inward from the corner on big screens so the bubble doesn't sit
     flush against the edge — feels more anchored to the working area. */
  bottom: clamp(20px, 3vw, 56px);
  right:  clamp(20px, 3vw, 80px);
  z-index: 9999;
  font-family: inherit;
}
/* The chat bubble stays bottom-RIGHT in both LTR and RTL on purpose.
   The accessibility FAB lives at bottom-left (#a11y-fab in js/accessibility.js)
   so they sit at opposite corners and never collide regardless of language. */
.elesh-chat-bubble {
  /* Scales with viewport — the floor matches the prior 56px on small screens,
     the ceiling lets it breathe on a 1440p+ admin monitor. */
  width:  clamp(56px, 4.5vw, 84px);
  height: clamp(56px, 4.5vw, 84px);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #2c3e50, #000);
  color: #fff;
  font-size: clamp(24px, 2vw, 34px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.elesh-chat-bubble {
  cursor: grab;
  touch-action: none;     /* drag handler controls touch; default scroll would conflict */
}
.elesh-chat-bubble:hover {
  transform: translateY(-2px);
}
.elesh-chat.dragging .elesh-chat-bubble,
.elesh-chat-bubble:active {
  cursor: grabbing;
}
.elesh-chat.dragging { user-select: none; }
.elesh-chat.dragging .elesh-chat-bubble:hover {
  transform: none;        /* don't lift while dragging — feels jittery */
}
.elesh-chat-bubble-icon {
  pointer-events: none;
  line-height: 1;
}
.elesh-chat-panel {
  position: absolute;
  /* Sits a bubble-height + gap above the bubble. clamp tracks the bubble's
     own size cap so the gap looks consistent across viewport widths. */
  bottom: clamp(72px, 5vw + 16px, 100px);
  right: 0;
  /* Panel grows with screen real estate. Floor preserves the original 360x540
     mobile-friendly size; ceiling fills more of a big monitor without going
     full-screen. */
  width:  clamp(360px, 30vw, 520px);
  max-width: calc(100vw - 40px);
  height: clamp(540px, 70vh, 760px);
  max-height: calc(100vh - 140px);
  /* Dark theme — matches the McCrae intro popup so the chat reads as the
     same surface, just expanded. Gold border accents the agent persona. */
  background: #1a1a2e;
  color: #e7ecf3;
  border-radius: 14px;
  box-shadow: 0 18px 52px rgba(0,0,0,.55);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #c8a951;
}
/* Panel anchors to the bubble's right edge regardless of direction —
   the bubble itself doesn't flip in RTL (see comment above .elesh-chat). */
.elesh-chat-header {
  background: linear-gradient(135deg, #1a1a2e, #2c3e50);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(200,169,81,.18);
}
.elesh-chat-title {
  /* Lightened from 700 → 500 + bumped 15→16px in the across-the-board sweep. */
  font-weight: 500;
  font-size: 16px;
  flex: 1;
  color: #f5b301;   /* gold accent matches the popup header */
  letter-spacing: .01em;
}
.elesh-chat-close,
.elesh-chat-reset {
  background: rgba(255,255,255,0.10);
  border: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
  margin-inline-start: 6px;
}
.elesh-chat-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  padding: 0;
}
/* Reset is a labeled pill — wider than the close × so the word fits.
   Stays in the same row of the header by keeping height aligned to the
   close button. */
.elesh-chat-reset {
  height: 28px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 0 10px;
}
.elesh-chat-close:hover,
.elesh-chat-reset:hover {
  background: rgba(255,255,255,0.22);
}
.elesh-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #0f1420;   /* slightly darker than the panel for contrast */
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.elesh-chat-empty {
  color: rgba(231,236,243,.65);
  font-size: 13px;
  text-align: center;
  margin: auto;
  max-width: 260px;
  line-height: 1.55;
}
.elesh-chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.elesh-chat-msg-user {
  align-self: flex-end;
  /* Gold owner bubble — distinct from the agent's slate-grey replies and
     consistent with the popup's gold accents. */
  background: linear-gradient(135deg, #c8a951, #b8993e);
  color: #1a1a2e;
  font-weight: 500;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(200,169,81,.22);
}
.elesh-chat[dir="rtl"] .elesh-chat-msg-user {
  border-bottom-right-radius: 14px;
  border-bottom-left-radius: 4px;
}
.elesh-chat-msg-asst {
  align-self: flex-start;
  background: #232a3d;
  color: #e7ecf3;
  border: 1px solid rgba(255,255,255,.08);
  border-bottom-left-radius: 4px;
}
.elesh-chat-msg-asst a {
  color: #f5b301; text-decoration: underline;
}
.elesh-chat[dir="rtl"] .elesh-chat-msg-asst {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}
/* M-04 — privacy disclosure line; sits above the input form so a first-time
   visitor reads it before composing. Muted, small, single-line ellipsis on
   narrow widths so it doesn't dominate the panel. */
.elesh-chat-privacy {
  font-size: 11px;
  line-height: 1.45;
  color: rgba(231,236,243,.55);
  background: #0f1420;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 8px 12px;
  text-align: center;
}
.elesh-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: #1a1a2e;
}
.elesh-chat-input {
  flex: 1;
  resize: none;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  max-height: 120px;
  outline: none;
  background: #0f1420;
  color: #e7ecf3;
}
.elesh-chat-input::placeholder { color: rgba(231,236,243,.40); }
.elesh-chat-input:focus {
  border-color: #c8a951;
  box-shadow: 0 0 0 3px rgba(200,169,81,.18);
}
.elesh-chat-send {
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  /* Lightened from 700 → 500 in the across-the-board sweep. */
  font-weight: 500;
  cursor: pointer;
  background: linear-gradient(135deg, #c8a951, #b8993e);
  color: #1a1a2e;
  font-size: 14px;
}
.elesh-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.elesh-chat-mic {
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.elesh-chat-mic:hover { background: #f5f5f5; }
.elesh-chat-mic.listening {
  background: #e74c3c;
  color: #fff;
  border-color: #c0392b;
  animation: ab-mic-pulse 1.2s infinite;
}
@keyframes ab-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,.6); }
  50%      { box-shadow: 0 0 0 6px rgba(231,76,60,0); }
}
@media (max-width: 480px) {
  .elesh-chat-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
    bottom: 72px;
  }
}

/* ── Fullscreen "takeover" mode ──────────────────────────────────
   Triggered when window.eleshChat.openFullscreen() is called (e.g. the
   "+ Create routine" button on /admin/agent.jsp). The panel detaches from
   the bubble's anchor and centers on the viewport with a dimmed backdrop,
   so the user can converse with the agent without squinting at a 360px
   floating box. Press Enter on an empty input to fold back. */
.elesh-chat.elesh-chat-fullscreen {
  /* Wrapper stays fixed but stretches to cover the viewport so its
     ::before backdrop pseudo can sit behind the panel. The bubble
     within the wrapper is hidden in fullscreen mode. */
  position: fixed;
  inset: 0;
  bottom: auto;
  right:  auto;
  width:  100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.elesh-chat.elesh-chat-fullscreen::before {
  /* Dimming backdrop. Pointer-events:none so clicks fall through to the
     panel; clicking outside doesn't close — Enter-on-empty does. */
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  pointer-events: none;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-bubble {
  /* Bubble is no longer reachable in fullscreen; hide it so the visual
     center stays on the panel. */
  display: none;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-panel {
  /* Override the anchored absolute positioning. Fill 92% of the viewport
     centered, with the gold accent border preserved. */
  position: relative;
  bottom: auto;
  right:  auto;
  left:   auto;
  top:    auto;
  width:    min(92vw, 1100px);
  height:   min(92vh, 880px);
  max-width:  none;
  max-height: none;
  display: flex;
  box-shadow: 0 30px 80px rgba(0,0,0,.7);
  border-width: 2px;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-messages {
  /* Generous text size matches the takeover-the-screen framing — the
     fullscreen panel is for focus mode, no reason to keep widget-tier
     fonts. */
  padding: 26px 32px;
  font-size: 17px;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-msg {
  max-width: 72%;
  font-size: 17px;
  line-height: 1.65;
  padding: 14px 18px;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-empty {
  font-size: 16px;
  max-width: 420px;
  line-height: 1.6;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-input {
  font-size: 18px;
  padding: 14px 18px;
  min-height: 56px;
  line-height: 1.5;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-input::placeholder {
  font-size: 18px;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-form {
  padding: 16px 20px;
  gap: 10px;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-send {
  font-size: 16px;
  padding: 0 22px;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-mic {
  font-size: 20px;
  padding: 0 16px;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-header {
  padding: 20px 26px;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-title {
  font-size: 19px;
}
.elesh-chat.elesh-chat-fullscreen .elesh-chat-privacy {
  font-size: 13px;
  padding: 10px 16px;
}