/* ===========================
   THE SILVER VAULT — TRUE 3D CLAY
   Technique: Neumorphism + Organic terrain blobs
   Reference: 3D clay dashboard moodboard
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@400;600;700;800&family=Comfortaa:wght@600;700&display=swap');

/* ── PALETTE & TOKENS ───────────────────────────────────────────── */
:root {
    /* ---- Background base ---- */
    --bg:            #8EA89A;   /* mid sage for body */

    /* ---- Blob / terrain colors ---- */
    --blob-dk:       #3D5A4A;   /* darkest organic mass */
    --blob-md:       #4E6E5C;
    --blob-lt:       #5E8070;

    /* ---- Cards — near-white, very light so they "float" ---- */
    --card:          #F0EDE7;
    --card-inner:    #E6E2DB;   /* inner surfaces / input bg */
    --card-deep:     #D8D3CA;   /* deepest inset */

    /* ---- Clay accent ---- */
    --clay:          #C4845A;
    --clay-lt:       #D49E7E;
    --clay-dk:       #A26840;

    /* ---- Teal accent ---- */
    --teal:          #7AAAA0;
    --teal-dk:       #548A80;

    /* ---- Text ---- */
    --text:          #2C3028;
    --text-mid:      #4A5848;
    --text-muted:    rgba(44, 48, 40, 0.48);
    --text-light:    #F5F2EC;

    /* ---- Accents ---- */
    --purple:        #9880CC;
    --green:         #4AB882;

    /* ====================================================
       NEUMORPHIC SHADOW SYSTEM
       Rule: element bg == card bg → use two opposing shadows
             dark shadow bottom-right + light shadow top-left
       ==================================================== */

    /* Raised element on --card surface */
    --nm-raised:
        5px 5px 12px rgba(168, 148, 128, 0.55),
       -4px -4px 10px rgba(255, 255, 255, 0.92);

    /* Deeply raised / hover */
    --nm-raised-hover:
        7px 8px 18px rgba(168, 148, 128, 0.60),
       -4px -5px 13px rgba(255, 255, 255, 0.95);

    /* Inset / pressed / input well on --card surface */
    --nm-inset:
        inset 4px 4px 10px rgba(168, 148, 128, 0.52),
        inset -3px -3px 8px rgba(255, 255, 255, 0.88);

    /* Raised element on --card-inner surface */
    --nm-inner-raised:
        3px 3px 8px  rgba(155, 138, 118, 0.52),
       -2px -2px 6px rgba(255, 255, 255, 0.88);

    /* Inset on --card-inner */
    --nm-inner-inset:
        inset 3px 3px 8px  rgba(155, 138, 118, 0.50),
        inset -2px -2px 6px rgba(255, 255, 255, 0.85);

    /* Floating card above dark bg */
    --float-card:
        10px 14px 36px rgba(30, 48, 36, 0.55),
        -2px -3px 12px rgba(255, 255, 255, 0.22);

    --radius-sm:   10px;
    --radius-md:   18px;
    --radius-lg:   26px;
    --radius-xl:   34px;
    --radius-pill: 100px;
}

/* ── DARK MODE ──────────────────────────────────────────────────── */
body.dark-mode {
    --bg:            #181d19;
    --blob-dk:       #0c1110;
    --blob-md:       #141a15;
    --blob-lt:       #1c251e;

    --card:          #222c24;
    --card-inner:    #1a2219;
    --card-deep:     #141b14;

    --clay:          #b87550;
    --clay-lt:       #cc8f68;
    --clay-dk:       #9a5e38;

    --teal:          #5a8c82;
    --teal-dk:       #3e726a;

    --text:          #ddeadd;
    --text-mid:      #9db89e;
    --text-muted:    rgba(185, 215, 186, 0.42);
    --text-light:    #edf5ee;

    --purple:        #a896d8;

    --nm-raised:
        5px 5px 12px rgba(0, 0, 0, 0.60),
       -3px -3px 9px rgba(60, 90, 64, 0.22);
    --nm-raised-hover:
        7px 8px 18px rgba(0, 0, 0, 0.68),
       -4px -5px 12px rgba(60, 90, 64, 0.28);
    --nm-inset:
        inset 4px 4px 10px rgba(0, 0, 0, 0.55),
        inset -3px -3px 8px rgba(60, 90, 64, 0.18);
    --nm-inner-raised:
        3px 3px 8px rgba(0, 0, 0, 0.55),
       -2px -2px 6px rgba(60, 90, 64, 0.18);
    --nm-inner-inset:
        inset 3px 3px 8px rgba(0, 0, 0, 0.52),
        inset -2px -2px 6px rgba(60, 90, 64, 0.15);
    --float-card:
        10px 14px 36px rgba(0, 0, 0, 0.72),
        -2px -3px 12px rgba(60, 90, 64, 0.14);
}

body.dark-mode .dashboard-v2 {
    background: rgba(26, 36, 28, 0.96);
    border-color: rgba(80, 110, 82, 0.25);
}

body.dark-mode .section-screen-wrap {
    background: rgba(24, 32, 25, 0.97);
}

body.dark-mode .terminal-container {
    background: var(--card);
}

body.dark-mode .modal-overlay {
    background: rgba(5, 8, 5, 0.78);
}

body.dark-mode .pnl-table th {
    color: var(--text-mid);
}

body.dark-mode .row-delete-btn {
    background: #2e3a2e;
    color: var(--text-muted);
}

body.dark-mode .news-tag {
    background: rgba(180, 60, 60, 0.22);
    color: #e08888;
}

body.dark-mode .terminal-input {
    background: var(--card-inner);
    color: var(--text);
}

body.dark-mode .mr-d-modal {
    background: rgba(8, 12, 8, 0.72);
}

body.dark-mode .blob { opacity: 0.35; }

/* Dark mode active state for dark-mode-btn */
body.dark-mode #dark-mode-btn {
    background: var(--teal);
    color: var(--text-light);
}

