/* © 2026 William C. Chesher. All Rights Reserved.
   programs.css - the programs page (automate's workflows manager in bench's skin). Reads only the tokens and
   bench.css: a command bar with a verdict, the stop rail, a roster of program cards, the board, and a detail panel. */

.pg-main { padding-bottom: 40px; max-width: 860px; }
.pg-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.pg-bar-r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pg-eyebrow { margin: 0 0 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: lowercase; color: var(--ink-faint); }
.pg-title { margin: 0; font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -.01em; background: var(--genesis); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pg-verdict { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); display: inline-flex; align-items: center; gap: 8px; }
.pg-verdict:empty { display: none; }
.pg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); display: inline-block; }
.pg-dot.on { background: var(--mint); box-shadow: 0 0 8px var(--mint); }

.pg-state { margin: 0 0 12px; font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.pg-state:empty { display: none; }
.pg-state a { color: var(--orange); }
.pg-notice { margin: 0 0 12px; font-size: 13px; color: var(--mint); }
.pg-notice.err { color: var(--bad); }
.pg-notice:empty { display: none; }

/* the stop rail */
.pg-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.pg-rail-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.pg-rail-card.halted { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.pg-rail-title { margin: 0; font-weight: 600; font-size: 14px; color: var(--ink); }
.pg-rail-body { margin: 0; font-size: 12.5px; color: var(--ink-dim); line-height: 1.5; }
.btn.stop { background: var(--bad); color: #1a0006; border-color: var(--bad); }
.btn.stop:hover { box-shadow: 0 0 24px -6px var(--bad); }
.btn.quiet { color: var(--ink-dim); background: transparent; border-color: var(--line); font-weight: 500; }
.btn.quiet:hover { color: var(--ink); }
.btn.small { padding: 5px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.danger { color: var(--bad); background: transparent; border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); font-weight: 500; }
.btn[disabled] { opacity: .5; cursor: progress; }

/* tabs */
.pg-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.pg-tabs button { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; }
.pg-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.pg-tabs button:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }

/* roster */
.pg-controls { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.pg-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.pg-chip { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; display: inline-flex; gap: 6px; }
.pg-chip[aria-pressed="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--orange) 55%, var(--line)); }
.pg-chip-n { color: var(--ink-faint); }
.pg-search { font: inherit; font-size: 14px; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 12px; min-width: 0; flex: 0 1 240px; }
.pg-search:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.pg-empty { margin: 0 0 12px; font-size: 13px; color: var(--ink-faint); }

.pg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pg-row { border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pg-row[data-status="active"] { border-left-color: var(--mint); }
.pg-row[data-status="paused"] { border-left-color: var(--caution); }
.pg-row-main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pg-row-name { font-weight: 600; color: var(--ink); background: none; border: 0; padding: 0; text-align: left; font: inherit; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; }
.pg-row-name:hover { color: var(--orange-lt); }
.pg-row-name:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.pg-row-meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); overflow-wrap: anywhere; }
.pg-pill { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-faint); white-space: nowrap; }
.pg-pill.active, .pg-pill.completed { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 50%, var(--line)); }
.pg-pill.paused, .pg-pill.open { color: var(--caution); border-color: color-mix(in srgb, var(--caution) 50%, var(--line)); }
.pg-pill.refused, .pg-pill.aborted, .pg-pill.dead_lettered, .pg-pill.failed { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.pg-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* board */
.pg-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.pg-stat { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); padding: 10px 12px; }
.pg-stat-n { font-family: var(--mono); font-size: 22px; color: var(--ink); }
.pg-stat-l { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: .08em; }
.pg-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pg-table th, .pg-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pg-table th { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-faint); font-weight: 500; background: var(--panel); }
.pg-table td { color: var(--ink-2); }
.pg-table tr:last-child td { border-bottom: 0; }
.pg-mono { font-family: var(--mono); font-size: 12px; }

/* detail */
.pg-detail { margin-top: 18px; border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line)); border-radius: var(--radius); background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.pg-detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pg-detail-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.pg-cap { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.pg-runs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pg-run { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.pg-run > summary { list-style: none; cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; }
.pg-run > summary::-webkit-details-marker { display: none; }
.pg-run > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.pg-run-when { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.pg-run-what { font-size: 12.5px; color: var(--ink-dim); flex: 1 1 160px; overflow-wrap: anywhere; }
.pg-trace { padding: 0 12px 10px; font-size: 12.5px; color: var(--ink-dim); }
.pg-trace ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.pg-note { margin: 0; font-size: 12px; color: var(--ink-faint); line-height: 1.5; }

/* dialog */
.pg-dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); padding: 18px; max-width: min(440px, calc(100vw - 32px)); }
.pg-dialog::backdrop { background: rgba(5, 8, 14, .7); }
.pg-dialog-title { margin: 0 0 10px; font-size: 17px; }
.pg-dialog p { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.pg-dialog input { font: inherit; width: 100%; box-sizing: border-box; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 12px; }
.pg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

@media (max-width: 620px) {
  .pg-rail { grid-template-columns: 1fr; }
  .pg-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* your saved code and share codes (codes.js): the same rows, below the programs */
.pg-codes { margin-top: 36px; display: flex; flex-direction: column; gap: 12px; }
.pg-codes-h { margin: 0; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.pg-share { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pg-share input { flex: 0 1 220px; text-transform: uppercase; letter-spacing: .12em; }
