/* Verigo Global — base + responsive layer.
   Page components use inline styles designed at desktop width; these rules adapt
   them for tablets and phones by matching the serialized inline style values. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; overflow-x: clip; font-family: 'DM Sans', system-ui, sans-serif; background: #fff; color: #0a0a0a; -webkit-font-smoothing: antialiased; text-wrap: pretty; }
a { text-decoration: none; }
button { font-family: inherit; }
::selection { background: #EEE7F6; }
img { max-width: 100%; }
#root:empty { min-height: 100vh; }
.vg-noscript { max-width: 640px; margin: 80px auto; padding: 0 16px; font-size: 16px; line-height: 1.6; }

/* ── Cookie consent banner ── */
#vg-consent {
  position: fixed; left: 24px; bottom: 24px; z-index: 2000; max-width: 440px;
  background: #fff; color: #0a0a0a; border: 1px solid #DCDCE8; box-shadow: 0 12px 40px rgba(10, 10, 18, 0.18);
  padding: 20px 22px; font: 400 13.5px/1.55 'DM Sans', system-ui, sans-serif;
}
#vg-consent p { margin: 0 0 14px; color: #3a3a4a; }
#vg-consent .vg-consent-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
#vg-consent button { font: 600 13px 'DM Sans', system-ui, sans-serif; padding: 10px 16px; cursor: pointer; border-radius: 0; }
#vg-consent .vg-btn-ghost { background: transparent; color: #0a0a0a; border: 1.5px solid #DCDCE8; }
#vg-consent .vg-btn-primary { background: #5B2E91; color: #fff; border: 1.5px solid #5B2E91; }
#vg-consent button:focus-visible { outline: 2px solid #E8622A; outline-offset: 2px; }
@media (max-width: 640px) {
  #vg-consent { left: 12px; right: 12px; bottom: 12px; max-width: none; padding: 16px; }
  #vg-consent button { flex: 1 1 auto; }
}

/* ── Header: switch to a menu button before the nav gets cramped ── */
@media (max-width: 1180px) {
  .vg-hd-nav, .vg-hd-ghost { display: none !important; }
  .vg-hd-burger { display: inline-flex !important; }
  .vg-hd-actions { margin-left: auto; margin-right: 12px; }
}
@media (max-width: 600px) {
  .vg-hd-actions { display: none !important; }
  .vg-hd-inner { padding: 0 16px !important; }
}