/* Dark mode flash — opacity only (GPU composited, zero repaint cost) */
@keyframes darkModeFlash {
    from { opacity: 0.82; }
    to   { opacity: 1; }
}
.dark-mode-animating {
    animation: darkModeFlash 0.22s ease forwards;
}

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

/* ── BODY ───────────────────────────────────────────────────────── */
body {
    font-family: 'Assistant', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    position: relative;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Allow text selection only in inputs and chat */
input, textarea, .chat-messages, .chat-message {
    -webkit-user-select: text;
    user-select: text;
}

/* ── HIDE OLD ELEMENTS ──────────────────────────────────────────── */
.grid-background  { display: none; }
.matrix-container { display: none; }

/* ════════════════════════════════════════════
   3D CLAY TERRAIN BLOBS
   Each blob is an organic shape with a flat-top
   highlight + bottom shadow to sell the 3D hill look
   ════════════════════════════════════════════ */
.clay-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.blob {
    position: absolute;
    background: var(--blob-dk);
}

/* ---- BLOB 1: massive bottom-left mountain ---- */
.blob-1 {
    width: 85vw;
    height: 75vw;
    bottom: -38vw;
    left: -25vw;
    background: radial-gradient(ellipse at 45% 30%, var(--blob-md) 0%, var(--blob-dk) 55%, #2A3E30 100%);
    border-radius: 55% 45% 30% 70% / 60% 30% 70% 40%;
    box-shadow:
        0  30px 80px rgba(20, 38, 28, 0.70),   /* ground shadow */
        inset 0 -20px 60px rgba(20,38,28,0.35), /* inner bottom dark */
        inset 0  15px 40px rgba(110,160,130,0.25); /* top highlight */
    filter: blur(0.5px);
}

/* ---- BLOB 2: top-right terrain mass ---- */
.blob-2 {
    width: 65vw;
    height: 60vw;
    top: -28vw;
    right: -22vw;
    background: radial-gradient(ellipse at 50% 65%, var(--blob-md) 0%, var(--blob-dk) 55%, #2A3E30 100%);
    border-radius: 45% 55% 70% 30% / 40% 65% 35% 60%;
    box-shadow:
        0  20px 60px rgba(20, 38, 28, 0.60),
        inset 0 -15px 45px rgba(20,38,28,0.30),
        inset 0  12px 35px rgba(110,160,130,0.20);
    filter: blur(0.5px);
}

/* ---- BLOB 3: bottom-right secondary shape ---- */
.blob-3 {
    width: 55vw;
    height: 48vw;
    bottom: -22vw;
    right: -18vw;
    background: radial-gradient(ellipse at 40% 35%, var(--blob-lt) 0%, var(--blob-md) 50%, var(--blob-dk) 100%);
    border-radius: 65% 35% 50% 50% / 35% 55% 45% 65%;
    box-shadow:
        0  18px 50px rgba(20, 38, 28, 0.55),
        inset 0 -10px 35px rgba(20,38,28,0.28),
        inset 0  10px 28px rgba(110,160,130,0.18);
    filter: blur(0.8px);
}

/* ---- BLOB 4: mid-left accent ---- */
.blob-4 {
    width: 30vw;
    height: 30vw;
    top: 35%;
    left: -12vw;
    background: radial-gradient(ellipse at 55% 40%, var(--blob-lt) 0%, var(--blob-dk) 80%);
    border-radius: 50% 50% 65% 35% / 55% 45% 55% 45%;
    box-shadow:
        0 12px 35px rgba(20, 38, 28, 0.45),
        inset 0 8px 20px rgba(110,160,130,0.15);
    filter: blur(1px);
}

/* ---- BLOB 5: top-left small hill ---- */
.blob-5 {
    width: 28vw;
    height: 26vw;
    top: -10vw;
    left: 10%;
    background: radial-gradient(ellipse at 50% 60%, var(--blob-md) 0%, var(--blob-dk) 75%);
    border-radius: 40% 60% 55% 45% / 60% 40% 60% 40%;
    box-shadow:
        0 10px 28px rgba(20, 38, 28, 0.40),
        inset 0 6px 18px rgba(110,160,130,0.12);
    filter: blur(1px);
}

/* All content sits on top of blobs */
.screen,
.footer {
    position: relative;
    z-index: 1;
}

/* ── ANIMATIONS ─────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes fadeInDissolve {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
    0%, 49%  { opacity: 1; }
    50%, 100%{ opacity: 0.3; }
}

.fade-in-message { animation: fadeInDissolve 0.45s ease-out; }
.blink           { animation: blink 1.5s infinite; color: var(--clay); }

/* ── SCREEN ─────────────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; padding: 20px; padding-top: max(20px, calc(var(--tg-content-safe-area-inset-top, 0px) + 16px)); }
.screen.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    animation: screenFadeIn 0.35s ease forwards;
}
/* Login stays vertically centred */
#login-screen.active { align-items: center; }

/* Leaving screen — stays visible while fading out */
.screen.screen-leaving {
    display: flex !important;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
    animation: screenFadeOut 0.2s ease forwards;
}
#login-screen.screen-leaving { align-items: center; }

@keyframes screenFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes screenFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ════════════════════════════════════════════
   LOGIN — floating card above the terrain
   ════════════════════════════════════════════ */
.terminal-container {
    width: 90%;
    max-width: 400px;
    background: var(--card);
    border-radius: var(--radius-xl);
    box-shadow: var(--float-card);
    animation: fadeIn 0.55s ease;
    overflow: hidden;
}

/* Header strip — clay orange raised pill */
.terminal-header {
    background: var(--clay);
    color: var(--text-light);
    padding: 14px 24px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    letter-spacing: 0.5px;
    /* Neumorphic raised header on card */
    box-shadow:
        0 6px 16px rgba(140, 90, 50, 0.40),
        inset 0 2px 6px rgba(255,255,255,0.25),
        inset 0 -2px 6px rgba(100,50,20,0.20);
}

.terminal-body { padding: 28px 24px 32px; }

/* Title block — deep inset well */
.vault-title {
    text-align: center;
    margin-bottom: 24px;
    padding: 18px 12px;
    background: var(--card-inner);
    border-radius: var(--radius-md);
    box-shadow: var(--nm-inset);
}

.title-he {
    font-family: 'Comfortaa', sans-serif;
    font-size: 50px;
    font-weight: 700;
    color: var(--purple);
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.title-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.login-text { text-align: center; margin: 14px 0; }
.login-text p { font-size: 14px; color: var(--text-mid); margin: 4px 0; }
.access-text  { color: var(--text-mid); font-size: 16px; }

.input-group { margin: 20px 0; }
.input-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-mid);
    font-weight: 700;
    font-size: 13px;
}

/* Input — deep clay well */
.terminal-input {
    width: 100%;
    padding: 13px 16px;
    background: var(--card-inner);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Assistant', sans-serif;
    font-size: 15px;
    outline: none;
    box-shadow: var(--nm-inset);
    transition: box-shadow 0.2s;
    direction: rtl;
}
.terminal-input::placeholder { color: var(--text-muted); }
.terminal-input:focus {
    box-shadow:
        inset 5px 5px 12px rgba(168, 148, 128, 0.58),
        inset -3px -3px 8px rgba(255, 255, 255, 0.90),
        0 0 0 2px rgba(196, 132, 90, 0.28);
}

.error-msg { color: #B04040; margin-top: 6px; font-size: 13px; min-height: 16px; font-weight: 700; }

/* Raised clay pill button */
.neon-button {
    width: 100%;
    padding: 14px;
    background: var(--clay);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--text-light);
    font-family: 'Assistant', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    /* Clay pill 3D shadow */
    box-shadow:
        5px 6px 14px rgba(130, 80, 40, 0.45),
       -2px -2px 8px rgba(255, 200, 160, 0.35),
        inset 0 2px 5px rgba(255, 200, 160, 0.25),
        inset 0 -2px 5px rgba(100, 45, 15, 0.20);
}
.neon-button:hover {
    background: var(--clay-lt);
    box-shadow:
        7px 8px 18px rgba(130, 80, 40, 0.50),
       -3px -3px 10px rgba(255, 200, 160, 0.40),
        inset 0 2px 5px rgba(255, 210, 170, 0.30),
        inset 0 -2px 5px rgba(100, 45, 15, 0.15);
    transform: translateY(-2px);
}
.neon-button:active {
    transform: translateY(1px);
    box-shadow:
        2px 3px 8px rgba(130, 80, 40, 0.40),
        inset 3px 3px 8px rgba(100, 50, 20, 0.30),
        inset -2px -2px 6px rgba(255, 200, 160, 0.20);
    background: var(--clay-dk);
}

/* ════════════════════════════════════════════
   DASHBOARD
   ════════════════════════════════════════════ */
.dashboard-container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 20px;
}

/* Floating header card */
.dashboard-header {
    position: relative;
    text-align: center;
    margin-bottom: 16px;
    padding: 20px 22px 16px;
    padding-inline-start: 72px; /* leave breath next to top corner control on narrow screens */
    padding-inline-end: 72px;
    background: var(--card);
    border-radius: var(--radius-xl);
    box-shadow: var(--float-card);
}

/* איזור אישי — compact clay pill, top physical corner */
.personal-space-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    max-width: calc(100% - 24px);
    background: linear-gradient(145deg, var(--teal) 0%, var(--teal-dk) 100%);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-pill);
    font-family: 'Assistant', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2px;
    cursor: pointer;
    z-index: 2;
    box-shadow:
        4px 5px 12px rgba(60, 100, 92, 0.45),
       -2px -2px 8px rgba(255, 255, 255, 0.35),
        inset 0 1px 4px rgba(255, 255, 255, 0.22),
        inset 0 -2px 4px rgba(30, 72, 64, 0.35);
    transition: transform 0.18s, box-shadow 0.18s;
}
.personal-space-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        5px 7px 16px rgba(60, 100, 92, 0.50),
       -2px -3px 10px rgba(255, 255, 255, 0.4),
        inset 0 1px 4px rgba(255, 255, 255, 0.28);
}
.personal-space-btn:active {
    transform: translateY(1px);
}
.personal-space-btn-icon {
    font-size: 13px;
    line-height: 1;
    opacity: 0.95;
}
.personal-space-btn-label {
    white-space: nowrap;
}

