/* The web client's styles, all scoped to .calcu-client so a host page's
   own styles and this client's don't meet. Colours and the panels' and
   the bar's sizes are the product's chrome (app/SharpChrome): the desktop
   app's look, light or dark with the system. */

.calcu-client {
  /* The colours and sizes are the product's chrome (app/SharpChrome, the
     Qt6 app's look), set on this element by CalcU1600 from the engine's
     answer, light or dark with the system; until it came, these neutral
     system colours for the product's own names (the common ones are the
     library's, shell.css). */
  --calcu-control-pressed: ButtonFace;
  --calcu-accent: Highlight;
  --calcu-accent-text: HighlightText;

  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--calcu-window);
  color: var(--calcu-text);
  font: 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.calcu-client *,
.calcu-client *::before,
.calcu-client *::after { box-sizing: border-box; }

/* ── Control bar (its layout is the library's, shell.css; the disk
   control's buttons media.css) ───────────────────────────────────── */
/* The places in the look of the bar's buttons, pressed while plugged. */
.calcu-client .calcu-controlbar .calcu-shell-place {
  height: 22px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: var(--calcu-control);
  color: inherit;
  font: inherit;
  cursor: default;
}
.calcu-client .calcu-controlbar .calcu-shell-place:hover { background: var(--calcu-control-hover); }
.calcu-client .calcu-controlbar .calcu-shell-place:active,
.calcu-client .calcu-controlbar .calcu-shell-place.calcu-shell-plugged { background: var(--calcu-control-pressed); box-shadow: none; }
.calcu-client .calcu-controlbar .calcu-shell-place[aria-disabled="true"] { color: var(--calcu-text-dim); }
/* The slot pickers: one fixed width, the longest module ID ("CE-1600M"),
   whatever they show; the list keeps the full names. */
.calcu-client .calcu-shell-slot .calcu-media-picker { width: var(--calcu-slot-picker-width, auto); max-width: none; }

/* ── The product's panels in the library's row (panels.css) ────────── */
.calcu-client .calcu-panels .calcu-printer { flex: 1 1 0; }
.calcu-client .calcu-panel.calcu-printer .calcu-printer-output { white-space: pre-wrap; }
.calcu-client .calcu-printer-serial { flex: none; padding: 4px 8px; font-size: 11px; opacity: 0.7; border-bottom: 1px solid var(--calcu-output-border); }

/* The fixed-width font of every Web client: JetBrains Mono NL
   (vendor/jetbrains-mono, SIL OFL 1.1), served from the client's own
   fonts/ beside calc.css and precached by its service worker; never loaded
   from another server. Tables, paper and listings line up the same in every
   browser. */
@font-face { font-family: "Calc-U Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/JetBrainsMonoNL-Regular.woff2") format("woff2"); }
@font-face { font-family: "Calc-U Mono"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/JetBrainsMonoNL-Bold.woff2") format("woff2"); }
.calcu-client { --calcu-mono: "Calc-U Mono", ui-monospace, Menlo, Consolas, monospace; }

/* The paper panel of the React component set: every selector inside
   .calcu-client (build/dist.js checks it). No scroll bar is drawn: the paper
   scrolls with the wheel or by touch. */
/* Without a printer: a hint where the paper would start, on the paper. */
.calcu-client .calcu-paper-hint { margin: 12px 8px 0; text-align: center; color: var(--calcu-paper-text); opacity: 0.6; }
.calcu-client .calcu-paper-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--calcu-window);
  color: var(--calcu-text);
}
/* Header: the place controls left, the owner's name centred, the view
   control right; below the paper one row that never wraps: the owner's
   controls left, Copy and Cut right. Each cell keeps its place whatever
   the others hold. */
.calcu-client .calcu-paper-header {
  flex: none;   /* a short panel shrinks the paper, never the header */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  min-height: 24px;
}
.calcu-client .calcu-paper-places { display: inline-flex; gap: 4px; justify-self: start; }
/* A place control on the paper (Calc-U-59's PC-100C) carries the dot of
   every GUI: the product chrome's plugged colour while it is plugged in,
   its unplugged colour otherwise. */
