/* ============================================================
   Practical Lab — additions on top of shared/style.css
   (wider sidebar + the Laboratory Notebook panel)
   ============================================================ */

/* stage row: slightly smaller experiment window + steps beside it */
.prac-page .layout { max-width: 1280px; padding-bottom: 8px; }
.prac-page .sidebar {
  flex: 0 0 340px;
  position: static;
  max-width: 340px;
}
@media (max-width: 1100px) {
  .prac-page .sidebar { max-width: none; width: 100%; }
}

/* free-play mode: no steps sidebar, no guided instruction banner */
.free-mode .sidebar { display: none; }
.free-mode .cl-instruction { display: none; }
.free-mode .layout { max-width: 1200px; }
#btn-free { background: #eef3ff; }
.free-mode #btn-free { background: #e7f6ec; border-color: #b6dfc4; color: #256a3f; }

.prac-page #steps li { font-size: .82rem; }

/* the CURRENT step expands with the full instructions from the paper */
.prac-page #steps li .step-detail {
  font-weight: 400;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--ink);
  background: #f3f7fc;
  border: 1px solid #d5e3f2;
  border-radius: 8px;
  padding: 7px 9px;
  margin-top: 6px;
}

/* full-width laboratory notebook strip below the experiment */
.nb-wide {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 18px 30px;
}
.nb-wide .nb {
  margin-top: 0;
  border-top: none;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px 20px;
}
/* entries flow in responsive columns across the width */
.nb-wide .nb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
  align-items: start;
}
.nb-wide .nb-grid .nb-entry { margin: 0; }

/* ---------------- notebook shell ---------------- */
.nb {
  margin-top: 14px;
  border-top: 2px dashed #d8d2c2;
  padding-top: 12px;
}
.nb-head-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.nb-title-main {
  font-size: 1rem; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 7px;
}
.nb-score {
  font-size: .82rem; font-weight: 700; color: #fff;
  background: var(--navy); border-radius: 999px; padding: 3px 11px;
  white-space: nowrap;
}
.nb-sub {
  font-size: .78rem; color: var(--ink-soft); margin: 0 0 10px;
}

.nb-section > h3 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft); margin: 14px 0 6px;
  border-bottom: 1px solid #e5e0d2; padding-bottom: 3px;
}

/* ---------------- log lines ---------------- */
.nb-log {
  font-size: .8rem; color: var(--ink-soft);
  margin: 6px 0; padding-left: 18px; position: relative;
}
.nb-log::before { content: "✎"; position: absolute; left: 2px; top: 0; }