@media (max-width: 380px) {
    .personal-space-btn-label {
        display: none;
    }
    .personal-space-btn {
        padding: 10px 12px;
    }
    .dashboard-header {
        padding-inline-start: 56px;
        padding-inline-end: 56px;
    }
}

.dashboard-title {
    font-family: 'Comfortaa', sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 1px;
    color: var(--purple);
    letter-spacing: 1.5px;
}

.status-text   { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.status-online { color: var(--green); font-weight: 800; }

/* ── PRICE BAR ──────────────────────────────────────────────────── */
.price-bar {
    background: var(--card);
    border-radius: var(--radius-pill);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--float-card);
}

.price-label { font-size: 13px; color: var(--text-mid); font-weight: 700; }

/* Price number — raised neumorphic pill ON the card */
.price-value {
    font-size: 22px;
    color: var(--green);
    font-weight: 800;
    font-family: 'Comfortaa', sans-serif;
    background: var(--card);
    padding: 4px 18px;
    border-radius: var(--radius-pill);
    box-shadow: var(--nm-raised);
}

.price-update { font-size: 11px; color: var(--text-muted); }

/* ── NAV TABS ───────────────────────────────────────────────────── */
.nav-menu {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Each tab: raised clay pill */
.nav-btn {
    flex: 1;
    min-width: 90px;
    padding: 13px 14px;
    background: var(--card);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--text-mid);
    font-family: 'Assistant', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--nm-raised);
    transition: all 0.18s;
}
.nav-btn:hover {
    box-shadow: var(--nm-raised-hover);
    transform: translateY(-2px);
}
/* Active tab: pressed in + clay orange tint */
.nav-btn.active {
    background: var(--clay);
    color: var(--text-light);
    box-shadow:
        inset 3px 3px 8px rgba(100, 50, 20, 0.35),
        inset -2px -2px 6px rgba(255, 190, 140, 0.25),
        0 4px 10px rgba(130, 70, 30, 0.35);
}

