html, body {
  max-width: 100%;
  overflow-x: hidden !important;
}

body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
}

img, iframe {
  max-width: 100%;
  height: auto;
}

a {
  word-break: break-word;
}

/* Common fixed-width tables */
table[width="960"],
table[width="900"],
table[width="790"],
table[width="750"],
table[width="700"],
table[width="680"],
table[width="650"],
table[width="610"],
#loading {
  width: min(960px, calc(100% - 32px)) !important;
  max-width: calc(100% - 32px) !important;
}

table[width="900"] { width: min(900px, calc(100% - 32px)) !important; }
table[width="790"] { width: min(790px, calc(100% - 32px)) !important; }
table[width="750"] { width: min(750px, calc(100% - 32px)) !important; }
table[width="700"] { width: min(700px, calc(100% - 32px)) !important; }
table[width="680"] { width: min(680px, calc(100% - 32px)) !important; }
table[width="650"] { width: min(650px, calc(100% - 32px)) !important; }
table[width="610"] { width: min(610px, calc(100% - 32px)) !important; }

/* fixed inner content boxes used on recruit/contact pages */
div[style*="width: 640px"],
div[style*="width:640px"],
div[style*="width: 620px"],
div[style*="width:620px"],
div[style*="width: 610px"],
div[style*="width:610px"] {
  width: auto !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Header */
.site-header {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
}

.menu-toggle {
  display: none;
  appearance: none;
  border: 1px solid #cfcfcf;
  background: #fff;
  color: #6E6E6E;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
}

.menu-toggle:focus-visible {
  outline: 2px solid #999;
  outline-offset: 2px;
}

#menu {
  position: relative;
}

#menu ul {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

#menu li,
#menu ul {
  left: auto !important;
  float: none !important;
}

#menu li a {
  width: auto;
  min-width: 70px;
  height: auto;
  padding: 6px 8px;
}

.header-facebook {
  min-width: 30px;
}

/* Work masonry fallback */
#wrapper {
  width: min(1100px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

#container {
  width: 100% !important;
  max-width: 1100px;
}

/* Think accordion desktop fit */
.ac-container,
.ac-container label {
  max-width: 100%;
}

.site-footer-copyright {
  width: min(960px, calc(100% - 32px));
  margin: 40px auto 20px;
  text-align: right;
  font-size: 8pt;
  color: #6E6E6E;
}

@media (max-width: 767px) {
  .site-header {
    width: calc(100% - 24px);
  }

  .site-header,
  .site-header tbody,
  .site-header tr {
    display: block;
  }

  .site-header td {
    display: block;
    width: auto !important;
    height: auto !important;
    text-align: left !important;
  }

  .site-header .header-logo {
    margin-bottom: 10px;
  }

  .site-header .header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
  }

  .site-header .header-facebook {
    position: absolute;
    top: 18px;
    right: 12px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #menu {
    display: none;
    width: 100%;
    margin-top: 10px;
  }

  #menu.is-open {
    display: block;
  }

  #menu ul {
    display: block;
    margin: 0;
    padding: 0;
  }

  #menu li {
    margin: 0 0 8px;
  }

  #menu li a {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: left;
    padding: 12px 10px;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    font-size: 14px;
  }

  #slide-line {
    display: none !important;
  }

  /* generic content tables */
  table[width="960"],
  table[width="900"],
  table[width="790"],
  table[width="750"],
  table[width="700"],
  table[width="680"],
  table[width="650"],
  table[width="610"] {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }

  table[width="900"] tr,
  table[width="790"] tr,
  table[width="750"] tr,
  table[width="700"] tr,
  table[width="680"] tr,
  table[width="650"] tr,
  table[width="610"] tr,
  table[width="900"] td,
  table[width="790"] td,
  table[width="750"] td,
  table[width="700"] td,
  table[width="680"] td,
  table[width="650"] td,
  table[width="610"] td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }

  table[width="900"] td,
  table[width="790"] td,
  table[width="750"] td,
  table[width="700"] td,
  table[width="680"] td,
  table[width="650"] td,
  table[width="610"] td {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  table[width="900"] td[width="520"],
  table[width="790"] td[width="180"],
  table[width="750"] td[width="100"],
  table[width="700"] td[width="100"],
  table[width="650"] td[width="200"] {
    text-align: left !important;
  }

  table[width="900"] td img,
  table[width="790"] td img,
  table[width="750"] td img,
  table[width="700"] td img,
  table[width="680"] td img,
  table[width="650"] td img,
  table[width="610"] td img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* contact/recruit inner spacing */
  div[style*="padding-left: 55px"],
  div[style*="padding-left:55px"],
  img[style*="padding-left: 3em"],
  img[style*="padding-left:3em"] {
    padding-left: 0 !important;
  }

  /* work category/sort bar */
  #work {
    display: block;
    width: 100% !important;
    text-align: left !important;
    padding-bottom: 10px;
  }

  /* work listing */
  #wrapper {
    width: calc(100% - 24px);
    margin-top: 24px;
  }

  #container {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
    height: auto !important;
    position: static !important;
    margin-bottom: 20px;
  }

  .grid {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: calc(50% - 6px) !important;
    margin: 0 !important;
    padding: 10px !important;
    box-sizing: border-box;
  }

  #loading {
    height: auto !important;
  }

  #loading img {
    width: min(280px, 100%);
    height: auto;
  }

  /* think page accordion */
  .ac-container,
  .ac-container label,
  .ac-container table[width="610"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  .ac-container div[class*="ac-topic"] {
    height: auto !important;
  }

  /* detail page */
  td[style*="font-size:32pt"] {
    font-size: 22pt !important;
    text-align: left !important;
  }

  iframe[width="600"], iframe[width="650"] {
    width: 100% !important;
    height: 320px !important;
  }

  /* archive/news tables */
  td[width="90"] img {
    width: 72px !important;
    max-width: 72px !important;
  }

  .site-footer-copyright {
    width: calc(100% - 24px);
    margin: 24px auto 16px;
    text-align: center;
    font-size: 10px;
    line-height: 1.6;
  }
}

@media (max-width: 479px) {
  .grid {
    width: calc(50% - 6px) !important;
    padding: 6px !important;
  }

  body, td {
    font-size: 14px !important;
    line-height: 1.7;
  }

  h1 {
    font-size: 18pt;
    line-height: 1.4;
  }

  iframe[width="600"], iframe[width="650"] {
    height: 260px !important;
  }
}
