body {
  font-family: Arial, sans-serif;
  text-align: center;
  background-color: #f5f5f5;
  margin: 0;
  padding: 0;
}

h1 { margin-top: 30px; }

a { color: #007BFF; text-decoration: none; }
a:hover { text-decoration: underline; }

.options-container {
  display: flex;
  justify-content: center;
  margin-top: 50px;
  gap: 30px;
  flex-wrap: wrap;
}

.option-box {
  display: block;                 /* <- add this */
  background-color: white;
  border: 2px solid #ccc;
  border-radius: 10px;
  padding: 30px;
  width: 250px;
  height: 200px;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: 0.3s;
  text-decoration: none;          /* anchors shouldn’t underline */
  color: inherit;                  /* keep text color */
}

.option-box:hover { transform: scale(1.05); border-color: #007BFF; }
.coming-soon { opacity: 0.6; cursor: not-allowed; }

*, *::before, *::after { box-sizing: border-box; }

.container {
  max-width: 1100px;          /* was 900px */
  width: calc(100% - 48px);   /* keeps nice side padding on small screens */
  margin: 20px auto 60px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 24px;              /* a touch more breathing room */
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  text-align: left;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));  /* minmax(0,1fr) prevents overflow */
  column-gap: 18px;
  row-gap: 14px;
}
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }

.input, .select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
  height: 42px;               /* keeps coupon + neighbor fields same height */
}
/* Chrome/Safari/Edge: remove spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  appearance: none;          /* ← standard */
  -webkit-appearance: none;  /* vendor */
  margin: 0;
}

/* Firefox: make number inputs look like text fields (no spinners) */
input[type="number"] {
  appearance: textfield;     /* ← standard */
  -moz-appearance: textfield;/* vendor */
}
.row { margin-top: 14px; }

.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background: #f2f2f2;
  cursor: pointer;
  font-weight: 600;
}
.btn.primary { background: #10b981; color: #083b2d; border-color: #0ea271; }
.btn:hover { filter: brightness(0.98); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.stat {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px;
  background: #fafafa;
}
.stat .k { color: #666; font-size: 12px; }
.stat .v { font-weight: 700; margin-top: 4px; }

.note { color: #666; font-size: 13px; margin-top: 10px; }

.back { display: inline-block; margin: 12px 0 0; }

.back { display: inline-block; margin: 12px 0 0; }  /* keep existing */

.back-top {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  color: #007BFF;
  text-decoration: none;
}
.back-top:hover { text-decoration: underline; }
/* --- tiny info tooltips --- */
.help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 50%;
  background: #eef6ff;
  color: #0b63ce;
  border: 1px solid #b6d4ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  position: relative;
}

.help .bubble {
  position: absolute;
  top: 120%;
  left: 0;
  z-index: 100;
  width: 280px;
  max-width: calc(100vw - 48px);
  background: #111;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  font-size: 13px;
  line-height: 1.3;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
}

.help:hover .bubble,
.help:focus .bubble {
  opacity: 1;
  visibility: visible;
}

.help .bubble::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 10px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
}
/* --- glossary footer --- */
.glossary {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  color: rgba(0,0,0,0.7);   /* ~70% opacity gray */
  font-size: 13px;
  line-height: 1.45;
}
.glossary dt { font-weight: 700; }
.glossary dd { margin: 4px 0 12px 0; }
.glossary code { background:#f6f6f6; border:1px solid #eaeaea; border-radius:6px; padding:1px 6px; }
/* Correlation heatmap buckets */
.matrix td.cneg3 { background: #ffd0d0; } /* <= -0.75 strong negative */
.matrix td.cneg2 { background: #ffe0e0; } /* -0.75 .. -0.40 */
.matrix td.cneg1 { background: #fff0f0; } /* -0.40 .. -0.10 */
.matrix td.czero { background: #ffffff; } /* -0.10 ..  0.10 */
.matrix td.cpos1 { background: #f0fff0; } /*  0.10 ..  0.40 */
.matrix td.cpos2 { background: #e0ffe0; } /*  0.40 ..  0.75 */
.matrix td.cpos3 { background: #d0ffd0; } /* >= 0.75 strong positive */

.corner-right { right: 16px; left: auto; }
/* --- Back to Stocks: consistent pill button (matches DCA page) --- */
.back { display: inline-block; }

.back-top{
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1000;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 8px 12px;
  border-radius: 9999px;
  background: #fff;
  color: #111;
  border: 1px solid #ddd;
  text-decoration: none;
  font-weight: 600;

  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}

.back-top:hover{
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}

.back-top:active{
  transform: translateY(0);
}

.back-top:focus-visible{
  outline: 2px solid #93c5fd; /* subtle focus ring */
  outline-offset: 2px;
}

/* optional: when you do want it on the right */
.corner-right{ right:16px; left:auto; }
/* Base layout */
body { font-family: Arial, sans-serif; text-align: center; background-color: #f5f5f5; margin: 0; padding: 0; }
h1 { margin-top: 30px; }
.subtitle { color: #555; margin: 8px 0 24px; }
.page { max-width: 1000px; margin: 0 auto; padding: 20px; text-align: left; }

/* Home cards */
.options-container { display: flex; justify-content: center; margin-top: 50px; gap: 30px; flex-wrap: wrap; }
.option-box { display: block; background: #fff; border: 2px solid #ccc; border-radius: 12px; padding: 20px; width: 260px; cursor: pointer; transition: transform .1s ease, box-shadow .1s ease; }
.option-box:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.option-box h2{ margin: 0 0 8px; }

/* Buttons & links */
.back-btn { display: inline-block; margin: 10px 0 20px; text-decoration: none; border: 1px solid #ccc; padding: 8px 12px; border-radius: 10px; background: #fff; color: #000; }
.btn { display: inline-block; padding: 10px 14px; border-radius: 10px; border: 1px solid #bbb; background: #fff; cursor: pointer; }
.btn:hover { filter: brightness(0.98); }
.btn.primary { border-color: #2e67ff; }
.btn.danger { border-color: #e05a5a; }
.btn.light { border-color: #ddd; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

/* Hub grid */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.tool-card { background: #fff; border: 2px solid #ccc; border-radius: 12px; padding: 18px; cursor: pointer; }
.tool-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }

/* Forms & results */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; background: #fff; border: 2px solid #ddd; padding: 16px; border-radius: 12px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-weight: bold; }
.form-row input, .form-row select { padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; }
.results { margin-top: 16px; display: grid; gap: 12px; grid-template-columns: 1fr; }
.results.two-col { grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); }
.kv { display: flex; justify-content: space-between; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.kv.small { font-size: 0.9rem; color: #555; border-style: dashed; }

/* Payoff builder */
.builder { display: grid; grid-template-columns: 1fr; gap: 14px; }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; background: #fff; border: 2px solid #ddd; padding: 12px; border-radius: 12px; }
.leg-table table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; border: 2px solid #ddd; }
.leg-table th, .leg-table td { border-bottom: 1px solid #eee; padding: 10px; text-align: left; }
.leg-table th { background: #fafafa; }

/* Charts */
.chart-container { margin-top: 20px; background: #fff; border: 2px solid #ddd; border-radius: 12px; padding: 10px; }

/* Utilities */
.hint { color:#666; font-size: 0.85rem; }
