/* DESK SCREEN (2026-09-29) — frontend/app/deskscreen.js. Click an agent's workstation on the live floor: the DESK SCREEN
   window opens on that agent's COMPUTER — the app its current step is working in (editor · diff · terminal · web ·
   browser), rendered from the run transcript. It is a normal station window (StationUI 'desk', PANEL shell): the term
   system owns the glass chrome, the dock rise, resizing and the roster switcher; this file lays out the body. The
   activity feed is COMMS, never repeated here. Matte, no glow; theme tokens only. */
/* the window body is a column so the monitor FILLS it: resize the window and the screen grows with it */
.desk-win .term-body { display: flex; flex-direction: column; }
.desk-win .ds-screen { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
/* the status strip: lamp · agent · state (the lamp is drawn geometry, never a bloom) */
.ds-strip { display: flex; align-items: baseline; gap: 10px; padding: 2px 0 6px; border-bottom: 1px solid var(--gd-edge, rgba(var(--ph-rgb),.24)); }
.ds-lamp { width: 8px; height: 8px; border-radius: 50%; align-self: center; flex: none; background: var(--ph-dim); box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
.ds-screen[data-state="running"] .ds-lamp { background: var(--ph); }
.ds-screen[data-state="ask"] .ds-lamp { background: var(--gold, #ffc24a); }
.ds-screen[data-state="done"] .ds-lamp { background: var(--ok, #62ff9e); }
.ds-screen[data-state="failed"] .ds-lamp { background: var(--bad, #ff4a3d); }
.ds-st { font-size: 14px; letter-spacing: 1.2px; color: var(--ph-dim); }
.ds-screen[data-state="running"] .ds-st { color: var(--ph); }
.ds-screen[data-state="ask"] .ds-st { color: var(--gold, #ffc24a); }
.ds-main { flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; gap: 6px; }
.ds-dim { color: var(--ph-dim); font-size: 14px; line-height: 1.3; margin: 2px 0; }
.ds-job { margin: 0; font-size: 14px; color: var(--ph-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-ask { margin: 0; padding: 4px 8px; font-size: 15px; color: var(--gold, #ffc24a); border: 1px solid rgba(var(--gold-rgb, 255,194,74), .35); border-radius: 4px; background: rgba(var(--gold-rgb, 255,194,74), .06); }

/* STEP-IN: the agent asked for a human in its browser — the door to take it sits on its screen */
.ds-handoff { display: flex; align-items: center; gap: 10px; flex: none; }
.ds-handoff > span { flex: 1 1 auto; min-width: 0; }
.ds-handoff small { display: block; font-size: 13px; color: var(--ph-dim); margin-top: 2px; overflow-wrap: anywhere; }
.ds-handoff .bb { flex: none; }
/* OPEN PAGE: a web page it wrote, shown for real in the BROWSER window */
.ds-openpage { flex: none; }

/* THE SCREEN: a recessed monitor well (dark glass, one hairline edge, inset shadow) holding one app */
.ds-app { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--gd-edge, rgba(var(--ph-rgb),.24)); border-radius: 5px; background: rgba(0,0,0,.34); box-shadow: inset 0 1px 6px rgba(0,0,0,.45); overflow: hidden; }
.ds-bar { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 10px; border-bottom: 1px solid var(--gd-edge, rgba(var(--ph-rgb),.24)); background: linear-gradient(180deg, rgba(var(--ph-rgb),.10), rgba(var(--ph-rgb),.02)); }
.ds-appname { font-size: 13px; letter-spacing: 2px; color: var(--ph-bright); flex: none; }
.ds-target { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.ds-pager { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.ds-pos { font-size: 13px; color: var(--ph-dim); min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.ds-pager .bb:disabled { opacity: .35; cursor: default; }
.ds-status { padding: 2px 10px; font-size: 13px; color: var(--ph-dim); border-bottom: 1px solid rgba(var(--ph-rgb), .08); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-app[data-s="run"] .ds-status { color: var(--ph); }
.ds-app[data-s="bad"] .ds-status { color: color-mix(in srgb, var(--bad, #ff4a3d) 70%, var(--text)); }
.ds-partial { padding: 4px 10px; }
.ds-view { flex: 1 1 auto; min-height: 0; overflow: auto; }

/* the apps' surfaces — all monospace station type, no syntax colour (a matte screen, not an IDE skin) */
.ds-code { list-style: none; margin: 0; padding: 6px 0; counter-reset: ln; font-size: 15px; line-height: 1.3; }
.ds-code li { counter-increment: ln; padding: 0 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.ds-code li::before { content: counter(ln); display: inline-block; width: 38px; margin-right: 10px; text-align: right; color: var(--ph-dim); opacity: .6; }
.ds-diff, .ds-term, .ds-page { margin: 0; padding: 6px 10px; font: 15px/1.3 'VT323', monospace; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ds-diff .ds-add { color: var(--ok, #62ff9e); }
.ds-diff .ds-del { color: color-mix(in srgb, var(--bad, #ff4a3d) 75%, var(--text)); }
.ds-diff .ds-hunk { color: var(--ph-dim); }
.ds-app[data-app="terminal"] .ds-view { background: rgba(0,0,0,.28); }
.ds-app > .ds-page { flex: 1 1 auto; min-height: 0; overflow: auto; }
/* screen off: an empty monitor says what it is waiting for, in the station's quiet voice */
.ds-off { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; border: 1px solid var(--gd-edge, rgba(var(--ph-rgb),.24)); border-radius: 5px; background: rgba(0,0,0,.34); box-shadow: inset 0 1px 6px rgba(0,0,0,.45); padding: 16px; }
.ds-off span { font-size: 17px; letter-spacing: 2px; color: var(--ph-dim); text-transform: uppercase; }
.ds-off small { font-size: 14px; color: var(--ph-dim); max-width: 46ch; }

/* hands: tell it something mid-run, stop it, open its chat */
.ds-steer { display: flex; gap: 6px; flex: none; }
.ds-steer[hidden] { display: none; }
/* (0,2,0) on purpose: the station's base field rule input[type=text] is (0,1,1) and would paint a 19px console field */
.ds-screen .ds-in { flex: 1; width: auto; min-width: 0; font: 15px/1.2 'VT323', monospace; color: var(--text); text-shadow: none; background: rgba(0,0,0,.28); border: 1px solid var(--gd-edge, rgba(var(--ph-rgb),.24)); border-radius: 4px; padding: 4px 8px; box-shadow: inset 0 1px 3px rgba(0,0,0,.3); }
.ds-screen .ds-in:focus { outline: none; border-color: rgba(var(--ph-rgb), .55); }
.ds-screen .ds-in::placeholder { color: var(--ph-dim); }
.ds-note { margin: 0; font-size: 14px; color: var(--ph); }
.ds-note:empty { display: none; }
.ds-foot { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.ds-foot [hidden] { display: none; }
.ds-screen .ds-stop.armed { color: var(--bad); border-color: var(--bad); }
