/* Energy Barriers and Overpotential (CHM2001, Lectures 5-6)
   Layout only - every colour comes from the model-shell palette at runtime, through inline styles
   and the --ebo-* custom properties that the script sets on the model container. Same layout and
   slider style as current-and-charge.css (Faraday's law). */

.ebo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.ebo-layout > * {
  min-width: 0;
}

/* Elements with their own display value would otherwise ignore the hidden attribute. */
.ebo-layout [hidden] {
  display: none !important;
}

/* The key idea heads the results card. */
.ebo-key {
  margin: 0 0 0.5rem;
  text-align: center;
  line-height: 1.2;
}

.ebo-key-main {
  display: block;
  font-size: clamp(1.8rem, 4.6vw, 2.6rem);
  font-weight: 800;
}

.ebo-key-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: clamp(0.95rem, 2.1vw, 1.12rem);
  font-weight: 600;
}

.ebo-key:empty {
  display: none;
}

.ebo-stage {
  display: block;
  width: 100%;
  height: 470px;
}

/* The verdict sits directly above the picture it explains. */
.ebo-verdict {
  min-height: 5.6rem;           /* about the same height whatever it says, so the page does not jump */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.8rem;
  text-align: center;
  border: 3px solid;
  border-radius: 10px;
}

.ebo-verdict-main {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
}

.ebo-verdict-sub {
  display: block;
  font-size: 1.02rem;
  margin-top: 0.2rem;
  line-height: 1.45;
}

.ebo-verdict-sub:empty {
  display: none;
}

