/* Lecture 4 Practice: Feasibility and Reaction Rates (CHE7403)
   Layout only - every colour comes from the model-shell palette at runtime, through the --l4p-*
   custom properties that the script sets on the model container. */

.l4p-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
}

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

.l4p-layout [hidden] {
  display: none !important;
}

/* ---------------- equation sheet and problem tiles ---------------- */
.l4p-sheet {
  border: 2px solid var(--l4p-grid, #ccc);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  margin-bottom: 0.6rem;
}

.l4p-sheet summary {
  font-weight: 800;
  cursor: pointer;
}

.l4p-sheet ul {
  margin: 0.4rem 0 0.2rem;
  padding-left: 1.2rem;
  columns: 2;
  column-gap: 2rem;
}

.l4p-sheet li {
  margin: 0.2rem 0;
  break-inside: avoid;
}

.l4p-score {
  margin: 0 0 0.4rem;
  text-align: right;
  font-weight: 800;
}

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

.l4p-tile {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  font: inherit;
  text-align: left;
  color: var(--l4p-fg, #111);
  background: var(--l4p-bg, #fff);
  border: 2px solid var(--l4p-grid, #ccc);
  border-radius: 12px;
  cursor: pointer;
}

.l4p-tile:hover {
  border-color: var(--l4p-fg, #111);
}

.l4p-tile[aria-current="true"] {
  border-color: var(--l4p-accent, red);
  box-shadow: inset 0 0 0 2px var(--l4p-accent, red);
}

.l4p-tile.is-done {
  border-color: var(--l4p-green, green);
  background: var(--l4p-green-t, #f1f8f1);
}

.l4p-ic {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  background: var(--l4p-panel, #f4f4f4);
}

.l4p-tile-title {
  display: block;
  font-weight: 800;
  line-height: 1.25;
}

.l4p-tile-tags {
  display: block;
  margin-top: 0.2rem;
}

.l4p-tick {
  position: absolute;
  top: 0.3rem;
  right: 0.5rem;
  font-weight: 900;
  color: var(--l4p-green, green);
}

.l4p-chip {
  display: inline-block;
  margin: 0 0.25rem 0.15rem 0;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1.5px solid;
  border-radius: 999px;
}

.l4p-chip--fmt { color: var(--l4p-accent, red); border-color: var(--l4p-accent, red); }
.l4p-chip--ctx { color: var(--l4p-blue, blue); border-color: var(--l4p-blue, blue); }

/* ---------------- one problem ---------------- */
.l4p-q h3 {
  margin: 0.3rem 0 0.3rem;
  font-size: 1.3rem;
}

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

.l4p-reaction {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.l4p-fig {
  margin: 0.4rem 0 0.8rem;
  padding: 0.5rem;
  border-radius: 10px;
  background: var(--l4p-panel, #f4f4f4);
}

.l4p-fig svg {
  display: block;
  width: 100%;
  max-width: 620px;
  height: auto;
  margin: 0 auto;
}

.l4p-data {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--l4p-bg, #fff);
}

.l4p-data caption {
  text-align: left;
  font-weight: 700;
  font-size: 0.88rem;
  padding-bottom: 0.25rem;
}

.l4p-data th,
.l4p-data td {
  padding: 0.2rem 0.5rem;
  border-bottom: 1px solid var(--l4p-grid, #ccc);
  text-align: right;
}

.l4p-data th:first-child,
.l4p-data td:first-child {
  text-align: left;
}

.l4p-lookup {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.88rem;
}

.l4p-part {
  margin: 0.5rem 0;
  padding: 0.5rem 0.7rem;
  border: 2px solid var(--l4p-grid, #ccc);
  border-radius: 10px;
}

.l4p-part.is-active { border-color: var(--l4p-accent, red); }
.l4p-part.is-done { border-color: var(--l4p-green, green); background: var(--l4p-green-t, #f1f8f1); }
.l4p-part.is-locked { opacity: 0.5; }

.l4p-label {
  margin: 0 0 0.4rem;
  font-weight: 700;
}

.l4p-student {
  margin: 0.2rem 0 0.5rem;
  padding: 0.4rem 0.7rem;
  border: 2px dashed var(--l4p-orange, orange);
  border-radius: 10px;
  background: var(--l4p-orange-t, #fff8f0);
  font-size: 1.02rem;
}

.l4p-num {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.l4p-num input {
  width: 9rem;
  padding: 0.25rem 0.5rem;
  font: inherit;
  box-sizing: border-box;
}

.l4p-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.l4p-opt {
  padding: 0.45rem 0.6rem;
  font: inherit;
  text-align: left;
  color: var(--l4p-fg, #111);
  background: var(--l4p-bg, #fff);
  border: 2px solid var(--l4p-fg, #111);
  border-radius: 8px;
  cursor: pointer;
}

.l4p-opt:disabled {
  cursor: default;
  color: var(--l4p-fg, #111);
}

.l4p-opt.is-right {
  font-weight: 800;
  border-width: 3px;
  border-color: var(--l4p-green, green);
  background: var(--l4p-green-t, #e8f5e9);
}

.l4p-opt.is-wrong {
  border-color: var(--l4p-red, red);
  background: var(--l4p-red-t, #fdecea);
  text-decoration: line-through;
  opacity: 0.75;
}

.l4p-feedback {
  margin: 0.4rem 0 0;
  line-height: 1.45;
}

.l4p-feedback:empty {
  display: none;
}

.l4p-working {
  margin: 0.7rem 0 0;
  padding: 0.5rem 0.8rem 0.5rem 1.9rem;
  border-radius: 10px;
  background: var(--l4p-panel, #f4f4f4);
  line-height: 1.5;
}

.l4p-working:empty {
  display: none;
}

.l4p-working li {
  margin: 0.2rem 0;
}

/* sort and true-or-false cards */
.l4p-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.l4p-card {
  padding: 0.5rem 0.7rem;
  border: 2px solid var(--l4p-grid, #ccc);
  border-radius: 10px;
}

.l4p-card.is-done {
  border-color: var(--l4p-green, green);
  background: var(--l4p-green-t, #f1f8f1);
}

.l4p-card p {
  margin: 0 0 0.4rem;
}

.l4p-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.l4p-why {
  margin: 0.4rem 0 0;
  font-size: 0.93rem;
  line-height: 1.4;
}

/* the four-cases table */
.l4p-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2.4rem;
}

.l4p-quad {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.l4p-hd {
  display: grid;
  place-items: center;
  padding: 0.25rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.l4p-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 5.5rem;
  padding: 0.4rem;
  border: 2px dashed var(--l4p-grid, #ccc);
  border-radius: 10px;
  cursor: pointer;
}

.l4p-cell.is-target {
  border-color: var(--l4p-accent, red);
}

.l4p-cap {
  font-size: 0.82rem;
  font-weight: 800;
}

.l4p-token {
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  color: var(--l4p-fg, #111);
  background: var(--l4p-bg, #fff);
  border: 2px solid var(--l4p-fg, #111);
  border-radius: 8px;
  cursor: pointer;
}

.l4p-token[aria-pressed="true"] {
  border-color: var(--l4p-accent, red);
  box-shadow: 0 0 0 2px var(--l4p-accent, red);
}

.l4p-token.is-right {
  border-color: var(--l4p-green, green);
  background: var(--l4p-green-t, #e8f5e9);
}

.l4p-token.is-wrong {
  border-color: var(--l4p-red, red);
  background: var(--l4p-red-t, #fdecea);
}

.l4p-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

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

@media (max-width: 900px) {
  .l4p-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .l4p-sheet ul {
    columns: 1;
  }
}

@media (max-width: 560px) {
  .l4p-tiles,
  .l4p-cards,
  .l4p-opts {
    grid-template-columns: minmax(0, 1fr);
  }
  .l4p-tile {
    padding: 0.4rem 0.6rem;
  }
  .l4p-quad {
    grid-template-columns: 4.6rem minmax(0, 1fr) minmax(0, 1fr);
    font-size: 0.85rem;
  }
}

/* the matching grid (Problem 3) */
.l4p-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.4rem;
  margin-top: 0.6rem;
}

/* scientific notation in the working */
.l4p-working sup,
.l4p-student sup {
  line-height: 0;
}
