/* Current, Charge and Overpotential (CHM2001)
   Layout only - every colour comes from the model-shell palette at runtime, through inline styles
   and the --cov-* custom properties that the script sets on the model container. Same pattern as
   the CHE7403 models (entropy-dispersal.css, beat-the-barrier.css). */

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

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

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

/* The key idea heads the results card. */
.cov-key {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 800;
  line-height: 1.25;
}

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

.cov-stage {
  display: block;
  width: 100%;
  height: 420px;
}

/* The live controls sit directly under the canvas, so the graph and its controls stay in view together. */
.cov-strip {
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.7rem 0.4rem;
  border: 2px solid var(--cov-grid, #ccc);
  border-radius: 10px;
}

.cov-strip > :first-child {
  margin-top: 0;
}

/* The verdict is the most important thing on the page, so it is the largest text. */
.cov-verdict {
  margin: 0.6rem 0 0.4rem;
  padding: 0.5rem 0.8rem;
  border: 3px solid;
  border-radius: 10px;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.cov-sub {
  margin: 0 0 0.3rem;
  font-weight: 700;
}

.cov-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

.cov-chip {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.3rem 0.65rem;
  border: 2px solid;
  border-radius: 999px;
  cursor: pointer;
}

.cov-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.2rem;
  margin: 0 0 0.6rem;
}

.cov-field label {
  font-weight: 800;
}

.cov-field select {
  font: inherit;
  padding: 0.35rem 0.4rem;
  border: 2px solid;
  border-radius: 8px;
  width: 100%;
  min-width: 0;
}

.cov-slider {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr) 5.4rem;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
}

.cov-slider label {
  font-weight: 800;
}

.cov-slider input {
  width: 100%;
}

.cov-val {
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

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

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

/* Predict-first cards inside a stage */
.cov-qproc {
  margin: 0.2rem 0 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.cov-choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem;
}

.cov-choices button {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  padding: 0.45rem 0.6rem;
  border: 2px solid;
  border-radius: 8px;
  cursor: pointer;
}

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

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

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

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

.cov-score {
  font-weight: 800;
  font-size: 0.9rem;
}

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

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

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

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

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

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

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

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

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

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

.cov-gap {
  margin-top: 1.1rem;
  padding-top: 0.7rem;
  border-top: 2px solid var(--cov-grid, #ccc);
}

.cov-choices button:disabled {
  cursor: default;
}

/* Wide screens: the predictions and the free controls side by side under the graph. */
@media (min-width: 1000px) {
  .cov-strip--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 1.2rem;
    align-items: start;
  }
  .cov-strip--split .cov-gap {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .cov-strip--split .cov-slider {
    grid-template-columns: minmax(0, 1fr) 5.2rem;
    grid-template-areas: "label value" "input input";
  }
  .cov-strip--split .cov-slider label { grid-area: label; }
  .cov-strip--split .cov-slider input { grid-area: input; }
  .cov-strip--split .cov-val { grid-area: value; }
}

/* Narrower screens: one set of controls at a time, so whichever is in use sits right under the graph. */
.cov-views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.6rem;
}

@media (max-width: 999px) {
  .cov-strip--split[data-view="predict"] .cov-explore,
  .cov-strip--split[data-view="explore"] .cov-predict {
    display: none;
  }
  .cov-strip--split .cov-gap {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
}

@media (min-width: 1000px) {
  .cov-views {
    display: none;
  }
  .cov-strip--split .cov-views {
    grid-column: 1 / -1;
  }
}