.calcu-client .calcu-paper-places .calcu-shell-place::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--calcu-unplugged);
  vertical-align: middle;
}
.calcu-client .calcu-paper-places .calcu-shell-place.calcu-shell-plugged::after { background: var(--calcu-plugged); }
.calcu-client .calcu-paper-owner { font-weight: 600; white-space: nowrap; }
.calcu-client .calcu-paper-owner[data-connected="false"] { color: var(--calcu-paper-owner-off); }
.calcu-client .calcu-paper-views { display: inline-flex; gap: 4px; justify-self: end; }
/* The paper's own window: the panel over the whole window. */
.calcu-client.calcu-paper-window {
  position: fixed;
  inset: 0;
  display: flex;
  box-sizing: border-box;
  background: var(--calcu-window);
}
.calcu-client.calcu-paper-window > * { flex: 1; min-width: 0; min-height: 0; }
.calcu-client .calcu-paper-footer {
  flex: none;   /* nor the control row */
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--calcu-paper-row-gap, 12px);
  padding: 2px var(--calcu-paper-row-gap, 12px);
  min-height: 24px;
  white-space: nowrap;
}
/* The narrow row (calcuShellPaperRowCompact): the short labels, the
   chrome's tighter gap. */
.calcu-client .calcu-paper-compact .calcu-paper-footer {
  gap: var(--calcu-paper-row-compact-gap, 6px);
  padding: 2px var(--calcu-paper-row-compact-gap, 6px);
}
.calcu-client .calcu-paper-actions { display: inline-flex; gap: inherit; margin-left: auto; }
.calcu-client .calcu-paper-action { display: inline-flex; align-items: center; justify-content: center; }
.calcu-client .calcu-paper-icon { display: block; }
.calcu-client .calcu-paper-control.calcu-paper-down { box-shadow: inset 0 1px 3px var(--calcu-shadow); background: var(--calcu-pill-pressed); }
/* A switch shows its position by its dot, as the place controls: the
   chrome's plugged colour while on, its unplugged colour while off. */
.calcu-client .calcu-paper-switch { display: inline-flex; align-items: center; gap: 4px; }
.calcu-client .calcu-paper-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--calcu-unplugged);
}
.calcu-client .calcu-paper-dot.calcu-paper-dot-on { background: var(--calcu-plugged); }
.calcu-client .calcu-paper-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--calcu-paper);
  touch-action: pan-y;
  position: relative;
}
.calcu-client .calcu-paper-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.calcu-client .calcu-paper-sheet { position: relative; overflow: hidden; }
.calcu-client .calcu-paper-canvas { position: absolute; left: 0; display: block; }
.calcu-client .calcu-paper-text {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 8px;
  overflow: auto;
  background: var(--calcu-paper);
  color: var(--calcu-paper-text);
  font-family: var(--calcu-mono);
  user-select: text;
  -webkit-user-select: text;
  white-space: pre;
}
.calcu-client .calcu-paper-toast {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--calcu-menu-text);
  color: var(--calcu-menu);
  pointer-events: none;
}

/* The media components of the React component set: every selector inside
   .calcu-client (build/dist.js checks it). */
.calcu-client .calcu-media-picker { max-width: 16em; }
/* A picker that shows its short text closed: the select over it, unseen. */
.calcu-client .calcu-picker-short { position: relative; display: inline-flex; align-items: center; }
.calcu-client .calcu-picker-short > .calcu-media-picker {
  position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; cursor: pointer;
}
.calcu-client .calcu-media-dialog {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  min-width: 18em;
}
.calcu-client .calcu-media-row { display: flex; align-items: center; gap: 6px; }
.calcu-client .calcu-media-buttons { display: flex; justify-content: flex-end; gap: 6px; }
.calcu-client .calcu-media-problem { color: var(--calcu-alert); }
.calcu-client .calcu-media-table { border-collapse: collapse; }
.calcu-client .calcu-media-table td { padding: 2px 6px; }
.calcu-client .calcu-media-none { font-style: italic; }
/* Inside a modal (ShellModal) the modal gives the room around it. */
.calcu-client .calcu-shell-modal-body > .calcu-media-dialog { padding: 0; min-width: 0; }

