/* The AGI playground: files, editor, output and floating tool windows. Built on the tokens of docs.css. */ .kind-playground body { overflow: hidden; } .pg-main { height: 100dvh; padding-top: var(--top-h); } .pg [hidden] { display: none !important; } .pg { --pg-files-w: 248px; --pg-out-w: 42%; --pg-edit-bg: var(--bg); height: 100%; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg-alt); font-size: 13px; } /* ---------- Toolbar ---------- */ .pg-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg); min-width: 0; flex-wrap: wrap; position: relative; z-index: 80; /* menus open over the tool windows */ } #pg-samples .pop-menu { right: auto; left: 0; transform-origin: top left; } .pg-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; } .pg-wins { display: flex; gap: 2px; } .pg-bar-end { margin-left: auto; display: flex; gap: 4px; } .pg-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 500; color: var(--text); background: transparent; border: 0; cursor: pointer; white-space: nowrap; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); } .pg-btn:hover:not(:disabled) { background: var(--fill); } .pg-btn:disabled { opacity: 0.45; cursor: default; } .pg-btn .i { width: 15px; height: 15px; flex: none; } .pg-btn kbd { font: 11px var(--font); color: inherit; opacity: 0.7; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.18); } .pg-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); } .pg-run { background: var(--accent); color: #fff; padding-right: 8px; } .pg-run:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, #fff); } #pg-stop { color: var(--err); } .pg-primary { background: var(--accent); color: #fff; } .pg-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff) !important; } .pg-icon-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); cursor: pointer; } .pg-icon-btn:hover { background: var(--fill); color: var(--text); } .pg-icon-btn .i { width: 15px; height: 15px; } .pg-mode { font-size: 12px; color: var(--text-2); padding: 3px 9px; border-radius: 999px; background: var(--fill); white-space: nowrap; } .pg-mode b { color: var(--text); font-weight: 600; } .pg-samples-menu { width: 340px; max-height: 70vh; overflow: auto; } .pg-samples-menu h5 { margin: 8px 10px 2px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); } .pg-samples-menu button { display: block !important; text-align: left; } .pg-samples-menu button small { display: block; color: var(--text-2); font-size: 12px; margin-top: 1px; white-space: normal; } /* ---------- Body ---------- */ .pg-body { display: grid; grid-template-columns: var(--pg-files-w) minmax(260px, 1fr) 5px minmax(280px, var(--pg-out-w)); min-height: 0; } .pg-pane-head { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 6px 0 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--line-2); } .pg-pane-tools { display: flex; gap: 1px; } /* Files */ .pg-files { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--bg-alt); } .pg-files.drop { box-shadow: inset 0 0 0 2px var(--accent); } .pg-tree { flex: 1; overflow: auto; padding: 6px; outline: none; } .pg-files-note { margin: 0; padding: 10px 12px; font-size: 11.5px; line-height: 1.45; color: var(--text-3); border-top: 1px solid var(--line-2); } .pg-files-note code { font-size: 11px; } .pg-node { display: flex; align-items: center; gap: 6px; height: 26px; padding-right: 4px; border-radius: 6px; cursor: default; white-space: nowrap; user-select: none; color: var(--text); } .pg-node:hover { background: var(--fill); } .pg-node.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); } .pg-node.open-file .pg-name { font-weight: 600; } .pg-node .tw { width: 14px; height: 14px; flex: none; display: grid; place-items: center; color: var(--text-3); transition: transform 0.15s var(--ease); } .pg-node .tw .i { width: 11px; height: 11px; } .pg-node.expanded .tw { transform: rotate(90deg); } .pg-node .ic { width: 15px; height: 15px; flex: none; color: var(--text-2); } .pg-node .ic .i { width: 15px; height: 15px; } .pg-node.dir > .ic { color: var(--accent); } .pg-node .pg-name { overflow: hidden; text-overflow: ellipsis; flex: 1; } .pg-node .pg-root-label { color: var(--text-3); font-size: 11.5px; } .pg-node .acts { display: none; gap: 0; } .pg-node:hover .acts, .pg-node.sel .acts { display: flex; } .pg-node .acts button { width: 22px; height: 22px; border: 0; background: none; border-radius: 5px; color: var(--text-3); cursor: pointer; display: grid; place-items: center; } .pg-node .acts button:hover { background: var(--fill-2); color: var(--text); } .pg-node .acts .i { width: 13px; height: 13px; } .pg-node.changed .pg-name::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-left: 6px; vertical-align: middle; } .pg-size { color: var(--text-3); font-size: 11px; } /* Editor */ .pg-editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--pg-edit-bg); } .pg-tabs { display: flex; height: 36px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: thin; background: var(--bg-alt); } .pg-tab { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; border: 0; border-right: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; white-space: nowrap; cursor: pointer; } .pg-tab[aria-selected="true"] { background: var(--pg-edit-bg); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); } .pg-tab .x { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; color: var(--text-3); } .pg-tab .x:hover { background: var(--fill-2); color: var(--text); } .pg-tab .x .i { width: 11px; height: 11px; } .pg-tab.dirty .x::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); } .pg-tab.dirty .x .i { display: none; } .pg-tab.dirty .x:hover::before { display: none; } .pg-tab.dirty .x:hover .i { display: block; } .pg-code { flex: 1; display: flex; min-height: 0; position: relative; } .pg-gutter { flex: none; width: 48px; padding: 14px 10px 14px 0; overflow: hidden; font: 12.5px/1.6 var(--mono); color: var(--text-3); text-align: right; background: var(--pg-edit-bg); border-right: 1px solid var(--line-2); user-select: none; } .pg-gutter div.err { color: var(--err); font-weight: 700; } .pg-code-scroll { position: relative; flex: 1; min-width: 0; overflow: hidden; } .pg-hl, #pg-text { position: absolute; inset: 0; margin: 0; padding: 14px 16px; font: 12.5px/1.6 var(--mono); tab-size: 4; white-space: pre; overflow: auto; border: 0; letter-spacing: normal; word-spacing: normal; } .pg-hl { color: var(--text); pointer-events: none; overflow: hidden; } #pg-text { color: transparent; caret-color: var(--text); background: transparent; resize: none; outline: none; } #pg-text::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: transparent; } .pg-hl .err-line { background: color-mix(in srgb, var(--err) 12%, transparent); display: inline-block; min-width: 100%; } .pg-preview { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--bg-alt); } .pg-preview img { max-width: 100%; max-height: calc(100% - 30px); object-fit: contain; box-shadow: var(--shadow); border-radius: 6px; background: repeating-conic-gradient(var(--fill) 0 25%, transparent 0 50%) 0 0 / 16px 16px; } .pg-preview .pg-bin { text-align: center; color: var(--text-2); } .pg-preview .pg-bin pre { text-align: left; font: 11.5px/1.5 var(--mono); background: var(--code-bg); padding: 12px; border-radius: 8px; max-width: 560px; overflow: auto; } .pg-empty { flex: 1; display: grid; place-items: center; color: var(--text-3); } .pg-split { cursor: col-resize; background: var(--line-2); transition: background-color 0.15s var(--ease); } .pg-split:hover, .pg-split.drag, .pg-split:focus-visible { background: var(--accent); outline: none; } /* Output */ .pg-out { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); } .pg-out-tabs { display: flex; gap: 2px; height: 36px; align-items: center; padding: 0 6px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; background: var(--bg-alt); } .pg-out-tabs button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; } .pg-out-tabs button:hover { color: var(--text); background: var(--fill); } .pg-out-tabs button[aria-selected="true"] { color: var(--text); background: var(--bg); box-shadow: 0 0 0 1px var(--line); font-weight: 600; } .pg-out-tabs b { font-weight: 600; font-size: 11px; color: var(--text-3); } .pg-out-tabs b.err { color: var(--err); } .pg-out-body { flex: 1; min-height: 0; position: relative; } .pg-panel { position: absolute; inset: 0; overflow: auto; display: flex; flex-direction: column; } .pg-panel[hidden] { display: none; } .pg-hint { color: var(--text-3); margin: 18px; line-height: 1.55; } .pg-hint kbd { font: 12px var(--font); padding: 1px 6px; border-radius: 5px; background: var(--fill); } .pg-resp-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px 0; } .pg-resp-head:empty { display: none; } .pg-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-family: var(--mono); } .pg-chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); } .pg-chip.bad { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); } .pg-chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, transparent); } .pg-resp-view { display: flex; gap: 2px; margin: 10px 12px 0; } .pg-resp-view button { font: inherit; font-size: 12px; border: 0; padding: 3px 10px; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; } .pg-resp-view button[aria-selected="true"] { background: var(--fill-2); color: var(--text); } .pg-resp { flex: 1; min-height: 0; padding: 10px 12px 12px; display: flex; flex-direction: column; } .pg-resp pre { margin: 0; flex: 1; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; background: var(--code-bg); border-radius: 10px; padding: 12px 14px; overflow: auto; } .pg-resp iframe { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 240px; } .pg-resp img { max-width: 100%; border-radius: 8px; align-self: flex-start; } .pg-error { border-radius: 10px; padding: 12px 14px; background: color-mix(in srgb, var(--err) 9%, transparent); color: var(--text); margin-bottom: 10px; } .pg-error strong { color: var(--err); } .pg-error pre { background: transparent; padding: 6px 0 0; font-size: 12px; color: var(--text-2); } .pg-error button { margin-top: 6px; } .pg-log { font: 12px/1.55 var(--mono); padding: 6px 0; } .pg-log:empty::before { content: attr(data-empty); display: block; padding: 12px 16px; color: var(--text-3); font-family: var(--font); } .pg-line { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 2px 12px; border-bottom: 1px solid var(--line-2); } .pg-line .t { color: var(--text-3); text-align: right; } .pg-line .src { color: var(--text-3); margin-right: 6px; } .pg-line .txt { white-space: pre-wrap; word-break: break-word; } .pg-line.agi .txt { color: var(--text-2); } .pg-line.warn { background: color-mix(in srgb, var(--warn) 7%, transparent); } .pg-line.warn .txt { color: var(--warn); } .pg-line.error .txt, .pg-line.agi .txt.bad { color: var(--err); } .pg-call { padding: 8px 12px; border-bottom: 1px solid var(--line-2); } .pg-call-head { display: flex; gap: 8px; align-items: baseline; } .pg-call-head code { font-weight: 600; } .pg-call-head .rule { margin-left: auto; font-family: var(--font); font-size: 11px; color: var(--text-3); } .pg-call pre { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; color: var(--text-2); font: inherit; } .pg-call pre.res { color: var(--text); } .pg-change { display: flex; gap: 8px; align-items: center; padding: 5px 12px; border-bottom: 1px solid var(--line-2); } .pg-change .k { font-family: var(--font); font-size: 11px; font-weight: 600; width: 64px; } .pg-change .k.created { color: var(--ok); } .pg-change .k.modified { color: var(--accent); } .pg-change .k.deleted { color: var(--err); } .pg-change a { color: var(--text); cursor: pointer; } .pg-ws-log { flex: 1; } .pg-line.ws-out .txt { color: var(--accent); } .pg-line.ws-in .txt { color: var(--ok); } .pg-line.ws-meta .txt { color: var(--text-3); font-style: italic; } .pg-ws-send { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg); } .pg-ws-send input { flex: 1; } .pg-state { padding: 10px 14px 18px; } .pg-state h5 { margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; } .pg-state table { width: 100%; border-collapse: collapse; font-size: 12px; } .pg-state td, .pg-state th { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; font-family: var(--mono); word-break: break-all; } .pg-state th { font-family: var(--font); font-weight: 600; color: var(--text-3); font-size: 11px; } .pg-state p { color: var(--text-3); margin: 4px 0; } /* Status */ .pg-status { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 12px; border-top: 1px solid var(--line); background: var(--bg); color: var(--text-2); font-size: 12px; } .pg-status-end { margin-left: auto; color: var(--text-3); } .pg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); } .pg[data-state="ready"] .pg-dot { background: var(--ok); } .pg[data-state="running"] .pg-dot { background: var(--accent); animation: pg-pulse 1s infinite; } .pg[data-state="failed"] .pg-dot { background: var(--err); } @keyframes pg-pulse { 50% { opacity: 0.3; } } /* ---------- Tool windows ---------- */ .pg-win { position: fixed; z-index: 60; top: 120px; left: calc(50% - 200px); width: 400px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 132px); display: flex; flex-direction: column; background: var(--menu-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); resize: both; overflow: hidden; min-width: 300px; min-height: 160px; } .pg-win-wide { width: 540px; } .pg-win[hidden] { display: none; } .pg-win.front { z-index: 61; } .pg-win-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 6px 0 12px; flex: none; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line-2); cursor: grab; user-select: none; touch-action: none; } .pg-win-head:active { cursor: grabbing; } .pg-win-head > span { display: flex; align-items: center; gap: 8px; } .pg-win-head > span .i { width: 15px; height: 15px; color: var(--accent); } .pg-win-body { padding: 12px 14px 16px; overflow: auto; display: flex; flex-direction: column; gap: 10px; } .pg-win-body h4 { margin: 8px 0 -2px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; } .pg-note { margin: 0; color: var(--text-2); font-size: 12px; line-height: 1.5; } .pg-note code, .pg-win label code, .pg-win small code { font-size: 11.5px; } .pg-win label, .pg-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-2); } .pg-label { font-size: 12px; font-weight: 500; color: var(--text-2); } .pg-win label small, .pg-label small { font-weight: 400; color: var(--text-3); } .pg-win label.pg-check { display: block; font-weight: 400; color: var(--text); line-height: 1.5; } .pg-check input { margin: 0 6px 0 0; vertical-align: -2px; } .pg-inline { flex-direction: row !important; align-items: center; gap: 8px !important; } .pg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .pg-pair { display: flex; gap: 6px; } .pg-pair input { min-width: 0; } .pg-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; } .pg-mono { font-family: var(--mono) !important; font-size: 12px !important; } .pg input[type="text"], .pg input[type="number"], .pg select, .pg textarea { font: inherit; font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; width: 100%; min-width: 0; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); } .pg select { padding-right: 4px; } .pg-inline select { width: auto; max-width: 320px; } .pg textarea { resize: vertical; line-height: 1.45; } .pg input:focus, .pg select:focus, .pg textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); } .pg input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; } .pg-json-state { margin: -4px 0 0; font-size: 11.5px; color: var(--text-3); min-height: 1em; } .pg-json-state.bad { color: var(--err); } .pg-kv { display: flex; flex-direction: column; gap: 4px; } .pg-kv-row { display: grid; grid-template-columns: 1fr 1.6fr 26px; gap: 4px; } .pg-rules { display: flex; flex-direction: column; gap: 8px; } .pg-rules:empty::before { content: attr(data-empty); color: var(--text-3); font-size: 12px; } .pg-rule { border: 1px solid var(--line); border-radius: 9px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); } .pg-rule.off { opacity: 0.55; } .pg-rule-top { display: flex; gap: 6px; align-items: center; } .pg-rule-top select { width: auto; flex: none; } .pg-rule-top input[type="text"] { flex: 1; } .pg-rule-top input[type="number"] { width: 72px; flex: none; } .pg-rule-more { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .pg-rule label { font-size: 11.5px; } /* Dialog */ .pg-dialog { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0, 0, 0, 0.32); } .pg-dialog[hidden] { display: none; } .pg-dialog-box { width: min(420px, calc(100vw - 32px)); background: var(--bg-elev); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; } .pg-dialog-msg { margin: 0; line-height: 1.5; white-space: pre-wrap; } .pg-dialog-btns { display: flex; justify-content: flex-end; gap: 8px; } .pg-dialog-btns .pg-btn:not(.pg-primary) { box-shadow: inset 0 0 0 1px var(--line); } .pg-noscript { padding: 40px; text-align: center; } /* ---------- Small screens ---------- */ @media (max-width: 1100px) { .pg-btn span:not(:only-child) { display: none; } .pg-run span, .pg-run kbd { display: inline !important; } .pg-wins .pg-btn span { display: none; } } @media (max-width: 860px) { .kind-playground body { overflow: auto; } .pg-main { height: auto; } .pg { height: auto; } .pg-body { grid-template-columns: 1fr; grid-template-rows: auto 60vh 0 auto; } .pg-files { border-right: 0; border-bottom: 1px solid var(--line); max-height: 240px; } .pg-split { display: none; } .pg-out { min-height: 50vh; border-top: 1px solid var(--line); } .pg-win { left: 8px !important; right: 8px; top: 70px !important; width: auto !important; } .pg-grid2 { grid-template-columns: 1fr; } }