/* PLATFORM-OWNED corrections to the copied desk stylesheet.
 *
 * `mm-sim.css` is the same text as the trading-sims repo's and is never
 * edited here (`MANIFEST.json`, `scripts/resync_mmgame.py`). It is written
 * for a page where the simulation is the whole application. This page is
 * one module among many, so a few of its rules reach further here than
 * they do there. This file is loaded after it, only while the desk is on
 * screen, and says what those rules mean on a shared page.
 *
 * Design record: OneDrive/EduMarkets/docs/multiplayer sims/mm-sim/design/
 * mm-sim-single-player-design-2026-09.md, section 3.5.
 *
 * NOT corrected, deliberately: the root `color-scheme` pair. This page
 * declares `dark light` in its meta and drives `[data-theme]` the same way
 * the simulation does, and the platform's own stylesheets declare no root
 * colour scheme at all, so the copied pair is right here and fixes the
 * same thing it fixes there (a dark-OS machine drawing dark checkboxes on
 * the light theme). */

/* ── What the platform's own chrome reads ───────────────────────────────
 * The copied sheet narrows the sidebar to 260px on `:root`, deliberately,
 * so that the header lockup beside it lines up. Here that variable is the
 * platform's own: `components.css` sizes every module's sidebar and the
 * header gutter from it. The simulation is the only module that asked for
 * 260, so it takes it on the workspace, where the desk's own sidebar
 * inherits it, and the platform keeps its 340 everywhere else.
 *
 * The desk's sidebar and the platform's header gutter are then a different
 * width from each other, which on the simulation's own page they are not.
 * Left as it is until the owner's browser round says which of the two
 * should move. */
:root { --sidebar-width: 340px; }
#market-making-workspace { --sidebar-width: 260px; }

/* The header lockup carries ONE simulation's name on the copied sheet's own
 * page and is sized for it there. Here it is the platform's masterbrand and
 * sits beside the module tabs, which are sized against it. The platform's
 * own two values, restated (`components.css`, the rule whose comment does
 * the alignment arithmetic). */
.header-logo-mount .lockup-led {
  --led-wm-size: 16px;
  --led-name-size: 22px;
}

/* ── The attribute that hides a thing ───────────────────────────────────
 * `[hidden]` is an attribute and a class that sets `display` beats it.
 * The simulation's own `base.css` answers that once for its whole page;
 * this repo answers it per selector instead, about twenty times over, and
 * the copied desk hides a great many elements this way. So the desk's
 * floor-sound panel and its hint both stood on screen with nothing to
 * hide them (owner report, 2026-09-18, the first render).
 *
 * The same one line, and unscoped on purpose: this file is on the page
 * only while the desk is, so the rule lasts exactly as long as the desk
 * that needs it. Nothing here shows an element carrying the attribute. */
[hidden] { display: none !important; }

/* ── The sidebar footer ─────────────────────────────────────────────────
 * The copied desk's footer wears `.disclaimer-footer`, which every app in
 * the simulation's own service styles from one shared stylesheet this page
 * does not load, so the copyright line and its Disclaimer button rendered
 * as a bare paragraph and a bare button (owner report, 2026-09-18).
 *
 * Written against the PLATFORM's own sidebar disclaimer rather than copied
 * from theirs: it is this page's footer, so it reads in this page's tokens
 * and at the size every other module's footer reads at. The button is an
 * inline link inside the line, which is the one thing both designs agree
 * on and the reason it is a button at all. */
#market-making-workspace .disclaimer-footer {
  /* The SIMULATION's own size, not this page's caption size, which reads
     a step and a half larger and made the footer heavier than the same
     footer in the multiplayer (owner, 2026-09-18). The desk beside it is
     the same desk, so its footer reads the same. Declared as a property
     rather than typed into the rule, so the one number this file invents
     says where it came from. */
  --mkm-disclaimer-size: 0.75rem;   /* 12px, chrome.css in the sims */
  font-size: var(--mkm-disclaimer-size);
  line-height: 1.4;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  /* NO padding under it. What holds the text off the bottom of the column
     is the sidebar's own 20px inset, which is the same number in both
     products; a bottom padding here was added to that and sat the footer
     higher than the one beside it (owner, 2026-09-18). */
  padding: 12px 16px 0;
}
#market-making-workspace .footer-disclaimer {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
#market-making-workspace .footer-disclaimer:hover { color: var(--text); }

