@pairz/directory 0.0.1 → 1.0.0-rc.81

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 (68) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -1
  3. package/WORDS.md +198 -0
  4. package/actions/code.d.ts +4 -0
  5. package/actions/code.js +135 -0
  6. package/actions/host.d.ts +2 -0
  7. package/actions/host.js +55 -0
  8. package/actions/invite.d.ts +5 -0
  9. package/actions/invite.js +129 -0
  10. package/actions/org.d.ts +10 -0
  11. package/actions/org.js +273 -0
  12. package/collections/credit-code.d.ts +107 -0
  13. package/collections/credit-code.js +28 -0
  14. package/collections/invite.d.ts +74 -0
  15. package/collections/invite.js +20 -0
  16. package/collections/membership.d.ts +65 -0
  17. package/collections/membership.js +22 -0
  18. package/collections/org-host.d.ts +55 -0
  19. package/collections/org-host.js +30 -0
  20. package/collections/org.d.ts +134 -0
  21. package/collections/org.js +58 -0
  22. package/collections/staff.d.ts +35 -0
  23. package/collections/staff.js +12 -0
  24. package/contract.d.ts +8 -0
  25. package/contract.js +8 -0
  26. package/mod.d.ts +67 -0
  27. package/mod.js +123 -0
  28. package/package.json +63 -3
  29. package/routes/console.d.ts +26 -0
  30. package/routes/console.js +129 -0
  31. package/routes/enter.d.ts +18 -0
  32. package/routes/enter.js +47 -0
  33. package/routes/forward.d.ts +35 -0
  34. package/routes/forward.js +120 -0
  35. package/routes/orgs.d.ts +25 -0
  36. package/routes/orgs.js +113 -0
  37. package/routes/signout.d.ts +11 -0
  38. package/routes/signout.js +36 -0
  39. package/shared/enter.d.ts +36 -0
  40. package/shared/enter.js +82 -0
  41. package/shared/http.d.ts +44 -0
  42. package/shared/http.js +79 -0
  43. package/shared/member.d.ts +21 -0
  44. package/shared/member.js +73 -0
  45. package/shared/settings.d.ts +53 -0
  46. package/shared/settings.js +16 -0
  47. package/shared/state.d.ts +74 -0
  48. package/shared/state.js +101 -0
  49. package/views/web/codes.d.ts +27 -0
  50. package/views/web/codes.js +50 -0
  51. package/views/web/console-codes.d.ts +37 -0
  52. package/views/web/console-codes.js +166 -0
  53. package/views/web/console.d.ts +37 -0
  54. package/views/web/console.js +224 -0
  55. package/views/web/lists.d.ts +48 -0
  56. package/views/web/lists.js +42 -0
  57. package/views/web/org.d.ts +12 -0
  58. package/views/web/org.js +62 -0
  59. package/views/web/orgs.d.ts +148 -0
  60. package/views/web/orgs.js +253 -0
  61. package/views/web/style.d.ts +6 -0
  62. package/views/web/style.js +197 -0
  63. package/views/web/switcher.d.ts +81 -0
  64. package/views/web/switcher.js +367 -0
  65. package/views/web/words.d.ts +10 -0
  66. package/views/web/words.js +206 -0
  67. package/web.d.ts +36 -0
  68. package/web.js +57 -0