/* ── CONTENT PANEL ──────────────────────────────────────────────── */
.content-area {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 24px;
    min-height: 460px;
    box-shadow: var(--float-card);
}

.content-section { display: none; }
.content-section.active { display: block; animation: fadeIn 0.35s ease; }

.section-title {
    color: var(--text-mid);
    text-align: center;
    margin-bottom: 22px;
    font-size: 19px;
    font-weight: 800;
    font-family: 'Comfortaa', 'Assistant', sans-serif;
}

/* ── ARCHIVES ───────────────────────────────────────────────────── */
.search-bar { margin-bottom: 20px; }
.file-category { margin-bottom: 28px; }

.category-header {
    color: var(--clay-dk);
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--card-inner);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

/* File card: raised on the panel surface */
.file-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    box-shadow: var(--nm-raised);
    transition: all 0.2s;
}
.file-card:hover {
    box-shadow: var(--nm-raised-hover);
    transform: translateY(-4px);
}
.file-card:active {
    box-shadow: var(--nm-inset);
    transform: translateY(0);
}

.file-icon  { font-size: 38px; text-align: center; margin-bottom: 10px; color: var(--clay); position: relative; }
.yt-badge {
    display: inline-block;
    background: #ff0000;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 4px;
    letter-spacing: 0.04em;
}
.file-name  { color: var(--text); font-size: 13px; font-weight: 700; margin-bottom: 5px; word-break: break-word; }
.file-meta  { color: var(--text-muted); font-size: 11px; }
.loading    { text-align: center; color: var(--clay); font-size: 16px; padding: 40px; font-weight: 700; }

/* ── SILVER 101 GUIDE ───────────────────────────────────────────── */
.guide-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.guide-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 20px 18px;
    box-shadow: var(--nm-raised);
    transition: all 0.22s;
}
.guide-card:hover {
    box-shadow: var(--nm-raised-hover);
    transform: translateY(-4px);
}

.guide-card h3 {
    color: var(--clay-dk);
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 800;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--card-inner);
}
.guide-card p        { color: var(--text); line-height: 1.88; font-size: 13px; }
.guide-card p strong { color: var(--clay-dk); font-weight: 700; }

@media (max-width: 768px) {
    .guide-content { grid-template-columns: 1fr; gap: 12px; }
    .guide-card    { padding: 16px 14px; }
}

/* ── CHAT ───────────────────────────────────────────────────────── */
.chat-container { display: flex; flex-direction: column; height: 500px; }

/* Chat window: deep inset well in the panel */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: var(--card-inner);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    direction: rtl;
    text-align: right;
    box-shadow: var(--nm-inset);
}

/* Scroll bar styling */
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--card-deep); border-radius: 10px; }

/* Chat bubbles: raised on the inset surface */
.chat-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    direction: rtl;
    text-align: right;
    max-width: 80%;
    width: fit-content;
    min-width: 140px;
    line-height: 1.8;
    font-size: 14px;
    word-wrap: break-word;
    white-space: pre-wrap;
    /* Raised from inset surface */
    box-shadow: var(--nm-inner-raised);
}

/* Bot bubble: card-color raised from inner surface */
.chat-message.bot {
    background: var(--card);
    margin-right: 0;
    margin-left: auto;
    border-radius: var(--radius-md) var(--radius-md) 6px var(--radius-md);
    max-width: 84%;
}

/* User bubble: teal clay raised */
.chat-message.user {
    background: var(--teal);
    color: var(--text-light);
    margin-right: auto;
    margin-left: 0;
    border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 6px;
    max-width: 74%;
    box-shadow:
        4px 4px 10px rgba(50, 90, 82, 0.50),
       -2px -2px 7px rgba(160, 220, 210, 0.40);
}

.message-author { display: none; }
.message-text { color: inherit; }

/* Inline author format — "מר ד': טקסט" on one line */
.msg-content {
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.msg-inline-author {
    color: var(--clay);
    font-weight: 800;
    font-size: 13px;
}

.chat-message.user .msg-content { color: var(--text-light); }
.chat-message.user .msg-inline-author { color: rgba(240,238,232,0.78); }

.chat-input-area { display: flex; gap: 10px; }
#chat-input { flex: 1; }

/* Send button: clay raised pill */
.neon-button-small {
    padding: 12px 20px;
    background: var(--clay);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--text-light);
    font-family: 'Assistant', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    box-shadow:
        4px 5px 12px rgba(130, 80, 40, 0.45),
       -1px -2px 6px rgba(255, 200, 160, 0.30),
        inset 0 2px 4px rgba(255, 200, 160, 0.20),
        inset 0 -2px 4px rgba(100, 45, 15, 0.18);
}
.neon-button-small:hover {
    background: var(--clay-lt);
    transform: translateY(-2px);
    box-shadow:
        6px 7px 16px rgba(130, 80, 40, 0.50),
       -2px -3px 8px rgba(255, 200, 160, 0.38);
}
.neon-button-small:active {
    transform: translateY(1px);
    background: var(--clay-dk);
    box-shadow:
        inset 3px 3px 8px rgba(100, 50, 20, 0.35),
        inset -2px -2px 6px rgba(255, 190, 140, 0.22);
}

.chat-disclaimer { text-align: center; color: var(--text-muted); font-size: 11px; margin-top: 8px; }

