:root {
  color-scheme: dark;
  --bg: #0b1118;
  --surface: #111a24;
  --surface-2: #172331;
  --text: #eef4f8;
  --muted: #9fb0bf;
  --line: #263748;
  --brand: #2dd4bf;
  --brand-2: #f5c451;
  --danger: #ff6b7a;
  --success: #62d68f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #edf2f7;
  --text: #12202c;
  --muted: #5c6b78;
  --line: #dce4ec;
  --shadow: 0 18px 50px rgba(20, 36, 54, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  opacity: 1;
  transition: opacity 140ms ease;
}
html.is-navigating body { opacity: 0.2; }
@view-transition {
  navigation: auto;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(180px, 420px) 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0; }
.brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; }
.brand span::before {
  content: "SR";
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 10px;
  color: #081018;
  background: var(--brand);
  border-radius: 8px;
}
.global-search { position: relative; }
.global-search input, .select-row input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--text);
  background: var(--surface);
}
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 100;
  display: none;
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-suggestions.open { display: block; }
.search-suggestions button {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.search-suggestions button:hover { background: var(--surface-2); }
.search-suggestions button:last-child { border-bottom: 0; }
.search-suggestions span, .search-suggestions small { color: var(--muted); }
.site-nav { display: flex; justify-content: flex-end; gap: 18px; color: var(--muted); font-size: 14px; }
.site-nav a:hover { color: var(--text); }
.theme-toggle, .menu-toggle {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}
.menu-toggle { display: none; }

main { min-height: 70vh; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding: clamp(56px, 9vw, 110px) clamp(16px, 5vw, 64px) 44px;
  background:
    linear-gradient(120deg, rgba(45, 212, 191, 0.16), transparent 34%),
    linear-gradient(160deg, transparent, rgba(245, 196, 81, 0.08));
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2 { margin: 0; line-height: 1.08; letter-spacing: 0; }
h1 { font-size: clamp(42px, 8vw, 86px); }
h2 { font-size: clamp(24px, 4vw, 38px); }
.hero-copy, .page-title p { max-width: 780px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}
.button.primary { color: #051410; background: var(--brand); border-color: var(--brand); font-weight: 800; }
.button.ghost { background: transparent; }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 14px; }
.market-panel, .metric-card, .screener-card, .filter-panel, .results-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 8px;
}
.market-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; overflow: hidden; }
.market-panel div { padding: 24px; background: var(--surface-2); }
.market-panel span, .metric-card span, small { display: block; color: var(--muted); font-size: 13px; }
.market-panel strong { display: block; margin-top: 8px; font-size: 30px; }

.section-band, .page-title, .stock-hero {
  padding: 44px clamp(16px, 5vw, 64px);
}
.section-head, .results-head, .stock-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.section-head { margin-bottom: 22px; }
.section-head a, .telegram-link { color: var(--brand); font-weight: 700; }
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 18px clamp(16px, 5vw, 64px) 0;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumbs a { color: var(--brand); font-weight: 700; }
.breadcrumbs b { color: var(--line); }
.content-section h2 { margin-bottom: 14px; }
.content-section p { max-width: 900px; color: var(--muted); }
.content-section ul {
  display: grid;
  gap: 10px;
  max-width: 900px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
}
.screener-grid, .indicator-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.indicator-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.screener-card, .indicator-card { min-height: 176px; padding: 18px; transition: transform 160ms ease, border-color 160ms ease; }
.indicator-card { min-height: 128px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.screener-card:hover, .indicator-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.screener-card span, .indicator-card span { color: var(--brand-2); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.screener-card strong, .indicator-card strong { display: block; margin: 8px 0; font-size: 18px; }
.screener-card p { margin: 0; color: var(--muted); font-size: 14px; }
.donation-strip, .risk-disclaimer {
  margin: 0 clamp(16px, 5vw, 64px) 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.donation-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
}
.donation-strip p { margin: 8px 0 0; color: var(--muted); }
.risk-disclaimer {
  padding: 16px 18px;
  color: var(--muted);
  border-color: color-mix(in srgb, var(--brand-2) 45%, var(--line));
}
.risk-disclaimer strong { color: var(--brand-2); }

.screener-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 22px;
  padding: 0 clamp(16px, 5vw, 64px) 50px;
}
.filter-panel {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 18px;
}
.filter-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}
.filter-details summary::-webkit-details-marker { display: none; }
.filter-details summary small { color: var(--brand); }
.filter-body { padding-top: 14px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend, .range-row span, .select-row span { display: block; margin-bottom: 8px; color: var(--muted); font-weight: 700; font-size: 13px; }
.check, .toggle { display: flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--text); font-size: 14px; }
input[type="range"] { width: 100%; accent-color: var(--brand); }
.select-row, .range-row { display: block; margin-bottom: 18px; }
.results-panel { min-width: 0; padding: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.chips > span, .chip-button, .pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
}
.chip-button {
  gap: 8px;
  cursor: pointer;
}
.chip-button b {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #071018;
  background: var(--brand);
  font-size: 12px;
  line-height: 1;
}
.pill.bullish { color: var(--success); }
.pill.bearish { color: var(--danger); }