/* A drive's lamp (ShellDiskControl): green while the drive works. */
.calcu-client .calcu-lamp { flex: none; width: 14px; text-align: center; color: var(--calcu-lamp-off); }
.calcu-client .calcu-lamp.on { color: var(--calcu-lamp-on); }

/* The tape counter (ShellTapeControl): as wide as its widest text, in the
   lamp's colour while the motor runs, dimmed without a cassette. */
.calcu-client .calcu-tape-counter { flex: none; width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; }
.calcu-client .calcu-tape-counter.on { color: var(--calcu-lamp-on); }
.calcu-client .calcu-tape-counter.empty { color: var(--calcu-text-dim); }

/* The disk control's and the slot picker's row (ShellMedia.jsx): a fieldset
   without its frame, the side button, Name & Save with its glyph. */
.calcu-client .calcu-bar-fieldset {
  display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0;
}
.calcu-client .calcu-bar-label { flex: none; }
.calcu-client .calcu-bar-fieldset .calcu-button,
.calcu-client .calcu-bar-fieldset .calcu-iconbutton {
  height: 22px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: var(--calcu-control);
  color: inherit;
  font: inherit;
  cursor: default;
}
.calcu-client .calcu-bar-fieldset .calcu-button:hover:not(:disabled),
.calcu-client .calcu-bar-fieldset .calcu-iconbutton:hover:not(:disabled) { background: var(--calcu-control-hover); }
.calcu-client .calcu-bar-fieldset .calcu-button:active:not(:disabled),
.calcu-client .calcu-bar-fieldset .calcu-iconbutton:active:not(:disabled) { background: var(--calcu-control-pressed, var(--calcu-control-hover)); box-shadow: none; }
.calcu-client .calcu-bar-fieldset .calcu-button:disabled,
.calcu-client .calcu-bar-fieldset .calcu-iconbutton:disabled { color: var(--calcu-text-dim); }
.calcu-client .calcu-bar-fieldset .calcu-iconbutton:disabled .calcu-save-icon { opacity: 0.4; }
.calcu-client .calcu-bar-fieldset .calcu-iconbutton { width: 33px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.calcu-client .calcu-bar-fieldset .calcu-compact { width: 26px; padding: 0; }
.calcu-client .calcu-bar-fieldset .calcu-save-icon { width: 16px; height: 16px; }

/* The Sharp products' panel row (Panels.jsx): the INSPECTOR, the paper and
   a product's own panels, side by side below the faceplate. Panels side by
   side line up: every header and every button bar has one height, the
   paper panel's too. The colours and heights are the product's chrome. */
.calcu-client .calcu-panels { flex: 1; min-height: 0; display: flex; gap: var(--calcu-panel-inset, 0); padding: 0 var(--calcu-panel-inset, 0) var(--calcu-panel-inset, 0); }
.calcu-client .calcu-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.calcu-client .calcu-panels .calcu-shell-panels { flex: 1; min-height: 0; gap: var(--calcu-panel-inset, 0); }
.calcu-client .calcu-panels .calcu-inspector,
.calcu-client .calcu-shell-panels > .calcu-inspector { flex: 2 1 0; }
.calcu-client .calcu-panels .calcu-paper { flex: 1 1 0; }
.calcu-client .calcu-panel-header {
  flex: none;
  height: var(--calcu-panel-header-height, auto);
  padding: 6px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--calcu-header);
  color: var(--calcu-header-text);
}
.calcu-client .calcu-panel-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--calcu-output);
  border: 1px solid var(--calcu-output-border);
  border-top: none;
}
.calcu-client .calcu-panel-buttons {
  flex: none;
  height: var(--calcu-panel-buttons-height, auto);
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--calcu-button-bar);
}
/* A panel's text output (the INSPECTOR's, a printer's). */
.calcu-client .calcu-panel .calcu-panel-output {
  flex: 1;
  margin: 0;
  padding: 6px 8px;
  overflow: auto;
  font: var(--calcu-panel-output-size, 11px)/1.35 var(--calcu-mono);
  color: var(--calcu-output-text);
  white-space: pre;
  user-select: text;
  -webkit-user-select: text;
}
/* The pill: the panels' buttons, the paper panel's too. */
.calcu-client .calcu-panel .calcu-pill,
.calcu-client .calcu-panel.calcu-paper .calcu-paper-header button,
.calcu-client .calcu-panel.calcu-paper .calcu-paper-footer button {
  height: var(--calcu-pill-height, auto);
  padding: var(--calcu-pill-padding, 0);
  border: none;
  border-radius: var(--calcu-pill-radius, 0);
  background: var(--calcu-pill);
  color: var(--calcu-pill-text);
  font: inherit;
  font-size: var(--calcu-pill-font-size, inherit);
  font-weight: var(--calcu-pill-font-weight, inherit);
  cursor: default;
}
.calcu-client .calcu-panel .calcu-pill:hover:not(:disabled),
.calcu-client .calcu-panel.calcu-paper .calcu-paper-footer button:hover:not(:disabled) { background: var(--calcu-pill-hover); }
.calcu-client .calcu-panel .calcu-pill:active:not(:disabled),
.calcu-client .calcu-panel.calcu-paper .calcu-paper-footer button:active:not(:disabled),
.calcu-client .calcu-panel.calcu-paper .calcu-paper-control.calcu-paper-down { background: var(--calcu-pill-pressed); }
.calcu-client .calcu-panel .calcu-pill:disabled,
.calcu-client .calcu-panel.calcu-paper .calcu-paper-footer button:disabled { background: var(--calcu-pill-off); color: var(--calcu-pill-text-off); }
/* The paper panel (the library's) in the panels' frame: the header and the
   button bar of the others. */