/* ── FOOTER ─────────────────────────────────────────────────────── */
.footer {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(42, 48, 40, 0.35);
    font-size: 11px;
    z-index: 10;
    font-family: 'Assistant', sans-serif;
    letter-spacing: 2px;
    text-align: center;
    width: 100%;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .dashboard-title { font-size: 34px; letter-spacing: 2px; }
    .nav-btn         { font-size: 13px; padding: 11px 8px; }
    .files-grid      { grid-template-columns: 1fr; }
    .title-he        { font-size: 40px; }
    .footer          { font-size: 10px; }
    .chat-message    { max-width: 90%; font-size: 13px; }
    .content-area    { padding: 14px; }
    .price-value     { font-size: 18px; }
    .blob-4, .blob-5 { display: none; } /* cleaner on small screens */
}

/* ════════════════════════════════════════════
   PERSONAL SPACE — נפרד מהדשבורד; שלד משבצות לעתיד
   ════════════════════════════════════════════ */
.personal-space-overlay {
    z-index: 10002;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* מנצח את .modal-box (ריפוד/רוחב) — קליפת איזור אישי */
.modal-box.personal-space-card {
    position: relative;
    max-width: 340px;
    width: 100%;
    padding: 22px 18px 18px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    text-align: right;
    border-radius: var(--radius-xl);
    animation: personalSpacePop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.personal-space-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-inline-end: 36px; /* מקום לכפתור סגירה */
    flex-wrap: wrap;
}

.personal-space-heading {
    margin: 0;
    font-family: 'Comfortaa', 'Assistant', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--purple);
    letter-spacing: 0.3px;
}

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

.personal-space-close {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--card-inner);
    color: var(--text-mid);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--nm-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
}
.personal-space-close:hover {
    box-shadow: var(--nm-raised-hover);
    transform: translateY(-1px);
}

.personal-space-badge {
    flex-shrink: 0;
    margin: 0;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: var(--card-inner);
    color: var(--clay-dk);
    font-size: 11px;
    font-weight: 800;
    font-family: 'Assistant', sans-serif;
    letter-spacing: 0.35px;
    box-shadow: var(--nm-inset);
}

.personal-space-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.personal-space-tile {
    min-height: 72px;
    padding: 12px 10px;
    border-radius: var(--radius-md);
    background: var(--card-inner);
    box-shadow: var(--nm-inset);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    cursor: default;
    opacity: 0.92;
    transition: opacity 0.2s;
}

.personal-space-tile-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    font-family: 'Assistant', sans-serif;
}

.personal-space-tile-hint {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

@media (max-width: 360px) {
    .personal-space-grid {
        grid-template-columns: 1fr;
    }
    .personal-space-card {
        max-width: 300px;
    }
}

/* ════════════════════════════════════════════
   AI DISCLAIMER MODAL
   ════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(40, 60, 44, 0.55);
    backdrop-filter: blur(14px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-box {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    max-width: 440px;
    width: 90%;
    box-shadow: var(--float-card);
    text-align: center;
    direction: rtl;
    animation: fadeIn 0.35s ease;
}

.modal-title {
    font-family: 'Comfortaa', 'Assistant', sans-serif;
    font-size: 1.45rem;
    color: var(--clay-dk);
    margin-bottom: 18px;
    font-weight: 700;
}

.modal-content        { margin-bottom: 24px; line-height: 1.85; color: var(--text); text-align: right; }
.modal-content p      { margin-bottom: 10px; font-size: 14px; }
.modal-content strong { color: var(--clay-dk); font-weight: 700; }

.modal-button {
    background: var(--clay);
    color: var(--text-light);
    border: none;
    padding: 13px 38px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Assistant', sans-serif;
    border-radius: var(--radius-pill);
    cursor: pointer;
    box-shadow:
        5px 6px 14px rgba(130, 80, 40, 0.45),
       -2px -2px 8px rgba(255, 200, 160, 0.30),
        inset 0 2px 5px rgba(255, 200, 160, 0.22),
        inset 0 -2px 5px rgba(100, 45, 15, 0.18);
    transition: all 0.2s;
}
.modal-button:hover {
    background: var(--clay-lt);
    transform: translateY(-2px);
    box-shadow:
        7px 8px 18px rgba(130, 80, 40, 0.50),
       -3px -3px 10px rgba(255, 200, 160, 0.38);
}
.modal-button:active {
    transform: translateY(1px);
    background: var(--clay-dk);
    box-shadow:
        inset 3px 3px 8px rgba(100, 50, 20, 0.35),
        inset -2px -2px 6px rgba(255, 190, 140, 0.22);
}

/* ════════════════════════════════════════════
   PRICE CHART MODAL
   ════════════════════════════════════════════ */
.chart-modal-box {
    max-width: 640px;
    width: 95%;
    padding: 24px 22px 20px;
    direction: rtl;
}

.chart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.chart-modal-title {
    margin-bottom: 0;
    font-size: 1.25rem;
    text-align: right;
}

.chart-close-btn {
    background: var(--card-inner);
    border: none;
    border-radius: var(--radius-pill);
    width: 36px;
    height: 36px;
    font-size: 15px;
    cursor: pointer;
    color: var(--text-mid);
    box-shadow: var(--nm-raised);
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chart-close-btn:hover {
    box-shadow: var(--nm-raised-hover);
    transform: translateY(-1px);
}
.chart-close-btn:active {
    box-shadow: var(--nm-inset);
    transform: translateY(0);
}

/* Period tabs — neumorphic pills */
.chart-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    justify-content: center;
}

.chart-tab {
    flex: 1;
    max-width: 120px;
    padding: 10px 14px;
    background: var(--card);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--text-mid);
    font-family: 'Assistant', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--nm-raised);
    transition: all 0.18s;
}
.chart-tab:hover {
    box-shadow: var(--nm-raised-hover);
    transform: translateY(-1px);
}
.chart-tab.active {
    background: var(--clay);
    color: var(--text-light);
    box-shadow:
        inset 3px 3px 8px rgba(100, 50, 20, 0.30),
        inset -2px -2px 6px rgba(255, 190, 140, 0.22),
        0 4px 10px rgba(130, 70, 30, 0.30);
}

