/* בסיס כללי */
*,
*::before,
*::after {
    box-sizing: border-box;
}
/* Visually hidden (SEO/Accessibility) — בלי לגרום לגלילה אופקית */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Heebo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #161b33 0, #050609 45%, #02030a 100%);
    color: #f7f7ff;
}

/* שורש האפליקציה */
.app-root {
    min-height: auto; 
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* צד ימין בהדר – תצוגה של "נתונים נכונים לתקופה" + כפתור נגישות מתחת */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: conic-gradient(from 210deg, #18ffff, #7c4dff, #ff4081, #18ffff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.4rem;
    color: #050609;
    box-shadow: 0 0 20px rgba(24, 255, 255, 0.35);
}

.brand-text h1 {
    margin: 0;
    font-size: 1.9rem;
}

.brand-text p {
    margin: 0.25rem 0 0;
    opacity: 0.75;
    font-size: 0.95rem;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(10, 16, 40, 0.8);
    border: 1px solid rgba(120, 143, 255, 0.35);
    font-size: 0.85rem;
}

.pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #18ffff;
    box-shadow: 0 0 12px rgba(24, 255, 255, 0.9);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.4; }
    100% { transform: scale(1); opacity: 1; }
}

/* Main layout */
.app-main {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}


/* ===== Tabs (השוואה / מחשבון) ===== */
.tabs-row{
    display:flex;
    gap:0.6rem;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
}