.calcu-client .calcu-panel.calcu-paper > .calcu-paper-panel { flex: 1; background: var(--calcu-button-bar); color: var(--calcu-text); }
.calcu-client .calcu-panel.calcu-paper .calcu-paper-header {
  height: var(--calcu-panel-header-height, auto); min-height: 0; padding: 0 6px;
  background: var(--calcu-header); color: var(--calcu-header-text); font-size: 12px;
}
.calcu-client .calcu-panel.calcu-paper .calcu-paper-owner { font-weight: 700; }
.calcu-client .calcu-panel.calcu-paper .calcu-paper-scroll,
.calcu-client .calcu-panel.calcu-paper .calcu-paper-text { border: 1px solid var(--calcu-output-border); border-top: none; }
.calcu-client .calcu-panel.calcu-paper .calcu-paper-footer {
  height: var(--calcu-panel-buttons-height, auto); min-height: 0; gap: 8px; padding: 0 10px;
  background: var(--calcu-button-bar);
}
/* The INSPECTOR's bar (Panels.jsx's ShellInspector): the stretch before
   the product's buttons, the Clear icon, the pill menus and their lists,
   which open upwards. */
.calcu-client .calcu-bar-stretch { flex: 1; }
.calcu-client .calcu-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  padding: 5px;
  color: var(--calcu-text);
  background: var(--calcu-menu);
  border: 1px solid var(--calcu-menu-border);
  border-radius: 7px;
  box-shadow: 0 8px 24px var(--calcu-shadow);
  z-index: 30;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.calcu-client .calcu-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  padding: 3px 8px 3px 20px;
  border-radius: 4px;
  white-space: nowrap;
  cursor: default;
}
.calcu-client .calcu-menu-item:hover:not(.disabled) { background: var(--calcu-menu-hover); color: var(--calcu-accent-text, var(--calcu-menu-hover-text)); }
/* Touch screens: taller rows. */
@media (pointer: coarse) {
  .calcu-client .calcu-menu-item { padding-top: 8px; padding-bottom: 8px; }
}
.calcu-client .calcu-menu-item.disabled { color: var(--calcu-text-dim); }
.calcu-client .calcu-pill-icon { width: 30px; display: inline-flex; align-items: center; justify-content: center; }
.calcu-client .calcu-pill-icon svg { width: 14px; height: 14px; }
.calcu-client .calcu-pill-arrow { font-size: 9px; opacity: 0.7; }
.calcu-client .calcu-pillmenu { position: relative; }
.calcu-client .calcu-pillmenu-list { top: auto; bottom: 100%; margin-bottom: 4px; }

