/* Entropy and Energy Dispersal (CHE7403)
   Layout only - every colour comes from the model-shell palette at runtime, through the --ent-*
   custom properties that the script sets on the model container. */

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

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

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

.ent-key {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.25;
}

.ent-flasks {
  display: block;
  width: 100%;
}

.ent-flask-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
  font-weight: 700;
  margin: 0.2rem 0 0.4rem;
}

.ent-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.ent-count {
  border: 2px solid var(--ent-grid, #ccc);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
}

.ent-bar,
.ent-sbar {
  height: 10px;
  border-radius: 5px;
  background: var(--ent-grid-t, #eee);
  margin-top: 0.25rem;
  overflow: hidden;
}

.ent-bar > span,
.ent-sbar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ent-blue, #2f6db5);
}

.ent-phases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.ent-phase {
  border: 2px solid var(--ent-grid, #ccc);
  border-radius: 10px;
  padding: 0.4rem;
}

.ent-phase h4 {
  margin: 0.1rem 0 0.3rem;
  text-align: center;
  font-size: 1rem;
}

.ent-phase canvas {
  display: block;
  width: 100%;
}

.ent-phase ul {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0.2rem;
  font-size: 0.92rem;
}

.ent-phase li {
  margin: 0.1rem 0;
}

.ent-yes { color: var(--ent-green, green); font-weight: 800; }
.ent-no { color: var(--ent-red, red); font-weight: 800; }
.ent-part { color: var(--ent-orange, orange); font-weight: 800; }

.ent-sval {
  margin: 0.3rem 0 0.1rem;
  text-align: center;
  font-weight: 800;
  color: var(--ent-blue, #2f6db5);
}

.ent-sbar {
  margin: 0.2rem 0.3rem 0.3rem;
  height: 12px;
}

.ent-note {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
}

.ent-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.6rem;
}

.ent-pair svg {
  display: block;
  width: 100%;
  height: auto;
}

.ent-calc {
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  border: 2px solid var(--ent-grid, #ccc);
  border-radius: 10px;
  font-size: 1.02rem;
}

.ent-calc-row {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.3rem;
  margin: 0.15rem 0;
}

.ent-verdict {
  margin: 0.6rem 0 0.4rem;
  padding: 0.5rem 0.8rem;
  border: 3px solid;
  border-radius: 10px;
}

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

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

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

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

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

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

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

.ent-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

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

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

.ent-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

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

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

.ent-qproc {
  margin: 0.2rem 0 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
}

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

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

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

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

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

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

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

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

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

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

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

@media (max-width: 820px) {
  .ent-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .ent-phases,
  .ent-pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .ent-phase canvas {
    max-width: 320px;
    margin: 0 auto;
  }
}

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

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