/* The Commands page (pages/world/commands.py): groups by purpose, a row a command, the menu it opens drawn beside it, a finder.
   Tokens only (BRAND.md). Commands are the one place mono is allowed: a small code pill. No table, no box round the list.
   The canvas of a menu title is the game's own (static/world/commands.js); until it is drawn, or without art, the title stands as plain text in a chip. */

/* ---- the finder ---- */
.cx-find { max-width: 640px; margin: var(--sp-5) 0 var(--sp-2); }
.cx-find-l { display: block; margin: 0 0 var(--sp-2); font: 600 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.cx-find-box { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding-left: var(--sp-4); color: var(--text-3);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius-sm); }
.cx-find-box:hover { border-color: var(--control-border-hover); }
.cx-find-box:has(.cx-q:focus-visible) { outline: 2px solid var(--ember); outline-offset: 2px; }
.cx-q { flex: 1; min-width: 0; height: 46px; min-height: 44px; margin: 0; padding: 0 var(--sp-4) 0 0; font: 400 16px/1.4 var(--sans); color: var(--text);
  background: transparent; border: 0; border-radius: var(--radius-sm); -webkit-appearance: none; appearance: none; }
.cx-q:focus, .cx-q:focus-visible { outline: none; }
.cx-q::placeholder { color: var(--text-3); }
.cx-none { margin: var(--sp-3) 0 0; color: var(--text-2); }

/* ---- a group: one plain sentence under the heading, then its commands ---- */
.cx-list { list-style: none; margin: var(--sp-3) 0 var(--sp-4); padding: 0; }
.cx-row { display: grid; grid-template-columns: minmax(168px, 200px) minmax(0, 1fr); gap: var(--sp-2) var(--sp-5); align-items: start;
  padding: 14px 0; margin: 0; max-width: none; border-top: 1px solid var(--border); }
.cx-row:last-child { border-bottom: 1px solid var(--border); }
.cx-row[hidden], .c-sec[hidden], .cx-none[hidden] { display: none; }
.cx-cmd { justify-self: start; max-width: 100%; overflow-wrap: anywhere; font: 500 15px/1.5 var(--mono); color: var(--ember-soft); background: var(--surface-2);
  border-radius: 8px; padding: 2px 10px; scroll-margin-top: calc(var(--header) + 12px); }
.cx-row:target .cx-cmd { outline: 2px solid var(--ember); outline-offset: 2px; }
.cx-body { min-width: 0; }
.cx-body p { margin: 0; max-width: var(--read); }
.cx-what { color: var(--text); }
.cx-note { margin-top: 4px; font-size: 15px; color: var(--text-2); }
.cx-see { margin-top: 4px; font-size: 15px; color: var(--text-3); }
.cx-note code { font-size: 14px; }

/* ---- the menu a command opens ---- */
.cx-body .cx-menu { min-width: 0; display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-3) 0 0; }
.cx-opens { font: 600 12px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
/* plain text first: a chip. Once drawn the text is for screen readers only and the canvas (aria-hidden) is the title. */
.cx-title { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.cx-title-t { display: inline-block; font: 500 15px/1.4 var(--sans); color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 3px 10px; }
.cx-title.drawn .cx-title-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; padding: 0; border: 0; }
.cx-title > canvas.cx-canvas { display: block; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none;
  image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; image-rendering: pixelated; }

@media (max-width: 640px) {
  .cx-row { grid-template-columns: minmax(0, 1fr); }
}
