html, body {
  margin: 0;
  padding: 0;
}

form {
  display: block;
  width: 100%;
  max-width: inherit;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Container & Layout === */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: top;

  min-height: 100vh;
  width: 100%;
  max-width: 400px;          /* 📱 Mobile default */
  margin: 0 auto;
  padding: 3px 3px;
  box-sizing: border-box;
  text-align: center;
  gap: 15px;
  overflow-x: auto;          /* prevent overflow on small screens */
}


/* 🎯 ADD THIS NEW RULE: Overrides Flexbox for the chart area */
.container .chart-section {
    width: 100%;
    max-width: none; /* Crucial for allowing the chart to use the full 400px width */
    padding: 0;
    margin: 0;
    align-self: stretch; /* Makes sure it spans the full width of the container */
}


/* --- Responsive scaling --- */
@media (min-width: 768px) {
  .container {
    max-width: 700px;        /* 🖥 Tablet */
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1000px;       /* 💻 Desktop */
  }
}

/* ✅ Optional full-width layout (use <div class="container wide">) */
.container.wide {
  max-width: 100%;
  padding: 0 10px;
}

/* === Buttons === */
.button {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-color, #000);

  display: inline-block;
  vertical-align: bottom;
  width: var(--btn-width, 300px);
  max-width: 100%;
  min-height: var(--btn-min-height, 50px);
  padding: 8px 12px;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;

  background: linear-gradient(
    to bottom,
    var(--grad-top, #dff5fb) 0%,
    var(--grad-mid, #c5e5ed) 50%,
    var(--grad-bottom, #97b5bd) 100%
  );

  border-radius: 6px;
  border: 1px solid var(--border-color, #1b4b63);

  box-shadow:
    0 2px 4px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.4);

  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  cursor: pointer;
  transition: filter 0.2s, box-shadow 0.2s;
}

.button:hover { filter: brightness(0.90); }

.button.blue {
  --grad-top: #dff5fb;
  --grad-mid: #8ecae6;
  --grad-bottom: #219ebc;
  --border-color: #1b4b63;
  --text-color: #00394d;
}

.button.red {
  --grad-top: #edeef0;
  --grad-mid: #eb776e;
  --grad-bottom: #ba5952;
  --border-color: #9b1f1f;
  --text-color: #4d0000;
}

.button.gray {
  --grad-top: #f2f2f2;
  --grad-mid: #d9d9d9;
  --grad-bottom: #bfbfbf;
  --border-color: #808080;
  --text-color: #333333;
}

.button.green {
  --grad-top: #edeef0;
  --grad-mid: #bdf2cf;
  --grad-bottom: #a7cfb5;
  --border-color: #2e703f;
  --text-color: #063d1e;
}


.button.wide {
  --btn-width: 400px;
}

.button.info {
  --btn-width: 600px; 
 }

/* === Inputs & Labels === */
label {
  display: block;
  font-size: 0.85em;
  margin-bottom: 3px;
  text-align: left;
}

.textbox {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  display: inline-block;
  width: var(--tb-width, 400px);
  max-width: var(--tb-max-width, 100%);
  padding: 8px 12px;
  margin: 0 3px 8px;
  border: var(--tb-border-width, 2px) solid var(--tb-border-color, #ccc);
  border-radius: var(--tb-radius, 6px);
  box-sizing: border-box;
  background-color: var(--tb-bg, #fff);
  color: var(--tb-color, #000);
}

.textbox.courier {
	font-size: 24px;
	--tb-width: 250px;
    --tb-max-width: 100%;
}
.textbox.short {
  --tb-width: 300px;
  --tb-max-width: 100%;
}

.textbox.red {
  --tb-border-width: 3px;
  --tb-border-color: #c00;
}

.textbox.red.short {
  --tb-width: 300px;
  --tb-max-width: 100%;
  --tb-border-width: 3px;
  --tb-border-color: #c00;
}

.textbox::placeholder {
  color: #748eb3;
  opacity: 1;
}

.textbox.red::placeholder {
  color: #d00;
  opacity: 1;
}

/* === Field Wrappers === */
.field-short {
  display: inline-block;
  text-align: left;
  width: auto;
  margin: 0 auto;
}

.field-short .textbox.short {
  width: 300px;
  max-width: 100%;
  display: block;
  margin: 0;
}

.field-short label {
  display: block;
  font-size: 0.85em;
  margin-bottom: 3px;
}

/* === Warning Message === */
.warning {
  display: inline-block;
  align-items: center;
  gap: 8px;
  background-color: #ffe6e6;
  border: 1px solid #ff4d4d;
  border-radius: 6px;
  color: #b20000;
  font-weight: bold;
  font-size: 1.2em;
  padding: 10px 14px;
  margin: 0 8px;
  box-sizing: border-box;
  width: 400px;
  max-width: 100%;
}

.warning::before {
  content: "⚠️";
  font-size: 1.2em;
  line-height: 1;
}

/* === Tables === */
table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  background: #fff;
  margin-bottom: 10px;
  table-layout: auto;
  font-size: 1rem; /* base size for desktop */
}

th, td {
  padding: 8px 12px;
  text-align: left;
  word-wrap: break-word;
}

/* 🧾 Wide table variant (use <table class="wide-table">) */
.wide-table {
  width: 100%;
  max-width: none;
}

/* 📱 Responsive scaling (no horizontal scroll) */
@media (max-width: 800px) {
  table {
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  table {
    font-size: 0.85rem;
    transform: scale(0.95);
    transform-origin: top center;
  }
}

@media (max-width: 450px) {
  table {
    font-size: 0.8rem;
    transform: scale(0.9);
    transform-origin: top center;
  }
}

.hyphenate {
  display: inline-block;
  width: 100%;              /* 👈 give the browser a wrapping context */
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;   /* 👈 stronger hint */
  hyphens: auto;
  -webkit-hyphens: auto;    /* 👈 for Safari/Chrome */
  -ms-hyphens: auto;        /* 👈 legacy Edge */
}

/* === Report tables === */
.report-table {
  width: 100%;
}

.report-row {
  margin-bottom: 10px;
}

.mini-table {
  width: 100%;
  max-width: 400px;
  border-collapse: collapse;
  background: #fff;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.mini-table td {
  padding: 4px 8px;
  text-align: left;
  word-wrap: break-word;
}

/* 📱 mobile / desktop toggle */
.report-row.desktop { display: none; }
.report-row.mobile { display: block; }

@media (min-width: 768px) {
  .report-row.desktop { display: block; }
  .report-row.mobile { display: none; }
}

/* --- New Nav Bar Variables --- */
:root {
    --nav-bg: #25452C;
    --nav-height: 50px; /* Better for touch/visibility than 15px */
}

/* Hide from Printer */
@media print {
    .no-print { display: none !important; }
}

/* The Bar - Fixed at the very top */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--nav-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    z-index: 2000; /* High z-index to stay above everything */
    padding: 0 15px;
    box-sizing: border-box;
}

/* Spacer to push the .container down so it doesn't hide under the bar */
.nav-spacer {
    height: var(--nav-height);
    width: 100%;
}

/* Left Icon Scaling */
.home-icon {
    height: 35px; /* Scaled down from 304px to fit the bar */
    width: auto;
    display: block;
}

/* Center Text */
.nav-center {
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    display: flex;
    gap: 15px;
}

.nav-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adds "..." if the title is too long */
    max-width: 150px;       /* Adjust based on your preference */
}

/* Burger Button */
.burger-menu {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 5px;
}

.burger-bar {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
}

/* Vertical Dropdown Menu */
.menu-content {
    display: none; 
    position: absolute;
    top: var(--nav-height);
    right: 0;
    background-color: var(--nav-bg);
    width: 190px;
    flex-direction: column;
    padding: 15px;
    box-shadow: -2px 5px 10px rgba(0,0,0,0.4);
    border-bottom-left-radius: 8px;
	max-height: 90vh;    /* Prevents menu from going off-screen */
    overflow-y: auto;    /* Adds a scrollbar INSIDE the menu if it's too long */
}

.menu-content.active {
    display: flex;
}

/* --- REUSING YOUR BUTTON STYLES --- */
.button.short {
    --btn-width: 180px; /* As requested */
    margin: 5px auto;   /* Center buttons in the dropdown */
}

/* Override for forms inside the menu to prevent stretching */
.menu-content form {
    width: auto;
    padding: 0;
    text-align: center;
}