:root {
  --bg: #0f1115; --panel: #171a21; --line: #262b36; --text: #e6e8ee; --muted: #8a92a6;
  --accent: #6ea8fe; --ok: #4cc38a; --bad: #f2555a; --warn: #f5b74e; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
header { display: flex; align-items: center; gap: 20px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 600; font-size: 16px; }
nav button { background: none; border: 1px solid transparent; color: var(--muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; }
nav button.active { color: var(--text); background: var(--bg); border-color: var(--line); }
.sysinfo { margin-left: auto; color: var(--muted); font-size: 12px; font-family: var(--mono); text-align: right; }
.sysinfo b { color: var(--text); font-weight: 500; }
main { padding: 16px 18px 60px; max-width: 1500px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; }
.panel summary { padding: 10px 14px; cursor: pointer; font-weight: 500; }
.panel form { padding: 4px 14px 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.grid label.row { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.grid .wide { grid-column: 1 / -1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; font-family: var(--mono); font-size: 13px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
button { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 11px; cursor: pointer; font: inherit; font-size: 13px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #0b1020; border-color: var(--accent); font-weight: 600; }
button.danger:hover { border-color: var(--bad); color: var(--bad); }
button.small { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tbody tr:hover { background: #1c2029; }
tbody tr.selected { background: #1f2a3d; }
tbody tr.clickable { cursor: pointer; }
td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }
td.trunc { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
.child { color: var(--muted); }
.child td:first-child::before { content: "└ "; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.badge.running { background: #1b3a5c; color: var(--accent); }
.badge.success { background: #143526; color: var(--ok); }
.badge.failed, .badge.error, .badge.lost { background: #3d1c1e; color: var(--bad); }
.badge.killed, .badge.timeout { background: #3d2f14; color: var(--warn); }
.badge.managed { background: #2a2140; color: #c3a6ff; }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.split.open { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.detail { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; position: sticky; top: 64px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; gap: 10px; }
.detail h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; font-size: 12.5px; }
.detail dt { color: var(--muted); } .detail dd { margin: 0; font-family: var(--mono); word-break: break-all; }
.detail pre { flex: 1; min-height: 200px; margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow: auto; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.on-toggle { width: 34px; height: 18px; border-radius: 9px; background: #3a3f4d; position: relative; cursor: pointer; border: none; padding: 0; }
.on-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.on-toggle.on { background: var(--ok); } .on-toggle.on::after { left: 18px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #2b1d1f; color: #ffd4d6; border: 1px solid var(--bad); padding: 10px 16px; border-radius: 8px; font-size: 13px; max-width: 80vw; z-index: 10; }
#toast.ok { background: #16301f; color: #c9f2d9; border-color: var(--ok); }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } .split.open { grid-template-columns: 1fr; } .detail { position: static; max-height: none; } td.trunc { max-width: 160px; } }
/* path picker */
.pp { position: relative; }
.pp input { width: 100%; }
.pp-menu { position: absolute; left: 0; right: 0; top: calc(100% + 2px); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; max-height: 260px; overflow: auto; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.pp-item { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; cursor: pointer; font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.pp-item.active, .pp-item:hover { background: #1f2a3d; }
.pp-item .src { margin-left: auto; color: var(--muted); font-size: 11px; font-family: system-ui, sans-serif; }
.pp-item .src.fs { color: var(--accent); }
.pp-empty { padding: 8px 10px; color: var(--muted); font-size: 12px; }
/* v2: agents/apps tabs, dialog, docs */
.api-link { color: var(--accent); text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 5px 11px; font-size: 13px; font-weight: 600; }
.api-link:hover { border-color: var(--accent); }
.toolbar .right { margin-left: auto; }
.section-title { font-size: 14px; font-weight: 500; color: var(--muted); margin: 18px 0 8px; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; width: min(760px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h3 { margin: 0 0 4px; font-size: 16px; }
dialog form.grid { padding: 0; }
.app-name { font-weight: 600; }
.app-desc { color: var(--muted); font-size: 12px; max-width: 360px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; background: #1c2029; color: var(--muted); border: 1px solid var(--line); }
.pill.on { background: #143526; color: var(--ok); border-color: transparent; }
.link { color: var(--accent); cursor: pointer; text-decoration: none; } .link:hover { text-decoration: underline; }

.sessions { font-size: 12.5px; }
.session { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-top: 1px solid var(--line); }
.session code { font-family: var(--mono); font-size: 12px; }
.detail pre.screen { white-space: pre; font-size: 11.5px; line-height: 1.25; }
.detail form.keys input { min-width: 0; flex: 1; }
.detail details.meta summary { cursor: pointer; font-size: 12.5px; list-style: none; }
.detail details.meta summary::before { content: "▸ "; } .detail details.meta[open] summary::before { content: "▾ "; }
.detail details.meta dl { margin-top: 6px; }
.sess a { white-space: nowrap; display: inline-block; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #5a6070; vertical-align: middle; }
.dot.idle { background: var(--ok); } .dot.working { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.sess { line-height: 1.3; } .sess code { font-size: 11px; }
.sesscell { max-width: 280px; min-width: 160px; }
.sess > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess > div + div { white-space: normal; }

/* ---------------------------------------------------------------- phones (and narrow windows) */
@media (max-width: 720px) {
  body { font-size: 15px; }
  header { padding: 8px 12px; gap: 10px; }
  .sysinfo { display: none; }
  /* tabs: a full-width row under the brand (not a fixed bottom bar: iOS Safari's own bottom toolbar sits over that and eats the taps) */
  header { padding-bottom: 0; }
  nav { order: 10; flex-basis: 100%; display: flex; gap: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -12px; padding: 2px 6px 6px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav button { flex: 1 0 auto; padding: 9px 10px; font-size: 13.5px; border-radius: 8px; }
  main { padding: 12px 10px calc(24px + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: 16px; padding: 9px 10px; }            /* 16px stops iOS from zooming the page */
  button { padding: 9px 12px; font-size: 14px; } button.small { padding: 7px 10px; font-size: 13px; }
  .toolbar .right { margin-left: 0; }
  /* tables become cards */
  table, tbody { display: block; background: none; border: 0; }
  thead { display: none; }
  tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
  tbody tr:hover { background: var(--panel); }
  tbody tr.selected { border-color: var(--accent); }
  td { display: block; padding: 0; border: 0; max-width: none !important; }
  td[data-l]::before { content: attr(data-l) " "; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
  td.trunc, td.full, td.sesscell, td.row { flex-basis: 100%; min-width: 0; max-width: none; }
  td.trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  td.row { padding-top: 6px; gap: 8px; }
  td.status { margin-left: auto; }
  .sess > div:first-child { white-space: normal; }
  .child td:first-child::before { content: "↳ "; }
  /* runs: the detail takes the whole screen */
  .split.open > table { display: none; }
  body.run-open { overflow: hidden; }
  .detail { position: fixed; inset: 0; z-index: 7; border: 0; border-radius: 0; max-height: none; overflow: auto; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); gap: 8px; }
  .detail h3 { position: sticky; top: -10px; background: var(--panel); padding: 8px 0; z-index: 1; }
  .detail dl { grid-template-columns: 1fr; gap: 1px; } .detail dt { font-size: 11px; margin-top: 4px; } .detail dd { font-size: 12.5px; }
  .detail pre { min-height: 45vh; font-size: 11px; }
  .detail pre.screen { font-size: 10.5px; line-height: 1.3; }
  .detail form.keys { position: sticky; bottom: 0; background: var(--panel); padding: 6px 0; }
  .detail form.keys input { flex: 1 1 100%; }
  .session { flex-direction: column; align-items: stretch; }
  /* dialogs go full screen */
  dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; overflow: auto; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }
  .pp-menu { max-height: 40vh; }
}
@media (pointer: coarse) { button, .on-toggle { min-height: 36px; } nav button { min-height: 40px; } }

/* Workspace design system */
:root { color-scheme: dark; --bg:#111312; --panel:#191c1a; --line:#2c312d; --text:#edf0eb; --muted:#a0aaa2; --accent:#c4ef91; --ok:#95d6ae; --bad:#f09a98; --warn:#e5c284; }
[hidden] { display:none !important; }
body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; -webkit-font-smoothing:antialiased; }
button,input,select,textarea,a { -webkit-tap-highlight-color:transparent; }
button,a,input,select,textarea,summary { touch-action:manipulation; }
button { min-height:38px; border-radius:8px; font-weight:500; transition:background .15s,border-color .15s; }
button:hover { background:#252c25; border-color:#65765b; }
button.primary { color:#17220d; box-shadow:0 1px 2px #0002; }
button.primary:hover { background:#d3f7a8; }
button.small { min-height:32px; padding:6px 10px; }
button.danger { color:var(--muted); }
button.danger:hover { background:#382424; color:var(--bad); }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
a { color:var(--accent); }
.skip-link { position:fixed; top:-80px; left:16px; z-index:50; padding:12px; background:var(--panel); }
.skip-link:focus { top:12px; }
.console .sidebar { width:224px; position:fixed; inset:0 auto 0 0; display:flex; flex-direction:column; align-items:stretch; flex-wrap:nowrap; gap:0; padding:30px 18px 20px; border:0; border-right:1px solid var(--line); background:#151816; z-index:5; }
.brand { display:flex; align-items:center; gap:11px; text-decoration:none; color:var(--text); font-size:15px; letter-spacing:-.3px; }
.brand-mark { display:grid; place-content:center; position:relative; width:35px; height:35px; flex-shrink:0; border:1px solid #667753; background:#27331f; border-radius:10px; font-size:29px; font-weight:650; line-height:1; color:var(--accent); }
.brand-mark span { position:absolute; right:4px; bottom:3px; font-size:22px; }
.brand small { display:block; color:var(--muted); font-size:10px; font-weight:400; margin-top:3px; letter-spacing:.1px; }
.nav-label { font-size:10px; letter-spacing:1.5px; color:#7e8a80; margin:48px 12px 14px; }
.console nav { display:flex; flex-direction:column; gap:6px; }
.console nav button { display:flex; align-items:center; gap:13px; width:100%; min-height:44px; text-align:left; padding:10px 13px; font-size:13px; border-radius:8px; }
.console nav button > span { width:20px; text-align:center; font-size:21px; line-height:20px; }
.console nav button.active { background:#293322; color:var(--accent); border-color:#3b4930; }
.sidebar-bottom { margin-top:auto; }
.sidebar-bottom .api-link { display:flex; justify-content:space-between; font-size:12px; padding:12px; color:var(--muted); border:0; }
.sysinfo { overflow-wrap:anywhere; margin:16px 0 0; padding:16px 12px 0; border-top:1px solid var(--line); text-align:left; font-family:inherit; font-size:10px; line-height:1.8; }
.console main { margin-left:224px; padding:0 40px 60px; max-width:1800px; }
.page-top { display:flex; align-items:center; justify-content:space-between; gap:12px; height:74px; border-bottom:1px solid var(--line); font-size:12px; }
.breadcrumb { color:var(--muted); }.breadcrumb span { margin:0 12px; color:#536056; }.breadcrumb b { font-weight:450; color:var(--text); }
.connection { color:var(--muted); font-size:11px; white-space:nowrap; }.connection::before { content:""; display:inline-block; width:6px; height:6px; margin-right:7px; border-radius:50%; background:var(--warn); }.connection.online::before { background:var(--ok); box-shadow:0 0 0 4px #95d6ae0b; }
.page-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:38px 0 30px; }
.eyebrow { margin:0 0 10px; color:var(--accent); font-size:10px; font-weight:600; letter-spacing:1.8px; }
h1 { margin:0; font-size:32px; line-height:1.25; font-weight:580; letter-spacing:-1.2px; }
#page-description { color:var(--muted); margin:10px 0 0; font-size:13px; line-height:1.7; }
#refresh-btn { color:var(--muted); background:transparent; display:flex; gap:7px; align-items:center; }
.toolbar { margin-bottom:20px; gap:12px; }.toolbar .muted { font-size:12px; }.toolbar label { display:flex; align-items:center; gap:7px; }
input,select,textarea { border-radius:8px; padding:10px 12px; background:#121613; min-width:0; max-width:100%; }
input[type=checkbox] { accent-color:var(--accent); width:16px; height:16px; margin:0 4px 0 0; }
.grid { gap:18px; }.grid > * { min-width:0; }.grid label { gap:8px; font-size:12px; }.grid .row { gap:8px; }
.panel { border-radius:12px; margin-bottom:22px; }.panel summary { padding:17px 20px; font-size:13px; }.panel form { padding:12px 20px 22px; }
table { border-collapse:separate; border-spacing:0; border-radius:12px; table-layout:fixed; }
th { padding:13px 14px; font-size:10px; text-transform:uppercase; letter-spacing:.8px; background:#1c201d; }
td { padding:16px 14px; font-size:12px; overflow-wrap:anywhere; }tbody tr:last-child td { border-bottom:0; }tbody tr:hover { background:#202620; }td.row { display:flex; gap:6px; }
td.trunc { max-width:220px; }tbody tr.selected { background:#293322; }
.badge { text-transform:none; letter-spacing:0; font-size:11px; padding:4px 9px; font-weight:500; }.badge.running { background:#263c2c; color:#b5e3bc; }.badge.managed { background:#2d3330; color:#abb9ae; }.badge.success { background:#213629; }
.pill { padding:4px 9px; font-size:11px; background:#252b26; }
.section-title { margin:30px 0 14px; color:var(--text); font-size:15px; }
/* Process lists prioritize session identity, with details and actions below. */
.proc-table { display:block; background:transparent; border:0; overflow:visible; }
.proc-table thead { display:none; }
.proc-table tbody { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.proc-table tbody tr { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:20px; border:1px solid var(--line); border-radius:12px; background:var(--panel); min-width:0; }
.proc-table td { display:block; padding:0; border:0; min-width:0; }
.proc-table td:first-child { order:1; color:var(--muted); margin-left:auto; font-size:10px; }.proc-table td:first-child::before { content:"PID "; }
.proc-table td:nth-child(2) { order:0; font-size:12px; font-weight:600; text-transform:capitalize; }
.proc-table td:nth-child(3) { order:2; flex-basis:100%; max-width:none; min-width:0; padding:5px 0; }
.sess > div:first-child { white-space:normal; font-size:16px; font-weight:500; line-height:1.5; letter-spacing:-.2px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sess > div + div { margin-top:5px; overflow-wrap:anywhere; line-height:1.6; }.dot.working { background:var(--accent); box-shadow:none; }
.proc-table td:nth-child(4) { order:3; flex-basis:100%; max-width:100%; color:var(--muted); font-size:11px; }
.proc-table td:nth-child(5) { order:4; flex-basis:100%; max-width:100%; color:#8c998e; font-size:10px; background:#121613; border:1px solid #252d26; border-radius:6px; padding:8px 10px; }
.proc-table td:nth-child(n+6):nth-child(-n+9) { order:5; color:var(--text); font-size:11px; }.proc-table td[data-l]::before { content:attr(data-l) " "; color:var(--muted); font-size:10px; text-transform:uppercase; margin-right:3px; }
.proc-table td:last-child:not([colspan]) { order:6; flex-basis:100%; display:flex; border-top:1px solid var(--line); padding-top:14px; margin-top:2px; }
.proc-table tr:has(td[colspan]) { grid-column:1/-1; justify-content:center; padding:50px; }.proc-table td[colspan] { margin:0; }.proc-table td[colspan]::before { content:none; }
.proc-table tr.child { opacity:.7; }
#app-table th:first-child { width:25%; }#app-table th:nth-child(2) { width:27%; }
#wf-table th:first-child { width:20%; }#wf-table th:last-child { width:23%; }
#type-table th:first-child { width:23%; }#type-table th:nth-child(3) { width:24%; }
#runs-table th:nth-child(2) { width:30%; }
.app-name { margin-bottom:5px; font-size:15px; }.app-desc { line-height:1.7; }
.on-toggle { width:40px; height:24px; min-height:24px; border-radius:20px; background:#424c44; }.on-toggle::after { width:18px; height:18px; top:3px; left:3px; }.on-toggle.on::after { left:19px; }.on-toggle.on { background:#719653; }
.split.open { grid-template-columns:minmax(260px,.8fr) minmax(0,1.2fr); }
.split.open #runs-table th:nth-child(n+3),.split.open #runs-table td:nth-child(n+3) { display:none; }.split.open #runs-table th:first-child { width:55px; }
.detail { top:20px; max-height:calc(100dvh - 40px); padding:20px; border-radius:12px; gap:16px; }.detail h3 { flex-wrap:wrap; font-size:17px; }.detail pre { min-height:300px; line-height:1.7; padding:16px; background:#0d110e; }.detail details.meta { overflow-wrap:anywhere; }.detail details.meta summary { line-height:1.7; }.detail dl { padding:12px 0; }.detail dd { max-height:220px; overflow:auto; }.session { padding:12px 0; gap:12px; }.session > div { overflow-wrap:anywhere; }
dialog { padding:28px; width:min(720px,calc(100vw - 32px)); max-height:calc(100dvh - 48px); border-radius:16px; }dialog h3 { font-size:23px; letter-spacing:-.5px; margin-bottom:8px; }dialog::backdrop { background:#050a07b3; backdrop-filter:blur(5px); }#preview { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; }#preview:empty { display:none; }
#toast { max-width:calc(100vw - 32px); bottom:calc(22px + env(safe-area-inset-bottom)); box-shadow:0 8px 40px #0004; }
@media (min-width:1700px) { .proc-table tbody { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:1200px) { .console .sidebar { width:190px; padding:26px 12px; }.console main { margin-left:190px; padding-inline:24px; }.proc-table tbody { grid-template-columns:1fr; }.split.open { grid-template-columns:1fr; }.split.open > table { display:none; }.detail { position:static; max-height:none; } }
@media (max-width:900px) {
  .console .sidebar { width:auto; position:sticky; inset:auto; top:0; padding:16px 20px 0; border-right:0; border-bottom:1px solid var(--line); }
  .brand { font-size:14px; }.brand small,.nav-label,.sidebar-bottom { display:none; }.brand-mark { width:30px; height:30px; font-size:24px; }
  .console nav { flex-direction:row; gap:4px; margin:14px -6px 0; padding:0 0 10px; overflow-x:auto; }
  .console nav button { justify-content:center; gap:6px; width:auto; flex:1; white-space:nowrap; min-height:44px; padding:9px; }.console nav button > span { font-size:18px; width:18px; }
  .console main { margin:0; padding:0 20px 40px; }.page-top { height:54px; }.page-heading { padding:26px 0; }h1 { font-size:29px; }
  table,tbody { display:block; border:0; background:none; }thead { display:none; }
  tbody tr { display:flex; flex-wrap:wrap; align-items:center; gap:12px; min-width:0; background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:18px; margin-bottom:12px; }
  td { display:block; padding:0; border:0; min-width:0; max-width:100% !important; }td.full,td.trunc,td.row { flex-basis:100%; }td.row { padding-top:12px; border-top:1px solid var(--line); }td.status { margin-left:auto; }
  td[data-l]::before { content:attr(data-l) " "; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.4px; }td.full { overflow-wrap:anywhere; }.proc-table tbody tr { margin:0; }
  tbody tr.selected { border-color:#719653; }.split.open #runs-table td:nth-child(n+3) { display:block; }
  button.small { min-height:40px; } .grid { grid-template-columns:1fr; }
  .detail { position:fixed; inset:0; z-index:7; border-radius:0; max-height:100dvh; padding:20px 20px calc(20px + env(safe-area-inset-bottom)); overflow:auto; }
  body.run-open { overflow:hidden; }.detail h3 { position:sticky; top:-20px; background:var(--panel); padding:14px 0; z-index:1; }.detail pre { flex:1 0 45dvh; min-height:240px; }.detail dl { grid-template-columns:1fr; }.detail dt { margin-top:8px; }.detail .keys { position:sticky; bottom:0; background:var(--panel); padding-block:10px; }
}
@media (max-width:540px) {
  .console .sidebar { padding:12px 14px 0; padding-top:max(12px,env(safe-area-inset-top)); }.console nav { margin-top:10px; gap:1px; }.console nav button { font-size:11px; flex-direction:column; gap:4px; padding:7px 5px; min-width:0; }.console nav button > span { font-size:20px; }
  .console main { padding:0 14px calc(30px + env(safe-area-inset-bottom)); }.page-top { font-size:10px; }.connection { font-size:10px; }.breadcrumb span { margin:0 7px; }.page-heading { align-items:flex-start; gap:8px; padding:24px 0; }.eyebrow { font-size:9px; letter-spacing:1.4px; }h1 { font-size:28px; }#page-description { font-size:12px; max-width:290px; }#refresh-btn { min-width:44px; justify-content:center; }#refresh-btn span { display:none; }
  .toolbar { gap:10px; margin-bottom:16px; }.toolbar .right { flex-basis:100%; margin:2px 0 0; }.toolbar select { flex:1 1 130px; width:0; }.toolbar #runs-count { flex-basis:100%; }
  input,select,textarea { font-size:16px; min-height:44px; }.grid label { font-size:12px; }input[type=checkbox] { min-height:0; }button,button.small { min-height:44px; } .on-toggle { min-height:44px; width:48px; background:transparent; }.on-toggle::before { content:""; position:absolute; inset:10px 0; border-radius:15px; background:#424c44; }.on-toggle.on::before { background:#719653; }.on-toggle::after { top:13px; left:4px; }.on-toggle.on::after { left:26px; }
  .proc-table tbody tr { padding:16px; gap:10px; }.proc-table td:last-child:not([colspan]) { gap:8px; }.proc-table td:nth-child(2) { font-size:11px; }.sess > div:first-child { font-size:15px; }
  td.row { gap:8px; }td.row button { flex-grow:1; }.panel summary { padding:16px; }.panel form { padding:8px 16px 20px; }
  dialog { width:100%; height:100dvh; max-height:100dvh; max-width:100%; margin:0; border-radius:0; padding:24px 18px calc(24px + env(safe-area-inset-bottom)); }.detail { padding-inline:14px; }.detail h3 { font-size:16px; }.detail pre { font-size:12px; }.detail .session { align-items:stretch; flex-direction:column; }.detail .keys input { flex:1 1 100%; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; scroll-behavior:auto !important; } }
.mobile-docs { display:none; }
.pill,.badge { white-space:nowrap; }
#wf-table th:nth-child(4) { width:115px; }
select { font-family:inherit; }
@media (max-width:900px) { .mobile-docs { display:block; position:absolute; right:20px; top:22px; font-size:11px; color:var(--muted); text-decoration:none; }.console .brand { align-self:flex-start; } }
@media (max-width:540px) { .mobile-docs { right:16px; top:max(20px,env(safe-area-inset-top)); } }
@media (min-width:901px) and (max-width:1200px) {
  #app-table,#wf-table,#type-table,#app-table tbody,#wf-table tbody,#type-table tbody { display:block; background:none; border:0; }
  #app-table thead,#wf-table thead,#type-table thead { display:none; }
  #app-table tr,#wf-table tr,#type-table tr { display:flex; flex-wrap:wrap; align-items:center; gap:14px; padding:20px; margin-bottom:14px; background:var(--panel); border:1px solid var(--line); border-radius:12px; }
  #app-table td,#wf-table td,#type-table td { display:block; padding:0; border:0; min-width:0; max-width:100%; }
  #app-table td.full,#wf-table td.full,#type-table td.full { flex-basis:100%; }
  #app-table td.row,#wf-table td.row,#type-table td.row { display:flex; flex-basis:100%; padding-top:14px; border-top:1px solid var(--line); }
  td[data-l]::before { content:attr(data-l) " "; color:var(--muted); font-size:10px; text-transform:uppercase; }
}
.form-error { padding:12px; border:1px solid #704140; border-radius:8px; color:var(--bad); background:#30201f; font-size:13px; overflow-wrap:anywhere; }

/* ---------------------------------------------------------------- console: session rail + terminal pane */
.console-view { display:grid; grid-template-columns:minmax(240px,290px) minmax(0,1fr); gap:18px; align-items:start; }
.rail { display:flex; flex-direction:column; gap:8px; position:sticky; top:20px; max-height:calc(100dvh - 40px); overflow:auto; }
.rail-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:6px 2px; color:var(--muted); font-size:10px; letter-spacing:1.2px; text-transform:uppercase; }
.rail-head:not(:first-child) { margin-top:10px; padding-top:14px; border-top:1px solid var(--line); }
.rail-item { display:block; width:100%; padding:14px; text-align:left; font:inherit; color:var(--text); text-decoration:none; background:var(--panel); border:1px solid var(--line); border-radius:12px; }
.rail-item:hover { background:#202620; border-color:#65765b; }
.rail-item.active { background:#293322; border-color:#3b4930; }
.rail-item.flat { background:transparent; }
.rail-item.flat:hover { background:#1c201d; }
.rail-title { font-size:14px; font-weight:500; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.rail-sub { margin-top:4px; color:var(--muted); font-size:11px; overflow-wrap:anywhere; }
.rail-sub.dim { color:#7e8a80; }
.rail-item.flat button { width:100%; margin-top:10px; }
.pane { display:flex; flex-direction:column; gap:14px; position:sticky; top:20px; max-height:calc(100dvh - 40px); padding:18px; background:var(--panel); border:1px solid var(--line); border-radius:12px; }
.pane-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.pane-id { min-width:0; }
.pane h2 { margin:0; font-size:19px; font-weight:560; line-height:1.35; letter-spacing:-.4px; overflow-wrap:anywhere; }
.pane-meta { margin-top:6px; font-size:11.5px; overflow-wrap:anywhere; }
.pane-meta code { margin-left:8px; }
.pane-actions { gap:8px; }
.pane .follow { display:flex; align-items:center; font-size:12px; white-space:nowrap; }
.pane pre.screen { flex:1; min-height:340px; margin:0; padding:14px; overflow:auto; white-space:pre; background:#0d110e; border:1px solid var(--line); border-radius:8px; font-family:var(--mono); font-size:11.5px; line-height:1.3; }
.pane form.keys input { flex:1; min-width:0; }
.pane-foot { font-size:10.5px; }
.pane-empty { display:flex; flex-direction:column; align-items:center; gap:14px; padding:56px 10px; text-align:center; }
.pane-empty h2 { font-size:21px; }
.pane-empty p { margin:0; max-width:430px; font-size:13px; line-height:1.7; }
@media (max-width:1200px) {
  .console-view { grid-template-columns:1fr; }
  /* the rail becomes a scrolling row of session cards above the terminal */
  .rail { position:static; max-height:none; flex-direction:row; align-items:stretch; overflow-x:auto; padding-bottom:4px; }
  .rail-head { flex:0 0 auto; flex-direction:column; align-items:flex-start; justify-content:center; margin:0; padding:0 6px 0 0; border:0; }
  .rail-head:not(:first-child) { margin:0; padding:0 6px; border:0; border-left:1px solid var(--line); }
  .rail-item { flex:0 0 230px; }
  .rail-item.flat button { margin-top:8px; }
  .pane { position:static; max-height:none; }
}
@media (max-width:900px) {
  .pane { padding:16px; }
  .pane pre.screen { min-height:44dvh; font-size:11px; }
  .pane form.keys { position:sticky; bottom:0; padding-block:8px; background:var(--panel); }
  .pane form.keys input { flex:1 1 100%; }
  .pane-actions { width:100%; }
}

/* people: who you are, who else is here */
.page-top-right { display:flex; align-items:center; gap:14px; min-width:0; }
.people { color:var(--muted); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.people b { color:var(--text); font-weight:600; }
.people button { margin-left:8px; }
dialog.login { width:min(420px, calc(100vw - 32px)); }
.by { color:var(--muted); }

/* live terminal (xterm.js over a websocket to tmux) */
/* A fixed height, never "grow to fit": the fit addon sizes the terminal from this box, so a box that grew with the
   terminal would feed back (more rows → taller box → more rows) up to the row cap. */
.pane .term { position:relative; flex:none; height:max(360px, calc(100dvh - 380px)); padding:8px; background:#0d110e; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.pane .term .xterm { height:100%; }
.pane .term-status { position:absolute; top:8px; right:12px; z-index:5; font-size:11px; color:var(--muted); background:#0d110ecc; padding:2px 8px; border-radius:6px; }
.pane .term-status:empty { display:none; }

/* full-screen terminal: just the session, edge to edge */
body.term-full .sidebar, body.term-full .page-top, body.term-full .page-heading, body.term-full .rail, body.term-full .pane-foot { display:none; }
body.term-full main { margin:0; padding:0; max-width:none; }
body.term-full .console-view { display:block; }
body.term-full .pane { position:fixed; inset:0; top:0; max-height:none; gap:8px; padding:8px 12px 10px; border:0; border-radius:0; z-index:20; }
body.term-full .pane .term { flex:1; height:auto; min-height:0; }
body.term-full .pane-head { align-items:center; }
body.term-full .pane h2 { font-size:15px; }
body.term-full .pane-meta { margin-top:2px; }