/* The controls: one coloured strip directly under the picture. */
.ebo-strip {
  margin: 0.4rem 0 0;
  padding: 0.6rem 0.8rem;
  border: 3px solid var(--ebo-red, red);
  border-radius: 12px;
  background: var(--ebo-bg, #fff);
}

.ebo-strip-head {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  text-align: center;
  text-wrap: balance;
}

/* The numbers substituted into each equation, updated live. */
.ebo-calc {
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--ebo-grid, #ccc);
  border-radius: 10px;
  font-size: 1.02rem;
}

.ebo-calc:empty {
  display: none;
}

.ebo-calc-row {
  display: grid;
  grid-template-columns: 9.6rem minmax(0, 1fr);
  gap: 0.3rem;
  margin: 0.15rem 0;
  line-height: 1.45;
}

.ebo-bridge {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--ebo-red, red);
  border-radius: 10px;
  background: var(--ebo-red-t, #fff3f3);
  line-height: 1.5;
}

.ebo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.ebo-tab {
  flex: 1 1 9rem;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.45rem 0.5rem;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.ebo-process {
  margin: 0 0 0.5rem;
  font-size: 1.12rem;
  font-weight: 800;
}

.ebo-process:empty {
  display: none;
}

.ebo-guide {
  margin: 0 0 0.7rem;
  line-height: 1.5;
}

.ebo-guide:empty {
  display: none;
}

.ebo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.ebo-row--centre {
  justify-content: center;
}

.ebo-strong {
  font-weight: 800;
}

.ebo-go {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 800;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.ebo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.3rem;
}

.ebo-chips--centre {
  justify-content: center;
}

.ebo-chip {
  font: inherit;
  font-size: 1rem;
  padding: 0.3rem 0.7rem;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

/* Slider: a dark outlined track, filled up to the thumb, and a large white thumb with a dark ring. */
.ebo-slider {
  display: grid;
  grid-template-columns: 8.4rem minmax(0, 1fr) 5.6rem;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
}

.ebo-slider label {
  font-weight: 800;
  font-size: 1.1rem;
}

.ebo-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --p: 50%;
}

.ebo-slider input[type="range"]::-webkit-slider-runnable-track {
  box-sizing: border-box;
  height: 16px;
  border: 2px solid var(--ebo-fg, #000);
  border-radius: 8px;
  background: linear-gradient(to right, var(--ebo-sl, #888) var(--p), var(--ebo-trk, #ddd) var(--p));
}

.ebo-slider input[type="range"]::-moz-range-track {
  box-sizing: border-box;
  height: 16px;
  border: 2px solid var(--ebo-fg, #000);
  border-radius: 8px;
  background: linear-gradient(to right, var(--ebo-sl, #888) var(--p), var(--ebo-trk, #ddd) var(--p));
}

.ebo-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  margin-top: -6px;
  border: 4px solid var(--ebo-fg, #000);
  border-radius: 50%;
  background: var(--ebo-bg, #fff);
}

.ebo-slider input[type="range"]::-moz-range-thumb {
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  border: 4px solid var(--ebo-fg, #000);
  border-radius: 50%;
  background: var(--ebo-bg, #fff);
}

.ebo-slider input[type="range"]:focus-visible {
  outline: 3px solid var(--ebo-fg, #000);
  outline-offset: 3px;
  border-radius: 8px;
}

.ebo-val {
  font-weight: 800;
  font-size: 1.1rem;
  text-align: right;
  white-space: nowrap;
}

.ebo-small {
  margin: 0.5rem 0 0.1rem;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.4;
}

.ebo-small--left {
  text-align: left;
}

.ebo-notes {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.45;
}

.ebo-notes li {
  margin: 0.25rem 0;
}

/* Test your knowledge */
.ebo-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.ebo-progress {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.ebo-dot {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 2px solid;
  display: inline-grid;
  place-items: center;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.ebo-dot[aria-current="true"] {
  outline: 3px solid currentColor;
  outline-offset: 2px;
}

.ebo-score {
  font-weight: 800;
  font-size: 1rem;
}

.ebo-task {
  margin: 0.6rem 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.ebo-intro {
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.ebo-step {
  margin-bottom: 0.4rem;
  padding: 0.35rem 0.5rem;
  border: 2px solid;
  border-radius: 8px;
}

.ebo-step-q {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.ebo-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.3rem;
}

.ebo-options button {
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border: 2px solid;
  border-radius: 8px;
  cursor: pointer;
}

.ebo-feedback {
  margin: 0.6rem 0 0;
  min-height: 2.6em;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .ebo-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .ebo-verdict-main {
    font-size: 1.2rem;
  }
}

@media (max-width: 560px) {
  .ebo-slider {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "label value" "input input";
  }
  .ebo-slider label { grid-area: label; }
  .ebo-slider input { grid-area: input; }
  .ebo-val { grid-area: value; }
  .ebo-calc-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ebo-tab,
  .ebo-chip {
    transition: none;
  }
}


/* ---------------- 2026: What η does, live (right-hand column) ---------------- */
.ebo-live {
  margin: 0 0 0.6rem;
  padding: 0.55rem 0.75rem 0.6rem;
  border: 3px solid var(--ebo-fg, #000);
  border-radius: 12px;
  background: var(--ebo-bg, #fff);
  font-size: 1.05rem;
}

.model-card--results .ebo-live {
  margin: 0.6rem 0 0;
}

.ebo-live-title {
  font-weight: 800;
  font-size: 1.15rem;
}

/* symbols on top, this moment's numbers underneath */
.ebo-eqtab {
  border-collapse: collapse;
  margin: 0.15rem auto 0.4rem;
}

.ebo-eqtab td {
  padding: 0.05rem 0.3rem;
  text-align: center;
  white-space: nowrap;
}

.ebo-eqtab .ebo-sym td {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.15;
}

.ebo-eqtab .ebo-num td {
  font-size: 1.2rem;
  font-weight: 700;
  border-top: 1px dashed var(--ebo-grid, #bbb);
  padding-top: 0.2rem;
}

/* the chain from η to the barriers */
.ebo-live .ebo-calc {
  margin: 0;
  padding: 0.35rem 0 0;
  border: 0;
  border-top: 2px solid var(--ebo-red, red);
  border-radius: 0;
  font-size: 1.05rem;
}

.ebo-live .ebo-calc-row {
  grid-template-columns: 6.2rem minmax(0, 1fr);
  margin: 0.25rem 0;
}

/* the rates: symbolic bars */
.ebo-bars {
  margin: 0.5rem 0 0;
}

.ebo-bars-head {
  margin: 0 0 0.25rem;
  font-weight: 800;
}

.ebo-bars-head span {
  font-weight: 400;
}

.ebo-bar-row {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr) 3.6rem;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 0;
}

.ebo-bar-lab,
.ebo-bar-word {
  font-weight: 800;
}

.ebo-bar {
  display: block;
  height: 1rem;
  border: 2px solid var(--ebo-fg, #000);
  border-radius: 8px;
  overflow: hidden;
}

.ebo-bar > span {
  display: block;
  height: 100%;
  transition: width 0.3s ease;
}

/* what has just changed */
.ebo-flash {
  background: #fff1a8;
  color: inherit;
  border-radius: 3px;
  box-shadow: 0 0 0 2px #e0b800;
}

.high-contrast .ebo-flash {
  background: transparent;
  box-shadow: 0 0 0 2px currentColor;
}

.ebo-so {
  margin: 0.5rem 0 0;
  padding: 0.4rem 0.6rem;
  border-left: 4px solid var(--ebo-grid, #999);
  background: var(--ebo-red-t, #f6f6f6);
  line-height: 1.45;
}

/* text in drop-downs */
.ebo-more {
  margin: 0.5rem 0 0;
  padding: 0.4rem 0.65rem;
  border: 2px solid var(--ebo-grid, #ccc);
  border-radius: 10px;
  font-size: 1.04rem;
}

.ebo-more > summary {
  font-weight: 800;
  cursor: pointer;
}

.ebo-more ul {
  margin: 0.35rem 0 0.2rem;
  padding-left: 1.1rem;
  line-height: 1.45;
}

.ebo-more li {
  margin: 0.25rem 0;
}

.ebo-more-text {
  margin: 0.35rem 0 0.15rem;
  line-height: 1.5;
}

.ebo-go {
  font-size: 1.05rem;
}

.ebo-intro,
.ebo-step-q,
.ebo-feedback {
  font-size: 1.04rem;
}

@media (prefers-reduced-motion: reduce) {
  .ebo-bar > span {
    transition: none;
  }
}

@media (max-width: 560px) {
  .ebo-eqtab .ebo-sym td {
    font-size: 1.5rem;
  }
  .ebo-eqtab .ebo-num td {
    font-size: 1.05rem;
  }
  .ebo-live .ebo-calc-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .ebo-bar-row {
    grid-template-columns: 5.4rem minmax(0, 1fr) 3.4rem;
  }
}