/* ---------------- entries ---------------- */
.nb-entry {
  background: #fbf9f2;
  border: 1px solid #e3ddcb;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0;
  transition: opacity .25s;
}
.nb-entry.locked { opacity: .45; pointer-events: none; }
.nb-entry.locked .nb-body { display: none; }
.nb-entry.locked .nb-actions { display: none; }
.nb-entry.done { border-color: #bfe0c8; background: #f4faf5; }
.nb-entry.done.partial { border-color: #ecd9a8; background: #fdf9ee; }

.nb-entry-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.nb-entry-title { font-size: .85rem; font-weight: 700; color: var(--ink); }
.nb-entry-marks {
  font-size: .72rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap;
}
.nb-entry.done .nb-entry-marks { color: #2b8a4d; }

.nb-body { margin-top: 7px; font-size: .86rem; line-height: 1.9; color: var(--ink); }

/* dropdown blanks */
.nb-body select {
  font: inherit; font-size: .82rem;
  padding: 2px 6px; margin: 0 2px;
  border: 1.6px solid #c9c2ad; border-radius: 7px;
  background: #fff; color: var(--ink);
  max-width: 100%;
}
.nb-body select.ok   { border-color: #37a05a; background: #eefaf1; }
.nb-body select.bad  { border-color: #d0503f; background: #fdf0ee; }

/* numeric fields */
.nb-num-row {
  display: flex; align-items: center; gap: 8px; margin: 5px 0;
  font-size: .84rem;
}
.nb-num-row label { flex: 1 1 auto; }
.nb-num-row input {
  font: inherit; font-size: .84rem; width: 92px;
  padding: 3px 7px; border: 1.6px solid #c9c2ad; border-radius: 7px;
}
.nb-num-row input.ok  { border-color: #37a05a; background: #eefaf1; }
.nb-num-row input.bad { border-color: #d0503f; background: #fdf0ee; }
.nb-num-row .nb-unit { color: var(--ink-soft); font-size: .8rem; width: 34px; }

/* written mode */
.nb-body textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  font: inherit; font-size: .84rem; line-height: 1.45;
  min-height: 58px; padding: 7px 9px;
  border: 1.6px solid #c9c2ad; border-radius: 9px;
  background: repeating-linear-gradient(#fff, #fff 25px, #f1ede1 26px);
}
.nb-body textarea:focus { outline: 2px solid var(--blue-soft); }
.nb-written-input {
  width: 100%; box-sizing: border-box;
  font: inherit; font-size: .84rem; padding: 4px 8px;
  border: 1.6px solid #c9c2ad; border-radius: 7px;
}

/* actions + feedback */
.nb-actions { margin-top: 7px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nb-actions button {
  font-size: .78rem; padding: 5px 12px; border-radius: 8px;
}
.nb-actions .nb-check { background: var(--navy); color: #fff; }
.nb-actions .nb-check:hover { background: var(--navy-deep); }
.nb-actions .nb-reveal { background: #efe9d8; }
.nb-attempts { font-size: .72rem; color: var(--ink-soft); }

.nb-fb { margin-top: 6px; font-size: .78rem; }
.nb-fb ul { margin: 4px 0 0; padding-left: 4px; list-style: none; }
.nb-fb li { margin: 3px 0; padding-left: 20px; position: relative; }
.nb-fb li.hit::before  { content: "✓"; position: absolute; left: 2px; color: #2b8a4d; font-weight: 700; }
.nb-fb li.miss::before { content: "✗"; position: absolute; left: 2px; color: #c8563f; font-weight: 700; }
.nb-fb li.hit  { color: #2b6a42; }
.nb-fb li.miss { color: #9c4a34; }
.nb-fb li.warn { color: #8a5a00; }
.nb-fb li.warn::before { content: "⚠"; position: absolute; left: 0; }
.nb-fb .nb-model {
  margin-top: 6px; padding: 7px 10px; border-radius: 8px;
  background: #eef4fb; color: var(--ink); border: 1px solid #cfe0f2;
  font-size: .8rem;
}
.nb-fb .nb-model b { color: var(--navy); }

/* table for masses */
.nb-table { border-collapse: collapse; width: 100%; margin: 4px 0; font-size: .82rem; }
.nb-table th, .nb-table td { border: 1px solid #d6cfba; padding: 4px 8px; text-align: left; }
.nb-table th { background: #f1ecdd; font-weight: 600; }
.nb-table input {
  font: inherit; font-size: .84rem; width: 84px;
  padding: 2px 6px; border: 1.5px solid #c9c2ad; border-radius: 6px;
}
.nb-table input.ok  { border-color: #37a05a; background: #eefaf1; }
.nb-table input.bad { border-color: #d0503f; background: #fdf0ee; }

/* ============================================================
   Question-paper drawer (📄 button) — looks like the real paper
   ============================================================ */
.paper-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(760px, 96vw);
  background: #6b7280;
  box-shadow: -12px 0 40px rgba(0,0,0,.28);
  z-index: 55;
  padding: 26px 22px;
  overflow-y: auto;
  transform: translateX(105%);
  transition: transform .3s ease;
}
.paper-drawer.open { transform: translateX(0); }
.paper-drawer .close-paper {
  position: fixed; top: 14px; right: 16px; z-index: 2;
  background: #33506d; color: #fff; border: none;
  width: 34px; height: 34px; border-radius: 8px; font-size: 1rem; cursor: pointer;
}

.paper-sheet {
  background: #fff;
  color: #111;
  font-family: "Times New Roman", Georgia, serif;
  max-width: 720px; margin: 0 auto;
  padding: 34px 40px 60px;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  line-height: 1.5;
  font-size: .95rem;
}
.paper-sheet p { margin: 8px 0; }
.paper-sheet sub, .paper-sheet sup { font-size: .74em; }

.ppr-head { text-align: center; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 16px; }
.ppr-org { font-size: .72rem; color: #333; line-height: 1.35; }
.ppr-title { font-weight: 700; font-size: 1.05rem; margin-top: 10px; letter-spacing: .02em; }
.ppr-title span { float: right; }
.ppr-sub { font-size: .82rem; margin-top: 4px; }
.ppr-note { font-size: .75rem; text-align: left; color: #333; margin-top: 12px; background: #f4f4f0; padding: 7px 10px; border-radius: 4px; }

.ppr-q { font-weight: 700; font-size: 1.02rem; margin: 4px 0 10px; }
.ppr-eqn { text-align: center; font-style: italic; margin: 12px 0; }
.ppr-warn { font-size: .85rem; }
.ppr-ih { font-weight: 700; margin: 12px 0 4px; }
.ppr-steps { margin: 4px 0 4px 4px; padding-left: 22px; }
.ppr-steps li { margin: 4px 0; font-size: .9rem; }

.pq { margin: 16px 0; padding-top: 4px; }
.pq-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pq-label { font-weight: 700; }
.pq-marks { float: right; font-weight: 700; }
.pq-marks-r { text-align: right; margin: 2px 0; }
.ppr-total { margin-left: 12px; }
.ppr-ans-line { margin: 8px 0; }
.ppr-ans-line .dots {
  display: inline-block; min-width: 130px;
  border-bottom: 1px dotted #555; vertical-align: bottom;
  text-align: center; padding: 0 4px;
}
.ppr-ans-line .dots.wide { min-width: 210px; }

/* ruled answer region — blank lines the student would write on */
.pq-write {
  margin: 6px 0 10px; padding: 0 2px;
  line-height: 22px; min-height: 44px;
  background-image: repeating-linear-gradient(to bottom,
    transparent 0, transparent 21px, #bdb7a4 21px, #bdb7a4 22px);
}
.pq-write[data-lines="1"] { min-height: 22px; }

/* the paper's tables */
.ppr-table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: .88rem; }
.ppr-table th, .ppr-table td { border: 1px solid #333; padding: 7px 9px; text-align: left; vertical-align: top; }
.ppr-table th { background: #f0efe9; font-weight: 700; }
.ppr-table.t11 td, .ppr-table.t11 th { width: 50%; }
.ppr-table.t11 td { height: 34px; }
.ppr-table.t11 td.blank { background: #fff; border: 1px solid #333; }
.ppr-table.t12 th:first-child, .ppr-table.t12 td:first-child { width: 52%; }
.ppr-table.t12 td { min-height: 70px; }
.ppr-table hr { border: none; border-top: 1px dashed #999; margin: 8px 0; }

/* Show-answer buttons + answers written into the answer space */
.pq-show {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: .72rem; font-weight: 600;
  color: #2b6a42; background: #e7f6ec; border: 1px solid #b6dfc4;
  border-radius: 999px; padding: 3px 11px; cursor: pointer; white-space: nowrap;
}
.pq-show:hover { background: #d7efdf; }
.pq-show.shown { color: #8a5a00; background: #fdefcf; border-color: #e6c980; }
/* the answer itself — green "ink" sitting on the provided lines/boxes */
.ans-write {
  color: #146c39; font-weight: 600;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.ans-write[hidden] { display: none; }   /* never show until its button reveals it */
.ans-write b { color: #0f4f2a; }

/* hub cards (text-only) */
.prac-hub .ver-tag {
  display: inline-block; font-size: .7rem; font-weight: 700;
  color: #fff; background: var(--purple); border-radius: 999px;
  padding: 2px 10px; margin-bottom: 6px;
}
