dsh-better-goal 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/client.js CHANGED
@@ -17,7 +17,7 @@
17
17
  * so a stale render cannot become the authority.
18
18
  *
19
19
  * Styling follows the shared UI contract (Apollo docs/UI-KIT.md): flat 1px
20
- * lines, one 920px settings column, 32px controls. Everything is scoped under
20
+ * lines, one 960px settings column, 32px controls. Everything is scoped under
21
21
  * `dbg-` classes; no shadcn, no build.
22
22
  */
23
23
 
@@ -49,12 +49,15 @@ window.__ModuleLoader__.load({
49
49
  * is scoped. Registering the same page under every exact key keeps the
50
50
  * independent plugin's config namespace and store unchanged in any assembly.
51
51
  */
52
+ const BETTER_DSH_ROW_KEY = 'dsh-better-dsh#dsh-better-goal'
52
53
  const APOLLO_ROW_KEY = 'dsh-apollo#dsh-better-goal'
53
54
  /** Apollo's published scoped package name declares the same row. */
54
55
  const SCOPED_APOLLO_ROW_KEY = '@menghuan1918/dsh-apollo#dsh-better-goal'
55
56
  /** Every assembly's `plugins.row.config` key, in dispatch order. */
56
- const ROW_CONFIG_KEYS = Object.freeze([ROW_KEY, APOLLO_ROW_KEY, SCOPED_APOLLO_ROW_KEY])
57
+ const ROW_CONFIG_KEYS = Object.freeze([ROW_KEY, BETTER_DSH_ROW_KEY, APOLLO_ROW_KEY, SCOPED_APOLLO_ROW_KEY])
57
58
  const ROUND_LIMIT_MODES = Object.freeze(['agent', 'unlimited', 'fixed'])
59
+ /** Continuation-mode cards, in radiogroup order. */
60
+ const IMPLEMENTATION_MODES = Object.freeze(['enhanced', 'native'])
58
61
  const DEFAULT_ROUND_LIMIT = 256
59
62
  const UNLIMITED_ROUNDS = Number.MAX_SAFE_INTEGER
60
63
  const STYLE_GOAL = 'dsh-better-goal/goal.css'
@@ -66,7 +69,7 @@ window.__ModuleLoader__.load({
66
69
  const zh = {
67
70
  summary: '目标与自动续跑',
68
71
  waitingForm: '正在加载设置…',
69
- noFormHint: '请检查插件的设置服务是否已加载,并使用受信任的连接。',
72
+ noFormHint: '请使用受信任的连接打开设置。',
70
73
  loading: '正在读取配置…',
71
74
  unavailable: '设置不可用',
72
75
  readonly: '只读',
@@ -77,12 +80,18 @@ window.__ModuleLoader__.load({
77
80
  saveFailed: '保存失败:',
78
81
  reset: '放弃改动',
79
82
  modeLabel: '轮数策略',
83
+ roundDefinition: '一轮指目标的一次自动续跑。',
80
84
  modeAgent: '由 Agent 决定',
81
- modeAgentHint: '可由 Agent 设置;未设置时不限轮数。',
85
+ modeAgentFlow: '目标 → 由 Agent 决定 → 上限',
86
+ modeAgentStop: '达到 Agent 设定的上限、目标完成或受阻时停止。',
82
87
  modeUnlimited: '无上限',
83
- modeUnlimitedHint: '持续推进,直到完成或暂停。',
88
+ modeUnlimitedFlow: '目标 → 第 1 轮 → 第 2 轮 → …',
89
+ modeUnlimitedStop: '仅在目标完成或受阻时停止。',
84
90
  modeFixed: '固定轮数',
85
- modeFixedHint: '每个目标最多运行指定轮数。',
91
+ modeFixedFlow: '目标 → 第 1 轮 → … → 第 N 轮',
92
+ modeFixedStop: '达到第 N 轮后停止。',
93
+ modeStop: '停止条件',
94
+ roundSpan: '第 1 轮 → … → 第 {rounds} 轮',
86
95
  roundLimitLabel: '轮数上限',
87
96
  roundLimitHint: '达到上限后停止续跑。',
88
97
  roundLimitUnlimited: '当前值等于兼容哨兵,界面显示为无上限。',
@@ -94,8 +103,8 @@ window.__ModuleLoader__.load({
94
103
  invalidQuestionTimeout: '提问超时必须是 -1,或 1 到 2147483 之间的整数。',
95
104
  readonlyNote: '只读:当前无法写入宿主配置。',
96
105
  unavailableNote: '不可写:当前连接下该配置不可用。',
97
- settingsTitle: '目标',
98
- settingsIntro: '',
106
+ settingsTitle: '目标与续跑',
107
+ settingsIntro: '管理目标自动续跑的方式、轮数上限与受阻判定。',
99
108
  'phase.active': '进行中',
100
109
  'phase.active.disarmed': '已暂停',
101
110
  'phase.paused': '已暂停',
@@ -110,24 +119,34 @@ window.__ModuleLoader__.load({
110
119
  'action.clear': '清除目标',
111
120
  'cap.unlimited': '无上限',
112
121
  'meta.rounds': '第 {rounds} / {max} 轮',
113
- nativeSection: '原生策略',
122
+ nativeSection: 'DSH 续跑策略',
114
123
  nativeDefaultLabel: '默认轮数上限',
115
- nativeDefaultHint: '新目标未指定上限时使用;已有目标保持原值。',
124
+ nativeDefaultHint: '新目标未指定上限时使用此值。',
116
125
  nativeBlockedLabel: '报告受阻门槛',
117
- nativeBlockedHint: 'Agent 执行到此轮数后可报告受阻。',
118
- invalidImplementation: '请选择目标实现。',
119
- invalidNative: '原生参数必须是正安全整数。',
126
+ nativeBlockedHint: '达到该轮数后 Agent 可报告受阻。',
127
+ invalidImplementation: '请选择续跑模式。',
128
+ invalidNative: '请输入 1 到 9007199254740991 之间的整数。',
120
129
  help: '了解设置',
121
- implementation: '目标实现',
122
- implEnhancedHint: '由 Agent 控制轮数',
123
- implNativeHint: '使用宿主轮数策略',
130
+ implementation: '续跑模式',
131
+ implementationHint: '切换模式需保存后重启当前 profile。',
132
+ implEnhancedTag: '本插件驱动',
133
+ implNativeTag: '宿主原生',
134
+ implEnhancedFlow: '目标 → 第 1 轮 → 第 2 轮 → … → 上限/完成/受阻',
135
+ implNativeFlow: '目标 → DSH 原生驱动 → 宿主轮数策略',
136
+ implEnhancedBullet1: '每轮自动推进',
137
+ implEnhancedBullet2: '达到上限/完成/受阻时停止',
138
+ implEnhancedBullet3: '支持 Agent/无上限/固定轮数',
139
+ implNativeBullet1: '使用原生 goal 服务与工具',
140
+ implNativeBullet2: '本页只设置原生默认轮数与受阻门槛',
141
+ implNativeBullet3: '切换后需重载',
124
142
  replaceNative: '替换原生 Goal',
125
143
  replaceHint: '关闭后由宿主原生 Goal 管理目标与续跑。保存后重启当前 profile。',
126
144
  reloadRequired: '重启 profile 后生效',
127
- runtimeBetter: '增强',
128
- runtimeNative: '原生',
145
+ runtimeBetter: '自定义续跑',
146
+ runtimeNative: 'DSH 默认',
129
147
  runtimeLoading: '正在检查运行状态…',
130
148
  runtimeUnavailable: '无法读取运行状态。',
149
+ refreshRuntime: '刷新运行状态',
131
150
  nativeDependency: '原生模式使用宿主的轮数策略。',
132
151
  runtimeActive: '当前运行:{implementation}',
133
152
  roundsSection: '自动续跑',
@@ -164,7 +183,7 @@ window.__ModuleLoader__.load({
164
183
  const en = {
165
184
  summary: 'Goals and continuation',
166
185
  waitingForm: 'Loading settings…',
167
- noFormHint: 'Check that the plugin settings service is loaded and use a trusted connection.',
186
+ noFormHint: 'Use a trusted connection to open these settings.',
168
187
  loading: 'Loading configuration…',
169
188
  unavailable: 'Settings unavailable',
170
189
  readonly: 'Read-only',
@@ -175,12 +194,18 @@ window.__ModuleLoader__.load({
175
194
  saveFailed: 'Save failed: ',
176
195
  reset: 'Discard',
177
196
  modeLabel: 'Round policy',
178
- modeAgent: 'Agent decides',
179
- modeAgentHint: 'The agent can set a cap; defaults to unlimited.',
197
+ roundDefinition: 'A round is one automatic continuation of the goal.',
198
+ modeAgent: 'Agent-decided',
199
+ modeAgentFlow: 'Goal → Agent decides → cap',
200
+ modeAgentStop: 'Stops at the agent-set cap, on completion, or when blocked.',
180
201
  modeUnlimited: 'Unlimited',
181
- modeUnlimitedHint: 'Continue until complete or paused.',
202
+ modeUnlimitedFlow: 'Goal → Round 1 → Round 2 → …',
203
+ modeUnlimitedStop: 'Stops only on completion or when blocked.',
182
204
  modeFixed: 'Fixed rounds',
183
- modeFixedHint: 'Limit each goal to a fixed number of rounds.',
205
+ modeFixedFlow: 'Goal → Round 1 → … → Round N',
206
+ modeFixedStop: 'Stops after round N.',
207
+ modeStop: 'Stop condition',
208
+ roundSpan: 'Round 1 → … → Round {rounds}',
184
209
  roundLimitLabel: 'Round limit',
185
210
  roundLimitHint: 'Automatic continuation stops at the limit.',
186
211
  roundLimitUnlimited: 'This value is the compatibility sentinel; the UI renders it as unlimited.',
@@ -192,8 +217,8 @@ window.__ModuleLoader__.load({
192
217
  invalidQuestionTimeout: 'The timeout must be -1 or an integer from 1 to 2147483.',
193
218
  readonlyNote: 'Read-only: host configuration cannot be written.',
194
219
  unavailableNote: 'Not writable: this configuration is unavailable on the current connection.',
195
- settingsTitle: 'Goals',
196
- settingsIntro: '',
220
+ settingsTitle: 'Goals and continuation',
221
+ settingsIntro: 'Manage how goals continue automatically, including rounds and blocked reporting.',
197
222
  'phase.active': 'Running',
198
223
  'phase.active.disarmed': 'Paused',
199
224
  'phase.paused': 'Paused',
@@ -208,24 +233,34 @@ window.__ModuleLoader__.load({
208
233
  'action.clear': 'Clear goal',
209
234
  'cap.unlimited': 'unlimited',
210
235
  'meta.rounds': 'Round {rounds} / {max}',
211
- nativeSection: 'Native policy',
236
+ nativeSection: 'DSH continuation policy',
212
237
  nativeDefaultLabel: 'Default round cap',
213
- nativeDefaultHint: 'Used when a new goal omits its cap. Existing goals keep theirs.',
238
+ nativeDefaultHint: 'Used for new goals without an explicit cap.',
214
239
  nativeBlockedLabel: 'Minimum rounds to report blocked',
215
- nativeBlockedHint: 'The agent can report blocked after this many admitted rounds.',
216
- invalidImplementation: 'Choose a goal implementation.',
217
- invalidNative: 'Native parameters must be positive safe integers.',
240
+ nativeBlockedHint: 'The agent may report blocked after this many rounds.',
241
+ invalidImplementation: 'Choose a continuation mode.',
242
+ invalidNative: 'Enter a whole number from 1 to 9007199254740991.',
218
243
  help: 'About these settings',
219
- implementation: 'Implementation',
220
- implEnhancedHint: 'Agent-controlled rounds',
221
- implNativeHint: 'Host round policy',
244
+ implementation: 'Continuation mode',
245
+ implementationHint: 'Save and restart the current profile to switch modes.',
246
+ implEnhancedTag: 'Plugin-driven',
247
+ implNativeTag: 'Host-native',
248
+ implEnhancedFlow: 'Goal → Round 1 → Round 2 → … → limit/complete/blocked',
249
+ implNativeFlow: 'Goal → DSH native driver → host round policy',
250
+ implEnhancedBullet1: 'Advances automatically each round',
251
+ implEnhancedBullet2: 'Stops at the cap, on completion, or when blocked',
252
+ implEnhancedBullet3: 'Supports agent-set, unlimited, and fixed rounds',
253
+ implNativeBullet1: 'Uses the native goal service and tools',
254
+ implNativeBullet2: 'This page sets only the native default cap and blocked threshold',
255
+ implNativeBullet3: 'Reload required after switching',
222
256
  replaceNative: 'Replace native Goal',
223
257
  replaceHint: 'When off, the host’s native Goal manages goals and continuation. Save, then restart the profile.',
224
258
  reloadRequired: 'Restart the profile to apply',
225
- runtimeBetter: 'Enhanced',
226
- runtimeNative: 'Native',
259
+ runtimeBetter: 'Configurable continuation',
260
+ runtimeNative: 'DSH default',
227
261
  runtimeLoading: 'Checking runtime…',
228
262
  runtimeUnavailable: 'Runtime status unavailable.',
263
+ refreshRuntime: 'Refresh runtime status',
229
264
  nativeDependency: 'Native mode uses the host’s round policy.',
230
265
  runtimeActive: 'Running: {implementation}',
231
266
  roundsSection: 'Continuation',
@@ -273,8 +308,9 @@ window.__ModuleLoader__.load({
273
308
  }
274
309
 
275
310
  // Scoped roles inherit the host theme; all controls share the same compact geometry.
276
- const GOAL_CSS = `.dbg-dock{--cfg-accent:#3388BB;--cfg-solid:#20709e;--cfg-accent-text:#14587f;--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 10%,transparent);--cfg-ink:var(--dsw-alias-label-primary);--cfg-muted:var(--dsw-alias-label-secondary);--cfg-faint:color-mix(in srgb,var(--dsw-alias-label-tertiary) 80%,var(--dsw-alias-label-primary));--cfg-line:var(--dsw-alias-border-l1);--cfg-line-2:var(--dsw-alias-border-l2);--cfg-line-strong:var(--dsw-alias-border-l3);--cfg-base:var(--dsw-alias-bg-layer-1);--cfg-raised:var(--dsw-alias-bg-layer-2);--cfg-overlay:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));--cfg-hover:var(--dsw-alias-interactive-bg-hover);--cfg-danger:var(--dsw-alias-state-error-primary);--cfg-warn:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 60%,var(--dsw-alias-label-primary));--cfg-success:color-mix(in srgb,var(--dsw-alias-state-success-primary) 60%,var(--dsw-alias-label-primary));--cfg-on-solid:#fff;box-sizing:border-box;width:calc(100% - 2 * var(--dsh-composer-side-clearance,12px) - 4 * var(--dsh-composer-dock-inset,2px));max-width:var(--dsh-composer-card-max-width,820px);margin:0 auto;color:var(--cfg-ink);font-size:13px;line-height:20px;container-type:inline-size;container-name:better-goal-dock}
277
- .dbg-bar{box-sizing:border-box;min-height:40px;border:1px solid var(--cfg-line-2);border-radius:8px;background:var(--cfg-raised);display:flex;align-items:center;gap:8px;padding:4px 6px 4px 12px;position:relative;overflow:hidden}
311
+ const GOAL_CSS = `.dbg-dock{--cfg-accent:var(--dsw-alias-state-business-primary,#3388bb);--cfg-solid:var(--dsw-alias-button-primary-fill,#20709e);--cfg-accent-text:color-mix(in srgb,var(--cfg-accent) 70%,var(--cfg-ink));--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 10%,transparent);--cfg-ink:var(--dsw-alias-label-primary);--cfg-muted:var(--dsw-alias-label-secondary);--cfg-faint:color-mix(in srgb,var(--dsw-alias-label-tertiary) 80%,var(--dsw-alias-label-primary));--cfg-line:var(--dsw-alias-border-l1);--cfg-line-2:var(--dsw-alias-border-l2);--cfg-line-strong:var(--dsw-alias-border-l3);--cfg-base:var(--dsw-alias-bg-layer-1);--cfg-raised:var(--dsw-alias-bg-layer-2);--cfg-overlay:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));--cfg-hover:var(--dsw-alias-interactive-bg-hover);--cfg-danger:color-mix(in srgb,var(--dsw-alias-state-error-primary) 60%,var(--cfg-ink));--cfg-warn:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 60%,var(--dsw-alias-label-primary));--cfg-success:color-mix(in srgb,var(--dsw-alias-state-success-primary) 60%,var(--dsw-alias-label-primary));--cfg-on-solid:var(--dsw-alias-label-primary-foreground,#fff);box-sizing:border-box;width:calc(100% - 2 * var(--dsh-composer-side-clearance,12px) - 4 * var(--dsh-composer-dock-inset,2px));max-width:var(--dsh-composer-card-max-width,820px);margin:0 auto;color:var(--cfg-ink);font-size:13px;line-height:20px;font-variant-numeric:tabular-nums;container-type:inline-size;container-name:better-goal-dock}
312
+ .dbg-bar{box-sizing:border-box;min-height:40px;border:1px solid var(--cfg-line-2);border-radius:8px;background:var(--cfg-raised);display:flex;align-items:center;gap:8px;padding:4px 6px 4px 12px;position:relative}
313
+ .dbg-bar[data-expanded=true]{border-radius:8px 8px 0 0}
278
314
  .dbg-goalGlyph{color:var(--cfg-faint);flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px}
279
315
  .dbg-goalGlyph[data-state=active]{color:var(--cfg-accent)}
280
316
  .dbg-goalGlyph[data-state=paused]{color:var(--cfg-warn)}
@@ -283,28 +319,27 @@ window.__ModuleLoader__.load({
283
319
  .dbg-label{flex:none;font-size:11px;line-height:16px;font-weight:500;color:var(--cfg-muted);white-space:nowrap}
284
320
  .dbg-goalMain{flex:1;min-width:0;display:flex;align-items:center;gap:10px}
285
321
  .dbg-goalStatus{display:flex;align-items:center;gap:8px;flex:none;min-width:0}
286
- .dbg-objective{min-width:0;flex:1;display:flex;align-items:center;gap:6px;min-height:28px;text-align:left;color:inherit;font:inherit;background:transparent;border:0;border-radius:6px;padding:2px;cursor:pointer}
287
- .dbg-objectiveText{min-width:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink)}
322
+ .dbg-objective{min-width:0;flex:1;display:flex;align-items:center;gap:6px;min-height:32px;text-align:left;color:inherit;font:inherit;background:transparent;border:0;border-radius:6px;padding:2px;cursor:pointer}
288
323
  .dbg-objective:hover{background:var(--cfg-hover)}
324
+ .dbg-objectiveText{min-width:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink)}
289
325
  .dbg-chevron{flex:none;display:inline-flex;color:var(--cfg-faint);transition:transform 100ms ease}
290
326
  [aria-expanded=true]>.dbg-chevron,.dbg-historyList details[open]>summary>.dbg-chevron{transform:rotate(180deg)}
291
327
  .dbg-meta{color:var(--cfg-faint);font-size:11px;line-height:16px;font-variant-numeric:tabular-nums;white-space:nowrap}
292
- .dbg-roundChip,.dbg-countChip{display:inline-flex;align-items:center;height:20px;padding:0 7px;border:1px solid var(--cfg-line-2);border-radius:999px;color:var(--cfg-muted);font-size:11px;line-height:18px;font-variant-numeric:tabular-nums;white-space:nowrap}
293
- .dbg-roundChip{font-family:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace)}
328
+ .dbg-roundChip,.dbg-countChip{display:inline-flex;align-items:center;height:20px;padding:0 7px;border:1px solid var(--cfg-line-2);border-radius:10px;color:var(--cfg-muted);font-size:11px;line-height:18px;font-variant-numeric:tabular-nums;white-space:nowrap}
294
329
  .dbg-error{color:var(--cfg-danger);font-size:12px;line-height:18px;overflow-wrap:anywhere;margin:0}
295
330
  .dbg-editBar{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:10px;border:1px solid var(--cfg-line-2);border-radius:8px;background:var(--cfg-raised);overflow:visible}
296
331
  .dbg-editLabel{display:block;color:var(--cfg-muted);font-size:12px;line-height:18px}
297
- .dbg-editInput{box-sizing:border-box;resize:vertical;width:100%;min-height:84px;max-height:220px;padding:8px 10px;border:1px solid var(--cfg-line-2);border-radius:8px;background:var(--cfg-base);color:inherit;font:inherit;line-height:20px}
298
- .dbg-editFooter{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:2px}
332
+ .dbg-editInput{box-sizing:border-box;resize:vertical;width:100%;min-height:84px;max-height:220px;padding:8px 10px;border:1px solid var(--cfg-line-2);border-radius:8px;background:var(--cfg-raised);color:inherit;font:inherit;line-height:20px}
333
+ .dbg-editFooter{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;margin-top:2px}
334
+ .dbg-editHint{margin-right:auto;color:var(--cfg-faint);font-size:12px;line-height:18px}
299
335
  .dbg-actions{flex:none;display:flex;align-items:center;gap:2px}
300
- .dbg-iconBtn{display:inline-flex;align-items:center;justify-content:center;flex:none;width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--cfg-muted);cursor:pointer}
336
+ .dbg-iconBtn{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--cfg-muted);cursor:pointer}
301
337
  .dbg-iconBtn:hover:not(:disabled){background:var(--cfg-hover);color:var(--cfg-ink)}
302
338
  .dbg-iconBtn[data-danger=true]:hover:not(:disabled),.dbg-iconBtn[data-armed=true]{color:var(--cfg-danger)}
303
339
  .dbg-iconBtn:disabled{opacity:.4;cursor:not-allowed}
304
- .dbg-progressTrack{position:absolute;bottom:0;left:0;right:0;height:1px;background:var(--cfg-line);pointer-events:none}
305
- .dbg-progress{display:block;height:1px;background:var(--cfg-accent)}
340
+ .dbg-progressTrack{position:absolute;bottom:1px;left:1px;right:1px;height:2px;border-radius:0 0 6px 6px;background:var(--cfg-line);pointer-events:none;overflow:hidden}
341
+ .dbg-progress{display:block;height:100%;background:var(--cfg-accent)}
306
342
  .dbg-details{box-sizing:border-box;border:1px solid var(--cfg-line-2);border-top:0;border-radius:0 0 8px 8px;background:var(--cfg-raised);margin-top:0;padding:10px 12px}
307
- .dbg-bar[data-expanded=true]{border-radius:8px 8px 0 0}
308
343
  .dbg-fullObjective{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;max-height:200px;overflow:auto;font-size:13px;line-height:20px}
309
344
  .dbg-history{box-sizing:border-box;border:1px solid var(--cfg-line-2);border-radius:10px;background:var(--cfg-raised);margin-top:6px;padding:12px}
310
345
  .dbg-historyHead{display:flex;align-items:center;gap:8px;margin-bottom:8px;font-size:13px;line-height:20px;font-weight:500}
@@ -312,34 +347,33 @@ window.__ModuleLoader__.load({
312
347
  .dbg-historyHead .dbg-countChip{margin-left:auto}
313
348
  .dbg-historyTools{display:flex;align-items:center;gap:8px;margin-bottom:8px}
314
349
  .dbg-historyTools>.dbg-choice{width:140px;flex:none}
315
- .dbg-search{appearance:none;box-sizing:border-box;min-width:0;height:32px;padding:0 10px;border:1px solid var(--cfg-line-2);border-radius:8px;color:inherit;background:var(--cfg-base);font:inherit;flex:1;width:100%}
350
+ .dbg-search{appearance:none;box-sizing:border-box;min-width:0;height:32px;padding:0 10px;border:1px solid var(--cfg-line-2);border-radius:8px;color:inherit;background:var(--cfg-raised);font:inherit;flex:1;width:100%}
316
351
  .dbg-search::-webkit-search-cancel-button{appearance:none}
317
- .dbg-historyList{list-style:none;padding:0;margin:0;max-height:320px;overflow:auto;scrollbar-width:thin;scrollbar-gutter:stable}
352
+ .dbg-historyList{list-style:none;padding:0;margin:0;max-height:320px;overflow:auto;scrollbar-width:thin;scrollbar-gutter:stable;display:flex;flex-direction:column;gap:2px}
318
353
  .dbg-historyList>li{content-visibility:auto;contain-intrinsic-size:auto 56px}
319
- .dbg-historyList>li+li{border-top:1px solid var(--cfg-line)}
320
- .dbg-historyList summary{cursor:pointer;display:flex;align-items:center;gap:8px;min-height:40px;padding:6px 4px;list-style:none;border-radius:6px}
321
- .dbg-historyList summary::-webkit-details-marker{display:none}
354
+ .dbg-historyList summary{cursor:pointer;display:flex;align-items:center;gap:8px;min-height:36px;padding:5px 6px;list-style:none;border-radius:6px}
355
+ .dbg-historyList summary::-webkit-details-marker{display:none}.dbg-historyList summary::marker{content:''}
322
356
  .dbg-historyList summary:hover{background:var(--cfg-hover)}
323
357
  .dbg-historyIdentity{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
324
358
  .dbg-historyName{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;line-height:20px;font-weight:500}
325
359
  .dbg-historyFacts{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
326
- .dbg-historyState{display:inline-flex;align-items:center;height:20px;padding:0 7px;border:1px solid var(--cfg-line-2);border-radius:999px;color:var(--cfg-muted);background:var(--cfg-base);font-size:11px;line-height:18px}
360
+ .dbg-historyState{display:inline-flex;align-items:center;height:20px;padding:0 7px;border:1px solid var(--cfg-line-2);border-radius:10px;color:var(--cfg-muted);background:var(--cfg-base);font-size:11px;line-height:18px}
327
361
  .dbg-historyState[data-phase=active]{color:var(--cfg-accent-text);border-color:color-mix(in srgb,var(--cfg-accent) 30%,transparent);background:var(--cfg-accent-soft)}
328
362
  .dbg-historyState[data-phase=blocked]{color:var(--cfg-danger);border-color:color-mix(in srgb,var(--cfg-danger) 30%,transparent)}
329
363
  .dbg-historyMeta{color:var(--cfg-faint);font-size:11px;line-height:16px;font-variant-numeric:tabular-nums;white-space:nowrap}
330
- .dbg-historyBody{padding:4px 4px 10px;border-top:1px solid var(--cfg-line);margin-top:4px}
331
- .dbg-historyBody time{display:block;margin-top:8px}
364
+ .dbg-historyBody{padding:4px 6px 8px;margin:0}
365
+ .dbg-historyBody time{display:block;margin-top:8px;white-space:normal;overflow-wrap:anywhere}
332
366
  .dbg-historyEmpty{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;padding:12px 0;color:var(--cfg-faint);font-size:12px;line-height:18px}
333
367
  .dbg-choice{position:relative;min-width:0}
334
- .dbg-choiceTrigger{appearance:none;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-width:0;height:32px;padding:0 10px;border:1px solid var(--cfg-line-2);border-radius:8px;background:var(--cfg-base);color:var(--cfg-ink);font:inherit;text-align:left;cursor:pointer}
368
+ .dbg-choiceTrigger{appearance:none;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-width:0;height:32px;padding:0 10px;border:1px solid var(--cfg-line-2);border-radius:8px;background:var(--cfg-raised);color:var(--cfg-ink);font:inherit;text-align:left;cursor:pointer}
335
369
  .dbg-choiceTrigger>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
336
370
  .dbg-choiceTrigger:after{content:'';flex:none;width:6px;height:6px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:translateY(-2px) rotate(45deg);transition:transform 100ms ease}
337
371
  .dbg-choiceTrigger[aria-expanded=true]:after{transform:translateY(2px) rotate(225deg)}
338
372
  .dbg-choiceTrigger:hover:not(:disabled){border-color:var(--cfg-line-strong)}
339
- .dbg-choiceTrigger[aria-expanded=true]{border-color:var(--cfg-accent);box-shadow:0 0 0 2px var(--cfg-accent-soft)}
373
+ .dbg-choiceTrigger[aria-expanded=true]{border-color:var(--cfg-accent);background:var(--cfg-accent-soft)}
340
374
  .dbg-choiceList{position:absolute;inset:calc(100% + 4px) 0 auto;z-index:40;box-sizing:border-box;min-width:100%;max-height:224px;overflow:auto;margin:0;padding:4px;list-style:none;border:1px solid var(--cfg-line-strong);border-radius:10px;background:var(--cfg-overlay);color:var(--cfg-ink);scrollbar-width:thin;box-shadow:0 12px 32px -12px rgb(0 0 0/.35)}
341
375
  .dbg-choice[data-side=above] .dbg-choiceList{inset:auto 0 calc(100% + 4px)}
342
- .dbg-choiceOption{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:30px;padding:0 8px;border-radius:6px;cursor:pointer;white-space:nowrap}
376
+ .dbg-choiceOption{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px;padding:0 8px;border-radius:6px;cursor:pointer;white-space:nowrap}
343
377
  .dbg-choiceOption[data-active=true]{background:var(--cfg-hover)}
344
378
  .dbg-choiceOption[aria-selected=true]{color:var(--cfg-accent-text);font-weight:500;background:var(--cfg-accent-soft)}
345
379
  .dbg-choiceOption svg{flex:none}
@@ -350,50 +384,50 @@ window.__ModuleLoader__.load({
350
384
  .dbg-button{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border:1px solid transparent;border-radius:8px;font:inherit;font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink);background:transparent;cursor:pointer}
351
385
  .dbg-button:hover:not(:disabled){background:var(--cfg-hover)}
352
386
  .dbg-button[data-variant=primary]{background:var(--cfg-solid);color:var(--cfg-on-solid);min-width:80px}
353
- .dbg-button[data-variant=primary]:hover:not(:disabled){background:color-mix(in srgb,var(--cfg-solid) 88%,black)}
387
+ .dbg-button[data-variant=primary]:hover:not(:disabled){background:color-mix(in srgb,var(--cfg-solid) 88%,var(--cfg-on-solid))}
354
388
  .dbg-button[data-variant=outline]{border-color:var(--cfg-line-2)}
355
389
  .dbg-spinner{box-sizing:border-box;display:inline-block;flex:none;width:12px;height:12px;border:1px solid currentColor;border-right-color:transparent;border-radius:50%;animation:dbg-spin .7s linear infinite}@keyframes dbg-spin{to{transform:rotate(360deg)}}
356
- @media(max-width:640px){.dbg-historyTools{flex-wrap:wrap}.dbg-historyTools>.dbg-choice{width:auto;flex:1}.dbg-bar{gap:5px}.dbg-meta{max-width:90px;overflow:hidden;text-overflow:ellipsis}}
357
- @container better-goal-dock (max-width:540px){.dbg-bar{flex-wrap:wrap}.dbg-goalMain{flex-basis:100%}.dbg-actions{margin-left:auto}}
390
+ @media(max-width:640px){.dbg-dock :is(.dbg-iconBtn,.dbg-button,.dbg-objective,.dbg-search,.dbg-choiceTrigger,.dbg-choiceOption,.dbg-historyList summary){min-height:44px}.dbg-iconBtn{width:44px}.dbg-historyTools{flex-direction:column;align-items:stretch}.dbg-historyTools>.dbg-choice{width:100%}.dbg-historyName{white-space:normal;overflow-wrap:anywhere}.dbg-bar{gap:6px}}
391
+ @media(pointer:coarse){.dbg-dock :is(.dbg-iconBtn,.dbg-button,.dbg-objective,.dbg-search,.dbg-choiceTrigger,.dbg-choiceOption,.dbg-historyList summary){min-height:44px}.dbg-iconBtn{width:44px}}
392
+ @container better-goal-dock (max-width:540px){.dbg-bar{flex-wrap:wrap}.dbg-goalMain{flex-basis:100%}.dbg-actions{margin-left:auto}.dbg-dock :is(.dbg-iconBtn,.dbg-button,.dbg-objective,.dbg-search,.dbg-choiceTrigger,.dbg-choiceOption,.dbg-historyList summary){min-height:44px}.dbg-iconBtn{width:44px}.dbg-historyTools{flex-direction:column;align-items:stretch}.dbg-historyTools>.dbg-choice{width:100%}.dbg-historyName{white-space:normal;overflow-wrap:anywhere}}
358
393
  @container better-goal-dock (max-width:360px){.dbg-goalMain{align-items:stretch;flex-direction:column;gap:2px}.dbg-goalStatus{flex-wrap:wrap}}
359
- [data-ds-dark-theme] .dbg-dock{--cfg-accent:#4eb0e8;--cfg-solid:#4eb0e8;--cfg-on-solid:#0e1014;--cfg-accent-text:#6fc0ee;--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 14%,transparent)}
394
+ [data-ds-dark-theme] .dbg-dock{--cfg-accent:var(--dsw-alias-state-business-primary,#4eb0e8);--cfg-solid:var(--dsw-alias-button-primary-fill,#4eb0e8);--cfg-on-solid:var(--dsw-alias-label-primary-foreground,#0e1014);--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 14%,transparent)}
360
395
  @media(prefers-reduced-motion:reduce){.dbg-dock *{animation:none!important;transition:none!important}}`
361
396
 
362
- const SETTINGS_CSS = `.dbg-cfg{--cfg-accent:#3388BB;--cfg-solid:#20709e;--cfg-accent-text:#14587f;--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 10%,transparent);--cfg-ink:var(--dsw-alias-label-primary);--cfg-muted:var(--dsw-alias-label-secondary);--cfg-faint:color-mix(in srgb,var(--dsw-alias-label-tertiary) 80%,var(--dsw-alias-label-primary));--cfg-line:var(--dsw-alias-border-l1);--cfg-line-2:var(--dsw-alias-border-l2);--cfg-line-strong:var(--dsw-alias-border-l3);--cfg-base:var(--dsw-alias-bg-layer-1);--cfg-raised:var(--dsw-alias-bg-layer-2);--cfg-overlay:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));--cfg-hover:var(--dsw-alias-interactive-bg-hover);--cfg-danger:var(--dsw-alias-state-error-primary);--cfg-on-solid:#fff;display:flex;flex-direction:column;gap:24px;max-width:920px;min-width:0;margin:0 auto;width:100%;flex:1;min-height:0;container-type:inline-size;container-name:better-goal-settings;font-size:13px;line-height:20px;color:var(--cfg-ink);font-variant-numeric:tabular-nums}
397
+ const SETTINGS_CSS = `.dbg-cfg{--cfg-accent:var(--dsw-alias-state-business-primary,#3388bb);--cfg-solid:var(--dsw-alias-button-primary-fill,#20709e);--cfg-accent-text:color-mix(in srgb,var(--cfg-accent) 70%,var(--cfg-ink));--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 10%,transparent);--cfg-ink:var(--dsw-alias-label-primary);--cfg-muted:var(--dsw-alias-label-secondary);--cfg-faint:color-mix(in srgb,var(--dsw-alias-label-tertiary) 80%,var(--dsw-alias-label-primary));--cfg-line:var(--dsw-alias-border-l1);--cfg-line-2:var(--dsw-alias-border-l2);--cfg-line-strong:var(--dsw-alias-border-l3);--cfg-base:var(--dsw-alias-bg-layer-1);--cfg-raised:var(--dsw-alias-bg-layer-2);--cfg-overlay:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));--cfg-hover:var(--dsw-alias-interactive-bg-hover);--cfg-danger:color-mix(in srgb,var(--dsw-alias-state-error-primary) 60%,var(--cfg-ink));--cfg-warn:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 60%,var(--cfg-ink));--cfg-success:color-mix(in srgb,var(--dsw-alias-state-success-primary) 60%,var(--cfg-ink));--cfg-on-solid:var(--dsw-alias-label-primary-foreground,#fff);display:flex;flex-direction:column;gap:20px;max-width:960px;min-width:0;margin:0 auto;width:100%;flex:1;min-height:0;container-type:inline-size;container-name:better-goal-settings;font-size:13px;line-height:20px;color:var(--cfg-ink);font-variant-numeric:tabular-nums}
363
398
  .dbg-cfg *{box-sizing:border-box}
399
+ .dbg-pageHead{display:flex;flex-direction:column;gap:4px;min-width:0}
364
400
  .dbg-title{margin:0;font-size:20px;line-height:28px;font-weight:500;letter-spacing:-.01em}
401
+ .dbg-pagePurpose{margin:0;color:var(--cfg-muted);font-size:13px;line-height:20px}
365
402
  .dbg-note{margin:0;padding:6px 10px;border:1px solid var(--cfg-line-2);border-radius:6px;background:var(--cfg-raised);color:var(--cfg-muted);font-size:12px;line-height:18px}
366
403
  .dbg-note[data-tone=error],.dbg-status[data-tone=error],.dbg-fieldError{color:var(--cfg-danger)}
367
404
  .dbg-note[data-tone=warn]{color:var(--cfg-warn)}
368
- .dbg-section{display:flex;flex-direction:column;gap:8px;min-width:0;border:0;border-top:1px solid var(--cfg-line-2);padding:12px 0 0;margin:0}
369
- .dbg-section:first-of-type{border-top:0;padding-top:0}
370
- .dbg-section>legend{display:block;width:100%;margin:0;padding:0 0 6px;border-bottom:1px solid var(--cfg-line);color:var(--cfg-faint);font-size:12px;line-height:18px;font-weight:500;letter-spacing:.02em}
405
+ .dbg-section{display:flex;flex-direction:column;gap:10px;min-width:0;border:0;padding:0;margin:0}
406
+ .dbg-section>legend{display:block;width:100%;margin:0;padding:0 0 8px;border-bottom:1px solid var(--cfg-line);color:var(--cfg-faint);font-size:12px;line-height:18px;font-weight:500;letter-spacing:.02em}
407
+ .dbg-hint{margin:0;color:var(--cfg-faint);font-size:12px;line-height:18px}
371
408
  .dbg-modeCards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
372
- .dbg-modeCard{position:relative;display:flex;align-items:flex-start;gap:10px;min-width:0;padding:12px;border:1px solid var(--cfg-line-2);border-radius:10px;background:var(--cfg-raised);cursor:pointer;transition:background-color 140ms ease,border-color 140ms ease}
373
- .dbg-modeCard:hover{background:var(--cfg-hover)}.dbg-modeCard[data-disabled=true]{opacity:.4;cursor:not-allowed}
409
+ .dbg-optionCards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
410
+ .dbg-modeCard{position:relative;display:flex;flex-direction:column;gap:10px;min-width:0;padding:14px;border:1px solid var(--cfg-line-2);border-radius:10px;background:var(--cfg-raised);cursor:pointer;transition:background-color 140ms ease,border-color 140ms ease}
411
+ .dbg-modeCard:hover{background:var(--cfg-hover)}
412
+ .dbg-modeCard[data-disabled=true]{opacity:.4;cursor:not-allowed}
374
413
  .dbg-modeCard[data-checked=true]{border-color:var(--cfg-accent);background:var(--cfg-accent-soft)}
375
414
  .dbg-modeCard:has(.dbg-segmentInput:focus-visible){outline:2px solid var(--cfg-accent);outline-offset:2px}
415
+ .dbg-modeCardHead{display:flex;align-items:center;gap:8px;min-width:0}
376
416
  .dbg-modeCardGlyph{display:inline-flex;align-items:center;justify-content:center;flex:none;width:28px;height:28px;border:1px solid var(--cfg-line-2);border-radius:8px;background:var(--cfg-base);color:var(--cfg-muted)}
377
417
  .dbg-modeCard[data-checked=true] .dbg-modeCardGlyph{border-color:color-mix(in srgb,var(--cfg-accent) 30%,transparent);color:var(--cfg-accent-text)}
378
- .dbg-modeCardText{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
379
- .dbg-modeCardTitle{font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink)}
380
- .dbg-modeCardDesc{font-size:12px;line-height:18px;color:var(--cfg-faint)}
381
- .dbg-modeCardCheck{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:20px;color:var(--cfg-accent)}
418
+ .dbg-modeCardTitle{min-width:0;font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink)}
419
+ .dbg-modeCardCheck{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:20px;margin-left:auto;color:var(--cfg-accent)}
420
+ .dbg-modeCardFlow{display:block;padding:7px 9px;border:1px solid var(--cfg-line);border-radius:6px;background:var(--cfg-base);color:var(--cfg-muted);font-size:12px;line-height:18px;overflow-wrap:anywhere}
421
+ .dbg-modeCardBullets{display:flex;flex-direction:column;gap:4px;margin:0;padding:0;color:var(--cfg-muted);font-size:12px;line-height:18px}
422
+ .dbg-modeCardBullet{display:block;padding-left:12px;position:relative}
423
+ .dbg-modeCardBullet:before{content:'·';position:absolute;left:2px;color:var(--cfg-faint)}
424
+ .dbg-modeCardStop{display:block;color:var(--cfg-muted);font-size:12px;line-height:18px}
425
+ .dbg-modeCardStopLabel{color:var(--cfg-faint)}
382
426
  .dbg-segmentInput{appearance:none;position:absolute;width:1px;height:1px;opacity:0;margin:0}
383
- .dbg-segmented{display:flex;align-self:flex-start;max-width:100%;gap:2px;padding:2px;border:1px solid var(--cfg-line-2);border-radius:8px;background:color-mix(in srgb,var(--cfg-ink) 4%,var(--cfg-base))}
384
- .dbg-segment{position:relative;flex:1;min-width:0;cursor:pointer}
385
- .dbg-segment>span{display:flex;align-items:center;justify-content:center;min-height:28px;padding:0 12px;border:1px solid transparent;border-radius:6px;color:var(--cfg-muted);white-space:nowrap;font-size:13px}
386
- .dbg-segmentInput:checked+span{color:var(--cfg-accent-text);background:var(--cfg-raised);border-color:var(--cfg-line-2);font-weight:500}
387
- .dbg-segment:hover .dbg-segmentInput:not(:disabled)+span{background:var(--cfg-hover)}
388
- .dbg-segmentInput:focus-visible+span{outline:2px solid var(--cfg-accent);outline-offset:2px}
389
- .dbg-segmentInput:disabled+span{opacity:.4;cursor:not-allowed}
390
- .dbg-roundPolicy{display:flex;align-items:center;gap:8px;min-height:24px;margin-top:2px;color:var(--cfg-faint);font-size:12px;line-height:18px;font-variant-numeric:tabular-nums}
391
- .dbg-roundStart,.dbg-roundCap{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:20px;padding:0 7px;border:1px solid var(--cfg-line-2);border-radius:999px;background:var(--cfg-base);color:var(--cfg-muted);font-size:11px;line-height:18px}
392
- .dbg-roundCap[data-mode=fixed],.dbg-roundCap[data-mode=unlimited]{color:var(--cfg-accent-text);border-color:color-mix(in srgb,var(--cfg-accent) 30%,transparent)}
393
- .dbg-roundRail{position:relative;flex:1;height:1px;background:var(--cfg-line-strong)}
394
- .dbg-roundPolicy[data-mode=unlimited] .dbg-roundRail{background:var(--cfg-accent)}
395
- .dbg-field{display:grid;grid-template-columns:minmax(120px,180px) minmax(0,1fr);gap:8px 20px;padding:10px 0;align-items:start;border-bottom:1px solid var(--cfg-line)}
396
- .dbg-field:last-child{border-bottom:0}
427
+ .dbg-chip{display:inline-flex;align-items:center;height:20px;padding:0 7px;border:1px solid var(--cfg-line-2);border-radius:10px;color:var(--cfg-muted);font-size:11px;line-height:18px;white-space:nowrap}
428
+ .dbg-chip[data-tone=accent]{color:var(--cfg-accent-text);border-color:color-mix(in srgb,var(--cfg-accent) 30%,transparent);background:var(--cfg-accent-soft)}
429
+ .dbg-roundSpan{display:inline-flex;align-items:center;align-self:flex-start;min-height:28px;padding:0 10px;border:1px solid var(--cfg-line-2);border-radius:6px;background:var(--cfg-base);color:var(--cfg-muted);font-size:12px;line-height:18px;font-variant-numeric:tabular-nums;white-space:nowrap;overflow-wrap:anywhere}
430
+ .dbg-field{display:grid;grid-template-columns:minmax(120px,180px) minmax(0,1fr);gap:8px 20px;padding:4px 0;align-items:start}
397
431
  .dbg-fieldHeading{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0;padding-top:4px}
398
432
  .dbg-fieldLabel{font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink)}
399
433
  .dbg-fieldBody{display:flex;flex-direction:column;gap:6px;min-width:0}
@@ -404,41 +438,38 @@ window.__ModuleLoader__.load({
404
438
  .dbg-input:hover:not(:disabled){border-color:var(--cfg-line-strong)}
405
439
  .dbg-input[aria-invalid=true]{border-color:var(--cfg-danger)}
406
440
  .dbg-input:focus-visible{outline:2px solid var(--cfg-accent);outline-offset:2px}
441
+ .dbg-iconBtn{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--cfg-muted);cursor:pointer}
442
+ .dbg-iconBtn:hover:not(:disabled){background:var(--cfg-hover);color:var(--cfg-ink)}
443
+ .dbg-iconBtn:disabled{opacity:.4;cursor:not-allowed}
407
444
  .dbg-help{margin:0;font-size:12px;line-height:18px}
408
- .dbg-help>summary{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border-radius:999px;color:var(--cfg-faint);cursor:pointer;list-style:none}
409
- .dbg-help>summary::-webkit-details-marker{display:none}
445
+ .dbg-help>summary{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border-radius:6px;color:var(--cfg-faint);cursor:pointer;list-style:none}
446
+ .dbg-help>summary::-webkit-details-marker{display:none}.dbg-help>summary::marker{content:''}
410
447
  .dbg-help>summary:hover,.dbg-help[open]>summary{background:var(--cfg-hover);color:var(--cfg-ink)}
411
- .dbg-help>p{margin:6px 0 0;max-width:64ch;color:var(--cfg-muted);font-size:12px;line-height:18px;overflow-wrap:anywhere}
412
- .dbg-helpText>summary{width:auto;height:auto;padding:4px 8px;border-radius:6px;color:var(--cfg-muted);font-size:12px}
413
- .dbg-info>summary:before{display:none}
414
- .dbg-advanced{border-top:1px solid var(--cfg-line-2);margin-top:4px;padding-top:4px}
415
- .dbg-advanced>summary{display:flex;align-items:center;gap:8px;min-height:32px;padding:0;list-style:none;cursor:pointer;font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink)}
416
- .dbg-advanced>summary::-webkit-details-marker{display:none}
417
- .dbg-advanced>summary:before{content:'';flex:none;width:5px;height:5px;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:rotate(-45deg);margin:0 4px}
418
- .dbg-advanced[open]>summary:before{transform:translateY(-2px) rotate(45deg)}
419
- .dbg-advancedCount{margin-left:auto;color:var(--cfg-faint);font-size:12px;line-height:18px;font-weight:400}
420
- .dbg-advanced[data-invalid=true]>summary{color:var(--cfg-danger)}.dbg-field + .dbg-advanced{border-top:0;margin-top:0;padding-top:0}
421
- .dbg-runtime{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-height:32px;padding:8px 0;color:var(--cfg-muted);font-size:12px;line-height:18px}
448
+ .dbg-helpText>summary{width:auto;height:auto;min-height:32px;padding:4px 8px;border-radius:6px;color:var(--cfg-muted);font-size:12px;line-height:18px}
449
+ .dbg-helpBody{display:flex;flex-direction:column;gap:6px;margin-top:6px;max-width:64ch}
450
+ .dbg-helpBody p{margin:0;color:var(--cfg-muted);font-size:12px;line-height:18px;overflow-wrap:anywhere}
451
+ .dbg-runtime{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-height:36px;padding:8px 10px;border:1px solid var(--cfg-line-2);border-radius:8px;background:var(--cfg-base);color:var(--cfg-muted);font-size:12px;line-height:18px}
422
452
  .dbg-runtimeDot{flex:none;width:6px;height:6px;border-radius:50%;background:var(--cfg-muted)}
423
453
  .dbg-runtimeDot[data-tone=active]{background:var(--cfg-accent)}
424
- .dbg-runtimeDot[data-tone=warn]{background:var(--cfg-warn)}
425
454
  .dbg-runtimeDot[data-tone=error]{background:var(--cfg-danger)}
426
455
  .dbg-runtimeLabel{margin:0;color:var(--cfg-ink);font-size:13px;line-height:20px}
427
- .dbg-chip{display:inline-flex;align-items:center;height:20px;padding:0 7px;border:1px solid var(--cfg-line-2);border-radius:999px;color:var(--cfg-muted);font-size:11px;line-height:18px;white-space:nowrap}
428
- .dbg-chip[data-tone=accent]{color:var(--cfg-accent-text);border-color:color-mix(in srgb,var(--cfg-accent) 30%,transparent);background:var(--cfg-accent-soft)}
456
+ .dbg-runtimeRefresh{margin-left:auto}
429
457
  .dbg-footer{position:sticky;bottom:0;z-index:2;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 0;border-top:1px solid var(--cfg-line-2);background:var(--cfg-base);margin-top:auto}
430
458
  .dbg-status{flex:1;min-width:140px;margin:0;color:var(--cfg-faint);font-size:12px;line-height:18px;overflow-wrap:anywhere}
431
- .dbg-status[data-tone=ok]{color:var(--cfg-success)}.dbg-status[data-tone=warn]{color:var(--cfg-warn)}
459
+ .dbg-status[data-tone=ok]{color:var(--cfg-success)}
460
+ .dbg-status[data-tone=warn]{color:var(--cfg-warn)}
432
461
  .dbg-button{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border:1px solid transparent;border-radius:8px;font:inherit;font-size:13px;line-height:20px;font-weight:500;color:var(--cfg-ink);background:transparent;cursor:pointer}
433
462
  .dbg-button:hover:not(:disabled){background:var(--cfg-hover)}
434
463
  .dbg-button[data-variant=primary]{background:var(--cfg-solid);color:var(--cfg-on-solid);min-width:80px}
435
- .dbg-button[data-variant=primary]:hover:not(:disabled){background:color-mix(in srgb,var(--cfg-solid) 88%,black)}
464
+ .dbg-button[data-variant=primary]:hover:not(:disabled){background:color-mix(in srgb,var(--cfg-solid) 88%,var(--cfg-on-solid))}
436
465
  .dbg-button[data-variant=outline]{border-color:var(--cfg-line-2)}
437
466
  .dbg-spinner{box-sizing:border-box;display:inline-block;flex:none;width:12px;height:12px;border:1px solid currentColor;border-right-color:transparent;border-radius:50%;animation:dbg-spin .7s linear infinite}@keyframes dbg-spin{to{transform:rotate(360deg)}}
438
- @container better-goal-settings (max-width:540px){.dbg-modeCards{grid-template-columns:1fr}.dbg-field{grid-template-columns:minmax(0,1fr);gap:6px}.dbg-fieldHeading{padding-top:0}.dbg-segmented{width:100%;align-self:stretch}.dbg-segment>span{padding:0 6px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dbg-footer .dbg-status{flex-basis:100%}}
439
- @media(max-width:640px){.dbg-title{font-size:18px;line-height:26px}.dbg-cfg{gap:20px}.dbg-modeCards{grid-template-columns:1fr}.dbg-field{grid-template-columns:minmax(0,1fr);gap:6px}.dbg-fieldHeading{padding-top:0}.dbg-segmented{width:100%;align-self:stretch}.dbg-segment>span{padding:0 6px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dbg-footer .dbg-status{flex-basis:100%}}
440
- [data-ds-dark-theme] .dbg-cfg{--cfg-accent:#4eb0e8;--cfg-solid:#4eb0e8;--cfg-on-solid:#0e1014;--cfg-accent-text:#6fc0ee;--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 14%,transparent)}
441
- @media(prefers-reduced-motion:reduce){.dbg-cfg *{animation:none!important;transition:none!important}}`
467
+ @container better-goal-settings (max-width:640px){.dbg-modeCards,.dbg-optionCards{grid-template-columns:1fr}.dbg-field{grid-template-columns:minmax(0,1fr);gap:6px}.dbg-fieldHeading{padding-top:0}.dbg-footer .dbg-status{flex-basis:100%}.dbg-cfg :is(.dbg-input,.dbg-button,.dbg-iconBtn,.dbg-help>summary,.dbg-helpText>summary){min-height:44px}.dbg-cfg .dbg-iconBtn{width:44px}}
468
+ @media(max-width:640px){.dbg-modeCards,.dbg-optionCards{grid-template-columns:1fr}.dbg-field{grid-template-columns:minmax(0,1fr);gap:6px}.dbg-fieldHeading{padding-top:0}.dbg-footer .dbg-status{flex-basis:100%}.dbg-cfg :is(.dbg-input,.dbg-button,.dbg-iconBtn,.dbg-help>summary,.dbg-helpText>summary){min-height:44px}.dbg-cfg .dbg-iconBtn{width:44px}}
469
+ @media(pointer:coarse){.dbg-cfg :is(.dbg-input,.dbg-button,.dbg-iconBtn,.dbg-help>summary,.dbg-helpText>summary){min-height:44px}.dbg-cfg .dbg-iconBtn{width:44px}}
470
+ [data-ds-dark-theme] .dbg-cfg{--cfg-accent:var(--dsw-alias-state-business-primary,#4eb0e8);--cfg-solid:var(--dsw-alias-button-primary-fill,#4eb0e8);--cfg-on-solid:var(--dsw-alias-label-primary-foreground,#0e1014);--cfg-accent-soft:color-mix(in srgb,var(--cfg-accent) 14%,transparent)}
471
+ @media(prefers-reduced-motion:reduce){.dbg-cfg *{animation:none!important;transition:none!important}}
472
+ `
442
473
 
443
474
 
444
475
  // ── Icons (inline SVG keeps this closure dependency-free) ──────────────
@@ -468,6 +499,10 @@ window.__ModuleLoader__.load({
468
499
  ])
469
500
  }
470
501
 
502
+ function IconRefresh() {
503
+ return iconSvg(h('path', { d: 'M13 8a5 5 0 1 1-1.6-3.7M13 2.5V6h-3.5', stroke: 'currentColor', strokeWidth: 1.5, strokeLinecap: 'round', strokeLinejoin: 'round' }))
504
+ }
505
+
471
506
  function IconPause() {
472
507
  return iconSvg([
473
508
  h('rect', { key: 'left', x: 4.5, y: 3.5, width: 2.2, height: 9, rx: 1, fill: 'currentColor' }),
@@ -1012,7 +1047,7 @@ window.__ModuleLoader__.load({
1012
1047
 
1013
1048
  return h('div', { className: 'dbg-dock', 'data-goal-bar': 'dsh-better-goal' },
1014
1049
  h('style', { 'data-plugin-css': STYLE_GOAL }, GOAL_CSS),
1015
- h('div', { className: 'dbg-bar', title, 'data-running': showPause, 'data-expanded': expanded, 'aria-busy': pending || undefined },
1050
+ h('div', { className: 'dbg-bar', title, 'data-running': showPause, 'data-state': visualState, 'data-expanded': expanded, 'aria-busy': pending || undefined },
1016
1051
  h('div', { className: 'dbg-goalMain' },
1017
1052
  h('div', { className: 'dbg-goalStatus' },
1018
1053
  h('span', { className: 'dbg-goalGlyph', 'data-state': visualState },
@@ -1236,6 +1271,38 @@ window.__ModuleLoader__.load({
1236
1271
  return ops
1237
1272
  }
1238
1273
 
1274
+ /**
1275
+ * One radiogroup keyboard contract for visual choice cards: arrows move by
1276
+ * one (wrapping), Home/End jump to the edges, Space/Enter choose the focused
1277
+ * option. The cards keep the native radio inputs as the single source of
1278
+ * truth, so assistive technology still sees a real radiogroup.
1279
+ */
1280
+ function radioCardKeyDown(event, values, current, choose, refs) {
1281
+ if (event.defaultPrevented || event.nativeEvent?.isComposing || event.target?.disabled) return
1282
+ const key = event.key
1283
+ const activate = key === ' ' || key === 'Enter' || key === 'Spacebar'
1284
+ const navigate = key === 'ArrowRight' || key === 'ArrowDown' || key === 'ArrowLeft' || key === 'ArrowUp' || key === 'Home' || key === 'End'
1285
+ if (!activate && !navigate) return
1286
+ const currentIndex = Math.max(0, values.indexOf(current))
1287
+ let nextIndex = currentIndex
1288
+ if (activate) {
1289
+ const focused = values.indexOf(event.target?.value)
1290
+ nextIndex = focused >= 0 ? focused : currentIndex
1291
+ } else if (key === 'Home') {
1292
+ nextIndex = 0
1293
+ } else if (key === 'End') {
1294
+ nextIndex = values.length - 1
1295
+ } else if (key === 'ArrowRight' || key === 'ArrowDown') {
1296
+ nextIndex = (currentIndex + 1) % values.length
1297
+ } else {
1298
+ nextIndex = (currentIndex - 1 + values.length) % values.length
1299
+ }
1300
+ event.preventDefault()
1301
+ choose(values[nextIndex])
1302
+ const node = refs.current?.[values[nextIndex]]
1303
+ if (typeof node?.focus === 'function') node.focus()
1304
+ }
1305
+
1239
1306
  function closeDetailsOnEscape(event) {
1240
1307
  if (event.key !== 'Escape' || event.nativeEvent?.isComposing || !event.currentTarget.open) return
1241
1308
  event.preventDefault()
@@ -1275,6 +1342,8 @@ window.__ModuleLoader__.load({
1275
1342
  const [runtime, setRuntime] = useState(undefined)
1276
1343
  const [runtimeRequest, setRuntimeRequest] = useState(0)
1277
1344
  const busyRef = useRef(false)
1345
+ const implementationInputs = useRef({})
1346
+ const roundModeInputs = useRef({})
1278
1347
  useEffect(() => {
1279
1348
  let current = true
1280
1349
  setRuntime(undefined)
@@ -1310,6 +1379,11 @@ window.__ModuleLoader__.load({
1310
1379
  })
1311
1380
  }, [baseDraft, revision])
1312
1381
 
1382
+ const chooseImplementation = (value) => edit((current) => ({ ...current, implementation: value }))
1383
+ const chooseRoundMode = (value) => edit((current) => ({ ...current, roundLimitMode: value }))
1384
+ const onImplementationKeyDown = (event) => radioCardKeyDown(event, IMPLEMENTATION_MODES, live.implementation, chooseImplementation, implementationInputs)
1385
+ const onRoundModeKeyDown = (event) => radioCardKeyDown(event, ROUND_LIMIT_MODES, live.roundLimitMode, chooseRoundMode, roundModeInputs)
1386
+
1313
1387
  const save = async () => {
1314
1388
  if (!form || !writable || busyRef.current || !dirty || invalid !== null || parsed?.value === undefined) return
1315
1389
  const ops = diffOps(host, parsed.value)
@@ -1349,14 +1423,22 @@ window.__ModuleLoader__.load({
1349
1423
  const disabled = !writable || busy
1350
1424
  const nativeField = (key, label, hint) => {
1351
1425
  const id = 'dsh-better-goal-' + key
1426
+ const hintId = id + '-hint'
1427
+ const errorId = id + '-error'
1352
1428
  const error = invalid === 'invalidNative' && parsed.field === key ? tr(t, invalid) : undefined
1353
- return h(Field, { key, t, id, label: tr(t, label), hint: tr(t, hint), error },
1354
- h('input', { className: 'dbg-input', id, type: 'number', min: 1, max: UNLIMITED_ROUNDS, step: 1, inputMode: 'numeric', value: live[key], disabled,
1355
- 'aria-invalid': Boolean(error) || undefined, 'aria-describedby': error ? id + '-error' : undefined,
1356
- onChange: (event) => edit((current) => ({ ...current, [key]: event.target.value })),
1357
- }))
1429
+ return h('div', { key, className: 'dbg-field' },
1430
+ h('div', { className: 'dbg-fieldHeading' },
1431
+ h('label', { className: 'dbg-fieldLabel', htmlFor: id }, tr(t, label))),
1432
+ h('div', { className: 'dbg-fieldBody' },
1433
+ h('input', {
1434
+ className: 'dbg-input', id, type: 'number', min: 1, max: UNLIMITED_ROUNDS, step: 1, inputMode: 'numeric', value: live[key], disabled,
1435
+ 'aria-invalid': Boolean(error) || undefined,
1436
+ 'aria-describedby': error ? errorId + ' ' + hintId : hintId,
1437
+ onChange: (event) => edit((current) => ({ ...current, [key]: event.target.value })),
1438
+ }),
1439
+ h('p', { className: 'dbg-hint', id: hintId }, tr(t, hint)),
1440
+ error ? h('p', { className: 'dbg-fieldError', id: errorId, role: 'alert' }, error) : null))
1358
1441
  }
1359
- const nativeNonDefault = (parsed?.value ? parsed.value.nativeBlockedAfterConsecutiveRounds !== 3 : live.nativeBlockedAfterConsecutiveRounds !== '3') ? 1 : 0
1360
1442
  const roundLimitValue = parsePositiveSafeIntegerText(live.roundLimit)
1361
1443
  const runtimeTone = runtime === null ? 'error' : runtime === undefined ? undefined : 'active'
1362
1444
  const runtimeLabel = runtime === undefined
@@ -1364,62 +1446,104 @@ window.__ModuleLoader__.load({
1364
1446
  : runtime === null
1365
1447
  ? tr(t, 'runtimeUnavailable')
1366
1448
  : tr(t, 'runtimeActive', { implementation: tr(t, runtime.runtime?.implementation === 'native' ? 'runtimeNative' : 'runtimeBetter') })
1367
- const implementationCard = (value) => h('label', {
1368
- key: value,
1369
- className: 'dbg-modeCard',
1370
- 'data-checked': live.implementation === value || undefined,
1371
- 'data-disabled': disabled || undefined,
1372
- },
1373
- h('input', {
1374
- className: 'dbg-segmentInput', type: 'radio', name: 'dsh-better-goal-implementation',
1375
- id: 'dsh-better-goal-implementation-' + value, value,
1376
- checked: live.implementation === value, disabled,
1377
- onChange: () => edit((current) => ({ ...current, implementation: value })),
1378
- }),
1379
- h('span', { className: 'dbg-modeCardGlyph', 'aria-hidden': true }, value === 'enhanced' ? h(IconGoal) : h(IconNative)),
1380
- h('span', { className: 'dbg-modeCardText' },
1381
- h('span', { className: 'dbg-modeCardTitle' }, tr(t, value === 'enhanced' ? 'runtimeBetter' : 'runtimeNative')),
1382
- h('span', { className: 'dbg-modeCardDesc' }, tr(t, value === 'enhanced' ? 'implEnhancedHint' : 'implNativeHint'))),
1383
- h('span', { className: 'dbg-modeCardCheck', 'aria-hidden': true }, live.implementation === value ? h(IconCheck) : null))
1449
+ const implementationCard = (value) => {
1450
+ const enhanced = value === 'enhanced'
1451
+ const checked = live.implementation === value
1452
+ return h('label', {
1453
+ key: value,
1454
+ className: 'dbg-modeCard',
1455
+ 'data-checked': checked || undefined,
1456
+ 'data-disabled': disabled || undefined,
1457
+ },
1458
+ h('input', {
1459
+ className: 'dbg-segmentInput', type: 'radio', name: 'dsh-better-goal-implementation',
1460
+ id: 'dsh-better-goal-implementation-' + value, value, checked, disabled,
1461
+ ref: (node) => { implementationInputs.current[value] = node },
1462
+ onChange: () => chooseImplementation(value),
1463
+ }),
1464
+ h('span', { className: 'dbg-modeCardHead' },
1465
+ h('span', { className: 'dbg-modeCardGlyph', 'aria-hidden': true }, enhanced ? h(IconGoal) : h(IconNative)),
1466
+ h('span', { className: 'dbg-modeCardTitle' }, tr(t, enhanced ? 'runtimeBetter' : 'runtimeNative')),
1467
+ h('span', { className: 'dbg-chip', 'data-tone': checked ? 'accent' : undefined }, tr(t, enhanced ? 'implEnhancedTag' : 'implNativeTag')),
1468
+ h('span', { className: 'dbg-modeCardCheck', 'aria-hidden': true }, checked ? h(IconCheck) : null)),
1469
+ h('span', { className: 'dbg-modeCardFlow', 'aria-hidden': true }, tr(t, enhanced ? 'implEnhancedFlow' : 'implNativeFlow')),
1470
+ h('span', { className: 'dbg-modeCardBullets' },
1471
+ (enhanced
1472
+ ? ['implEnhancedBullet1', 'implEnhancedBullet2', 'implEnhancedBullet3']
1473
+ : ['implNativeBullet1', 'implNativeBullet2', 'implNativeBullet3']).map((key) =>
1474
+ h('span', { className: 'dbg-modeCardBullet', key }, tr(t, key)))))
1475
+ }
1476
+ const roundModeCard = (value) => {
1477
+ const copy = value === 'agent'
1478
+ ? { title: 'modeAgent', flow: 'modeAgentFlow', stop: 'modeAgentStop' }
1479
+ : value === 'unlimited'
1480
+ ? { title: 'modeUnlimited', flow: 'modeUnlimitedFlow', stop: 'modeUnlimitedStop' }
1481
+ : { title: 'modeFixed', flow: 'modeFixedFlow', stop: 'modeFixedStop' }
1482
+ const checked = live.roundLimitMode === value
1483
+ return h('label', {
1484
+ key: value,
1485
+ className: 'dbg-modeCard',
1486
+ 'data-checked': checked || undefined,
1487
+ 'data-disabled': disabled || undefined,
1488
+ },
1489
+ h('input', {
1490
+ className: 'dbg-segmentInput', type: 'radio', name: 'dsh-better-goal-round-limit-mode',
1491
+ id: 'dsh-better-goal-round-limit-mode-' + value, value, checked, disabled,
1492
+ ref: (node) => { roundModeInputs.current[value] = node },
1493
+ onChange: () => chooseRoundMode(value),
1494
+ }),
1495
+ h('span', { className: 'dbg-modeCardHead' },
1496
+ h('span', { className: 'dbg-modeCardTitle' }, tr(t, copy.title)),
1497
+ h('span', { className: 'dbg-modeCardCheck', 'aria-hidden': true }, checked ? h(IconCheck) : null)),
1498
+ h('span', { className: 'dbg-modeCardFlow', 'aria-hidden': true }, tr(t, copy.flow)),
1499
+ h('span', { className: 'dbg-modeCardStop' },
1500
+ h('span', { className: 'dbg-modeCardStopLabel' }, tr(t, 'modeStop') + ' · '),
1501
+ tr(t, copy.stop)))
1502
+ }
1384
1503
  return h('div', rootProps,
1385
- h('h3', { className: 'dbg-title' }, tr(t, 'settingsTitle')),
1386
- writable ? null : h('p', { className: 'dbg-runtime', role: 'status' },
1387
- h('span', { className: 'dbg-runtimeDot', 'data-tone': 'warn', 'aria-hidden': true }),
1388
- h('span', { className: 'dbg-runtimeLabel' }, tr(t, 'readonly'))),
1504
+ h('header', { className: 'dbg-pageHead' },
1505
+ h('h3', { className: 'dbg-title' }, tr(t, 'settingsTitle')),
1506
+ h('p', { className: 'dbg-pagePurpose' }, tr(t, 'settingsIntro'))),
1507
+ writable ? null : h('p', { className: 'dbg-note', role: 'status' }, tr(t, 'readonly')),
1508
+ h('div', { className: 'dbg-runtime', role: 'status', 'data-runtime': runtime === null ? 'unavailable' : runtime === undefined ? 'loading' : 'ready' },
1509
+ h('span', { className: 'dbg-runtimeDot', 'data-tone': runtimeTone, 'aria-hidden': true }),
1510
+ h('p', { className: 'dbg-runtimeLabel' }, runtimeLabel),
1511
+ showReloadChip ? h('span', { className: 'dbg-chip', 'data-tone': 'accent' }, tr(t, 'reloadRequired')) : null,
1512
+ h('button', {
1513
+ type: 'button', className: 'dbg-iconBtn dbg-runtimeRefresh',
1514
+ 'aria-label': tr(t, 'refreshRuntime'), title: tr(t, 'refreshRuntime'),
1515
+ disabled: runtime === undefined,
1516
+ onClick: () => setRuntimeRequest((value) => value + 1),
1517
+ }, h(IconRefresh))),
1389
1518
  h('fieldset', { className: 'dbg-section' },
1390
1519
  h('legend', { className: 'dbg-sectionTitle' }, tr(t, 'implementation')),
1391
- h('div', { className: 'dbg-modeCards' }, ['enhanced', 'native'].map(implementationCard))),
1520
+ h('div', { className: 'dbg-modeCards', role: 'radiogroup', 'aria-label': tr(t, 'implementation'), onKeyDown: onImplementationKeyDown },
1521
+ IMPLEMENTATION_MODES.map(implementationCard)),
1522
+ h('p', { className: 'dbg-hint' }, tr(t, 'implementationHint'))),
1392
1523
  live.implementation === 'native'
1393
1524
  ? h('fieldset', { className: 'dbg-section' },
1394
1525
  h('legend', { className: 'dbg-sectionTitle' }, tr(t, 'nativeSection')),
1395
1526
  nativeField('nativeDefaultMaxGoalRounds', 'nativeDefaultLabel', 'nativeDefaultHint'),
1396
- h('details', { className: 'dbg-advanced', onKeyDown: closeDetailsOnEscape, 'data-invalid': invalid === 'invalidNative' && parsed.field === 'nativeBlockedAfterConsecutiveRounds' || undefined },
1397
- h('summary', null, tr(t, 'advanced'), nativeNonDefault ? h('span', { className: 'dbg-advancedCount' }, tr(t, 'modified', { count: nativeNonDefault })) : null),
1398
- nativeField('nativeBlockedAfterConsecutiveRounds', 'nativeBlockedLabel', 'nativeBlockedHint')))
1527
+ nativeField('nativeBlockedAfterConsecutiveRounds', 'nativeBlockedLabel', 'nativeBlockedHint'))
1399
1528
  : h('fieldset', { className: 'dbg-section' },
1400
1529
  h('legend', { className: 'dbg-sectionTitle' }, tr(t, 'modeLabel')),
1401
- h('div', { className: 'dbg-segmented' }, ...ROUND_LIMIT_MODES.map((value) =>
1402
- h('label', { className: 'dbg-segment', key: value },
1403
- h('input', { className: 'dbg-segmentInput', type: 'radio', name: 'dsh-better-goal-round-limit-mode', id: 'dsh-better-goal-round-limit-mode-' + value, value, checked: live.roundLimitMode === value, disabled,
1404
- onChange: () => edit((current) => ({ ...current, roundLimitMode: value })),
1405
- }), h('span', null, tr(t, value === 'agent' ? 'modeAgent' : value === 'unlimited' ? 'modeUnlimited' : 'modeFixed'))))),
1406
- h('div', { className: 'dbg-roundPolicy', 'data-mode': live.roundLimitMode, 'aria-hidden': true },
1407
- h('span', { className: 'dbg-roundStart' }, '1'),
1408
- h('span', { className: 'dbg-roundRail' }),
1409
- h('span', { className: 'dbg-roundCap', 'data-mode': live.roundLimitMode, title: tr(t, live.roundLimitMode === 'agent' ? 'modeAgent' : live.roundLimitMode === 'unlimited' ? 'modeUnlimited' : 'roundLimitLabel') },
1410
- live.roundLimitMode === 'fixed' ? (roundLimitValue === undefined ? '—' : isUnlimitedCap(roundLimitValue) ? '∞' : String(roundLimitValue)) : live.roundLimitMode === 'unlimited' ? '∞' : tr(t, 'modeAgent'))),
1530
+ h('p', { className: 'dbg-hint' }, tr(t, 'roundDefinition')),
1531
+ h('div', { className: 'dbg-optionCards', role: 'radiogroup', 'aria-label': tr(t, 'modeLabel'), onKeyDown: onRoundModeKeyDown },
1532
+ ROUND_LIMIT_MODES.map(roundModeCard)),
1411
1533
  live.roundLimitMode === 'fixed' ? h(Field, { t, id: 'dsh-better-goal-round-limit', label: tr(t, 'roundLimitLabel'),
1412
1534
  error: invalid === 'invalidRoundLimit' ? tr(t, invalid) : undefined,
1413
1535
  }, h('input', { className: 'dbg-input', id: 'dsh-better-goal-round-limit', type: 'number', min: 1, max: UNLIMITED_ROUNDS, step: 1, inputMode: 'numeric', value: live.roundLimit, disabled,
1414
1536
  'aria-invalid': invalid === 'invalidRoundLimit' || undefined,
1415
1537
  'aria-describedby': invalid === 'invalidRoundLimit' ? 'dsh-better-goal-round-limit-error' : undefined,
1416
1538
  onChange: (event) => edit((current) => ({ ...current, roundLimit: event.target.value })),
1417
- })) : null),
1418
- h('div', { className: 'dbg-runtime', role: 'status' },
1419
- h('span', { className: 'dbg-runtimeDot', 'data-tone': runtimeTone, 'aria-hidden': true }),
1420
- h('p', { className: 'dbg-runtimeLabel' }, runtimeLabel),
1421
- runtime === null ? h('button', { type: 'button', className: 'dbg-button', 'data-variant': 'outline', onClick: () => setRuntimeRequest((value) => value + 1) }, tr(t, 'retry')) : null,
1422
- showReloadChip ? h('span', { className: 'dbg-chip', 'data-tone': 'accent' }, tr(t, 'reloadRequired')) : null),
1539
+ }), h('span', { className: 'dbg-roundSpan' }, tr(t, 'roundSpan', { rounds: roundLimitValue === undefined ? '…' : isUnlimitedCap(roundLimitValue) ? '∞' : String(roundLimitValue) }))) : null),
1540
+ h('details', { className: 'dbg-help dbg-helpText', onKeyDown: closeDetailsOnEscape },
1541
+ h('summary', null, tr(t, 'help')),
1542
+ h('div', { className: 'dbg-helpBody' },
1543
+ h('p', null, tr(t, 'roundDefinition')),
1544
+ h('p', null, tr(t, 'implementationHint')),
1545
+ state.value?.questionTimeoutSeconds === undefined ? null : h('p', null,
1546
+ (state.value.questionTimeoutSeconds === -1 ? tr(t, 'never') : tr(t, 'legacyTimeout', { seconds: state.value.questionTimeoutSeconds })) + ' · ' + tr(t, 'legacyHint')))),
1423
1547
  notice !== null ? h('p', { className: 'dbg-status', 'data-tone': notice.tone, role: notice.tone === 'error' ? 'alert' : 'status' }, notice.text) : null,
1424
1548
  dirty ? h('div', { className: 'dbg-footer' },
1425
1549
  h('span', { className: 'dbg-status', role: 'status' }, busy ? tr(t, 'saving') : tr(t, 'pendingChanges', { count: changedCount }) + (requiresReload ? ' · ' + tr(t, 'reloadRequired') : '')),