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

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

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

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

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

.bve-key-main {
  display: block;
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  font-weight: 800;
}

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

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

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

/* The verdict sits directly above the picture it explains. */
.bve-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;
}

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

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

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

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

.bve-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. */
.bve-calc {
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--bve-grid, #ccc);
  border-radius: 10px;
  font-size: 1.02rem;
}

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

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

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

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

.bve-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;
}

.bve-process {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
}

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

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

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

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

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

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

.bve-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;
}

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

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

.bve-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. */
.bve-slider {
  display: grid;
  grid-template-columns: 8.4rem minmax(0, 1fr) 5.6rem;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
}

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

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

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

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

.bve-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(--bve-fg, #000);
  border-radius: 50%;
  background: var(--bve-bg, #fff);
}

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

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

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

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

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

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

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

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

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

.bve-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;
}

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

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

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

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

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

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

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

.bve-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;
}

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

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

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

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


/* ---------------- 2026: the Butler–Volmer equation, live (right-hand column) ---------------- */
.bve-live {
  margin: 0 0 0.6rem;
  padding: 0.55rem 0.75rem 0.6rem;
  border: 3px solid var(--bve-fg, #000);
  border-radius: 12px;
  background: var(--bve-bg, #fff);
  font-size: 1.05rem;
}

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

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

.bve-half {
  margin: 0.25rem 0 0.1rem;
  font-weight: 700;
}

/* symbols on top, this moment's numbers underneath each term */
.bve-eqwrap {
  overflow-x: auto;
}

.bve-eqtab {
  border-collapse: collapse;
  margin: 0.2rem auto 0.4rem;
}

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

.bve-eqtab .bve-sym td {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.25;
}

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

.bve-eqtab .bve-unit td {
  font-size: 0.9rem;
  line-height: 1.1;
}

/* the working: one step per line, as in the lectures */
.bve-live .bve-calc {
  margin: 0;
  padding: 0.35rem 0 0;
  border: 0;
  border-top: 2px solid var(--bve-red, red);
  border-radius: 0;
  font-size: 1.04rem;
}

.bve-live .bve-calc-row {
  grid-template-columns: 5.2rem minmax(0, 1fr);
}

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

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

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

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

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

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

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

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

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

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

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


/* round 2: the forward and back terms, i0, and the full working in a drop-down */
.bve-terms p {
  margin: 0.25rem 0;
  font-size: 1.08rem;
  line-height: 1.4;
}

.bve-terms {
  border-top: 2px solid var(--bve-red, red);
  padding-top: 0.3rem;
}

.bve-i0 {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  line-height: 1.4;
}

.bve-work {
  margin-top: 0.45rem;
  font-size: 1rem;
}

.bve-work .bve-calc {
  margin: 0.3rem 0 0;
  padding: 0;
  border: 0;
}

.bve-work .bve-calc-row {
  grid-template-columns: 5.2rem minmax(0, 1fr);
}


/* Nov 2026: the exchange current density slider (log scale, 10⁻⁶ to 10⁻² A cm⁻²) and its tick labels. */
.bve-strip .bve-slider {
  grid-template-columns: 8.4rem minmax(0, 1fr) 8.2rem;
}

.bve-slider--i0 {
  margin-bottom: 0;
}

.bve-slider--i0 label {
  font-size: 1rem;
  line-height: 1.2;
}

.bve-ticks {
  display: grid;
  grid-template-columns: 8.4rem minmax(0, 1fr) 8.2rem;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.bve-ticks-row {
  grid-column: 2;
  position: relative;
  height: 1.2em;
  margin: 0 14px;               /* the centre of the thumb at each end of the track */
}

.bve-ticks-row > span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .bve-strip .bve-slider {
    grid-template-columns: minmax(0, 1fr) auto;     /* the label wraps; the value keeps its width */
  }
  .bve-ticks {
    grid-template-columns: minmax(0, 1fr);
  }
  .bve-ticks-row {
    grid-column: 1;
  }
}
