/* ==========================================================================
   VARIABLES & BASE TYPOGRAPHY
   ========================================================================== */
:root {
  --font-base: 'Source Sans 3', sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-semibold: 600;
  --fs-small: .875rem;
  --fs-base: 1rem;
  --fs-headers: 1.125rem;
  --fs-small-mobile: .75rem;
  --fs-base-mobile: .875rem;
  --fs-headers-mobile: 1rem;
  --lh-base: 1.5rem;
  --ls-base: 0.5px;
  --color-text: #222;
  --color-text-light: #a1a1a1;
  --color-heading: #222;
  --color-body-bg: #FFFFFF;
  --color-border-idle: #d8d8d8;
  --color-border-focus: #000;
  --color-error: #e53935;
  --color-primary: #d17b04;
  --color-progress-bg: #e0e0e0;
  --color-progress-bg-active: #DC640C;
  --color-progress-bg-done: rgb(238, 178, 134);
  --color-step-inactive: #aaa;
  color-scheme: light;
}

html {
  /* Force one smoothing mode everywhere */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Reset & Base ---- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-color: var(--color-border-idle) #ffffff; /* thumb, track */
}

::-webkit-scrollbar {
  width: 10px;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-idle);
  border-radius: 5px;
}

::-webkit-scrollbar-track {
  background: #ffffff;
  border-radius: 5px;
}

html, body {
  height: 100%;
}

html {
  font-size: 100%;
}

body {
  font-family: var(--font-base);
  font-weight: var(--fw-light);
  line-height: var(--lh-base);
  font-size: var(--fs-base);
  letter-spacing: var(--ls-base);
  color: var(--color-text);
  background: var(--color-body-bg);
}
h1, h2 {
  font-weight: var(--fw-light);
  font-size: var(--fs-headers);
  line-height: 1.5;
  color: var(--color-heading);
  margin-bottom: 1rem;
}
h1 {
  font-weight: 800;
  font-size: min(13vw, 3rem);
}

/* ==========================================================================
LOADING ANIMATION
========================================================================== */

#loader-container {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: white;
  font-family: 'Source Sans 3', sans-serif;
  z-index: 9999;
}

.graph-loader-container {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #f5f5f5;
  font-family: 'Source Sans 3', sans-serif;
  z-index: 9999;
}

.loader {
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
  transform-origin: center;
}

.arc {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  r: 20;
  cx: 25;
  cy: 25;
}

.arc-light {
  stroke: #EEB286;
  stroke-dasharray: 18 126; /* 50 visible, 100 gap */
  stroke-dashoffset: 45;
}

.arc-dark {
  stroke: #DC9015;
  stroke-dasharray: 90 36; /* same length, offset to avoid overlap */
  stroke-dashoffset: 0;    /* offset so it starts after the light arc */
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  10%  { transform: rotate(18deg); }
  20%  { transform: rotate(42deg); }
  30%  { transform: rotate(78deg); }
  40%  { transform: rotate(118deg); }
  50%  { transform: rotate(180deg); }
  60%  { transform: rotate(236deg); }
  70%  { transform: rotate(282deg); }
  80%  { transform: rotate(318deg); }
  90%  { transform: rotate(342deg); }
  100%  { transform: rotate(360deg); }
}

.main-content {
  padding: 2rem;
}


/* ==========================================================================
   PROGRESS BAR
   ========================================================================== */
#progress-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  counter-reset: step;
}
#progress-bar .step {
  position: relative;
  flex: 1;
  text-align: center;
  color: var(--color-step-inactive);
}
#progress-bar .step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-block;
  width: calc(2 * (var(--fs-base)));
  height: calc(2 * (var(--fs-base)));
  line-height: calc(2 * (var(--fs-base)));
  border-radius: 50%;
  background: var(--color-progress-bg);
  color: white;
  margin-bottom: .5rem;
}
#progress-bar .step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: var(--fs-base);
  right: -50%;
  width: 100%;
  height: 2px;
  background: var(--color-progress-bg); /* light gray */
  z-index: -1;
}
#progress-bar .step.active {
  color: var(--color-progress-bg-active);
}
#progress-bar .step.active::before {
  background: var(--color-progress-bg-active);
}
/* Make the line between two done steps orange */
#progress-bar .step.done::before,
#progress-bar .step.done::after {
  background: var(--color-progress-bg-done);
}

/* ==========================================================================
   FORM LAYOUT
   ========================================================================== */