/* ── Rules the copied sheet writes for a page it owns ───────────────────
 * Each is right for the desk and wrong for the module beside it, so each
 * is put back for everything outside the workspace. The desk keeps them
 * through the copied sheet's own rules, which are scoped to the workspace
 * already or are `mkm-` prefixed and reach nothing else.
 *
 * `.num` means a number on the simulation's page, which is what puts the
 * monospace face on a reading outside a table. The platform's own rule is
 * a data table's cells, and its handbooks, tools and pricers are written
 * against that. */
body:not(:has(#market-making-workspace)) .num:not(th) {
  font-family: inherit;
  font-variant-numeric: normal;
}

/* The desk squares the corners of every table wrap and drops the coloured
 * bar the platform paints down the left edge of a hovered row. Both are
 * the simulation's own look. */
body:not(:has(#market-making-workspace)) .data-table-wrap {
  border-radius: var(--r-lg);
}

/* ── What the two pages DO share ────────────────────────────────────────
 * `#module-mount` is the element every module renders into here, and the
 * simulation's own page body there. The copied sheet makes it a
 * full-height flex column so the desk fills the viewport under the
 * header, and this page is built the same way: `.app-wrapper` is a flex
 * column of at least the viewport's height in both repos, and the mount
 * is its child. So the copied rule is followed rather than put back, and
 * it is on the page only while the desk is.
 *
 * Overriding it was the first render's unused strip along the bottom of
 * the screen (owner report, 2026-09-18): the height stopped at the mount
 * and never reached the workspace, so every panel ended short.
 *
 * The simulation's page has one header of its own with its own controls.
 * Here the header is the platform's, and these ids and classes belong to
 * elements that do not exist, so the rules reach nothing. They are listed
 * rather than removed because a resync must not have to think about them:
 * #mm-header-controls, .mm-header-name, .mm-header-conn, .join-screen,
 * .status-dot. The one that WOULD reach something is the theme toggle,
 * which the copied sheet scopes to #mm-header-controls, so it does not. */

/* ── The session controls ───────────────────────────────────────────────
 * The slot the copied desk's sidebar leaves for a host page. In a room of
 * one that host is this platform, and what it puts there is Start, Pause
 * and End. The buttons take the width of their own words (owner,
 * 2026-09-18): they are read once at the top of a session and once at the
 * end, unlike the two reference buttons below the readings, which take
 * half the column each because a participant goes looking for them. */
#market-making-workspace .mkm-sb-session-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* ── What the desk's own covers may paint over ──────────────────────────
 * On the simulation's own page the desk IS the page, so the hold over it
 * and the desk's own modal shell sit at the top of everything. Here the
 * platform's chrome is above the desk: the module catalogue, the command
 * palette and the dialogs all open over it, and a paused session painted
 * its own cover over the catalogue (owner report, 2026-09-18).
 *
 * The hold is already confined to the desk panel by the copied sheet
 * (`#tab-desk` is positioned and `#mkm-hold` is absolute inside it), so
 * only the stacking is wrong. It needs to be above what the panel holds
 * and below everything the platform opens, which is `--z-overlay` (500)
 * and up. The desk's own dialogs are appended to the body at `--z-max`
 * and still open over it.
 *
 * `.modal-overlay` at 10,000 is the same thing for the shell the copied
 * desk's calendar and shortcut dialogs use. */
#market-making-workspace .pause-overlay { z-index: var(--z-sticky); }
.modal-overlay { z-index: var(--z-max); }

/* ── The walkthrough mode ───────────────────────────────────────────────
 * A walkthrough runs on a preview session frozen at the first tick.
 * The desk mounts the same way it does for a live session; the shell
 * puts `.mkm-walkthrough-mode` on the workspace root and this rule
 * takes the hold overlay off (the copied desk paints it while the
 * server's state is still `lobby` between the initial snapshot and
 * the warmup response) and stops the desk area from taking clicks
 * under the tour tooltip. The sidebar sits outside the workspace
 * content and keeps its own clicks, so the Close walkthrough button
 * still works.
 *
 * The walkthrough's tooltip appends to `document.body`, above the
 * workspace's stacking context, so it takes clicks the desk cannot. */
.mkm-walkthrough-mode #mkm-hold { display: none; }
.mkm-walkthrough-mode .workspace-content { pointer-events: none; }
