/* ChartsView site header - one header for every page (added 2026-09-30).
   Markup: includes/cv-site-header.php   Behaviour: js/cv-header.js
   Colours follow home-v2/styles/tokens.css. */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap');

.cvh, .cvh *, .cvh *::before, .cvh *::after { box-sizing: border-box; }
.cvh {
  --cvh-bg: #0d1117;
  --cvh-panel: #131722;
  --cvh-card: #1a1e2e;
  --cvh-line: #232838;
  --cvh-line-strong: #2a2a3e;
  --cvh-text: #e0e0e0;
  --cvh-muted: #aeb7c4;
  --cvh-red: #c0392b;
  --cvh-cta: #cc0000;
  --cvh-h: 64px;
  position: relative;
  z-index: 1000;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--cvh-bg);
  border-bottom: 1px solid var(--cvh-line);
  font-family: Ubuntu, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.3;
  color: var(--cvh-text);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.cvh a { text-decoration: none !important; }
.cvh ul { list-style: none; margin: 0; padding: 0; }
.cvh li { margin: 0; padding: 0; list-style: none; }
.cvh li::before, .cvh li::marker { content: none; }
.cvh button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: normal; }
.cvh svg { display: inline-block; }

.cvh-bar {
  display: flex; align-items: center; gap: 12px;
  max-width: 1320px; height: var(--cvh-h);
  margin: 0 auto; padding: 0 24px;
}
.cvh-logo { display: flex; align-items: center; flex: 0 0 auto; margin-right: 14px; padding: 0; background: none; }
.cvh-logo img { display: block; height: 46px; width: auto; max-width: none; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }

