html,
body {
  margin: 0;
  padding: 2px;
  overflow-x: hidden;
  background: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 120%;
}



/* For main header tables, use max-width and center */
.main-header-table {
  max-width: 1100px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

a {
  text-decoration: none;
  color: rgb(31, 78, 31);
}

/* push header logos inward from the edges */
table img[align="left"] {
  padding-top: 20px;
  margin-left: 20px;
}

table img[align="right"] {
  margin-top: 20px;
  margin-right: 20px;
}

table.menu,
table.menu td {
  background-color: rgb(88, 88, 88);
  height: 62px;
  text-align: center;
  font-size: medium;
  vertical-align: middle;
  white-space: nowrap;
}

/* Prevent header text from overflowing and scale down if needed */
td,
th {
  word-break: break-word;
  overflow-wrap: break-word;
}

table[background*="topbg.jpg"] font[size="+4"],
table[background*="topbg.jpg"] font[size="+3"] {
  display: block;
  text-align: center;
  max-width: 100%;
  font-size: clamp(1.5rem, 5vw, 2.8rem);
  line-height: 1.1;
  margin: 0 auto;
  white-space: normal;
}

/* Force header text in top table to center and wrap, even with inline font tags */
table[background*="topbg.jpg"] td {
  text-align: center !important;
  vertical-align: middle;
}

table[background*="topbg.jpg"] font[size],
table[background*="topbg.jpg"] b,
table[background*="topbg.jpg"] center {
  display: block;
  text-align: center !important;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Make sure images in header stay at the edges */
table[background*="topbg.jpg"] img[align="left"] {
  float: left;
  margin-left: 10px;
}

table[background*="topbg.jpg"] img[align="right"] {
  float: right;
  margin-right: 10px;
}

img.logo,
img.kylogo {
  height: 90px;
  padding: 10px;
}

/* Robust, simple centering for header with images and text */
.header-row {
  width: 100%;
}

.header-row td {
  vertical-align: middle;
}

.header-row .header-left {
  text-align: left;
  width: 20%;
}

.header-row .header-center {
  text-align: center;
  width: 60%;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  word-break: break-word;
  white-space: normal;
}

.header-row .header-right {
  text-align: right;
  width: 20%;
}

.header-row .header-title {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2.2em;
  font-weight: bold;
  padding-bottom: 1rem;
}

.header-row .header-subtitle {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.5em;
}