.tab-btn{
    padding:0.55rem 1.05rem;
    border-radius:999px;
    border:1px solid rgba(132, 150, 255, 0.65);
    background: rgba(6, 11, 35, 0.78);
    color:#d0d4ff;
    font-size:0.92rem;
    cursor:pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.tab-btn.tab-link{
    text-decoration:none;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}


.tab-btn:hover{
    background: rgba(10, 17, 53, 0.92);
    border-color:#18ffff;
    transform: translateY(-1px);
}

.tab-btn.is-active{
    background: linear-gradient(135deg, rgba(24,255,255,0.95), rgba(124,77,255,0.95));
    border-color: rgba(24,255,255,0.9);
    color:#050609;
    box-shadow: 0 10px 26px rgba(24, 255, 255, 0.22);
}

.tab-view[hidden]{
    display:none !important;
}


/* Tab description (שורה מתחת לטאבים) */

/* Tab description row + copy link button */
.tab-description-row{
    display:flex;
    align-items:center;
    gap:0.6rem;
    flex-wrap:wrap;
}

.tab-link-btn{
    margin-top: 0.45rem;
    white-space: nowrap;
}

.tab-description{
    margin-top: 0.45rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.86rem;
    line-height: 1.35;
    background: rgba(6, 11, 35, 0.72);
    border: 1px solid rgba(132, 150, 255, 0.35);
    color: #d6dbff;
    width: fit-content;
    max-width: 100%;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tab-description.fade{
    opacity: 0;
    transform: translateY(-3px);
}
/* ===== מחשבון (placeholder) ===== */
.calculator-placeholder{
    display:flex;
    align-items:center;
    gap:0.9rem;
    padding:1rem;
    border-radius:18px;
    border:1px dashed rgba(120, 143, 255, 0.55);
    background: rgba(4, 7, 22, 0.55);
}

.placeholder-icon{
    width:44px;
    height:44px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:1.35rem;
    background: radial-gradient(circle at top, rgba(24,255,255,0.9), rgba(124,77,255,0.75));
    color:#050609;
    flex: 0 0 auto;
}

.placeholder-text{
    font-size:0.92rem;
    opacity:0.92;
    line-height:1.4;
}
/* Glass card */
.glass {
    background: linear-gradient(135deg, rgba(18, 22, 55, 0.82), rgba(7, 11, 35, 0.9));
    border-radius: 22px;
    padding: 1.4rem 1.6rem;
    border: 1px solid rgba(132, 150, 255, 0.35);
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(16px);
}

/* Filters */
.filters-card {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.filters-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.filters-header p {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field.compact {
    justify-content: flex-end;
}

label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Inputs & selects */
select,
input[type="number"] {
    width: 100%;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(132, 150, 255, 0.6);
    background: rgba(4, 7, 20, 0.9);
    color: #f7f7ff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

select:focus,
input[type="number"]:focus {
    border-color: #18ffff;
    box-shadow: 0 0 0 1px rgba(24, 255, 255, 0.35);
    background: rgba(6, 10, 27, 0.95);
}

select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Buttons */
.primary-btn {
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    background: linear-gradient(135deg, #18ffff, #7c4dff);
    color: #050609;
    box-shadow: 0 9px 24px rgba(24, 255, 255, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.primary-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 12px 30px rgba(24, 255, 255, 0.55);
}

.primary-btn:active {
    transform: translateY(1px);
    box-shadow: 0 5px 18px rgba(24, 255, 255, 0.35);
}

.chip-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(132, 150, 255, 0.6);
    background: rgba(6, 11, 35, 0.9);
    color: #d0d4ff;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.chip-btn:hover {
    background: rgba(10, 17, 53, 0.95);
    border-color: #18ffff;
    transform: translateY(-1px);
}

.chip-btn:active {
    transform: translateY(1px);
}

/* Summary row */
.summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.summary-card h3 {
    margin: 0;
    font-size: 1rem;
}

.summary-value {
    margin: 0.2rem 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.summary-label {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===== כרטיס השוואה ===== */
.compare-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.compare-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.compare-subtext {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.compare-warning {
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.6);
    color: #ffe082;
}

.compare-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr);
    gap: 1rem;
}

.compare-table-wrapper {
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.compare-table thead {
    background: linear-gradient(90deg, rgba(10, 16, 45, 0.98), rgba(3, 10, 35, 0.98));
}

.compare-table th,
.compare-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid rgba(42, 56, 120, 0.55);
    text-align: right;
}

.compare-table th {
    font-size: 0.8rem;
    opacity: 0.9;
}

.compare-table tbody tr:nth-child(odd) {
    background: rgba(2, 6, 20, 0.75);
}

.compare-table tbody tr:nth-child(even) {
    background: rgba(2, 5, 18, 0.95);
}

.compare-table td.metric-label {
    font-weight: 500;
    white-space: nowrap;
}

.compare-table td.highlight-max {
    background: radial-gradient(circle at center, rgba(24, 255, 255, 0.24), rgba(6, 10, 32, 0.95));
    box-shadow: inset 0 0 0 1px rgba(24, 255, 255, 0.6);
    font-weight: 600;
}

.compare-chart-wrapper {
    background: radial-gradient(circle at top, rgba(13, 19, 51, 0.98), rgba(3, 6, 18, 0.98));
    border-radius: 18px;
    border: 1px solid rgba(132, 150, 255, 0.4);
    padding: 0.75rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
}

/* Table card */
.table-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-header-row h2 {
    margin: 0;
    font-size: 1.3rem;
}

.table-header-row p {
    margin: 0.3rem 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Status bar */
.status-bar {
    font-size: 0.85rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(4, 7, 22, 0.9);
    border: 1px dashed rgba(120, 143, 255, 0.5);
    opacity: 0.92;
}

/* Table wrapper – בלי גלילה אופקית */
.table-wrapper {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(132, 150, 255, 0.4);
    background: radial-gradient(circle at top, rgba(13, 19, 51, 0.98), rgba(3, 6, 18, 0.98));
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}

/* Table */
.funds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    position: relative;
    z-index: 1;
    table-layout: fixed;
}

.funds-table thead {
    background: linear-gradient(90deg, rgba(10, 16, 45, 0.98), rgba(3, 10, 35, 0.98));
}

.funds-table th,
.funds-table td {
    padding: 0.5rem 0.45rem;
    text-align: right;
    border-bottom: 1px solid rgba(42, 56, 120, 0.55);
}

/* כותרות יכולות לרדת לשתי שורות */
.funds-table th {
    font-size: 0.8rem;
    opacity: 0.9;
    white-space: normal;
    word-wrap: break-word;
}

/* ברירת מחדל – הערכים עצמם בשורה אחת */
.funds-table td {
    white-space: nowrap;
}

/* ✅ 4 העמודות הטקסטואליות: שם קופה, סיווג, התמחות, תת־התמחות – מותר לשבור שורה */
.funds-table td:nth-child(2),
.funds-table td:nth-child(3),
.funds-table td:nth-child(4),
.funds-table td:nth-child(5) {
    white-space: normal;
    word-wrap: break-word;
}

.funds-table tbody tr:nth-child(odd) {
    background: rgba(2, 6, 20, 0.72);
}

.funds-table tbody tr:nth-child(even) {
    background: rgba(2, 5, 18, 0.9);
}

.funds-table tbody tr:hover {
    background: rgba(10, 22, 70, 0.9);
}

.funds-table td {
    vertical-align: middle;
}

/* מספרים */
.funds-table td.num-col,
.funds-table td.num-col .num {
    direction: ltr;
    text-align: center;
    unicode-bidi: bidi-override;
}

/* צפיפות טבלה (מצב קומפקט) */
.funds-table.compact th,
.funds-table.compact td {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

/* Footer */
.app-footer {
    margin-top: 1.25rem; ;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8rem;
    opacity: 0.7;
    flex-wrap: wrap;
}

/* ---------- רספונסיביות כללית ---------- */

@media (max-width: 980px) {
    .filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .compare-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .app-root {
        padding: 1rem;
    }
    .filters-grid {
        grid-template-columns: 1fr;
    }
    .summary-row {
        grid-template-columns: 1fr;
    }
}

/* ---------- מצב כרטיסים – כשאי אפשר להציג את כל העמודות ---------- */
/* במסכים עד 900px כל שורה הופכת לכרטיס */

@media (max-width: 900px) {

    .table-wrapper {
        overflow-x: hidden;
        overflow-y: visible;
        border-radius: 0;
        border: none;
        background: transparent;
        max-width: 100%;
    }

    .funds-table {
        border-collapse: separate;
        border-spacing: 0 0.75rem;
        font-size: 0.8rem;
        min-width: 0;
    }

    .funds-table thead {
        display: none; /* הכותרות יעברו ל־data-label */
    }

    .funds-table tbody tr {
        display: block;
        background: linear-gradient(135deg, rgba(6, 10, 32, 0.98), rgba(3, 6, 20, 0.98));
        border-radius: 16px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
        overflow: hidden;
        border: 1px solid rgba(132, 150, 255, 0.4);
        margin-bottom: 0.75rem;
        width: 100%;
    }

    .funds-table tbody tr:hover {
        background: linear-gradient(135deg, rgba(10, 16, 46, 0.98), rgba(4, 9, 28, 0.98));
    }

    .funds-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid rgba(42, 56, 120, 0.45);
        padding: 0.45rem 0.8rem;
        white-space: normal; /* במסך קטן תמיד מותר לשבור שורה */
    }

    .funds-table td:last-child {
        border-bottom: none;
    }

    .funds-table td::before {
        content: attr(data-label);
        font-weight: 500;
        font-size: 0.8rem;
        color: #c5cae9;
        margin-left: 0.5rem;
        flex: 0 0 auto;
    }

    .funds-table td.num-col,
    .funds-table td.num-col .num {
        text-align: center;
        direction: ltr;
    }

    /* שם קופה – כותרת הכרטיס */
    .funds-table td[data-label="שם קופה"] {
        font-weight: 600;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding-top: 0.6rem;
    }
}

/* טקסט משני מתחת לכותרת הטבלה */
.table-subtext {
    font-size: 0.85rem;
    color: #9aa0b2;
    margin-top: 4px;
    margin-bottom: 14px;
    line-height: 1.45;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 6px;
}

.table-subtext .table-icon {
    font-size: 1.05rem;
    opacity: 0.85;
    vertical-align: middle;
}

/* הדגשת הערך המקסימלי בעמודות התשואה */
.funds-table td.highlight-max {
    background: radial-gradient(circle at center, rgba(24, 255, 255, 0.24), rgba(6, 10, 32, 0.95));
    box-shadow: inset 0 0 0 1px rgba(24, 255, 255, 0.6);
    font-weight: 600;
}

/* ===== נגישות – לוח צדדי ===== */
.a11y-panel {
    position: fixed;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    width: 180px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0.6rem 0.7rem;
    border-radius: 16px;
    background: rgba(5, 9, 30, 0.96);
    border: 1px solid rgba(132, 150, 255, 0.7);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    z-index: 3000;
    backdrop-filter: blur(10px);
}

.a11y-panel.a11y-hidden {
    display: none;
}

.a11y-title {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: right;
}

.a11y-btn {
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0.4rem;
    border-radius: 10px;
    border: 1px solid rgba(132, 150, 255, 0.7);
    background: rgba(9, 13, 40, 0.95);
    color: #e0e4ff;
    font-size: 0.8rem;
    text-align: right;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.a11y-btn:hover {
    background: rgba(18, 26, 80, 0.98);
    border-color: #18ffff;
    transform: translateY(-1px);
}

.a11y-btn:active {
    transform: translateY(1px);
}

.a11y-reset {
    margin-top: 0.35rem;
    background: linear-gradient(135deg, #ff5252, #ffb74d);
    border-color: rgba(255, 255, 255, 0.6);
    color: #1b1b1b;
}

/* אייקון בתוך כפתור נגישות */
.a11y-icon {
    margin-left: 4px;
    font-size: 0.95rem;
}

/* כפתור צף לפתיחה/סגירה של הלוח */
.a11y-toggle {
    position: relative;
    align-self: flex-end;
    margin-top: 0.55rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(132, 150, 255, 0.8);
    background: radial-gradient(circle at top, #18ffff, #7c4dff);
    color: #061019;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3100;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}


.a11y-toggle:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.8);
    filter: brightness(1.05);
}

.a11y-toggle:active {
    transform: translateY(1px) scale(0.98);
}
/* ===== Theme Toggle (Dark/Light) ===== */
.theme-toggle{
    position: relative;
    align-self: flex-end;
    margin-top: 0.55rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(132, 150, 255, 0.8);
    background: radial-gradient(circle at top, rgba(255,255,255,0.9), rgba(160, 180, 255, 0.9));
    color: #061019;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3100;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.theme-toggle:hover{
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65);
    filter: brightness(1.05);
}

.theme-toggle:active{
    transform: translateY(1px) scale(0.98);
}


/* התאמה למסכים קטנים יותר */
@media (max-width: 720px) {
    .a11y-panel {
        width: 150px;
        right: 0.25rem;
        padding: 0.5rem;
    }
}

/* מצבי נגישות בפועל */

/* מונוכרום */
body.a11y-monochrome {
    filter: grayscale(100%);
}

/* ניגודיות גבוהה */
body.a11y-high-contrast {
    background: #000 !important;
    color: #ffffff !important;
}

body.a11y-high-contrast .app-root,
body.a11y-high-contrast .glass,
body.a11y-high-contrast .table-wrapper {
    background: #000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

/* הדגשת קישורים */
body.a11y-highlight-links a {
    outline: 2px solid #ffeb3b;
    outline-offset: 2px;
    text-decoration: underline;
}

/* גופן קריא */
body.a11y-readable-font {
    font-family: Arial, Helvetica, sans-serif;
}

/* ניווט מקלדת – פוקוס מודגש */
body.a11y-keyboard-nav *:focus {
    outline: 2px solid #ffeb3b !important;
    outline-offset: 3px;
}

/* חסימת אנימציות */
body.a11y-no-animations * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* סמן גדול */
body.a11y-big-cursor,
body.a11y-big-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><polygon points="0,0 0,32 8,24 14,30 18,26 12,20 20,20" fill="white" stroke="black" stroke-width="1"/></svg>') 0 0, auto !important;
}


/* נקודה מונפשת בכותרת הראשית */
.brand-dot {
    display: inline-block;
    padding: 0 2px;
    color: #18ffff;
    animation: pulse 1.8s infinite;
    transform-origin: center;
}

/* 🏆 קופה מובילה בטבלה */
.funds-table tr.best-fund td[data-label="שם קופה"]::after,
.funds-table tr.best-fund td:nth-child(2)::after {
    content: " 🏆";
    font-size: 1.1rem;
    margin-right: 6px;
    filter: drop-shadow(0 0 6px gold);
}

/* רקע עדין לכל השורה המובילה */
.funds-table tr.best-fund {
    background: linear-gradient(
        90deg,
        rgba(255, 215, 0, 0.08),
        rgba(255, 215, 0, 0.02)
    ) !important;
}

/* טול־טיפ לקופה המובילה – על תא "שם קופה" */
.funds-table tr.best-fund td:nth-child(2) {
    position: relative;
}

/* הבועה עצמה */
.funds-table tr.best-fund td:nth-child(2)::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    transform: translateY(-6px);
    background: rgba(5, 9, 30, 0.96);
    color: #e0e4ff;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    border: 1px solid rgba(132, 150, 255, 0.7);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

/* הצגת הטול־טיפ בהובר */
.funds-table tr.best-fund td:nth-child(2):hover::before {
    opacity: 1;
    transform: translateY(-10px);
}

/* ===== תיקון ריצוד וריקוד בגלילה בסלולרי ===== */

html, body {
    /* מונע גלילות צד קטנות שיכולות להרגיש כמו "קפיצות" */
    overflow-x: hidden;
}

/* במכשירים עד 900px נרגיע אפקטים כבדים */
@media (max-width: 900px) {

    /* כרטיסי glass – בלי blur כבד וצל מטורף */
    .glass {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6);
    }

    /* כרטיסי הטבלה במצב מובייל – צל עדין יותר */
    .funds-table tbody tr {
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
    }

    /* לוח נגישות וכפתור ♿ – שכבה גרפית יציבה (GPU) */
    .a11y-panel,
    .a11y-toggle,
    .header-badge,
    .brand-icon {
        will-change: transform;
        transform: translateZ(0);
    }

    /* ביטול אנימציות קבועות בראש – חוסך הרבה ציור מחדש */
    .pulse-dot,
    .brand-dot {
        animation: none;
        box-shadow: 0 0 4px rgba(24, 255, 255, 0.6);
    }
}

/* ✅ ביטול גורם שכיח לגלילה אופקית במובייל: טול־טיפ ארוך של "הקופה המובילה" */
.funds-table tr.best-fund td:nth-child(2)::before {
  max-width: min(90vw, 320px);
  white-space: normal;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}

/* במובייל אין hover אמיתי – אז פשוט לא להציג את הטול־טיפ */
@media (max-width: 900px) {
  .funds-table tr.best-fund td:nth-child(2)::before {
    display: none !important;
  }
}

/* חיזוק: למנוע overflow גם בתוך הקונטיינר הראשי */
.app-root {
  width: 100%;
  overflow-x: hidden;
}



/* ===== Savings Calculator (Tab 2) ===== */
.calculator-card { margin-top: 14px; }
.calc-grid{
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 980px){
  .calc-grid{ grid-template-columns: 1fr; }
}

.calc-form{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.calc-field label{
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  opacity: .95;
}
.calc-field input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.22);
  color: inherit;
  outline: none;
}
.calc-field input:focus{
  border-color: rgba(255,255,255,.32);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

.calc-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.btn.primary{
  border-color: rgba(255,255,255,.26);
}

.calc-note{
  min-height: 20px;
  font-size: 13px;
  opacity: .85;
}

.calc-output{
  display: grid;
  gap: 12px;
}

.calc-kpis{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 520px){
  .calc-kpis{ grid-template-columns: 1fr; }
}

.kpi{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.14);
  border-radius: 16px;
  padding: 12px;
}
.kpi-label{
  font-size: 12px;
  opacity: .8;
  margin-bottom: 6px;
}
.kpi-value{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
}


/* KPI כפול (השוואה בין שתי ריביות) */
.dual-kpi{ display:flex; flex-direction:column; gap:4px; }
.dual-kpi span{ font-weight:700; font-size:14px; letter-spacing:.1px; }
.dual-kpi .dual-a{ opacity:.95; }
.dual-kpi .dual-b{ opacity:.85; }

.calc-chart-wrap{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.12);
  border-radius: 18px;
  padding: 10px;
  overflow: hidden;

    min-height: 180px;
}

.calc-table-wrap{ margin-top: 14px; }
.calc-table-head{ display:flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.small{ font-size: 12px; }

.table-scroll{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.calc-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
.calc-table th, .calc-table td{
  padding: 10px 10px;
  text-align: right;
  border-bottom: 1px solid rgba(255,255,255,.10);
  white-space: nowrap;
}
.calc-table th{
  font-size: 12px;
  opacity: .85;
  position: sticky;
  top: 0;
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
}


/* ===== שיפור ריווח בין הטאבים לתוכן ===== */
.tabs-row { margin-bottom: 0.25rem; }
.tab-view { margin-top: 0; padding-top: 0; }
.tab-view .calculator-card { margin-top: 0; }
.tab-view .filters-header { margin-top: 0; }

/* טקסט משני */
.muted { opacity: 0.8; }
.small { font-size: 0.82rem; line-height: 1.35; }

/* התאמה לשדות select בתוך מחשבונים */
.calculator-card select {
    width: 100%;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(132, 150, 255, 0.6);
    background: rgba(4, 7, 20, 0.9);
    color: #f7f7ff;
    font-size: 0.95rem;
    outline: none;
}
.calculator-card select:focus {
    border-color: #18ffff;
    box-shadow: 0 0 0 1px rgba(24, 255, 255, 0.35);
    background: rgba(6, 10, 27, 0.95);
}

/* ===== Light Theme Overrides ===== */
body.theme-light {
    background: radial-gradient(circle at top, #f4f7ff 0, #eef3ff 45%, #ffffff 100%) !important;
    color: #0b1020 !important;
}

body.theme-light .brand-icon{
    box-shadow: 0 0 18px rgba(124, 77, 255, 0.18);
}

body.theme-light .header-badge{
    background: rgba(255,255,255,0.9);
    border-color: rgba(30, 50, 120, 0.22);
    color: #0b1020;
}

body.theme-light .pulse-dot{
    box-shadow: 0 0 10px rgba(124, 77, 255, 0.45);
}

body.theme-light .glass{
    background: linear-gradient(135deg, rgba(255,255,255,0.86), rgba(245,247,255,0.92));
    border-color: rgba(30, 50, 120, 0.18);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.02);
}

body.theme-light label{
    color: rgba(11, 16, 32, 0.92);
    opacity: 1;
}

body.theme-light select,
body.theme-light input[type="number"]{
    background: rgba(255,255,255,0.95);
    color: #0b1020;
    border-color: rgba(30, 50, 120, 0.25);
}

body.theme-light select:focus,
body.theme-light input[type="number"]:focus{
    border-color: rgba(124, 77, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(124, 77, 255, 0.25);
    background: rgba(255,255,255,1);
}

body.theme-light .tab-btn{
    background: rgba(255,255,255,0.88);
    color: #1b2550;
    border-color: rgba(30, 50, 120, 0.25);
}

body.theme-light .tab-btn:hover{
    background: rgba(245,247,255,0.96);
    border-color: rgba(124, 77, 255, 0.7);
}

body.theme-light .chip-btn{
    background: rgba(255,255,255,0.88);
    color: #1b2550;
    border-color: rgba(30, 50, 120, 0.25);
}

body.theme-light .chip-btn:hover{
    background: rgba(245,247,255,0.96);
    border-color: rgba(124, 77, 255, 0.7);
}

body.theme-light .status-bar{
    background: rgba(255,255,255,0.92);
    border-color: rgba(30, 50, 120, 0.22);
    color: rgba(11, 16, 32, 0.85);
}

body.theme-light .table-wrapper,
body.theme-light .compare-chart-wrapper{
    background: radial-gradient(circle at top, rgba(255,255,255,0.96), rgba(245,247,255,0.96));
    border-color: rgba(30, 50, 120, 0.18);
}

body.theme-light .funds-table thead,
body.theme-light .compare-table thead{
    background: linear-gradient(90deg, rgba(255,255,255,0.98), rgba(242,245,255,0.98));
}

body.theme-light .funds-table th,
body.theme-light .funds-table td,
body.theme-light .compare-table th,
body.theme-light .compare-table td{
    border-bottom-color: rgba(30, 50, 120, 0.12);
    color: rgba(11, 16, 32, 0.92);
}

body.theme-light .funds-table tbody tr:nth-child(odd){
    background: rgba(255,255,255,0.85);
}

body.theme-light .funds-table tbody tr:nth-child(even){
    background: rgba(245,247,255,0.88);
}

body.theme-light .funds-table tbody tr:hover{
    background: rgba(235,240,255,0.95);
}

body.theme-light .compare-table tbody tr:nth-child(odd){
    background: rgba(255,255,255,0.85);
}

body.theme-light .compare-table tbody tr:nth-child(even){
    background: rgba(245,247,255,0.9);
}

body.theme-light .table-subtext{
    color: rgba(11, 16, 32, 0.62);
}

body.theme-light .a11y-panel{
    background: rgba(255,255,255,0.96);
    border-color: rgba(30, 50, 120, 0.22);
    color: #0b1020;
}

body.theme-light .a11y-btn{
    background: rgba(245,247,255,0.96);
    border-color: rgba(30, 50, 120, 0.20);
    color: #0b1020;
}

body.theme-light .a11y-btn:hover{
    background: rgba(235,240,255,0.98);
    border-color: rgba(124, 77, 255, 0.55);
}

body.theme-light .funds-table tr.best-fund td:nth-child(2)::before{
    background: rgba(255,255,255,0.96);
    color: #0b1020;
    border-color: rgba(30, 50, 120, 0.22);
}
/* ===== Disclaimer מתחת לטבלה ===== */
.table-disclaimer {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.5;
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.45);
    color: #ffe8a1;
}
/* ===== Disclaimer – התאמה למצב יום ===== */
body.theme-light .table-disclaimer {
    background: rgba(255, 193, 7, 0.22);
    border: 1px solid rgba(255, 152, 0, 0.6);
    color: #5a4300; /* טקסט כהה וברור */
}

body.theme-light .table-disclaimer strong {
    color: #3e2e00;
}


.table-disclaimer strong {
    font-weight: 600;
}

/* אופציונלי: קצת פחות “אוויר” בתוך הרוחב */
#viewRentBuy .calc-grid{
  grid-template-columns: 340px 1fr; /* היה 360px 1fr */
}

@media (max-width: 980px){
  #viewRentBuy .calc-grid{ grid-template-columns: 1fr; }
}
/* ===== Coming Soon – קנייה מול שכירות ===== */
#viewRentBuy .coming-soon{
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.coming-soon-inner{
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.coming-soon-text{
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #18ffff, #7c4dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.coming-soon-sub{
  font-size: 0.95rem;
  opacity: 0.7;
}



/* ==========================================================
   FIX: Mortgage (Shpitzer) – keep chart labels & disclaimer inside card
   ========================================================== */

/* Ensure calculator cards clip inner visuals (prevents canvas text leaking) */
.calculator-card{
  overflow: hidden;
}

/* Defensive: prevent any calc sections from forcing wider than card */
.calc-output,
.calc-table-wrap,
.table-disclaimer,
.calc-chart-wrap,
.table-scroll{
  max-width: 100%;
  box-sizing: border-box;
}

/* Canvas should never exceed its wrapper */
.calc-chart-wrap canvas{
  display: block;
  max-width: 100%;
}

/* Extra padding on the chart wrapper so Y-axis labels never touch the border */
#viewRentBuy .calc-chart-wrap{
  padding: 14px 14px 12px;
}

/* If Chart.js sets a large internal size, still clip */
#viewRentBuy .calc-output{
  min-width: 0;
}


/* ===== כוח הריבית דריבית: סליידר ואנימציה ===== */
.range-wrap{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:10px 10px 12px;
  border-radius:14px;
  border:1px solid rgba(132, 150, 255, 0.35);
  background: rgba(4, 7, 22, 0.55);
}

.range-wrap input[type="range"]{
  width:100%;
  accent-color: #18ffff;
}

.range-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:0.9rem;
}

.range-sub{
  opacity:0.75;
  font-size:0.85rem;
}



/* ===== Kid Savings (Compound Animation) ===== */
.range-meta{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:0.6rem;
    margin-top:0.3rem;
}

input[type="range"]{
    width:100%;
    accent-color: #18ffff;
}

.kid-anim{
    margin-top: 0.85rem;
    position: relative;
    height: 44px;
    border-radius: 14px;
    border: 1px dashed rgba(120, 143, 255, 0.45);
    background: rgba(4, 7, 22, 0.55);
    overflow:hidden;
}

.kid-coin{
    position:absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.0;
}

.kid-anim.is-running .kid-coin{
    opacity: 1;
    animation: coinDrop 0.65s infinite;
}

@keyframes coinDrop{
    0%{ transform: translateY(-50%) translateX(0); opacity: 0.15; }
    40%{ transform: translateY(-50%) translateX(45px); opacity: 1; }
    100%{ transform: translateY(-50%) translateX(85px); opacity: 0.0; }
}

body.a11y-no-animations .kid-anim.is-running .kid-coin{
    animation: none !important;
}


/* ===== Info icon for disclaimer scroll ===== */
.info-scroll-btn{
    border:1px solid rgba(132, 150, 255, 0.55);
    background: rgba(6, 11, 35, 0.75);
    color:#d0d4ff;
    width:34px;
    height:34px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.info-scroll-btn:hover{
    border-color:#18ffff;
    background: rgba(10, 17, 53, 0.92);
    transform: translateY(-1px);
}
.filters-header .header-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:0.75rem;
    flex-wrap:wrap;
}

/* ===========================
   Cookie banner + footer links
   =========================== */
.footer-links a{
  color:#cfd6ff;
  text-decoration:none;
  border-bottom: 1px dashed rgba(24,255,255,0.35);
}
.footer-links a:hover{
  color:#18ffff;
  border-bottom-color: rgba(24,255,255,0.75);
}
.footer-sep{
  opacity:0.65;
  margin:0 0.45rem;
}

.cookie-banner{
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 9999;
  max-width: 980px;
  margin: 0 auto;
}
.cookie-inner{
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(132,150,255,0.35);
  background: rgba(6, 11, 35, 0.88);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
}
.cookie-title{
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.cookie-text{
  font-size: 0.88rem;
  line-height: 1.45;
  opacity: 0.95;
}
.cookie-link{
  color:#18ffff;
  text-decoration:none;
  border-bottom: 1px dashed rgba(24,255,255,0.55);
}
.cookie-link:hover{ border-bottom-color: rgba(24,255,255,0.9); }

.cookie-actions{
  display:flex;
  gap:0.6rem;
  margin-top:0.75rem;
  flex-wrap:wrap;
}

.cookie-btn-primary{
  background: linear-gradient(135deg, rgba(24,255,255,0.95), rgba(124,77,255,0.95));
  border: 1px solid rgba(24,255,255,0.7);
  color:#050609;
}
.cookie-btn-ghost{
  background: rgba(10, 16, 40, 0.55);
  border: 1px solid rgba(132,150,255,0.35);
  color:#d6dbff;
}

.cookie-hidden{
  display:none !important;
}

@media (max-width: 720px){
  .cookie-banner{
    inset: auto 0.75rem 0.75rem 0.75rem;
  }
  .cookie-inner{
    padding: 0.85rem 0.85rem;
    border-radius: 16px;
  }
}


/* ===== Articles Hub + Article Pages (Authority System) ===== */
.articles-hub-head .muted, .muted { opacity: .78; }

.articles-toolbar{
  display:flex;
  gap:0.8rem;
  flex-wrap:wrap;
  align-items:center;
  margin-top:0.8rem;
}
.article-search{
  flex: 1 1 260px;
  padding:0.55rem 0.8rem;
  border-radius: 999px;
  border:1px solid rgba(132,150,255,0.45);
  background: rgba(4, 7, 20, 0.9);
  color:#f7f7ff;
  outline:none;
}
.article-search:focus{
  border-color:#18ffff;
  box-shadow: 0 0 0 1px rgba(24,255,255,0.35);
}

.article-tags{ display:flex; gap:0.5rem; flex-wrap:wrap; }
.tag-filter.is-active{
  background: linear-gradient(135deg, rgba(24,255,255,0.95), rgba(124,77,255,0.95));
  color:#050609;
  border-color: rgba(24,255,255,0.9);
}

.articles-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:1rem;
  margin-top:1rem;
}
.article-card{
  display:block;
  text-decoration:none;
  color:#f7f7ff;
  padding:1rem;
  border-radius:18px;
  border:1px solid rgba(132,150,255,0.35);
  background: rgba(6, 11, 35, 0.78);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.article-card:hover{
  transform: translateY(-2px);
  border-color:#18ffff;
  box-shadow: 0 12px 30px rgba(24, 255, 255, 0.18);
}
.article-kicker{
  font-size:0.78rem;
  opacity:0.8;
  margin-bottom:0.35rem;
}

.article-page{
  max-width: 920px;
  margin: 0 auto;
  line-height: 1.8;
}
.breadcrumbs{
  font-size:0.85rem;
  opacity:0.75;
  margin-bottom:0.75rem;
}
.article-hero{
  padding:0.9rem 1rem;
  border-radius:14px;
  background: rgba(24,255,255,0.08);
  border: 1px solid rgba(24,255,255,0.35);
  margin: 0.8rem 0 1rem;
}
.article-meta{
  display:flex;
  gap:0.7rem;
  flex-wrap:wrap;
  opacity:0.85;
  font-size:0.9rem;
  margin: 0.6rem 0 1rem;
}
#toc{
  margin: 1rem 0 1.2rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(132,150,255,0.35);
  background: rgba(2, 6, 20, 0.55);
}
#toc ul{ margin:0; padding:0 1.1rem 0 0; }
#toc li{ margin:0.25rem 0; }
#toc a{ color:#d6dbff; text-decoration:none; }
#toc a:hover{ text-decoration:underline; }

.related-articles{
  margin-top: 1.7rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(132,150,255,0.3);
}
.related-articles ul{ margin:0.6rem 0 0; padding:0 1.1rem 0 0; }
.related-articles a{ color:#d6dbff; }


/* ===== Top Performer Bar ===== */
.top-performers-card{
    margin-top: 1rem;
    padding: 1.1rem 1.2rem;
}
.top-performers-header{
    display:flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.top-performers-header h3{
    margin:0;
    font-size: 1.05rem;
}
.top-performer-bar{
    display:flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: stretch;
}
.tp-item{
    flex: 1 1 190px;
    min-width: 190px;
    border-radius: 16px;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(132, 150, 255, 0.35);
    background: radial-gradient(circle at top, rgba(24,255,255,0.12), rgba(6,10,32,0.92));
    box-shadow: 0 10px 26px rgba(0,0,0,0.45);
    display:flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    overflow: hidden;
}
.tp-item::after{
    content:"";
    position:absolute;
    inset:auto -40% -55% -40%;
    height: 120%;
    background: radial-gradient(circle at center, rgba(124,77,255,0.22), rgba(0,0,0,0));
    transform: rotate(-8deg);
    pointer-events:none;
}
.tp-top{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}
.tp-label{
    font-size: 0.82rem;
    opacity: 0.9;
    white-space: nowrap;
}
.tp-badge{
    font-size: 0.78rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(24,255,255,0.45);
    background: rgba(24,255,255,0.12);
    color: rgba(240,255,255,0.95);
    white-space: nowrap;
}
.tp-name{
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
    position: relative;
    z-index: 1;
}
.tp-value{
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(24,255,255,0.95);
    position: relative;
    z-index: 1;
}
.tp-item .muted{
    opacity: 0.75;
}

/* מצב יום */
body.theme-light .tp-item{
    border-color: rgba(30, 50, 120, 0.18);
    background: radial-gradient(circle at top, rgba(124,77,255,0.10), rgba(255,255,255,0.92));
    box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}
body.theme-light .tp-badge{
    border-color: rgba(124,77,255,0.45);
    background: rgba(124,77,255,0.10);
    color: rgba(11,16,32,0.92);
}
body.theme-light .tp-value{
    color: rgba(30, 50, 120, 0.92);
}
