@volter/world-platform 2.0.0

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.
Files changed (75) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +29 -0
  3. package/client/platform.css +228 -0
  4. package/client/platform.tsx +1049 -0
  5. package/client/reserved.ts +3 -0
  6. package/dist/client/platform.bundle.js +237 -0
  7. package/dist/client/platform.css +228 -0
  8. package/dist/client/platform.tsx +1049 -0
  9. package/dist/client/reserved.d.ts +1 -0
  10. package/dist/client/reserved.js +3 -0
  11. package/dist/client/reserved.ts +3 -0
  12. package/dist/src/audit.d.ts +24 -0
  13. package/dist/src/audit.js +23 -0
  14. package/dist/src/backup.d.ts +37 -0
  15. package/dist/src/backup.js +94 -0
  16. package/dist/src/biller.d.ts +59 -0
  17. package/dist/src/biller.js +1 -0
  18. package/dist/src/cli.d.ts +2 -0
  19. package/dist/src/cli.js +112 -0
  20. package/dist/src/db/migrations/0000_init.sql +143 -0
  21. package/dist/src/db/migrations/meta/0000_snapshot.json +877 -0
  22. package/dist/src/db/migrations/meta/_journal.json +13 -0
  23. package/dist/src/db/migrations.d.ts +4 -0
  24. package/dist/src/db/migrations.js +33 -0
  25. package/dist/src/db/open.d.ts +11 -0
  26. package/dist/src/db/open.js +114 -0
  27. package/dist/src/db/pack-migrations.d.ts +1 -0
  28. package/dist/src/db/pack-migrations.js +33 -0
  29. package/dist/src/db/schema.d.ts +1803 -0
  30. package/dist/src/db/schema.js +123 -0
  31. package/dist/src/directory.d.ts +75 -0
  32. package/dist/src/directory.js +199 -0
  33. package/dist/src/doors.d.ts +16 -0
  34. package/dist/src/doors.js +123 -0
  35. package/dist/src/identity.d.ts +88 -0
  36. package/dist/src/identity.js +314 -0
  37. package/dist/src/labs.d.ts +14 -0
  38. package/dist/src/labs.js +7 -0
  39. package/dist/src/mail.d.ts +16 -0
  40. package/dist/src/mail.js +27 -0
  41. package/dist/src/pages.d.ts +15 -0
  42. package/dist/src/pages.js +73 -0
  43. package/dist/src/platform.d.ts +77 -0
  44. package/dist/src/platform.js +1845 -0
  45. package/dist/src/sample.d.ts +11 -0
  46. package/dist/src/sample.js +93 -0
  47. package/dist/src/store.d.ts +110 -0
  48. package/dist/src/store.js +142 -0
  49. package/dist/src/tokens.d.ts +69 -0
  50. package/dist/src/tokens.js +96 -0
  51. package/dist/src/webhooks.d.ts +60 -0
  52. package/dist/src/webhooks.js +92 -0
  53. package/package.json +78 -0
  54. package/src/audit.ts +26 -0
  55. package/src/backup.ts +73 -0
  56. package/src/biller.ts +45 -0
  57. package/src/cli.ts +99 -0
  58. package/src/db/migrations/0000_init.sql +143 -0
  59. package/src/db/migrations/meta/0000_snapshot.json +877 -0
  60. package/src/db/migrations/meta/_journal.json +13 -0
  61. package/src/db/migrations.ts +33 -0
  62. package/src/db/open.ts +92 -0
  63. package/src/db/pack-migrations.ts +19 -0
  64. package/src/db/schema.ts +137 -0
  65. package/src/directory.ts +216 -0
  66. package/src/doors.ts +138 -0
  67. package/src/identity.ts +279 -0
  68. package/src/labs.ts +8 -0
  69. package/src/mail.ts +27 -0
  70. package/src/pages.ts +69 -0
  71. package/src/platform.ts +1183 -0
  72. package/src/sample.ts +84 -0
  73. package/src/store.ts +154 -0
  74. package/src/tokens.ts +94 -0
  75. package/src/webhooks.ts +85 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @volter/world-platform