.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { width: 100%; min-width: 840px; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}
.sort-button b {
  color: var(--brand);
  font-size: 13px;
}
.sort-button.active span { color: var(--text); }
tr:last-child td { border-bottom: 0; }
.stock-link { display: grid; gap: 2px; }
.stock-link span { color: var(--muted); font-size: 13px; }
.up { color: var(--success); }
.down { color: var(--danger); }
.hot { color: var(--brand-2); }
.empty-state { padding: 24px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.link-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.link-cloud a { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--brand); }
.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 800; }

.stock-hero {
  background: linear-gradient(120deg, rgba(45, 212, 191, 0.12), rgba(245, 196, 81, 0.06));
}
.stock-hero h1 span { color: var(--muted); font-size: 24px; }
.stock-price { font-size: 30px; font-weight: 900; }
.export-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 26px clamp(16px, 5vw, 64px); }
.metric-card { padding: 18px; }
.metric-card strong { display: block; margin-top: 8px; font-size: 20px; }

.site-footer {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) minmax(130px, 0.75fr) minmax(180px, 0.9fr) minmax(170px, 0.8fr) auto;
  gap: 20px;
  padding: 32px clamp(16px, 5vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}
.footer-about p { margin: 8px 0 0; }
.footer-links { display: grid; gap: 8px; }
.donation-box { display: grid; gap: 8px; align-content: start; }
.donation-box strong { color: var(--text); }
.donation-box img { width: 78px; height: 78px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.telegram-popup {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(310px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.telegram-popup button { position: absolute; right: 8px; top: 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.telegram-popup a { color: var(--brand); font-weight: 800; }
.donate-float, .telegram-float {
  position: fixed;
  bottom: 18px;
  z-index: 75;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #051410;
  background: var(--brand);
  box-shadow: var(--shadow);
  font-weight: 900;
}
.donate-float {
  left: 18px;
}
.telegram-float {
  right: 18px;
  color: #071018;
  background: var(--brand-2);
}
.loading { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: auto minmax(28px, 1fr) auto auto; column-gap: clamp(18px, 6vw, 48px); }
  .brand { order: 1; grid-column: 1 / 3; }
  .menu-toggle { order: 2; grid-column: 3; }
  .theme-toggle { order: 3; grid-column: 4; }
  .global-search { grid-column: 1 / -1; order: 4; }
  .menu-toggle { display: inline-grid; place-items: center; justify-self: end; }
  .theme-toggle { justify-self: end; }
  .site-nav {
    display: none;
    order: 5;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0 4px;
  }
  .site-nav.open { display: flex; }
  .hero, .screener-layout, .site-footer, .stock-hero { grid-template-columns: 1fr; }
  .screener-grid, .indicator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-panel { position: sticky; top: 116px; max-height: none; padding: 12px; z-index: 20; }
  .filter-details:not([open]) { max-height: 48px; overflow: hidden; }
  .results-panel { padding: 14px; }
  .donation-strip { display: grid; }
}

@media (max-width: 620px) {
  .site-header { gap: 14px 18px; padding: 12px 22px; }
  .brand span { font-size: 15px; }
  .brand { min-width: 0; }
  .brand span { max-width: 188px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-toggle, .theme-toggle { width: 54px; height: 54px; }
  .hero { padding-top: 38px; }
  .market-panel, .screener-grid, .indicator-grid, .metrics-grid { grid-template-columns: 1fr; }
  .section-head, .results-head, .stock-hero { display: grid; }
  h1 { font-size: 42px; }
  .page-title p, .hero-copy { font-size: 16px; }
  .site-footer { gap: 24px; }
  .filter-panel { top: 104px; }
  .filter-body { max-height: 58vh; overflow: auto; }
  .donation-strip, .risk-disclaimer { margin-left: 16px; margin-right: 16px; }
  .donate-float { left: 14px; bottom: 14px; }
  .telegram-float { right: 14px; bottom: 14px; }
}

@media print {
  .site-header, .site-footer, .telegram-popup, .export-actions { display: none; }
  body { background: #fff; color: #111; }
  .table-wrap, .metric-card, .stock-hero { box-shadow: none; }
}