/* The shell of the React component set: every selector inside .calcu-client
   (build/dist.js checks it). Colours are the product's chrome only: the
   common ones (shell::ChromeColours) and shell::shellColourNames(), set on
   the client by calcuChromeStyle; until the engine answers, these neutral
   system colours. */
.calcu-client {
  --calcu-window: Canvas;
  --calcu-text: CanvasText;
  --calcu-text-dim: GrayText;
  --calcu-header: ButtonFace;
  --calcu-header-text: CanvasText;
  --calcu-button-bar: ButtonFace;
  --calcu-pill: ButtonFace;
  --calcu-pill-hover: ButtonFace;
  --calcu-pill-pressed: ButtonFace;
  --calcu-pill-off: ButtonFace;
  --calcu-pill-text: ButtonText;
  --calcu-pill-text-off: GrayText;
  --calcu-output: Canvas;
  --calcu-output-text: CanvasText;
  --calcu-output-border: GrayText;
  --calcu-plugged: Highlight;
  --calcu-unplugged: GrayText;
  --calcu-menu: Canvas;
  --calcu-menu-text: CanvasText;
  --calcu-menu-border: GrayText;
  --calcu-menu-hover: Highlight;
  --calcu-menu-hover-text: HighlightText;
  --calcu-link: LinkText;
  --calcu-scrim: transparent;
  --calcu-shadow: transparent;
  --calcu-alert: CanvasText;
  --calcu-banner: Mark;
  --calcu-banner-text: MarkText;
  --calcu-banner-border: GrayText;
  --calcu-paper: Canvas;
  --calcu-paper-text: CanvasText;
  --calcu-key-pressed: transparent;
  --calcu-control: ButtonFace;
  --calcu-control-hover: ButtonFace;
  --calcu-lamp-off: GrayText;
  --calcu-lamp-on: Highlight;
}
/* The menu bar is as tall as a page counts it (ShellClient's
   CALCU_CLIENT_MENU_HEIGHT, a page's own). */
.calcu-client .calcu-shell-menubar {
  flex: none;
  display: flex;
  height: 26px;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  background: var(--calcu-menu);
  border-bottom: 1px solid var(--calcu-menu-border);
  font: 13px system-ui, sans-serif;
  position: relative;
  z-index: 20;
}
/* The menus, the More popup and the dialogs in the chrome's menu colours,
   whatever the client's text is. */
.calcu-client .calcu-shell-menubar,
.calcu-client .calcu-shell-menu-items,
.calcu-client .calcu-shell-modal { color: var(--calcu-menu-text); }
.calcu-client .calcu-shell-menu { position: relative; }
.calcu-client .calcu-shell-menu-title {
  border: 0;
  background: transparent;
  padding: 3px 8px;
  font: inherit;
  cursor: default;
}
.calcu-client .calcu-shell-open > .calcu-shell-menu-title { background: var(--calcu-menu-hover); color: var(--calcu-menu-hover-text); }
.calcu-client .calcu-shell-menu-items {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--calcu-menu);
  border: 1px solid var(--calcu-menu-border);
  box-shadow: 0 2px 8px var(--calcu-shadow);
  z-index: 30;
}
.calcu-client .calcu-shell-menu-items .calcu-shell-menu-items { top: -5px; left: 100%; }
.calcu-client .calcu-shell-item { position: relative; cursor: default; }
.calcu-client .calcu-shell-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px 3px 4px;
  white-space: nowrap;
}
/* Only the row under the pointer is lit, never the item around an open
   submenu, and only where there is a pointer: a touch screen keeps the
   last tap's hover, which would light whatever slid under it. A menu
   bar's submenu keeps its item lit while it is open beside it. */
@media (hover: hover) {
  .calcu-client .calcu-shell-row:hover,
  .calcu-client .calcu-shell-menu > .calcu-shell-menu-items .calcu-shell-sub-open > .calcu-shell-row {
    background: var(--calcu-menu-hover); color: var(--calcu-menu-hover-text);
  }
}
/* A disabled item dims the menu's own text: the chrome's dim text is for
   its columns, which may be dark where the menu is light. */
