| 1 | :root { |
| 2 | color-scheme: light; |
| 3 | --bg: #f2f3f5; |
| 4 | --panel: #ffffff; |
| 5 | --text: #1c1e21; |
| 6 | --muted: #6b7280; |
| 7 | --border: #e3e5e8; |
| 8 | --accent: #2481cc; |
| 9 | --chat: #e6ebf0; |
| 10 | --bubble: #ffffff; |
| 11 | --ok: #16a34a; |
| 12 | --bad: #dc2626; |
| 13 | --warn: #d97706; |
| 14 | } |
| 15 | :root[data-theme="dark"] { |
| 16 | color-scheme: dark; |
| 17 | --bg: #0e1621; |
| 18 | --panel: #17212b; |
| 19 | --text: #e9edf1; |
| 20 | --muted: #8b98a5; |
| 21 | --border: #243442; |
| 22 | --chat: #0e1621; |
| 23 | /* = bg_color of the framework's default dark palette (sdk-policy.ts DEFAULT_THEME_PARAMS), which the dev app passes: |
| 24 | the renderer paints the widget's root in it (the UA layer, docs/sdk-v1.md §2.4), so the bubble must be that colour. */ |
| 25 | --bubble: #212121; |
| 26 | } |
| 27 | * { box-sizing: border-box; } |
| 28 | html, body { margin: 0; height: 100%; } |
| 29 | body { font: 13px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); } |
| 30 | /* minmax(0, 1fr): grid items default to min-height: auto, which let the row grow with the stage instead of letting it scroll. */ |
| 31 | #app { display: grid; grid-template-columns: 240px 1fr 380px; grid-template-rows: minmax(0, 1fr); height: 100vh; } |
| 32 | aside { background: var(--panel); border-right: 1px solid var(--border); overflow: auto; padding: 10px; display: flex |
| 33 | #right { border-right: 0; border-left: 1px solid var(--border); } |
| 34 | h2, h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var( |
| 35 | #drop { border: 2px dashed var(--border); border-radius: 8px; padding: 14px; text-align: center; color: var( |
| 36 | #drop.over { border-color: var(--accent); color: var(--accent); } |
| 37 | #corpus { list-style: none; margin: 0; padding: 0; } |
| 38 | #corpus li { padding: 4px 6px; border-radius: 4px; cursor: pointer; font-family: ui-monospace, Menlo, monospace; font-size: 12 |
| 39 | #corpus li:hover { background: var(--bg); } |
| 40 | #corpus li.active { background: var(--accent); color: #fff; } |
| 41 | #center { display: flex; flex-direction: column; min-width: 0; } |
| 42 | .toolbar { display: flex; gap: 14px; align-items: center; padding: 8px 14px; background: var(--panel); border-bottom: |
| 43 | .toolbar .spacer { flex: 1; } |
| 44 | #title { font-family: ui-monospace, Menlo, monospace; } |
| 45 | /* min-height: 0 — a flex child with overflow: auto only scrolls when it may shrink below its content (needed by tests/lifecycle.spec.ts, which scrolls the bubble away). */ |
| 46 | .stage { flex: 1; min-height: 0; display: flex; gap: 24px; justify-content: center; align-items: flex-start; padding: 24px |
| 47 | .chat { width: var(--chat-width, 420px); flex: none; } |
| 48 | /* setResizeAnchor('bottom'): the bubble's bottom edge stays put, it grows upward from the stage's bottom (main.ts applyAnchor). */ |
| 49 | .stage #chat-sandbox.anchor-bottom { margin-top: auto; } |
| 50 | .stage.free-width #chat-sandbox { resize: horizontal; overflow: hidden; min-width: 200px; max-width: 1200px; padding-right: 6px; } |
| 51 | .chat.hidden { display: none; } |
| 52 | /* compare mode: the extra columns sit in the stage's flex row; four bubbles need narrower columns */ |
| 53 | .compare-chats { display: contents; } |
| 54 | .stage.compare .chat { width: var(--chat-width, 340px); } |
| 55 | .chat .compare-status { font-size: 11px; color: var(--muted); margin: 4px 0 0 8px; white-space: pre-wrap; } |
| 56 | .bubble-head { font-size: 11px; color: var(--muted); margin: 0 0 4px 8px; } |
| 57 | /* The network marker (docs/integration.md): a tap may send data to the bot's server (the message has can_query). */ |
| 58 | .net-marker { margin-left: 6px; padding: 0 6px; border-radius: 8px; color: var(--accent); border: 1px solid |
| 59 | .net-marker.hidden { display: none; } |
| 60 | /* The bubble is the widget's canvas, as on a client (docs/sdk-v1.md §2.4, docs/integration.md): no padding of its own (the |
| 61 | widget's body margin is the inset), the background in exactly the bg_color the dev app passes (main.ts sets --bubble from |
| 62 | the same palette), and the radius clips what the widget paints. Text bubbles of the feed keep their padding (below). */ |
| 63 | .bubble { position: relative; background: var(--bubble); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px |
| 64 | #widget-error { margin: 4px 8px 0; font-size: 11px; color: var(--bad); white-space: nowrap; overflow: hidden; |
| 65 | #widget-error.hidden { display: none; } |
| 66 | /* The client's time over a widget with no caption below it (main.ts setTimeCorner; its geometry is reference.ts timeCornerStyle). */ |
| 67 | #time-corner-view.hidden, #time-corner-ref.hidden { display: none; } |
| 68 | .frame-wrap { width: 100%; } |
| 69 | .widget-frame { display: block; width: 100%; height: 24px; border: 0; background: transparent; } |
| 70 | section { display: flex; flex-direction: column; min-height: 0; } |
| 71 | section.grow { flex: 1; } |
| 72 | #status.ok { color: var(--ok); } |
| 73 | #status.dead { color: var(--bad); font-weight: 600; } |
| 74 | #stats { border-collapse: collapse; font-size: 12px; } |
| 75 | #stats th { text-align: left; font-weight: 500; color: var(--muted); padding: 1px 8px 1px 0; |
| 76 | #stats td { padding: 1px 0; } |
| 77 | #diags, #bridge { list-style: none; margin: 0; padding: 0; font-size: 12px; } |
| 78 | #diags li { padding: 2px 0; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow |
| 79 | #diags li b { color: var(--warn); } |
| 80 | #diags li.diag-url-blocked b, #diags li.diag-network-blocked b, #diags li.diag-navigation-blocked b, #diags li.diag-protocol-violation b, #diags |
| 81 | #diags li.diag-library b, #diags li.diag-boot b { color: var(--ok); } |
| 82 | /* the mock bot (mock-bot.ts) */ |
| 83 | #bot-panel { display: flex; flex-direction: column; gap: 4px; font-size: 12px; } |
| 84 | #bot-panel .bot-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; } |
| 85 | #bot-panel label { display: inline-flex; gap: 3px; align-items: center; } |
| 86 | #bot-panel input[type=number] { width: 64px; } |
| 87 | #bot-panel textarea { width: 100%; resize: vertical; font: 11px/1.4 ui-monospace, Menlo, monospace; background: var(--bg); color |
| 88 | #bot-panel .bot-title { font-size: 11px; } |
| 89 | #bot-requests { list-style: none; margin: 0; padding: 0; font: 11px/1.4 ui-monospace, Menlo, monospace; } |
| 90 | #bot-requests li { padding: 2px 0; border-bottom: 1px solid var(--border); word-break: break-word; } |
| 91 | .bubble-copied { top: auto; bottom: 6px; max-width: calc(100% - 12px); white-space: nowrap; overflow: hidden; |
| 92 | #console { flex: 1; min-height: 120px; margin: 0; overflow: auto; font: 11px/1.4 ui-monospace, Menlo, monospace; background |
| 93 | .log-error { color: var(--bad); } |
| 94 | .log-warn { color: var(--warn); } |
| 95 | .log-debug, .log-info { color: var(--muted); } |
| 96 | |
| 97 | /* ───────────── chat feed demo (?feed=1, src/feed.ts) ───────────── */ |
| 98 | #app.feed-mode { grid-template-columns: 1fr; } |
| 99 | #app.feed-mode #left, #app.feed-mode #right, #app.feed-mode .stage, #app.feed-mode .single-only { display: none; } |
| 100 | #feed-view { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; } |
| 101 | #feed-view.hidden { display: none; } |
| 102 | .feed-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 6px 14px; background: var( |
| 103 | .feed-bar .feed-group { display: inline-flex; gap: 6px; align-items: center; } |
| 104 | .feed-bar label { display: inline-flex; gap: 3px; align-items: center; cursor: pointer; } |
| 105 | .feed-bar input[type=number] { width: 56px; } |
| 106 | .feed-main { flex: 1; min-height: 0; display: flex; } |
| 107 | .feed-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; background: var(--chat); overflow-anchor: none; /* the feed keeps the resize anchor itself (feed.ts) */ } |
| 108 | /* The bench panel (src/feed-bench.ts): a column to the left of the feed, the two live tables, tabular numbers. */ |
| 109 | .feed-bench { width: 600px; max-width: 55%; min-height: 0; overflow: auto; padding: 10px 14px 24px; |
| 110 | .feed-bench.hidden { display: none; } |
| 111 | .feed-bar button.on { outline: 2px solid var(--accent); outline-offset: -2px; } |
| 112 | .bench-title { font-weight: 600; font-size: 13px; } |
| 113 | .bench-form { display: flex; flex-direction: column; gap: 6px; } |
| 114 | .bench-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } |
| 115 | .bench-row input[type=number] { width: 56px; } |
| 116 | .bench-combos { display: grid; grid-template-columns: max-content repeat(2, 64px); gap: 2px 10px; align-items: center; } |
| 117 | .bench-combos label { display: flex; justify-content: center; } |
| 118 | .bench-progress { min-height: 1.5em; } |
| 119 | .bench-progress.ok { color: var(--ok); } |
| 120 | .bench-progress.bad { color: var(--bad); } |
| 121 | .bench-results h3 { margin: 12px 0 4px; font-size: 12px; font-weight: 600; } |
| 122 | .bench-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; } |
| 123 | .bench-table th, .bench-table td { padding: 2px 6px; text-align: right; white-space: nowrap; border-bottom: 1px solid |
| 124 | .bench-table th { color: var(--muted); font-weight: 500; } |
| 125 | .bench-table th:first-child, .bench-table td:first-child { text-align: left; padding-left: 0; white-space: normal; color: var(--muted); } |
| 126 | .bench-table .bench-group td { padding-top: 8px; color: var(--text); font-weight: 600; text-align: left; border-bottom: none; } |
| 127 | .bench-table .bench-group td .muted { font-weight: 400; } |
| 128 | .bench-note { margin-top: 6px; line-height: 1.45; } |
| 129 | .feed-bench .muted { color: var(--muted); } |
| 130 | /* The column has to scroll past the overlay (bottom right): room below the last bubble. */ |
| 131 | .feed-col { width: 520px; max-width: 100%; margin: 0 auto; padding: 16px 12px 180px; display: |
| 132 | .feed-bubble.widget { width: 420px; max-width: 100%; } |
| 133 | .feed-bubble.text .bubble { display: inline-block; max-width: 70%; padding: 8px 12px; font-size: 14px; } |
| 134 | .feed-bubble.text.out { text-align: right; } |
| 135 | .feed-bubble.text.out .bubble { background: var(--accent); color: #fff; } |
| 136 | .feed-bubble .bubble-head { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } |
| 137 | .feed-bubble.dead .bubble-head { color: var(--bad); } |
| 138 | .feed-foot { margin: 4px 8px 0; font-size: 11px; color: var(--bad); white-space: nowrap; overflow: hidden; |
| 139 | .feed-foot.hidden { display: none; } |
| 140 | .feed-wrap { position: relative; } |
| 141 | /* The boot placeholder: stripes over whatever the renderer has (an empty document, or nothing yet) and the milliseconds the reader is waiting. */ |
| 142 | .feed-wrap.booting::after { |
| 143 | content: 'booting ' attr(data-ms); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; |
| 144 | font: 12px/1 ui-monospace, Menlo, monospace; color: var(--muted); border-radius: 8px; |
| 145 | background: repeating-linear-gradient(135deg, rgba(128,128,128,.10) 0 10px, rgba(128,128,128, |
| 146 | } |
| 147 | .feed-parked { display: flex; align-items: center; justify-content: center; font: 11px/1 ui-monospace, Menlo, monospace; color: var(--muted |
| 148 | .feed-stopped { color: var(--bad); border-color: var(--bad); } |
| 149 | .feed-overlay { position: absolute; right: 14px; bottom: 14px; min-width: 340px; max-width: 520px; padding: 8px |
| 150 | .feed-overlay table { border-collapse: collapse; margin: 4px 0; } |
| 151 | .feed-overlay th, .feed-overlay td { text-align: right; padding: 0 0 0 12px; font-weight: 500; } |
| 152 | .feed-overlay th:first-child, .feed-overlay td:first-child { text-align: left; padding-left: 0; color: var(--muted); } |
| 153 | .feed-overlay th { color: var(--muted); } |
| 154 | .feed-overlay .ok { color: var(--ok); } |
| 155 | .feed-overlay .bad { color: var(--bad); font-weight: 600; } |
| 156 | .feed-overlay .warn { color: var(--warn); } |
| 157 | .feed-overlay .muted { color: var(--muted); } |
| 158 | |
| 159 | /* What the bubble did with a press (bubble-gestures.ts): a label over the bubble for a moment. */ |
| 160 | .bubble-gesture { position: absolute; top: 6px; right: 6px; z-index: 1; padding: 2px 8px; border-radius: 10 |
| 161 | @keyframes bubble-gesture { 0%, 70% { opacity: 1; } 100% { opacity: 0; } } |
| 162 | #gestures { font-size: 12px; } |
| 163 | #width-value { color: var(--muted); font-variant-numeric: tabular-nums; } |
| 164 | #stats tr.size-warning td { color: var(--warn); font-weight: 500; } |
| 165 | #stats tr.size-error td { color: var(--bad); font-weight: 600; } |
| 166 | #stats tr.size td div { font-weight: 400; font-size: 11px; max-width: 280px; } |
| 167 | |
| 168 | /* The mock wallet window (mock-bot.ts showWalletWindow): the client's own sheet over the chat, outside the bubble. */ |
| 169 | .wallet-sheet { position: fixed; inset: 0; background: rgb(0 0 0 / .35); display: flex; align-items: flex-end; justify-content |
| 170 | .wallet-card { background: var(--panel); color: var(--text); width: min(420px, 100%); border-radius: 14px 14px |
| 171 | .wallet-head { font-weight: 600; font-size: 15px; } |
| 172 | .wallet-line b { font-size: 15px; } |
| 173 | .wallet-text { margin: 0; padding: 8px; background: var(--bg); border-radius: 6px; white-space: pre-wrap; font: 12px/ |
| 174 | .wallet-warn { color: var(--warn); } |
| 175 | .wallet-buttons { display: flex; gap: 8px; justify-content: flex-end; } |
| 176 | .wallet-buttons button { padding: 6px 14px; } |
| 177 | #wallet-confirm { background: var(--accent); color: #fff; border: 0; border-radius: 6px; } |
| 178 | |