/* Chart canvas inset well */
.chart-well {
    background: var(--card-inner);
    border-radius: var(--radius-md);
    padding: 16px 12px 10px;
    box-shadow: var(--nm-inset);
    margin-bottom: 14px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#price-chart {
    width: 100% !important;
    max-height: 220px;
}

.chart-loading {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    font-family: 'Assistant', sans-serif;
}

/* Stats row below chart */
.chart-stats {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.chart-stat {
    flex: 1;
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 10px 8px;
    box-shadow: var(--nm-raised);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chart-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    font-family: 'Assistant', sans-serif;
}

.chart-stat-val {
    font-size: 14px;
    font-weight: 800;
    color: var(--text);
    font-family: 'Comfortaa', sans-serif;
}

.chart-stat-val.positive { color: var(--green); }
.chart-stat-val.negative { color: #C04040; }

/* Price bar — clickable, full width centered */
.price-bar {
    cursor: pointer;
    transition: all 0.2s;
    max-width: 520px;
    margin: 0 auto 16px;
}
.price-bar:hover {
    box-shadow:
        12px 16px 40px rgba(30, 48, 36, 0.62),
        -2px -3px 12px rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
}

/* Left group inside price bar */
.price-bar-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* "גרפים" chip — sits inside the price bar on the right */
.price-chart-hint {
    background: var(--card-inner);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 800;
    color: var(--clay);
    font-family: 'Assistant', sans-serif;
    box-shadow: var(--nm-raised);
    letter-spacing: 0.3px;
    white-space: nowrap;
    pointer-events: none; /* entire bar is clickable */
}

@media (max-width: 640px) {
    .chart-modal-box { padding: 18px 14px; }
    .chart-tab       { font-size: 12px; padding: 9px 10px; }
    .chart-stats     { gap: 6px; }
    .chart-stat-val  { font-size: 12px; }
}

/* =========================================
   DASHBOARD V2 (HOME PAGE REDESIGN)
   ========================================= */

#dashboard-screen {
    align-items: flex-start;
    justify-content: center;
    padding: 10px 10px 80px;
}

.dashboard-v2 {
    width: min(400px, 100%);
    background: rgba(240, 237, 231, 0.92);
    border-radius: var(--radius-xl);
    box-shadow: var(--float-card);
    padding: 10px 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
}

.dashboard-v2-header {
    display: grid;
    gap: 5px;
    margin-bottom: 2px;
}

/* ── DESKTOP responsive scale-up ─────────────────────────────── */
@media (min-width: 600px) {
    #dashboard-screen {
        align-items: center;
        min-height: 100vh;
        padding: 24px 24px 100px;
    }

    .dashboard-v2 {
        width: min(580px, 100%);
        padding: 22px 22px 26px;
    }

    .dashboard-v2-header { gap: 10px; margin-bottom: 6px; }

    .dashboard-title { font-size: 38px; letter-spacing: 2.5px; }

    .price-strip { padding: 10px 18px; gap: 10px; }
    .price-strip-value { font-size: 20px; }
    .price-strip-label { font-size: 13px; }

    .icon-grid {
        grid-template-columns: repeat(2, minmax(0, 210px));
        gap: 16px;
        margin-top: 14px;
    }

    .icon-btn-label { font-size: 14px; padding: 6px 6px 9px; }
}

@media (min-width: 900px) {
    .dashboard-v2 { width: min(660px, 100%); padding: 26px 26px 30px; }
    .dashboard-title { font-size: 44px; }
    .icon-grid { grid-template-columns: repeat(2, minmax(0, 250px)); gap: 18px; }
    .icon-btn-label { font-size: 15px; padding: 7px 8px 10px; }
}

.price-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    background: var(--card-inner);
    border-radius: var(--radius-pill);
    padding: 12px 18px;
    box-shadow: var(--nm-inset);
}

.price-strip-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-mid);
}

.price-strip-value {
    font-size: 22px;
    color: var(--clay-dk);
    font-family: 'Comfortaa', sans-serif;
    font-weight: 700;
}

.price-strip-update {
    font-size: 13px;
    color: var(--text-muted);
}

.main-wave { display: none; }

.main-switcher {
    display: grid;
    gap: 10px;
}

.main-switch-btn {
    border: none;
    background: var(--card);
    color: var(--text);
    border-radius: var(--radius-pill);
    box-shadow: var(--nm-raised);
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.main-switch-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--nm-raised-hover);
}

.main-switch-btn.active {
    background: linear-gradient(135deg, #f2ede5 0%, #e6ddd1 100%);
    outline: 2px solid rgba(122, 170, 160, 0.35);
}

.main-switch-index { display: none; }

/* ════════════════════════════════════════════
   ICON GRID — 2×2 app-icon navigation
   ════════════════════════════════════════════ */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 140px));
    gap: 10px;
    margin-top: 8px;
    justify-content: center;
}

.icon-btn {
    position: relative;
    border: none;
    background: var(--card);
    border-radius: var(--radius-lg);
    /* Strong neumorphic shadow = clearly a raised button */
    box-shadow:
        6px 8px 20px rgba(140, 120, 100, 0.50),
       -4px -5px 14px rgba(255, 255, 255, 0.95),
        inset 0 1px 0 rgba(255,255,255,0.6);
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    width: 100%;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}

.icon-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow:
        8px 10px 26px rgba(140, 120, 100, 0.55),
       -5px -6px 16px rgba(255, 255, 255, 1);
}

.icon-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: var(--nm-inset);
}

/* Image fills button completely */
.icon-img-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

.icon-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.30);
    transform-origin: center center;
    transition: transform 0.22s ease;
    draggable: false;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.icon-btn:hover .icon-img-wrap img {
    transform: scale(1.35);
}

/* Label — plain text, no background */
.icon-btn-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    font-family: 'Assistant', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    line-height: 1.2;
    padding: 5px 4px 7px;
    background: none;
}