.form {
  width: calc(80% - (80% - 700px));
  max-width: 90%;
  margin-inline: auto;
  margin-top: 10vh;
  background: var(--color-body-bg);
  /* padding: 2rem; */
  border-radius: 0;
  box-shadow: none;
  font-weight: var(--fw-light);
}

.form-step:not(.active) { display: none }

.field {
  margin-bottom: 1.5rem;
}
.field label {
  font-size: var(--fs-base);
  display: block;
  margin-bottom: .5rem;
  font-weight: var(--fw-light);
}

.tooltip-field {
  position: relative;
}

.tooltip-icon-wrapper {
  position: relative;
  display: inline-block;
  margin-left: 0.5em;
}

.tooltip-icon {
  color: #666;
  cursor: help;
  font-size: 1em;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: 220px;
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.5em;
  position: absolute;
  top: 120%;              /* drop it below the icon */
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.2s ease-in-out;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 0.875em;
  line-height: 1.3;
}

.tooltip-icon-wrapper:hover .tooltip-text,
.tooltip-icon-wrapper:focus-within .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.modal-icon-wrapper {
  margin-left: 0.5em;
}

/* ==========================================================================
   INPUTS & SELECTS
   ========================================================================== */
/* Shared idle styling */
.field input[type="text"],
.field input[type="number"],
.field select,
.custom-select .selected {
  width: 100%;
  padding: .75rem;
  border: 1.5px solid var(--color-border-idle);
  border-radius: 0;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--color-text);
  background: var(--color-body-bg);
  appearance: none;
}

/* Native select arrow */
.field select {
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 8px 5px;
}

/* Light grey placeholder, fully opaque */
.field select:invalid,
.field select:disabled,
.field input[type="text"]::placeholder,
.field input[type="number"]::placeholder {
  color: var(--color-text-light);
  opacity: 1; /* some browsers default opacity lower */
}

/* Focused / active state */
.field input[type="text"]:focus,
.field input[type="number"]:focus,
.field select:focus,
.custom-select.open .selected,
.custom-select .selected:focus {
  outline: none;
  border-color: var(--color-border-focus);
}
/* .field input[type="number"] {
  -moz-appearance: textfield;
}
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
} */

/* ==========================================================================
   ERROR STATE
   ========================================================================== */
.field input.error,
.field select.error {
  border-color: var(--color-error);
}
.field .error-text {
  color: var(--color-error);
  margin-top: .25rem;
  font-size: var(--fs-small);
}

.pv-options {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
    
/* ==========================================================================
   CONDITIONAL RADIO BUTTONS
   ========================================================================== */
.pv-radio {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ==========================================================================
   CUSTOM DROPDOWN
   ========================================================================== */
.custom-select {
  position: relative;
  width: 100%;
  font-family: inherit;
  font-size: var(--fs-base);
  /* line-height: inherit; */
}
.custom-select .selected {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.custom-select .arrow {
  width: 8px;
  height: 5px;
  background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.custom-select .options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  background: var(--color-body-bg);
  border: 1.5px solid var(--color-border-idle);
  border-top: none;
  border-radius: 0;
  box-shadow: none;
  z-index: 1000;
  display: none;
}
.custom-select.open .options {
  display: block;
}
.custom-select .option {
  padding: .75rem;
  cursor: pointer;
}
.custom-select .option:hover {
  background: #e0e0e0;
}
.custom-select .option.disabled {
  color: var(--color-text-light);
  cursor: not-allowed;
}

/* ==========================================================================
BUTTONS
========================================================================== */
.buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}
button {
  padding: .75rem 1.5rem;
  font-size: var(--fs-base);
  font-family: inherit;
  border: none;
  border-radius: 10px;
  background: var(--color-primary);
  color: white;
  cursor: pointer;
}
button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.fa-download {
  margin-right: 0.25rem;
}

@media(min-width: 600px) {
  .fa-download {
    margin-right: 0.75rem;
  }
}

/* Default: hidden on desktop */
.mobile-spacer {
  display: none;
}

/* ==========================================================================
   Results Page
   ========================================================================== */

#results-page {
  max-width: 100%;
  margin: 0 auto;
}

#results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
#results-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0;
  line-height: 1;
}
#results-header button {
  margin: 0;
}

