/* GoldScore — warm charcoal & gold theme with a light variant ([data-theme] on <html>). Logical properties keep RTL (Hebrew) working. */
:root,
[data-theme="dark"] {
  --bg: #0b0a08;
  --bg-2: #12110e;
  --panel: #161410;
  --panel-2: #1c1a15;
  --panel-hi: #25221b;
  --border: #2a2620;
  --border-hi: #3b362c;
  --text: #f2ede3;
  --text-2: #c0b7a7;
  --muted: #8c8376;
  --gold: #e0b252;
  --gold-hi: #f3cd76;
  --gold-dim: #8f6d2a;
  --gold-bg: rgba(224, 178, 82, .12);
  --gold-line: rgba(224, 178, 82, .45);
  --on-gold: #1a1305;
  --link: #ecc671;
  --blue: #7aa7ff;
  --blue-bg: rgba(122, 167, 255, .12);
  --up: #3ccf86;
  --down: #f06a64;
  --warn: #e8a645;
  --violet: #c7a0ff;
  --warn-bg: rgba(232, 166, 69, .12);
  --bad-bg: rgba(240, 106, 100, .12);
  --ok-bg: rgba(60, 207, 134, .12);
  --warn-text: #f4d39e;
  --bad-text: #ffc6c2;
  --info-text: #d5e2ff;
  --ok-text: #bff1d6;
  --hero-num: #fff3d6;
  --hover: rgba(255, 244, 220, .035);
  --header-bg: rgba(11, 10, 8, .8);
  --scrim: rgba(0, 0, 0, .55);
  --shadow: 0 1px 0 rgba(255, 244, 220, .03) inset, 0 10px 30px rgba(0, 0, 0, .3);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, .55);
  --glow: radial-gradient(900px 420px at 85% -120px, rgba(224, 178, 82, .09), transparent 70%);
  /* chart colours (6-digit hex; charts append an alpha suffix) */
  --c1: #e0b252; --c2: #7aa7ff; --c3: #3cc7b4; --c4: #b893ff; --c5: #f0904f; --c6: #e873a8;
  --c-up: #3ccf86; --c-down: #f06a64; --c-flat: #8c8376;
  --ch-grid: rgba(220, 200, 160, .07); --ch-tick: #8c8376; --ch-legend: #c0b7a7;
  --ch-tip-bg: #1c1a15; --ch-tip-border: #3b362c; --ch-tip-title: #f2ede3; --ch-tip-body: #d9d1c3;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f3ec;
  --bg-2: #efeadf;
  --panel: #ffffff;
  --panel-2: #faf7f1;
  --panel-hi: #f1ebdf;
  --border: #e6dece;
  --border-hi: #d4c9b3;
  --text: #1c1913;
  --text-2: #4b4438;
  --muted: #7a7162;
  --gold: #9c6f12;
  --gold-hi: #845d0c;
  --gold-dim: #cfa955;
  --gold-bg: rgba(176, 128, 26, .1);
  --gold-line: rgba(156, 111, 18, .45);
  --on-gold: #1a1305;
  --link: #8a5f08;
  --blue: #2c5fcc;
  --blue-bg: rgba(44, 95, 204, .08);
  --up: #12804a;
  --down: #c5342e;
  --warn: #a2650a;
  --violet: #6f45c9;
  --warn-bg: rgba(200, 130, 20, .1);
  --bad-bg: rgba(197, 52, 46, .08);
  --ok-bg: rgba(18, 128, 74, .08);
  --warn-text: #74470a;
  --bad-text: #8d1f1a;
  --info-text: #1e449d;
  --ok-text: #0c5f36;
  --hero-num: #17140f;
  --hover: rgba(80, 60, 20, .035);
  --header-bg: rgba(246, 243, 236, .86);
  --scrim: rgba(30, 24, 12, .35);
  --shadow: 0 1px 2px rgba(70, 52, 20, .05), 0 6px 20px rgba(70, 52, 20, .05);
  --shadow-pop: 0 16px 44px rgba(70, 52, 20, .16);
  --glow: radial-gradient(900px 420px at 85% -120px, rgba(214, 166, 60, .14), transparent 70%);
  --c1: #b5850f; --c2: #2c5fcc; --c3: #0f9488; --c4: #7a4cd4; --c5: #d0661f; --c6: #c43d7f;
  --c-up: #12804a; --c-down: #c5342e; --c-flat: #7a7162;
  --ch-grid: rgba(70, 52, 20, .08); --ch-tick: #7a7162; --ch-legend: #4b4438;
  --ch-tip-bg: #ffffff; --ch-tip-border: #d4c9b3; --ch-tip-title: #1c1913; --ch-tip-body: #4b4438;
  color-scheme: light;
}
:root {
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 62px;
  --wrap: 1480px;
  --gutter: 28px;
  --font: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--glow), var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font: 14.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only:focus { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; width: auto; height: auto; clip: auto; z-index: 200; padding: 8px 12px; background: var(--gold); color: var(--on-gold); border-radius: var(--radius-sm); }
