@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700;800&display=swap');

body {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 16px;
  color: #1e1e1e;
  margin: 20px;
}

h1, h2, h3 {
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 700;
}

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

.site-header-logo-link {
  display: inline-block;
  line-height: 0;
}

.site-header-logo {
  height: 55px;
  width: auto;
  display: block;
}

.hero-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 28px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 14px 18px 16px;
  margin-bottom: 20px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.hero-body {
  flex: 1 1 420px;
  min-width: 0;
}

.title-block h1 {
  font-weight: 800;
  font-size: clamp(32px, 5vw, 58px);
  margin: 0;
  line-height: 1;
}

.title-block h2 {
  font-weight: 600;
  font-size: clamp(11px, 1.8vw, 20px);
  letter-spacing: clamp(1px, 0.2vw, 2px);
  margin: 8px 0 14px;
  line-height: 1.25;
  color: #333;
}

.calculator-inner {
  padding-top: 2px;
}

.section-title {
  font-weight: 800;
  font-size: 26px;
  margin: 0 0 10px;
}

.section-title--calc {
  font-size: 22px;
  margin-bottom: 8px;
}

.section-title--plots {
  margin-top: 4px;
}

.calc-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  column-gap: 6px;
  row-gap: 6px;
}

.calc-field {
  margin-right: 0;
  margin-bottom: 0;
}

.calc-field--species {
  flex: 0 1 auto;
  min-width: min(260px, 100%);
  max-width: min(340px, 100%);
}

.calc-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #444;
}

.instruction {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 13px;
  color: #555;
  font-style: italic;
  line-height: 1.4;
}

.plot-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  align-items: start;
}

.plot-row--second {
  margin-top: 20px;
}

.plot-col {
  min-width: 0;
  width: 100%;
}

.plot-col > h2 {
  font-size: 1.25rem;
  margin-top: 0;
}

.eq-caption {
  font-size: 12px;
  color: #888;
  margin-left: 8px;
}

.equations {
  font-size: 16px;
  margin-bottom: 10px;
  max-height: 140px;
  overflow-y: auto;
}

.equations .note {
  font-style: italic;
  color: #777;
}

.plot-col .ts-wrapper {
  width: 100%;
  margin-bottom: 10px;
}

/* Keep plot vertical position stable: chips wrap inside a fixed band */
.plot-col .ts-wrapper.multi .ts-control {
  max-height: 104px;
  min-height: 38px;
  overflow-y: auto;
  overflow-x: hidden;
  align-items: center;
  align-content: flex-start;
  flex-wrap: wrap;
}

.input-box {
  width: 80px;
  height: 38px;
  padding: 6px;
  box-sizing: border-box;
}

.out-box {
  width: 220px;
  height: 38px;
  padding: 6px;
  font-size: 13px;
  box-sizing: border-box;
}

.vdivider {
  width: 1px;
  height: 44px;
  background-color: #d3d3d3;
  margin: 0 8px;
  align-self: flex-end;
}

.calc-error {
  margin-top: 8px;
  color: #b00020;
  font-weight: 700;
}

.plot-box {
  height: 650px;
  width: 100%;
}

.ts-wrapper {
  font-family: inherit;
  font-size: 14px;
}

.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid #c8c8c8;
  box-shadow: none;
  padding: 2px 8px;
  background-color: #fff;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  align-items: center;
  box-sizing: border-box;
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control {
  border-color: #1a5a3f;
  box-shadow: 0 0 0 2px rgba(26, 90, 63, 0.12);
}

.ts-wrapper.single .ts-control input {
  font-size: 14px;
  line-height: 1.3;
}

/* Match number inputs (38px) and vertically center placeholder / chosen species */
.calc-field--species .ts-wrapper.single .ts-control {
  min-height: 38px;
  padding: 0 8px;
}

.calc-field--species .ts-wrapper.single .ts-control > .item {
  align-self: center;
}


.calc-field--species .ts-wrapper.single .ts-control > input {
  align-self: center;
  margin: 0;
  padding: 5px 0 1px;
  line-height: 1.35;
  min-height: 0;
}

.calc-field--species .ts-wrapper.plugin-input_autogrow.single.has-items .ts-control > input {
  min-width: 0 !important;
}

.calc-field--species .ts-wrapper {
  width: 100%;
  max-width: min(340px, 100%);
}

.dropdown-input {
  border-radius: 8px !important;
}
.ts-dropdown {
  border-radius: 8px;
  border: 1px solid #dcdcdc;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}
.ts-dropdown .option {
  padding: 9px 12px;
  border-radius: 4px;
}

.ts-dropdown .option.active,
.ts-dropdown .active {
  background-color: rgba(26, 90, 63, 0.1) !important;
  color: #1a2e22 !important;
}

.ts-dropdown [data-selectable] .highlight {
  background: rgba(26, 90, 63, 0.22) !important;
  border-radius: 2px;
}

.ts-wrapper.plugin-clear_button .clear-button {
  color: #777 !important;
  opacity: 0.85 !important;
}
.ts-wrapper.plugin-clear_button.focus.has-items .clear-button,
.ts-wrapper.plugin-clear_button:hover.has-items .clear-button {
  color: #333 !important;
  opacity: 1 !important;
}

.plot-col .ts-wrapper.multi .ts-control > div.item,
.plot-col .ts-wrapper.multi .ts-control > [data-value],
.plot-col .ts-wrapper.multi .ts-control .item {
  border-radius: 6px;
  padding: 3px 8px !important;
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.plot-col .ts-wrapper.multi .ts-control > div.item *,
.plot-col .ts-wrapper.multi .ts-control > [data-value] * {
  text-shadow: none !important;
  box-shadow: none !important;
}

.ts-wrapper.plugin-remove_button:not(.rtl) .item .remove,
.ts-wrapper.multi .ts-control .item a.remove,
.ts-wrapper.multi .ts-control .item .remove {
  text-decoration: none !important;
  border-left: 0 !important;
  padding-left: 4px !important;
  margin-left: 4px !important;
}

.ts-dropdown .option.option a.remove:any-link:visited {
  color: #1e1e1e !important;
}

@media (max-width: 720px) {
  .plot-row {
    grid-template-columns: 1fr;
  }
}