/* Desktop menu */
.cvh-nav { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; background: none; }
.cvh-menu { display: flex; align-items: stretch; gap: 2px; height: var(--cvh-h); }
.cvh-item { position: relative; display: flex; align-items: stretch; }
.cvh .cvh-link {
  display: inline-flex; align-items: center; gap: 6px;
  height: 100%; padding: 0 12px;
  color: var(--cvh-muted) !important; background: none !important;
  font-weight: 500; font-size: 15px; white-space: nowrap;
  border: 0; border-top: 2px solid transparent; border-bottom: 2px solid transparent; border-radius: 0;
  transition: color .15s ease, border-color .15s ease;
}
.cvh .cvh-link:hover, .cvh-item.is-open > .cvh-link, .cvh .cvh-link:focus-visible { color: #fff !important; }
.cvh .cvh-item.is-current > .cvh-link { color: #fff !important; border-bottom-color: var(--cvh-red); }
.cvh-chev { width: 12px; height: 12px; opacity: .7; transition: transform .15s ease; }
.cvh-item.is-open > .cvh-link .cvh-chev { transform: rotate(180deg); }
.cvh :focus-visible { outline: 2px solid #5dade2; outline-offset: 2px; border-radius: 4px; }

.cvh-sub {
  display: none; position: absolute; top: calc(100% - 6px); left: 0; z-index: 1001;
  min-width: 232px; padding: 8px;
  background: var(--cvh-panel); border: 1px solid var(--cvh-line-strong);
  border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.cvh-item:nth-last-child(-n+2) > .cvh-sub { left: auto; right: 0; }
.cvh-item.is-open > .cvh-sub { display: block; }
.cvh .cvh-sub a {
  display: block; padding: 9px 12px; border-radius: 6px;
  color: var(--cvh-text) !important; background: none;
  font-size: 14px; font-weight: 400; line-height: 1.3; white-space: nowrap;
}
.cvh .cvh-sub a:hover, .cvh .cvh-sub a:focus-visible { background: var(--cvh-card); color: #fff !important; }
.cvh .cvh-sub a[aria-current="page"] { color: #fff !important; box-shadow: inset 2px 0 0 var(--cvh-red); }

/* Right-hand side */
.cvh-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }
.cvh .cvh-login { color: var(--cvh-text) !important; font-weight: 500; font-size: 14px; padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.cvh .cvh-login:hover { color: #fff !important; background: rgba(255,255,255,.06); }
.cvh .cvh-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; border-radius: 6px; border: 1px solid var(--cvh-cta);
  background: var(--cvh-cta); color: #fff !important;
  font-weight: 500; font-size: 14px; line-height: 1.2; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.cvh .cvh-btn:hover { background: #a80000; border-color: #a80000; }
.cvh .cvh-btn-ghost { background: transparent; border-color: var(--cvh-line-strong); color: var(--cvh-text) !important; }
.cvh .cvh-btn-ghost:hover { background: rgba(255,255,255,.06); border-color: #3a4256; }

.cvh-burger { display: none !important; width: 44px; height: 44px; border-radius: 8px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.cvh-burger span { display: block; width: 20px; height: 2px; background: #e0e0e0; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.cvh-burger:hover { background: rgba(255,255,255,.06) !important; }
.cvh.is-open .cvh-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cvh.is-open .cvh-burger span:nth-child(2) { opacity: 0; }
.cvh.is-open .cvh-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.cvh-panel-actions { display: none; }

/* Mouse users on wide screens: menus open on hover */
@media (hover: hover) and (min-width: 1101px) {
  .cvh-item:hover > .cvh-sub { display: block; }
  .cvh .cvh-item:hover > .cvh-link { color: #fff !important; }
}
@media (max-width: 1240px) and (min-width: 1101px) {
  .cvh .cvh-link { padding: 0 9px; font-size: 14.5px; }
  .cvh-logo { margin-right: 6px; }
}

/* Tablets and phones: menu button + full-height panel */
@media (max-width: 1100px) {
  .cvh { --cvh-h: 60px; }
  .cvh-bar { padding: 0 12px 0 16px; }
  .cvh-logo img { height: 40px; }
  .cvh-burger { display: inline-flex !important; }
  .cvh .cvh-login, .cvh-actions .cvh-btn-ghost { display: none; }
  .cvh-nav {
    display: none; position: fixed; left: 0; right: 0; top: var(--cvh-top, 60px); bottom: 0; z-index: 1002;
    flex-direction: column; align-items: stretch; overflow-y: auto; overscroll-behavior: contain;
    background: var(--cvh-bg); border-top: 1px solid var(--cvh-line); padding: 6px 16px 28px;
  }
  .cvh.is-open .cvh-nav { display: flex; }
  .cvh-menu { flex-direction: column; height: auto; gap: 0; }
  .cvh-item { flex-direction: column; border-bottom: 1px solid var(--cvh-line); }
  .cvh .cvh-link { height: 52px; padding: 0 4px; justify-content: space-between; width: 100%; font-size: 16px; color: var(--cvh-text) !important; border: 0; }
  .cvh .cvh-item.is-current > .cvh-link { border: 0; color: #fff !important; }
  .cvh-sub { position: static; display: none; min-width: 0; padding: 0 0 10px; background: transparent; border: 0; box-shadow: none; border-radius: 0; }
  .cvh-item.is-open > .cvh-sub { display: block; }
  .cvh .cvh-sub a { padding: 12px; font-size: 15px; color: var(--cvh-muted) !important; }
  .cvh-panel-actions { display: flex; gap: 10px; padding-top: 18px; }
  .cvh-panel-actions .cvh-btn { flex: 1 1 0; padding: 12px 16px; font-size: 15px; }
  body.cvh-lock { overflow: hidden !important; }
}
@media (max-width: 380px) {
  .cvh-actions .cvh-btn { padding: 8px 12px; font-size: 13px; }
  .cvh-logo img { height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .cvh *, .cvh *::before, .cvh *::after { transition: none !important; } }
@media print { .cvh { display: none !important; } }

/* ===================== Site footer (shared, added 2026-09-30) ===================== */
.cvf, .cvf *, .cvf *::before, .cvf *::after { box-sizing: border-box; }
.cvf {
  display: block; width: 100%; margin: 56px 0 0; padding: 0;
  background: #0d1117; border-top: 1px solid #232838; color: #aeb7c4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px; line-height: 1.6; text-align: left;
}
.cvf a { color: #cfd8dc !important; text-decoration: none !important; background: none; }
.cvf a:hover { color: #fff !important; }
.cvf-inner { max-width: 1320px; margin: 0 auto; padding: 48px 24px 28px; }
.cvf-top { display: grid; grid-template-columns: minmax(220px, 1.2fr) 3.8fr; gap: 40px; }
.cvf-logo { display: inline-block; }
.cvf-logo img { display: block; height: 52px; width: auto; max-width: none; border: 0; background: none; }
.cvf-brand p { margin: 14px 0 16px; max-width: 300px; color: #aeb7c4; font-size: 14px; }
.cvf-social { display: flex; gap: 10px; }
.cvf-social a { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #2a2a3e; border-radius: 8px; }
.cvf-social a:hover { border-color: #3a4256; background: #131722; }
.cvf-social svg { width: 16px; height: 16px; display: block; }
.cvf-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.cvf .cvf-h {
  margin: 0 0 12px; padding: 0; color: #fff; font-family: Ubuntu, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 12.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
}
.cvf ul { list-style: none; margin: 0; padding: 0; }
.cvf li { margin: 0 0 9px; padding: 0; list-style: none; font-size: 14px; }
.cvf li::before, .cvf li::marker { content: none; }
.cvf-legal { margin-top: 36px; padding: 18px 20px; border: 1px solid #232838; border-radius: 10px; background: #11151d; font-size: 12.5px; line-height: 1.6; color: #8f99a8; }
.cvf-legal p { margin: 0 0 8px; color: #8f99a8; font-size: 12.5px; }
.cvf-legal p:last-child { margin-bottom: 0; }
.cvf-legal strong { color: #cfd8dc; font-weight: 600; }
.cvf-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid #232838; font-size: 13px; color: #8f99a8; }
@media (max-width: 900px) {
  .cvf-top { grid-template-columns: 1fr; gap: 28px; }
  .cvf-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
}
@media (max-width: 480px) { .cvf-inner { padding: 36px 16px 96px; } }

/* ===================== Cookie banner (shared, added 2026-09-30) ===================== */
.cvc[hidden] { display: none !important; }
.cvc { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 990; display: flex; justify-content: center; pointer-events: none; }
.cvc-inner {
  pointer-events: auto; width: 100%; max-width: 780px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 18px;
  padding: 14px 16px 14px 20px; background: #131722; border: 1px solid #2a2a3e; border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); color: #e0e0e0;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; text-align: left;
}
.cvc-text { margin: 0; flex: 1 1 340px; color: #e0e0e0; font-size: 14px; }
.cvc-text a { color: #5dade2 !important; text-decoration: underline !important; }
.cvc-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.cvc-btn {
  font: 500 14px/1.2 Ubuntu, "Segoe UI", Roboto, Arial, sans-serif; padding: 10px 20px; border-radius: 6px;
  border: 1px solid #cc0000; background: #cc0000; color: #fff; cursor: pointer; box-shadow: none; text-transform: none;
}
.cvc-btn:hover { background: #a80000; border-color: #a80000; }
.cvc-btn-ghost { background: transparent; border-color: #3a4256; color: #e0e0e0; }
.cvc-btn-ghost:hover { background: rgba(255, 255, 255, .06); border-color: #4a5268; }
body.cvh-lock .cvc { display: none; }
@media (max-width: 480px) { .cvc { left: 8px; right: 8px; bottom: 8px; } .cvc-actions { width: 100%; } .cvc-btn { flex: 1 1 0; } }
@media print { .cvf, .cvc { display: none !important; } }

/* Dark scrollbars and form controls on every page that uses the shared header (30 Sep 2026).
   Embedded iframes keep the normal scheme so TradingView widgets don't get a white backing. */
:root { color-scheme: dark; }
iframe { color-scheme: normal; }