::selection { background: var(--gold-bg); }

/* ---------- header & top navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 30; }
/* blur sits on a pseudo-element so the fixed mobile drawer inside the header is not trapped by it */
.site-header::before { content: ""; position: absolute; inset: 0; background: var(--header-bg); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--border); z-index: -1; }
.hdr { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); height: var(--header-h); display: flex; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #f7d684, #c4952f 55%, #7d5c1b); color: #1a1205; font-weight: 800; font-size: 14px; letter-spacing: -.02em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset, 0 6px 18px rgba(224, 178, 82, .28);
}
.brand-name { font-weight: 750; letter-spacing: -.01em; font-size: 18px; direction: ltr; unicode-bidi: isolate; }
.brand-name span { color: var(--gold); }

.nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav-top {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 560; font-size: 14px; text-decoration: none; background: none; border: 0; cursor: pointer; white-space: nowrap; position: relative;
}
.nav-top:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.nav-top > svg { width: 17px; height: 17px; flex: none; opacity: .8; }
button.nav-top > svg { width: 14px; height: 14px; opacity: .6; transition: transform .15s ease; }
.nav-top[aria-current="page"], .nav-group.active > .nav-top { color: var(--gold-hi); }
.nav-top[aria-current="page"]::after, .nav-group.active > .nav-top::after {
  content: ""; position: absolute; inset-inline: 12px; bottom: -12px; height: 2px; border-radius: 2px; background: var(--gold);
}
.nav-group { position: relative; }
.nav-group.open > .nav-top { color: var(--text); background: var(--hover); }
.nav-group.open > .nav-top > svg { transform: rotate(180deg); }
.nav-menu {
  position: absolute; inset-block-start: calc(100% + 10px); inset-inline-start: 0; min-width: 236px; padding: 6px;
  background: var(--panel); border: 1px solid var(--border-hi); border-radius: 12px; box-shadow: var(--shadow-pop);
  display: none; flex-direction: column; gap: 1px; z-index: 40;
}
.nav-group.open > .nav-menu { display: flex; animation: pop .14s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; color: var(--text-2); font-weight: 520; text-decoration: none; }
.nav-menu a svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.nav-menu a:hover { background: var(--hover); color: var(--text); }
.nav-menu a[aria-current="page"] { background: var(--gold-bg); color: var(--gold-hi); }
.nav-menu a[aria-current="page"] svg { opacity: 1; }
.nav-foot { display: none; }

.hdr-end { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-2); cursor: pointer; padding: 0; text-decoration: none;
}
.icon-btn:hover { color: var(--gold-hi); border-color: var(--border-hi); text-decoration: none; }
.icon-btn[aria-current="page"] { color: var(--gold-hi); border-color: var(--gold-line); background: var(--gold-bg); }
.icon-btn svg { width: 18px; height: 18px; display: block; }
.menu-btn { display: none; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text-2); font-size: 12.5px; font-weight: 550; white-space: nowrap; text-decoration: none;
}
.status-pill:hover { color: var(--text); border-color: var(--border-hi); text-decoration: none; }

