@import url("./plan-dialog.css?v=20261102-1");
.ems-document-dialog { width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;color:#20313c;background:#fff; }
.site-play-link { display:inline-flex;align-items:center;justify-content:center;min-height:42px;margin-left:auto;padding:9px 17px;border-radius:8px;background:#0b735c;color:#fff;font-weight:750;text-decoration:none;white-space:nowrap; }
.site-play-link:hover { background:#075941;color:#fff; }
.site-play-link:focus-visible { outline:3px solid #d89523;outline-offset:3px; }
.ems-play-dialog { box-sizing:border-box;width:min(680px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:28px;border:1px solid #dce8e2;border-radius:16px;background:#fff;color:#20313c;box-shadow:0 24px 72px #13281f38;font:inherit; }
.ems-play-dialog::backdrop { background:rgb(17 33 29 / 48%); }
.ems-play-dialog-head { display:flex;align-items:start;justify-content:space-between;gap:18px;margin-bottom:22px; }
.ems-play-eyebrow { margin:0 0 5px;color:#0b735c;font-size:.72rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase; }
.ems-play-dialog h2 { margin:0;color:#20313c;font-size:clamp(1.5rem,3vw,2rem);line-height:1.1;letter-spacing:-.025em; }
.ems-play-close { display:grid;place-items:center;flex:none;width:36px;height:36px;border:1px solid #dce5e0;border-radius:9px;background:#fff;color:#52635d;font:inherit;font-size:1.5rem;line-height:1;cursor:pointer; }
.ems-play-close:hover { background:#f0f7f3;color:#0b735c; }
.ems-play-options { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
.ems-play-option { display:grid;grid-template-columns:44px minmax(0,1fr) 18px;align-items:center;gap:13px;min-height:112px;padding:17px;border:1px solid #cfe2d8;border-radius:12px;background:#f8fbf9;color:#20313c;text-decoration:none;text-align:left;transition:border-color .15s,background .15s,transform .15s; }
.ems-play-option:focus-visible { outline:3px solid #d89523;outline-offset:2px; }
.ems-play-option:hover { transform:translateY(-2px);border-color:#0b735c;background:#eef7f1;color:#20313c; }
.ems-play-icon { display:grid;place-items:center;width:44px;height:44px;border-radius:10px;background:#0b735c;color:#fff;font-size:1.15rem;font-weight:800;letter-spacing:-.05em; }
.ems-play-icon span { font-size:.8rem; }
.ems-play-icon svg { width:25px;height:25px; }
.ems-play-option-copy { display:grid;gap:4px;min-width:0; }
.ems-play-option-copy strong { font-size:1rem;line-height:1.2; }
.ems-play-option-copy small { color:#60716b;font-size:.76rem;line-height:1.25; }
.ems-play-arrow { color:#0b735c;font-size:1.25rem;font-weight:700; }
.ems-play-join { display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,170px) auto;align-items:center;gap:10px;margin:16px 0 0;padding:14px 16px;border:2px solid #0b735c;border-radius:12px;background:#e9f6ed;color:#20313c; }
.ems-play-join-copy { display:grid;gap:2px;margin:0; }
.ems-play-join-copy strong { color:#10233f;font-size:1.05rem;font-weight:800; }
.ems-play-join-copy span { color:#3f5a4f;font-size:.8rem;font-weight:600; }
.ems-play-join input { box-sizing:border-box;width:100%;min-height:44px;padding:8px 10px;border:1px solid #9cc5b2;border-radius:8px;background:#fff;color:#10233f;font:inherit;font-size:1.1rem;font-weight:800;letter-spacing:.18em;text-align:center;text-transform:uppercase; }
.ems-play-join input::placeholder { color:#9aa9a2;letter-spacing:.18em; }
.ems-play-join button { min-height:44px;padding:8px 16px;border:0;border-radius:8px;background:#00b22d;color:#10233f;font:inherit;font-size:.95rem;font-weight:800;white-space:nowrap;cursor:pointer; }
.ems-play-join button:hover { background:#00a028; }
@media(max-width:560px) { .ems-play-join { grid-template-columns:minmax(0,1fr) auto; } .ems-play-join-copy { grid-column:1 / -1; } }
.ems-play-dialog :focus-visible { outline:3px solid #d89523;outline-offset:2px; }
.ems-play-error,.ems-game-error { margin:12px 0 0;padding:9px 12px;border-radius:7px;background:#fff0ef;color:#9a3140;font-size:.82rem;font-weight:650; }
.ems-game-dialog { box-sizing:border-box;width:min(760px,calc(100vw - 32px));max-height:88dvh;padding:0;border:1px solid #dce8e2;border-radius:14px;background:#fff;color:#20313c;box-shadow:0 24px 72px #13281f38;font:inherit;overflow:auto; }
.ems-game-dialog::backdrop { background:rgb(17 33 29 / 48%); }
.ems-game-dialog [hidden] { display:none !important; }
.ems-game-form { display:grid;gap:14px;padding:24px 28px; }
.ems-game-head { display:flex;align-items:start;justify-content:space-between;gap:16px; }
.ems-game-head h2 { margin:0;color:#20313c;font-size:1.45rem;line-height:1.12;letter-spacing:-.025em; }
.ems-game-steps { display:grid;gap:7px; }
/* The shared steps continue the game's own list at its 7px spacing, not the form's 14px plus 7. */
.ems-game-common { margin-top:-7px; }
.ems-game-step { display:grid;grid-template-columns:minmax(0,1fr) minmax(210px,1fr);align-items:center;gap:12px;min-height:56px;padding:8px 13px;border:1px solid #dbe7e1;border-radius:9px;background:#f8fbf9;color:#20313c;font-size:.83rem;font-weight:750; }
.ems-game-step > span:first-child { display:flex;align-items:center;gap:10px;min-width:0; }
.ems-game-step b { display:grid;place-items:center;flex:none;width:28px;height:28px;border-radius:50%;background:#dceee5;color:#0b735c;font-size:.8rem; }
.ems-game-step small { margin-left:auto;color:#67756f;font-size:.68rem;font-weight:600;white-space:nowrap; }
.ems-game-step select,.ems-game-step input[type=number],.ems-game-step input[type=text] { box-sizing:border-box;width:100%;min-height:39px;padding:7px 10px;border:1px solid #d5e0da;border-radius:7px;background-color:#fff;color:#20313c;font:inherit;font-size:.84rem;font-weight:500; }
/* MCQ tick lists, adapted from the Questions Bank pickers (.qbank-picker-*). An open list takes the dialog:
   the other steps stand aside, the dialog keeps the height it had (held by play-setup.mjs), and only the
   list scrolls. Closing it brings the steps back. */
.ems-game-picker-button { display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;min-height:39px;padding:7px 10px;border:1px solid #d5e0da;border-radius:7px;background:#fff;color:#20313c;font:inherit;font-size:.84rem;font-weight:500;text-align:left;cursor:pointer; }
.ems-game-picker-button:hover { border-color:#bfd2cb; }
.ems-game-picker-summary { flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.ems-game-picker-caret { flex:none;width:9px;height:9px;border-right:1.6px solid #67756f;border-bottom:1.6px solid #67756f;transform:translateY(-2px) rotate(45deg); }
.ems-game-picker.is-open .ems-game-picker-caret { transform:translateY(2px) rotate(225deg); }
.ems-game-picker.is-chosen .ems-game-picker-button { border-color:#0b735c;background:#e9f6ed;color:#0b735c;font-weight:650; }
.ems-game-picker-menu { grid-column:1/-1;box-sizing:border-box;padding:5px;border:1px solid #d5e0da;border-radius:7px;background:#fff;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#8ab8a7 #edf5f1; }
.ems-game-check { display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:5px;color:#20313c;font-size:.8rem;font-weight:650;line-height:1.35;cursor:pointer; }
.ems-game-check:hover,.ems-game-check:has(input:checked) { background:#e9f6ed;color:#0b735c; }
.ems-game-check:has(input:focus-visible) { outline:2px solid #0b735c;outline-offset:-1px; }
.ems-game-check input { flex:none;width:15px;height:15px;margin:0;accent-color:#0b735c;cursor:pointer; }
.ems-game-check-text { flex:1 1 auto;min-width:0;overflow-wrap:anywhere; }
.ems-game-check-count { flex:none;margin-left:auto;padding-left:6px;color:#90a09a;font-size:.72rem;font-weight:650; }
/* Colour-coded equivalent entries, their note and each group's Select all, adapted from the Questions Bank
   (.qbank-pair-*). Ticked entries keep their group's colour. */
.ems-game-pair-note { display:flex;align-items:center;gap:10px;margin:2px 2px 4px;padding:10px 12px;border-radius:7px;background:#10233f;color:#fff;font-size:.73rem;font-weight:600;line-height:1.5; }
.ems-game-pair-note-text { flex:1 1 auto;min-width:0;margin:0; }
.ems-game-check[data-pair-group] { border-left:5px solid transparent;padding-left:9px; }
.ems-game-check[data-pair-group="1"] { border-left-color:#1f7a5a;background:#e7f3ee; }
.ems-game-check[data-pair-group="2"] { border-left-color:#a8620d;background:#fbeed8; }
.ems-game-check[data-pair-group="3"] { border-left-color:#4b3b8f;background:#efecfa; }
.ems-game-check[data-pair-group="1"]:has(input:checked) { background:#d3eadf; }
.ems-game-check[data-pair-group="2"]:has(input:checked) { background:#f6e0bd; }
.ems-game-check[data-pair-group="3"]:has(input:checked) { background:#e0dbf5; }
.ems-game-pair-head { display:flex;justify-content:center;margin:10px 0 0;padding:6px 8px 6px 9px;border-left:5px solid transparent;border-radius:5px; }
.ems-game-pair-head[data-pair-group="1"] { border-left-color:#1f7a5a;background:#e7f3ee; }
.ems-game-pair-head[data-pair-group="2"] { border-left-color:#a8620d;background:#fbeed8; }
.ems-game-pair-head[data-pair-group="3"] { border-left-color:#4b3b8f;background:#efecfa; }
.ems-game-pair-select { padding:3px 12px;border:1px solid currentColor;border-radius:999px;background:#fff;font:inherit;font-size:.72rem;font-weight:750;cursor:pointer; }
.ems-game-pair-select:hover { color:#fff; }
.ems-game-pair-head[data-pair-group="1"] .ems-game-pair-select { color:#1f7a5a; }
.ems-game-pair-head[data-pair-group="2"] .ems-game-pair-select { color:#a8620d; }
.ems-game-pair-head[data-pair-group="3"] .ems-game-pair-select { color:#4b3b8f; }
.ems-game-pair-head[data-pair-group="1"] .ems-game-pair-select:hover { background:#1f7a5a;border-color:#1f7a5a; }
.ems-game-pair-head[data-pair-group="2"] .ems-game-pair-select:hover { background:#a8620d;border-color:#a8620d; }
.ems-game-pair-head[data-pair-group="3"] .ems-game-pair-select:hover { background:#4b3b8f;border-color:#4b3b8f; }
@media (forced-colors: active) { .ems-game-check[data-pair-group],.ems-game-pair-head { border-left-color:currentColor; } }
.ems-game-visually-hidden { position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0; }
/* "Scroll for more" over the foot of the open list while more is below (Questions Bank .qbank-scroll-cue). */
.ems-game-picker { position:relative; }
.ems-game-scroll-cue { position:absolute;left:14px;right:14px;bottom:9px;display:flex;justify-content:center;padding:30px 0 6px;border-radius:0 0 7px 7px;pointer-events:none;background:linear-gradient(to bottom,transparent,#fff 58%); }
.ems-game-scroll-cue span { padding:4px 11px;color:#0b735c;font-size:.76rem;font-weight:750; }
.ems-game-dialog[data-picking] { overflow:hidden; }
.ems-game-dialog[data-picking] .ems-game-form { box-sizing:border-box;height:100%;display:flex;flex-direction:column; }
.ems-game-dialog[data-picking] [data-ems-game-mcq] { display:flex;flex-direction:column;flex:1 1 auto;min-height:0; }
.ems-game-dialog[data-picking] [data-ems-game-mcq] > :not(.is-open),.ems-game-dialog[data-picking] [data-ems-game-create] { display:none; }
.ems-game-dialog[data-picking] .ems-game-picker.is-open { display:flex;flex-direction:column;align-items:stretch;flex:1 1 auto;min-height:0; }
.ems-game-dialog[data-picking] .ems-game-picker-menu { flex:1 1 auto;min-height:0; }
.ems-game-choice-pills { display:flex;flex-wrap:wrap;align-items:center;gap:7px; }
.ems-game-choice-pills label { position:relative;display:inline-flex;align-items:center;min-height:31px;padding:5px 12px;border:1px solid #d5e0da;border-radius:999px;background:#fff;color:#20313c;font-size:.76rem;font-weight:650;cursor:pointer; }
.ems-game-choice-pills label:has(input:checked) { border-color:#0b735c;background:#e9f6ed;color:#0b735c; }
.ems-game-choice-pills input { margin:0 6px 0 0;accent-color:#0b735c; }
/* A diagram's games and their Numbers/Annotations setting are two rows of the same right-hand column, so
   each setting sits under a game (owner, 30 September 2026). The count of prepared
   questions is not shown: players have no use for it. */
/* Every choice row in setup is two equal cells, so the rows line up down the form. */
.ems-game-dialog .ems-game-choice-pills { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch; }
/* Beside its label, a choice row gets the wider share, so a game's name fits on one line ("Two maximum prices")
   while its four pills stay one width (owner, 30 September 2026). On a phone the row stacks under its label. */
@media(min-width:651px) {
  .ems-game-dialog .ems-game-step { grid-template-columns:minmax(0,1fr) minmax(210px,1.55fr); }
  .ems-game-dialog .ems-game-choice-pills label { white-space:nowrap; }
}
/* On a phone two names do not fit side by side, so each choice takes its own full-width line. */
@media(max-width:650px) {
  .ems-game-dialog .ems-game-choice-pills { grid-template-columns:minmax(0,1fr); }
  .ems-game-dialog .ems-game-choice-pills label { white-space:nowrap; }
}
/* A row whose names do not fit two across takes one per line; on a very narrow phone a name may wrap
   (owner, 1 October 2026: "Revenue, surplus and welfare" was cut off). play-setup.mjs fitChoiceRows decides. */
.ems-game-dialog .ems-game-choice-pills.is-stacked { grid-template-columns:minmax(0,1fr); }
.ems-game-dialog .ems-game-choice-pills.is-stacked label { white-space:normal; }
.ems-game-diagram-variants { grid-column:2;display:grid;gap:5px;margin-top:2px; }
.ems-game-diagram-variants[hidden] { display:none; }
.ems-game-diagram-variants > span { color:#617068;font-size:.72rem;font-weight:700; }
.ems-game-categories { min-width:0;margin:0 0 11px;padding:0;border:0; }
.ems-game-categories legend { margin:0 0 10px;padding:0;color:#20313c;font-size:.88rem;font-weight:750; }
.ems-game-category-heading { display:inline-flex;align-items:center;gap:10px; }
.ems-game-category-heading b { display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#dceee5;color:#0b735c;font-size:.8rem; }
.ems-game-category-heading small { color:#67756f;font-size:.68rem;font-weight:600; }
.ems-game-category-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
.ems-game-category { position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:52px;padding:10px 13px;border:1px solid #cfe2d8;border-radius:9px;background:#f8fbf9;color:#20313c;font-size:.82rem;font-weight:700;cursor:pointer; }
.ems-game-category::before { content:"";flex:none;width:15px;height:15px;border:1px solid #bacfc5;border-radius:4px;background:#fff; }
.ems-game-category input { position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer; }
.ems-game-category strong { flex:none;color:#0b735c;font-size:.82rem; }
.ems-game-category:has(input:checked) { border-color:#0b735c;background:#e9f6ed;box-shadow:inset 0 0 0 1px #0b735c; }
.ems-game-category:has(input:checked)::before { content:"✓";display:grid;place-items:center;border-color:#0b735c;background:#0b735c;color:#fff;font-size:12px; }
.ems-game-category:has(input:focus-visible) { outline:3px solid #d89523;outline-offset:2px; }
.ems-game-category[data-empty=true] { border-color:#e2e6e4;background:#f1f3f2;color:#89948f;cursor:not-allowed; }
.ems-game-category[data-empty=true] strong { color:#89948f; }
.ems-game-category[data-empty=true] input { cursor:not-allowed; }
.ems-game-actions { position:sticky;z-index:1;bottom:0;display:flex;justify-content:flex-end;gap:8px;margin:2px -28px -24px;padding:12px 28px 24px;border-top:1px solid #dce5e0;background:#fff; }
.ems-game-actions button { min-height:40px;padding:8px 14px;border:1px solid #d5e0da;border-radius:7px;background:#fff;color:#0b735c;font:inherit;font-size:.83rem;font-weight:750;cursor:pointer; }
.ems-game-actions .ems-game-go { min-width:145px;border-color:#0b735c;background:#0b735c;color:#fff; }
.ems-game-actions button:disabled { opacity:.55;cursor:wait; }
/* "Is that you?" when a different name is typed for a game this browser is already in (owner, 3 November 2026). */
.ems-game-rejoin { margin:12px 0 0;padding:11px 13px;border:1px solid #f0c36d;border-radius:9px;background:#fff8e6;color:#3d2a00;font-size:.86rem; }
.ems-game-rejoin[hidden] { display:none; }
.ems-game-rejoin p { margin:0 0 9px;font-weight:700; }
.ems-game-rejoin-actions { display:flex;flex-wrap:wrap;gap:8px; }
.ems-game-rejoin-actions button { min-height:40px;padding:8px 14px;border:1px solid #d5e0da;border-radius:7px;background:#fff;color:#0b735c;font:inherit;font-size:.83rem;font-weight:750;cursor:pointer; }
.ems-game-rejoin-actions button:first-child { border-color:#0b735c;background:#0b735c;color:#fff; }
.ems-game-dialog :focus-visible { outline:3px solid #d89523;outline-offset:2px; }
@media(max-width:650px) { .ems-game-form { padding:18px; } .ems-game-step { grid-template-columns:1fr;gap:7px; } .ems-game-diagram-variants { grid-column:1; } .ems-game-category-grid { grid-template-columns:1fr; } .ems-game-actions { margin:2px -18px -18px;padding:12px 18px 18px; } }
@media(max-width:590px) { .ems-play-dialog { padding:20px; } .ems-play-options { grid-template-columns:1fr; } .ems-play-option { min-height:82px; } .ems-play-options .ems-play-option { min-height:46px; } }
.site-header .header-inner { display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);column-gap:20px; }
.site-header .brand-lockup { grid-column:1;grid-row:1;justify-self:start; }
.site-header .site-play-link { grid-column:2;grid-row:1;justify-self:center;margin:0; }
.site-header .site-nav { grid-column:3;grid-row:1;justify-self:end;margin-left:0; }
body > .site-play-link { position:fixed;top:12px;left:50%;z-index:1000;margin:0;transform:translateX(-50%);box-shadow:0 2px 12px #0002; }
.apphead { position:relative; }
.apphead .site-play-link { position:absolute;left:50%;transform:translateX(-50%);min-height:34px;margin:0;padding:6px 14px;font-size:.8rem; }
@media(max-width:1024px) {
  .apphead .site-play-link { top:0;right:0;left:auto;transform:none; }
  .apphead:has(.site-play-link) h1 { min-height:34px;padding-right:170px;display:flex;align-items:center; }
}
@media(max-width:920px) {
  .site-header .header-inner { grid-template-columns:minmax(0,1fr) auto;row-gap:12px;padding-top:14px;padding-bottom:14px; }
  .site-header .site-nav { grid-column:2;grid-row:1; }
  .site-header .site-play-link { grid-column:1 / -1;grid-row:2; }
}
@media(max-width:640px) {
  .site-header .header-inner { grid-template-columns:1fr; }
  .site-header .site-nav { grid-column:1;grid-row:3;justify-self:stretch; }
}
.ems-document-dialog::backdrop { background:rgb(15 35 28 / 60%); }
.ems-document-dialog.is-compact { width:96vw;height:92dvh;margin:auto;border-radius:12px;box-shadow:0 12px 50px #0005; }
.ems-document-shell { position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);height:100%;min-width:0; }
.ems-document-header { display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;padding:12px 20px;background:#0c6f59;color:#fff; }
.ems-document-header strong { flex:1;min-width:120px; }
.ems-document-actions { display:flex;flex-wrap:wrap;gap:8px;margin-left:auto; }
.ems-document-dialog button,.ems-document-dialog a,.ems-document-dialog select,.ems-document-dialog input { box-sizing:border-box;min-height:40px;padding:7px 12px;border:1px solid #b9cec6;border-radius:7px;color:#0c6f59;background:#fff;font:inherit;font-size:14px;font-weight:650; }
.ems-document-dialog button,.ems-document-dialog select { cursor:pointer; }
.ems-document-dialog button:disabled { opacity:.5;cursor:default; }
.ems-document-dialog a { display:inline-flex;align-items:center;text-decoration:none; }
.ems-document-dialog [data-doc-related] { max-width:100%;font-size:17px;font-weight:700;background:#0c6f59;color:white;border-color:#ffffff80; }
.ems-document-dialog [data-doc-related] option { background:white;color:#20313c; }
.ems-document-dialog [data-doc-download] { background:#0c6f59;color:#fff;border-color:#ffffff80; }
.ems-document-dialog iframe { grid-row:2;grid-column:1;width:100%;height:100%;min-height:0;border:0; }
.ems-document-dialog[data-document-ready="false"] iframe,.ems-document-dialog[data-document-ready="error"] iframe { visibility:hidden; }
.ems-document-loading { grid-row:2;grid-column:1;z-index:1;display:grid;place-items:center;padding:32px;background:#f7faf8;color:#305a4e;font-weight:700;text-align:center; }
.ems-document-dialog[data-document-ready="true"] .ems-document-loading { display:none; }
.ems-document-controls { position:absolute;right:16px;bottom:12px;display:flex;flex-direction:column;align-items:flex-end;gap:6px;max-width:calc(100% - 24px); }
/* Said when a document has nothing on the question being read and so opens at its start. */
.ems-document-note { margin:0;max-width:340px;padding:8px 12px;border-radius:8px;background:#10233f;color:#fff;font-size:13px;font-weight:600;line-height:1.4;box-shadow:0 2px 12px #0003; }
.ems-document-note[hidden] { display:none; }
.ems-document-toolbar { display:flex;align-items:center;gap:5px;padding:6px;border:1px solid #c7d4cf;border-radius:10px;background:rgb(255 255 255 / 96%);box-shadow:0 2px 12px #0002; }
.ems-document-toolbar button { font-size:24px;padding:0 10px; }
.ems-document-toolbar input { width:48px;padding:6px;text-align:center;appearance:textfield; }
.ems-document-toolbar input::-webkit-inner-spin-button { appearance:none; }
.ems-document-toolbar span { white-space:nowrap;font-size:14px; }
.ems-document-toolbar select { max-width:110px; }
.ems-document-dialog .ems-controls-toggle { min-height:30px;padding:4px 10px;font-size:12px;box-shadow:0 2px 6px #0002; }
.controls-hidden .ems-document-toolbar { visibility:hidden;pointer-events:none; }
.ems-document-dialog :focus-visible { outline:3px solid #d89523;outline-offset:2px; }
.ems-document-dialog [hidden] { display:none; }
.ems-visually-hidden { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }
.ems-document-shell:fullscreen { width:100vw;height:100dvh;background:#fff; }
@media(max-width:600px) { .ems-document-header { padding:10px;gap:8px; } .ems-document-actions { gap:5px;margin-left:0; } .ems-document-dialog .ems-document-actions button,.ems-document-dialog .ems-document-actions a { padding:6px 8px;font-size:12px; } .ems-document-controls { right:10px;bottom:10px; } }

/* The catalogue uses contained scrolling like the existing study workspaces. */
@media (min-width:1000px) and (min-height:650px) {
  .diagrams-main { height:calc(100dvh - 85px); min-height:0; }
  .diagrams-main .diagrams-page { height:100%;display:flex;flex-direction:column;padding:24px 0; }
  .diagrams-main .diagrams-heading { flex:none; }
  .diagrams-main .diagram-directory { flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable; }
}

/* One dropdown affordance across EMS, independent of browser-native arrow styling. */
html body select:not([multiple]):not([size]), html body select:not([multiple])[size="1"] {
  appearance:none;
  -webkit-appearance:none;
  padding-inline-end:42px;
  background-image:var(--ems-select-chevron, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%235c6a70' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"));
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:16px 16px;
}
.ems-document-dialog [data-doc-related] { --ems-select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html body .hierarchy-toggle::after { content:"";width:8px;height:8px;border-right:1.8px solid currentColor;border-bottom:1.8px solid currentColor;transform:translateY(-2px) rotate(45deg);margin-right:4px; }
html body .hierarchy-toggle[aria-expanded="true"]::after { transform:translateY(2px) rotate(225deg); }
html body .qbank-picker-caret { width:8px;height:8px;border-width:1.8px;margin-right:4px; }
@media(forced-colors:active) {
  html body select:not([multiple]) { appearance:auto;-webkit-appearance:auto;background-image:none; }
}

/* Diagram games: one entry per diagram, below Multiple choice and Keywords (DIAGRAM-GAMES.md, 29 September 2026). */
.ems-play-diagrams { margin-top:14px; }
/* Multiple choice and Keywords are compact text buttons, no icons (owner, 12 October 2026: "take up too much space and
   do not need icons"); the diagram games sit under the catalogue's headings. */
.ems-play-options .ems-play-option { display:flex;align-items:center;justify-content:center;min-height:52px;padding:8px 14px;text-align:center; }
.ems-play-options .ems-play-option-copy { gap:1px;justify-items:center; }
/* Each catalogue section is a card column with a green heading band, as the calculators' cards are (owner, 12 October
   2026). Eight games fit a column without scrolling; more scroll inside the card, with a hint. */
.ems-play-dialog:has(.ems-play-columns) { width:min(1040px,calc(100vw - 32px)); }
.ems-play-diagram-list.ems-play-columns { display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px; }
.ems-play-column { display:flex;flex-direction:column;min-width:0;border:1px solid #dce5e0;border-radius:12px;background:#fff;box-shadow:0 4px 14px #13281f12;overflow:hidden; }
.ems-play-column-head { margin:0;padding:8px 12px;background:#0b735c;color:#fff;font-size:.78rem;font-weight:800;letter-spacing:.02em; }
.ems-play-column-body { display:grid;align-content:start;gap:6px;max-height:calc(8 * 38px + 7 * 6px + 20px);padding:10px;overflow-y:auto;overscroll-behavior:contain; }
.ems-play-columns .ems-play-diagram { min-height:38px;padding:6px 10px;font-size:.84rem; }
.ems-play-column-empty { margin:4px 2px;color:#8a9a94;font-size:.8rem;font-style:italic; }
.ems-play-column-hint { margin:0;padding:4px 10px 8px;color:#b4690e;font-size:.72rem;font-weight:800;text-align:right; }
@media (max-width:760px) { .ems-play-diagram-list.ems-play-columns { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:440px) { .ems-play-diagram-list.ems-play-columns { grid-template-columns:1fr; } }
/* Until the diagram games are in, their section keeps the space they take, so the chooser opens at its final
   size even on a very fast click (owner, 14 October 2026). Heights measured at 1440, 700 and 390px wide. */
.ems-play-diagrams[data-loading] .ems-play-diagram-list { min-height:359px; }
@media (max-width:760px) { .ems-play-diagrams[data-loading] .ems-play-diagram-list { min-height:597px; } }
@media (max-width:440px) { .ems-play-diagrams[data-loading] .ems-play-diagram-list { min-height:841px; } }
.ems-play-diagrams-head { margin:0 0 8px;color:#60716b;font-size:.72rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase; }
.ems-play-diagram-list { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px; }
.ems-play-diagram { display:flex;align-items:center;justify-content:center;min-height:46px;padding:8px 10px;border:1px solid #cfe2d8;border-radius:10px;background:#f8fbf9;color:#20313c;text-decoration:none;text-align:center;font-size:.86rem;font-weight:700; }
.ems-play-diagram:hover { border-color:#0b735c;background:#eef7f1; }
.ems-play-diagram:focus-visible { outline:3px solid #d89523;outline-offset:2px; }
/* A click is confirmed at once (owner, 24 October 2026: "there should be like a second where the user gets any
   confirmation even subtle that they have clicked"). A game stays pressed while its settings open. Same subtle
   press as the Questions Bank quick buttons and the simulator's scenario toggle. */
.ems-play-option:active, .ems-play-option.is-opening { transform:translateY(0);border-color:#0b735c;background:#e3f1e8; }
.ems-play-diagram:active, .ems-play-diagram.is-opening { transform:translateY(1px);border-color:#0b735c;background:#e3f1e8; }
.ems-play-join button:active, .ems-game-actions button:not(:disabled):active { transform:translateY(1px); }

/* A code can open a game, a school/class join, or a later EMS flow. The header opens the same entry form as /code/. */
.ems-code-dialog{box-sizing:border-box;max-width:none;width:min(760px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:24px;border:1px solid #cfe2d8;border-radius:16px;background:#fff;color:#20313c;box-shadow:0 24px 72px #13281f38;font:inherit}
.ems-code-dialog::backdrop{background:rgb(17 33 29 / 48%)}
.ems-code-head{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:18px}
.ems-code-head h2{margin:0;font-size:1.45rem;color:#20313c}
.ems-code-close{display:grid;place-items:center;width:36px;height:36px;border:1px solid #dce5e0;border-radius:9px;background:#fff;color:#52635d;font:inherit;font-size:1.5rem;line-height:1;cursor:pointer}
.ems-code-close:hover{background:#f0f7f3;color:#0b735c}
.ems-code-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,1fr) auto;align-items:center;gap:12px;padding:18px;border:2px solid #0b735c;border-radius:12px;background:#e9f6ed;color:#20313c}
.ems-code-form label{display:grid;gap:4px}
.ems-code-form label strong{color:#10233f;font-size:1.1rem;font-weight:800}
.ems-code-form label span{color:#3f5a4f;font-size:.85rem;font-weight:600}
.ems-code-form input{box-sizing:border-box;width:100%;min-height:46px;padding:8px 10px;border:1px solid #9cc5b2;border-radius:8px;background:#fff;color:#10233f;font:inherit;font-size:1.05rem;font-weight:800;letter-spacing:.12em;text-align:center;text-transform:uppercase}
.ems-code-form input::placeholder{color:#9aa9a2;letter-spacing:.18em}
.ems-code-form button{min-height:46px;padding:8px 18px;border:0;border-radius:8px;background:#00b22d;color:#10233f;font:inherit;font-weight:800;white-space:nowrap;cursor:pointer}
.ems-code-form button:hover{background:#00a028}
.ems-code-form button:disabled{opacity:.6;cursor:wait}
.ems-code-error{margin:12px 2px 0;color:#a33227;font-size:.9rem;font-weight:650}
.ems-code-error[hidden]{display:none}
.ems-code-dialog :focus-visible,.ems-code-page :focus-visible{outline:3px solid #d89523;outline-offset:3px}
.ems-code-page{box-sizing:border-box;width:100%;min-height:calc(100dvh - 85px);max-width:1040px;margin:0 auto;padding:clamp(28px,5vw,64px) 28px;color:#20313c}
.ems-code-page h1{margin:0 0 8px;font-size:clamp(1.7rem,4vw,2.6rem)}
.ems-code-page>p{margin:0 0 24px;color:#52635d}
@media(max-width:650px){
 .ems-code-dialog{padding:18px}
 .ems-code-form{grid-template-columns:1fr}
 .ems-code-form button{width:100%}
 .ems-code-page{padding:30px 18px}
}
@media (max-width:560px) { .ems-play-diagram-list { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* "Return to your game" (owner, 2 October 2026): a small fixed pill on every page while a game is saved. */
.ems-play-return { position:fixed;right:16px;bottom:16px;z-index:9000;display:flex;align-items:center;gap:4px;padding:6px 6px 6px 16px;border:1px solid #0b735c;border-radius:999px;background:#e7f6ef;box-shadow:0 10px 28px #13281f2e;font:inherit;font-size:.92rem; }
.ems-play-return a { color:#0b5e4b;font-weight:750;text-decoration:none; }
.ems-play-return a:hover,.ems-play-return a:focus-visible { text-decoration:underline; }
.ems-play-return button { width:30px;height:30px;border:0;border-radius:50%;background:transparent;color:#20313c;font:inherit;font-size:1.1rem;cursor:pointer; }
.ems-play-return button:hover,.ems-play-return button:focus-visible { background:#d2ece1; }
@media print { .ems-play-return { display:none; } }

/* An interactive diagram is built by its script after the page arrives. Until the script has run, its panels
   wait, so the first thing seen is the finished diagram rather than a half-built page whose controls then
   push the buttons down (owner, 14 October 2026). The title bar shows at once; site/runtime.mjs marks the
   page ready, and if that never happens the panels show after 4 seconds regardless. */
html:not(.ems-diagram-ready) body[data-product-shell^="ems-interactive-diagram"] .layout { visibility:hidden; animation:ems-diagram-reveal 0s linear 4s forwards; }
@keyframes ems-diagram-reveal { to { visibility:visible; } }

/* The account link ("Login / Sign up", or the profile menu once signed in) is added by site/homework.mjs a moment after
   the page appears. Until then the menu already has the account layout and space for Login / Sign up, so the other
   links do not shuffle when it arrives (owner, 14 October 2026). Mirrors .ems-account-nav in homework.css. */
.site-nav:not(.ems-account-nav) { flex-wrap:wrap;justify-content:flex-end;white-space:normal;row-gap:8px; }
.site-nav:not(.ems-account-nav)::after { content:"Login / Sign up";visibility:hidden;font-size:.96rem;font-weight:650;white-space:nowrap; }
@media (max-width:600px) { .site-nav:not(.ems-account-nav) { max-width:100%;width:100%; } }
@media (max-width:640px) { .site-nav:not(.ems-account-nav)::after { font-size:.82rem; } }

/* Plan limits (plan-lock.mjs, 19 October 2026): the box shown on using something a plan does not include, and the
   "Free" label on the diagrams page. The same look as the lessons' box (Learning learning.css). */
.diagram-free-badge{display:inline-block;margin-left:6px;padding:1px 8px;border:1px solid #e3c79a;border-radius:999px;background:#fff4e5;color:#704c16;font-size:.78em;font-weight:700;vertical-align:middle}
.diagram-free-note{margin:6px 0 0;color:#475569}

@media(max-width:760px){.ems-code-dialog{width:calc(100vw - 16px);padding:12px}.ems-code-form{grid-template-columns:minmax(0,1fr);padding:10px;gap:12px}.ems-code-form input{width:100%;min-width:0;box-sizing:border-box;letter-spacing:.04em}.ems-code-form button{width:100%}.ems-code-page{padding:24px 8px}}

/* PHONE LAYOUT (owner-approved 4 November 2026; SITE-EXPERIENCE.md "Phone layout"). One shared phone media query for
   every page: an upright phone (≤600px wide) or a phone on its side (≤500px tall). iPads (≥744px both ways) and
   computers never match, so they are unchanged. Header: logo, Enter Code and Login on ONE row, each control ≥44px tall.
   This replaced the two/three-row phone header (logo, then Enter Code, then Login), which took 140–190px of a phone
   screen. :is(body,.home-page,.pricing-page) lifts the rules above homepage.css's short-screen header layout. Kept at
   the end of the file so the cascade is the same as the approved mock-up's. */
@media (max-width:600px), (orientation:landscape) and (max-height:500px) {
  :is(body,.home-page,.pricing-page) .site-header .header-inner { grid-template-columns:minmax(0,1fr) auto auto; column-gap:10px; row-gap:0; min-height:0; padding:8px 16px; }
  :is(body,.home-page,.pricing-page) .site-header .brand-lockup { grid-column:1; grid-row:1; gap:9px; min-height:44px; font-size:1rem; }
  :is(body,.home-page,.pricing-page) .site-header .brand-lockup img { width:36px; height:36px; }
  :is(body,.home-page,.pricing-page) .site-header .site-play-link { grid-column:2; grid-row:1; justify-self:end; display:inline-flex; align-items:center; min-height:44px; padding:0 14px; font-size:.9rem; }
  :is(body,.home-page,.pricing-page) .site-header .site-nav { grid-column:3; grid-row:1; justify-self:end; width:auto; max-width:none; margin:0; flex-wrap:nowrap; }
  .site-header .site-nav a { display:inline-flex; align-items:center; min-height:44px; font-size:.9rem; }
  .site-header .ems-profile-menu summary { box-sizing:border-box; min-height:44px; }
  /* The space kept for the account link before it arrives is the label the link will actually show ("Login" while
     sign-up links are hidden), so on one row the logo never wraps and then jumps back (an 8px shift otherwise). */
  .site-header .site-nav:not(.ems-account-nav)::after { content:"Login"; font-size:.9rem; }
  html[data-ems-signup-links="true"] .site-header .site-nav:not(.ems-account-nav)::after { content:"Login / Sign up"; }
}
@media (min-width:380px) and (max-width:400px) {
  /* Reserve the full account control before its module arrives. Linux's wider font otherwise
     squeezes the brand into another line when Account replaces the initial Login space. */
  .site-header .header-inner { column-gap:6px; padding-inline:12px; }
  .site-header .site-nav { min-width:92px; }
  .site-header .ems-profile-menu summary { padding-inline:6px; }
  .site-header .site-play-link { padding-inline:4px; }
}
