/* Machines pages (the "PC detail" mockup): the head panel with its meta strip, the banners, the monitor map with
   its slot tiles, the click queue, the windows-running chart and the PC cards of the list. Tokens only, so both themes follow. */

/* ── the head: mono name, state chips, host, actions; the agent's numbers in a strip under it ── */
.mhead__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 16px 18px; }
.mhead__name { margin: 0; font: 600 19px/1.1 var(--mono); letter-spacing: 0; color: var(--ink); }
.mhead__reason { font: 12px/1 var(--mono); color: var(--warn); }
.mhead__host { font: 12px/1 var(--mono); color: var(--ink-3); }
.mhead__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.mhead__actions .btn { height: 32px; }
.mhead__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.mtile { background: var(--panel); padding: 10px 18px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mtile__label { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile__value { font: 500 13px/1.2 var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile__value--ok { color: var(--ok); } .mtile__value--warn { color: var(--warn); } .mtile__value--bad { color: var(--bad); } .mtile__value--mute { color: var(--ink-3); }
.mtile__bar { display: block; height: 3px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.mtile__fill { display: block; height: 100%; border-radius: 2px; background: var(--ink); }
.mtile__sub { font-size: 11px; line-height: 1.2; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile__sub--bad { color: var(--bad); } .mtile__sub--warn { color: var(--warn); }
.mtile__fill--ok { background: var(--ok); } .mtile__fill--warn { background: var(--warn); } .mtile__fill--bad { background: var(--bad); }
@media (max-width: 760px) { .mhead__row { padding: 14px; } .mhead__actions { margin-left: 0; width: 100%; } .mhead__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mtile { padding: 10px 14px; } }

/* ── a card head that keeps its title on a phone: the meta wraps under it instead of pushing it out ── */
.mcard__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.mcard__head .panel__title { flex: none; color: var(--ink-2); }
.mcard__meta { font-size: 12px; color: var(--ink-3); min-width: 0; }
.mcard__meta--end, .mcard__end { margin-left: auto; }
.mcard__end { display: inline-flex; }

/* ── the warning banners (mockup: bare glyph, title with its code in amber mono, buttons at the top right) ── */
.mban { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 13px 18px; border-radius: 14px; background: var(--warn-bg); border: 1px solid color-mix(in oklab, var(--warn) 25%, transparent); color: var(--ink); line-height: 1.45; }
.mban__g { font: 600 13px/20px var(--mono); color: var(--warn); }
.mban__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mban__title strong { font-weight: 600; }
.mban__code { font: 600 11.5px/1 var(--mono); color: var(--warn); white-space: nowrap; }
.mban__text { color: var(--ink-2); text-wrap: pretty; }
.mban__next { text-wrap: pretty; } .mban__next strong { font-weight: 600; }
.mban__end { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.mban__end .btn { height: 30px; white-space: nowrap; }
.mban--bad { background: var(--bad-bg); border-color: color-mix(in oklab, var(--bad) 25%, transparent); } .mban--bad .mban__g, .mban--bad .mban__code { color: var(--bad); }
.mban--info { background: var(--info-bg); border-color: color-mix(in oklab, var(--info) 25%, transparent); } .mban--info .mban__g { color: var(--info); }
.mban--neutral { background: var(--panel-2); border-color: var(--line-2); } .mban--neutral .mban__g { color: var(--ink-3); }
.mban--ok { background: var(--ok-bg); border-color: color-mix(in oklab, var(--ok) 25%, transparent); } .mban--ok .mban__g { color: var(--ok); }
@media (max-width: 760px) {
  .mban { grid-template-columns: auto minmax(0, 1fr); padding: 12px 14px; }
  .mban__end { grid-column: 2; justify-content: flex-start; }
  .mban__end .btn { white-space: normal; height: auto; min-height: 30px; }
}

/* ── a bot's picture: the headshot over a tile in the bot's own colour (shows through when there is none) ── */
.mpic { --sz: 18px; --hue: 210; position: relative; display: inline-block; flex: none; width: var(--sz); height: var(--sz); vertical-align: middle; }
.mpic__tile, .mpic__img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: calc(var(--sz) * .28); }
.mpic__tile { display: grid; place-items: center; background: oklch(0.62 0.13 var(--hue)); color: #fff; font: 700 calc(var(--sz) * .42) / 1 var(--mono); letter-spacing: -.02em; }
.mpic__img { object-fit: cover; background: transparent; }
.mpic__game { position: absolute; right: calc(var(--sz) * -.14); bottom: calc(var(--sz) * -.14); border-radius: calc(var(--sz) * .14); border: 2px solid var(--panel); background: var(--panel-2); display: block; }

/* ── the machine key, shown once ── */
.mkey { border-color: var(--accent); }
.mkey__key { font-size: 14px; word-break: break-all; }
.mkey__cmd { margin: 0; white-space: pre-wrap; user-select: all; padding: 10px 12px; border-radius: 9px; background: var(--sunk); border: 1px solid var(--line-2); overflow-wrap: anywhere; }

/* ── the monitor map: one screen per monitor, every slot where it is, the taskbar along the foot ── */
.mmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; padding: 18px; }
.mmap__mon { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.mmap__title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mmap__name { font-weight: 500; white-space: nowrap; }
.mmap__spec { font: 11.5px/1 var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmap__spec.is-warn { color: var(--warn); }
.mmap__count { margin-left: auto; font: 11.5px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.mmap__screen { position: relative; width: 100%; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sunk); overflow: hidden; }
.mmap__none { position: absolute; inset: 0 0 14px; display: grid; place-items: center; font: 11px/1 var(--mono); color: var(--ink-3); }
.mmap__taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: var(--line-2); border-radius: 0 0 9px 9px; }
.mmap__taskbar.is-warn { background: color-mix(in oklab, var(--warn) 70%, transparent); }
/* a slot tile: its geometry comes inline as --l --t --wd --h (percentages of the monitor); the screen keeps a 5 px
   frame and the taskbar strip at the foot, and every tile leaves 5 px to its neighbour */
.mmap__screen { --pad: 5px; --tb: 14px; }
.mslot { position: absolute; box-sizing: border-box; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: repeating-linear-gradient(135deg, var(--panel-2) 0 8px, var(--panel) 8px 16px); color: var(--ink); text-align: left;
  left: calc(var(--pad) + (100% - 2 * var(--pad)) * var(--l) / 100); top: calc(var(--pad) + (100% - var(--pad) - var(--tb)) * var(--t) / 100);
  width: calc((100% - 2 * var(--pad)) * var(--wd) / 100 - 5px); height: calc((100% - var(--pad) - var(--tb)) * var(--h) / 100 - 5px); }
a.mslot:hover { text-decoration: none; border-color: var(--accent); }
.mslot--free { background: transparent; border-style: dashed; color: var(--ink-3); }
.mslot--off { background: var(--sunk); }
.mslot--live { border-color: color-mix(in oklab, var(--btn) 45%, transparent); }
.mslot--bad { border-color: color-mix(in oklab, var(--bad) 55%, transparent); }
.mslot.is-covered { border: 2px solid var(--warn); }
/* an error keeps its red border; the taskbar over it shows as an amber strip along its foot */
.mslot--bad.is-covered { border: 1px solid color-mix(in oklab, var(--bad) 70%, transparent); box-shadow: inset 0 -3px 0 var(--warn); }
.mslot__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.mslot__head, .mslot__foot { position: relative; display: flex; align-items: center; gap: 5px; padding: 5px 6px; background: color-mix(in oklab, var(--panel) 85%, transparent); min-width: 0; }
.mslot__label { font: 600 11px/1 var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mslot--free .mslot__label { color: var(--ink-3); }
.mslot__pill, .mslot__empty { margin-left: auto; flex: none; }
.mslot__pill { height: 16px; padding: 0 5px; font-size: 10px; gap: 3px; } .mslot__pill .pill__g { font-size: 9px; }
.mslot__empty { font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.mslot__centre { position: relative; align-self: center; display: inline-flex; align-items: center; gap: 5px; font: 10px/1 var(--mono); color: var(--ink-3); padding: 0 6px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mslot__centre .glogo { width: 14px; height: 14px; border-radius: 3px; }
.mslot__foot { font: 10px/1.2 var(--mono); color: var(--ink-2); padding: 4px 6px; gap: 4px; }
.mslot__phase { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mslot__tip { color: var(--ink-3); white-space: nowrap; flex: none; }
.mslot--bad .mslot__phase { color: var(--bad); }
@media (max-width: 760px) { .mmap { padding: 14px; gap: 16px; grid-template-columns: minmax(0, 1fr); } .mslot__pill { display: none; } }

/* ── the click queue: three numbers, who held the cursor last and who waited, the rule ── */
.mlower { align-items: start; }
.cq__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.cq__stat { background: var(--panel); padding: 12px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cq__label, .cq__sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cq__sub { font-size: 11px; }
.cq__value { font: 600 20px/1.1 var(--mono); color: var(--ink); white-space: nowrap; }
.cq__value--ok { color: var(--ok); } .cq__value--warn { color: var(--warn); } .cq__value--bad { color: var(--bad); }
.cq__rows { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cq__row { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.cq__key { font-size: 12px; color: var(--ink-3); width: 70px; flex: none; }
.cq__bot { font: 500 12px/22px var(--mono); padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); white-space: nowrap; }
.cq__bot--on { font-weight: 600; border-color: transparent; background: var(--accent-bg); color: var(--accent); }
.cq__ms { color: var(--ink-3); }
.cq__meta { font: 11.5px/1 var(--mono); color: var(--ink-3); }
.cq__none { color: var(--ink-3); }
.cq__note { font-size: 12px; color: var(--ink-3); text-wrap: pretty; }
@media (max-width: 760px) { .cq__stat { padding: 10px 12px; } .cq__value { font-size: 17px; } .cq__rows { padding: 12px 14px; } }

/* ── windows running: the live count against the slots, the cells, then the 12-hour chart ── */
.wrun__body { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.wchart { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; align-items: end; height: 96px; border-bottom: 1px solid var(--line); }
.wchart__h { position: relative; height: 100%; display: flex; align-items: flex-end; }
.wchart__bar { display: block; width: 100%; min-height: 0; background: linear-gradient(180deg, var(--btn), color-mix(in oklab, var(--btn) 15%, transparent)); border-radius: 3px 3px 0 0; opacity: .75; }
.wchart__line { position: absolute; left: -2px; right: -2px; height: 2px; border-radius: 1px; background: var(--brand); }
.wchart__empty { position: absolute; inset: 0 0 8px; display: grid; place-items: center; font-size: 12px; color: var(--ink-3); }
.wchart__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--ink-3); }
.wchart__legend > span { display: inline-flex; align-items: center; gap: 5px; }
.wchart__key { display: inline-block; }
.wchart__key--bar { width: 10px; height: 8px; border-radius: 2px; background: var(--btn); }
.wchart__key--line { width: 12px; height: 2px; background: var(--brand); }
.wchart__span { margin-left: auto; font-family: var(--mono); }
@media (max-width: 760px) { .wrun__body { padding: 14px; } .wchart { gap: 3px; } }

/* ── the tables in a half-width card fit it: fixed columns, the long one ellipsised, the second line under ── */
.mfit { table-layout: fixed; width: 100%; }
.mfit td { overflow: hidden; }
.mfit__main { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfit__sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfit__clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfit .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mlog .feed { max-height: 640px; overflow: auto; }
@media (max-width: 760px) { .mfit { min-width: 520px; } }
.wrun { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wrun__n { font: 600 28px/1 var(--mono); color: var(--ink); }
.wrun__max { color: var(--ink-3); font-size: 16px; }
.wrun__text { font-size: 12px; color: var(--ink-2); }
.wrun__cells { display: grid; gap: 4px; }
.wrun__cell { height: 8px; border-radius: 3px; background: transparent; outline: 1px dashed var(--line-2); outline-offset: -1px; }
.wrun__cell.is-wanted { outline-color: var(--ink-3); }
.wrun__cell.is-on { background: var(--btn); outline-color: transparent; }
.table td.nowrap-cell { white-space: nowrap; }
.botcell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.botcell__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.botcell__text > a { font-weight: 500; color: var(--ink); }
.kvtable th { width: 110px; color: var(--ink-3); font-weight: 500; vertical-align: top; }
.kvtable td { overflow-wrap: anywhere; }
.kvtable td.row { display: flex; }

/* ── the list: one card per PC, the slot strip inside it ── */
.pccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; }
.pccard { display: flex; flex-direction: column; color: inherit; }
a.pccard:hover { text-decoration: none; border-color: var(--line-2); }
.pccard__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 18px; }
.pccard__name { font: 600 15px/1.1 var(--mono); }
.pccard__host { font: 11.5px/1 var(--mono); color: var(--ink-3); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pccard__meta { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pccard__meta .mtile { padding: 9px 14px; }
.pccard__slots { display: grid; gap: 6px; padding: 12px 18px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); border-top: 1px solid var(--line); }
.pcslot { display: flex; align-items: center; gap: 5px; height: 26px; padding: 0 7px; border-radius: 6px; border: 1px dashed var(--line-2); font: 500 10.5px/1 var(--mono); color: var(--ink-3); min-width: 0; }

.pcslot__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pcslot--on { border: 1px solid color-mix(in oklab, var(--btn) 45%, transparent); background: var(--accent-bg); color: var(--ink); }
.pcslot--off { border-style: solid; background: var(--sunk); color: var(--ink-2); }
.pccard__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 18px; border-top: 1px solid var(--line); margin-top: auto; font-size: 12px; color: var(--ink-3); }
.pccard__foot .code { margin-right: 2px; }
.pccard__bots { display: inline-flex; margin-left: auto; }
.pccard__bots .mpic { margin-left: -4px; } .pccard__bots .mpic:first-child { margin-left: 0; }
.pccard__bots .mpic__tile, .pccard__bots .mpic__img { box-shadow: 0 0 0 2px var(--panel); }
@media (max-width: 760px) { .pccards { grid-template-columns: minmax(0, 1fr); } .pccard__slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pccard__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