@@ -0,0 +1,148 @@
1
+ export type Org = {
2
+ id: string;
3
+ name: string;
4
+ kind: "personal" | "team";
5
+ suspended?: true;
6
+ };
7
+ /** An invitation to an org, waiting for the person: from whom, as what. */
8
+ export type OrgInvite = {
9
+ id: string;
10
+ org: string;
11
+ name: string;
12
+ role: string;
13
+ from?: string;
14
+ at: string;
15
+ };
16
+ /** What `GET /orgs` answers. */
17
+ export type Orgs = {
18
+ person: string;
19
+ email: string | null;
20
+ /** The org the session is in. */
21
+ current: string | null;
22
+ orgs: Org[];
23
+ invites: OrgInvite[];
24
+ /** Platform staff, who go into any org. */
25
+ staff: boolean;
26
+ /** The session they hold in the org they're in is staff's, one of theirs or not. */
27
+ asStaff: boolean;
28
+ };
29
+ /** An org as staff's console lists it, with what it last reported of itself. */
30
+ export type ConsoleOrg = Org & {
31
+ by: string;
32
+ members: number;
33
+ placement: {
34
+ schema: string;
35
+ };
36
+ summary?: {
37
+ people?: number;
38
+ spaces?: number;
39
+ active?: string;
40
+ at?: string;
41
+ };
42
+ at: string;
43
+ };
44
+ /**
45
+ * Where the orgs stand: still asking, a server with none (one org), or what
46
+ * it said, with the org the person is in (`here`: one of theirs, or, for
47
+ * staff, one they went into, as the console names it).
48
+ */
49
+ export type OrgsState = {
50
+ status: "loading";
51
+ } | {
52
+ status: "none";
53
+ } | {
54
+ status: "ready";
55
+ value: Orgs;
56
+ here?: Org;
57
+ };
58
+ /** Asks the server, once (again with `refreshOrgs`); a server that serves one org answers none. */
59
+ export declare function loadOrgs(): Promise<OrgsState>;
60
+ /** Asks the server again: after renaming an org, or answering an invitation. */
61
+ export declare function refreshOrgs(): Promise<OrgsState>;
62
+ /** The orgs, as they stand, kept current. */
63
+ export declare function useOrgs(): OrgsState;
64
+ /** The org the session is in: one of theirs, or (for staff) one they've gone into. */
65
+ export declare const currentOrg: (orgs: Orgs) => Org | undefined;
66
+ /** Whether they're in an org as platform staff, not as one of its people. */
67
+ export declare const asStaff: (orgs: Orgs) => boolean;
68
+ /** What an org is called where it shows: everyone's own is "Personal". */
69
+ export declare const orgName: (org: Pick<Org, "name" | "kind">) => string;
70
+ /**
71
+ * Going into an org: which, while the page starts over there (as staff, or
72
+ * `moved` there because they're no longer in the one they were in).
73
+ */
74
+ export type Switching = {
75
+ /** The org's id, when known (its face's colour). */
76
+ id?: string;
77
+ name: string;
78
+ kind: "personal" | "team";
79
+ staff?: boolean;
80
+ moved?: boolean;
81
+ };
82
+ /** The org the page is going into, while it does (the shell shows a short transition). */
83
+ export declare function useSwitching(): Switching | undefined;
84
+ /** Goes into an org (one of theirs; any, for staff), and starts over at its home. */
85
+ export declare function enterOrg(org: Pick<Org, "id" | "name" | "kind">, staff?: boolean): Promise<void>;
86
+ /** Makes a team org, its maker its owner, and goes into it. */
87
+ export declare function createOrg(name: string): Promise<void>;
88
+ /** Accepts an invitation (and goes into its org) or declines it. */
89
+ export declare function answerOrgInvite(invite: OrgInvite, accept: boolean): Promise<void>;
90
+ /**
91
+ * Where many orgs are served, someone still signed in whose session in this
92
+ * org ended (they were taken out of it, or it was suspended) goes into
93
+ * another of theirs instead of signing in again: the one they were in
94
+ * before, or their own. True when the page is starting over there; never
95
+ * twice in a row, so a page that can't get in shows sign-in.
96
+ */
97
+ export declare function reenter(): Promise<boolean>;
98
+ /** The org the page just came into, once (its welcome), then forgotten. */
99
+ export declare function arrived(): Switching | undefined;
100
+ /** Every org, for staff's console. */
101
+ export declare function consoleOrgs(): Promise<ConsoleOrg[]>;
102
+ /** Suspends an org or lifts it, or renames it: staff's. */
103
+ export declare function updateOrg(org: string, change: {
104
+ suspended?: boolean;
105
+ name?: string;
106
+ }): Promise<void>;
107
+ /** Moves an org's rows to another schema (for a big org: one of its own). */
108
+ export declare function moveOrg(org: string, schema: string): Promise<{
109
+ schema: string;
110
+ }>;
111
+ /** Where an org's rows download, as SQL. */
112
+ export declare const exportOrgUrl: (org: string) => string;
113
+ /** Deletes an org for good: `name`, its exact name, confirms it. */
114
+ export declare function deleteOrg(org: string, name: string): Promise<void>;
115
+ /** A gift code as staff's console lists it: never the code itself, which is only kept hashed. */
116
+ export type GiftCode = {
117
+ id: string;
118
+ /** Enough to tell them apart: it can't be claimed with this. */
119
+ short: string;
120
+ /** USD. */
121
+ amount: number;
122
+ /** The first day its credits no longer count (`YYYY-MM-DD`); none: they don't lapse. */
123
+ expires?: string;
124
+ /** The last moment it can be claimed (ISO); none: until it is. */
125
+ until?: string;
126
+ note?: string;
127
+ by: string;
128
+ at: string;
129
+ /** Who took it, for which org, and when. */
130
+ org?: string;
131
+ person?: string;
132
+ claimed?: string;
133
+ revoked?: string;
134
+ };
135
+ /** Gift codes, newest first, for staff's console. */
136
+ export declare function giftCodes(): Promise<GiftCode[]>;
137
+ /** Makes a gift code: the answer's `code` is the only time it's ever shown. */
138
+ export declare const createGiftCode: (code: {
139
+ amount: number;
140
+ expires?: string;
141
+ until?: string;
142
+ note?: string;
143
+ }) => Promise<{
144
+ code: string;
145
+ id: string;
146
+ }>;
147
+ /** Takes back a gift code nobody has claimed. */
148
+ export declare function revokeGiftCode(id: string): Promise<void>;
@@ -0,0 +1,253 @@
1
+ /**
2
+ * The directory's browser half: what the directory's routes say of the orgs
3
+ * the signed-in person belongs to, when the app serves many behind one
4
+ * address, and going between them. A server that serves one org has none of
5
+ * this, and `useOrgs()` says so (`none`): the switcher then shows nothing.
6
+ * The directory's front end (web.tsx: the switcher, the org page, staff's
7
+ * console) is built on it; other plugins' front ends import it through the
8
+ * directory's contract.ts.
9
+ *
10
+ * - `useOrgs()`: who's signed in, the org they're in, their orgs (the last
11
+ * entered first), the invitations waiting for them, and whether they're
12
+ * platform staff; `refreshOrgs()` asks again, as does the page hearing that
13
+ * an org changed (the web shell's `orgsChanged()`, after renaming one).
14
+ * - `enterOrg`, `createOrg`, `answerOrgInvite`: each goes into an org (the
15
+ * directory hands the person to it, which sets its session), and the page
16
+ * starts over at that org's home, after a short transition
17
+ * (`useSwitching()`, which the shell shows).
18
+ * - Staff's console: `consoleOrgs()`, `updateOrg(id, { suspended?, name? })`,
19
+ * `moveOrg(id, schema)`, `exportOrgUrl(id)` (its rows, as SQL, to save)
20
+ * and `deleteOrg(id, name)` (its exact name confirms it). An app that
21
+ * doesn't do one says so (`unsupported`). Gift codes: `giftCodes()`,
22
+ * `createGiftCode(...)` (the code itself, this once) and `revokeGiftCode(id)`.
23
+ *
24
+ * It's the page's own HTTP, same origin, with the cookies the directory set
25
+ * (see routes/orgs.ts and routes/console.ts).
26
+ */
27
+ import { useSyncExternalStore } from "react";
28
+ import { onOrgsChanged } from "pairz/plugins/interfaces/contract";
29
+ import { sayOrg } from "./words.js";
30
+ let state = { status: "loading" };
31
+ let asked;
32
+ const listeners = new Set();
33
+ const set = (next) => {
34
+ state = next;
35
+ for (const listener of listeners)
36
+ listener();
37
+ };
38
+ const store = {
39
+ subscribe(listener) {
40
+ listeners.add(listener);
41
+ return () => listeners.delete(listener);
42
+ },
43
+ get: () => state,
44
+ };
45
+ /** Asks the server, once (again with `refreshOrgs`); a server that serves one org answers none. */
46
+ export function loadOrgs() {
47
+ return asked ??= fetch("/orgs", { headers: { accept: "application/json" } }).then(async (response) => {
48
+ const json = response.headers.get("content-type")?.includes("application/json");
49
+ // One org: the server answers its page (or nothing) where many would answer JSON.
50
+ if (!response.ok || !json) {
51
+ set({ status: "none" });
52
+ return state;
53
+ }
54
+ const value = await response.json();
55
+ // Staff in an org of someone else's: its name is the console's.
56
+ const here = currentOrg(value) ??
57
+ (value.staff && value.current
58
+ ? (await consoleOrgs().catch(() => [])).find((o) => o.id === value.current)
59
+ : undefined);
60
+ const next = {
61
+ status: "ready",
62
+ value,
63
+ ...(here
64
+ ? {
65
+ here: {
66
+ id: here.id,
67
+ name: here.name,
68
+ kind: here.kind,
69
+ ...(here.suspended ? { suspended: true } : {}),
70
+ },
71
+ }
72
+ : {}),
73
+ };
74
+ set(next);
75
+ return next;
76
+ }, () => {
77
+ asked = undefined;
78
+ const next = { status: "none" };
79
+ set(next);
80
+ return next;
81
+ });
82
+ }
83
+ /** Asks the server again: after renaming an org, or answering an invitation. */
84
+ export function refreshOrgs() {
85
+ asked = undefined;
86
+ return loadOrgs();
87
+ }
88
+ // An org changed elsewhere in the page (its owners renamed it in spaces' About): ask again.
89
+ onOrgsChanged(() => void refreshOrgs());
90
+ /** The orgs, as they stand, kept current. */
91
+ export function useOrgs() {
92
+ const now = useSyncExternalStore(store.subscribe, store.get, store.get);
93
+ if (now.status === "loading" && typeof fetch === "function")
94
+ void loadOrgs();
95
+ return now;
96
+ }
97
+ /** The org the session is in: one of theirs, or (for staff) one they've gone into. */
98
+ export const currentOrg = (orgs) => orgs.orgs.find((o) => o.id === orgs.current);
99
+ /** Whether they're in an org as platform staff, not as one of its people. */
100
+ export const asStaff = (orgs) => orgs.asStaff === true;
101
+ /** What an org is called where it shows: everyone's own is "Personal". */
102
+ export const orgName = (org) => org.kind === "personal" ? sayOrg("personalOrg") : org.name;
103
+ /** What a refusal's status means: not let (403), not done by this app (501), or not so (else). */
104
+ const codeOf = (status) => status === 403 ? "forbidden" : status === 501 ? "unsupported" : "invalid";
105
+ const post = async (path, body) => {
106
+ const response = await fetch(path, {
107
+ method: "POST",
108
+ headers: { "content-type": "application/json" },
109
+ body: JSON.stringify(body),
110
+ });
111
+ const answer = await response.json().catch(() => ({}));
112
+ if (!response.ok) {
113
+ throw Object.assign(new Error(answer.error ?? response.statusText), {
114
+ code: codeOf(response.status),
115
+ });
116
+ }
117
+ return answer;
118
+ };
119
+ let switching;
120
+ const switchers = new Set();
121
+ const switchingTo = (next) => {
122
+ switching = next;
123
+ for (const listener of switchers)
124
+ listener();
125
+ };
126
+ /** The org the page is going into, while it does (the shell shows a short transition). */
127
+ export function useSwitching() {
128
+ return useSyncExternalStore((listener) => {
129
+ switchers.add(listener);
130
+ return () => switchers.delete(listener);
131
+ }, () => switching, () => undefined);
132
+ }
133
+ /** Where the page says, once it has started over, which org it came into. */
134
+ const ARRIVED = "pairz-org-arrived";
135
+ /** Shows the transition, does `move`, then starts over at the org's home; failing, it stays. */
136
+ async function into(to, move) {
137
+ switchingTo(to);
138
+ const started = Date.now();
139
+ try {
140
+ const done = await move();
141
+ // Long enough to read where you're going; never long enough to wait on.
142
+ await new Promise((r) => setTimeout(r, Math.max(0, 420 - (Date.now() - started))));
143
+ try {
144
+ sessionStorage.setItem(ARRIVED, JSON.stringify(to));
145
+ }
146
+ catch { /* private mode: no welcome */ }
147
+ location.assign("/");
148
+ return done;
149
+ }
150
+ catch (error) {
151
+ switchingTo(undefined);
152
+ throw error;
153
+ }
154
+ }
155
+ /** Goes into an org (one of theirs; any, for staff), and starts over at its home. */
156
+ export function enterOrg(org, staff = false) {
157
+ return into({ id: org.id, name: org.name, kind: org.kind, ...(staff ? { staff: true } : {}) }, () => post("/orgs/enter", { org: org.id, ...(staff ? { staff: true } : {}) })).then(() => { });
158
+ }
159
+ /** Makes a team org, its maker its owner, and goes into it. */
160
+ export function createOrg(name) {
161
+ return into({ name, kind: "team" }, () => post("/orgs", { name })).then(() => { });
162
+ }
163
+ /** Accepts an invitation (and goes into its org) or declines it. */
164
+ export async function answerOrgInvite(invite, accept) {
165
+ if (!accept) {
166
+ await post("/orgs/invites/answer", { invite: invite.id, accept: false });
167
+ await refreshOrgs();
168
+ return;
169
+ }
170
+ await into({ id: invite.org, name: invite.name, kind: "team" }, () => post("/orgs/invites/answer", { invite: invite.id, accept: true }));
171
+ }
172
+ /**
173
+ * Where many orgs are served, someone still signed in whose session in this
174
+ * org ended (they were taken out of it, or it was suspended) goes into
175
+ * another of theirs instead of signing in again: the one they were in
176
+ * before, or their own. True when the page is starting over there; never
177
+ * twice in a row, so a page that can't get in shows sign-in.
178
+ */
179
+ export async function reenter() {
180
+ const KEY = "pairz-org-reentered";
181
+ try {
182
+ if (Date.now() - Number(sessionStorage.getItem(KEY) ?? 0) < 15_000)
183
+ return false;
184
+ const found = await loadOrgs();
185
+ if (found.status !== "ready")
186
+ return false;
187
+ const next = found.value.orgs.find((o) => o.id !== found.value.current && !o.suspended);
188
+ if (!next)
189
+ return false;
190
+ sessionStorage.setItem(KEY, String(Date.now()));
191
+ await post("/orgs/enter", { org: next.id });
192
+ sessionStorage.setItem(ARRIVED, JSON.stringify({ id: next.id, name: next.name, kind: next.kind, moved: true }));
193
+ location.assign("/");
194
+ return true;
195
+ }
196
+ catch {
197
+ return false;
198
+ }
199
+ }
200
+ /** The org the page just came into, once (its welcome), then forgotten. */
201
+ export function arrived() {
202
+ try {
203
+ const kept = sessionStorage.getItem(ARRIVED);
204
+ sessionStorage.removeItem(ARRIVED);
205
+ return kept ? JSON.parse(kept) : undefined;
206
+ }
207
+ catch {
208
+ return undefined;
209
+ }
210
+ }
211
+ /** Every org, for staff's console. */
212
+ export async function consoleOrgs() {
213
+ const response = await fetch("/console/orgs", { headers: { accept: "application/json" } });
214
+ const answer = await response.json().catch(() => ({}));
215
+ if (!response.ok) {
216
+ throw Object.assign(new Error(answer.error ?? response.statusText), {
217
+ code: codeOf(response.status),
218
+ });
219
+ }
220
+ return answer.orgs;
221
+ }
222
+ /** Suspends an org or lifts it, or renames it: staff's. */
223
+ export async function updateOrg(org, change) {
224
+ await post(`/console/orgs/${encodeURIComponent(org)}`, change);
225
+ }
226
+ /** Moves an org's rows to another schema (for a big org: one of its own). */
227
+ export async function moveOrg(org, schema) {
228
+ const { placement } = await post(`/console/orgs/${encodeURIComponent(org)}/move`, { schema });
229
+ return placement;
230
+ }
231
+ /** Where an org's rows download, as SQL. */
232
+ export const exportOrgUrl = (org) => `/console/orgs/${encodeURIComponent(org)}/export`;
233
+ /** Deletes an org for good: `name`, its exact name, confirms it. */
234
+ export async function deleteOrg(org, name) {
235
+ await post(`/console/orgs/${encodeURIComponent(org)}/delete`, { confirm: name });
236
+ }
237
+ /** Gift codes, newest first, for staff's console. */
238
+ export async function giftCodes() {
239
+ const response = await fetch("/console/codes", { headers: { accept: "application/json" } });
240
+ const answer = await response.json().catch(() => ({}));
241
+ if (!response.ok) {
242
+ throw Object.assign(new Error(answer.error ?? response.statusText), {
243
+ code: codeOf(response.status),
244
+ });
245
+ }
246
+ return answer.codes;
247
+ }
248
+ /** Makes a gift code: the answer's `code` is the only time it's ever shown. */
249
+ export const createGiftCode = (code) => post("/console/codes", code);
250
+ /** Takes back a gift code nobody has claimed. */
251
+ export async function revokeGiftCode(id) {
252
+ await post("/console/codes/revoke", { id });
253
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The directory's front end, its layout: the switcher and what it opens, making an org,
3
+ * going between orgs, staff's line along the top, the org's page and staff's console. Only
4
+ * layout, on the theme's variables.
5
+ */
6
+ export declare const STYLE = "\n/* The switcher, at the top of the sidebar beside the app's mark */\n.pairz-org { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px;\n padding: 6px 8px 6px 7px; border: 1px solid transparent; border-radius: var(--radius-lg); background: transparent;\n color: var(--sidebar-foreground); text-align: left; cursor: pointer; transition: background-color .12s, border-color .12s; }\n.pairz-org:hover, .pairz-org[aria-expanded=true] { background: var(--sidebar-accent); }\n.pairz-org[aria-expanded=true] { border-color: var(--sidebar-border); }\n.pairz-org-text { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.25; }\n.pairz-org-name { overflow: hidden; font-family: var(--font-display); font-size: 14.5px; font-weight: 650;\n letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }\n.pairz-org-sub { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden;\n color: var(--muted-foreground); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }\n.pairz-org[data-staff] .pairz-org-sub { color: var(--warning-text); font-weight: 620; }\n.pairz-org[data-staff] > .pairz-avatar { outline: 2px solid var(--warning); outline-offset: 1px; }\n.pairz-org-rail[data-staff] > .pairz-avatar { outline: 2px solid var(--warning); outline-offset: 1px; }\n.pairz-org-chevron { flex: none; color: var(--muted-foreground); }\n.pairz-org-dot { flex: none; display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px;\n border-radius: var(--radius-full); background: var(--primary); color: var(--primary-foreground); font-size: 11px;\n font-weight: 700; font-variant-numeric: tabular-nums; }\n\n/* What the switcher opens */\n.pairz-orgs-box { display: grid; gap: 2px; }\n.pairz-orgs-who { margin: 4px 8px 6px; overflow: hidden; color: var(--muted-foreground); font-size: 12.5px;\n text-overflow: ellipsis; white-space: nowrap; }\n.pairz-orgs-who b { color: var(--foreground); font-weight: 600; }\n.pairz-orgs-staff { display: flex; align-items: flex-start; gap: 8px; margin: 0 2px 6px; padding: 9px 10px;\n border: 1px solid var(--warning-border); border-radius: var(--radius-md); background: var(--warning-soft);\n color: var(--warning-text); font-size: 12.5px; line-height: 1.45; }\n.pairz-orgs-staff > .pairz-icon { margin-top: 1px; }\n.pairz-orgs-staff b { font-weight: 650; }\n.pairz-orgs-staff-back { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: inherit;\n font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }\n.pairz-orgs-list, .pairz-orgs-invites ul { list-style: none; display: grid; gap: 1px; margin: 0; padding: 0; }\n.pairz-orgs-row, .pairz-orgs-action { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;\n padding: 6px 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit;\n font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; outline: none; }\n.pairz-orgs-row:hover, .pairz-orgs-row:focus-visible, .pairz-orgs-action:hover,\n.pairz-orgs-action:focus-visible { background: var(--accent); color: var(--accent-foreground); }\n.pairz-orgs-row:focus-visible, .pairz-orgs-action:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }\n.pairz-orgs-row[aria-current] { background: color-mix(in oklab, var(--primary-soft) 60%, transparent); }\n.pairz-orgs-row[aria-disabled] { opacity: .62; cursor: not-allowed; }\n.pairz-orgs-row-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }\n.pairz-orgs-row-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }\n.pairz-orgs-row-sub { color: var(--muted-foreground); font-size: 12px; }\n.pairz-orgs-row-error { color: var(--destructive-text); font-size: 12px; white-space: normal; }\n.pairz-orgs-check { flex: none; color: var(--primary-text); }\n.pairz-orgs-invites { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }\n.pairz-orgs-invites h3 { display: flex; align-items: center; gap: 6px; margin: 0 8px 8px; color: var(--muted-foreground);\n font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }\n.pairz-orgs-invites ul { gap: 6px; }\n.pairz-orgs-invite { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin: 0 2px; padding: 10px;\n border: 1px solid var(--primary-border); border-radius: var(--radius-lg);\n background: color-mix(in oklab, var(--primary-soft) 45%, var(--popover)); }\n.pairz-orgs-invite-text { display: grid; gap: 1px; min-width: 0; }\n.pairz-orgs-invite-name { margin: 0; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }\n.pairz-orgs-invite-meta { margin: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }\n.pairz-orgs-invite-meta .pairz-time { font-size: 12.5px; }\n.pairz-orgs-invite-answers { display: flex; gap: 6px; margin-top: 8px; }\n.pairz-orgs-actions { display: grid; gap: 1px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }\n.pairz-orgs-action { min-height: 38px; color: var(--secondary-foreground); }\n.pairz-orgs-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted-foreground); }\n.pairz-orgs-icon-new { border: 1px dashed var(--input); border-radius: var(--radius-sm); }\n\n/* Making one */\n.pairz-new-org { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }\n.pairz-new-org-preview { padding-top: 25px; }\n\n/* Going into another org: over everything, until it's there; and a word once it is */\n.pairz-switching { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;\n border: 0; background: transparent; color: var(--foreground); outline: none; }\n.pairz-switching::backdrop { background: color-mix(in oklab, var(--background) 84%, transparent);\n -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: pairz-switching .22s ease-out; }\n.pairz-switching[open] { display: grid; place-items: center; animation: pairz-switching .22s ease-out; }\n.pairz-switching-box { display: grid; justify-items: center; text-align: center;\n animation: pairz-switching-in .36s cubic-bezier(.2, .8, .2, 1); }\n.pairz-switching-box .pairz-avatar { box-shadow: var(--shadow-md); }\n.pairz-switching-personal { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--radius-full);\n background: var(--primary-soft); color: var(--primary-text); }\n.pairz-switching-label { margin: 18px 0 2px; color: var(--muted-foreground); font-size: 13px; }\n.pairz-switching-name { margin: 0 0 18px; max-width: min(520px, calc(100vw - 48px)); font-family: var(--font-display);\n font-size: 26px; font-weight: 680; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }\n.pairz-switching .pairz-spinner { color: var(--muted-foreground); }\n@keyframes pairz-switching { from { opacity: 0; } }\n@keyframes pairz-switching-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }\n.pairz-arrived { position: fixed; z-index: 70; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));\n display: flex; align-items: center; gap: 9px; width: max-content; max-width: min(560px, calc(100vw - 32px));\n padding: 10px 16px;\n border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--popover);\n color: var(--popover-foreground); box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.4;\n pointer-events: none; animation: pairz-arrived 2.6s ease-in-out forwards; }\n.pairz-arrived b { font-weight: 650; }\n.pairz-arrived > .pairz-icon { color: var(--success-text); }\n.pairz-arrived[data-long] { border-radius: var(--radius-xl); animation-duration: 5.2s; }\n.pairz-arrived[data-long] > .pairz-icon { color: var(--info-text); }\n.pairz-arrived[data-staff] { border-color: var(--warning-border); }\n.pairz-arrived[data-staff] > .pairz-icon { color: var(--warning-text); }\n@keyframes pairz-arrived {\n 0% { opacity: 0; transform: translate(-50%, 10px); }\n 10%, 88% { opacity: 1; transform: translate(-50%, 0); }\n 100% { opacity: 0; transform: translate(-50%, 4px); }\n}\n\n/* Staff in someone's org: a line along the top, always */\n.pairz-staff-line { position: fixed; z-index: 80; inset: 0 0 auto; height: 3px; background: var(--warning);\n pointer-events: none; }\n\n/* The org's page */\n.pairz-org-held { margin-bottom: 12px; }\n.pairz-org-tabs { position: sticky; top: 0; z-index: 4; display: flex; width: 100%; margin-top: -2px;\n background: var(--background); }\n.pairz-org-tabs .pairz-tab { padding: 0 10px; }\n.pairz-org-section { padding-top: 22px; }\n.pairz-org-loading { display: grid; gap: 14px; margin-top: 8px; }\n.pairz-org-missing { display: grid; place-items: center; padding: 32px; }\n.pairz-org-page .pairz-page-badges .pairz-badge { gap: 4px; }\n\n/* Staff's console: dense, calm */\n.console-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }\n.console-stat { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);\n background: var(--card); }\n.console-stat-label { color: var(--muted-foreground); font-size: 12px; font-weight: 600; }\n.console-stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -.02em;\n line-height: 1.2; font-variant-numeric: tabular-nums; }\n.console-stat[data-tone=warning] .console-stat-value { color: var(--warning-text); }\n.console-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;\n margin: 22px 0 12px; }\n.console-search { flex: 1 1 280px; max-width: 420px; }\n.console-notice { margin-bottom: 12px; }\n.console-loading { display: grid; gap: 6px; }\n.console-table { container: console / inline-size; display: grid; border: 1px solid var(--border);\n border-radius: var(--radius-lg); background: var(--card); overflow: hidden; }\n.console-row { display: grid; grid-template-columns: minmax(220px, 2.4fr) 64px 64px minmax(92px, .9fr) minmax(110px, 1fr) 92px 176px;\n align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px 8px 14px; font-size: 13.5px; }\n.console-row + .console-row { border-top: 1px solid var(--border); }\n.console-row:not(.console-head):hover { background: color-mix(in oklab, var(--muted) 45%, var(--card)); }\n.console-row[data-suspended] { background: color-mix(in oklab, var(--warning-soft) 35%, var(--card)); }\n.console-head { min-height: 38px; background: color-mix(in oklab, var(--muted) 55%, var(--card)); color: var(--muted-foreground);\n font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }\n.console-num { text-align: right; font-variant-numeric: tabular-nums; }\n.console-org { display: flex; align-items: center; gap: 11px; min-width: 0; }\n.console-org-text { display: grid; gap: 1px; min-width: 0; }\n.console-org-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; font-weight: 620;\n text-overflow: ellipsis; white-space: nowrap; }\n.console-org-meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground);\n font-size: 12px; }\n.console-org-meta code { min-width: 0; overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }\n.console-org-meta .pairz-copy { margin: -4px 0; }\n.console-error { color: var(--destructive-text); font-size: 12px; }\n.console-active { color: var(--secondary-foreground); }\n.console-active .pairz-time { font-size: 13px; }\n.console-placement { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground); }\n.console-placement code { min-width: 0; overflow: hidden; color: var(--secondary-foreground); font-size: 12.5px;\n text-overflow: ellipsis; white-space: nowrap; }\n.console-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }\n.console-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n.console-foot { margin: 12px 2px 0; color: var(--muted-foreground); font-size: 12.5px; }\n.console-dialog-text { margin: 0 0 12px; color: var(--secondary-foreground); font-size: 14px; line-height: 1.55; }\n.console-move { display: grid; gap: 4px; }\n.console-move-from { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--muted-foreground);\n font-size: 13px; }\n.console-move-from code { padding: 2px 8px; border-radius: var(--radius-sm); background: var(--muted);\n color: var(--foreground); font-size: 12.5px; }\n.console-mono input { font-family: var(--font-mono); }\n.console-delete { display: grid; gap: 14px; }\n.console-export { display: inline-flex; align-items: center; gap: 6px; justify-self: start; color: var(--primary-text);\n font-size: 13.5px; font-weight: 560; text-underline-offset: 3px; }\n.console-name { font-family: var(--font-mono); font-weight: 650; }\n@container console (max-width: 900px) {\n .console-row.console-head { display: none; }\n .console-row > [data-label=Placement] { display: none; }\n .console-row:not([data-suspended]) > [data-label=Status] { display: none; }\n .console-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 10px 12px 14px; }\n .console-row::after { content: \"\"; order: 1; flex-basis: 100%; height: 0; }\n .console-org { flex: 1 1 0; }\n .console-row > [data-label] { order: 2; color: var(--muted-foreground); font-size: 12.5px; text-align: left; }\n .console-row > [data-label=People] { margin-left: 41px; }\n .console-row > [data-label=People]::before, .console-row > [data-label=Spaces]::before,\n .console-row > [data-label=\"Last active\"]::before { content: attr(data-label) \" \"; }\n .console-row > [data-label=People]::before, .console-row > [data-label=Spaces]::before,\n .console-row > [data-label=\"Last active\"]::before { color: var(--muted-foreground); }\n .console-row > [data-label] .pairz-time, .console-row > [data-label] code { color: var(--foreground); font-size: 12.5px; }\n .console-row > .console-num { color: var(--foreground); }\n}\n@container console (max-width: 520px) {\n .console-actions .pairz-button { padding: 0 9px; }\n}\n@media (max-width: 760px) {\n .console-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }\n .console-search { max-width: none; }\n .pairz-org-tabs { position: static; }\n}\n";
@@ -0,0 +1,197 @@
1
+ /**
2
+ * The directory's front end, its layout: the switcher and what it opens, making an org,
3
+ * going between orgs, staff's line along the top, the org's page and staff's console. Only
4
+ * layout, on the theme's variables.
5
+ */
6
+ export const STYLE = `
7
+ /* The switcher, at the top of the sidebar beside the app's mark */
8
+ .pairz-org { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px;
9
+ padding: 6px 8px 6px 7px; border: 1px solid transparent; border-radius: var(--radius-lg); background: transparent;
10
+ color: var(--sidebar-foreground); text-align: left; cursor: pointer; transition: background-color .12s, border-color .12s; }
11
+ .pairz-org:hover, .pairz-org[aria-expanded=true] { background: var(--sidebar-accent); }
12
+ .pairz-org[aria-expanded=true] { border-color: var(--sidebar-border); }
13
+ .pairz-org-text { flex: 1; min-width: 0; display: grid; gap: 1px; line-height: 1.25; }
14
+ .pairz-org-name { overflow: hidden; font-family: var(--font-display); font-size: 14.5px; font-weight: 650;
15
+ letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
16
+ .pairz-org-sub { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden;
17
+ color: var(--muted-foreground); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
18
+ .pairz-org[data-staff] .pairz-org-sub { color: var(--warning-text); font-weight: 620; }
19
+ .pairz-org[data-staff] > .pairz-avatar { outline: 2px solid var(--warning); outline-offset: 1px; }
20
+ .pairz-org-rail[data-staff] > .pairz-avatar { outline: 2px solid var(--warning); outline-offset: 1px; }
21
+ .pairz-org-chevron { flex: none; color: var(--muted-foreground); }
22
+ .pairz-org-dot { flex: none; display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px;
23
+ border-radius: var(--radius-full); background: var(--primary); color: var(--primary-foreground); font-size: 11px;
24
+ font-weight: 700; font-variant-numeric: tabular-nums; }
25
+
26
+ /* What the switcher opens */
27
+ .pairz-orgs-box { display: grid; gap: 2px; }
28
+ .pairz-orgs-who { margin: 4px 8px 6px; overflow: hidden; color: var(--muted-foreground); font-size: 12.5px;
29
+ text-overflow: ellipsis; white-space: nowrap; }
30
+ .pairz-orgs-who b { color: var(--foreground); font-weight: 600; }
31
+ .pairz-orgs-staff { display: flex; align-items: flex-start; gap: 8px; margin: 0 2px 6px; padding: 9px 10px;
32
+ border: 1px solid var(--warning-border); border-radius: var(--radius-md); background: var(--warning-soft);
33
+ color: var(--warning-text); font-size: 12.5px; line-height: 1.45; }
34
+ .pairz-orgs-staff > .pairz-icon { margin-top: 1px; }
35
+ .pairz-orgs-staff b { font-weight: 650; }
36
+ .pairz-orgs-staff-back { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: inherit;
37
+ font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
38
+ .pairz-orgs-list, .pairz-orgs-invites ul { list-style: none; display: grid; gap: 1px; margin: 0; padding: 0; }
39
+ .pairz-orgs-row, .pairz-orgs-action { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
40
+ padding: 6px 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit;
41
+ font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; outline: none; }
42
+ .pairz-orgs-row:hover, .pairz-orgs-row:focus-visible, .pairz-orgs-action:hover,
43
+ .pairz-orgs-action:focus-visible { background: var(--accent); color: var(--accent-foreground); }
44
+ .pairz-orgs-row:focus-visible, .pairz-orgs-action:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
45
+ .pairz-orgs-row[aria-current] { background: color-mix(in oklab, var(--primary-soft) 60%, transparent); }
46
+ .pairz-orgs-row[aria-disabled] { opacity: .62; cursor: not-allowed; }
47
+ .pairz-orgs-row-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
48
+ .pairz-orgs-row-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
49
+ .pairz-orgs-row-sub { color: var(--muted-foreground); font-size: 12px; }
50
+ .pairz-orgs-row-error { color: var(--destructive-text); font-size: 12px; white-space: normal; }
51
+ .pairz-orgs-check { flex: none; color: var(--primary-text); }
52
+ .pairz-orgs-invites { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
53
+ .pairz-orgs-invites h3 { display: flex; align-items: center; gap: 6px; margin: 0 8px 8px; color: var(--muted-foreground);
54
+ font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
55
+ .pairz-orgs-invites ul { gap: 6px; }
56
+ .pairz-orgs-invite { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin: 0 2px; padding: 10px;
57
+ border: 1px solid var(--primary-border); border-radius: var(--radius-lg);
58
+ background: color-mix(in oklab, var(--primary-soft) 45%, var(--popover)); }
59
+ .pairz-orgs-invite-text { display: grid; gap: 1px; min-width: 0; }
60
+ .pairz-orgs-invite-name { margin: 0; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
61
+ .pairz-orgs-invite-meta { margin: 0; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.45; }
62
+ .pairz-orgs-invite-meta .pairz-time { font-size: 12.5px; }
63
+ .pairz-orgs-invite-answers { display: flex; gap: 6px; margin-top: 8px; }
64
+ .pairz-orgs-actions { display: grid; gap: 1px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
65
+ .pairz-orgs-action { min-height: 38px; color: var(--secondary-foreground); }
66
+ .pairz-orgs-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted-foreground); }
67
+ .pairz-orgs-icon-new { border: 1px dashed var(--input); border-radius: var(--radius-sm); }
68
+
69
+ /* Making one */
70
+ .pairz-new-org { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 16px; }
71
+ .pairz-new-org-preview { padding-top: 25px; }
72
+
73
+ /* Going into another org: over everything, until it's there; and a word once it is */
74
+ .pairz-switching { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
75
+ border: 0; background: transparent; color: var(--foreground); outline: none; }
76
+ .pairz-switching::backdrop { background: color-mix(in oklab, var(--background) 84%, transparent);
77
+ -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: pairz-switching .22s ease-out; }
78
+ .pairz-switching[open] { display: grid; place-items: center; animation: pairz-switching .22s ease-out; }
79
+ .pairz-switching-box { display: grid; justify-items: center; text-align: center;
80
+ animation: pairz-switching-in .36s cubic-bezier(.2, .8, .2, 1); }
81
+ .pairz-switching-box .pairz-avatar { box-shadow: var(--shadow-md); }
82
+ .pairz-switching-personal { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--radius-full);
83
+ background: var(--primary-soft); color: var(--primary-text); }
84
+ .pairz-switching-label { margin: 18px 0 2px; color: var(--muted-foreground); font-size: 13px; }
85
+ .pairz-switching-name { margin: 0 0 18px; max-width: min(520px, calc(100vw - 48px)); font-family: var(--font-display);
86
+ font-size: 26px; font-weight: 680; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
87
+ .pairz-switching .pairz-spinner { color: var(--muted-foreground); }
88
+ @keyframes pairz-switching { from { opacity: 0; } }
89
+ @keyframes pairz-switching-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
90
+ .pairz-arrived { position: fixed; z-index: 70; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
91
+ display: flex; align-items: center; gap: 9px; width: max-content; max-width: min(560px, calc(100vw - 32px));
92
+ padding: 10px 16px;
93
+ border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--popover);
94
+ color: var(--popover-foreground); box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.4;
95
+ pointer-events: none; animation: pairz-arrived 2.6s ease-in-out forwards; }
96
+ .pairz-arrived b { font-weight: 650; }
97
+ .pairz-arrived > .pairz-icon { color: var(--success-text); }
98
+ .pairz-arrived[data-long] { border-radius: var(--radius-xl); animation-duration: 5.2s; }
99
+ .pairz-arrived[data-long] > .pairz-icon { color: var(--info-text); }
100
+ .pairz-arrived[data-staff] { border-color: var(--warning-border); }
101
+ .pairz-arrived[data-staff] > .pairz-icon { color: var(--warning-text); }
102
+ @keyframes pairz-arrived {
103
+ 0% { opacity: 0; transform: translate(-50%, 10px); }
104
+ 10%, 88% { opacity: 1; transform: translate(-50%, 0); }
105
+ 100% { opacity: 0; transform: translate(-50%, 4px); }
106
+ }
107
+
108
+ /* Staff in someone's org: a line along the top, always */
109
+ .pairz-staff-line { position: fixed; z-index: 80; inset: 0 0 auto; height: 3px; background: var(--warning);
110
+ pointer-events: none; }
111
+
112
+ /* The org's page */
113
+ .pairz-org-held { margin-bottom: 12px; }
114
+ .pairz-org-tabs { position: sticky; top: 0; z-index: 4; display: flex; width: 100%; margin-top: -2px;
115
+ background: var(--background); }
116
+ .pairz-org-tabs .pairz-tab { padding: 0 10px; }
117
+ .pairz-org-section { padding-top: 22px; }
118
+ .pairz-org-loading { display: grid; gap: 14px; margin-top: 8px; }
119
+ .pairz-org-missing { display: grid; place-items: center; padding: 32px; }
120
+ .pairz-org-page .pairz-page-badges .pairz-badge { gap: 4px; }
121
+
122
+ /* Staff's console: dense, calm */
123
+ .console-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
124
+ .console-stat { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg);
125
+ background: var(--card); }
126
+ .console-stat-label { color: var(--muted-foreground); font-size: 12px; font-weight: 600; }
127
+ .console-stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -.02em;
128
+ line-height: 1.2; font-variant-numeric: tabular-nums; }
129
+ .console-stat[data-tone=warning] .console-stat-value { color: var(--warning-text); }
130
+ .console-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
131
+ margin: 22px 0 12px; }
132
+ .console-search { flex: 1 1 280px; max-width: 420px; }
133
+ .console-notice { margin-bottom: 12px; }
134
+ .console-loading { display: grid; gap: 6px; }
135
+ .console-table { container: console / inline-size; display: grid; border: 1px solid var(--border);
136
+ border-radius: var(--radius-lg); background: var(--card); overflow: hidden; }
137
+ .console-row { display: grid; grid-template-columns: minmax(220px, 2.4fr) 64px 64px minmax(92px, .9fr) minmax(110px, 1fr) 92px 176px;
138
+ align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px 8px 14px; font-size: 13.5px; }
139
+ .console-row + .console-row { border-top: 1px solid var(--border); }
140
+ .console-row:not(.console-head):hover { background: color-mix(in oklab, var(--muted) 45%, var(--card)); }
141
+ .console-row[data-suspended] { background: color-mix(in oklab, var(--warning-soft) 35%, var(--card)); }
142
+ .console-head { min-height: 38px; background: color-mix(in oklab, var(--muted) 55%, var(--card)); color: var(--muted-foreground);
143
+ font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
144
+ .console-num { text-align: right; font-variant-numeric: tabular-nums; }
145
+ .console-org { display: flex; align-items: center; gap: 11px; min-width: 0; }
146
+ .console-org-text { display: grid; gap: 1px; min-width: 0; }
147
+ .console-org-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; font-weight: 620;
148
+ text-overflow: ellipsis; white-space: nowrap; }
149
+ .console-org-meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground);
150
+ font-size: 12px; }
151
+ .console-org-meta code { min-width: 0; overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
152
+ .console-org-meta .pairz-copy { margin: -4px 0; }
153
+ .console-error { color: var(--destructive-text); font-size: 12px; }
154
+ .console-active { color: var(--secondary-foreground); }
155
+ .console-active .pairz-time { font-size: 13px; }
156
+ .console-placement { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground); }
157
+ .console-placement code { min-width: 0; overflow: hidden; color: var(--secondary-foreground); font-size: 12.5px;
158
+ text-overflow: ellipsis; white-space: nowrap; }
159
+ .console-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
160
+ .console-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
161
+ .console-foot { margin: 12px 2px 0; color: var(--muted-foreground); font-size: 12.5px; }
162
+ .console-dialog-text { margin: 0 0 12px; color: var(--secondary-foreground); font-size: 14px; line-height: 1.55; }
163
+ .console-move { display: grid; gap: 4px; }
164
+ .console-move-from { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--muted-foreground);
165
+ font-size: 13px; }
166
+ .console-move-from code { padding: 2px 8px; border-radius: var(--radius-sm); background: var(--muted);
167
+ color: var(--foreground); font-size: 12.5px; }
168
+ .console-mono input { font-family: var(--font-mono); }
169
+ .console-delete { display: grid; gap: 14px; }
170
+ .console-export { display: inline-flex; align-items: center; gap: 6px; justify-self: start; color: var(--primary-text);
171
+ font-size: 13.5px; font-weight: 560; text-underline-offset: 3px; }
172
+ .console-name { font-family: var(--font-mono); font-weight: 650; }
173
+ @container console (max-width: 900px) {
174
+ .console-row.console-head { display: none; }
175
+ .console-row > [data-label=Placement] { display: none; }
176
+ .console-row:not([data-suspended]) > [data-label=Status] { display: none; }
177
+ .console-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 10px 12px 14px; }
178
+ .console-row::after { content: ""; order: 1; flex-basis: 100%; height: 0; }
179
+ .console-org { flex: 1 1 0; }
180
+ .console-row > [data-label] { order: 2; color: var(--muted-foreground); font-size: 12.5px; text-align: left; }
181
+ .console-row > [data-label=People] { margin-left: 41px; }
182
+ .console-row > [data-label=People]::before, .console-row > [data-label=Spaces]::before,
183
+ .console-row > [data-label="Last active"]::before { content: attr(data-label) " "; }
184
+ .console-row > [data-label=People]::before, .console-row > [data-label=Spaces]::before,
185
+ .console-row > [data-label="Last active"]::before { color: var(--muted-foreground); }
186
+ .console-row > [data-label] .pairz-time, .console-row > [data-label] code { color: var(--foreground); font-size: 12.5px; }
187
+ .console-row > .console-num { color: var(--foreground); }
188
+ }
189
+ @container console (max-width: 520px) {
190
+ .console-actions .pairz-button { padding: 0 9px; }
191
+ }
192
+ @media (max-width: 760px) {
193
+ .console-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
194
+ .console-search { max-width: none; }
195
+ .pairz-org-tabs { position: static; }
196
+ }
197
+ `;