:root {
  /* Bright, pro theme */
  --bg: #0a0f1f;
  --card: #0f1730;
  --ink: #f7fbff;
  --muted: #c3cfec;
  --accent: #16a34a; /* emerald */
  --accent-2: #06b6d4; /* cyan */
  --accent-3: #f59e0b; /* amber */
  --shadow: 0 22px 44px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}
html,
body {
  /* height: 100%; */
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter,
    Arial, Apple Color Emoji, Segoe UI Emoji;
  background: radial-gradient(
      1400px 900px at 90% -10%,
      #1c2750 0%,
      #0b1226 60%,
      #070a15 100%
    ),
    linear-gradient(120deg, rgba(6, 182, 212, 0.15), rgba(22, 163, 74, 0.12));
  color: var(--ink);
  overflow-y: auto; /* ✅ allow page scroll */
}

.wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh; /* ✅ let content extend beyond viewport */
  display: grid;
  grid-template-rows: auto auto 1fr auto; /* header, widgets, main, footer */
  gap: 12px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.title {
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 800;
  margin: 0;
  background: linear-gradient(90deg, #e2f8ff, #baf9d1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.widget {
  grid-column: span 4;
  background: linear-gradient(
    180deg,
    rgba(17, 95, 170, 0.25),
    rgba(15, 40, 90, 0.7)
  );
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  min-height: 72px;
}
.widget .label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.widget .value {
  font-size: 20px;
  font-weight: 800;
}

.card {
  background: linear-gradient(180deg, #0f1730 0%, #0a1228 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 4px 16px;
}

.left {
  grid-column: span 5;
  padding: 16px;
}
.right {
  grid-column: span 7;
  padding: 16px;
}

.section-title {
  font-weight: 800;
  font-size: 16px;
  margin: 0 0 12px;
}

/* Controls */
.control {
  margin-bottom: 12px;
}
.control label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
select,
input[type="range"] {
  width: 100%;
  background: #0c1428;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 10px;
  color: var(--ink);
  outline: none;
  padding-inline:5%;
}


.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.badge {
  background: linear-gradient(
    180deg,
    rgba(6, 182, 212, 0.16),
    rgba(6, 182, 212, 0.08)
  );
  border: 1px dashed rgba(255, 255, 255, 0.22);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.radios {
  display: flex;
  gap: 10px;
  margin: 8px 0 4px;
}
.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  user-select: none;
}
.radio input {
  accent-color: var(--accent-2);
}

/* Vertical stats list */
.stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat {
  background: #0d1733;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
}
.stat .k {
  font-size: 12px;
  color: var(--muted);
}
.stat .v {
  font-weight: 900;
  font-size: 18px;
  margin-top: 6px;
}

/* Flashy callouts */
.callout {
  position: relative;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.25),
    rgba(16, 185, 129, 0.25)
  );
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 30px rgba(16, 185, 129, 0.25);
}
.callout h4 {
  margin: 0 0 6px;
  font-size: 15px;
}
.callout .big {
  font-size: 22px;
  font-weight: 900;
}
.callout small {
  color: var(--muted);
}
.callout::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      600px 200px at -10% -10%,
      rgba(255, 255, 255, 0.15),
      transparent 40%
    ),
    radial-gradient(
      300px 120px at 110% 120%,
      rgba(255, 255, 255, 0.12),
      transparent 40%
    );
  mix-blend-mode: screen;
  pointer-events: none;
  border-radius: inherit;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer {
  0% {
    opacity: 0.7;
  }
  50% {
    opacity: 0.35;
  }
  100% {
    opacity: 0.7;
  }
}

.choice {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}
.choice input {
  accent-color: var(--accent);
}

aside.tip {
  background: linear-gradient(
    180deg,
    rgba(6, 182, 212, 0.12),
    rgba(22, 163, 74, 0.1)
  );
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 12px;
  border-radius: 14px;
  margin-top: 10px;
  font-size: 12px;
}

hr.sep {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 12px 0;
}
small.dim {
  color: var(--muted);
}

.term-choices {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.term-choices .badge {
  cursor: pointer;
  background: none;
  border: none;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 18px;
  text-align: center;
  width:16.7%;
  margin-top: -16px;
}

.term-choices .badge small {
  font-size:10px;
}


.term-choices .term-chip {
  transition: transform 0.08s ease, box-shadow 0.12s ease;
}
.term-choices .term-chip:hover {
  transform: translateY(-1px);
}
.term-choices .term-chip.active {
  /*background: linear-gradient(
    180deg,
    rgba(22, 163, 74, 0.35),
    rgba(6, 182, 212, 0.25)
  );
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  */
  color: #eafff7;
  font-weight: 800;
}

#main-grid {
  /* was overflow:hidden; removed so content can grow */
}