.calcu-client .calcu-shell-disabled { color: var(--calcu-menu-text); opacity: 0.4; }
.calcu-client .calcu-shell-disabled > .calcu-shell-row:hover { background: transparent; color: inherit; }
.calcu-client .calcu-shell-check { width: 14px; text-align: center; }
.calcu-client .calcu-shell-label { flex: 1 1 auto; }
/* A menu's name in More: small and dimmed, above its items. */
.calcu-client .calcu-shell-heading { padding: 6px 10px 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; opacity: 0.6; cursor: default; }
.calcu-client .calcu-shell-heading:not(:first-child) { margin-top: 4px; }
.calcu-client .calcu-shell-separator { height: 1px; margin: 4px 0; background: var(--calcu-menu-border); }
.calcu-client .calcu-shell-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font: 13px system-ui, sans-serif;
}
.calcu-client .calcu-shell-bar-group { display: inline-flex; align-items: center; gap: 4px; }
/* The page of a pictured faceplate (ShellClient, the root's
   calcu-shell-client): a column of the menu bar, the faceplate's row and the
   control bar, the shell's bar on one line in its row. */
.calcu-client .calcu-face-row { flex: none; display: flex; justify-content: center; }
.calcu-client.calcu-shell-client .calcu-shell-roms-missing { flex: 1; }
.calcu-client .calcu-controlbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--calcu-bar-gap, 0);
  height: var(--calcu-bar-height, auto);
  padding: 0 11px;
  white-space: nowrap;
  overflow: hidden;
}
.calcu-client .calcu-controlbar > .calcu-shell-bar { flex: 1; flex-wrap: nowrap; padding: 0; gap: 10px; overflow: hidden; }
/* Its pickers and buttons in the desktop app's look: rounded, the control
   colour. :where keeps them below a product's own rules (a slot's picker,
   a picker that shows its short text, the places' pressed look). */
.calcu-client .calcu-controlbar :where(.calcu-shell-picker),
.calcu-client .calcu-controlbar :where(.calcu-media-picker) {
  height: 22px;
  padding: 0 24px 0 9px;
  border: none;
  border-radius: 6px;
  /* The arrow: two half-squares of the chrome's dim text, a caret. */
  background:
    linear-gradient(45deg, transparent 50%, var(--calcu-text-dim) 50%) no-repeat right 12px center / 4px 4px,
    linear-gradient(135deg, var(--calcu-text-dim) 50%, transparent 50%) no-repeat right 8px center / 4px 4px,
    var(--calcu-control);
  color: inherit;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  max-width: 14em;
  text-overflow: ellipsis;
}
.calcu-client .calcu-controlbar :where(.calcu-shell-picker:disabled),
.calcu-client .calcu-controlbar :where(.calcu-media-picker:disabled) { color: var(--calcu-text-dim); opacity: 0.7; }
.calcu-client .calcu-controlbar :where(.calcu-shell-action) {
  height: 22px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: var(--calcu-control);
  color: inherit;
  font: inherit;
  cursor: default;
}
.calcu-client .calcu-controlbar :where(.calcu-shell-action:hover) { background: var(--calcu-control-hover); }
.calcu-client .calcu-controlbar :where(.calcu-shell-action[aria-disabled="true"]) { color: var(--calcu-text-dim); }
/* Touch screens: a taller menu bar (iOS Safari takes a tap at the very top
   of the page to bring back its toolbar, so a 26 px bar is nearly
   untappable there; this one has a lower part Safari leaves to the page). */
