/* The ops console's own CSS: layout and a few data colours, nothing else.
 *
 * Every component on the page (shell, cards, badges, metrics, tables, lists, banners, the sign-in
 * screen) is drawn by @gemboss/ui, vendored in ./ui with a lock. Every rule here is scoped to an
 * `ops-` class of this page and never restyles a package class on its own: tests/test_ops_console.py
 * fails on a rule whose subject is a package class without an `ops-` context, which is how five
 * services ended up with five drifting copies of the same shell (gempress gate_ui_not_copied.py). */

/* The sign-in screen and the shell take turns. Both package roots set `display` (grid / flex), which
   beats the browser's own `[hidden] { display: none }`, so without this both showed at once. */
.ops-root[hidden],
.ops-where[hidden],
.ops-signout[hidden] { display: none !important; }

.ops-live-strip {
  margin: 0;
  padding: 4px 12px 0;
  font-size: var(--ui-fs-caption);
  line-height: 16px;
  color: var(--ui-text-muted);
}
.ops-live-strip[data-state="stale"] { color: var(--gemboss-danger); }

/* A row of things side by side that wraps on a phone: head + actions, badge runs. */
.ops-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ops-row--between { justify-content: space-between; }

/* A URL is the one value on this page that can be longer than its column; break it, never overflow. */
.ops-url {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Monospace for the values an operator copies into a terminal: ids, shas, paths, error text. */
.ops-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.ops-pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 18px;
}

/* The step a running call is on: one muted line under its URL. */
.ops-step {
  display: block;
  color: var(--ui-text-muted);
  font-size: var(--ui-fs-caption);
  line-height: 16px;
  overflow-wrap: anywhere;
}

/* A table cell holding badges wraps them instead of widening the table. */
.ops-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* A short link in a table cell ("curl") still gets a 24px target (WCAG 2.5.8; visual gate). */
.ops-cell-link {
  display: inline-block;
  min-width: 24px;
  min-height: 24px;
  line-height: 24px;
}

/* A list row whose title is a URL or an error: it wraps instead of truncating, because the end of a
   URL or an error message is usually the part that matters. */
.ops-title {
  margin: 0;
  font-weight: 650;
  color: var(--ui-text);
}

/* Settings: a command to copy sits in its own box with the button under it. */
.ops-stack-tight {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.ops-code {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-2, var(--ui-surface));
}
.ops-grow { flex: 1 1 220px; }
.ops-field-label {
  font-size: var(--ui-fs-caption);
  color: var(--ui-text-muted);
}

/* Captures: a page preview is the TOP of a long page, so the 16:10 card crop keeps the top, not the middle. */
.ops-shot-grid .ui-card__media img { object-position: top; }
/* Studio: the studio page in a frame of this origin. ops.js sets its height to what the screen leaves. */
.ops-studio-host[hidden] { display: none !important; }
.ops-studio-frame { display: block; width: 100%; height: 640px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); background: var(--ui-surface); }
/* Captures › Map. The map is as tall as a laptop screen allows, shorter on a phone; the country list sits
   beside it on a wide screen and under it otherwise. */
.ops-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.ops-map-side { display: grid; gap: 24px; min-width: 0; }
@media (max-width: 1100px) { .ops-map-layout { grid-template-columns: minmax(0, 1fr); } }
.ops-map { height: 560px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); overflow: hidden; background: var(--ui-surface-2); }
@media (max-width: 47.9975em) { .ops-map { height: 420px; } }
/* Every target on the map is 44 px: the dot's hit area (the 14 px dot is drawn inside it), each cluster,
   and the zoom buttons, which Leaflet draws at 30 px. */
.ops-map .ops-map-dot { display: flex; align-items: center; justify-content: center; }
.ops-map .ops-map-dot span { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--gemboss-accent, #5661f5); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.ops-map .ops-map-cluster > div { width: 34px; height: 34px; margin-left: 5px; margin-top: 5px; }
.ops-map .ops-map-cluster > div > span { line-height: 34px; }
/* leaflet.css loads after this file and its `.leaflet-touch .leaflet-bar a` (30 px) ties this selector, so
   this one is one class heavier. */
.ops-map.leaflet-container .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
.ops-map .ops-map-pop img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 6px; margin-bottom: 8px; }
.ops-map .ops-map-pop p { margin: 4px 0 0; white-space: normal; overflow-wrap: anywhere; }
.ops-map.leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; font-size: 24px; line-height: 44px; }
.ops-map .ops-map-loading { margin: 0; padding: 16px; }
.ops-map .ops-map-pop a { display: inline-block; min-height: 24px; line-height: 24px; }
/* At its own width, never stretched: a phone preview is 390 px and blurs when widened to the modal. */
.ops-viewer-body img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-md); }

.ops-chips { min-width: 0; max-width: 100%; }
.ops-chip { max-width: 100%; min-width: 0; }
.ops-chip__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
