/* The shell side of the app platform (shell/core/platform.js). Structure only, tokens only; looks restyle material.
   Nothing here shows unless the platform is mounted (Stable today has no platform client).
   Hooks: .ev[data-rail=app] (a platform row on the rail) · .ev.ape-more (a folded run of them)
          #holdSlot > .ev.ask.aph.pf-hold[data-hold][data-kind][data-state=needs-you|sending|expired] (a pending hold)
          #holdSlot > p.pf-note[data-level] (the last thing that failed, in words)
          #sys .it.mach[data-k=mach][data-host=up|degraded|down|unknown] > i.lamp(.h-up|.h-deg|.stop|.stale) + b
          #hostPop.launch.hpop > h3, .hp-row[data-state] > i.lamp, b, .hp-s, .hp-w · button.hp-go (See Activity: its Scheduled jobs)
          .app-h .st[data-slot=status][data-level][data-stale] > .pf-pres (i.lamp, b) + .pf-line (i.pf-mk) */

/* ── rail: a folded run of app rows ── */
.ev.ape-more > .g b { color: var(--ink-3); }
.ev.ape-more .act em { overflow: hidden; text-overflow: ellipsis; }

/* ── holds: the question card, in the conversation, above Claude's own question ── */
#holdSlot { flex: none; }
#holdSlot:empty { display: none; }
#holdSlot .pf-hold .aph-b .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#holdSlot .pf-hold[data-state="expired"] .ask-l, #holdSlot .pf-hold[data-state="expired"] > .g b { color: var(--ink-3); }
#holdSlot .pf-hold[data-state="expired"] > .tk::after { background: none; border: 2px solid var(--clear); }
#holdSlot .pf-note { margin: 4px 24px 8px calc(var(--tw) + 24px); max-width: 36em; font: 500 14px/20px var(--sans); color: var(--ink-2); overflow-wrap: anywhere; }
#holdSlot .pf-note[data-level="bad"] { color: var(--stop); }
.phone #holdSlot .pf-note { margin-left: 16px; margin-right: 16px; }

/* ── status bar: the machine lamp (colour + shape + a word on hover) ── */
.lamp.h-deg { background: var(--warn, var(--k-make)); border: 0; border-radius: 0; width: 11px; height: 10px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
#sys button.it.mach { cursor: pointer; }
#sys button.it.mach:focus-visible, #sys .x.mach:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* the phone bar when it is tight: the machine name gives way whole (never "M…"), the lamp stays */
.phone #sys[data-name="off"] > .x { display: none; }
.phone #sys > .x.mach { cursor: pointer; }
.phone #sys > .x { flex: none; min-width: 0; }               /* whole or not at all: "Connected" gives way first, then status.js takes the name out */

html #hostPop.hpop { position: fixed; top: var(--hp-top, 44px); left: var(--hp-left, 8px); right: auto; bottom: auto; width: min(360px, calc(100vw - 16px)); max-height: calc(100dvh - var(--hp-top, 44px) - 12px); overflow-y: auto; padding: 0 0 8px; z-index: 45; }
.hpop h3 { margin: 0; padding: 12px 16px 6px; font: 700 12.5px/16px var(--sans); color: var(--ink-3); }
.hpop .hp-row { display: grid; grid-template-columns: 12px auto minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 8px 16px; }
.hpop .hp-row > .lamp { justify-self: center; }
.hpop .hp-row > b { font: 700 15px/20px var(--sans); color: var(--ink); white-space: nowrap; }
.hpop .hp-row > .hp-s { font: 500 14px/20px var(--sans); color: var(--ink-2); text-align: right; }
.hpop .hp-row > .hp-w { grid-column: 2 / -1; font: var(--meta); color: var(--ink-3); white-space: normal; overflow-wrap: anywhere; }
.hpop .hp-row[data-state="down"] > .hp-s { color: var(--stop); font-weight: 700; }
.hpop .hp-row[data-state="degraded"] > .hp-s, .hpop .hp-row[data-state="down"] > .hp-w { color: var(--ink); }
/* the way on: Activity's Scheduled jobs (a 44 px row at the foot, a hairline above) */
.hpop .hp-go { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 16px); min-height: 44px; margin: 6px 8px 0; padding: 0 8px;
  border: 0; border-top: 1px solid var(--rule); border-radius: var(--r-2, 8px); background: none; color: var(--accent); font: 600 14px/20px var(--sans); text-align: left; cursor: pointer; }
.hpop .hp-go:hover, .hpop .hp-go:focus-visible { background: color-mix(in oklab, var(--ink) 6%, transparent); border-radius: var(--r, 8px); }
.hpop .hp-go .chev { font: 400 18px/1 var(--sans); font-style: normal; color: var(--ink-3); }
/* the state mark beside the machine's name: a 44 px target that opens the three Macs (status.js data-k=state) */
#sys > [data-k="state"] { box-sizing: content-box; padding-block: 12px; margin-block: -12px; min-width: 44px; cursor: pointer; }   /* 44 px tall without moving a pixel (its own height stays the line's) */
#sys [data-k="state"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-2, 8px); }