@media (pointer: coarse) {
  .calcu-client.calcu-shell-client .calcu-shell-menubar,
  .calcu-client.calcu-shell-client .calcu-shell-menu-title { height: 40px; }
}
.calcu-client .calcu-shell-slot { display: inline-flex; align-items: center; gap: 2px; }
.calcu-client .calcu-shell-place.calcu-shell-plugged { box-shadow: inset 0 1px 3px var(--calcu-shadow); background: var(--calcu-pill-pressed); }
.calcu-client .calcu-shell-place[aria-disabled="true"] { color: var(--calcu-text-dim); }
.calcu-client .calcu-shell-panels { display: flex; min-height: 0; }
.calcu-client .calcu-shell-panels > * { flex: 1 1 0; min-width: 0; }
.calcu-client .calcu-shell-modal-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--calcu-scrim);
  z-index: 50;
}
/* Every dialog of both products: the shell's and the products' own. */
.calcu-client .calcu-shell-modal {
  display: flex;
  flex-direction: column;
  min-width: min(300px, 90%);
  max-width: min(560px, 90%);
  max-height: 90%;
  padding: 14px 18px;
  background: var(--calcu-menu);
  border: 1px solid var(--calcu-menu-border);
  border-radius: 10px;
  box-shadow: 0 10px 32px var(--calcu-shadow);
  font: 13px system-ui, sans-serif;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.calcu-client .calcu-shell-modal-title { flex: none; font-weight: 600; margin-bottom: 10px; }
.calcu-client .calcu-shell-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}
.calcu-client .calcu-shell-modal-body p { margin: 0; }
.calcu-client .calcu-shell-modal-body small { opacity: 0.7; }
.calcu-client .calcu-shell-modal-body a { color: var(--calcu-link); }
.calcu-client .calcu-shell-modal-body tt { font-family: var(--calcu-mono); }
.calcu-client .calcu-shell-notice-text { white-space: pre-wrap; }
/* About's Support Information: set off from the links, selectable. */
.calcu-client .calcu-shell-about-section { margin-top: 1em; user-select: text; -webkit-user-select: text; }
.calcu-client .calcu-shell-problem { color: var(--calcu-alert); }
.calcu-client .calcu-shell-modal-buttons { flex: none; display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
/* The buttons, fields and pickers in a dialog: the menu's colours, the
   default button (calcu-shell-default) in the highlighted item's. */
.calcu-client .calcu-shell-modal-buttons button,
.calcu-client .calcu-shell-modal .calcu-media-buttons button,
.calcu-client .calcu-shell-modal input[type=text],
.calcu-client .calcu-shell-modal input[type=number],
.calcu-client .calcu-shell-modal input:not([type]),
.calcu-client .calcu-shell-modal select {
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--calcu-menu-border);
  border-radius: 6px;
  background: var(--calcu-menu);
  color: var(--calcu-menu-text);
  font: inherit;
}
.calcu-client .calcu-shell-modal-buttons button,
.calcu-client .calcu-shell-modal .calcu-media-buttons button { min-width: 72px; padding: 0 12px; cursor: pointer; }
.calcu-client .calcu-shell-modal .calcu-shell-default:not(:disabled) {
  border-color: transparent;
  background: var(--calcu-menu-hover);
  color: var(--calcu-menu-hover-text);
}
/* A button held down looks pressed: in the highlighted item's colours, the
   default button (already in them) darker. */
.calcu-client .calcu-shell-modal-buttons button:active:not(:disabled),
.calcu-client .calcu-shell-modal .calcu-media-buttons button:active:not(:disabled) {
  background: var(--calcu-menu-hover);
  color: var(--calcu-menu-hover-text);
}
.calcu-client .calcu-shell-modal .calcu-shell-default:active:not(:disabled) { filter: brightness(0.85); }
.calcu-client .calcu-shell-modal .calcu-shell-default.calcu-shell-destructive:not(:disabled) {
  background: var(--calcu-alert);
  color: var(--calcu-menu);
}
.calcu-client .calcu-shell-modal button:disabled { opacity: 0.4; cursor: default; }
.calcu-client .calcu-shell-modal select { min-width: 0; max-width: 100%; }
.calcu-client .calcu-shell-modal input[type=text],
.calcu-client .calcu-shell-modal input:not([type]) { flex: 1 1 auto; min-width: 0; }
.calcu-client .calcu-shell-section { margin: 0; min-width: 0; border: 1px solid var(--calcu-menu-border); }
.calcu-client .calcu-shell-setting { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.calcu-client .calcu-shell-setting-label { min-width: 160px; }
.calcu-client .calcu-shell-slider { display: flex; align-items: center; gap: 8px; flex: 1; }
.calcu-client .calcu-shell-slider input { flex: 1; }
.calcu-client .calcu-shell-slider-value { min-width: 3ch; text-align: right; }
.calcu-client .calcu-shell-folder { display: inline-flex; align-items: center; gap: 6px; }
.calcu-client .calcu-shell-loading {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--calcu-menu);
  color: var(--calcu-menu-text);
  border-radius: 4px;
  box-shadow: 0 1px 4px var(--calcu-shadow);
  pointer-events: none;
  z-index: 40;
  font: 13px system-ui, sans-serif;
}
.calcu-client .calcu-shell-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--calcu-text-dim);
  border-top-color: transparent;
  border-radius: 50%;
  animation: calcu-shell-spin 0.8s linear infinite;
}
@keyframes calcu-shell-spin { to { transform: rotate(360deg); } }
/* The lines left-aligned as the text has them, indents kept. */
.calcu-client .calcu-shell-roms-missing { padding: 24px; white-space: pre-wrap; text-align: left; }