body.dark-mode .icon-btn-label {
    color: #1a1a1a;
    text-shadow:
        0 0 6px rgba(0, 0, 0, 0.80),
        0 0 14px rgba(0, 0, 0, 0.50);
}

@media (max-width: 360px) {
    .icon-grid { gap: 8px; }
    .icon-btn-label { font-size: 10px; padding: 4px 4px 6px; }
}

/* Personal area sub-menu */
.personal-action-menu {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.personal-action-btn {
    gap: 12px;
    font-size: 17px;
    padding: 18px 20px;
}

.personal-btn-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.section-panels { margin-top: 14px; }

.section-panel { display: none; }

.section-panel.active {
    display: block;
    animation: fadeIn 0.35s ease;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-mid);
    margin-top: -2px;
    margin-bottom: 14px;
}

.pnl-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.pnl-form input {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--nm-inset);
    padding: 10px 12px;
    background: var(--card-inner);
    color: var(--text);
    font-size: 14px;
    width: 100%;
}

.pnl-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.pnl-summary > div {
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--nm-raised);
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--nm-inset);
    background: var(--card-inner);
    padding: 8px;
}

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

.pnl-table th,
.pnl-table td {
    text-align: center;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    white-space: nowrap;
}

.empty-row {
    color: var(--text-muted);
    font-weight: 700;
}

.row-delete-btn {
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e7ddd0;
    cursor: pointer;
}

.pnl-positive { color: #1f9d63; }
.pnl-negative { color: #c43f3f; }

.quiz-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--nm-raised);
    padding: 16px;
}

.quiz-top-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
}

.quiz-question {
    margin-top: 14px;
    margin-bottom: 12px;
    font-size: 20px;
}

.quiz-options {
    display: grid;
    gap: 9px;
}

.quiz-option-btn {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--nm-raised);
    background: var(--card-inner);
    color: var(--text);
    padding: 10px 12px;
    text-align: right;
    font-size: 15px;
    cursor: pointer;
}

.quiz-option-btn.correct {
    background: rgba(74, 184, 130, 0.18);
    color: #1f744e;
}

.quiz-option-btn.wrong {
    background: rgba(212, 73, 73, 0.16);
    color: #9f2f2f;
}

.quiz-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.neon-button-small.secondary {
    background: #d7d0c2;
    color: var(--text);
}

.quiz-feedback {
    min-height: 24px;
    margin-top: 10px;
    font-weight: 700;
}

.quiz-feedback.ok { color: #1f9d63; }
.quiz-feedback.bad { color: #c43f3f; }

.news-grid {
    display: grid;
    gap: 12px;
}

.news-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--nm-raised);
    padding: 14px;
}

.news-tag {
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    background: rgba(212, 73, 73, 0.16);
    color: #a23535;
    border-radius: var(--radius-pill);
    padding: 5px 9px;
    margin-bottom: 8px;
}

.chart-time-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 12px;
}

.chart-time-btn {
    border: none;
    border-radius: var(--radius-pill);
    padding: 8px 12px;
    background: var(--card);
    box-shadow: var(--nm-raised);
    cursor: pointer;
    font-weight: 700;
}

.chart-time-btn.active {
    background: var(--clay);
    color: var(--text-light);
}

.candles-wrap {
    width: 100%;
    height: 460px;
    border-radius: var(--radius-lg);
    box-shadow: var(--nm-inset);
    background: var(--card-inner);
    padding: 8px;
}

#candles-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: var(--radius-md);
}

.chart-note {
    margin-top: 9px;
    color: var(--text-muted);
    font-size: 12px;
}

.mr-d-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at 25% 25%, #fff3e5 0%, #d39b77 45%, #a66b4a 100%);
    color: #fff;
    box-shadow: 0 12px 26px rgba(35, 27, 21, 0.38);
    cursor: pointer;
    z-index: 40;
    display: grid;
    place-items: center;
    transition: transform 0.2s ease;
}

.mr-d-fab:hover { transform: translateY(-1px) scale(1.02); }

.mr-d-fab-label {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.05;
}

.mr-d-fab-index { display: none; }

.mr-d-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(35, 40, 35, 0.54);
    padding: 10px;
    display: none;
    flex-direction: column;
}

.mr-d-modal-head {
    width: min(980px, 100%);
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.chat-fullscreen {
    width: min(980px, 100%);
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-fullscreen .chat-messages {
    flex: 1;
    min-height: 0;
}

@media (max-width: 900px) {
    .pnl-form { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .pnl-summary { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .dashboard-v2 { padding: 14px 12px; }
    .main-switch-btn { font-size: 15px; }
    .candles-wrap { height: 380px; }
    .mr-d-fab { width: 62px; height: 62px; }
}

/* ════════════════════════════════════════════
   SECTION SCREENS — each section is a full page
   ════════════════════════════════════════════ */
#personal-screen.active,
#homework-screen.active,
#updates-screen.active,
#charts-screen.active {
    align-items: flex-start;
    padding: 24px 14px 100px;
}

.section-screen-wrap {
    width: min(980px, 100%);
    background: rgba(240, 237, 231, 0.92);
    border-radius: var(--radius-xl);
    box-shadow: var(--float-card);
    padding: 18px 16px 24px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
}

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

.section-screen-title {
    font-family: 'Comfortaa', 'Assistant', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--purple);
    margin: 0;
    flex: 1;
}

/* Back button — clay pill */
.back-btn {
    flex-shrink: 0;
    padding: 9px 18px;
    background: var(--card);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--text-mid);
    font-family: 'Assistant', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--nm-raised);
    transition: all 0.18s;
    white-space: nowrap;
}
.back-btn:hover {
    box-shadow: var(--nm-raised-hover);
    transform: translateY(-2px);
}
.back-btn:active {
    box-shadow: var(--nm-inset);
    transform: translateY(0);
}

/* ── Coming Soon (Homework) ── */
.coming-soon-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
    text-align: center;
}

