/* (c) 2026 Mohammad Ali Akeel
   The language switch's dropdown: all of its appearance. Behaviour is in agentry-zh.js.
   22 Oct 2026: the 中文 | EN pill became a native <select>; the places and the colours
   below are the pill's, carried over unchanged.

   Where it sits, chosen so it covers nothing (checked in a headed browser, 22 Oct 2026):
   - Public site: bottom-right, as in RAIDT-Studio. Nothing else is fixed there.
   - Console and sign-in pages (body[data-page-key]), wide: in the topbar, centred in the
     empty gap between the brand and the organisation name. Bottom-right is the
     assistant's composer and launcher, and bottom-left holds "Viewing as" and Settings.
   - Console below 1050px, where the sidebar leaves the screen and the topbar is full:
     bottom-left, opposite the assistant's launcher. The sign-in pages keep the topbar
     place at every width, because their topbar holds only the brand.
   The list itself is drawn by the browser, so it is never clipped by the page.

   Colours read the host's own tokens, with RAIDT-Studio's values as the fallback.
   NOT PORTED: the dark-scheme colours of raidt-zh.js - both Agentry surfaces are
   light-only (the console declares color-scheme: light), so a dark control would sit on a
   light page. The control paints its own ground, so one palette is complete. */

.ag-zh {
  position: fixed;
  /* Above the topbar (40) and the public header (30); below the console's mobile
     sidebar and its scrim (44, 45), so an open menu is never covered. */
  z-index: 43;
  right: 14px;
  bottom: 14px;
  font: 13px/1.3 system-ui, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

/* The closed control looks as the pill did: the chosen language in the accent colour,
   bold, on the pill's ground, border and shadow. */
.ag-zh-select {
  display: block;
  margin: 0;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line, #cfd6e4);
  border-radius: 999px;
  background: var(--panel, #fff);
  color: var(--accent, #582c83);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ag-zh-select:focus-visible {
  outline: 3px solid var(--focus, #9a5200);
  outline-offset: 2px;
}

.ag-zh-select option {
  background: var(--panel, #fff);
  color: var(--ink, #1d2a44);
  font-weight: 400;
}

body[data-page-key] .ag-zh {
  top: calc((var(--header-height, 52px) - 32px) / 2);
  right: auto;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
}

body[data-page-key] .ag-zh-select {
  box-shadow: none;
}

@media (max-width: 1050px) {
  body[data-page-key]:not(.signin-page) .ag-zh {
    top: auto;
    right: auto;
    bottom: var(--edge-inset, 14px);
    left: var(--edge-inset, 14px);
    transform: none;
  }

  body[data-page-key]:not(.signin-page) .ag-zh-select {
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  }
}

/* While the page is in Chinese, a table cell breaks only where the English did - at a
   space or a punctuation mark. Chinese may otherwise break between any two characters,
   and a narrow column then stacks a badge such as 已定义 one character per line, where
   "defined" never broke. Only applies in Chinese; English pages are untouched.
   22 Oct 2026, with the sentences translated, keep-all had to go: a whole Chinese sentence in a
   cell then had nowhere to break and pushed the table, and the page, sideways. Instead a console
   cell is never narrower than three Chinese characters, so a short value (已定义, 受限) stays on
   one line as "defined" did, and a sentence wraps as Chinese does. The stage chip and status
   label never wrap; a verdict may hold a sentence ("Gate into defined: 3 of 3 rules passed"), so it wraps. */
:root[lang="zh-CN"] body[data-page-key] th,
:root[lang="zh-CN"] body[data-page-key] td {
  min-width: 3em;
}
:root[lang="zh-CN"] body[data-page-key] :is(.stage-chip, .status-label) {
  white-space: nowrap;
}
/* a verdict breaks at its spaces and punctuation only: 已挂起 stays whole, a sentence still wraps */
:root[lang="zh-CN"] body[data-page-key] .verdict {
  word-break: keep-all;
}
