/* Engineering Design Studio: the Prototype Review Desk inside the practice shell's stage (about 1066 x 628 at 1366 x 768).
 * Foundations: every word in the play area is 18 px or more; every tap target is 48 px or more.
 * Pictures sit on a lit slide that stays the same in light and dark (the art is drawn for it). */
.ed { position: absolute; inset: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; padding: 10px 14px; color: #1b2733; font-size: 18px; line-height: 1.3;
  background: linear-gradient(#edf2f8, #dbe5ef);
  --ed-panel: rgba(255, 255, 255, .96); --ed-line: #a9bccb; --ed-soft: #44525f; --ed-accent: #1f5f99; --ed-accent-bg: #e2edf8; --ed-slide: #fbfdff; --ed-ink: #1b2733;
  --ed-goal: #b8372d; --ed-limit: #8a5a00; --ed-yes: #17663a; --ed-no: #a3241f; }
html[data-theme="dark"] .ed { color: #eaf0f5; background: linear-gradient(#19202a, #12171e);
  --ed-panel: rgba(30, 37, 46, .97); --ed-line: #56677a; --ed-soft: #c9d5df; --ed-accent: #8cc4f2; --ed-accent-bg: #1d3247; }
.ed *, .ed *::before, .ed *::after { box-sizing: border-box; }
.ed p, .ed figure, .ed figcaption, .ed ol { margin: 0; padding: 0; }
.ed button { font: inherit; color: inherit; }
.ed svg { display: block; }
.ed :focus-visible { outline: 4px solid #ffb000; outline-offset: 2px; }
.ed-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── picture (left) ── */
.ed .ed-scenebox { container: edscene / inline-size; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; background: var(--ed-panel); border: 1.5px solid var(--ed-line); }
.ed-scene-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; padding: 8px; border-radius: 10px; background: var(--ed-slide); color: var(--ed-ink); box-shadow: inset 0 0 0 1px rgba(40, 60, 80, .2); overflow: hidden; }
.ed p.ed-cap { flex: none; font-weight: 600; }
.ed.is-revealed .ed-scenebox { border-color: var(--ed-accent); box-shadow: 0 0 0 3px var(--ed-accent-bg); }
.ed-pic { display: block; }
.ed-pic svg { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 1px 3px rgba(20, 30, 40, .25); }
.ed-fig { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ed-fig figcaption { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; line-height: 1.25; }

/* project + rule card + design brief board */
.ed-project { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.ed-brief { font-size: 19px; line-height: 1.35; }
.ed-note { display: block; margin-top: 6px; font-size: 18px; color: #44525f; font-style: italic; }
.ed-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: 10px; background: #fffbe8; border: 2px solid #d9b44a; box-shadow: 0 3px 8px rgba(80, 60, 0, .18); transform: rotate(-.6deg); }
.ed-cardk { font-weight: 700; color: #6a4a00; }
.ed-cardt { font-size: 20px; font-weight: 700; }
.ed-card.is-placed { opacity: .55; transform: none; box-shadow: none; }
.ed-fixslot:empty { display: none; }
.ed-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.ed-col { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; background: #fff; border: 2px solid; }
.ed-col--criterion { border-color: var(--ed-goal); }
.ed-col--constraint { border-color: #c48a12; }
.ed-colhead { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.ed-colhead svg { width: 32px; height: 32px; flex: none; }
.ed-rule { padding: 6px 8px; border-radius: 8px; background: #f1f4f7; color: #44525f; line-height: 1.25; }
.ed-rule.is-hot { background: #fffbe8; color: #1b2733; font-weight: 700; box-shadow: 0 0 0 3px #f0b323; }

/* two designs side by side + a table */
.ed-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ed-two .ed-pic svg { max-height: 170px; width: auto; max-width: 100%; margin: 0 auto; }
.ed-tablebox { flex: none; }
.ed-matrix { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 10px; box-shadow: 0 0 0 1.5px #a9bccb; overflow: hidden; color: #1b2733; }
.ed-matrix th, .ed-matrix td { padding: 6px 10px; border-bottom: 1px solid #d6dee6; text-align: center; vertical-align: middle; }
.ed-matrix tr:last-child th, .ed-matrix tr:last-child td { border-bottom: 0; }
.ed-matrix thead th { background: #e8eef4; font-weight: 800; }
.ed-matrix tbody th { text-align: left; font-weight: 700; }
.ed-limitrow { background: #fff7e0; }
.ed-addrow { background: #f3f8f4; }
.ed-rulechip { display: inline-block; padding: 0 6px; border-radius: 6px; background: #fbe6b0; color: #5a3f00; font-weight: 700; }
.ed-limitrow td { white-space: nowrap; }
.ed-matrix th { overflow-wrap: anywhere; }
.ed-dots { display: inline-flex; gap: 5px; vertical-align: middle; }
.ed-dot { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #1f5f99; background: #fff; }
.ed-dot.is-on { background: #1f5f99; }
.ed-results td.is-win { box-shadow: inset 0 0 0 3px #f0b323; background: #fffbe8; }
.ed-why { display: block; font-weight: 700; color: #6a4a00; }
.ed-yes { color: var(--ed-yes); font-weight: 800; }
.ed-no { color: var(--ed-no); font-weight: 800; }
.ed-muted { color: #5a6774; }

/* test plans */
.ed--test { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.ed-plans { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ed-plan { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 4px 10px; align-items: center; padding: 6px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1.5px #c3ced8; }
.ed-planhead { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-weight: 800; }
.ed-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #22303f; color: #fff; font-size: 18px; font-weight: 800; }
.ed-num--big { width: 44px; height: 44px; font-size: 22px; }
.ed-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.ed-fig--plan { flex-direction: row; align-items: center; gap: 6px; }
.ed-fig--plan .ed-pic { flex: 0 0 120px; }
.ed-fig--plan figcaption { flex-direction: column; align-items: flex-start; gap: 3px; }
.ed-pv { padding: 0 5px; border-radius: 6px; line-height: 1.25; }
.ed-pv.is-changed { background: #ffe08a; box-shadow: 0 0 0 2px #e0a21c; font-weight: 700; }
.ed-verdict { font-weight: 700; line-height: 1.2; }
.ed-verdict.is-fair { color: var(--ed-yes); }
.ed-verdict.is-unfair { color: var(--ed-no); }

/* next: the new design and the design cycle */
.ed-nextbox { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ed-fig--big { width: min(100%, 380px); }
.ed-cycle { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: center; }
.ed-arrow { font-weight: 800; color: #5a6774; }
.ed-step { padding: 6px 14px; border-radius: 999px; background: #e8eef4; color: #44525f; font-weight: 700; }
.ed-step.is-now { background: #1f5f99; color: #fff; box-shadow: 0 0 0 3px #9fc6ea; }

/* ── task (right) ── */
.ed-task { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }
.ed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; min-height: 48px; flex-wrap: wrap; }
.ed p.ed-title { min-width: 0; padding: 6px 14px; border-radius: 12px; background: var(--ed-panel); border: 1.5px solid var(--ed-line); }
.ed-title b { font-size: 20px; }
html .ed-say { flex: none; min-height: 48px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--ed-line); background: var(--ed-panel); font-weight: 700; cursor: pointer; white-space: nowrap; }
.ed-say[aria-pressed="true"] { border-color: var(--ed-accent); }
.ed-say:hover { background: var(--ed-accent-bg); }
.ed-k { flex: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.ed-k span { color: var(--ed-soft); }
.ed-msg { font-weight: 700; flex: none; }
.ed-msg:empty { display: none; }
.ed button:disabled { opacity: 1; cursor: default; }
.ed-choices { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
html .ed-choice { position: relative; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px 8px 8px; border-radius: 14px; border: 2.5px solid var(--ed-line); background: var(--ed-panel); text-align: left; cursor: pointer; }
.ed-cpic { flex: none; display: grid; place-items: center; width: 108px; height: 81px; background: var(--ed-slide); border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(40, 60, 80, .2); overflow: hidden; }
.ed-cpic > svg { width: 100%; height: 100%; }
.ed-cpic > svg.ed-icon { width: 54px; height: 54px; }
.ed-choices--sort .ed-cpic, .ed-choices--next .ed-cpic, .ed-choices--test .ed-cpic { width: 64px; height: 64px; }
.ed-choices--sort .ed-cpic > svg.ed-icon, .ed-choices--next .ed-cpic > svg.ed-icon { width: 48px; height: 48px; }
.ed-choice-t { flex: 1 1 auto; min-width: 0; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ed-choices--spot .ed-choice { padding: 10px 12px; }
.ed-tag:empty { display: none; }
.ed-tag { flex: none; }
.ed-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 999px; font-weight: 800; background: #fff; color: #1b2733; box-shadow: inset 0 0 0 2px currentColor; }
.ed-chip svg { width: 26px; height: 26px; }
.ed-chip--criterion { color: var(--ed-goal); }
.ed-chip--constraint { color: var(--ed-limit); }
html .ed-choice:hover:not(:disabled) { border-color: var(--ed-accent); background: var(--ed-accent-bg); }
html .ed-choice.is-chosen { border-color: var(--ed-accent); box-shadow: 0 0 0 3px var(--ed-accent); }

/* ✓ / ✗ after Check: at the end of the choice, never on a picture */
.ed-mark { display: none; }
.ed.is-revealed .ed-mark:not(:empty) { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; font-weight: 800; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
html .ed.is-revealed .ed-choice.is-right { border-color: #2f9a5c; box-shadow: 0 0 0 3px #2f9a5c; }
html .ed.is-revealed .ed-choice.is-wrong { border-color: #c4473d; box-shadow: 0 0 0 3px #c4473d; }
.ed.is-revealed .is-right .ed-mark { background: #17663a; }
.ed.is-revealed .is-wrong .ed-mark { background: #a3241f; }

/* ── Briefing example and Start art ── */
.ed-example { display: flex; flex-direction: column; gap: 10px; color: #1b2733; background: #fbfdff; padding: 8px; border-radius: 10px; }
.ed-example .ed-two .ed-pic svg { max-height: 150px; }
.ps-brief--drawer .ed-example .ed-two { grid-template-columns: 1fr; }
.ed-start { width: 100%; height: 100%; display: grid; place-items: center; background: #1f4f86; border-radius: 12px; overflow: hidden; }
.ed-start svg { width: 100%; height: 100%; }

/* ── Foundations: 18 px for the shell's words beside the play area too ── */
body[data-activity="engineering-design-studio"] .ps-bubble, body[data-activity="engineering-design-studio"] .ps-cust-detail, body[data-activity="engineering-design-studio"] .ps-feedback,
body[data-activity="engineering-design-studio"] .ps-hint, body[data-activity="engineering-design-studio"] .ps-gloss, body[data-activity="engineering-design-studio"] .ps-cust-who,
body[data-activity="engineering-design-studio"] .ps-nudge { font-size: 18px; line-height: 1.3; }
body[data-activity="engineering-design-studio"] .ps-cust-detail { color: var(--tlg-text); }
body[data-activity="engineering-design-studio"] .ps-say { width: 48px; height: 48px; font-size: 22px; margin: -2px -4px 4px 8px; }
body[data-activity="engineering-design-studio"] .ps-hint-btn { min-height: 48px; }
body[data-activity="engineering-design-studio"] .ps-hint .ps-hint-note { font-size: 16px; }
body[data-activity="engineering-design-studio"] .ps-side:has(.ps-feedback:not([hidden])) .ps-cust-detail,
body[data-activity="engineering-design-studio"] .ps-side:has(.ps-feedback:not([hidden])) .ps-hint { display: none; }

@container (max-width: 420px) {
  .ed-cpic { width: 88px; height: 66px; }
  html .ed-choice { gap: 10px; }
}
@container edscene (max-width: 560px) {
  .ed-plan { grid-template-columns: minmax(0, 1fr); }
  .ed-planhead { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
  .ed-fig--plan .ed-pic { flex-basis: 104px; }
}
@container edscene (max-width: 440px) {
  .ed-matrix th, .ed-matrix td { padding: 6px 5px; }
  .ed-dots { gap: 3px; }
  .ed-project { grid-template-columns: 1fr; }
  .ed-board { grid-template-columns: 1fr; }
  .ed-pair { grid-template-columns: 1fr; }
  .ed-fig--plan .ed-pic { flex-basis: 140px; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .ed { overflow-y: auto; align-items: start; }
  .ed-scene-body { flex: none; overflow: visible; }
}
@media (max-width: 900px) {
  .ed, .ed--test { position: relative; inset: auto; overflow: visible; grid-template-columns: minmax(0, 1fr); padding: 10px 10px 16px; }
  .ed-scene-body { overflow: visible; }
}
@media (prefers-reduced-motion: no-preference) {
  .ed-choice { transition: border-color .12s, background-color .12s, box-shadow .12s; }
  .ed.is-revealed .ed-scenebox { animation: ed-pop .35s ease-out; }
  .ed-rule.is-hot, .ed-results td.is-win { animation: ed-glow .9s ease-out; }
  @keyframes ed-pop { 0% { transform: scale(.98); opacity: .6; } 100% { transform: scale(1); opacity: 1; } }
  @keyframes ed-glow { 0% { box-shadow: 0 0 0 10px rgba(240, 179, 35, .1); } 100% { box-shadow: 0 0 0 3px #f0b323; } }
}