.coming-soon-badge {
    font-family: 'Comfortaa', 'Assistant', sans-serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--purple);
    background: var(--card-inner);
    border-radius: var(--radius-xl);
    padding: 22px 48px;
    box-shadow: var(--nm-raised);
    letter-spacing: 2px;
}

.coming-soon-text {
    color: var(--text-mid);
    font-size: 16px;
    font-weight: 600;
}

/* ── Chart type toggle ── */
.chart-type-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.chart-type-btn {
    flex: 1;
    padding: 10px 14px;
    background: var(--card);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--text-mid);
    font-family: 'Assistant', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--nm-raised);
    transition: all 0.18s;
}

.chart-type-btn:hover {
    box-shadow: var(--nm-raised-hover);
    transform: translateY(-1px);
}

.chart-type-btn.active {
    background: var(--clay);
    color: var(--text-light);
    box-shadow:
        inset 3px 3px 8px rgba(100, 50, 20, 0.30),
        inset -2px -2px 6px rgba(255, 190, 140, 0.22),
        0 4px 10px rgba(130, 70, 30, 0.30);
}

/* ── Line chart canvas container ── */
.line-chart-wrap {
    width: 100%;
    height: 420px;
    border-radius: var(--radius-lg);
    box-shadow: var(--nm-inset);
    background: var(--card-inner);
    padding: 12px;
    position: relative;
}

.line-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ── FX status message ── */
.fx-status {
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
    margin-bottom: 8px;
    padding: 4px 0;
    color: var(--text-muted);
    transition: color 0.3s;
}

.fx-status.fx-loading { color: var(--clay); }
.fx-status.fx-ok      { color: var(--green); }

/* Live FX rate info line below the summary */
.fx-live-info {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 6px 10px;
    background: var(--card-inner);
    border-radius: var(--radius-md);
    box-shadow: var(--nm-inset);
    text-align: center;
}

/* ── PNL form responsive fix (no FX field = 5 cols max) ── */
.pnl-form {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
}

@media (max-width: 900px) {
    .pnl-form { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
    .section-screen-title { font-size: 16px; }
}

@media (max-width: 640px) {
    .coming-soon-badge { font-size: 30px; padding: 16px 32px; }
    .line-chart-wrap   { height: 320px; }
    .section-screen-wrap { padding: 14px 12px 20px; }
}

/* ════════════════════════════════════════════
   SILVER TRIVIA QUIZ
   ════════════════════════════════════════════ */

.quiz-panel {
    animation: fadeIn 0.32s ease;
}

/* ── Start screen ── */
.quiz-intro-text {
    text-align: center;
    color: var(--text-mid);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 18px;
}

.quiz-stats-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 22px;
}

.quiz-stat-box {
    flex: 1;
    max-width: 110px;
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--nm-raised);
    padding: 12px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quiz-stat-box strong {
    font-family: 'Comfortaa', sans-serif;
    font-size: 20px;
    color: var(--clay-dk);
}

.quiz-stat-box span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
}

.quiz-cta-btn {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

/* ── Playing HUD ── */
.quiz-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quiz-hud-item {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-mid);
    background: var(--card);
    border-radius: var(--radius-pill);
    padding: 5px 10px;
    box-shadow: var(--nm-raised);
}

.quiz-timer-txt {
    font-family: 'Comfortaa', sans-serif;
    font-size: 14px;
    color: var(--teal-dk);
}

.quiz-timer-low {
    color: #c43f3f !important;
    animation: blink 0.8s infinite;
}

/* ── Progress bar ── */
.quiz-progress-bar {
    height: 5px;
    background: var(--card-deep);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: var(--nm-inner-inset);
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal) 0%, var(--clay) 100%);
    border-radius: var(--radius-pill);
    transition: width 0.4s ease;
}

/* ── Question text ── */
.quiz-question-txt {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.65;
    text-align: right;
    margin-bottom: 18px;
    min-height: 56px;
}

/* ── Answer buttons ── */
.quiz-options-wrap {
    display: grid;
    gap: 10px;
}

.quiz-opt-btn {
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--card);
    color: var(--text);
    font-family: 'Assistant', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
    box-shadow: var(--nm-raised);
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.2s;
    line-height: 1.5;
}

.quiz-opt-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--nm-raised-hover);
}

.quiz-opt-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: var(--nm-inset);
}

.quiz-opt-btn.correct {
    background: rgba(74, 184, 130, 0.22);
    color: #1a7a4e;
    box-shadow: 0 0 0 2px rgba(74, 184, 130, 0.55);
    font-weight: 800;
}

.quiz-opt-btn.wrong {
    background: rgba(196, 63, 63, 0.16);
    color: #9f2f2f;
    box-shadow: 0 0 0 2px rgba(196, 63, 63, 0.45);
}

/* ── Done screen ── */
.quiz-done-head {
    text-align: center;
    font-family: 'Comfortaa', 'Assistant', sans-serif;
    font-size: 1.3rem;
    color: var(--clay-dk);
    margin-bottom: 16px;
}

.quiz-done-score {
    text-align: center;
    font-family: 'Comfortaa', sans-serif;
    font-size: 52px;
    font-weight: 700;
    color: var(--clay);
    line-height: 1.1;
    margin-bottom: 6px;
}

.quiz-done-denom {
    font-size: 24px;
    color: var(--text-muted);
}

.quiz-done-msg {
    text-align: center;
    font-size: 15px;
    color: var(--text-mid);
    font-weight: 600;
    margin-bottom: 24px;
    min-height: 22px;
}

/* Dark mode overrides */
body.dark-mode .quiz-opt-btn.correct { color: #3dd68a; background: rgba(74, 184, 130, 0.18); }
body.dark-mode .quiz-opt-btn.wrong   { color: #e06060; background: rgba(196, 63, 63, 0.14); }
body.dark-mode .quiz-stat-box        { background: var(--card); }
body.dark-mode .quiz-hud-item        { background: var(--card); }