2
+
3
+ The Volter World platform: where people and orgs are. People sign in through one access provider,
4
+ make orgs, add and invite members, make Worlds on the hosts the platform has enrolled, and open a
5
+ World as themselves with a short-lived pass. It serves its own pages and never a twin; a host
6
+ (`@volter/world-host`) serves the Worlds, and a World's pages are `@volter/world-console`.
7
+
8
+ ```bash
9
+ npm install -g @volter/world-platform
10
+ volter-platform serve --dir ./platform-state --provider oidc --url https://app.example.com
11
+ ```
12
+
13
+ | Environment | For |
14
+ |---|---|
15
+ | `VOLTER_ISSUER`, `VOLTER_CLIENT_ID`, `VOLTER_CLIENT_SECRET` | `--provider volter` (the default without `OIDC_ISSUER`): Volter Identity keeps the people, orgs and members |
16
+ | `OIDC_ISSUER`, `OIDC_CLIENT_ID`, `OIDC_CLIENT_SECRET`, `OIDC_NAME`, `OIDC_TRUST_EMAIL_DOMAINS` | `--provider oidc`: any OpenID Connect issuer; the platform keeps the directory |
17
+ | `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET`, `GITHUB_URL`, `GITHUB_API_URL` | `--provider github`: a GitHub OAuth app (the last two for Enterprise Server); the platform keeps the directory |
18
+ | `RESEND_API_KEY` | the platform's mail through Resend, from `--mail-from`; without it mail is only logged |
19
+ | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, `AWS_ENDPOINT_URL` | `--backup-bucket` |
20
+ | `POLAR_ACCESS_TOKEN`, `POLAR_SERVER` | Volter's cloud only, with Volter's biller (not in this package); set without it, the platform refuses to start |
21
+
22
+ The provider's client is registered with the callback `<platform>/-/sign-in/callback`. Every flag
23
+ and name is in the [CLI reference](../../docs/reference/cli.md#volter-platform-serve). Its state is one SQLite
24
+ database, `<dir>/platform.db`. Requires Node 22.13 or later (for `node:sqlite`) or Bun.
25
+
26
+ - [Self-host the platform](../../docs/guides/self-host-the-platform.md): a host and the platform on
27
+ your machine, signed in through an OpenID Connect provider.
28
+ - [The hosted product](../../docs/contributing/architecture.md#the-hosted-product): the design.
29
+ - [Platform API](../../docs/reference/platform-api.md): every endpoint.
@@ -0,0 +1,228 @@
1
+ /* THE PLATFORM'S PAGES, over the kit (apps/console/client/kit/kit.css, served first): only what an org's pages show.
2
+ Every colour is a role of the brand, as the kit's are; dark follows the system through the brand's light-dark roles. */
3
+
4
+ /* the support view's standing notice, above the top bar */
5
+ .banner { margin: 0; border-radius: 0; border-width: 0 0 1px; text-align: center; }
6
+ button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
7
+ button.primary:hover:not(:disabled) { color: var(--accent-ink); filter: brightness(1.06); }
8
+ a.button { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
9
+ a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
10
+ .link-button { justify-self: start; border: 0; background: none; padding: 2px 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
11
+ .link-button:hover:not(:disabled) { color: var(--ink); text-decoration-color: currentColor; }
12
+ .mono { font-family: var(--mono); font-size: 12px; }
13
+ .nowrap { white-space: nowrap; }
14
+ .small { font-size: 12px; }
15
+ .grow { flex: 1; min-width: 0; }
16
+ .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
17
+ .pre { white-space: pre-wrap; }
18
+ .warn-text { color: var(--warn); }
19
+
20
+ /* the sign-in card: the brand, one way in */
21
+ body.portal #root { width: min(440px, 100%); }
22
+ body.portal .card { width: 100%; }
23
+ body.portal .card .brand h1 { font-size: 15px; margin: 0; }
24
+ body.portal .card .brand h1 a { color: var(--ink); text-decoration: none; }
25
+ main.boot { max-width: 520px; display: grid; gap: 14px; padding-top: 18vh; }
26
+
27
+ /* the top bar: the drawer's button on a phone, the brand, where you are, search, and you */
28
+ main.app > header { gap: 12px; }
29
+ .search-button { margin-left: auto; display: inline-flex; align-items: center; gap: 24px; padding: 5px 8px 5px 12px; color: var(--muted); background: var(--surface-2); border-color: var(--line); min-width: 200px; justify-content: space-between; }
30
+ .search-button:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
31
+ kbd { font: 11px/1 var(--mono); padding: 3px 5px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--muted); }
32
+ .head-link { color: var(--muted); font-size: 13px; }
33
+ .avatar-menu > summary { list-style: none; cursor: pointer; border-radius: 999px; }
34
+ .avatar-menu > summary::-webkit-details-marker { display: none; }
35
+ .avatar-menu .mark { border-radius: 999px; width: 28px; height: 28px; }
36
+ .avatar-menu .popover { width: 240px; }
37
+ .menu-who { display: grid; padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
38
+ .menu-list a[aria-current] { background: var(--surface-2); }
39
+
40
+ /* the org switcher's popover */
41
+ .top-picker .popover { gap: 6px; }
42
+ .top-picker .popover input { width: 100%; }
43
+ .top-picker .branch-list .vendor-cell { font-weight: 500; }
44
+ .top-picker .popover > a.button { text-align: center; }
45
+
46
+ /* a page: its head (title, count, actions), its lede, and a toolbar */
47
+ .page-head { margin: 0 0 16px; }
48
+ .page-head .content-head { margin: 0; }
49
+ .page-head .lede { margin: 4px 0 0; color: var(--muted); max-width: 720px; }
50
+ .count { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600; vertical-align: middle; }
51
+ .toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
52
+ .toolbar input[type="search"], .toolbar-search { min-width: 240px; }
53
+ .content .block { margin-bottom: 16px; overflow-x: auto; }
54
+ .table-note { padding: 10px 14px; border-top: 1px solid var(--line); margin: 0; }
55
+ .row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
56
+ .marks { display: inline-flex; align-items: center; gap: 4px; }
57
+ .marks .mode { margin-left: 6px; }
58
+ .who { display: grid; line-height: 1.3; }
59
+ .who a { color: var(--ink); text-decoration: none; font-weight: 600; }
60
+ .who a:hover { text-decoration: underline; }
61
+ .badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: var(--volter-status-healthy-soft); }
62
+ .badge.warn { color: var(--warn); border-color: var(--volter-status-attention-line); background: var(--warn-soft); }
63
+ .badge.info { color: var(--ink); background: var(--accent-soft); border-color: var(--line-strong); }
64
+ .badge.you { margin-left: 6px; text-transform: none; letter-spacing: 0; }
65
+ .content td select { padding: 4px 26px 4px 8px; font-size: 13px; }
66
+
67
+ /* cards */
68
+ section.card { margin: 0 0 16px; padding: 18px 20px; }
69
+ section.card h3 { margin: 0 0 6px; font-size: 15px; }
70
+ section.card.flush { padding: 0; overflow: hidden; }
71
+ .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
72
+ .card-head h3 { margin: 0 0 2px; }
73
+ .card-head p { margin: 0; max-width: 620px; }
74
+ .card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
75
+ .stack { display: grid; gap: 12px; max-width: none; margin: 0; }
76
+ .stack label { font-size: 13px; }
77
+ .stack > button[type="submit"] { justify-self: start; }
78
+ .field-error { color: var(--danger-text); font-size: 12.5px; margin: -6px 0 0; }
79
+ .stack > .mode { margin: -6px 0 0; }
80
+ input[aria-invalid="true"] { border-color: var(--danger); }
81
+ label.check { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); font-size: 13px; }
82
+ label.check input { margin-top: 3px; }
83
+ .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
84
+ textarea { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); resize: vertical; }
85
+ .narrow { max-width: 640px; }
86
+
87
+ /* a setting: what it is on the left, its control on the right */
88
+ .setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
89
+ section.card > .setting-row:first-child, section.card > p + .setting-row { border-top: 0; }
90
+ .setting-row p { margin: 2px 0 0; }
91
+ .setting-row.stack-row { align-items: flex-end; max-width: none; }
92
+ .setting-row.stack-row label { display: grid; gap: 4px; color: var(--ink); }
93
+ .settings { max-width: 820px; }
94
+ .danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
95
+ .danger-zone h3 { color: var(--danger-text); }
96
+ .danger-zone .setting-row { border-top: 0; padding-bottom: 0; }
97
+ .switch { position: relative; display: inline-block; flex: none; width: 38px; height: 22px; }
98
+ .switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
99
+ .switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--volter-surface-inset); border: 1px solid var(--line-strong); transition: background var(--volter-motion-fast, 140ms); }
100
+ .switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: var(--surface); box-shadow: var(--volter-shadow-resting); transition: transform var(--volter-motion-fast, 140ms); }
101
+ .switch input:checked + span { background: var(--accent); border-color: var(--accent); }
102
+ .switch input:checked + span::after { transform: translateX(16px); background: var(--accent-ink); }
103
+ .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
104
+ .switch input:disabled + span { opacity: 0.5; }
105
+
106
+ /* choices as cards (a token's access, a webhook's events) */
107
+ fieldset.choice, fieldset.vendor-picker { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
108
+ fieldset legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 6px; }
109
+ .choice-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; color: var(--ink); }
110
+ .choice-card.on { border-color: var(--accent); background: var(--accent-soft); }
111
+ .choice-card input { margin-top: 3px; }
112
+ .choice-card > span { display: grid; gap: 2px; }
113
+ .scope-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; }
114
+ .scope-grid label { display: grid; gap: 4px; color: var(--ink); }
115
+ .scope-grid label.check { display: flex; }
116
+
117
+ /* the vendor picker: what is picked as chips, the catalog as a grid of marks */
118
+ .chips { display: flex; flex-wrap: wrap; gap: 6px; }
119
+ .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border-radius: 999px; background: var(--surface-2); border-color: var(--line); font-size: 12.5px; }
120
+ .chip .mark { width: 18px; height: 18px; }
121
+ .vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 280px; overflow-y: auto; padding: 2px; }
122
+ .vendor-option { display: flex; align-items: center; gap: 8px; text-align: left; padding: 7px 10px; background: var(--surface); border-color: var(--line); }
123
+ .vendor-option .vendor-label { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
124
+ .vendor-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
125
+ .vendor-option[aria-pressed="true"]:hover:not(:disabled) { color: var(--ink); }
126
+
127
+ /* invitations: an address and a role per row */
128
+ .invite-row { display: flex; align-items: flex-end; gap: 8px; }
129
+ .invite-row label { display: grid; gap: 4px; }
130
+
131
+ /* notices: a restriction, a payment, a warning in a dialog */
132
+ .notice { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin: 0 0 14px; color: var(--ink); }
133
+ .notice.ok { background: var(--volter-status-healthy-soft); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
134
+ .notice.warn { background: var(--warn-soft); border-color: var(--volter-status-attention-line); }
135
+ .notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); color: var(--ink); }
136
+ .notice.info { background: var(--accent-soft); border-color: var(--line-strong); }
137
+ .dialog-body .notice { margin: 0; }
138
+
139
+ /* billing: the plan, the period's usage against its limits, the plans side by side */
140
+ .billing-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
141
+ .billing-grid section.card { margin: 0; }
142
+ .eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
143
+ .price-line { margin: 4px 0; }
144
+ .price { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
145
+ .meters { display: grid; gap: 16px; margin: 8px 0 14px; }
146
+ .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
147
+ .stats dt { color: var(--muted); font-size: 12px; }
148
+ .stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
149
+ .day-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 8px; }
150
+ .day-bar { flex: 1; display: grid; grid-template-rows: 1fr auto; height: 100%; align-items: end; text-align: center; }
151
+ .day-bar span { display: block; border-radius: 3px 3px 0 0; background: var(--volter-data-base); }
152
+ .day-bar em { font-style: normal; font-size: 10.5px; color: var(--faint); }
153
+ .section-title { margin: 24px 0 10px; font-size: 15px; }
154
+ .plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
155
+ .plans section.card { margin: 0; display: grid; gap: 6px; align-content: start; }
156
+ .plans h4 { margin: 0; font-size: 15px; color: var(--ink); text-transform: none; letter-spacing: 0; }
157
+ .plan.current { border-color: var(--accent); }
158
+ .checks { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 4px; }
159
+ .checks li { position: relative; padding-left: 20px; }
160
+ .checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 600; }
161
+ .plans button { justify-self: start; }
162
+
163
+ /* account */
164
+ .profile { display: flex; align-items: center; gap: 16px; }
165
+ .profile > .mark { width: 52px; height: 52px; border-radius: 999px; font-size: 20px; }
166
+ .profile h3 { margin: 0; }
167
+ .profile p { margin: 2px 0 0; }
168
+ .profile .card-actions { margin: 0; }
169
+ .sent h3 { margin-top: 0; }
170
+
171
+ /* ⌘K */
172
+ .palette { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; max-height: 360px; overflow-y: auto; }
173
+ .palette button { display: flex; width: 100%; justify-content: space-between; gap: 12px; border: 0; background: transparent; padding: 8px 10px; text-align: left; color: var(--ink); }
174
+ .palette li[aria-selected="true"] button { background: var(--surface-2); }
175
+ .palette button:hover:not(:disabled) { color: var(--ink); }
176
+
177
+ /* the first run: a checklist with its progress */
178
+ .onboarding { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 16px; box-shadow: none; }
179
+ .onboarding-head { display: flex; align-items: center; gap: 12px; }
180
+ .onboarding-head h3 { margin: 0; font-size: 14px; }
181
+ .progress { flex: 1; max-width: 160px; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
182
+ .progress span { display: block; height: 100%; background: var(--volter-status-live-base); }
183
+ .onboarding-head .icon-button { margin-left: auto; }
184
+ .onboarding ol { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
185
+ /* the other way through: a prompt for the person's coding agent, copied whole */
186
+ .ask-agent { margin: 12px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }
187
+ .ask-agent > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink); }
188
+ .ask-agent > summary::-webkit-details-marker { display: none; }
189
+ .ask-agent > summary > span::before { content: "\25B8"; display: inline-block; width: 1em; color: var(--muted); }
190
+ .ask-agent[open] > summary > span::before { content: "\25BE"; }
191
+ .ask-agent pre { margin: 10px 0 6px; white-space: pre-wrap; font-size: 12.5px; line-height: 1.55; max-width: none; }
192
+ .ask-agent .mode { margin: 0; font-size: 12.5px; }
193
+ .onboarding li { display: flex; align-items: center; gap: 10px; margin: 0; }
194
+ .onboarding .tick { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 11px; color: var(--muted); }
195
+ .onboarding li.done { color: var(--muted); }
196
+ .onboarding li.done .tick { background: var(--volter-status-live-base); border-color: var(--volter-status-live-base); color: var(--volter-text-on-strong); }
197
+ .onboarding-alt { margin: 10px 0 0 30px; font-size: 12.5px; }
198
+
199
+ /* the first paint */
200
+ main.booting .side .skeleton, main.booting .content .skeleton { border: 0; background: transparent; }
201
+
202
+ /* a phone: the header keeps the menu, the brand, the place and you on one line; the sidebar is a drawer */
203
+ @media (max-width: 900px) { .billing-grid { grid-template-columns: 1fr; } }
204
+ @media (max-width: 720px) {
205
+ main.app > header { flex-wrap: nowrap; }
206
+ main.app > header .brand-name { display: none; }
207
+ main.app > header .crumbs { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
208
+ .search-button { min-width: 0; margin-left: auto; gap: 0; }
209
+ .search-button span, .search-button kbd, .head-link { display: none; }
210
+ .search-button::before { content: "⌕"; font-size: 16px; }
211
+ .two { grid-template-columns: 1fr; }
212
+ .toolbar-search, .toolbar input[type="search"] { min-width: 0; width: 100%; }
213
+ .content-head .head-actions { width: 100%; }
214
+ .worlds-table th:nth-child(2), .worlds-table td:nth-child(2), .worlds-table th:nth-child(3), .worlds-table td:nth-child(3), .worlds-table th:nth-child(4), .worlds-table td:nth-child(4), .tokens-table th:nth-child(3), .tokens-table td:nth-child(3), .tokens-table th:nth-child(5), .tokens-table td:nth-child(5), .pending-table th:nth-child(3), .pending-table td:nth-child(3) { display: none; }
215
+ .profile { flex-wrap: wrap; }
216
+ .setting-row { flex-wrap: wrap; }
217
+ }
218
+
219
+ /* the Worlds empty state: Create World beside the sample, and the sample's note on its own line */
220
+ .actions-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
221
+ .empty-body .sample-note { display: block; margin-top: 8px; font-size: 12.5px; }
222
+
223
+ /* a World's pull-request previews, under its row */
224
+ .preview-row td { padding-top: 0; padding-bottom: 10px; border-top: 0; }
225
+ .preview-row td > .mode { font-size: 12px; margin-right: 10px; }
226
+ .previews { display: inline-flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0; vertical-align: middle; }
227
+ .previews li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
228
+ .worlds-table tr:has(+ .preview-row) td { border-bottom: 0; }