/* The bar's actions and the More button of
   a window without a menu bar, its popup inside the client (submenus open
   inline, as a narrow portrait has no room beside), the storage banner. */
.calcu-client .calcu-shell-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
}
.calcu-client .calcu-shell-action[aria-disabled="true"] { color: var(--calcu-text-dim); }
.calcu-client .calcu-shell-action-icon { font-size: 15px; line-height: 1; }
.calcu-client .calcu-shell-more { display: inline-flex; }
.calcu-client .calcu-shell-more-popup {
  position: fixed;
  z-index: 30;
  overflow-y: auto;
  overscroll-behavior: contain;   /* scrolling the menu leaves the page */
  touch-action: pan-y;
}
.calcu-client .calcu-shell-more-popup > .calcu-shell-menu-items { position: static; min-width: 180px; }
.calcu-client .calcu-shell-more-popup .calcu-shell-row { white-space: normal; }
.calcu-client .calcu-shell-more-popup .calcu-shell-menu-items .calcu-shell-menu-items {
  position: static;
  min-width: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0 0 0 12px;
}
/* The More popup with every submenu open, unseen, unwrapped: its width is
   the popup's. */
.calcu-client .calcu-shell-more-sizer {
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  width: max-content;
  overflow: visible;
}
.calcu-client .calcu-shell-more-sizer .calcu-shell-row { white-space: nowrap; }
.calcu-client .calcu-shell-destructive { color: var(--calcu-alert); }
.calcu-client .calcu-shell-storage-banner {
  flex: none;
  padding: 5px 12px;
  background: var(--calcu-banner);
  color: var(--calcu-banner-text);
  border-bottom: 1px solid var(--calcu-banner-border);
  font: 12px system-ui, sans-serif;
}
/* A group the bar model pushes (a spread bar: the media group, End). */
.calcu-client .calcu-shell-bar-group.calcu-shell-pushed { margin-left: auto; }
/* A compact bar keeps its labels unseen and out of the flow (measurable). */
.calcu-client .calcu-shell-compact .calcu-bar-label { position: absolute; visibility: hidden; pointer-events: none; }
/* A droppable control (the model picker, a place's) wraps nothing of its
   own; one the bar leaves out, and a group left without a control, is
   unseen and out of the flow, measurable (useShellBarFit). */
.calcu-client .calcu-bar-droppable { display: inline-flex; align-items: center; }
.calcu-client .calcu-shell-bar { position: relative; }
.calcu-client .calcu-bar-dropped { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
/* A faceplate drawn from a picture (ShellFaceplate): the art, the LCD over
   it, transparent key buttons that take no pointer (the faceplate's); a held
   key in the chrome's key-pressed colour. */
.calcu-client .calcu-shell-face { position: relative; touch-action: none; cursor: default; }
.calcu-client .calcu-shell-face .calcu-face-art { position: absolute; left: 0; top: 0; }
.calcu-client .calcu-shell-face .calcu-lcd { position: absolute; }
.calcu-client .calcu-shell-face .calcu-key {
  position: absolute;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  pointer-events: none;
}
.calcu-client .calcu-shell-face .calcu-key[aria-pressed="true"] { background: var(--calcu-key-pressed); }
