:root {
  --bg: #0b1220; --surface: #121a2b; --surface-2: #19233a; --line: #243049;
  --text: #e8ecf4; --muted: #8f9bb3; --gold: #e5b53c; --gold-ink: #1a1405;
  --up: #34c38f; --down: #f1626b; --radius: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Cairo', system-ui, sans-serif; line-height: 1.7; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; margin-top: 2em; }
h2 small { color: var(--muted); font-weight: 400; font-size: .8em; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }
.sec { padding-top: 40px; padding-bottom: 8px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sec-head h2 { margin-top: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.up { color: var(--up); } .down { color: var(--down); }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(11,18,32,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); margin-inline-end: auto; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a[aria-current] { color: var(--text); background: var(--surface-2); text-decoration: none; }
.lang, .burger { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 4px 12px; font: inherit; cursor: pointer; }
.lang:hover { border-color: var(--gold); }
.burger { display: none; padding: 0 10px; }

/* hero */
.hero { padding: 72px 0 56px; background: radial-gradient(900px 300px at 50% 0, rgba(229,181,60,.14), transparent), var(--bg); border-bottom: 1px solid var(--line); }
.hero p { max-width: 620px; color: var(--muted); font-size: 1.1rem; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* buttons, tags, chips */
.btn { display: inline-block; background: var(--gold); color: var(--gold-ink); font-weight: 700; padding: 10px 20px; border-radius: 10px; border: 0; font: inherit; font-weight: 700; cursor: pointer; text-align: center; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.btn.sm { padding: 4px 14px; font-size: .85rem; white-space: nowrap; }
.tag { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: var(--surface-2); }
.tag.buy, .tag.win { color: var(--up); background: rgba(52,195,143,.12); }
.tag.sell, .tag.loss { color: var(--down); background: rgba(241,98,107,.12); }
.tag.open { color: var(--gold); background: rgba(229,181,60,.12); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }
.chip { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 99px; padding: 4px 16px; font: inherit; cursor: pointer; }
.chip.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 700; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 1.1rem; margin-bottom: .3em; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sym { font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.rank { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); font-size: .8rem; }
.stars { color: var(--gold); font-weight: 700; white-space: nowrap; }
.levels, .kv { margin: 14px 0; }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.levels dt, .kv dt { color: var(--muted); font-size: .8rem; }
.levels dd, .kv dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv > div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.broker .btn { width: 100%; }

/* stats */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.tile b { display: block; font-size: 2rem; line-height: 1.2; color: var(--gold); }
.tile b.up { color: var(--up); } .tile b.down { color: var(--down); }
.tile span { color: var(--muted); font-size: .9rem; }
.months { display: grid; gap: 14px; margin-top: 12px; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--gold); border-radius: 99px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 10px 14px; text-align: start; white-space: nowrap; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { background: var(--surface); color: var(--muted); font-weight: 600; font-size: .82rem; }
tr:last-child td { border-bottom: 0; }

/* blog + form */
.post { max-width: 720px; }
.post p { font-size: 1.05rem; }
.form { display: grid; gap: 14px; margin-top: 20px; }
.form label { display: grid; gap: 4px; font-weight: 600; }
input, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }

/* server-rendered pages */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
a.chip { display: inline-flex; align-items: center; color: var(--text); }
a.chip:hover { text-decoration: none; border-color: var(--gold); }
a.chip.on { color: var(--gold-ink); }
.h3 { font-size: 1.1rem; margin: .3em 0; }
.h3 a { color: var(--text); }
.tag.be { color: var(--muted); background: var(--surface-2); }
.tag.corr { color: var(--gold); background: rgba(229,181,60,.12); font-size: .72rem; }
.note { margin: 0 0 12px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; font-size: .92rem; color: var(--text); }
.note-d summary { cursor: pointer; color: var(--gold); }
.note-d p { margin: 6px 0 0; white-space: normal; min-width: 220px; max-width: 360px; }
.rate { display: grid; gap: 4px; min-width: 120px; }
.tile small { color: var(--muted); font-size: .55em; font-weight: 600; }
.chart { margin: 12px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.eq { display: block; width: 100%; height: auto; }
.eq .grid { stroke: var(--line); stroke-width: 1; }
.eq .zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.eq .line { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; }
.eq .area { fill: rgba(229,181,60,.2); }
.eq .dot { fill: var(--gold); }
.eq .tick { fill: var(--muted); font-size: 11px; font-family: inherit; }
.info { margin-top: 32px; }
.info h2 { margin-top: 0; font-size: 1.1rem; }
.info h2:not(:first-child) { margin-top: 1.2em; }
.join { text-align: center; }
.join h2 { margin-top: 0; }
.join .actions { justify-content: center; }
.btn.tg { background: #229ed9; color: #04141c; }
.btn.wa { background: #25d366; color: #04140a; }
.btn.tg, .btn.wa { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0; }
.site-footer .actions { margin: 16px 0; }
.prose p { font-size: 1.02rem; }
.prose h2 { font-size: 1.2rem; }
/* signals page: locked-record line, risk line, follow row, empty state */
.trust { margin: 4px 0 16px; max-width: 72ch; }
.trust-main { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: var(--text); }
.trust-main svg { flex: none; margin-top: 5px; color: var(--gold); }
.trust-r { margin: 6px 0 0; padding-inline-start: 26px; color: var(--muted); font-size: .92rem; }
.nb { display: inline-block; }
.risk-line { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 12px 14px; max-width: 72ch; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: .95rem; }
.risk-line svg { flex: none; margin-top: 3px; color: var(--gold); }
.proof { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 10px; font-size: .9rem; color: var(--muted); }
.proof:hover { color: var(--text); }
.signal .row.small { flex-wrap: wrap; gap: 4px 12px; }
.signal .row.small > span { white-space: nowrap; }
.rec { display: inline-flex; align-items: center; gap: 6px; }
.rec svg { flex: none; }
.follow { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; }
.follow p { margin: 0; color: var(--muted); }
.follow .actions { margin: 0; }
.empty { padding: 20px 0; max-width: 60ch; }
.empty p { margin: 0 0 8px; color: var(--muted); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; }
.note-d summary { display: inline-flex; align-items: center; min-height: 32px; }

/* closed-trades table becomes one compact card per trade on phones: result and R first */
@media (max-width: 760px) {
  .table-wrap:has(.trades) { border: 0; overflow: visible; border-radius: 0; }
  .trades, .trades tbody { display: block; }
  .trades thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .trades tr { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px 6px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
  .trades td { padding: 0; border: 0; white-space: normal; min-width: 0; }
  /* source order is table order; `order` puts symbol, direction, result and R on the first line */
  .trades .c-sym { order: 1; grid-column: span 3; font-size: 1.05rem; }
  .trades .c-type { order: 2; grid-column: span 2; }
  .trades .c-res { order: 3; grid-column: span 3; }
  .trades .c-r { order: 4; grid-column: span 4; justify-self: end; font-size: 1.3rem; font-weight: 800; }
  .trades .c-lvl { order: 5; grid-column: span 4; padding-top: 8px; border-top: 1px dashed var(--line); font-weight: 700; }
  .trades .c-date { order: 6; }
  .trades .c-note { order: 7; }
  .trades .c-lvl::before, .trades .c-date::before { content: attr(data-label); display: block; color: var(--muted); font-size: .75rem; font-weight: 400; }
  .trades .c-date { grid-column: span 12; color: var(--muted); font-size: .85rem; display: flex; gap: 6px; }
  .trades .c-date::before { display: inline; }
  .trades .c-note { grid-column: span 12; }
  .trades .c-note.c-empty { display: none; }
  .trades .note-d p { max-width: none; min-width: 0; }
}

.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }

/* footer */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); padding: 28px 0; background: var(--surface); }
.risk { color: var(--muted); font-size: .85rem; max-width: 72ch; }
.copy { color: var(--muted); font-size: .85rem; margin: 0; }

/* accessibility + interaction polish */
:root { color-scheme: dark; }
/* the sticky header must not cover keyboard-focused elements or #main after the skip link */
html { scroll-padding-top: 88px; }
main:focus { outline: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: 8px; top: -64px; z-index: 100; background: var(--gold); color: var(--gold-ink); padding: 10px 16px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 8px; text-decoration: none; }
a, .btn, .chip, .lang, .burger, .card, .nav a { transition: background-color .18s ease, color .18s ease, border-color .18s ease, filter .18s ease; }
button, .btn, .chip { cursor: pointer; }
.lang, .burger, .chip { min-height: 44px; }
.burger { min-width: 44px; align-items: center; justify-content: center; }
.btn { min-height: 44px; }
.btn.sm { min-height: 32px; }
.card:hover { border-color: #33425f; }
.table-wrap:focus-visible { outline-offset: 0; border-radius: var(--radius); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 760px) {
  .burger { display: inline-flex; }
  .nav a { padding: 12px 12px; min-height: 44px; display: flex; align-items: center; }
}
@media (max-width: 760px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 64px; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .bar { position: relative; }
  .hero { padding: 48px 0 40px; }
}