/* ---------- page ---------- */
.page { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); min-width: 0; }
.page-head { padding: 26px 0 4px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; margin: 0; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.page-head .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.page-tabs { display: flex; gap: 4px; margin-top: 16px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tabs a { padding: 9px 14px; color: var(--text-2); font-weight: 560; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.page-tabs a:hover { color: var(--text); text-decoration: none; }
.page-tabs a[aria-current="page"] { color: var(--gold-hi); border-bottom-color: var(--gold); }
.content { padding: 18px 0 56px; width: 100%; flex: 1; outline: none; }
.disclaimer-bar { font-size: 12px; color: var(--muted); padding: 18px 0 26px; border-top: 1px solid var(--border); line-height: 1.6; }

/* ---------- grid & panels ---------- */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.g-auto-wide { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
.dash-top { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; min-width: 0;
}
.panel.flush { padding: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); font-weight: 680; margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.panel-title.gold { color: var(--gold); }
.panel-sub { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin: 34px 0 12px; font-weight: 720; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-hi), transparent); }
.section-title:first-child { margin-top: 4px; }
.section-note { color: var(--muted); font-size: 13px; margin: -4px 0 14px; max-width: 980px; }

/* ---------- value cards ---------- */
.card { position: relative; display: flex; flex-direction: column; gap: 7px; cursor: default; }
.card.clickable { cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.card.clickable:hover { border-color: var(--border-hi); transform: translateY(-1px); }
.card.selected { border-color: var(--gold-line); box-shadow: 0 0 0 1px var(--gold-bg) inset, var(--shadow); }
.card-name { font-size: 13px; color: var(--text-2); font-weight: 620; display: flex; gap: 6px; align-items: center; min-height: 18px; }
.card-value { font-size: 25px; font-weight: 720; letter-spacing: -.02em; line-height: 1.15; }
.card-value .unit { font-size: 12px; color: var(--muted); font-weight: 500; margin-inline-start: 4px; letter-spacing: 0; }
.card-value.xl { font-size: 46px; color: var(--hero-num); letter-spacing: -.03em; }
.card-change { font-size: 13.5px; font-weight: 650; display: flex; gap: 8px; flex-wrap: wrap; }
.card-meta { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.card-meta a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border-hi); text-underline-offset: 2px; }
.card-meta a:hover { color: var(--text-2); }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--text-2); }
.na { color: var(--muted); font-weight: 500; }
.spark { height: 48px; margin-top: 2px; }
.ohlc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; font-size: 13px; margin: 10px 0 8px; }
.ohlc div { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-weight: 600; }
.ohlc span { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 680; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-hi); color: var(--text-2); text-transform: uppercase; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.b-fresh { color: var(--up); border-color: color-mix(in srgb, var(--up) 38%, transparent); background: var(--ok-bg); }
.b-delayed, .b-market_closed { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 38%, transparent); background: var(--warn-bg); }
.b-stale, .b-error { color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent); background: var(--bad-bg); }
.b-missing, .b-not_configured { color: var(--muted); border-color: var(--border-hi); background: transparent; }
.b-estimate { color: var(--gold); border-color: var(--gold-line); background: var(--gold-bg); }
.b-info { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 38%, transparent); background: var(--blue-bg); }
.b-prelim { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 38%, transparent); background: color-mix(in srgb, var(--violet) 9%, transparent); }
.badges { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn {
  background: var(--panel-2); border: 1px solid var(--border-hi); color: var(--text); border-radius: var(--radius-sm);
  padding: 7px 14px; cursor: pointer; font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; text-decoration: none;
}
.btn:hover { border-color: var(--gold-dim); background: var(--panel-hi); text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #ebc260, #c9972c); color: var(--on-gold); border-color: #c4922a; font-weight: 720; box-shadow: 0 4px 14px rgba(224, 178, 82, .2); }
.btn.primary:hover { background: linear-gradient(180deg, #f2cd70, #d3a33a); }
.btn.danger { border-color: color-mix(in srgb, var(--down) 50%, transparent); color: var(--down); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-2); padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; padding: 4px 10px; font-size: 12px; color: var(--text-2); cursor: pointer; font-weight: 620; border-radius: 7px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--gold-bg); color: var(--gold-hi); box-shadow: 0 0 0 1px var(--gold-line) inset; }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=number], select, textarea {
  background: var(--bg-2); border: 1px solid var(--border-hi); border-radius: var(--radius-sm); padding: 7px 10px; min-height: 36px; color: var(--text); max-width: 100%;
}
textarea { width: 100%; min-height: 90px; font-family: var(--mono); font-size: 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px var(--gold-bg); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 550; max-width: 100%; min-width: 0; }
.chip {
  display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-hi);
  background: var(--bg-2); color: var(--text-2); font-size: 12.5px; cursor: pointer; font-weight: 580;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { border-color: var(--gold-line); background: var(--gold-bg); color: var(--gold-hi); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }

/* ---------- charts ---------- */
.chart-box { position: relative; height: 300px; }
.chart-box.tall { height: 390px; }
.chart-box.short { height: 200px; }
.chart-box canvas { position: absolute; inset: 0; }
.chart-foot { font-size: 12px; color: var(--muted); margin-top: 10px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: start; font-size: 11.5px; font-weight: 680; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 9px 12px; border-bottom: 1px solid var(--border-hi); white-space: nowrap; background: var(--panel-2); position: sticky; top: 0; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data td.r, table.data th.r { text-align: end; }
table.data tr:hover td { background: var(--hover); }
table.data tr.day-row td { background: var(--panel-2); color: var(--gold); font-weight: 680; font-size: 12px; letter-spacing: .04em; }
table.data tr.past td { opacity: .75; }

/* ---------- lists ---------- */
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.facts li { padding: 9px 2px; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.facts li:last-child { border-bottom: 0; }
.facts .src { color: var(--muted); font-size: 12px; }
.facts-table td { padding-top: 8px; padding-bottom: 8px; }
.facts-table td:first-child { font-weight: 500; }
.facts-table td:last-child { white-space: nowrap; }
@media (max-width: 520px) { table.data.facts-table td { padding-inline: 5px; font-size: 13px; } }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item { padding: 14px 2px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.news-item:last-child { border-bottom: 0; }
.news-item h3 { margin: 0; font-size: 15px; font-weight: 640; line-height: 1.4; }
.news-item h3 a { color: var(--text); }
.news-item h3 a:hover { color: var(--gold-hi); text-decoration: none; }
.news-item .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.news-item p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.news-item details.excerpt { font-size: 13px; }
.news-item details.excerpt summary { cursor: pointer; width: fit-content; color: var(--gold-hi); }
.news-item .excerpt-text { white-space: pre-line; margin: 6px 0 4px; padding: 10px 12px; border-inline-start: 2px solid var(--gold-dim); background: var(--panel-2); border-radius: var(--radius-sm); color: var(--text-2); line-height: 1.65; }
.news-item details.orig { font-size: 12px; color: var(--muted); }
.news-item details.orig summary { cursor: pointer; width: fit-content; }
.news-item details.orig > div { margin-top: 4px; padding: 6px 8px; border-inline-start: 2px solid var(--border); text-align: left; color: var(--text-2); }
.compact .news-item { padding: 10px 2px; }
.compact .news-item h3 { font-size: 14px; }

/* ---------- states ---------- */
.empty { border: 1px dashed var(--border-hi); border-radius: var(--radius); padding: 20px; color: var(--text-2); background: var(--panel-2); font-size: 13.5px; }
.empty strong { color: var(--text); }
.empty.small { padding: 11px 13px; font-size: 13px; }
.notice { border-radius: var(--radius-sm); padding: 10px 13px; font-size: 13px; border: 1px solid; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-bg); color: var(--warn-text); }
.notice.bad { border-color: color-mix(in srgb, var(--down) 45%, transparent); background: var(--bad-bg); color: var(--bad-text); }
.notice.info { border-color: color-mix(in srgb, var(--blue) 35%, transparent); background: var(--blue-bg); color: var(--info-text); }
.notice.ok { border-color: color-mix(in srgb, var(--up) 40%, transparent); background: var(--ok-bg); color: var(--ok-text); }
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--panel-hi), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-panel { min-height: 120px; }
.fade-in { animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.status-dot.ok { background: var(--up); box-shadow: 0 0 0 3px var(--ok-bg); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.status-dot.bad { background: var(--down); box-shadow: 0 0 0 3px var(--bad-bg); }
.countdown { font-variant-numeric: tabular-nums; color: var(--gold-hi); font-weight: 650; white-space: nowrap; }
.ai-panel { border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.ai-panel h4 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.ai-panel ul { margin: 0; padding-inline-start: 18px; }
.ai-panel li { margin: 3px 0; }
.cite { font-size: 10.5px; color: var(--blue); margin-inline-start: 3px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.gold-text { color: var(--gold); }
details.more summary { cursor: pointer; color: var(--text-2); font-size: 12.5px; }
details.more[open] summary { margin-bottom: 6px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.hr { height: 1px; background: var(--border); margin: 14px 0; }
.mt { margin-top: 16px; }
.toast { position: fixed; inset-block-end: 18px; inset-inline-end: 18px; z-index: 100; max-width: min(420px, calc(100vw - 36px)); }
.toast .notice { box-shadow: var(--shadow-pop); }

/* misc */
.mt-xs { margin-top: 4px; }
pre[data-log-out] { max-height: 420px; overflow: auto; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; white-space: pre-wrap; word-break: break-all; margin: 10px 0 0; }
pre[data-log-out]:empty { display: none; }
code { font-family: var(--mono); font-size: 12px; background: var(--panel-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }
a[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.card .card { padding: 0; border: 0; background: none; box-shadow: none; }

/* ---------- right-to-left (Hebrew) ---------- */
[dir="rtl"] body { font-family: "Segoe UI Variable Text", "Segoe UI", "Noto Sans Hebrew", "Arial Hebrew", Rubik, Arial, system-ui, sans-serif; }
[dir="rtl"] .panel-title, [dir="rtl"] .section-title, [dir="rtl"] .badge, [dir="rtl"] table.data th, [dir="rtl"] .ohlc span, [dir="rtl"] .ai-panel h4 { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .section-title { font-size: 15px; }
[dir="rtl"] .section-title::after { background: linear-gradient(270deg, var(--border-hi), transparent); }
[dir="rtl"] .panel-title { font-size: 13.5px; }
[dir="rtl"] table.data th { font-size: 12.5px; }
[dir="rtl"] .card-value { text-align: start; }
[dir="rtl"] table.data td.r, [dir="rtl"] table.data th.r { text-align: left; }
[dir="rtl"] code, [dir="rtl"] pre { direction: ltr; unicode-bidi: isolate; }

/* ---------- Learning Center ---------- */
.info-btn { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid var(--border-hi); background: var(--panel-2); color: var(--text-2); font: italic 700 11px/1 Georgia, "Times New Roman", serif; cursor: pointer; flex: none; vertical-align: middle; }
.info-btn:hover, .info-btn[aria-expanded="true"] { border-color: var(--gold-dim); color: var(--gold-hi); background: var(--gold-bg); }
.info-btn:focus-visible, .lesson-card:focus-visible, .quiz-opt:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.section-title .info-btn, .panel-title .info-btn { text-transform: none; letter-spacing: 0; }
.info-panel { position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 60; width: min(420px, 100vw); overflow-y: auto; background: var(--panel); border-inline-start: 1px solid var(--border-hi); box-shadow: var(--shadow-pop); padding: 20px 20px 30px; }
.info-panel[hidden] { display: none; }
.info-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.info-head h2 { margin: 2px 0 0; font-size: 18px; line-height: 1.3; outline: none; }
.info-body section { margin-top: 14px; }
.info-body h3, .lesson section h3 { margin: 0 0 4px; font-size: 13px; color: var(--gold); font-weight: 720; }
.info-body p, .lesson p { margin: 0 0 6px; color: var(--text-2); line-height: 1.65; }
.info-body .btn { margin-top: 10px; }
.eyebrow { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.limit { border-inline-start: 2px solid var(--warn); padding-inline-start: 8px; }
.example { background: var(--panel-2); border-radius: var(--radius-sm); padding: 9px 11px; }
.lesson-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; min-height: 118px; transition: border-color .15s ease, transform .15s ease; }
.lesson-card h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.lesson-card:hover { border-color: var(--gold-dim); transform: translateY(-1px); text-decoration: none; }
.lesson-card.done { border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.badge.lvl-1 { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); }
.badge.lvl-2 { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.badge.lvl-3 { color: var(--gold-hi); border-color: var(--gold-line); }
progress.progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--panel-hi); overflow: hidden; -webkit-appearance: none; appearance: none; }
progress.progress::-webkit-progress-bar { background: var(--panel-hi); }
progress.progress::-webkit-progress-value { background: var(--gold); }
progress.progress::-moz-progress-bar { background: var(--gold); }
.lesson { max-width: 860px; }
.lesson header h2 { margin: 6px 0; font-size: 23px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lesson section { margin-top: 18px; }
.lesson ul { margin: 0; padding-inline-start: 20px; color: var(--text-2); }
.lesson-actions { border-top: 1px solid var(--border); padding-top: 14px; }
.crumbs a { color: var(--text-2); }
.quiz fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.quiz legend { font-weight: 620; margin-bottom: 6px; color: var(--text); }
.quiz-opt { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.quiz-opt:hover { border-color: var(--border-hi); background: var(--hover); }
.quiz .btn { margin-top: 10px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.mini-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; background: var(--panel-2); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mini-name { font-size: 12.5px; color: var(--text-2); font-weight: 620; }
.mini-value { font-size: 17px; font-weight: 700; }
.mini-value .unit { font-size: 11px; color: var(--muted); font-weight: 500; }
.concept-map { list-style: none; margin: 14px 0 10px; padding: 0; display: flex; flex-direction: column; }
.cm-step { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 13px; background: var(--panel-2); }
.cm-step h3 { margin: 0; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.cm-step p { margin: 4px 0; }
.cm-value { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.cm-arrow { text-align: center; color: var(--gold); font-size: 16px; line-height: 1.6; }
.checklist { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cl-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold-bg); color: var(--gold-hi); font-size: 12px; margin-inline-end: 6px; }
.cl-items { list-style: none; margin: 10px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cl-items label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.checklist textarea { width: 100%; resize: vertical; font-family: var(--font); font-size: 13px; min-height: 70px; }
.mb { margin-bottom: 16px; }
body.beginner .card.core { border-color: var(--gold-line); box-shadow: 0 0 0 1px var(--gold-bg) inset, var(--shadow); }
@media (min-width: 1100px) {
  .concept-map { flex-direction: row; align-items: stretch; }
  .concept-map li { flex: 1 1 0; display: flex; align-items: center; min-width: 0; }
  .concept-map .cm-step { flex: 1; align-self: stretch; }
  .cm-arrow { padding: 0 4px; transform: rotate(-90deg); }
  [dir="rtl"] .cm-arrow { transform: rotate(90deg); }
  .cm-step h3 { flex-wrap: wrap; }
}

/* ---------- trading journal & analytics (private) ---------- */
.trading-status { padding: 12px 16px; }
.trading-status .row { gap: 10px; flex-wrap: wrap; }
.kpis { gap: 12px; }
.kpi { padding: 14px 16px; }
.kpi-value { font-size: 22px; font-weight: 720; margin-top: 2px; letter-spacing: -.02em; }
.kpi-value a { color: inherit; }
.filters { padding: 12px 16px; }
.filters summary { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.filters .span-2 { grid-column: span 2; }
table.data tr.clickable-row { cursor: pointer; }
table.data tr.clickable-row:focus-visible td { background: var(--panel-hi); }
table.data tfoot td { border-top: 1px solid var(--border-hi); font-weight: 650; }
.kv.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.kv.two > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.kv.two dd { text-align: end; }
.trade-title { margin: 0; font-size: 23px; letter-spacing: -.01em; }
.trade-result { text-align: end; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.trade-result .kpi-value { font-size: 28px; }
.kpi-r { font-size: 16px; font-weight: 650; }
.crumbs { gap: 10px; flex-wrap: wrap; }
.shots { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.shot { margin: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.shot img { display: block; max-width: 100%; max-height: 220px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-2); }
.shot-col label.btn { cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-cell { min-height: 80px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 9px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text-2); font: inherit; text-align: start; }
.cal-cell:disabled { cursor: default; opacity: .7; }
.cal-cell:not(:disabled) { cursor: pointer; }
.cal-cell:not(:disabled):hover { border-color: var(--border-hi); }
.cal-cell.empty-cell { border-color: transparent; background: transparent; }
.cal-cell.pos { background: var(--ok-bg); border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.cal-cell.neg { background: var(--bad-bg); border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.cal-cell.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
.cal-day { font-size: 12px; color: var(--muted); }
.cal-pnl { font-weight: 700; font-size: 14px; color: var(--text); }
.cal-meta { font-size: 11px; color: var(--text-2); }
ol.steps { margin: 6px 0; padding-inline-start: 20px; display: grid; gap: 4px; }
code.token { word-break: break-all; padding: 6px 8px; background: var(--bg-2); border: 1px solid var(--border-hi); border-radius: var(--radius-sm); font-size: 12.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-top { grid-template-columns: minmax(0, 1fr); }
  .status-label { display: none; }
  .status-pill { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 1100px) {
  :root { --gutter: 20px; }
  .menu-btn { display: inline-grid; }
  .hdr { gap: 12px; }
  .nav {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50; width: min(320px, 86vw);
    flex-direction: column; align-items: stretch; gap: 2px; padding: 18px 12px; overflow-y: auto;
    background: var(--panel); border-inline-end: 1px solid var(--border-hi); box-shadow: var(--shadow-pop);
    transform: translateX(-104%); transition: transform .2s ease; visibility: hidden;
  }
  [dir="rtl"] .nav { transform: translateX(104%); }
  .nav.open, [dir="rtl"] .nav.open { transform: none; visibility: visible; }
  .nav-top { height: 42px; width: 100%; }
  .nav-top[aria-current="page"] { background: var(--gold-bg); }
  .nav-top[aria-current="page"]::after, .nav-group.active > .nav-top::after { display: none; }
  button.nav-top { cursor: default; height: auto; padding: 16px 12px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: none; }
  [dir="rtl"] button.nav-top { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
  button.nav-top:hover, .nav-group.open > .nav-top { background: none; color: var(--muted); }
  .nav-group.active > button.nav-top { color: var(--gold); }
  button.nav-top > svg { display: none; }
  .nav-menu, .nav-group.open > .nav-menu { position: static; display: flex; min-width: 0; padding: 0; border: 0; box-shadow: none; background: none; animation: none; }
  .nav-foot { display: block; margin-top: auto; padding: 16px 12px 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
  .nav-foot p { margin: 6px 0 0; }
  /* below the header (z 30), whose stacking context holds the drawer */
  .scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 29; display: none; }
  .scrim.show { display: block; }
  .page-head .meta { display: none; }
}
@media (max-width: 960px) {
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .span-3 { grid-column: 1 / -1; }
  .kv.two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --header-h: 56px; }
  .hdr { gap: 8px; }
  .brand-name { font-size: 16px; }
  .brand-mark { width: 28px; height: 28px; font-size: 12.5px; }
  .icon-btn, .status-pill { width: 36px; height: 36px; }
  .page-head { padding-top: 18px; }
  .page-head h1 { font-size: 22px; }
  .panel { padding: 15px 15px; }
  .grid, .stack { gap: 12px; }
  .section-title { margin-top: 26px; }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .card-value { font-size: 22px; }
  .card-value.xl { font-size: 34px; }
  .chart-box { height: 240px; }
  .chart-box.tall { height: 300px; }
  .ohlc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-auto, .g-auto-wide { grid-template-columns: 1fr; }
  .info-panel { inset-block-start: auto; inset-inline: 0; width: 100%; max-height: 78vh; border-inline-start: 0; border-top: 1px solid var(--border-hi); border-radius: 16px 16px 0 0; }
  .info-btn { width: 22px; height: 22px; }
  .lesson-card { min-height: 0; }
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 56px; padding: 4px; }
  .cal-meta { display: none; }
  .cal-pnl { font-size: 11.5px; }
  .filters .span-2 { grid-column: auto; }
  .trade-result { align-items: flex-start; text-align: start; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 11px 12px; }
  .kpi-value { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Market Intelligence ---------- */
.mi-two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.mi-two .panel-head { flex-wrap: wrap; }
.mi-table td { vertical-align: middle; }
.mi-table td:first-child { min-width: 150px; }
.mi-name { gap: 6px; flex-wrap: nowrap; }
.mi-h4 { margin: 14px 0 6px; font-size: 12.5px; color: var(--text-2); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.mi-list { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.mi-ind .card-value { font-size: 24px; }
table.data tr.mi-major td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
[dir="rtl"] table.data tr.mi-major td:first-child { box-shadow: inset -3px 0 0 var(--gold); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 640px; overflow-y: auto; }
.tl-item { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 0; }
.tl-time { color: var(--gold-hi); font-weight: 650; font-size: 13px; padding-top: 1px; }
.tl-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.tl-head { display: flex; gap: 5px; flex-wrap: wrap; }
.tl-body a { color: var(--text); font-weight: 600; }
.tl-body a:hover { color: var(--gold-hi); }
.corr-bar { position: relative; width: 120px; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.corr-bar::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 50%; width: 1px; background: var(--border-hi); }
.corr-fill { position: absolute; inset-block: 0; display: block; }
.corr-fill.pos { inset-inline-start: 50%; background: var(--up); }
.corr-fill.neg { inset-inline-end: 50%; background: var(--down); }
.corr-fill.w0 { width: 0; } .corr-fill.w5 { width: 5%; } .corr-fill.w10 { width: 10%; } .corr-fill.w15 { width: 15%; } .corr-fill.w20 { width: 20%; }
.corr-fill.w25 { width: 25%; } .corr-fill.w30 { width: 30%; } .corr-fill.w35 { width: 35%; } .corr-fill.w40 { width: 40%; } .corr-fill.w45 { width: 45%; } .corr-fill.w50 { width: 50%; }
.brief-block .panel-title { margin-bottom: 8px; }
.know-today { border-color: var(--gold-line); }
@media (max-width: 1100px) { .mi-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .tl-item { grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
  .corr-bar { width: 70px; }
}

/* ---------- simple view: details on demand ---------- */
body:not(.show-all) #content .panel:not(.show-details) :is(.panel-sub, .chart-foot, .verbose, details.more, .notice.info, p.small.muted, div.small.muted),
body:not(.show-all) #content .panel:not(.show-details) .card-meta > :not(.keep) { display: none; }
/* a chart without data still says why */
#content .chart-box[style*="none"] + .chart-foot { display: flex !important; }
body:not(.show-all) #content .section-note { display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
body:not(.show-all) #content .section-note.open { display: block; }
body:not(.show-all) #content .section-note:not(.open)::after { content: ""; }
.details-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; padding: 3px 0; background: none; border: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.details-btn::after { content: "▾"; font-size: 11px; }
.details-btn[aria-expanded="true"]::after { content: "▴"; }
.details-btn:hover { color: var(--gold-hi); }
body.show-all .details-btn { display: none; }
.brief { border-color: var(--gold-line); }
.brief-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.brief-line { display: flex; gap: 10px; align-items: baseline; }
.brief-arrow { flex: none; width: 16px; text-align: center; font-size: 12px; color: var(--muted); }
.brief-note { color: var(--muted); margin: 12px 0 0; }
.mb-xs { margin-bottom: 8px; }