/* Footer */
footer {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 24px; /* ✅ add breathing room */
}

/* Buttons — hardened to avoid overrides */
.cta .btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.cta .btn-primary {
  background: linear-gradient(90deg, var(--accent), #22d3ee) !important;
  color: #051226 !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}
.cta .btn-ghost {
  background: transparent !important;
  color: var(--ink) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}
.cta-right {
  text-align:right;
}
.cta .btn-right {
  margin: 20px 0 0;
}

/* Footer card styling */
.footer-card{
  padding:16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0f1730 0%, #0a1228 100%);
  border:1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  margin-top: 8px;
  margin-bottom: 28px;        /* breathing room at very bottom */
}

/* Header row inside footer */
.footer-card .footer-head{
  display:flex; align-items:center; gap:10px;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 8px;
}
.footer-card .footer-head .dot{
  width:10px; height:10px; border-radius:50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(34,211,238,.6);
}

/* Terms text — pre-wrap for the multi-line block */
.footer-card .footer-body{
  white-space: pre-wrap;
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
}

/* Management Override: deposit strip */
.ov-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* 3 equal horizontal bands of ~33% each */
.ov-col { display:flex; align-items:center; gap:8px; }
.ov-col1 { flex: 0 0 33%; }
.ov-col2 { flex: 0 0 33%; }
.ov-col3 { flex: 0 0 33%; }

/* Inside each 33%: 8% radio + 25% content (or 25% select) */
.ov-col1 select.ov-slim { flex: 0 0 25%; min-width: 0; }
.ov-col1 .ov-radio      { flex: 0 0 8%; }
.ov-col2 .ov-radio      { flex: 0 0 8%; }
.ov-col2 .ov-text       { flex: 0 0 25%; white-space:nowrap; }
.ov-col3 .ov-radio      { flex: 0 0 8%; }
.ov-col3 .ov-input      { flex: 0 0 25%; min-width: 0; }


/* Make the dropdown 25% of its normal width when in override */
select.ov-slim { width: 25% !important; }

/* Tighten number input appearance */
.ov-input {
  background: #0c1428;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--ink);
}

/* One-line override strip: radio – select – radio – £99 – radio – input */
.ov-inline{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:8px;
  flex-wrap:nowrap;
}
.ov-inline .ov-radio{ width:18px; height:18px; accent-color: var(--brand-purple); }
.ov-inline .ov-text{ white-space:nowrap; }
.ov-inline .ov-input{
  background:#0c1428;
  border:1px solid rgba(255,255,255,0.16);
  border-radius:12px;
  padding:8px 10px;
  color:var(--ink);
  min-width:120px;
}

/* Grey/disable behaviour */
.ov-disabled{ opacity:.45; filter:grayscale(.2); pointer-events:none; }
select.ov-slim{ /* width set by JS; keep it tidy visually */ min-width:100px; }


/* display metric specfici settings follow */
@media (max-width: 900px) {
  body {
    overflow: auto;
  }
  .widget {
    grid-column: span 12;
  }
  .left,
  .right {
    grid-column: span 12;
  }
  /* Ensure nothing upstream clips the footer */
  #main-grid { overflow: visible !important; }
}


/* (Optional) cap extreme height and let footer itself scroll if massive */
@media (min-width: 901px){
  .footer-card{
    max-height: 30vh;        /* tweak if you want more/less */
    overflow-y: auto;        /* only shows scrollbar when needed */
    padding-right: 12px;     /* room for scrollbar */
  }
}

/* Mobile: let it grow naturally */
@media (max-width: 900px){
  .footer-card{ max-height: none; overflow: visible; }
  .choice label { width: 100% }
  .readonlyTextNorm {
     position: absolute;
     left: 145px;
     margin-top: -11px;
  }

  .term-choices .badge {
     width:14%;
  }  

}

@media (max-width: 520px){
  .ov-inline{
    flex-wrap: wrap;       /* allow flowing onto the next line */
    gap: 8px 10px;         /* tighter spacing on mobile */
  }
  .ov-inline select.ov-slim{ min-width: 90px; }  /* prevent vanishingly small select */
  .ov-inline .ov-input{     min-width: 90px; }   /* keep custom amount usable */
}