.results-graphs {
  display: grid;
  grid-template-columns: 1fr;
  /* grid-template-columns: repeat(2, minmax(0, 1fr)); */
}
.results-graphs > div {
  width: 100%;
}
.results-graphs > div img {
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border-idle);
  border-radius: 4px;
}
.results-tabs {
  display: inline-flex;
  gap: .5rem;
  margin: 0 0 .75rem 0;
}
.results-tabs button {
  padding: .4rem .7rem;
  border-radius: 6px;
  background: var(--color-progress-bg-done, #f2f5f9);
  cursor: pointer;
}
.results-tabs button.active {
  background: var(--color-primary, #f2f5f9);
}
.results-graph-stage .graph { width: 100%; }


svg { overflow: visible; }       /* allow drawing outside the box */
.chart { overflow: visible; }    /* make sure parents don’t clip */
/* target your legends root */
svg .legend .item,
svg .legend .item * {
  -webkit-tap-highlight-color: transparent; /* Safari/Chrome tap highlight */
  user-select: none;                         /* no text selection highlight */
}

svg .legend .item:focus,
svg .legend .item:focus-visible,
svg .legend .item:focus-within {
  outline: none;                             /* nix UA outline */
}

/* Optional: nicer keyboard-only focus */
svg .legend .item:focus-visible .swatch {
  stroke: grey;
  stroke-width: 2;
  rx: 2; ry: 2;
}

/* .grid line {
  stroke: #000;
  stroke-opacity: 0.1; 
  shape-rendering: crispEdges;
}
.grid--x line { stroke-dasharray: 2 2; } optional: vertical dashed
 */

.chart-tip .tip-actions {
  margin-top: .4rem;
}
.chart-tip .tip-actions .tip-cta {
  font: inherit;
  padding: .25rem .5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: var(--color-primary);
  cursor: pointer;
}

.tabs {
  display: none;
  justify-content: space-between;
  background: #e5e5e5;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20; 
}
.tab-group {
  display: flex;
}
.input {
  position: absolute;
  opacity: 0;
}
.label {
  width: auto;
  padding: min(5vw, 20px) min(4vw, 30px);
  font-size: min(3vw, var(--fs-headers));
  background: #e5e5e5;
  cursor: pointer;
  font-weight: bold;
  color: #7f7f7f;
  transition: background 0.1s, color 0.1s;
}
.label:active {
  background: #ccc;
}
.input:focus + .label {
  z-index: 1;
}
.input:checked + .label {
  background: #fff;
  color: #222222;
}
.panel {
  position: fixed;
  display: none;
  background: #fff;
  width: 100%;
  height: calc(100% - (var(--lh-base) + min(10vw, 40px)) + 2px);
  bottom: calc((var(--lh-base) + min(10vw, 40px)) + 2px);
}
.stage {
  width: 90%;
  height: 85%;
  padding: 20px;
}
.stage-grey {
  background-color: #f5f5f5;
  border-radius: 8px;
}
.stage-info {
  height: 90%;
  display: flex;
  flex-direction: column;
}
.input:checked + .label + .panel {
  display: flex;
  justify-content: center;
  align-items: center;
}
@media (min-width: 600px) {
  .label:hover {
    background: #d8d8d8;
  }
  .panel {
    order: 99;
  }
}
@media (max-width: 600px){
  .stage {
    width: 95%;
    height: 90%;
  }
  /* make labels share the footer width evenly */
  .label{
    flex: 1 1 1;
    text-align: center;
  }
}

#chart-info-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(640px, 92vw);
  max-height: 80vh;
  margin: auto;
}
#chart-info-dialog::backdrop { background: rgba(0,0,0,.4); }

.modal { padding: 16px 18px; font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans"; }
.modal-title { margin: 0 0 10px; font-weight: 600; font-size: 16px; }
.modal-body { 
  margin-block: 1rem;
  color: #374151;
 }
.modal-actions { margin-block: 12px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-actions > .button-modal {
  font-family: none;
  padding: 0;
  color: white;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #393939;
  cursor: pointer;
  font-size: 20px;
  display: block;
  width: 20px;
  height: 20px;
  line-height: 16px;
  text-align: center;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  transform: rotate(45deg);
  position: absolute;
  top: 12px;
  right: 12px;
}

.panel-body{
  flex: 1 1 auto;
  min-height: 0;              /* 🔑 allow child to be scrollable inside flex */
  min-width: 0;
  padding: 16px;
}

.sent-data-table-wrapper{
  margin-top: 1rem;
  height: 100%;
  overflow-y: auto;           /* vertical scroll */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* smooth on iOS */
}

.flex {
  display: flex;
}

.center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.bubble-wrap {
  overflow: visible;
  padding-left: 4rem;
}


.bubble{
  /* tune via CSS variables */
  --bg:#fff;
  --border:#c20012;   /* red outline */
  --bw:2px;           /* border width */
  --r:12px;           /* corner radius */
  --tailW:18px;       /* tail width */
  --tailH:12px;       /* tail half-height */
  --tailOffsetT: 15px;

  position: relative;
  width: 100%;
  height: 100%;
  padding: 16px 18px;
  background: var(--bg);
  border: var(--bw) solid var(--border);
  border-radius: var(--r);
  display: grid;
  grid-template-columns: 1fr auto; /* text | QR */
  gap: 16px;
}

/* OUTER triangle = border color */
.bubble::before{
  content:"";
  position:absolute;
  left: calc(-1 * var(--tailW));
  top: var(--tailOffsetT);                    /* vertical position of tail */
  border-top: var(--tailH) solid transparent;
  border-bottom: var(--tailH) solid transparent;
  border-right: var(--tailW) solid var(--border);
}

/* INNER triangle = background color (creates the stroke effect) */
.bubble::after{
  content:"";
  position:absolute;
  left: calc(-1 * var(--tailW) + (1.5 *var(--bw)));
  top: calc(var(--tailOffsetT));  /* align with box border */
  border-top: calc(var(--tailH)) solid transparent;
  border-bottom: calc(var(--tailH)) solid transparent;
  border-right: var(--tailW) solid var(--bg);
}

/* optional niceties */
.bubble .qr { height: 200px; }
.bubble p { margin:0; font: 600 18px/1.35 system-ui, sans-serif; }

@media (max-width: 600px) {
  .flex {
    flex-direction: column;
  }
  .bubble-wrap {
    padding-left: 0;
    padding-top: 2rem;
  }
  .bubble {
    grid-template-columns: none;
    grid-template-rows: 1fr auto;
  }
  /* OUTER triangle = border color */
  .bubble::before{
    content:"";
    position:absolute;
    top: calc(-1.7 * var(--tailW));
    left: var(--tailOffsetT);                    /* vertical position of tail */
    border-left: var(--tailH) solid transparent;
    border-right: var(--tailH) solid transparent;
    border-bottom: var(--tailW) solid var(--border);
    transform: rotate(90);
  }
  /* INNER triangle = background color (creates the stroke effect) */
  .bubble::after{
    content:"";
    position:absolute;
    top: calc(-1.7 * var(--tailW) + (1.5 *var(--bw)));
    left: calc(var(--tailOffsetT));  /* align with box border */
    border-left: calc(var(--tailH)) solid transparent;
    border-right: calc(var(--tailH)) solid transparent;
    border-bottom: var(--tailW) solid var(--bg);
    transform: rotate(90);
  }

}

.sent-data-table-wrapper p {
  margin-top: 0.5rem;
}
.sent-data-table-wrapper a {
  text-decoration: none;
  color: #c20012;
}
.sent-data-table-wrapper h2 {
  margin-top: 1rem;
  font-weight: 600;
}
.sent-data-table-wrapper > .text-block {
  max-width: min(100%, 800px);
  margin-block: 3rem;
}

.sent-data-table {
  width: 100%;
  margin-top: 3rem;
  margin-right: 1rem;
  border: 1px solid #e5e7eb;       /* slate-200 */
  border-radius: 12px;
  overflow: hidden;
  font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans";
}

.fade-bottom {
  content: '';
  margin-top: -100px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(251, 251, 251, 1) 0%, rgba(251, 251, 251, 0) 100%);
  position: relative;
}

.fade-top {
  content: '';
  margin-bottom: -100px;
  height: 40px;
  background: linear-gradient(to top, rgba(251, 251, 251, 1) 0%, rgba(251, 251, 251, 0) 100%);
  position: relative;
}

.sent-data-table .sdt-row {
  display: grid;
  grid-template-columns: minmax(140px, 30%) 1fr;  /* label | value */
  align-items: start;
}

.sent-data-table .sdt-header {
  background: #f9fafb;             /* gray-50 */
  font-weight: 600;
}

.sent-data-table .sdt-cell {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9; /* slate-100 */
}

.sent-data-table .sdt-row:last-child .sdt-cell {
  border-bottom: none;
}

.sent-data-table .sdt-cell--label { color: #111827; }  /* gray-900 */
.sent-data-table .sdt-cell--value { color: #374151; word-break: break-word; }

.sent-data-table .sdt-row:nth-child(even):not(.sdt-header) .sdt-cell {
  background: #fcfcfd;             /* very light zebra */
}

.sent-data-table .sdt-cell--span2 {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b7280;                   /* gray-500 */
}

/* Stack on small screens */
@media (max-width: 640px) {
  .sent-data-table .sdt-header { display: none; }
  .sent-data-table .sdt-row {
    grid-template-columns: 1fr;
  }
  .sent-data-table .sdt-cell--label {
    font-weight: 600;
    border-bottom: none;
  }
  .sent-data-table .sdt-cell--value {
    padding-top: 0;
  }
}


.download-btn {
  display: flex;
  color: white;
  background: var(--color-primary);
}

.grid--x line,
.grid--y line {
  stroke: #bbb;
  stroke-width: 1;
  stroke-dasharray: 2 3;
  shape-rendering: crispEdges;
}

#chart-info-dialog {
  background-color: #f9fafb;   /* light grey */
  color: #111827;              /* near-black text */
  border-radius: 12px;
}

#chart-info-dialog .modal-title {
  color: #111827;
  font-weight: 600;
}

#chart-info-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6); /* dim background */
}

/* ==========================================================================
EXTRA RESPONSIVE TWEAKS
(add these below your existing media(≤600px) block)
========================================================================== */


/* Phone breakpoint – refine all touch-targets, typography & autofill */
@media (max-width: 1000px) {
  /* Make your form span the viewport */
  form {
    /* width: 90%; */
    /* max-width: none; */
    padding: 0;
  }

  .form-step .field label {
    font-size: var(--fs-base-mobile);
    line-height: 1.4;
  }

  /* All inputs, selects, buttons, labels & custom-selects use the same base size */
  input, select, button, label, .field label, .custom-select .selected {
    font-size: var(--fs-base-mobile);
    line-height: 1.4;
  }

  /* 2) Headings & labels: same font-size, same line-height */
  .form-step h2 {
    font-size: var(--fs-headers-mobile);
    line-height: 1.4;
  }

  .field label {
    font-size: var(--fs-base-mobile);
    line-height: 1.4;
    margin-bottom: .5rem;
  } */

  /* 3) Inputs & selects: taller + bigger text
  .field input[type="text"],
  .field input[type="number"],
  .field select,
  .custom-select .selected {
    padding: 1rem;
    line-height: 3;
    min-height: 3rem;
  } */

  /* 4) Placeholder text – force it up to 1rem */
  .field .error-text,
  .field input::placeholder,
  .field input::-webkit-input-placeholder,  /* Chrome/Safari */
  .field input:-ms-input-placeholder,      /* IE 10+ */
  .field input::-ms-input-placeholder {    /* Edge */
    font-size: var(--fs-small-mobile);
    line-height: var(--lh-base);  /* or whatever line-height you use for error-text */
    opacity: 1;                   /* override any browser default opacity */
    color: var(--color-text-light); /* match your light-text color */
  }

  /* Autofill fix – override Chrome’s yellow/blue */
  /* input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-text) !important;
    -webkit-background-clip: text;
    box-shadow: 0 0 0px 1000px var(--color-body-bg) inset !important;
  } */

  /* Progress circles a bit smaller */
  #progress-bar .step::before {
    width: calc(1.5 * (var(--fs-base-mobile)));
    height: calc(1.5 * (var(--fs-base-mobile)));
    line-height: calc(1.5 * (var(--fs-base-mobile)));
    font-size: var(--fs-base-mobile);
  }
  #progress-bar .step:not(:last-child)::after {
    top: calc(.75 * (var(--fs-base-mobile)));
  }
  #progress-bar {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 600px) {
  .results-graphs {
    grid-template-columns: 1fr;
  }

  /* Stack buttons full-width */
  .buttons button {
    width: 50%;
    padding: 1rem;
    font-size: var(--fs-base-mobile);
  }
  
  .buttons {
    gap: 0.5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background: var(--color-body-bg);
    box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
    z-index: 1000;
  }

  .mobile-spacer {
    display: block;
    height: 8rem; /* match or slightly exceed your fixed button bar height */
  }
}

/* Subtle toggle button (form <-> results) */
.toggle-view-btn {
  position: fixed;
  top: 1.5rem;           /* distance from top of .main-content */
  right: 2rem;           /* distance from right of .main-content */

  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  font-size: var(--fs-small);
  font-family: inherit;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
  z-index: 10000;          /* sit above charts / form contents */
}

.toggle-view-btn i {
  font-size: 0.9em;
}

.toggle-view-btn:hover {
  background: #e5e7eb;
}

.toggle-view-btn:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

.mt-2 {
  margin-top: 2rem;
}

@media (max-width: 600px) {
  .toggle-view-btn {
    top: 1rem;
    right: 1rem;
    font-size: var(--fs-small-mobile);
  }
  .toggle-label {
    display: none;
  }
}

.hidden { display: none; }