/* ── app frame header: the app's status line and who is working there (one row, never pushes the controls) ── */
.app-h > .st[data-slot="status"] { flex: 0 10 auto; display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; }
.app-h > .st[data-slot="status"]:empty { display: none; }
.app-h > .st > .pf-pres { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.app-h > .st > .pf-pres b { font-weight: 700; color: var(--who, var(--ink)); }
.app-h > .st > .pf-line { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.app-h > .st[data-stale] > .pf-line { color: var(--ink-3); }
.app-h > .st .pf-mk { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--run); vertical-align: 1px; }
.app-h > .st[data-level="warn"] .pf-mk { border-radius: 0; width: 10px; height: 9px; background: var(--warn, var(--k-make)); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.app-h > .st[data-level="bad"] .pf-mk { border-radius: 0; background: var(--stop); }

/* ── Running: "Done by your apps" (core/appdone.js) — one plain row per app action, newest first ──
   section.ad[data-place=pane|board][hidden] > h3.ad-h (span + em) · ol.ad-list > li.ad-r[data-state][data-app][data-seq][data-who]
     > span.ad-ic (svg) + div.ad-t (p.ad-s > b.ad-w · p.ad-n · p.ad-m > time, span, em.ad-st) + button.btn.sm.ad-u · button.rp-line.ad-more */
.ad { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 4px 12px 12px; border-top: 1px solid var(--rule); }
.ad[hidden] { display: none; }
.board .rows > .ad { flex: none; overflow: visible; border-top: 0; padding-top: 8px; }
.ad-h { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 10px 4px 6px; font: 700 13px/16px var(--sans); color: var(--ink); }
.ad-h em { font: var(--meta); font-style: normal; color: var(--ink-3); }
.ad-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ad-r { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 10px; align-items: start; padding: 8px 4px; border-bottom: 1px solid var(--rule); min-width: 0; }
.ad-r:last-child { border-bottom: 0; }
.ad-ic { padding-top: 1px; color: var(--ink-2); line-height: 0; }
.ad-ic svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ad-t { min-width: 0; }
.ad-s { margin: 0; font: var(--do); color: var(--ink); overflow-wrap: anywhere; }
.ad-w { font-weight: 700; color: var(--who, var(--ink)); }
.ad-r[data-who="owner"] .ad-w { color: var(--ink); }
.ad-n { margin: 2px 0 0; font: var(--meta); color: var(--ink-2); overflow-wrap: anywhere; }
.ad-n[data-state="refused"], .ad-n[data-state="failed"] { color: var(--stop); }
.ad-m { margin: 3px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; font: var(--meta); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ad-m .ad-dot { font-style: normal; }
.ad-st { font-style: normal; font-weight: 600; color: var(--ink-2); }
.ad-r[data-state="undone"] .ad-s, .ad-r[data-state="denied"] .ad-s, .ad-r[data-state="expired"] .ad-s { color: var(--ink-2); }
.ad-u { align-self: center; }
.ad-u.off { opacity: .6; cursor: default; }
.ad-u:focus-visible, .ad-more:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ad-more { width: 100%; margin-top: 6px; }
.phone .ad-r { grid-template-columns: 20px minmax(0, 1fr); }
.phone .ad .ad-u.btn { grid-column: 2; justify-self: start; margin-top: 8px; height: 44px; padding: 0 16px; }
.phone .ad { overflow: visible; }

/* His own press in the app he is in (holdfront.js): the same confirm card IN FRONT of that app, one tap either way.
   Phone: a sheet from the bottom over the app sheet. Wide: a card centred over the app's window (--hf-* = its box). */
#holdFront[hidden] { display: none; }
#holdFront { position: fixed; inset: 0; z-index: 70; }
#holdFront > .hf-bg { position: absolute; inset: 0; background: rgb(4 5 8 / .46); }
[data-theme="light"] #holdFront > .hf-bg { background: rgb(28 26 22 / .22); }
#holdFront > .hf-box { position: absolute; display: flex; flex-direction: column; gap: 8px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 0; border-radius: var(--r-6, 20px); background: var(--panel); box-shadow: 0 0 0 1px color-mix(in oklab, var(--ink) 10%, transparent), 0 24px 60px -12px rgb(0 0 0 / .55); }
#holdFront[data-layout="wide"] > .hf-bg { left: var(--hf-l, 0px); top: var(--hf-t, 0px); width: var(--hf-w, 100vw); height: var(--hf-h, 100vh); right: auto; bottom: auto; border-radius: var(--r-5, 16px); }
#holdFront[data-layout="wide"] > .hf-box { left: calc(var(--hf-l, 0px) + var(--hf-w, 100vw) / 2); top: calc(var(--hf-t, 0px) + var(--hf-h, 100vh) / 2); translate: -50% -50%;
  width: min(460px, calc(var(--hf-w, 100vw) - 32px)); max-height: calc(var(--hf-h, 100vh) - 32px); }
#holdFront[data-layout="phone"] > .hf-box { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 96px); border-radius: var(--r-7, 28px); }
#holdFront .pf-hold { margin: 0; border: 0; box-shadow: none; background: none; }
#holdFront .pf-hold > .g, #holdFront .pf-hold > .tk { display: none; }          /* no conversation gutter: it is a dialog, not a message */
#holdFront .pf-hold > .evb { margin: 0; padding: 12px 18px 10px; max-width: none; }
#holdFront .pf-hold .aph-b { display: flex; gap: 10px; }
#holdFront .pf-hold .aph-b .btn { flex: 1; min-height: 44px; }
#holdFront .pf-hold .aph-b .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
