/* ChemicalCSSVersion: 1.3 */

:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
  color: #111;
  background: #eeeeee;
}

.MainWrapper {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 14px 16px 28px;
  background: #ffffff;
}

.PageHeader h1 {
  margin: 4px 0 22px;
  text-align: center;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1.05;
}

.InputForm {
  width: 100%;
  text-align: center;
}

.ChemNumberLabel {
  display: block;
  width: 100%;
  margin: 8px 0 12px;
  text-align: center;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 700;
}

.ChemInputRow,
.ChemButtonRow,
.HomeButtonRow {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
}

.ChemNumberInput {
  width: min(82vw, 360px);
  padding: 10px 14px;
  font-size: clamp(2.4rem, 13vw, 4.5rem);
  text-align: center;
  border: 3px solid #123a7a;
  border-radius: 10px;
  background: #f8f8f8;
  color: #111;
}

.ChemButtonRow {
  margin-top: 14px;
}

.PrimaryButton {
  display: inline-block;
  min-width: 220px;
  padding: 12px 26px;
  border: 2px solid #123a7a;
  border-radius: 9px;
  background: #1e5aa8;
  color: #fff;
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.PrimaryButton:hover,
.PrimaryButton:focus-visible {
  background: #16457f;
}

.ResultPanel {
  width: min(100%, 680px);
  margin: 24px auto 8px;
  text-align: center;
}

.ResultCode {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  font-weight: 700;
}

.ResultDescription {
  min-height: 60px;
  margin: 0;
  padding: 12px;
  border: 1px solid #bdbdbd;
  border-radius: 8px;
  font-size: clamp(1.2rem, 4.7vw, 1.7rem);
  line-height: 1.25;
  background: #fafafa;
}

.WikipediaRow {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
}

.WikipediaButton[hidden] {
  display: none !important;
}

.WikipediaButton {
  display: inline-block;
  padding: 9px 18px;
  border: 1px solid #333;
  border-radius: 7px;
  background: #f2f2f2;
  color: #111;
  font-size: clamp(1rem, 4vw, 1.2rem);
  font-weight: 700;
  text-decoration: none;
}

.WikipediaButton:hover,
.WikipediaButton:focus-visible {
  background: #e2e2e2;
}

.AboutSection {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #cccccc;
}

.AboutLead,
.AboutText {
  width: min(100%, 760px);
  margin: 0 auto;
  text-align: center;
  font-size: clamp(1rem, 4.4vw, 1.35rem);
  line-height: 1.3;
}

.AboutLead {
  font-weight: 700;
}

.PlacardGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 760px);
  margin: 18px auto;
  align-items: center;
  justify-items: center;
}

.PlacardGrid img {
  display: block;
  width: 100%;
  max-width: 150px;
  height: auto;
}

.HomeButtonRow {
  margin: 24px 0 20px;
}

.VersionPanel {
  margin-top: 18px;
  border: 1px solid #9eb8dc;
  border-radius: 8px;
  overflow: hidden;
}

.VersionPanel h2 {
  margin: 0;
  padding: 10px;
  text-align: center;
  font-size: 1.15rem;
  background: #eef4fb;
}

.VersionGrid {
  display: grid;
  grid-template-columns: 1.45fr .55fr 1.4fr;
  font-size: .95rem;
}

.VersionGrid > div {
  padding: 7px 8px;
  border-top: 1px solid #e0e0e0;
  overflow-wrap: anywhere;
}

.VersionHead {
  font-weight: 700;
  text-align: center;
  background: #f5f5f5;
}

@media (max-width: 640px) {
  .MainWrapper {
    padding-left: 12px;
    padding-right: 12px;
  }

  .PlacardGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 430px;
    gap: 14px;
  }

  .PlacardGrid img {
    max-width: 155px;
  }

  .VersionGrid {
    grid-template-columns: 1.2fr .5fr 1.4fr;
    font-size: .78rem;
  }

  .VersionGrid > div {
    padding: 6px 5px;
  }
}
