:root {
  --content-max: 1280px;
  --page-bg: #050505;
  --text-color: #c8c8c8; /* body text color */
  --link-color: #e6da53; /* link text color */
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  background: var(--page-bg) !important;
  color: var(--text-color) !important;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  font-optical-sizing: auto;
  line-height: 1.35;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  scrollbar-gutter: stable;
}

a, a:link, a:visited, a:hover, a:active { color: var(--link-color) !important; }

header { width: 100%; display: flex; justify-content: center; align-items: center; padding: 12px 0 12px; overflow: hidden; }
.home header { padding: 12px 0 12px; }
.logo   { width: 48px; height: 48px; display: block; }

main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
body.tv-news-page { overflow-y: hidden; }
body.tv-news-page .page-shell { padding: 0 16px 12px; }
body.tv-news-page .card.full { min-height: calc(100vh - 120px); }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 16px; }

.sitemap {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 72px 16px 64px;
}
.sitemap-buttons {
  width: 100%;
  max-width: 720px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.button-link,
.button-link:link,
.button-link:visited,
.button-link:hover,
.button-link:active {
  display: block;
  text-align: center;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: #222222;
  text-decoration: none;
  color: var(--text-color) !important;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.button-link:hover,
.button-link:focus-visible {
  background: #2c2c2c;
  border-color: rgba(255, 255, 255, 0.28);
  outline: none;
}

.card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  min-height: 0;
  background: #181818 !important;
  overflow-x: hidden;
  overflow-y: visible;
}
.page-shell {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.section-header { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.card.full { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.news-card { flex: 0 0 auto; width: 100%; }
.widget-fill { flex: 1; position: relative; min-height: calc(100vh - 200px); }
.widget-fill .tradingview-widget-container,
.widget-fill .tradingview-widget-container__widget { width: 100%; height: 100%; }
.widget-fill .tradingview-widget-container { position: absolute; inset: 0; }

.offset { max-width: var(--content-max); margin: 8px auto; padding: 0 16px; }

#research-form { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
#research-q {
  width: 100%;
  padding: 4px 8px;
  border-radius: 0;
  background-color: #8e8e8e !important;
  border: 1px solid #8e8e8e !important;
  color: #000000;
  font-family: inherit;
}
#research-q:focus {
  outline: none;
  box-shadow: none;
}
.primary { padding: 8px 12px; border: 1px solid currentColor; border-radius: 0; background: transparent; }
#research-go.primary {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: inherit;
  cursor: pointer;
  line-height: inherit;
  font-size: 1.6rem;
}
#research-go.primary:hover,
#research-go.primary:focus-visible {
  text-decoration: underline;
  background: transparent !important;
  border-color: transparent !important;
  outline: none;
}

body :not(button):not(.primary):not(.primary *):not(script):not(style) { font-size: 1.2rem !important; }
#research-links, #research-links * { font-size: 1.05rem !important; }

.linklist { list-style: none; padding: 0; margin: 8px 0 0; width: 100%; overflow-x: hidden; }
.linklist li { padding: 6px 0; border-top: 1px solid rgba(242, 242, 242, 0.12); }
.linklist li:first-child { border-top: 1px solid rgba(242, 242, 242, 0.12); }
.linklist a { word-break: break-word; overflow-wrap: anywhere; white-space: normal; display: block; max-width: 100%; }

.automatic-search-page #research-links { margin-top: 4px; }
.automatic-search-page #research-links li { padding: 4px 0; }
.automatic-search-page #research-links a { line-height: 1.15; }
.automatic-search-page label { font-size: 1.05rem !important; }

.news-finnhub .linklist,
.news-marketaux .linklist { margin-top: 4px; }
.news-finnhub .linklist li,
.news-marketaux .linklist li { padding: 3px 0; }
.news-finnhub .linklist a,
.news-marketaux .linklist a { line-height: 1.2; }

.info-icon { text-decoration: none; }
.info-icon.overlay { position: absolute; top: 8px; right: 8px; z-index: 2; }
.site-feedback { position: fixed; left: 12px; bottom: 12px; }
.site-feedback p { margin: 0; }
