    /* === KOMPAKTOWE WIERSZE TABELI ===
       Aby wrócić do starej wersji, zakomentuj lub usuń ten blok (do END COMPACT)
       Oryginalne wartości Bootstrap: padding ~0.75rem, line-height ~1.5, font-size 1rem
    */
    .table tbody td {
        padding: 0.02rem 0.4rem !important;
        vertical-align: middle;
        font-size: 0.82rem;
    }
    .table thead th {
        padding: 0.1rem 0.4rem !important;
        font-size: 0.8rem;
    }
    .stock-row {
        line-height: 1;
    }
    .stock-row .badge {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
    /* === END COMPACT === */

    .search-results {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        max-height: 300px;
        overflow-y: auto;
    }
    .search-result-item {
        cursor: pointer;
        padding: 10px 15px;
        border-bottom: 1px solid #333;
    }
    .search-result-item:hover {
        background-color: #2a2a2a;
    }

    /* Autocomplete dropdown */
    .autocomplete-dropdown {
        position: absolute;
        top: calc(100% + 2px);
        left: 0;
        right: 0;
        z-index: 1050;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        max-height: 320px;
        overflow-y: auto;
        display: none;
        box-shadow: 0 8px 16px rgba(0,0,0,0.4);
        margin-top: 2px;
    }
    .autocomplete-dropdown.show {
        display: block;
    }
    .autocomplete-item {
        padding: 10px 15px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--border-color);
        transition: background 0.15s;
        color: var(--text-primary);
    }
    .autocomplete-item:hover,
    .autocomplete-item.active {
        background: var(--bg-hover);
    }
    .autocomplete-item:last-child {
        border-bottom: none;
    }
    .autocomplete-symbol {
        font-weight: 600;
        color: var(--accent-color);
        margin-right: 10px;
    }
    .autocomplete-name {
        color: var(--text-secondary);
        font-size: 0.9em;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .autocomplete-category {
        font-size: 0.75em;
        padding: 2px 8px;
        border-radius: 4px;
        margin-left: 10px;
    }
    .autocomplete-category.stocks { background: #0d6efd; color: #fff; }
    .autocomplete-category.etf { background: #6f42c1; color: #fff; }
    .autocomplete-category.commodities { background: #ffc107; color: #000; }
    .autocomplete-category.crypto { background: #0dcaf0; color: #000; }
    .remove-btn {
        opacity: 0;
        transition: opacity 0.2s;
    }
    .stock-row:hover .remove-btn {
        opacity: 1;
    }
    .drag-handle {
        cursor: grab;
        opacity: 0.4;
        transition: opacity 0.2s;
    }
    .drag-handle:hover {
        opacity: 1;
    }
    .drag-handle:active {
        cursor: grabbing;
    }
    .sortable-ghost {
        opacity: 0.4;
        background: #333;
    }
    .sortable-drag {
        background: #1a1a1a;
    }

    /* Tabs styling */
    .category-tabs {
        border-bottom: 2px solid #333;
        margin-bottom: 20px;
    }
    .category-tabs .nav-link {
        color: #888;
        border: none;
        border-bottom: 3px solid transparent;
        padding: 12px 25px;
        font-weight: 500;
        transition: all 0.2s;
    }
    .category-tabs .nav-link:hover {
        color: #fff;
        border-color: #555;
    }
    .category-tabs .nav-link.active {
        color: #fff;
        background: transparent;
        border-color: #0d6efd;
    }
    .category-tabs .nav-link .badge {
        margin-left: 8px;
        font-size: 0.75rem;
    }

    /* Tab icons */
    .tab-icon {
        margin-right: 8px;
    }

    /* Empty state */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
        color: #666;
    }
    .empty-state i {
        font-size: 4rem;
        margin-bottom: 20px;
        opacity: 0.3;
    }

    /* Fear & Greed styles */
    .fear-greed-gauge-container {
        display: flex;
        justify-content: center;
        align-items: center;
        min-width: 0;
    }
    /* Gauge skaluje sie do szerokosci kolumny (na telefonie col-7 < 200px) -- bez tego canvas 200px wystawal na tekst obok */
    #fearGreedGauge {
        display: block;
        width: 100%;
        max-width: 200px;
        height: auto;
        min-width: 0;   /* flex-item musi miec min-width:0, inaczej nie kurczy sie ponizej 200px i wystaje na tekst */
    }
    .fear-greed-value {
        font-size: 2.5rem;
        font-weight: bold;
        line-height: 1;
    }
    .fear-greed-label {
        font-size: 1rem;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    .scale-bar {
        height: 12px;
        border-radius: 6px;
        background: linear-gradient(to right,
            #dc3545 0%,
            #fd7e14 25%,
            #ffc107 50%,
            #20c997 75%,
            #28a745 100%
        );
    }

    /* Sortowalne nagłówki */
    .sortable-header {
        transition: background-color 0.2s;
    }
    .sortable-header:hover {
        background-color: #333 !important;
        color: #f0c000 !important;
    }
    .sort-icon {
        font-size: 0.8em;
        opacity: 0.5;
    }
    .sortable-header:hover .sort-icon {
        opacity: 1;
    }
    .sortable-header.sorted-desc .sort-icon::before {
        content: "\F128"; /* bi-arrow-down */
    }
    .sortable-header.sorted-asc .sort-icon::before {
        content: "\F148"; /* bi-arrow-up */
    }

    /* (style czatu usunięte 2026-06-11 — czat zastąpiony Wiadomością dnia) */

    /* ========== MOBILE STYLES ========== */
    @media (max-width: 768px) {
        /* Ukryj tabelę na mobile */
        .table-responsive {
            display: none !important;
        }

        /* Pokaż karty na mobile */
        .mobile-cards {
            display: block !important;
        }

        /* Ukryj analizę Fear & Greed na mobile */
        #fearGreedCard .border-top.border-secondary {
            display: none !important;
        }

        /* Style kart mobilnych - ULTRA KOMPAKTOWE */
        .mobile-stock-card {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 4px 8px;
            margin-bottom: 3px;
            position: relative;
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .mobile-stock-card:active {
            transform: scale(0.98);
            background: var(--bg-tertiary);
        }

        .mobile-stock-card.sortable-ghost {
            opacity: 0.4;
            background: var(--bg-tertiary);
        }

        .mobile-stock-card.sortable-drag {
            opacity: 0.8;
        }

        .mobile-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0;
        }

        .mobile-card-symbol {
            display: flex;
            flex-direction: column;
            flex: 1;
            padding-left: 22px;
        }

        .mobile-symbol {
            font-size: 0.8rem;
            font-weight: 700;
            color: var(--accent-color);
            margin-bottom: 0;
            line-height: 1.1;
        }

        .mobile-name {
            font-size: 0.65rem;
            color: var(--text-muted);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 130px;
            line-height: 1.1;
        }

        .mobile-card-price {
            text-align: right;
        }

        .mobile-price {
            font-size: 0.8rem;
            font-weight: 600;
            margin-bottom: 0;
            line-height: 1.1;
        }

        .mobile-change {
            font-size: 0.7rem;
            font-weight: 600;
            line-height: 1.1;
        }

        .mobile-card-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 3px;
            padding-top: 3px;
            border-top: 1px solid var(--border-color);
        }

        .mobile-signal-score {
            display: flex;
            gap: 6px;
            align-items: center;
        }

        .mobile-signal-score .badge {
            font-size: 0.6rem;
            padding: 1px 4px;
        }

        .mobile-score {
            font-size: 0.7rem;
            font-weight: 600;
            padding: 1px 4px;
            border-radius: 3px;
            background: var(--bg-tertiary);
        }

        .mobile-remove-btn {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-color);
            color: #ef4444;
            width: 22px;
            height: 22px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
        }

        .mobile-drag-handle {
            position: absolute;
            left: 2px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            font-size: 0.85rem;
            cursor: grab;
            padding: 2px;
            touch-action: none;
        }

        .mobile-drag-handle:active {
            cursor: grabbing;
        }

        .mobile-remove-btn:active {
            background: #7f1d1d;
        }

        /* Ukryj drag handle na mobile */
        .drag-handle {
            display: none !important;
        }

        /* Kompaktowy formularz na mobile */
        .position-relative.ms-3 {
            margin-left: 0 !important;
            margin-top: 12px;
            min-width: 100% !important;
        }

        /* Czat na mobile - pełna szerokość */
        .col-lg-6 {
            max-width: 100%;
        }

        /* Tabs na mobile - przewijalne i kompaktowe */
        .category-tabs {
            width: 100% !important;
            flex-wrap: nowrap !important;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .category-tabs::-webkit-scrollbar {
            height: 0;
        }

        .category-tabs .nav-link {
            white-space: nowrap;
            font-size: 0.78rem;
            padding: 8px 10px;
        }

        .category-tabs .nav-link .tab-icon {
            display: none;
        }

        .category-tabs .nav-link .badge {
            font-size: 0.65rem;
            padding: 1px 4px;
            margin-left: 4px;
        }
    }

    /* Desktop: ukryj karty mobilne */
    @media (min-width: 769px) {
        .mobile-cards {
            display: none !important;
        }
    }

/* Portfel: checkbox + wyroznienie wiersza */
.portfolio-check { cursor: pointer; margin-right: 5px; vertical-align: middle; accent-color: #d4af37; width: 15px; height: 15px; }
.mobile-drag-handle .portfolio-check { margin: 0 4px 0 0; }
tr.stock-row:has(.portfolio-check:checked) { box-shadow: inset 3px 0 0 0 #d4af37; }
.mobile-stock-card:has(.portfolio-check:checked) { border-left: 3px solid #d4af37; }

/* Separatory grup Wallet / Obserwowane */
.group-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent-color) !important; }
tr.group-label-row td.group-label { padding: 7px 12px 5px; background: rgba(212,175,55,0.07); border-top: 1px solid rgba(212,175,55,0.22); border-bottom: 1px solid rgba(212,175,55,0.22); }
.group-label-mobile { margin: 8px 2px 3px; padding: 2px 2px; }

/* Plakietka sesji rozszerzonej przy cenie (pre-market / after-hours / po sesji).
   Tło półprzezroczyste, więc czyta się i na ciemnym, i na jasnym motywie. */
.session-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}
.session-badge-pre { color: #3d8bfd; border-color: rgba(61, 139, 253, 0.55); background: rgba(61, 139, 253, 0.14); }
.session-badge-post { color: #9b6dff; border-color: rgba(155, 109, 255, 0.55); background: rgba(155, 109, 255, 0.14); }
.session-badge-closed { color: #8d949e; border-color: rgba(141, 148, 158, 0.5); background: rgba(141, 148, 158, 0.14); }
[data-theme="dark"] .session-badge-pre { color: #6ea8fe; }
[data-theme="dark"] .session-badge-post { color: #b58cff; }
[data-theme="dark"] .session-badge-closed { color: #a7adb6; }

/* ═══════════════════════════════════════════════════════════
   REDESIGN 2026-07-31 — mikro-wykresy, pasek punktacji,
   siła sygnału, karty mobilne.
   Cofnięcie: usuń wszystko od tego komentarza do końca pliku.
   ═══════════════════════════════════════════════════════════ */

/* ——— mikro-wykres 20 sesji ——— */
.spark {
    width: 78px;
    height: 26px;
    display: block;
    margin: 0 auto;
    overflow: visible;
}
.spark polyline {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}
.spark-up   { color: var(--success-color, #16a34a); }
.spark-down { color: var(--danger-color, #dc2626); }
.spark-empty { color: var(--text-muted, #888); font-size: .8rem; }
.spark-th { width: 92px; }
.spark-td { padding: 0 .35rem !important; }

/* ——— punktacja: liczba + pasek siły ——— */
.score-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 46px;
}
.score-val {
    font-weight: 700;
    font-size: .82rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.score-pos  { color: var(--success-color, #16a34a); }
.score-neg  { color: var(--danger-color, #dc2626); }
.score-zero { color: var(--text-muted, #888); }
.score-bar {
    display: block;
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color, #ddd);
    overflow: hidden;
}
.score-bar i {
    display: block;
    height: 100%;
    border-radius: 2px;
    transition: width .4s cubic-bezier(.22,.61,.36,1);
}
.score-bar .bar-pos { background: var(--success-color, #16a34a); }
.score-bar .bar-neg { background: var(--danger-color, #dc2626); }

/* ——— siła rekomendacji: mocny sygnał czytelny od razu ——— */
.badge.sig-strong {
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(0,0,0,.06) inset;
}
.badge.sig-mid  { opacity: .88; }
.badge.sig-weak { opacity: .62; font-weight: 500; }

/* ——— karta mobilna: wykres nad ceną ——— */
/* 2026-08-23: mini-wykresy ukryte na mobile (decyzja: nie da sie ich sensownie
   zmiescic obok symbolu i ceny w jednym wierszu -- przy 60px i tak byly nieczytelne,
   a .spark ma overflow:visible i nachodzil na ticker). Tabela na desktopie (.spark-td)
   zostaje bez zmian. Przywrocenie: usunac 'display:none' ponizej. */
.mobile-spark {
    display: none !important;
}
.mobile-spark .spark { width: 60px; height: 22px; }

@media (max-width: 768px) {
    .score-box { min-width: 40px; }
    .score-bar { width: 36px; }
    .mobile-card-header { align-items: center; }
}

/* ═══════════════════════════════════════════════════════════
   2026-08-23 — mobile: siatka kolumnowa (wszystko rowno w pionie)
   ───────────────────────────────────────────────────────────
   Wczesniej karta byla flexem: kazdy element mial szerokosc od swojej tresci,
   wiec dluzszy badge ("TRZYMAJ" vs "KUP") albo dluzsza cena ($963.68 vs $78.85)
   przesuwaly cala reszte i wiersze nie trzymaly pionu.
   Teraz karta to GRID o stalych kolumnach, a wewnetrzne kontenery dostaja
   display:contents, zeby ich dzieci trafily wprost do tej samej siatki.
   Kolejnosc kolumn: [checkbox] [symbol] [cena] [zmiana%] [rekomendacja] [score] [x]
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    html[data-skin="investing"] .mobile-stock-card,
    .mobile-stock-card {
        display: grid !important;
        grid-template-columns: 26px 58px minmax(0, 1fr) 52px 70px 44px 16px;
        align-items: center !important;
        column-gap: 5px !important;
        padding: 6px 8px !important;
        overflow: hidden;
    }

    /* kontenery znikaja z ukladu - ich dzieci staja sie komorkami siatki */
    html[data-skin="investing"] .mobile-card-header,
    html[data-skin="investing"] .mobile-card-footer,
    html[data-skin="investing"] .mobile-card-price,
    html[data-skin="investing"] .mobile-signal-score,
    .mobile-card-header, .mobile-card-footer,
    .mobile-card-price, .mobile-signal-score {
        display: contents !important;
    }

    /* uchwyt: byl position:absolute, w siatce musi byc zwyklym elementem */
    html[data-skin="investing"] .mobile-drag-handle,
    .mobile-drag-handle {
        position: static !important;
        transform: none !important;
        left: auto !important; top: auto !important;
        display: flex !important; align-items: center; gap: 3px;
        padding: 0 !important;
    }

    html[data-skin="investing"] .mobile-card-symbol,
    .mobile-card-symbol {
        padding-left: 0 !important;
        min-width: 0;
        display: block !important;
    }
    .mobile-symbol { text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .mobile-price  { text-align: right; white-space: nowrap; }
    .mobile-change { text-align: right; white-space: nowrap; }

    /* rekomendacja: stala szerokosc kolumny, tekst wysrodkowany */
    html[data-skin="investing"] .mobile-signal-score .badge,
    .mobile-signal-score .badge {
        width: 100% !important; max-width: none !important;
        text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .score-box { min-width: 0 !important; width: 100%; }

    html[data-skin="investing"] .mobile-remove-btn,
    .mobile-remove-btn { padding: 0 !important; justify-self: end; }

    /* napis sesji -> ikona (tekst zostaje w DOM dla czytnikow i tooltipa) */
    .session-badge {
        font-size: 0 !important; padding: 0 !important;
        border: 0 !important; background: transparent !important;
        margin-left: 3px !important;
    }
    .session-badge::before { font-size: 11px; line-height: 1; display: inline-block; }
    .session-badge-pre::before    { content: "\2600"; }
    .session-badge-post::before   { content: "\263E"; }
    .session-badge-closed::before { content: "\263E"; }
}
