/* Gibbs Free Energy and Temperature (CHE7403)
   Layout only - every colour comes from the model-shell palette at runtime. */

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

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

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

/* The equation heads the results card: the balance is read as ΔG = ΔH − TΔS. */
.gfe-eqhead {
  margin: 0 0 0.1rem;
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 800;
  line-height: 1.2;
}

.gfe-eqkey {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.4rem;
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.gfe-stage {
  display: block;
  width: 100%;
  height: 320px;
}

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

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

.gfe-verdict-sub {
  display: block;
  font-size: 1.05rem;
  margin-top: 0.15rem;
}

.gfe-legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
  font-size: 1.02rem;
}

.gfe-swatch {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid;
  border-radius: 3px;
}

.gfe-swatch--s {
  border-style: dashed;
}

.gfe-eq-scroll {
  overflow-x: auto;
  margin-top: 0.4rem;
}

.gfe-eq {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: auto auto auto;
  justify-content: start;
  align-items: center;
  column-gap: 0.6rem;
  row-gap: 0.1rem;
  width: max-content;
}

.gfe-eq-head {
  max-width: 6.5rem;
  font-size: 0.8rem;
  line-height: 1.15;
  font-weight: 700;
  text-align: center;
}

.gfe-eq-sym {
  font-size: 1.3rem;
  text-align: center;
  white-space: nowrap;
}

.gfe-eq-val {
  font-size: 1.05rem;
  text-align: center;
  white-space: nowrap;
}

.gfe-eq-res {
  font-weight: 800;
}

.gfe-foot {
  margin: 0.3rem 0 0.5rem;
  font-size: 0.95rem;
}

.gfe-graph {
  display: block;
  width: 100%;
  height: 220px;
  margin-top: 0.5rem;
}

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

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

.gfe-process {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.gfe-slider {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 7.6rem;
  align-items: center;
  gap: 0.5rem;
}

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

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

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

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

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

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

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

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

.gfe-cases {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.gfe-cases caption {
  text-align: left;
  font-weight: 800;
  padding-bottom: 0.25rem;
}

.gfe-cases th,
.gfe-cases td {
  border: 1px solid;
  padding: 0.35rem 0.4rem;
  text-align: center;
  vertical-align: middle;
}

.gfe-cases th {
  font-weight: 700;
}

.gfe-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

.gfe-dot {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

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

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

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

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

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

.gfe-step-q {
  margin: 0 0 0.3rem;
  font-weight: 700;
}

.gfe-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.gfe-choices button {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.35rem 0.4rem;
  border: 2px solid;
  border-radius: 8px;
  cursor: pointer;
}

.gfe-step--num {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem 4.2rem;
  align-items: center;
  gap: 0.4rem;
}

.gfe-step--num label {
  font-weight: 700;
}

.gfe-step--num input {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  padding: 0.2rem 0.35rem;
}

.gfe-hint {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
}

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

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

.gfe-feedback {
  margin: 0.6rem 0 0;
  min-height: 2.6em;
}

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

@media (max-width: 480px) {
  .gfe-slider {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "label value" "input input";
  }
  .gfe-slider label {
    grid-area: label;
  }
  .gfe-slider input {
    grid-area: input;
  }
  .gfe-val {
    grid-area: value;
  }
  .gfe-step--num {
    grid-template-columns: minmax(0, 1fr) 5.5rem auto;
  }
  .gfe-eq {
    column-gap: 0.3rem;
  }
  .gfe-eq-head {
    max-width: 4.6rem;
    font-size: 0.72rem;
  }
  .gfe-eq-sym {
    font-size: 1.1rem;
  }
  .gfe-eq-val {
    font-size: 0.95rem;
  }
}

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