/* ── Tablet ── */
@media (max-width: 960px) {
  /* Multi-column grids: wide asymmetric layouts stack, card grids go to two columns */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns: repeat(6"],
  [style*="grid-template-columns: 1fr 1fr 1fr"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [style*="grid-template-columns"] > * { min-width: 0; }
  [style*="grid-column: span"], [style*="grid-column: 1 / -1"] { grid-column: auto !important; }
  [style*="grid-row: span"] { grid-row: auto !important; }

  [style*="gap: 80px"], [style*="gap: 72px"], [style*="gap: 64px"], [style*="gap: 60px"], [style*="gap: 56px"] { gap: 36px !important; }

  /* Sticky sidebars become normal flow once stacked */
  [style*="position: sticky"]:not(header) { position: static !important; }

  .vg-ft-top { grid-template-columns: 1fr !important; gap: 40px !important; }
  .vg-ft-cols { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* Long horizontal rows wrap instead of overflowing */
  [style*="display: flex"][style*="justify-content: space-between"] { flex-wrap: wrap; }

  table { display: block; max-width: 100%; overflow-x: auto; }
}

/* ── Phone ── */
@media (max-width: 640px) {
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .vg-ft-cols { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* Content containers: 16px gutters */
  [style*="max-width: 1280px"], [style*="max-width: 1200px"], [style*="max-width: 1240px"], [style*="max-width: 1180px"],
  [style*="max-width: 1120px"], [style*="max-width: 1080px"], [style*="max-width: 1040px"], [style*="max-width: 960px"],
  [style*="max-width: 920px"], [style*="max-width: 880px"], [style*="max-width: 860px"], [style*="max-width: 820px"],
  [style*="max-width: 800px"], [style*="max-width: 760px"], [style*="max-width: 720px"] {
    padding-left: 16px !important; padding-right: 16px !important;
  }

  /* Vertical rhythm */
  [style*="padding: 120px 0px"], [style*="padding: 112px 0px"], [style*="padding: 104px 0px"], [style*="padding: 100px 0px"],
  [style*="padding: 96px 0px"], [style*="padding: 88px 0px"], [style*="padding: 80px 0px"], [style*="padding: 72px 0px"] {
    padding-top: 52px !important; padding-bottom: 52px !important;
  }
  [style*="padding: 84px 0px 60px"] { padding-top: 48px !important; padding-bottom: 40px !important; }
  [style*="padding: 72px 32px"], [style*="padding: 80px 32px"] { padding: 44px 16px !important; }
  [style*="padding: 52px"], [style*="padding: 48px"], [style*="padding: 44px"], [style*="padding: 40px"], [style*="padding: 36px"] {
    padding-left: 20px !important; padding-right: 20px !important;
  }

  /* Type scale */
  h1[style*="font-size"] { font-size: clamp(32px, 9vw, 40px) !important; line-height: 1.08 !important; }
  h2[style*="font-size"] { font-size: clamp(26px, 7vw, 32px) !important; line-height: 1.15 !important; }
  [style*="font-size: 72px"], [style*="font-size: 64px"], [style*="font-size: 60px"], [style*="font-size: 56px"] { font-size: 38px !important; }
  [style*="font-size: 54px"], [style*="font-size: 52px"], [style*="font-size: 48px"], [style*="font-size: 46px"] { font-size: 34px !important; }
  [style*="font-size: 21px"], [style*="font-size: 20px"], [style*="font-size: 19px"] { font-size: 17px !important; }

  /* Fixed-width blocks never exceed the screen */
  [style*="width: 4"], [style*="width: 5"], [style*="width: 6"], [style*="min-width: 3"], [style*="min-width: 4"] { max-width: 100% !important; }
  [style*="min-width: 3"], [style*="min-width: 4"] { min-width: 0 !important; }

  /* Buttons in hero / CTA rows go full width */
  [style*="display: flex"][style*="gap: 12px"] > button, [style*="display: flex"][style*="gap: 14px"] > button { flex: 1 1 auto; justify-content: center; }

  /* Decorative watermarks: keep them out of the text */
  svg[style*="position: absolute"] { opacity: 0.5; }

  /* Back-to-top button sits clear of content */
  button[title="Back to top"] { bottom: 16px !important; right: 16px !important; }

  /* Equal-width flex rows (stat strips, step rows) wrap into a 2-up grid */
  [style*="display: flex"] > [style*="flex: 1 1 0%"] { min-width: 0 !important; }
  [style*="display: flex"]:has(> [style*="flex: 1 1 0%"][style*="padding"]) { flex-wrap: wrap !important; }
  [style*="display: flex"] > [style*="flex: 1 1 0%"][style*="padding"] { flex: 1 1 calc(50% - 16px) !important; padding-left: 16px !important; padding-right: 16px !important; }

  /* Maturity staircase charts: tighter, wrap labels, scroll if still too wide */
  [style*="display: flex"]:has(> [style*="flex: 1 1 0%"][style*="justify-content: flex-end"]) { overflow-x: auto; gap: 4px !important; scrollbar-width: none; }
  [style*="flex: 1 1 0%"][style*="justify-content: flex-end"] * { overflow-wrap: anywhere; }

  /* Tab bars scroll sideways instead of overflowing */
  [style*="margin: 0px -32px"] { margin-left: -16px !important; margin-right: -16px !important; padding-left: 16px !important; padding-right: 16px !important; }
  [style*="display: flex"][style*="border-bottom"]:has(> button) { overflow-x: auto; flex-wrap: nowrap !important; scrollbar-width: none; }
  [style*="display: flex"][style*="border-bottom"]:has(> button) > button { flex: 0 0 auto !important; white-space: nowrap; }

  .vg-stack-sm { grid-template-columns: 1fr !important; }
}
