/* Customize menu (ATLAS-2783h), kept in its own file beside its module. */
@import url('./menu-customize.css');

/* Shared business-room components use the existing theme, type and spacing tokens. */
.room-page-header {
  align-items: flex-start;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.room-purpose {
  color: var(--muted);
  margin: var(--space-2) 0 0;
  max-width: 65ch;
  font-size: var(--type-base);
  line-height: 1.5;
}
.room-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-sm);
  background: var(--cyan);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.room-button.secondary {
  background: var(--surface2);
  border-color: var(--line);
  color: var(--text);
}
.room-button:disabled {
  opacity: 0.5;
  cursor: default;
}
.room-button:focus-visible,
.room-table-row:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.room-card,
.room-empty,
.room-error {
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: var(--space-4);
}
.room-card h2,
.room-empty h2,
.room-error h2 {
  margin-top: 0;
  font-size: var(--type-xl);
}
.room-empty p,
.room-error p {
  color: var(--muted);
  line-height: 1.5;
}
.room-error {
  border-color: var(--danger);
}
.room-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.room-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.room-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-body);
}
.room-table th,
.room-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.room-table th .room-button {
  white-space: nowrap;
}
.room-table-row {
  cursor: pointer;
}
.room-table-row:hover {
  background: var(--surface2);
}
.room-chip {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-2);
  background: var(--surface2);
  color: var(--muted);
  white-space: nowrap;
}
.room-chip.tone-good {
  color: var(--cyan);
}
.room-chip.tone-warn {
  color: var(--gold);
}
.room-chip.tone-bad {
  color: var(--danger);
}
.room-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.room-field input,
.room-field select,
.room-field textarea {
  min-height: 44px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.room-skeleton {
  padding: var(--space-4);
}
.room-skeleton-line {
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  margin-bottom: var(--space-3);
  animation: room-pulse 1.4s ease-in-out infinite alternate;
}
.room-skeleton-line:nth-last-child(1) {
  width: 65%;
}
.room-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.room-david {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cust-main,
.cust-room,
.room {
  min-width: 0;
}
@keyframes room-pulse {
  to {
    opacity: 0.4;
  }
}
@media (prefers-reduced-motion: reduce) {
  .room-skeleton-line {
    animation: none;
  }
}
@media (max-width: 600px) {
  .cust-app .cust-nav {
    display: flex;
    overflow-x: auto;
    gap: var(--space-2);
  }
  .cust-app .cust-link {
    flex: 0 0 auto;
    min-height: 44px;
  }
  .cust-app .cust-link .cust-icon {
    display: block;
    width: 18px;
    height: 18px;
  }
  .room-page-header {
    flex-direction: column;
  }
  .room-page-header .room-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .room-page-header .room-button {
    flex: 1;
  }
  .room-table th,
  .room-table td {
    padding: var(--space-2);
  }
  .room-empty,
  .room-card,
  .room-error {
    padding: var(--space-4);
  }
}

:root,
:root[data-theme='dark'] {
  color-scheme: dark;
  /* The browser chrome (meta theme-color) and the manifest: the ATLAS ink. */
  --theme-color: #05080e;
  /* Behind a tenant logo. Logos are white-lettering artwork, drawn for a dark ground. */
  --logo-plate: transparent;
  /* Business profile previews: a logo for dark or light backgrounds, on that background in
     either theme. */
  --plate-dark: #121316;
  --plate-light: #f4f1ea;
  --ink: #080b12;
  --surface: #0d1420;
  --surface2: #111c2b;
  --line: #223956;
  --text: #eef7ff;
  --muted: #87a0b9;
  --cyan: #31d7ff;
  --blue: #3585ff;
  --gold: #e9b85b;
  --danger: #ff7b92;

  /*
   * The one card surface. It was written out five times verbatim, so a change to the
   * console's depth meant finding all five.
   */
  --surface-card: linear-gradient(145deg, rgba(16, 28, 43, 0.93), rgba(9, 15, 24, 0.92));

  /* Spacing. A 4px base; everything below snaps to it. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* Radii. Three, plus a pill - not the nine distinct values this file had grown. */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /*
   * Type. The console is deliberately dense and its tracked uppercase labels are part of
   * that, but 8px was below the point where a label is readable at all. 9px is the floor,
   * and running prose never uses it.
   */
  --type-nano: 9px;
  --type-micro: 10px;
  --type-small: 11px;
  --type-body: 13px;
  --type-base: 14px;
  --type-lg: 16px;
  --type-xl: 18px;
  --type-display: 23px;
  --type-hero: 28px;

  /* Motion. There was exactly one transition in the whole stylesheet. */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --motion-fast: 120ms;
  --motion-base: 180ms;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
}

/*
 * The light theme: the same token names, a near-white ground and dark text. Every value is
 * the dark value with its lightness turned over, and an accent that is read as text (the ALFA
 * gold, cyan, the status colours) darkened until it holds 4.5:1 on the light ground.
 */
:root[data-theme='light'] {
  color-scheme: light;
  --theme-color: #f1f4fa;
  --logo-plate: #0e1726;
  --plate-dark: #121316;
  --plate-light: #f4f1ea;
  --ink: #edf0f7;
  --surface: #dfe6f2;
  --surface2: #d4dfee;
  --line: #a9c0dd;
  --text: #000d1a;
  --muted: #465f78;
  --cyan: #007692;
  --blue: #0062f7;
  --gold: #8e6313;
  --danger: #dc0026;
  --surface-card: linear-gradient(145deg, rgba(212, 224, 239, 0.93), rgba(231, 237, 246, 0.92));
}

/*
 * Colour channels: every colour the rooms below use, as "r g b" so a rule can add its own alpha
 * - rgb(var(--c-3fd8ff) / 0.2). Each is named after its dark-theme value; the light theme gives
 * the same name its light counterpart, so no rule below carries a colour of its own.
 */
:root,
:root[data-theme='dark'] {
  --c-000000: 0 0 0;
  --c-02050a: 2 5 10;
  --c-02050b: 2 5 11;
  --c-04080e: 4 8 14;
  --c-04101c: 4 16 28;
  --c-04160d: 4 22 13;
  --c-05080d: 5 8 13;
  --c-05080e: 5 8 14;
  --c-050c14: 5 12 20;
  --c-050c16: 5 12 22;
  --c-050d16: 5 13 22;
  --c-060a10: 6 10 16;
  --c-060b14: 6 11 20;
  --c-06121c: 6 18 28;
  --c-070b12: 7 11 18;
  --c-070c14: 7 12 20;
  --c-070f18: 7 15 24;
  --c-07111d: 7 17 29;
  --c-07121f: 7 18 31;
  --c-071420: 7 20 32;
  --c-071526: 7 21 38;
  --c-080d16: 8 13 22;
  --c-08101c: 8 16 28;
  --c-08111f: 8 17 31;
  --c-08121e: 8 18 30;
  --c-09121e: 9 18 30;
  --c-09253b: 9 37 59;
  --c-0a111c: 10 17 28;
  --c-0a1422: 10 20 34;
  --c-0a1523: 10 21 35;
  --c-0a66c2: 10 102 194;
  --c-0b1320: 11 19 32;
  --c-0b1422: 11 20 34;
  --c-0b1725: 11 23 37;
  --c-0c1522: 12 21 34;
  --c-0d3a55: 13 58 85;
  --c-0e1724: 14 23 36;
  --c-0e1726: 14 23 38;
  --c-0e1d2c: 14 29 44;
  --c-101a24: 16 26 36;
  --c-101c2b: 16 28 43;
  --c-111111: 17 17 17;
  --c-1185fe: 17 133 254;
  --c-121316: 18 19 22;
  --c-143c6e: 20 60 110;
  --c-15294a: 21 41 74;
  --c-16a34a: 22 163 74;
  --c-173a54: 23 58 84;
  --c-178fb9: 23 143 185;
  --c-1877f2: 24 119 242;
  --c-1976b7: 25 118 183;
  --c-1a1204: 26 18 4;
  --c-1f1300: 31 19 0;
  --c-2563eb: 37 99 235;
  --c-25f4ee: 37 244 238;
  --c-273142: 39 49 66;
  --c-27445c: 39 68 92;
  --c-284a67: 40 74 103;
  --c-29455f: 41 69 95;
  --c-294b66: 41 75 102;
  --c-2a3644: 42 54 68;
  --c-2b4663: 43 70 99;
  --c-2b6074: 43 96 116;
  --c-2e5877: 46 88 119;
  --c-304d68: 48 77 104;
  --c-312412: 49 36 18;
  --c-31526e: 49 82 110;
  --c-31536d: 49 83 109;
  --c-31d7ff: 49 215 255;
  --c-34a853: 52 168 83;
  --c-3585ff: 53 133 255;
  --c-36536c: 54 83 108;
  --c-38516c: 56 81 108;
  --c-3a2700: 58 39 0;
  --c-3a4a5e: 58 74 94;
  --c-3ddc97: 61 220 151;
  --c-3fd8ff: 63 216 255;
  --c-475569: 71 85 105;
  --c-496177: 73 97 119;
  --c-503713: 80 55 19;
  --c-5a3d00: 90 61 0;
  --c-5f7187: 95 113 135;
  --c-6b4a00: 107 74 0;
  --c-6ee7a8: 110 231 168;
  --c-6f86a0: 111 134 160;
  --c-7192af: 113 146 175;
  --c-7495b3: 116 149 179;
  --c-7790a8: 119 144 168;
  --c-78c8ff: 120 200 255;
  --c-7fd6a4: 127 214 164;
  --c-7fe9ff: 127 233 255;
  --c-8134af: 129 52 175;
  --c-87a0b9: 135 160 185;
  --c-89a7bd: 137 167 189;
  --c-8a6d1d: 138 109 29;
  --c-8b7bff: 139 123 255;
  --c-8ba1b8: 139 161 184;
  --c-8ca5b9: 140 165 185;
  --c-8dffff: 141 255 255;
  --c-90abc0: 144 171 192;
  --c-91acc0: 145 172 192;
  --c-a5b5c0: 165 181 192;
  --c-a9b6c6: 169 182 198;
  --c-a9bfd1: 169 191 209;
  --c-a9c0d6: 169 192 214;
  --c-b3c6da: 179 198 218;
  --c-b5d2e7: 181 210 231;
  --c-b8ccdb: 184 204 219;
  --c-b9c9d5: 185 201 213;
  --c-b9ccdb: 185 204 219;
  --c-b9eaf4: 185 234 244;
  --c-bdd7e9: 189 215 233;
  --c-bfffff: 191 255 255;
  --c-c2d7e7: 194 215 231;
  --c-c3d3e4: 195 211 228;
  --c-c9d6e3: 201 214 227;
  --c-c9f7e3: 201 247 227;
  --c-d4af37: 212 175 55;
  --c-d6ecff: 214 236 255;
  --c-d8f7ff: 216 247 255;
  --c-d9a634: 217 166 52;
  --c-d9d3ff: 217 211 255;
  --c-d9effc: 217 239 252;
  --c-d9fbff: 217 251 255;
  --c-db2777: 219 39 119;
  --c-dd2a7b: 221 42 123;
  --c-dffaff: 223 250 255;
  --c-e0b42b: 224 180 43;
  --c-e60023: 230 0 35;
  --c-e6fbff: 230 251 255;
  --c-e8fdff: 232 253 255;
  --c-e9b85b: 233 184 91;
  --c-eaf4ff: 234 244 255;
  --c-ef4444: 239 68 68;
  --c-effbff: 239 251 255;
  --c-f0a35b: 240 163 91;
  --c-f1eeff: 241 238 255;
  --c-f2fbff: 242 251 255;
  --c-f58529: 245 133 41;
  --c-f59e0b: 245 158 11;
  --c-f5c451: 245 196 81;
  --c-f5d77a: 245 215 122;
  --c-ff0000: 255 0 0;
  --c-ff5d6e: 255 93 110;
  --c-ff6666: 255 102 102;
  --c-ff6b6b: 255 107 107;
  --c-ff7b92: 255 123 146;
  --c-ff8a80: 255 138 128;
  --c-ff8a8a: 255 138 138;
  --c-ffb3b3: 255 179 179;
  --c-ffb4b4: 255 180 180;
  --c-ffb547: 255 181 71;
  --c-ffc2cc: 255 194 204;
  --c-ffc9c9: 255 201 201;
  --c-ffd0d0: 255 208 208;
  --c-ffd166: 255 209 102;
  --c-ffd1da: 255 209 218;
  --c-ffd2d2: 255 210 210;
  --c-ffe1b3: 255 225 179;
  --c-fff4d6: 255 244 214;
  --c-ffffff: 255 255 255;
  --c-on-accent: 255 255 255;
}
:root[data-theme='light'] {
  --c-000000: 247 247 247;
  --c-02050a: 242 246 252;
  --c-02050b: 242 246 253;
  --c-04080e: 241 245 251;
  --c-04101c: 227 239 251;
  --c-04160d: 233 251 242;
  --c-05080d: 242 245 250;
  --c-05080e: 241 244 250;
  --c-050c14: 235 242 250;
  --c-050c16: 233 240 250;
  --c-050d16: 233 241 250;
  --c-060a10: 239 243 249;
  --c-060b14: 235 240 249;
  --c-06121c: 227 239 249;
  --c-070b12: 237 241 248;
  --c-070c14: 235 240 248;
  --c-070f18: 231 239 248;
  --c-07111d: 226 236 248;
  --c-07121f: 224 235 248;
  --c-071420: 223 236 248;
  --c-071526: 217 231 248;
  --c-080d16: 233 238 247;
  --c-08101c: 227 235 247;
  --c-08111f: 226 235 247;
  --c-08121e: 225 235 247;
  --c-09121e: 225 234 246;
  --c-09253b: 196 224 246;
  --c-0a111c: 227 234 245;
  --c-0a1422: 221 231 245;
  --c-0a1523: 220 231 245;
  --c-0a66c2: 10 102 194;
  --c-0b1320: 223 231 244;
  --c-0b1422: 221 230 244;
  --c-0b1725: 218 230 244;
  --c-0c1522: 221 230 243;
  --c-0d3a55: 170 215 242;
  --c-0e1724: 219 228 241;
  --c-0e1726: 217 226 241;
  --c-0e1d2c: 211 226 241;
  --c-101a24: 219 229 239;
  --c-101c2b: 212 224 239;
  --c-111111: 238 238 238;
  --c-1185fe: 17 133 254;
  --c-121316: 233 234 237;
  --c-143c6e: 145 185 235;
  --c-15294a: 181 201 234;
  --c-16a34a: 92 233 144;
  --c-173a54: 171 206 232;
  --c-178fb9: 19 118 153;
  --c-1877f2: 24 119 242;
  --c-1976b7: 24 115 179;
  --c-1a1204: 251 243 229;
  --c-1f1300: 255 243 224;
  --c-2563eb: 37 99 235;
  --c-25f4ee: 37 244 238;
  --c-273142: 189 199 216;
  --c-27445c: 163 192 216;
  --c-284a67: 152 186 215;
  --c-29455f: 160 188 214;
  --c-294b66: 153 187 214;
  --c-2a3644: 187 199 213;
  --c-2b4663: 156 183 212;
  --c-2b6074: 139 192 212;
  --c-2e5877: 136 178 209;
  --c-304d68: 151 180 207;
  --c-312412: 237 224 206;
  --c-31526e: 145 178 206;
  --c-31536d: 146 180 206;
  --c-31d7ff: 0 118 146;
  --c-34a853: 52 168 83;
  --c-3585ff: 0 98 247;
  --c-36536c: 147 176 201;
  --c-38516c: 147 172 199;
  --c-3a2700: 255 236 197;
  --c-3a4a5e: 161 177 197;
  --c-3ddc97: 23 126 81;
  --c-3fd8ff: 0 119 150;
  --c-475569: 150 164 184;
  --c-496177: 136 160 182;
  --c-503713: 236 211 175;
  --c-5a3d00: 255 226 165;
  --c-5f7187: 92 110 131;
  --c-6b4a00: 255 222 148;
  --c-6ee7a8: 21 126 71;
  --c-6f86a0: 89 110 135;
  --c-7192af: 80 113 142;
  --c-7495b3: 76 109 139;
  --c-7790a8: 87 112 136;
  --c-78c8ff: 0 113 191;
  --c-7fd6a4: 39 123 75;
  --c-7fe9ff: 0 118 142;
  --c-8134af: 129 52 175;
  --c-87a0b9: 70 95 120;
  --c-89a7bd: 66 96 118;
  --c-8a6d1d: 226 197 117;
  --c-8b7bff: 99 77 255;
  --c-8ba1b8: 71 93 116;
  --c-8ca5b9: 70 95 115;
  --c-8dffff: 0 121 121;
  --c-90abc0: 63 90 111;
  --c-91acc0: 63 90 110;
  --c-a5b5c0: 63 79 90;
  --c-a9b6c6: 57 70 86;
  --c-a9bfd1: 77 113 143;
  --c-a9c0d6: 73 113 152;
  --c-b3c6da: 75 113 154;
  --c-b5d2e7: 52 115 161;
  --c-b8ccdb: 72 112 142;
  --c-b9c9d5: 42 58 70;
  --c-b9ccdb: 75 114 146;
  --c-b9eaf4: 22 118 137;
  --c-bdd7e9: 52 113 156;
  --c-bfffff: 0 64 64;
  --c-c2d7e7: 61 114 155;
  --c-c3d3e4: 71 113 158;
  --c-c9d6e3: 76 112 148;
  --c-c9f7e3: 8 54 34;
  --c-d4af37: 132 107 28;
  --c-d6ecff: 0 22 41;
  --c-d8f7ff: 0 31 39;
  --c-d9a634: 136 102 26;
  --c-d9d3ff: 6 0 44;
  --c-d9effc: 3 25 38;
  --c-d9fbff: 0 34 38;
  --c-db2777: 204 34 109;
  --c-dd2a7b: 221 42 123;
  --c-dffaff: 0 27 32;
  --c-e0b42b: 135 107 20;
  --c-e60023: 230 0 35;
  --c-e6fbff: 0 21 26;
  --c-e8fdff: 0 23 26;
  --c-e9b85b: 142 99 19;
  --c-eaf4ff: 0 12 26;
  --c-ef4444: 217 19 19;
  --c-effbff: 0 19 26;
  --c-f0a35b: 168 89 15;
  --c-f1eeff: 4 0 26;
  --c-f2fbff: 0 18 26;
  --c-f58529: 245 133 41;
  --c-f59e0b: 153 98 6;
  --c-f5c451: 139 100 8;
  --c-f5d77a: 137 106 10;
  --c-ff0000: 255 0 0;
  --c-ff5d6e: 220 0 23;
  --c-ff6666: 219 0 0;
  --c-ff6b6b: 219 0 0;
  --c-ff7b92: 220 0 38;
  --c-ff8a80: 220 17 0;
  --c-ff8a8a: 220 0 0;
  --c-ffb3b3: 76 0 0;
  --c-ffb4b4: 75 0 0;
  --c-ffb547: 158 94 0;
  --c-ffc2cc: 61 0 10;
  --c-ffc9c9: 54 0 0;
  --c-ffd0d0: 47 0 0;
  --c-ffd166: 143 100 0;
  --c-ffd1da: 46 0 9;
  --c-ffd2d2: 45 0 0;
  --c-ffe1b3: 76 46 0;
  --c-fff4d6: 41 30 0;
  --c-ffffff: 13 13 13;
  --c-on-accent: 248 250 252;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(circle at 60% -10%, rgb(var(--c-15294a)) 0, transparent 28rem),
    var(--ink);
  color: var(--text);
  min-width: 320px;
}
.atlas-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-rows: 68px 1fr;
  background: linear-gradient(130deg, rgb(var(--c-31d7ff) / 0.025), transparent 36%);
}
[hidden] {
  display: none !important;
}
.atlas-header {
  grid-column: 1/3;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  align-items: center;
  gap: var(--space-5);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgb(var(--c-070c14) / 0.88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.atlas-wordmark {
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.22em;
  font-weight: 850;
  font-size: var(--type-lg);
}
.atlas-wordmark span {
  display: block;
  color: var(--cyan);
  font-size: var(--type-nano);
  letter-spacing: 0.17em;
  margin-top: 2px;
}
.vitals {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  overflow: auto;
  scrollbar-width: none;
}
.vital {
  white-space: nowrap;
  min-width: 92px;
  padding-right: 12px;
  border-right: 1px solid rgb(var(--c-31d7ff) / 0.14);
}
.vital span {
  display: block;
  font-size: var(--type-nano);
  letter-spacing: 0.11em;
  color: var(--muted);
  text-transform: uppercase;
}
.unavailable {
  font-size: var(--type-micro);
  color: rgb(var(--c-7790a8));
  letter-spacing: 0.04em;
}
.atlas-nav {
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(var(--c-0e1724) / 0.95), rgb(var(--c-070b12) / 0.95));
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 68px);
  position: sticky;
  top: 68px;
  align-self: start;
}
.nav-label,
.rail-title {
  font-size: var(--type-nano);
  letter-spacing: 0.16em;
  color: rgb(var(--c-7192af));
  font-weight: 800;
  padding: 0 10px 10px;
}
.nav-link {
  padding: 10px;
  border-radius: var(--radius-sm);
  color: rgb(var(--c-a9c0d6));
  text-decoration: none;
  font-size: var(--type-small);
  font-weight: 750;
  letter-spacing: 0.09em;
  transition: 0.18s;
}
.nav-link:hover,
.nav-link.active {
  background: linear-gradient(90deg, rgb(var(--c-31d7ff) / 0.17), transparent);
  color: rgb(var(--c-effbff));
  box-shadow: inset 2px 0 var(--cyan);
}
.nav-spacer {
  flex: 1;
}
.role-switch {
  border-top: 1px solid var(--line);
  padding: 12px 4px 0;
  display: grid;
  gap: var(--space-2);
}
.role-switch span {
  font-size: var(--type-nano);
  color: var(--muted);
  letter-spacing: 0.1em;
}
.role-switch button,
.new-thread,
.activity-controls button,
.evidence-strip button {
  font: inherit;
  font-size: var(--type-nano);
  letter-spacing: 0.06em;
  color: rgb(var(--c-90abc0));
  background: rgb(var(--c-101c2b));
  border: 1px solid rgb(var(--c-2b4663));
  border-radius: var(--radius-sm);
  padding: 7px;
  cursor: pointer;
}
.role-switch button.active {
  border-color: var(--cyan);
  color: var(--cyan);
}
button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}
.atlas-main {
  padding: var(--space-5);
  /*
   * `.ask-ceo` is fixed to the bottom centre of the viewport, so without clearance it sits
   * on top of whatever the room ends with. This reserves its height plus a margin.
   */
  padding-bottom: 92px;
  min-width: 0;
}
.room {
  max-width: 1500px;
  /*
   * `margin: auto` alone was written for a block layout, where it centres a full-width box.
   * `.atlas-workspace` is a **grid**, and on a grid item `margin: auto` cancels the default
   * `stretch` - so the room shrank to its content and centred that instead. Measured at
   * 1024px: 449px of an available 784px, every room using barely half its column while the
   * rest sat empty.
   *
   * `inline-size: 100%` restores the fill; `margin-inline: auto` keeps the centring the
   * original line was reaching for once the 1500px cap bites on a wide screen.
   */
  inline-size: 100%;
  margin-inline: auto;
}
.room-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  margin: 0 0 20px;
}
.room h1 {
  font-size: var(--type-hero);
  margin: 3px 0 0;
  letter-spacing: -0.035em;
}
.eyebrow {
  font-size: var(--type-micro);
  letter-spacing: 0.16em;
  color: var(--cyan);
  margin: 0;
}
.badge {
  display: inline-block;
  /*
   * A badge inside a column flex container is blockified and stretches to the full width of
   * the card, which reads as a bar rather than a pill. Fixing it here rather than on each
   * container means the next room to use a badge inherits the correct behaviour.
   *
   * BOTH properties are required, and the first version of this fix only had the first.
   * `align-self` governs the cross axis, which is the horizontal one in a *column flex*
   * container - but `.executive-node` is a **grid**, where the horizontal axis is `justify`.
   * So the Executive Board's status badges went on stretching to 135px while the portfolio's
   * looked correct, which is precisely the kind of thing that is invisible until rendered.
   */
  align-self: start;
  justify-self: start;
  font-size: var(--type-nano);
  letter-spacing: 0.08em;
  border: 1px solid rgb(var(--c-38516c));
  padding: 4px 6px;
  border-radius: var(--radius-pill);
  color: rgb(var(--c-91acc0));
}
.badge.cyan {
  border-color: rgb(var(--c-31d7ff) / 0.45);
  color: var(--cyan);
}
.badge.gold {
  border-color: rgb(var(--c-e9b85b) / 0.6);
  color: var(--gold);
}
.gold-text {
  color: var(--gold);
}
.command-room {
  max-width: 1700px;
  margin: auto;
  display: grid;
  grid-template-columns: 220px minmax(430px, 1fr) 252px;
  gap: var(--space-4);
  position: relative;
  padding-bottom: 66px;
}
.command-left,
.command-right,
.command-center,
.room,
.limited-room,
.placeholder-room {
  border: 1px solid var(--line);
  background: var(--surface-card);
  box-shadow: 0 18px 45px rgb(var(--c-000000) / 0.22);
}
.command-left,
.command-right {
  padding: 14px;
  min-height: 690px;
}
.thread-search,
.composer textarea,
.activity-controls input {
  width: 100%;
  margin: 9px 0;
  padding: 10px;
  background: rgb(var(--c-07111d));
  border: 1px solid rgb(var(--c-29455f));
  color: var(--text);
  border-radius: var(--radius-sm);
}
.rail-note {
  font-size: var(--type-small);
  line-height: 1.6;
  color: var(--muted);
}
.command-center {
  min-width: 0;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.atlas-core-panel {
  height: 190px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle, rgb(var(--c-31d7ff) / 0.17), transparent 36%),
    linear-gradient(90deg, transparent, rgb(var(--c-31d7ff) / 0.04), transparent);
  border-bottom: 1px solid rgb(var(--c-31d7ff) / 0.2);
}
.core-orbit {
  position: absolute;
  border: 1px solid rgb(var(--c-31d7ff) / 0.4);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}
.orbit-a {
  width: 152px;
  height: 78px;
  transform: rotate(22deg);
}
.orbit-b {
  width: 112px;
  height: 148px;
  transform: rotate(-28deg);
  animation-direction: reverse;
}
.core-center {
  z-index: 1;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background: radial-gradient(
    circle at 35% 30%,
    rgb(var(--c-8dffff)),
    rgb(var(--c-1976b7)) 43%,
    rgb(var(--c-071526)) 70%
  );
  box-shadow:
    0 0 38px rgb(var(--c-31d7ff) / 0.55),
    inset 0 0 20px rgb(var(--c-bfffff));
}
.core-center strong {
  font-size: var(--type-micro);
  letter-spacing: 0.08em;
  color: rgb(var(--c-06121c));
}
.core-center small {
  font-size: var(--type-nano);
  color: rgb(var(--c-09253b));
  font-weight: 800;
}
.core-dot {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgb(var(--c-ffffff));
  box-shadow: 0 0 15px rgb(var(--c-ffffff));
}
.core-state {
  position: absolute;
  bottom: 13px;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--type-micro);
  color: var(--muted);
}
@keyframes spin {
  to {
    rotate: 1turn;
  }
}
@media (prefers-reduced-motion: reduce) {
  .core-orbit {
    animation: none;
  }
}
.conversation {
  display: grid;
  gap: var(--space-3);
  padding: 16px 4px;
  min-height: 270px;
}
.message {
  padding: 13px 15px;
  border-left: 2px solid var(--cyan);
  background: rgb(var(--c-050d16) / 0.46);
  font-size: var(--type-body);
  line-height: 1.55;
}
.owner-message {
  border-color: var(--gold);
  margin-left: 9%;
  background: rgb(var(--c-312412) / 0.28);
}
.message-author {
  display: block;
  font-size: var(--type-nano);
  letter-spacing: 0.13em;
  color: var(--cyan);
  font-weight: 800;
}
.owner-message .message-author {
  color: var(--gold);
}
.execution-card,
.command-result {
  border: 1px solid rgb(var(--c-284a67));
  background: rgb(var(--c-0a1523));
  padding: 13px;
}
.execution-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: center;
}
.telemetry-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
}
.telemetry-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 7px 0;
  border-bottom: 1px solid rgb(var(--c-7495b3) / 0.14);
  font-size: var(--type-small);
  color: rgb(var(--c-a9bfd1));
}
.autonomy-room {
  display: grid;
  gap: var(--space-5);
  padding: 22px;
}
.autonomy-state {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 11px 13px;
  border: 1px solid rgb(var(--c-31d7ff) / 0.3);
  background: rgb(var(--c-071420) / 0.72);
  color: var(--muted);
  font-size: var(--type-small);
}
.autonomy-state.stale,
.autonomy-state.missing {
  border-color: rgb(var(--c-e9b85b) / 0.5);
}
.autonomy-state.failed {
  border-color: rgb(var(--c-ff6666) / 0.55);
}
.autonomy-state p {
  margin: 0;
}
.learning-room {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.owner-correction {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--line, rgb(var(--c-2a3644)));
  border-radius: var(--radius-md);
}
.owner-correction input[type='text'],
.owner-correction textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem;
  font: inherit;
}
.owner-correction textarea {
  min-height: 6rem;
  resize: vertical;
}
.correction-actions {
  display: flex;
  justify-content: flex-end;
}
.correction-ok {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.autonomy-sections {
  display: grid;
  gap: var(--space-3);
}
.autonomy-sections h2 {
  margin: 12px 0 0;
  color: rgb(var(--c-b9eaf4));
  font-size: var(--type-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.autonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
.autonomy-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgb(var(--c-294b66));
  background: rgb(var(--c-07111d) / 0.82);
}
.autonomy-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  color: rgb(var(--c-dffaff));
}
.autonomy-card-head strong {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.autonomy-card-head .badge {
  flex: none;
}
.autonomy-fields {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
  gap: 0;
  margin: 10px 0 0;
  font-size: var(--type-micro);
}
.autonomy-fields dt,
.autonomy-fields dd {
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px solid rgb(var(--c-7495b3) / 0.14);
  overflow-wrap: anywhere;
}
.autonomy-fields dt {
  color: var(--muted);
}
.autonomy-fields dd {
  min-width: 0;
  color: rgb(var(--c-c2d7e7));
}
.empty-state {
  margin: 0;
  padding: 14px;
  border: 1px dashed rgb(var(--c-36536c));
  color: var(--muted);
  font-size: var(--type-small);
}
.unavailable-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: 14px;
}
.unavailable-actions button {
  border: 1px solid rgb(var(--c-496177));
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: rgb(var(--c-101a24));
  color: var(--muted);
  font-size: var(--type-nano);
  letter-spacing: 0.08em;
}
.owner-mutation-console {
  display: grid;
  gap: var(--space-3);
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid rgb(var(--c-31d7ff) / 0.24);
}
.owner-mutation-console > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.owner-mutation-console h2,
.owner-mutation-card h3,
.owner-mutation-console p {
  margin: 0;
}
.owner-mutation-console > p,
.owner-mutation-card > p,
.owner-mutation-status,
.owner-replay-confirm {
  color: var(--muted);
  font-size: var(--type-small);
  line-height: 1.5;
}
.owner-mutation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-3);
}
.owner-mutation-card {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-width: 0;
  padding: 14px;
  border: 1px solid rgb(var(--c-36536c));
  background: rgb(var(--c-07111d) / 0.88);
}
.owner-mutation-card h3 {
  color: rgb(var(--c-dffaff));
  font-size: var(--type-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.owner-mutation-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.owner-mutation-field {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  color: var(--muted);
  font-size: var(--type-nano);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.owner-mutation-field:first-child,
.owner-mutation-field:last-child {
  grid-column: 1 / -1;
}
.owner-mutation-field input,
.owner-mutation-field select {
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgb(var(--c-29455f));
  border-radius: var(--radius-sm);
  background: rgb(var(--c-07111d));
  color: var(--text);
  font: inherit;
  font-size: var(--type-small);
  letter-spacing: normal;
  text-transform: none;
}
.owner-mutation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.owner-mutation-card button {
  padding: 8px 10px;
  border: 1px solid rgb(var(--c-2b6074));
  border-radius: var(--radius-sm);
  background: rgb(var(--c-178fb9) / 0.14);
  color: rgb(var(--c-d9fbff));
  font: inherit;
  font-size: var(--type-nano);
  font-weight: 800;
  letter-spacing: 0.07em;
}
.owner-replay-confirm {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.owner-replay-confirm input {
  flex: none;
  margin-top: 3px;
}
.owner-mutation-status {
  padding: 9px;
  border-left: 2px solid var(--gold);
  background: rgb(var(--c-e9b85b) / 0.06);
}
.owner-mutation-receipt {
  max-height: 260px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid rgb(var(--c-7495b3) / 0.28);
  background: rgb(var(--c-050c14));
  color: rgb(var(--c-b9eaf4));
  font-size: var(--type-micro);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.composer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.composer textarea {
  resize: vertical;
  min-height: 72px;
  margin: 0;
}
.composer-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: 8px;
}
.read-command {
  margin-left: auto;
  border: 1px solid var(--cyan);
  background: rgb(var(--c-178fb9) / 0.16);
  color: rgb(var(--c-d9fbff));
  border-radius: var(--radius-sm);
  padding: 9px;
  font-size: var(--type-nano);
  font-weight: 850;
  letter-spacing: 0.08em;
}
.evidence-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 48px;
  border: 1px solid rgb(var(--c-304d68));
  background: rgb(var(--c-070f18) / 0.96);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  overflow: auto;
  font-size: var(--type-nano);
  color: var(--muted);
}
.evidence-strip strong {
  color: var(--cyan);
  white-space: nowrap;
}
.evidence-strip span {
  white-space: nowrap;
  border-left: 1px solid rgb(var(--c-27445c));
  padding-left: 10px;
}
.executive-map {
  padding: 32px 18px;
  text-align: center;
  position: relative;
  overflow: auto;
  min-height: 610px;
  background: radial-gradient(circle at 50% 10%, rgb(var(--c-31d7ff) / 0.12), transparent 35%),
    rgb(var(--c-09121e));
}
.owner-node,
.executive-node {
  border: 1px solid rgb(var(--c-2e5877));
  background: rgb(var(--c-0e1d2c) / 0.92);
  color: var(--text);
  padding: 12px;
  min-width: 145px;
}
.owner-node {
  display: inline-block;
  border-color: var(--gold);
  color: var(--gold);
  letter-spacing: 0.12em;
  font-weight: 850;
}
.map-line.vertical {
  height: 35px;
  width: 1px;
  background: var(--cyan);
  margin: auto;
}
.map-line.horizontal {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  max-width: 700px;
  margin: 30px auto;
}
.ceo-wrap {
  display: flex;
  justify-content: center;
}
.executive-node {
  display: grid;
  gap: var(--space-2);
  text-align: left;
}
.executive-node.ceo {
  border-color: var(--cyan);
  box-shadow: 0 0 25px rgb(var(--c-31d7ff) / 0.15);
}
.executive-node small {
  font-size: var(--type-nano);
  color: var(--muted);
}
.executive-grid {
  display: grid;
  /*
   * `auto-fit` rather than a fixed 3. Three 160px columns plus gaps need 508px, and the board
   * column is 462px on a 1024px window - so the chart sat inside its `overflow-x: auto`
   * parent and made the Owner scroll sideways to see their own org chart. The nodes need
   * ~158px of content, so narrowing the columns would only move the overflow inside them.
   *
   * Reflowing to two columns shows the whole hierarchy instead. It still takes three whenever
   * there is room, and the scroll container remains as the backstop for genuinely narrow
   * screens.
   */
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
  max-width: 850px;
  margin: auto;
}
.fleet {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-4);
}
.capacity {
  padding: 12px;
  background: rgb(var(--c-0a1422));
}
.worker-table {
  display: grid;
  gap: var(--space-2);
}
.worker-row {
  padding: 15px;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  font-size: var(--type-small);
}
.worker-row span {
  grid-column: 1/-1;
  color: var(--muted);
}
.task-graph,
.system-map {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  padding: 38px;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgb(var(--c-3585ff) / 0.16), transparent 35%),
    rgb(var(--c-08121e));
}
.graph-node,
.system-node {
  position: relative;
  border: 1px solid rgb(var(--c-31526e));
  padding: 13px;
  min-width: 110px;
  text-align: center;
  color: rgb(var(--c-b5d2e7));
  font-size: var(--type-micro);
  letter-spacing: 0.06em;
}
.graph-node:after,
.system-node:after {
  content: '';
  position: absolute;
  width: 22px;
  height: 1px;
  right: -23px;
  top: 50%;
  background: var(--cyan);
}
.graph-node.selected {
  border-color: var(--gold);
  color: var(--gold);
}
.system-node {
  display: grid;
  gap: var(--space-2);
  min-width: 120px;
}
.approval-center {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-6);
  padding: 30px;
}
.gold-seal {
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  color: var(--gold);
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: var(--type-body);
  letter-spacing: 0.13em;
  text-align: center;
  box-shadow: 0 0 30px rgb(var(--c-e9b85b) / 0.14);
}
.activity-stream {
  max-width: 920px;
  border-left: 1px solid var(--cyan);
  padding-left: 18px;
}
.activity-controls {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: 16px;
}
.activity-event {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: var(--space-3);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-size: var(--type-body);
}
.activity-event span {
  color: var(--cyan);
}
.placeholder-room,
.limited-room {
  padding: 22px;
  max-width: 900px;
}
.limited-room {
  line-height: 1.6;
}
/* The signed-out overlay. Its card is the branded sign-in (`sign-in.css`), scrollable on a phone. */
.signin {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  background: radial-gradient(
      1100px 520px at 50% -12%,
      rgb(var(--c-e0b42b) / 0.13),
      transparent 62%
    ),
    rgb(var(--c-05080e));
  z-index: 20;
}
.button {
  display: inline-block;
  padding: 10px 15px;
  background: rgb(var(--c-173a54));
  color: rgb(var(--c-ffffff));
  text-decoration: none;
  border: 1px solid var(--cyan);
  border-radius: var(--radius-sm);
}
.ask-ceo {
  position: fixed;
  z-index: 12;
  bottom: 16px;
  left: 50%;
  translate: -50%;
  border: 1px solid var(--cyan);
  background: rgb(var(--c-07121f) / 0.94);
  box-shadow: 0 0 25px rgb(var(--c-31d7ff) / 0.17);
  color: var(--cyan);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.ask-ceo small {
  display: block;
  font-size: var(--type-nano);
  color: var(--muted);
  margin-top: 2px;
}
.notice.error {
  padding: 16px;
  border: 1px solid var(--danger);
  color: rgb(var(--c-ffd1da));
}
.loading {
  color: var(--muted);
  padding: 50px;
  text-align: center;
}
.atlas-header {
  grid-template-columns: 190px minmax(270px, auto) minmax(0, 1fr) 220px;
}
.atlas-workspace-bar {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: var(--space-2);
}
.ghl-launch,
.board-mode-toggle,
.voice-command,
.voice-cancel {
  min-width: 0;
  border: 1px solid rgb(var(--c-31536d));
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: rgb(var(--c-0b1725));
  color: rgb(var(--c-bdd7e9));
  font: inherit;
  font-size: var(--type-nano);
  letter-spacing: 0.07em;
}
/* The sub-agency pull-down in a business room's header: switch without leaving the room. */
.room-agency-picker {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.room-agency-picker select {
  min-width: 0;
  max-width: 260px;
  padding: 8px 12px;
  border: 1px solid rgb(var(--c-31536d));
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
}
.room-agency-picker select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Add a sub-agency. */
.add-agency-form {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.add-agency-form label {
  display: grid;
  gap: var(--space-1);
  color: var(--muted);
}
.add-agency-form input {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid rgb(var(--c-31536d));
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
}
.add-agency-form button {
  justify-self: start;
}
@media (max-width: 720px) {
  .room-agency-picker,
  .room-agency-picker select {
    width: 100%;
    max-width: none;
  }
}

.ghl-launch {
  color: var(--gold);
  border-color: rgb(var(--c-e9b85b) / 0.5);
  white-space: nowrap;
}
.ghl-launch.inline {
  margin-top: 8px;
}
.nav-secondary-label {
  margin: 18px 10px 4px;
  color: rgb(var(--c-7192af));
  font-size: var(--type-nano);
  font-weight: 800;
  letter-spacing: 0.15em;
}
.nav-link.secondary {
  color: rgb(var(--c-8ca5b9));
  font-size: var(--type-nano);
}
.atlas-workspace {
  display: grid;
  gap: var(--space-4);
}
.atlas-preview-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  border: 1px solid rgb(var(--c-e9b85b) / 0.4);
  background: rgb(var(--c-503713) / 0.16);
  color: rgb(var(--c-b9c9d5));
  font-size: var(--type-small);
  line-height: 1.45;
}
.voice-controls {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: var(--space-2);
}
.voice-state {
  color: rgb(var(--c-89a7bd));
  flex: 1 1 210px;
  min-width: 0;
  /* Prose, not a label - it wraps and carries sentences, so it does not use the label floor. */
  font-size: var(--type-small);
  line-height: 1.35;
  letter-spacing: 0.08em;
  white-space: normal;
}
.voice-state[data-voice-state='recording'],
.voice-state[data-voice-state='requesting'],
.voice-state[data-voice-state='transcribed'] {
  color: var(--gold);
}
.voice-state[data-voice-state='reconnect'],
.voice-state[data-voice-state='unavailable'],
.voice-state[data-voice-state='cancelled'] {
  color: rgb(var(--c-a5b5c0));
}
.voice-command {
  border-color: var(--cyan);
  color: var(--cyan);
  white-space: nowrap;
}
.voice-cancel {
  white-space: nowrap;
}
.atlas-workspace .voice-command,
.atlas-workspace .voice-cancel {
  min-height: 42px;
  font-size: var(--type-small);
  font-weight: 700;
}
.executive-board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.35fr);
  gap: var(--space-4);
}
.executive-inspector,
.atlas-detail-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.executive-inspector h2,
.atlas-detail-card h2 {
  margin: 4px 0 12px;
  font-size: var(--type-lg);
}
.executive-node {
  cursor: pointer;
}
.executive-node:hover {
  border-color: var(--gold);
}
/*
 * This previously set `outline: none`, which removed the only indicator a keyboard user has
 * on a clickable node. The hover colour is kept; the ring is restored by the global rule.
 */
.executive-node:focus-visible {
  border-color: var(--gold);
}
.executive-map-2d {
  min-height: 0;
  padding: 18px;
  background: rgb(var(--c-09121e));
}
.executive-map-2d .map-line {
  display: none;
}
.executive-map-2d .ceo-wrap {
  margin: 12px auto;
}
.executive-map-2d .executive-grid {
  max-width: none;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.board-mode-toggle {
  color: rgb(var(--c-d9effc));
}
.atlas-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}
.atlas-detail-card p,
.atlas-contract-card li {
  color: var(--muted);
  font-size: var(--type-small);
  line-height: 1.55;
}
.atlas-contract-card ul {
  padding-left: 18px;
  margin: 10px 0 0;
}
@media (prefers-reduced-motion: reduce) {
  .atlas-workspace .core-orbit {
    animation: none;
  }
}
@media (max-width: 1100px) {
  .atlas-app {
    grid-template-columns: 185px 1fr;
    /*
     * The header becomes TWO rows here - the workspace bar, then the vitals spanning the full
     * width - but the row itself was still pinned to the 68px of the single-row layout. The
     * bar measured 75px inside it and spilled over the boundary, which is what crowded the
     * agency selector down to 21px wide. Let the header be as tall as the layout it was given.
     */
    grid-template-rows: auto 1fr;
  }
  .atlas-header {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  .atlas-workspace-bar {
    grid-column: 2;
  }
  .vitals {
    grid-column: 1 / -1;
  }
  .command-room {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .command-right {
    display: none;
  }
}
@media (max-width: 900px) {
  .executive-board-layout,
  .atlas-health-grid {
    grid-template-columns: 1fr;
  }
  .voice-controls {
    flex-basis: 100%;
    order: 3;
  }
}
@media (max-width: 760px) {
  .atlas-app {
    display: block;
  }
  .atlas-header {
    position: static;
    display: block;
    padding: 14px;
  }
  .vitals {
    margin-top: 10px;
  }
  .atlas-workspace-bar {
    margin-top: 10px;
    flex-wrap: wrap;
  }
  .atlas-nav {
    position: static;
    min-height: 0;
    display: flex;
    flex-direction: row;
    overflow: auto;
    padding: 8px;
    white-space: nowrap;
  }
  .nav-label,
  .nav-spacer,
  .role-switch {
    display: none;
  }
  .nav-link {
    padding: 8px;
  }
  .atlas-main {
    padding: 10px;
  }
  .room-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .room-actions {
    flex-basis: 100%;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .autonomy-room {
    padding: 12px;
  }
  .autonomy-state {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .autonomy-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .autonomy-fields dt {
    padding-bottom: 0;
    border-bottom: 0;
  }
  .autonomy-fields dd {
    padding-top: 2px;
  }
  .owner-mutation-grid,
  .owner-mutation-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .owner-mutation-field:first-child,
  .owner-mutation-field:last-child {
    grid-column: auto;
  }
  .command-room {
    display: block;
    padding-bottom: 58px;
  }
  .command-left,
  .command-right {
    display: none;
  }
  .command-center {
    padding: 10px;
  }
  .atlas-core-panel {
    height: 150px;
  }
  .executive-grid {
    grid-template-columns: 1fr 1fr;
  }
  .fleet,
  .approval-center {
    grid-template-columns: 1fr;
  }
  .ask-ceo {
    bottom: 8px;
  }
  .room h1 {
    font-size: var(--type-display);
  }
  .atlas-preview-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .composer-controls {
    flex-wrap: wrap;
  }
  .voice-state {
    white-space: normal;
  }
}

/* The Atlas route is an Owner workspace, not a developer console. */
.atlas-workspace {
  font-size: var(--type-lg);
}
.atlas-workspace .atlas-preview-banner {
  border-radius: var(--radius-md);
  font-size: var(--type-base);
}
.atlas-workspace .command-room {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  max-width: 1320px;
  padding-bottom: 0;
}
.atlas-workspace .command-left,
.atlas-workspace .evidence-strip,
.atlas-workspace .atlas-core-panel {
  display: none;
}
.atlas-workspace .command-center,
.atlas-workspace .command-right {
  min-height: 0;
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.atlas-workspace .command-center {
  padding: 26px;
}
.atlas-workspace .command-right {
  padding: 22px;
}
.atlas-workspace .conversation {
  min-height: 320px;
  padding: 0 0 18px;
}
.atlas-workspace .message {
  padding: 17px 18px;
  font-size: var(--type-lg);
  line-height: 1.6;
}
.atlas-workspace .message-author,
.atlas-workspace .rail-title,
.atlas-workspace .eyebrow {
  font-size: var(--type-small);
}
.atlas-workspace .rail-note,
.atlas-workspace .command-result p,
.atlas-workspace .advanced-control-content p {
  font-size: var(--type-base);
  line-height: 1.55;
}
.atlas-workspace .composer textarea {
  min-height: 120px;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: var(--type-lg);
  line-height: 1.5;
}
.atlas-workspace .composer-controls {
  justify-content: space-between;
  gap: var(--space-3);
}
.atlas-workspace .send-command,
.atlas-workspace .voice-command,
.atlas-workspace .voice-cancel,
.atlas-workspace .read-command {
  min-height: 42px;
  padding: 10px 14px;
  font-size: var(--type-body);
}
.atlas-workspace .send-command {
  margin-left: auto;
  border: 1px solid var(--cyan);
  border-radius: var(--radius-md);
  background: rgb(var(--c-178fb9) / 0.22);
  color: rgb(var(--c-e8fdff));
  font-weight: 800;
  letter-spacing: 0.06em;
}
.atlas-workspace .voice-state {
  font-size: var(--type-small);
  letter-spacing: 0.03em;
}
.atlas-workspace .command-result {
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius-md);
}
.atlas-workspace .command-result strong {
  display: block;
  font-size: var(--type-xl);
  letter-spacing: -0.01em;
}
.result-state {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 12px;
}
.command-diagnostics {
  margin-top: 14px;
  border-top: 1px solid rgb(var(--c-7495b3) / 0.18);
  color: var(--muted);
}
.command-diagnostics summary {
  padding: 12px 0;
  cursor: pointer;
  color: rgb(var(--c-b8ccdb));
  font-size: var(--type-body);
}
.advanced-control-content {
  display: grid;
  gap: var(--space-3);
  padding-bottom: 8px;
}
.advanced-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.atlas-workspace .telemetry-row {
  font-size: var(--type-body);
}
.atlas-workspace .telemetry-row span:first-child {
  color: rgb(var(--c-b9ccdb));
}
.atlas-workspace .badge {
  font-size: var(--type-small);
  letter-spacing: 0.04em;
}
.atlas-header:has(.atlas-workspace-bar:not([hidden])) {
  min-height: 64px;
  grid-template-columns: auto minmax(210px, 0.8fr) minmax(150px, auto) minmax(170px, auto);
  gap: var(--space-3);
}
.atlas-header:has(.atlas-workspace-bar:not([hidden])) .atlas-wordmark {
  font-size: var(--type-lg);
}
.atlas-header:has(.atlas-workspace-bar:not([hidden])) .vitals {
  justify-content: flex-start;
}
.atlas-header:has(.atlas-workspace-bar:not([hidden])) .vital {
  min-width: 125px;
  padding-right: 0;
  border-right: 0;
}
.atlas-app[data-workspace='atlas'] .ask-ceo,
.atlas-app[data-workspace='atlas'] .role-switch {
  display: none;
}
.atlas-app[data-workspace='atlas'] .nav-link {
  font-size: var(--type-body);
  letter-spacing: 0.02em;
  text-transform: none;
}
.atlas-app[data-workspace='atlas'] .nav-label,
.atlas-app[data-workspace='atlas'] .nav-secondary-label {
  letter-spacing: 0.08em;
}
.atlas-workspace .task-diagnostics {
  margin-top: 18px;
}
@media (max-width: 900px) {
  .atlas-workspace .command-room {
    grid-template-columns: 1fr;
  }
  .atlas-workspace .command-right {
    display: block;
  }
  .atlas-header:has(.atlas-workspace-bar:not([hidden])) {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}
@media (max-width: 760px) {
  .atlas-workspace .command-right {
    display: block;
    margin-top: 14px;
    min-height: 0;
  }
  .atlas-workspace .command-center,
  .atlas-workspace .command-right {
    padding: 16px;
  }
  .atlas-workspace .conversation {
    min-height: 0;
  }
  .atlas-workspace .message {
    padding: 14px;
    font-size: var(--type-lg);
  }
  .atlas-workspace .owner-message {
    margin-left: 0;
  }
  .atlas-workspace .composer-controls,
  .atlas-workspace .voice-controls {
    align-items: stretch;
  }
  .atlas-workspace .voice-controls {
    flex-wrap: wrap;
  }
  .atlas-workspace .voice-state {
    flex-basis: 100%;
  }
  .atlas-workspace .send-command,
  .atlas-workspace .voice-command,
  .atlas-workspace .voice-cancel {
    /*
     * `flex: 1` is `1 1 0%` - a zero basis, so these shared the row equally regardless of how
     * wide their labels are. At 375px that gave "CANCEL VOICE" 73px for a 115px label and it
     * was silently clipped, the same failure as the desktop row.
     *
     * `auto` keeps the intent - the buttons still grow to fill - while the basis is the text,
     * so a label wraps to the next line instead of being cut in half.
     */
    flex: 1 1 auto;
    margin-left: 0;
  }
  .atlas-header:has(.atlas-workspace-bar:not([hidden])) {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 12px;
  }
  .atlas-header:has(.atlas-workspace-bar:not([hidden])) .atlas-workspace-bar {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}

/* ------------------------------- Proposals -------------------------------- */
/*
 * Above the board, because "what should I do" is the question an Owner arrived with and the
 * board only answers "what is happening".
 */
.executive-board-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.proposals {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.proposals-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.proposals-head h2 {
  margin: 0;
  font-size: var(--type-lg);
}
.proposal {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  background: var(--surface-card);
}
/* Consequence, not decoration: the edge marks what stops other work. */
.proposal.blocking {
  border-left-color: var(--gold);
}
.proposal-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.proposal-office {
  font-family: var(--mono, monospace);
  font-size: var(--type-small);
  letter-spacing: 0.1em;
  color: var(--muted);
}
.proposal-observation {
  margin: 0;
  font-size: var(--type-base);
}
.proposal-text {
  margin: 0;
  font-size: var(--type-base);
  font-weight: 600;
}
.proposal-declined,
.proposal-requires {
  margin: 0;
  font-size: var(--type-body);
  color: var(--muted);
}

/* ----------------------------- Connected systems ---------------------------- */
/*
 * One surface per sub-agency. Categories stack; systems inside a category sit in a grid that
 * collapses to a single column on a narrow screen, because this page is the one an Owner is
 * most likely to open from a phone.
 */
.connected-systems {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.connected-system-category h2 {
  margin: 0 0 10px;
  font-size: var(--type-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.connected-system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}
.connected-system {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface-card);
}
/* A bound system is marked by an edge, never by colour alone: the badge says which it is. */
.connected-system.bound {
  border-left: 2px solid var(--cyan);
}
.connected-system-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.connected-system-head h3 {
  margin: 0;
  font-size: var(--type-lg);
}
.connected-system-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-body);
}
.connected-system-launch {
  align-self: flex-start;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: var(--type-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.connected-system-launch:hover {
  border-color: var(--cyan);
}

/* An open panel needs the room's full width, so it leaves the grid. */
.connected-system.framed {
  grid-column: 1 / -1;
}
.connected-system-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.connected-system-frame {
  width: 100%;
  height: min(70vh, 720px);
  border: 1px solid var(--line);
  background: var(--ink);
}
.connected-system-panel a {
  color: var(--cyan);
}

.funnel-grant-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.funnel-grantee {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: var(--type-body);
}
.connected-system-launch.inline {
  margin-left: 8px;
  padding: 4px 10px;
}
.voice-conversation {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--muted);
  font: inherit;
  font-size: var(--type-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.voice-conversation.active {
  border-color: var(--cyan);
  color: var(--text);
}

/* ---------------------------- Revenue Portfolio --------------------------- */
/*
 * Grouped by phase, because "what is running" and "what is only an idea" are different
 * questions and an Owner asks the first one first.
 */
.venture {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  background: var(--surface-card);
}
/* A venture somebody has actually ruled on reads differently from a raw candidate. */
.venture.judged {
  border-left-color: var(--cyan);
}
.venture-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.venture-head h3 {
  margin: 0;
  font-size: var(--type-lg);
}
.venture-summary {
  margin: 0;
  font-size: var(--type-body);
  color: var(--muted);
}
.venture-verdict {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.venture-rationale {
  margin: 0;
  font-size: var(--type-body);
}
.venture-attribution,
.venture-unjudged {
  margin: 0;
  font-size: var(--type-body);
  color: var(--muted);
}

/* ------------------------------ Focus, globally ----------------------------- */
/*
 * Every interactive element gets the same visible ring. This is the only thing standing
 * between a keyboard user and a console they cannot navigate, and it was previously defined
 * for exactly one link. `:focus-visible` keeps it off mouse clicks.
 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
/* The main region takes focus on every route change; that is a scroll target, not a control. */
.atlas-main:focus-visible {
  outline: none;
}

/* ------------------------------ Motion ----------------------------- */
/*
 * Interactive surfaces acknowledge the pointer. Kept short and on one curve so the console
 * feels responsive rather than animated.
 */
:where(.nav-link, .button, .badge, .venture, .connected-system, .executive-node) {
  transition:
    border-color var(--motion-base) var(--ease),
    background-color var(--motion-base) var(--ease),
    color var(--motion-fast) var(--ease);
}
/* Honour the system setting: motion is a preference, not a decoration we impose. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* --------------------------- Credential register --------------------------- */
/*
 * Lives in Health & Costs because that is the room an Owner already opens when something is
 * about to go wrong.
 */
.credential-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.credential-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
}
.credential-row:first-child {
  border-top: none;
  padding-top: 0;
}
.credential-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.credential-name {
  font-size: var(--type-body);
  font-weight: 700;
  /*
   * Setting names are long unbroken identifiers - ENGINEERING_MATERIAL_GITHUB_APP_PRIVATE_KEY
   * is 43 characters with nowhere to wrap - so the default `normal` never breaks them and they
   * run straight out of the card. Measured at 326px inside a 214px column before this.
   */
  overflow-wrap: anywhere;
  min-width: 0;
}
.credential-purpose {
  margin: 0;
  font-size: var(--type-body);
  color: var(--muted);
}
.credential-meta {
  margin: 0;
  font-size: var(--type-small);
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ------------------- Workspace bar: control before commentary ------------------- */
/*
 * The status line restates what the business switcher already shows. It shrinks first and far
 * faster than any control beside it, and never wraps: prose confirming a choice yields to the
 * controls that make one.
 */
.agency-context-status {
  min-width: 0;
  flex: 0 200 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------ Voice controls: never clip a label ------------------------ */
/*
 * Four controls in a `nowrap` row needing 365px inside 328px. Because the buttons are
 * `white-space: nowrap` with `min-width: 0`, they did not wrap and did not overflow visibly -
 * they were silently truncated: "ASK CEO" rendered into 54px of a 69px label, "CANCEL VOICE"
 * into 71px of 108px.
 *
 * A half-drawn label on the control that starts a voice command is worse than a taller row.
 * The row wraps; the buttons keep the width their text needs.
 */
.voice-controls {
  flex-wrap: wrap;
}
.voice-command,
.voice-cancel,
.voice-conversation {
  flex: 0 0 auto;
}

/* ------------------------- Waiting, not missing ------------------------- */
/*
 * `.unavailable` means the server has no such thing. A read still in flight is a different
 * fact, and rendering it in the same muted grey told the Owner a conversation did not exist
 * when it simply had not arrived.
 *
 * Distinguished by motion rather than colour: colour in this console already carries meaning
 * (cyan decided, gold attention, danger refused) and a fourth state competing with those would
 * read as a judgement. A slow pulse reads as "working" and stops being noticeable once it is.
 */
.pending {
  font-size: var(--type-micro);
  color: var(--cyan);
  letter-spacing: 0.04em;
  animation: pending-pulse 1.6s ease-in-out infinite;
}
@keyframes pending-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

/* ==========================================================================================
 * ATLAS OS - the product shell.
 *
 * Everything below is presentation over rooms that already exist and are wired; no room's
 * markup or data was changed to produce it. It is scoped to the ATLAS workspace so the legacy
 * console keeps its own look until it is retired.
 *
 * The language, from the Owner's references: a dark glass surface with one cyan accent, a
 * violet second, gold reserved for memory; a grouped left rail with the Council living at its
 * foot; status that is always visible in the top bar; and a Jarvis mode for demos only.
 * ========================================================================================== */

.atlas-app[data-workspace='atlas'] {
  --ink: #05080e;
  --surface: #0a111c;
  --surface2: #0e1726;
  --line: rgba(120, 200, 255, 0.12);
  --line-strong: rgba(120, 200, 255, 0.22);
  --text: #eaf4ff;
  --muted: #8ba1b8;
  --cyan: #3fd8ff;
  --violet: #8b7bff;
  --gold: #f5c451;
  --ok: #3ddc97;
  --warn: #ffb547;
  --stop: #ff6b6b;
  --idle: #5f7187;
  --glow: 0 0 24px rgba(63, 216, 255, 0.22);
  --surface-card: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  --rail-width: 248px;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  background: radial-gradient(
      1200px 600px at 78% -10%,
      rgb(var(--c-3fd8ff) / 0.07),
      transparent 60%
    ),
    radial-gradient(900px 500px at -10% 110%, rgb(var(--c-8b7bff) / 0.06), transparent 60%),
    var(--ink);
}
:root[data-theme='light'] .atlas-app[data-workspace='atlas'] {
  --ink: #f1f4fa;
  --surface: #e3eaf5;
  --surface2: #d9e2f1;
  --line: rgba(0, 113, 191, 0.12);
  --line-strong: rgba(0, 113, 191, 0.22);
  --text: #000c1a;
  --muted: #475d74;
  --cyan: #007796;
  --violet: #634dff;
  --gold: #8b6408;
  --ok: #177e51;
  --warn: #9e5e00;
  --stop: #db0000;
  --idle: #5c6e83;
  --glow: 0 0 24px rgba(0, 119, 150, 0.22);
  --surface-card: linear-gradient(180deg, rgba(13, 13, 13, 0.04), rgba(13, 13, 13, 0.012));
}
body:has(.atlas-app[data-workspace='atlas']) {
  background: rgb(var(--c-05080e));
}

/* --- Frame ------------------------------------------------------------------------------ */
.atlas-app[data-workspace='atlas'] .atlas-nav {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 12px;
  gap: 2px;
  background: linear-gradient(180deg, rgb(var(--c-0a111c) / 0.96), rgb(var(--c-05080e) / 0.96));
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.atlas-app[data-workspace='atlas'] .atlas-header {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 64px;
  padding: 10px 24px;
  background: rgb(var(--c-05080e) / 0.78);
  border-bottom: 1px solid var(--line);
}
.atlas-app[data-workspace='atlas'] .atlas-wordmark {
  display: none;
}
.atlas-app[data-workspace='atlas'] .atlas-main {
  grid-column: 2;
  grid-row: 2;
  padding: 24px 28px 110px;
}

/* --- Brand -------------------------------------------------------------------------------- */
.os-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}
.os-brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  box-shadow:
    var(--glow),
    inset 0 0 12px rgb(var(--c-3fd8ff) / 0.35);
  flex: none;
}
.os-brand-mark::before,
.os-brand-mark::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}
.os-brand-mark::before {
  inset: 6px;
  border: 1px dashed rgb(var(--c-3fd8ff) / 0.55);
  animation: os-spin 18s linear infinite;
}
.os-brand-mark::after {
  inset: 12px;
  background: radial-gradient(circle, rgb(var(--c-d8f7ff)), var(--cyan) 55%, transparent 70%);
}
.os-brand-text strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.34em;
  font-weight: 800;
}
.os-brand-text small {
  display: block;
  font-size: var(--type-nano);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-top: 3px;
}

/* --- Rail groups ---------------------------------------------------------------------------- */
.nav-group {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font: inherit;
  font-size: var(--type-nano);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}
.nav-group-toggle:hover {
  color: var(--text);
}
.nav-group-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate var(--motion-base) var(--ease);
}
.nav-group-toggle[aria-expanded='false'] .nav-group-chevron {
  rotate: -45deg;
  translate: -2px 0;
}
.nav-group-items {
  display: grid;
  gap: 2px;
}
.atlas-app[data-workspace='atlas'] .nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  color: rgb(var(--c-b3c6da));
  font-size: var(--type-body);
  font-weight: 550;
  letter-spacing: 0.01em;
  text-transform: none;
  transition:
    background var(--motion-fast) var(--ease),
    color var(--motion-fast) var(--ease);
}
.atlas-app[data-workspace='atlas'] .nav-link:hover {
  background: rgb(var(--c-ffffff) / 0.04);
  color: var(--text);
  box-shadow: none;
}
.atlas-app[data-workspace='atlas'] .nav-link.active {
  background: linear-gradient(90deg, rgb(var(--c-3fd8ff) / 0.16), rgb(var(--c-3fd8ff) / 0.02));
  color: rgb(var(--c-f2fbff));
  box-shadow: inset 2px 0 0 var(--cyan);
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.nav-link.active .nav-icon {
  color: var(--cyan);
  opacity: 1;
  filter: drop-shadow(0 0 6px rgb(var(--c-3fd8ff) / 0.55));
}

/* --- The Council, at the foot of the rail ------------------------------------------------- */
.os-roster {
  margin: 14px 0 6px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(var(--c-ffffff) / 0.02);
  display: grid;
  gap: 2px;
}
.os-roster-title {
  margin: 0 0 6px;
  font-size: var(--type-nano);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.os-roster-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 4px;
  border-radius: 6px;
  color: rgb(var(--c-c3d3e4));
  text-decoration: none;
  font-size: var(--type-small);
}
.os-roster-item:hover {
  background: rgb(var(--c-ffffff) / 0.04);
}
.os-roster-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.os-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: var(--idle, rgb(var(--c-5f7187)));
}
.os-dot.ok,
.os-status.ok .os-dot {
  background: var(--ok, rgb(var(--c-3ddc97)));
  box-shadow: 0 0 8px rgb(var(--c-3ddc97) / 0.7);
}
.os-dot.warn,
.os-status.warn .os-dot {
  background: var(--warn, rgb(var(--c-ffb547)));
  box-shadow: 0 0 8px rgb(var(--c-ffb547) / 0.6);
}
.os-dot.stop {
  background: var(--stop, rgb(var(--c-ff6b6b)));
  box-shadow: 0 0 8px rgb(var(--c-ff6b6b) / 0.6);
}
/* The role preview is a development control; it never belongs on the customer surface. */
.atlas-app[data-workspace='atlas'] .role-switch {
  display: none;
}

/* --- Top bar -------------------------------------------------------------------------------- */
.atlas-app[data-workspace='atlas'] .vitals {
  gap: 10px;
  overflow: visible;
}
.os-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: rgb(var(--c-ffffff) / 0.03);
  font-size: var(--type-small);
  font-weight: 600;
  white-space: nowrap;
}
.os-status.ok {
  border-color: rgb(var(--c-3ddc97) / 0.35);
  color: rgb(var(--c-c9f7e3));
}
.os-status.warn {
  border-color: rgb(var(--c-ffb547) / 0.4);
  color: rgb(var(--c-ffe1b3));
}
.os-status.ok .os-dot {
  animation: os-pulse 2.4s ease-in-out infinite;
}
.os-clock {
  font-variant-numeric: tabular-nums;
  font-size: var(--type-body);
  color: var(--muted);
  padding: 0 4px;
}
.atlas-app[data-workspace='atlas'] .atlas-workspace-bar {
  gap: 10px;
}
.atlas-app[data-workspace='atlas'] .agency-context-status:empty {
  display: none;
}

/* --- Rooms: one glass surface ---------------------------------------------------------------- */
.atlas-app[data-workspace='atlas'] .room,
.atlas-app[data-workspace='atlas'] .command-left,
.atlas-app[data-workspace='atlas'] .command-right,
.atlas-app[data-workspace='atlas'] .command-center {
  border-radius: 18px;
  border-color: var(--line);
  box-shadow:
    inset 0 1px 0 rgb(var(--c-ffffff) / 0.04),
    0 24px 60px rgb(var(--c-000000) / 0.35);
  backdrop-filter: blur(10px);
}
.atlas-app[data-workspace='atlas'] .room {
  padding: 24px 26px;
}
.atlas-app[data-workspace='atlas'] .room h1 {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.atlas-app[data-workspace='atlas'] .eyebrow {
  font-size: var(--type-nano);
  letter-spacing: 0.2em;
  font-weight: 700;
  text-transform: uppercase;
}
.atlas-app[data-workspace='atlas'] .badge {
  border-color: var(--line-strong);
  background: rgb(var(--c-ffffff) / 0.025);
  padding: 4px 9px;
  font-weight: 650;
}
.atlas-app[data-workspace='atlas'] .badge.cyan {
  border-color: rgb(var(--c-3fd8ff) / 0.45);
  background: rgb(var(--c-3fd8ff) / 0.08);
}
.atlas-app[data-workspace='atlas'] .badge.gold {
  border-color: rgb(var(--c-f5c451) / 0.5);
  background: rgb(var(--c-f5c451) / 0.08);
}

/* --- The Council as an org chart (Executive Board) ------------------------------------------ */
.atlas-app[data-workspace='atlas'] .owner-node {
  justify-self: center;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(var(--c-f5c451) / 0.5);
  color: var(--gold);
  font-size: var(--type-nano);
  font-weight: 800;
  letter-spacing: 0.24em;
  background: rgb(var(--c-f5c451) / 0.06);
}
.atlas-app[data-workspace='atlas'] .executive-node {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  transition:
    border-color var(--motion-fast) var(--ease),
    box-shadow var(--motion-fast) var(--ease),
    translate var(--motion-fast) var(--ease);
}
.atlas-app[data-workspace='atlas'] .executive-node:hover {
  border-color: rgb(var(--c-3fd8ff) / 0.45);
  box-shadow: var(--glow);
  translate: 0 -1px;
}
.atlas-app[data-workspace='atlas'] .executive-node.ceo {
  border-color: rgb(var(--c-8b7bff) / 0.55);
  background: linear-gradient(180deg, rgb(var(--c-8b7bff) / 0.14), rgb(var(--c-8b7bff) / 0.03));
  box-shadow: 0 0 34px rgb(var(--c-8b7bff) / 0.18);
}
.atlas-app[data-workspace='atlas'] .map-line {
  background: linear-gradient(90deg, transparent, rgb(var(--c-3fd8ff) / 0.5), transparent);
}
.atlas-app[data-workspace='atlas'] .map-line.vertical {
  background: linear-gradient(180deg, rgb(var(--c-f5c451) / 0.6), rgb(var(--c-8b7bff) / 0.5));
}

/* --- David, from every room ------------------------------------------------------------------- */
/*
 * On David / Home the composer is the room, so the dock would only duplicate it. Everywhere
 * else it is how the Owner reaches David without leaving what they are looking at.
 */
.atlas-app[data-workspace='atlas']:not([data-room='atlas']) .ask-ceo {
  display: flex;
}
.atlas-app[data-workspace='atlas'] .ask-ceo {
  align-items: center;
  gap: 12px;
  left: auto;
  right: 28px;
  bottom: 24px;
  translate: none;
  padding: 10px 20px 10px 10px;
  border-color: rgb(var(--c-3fd8ff) / 0.5);
  background: rgb(var(--c-08101c) / 0.92);
  box-shadow:
    0 0 0 1px rgb(var(--c-3fd8ff) / 0.08),
    0 18px 40px rgb(var(--c-000000) / 0.45),
    var(--glow);
  backdrop-filter: blur(12px);
  cursor: pointer;
}
.ask-ring {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--cyan);
  box-shadow: inset 0 0 10px rgb(var(--c-3fd8ff) / 0.4);
  flex: none;
}
.ask-ring::after {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--c-e6fbff)), var(--cyan) 60%, transparent 72%);
  animation: os-breathe 2.8s ease-in-out infinite;
}
.ask-text {
  display: grid;
  text-align: left;
}

/* --- Jarvis mode ------------------------------------------------------------------------------ */
html.jarvis-open {
  overflow: hidden;
}
.jarvis {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr minmax(220px, 300px);
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 28px;
  color: rgb(var(--c-eaf4ff));
  background: radial-gradient(60% 55% at 50% 50%, rgb(var(--c-143c6e) / 0.55), transparent 70%),
    radial-gradient(40% 40% at 50% 50%, rgb(var(--c-3fd8ff) / 0.1), transparent 70%),
    rgb(var(--c-02050b));
  animation: os-fade-in 320ms ease-out;
}
.jarvis-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.jarvis-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(52vmin, 520px);
  aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: none;
}
.jarvis-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgb(var(--c-3fd8ff) / 0.55);
}
.jarvis-ring.r1 {
  inset: 0;
  border-style: dashed;
  border-color: rgb(var(--c-3fd8ff) / 0.35);
  animation: os-spin 60s linear infinite;
}
.jarvis-ring.r2 {
  inset: 12%;
  border-width: 2px;
  border-top-color: transparent;
  border-bottom-color: rgb(var(--c-8b7bff) / 0.6);
  animation: os-spin 24s linear infinite reverse;
}
.jarvis-ring.r3 {
  inset: 26%;
  border-color: rgb(var(--c-3fd8ff) / 0.7);
  box-shadow:
    0 0 40px rgb(var(--c-3fd8ff) / 0.35),
    inset 0 0 40px rgb(var(--c-3fd8ff) / 0.25);
  animation: os-spin 40s linear infinite;
}
.jarvis-heart {
  position: absolute;
  inset: 40%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgb(var(--c-ffffff)),
    rgb(var(--c-7fe9ff)) 35%,
    rgb(var(--c-3fd8ff) / 0.2) 70%,
    transparent
  );
  box-shadow: 0 0 80px rgb(var(--c-3fd8ff) / 0.6);
  animation: os-breathe 3.6s ease-in-out infinite;
}
.jarvis-title {
  position: relative;
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.jarvis-title strong {
  font-size: 18px;
  letter-spacing: 0.5em;
  color: rgb(var(--c-3fd8ff));
  text-shadow: 0 0 14px rgb(var(--c-3fd8ff) / 0.6);
}
.jarvis-title span {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(var(--c-8ba1b8));
}
.jarvis-panels {
  position: relative;
  grid-row: 2;
  display: grid;
  align-content: center;
  gap: 12px;
}
.jarvis-left {
  grid-column: 1;
}
.jarvis-right {
  grid-column: 3;
}
.jarvis-panel {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.2);
  background: linear-gradient(180deg, rgb(var(--c-3fd8ff) / 0.08), rgb(var(--c-3fd8ff) / 0.015));
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgb(var(--c-ffffff) / 0.05);
}
.jarvis-panel-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(var(--c-8ba1b8));
  margin-bottom: 6px;
}
.jarvis-panel strong {
  font-size: 26px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgb(var(--c-3fd8ff) / 0.35);
}
.jarvis-agent {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  border-top: 1px solid rgb(var(--c-78c8ff) / 0.08);
}
.jarvis-agent-status {
  color: rgb(var(--c-8ba1b8));
  font-size: 11px;
}
.jarvis-empty {
  margin: 0;
  color: rgb(var(--c-8ba1b8));
  font-size: 13px;
}
.jarvis-caption {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: center;
  margin: 0;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.18);
  background: rgb(var(--c-050c16) / 0.7);
  font-size: 15px;
  color: rgb(var(--c-d6ecff));
}
.jarvis-exit {
  position: absolute;
  top: 24px;
  right: 28px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.3);
  background: rgb(var(--c-050c16) / 0.7);
  color: rgb(var(--c-d6ecff));
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.jarvis-exit:focus-visible {
  outline: 2px solid rgb(var(--c-3fd8ff));
  outline-offset: 3px;
}

@keyframes os-spin {
  to {
    rotate: 360deg;
  }
}
@keyframes os-pulse {
  50% {
    opacity: 0.45;
  }
}
@keyframes os-breathe {
  50% {
    scale: 0.82;
    opacity: 0.8;
  }
}
@keyframes os-fade-in {
  from {
    opacity: 0;
  }
}

/* --- Smaller screens ---------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .atlas-app[data-workspace='atlas'] {
    --rail-width: 212px;
  }
  .atlas-app[data-workspace='atlas'] .atlas-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .atlas-app[data-workspace='atlas'] .atlas-workspace-bar {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  /* The room tabs come first on a phone, then the agency and status bar. */
  .atlas-app[data-workspace='atlas'] {
    display: flex;
    flex-direction: column;
  }
  .atlas-app[data-workspace='atlas'] .atlas-nav {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    gap: 4px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
  }
  .atlas-app[data-workspace='atlas'] .os-brand {
    padding: 0 8px 0 0;
    margin: 0;
    border: 0;
  }
  .atlas-app[data-workspace='atlas'] .os-brand-text small,
  .atlas-app[data-workspace='atlas'] .nav-group-toggle,
  .atlas-app[data-workspace='atlas'] .os-roster,
  .atlas-app[data-workspace='atlas'] .nav-spacer {
    display: none;
  }
  .atlas-app[data-workspace='atlas'] .nav-group,
  .atlas-app[data-workspace='atlas'] .nav-group-items {
    display: flex;
    margin: 0;
    gap: 4px;
  }
  .atlas-app[data-workspace='atlas'] .nav-group-items[hidden] {
    display: flex !important;
  }
  .atlas-app[data-workspace='atlas'] .atlas-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    position: static;
  }
  .atlas-app[data-workspace='atlas'] .atlas-workspace-bar {
    flex-basis: 100%;
  }
  .atlas-app[data-workspace='atlas'] .atlas-main {
    padding: 14px 12px 110px;
  }
  .atlas-app[data-workspace='atlas'] .room {
    padding: 16px;
  }
  .atlas-app[data-workspace='atlas'] .ask-ceo {
    right: 12px;
    bottom: 12px;
  }
  .jarvis {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    overflow-y: auto;
  }
  .jarvis-left,
  .jarvis-right {
    grid-column: 1;
    grid-row: auto;
  }
  .jarvis-caption {
    grid-row: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .os-brand-mark::before,
  .os-status.ok .os-dot,
  .ask-ring::after,
  .jarvis-ring,
  .jarvis-heart {
    animation: none;
  }
}

/* --- Phase 2: sub-agencies and engine rooms -------------------------------------------------- */
.os-studio {
  display: grid;
  gap: 20px;
}
.os-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.os-section-title {
  margin: 4px 0 0;
  font-size: var(--type-nano);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.os-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.os-metric {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  box-shadow: inset 0 1px 0 rgb(var(--c-ffffff) / 0.04);
}
.os-metric-label {
  font-size: var(--type-nano);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.os-metric strong {
  font-size: 28px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.os-metric small {
  color: var(--muted);
  font-size: var(--type-small);
}

/* The content pipeline: eight stages, left to right, the way work actually moves. */
.os-pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}
.os-stage {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgb(var(--c-ffffff) / 0.025);
}
.os-stage::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -6px;
  width: 6px;
  height: 1px;
  background: var(--line-strong);
}
.os-stage:last-child::after {
  display: none;
}
.os-stage strong {
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.os-stage span {
  font-size: var(--type-small);
  color: var(--muted);
}
.os-stage.attention {
  border-color: rgb(var(--c-3fd8ff) / 0.55);
  background: rgb(var(--c-3fd8ff) / 0.08);
  box-shadow: var(--glow);
}
.os-stage.held {
  border-color: rgb(var(--c-ffb547) / 0.5);
  background: rgb(var(--c-ffb547) / 0.07);
}

.os-holds ul,
.os-provider-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.os-holds li {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgb(var(--c-ffb547) / 0.3);
  background: rgb(var(--c-ffb547) / 0.05);
  color: rgb(var(--c-ffe1b3));
  font-size: var(--type-body);
}
.os-provider-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgb(var(--c-ffffff) / 0.02);
  color: var(--text);
  font-size: var(--type-body);
}
.os-provider-list small {
  color: var(--muted);
}

.os-launches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.os-launch {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.os-launch h3 {
  margin: 0;
  font-size: var(--type-lg);
  font-weight: 650;
}
.os-launch p {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-body);
  line-height: 1.5;
}
.os-launch.unavailable {
  opacity: 0.75;
}
.os-launch-button {
  justify-self: start;
  margin-top: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(var(--c-3fd8ff) / 0.45);
  background: rgb(var(--c-3fd8ff) / 0.08);
  color: var(--cyan);
  font: inherit;
  font-size: var(--type-small);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow var(--motion-base) var(--ease);
}
.os-launch-button:hover {
  box-shadow: var(--glow);
}
.os-launch-missing {
  margin-top: 6px;
  font-size: var(--type-small);
  color: var(--muted);
}
.os-launch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.os-launch-button:disabled {
  cursor: default;
  opacity: 0.7;
}
.owner-fallback {
  font-size: var(--type-small);
  color: var(--muted);
}

/* A Sales Desk opened inside ATLAS. */
.desk-embed {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.desk-embed-frame {
  width: 100%;
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-card);
}
.desk-embed.full-screen .desk-embed-frame {
  min-height: calc(100vh - 180px);
}

.os-ask-david {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(var(--c-8b7bff) / 0.5);
  background: rgb(var(--c-8b7bff) / 0.1);
  color: rgb(var(--c-d9d3ff));
  font: inherit;
  font-size: var(--type-body);
  font-weight: 600;
  cursor: pointer;
}
.os-ask-david:hover {
  box-shadow: 0 0 24px rgb(var(--c-8b7bff) / 0.3);
}
.ask-ring.small {
  width: 24px;
  height: 24px;
  border-color: var(--violet, rgb(var(--c-8b7bff)));
}
.ask-ring.small::after {
  inset: 6px;
  background: radial-gradient(
    circle,
    rgb(var(--c-f1eeff)),
    var(--violet, rgb(var(--c-8b7bff))) 60%,
    transparent 72%
  );
}

/* Sub-agencies: the one in context, then every other business ATLAS runs. */
.os-agencies {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}
.os-agency-profile,
.os-agency-list {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.os-agency-list h2 {
  margin: 0;
  font-size: var(--type-lg);
}
.os-agency-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.os-agency-head h2 {
  margin: 2px 0;
  font-size: 22px;
}
.os-agency-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgb(var(--c-3fd8ff) / 0.3), rgb(var(--c-8b7bff) / 0.3));
  border: 1px solid rgb(var(--c-3fd8ff) / 0.4);
  font-size: 22px;
  font-weight: 700;
  color: rgb(var(--c-ffffff));
  flex: none;
}
.os-agency-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 16px;
}
.os-agency-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgb(var(--c-ffffff) / 0.02);
}
.os-agency-card h3 {
  margin: 0;
  font-size: var(--type-base);
}
.os-agency-card .os-launch-button {
  margin: 0;
}
.os-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.os-chip {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: rgb(var(--c-ffffff) / 0.03);
  color: var(--text);
  font-size: var(--type-small);
  font-weight: 600;
  text-decoration: none;
}
.os-chip:hover {
  border-color: rgb(var(--c-3fd8ff) / 0.5);
  color: var(--cyan);
}

@media (max-width: 1100px) {
  .os-pipeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .os-stage::after {
    display: none;
  }
  .os-agencies {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .os-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- The sub-agency dashboard ------------------------------------------------------------------ */
.os-dashboard {
  display: grid;
  gap: 14px;
}
.os-dashboard-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgb(var(--c-ffb547) / 0.4);
  background: rgb(var(--c-ffb547) / 0.06);
  color: rgb(var(--c-ffe1b3));
  font-size: var(--type-body);
}
.business-dashboard {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.business-dashboard-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.business-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
}
.business-kpi dd {
  margin: 0;
  font-size: 1.25rem;
}
.business-flags {
  margin: 0;
  padding: 8px 14px 8px 28px;
  border-radius: 10px;
  border: 1px solid rgb(var(--c-ffb547) / 0.4);
  color: rgb(var(--c-ffe1b3));
}
.business-rollup {
  display: grid;
  gap: 12px;
}
.os-widget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.os-widget {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  box-shadow: inset 0 1px 0 rgb(var(--c-ffffff) / 0.04);
  min-width: 0;
}
.os-widget.wide {
  grid-column: 1 / -1;
}
.os-widget-grid.editing .os-widget {
  border-style: dashed;
  border-color: rgb(var(--c-3fd8ff) / 0.35);
}
.os-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.os-widget-head h3 {
  margin: 0;
  font-size: var(--type-nano);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.os-widget-open {
  font-size: var(--type-small);
  font-weight: 600;
  color: var(--cyan);
  text-decoration: none;
}
.os-widget-tools {
  display: flex;
  gap: 4px;
}
.os-widget-tools button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgb(var(--c-ffffff) / 0.03);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.os-widget-tools button:disabled {
  opacity: 0.35;
  cursor: default;
}
.os-widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.os-widget-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--type-body);
  color: var(--text);
  min-width: 0;
}
.os-widget-list li span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.os-widget-list.council li {
  display: grid;
  grid-template-columns: auto 1fr auto;
}
.os-widget-list.council small {
  color: var(--muted);
}
.os-pipeline.compact {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}
.os-pipeline.compact .os-stage {
  padding: 10px 8px;
}
.os-pipeline.compact .os-stage strong {
  font-size: 20px;
}
.os-add-widget {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgb(var(--c-ffffff) / 0.03);
  color: var(--text);
  font: inherit;
  font-size: var(--type-small);
}
@media (max-width: 1100px) {
  .os-widget-grid {
    grid-template-columns: 1fr;
  }
  .os-pipeline.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* Folded-away controls: present and working, but not the first thing a room says. */
.os-advanced {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(var(--c-ffffff) / 0.015);
}
.os-advanced > summary {
  cursor: pointer;
  padding: 12px 16px;
  color: var(--muted);
  font-size: var(--type-small);
  font-weight: 600;
}
.os-advanced[open] > summary {
  border-bottom: 1px solid var(--line);
}
.os-advanced > :not(summary) {
  margin: 14px 16px 16px;
}

/* --- Owner-first rooms: needs you, the council, folded details -------------------------------- */
.needs-you,
.council {
  display: grid;
  gap: var(--space-3);
}
.needs-you-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.needs-you-title h2 {
  margin: 0;
  font-size: var(--type-lg);
  letter-spacing: 0.02em;
  text-transform: none;
}
.needs-you-item {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  background: var(--surface-card);
}
.needs-you-item.tone-bad {
  border-left-color: var(--danger);
}
.needs-you-item.tone-warn {
  border-left-color: var(--gold);
}
.needs-you-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.needs-you-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--type-small);
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.needs-you-chip.tone-bad {
  color: var(--danger);
  border-color: rgb(var(--c-ff7b92) / 0.45);
  background: rgb(var(--c-ff7b92) / 0.08);
}
.needs-you-chip.tone-warn {
  color: var(--gold);
  border-color: rgb(var(--c-e9b85b) / 0.45);
  background: rgb(var(--c-e9b85b) / 0.08);
}
.needs-you-chip.tone-good {
  color: rgb(var(--c-6ee7a8));
  border-color: rgb(var(--c-6ee7a8) / 0.4);
  background: rgb(var(--c-6ee7a8) / 0.07);
}
.needs-you-office {
  color: var(--muted);
  font-size: var(--type-small);
}
.needs-you-text {
  margin: 0;
  font-size: var(--type-base);
  line-height: 1.45;
  color: var(--text);
}
.needs-you-foot {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.needs-you-action {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: rgb(var(--c-31d7ff) / 0.12);
  border: 1px solid rgb(var(--c-31d7ff) / 0.45);
  color: var(--cyan);
  font-size: var(--type-body);
  font-weight: 600;
  text-decoration: none;
}
.needs-you-action:hover {
  background: rgb(var(--c-31d7ff) / 0.2);
}
.owner-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(var(--c-ffffff) / 0.015);
}
.owner-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 7px 12px;
  cursor: pointer;
  list-style: none;
  font-size: var(--type-body);
  color: var(--muted);
}
.owner-details > summary::-webkit-details-marker {
  display: none;
}
.owner-details > summary::before {
  content: '▸';
  margin-right: 6px;
  transition: transform var(--motion-fast) var(--ease);
}
.owner-details[open] > summary::before {
  transform: rotate(90deg);
}
.owner-details-title {
  flex: 1;
  color: var(--text);
}
.owner-details-summary {
  font-size: var(--type-small);
}
.owner-details.tone-bad .owner-details-summary {
  color: var(--danger);
}
.owner-details.tone-warn .owner-details-summary {
  color: var(--gold);
}
.owner-details-body {
  display: grid;
  gap: var(--space-2);
  padding: 4px 12px 12px;
  font-size: var(--type-body);
  color: var(--muted);
}
.needs-you-foot .owner-details {
  flex: 1;
  min-width: 180px;
}
.council-ceo {
  display: grid;
}
.council-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}
.council-card {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.council-card.ceo {
  border-color: rgb(var(--c-31d7ff) / 0.4);
}
.council-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}
.council-head strong {
  font-size: var(--type-base);
}
.council-line {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-body);
  line-height: 1.4;
}
.council-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 0;
}
.council-facts dt {
  color: var(--muted);
}
.council-facts dd {
  margin: 0;
  color: var(--text);
}
.needs-you-what {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-body);
  line-height: 1.45;
}
.needs-you-item .needs-you-text {
  font-weight: 600;
}
/* --- David's objectives: switch on, pause ------------------------------------------------------ */
.david-objectives {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
.objective-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.objective-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.objective-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.objective-head h3 {
  margin: 0;
  font-size: var(--type-body);
  line-height: 1.35;
}
.objective-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.objective-actions:empty {
  display: none;
}
.home-today {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.home-today .david-objectives {
  margin-bottom: 0;
}
.task-card {
  display: grid;
  gap: var(--space-2);
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
/* A current read says nothing worth a banner; a stale one does. */
.autonomy-state.current {
  display: none;
}
.health-stack {
  display: grid;
  gap: var(--space-3);
}
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chat-action {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.chat-action:hover,
.chat-action:focus-visible {
  border-color: var(--cyan);
}
.chat-business {
  display: block;
  font-size: 11px;
  opacity: 0.7;
}
/* Ask David to act: a real form, not raw inputs. */
.business-ops {
  display: grid;
  gap: var(--space-3);
}
.business-ops h2 {
  margin: 0;
  font-size: var(--type-lg);
  text-transform: none;
}
.business-ops-link {
  color: var(--cyan);
  font-size: var(--type-body);
}
.business-ops select,
.business-ops input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgb(var(--c-080d16) / 0.8);
  color: var(--text);
  font: inherit;
  font-size: var(--type-body);
}
.business-ops-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}
.business-ops-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--type-small);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.business-ops > button {
  justify-self: start;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(var(--c-31d7ff) / 0.45);
  background: rgb(var(--c-31d7ff) / 0.12);
  color: var(--cyan);
  font-weight: 600;
  cursor: pointer;
}
.business-ops > button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.business-ops-preview:empty {
  display: none;
}
.business-ops-preview {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 0;
  font-size: var(--type-body);
}
.objective-actions button {
  padding: 7px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(var(--c-31d7ff) / 0.45);
  background: rgb(var(--c-31d7ff) / 0.12);
  color: var(--cyan);
  font: inherit;
  font-size: var(--type-body);
  font-weight: 600;
  cursor: pointer;
}
.objective-actions button.primary {
  background: var(--cyan);
  color: var(--ink);
  border-color: var(--cyan);
}
.objective-actions button:disabled {
  opacity: 0.5;
  cursor: progress;
}

/* --- Jarvis voice: tap, talk, hear David ------------------------------------------------------- */
.jarvis-voice {
  position: absolute;
  left: 50%;
  bottom: 84px;
  translate: -50% 0;
  z-index: 2;
  width: min(640px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.jarvis-transcript {
  order: -1;
  width: 100%;
  max-height: 26vh;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  text-align: left;
}
.jarvis-transcript:empty {
  display: none;
}
.jarvis-turn {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgb(var(--c-050c16) / 0.72);
  border: 1px solid rgb(var(--c-78c8ff) / 0.16);
  color: rgb(var(--c-d6ecff));
  font-size: 14px;
  line-height: 1.45;
}
.jarvis-turn strong {
  margin-right: 8px;
  color: rgb(var(--c-3fd8ff));
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.jarvis-turn.you strong {
  color: rgb(var(--c-f5c451));
}
.jarvis-talk {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid rgb(var(--c-3fd8ff) / 0.6);
  background: rgb(var(--c-3fd8ff) / 0.14);
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 0 30px rgb(var(--c-3fd8ff) / 0.25);
}
.jarvis-talk:focus-visible {
  outline: 2px solid rgb(var(--c-3fd8ff));
  outline-offset: 3px;
}
.jarvis-talk:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.jarvis-talk-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgb(var(--c-3fd8ff));
  box-shadow: 0 0 12px rgb(var(--c-3fd8ff));
}
.jarvis-talk.active {
  background: rgb(var(--c-ff7b92) / 0.16);
  border-color: rgb(var(--c-ff7b92) / 0.6);
}
.jarvis-talk.active .jarvis-talk-icon {
  border-radius: 3px;
  background: rgb(var(--c-ff7b92));
  box-shadow: 0 0 12px rgb(var(--c-ff7b92));
}
.jarvis-voice-status {
  margin: 0;
  color: rgb(var(--c-d6ecff));
  font-size: 15px;
}
.jarvis-voice-heard {
  margin: 0;
  min-height: 1.4em;
  color: rgb(var(--c-ffffff));
  font-size: 18px;
  font-weight: 500;
}
.jarvis-voice-actions {
  display: flex;
  gap: 10px;
}
.jarvis-voice-actions[hidden] {
  display: none;
}
.jarvis-voice-actions button {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.35);
  background: rgb(var(--c-050c16) / 0.75);
  color: rgb(var(--c-d6ecff));
  font: inherit;
  cursor: pointer;
}
.jarvis-voice-actions .jarvis-voice-send {
  border-color: rgb(var(--c-3fd8ff));
  color: rgb(var(--c-3fd8ff));
}
/* The core answers the conversation: it listens, thinks and speaks visibly. */
.jarvis[data-voice='listening'] .jarvis-heart {
  animation-duration: 1.1s;
  box-shadow: 0 0 120px rgb(var(--c-3fd8ff) / 0.85);
}
.jarvis[data-voice='confirming'] .jarvis-heart {
  box-shadow: 0 0 110px rgb(var(--c-f5c451) / 0.75);
}
.jarvis[data-voice='thinking'] .jarvis-ring.r2 {
  animation-duration: 3s;
}
.jarvis[data-voice='thinking'] .jarvis-ring.r1 {
  animation-duration: 12s;
}
.jarvis[data-voice='speaking'] .jarvis-heart {
  animation-duration: 0.7s;
  box-shadow: 0 0 140px rgb(var(--c-8b7bff) / 0.85);
}
.jarvis[data-voice='speaking'] .jarvis-ring.r3 {
  box-shadow:
    0 0 70px rgb(var(--c-8b7bff) / 0.55),
    inset 0 0 50px rgb(var(--c-8b7bff) / 0.35);
}
.engine-gap {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: var(--type-body);
  line-height: 1.5;
}
/* --- Security & Cameras: the Owner's Ring cameras ------------------------------------------- */
.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}
.camera-card {
  display: grid;
  gap: var(--space-2);
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.camera-picture {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: rgb(var(--c-ffffff) / 0.03);
}
.camera-picture[role='button'] {
  cursor: zoom-in;
}
.camera-picture[role='button']:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
/* One camera, large, over the room. */
.camera-view {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(var(--c-04080e) / 0.82);
}
.camera-view-panel {
  display: grid;
  gap: var(--space-3);
  width: min(1100px, 100%);
  max-height: 100%;
  padding: var(--space-4, 16px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.camera-view-picture {
  width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  border-radius: var(--radius-md);
  background: rgb(var(--c-000000));
}
.camera-view-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-4);
  min-height: 0;
}
.camera-view-main {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}
.camera-view-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 220px);
  border-radius: var(--radius-md);
  background: rgb(var(--c-000000));
  overflow: hidden;
}
.camera-view-stage > * {
  width: 100%;
  height: 100%;
  max-height: none;
}
.camera-view-side {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--space-2);
  min-height: 0;
}
.camera-view-side h3 {
  margin: 0;
  font-size: var(--type-body);
}
.camera-history {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  max-height: calc(100vh - 220px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.camera-history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-2);
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.camera-history-item:disabled {
  cursor: default;
  opacity: 0.6;
}
.camera-history-item:not(:disabled):hover {
  border-color: var(--cyan);
}
.camera-view-actions {
  display: flex;
  gap: var(--space-2);
}
@media (max-width: 820px) {
  .camera-view-body {
    grid-template-columns: 1fr;
  }
  .camera-history {
    max-height: 30vh;
  }
}
.camera-view-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.camera-view-close {
  padding: 6px 14px;
  border: 1px solid rgb(var(--c-31536d));
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.camera-picture.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: var(--type-body);
}
/* Tile size: S/M/L/XL set a minimum tile width; Auto-fit sets the columns from script. Never
 * wider than the screen, so XL on a phone is one column rather than a sideways scroll. */
.camera-grid[data-camera-grid] {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--cam-min, 260px)), 1fr));
}
.camera-card-info {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}
.camera-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}
.camera-wall-open {
  cursor: pointer;
  font: inherit;
  font-size: var(--type-body);
  font-weight: 600;
}
.camera-wall-open::before {
  content: '';
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px var(--ink);
  background: currentColor;
}
.camera-wall-open:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.camera-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.camera-seg-button {
  min-height: 32px;
  padding: 5px 11px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--type-body);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease);
}
.camera-seg-button:last-child {
  border-right: 0;
}
.camera-seg-button:hover {
  color: var(--text);
}
.camera-seg-button[aria-pressed='true'] {
  background: rgb(var(--c-31d7ff) / 0.14);
  color: var(--text);
}
.camera-seg-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}
/* Arranging: a grip, the position, and up/down arrows that work without a mouse. */
.camera-arrange {
  display: flex;
  align-items: center;
  gap: 6px;
}
.camera-grip {
  margin-right: auto;
  color: var(--muted);
  font-size: var(--type-small);
  cursor: grab;
}
.camera-move {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.camera-move:disabled {
  opacity: 0.35;
  cursor: default;
}
.camera-move:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.camera-grid[data-arranging='true'] .camera-card {
  cursor: grab;
}
.camera-card.dragging {
  opacity: 0.45;
}
.camera-card.drop-target {
  outline: 2px dashed var(--cyan);
  outline-offset: 2px;
}
/* Tight: seamless tiles, no card frames, the name a small overlay that fades. */
.camera-grid[data-spacing='tight'] {
  gap: 2px;
}
.camera-grid[data-spacing='tight'] .camera-card {
  position: relative;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgb(var(--c-000000));
}
.camera-grid[data-spacing='tight'] .camera-picture {
  border-radius: 0;
}
.camera-grid[data-spacing='tight'] .camera-card-info {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 18px 8px 6px;
  background: linear-gradient(transparent, rgb(var(--c-000000) / 0.72));
  pointer-events: none;
  animation: camera-label-fade 5s var(--ease) forwards;
}
.camera-grid[data-spacing='tight'] .camera-card-info .council-line {
  display: none;
}
.camera-grid[data-spacing='tight'] .camera-card:hover .camera-card-info,
.camera-grid[data-spacing='tight'] .camera-card:focus-within .camera-card-info,
.camera-grid[data-spacing='tight'] .camera-card[data-offline='true'] .camera-card-info,
.camera-grid[data-spacing='tight'][data-arranging='true'] .camera-card-info {
  animation: none;
  opacity: 1;
}
.camera-grid[data-spacing='tight'] .camera-arrange {
  position: absolute;
  top: 6px;
  right: 6px;
}
.camera-grid[data-spacing='tight'] .camera-grip {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgb(var(--c-000000) / 0.6);
  color: var(--text);
}
@keyframes camera-label-fade {
  0%,
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* --- The camera wall: every camera, full screen, edge to edge ------------------------------ */
.camwall {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  background: rgb(var(--c-000000));
  color: rgb(var(--c-ffffff));
  outline: none;
}
.camwall::backdrop {
  background: rgb(var(--c-000000));
}
.camwall:not(.show-chrome) {
  cursor: none;
}
.camwall-grid {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(var(--wall-cols, 1), minmax(0, 1fr));
  grid-template-rows: repeat(var(--wall-rows, 1), minmax(0, 1fr));
  gap: 3px;
  background: rgb(var(--c-000000));
}
.camwall[data-spacing='tight'] .camwall-grid {
  gap: 0;
}
.camwall-tile {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: rgb(var(--c-05080d));
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}
.camwall-tile:focus-visible {
  z-index: 1;
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}
.camwall-still,
.camwall-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.camwall-tile:not([data-picture='true']) .camwall-still {
  visibility: hidden;
}
.camwall-video {
  opacity: 0;
  background: transparent;
  transition: opacity var(--motion-base) var(--ease);
}
.camwall-tile[data-playing='true'] .camwall-video {
  opacity: 1;
}
.camwall-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--muted);
  font-size: var(--type-body);
  text-align: center;
}
.camwall-tile[data-picture='true'] .camwall-placeholder {
  display: none;
}
.camwall-tile[data-down='true'] .camwall-still {
  filter: grayscale(1) brightness(0.5);
}
.camwall-label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 12px);
  padding: 2px 7px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgb(var(--c-000000) / 0.55);
  font-size: var(--type-small);
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms var(--ease);
}
.camwall.show-chrome .camwall-label,
.camwall-tile:focus-visible .camwall-label,
.camwall-tile.is-focused .camwall-label {
  opacity: 1;
}
.camwall-dot {
  color: rgb(var(--c-ff5d6e));
  font-size: var(--type-nano);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.camwall-dot::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: rgb(var(--c-ff5d6e));
  vertical-align: middle;
}
/* Down or reconnecting: always shown, never faded - a blank tile would say nothing. */
.camwall-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  max-width: calc(100% - 12px);
  padding: 2px 8px;
  overflow: hidden;
  border: 1px solid rgb(var(--c-ff7b92) / 0.6);
  border-radius: var(--radius-pill);
  background: rgb(var(--c-000000) / 0.7);
  color: rgb(var(--c-ffc2cc));
  font-size: var(--type-micro);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.camwall-badge[data-tone='warn'] {
  border-color: rgb(var(--c-e9b85b) / 0.6);
  color: var(--gold);
}
.camwall-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px 18px;
  background: linear-gradient(rgb(var(--c-000000) / 0.8), transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms var(--ease);
}
.camwall.show-chrome .camwall-bar {
  opacity: 1;
  pointer-events: auto;
}
.camwall-title {
  font-size: var(--type-base);
  white-space: nowrap;
}
.camwall-note {
  flex: 1;
  min-width: 0;
  color: rgb(var(--c-c9d6e3));
  font-size: var(--type-small);
}
.camwall[data-network='offline'] .camwall-note {
  color: var(--gold);
}
.camwall-exit {
  min-height: 32px;
  padding: 5px 14px;
  border: 1px solid rgb(var(--c-ffffff) / 0.35);
  border-radius: var(--radius-sm);
  background: rgb(var(--c-000000) / 0.5);
  color: rgb(var(--c-ffffff));
  font: inherit;
  font-size: var(--type-body);
  white-space: nowrap;
  cursor: pointer;
}
.camwall-exit:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
/* One camera large: the others stay live behind it, so going back is instant. */
.camwall[data-focus] .camwall-tile:not(.is-focused) {
  display: none;
}
.camwall-tile.is-focused {
  cursor: zoom-out;
}
.camwall-tile.is-focused .camwall-still,
.camwall-tile.is-focused .camwall-video {
  object-fit: contain;
}
@media (max-width: 600px) {
  .camwall-bar {
    flex-wrap: wrap;
  }
  .camwall-note {
    order: 3;
    flex-basis: 100%;
  }
}
/* A 4K wall is read from across a room: names and badges grow with the screen. */
.camwall-label {
  font-size: clamp(11px, 0.55vw, 22px);
}
.camwall-badge {
  font-size: clamp(10px, 0.5vw, 20px);
}
.camwall-dot {
  font-size: clamp(9px, 0.4vw, 16px);
}
.camwall-note {
  font-size: clamp(11px, 0.45vw, 18px);
}
.camwall-title {
  font-size: clamp(14px, 0.6vw, 24px);
}
.camwall-exit {
  font-size: clamp(13px, 0.5vw, 20px);
}
@media (prefers-reduced-motion: reduce) {
  .camera-grid[data-spacing='tight'] .camera-card-info {
    animation: none;
    opacity: 1;
  }
  .camwall-label,
  .camwall-bar,
  .camwall-video {
    transition: none;
  }
}

/* --- Command Center ---------------------------------------------------------------------- */
/* The menu can be hidden so the room (or the voice view) fills the screen. */
.atlas-app[data-workspace='atlas'].nav-hidden {
  grid-template-columns: 0 minmax(0, 1fr);
}
.atlas-app[data-workspace='atlas'].nav-hidden .atlas-nav {
  display: none;
}
.atlas-app[data-workspace='atlas'].nav-hidden .atlas-header,
.atlas-app[data-workspace='atlas'].nav-hidden .atlas-main {
  grid-column: 1 / span 2;
}
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--line-strong, rgb(var(--c-31536d)));
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.nav-toggle:focus-visible,
.cc-widget-head:focus-visible,
.cc-widget-full:focus-visible,
.cc-strip:focus-visible,
.chat-mode:focus-visible,
.atlas-chat-reopen:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* The room beside the conversation: one column for the room, one for David. */
.atlas-app[data-workspace='atlas'] .atlas-workspace {
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: start;
}
.atlas-app[data-workspace='atlas'] .atlas-workspace > :not(.atlas-chat-shell) {
  grid-column: 1;
}
.atlas-chat-shell {
  grid-column: 2;
  grid-row: 1 / span 3;
  position: sticky;
  top: 12px;
  height: calc(100vh - 110px);
  min-height: 420px;
}
.atlas-chat-shell.dropping .atlas-chat {
  outline: 2px dashed var(--cyan);
  outline-offset: -6px;
}
.atlas-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}
.atlas-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.atlas-chat-head strong {
  display: block;
  font-size: var(--type-lg);
}
.atlas-chat-head small {
  color: var(--muted);
  font-size: var(--type-small);
}
.atlas-chat-modes {
  display: flex;
  gap: 6px;
}
.chat-mode,
.atlas-chat-reopen {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong, rgb(var(--c-31536d)));
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.chat-mode[aria-pressed='true'] {
  border-color: var(--cyan);
  color: var(--cyan);
}
.atlas-chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 0;
}
.atlas-chat .conversation {
  min-height: 0;
  padding: 0;
}
.atlas-chat .message {
  padding: 10px 12px;
  font-size: var(--type-body);
}
.atlas-chat .composer {
  margin-top: 8px;
}
.atlas-chat .composer textarea {
  min-height: 70px;
}
.atlas-chat .composer-controls,
.atlas-chat .voice-controls {
  flex-wrap: wrap;
}
.chat-drop-hint,
.chat-drop-status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--type-small);
}
.atlas-chat-reopen {
  display: none;
}
/* Hidden: the round David bubble brings it back (see the end of this file). */
.atlas-app[data-chat='hidden'] .atlas-chat {
  display: none;
}
/* Expanded: the conversation takes the room for deep work. */
.atlas-app[data-chat='expanded'] .atlas-workspace {
  grid-template-columns: minmax(0, 1fr);
}
.atlas-app[data-chat='expanded'] .atlas-workspace > :not(.atlas-chat-shell) {
  display: none;
}
.atlas-app[data-chat='expanded'] .atlas-chat-shell {
  grid-column: 1;
}

/* What needs the Owner, across the top. */
.cc {
  display: grid;
  gap: 12px;
}
.cc-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text);
  font: inherit;
  text-align: left;
}
button.cc-strip {
  cursor: pointer;
}
.cc-strip span:not(.cc-widget-chevron) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.cc-strip.hot {
  border-color: rgb(var(--c-ff6b6b) / 0.55);
  background: rgb(var(--c-ff6b6b) / 0.1);
}
.cc-strip.hot strong {
  color: var(--stop);
}
.cc-strip.calm {
  color: var(--muted);
}
.cc-needs {
  display: grid;
  gap: 10px;
}

/* The widgets: one line each until opened. */
.cc-grid {
  display: grid;
  gap: 10px;
}
.cc-widget {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}
.cc-widget-bar {
  display: flex;
  align-items: stretch;
}
.cc-widget-head {
  display: grid;
  grid-template-columns: auto 160px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cc-widget-title {
  font-weight: 600;
}
.cc-widget-headline {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.cc-widget-chevron {
  color: var(--muted);
}
.cc-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--idle, rgb(var(--c-5f7187)));
}
.cc-light.tone-good {
  background: var(--ok, rgb(var(--c-3ddc97)));
  box-shadow: 0 0 8px rgb(var(--c-3ddc97) / 0.5);
}
.cc-light.tone-warn {
  background: var(--warn, rgb(var(--c-ffb547)));
  box-shadow: 0 0 8px rgb(var(--c-ffb547) / 0.5);
}
.cc-light.tone-bad {
  background: var(--stop, rgb(var(--c-ff6b6b)));
}
.cc-widget-full {
  width: 44px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.cc-widget-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}
/* A room shown inside a widget keeps its tools but not its big page title. */
.cc-widget-body .room {
  max-width: none;
  margin: 0;
  padding: 12px 0 0;
}
.cc-widget-body .room-head h1 {
  font-size: var(--type-lg);
}
.cc-widget-body .room-head .eyebrow {
  display: none;
}
.cc-widget.full {
  position: fixed;
  inset: 16px;
  z-index: 60;
  overflow-y: auto;
  background: var(--ink, rgb(var(--c-05080e)));
  box-shadow: 0 20px 60px rgb(var(--c-000000) / 0.6);
}

@media (max-width: 980px) {
  .atlas-app[data-workspace='atlas'] .atlas-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .atlas-chat-shell {
    grid-column: 1;
    grid-row: auto;
    position: static;
    height: 70vh;
  }
  .cc-widget-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .cc-widget-headline {
    grid-column: 2;
    grid-row: 2;
  }
}

/* A full-screen widget escapes the room: the room's blur would otherwise trap it inside. */
.room:has(.cc-widget.full) {
  backdrop-filter: none;
}

/* David's memory widget. */
.cc-memory {
  display: grid;
  gap: 12px;
}
.memory-note {
  margin: 0;
  color: var(--muted);
}
.memory-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(var(--c-ffffff) / 0.03);
  color: inherit;
  font: inherit;
}
.memory-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.memory-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.memory-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.memory-kind {
  color: var(--gold);
}
.memory-pending {
  color: rgb(var(--c-f0a35b));
}
.memory-text {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cc-learning {
  margin-top: 18px;
}

/* The council's punch lists. */
.office-plate {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.plate-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.plate-chip {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  white-space: nowrap;
}
.plate-chip.tone-good {
  color: rgb(var(--c-7fd6a4));
  border-color: rgb(var(--c-7fd6a4) / 0.4);
}
.plate-chip.tone-bad {
  color: rgb(var(--c-ff8a80));
  border-color: rgb(var(--c-ff8a80) / 0.45);
}
.plate-chip.tone-warn {
  color: var(--gold);
  border-color: rgb(var(--c-e9b85b) / 0.45);
}
.plate-chip.tone-muted {
  color: var(--muted);
}
.plate-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.plate-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.plate-title {
  flex: 1 1 160px;
  overflow-wrap: anywhere;
}
.plate-overdue {
  color: rgb(var(--c-ff8a80));
  font-size: 11px;
}
.plate-due,
.plate-meta,
.plate-note {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.plate-target {
  display: grid;
  gap: 4px;
}
.plate-target-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.plate-bar {
  height: 6px;
  border-radius: 999px;
  background: rgb(var(--c-ffffff) / 0.08);
  overflow: hidden;
}
.plate-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
}
.plate-next {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.office-open,
.office-back,
.plate-move,
.plate-new button {
  justify-self: start;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.office-open {
  margin-top: 10px;
}
a.office-open,
a.office-back {
  display: inline-block;
  text-decoration: none;
}
.office-room-holder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.office-room {
  display: grid;
  gap: 16px;
}
.office-room-head {
  display: grid;
  gap: 8px;
}
.office-room-head h2 {
  margin: 0;
}
.office-targets {
  display: grid;
  gap: 10px;
}
.plate-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.plate-column h3,
.office-targets h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.plate-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.plate-item-note {
  margin: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.plate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.plate-new {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.plate-new input {
  flex: 1 1 200px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(var(--c-ffffff) / 0.03);
  color: inherit;
  font: inherit;
}
.plate-new input[type='date'] {
  flex: 0 0 auto;
}

/* ==========================================================================================
 * Owner UI polish (23 Sep): the chat in the style of Claude.ai and ChatGPT, an arrangeable
 * Command Center, and a phone layout.
 *
 * Appended rather than threaded through the older rules so it reads as one design and wins
 * where it overlaps them. Colours come from the ATLAS tokens at the top of the ATLAS section.
 * ========================================================================================== */

/* --- Small icon buttons --------------------------------------------------------------------- */
.ui-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--ease),
    color var(--motion-fast) var(--ease);
}
.icon-button:hover:not(:disabled) {
  background: rgb(var(--c-ffffff) / 0.07);
  color: var(--text);
}
.icon-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}
.icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}
.icon-button[hidden] {
  display: none;
}

/* --- The chat panel ------------------------------------------------------------------------- */
.atlas-chat {
  padding: 0;
  overflow: hidden;
}
.atlas-chat-head {
  padding: 10px 8px 10px 14px;
}
.chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.chat-avatar {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    rgb(var(--c-d8f7ff)),
    var(--cyan) 45%,
    rgb(var(--c-0d3a55)) 78%
  );
  box-shadow: 0 0 10px rgb(var(--c-3fd8ff) / 0.35);
}
.chat-title-text strong {
  display: block;
  font-size: var(--type-base);
  font-weight: 600;
  line-height: 1.2;
}
.chat-title-text small {
  display: block;
  color: var(--muted);
  font-size: var(--type-micro);
  letter-spacing: 0.02em;
}
.atlas-chat-modes {
  gap: 2px;
}
.atlas-chat .chat-mode {
  min-width: 0;
  width: 32px;
  height: 32px;
  border: 0;
}
.atlas-chat .chat-mode[aria-pressed='true'] {
  background: rgb(var(--c-3fd8ff) / 0.12);
  color: var(--cyan);
}
.atlas-chat-handle,
.chat-sheet-close {
  display: none;
}
.atlas-chat-body {
  padding: 16px 14px 10px;
}
.chat-transcript,
.atlas-workspace .chat-transcript {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 0;
}

/* Messages: the Owner's as quiet right-aligned pills, David's as plain text. */
.chat-msg {
  max-width: 100%;
  font-size: var(--type-body);
  line-height: 1.55;
}
.chat-owner {
  display: flex;
  justify-content: flex-end;
}
.chat-pill {
  max-width: 85%;
  margin: 0;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 4px 16px;
  background: rgb(var(--c-ffffff) / 0.06);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: var(--type-small);
}
.chat-name {
  color: var(--cyan);
  font-weight: 600;
}
.chat-meta time {
  font-variant-numeric: tabular-nums;
}
/* Something ATLAS did, not something anyone said: one centred line, no bubble. */
.chat-event {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin: 0;
  color: var(--muted);
  font-size: var(--type-small);
  text-align: center;
  overflow-wrap: anywhere;
}
.chat-event time {
  font-variant-numeric: tabular-nums;
}
.chat-chip {
  padding: 1px 8px;
  border: 1px solid var(--line-strong, rgb(var(--c-31536d)));
  border-radius: var(--radius-pill);
  font-size: var(--type-micro);
}
.chat-chip.tone-warn,
.chat-chip.tone-gold {
  border-color: rgb(var(--c-ffb547) / 0.45);
  color: var(--warn, rgb(var(--c-ffb547)));
}
.chat-chip.tone-bad,
.chat-chip.tone-stop {
  border-color: rgb(var(--c-ff6b6b) / 0.45);
  color: var(--stop, rgb(var(--c-ff6b6b)));
}
.reply-speech-controls {
  display: inline-flex;
  margin-left: auto;
}
.reply-speech-controls .icon-button {
  width: 26px;
  height: 26px;
}
.reply-speech-controls .ui-icon {
  width: 15px;
  height: 15px;
}
.chat-text {
  color: var(--text);
  overflow-wrap: anywhere;
}
.chat-text p,
.chat-text ul,
.chat-text ol,
.chat-text pre {
  margin: 0 0 0.65em;
}
.chat-text > :last-child {
  margin-bottom: 0;
}
.chat-text ul,
.chat-text ol {
  padding-left: 1.35em;
}
.chat-text li {
  margin: 0.2em 0;
}
.chat-text code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgb(var(--c-ffffff) / 0.07);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
.chat-text pre {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(var(--c-000000) / 0.35);
  overflow-x: auto;
  white-space: pre;
}
.chat-text pre code {
  padding: 0;
  background: none;
}
.chat-heading {
  font-weight: 600;
}
.chat-status-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}
.chat-failed .chat-status-note {
  color: var(--stop, rgb(var(--c-ff6b6b)));
}
.chat-failed .chat-dots {
  display: none;
}
.chat-pending {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-empty {
  margin: auto 0;
  padding: 28px 10px;
  color: var(--muted);
  text-align: center;
}
.chat-empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
}
.chat-empty p {
  margin: 0;
  font-size: var(--type-body);
}
.chat-dots {
  display: inline-flex;
  gap: 3px;
}
.chat-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  animation: chat-dot 1.2s infinite ease-in-out;
}
.chat-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.chat-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes chat-dot {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

/* Task and results: one thin line until opened. */
.chat-task {
  margin: 0 14px;
  border-top: 1px solid var(--line);
  font-size: var(--type-small);
}
.chat-task > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 2px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.chat-task > summary::-webkit-details-marker {
  display: none;
}
.chat-task > summary::after {
  content: '\25BE';
  margin-left: 2px;
}
.chat-task[open] > summary::after {
  content: '\25B4';
}
.chat-task-label {
  flex: 1;
}
.chat-task-state {
  color: var(--text);
}
.chat-task .command-result,
.atlas-workspace .chat-task .command-result {
  max-height: 38vh;
  margin: 0 0 8px;
  padding: 10px 12px;
  overflow: auto;
  border-radius: var(--radius-md);
  font-size: var(--type-small);
  white-space: normal;
}
.atlas-workspace .chat-task .command-result strong {
  font-size: var(--type-body);
}

/* --- The composer: one rounded box with small icons inside ---------------------------------- */
.chat-composer,
.atlas-chat .chat-composer {
  margin: 0;
  padding: 8px 12px 10px;
  border-top: 0;
}
.composer-box {
  display: flex;
  flex-direction: column;
  padding: 8px 8px 6px 14px;
  border: 1px solid var(--line-strong, rgb(var(--c-31536d)));
  border-radius: 18px;
  background: rgb(var(--c-ffffff) / 0.035);
  transition:
    border-color var(--motion-fast) var(--ease),
    box-shadow var(--motion-fast) var(--ease);
}
.composer-box:focus-within {
  border-color: rgb(var(--c-3fd8ff) / 0.45);
  box-shadow: 0 0 0 3px rgb(var(--c-3fd8ff) / 0.08);
}
.chat-composer .composer-box textarea.composer-input {
  width: 100%;
  min-height: 24px;
  max-height: 200px;
  margin: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: var(--type-base);
  line-height: 1.5;
  resize: none;
}
.composer-input::placeholder {
  color: var(--muted);
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 32px;
  margin-top: 4px;
}
.composer-spacer {
  display: none;
}
.chat-composer .voice-state {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0 6px;
  color: var(--muted);
  font-size: var(--type-small);
  letter-spacing: 0;
  line-height: 1.3;
}
.chat-composer .voice-state:empty,
.chat-composer .voice-state[data-quiet] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.chat-composer .voice-state[data-voice-state='recording'],
.chat-composer .voice-state[data-voice-state='requesting'],
.chat-composer .voice-state[data-voice-state='transcribed'] {
  color: var(--cyan);
}
.chat-composer .voice-state[data-voice-state='blocked'],
.chat-composer .voice-state[data-voice-state='unavailable'],
.chat-composer .voice-state[data-voice-state='reconnect'] {
  color: var(--warn, rgb(var(--c-ffb547)));
}
.composer-mic.listening {
  background: rgb(var(--c-ff6b6b) / 0.16);
  color: var(--text);
}
.mic-live {
  position: absolute;
  top: 5px;
  right: 5px;
  display: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stop, rgb(var(--c-ff6b6b)));
}
.composer-mic.listening .mic-live {
  display: block;
  animation: mic-pulse 1.1s infinite ease-in-out;
}
@keyframes mic-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgb(var(--c-ff6b6b) / 0.6);
  }
  50% {
    box-shadow: 0 0 0 5px rgb(var(--c-ff6b6b) / 0);
  }
}
.composer-mic.blocked .ui-icon {
  opacity: 0.55;
}
.composer-mic.blocked::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 1.8px;
  border-radius: 1px;
  background: currentColor;
  rotate: -45deg;
  opacity: 0.8;
}
.composer-send {
  border-radius: 50%;
  background: var(--text);
  color: var(--ink, rgb(var(--c-05080e)));
}
.composer-send:hover:not(:disabled) {
  background: rgb(var(--c-ffffff));
  color: var(--ink, rgb(var(--c-05080e)));
}
.composer-send:disabled {
  opacity: 1;
  background: rgb(var(--c-ffffff) / 0.12);
  color: var(--muted);
}
.composer-send .ui-icon {
  stroke-width: 2.2;
}
.composer-more .ui-icon {
  stroke-width: 3;
}
.composer-more-wrap {
  position: relative;
  margin-left: auto;
}
.composer-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: min(310px, 82vw);
  padding: 6px;
  border: 1px solid var(--line-strong, rgb(var(--c-31536d)));
  border-radius: 12px;
  background: rgb(var(--c-0b1320));
  box-shadow: 0 18px 44px rgb(var(--c-000000) / 0.55);
}
.composer-menu[hidden] {
  display: none;
}
.composer-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  cursor: pointer;
}
.composer-menu .menu-item:hover {
  background: rgb(var(--c-ffffff) / 0.06);
}
.menu-item-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.menu-item-label {
  font-size: var(--type-body);
}
.menu-item-hint {
  color: var(--muted);
  font-size: var(--type-small);
}
.menu-switch {
  position: relative;
  flex: none;
  width: 30px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: rgb(var(--c-ffffff) / 0.16);
  transition: background var(--motion-fast) var(--ease);
}
.menu-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgb(var(--c-ffffff));
  transition: translate var(--motion-fast) var(--ease);
}
.menu-item[aria-checked='true'] .menu-switch {
  background: var(--cyan);
}
.menu-item[aria-checked='true'] .menu-switch::after {
  translate: 12px 0;
}
.composer-menu .advanced-controls {
  margin: 4px 0 0;
  padding: 0 10px;
  border-top: 1px solid var(--line);
}
.composer-menu .advanced-controls summary {
  padding: 9px 0;
  color: var(--muted);
  font-size: var(--type-small);
}
.composer-menu .advanced-control-content p,
.atlas-workspace .composer-menu .advanced-control-content p {
  margin: 0;
  font-size: var(--type-small);
}
.composer-menu .read-command,
.atlas-workspace .composer-menu .read-command {
  min-height: 0;
  margin: 8px 0 10px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: var(--type-small);
  letter-spacing: 0;
}
.composer-hint {
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: var(--type-micro);
  text-align: center;
  opacity: 0.8;
}
.chat-drop-status {
  margin: 0 4px 6px;
}

/* The composer's microphone replaces the floating ASK CEO control in the ATLAS rooms. */
.atlas-app[data-workspace='atlas'] .ask-ceo,
.atlas-app[data-workspace='atlas']:not([data-room='atlas']) .ask-ceo {
  display: none;
}

/* --- Command Center: view toggle, Arrange, list and tiles ----------------------------------- */
/* One column that may shrink: the needs strip's one-line text must not widen the room. */
.cc,
.cc-needs {
  grid-template-columns: minmax(0, 1fr);
}
.cc-strip {
  min-width: 0;
}
.room-actions {
  flex-wrap: wrap;
}
.cc-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pref-status {
  color: var(--muted);
  font-size: var(--type-small);
}
.pref-status[data-state='offline'],
.pref-status[data-state='error'] {
  color: var(--warn, rgb(var(--c-ffb547)));
}
.cc-view-toggle {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgb(var(--c-ffffff) / 0.03);
}
.cc-view-option {
  width: 30px;
  height: 28px;
}
.cc-view-option[aria-pressed='true'] {
  background: rgb(var(--c-3fd8ff) / 0.14);
  color: var(--cyan);
}
.cc-arrange {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-strong, rgb(var(--c-31536d)));
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--type-body);
  cursor: pointer;
}
.cc-arrange.active {
  border-color: var(--cyan);
  background: var(--cyan);
  color: var(--ink, rgb(var(--c-05080e)));
  font-weight: 600;
}
.cc-arrange:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* List: slim rows, about half the old height. */
.cc-grid.view-list {
  gap: 6px;
}
.cc-row .cc-widget-head {
  grid-template-columns: auto 150px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 7px 12px;
  font-size: var(--type-body);
}
.cc-widget-bar > .cc-widget-full {
  width: 38px;
  height: auto;
  border-left: 1px solid var(--line);
  border-radius: 0;
}
.cc-widget-body {
  overflow-x: auto;
}

/* Tiles: cards the size of app icons, with the headline number. */
.cc-grid.view-tiles {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-flow: row dense;
  gap: 10px;
}
.cc-tile {
  position: relative;
  border-radius: var(--radius-lg);
}
.cc-tile .cc-widget-bar {
  position: relative;
  height: 100%;
}
.cc-tile .cc-widget-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 112px;
  padding: 12px 14px 14px;
  border-radius: var(--radius-lg);
}
.cc-tile .cc-widget-head:hover {
  background: rgb(var(--c-ffffff) / 0.03);
}
.cc-tile-top {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-right: 26px;
}
.cc-tile .cc-widget-title {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--type-small);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.cc-tile-metric {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc-tile-metric.is-text {
  font-size: var(--type-lg);
  line-height: 1.5;
}
.cc-tile .cc-widget-headline {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--type-small);
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.cc-tile .cc-widget-bar > .cc-widget-full {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-left: 0;
  border-radius: 8px;
  opacity: 0.55;
}
.cc-tile .cc-widget-bar > .cc-widget-full:hover,
.cc-tile .cc-widget-bar > .cc-widget-full:focus-visible {
  opacity: 1;
}
.cc-tile.open {
  grid-column: 1 / -1;
}
.cc-tile.open .cc-widget-bar {
  height: auto;
}
.cc-tile.open .cc-widget-head {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-height: 0;
  padding: 10px 48px 10px 14px;
}
.cc-tile.open .cc-tile-top {
  width: auto;
  padding-right: 0;
}
.cc-tile.open .cc-tile-metric {
  font-size: var(--type-lg);
}

/* Arrange: iPhone-style jiggle, drag to reorder, x to hide. */
.cc-editable {
  position: relative;
  touch-action: none;
  user-select: none;
}
.cc-editable .cc-widget-head {
  cursor: grab;
}
.cc-row.cc-editable .cc-widget-head {
  grid-template-columns: auto auto 150px minmax(0, 1fr);
}
.cc-grip {
  display: inline-grid;
  color: var(--muted);
}
.cc-hide {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong, rgb(var(--c-31536d)));
  border-radius: 50%;
  background: rgb(var(--c-273142));
  color: var(--text);
}
.cc-hide .ui-icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.4;
}
.cc-move-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
}
.cc-tile .cc-move-group {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 0;
}
.cc-move {
  width: 28px;
  height: 28px;
}
@keyframes cc-jiggle {
  0%,
  100% {
    rotate: -0.7deg;
  }
  50% {
    rotate: 0.7deg;
  }
}
@keyframes cc-jiggle-row {
  0%,
  100% {
    rotate: -0.18deg;
  }
  50% {
    rotate: 0.18deg;
  }
}
.cc-grid.editing.view-tiles .cc-widget {
  animation: cc-jiggle 0.32s ease-in-out infinite;
}
.cc-grid.editing.view-list .cc-widget {
  animation: cc-jiggle-row 0.32s ease-in-out infinite;
}
.cc-grid.editing .cc-widget:nth-child(2n) {
  animation-delay: -0.16s;
}
.cc-grid .cc-widget.dragging {
  z-index: 5;
  animation: none;
  box-shadow: 0 18px 40px rgb(var(--c-000000) / 0.55);
  cursor: grabbing;
  opacity: 0.96;
}
.cc-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong, rgb(var(--c-31536d)));
  border-radius: 12px;
  color: var(--muted);
  font-size: var(--type-small);
}
.cc-restore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line-strong, rgb(var(--c-31536d)));
  border-radius: var(--radius-pill);
  background: rgb(var(--c-ffffff) / 0.04);
  color: var(--text);
  font: inherit;
  font-size: var(--type-small);
  cursor: pointer;
}
.cc-restore .ui-icon {
  width: 14px;
  height: 14px;
}
.cc-restore:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.cc-hidden-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-small);
}
@media (prefers-reduced-motion: reduce) {
  .cc-grid.editing .cc-widget {
    animation: none;
    outline: 1px dashed var(--line-strong, rgb(var(--c-31536d)));
    outline-offset: 2px;
  }
  .chat-dots i,
  .composer-mic.listening .mic-live {
    animation: none;
  }
}

/* --- Phones: the chat becomes a bottom sheet, the widgets tiles ----------------------------- */
@media (max-width: 767px) {
  body:has(.atlas-app[data-workspace='atlas']) {
    overflow-x: clip;
  }
  .atlas-app[data-workspace='atlas'][data-chat] .atlas-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .atlas-app[data-workspace='atlas'] .atlas-main {
    padding-bottom: 170px;
  }
  /*
   * The room tabs scroll sideways inside their own strip. Without a stretch the strip took the
   * width of every tab (about 1700px) and pushed the whole page sideways on a phone.
   */
  .atlas-app[data-workspace='atlas'] .atlas-nav {
    align-self: stretch;
    max-width: 100%;
    min-width: 0;
  }
  .atlas-chat-shell {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    height: auto;
    min-height: 0;
  }
  .atlas-chat {
    height: auto;
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: rgb(var(--c-0a111c));
    box-shadow: 0 -12px 32px rgb(var(--c-000000) / 0.5);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .atlas-chat-handle {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 8px 0 2px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }
  .atlas-chat-grabber {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: rgb(var(--c-ffffff) / 0.28);
  }
  .atlas-chat-handle-label,
  .atlas-chat-head,
  .atlas-chat-body,
  .chat-task,
  .composer-hint {
    display: none;
  }
  /* Pulled up, or expanded: the conversation takes the screen. */
  .atlas-app[data-chat-sheet='open'] .atlas-chat-shell,
  .atlas-app[data-chat='expanded'] .atlas-chat-shell {
    top: 0;
  }
  .atlas-app[data-chat-sheet='open'] .atlas-chat,
  .atlas-app[data-chat='expanded'] .atlas-chat {
    height: 100%;
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
  }
  .atlas-app[data-chat-sheet='open'] .atlas-chat-head,
  .atlas-app[data-chat='expanded'] .atlas-chat-head {
    display: flex;
  }
  .atlas-app[data-chat-sheet='open'] .atlas-chat-body,
  .atlas-app[data-chat='expanded'] .atlas-chat-body,
  .atlas-app[data-chat-sheet='open'] .chat-task,
  .atlas-app[data-chat='expanded'] .chat-task {
    display: block;
  }
  .atlas-app[data-chat-sheet='open'] .chat-sheet-close {
    display: inline-grid;
  }
  .atlas-app[data-chat-sheet='open'] .atlas-chat-handle,
  .atlas-app[data-chat='expanded'] .atlas-chat-handle {
    display: none;
  }
  /* iOS zooms into any field under 16px; the composer must not trigger it. */
  .chat-composer .composer-box textarea.composer-input {
    font-size: 16px;
  }
  .cc-grid.view-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cc-toolbar {
    width: 100%;
    justify-content: flex-end;
  }
  .cc-row .cc-widget-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .cc-row .cc-widget-headline {
    grid-column: 2;
    grid-row: 2;
  }
  .room-head {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
}

/* ==========================================================================================
 * Three Owner controls (24 Sep): David's heartbeat, the council's proposals, recent problems.
 * Compact rows and small buttons, in the punch lists' vocabulary.
 * ========================================================================================== */

.plate-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.hb-small,
.hb-link {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.hb-small:disabled,
.plate-move:disabled {
  opacity: 0.5;
  cursor: default;
}
.hb-link {
  justify-self: start;
  padding: 0;
  border: 0;
  color: var(--cyan);
}

/* --- David's heartbeat, at the top of David's work ----------------------------------------- */
.hb-card {
  display: grid;
  gap: 8px;
  margin: 12px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(var(--c-ffffff) / 0.015);
}
.hb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hb-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.hb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.hb-label {
  color: var(--muted);
  font-size: 12px;
}
.hb-slots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.hb-slot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.hb-slot-remove {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.hb-slot-remove:hover {
  color: var(--text);
  background: rgb(var(--c-ffffff) / 0.08);
}
.hb-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.hb-card input[type='time'],
.hb-card input[type='date'],
.hb-card select {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgb(var(--c-ffffff) / 0.03);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  color-scheme: inherit;
}
.hb-status {
  color: var(--muted);
  font-size: 12px;
}
.hb-reply {
  display: grid;
  gap: 2px;
}
.hb-reply-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hb-runs-list,
.diag-related {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}
.hb-run {
  display: flex;
  gap: 10px;
}
.hb-run-when {
  min-width: 110px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* --- David's proposals, in the Council ----------------------------------------------------- */
.proposals {
  display: grid;
  gap: 8px;
}
.proposal-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.proposal-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.proposal-item {
  display: grid;
  gap: 5px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.proposal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.proposal-office {
  color: var(--muted);
  font-size: 12px;
}
.proposal-summary,
.proposal-detail {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.proposal-detail {
  white-space: pre-wrap;
}
.proposal-actions .plate-move {
  padding: 3px 10px;
}

/* --- Recent problems, in Health & Costs ---------------------------------------------------- */
.diag-body {
  display: grid;
  gap: 8px;
}
.diag-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.diag-item {
  border: 1px solid var(--line);
  border-radius: 8px;
}
.diag-item.open {
  border-color: rgb(var(--c-31d7ff) / 0.35);
}
.diag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 0;
}
.diag-open {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.diag-component {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.diag-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.diag-code,
.diag-detail code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--gold);
}
.diag-count,
.diag-seen {
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.diag-actions {
  display: inline-flex;
  gap: 4px;
}
.diag-detail {
  display: grid;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--line);
  color: var(--text);
}
.diag-message {
  margin: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.diag-block h4 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.diag-chain {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}
.diag-chain li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: calc(var(--depth, 0) * 14px);
  overflow-wrap: anywhere;
}
.diag-chain li + li::before {
  content: '↳';
  color: var(--muted);
}
.diag-ids {
  display: grid;
  gap: 4px;
}
.diag-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.diag-id span {
  min-width: 72px;
}
.diag-id code {
  color: var(--text);
  overflow-wrap: anywhere;
}
.diag-copy {
  padding: 1px 8px;
  font-size: 11px;
}
.diag-stack {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre;
  color: var(--muted);
}

/* --- A widget line that leads to another room ---------------------------------------------- */
.cc-widget-alert {
  align-self: center;
  margin-right: 8px;
  padding: 2px 10px;
  border: 1px solid rgb(var(--c-e9b85b) / 0.45);
  border-radius: 999px;
  background: rgb(var(--c-e9b85b) / 0.08);
  color: var(--gold);
  font: inherit;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.cc-widget-alert.tone-bad {
  border-color: rgb(var(--c-ff7b92) / 0.45);
  background: rgb(var(--c-ff7b92) / 0.08);
  color: var(--danger);
}
.cc-widget-alert:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .diag-row {
    flex-wrap: wrap;
    padding-left: 0;
  }
  .hb-run-when {
    min-width: 90px;
  }
}

/* Native option lists are drawn by the OS: on Windows Chrome they inherited our light text on
   the system's white list, so the business names were unreadable when the pull-down opened. */
select {
  color-scheme: inherit;
}
select option,
select optgroup {
  background-color: var(--surface2);
  color: var(--text);
}
select option:disabled {
  color: var(--muted, rgb(var(--c-87a0b9)));
}

/* --- The business switcher: top of the left menu, familiar CRM style ------------------------- */
.nav-business {
  margin: 2px 0 12px;
}
.business-switcher {
  display: grid;
  align-items: center;
  border: 1px solid rgb(var(--c-78c8ff) / 0.22);
  background: rgb(var(--c-ffffff) / 0.04);
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.business-switcher:hover:not(:disabled) {
  border-color: rgb(var(--c-3fd8ff) / 0.55);
  background: rgb(var(--c-3fd8ff) / 0.07);
}
.business-switcher:focus-visible,
.business-option:focus-visible,
.top-bubble:focus-visible,
.profile-action:focus-visible {
  outline: 2px solid rgb(var(--c-3fd8ff));
  outline-offset: 2px;
}
.business-switcher:disabled {
  cursor: default;
  opacity: 0.7;
}
.business-switcher.full-form {
  grid-template-columns: 32px minmax(0, 1fr) 12px;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
}
.business-switcher-mark,
.business-option-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgb(var(--c-3fd8ff)), rgb(var(--c-8b7bff)));
  color: rgb(var(--c-04101c));
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.business-switcher.unselected .business-switcher-mark {
  background: rgb(var(--c-ffffff) / 0.12);
  color: rgb(var(--c-eaf4ff));
}
.business-switcher-text,
.business-option-text {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.business-switcher-text strong,
.business-option-text strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.business-switcher-text small,
.business-option-text small {
  overflow: hidden;
  color: rgb(var(--c-8ba1b8));
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.business-switcher-chevron {
  width: 8px;
  height: 8px;
  border-right: 1.6px solid rgb(var(--c-8ba1b8));
  border-bottom: 1.6px solid rgb(var(--c-8ba1b8));
  transform: translateY(-2px) rotate(45deg);
}
.business-switcher[aria-expanded='true'] .business-switcher-chevron {
  transform: translateY(2px) rotate(225deg);
}
/* The round badge stands in for the switcher only while the left menu is hidden. */
.business-switcher.badge-form {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  place-items: center;
  flex: none;
}
.business-switcher.badge-form .business-switcher-mark {
  width: 34px;
  height: 34px;
}
/* A business's own square icon in place of its initials: a rounded square, cropped to fill. */
img.business-icon {
  display: block;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface2);
  object-fit: cover;
}
/* A business with no icon shows its logo in the square, whole rather than cropped. */
img.business-icon.from-logo {
  object-fit: contain;
}
/*
 * The switcher's slot is a small circle (ATLAS-2667): a wide logo fitted whole there is a
 * squeezed sliver. The business's own round icon fills it; with no icon, the middle of the logo,
 * cropped to the circle.
 */
img.business-icon.business-switcher-mark,
img.business-icon.business-option-mark {
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}
.atlas-app.nav-hidden .atlas-workspace-bar .business-switcher.badge-form {
  display: grid;
}

/* --- Drop-down panels: the business list and the bubbles' panels --------------------------- */
/* Appended to the page rather than the app, so they carry their own colours. */
.atlas-popover {
  position: fixed;
  z-index: 60;
  width: min(340px, calc(100vw - 16px));
  max-height: min(72vh, 560px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.22);
  border-radius: 12px;
  background: rgb(var(--c-0b1422));
  box-shadow: 0 18px 48px rgb(var(--c-000000) / 0.55);
  color: rgb(var(--c-eaf4ff));
  color-scheme: inherit;
  font-size: 14px;
  line-height: 1.45;
}
.atlas-popover p {
  margin: 0;
}
.popover-title {
  margin: 0 0 8px;
  color: rgb(var(--c-8ba1b8));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.popover-link {
  display: block;
  margin-top: 10px;
  padding: 8px 10px;
  border-top: 1px solid rgb(var(--c-78c8ff) / 0.12);
  color: rgb(var(--c-3fd8ff));
  text-decoration: none;
}
.popover-link:hover {
  text-decoration: underline;
}
.business-list {
  display: grid;
  gap: 4px;
}
.business-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.business-option:hover {
  background: rgb(var(--c-3fd8ff) / 0.08);
}
.business-option.selected {
  border-color: rgb(var(--c-3fd8ff) / 0.35);
  background: rgb(var(--c-3fd8ff) / 0.1);
}
.business-option-tick {
  color: rgb(var(--c-3fd8ff));
  font-weight: 800;
}

/* --- Top-right bubbles ----------------------------------------------------------------------- */
.top-bubbles {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}
.top-bubble {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgb(var(--c-ffffff));
  font: inherit;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease;
}
.top-bubble:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgb(var(--c-ffffff) / 0.12);
}
.bubble-david {
  background: linear-gradient(135deg, rgb(var(--c-3fd8ff)), rgb(var(--c-8b7bff)));
  color: rgb(var(--c-04101c));
}
.bubble-needs {
  background: rgb(var(--c-f59e0b));
  color: rgb(var(--c-1f1300));
}
.bubble-phone {
  background: rgb(var(--c-16a34a));
}
.bubble-help {
  background: rgb(var(--c-2563eb));
}
.bubble-profile {
  background: rgb(var(--c-475569));
}
.bubble-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bubble-glyph {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.bubble-count {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid rgb(var(--c-05080e));
  border-radius: 9px;
  background: rgb(var(--c-ef4444));
  color: rgb(var(--c-on-accent));
  font-size: 10px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}
.avatar {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgb(var(--c-475569));
  color: rgb(var(--c-ffffff));
  font-weight: 800;
}
.avatar.small {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.avatar.large {
  width: 48px;
  height: 48px;
  flex: none;
  font-size: 16px;
}
.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- The bubbles' panels ----------------------------------------------------------------------- */
.bubble-panel {
  display: grid;
  gap: 10px;
}
.bubble-panel .needs-you {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.help-rooms {
  display: grid;
  gap: 2px 0;
  margin: 0;
}
.help-rooms dt a {
  color: rgb(var(--c-3fd8ff));
  font-weight: 700;
  text-decoration: none;
}
.help-rooms dd {
  margin: 0 0 8px;
  color: rgb(var(--c-b9ccdb));
}
.help-keys {
  padding-top: 8px;
  border-top: 1px solid rgb(var(--c-78c8ff) / 0.12);
  color: rgb(var(--c-8ba1b8));
  font-size: 13px;
}
.profile-who {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-names {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.profile-names strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-names small {
  color: rgb(var(--c-8ba1b8));
}
.profile-role {
  justify-self: start;
  padding: 1px 8px;
  border: 1px solid rgb(var(--c-3fd8ff) / 0.35);
  border-radius: 999px;
  color: rgb(var(--c-3fd8ff));
  font-size: 12px;
  font-weight: 700;
}
.profile-section {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgb(var(--c-78c8ff) / 0.12);
}
.profile-section-title {
  color: rgb(var(--c-8ba1b8));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.profile-action {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.22);
  border-radius: 8px;
  background: rgb(var(--c-ffffff) / 0.04);
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.profile-action:hover:not(:disabled) {
  border-color: rgb(var(--c-3fd8ff) / 0.55);
}
.profile-action:disabled {
  color: rgb(var(--c-8ba1b8));
  cursor: not-allowed;
}
.profile-action.sign-out {
  margin-top: 4px;
  border-color: rgb(var(--c-ff6b6b) / 0.35);
  color: rgb(var(--c-ffc9c9));
}
.login-as-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.login-as-list li {
  display: grid;
  gap: 1px;
}
.login-as-target {
  padding: 0;
  border: 0;
  background: none;
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  font-weight: 700;
  text-align: left;
}
.login-as-list small,
.atlas-popover .rail-note {
  color: rgb(var(--c-8ba1b8));
  font-size: 13px;
}
.profile-status:empty {
  display: none;
}
.profile-status.tone-good {
  color: rgb(var(--c-3ddc97));
}
.profile-status.tone-bad {
  color: rgb(var(--c-ff8a8a));
}
.profile-status.tone-muted {
  color: rgb(var(--c-8ba1b8));
}

/* --- The ATLAS top bar: menu toggle and status, then the clock, then the bubbles -------------- */
.atlas-app[data-workspace='atlas'] .atlas-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}
.atlas-app[data-workspace='atlas'] .atlas-workspace-bar {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.atlas-app[data-workspace='atlas'] .vitals {
  flex: 0 1 auto;
  min-width: 0;
}
@media (max-width: 760px) {
  .atlas-app[data-workspace='atlas'] .atlas-header {
    padding: 10px 12px;
    gap: 8px;
  }
  .atlas-app[data-workspace='atlas'] .atlas-workspace-bar {
    flex-basis: auto;
  }
  /* A phone keeps the business as a round badge at the start of the menu row. */
  .atlas-app[data-workspace='atlas'] .nav-business {
    flex: none;
    margin: 0 6px 0 0;
  }
  .atlas-app[data-workspace='atlas'] .business-switcher.full-form {
    grid-template-columns: 32px;
    width: auto;
    padding: 2px;
    border-radius: 50%;
  }
  .atlas-app[data-workspace='atlas'] .business-switcher.full-form .business-switcher-text,
  .atlas-app[data-workspace='atlas'] .business-switcher.full-form .business-switcher-chevron {
    display: none;
  }
}
@media (max-width: 520px) {
  /* The dot and the clock say it; the words stay for a screen reader. */
  .atlas-app[data-workspace='atlas'] .os-status span:not(.os-dot) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .atlas-app[data-workspace='atlas'] .os-status {
    padding: 7px;
  }
  .top-bubbles {
    gap: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .top-bubble {
    transition: none;
  }
}

/* --- Cameras, picture in picture ------------------------------------------------------------- */
.bubble-cameras {
  background: rgb(var(--c-db2777));
}
.camera-pip {
  position: fixed;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: 380px;
  height: 300px;
  min-width: 240px;
  min-height: 200px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
  resize: both;
  border: 1px solid rgb(var(--c-78c8ff) / 0.28);
  border-radius: 12px;
  background: rgb(var(--c-0b1422));
  box-shadow: 0 18px 48px rgb(var(--c-000000) / 0.6);
  color: rgb(var(--c-eaf4ff));
  color-scheme: inherit;
  font-size: 14px;
}
.camera-pip.corner-top-left {
  top: 80px;
  left: 16px;
}
.camera-pip.corner-top-right {
  top: 80px;
  right: 16px;
}
.camera-pip.corner-bottom-left {
  bottom: 16px;
  left: 16px;
}
/* Clear of the round David chat bubble in the same corner. */
.camera-pip.corner-bottom-right {
  right: 16px;
  bottom: 88px;
}
.camera-pip.dragging {
  opacity: 0.9;
  user-select: none;
}
.camera-pip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgb(var(--c-78c8ff) / 0.12);
  cursor: grab;
  touch-action: none;
}
.camera-pip.dragging .camera-pip-head {
  cursor: grabbing;
}
.camera-pip-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.camera-pip-actions {
  display: flex;
  flex: none;
  gap: 6px;
}
.camera-pip-button {
  padding: 4px 10px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.25);
  border-radius: 999px;
  background: rgb(var(--c-ffffff) / 0.04);
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.camera-pip-button:hover {
  border-color: rgb(var(--c-3fd8ff) / 0.6);
}
.camera-pip-button:focus-visible,
.camera-pip-tile:focus-visible {
  outline: 2px solid rgb(var(--c-3fd8ff));
  outline-offset: 2px;
}
.camera-pip-button.close {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}
.camera-pip-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}
.camera-pip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.camera-pip-tile {
  display: grid;
  gap: 4px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgb(var(--c-78c8ff) / 0.18);
  border-radius: 8px;
  background: rgb(var(--c-060b14));
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.camera-pip-tile:hover {
  border-color: rgb(var(--c-3fd8ff) / 0.6);
}
.camera-pip-picture {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgb(var(--c-0e1726));
}
.camera-pip-picture.empty {
  display: grid;
  place-items: center;
  color: rgb(var(--c-8ba1b8));
}
.camera-pip-name {
  padding: 0 8px 6px;
}
.camera-pip-video {
  flex: 1;
  width: 100%;
  min-height: 0;
  border-radius: 8px;
  background: rgb(var(--c-000000));
  object-fit: contain;
}
.camera-pip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.camera-pip-note {
  margin: 0;
  color: rgb(var(--c-8ba1b8));
  font-size: 12px;
}
@media (max-width: 520px) {
  .camera-pip {
    width: calc(100vw - 24px);
    height: 250px;
  }
  .camera-pip.corner-top-left,
  .camera-pip.corner-bottom-left {
    left: 12px;
  }
  .camera-pip.corner-top-right,
  .camera-pip.corner-bottom-right {
    right: 12px;
  }
}

/* --- The hidden chat: a round David bubble, bottom right, on every screen size -------------- */
.atlas-app[data-chat='hidden'] .atlas-workspace,
.atlas-app[data-workspace='atlas'][data-chat='hidden'] .atlas-workspace {
  grid-template-columns: minmax(0, 1fr);
}
/* The shell keeps no box of its own: only the fixed bubble inside it shows. */
.atlas-app[data-chat='hidden'] .atlas-chat-shell {
  display: contents;
}
.atlas-app[data-chat='hidden'] .atlas-chat-reopen {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 45;
  display: grid;
  place-items: center;
  width: 52px;
  min-width: 0;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgb(var(--c-3fd8ff)), rgb(var(--c-8b7bff)));
  color: rgb(var(--c-04101c));
  box-shadow:
    0 10px 28px rgb(var(--c-000000) / 0.5),
    0 0 24px rgb(var(--c-3fd8ff) / 0.25);
  writing-mode: horizontal-tb;
}
.atlas-chat-reopen .bubble-icon {
  width: 24px;
  height: 24px;
}
.chat-unread-dot {
  display: none;
  position: absolute;
  top: 3px;
  right: 3px;
  width: 13px;
  height: 13px;
  border: 2px solid rgb(var(--c-05080e));
  border-radius: 50%;
  background: rgb(var(--c-ef4444));
}
.atlas-chat-reopen[data-unread='true'] .chat-unread-dot {
  display: block;
}

/* --- Search: the box under the business switcher, and the palette it opens ------------------- */
.nav-search-wrap {
  margin: 0 0 12px;
}
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.16);
  background: rgb(var(--c-ffffff) / 0.03);
  color: rgb(var(--c-8ba1b8));
  font: inherit;
  cursor: pointer;
}
.nav-search:hover {
  border-color: rgb(var(--c-3fd8ff) / 0.45);
  color: rgb(var(--c-eaf4ff));
}
.nav-search:focus-visible,
.palette-input:focus-visible {
  outline: 2px solid rgb(var(--c-3fd8ff));
  outline-offset: 2px;
}
.nav-search.full-form {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
}
.nav-search-icon,
.palette-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-search-label {
  flex: 1;
}
.nav-search-kbd,
.palette-kbd {
  padding: 1px 6px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.22);
  border-radius: 5px;
  color: rgb(var(--c-8ba1b8));
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* The magnifier stands in for the box only while the left menu is hidden. */
.nav-search.icon-form {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border-radius: 50%;
}
.atlas-app.nav-hidden .atlas-workspace-bar .nav-search.icon-form {
  display: grid;
}
.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 12px 12px;
  background: rgb(var(--c-02050b) / 0.6);
}
.palette {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: 70vh;
  overflow: hidden;
  border: 1px solid rgb(var(--c-78c8ff) / 0.28);
  border-radius: 14px;
  background: rgb(var(--c-0b1422));
  box-shadow: 0 24px 64px rgb(var(--c-000000) / 0.6);
  color: rgb(var(--c-eaf4ff));
  color-scheme: inherit;
}
.palette-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgb(var(--c-78c8ff) / 0.12);
  color: rgb(var(--c-8ba1b8));
}
.palette-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  font-size: 16px;
}
.palette-input::placeholder {
  color: rgb(var(--c-6f86a0));
}
.palette-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
}
.palette-group {
  margin: 8px 8px 4px;
  color: rgb(var(--c-8ba1b8));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.palette-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.palette-option.active {
  background: rgb(var(--c-3fd8ff) / 0.12);
  box-shadow: inset 2px 0 0 rgb(var(--c-3fd8ff));
}
.palette-label {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-detail {
  flex: none;
  max-width: 55%;
  overflow: hidden;
  color: rgb(var(--c-8ba1b8));
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-empty {
  margin: 12px 10px;
  color: rgb(var(--c-8ba1b8));
}
.palette-foot {
  margin: 0;
  padding: 8px 14px;
  border-top: 1px solid rgb(var(--c-78c8ff) / 0.12);
  color: rgb(var(--c-6f86a0));
  font-size: 12px;
}
@media (max-width: 760px) {
  .atlas-app[data-workspace='atlas'] .nav-search-wrap {
    flex: none;
    margin: 0 6px 0 0;
  }
  .atlas-app[data-workspace='atlas'] .nav-search.full-form {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
  }
  .atlas-app[data-workspace='atlas'] .nav-search.full-form .nav-search-label,
  .atlas-app[data-workspace='atlas'] .nav-search.full-form .nav-search-kbd {
    display: none;
  }
  .palette-backdrop {
    padding-top: 8vh;
  }
}
/* The top bar's controls stay on one line; with the menu hidden on a phone, the bubbles take a
   second row of their own rather than squeezing the badge, search and clock into a column. */
.atlas-app[data-workspace='atlas'] .os-clock {
  white-space: nowrap;
}
@media (max-width: 760px) {
  .atlas-app[data-workspace='atlas'] .atlas-workspace-bar {
    flex-wrap: nowrap;
    margin-top: 0;
  }
}
@media (max-width: 520px) {
  .atlas-app[data-workspace='atlas'].nav-hidden .atlas-header {
    flex-wrap: wrap;
  }
  .atlas-app[data-workspace='atlas'].nav-hidden .top-bubbles {
    margin-left: auto;
  }
}

/* --- The business in view, at the top of the left menu ---------------------------------------- */
.business-brand {
  min-height: 56px;
}
.business-brand-logo {
  display: block;
  max-width: 100%;
  max-height: 44px;
  object-fit: contain;
  object-position: left center;
  border-radius: var(--radius-md);
  background: var(--logo-plate);
}
/*
 * A tenant logo is white-lettering artwork drawn for a dark ground. On the light theme it sits
 * on a dark rounded plate rather than being inverted, so the artwork is never altered.
 */
:root[data-theme='light'] .business-brand-logo,
:root[data-theme='light'] .cust-brand-logo {
  padding: var(--space-1) var(--space-2);
  background: var(--logo-plate);
}
.business-brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgb(var(--c-3fd8ff)), rgb(var(--c-8b7bff)));
  color: rgb(var(--c-04101c));
  font-size: 14px;
  font-weight: 800;
}
.business-brand-name {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: rgb(var(--c-eaf4ff));
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.popover-link.as-button {
  width: 100%;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.business-logo-control .profile-status {
  padding: 0 10px;
}
@media (max-width: 760px) {
  /* On a phone the switcher's badge already names the business; only a real logo adds to it. */
  .atlas-app[data-workspace='atlas'] .business-brand:not(.has-logo) {
    display: none;
  }
  .atlas-app[data-workspace='atlas'] .business-brand {
    min-height: 0;
  }
  .atlas-app[data-workspace='atlas'] .business-brand-logo {
    max-width: 96px;
    max-height: 32px;
  }
}

/* --- Freeze ATLAS and sign out everywhere (freeze-controls.js) ------------------------------ */
.os-status.bad {
  border-color: rgb(var(--c-ff6b6b) / 0.5);
  color: rgb(var(--c-ffd0d0));
}
.os-status.bad .os-dot {
  background: var(--stop, rgb(var(--c-ff6b6b)));
  box-shadow: 0 0 8px rgb(var(--c-ff6b6b) / 0.7);
}
.freeze-card.is-frozen {
  border-color: rgb(var(--c-ff6b6b) / 0.45);
}
.freeze-controls {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.freeze-state {
  margin: 0;
  font-weight: 700;
}
.freeze-state.running {
  color: rgb(var(--c-c9f7e3));
}
.freeze-state.frozen {
  color: rgb(var(--c-ffb3b3));
}
.freeze-controls .rail-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-body);
  overflow-wrap: anywhere;
}
.freeze-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.freeze-button {
  display: inline-block;
  box-sizing: border-box;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.22);
  border-radius: 8px;
  background: rgb(var(--c-ffffff) / 0.04);
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.freeze-controls.compact .freeze-button {
  width: 100%;
}
.freeze-button:hover {
  border-color: rgb(var(--c-3fd8ff) / 0.55);
}
.freeze-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.freeze-button.danger {
  border-color: rgb(var(--c-ff6b6b) / 0.55);
  background: rgb(var(--c-ff6b6b) / 0.12);
  color: rgb(var(--c-ffd0d0));
  font-weight: 700;
}
.freeze-button.confirm {
  border-color: rgb(var(--c-3ddc97) / 0.5);
  color: rgb(var(--c-c9f7e3));
  font-weight: 700;
}
.freeze-button.quiet {
  color: var(--muted);
}
.freeze-input {
  box-sizing: border-box;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong, rgb(var(--c-78c8ff) / 0.22));
  border-radius: 8px;
  background: rgb(var(--c-000000) / 0.25);
  color: var(--text);
  font: inherit;
}
.freeze-status:empty {
  display: none;
}
.freeze-status {
  margin: 0;
  font-size: var(--type-body);
}
.freeze-status.tone-good {
  color: rgb(var(--c-3ddc97));
}
.freeze-status.tone-bad {
  color: rgb(var(--c-ff8a8a));
}
.freeze-status.tone-muted {
  color: var(--muted);
}
/* ==========================================================================================
 * Content Studio (content-studio.js): the Owner's approval queue, calendar, published list,
 * held posts and brand board for the business in context. Laid out like the CRM's social
 * planner where the two overlap; the colours are ATLAS status tokens.
 * ========================================================================================== */

/* The full-size viewer is shown in body, outside .cs (content-studio.js `placeViewer`). */
.cs,
.cs-viewer-backdrop {
  --cs-waiting: var(--gold, rgb(var(--c-f5c451)));
  --cs-scheduled: var(--cyan, rgb(var(--c-3fd8ff)));
  --cs-published: var(--ok, rgb(var(--c-3ddc97)));
  --cs-held: var(--stop, rgb(var(--c-ff6b6b)));
  --cs-with-david: var(--violet, rgb(var(--c-8b7bff)));
  --cs-rejected: var(--idle, rgb(var(--c-5f7187)));
}
.cs {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}
.cs button,
.cs-viewer-backdrop button {
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
}
.cs button[disabled],
.cs-viewer-backdrop button[disabled] {
  cursor: default;
  opacity: 0.55;
}
.cs-muted {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-small);
}
.cs-loading,
.cs-empty {
  margin: 0;
  padding: var(--space-5);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

/* ---- header: this week's numbers and the one call to action ---------------------------- */
.cs-head {
  display: grid;
  gap: var(--space-3);
}
.cs-head-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.cs-head-top > div {
  display: grid;
  gap: 6px;
  flex: 1 1 320px;
  min-width: 0;
}
.cs-kicker {
  margin: 0;
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-publishing {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  font-size: var(--type-body);
  line-height: 1.4;
  color: var(--text);
  background: rgb(var(--c-ffffff) / 0.02);
}
.cs-publishing.draft {
  border-color: rgb(var(--c-f5c451) / 0.35);
  background: rgb(var(--c-f5c451) / 0.07);
}
.cs-publishing.on {
  border-color: rgb(var(--c-3ddc97) / 0.3);
}
.cs-cta {
  flex: 0 0 auto;
  font-size: var(--type-base);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(var(--c-f5c451) / 0.6);
  background: linear-gradient(180deg, rgb(var(--c-f5c451)), rgb(var(--c-d9a634)));
  color: rgb(var(--c-1a1204));
  font-weight: 700;
  box-shadow: 0 6px 20px rgb(var(--c-f5c451) / 0.18);
}
.cs-cta.quiet {
  border-color: var(--line);
  background: rgb(var(--c-ffffff) / 0.04);
  color: var(--muted);
  box-shadow: none;
}
.cs-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}
.cs-stat {
  display: grid;
  font-size: var(--type-body);
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong, var(--line));
  background: var(--surface-card);
  color: var(--text);
  text-align: left;
}
.cs-stat-waiting {
  border-top-color: var(--cs-waiting);
}
.cs-stat-scheduled {
  border-top-color: var(--cs-scheduled);
}
.cs-stat-published {
  border-top-color: var(--cs-published);
}
.cs-stat-held {
  border-top-color: var(--cs-held);
}
.cs-stat-label {
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-stat strong {
  font-size: 26px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.cs-stat small {
  color: var(--muted);
  font-size: var(--type-small);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.cs-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  font-size: var(--type-body);
}
.cs-banner.good {
  border-color: rgb(var(--c-3ddc97) / 0.4);
  background: rgb(var(--c-3ddc97) / 0.08);
}
.cs-banner.warn {
  border-color: rgb(var(--c-ffb547) / 0.4);
  background: rgb(var(--c-ffb547) / 0.08);
}
.cs-banner.bad {
  border-color: rgb(var(--c-ff6b6b) / 0.45);
  background: rgb(var(--c-ff6b6b) / 0.08);
}
.cs-banner-close,
.cs-dialog-close {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

/* ---- problems and their one action ------------------------------------------------------ */
.cs-business-problems,
.cs-held-business {
  display: grid;
  gap: var(--space-2);
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgb(var(--c-ff6b6b) / 0.3);
  background: rgb(var(--c-ff6b6b) / 0.05);
}
.cs-held-business h3,
.cs-held h3,
.cs-brand-section h3 {
  margin: 0 0 6px;
  font-size: var(--type-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-problems {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-problems li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.cs-problems p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 260px;
  min-width: 0;
  margin: 0;
  font-size: var(--type-body);
  line-height: 1.4;
}
.cs-link {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong, var(--line));
  background: rgb(var(--c-3fd8ff) / 0.06);
  color: var(--cyan);
  font-size: var(--type-small);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.cs-link:hover {
  background: rgb(var(--c-3fd8ff) / 0.12);
}

/* ---- platform connections --------------------------------------------------------------- */
.cs-platforms {
  display: grid;
  gap: 8px;
}
.cs-platforms-title {
  margin: 0;
  font-size: var(--type-small);
  color: var(--muted);
}
.cs-platforms-title strong {
  color: var(--text);
}
.cs-platform-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-platform {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: var(--type-small);
  background: rgb(var(--c-ffffff) / 0.02);
}
.cs-platform-state {
  color: var(--muted);
}
.cs-platform.connected {
  border-color: rgb(var(--c-3ddc97) / 0.4);
}
.cs-platform.connected .cs-platform-state {
  color: var(--cs-published);
}
.cs-platform.needs-attention {
  border-color: rgb(var(--c-ffb547) / 0.45);
}
.cs-platform.not-connected .cs-pf,
.cs-platform.not-reported .cs-pf,
.cs-pf.cs-pf-held {
  filter: grayscale(1);
  opacity: 0.55;
}

/* Connecting platforms: one row per platform, its accounts beneath it. */
.cs-social-list,
.cs-social-accounts,
.cs-social-options {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-social-platform {
  display: grid;
  gap: 4px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--line);
  background: rgb(var(--c-ffffff) / 0.02);
  font-size: var(--type-small);
}
.cs-social-platform.connected {
  border-color: rgb(var(--c-3ddc97) / 0.4);
}
.cs-social-platform.connected .cs-platform-state {
  color: var(--cs-published);
}
.cs-social-platform.needs-reconnect {
  border-color: rgb(var(--c-ffb547) / 0.45);
}
.cs-social-platform.not-connected .cs-pf {
  filter: grayscale(1);
  opacity: 0.55;
}
.cs-social-head,
.cs-social-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cs-social-head > button {
  margin-left: auto;
}
.cs-social-accounts {
  padding-left: 34px;
}
.cs-social-picker {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--cyan);
  font-size: var(--type-small);
}
.cs-social-picker p {
  margin: 0;
}
.cs-social-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* On a phone the read-only marks drop their words; here the words are the only label. */
.cs-social-platform .cs-platform-name,
.cs-social-platform .cs-platform-state {
  display: inline;
}

/* Platform marks, in the platforms' own colours. */
.cs-pf {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: rgb(var(--c-ffffff));
  background: rgb(var(--c-3a4a5e));
}
.cs-pf-facebook {
  background: rgb(var(--c-1877f2));
}
.cs-pf-instagram {
  background: linear-gradient(
    135deg,
    rgb(var(--c-f58529)),
    rgb(var(--c-dd2a7b)) 55%,
    rgb(var(--c-8134af))
  );
}
.cs-pf-linkedin {
  background: rgb(var(--c-0a66c2));
}
.cs-pf-googleBusinessProfile {
  background: rgb(var(--c-34a853));
}
.cs-pf-tiktok {
  background: rgb(var(--c-111111));
  box-shadow: inset 0 0 0 1px rgb(var(--c-25f4ee));
}
.cs-pf-youtube {
  background: rgb(var(--c-ff0000));
}
.cs-pf-pinterest {
  background: rgb(var(--c-e60023));
}
.cs-pf-threads,
.cs-pf-x {
  background: rgb(var(--c-000000));
  box-shadow: inset 0 0 0 1px rgb(var(--c-ffffff) / 0.35);
}
.cs-pf-bluesky {
  background: rgb(var(--c-1185fe));
}

/* ---- tabs, filters, toolbar -------------------------------------------------------------- */
.cs-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.cs-tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: var(--type-base);
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.cs-tab.active {
  border-bottom-color: var(--cyan);
  color: var(--text);
}
.cs-view {
  min-width: 0;
}
.cs-overview {
  display: grid;
  gap: var(--space-4);
}
.cs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: var(--space-3);
}
.cs-filters,
.cs-row,
.cs-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cs-filter,
.cs-row > button:not(.cs-primary):not(.cs-danger):not(.cs-link),
.cs-nav {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgb(var(--c-ffffff) / 0.03);
  color: var(--text);
  font-size: var(--type-small);
}
.cs-filter.active {
  border-color: var(--cyan);
  background: rgb(var(--c-3fd8ff) / 0.12);
}
.cs-bulk label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--type-small);
  color: var(--muted);
}
.cs-primary,
.cs-danger {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--type-small);
  font-weight: 700;
}
.cs-primary {
  background: var(--cs-published);
  color: rgb(var(--c-04160d));
}
.cs-danger {
  background: rgb(var(--c-ff6b6b) / 0.16);
  border-color: rgb(var(--c-ff6b6b) / 0.5);
  color: rgb(var(--c-ffd2d2));
}
.cs-primary.unavailable {
  background: rgb(var(--c-ffffff) / 0.06);
  color: var(--muted);
}

/* ---- the approval queue: one card per post ---------------------------------------------- */
.cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--space-4);
  align-items: start;
}
.cs-week-strip {
  display: grid;
  gap: 10px;
  margin-bottom: var(--space-4);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}
.cs-week-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cs-week-strip h2 {
  margin: 0;
  font-size: var(--type-base);
}
.cs-week-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cs-week-day {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(var(--c-ffffff) / 0.03);
  color: var(--text);
}
.cs-week-day > span:first-child {
  color: var(--muted);
  font-size: var(--type-micro);
  text-transform: uppercase;
}
.cs-week-day.today {
  border-color: var(--cyan);
  background: rgb(var(--c-3fd8ff) / 0.1);
}
.cs-week-dots {
  display: flex;
  justify-content: center;
  gap: 2px;
  min-height: 8px;
}
.cs-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong, var(--line));
  background: var(--surface-card);
}
.cs-card.busy {
  opacity: 0.6;
}
.cs-card-waiting {
  border-left-color: var(--cs-waiting);
}
.cs-card-scheduled {
  border-left-color: var(--cs-scheduled);
}
.cs-card-published {
  border-left-color: var(--cs-published);
}
.cs-card-held {
  border-left-color: var(--cs-held);
}
.cs-card-with-david {
  border-left-color: var(--cs-with-david);
}
.cs-card-rejected {
  border-left-color: var(--cs-rejected);
}
.cs-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.cs-card-platforms {
  display: inline-flex;
  gap: 3px;
}
.cs-when {
  margin-left: auto;
  font-size: var(--type-small);
  color: var(--muted);
  white-space: nowrap;
}
.cs-status,
.cs-tag {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.cs-tag {
  border: 1px solid var(--line-strong, var(--line));
  color: var(--muted);
}
.cs-status-waiting {
  background: rgb(var(--c-f5c451) / 0.16);
  color: var(--cs-waiting);
}
.cs-status-scheduled {
  background: rgb(var(--c-3fd8ff) / 0.14);
  color: var(--cs-scheduled);
}
.cs-status-published {
  background: rgb(var(--c-3ddc97) / 0.14);
  color: var(--cs-published);
}
.cs-status-held {
  background: rgb(var(--c-ff6b6b) / 0.14);
  color: var(--cs-held);
}
.cs-status-with-david {
  background: rgb(var(--c-8b7bff) / 0.16);
  color: var(--cs-with-david);
}
.cs-status-rejected {
  background: rgb(var(--c-5f7187) / 0.2);
  color: rgb(var(--c-a9b6c6));
}
.cs-media {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--ink);
  aspect-ratio: 16 / 9;
  --ratio: 1.7778;
}
/* Each ratio its own box; the inline style carries the media's exact ratio. */
.cs-media.square {
  aspect-ratio: 1 / 1;
  --ratio: 1;
}
.cs-media.portrait {
  aspect-ratio: 4 / 5;
  --ratio: 0.8;
}
.cs-media.tall {
  aspect-ratio: 9 / 16;
  --ratio: 0.5625;
}
/*
 * In a card the preview keeps its true shape and is capped by height: the box narrows rather
 * than the picture being cut, so the headline, the logo and the call to action stay in view.
 */
.cs-card .cs-media {
  width: min(100%, calc(320px * var(--ratio)));
  margin-inline: auto;
}
.cs-media-open {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--ink);
  cursor: zoom-in;
}
.cs-media-open:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}
.cs-media img,
.cs-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--ink);
}
.cs-media-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgb(var(--c-000000) / 0.6);
  color: rgb(var(--c-ffffff));
  font-size: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cs-full-preview {
  justify-self: start;
  font-size: var(--type-small);
}
.cs-media.empty {
  align-content: center;
  gap: 4px;
  padding: 12px;
  text-align: center;
}
.cs-media-kind {
  font-size: var(--type-small);
  font-weight: 700;
  color: var(--text);
}
.cs-media:not(.empty) .cs-media-kind {
  position: absolute;
  z-index: 1;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgb(var(--c-000000) / 0.6);
  font-size: var(--type-micro);
  pointer-events: none;
}
.cs-media small {
  max-width: 34ch;
  color: var(--muted);
  font-size: var(--type-micro);
}
.cs-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cs-version {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font-size: var(--type-micro);
}
.cs-version.active {
  border-color: var(--cyan);
  color: var(--text);
}
.cs-headline {
  margin: 0;
  font-weight: 700;
  font-size: var(--type-base);
  overflow-wrap: anywhere;
}
.cs-caption {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: var(--type-body);
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}
.cs-caption.short {
  color: var(--muted);
  -webkit-line-clamp: 2;
}
.cs-cta-line {
  margin: 0;
  font-size: var(--type-small);
  color: var(--muted);
}
.cs-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0;
  font-size: var(--type-small);
}
.cs-meta dt {
  color: var(--muted);
}
.cs-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.cs-live {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--type-small);
}
/* "Make the held ones again": one row per week, then what each request came back with. */
.cs-anyway {
  display: grid;
  gap: 4px;
}
.cs-held-again {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.cs-live li,
.cs-held-post,
.cs-published-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cs-live a {
  color: var(--cyan);
}
.cs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.cs-action {
  flex: 1 1 auto;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgb(var(--c-ffffff) / 0.03);
  color: var(--text);
  font-size: var(--type-small);
  font-weight: 600;
}
.cs-action.primary {
  background: var(--cs-published);
  border-color: transparent;
  color: rgb(var(--c-04160d));
}
.cs-action.danger {
  border-color: rgb(var(--c-ff6b6b) / 0.45);
  color: rgb(var(--c-ffb3b3));
}
.cs-action.unavailable {
  border-style: dashed;
  background: none;
  color: var(--muted);
}
.cs-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong, var(--line));
  background: rgb(var(--c-000000) / 0.25);
}
.cs-panel p {
  margin: 0;
  font-size: var(--type-small);
  line-height: 1.4;
}
.cs-field {
  display: grid;
  gap: 4px;
  font-size: var(--type-small);
  color: var(--muted);
}
.cs-panel textarea,
.cs-panel input[type='date'] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong, var(--line));
  background: rgb(var(--c-060a10));
  color: var(--text);
  font: inherit;
  font-size: var(--type-body);
  color-scheme: inherit;
}
.cs-choices {
  display: grid;
  gap: 6px;
  font-size: var(--type-small);
}
.cs-choices label,
.cs-edit-keep {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cs-edit-version {
  display: grid;
  gap: 6px;
}
.cs-note {
  margin: 0;
  font-size: var(--type-small);
  line-height: 1.4;
}
.cs-note:empty {
  display: none;
}
.cs-note.bad {
  color: rgb(var(--c-ffb3b3));
}
.cs-note.muted {
  color: var(--muted);
}

/* ---- calendar ------------------------------------------------------------------------------ */
.cs-cal-title {
  margin-left: 6px;
  font-size: var(--type-base);
}
.cs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
  font-size: var(--type-small);
  color: var(--muted);
}
.cs-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cs-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
}
.cs-dot.cs-status-waiting {
  background: var(--cs-waiting);
}
.cs-dot.cs-status-scheduled {
  background: var(--cs-scheduled);
}
.cs-dot.cs-status-published {
  background: var(--cs-published);
}
.cs-dot.cs-status-held {
  background: var(--cs-held);
}
.cs-dot.cs-status-with-david {
  background: var(--cs-with-david);
}
.cs-dot.cs-status-rejected {
  background: var(--cs-rejected);
}
.cs-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.cs-cal-weekday {
  padding: 6px 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-cal-day {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 120px;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cs-calendar[data-mode='month'] .cs-cal-day {
  min-height: 96px;
}
.cs-cal-day.today {
  background: rgb(var(--c-3fd8ff) / 0.06);
}
.cs-cal-day.outside {
  opacity: 0.45;
}
.cs-cal-date {
  font-size: var(--type-micro);
  font-weight: 700;
  color: var(--muted);
}
.cs-cal-day.today .cs-cal-date {
  color: var(--cyan);
}
.cs-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong, var(--line));
  background: rgb(var(--c-ffffff) / 0.03);
  color: var(--text);
  font-size: var(--type-micro);
  text-align: left;
}
.cs-chip-waiting {
  border-left-color: var(--cs-waiting);
}
.cs-chip-scheduled {
  border-left-color: var(--cs-scheduled);
}
.cs-chip-published {
  border-left-color: var(--cs-published);
}
.cs-chip-held {
  border-left-color: var(--cs-held);
}
.cs-chip-with-david {
  border-left-color: var(--cs-with-david);
}
.cs-chip-time {
  flex: 0 0 auto;
  color: var(--muted);
}
.cs-chip-platforms {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 1px;
}
.cs-chip-platforms .cs-pf {
  width: 14px;
  height: 14px;
  font-size: 7px;
}
.cs-chip-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A week has room to read: time and platforms on one line, the first words of the post below. */
.cs-calendar[data-mode='week'] .cs-chip {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 3px;
  padding: 6px;
}
.cs-calendar[data-mode='week'] .cs-chip-text {
  display: -webkit-box;
  flex-basis: 100%;
  white-space: normal;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* ---- published, held, brand -------------------------------------------------------------- */
.cs-published,
.cs-held-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-published-row {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.cs-published-body {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
  font-size: var(--type-small);
}
.cs-held {
  display: grid;
  gap: var(--space-4);
}
.cs-held-list > li {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cs-held);
  background: var(--surface-card);
}
.cs-held-post {
  flex-wrap: wrap;
  font-size: var(--type-small);
}
.cs-held-post .cs-caption {
  flex: 1 1 100%;
}
.cs-brand {
  display: grid;
  gap: var(--space-3);
}
.cs-brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: var(--space-3);
}
.cs-brand-section {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.cs-brand-section ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 16px;
  font-size: var(--type-small);
  overflow-wrap: anywhere;
}
.cs-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin-left: -16px;
}
.cs-swatch-chip {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgb(var(--c-ffffff) / 0.2);
}
.cs-gap {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.cs-gap h2 {
  margin: 0;
  font-size: var(--type-lg);
}
.cs-gap p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

/* ---- the post dialog (from the calendar) ------------------------------------------------ */
.cs-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(var(--c-02050a) / 0.72);
}
.cs-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: var(--surface, rgb(var(--c-0a111c)));
}
.cs-dialog-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 1;
}

@media (max-width: 1100px) {
  .cs-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  /* Five small numbers on a phone: the hints live on the tabs they lead to. */
  .cs-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .cs-stat {
    padding: 8px 10px;
  }
  .cs-stat small {
    display: none;
  }
  .cs-stat-label {
    font-size: 9px;
    letter-spacing: 0.06em;
  }
  .cs-cta {
    width: 100%;
  }
  .cs-stat strong {
    font-size: 20px;
  }
  /* A seven-column month does not fit a phone: the calendar becomes a list of days. */
  .cs-cal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .cs-cal-weekday {
    display: none;
  }
  .cs-cal-day,
  .cs-calendar[data-mode='month'] .cs-cal-day {
    min-height: 0;
  }
  .cs-calendar[data-mode='month'] .cs-cal-day.empty {
    display: none;
  }
  .cs-when {
    margin-left: 0;
    flex-basis: 100%;
  }
  /* The ten platforms as one row of marks; the state is the ring, the words are in the title. */
  .cs-platform {
    padding: 2px;
  }
  .cs-platform-name,
  .cs-platform-state {
    display: none;
  }
  .cs-platform.connected {
    box-shadow: 0 0 0 1px var(--cs-published);
  }
  .cs-published-row {
    flex-wrap: wrap;
  }
}

/* ---- analytics ---------------------------------------------------------------------------- */
.cs-analytics {
  display: grid;
  gap: var(--space-4);
}
.cs-collecting {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed rgb(var(--c-3fd8ff) / 0.35);
  background: rgb(var(--c-3fd8ff) / 0.05);
  color: var(--text);
  font-size: var(--type-body);
  line-height: 1.45;
}
.cs-variety {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-3);
}
.cs-variety > div,
.cs-table-wrap {
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.cs-variety h3,
.cs-table-wrap h3 {
  margin: 0 0 8px;
  font-size: var(--type-small);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.cs-table-wrap .cs-toolbar h3 {
  margin: 0;
}
.cs-variety ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-variety li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: var(--type-small);
}
.cs-variety strong {
  font-variant-numeric: tabular-nums;
}
.cs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-small);
}
.cs-table th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line-strong, var(--line));
  color: var(--muted);
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.cs-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
.cs-table td .cs-pf {
  vertical-align: middle;
}
.cs-table a {
  color: var(--text);
}
.cs-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cs-num.unmeasured {
  color: var(--muted);
}
.cs-boost {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: rgb(var(--c-f5c451) / 0.16);
  color: var(--cs-waiting);
  font-size: var(--type-micro);
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 760px) {
  /* A nine-column table does not fit a phone: each row becomes a small card. */
  .cs-table thead {
    display: none;
  }
  .cs-table,
  .cs-table tbody,
  .cs-table tr,
  .cs-table td {
    display: block;
    width: 100%;
  }
  .cs-table tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .cs-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    border: 0;
    text-align: right;
  }
  .cs-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    text-align: left;
  }
}

/* --- Fixes, 24 Sep: the Needs-you bubble panel and the centered business logo ------------------ */
/* The panel's grid sized its track to the longest line of text (min-width: auto), so cards were
   wider than the popover and every sentence ran off its edge behind a sideways scrollbar. */
.atlas-popover.popover-needs {
  width: min(420px, calc(100vw - 24px));
  overflow-x: hidden;
}
.bubble-panel,
.bubble-panel .needs-you,
.bubble-panel .needs-you-item {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.bubble-panel .needs-you * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.bubble-panel.needs-panel li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.bubble-panel.needs-panel ul {
  padding-inline-start: 18px;
}
/* The business logo sits centered in the top of the left menu, as in the CRM. */
.business-brand.has-logo {
  justify-content: center;
}
.business-brand-logo {
  margin-inline: auto;
  object-position: center center;
}

/* ==========================================================================================
 * The business owner's console (customer-console.js): a customer signed in with Google or
 * email sees their own business and nothing else. Its own frame, so none of the Owner's layout
 * rules apply; the palette is the ATLAS workspace's.
 * ========================================================================================== */

.atlas-app[data-workspace='customer'] {
  display: block;
  min-height: 100vh;
  background: rgb(var(--c-05080e));
}
body:has(.atlas-app[data-workspace='customer']) {
  background: rgb(var(--c-05080e));
}
.cust-app {
  --ink: #05080e;
  --surface: #0a111c;
  --surface2: #0e1726;
  --line: rgba(120, 200, 255, 0.12);
  --line-strong: rgba(120, 200, 255, 0.22);
  --text: #eaf4ff;
  --muted: #8ba1b8;
  --cyan: #3fd8ff;
  --violet: #8b7bff;
  --gold: #f5c451;
  --ok: #3ddc97;
  --warn: #ffb547;
  --stop: #ff6b6b;
  --idle: #5f7187;
  --surface-card: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(
      1200px 600px at 78% -10%,
      rgb(var(--c-3fd8ff) / 0.07),
      transparent 60%
    ),
    radial-gradient(900px 500px at -10% 110%, rgb(var(--c-8b7bff) / 0.06), transparent 60%),
    var(--ink);
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  overflow-x: hidden;
}
:root[data-theme='light'] .cust-app {
  --ink: #f1f4fa;
  --surface: #e3eaf5;
  --surface2: #d9e2f1;
  --line: rgba(0, 113, 191, 0.12);
  --line-strong: rgba(0, 113, 191, 0.22);
  --text: #000c1a;
  --muted: #475d74;
  --cyan: #007796;
  --violet: #634dff;
  --gold: #8b6408;
  --ok: #177e51;
  --warn: #9e5e00;
  --stop: #db0000;
  --idle: #5c6e83;
  --surface-card: linear-gradient(180deg, rgba(13, 13, 13, 0.04), rgba(13, 13, 13, 0.012));
}
.cust-top {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgb(var(--c-070c14) / 0.88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 5;
  min-width: 0;
}
.cust-wordmark {
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--cyan);
  font-size: 15px;
  flex: none;
}
.cust-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  flex: 1 1 auto;
}
.cust-brand-logo {
  height: 36px;
  max-width: 120px;
  object-fit: contain;
  border-radius: 8px;
  background: rgb(var(--c-ffffff) / 0.04);
  flex: none;
}
.cust-brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgb(var(--c-3fd8ff) / 0.25), rgb(var(--c-8b7bff) / 0.25));
  border: 1px solid var(--line-strong);
  font-weight: 800;
  font-size: 13px;
  flex: none;
}
.cust-brand-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cust-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.cust-switch-label {
  color: var(--muted);
  font-size: var(--type-small);
}
.cust-switch select {
  min-width: 0;
  max-width: 320px;
  width: 100%;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}
.cust-switch select option {
  background: rgb(var(--c-0e1726));
  color: rgb(var(--c-eaf4ff));
}
.cust-profile {
  position: relative;
  flex: none;
  margin-left: auto;
}
.cust-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, rgb(var(--c-3fd8ff) / 0.3), rgb(var(--c-8b7bff) / 0.3));
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}
.cust-menu {
  position: absolute;
  right: 0;
  top: 48px;
  width: min(280px, calc(100vw - 32px));
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgb(var(--c-0c1522));
  box-shadow: 0 18px 50px rgb(var(--c-000000) / 0.5);
  z-index: 10;
}
.cust-menu p {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.cust-menu-name {
  font-weight: 700;
}
.cust-menu-email,
.cust-menu-role {
  color: var(--muted);
  font-size: var(--type-body);
}
.cust-signout {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.cust-rail {
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  background: rgb(var(--c-070c14) / 0.6);
}
.cust-nav {
  display: grid;
  gap: 4px;
}
.cust-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: var(--type-base);
  font-weight: 600;
}
.cust-link.active,
.cust-link:hover {
  color: var(--text);
  background: rgb(var(--c-3fd8ff) / 0.08);
}
.cust-link.active {
  box-shadow: inset 2px 0 0 var(--cyan);
}
.cust-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.cust-main {
  min-width: 0;
  padding: 24px 28px 48px;
}
.cust-room {
  display: grid;
  gap: 18px;
  max-width: 1100px;
  min-width: 0;
}
.cust-hero h1 {
  margin: 2px 0 6px;
  font-size: 28px;
  line-height: 1.2;
}
.cust-hero.compact h1 {
  font-size: 23px;
}
.cust-eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: var(--type-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cust-lede,
.cust-muted {
  color: var(--muted);
  margin: 0;
}
.cust-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.cust-tile {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.cust-tile:hover {
  border-color: var(--line-strong);
}
.cust-tile-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--gold);
}
.cust-tile-label {
  font-weight: 700;
}
.cust-tile-note {
  color: var(--muted);
  font-size: var(--type-body);
}
.cust-card {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  min-width: 0;
}
.cust-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}
.cust-card p {
  margin: 0 0 10px;
  line-height: 1.55;
}
.cust-button {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgb(var(--c-3fd8ff) / 0.5);
  background: rgb(var(--c-3fd8ff) / 0.14);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.cust-button[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.cust-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgb(var(--c-ff6b6b) / 0.4);
  background: rgb(var(--c-ff6b6b) / 0.08);
  color: rgb(var(--c-ffb4b4));
}
.cust-david {
  max-width: 820px;
}
.cust-chat-log {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 240px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgb(var(--c-ffffff) / 0.02);
}
.cust-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.cust-bubble p {
  margin: 0 0 6px;
}
.cust-bubble p:last-child {
  margin-bottom: 0;
}
.cust-bubble.you {
  justify-self: end;
  background: rgb(var(--c-3fd8ff) / 0.14);
  border: 1px solid rgb(var(--c-3fd8ff) / 0.3);
}
.cust-bubble.david {
  justify-self: start;
  background: rgb(var(--c-8b7bff) / 0.1);
  border: 1px solid rgb(var(--c-8b7bff) / 0.28);
}
.cust-bubble-who {
  display: block;
  font-size: var(--type-small);
  color: var(--violet);
  font-weight: 700;
  margin-bottom: 2px;
}
.cust-chat-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.cust-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
}
.cust-app .cs {
  min-width: 0;
}
@media (max-width: 760px) {
  .cust-app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56px auto minmax(0, 1fr);
  }
  .cust-top {
    grid-column: 1;
    padding: 0 16px;
    gap: 10px;
  }
  .cust-wordmark {
    display: none;
  }
  .cust-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 16px;
    position: sticky;
    top: 56px;
    z-index: 4;
    background: rgb(var(--c-070c14) / 0.94);
  }
  .cust-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cust-link {
    justify-content: center;
    padding: 8px 6px;
    font-size: var(--type-body);
    gap: 6px;
  }
  .cust-link.active {
    box-shadow: inset 0 -2px 0 var(--cyan);
  }
  .cust-link .cust-icon {
    display: none;
  }
  .cust-link span {
    white-space: nowrap;
  }
  .cust-main {
    padding: 18px 16px 40px;
  }
  .cust-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .cust-hero h1 {
    font-size: 23px;
  }
  .cust-bubble {
    max-width: 92%;
  }
}

/* Verify CRM writes (capability-verification.js, ATLAS-2684): the ATLAS Owner's card. */
.cv {
  margin-top: 18px;
}
.cv-confirm {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgb(var(--c-3fd8ff) / 0.5);
}
.cv-confirm p {
  margin: 0;
}
.cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cv-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.cv-list li.cv-ok strong {
  color: var(--ok, var(--text));
}
.cv-list li.cv-no strong {
  color: var(--danger, var(--text));
}
.cv-list li.cv-idle strong {
  color: var(--muted);
}

/* Users & Roles (users-roles.js): the Owner invites the people who run each business. */
.ur {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.ur-invite,
.ur-business {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  min-width: 0;
}
.ur-invite h2,
.ur-business h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.ur-help,
.ur-sub {
  color: var(--muted);
  font-size: var(--type-body);
  margin: 0 0 10px;
}
.ur-sub {
  display: block;
  margin: 2px 0 0;
}
/* "Waiting on you": what David wrote is labelled, so it never passes for ALFA's own words. */
.owner-item-from {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.ur-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.ur-field {
  display: grid;
  gap: 4px;
  font-size: var(--type-body);
  color: var(--muted);
  min-width: 0;
}
.ur-field input,
.ur-field select,
.ur-table select {
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong, var(--line));
  background: var(--surface2, rgb(var(--c-0e1726)));
  color: var(--text);
  font: inherit;
}
.ur-field select option,
.ur-table select option {
  background: rgb(var(--c-0e1726));
  color: rgb(var(--c-eaf4ff));
}
.ur-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  font-size: var(--type-body);
}
.ur-primary,
.ur-secondary,
.ur-danger {
  padding: 9px 14px;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}
.ur-primary {
  border: 1px solid rgb(var(--c-3fd8ff) / 0.5);
  background: rgb(var(--c-3fd8ff) / 0.14);
}
.ur-secondary {
  border: 1px solid var(--line-strong, var(--line));
  background: transparent;
}
.ur-danger {
  border: 1px solid rgb(var(--c-ff6b6b) / 0.5);
  background: rgb(var(--c-ff6b6b) / 0.14);
}
.ur-list {
  display: grid;
  gap: 14px;
}
.ur-table-wrap {
  overflow-x: auto;
}
.ur-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-body);
}
.ur-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.ur-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ur-removed td {
  opacity: 0.55;
}
.ur-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--type-small);
  font-weight: 700;
}
.ur-status-active {
  color: var(--ok, rgb(var(--c-3ddc97)));
  background: rgb(var(--c-3ddc97) / 0.12);
}
.ur-status-invited {
  color: var(--gold, rgb(var(--c-f5c451)));
  background: rgb(var(--c-f5c451) / 0.12);
}
.ur-status-removed {
  color: var(--muted);
  background: rgb(var(--c-ffffff) / 0.06);
}
.ur-error,
.ur-notice {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
}
.ur-error {
  border: 1px solid rgb(var(--c-ff6b6b) / 0.4);
  background: rgb(var(--c-ff6b6b) / 0.08);
  color: rgb(var(--c-ffb4b4));
}
.ur-notice {
  border: 1px solid rgb(var(--c-3ddc97) / 0.4);
  background: rgb(var(--c-3ddc97) / 0.08);
}
/* Calls (voice-calls.js): David's phone calls, drawn with the Users & Roles pieces. */
.voice-call-row {
  cursor: pointer;
}
.voice-call-row:hover td,
.voice-call-open td {
  background: rgb(var(--c-3fd8ff) / 0.06);
}
.voice-call-row:focus-visible {
  outline: 2px solid rgb(var(--c-3fd8ff) / 0.6);
  outline-offset: -2px;
}
.voice-sample-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.voice-sample {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.voice-sample audio {
  width: 100%;
}
.voice-call-turns {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.voice-turn {
  display: grid;
  gap: 4px;
  max-width: min(80%, 640px);
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: var(--type-body);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.voice-turn-caller {
  justify-self: start;
  background: rgb(var(--c-ffffff) / 0.04);
  border-bottom-left-radius: 4px;
}
.voice-turn-david {
  justify-self: end;
  background: rgb(var(--c-3fd8ff) / 0.12);
  border-color: rgb(var(--c-3fd8ff) / 0.35);
  border-bottom-right-radius: 4px;
}
.voice-turn-who {
  color: var(--muted);
  font-size: var(--type-small);
  font-weight: 700;
}
@media (max-width: 640px) {
  /* Call-history columns on a phone: tighter cells, with horizontal wrapping as needed. */
  [data-voice-calls] .ur-table th,
  [data-voice-calls] .ur-table td {
    padding: 8px 4px;
    font-size: var(--type-small);
    overflow-wrap: anywhere;
  }
  .voice-turn {
    max-width: 92%;
  }
}
/* Money room (money-room.js): totals as figures, and a table that scrolls inside its own frame
   instead of pushing the page sideways on a phone. */
.money-room > * {
  min-width: 0;
}
.money-room > button {
  justify-self: start;
}
.money-totals dl {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin: 0;
}
.money-totals dt {
  color: var(--muted);
  font-size: var(--type-small);
}
.money-totals dd {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.money-room .ur-table th,
.money-room .ur-table td {
  white-space: nowrap;
}
.money-room .ur-table td[data-label='Contact'] {
  min-width: 140px;
  white-space: normal;
}
.money-actions > button + button {
  margin-left: 6px;
}
/* Waiting on owners: the add form's button sits clear of the fields above it. */
.owners-punch-add > .ur-primary {
  margin-top: 12px;
}
/* Prospect Intelligence controls (prospect-room.js): cards, not wide tables, so every tab reads
   the same on a phone as on a desk. */
.pi-room,
.pi-view {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.pi-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pi-review-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.pi-review-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-card);
}
.pi-review-tools .ur-field {
  align-content: start;
}
.pi-review-tools input,
.pi-review-tools select {
  width: 100%;
}
.pi-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  min-width: 0;
}
.pi-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.pi-card-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pi-card-title strong {
  display: block;
  font-size: 16px;
}
.pi-tick {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--cyan);
}
.pi-status {
  flex: none;
  color: var(--muted);
  background: rgb(var(--c-ffffff) / 0.06);
}
.pi-status.pi-ok {
  color: var(--ok, rgb(var(--c-3ddc97)));
  background: rgb(var(--c-3ddc97) / 0.12);
}
.pi-status.pi-warn {
  color: var(--gold, rgb(var(--c-f5c451)));
  background: rgb(var(--c-f5c451) / 0.12);
}
.pi-status.pi-stop {
  color: var(--stop, rgb(var(--c-ff6b6b)));
  background: rgb(var(--c-ff6b6b) / 0.12);
}
.pi-score {
  min-width: 52px;
  text-align: center;
  font-weight: 800;
  color: var(--text);
}
.pi-score-a {
  color: var(--ok, rgb(var(--c-3ddc97)));
  background: rgb(var(--c-3ddc97) / 0.12);
}
.pi-score-b {
  color: var(--gold, rgb(var(--c-f5c451)));
  background: rgb(var(--c-f5c451) / 0.12);
}
.pi-score-c {
  color: var(--muted);
}
.pi-why,
.pi-held,
.pi-result {
  margin: 0;
  font-size: var(--type-body);
  overflow-wrap: anywhere;
}
.pi-review-list .pi-why {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pi-more {
  color: var(--muted);
  font-size: var(--type-small);
}
.pi-more summary {
  width: max-content;
  color: var(--cyan);
  cursor: pointer;
}
.pi-more p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: var(--type-body);
}
.pi-held,
.pi-result.pi-warn {
  color: var(--gold, rgb(var(--c-f5c451)));
}
.pi-result.pi-ok {
  color: var(--ok, rgb(var(--c-3ddc97)));
}
.pi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pi-chips li {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--type-small);
}
.pi-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 14px;
  margin: 0;
  font-size: var(--type-body);
}
.pi-facts dt {
  color: var(--muted);
}
.pi-facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pi-facts a {
  color: var(--cyan);
}
.pi-facts-wide {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  gap: 8px 18px;
}
.pi-actions,
.pi-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pi-searches .ur-table th,
.pi-searches .ur-table td {
  padding: 9px 10px;
  vertical-align: top;
}
.pi-searches .ur-table td:nth-child(5) {
  min-width: 210px;
}
.pi-searches .pi-actions {
  flex-wrap: nowrap;
}
.pi-metric-filter {
  width: 100%;
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pi-metric-filter:hover {
  border-color: var(--cyan);
}
.pi-metric-filter:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.pi-bulk .ur-help {
  flex: 1 1 220px;
  margin: 0;
}
.pi-room button:disabled {
  opacity: 0.5;
  cursor: default;
}
.pi-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--type-body);
}
.pi-inline select,
.pi-results-controls select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong, var(--line));
  background: var(--surface2, rgb(var(--c-0e1726)));
  color: var(--text);
  font: inherit;
}
.pi-inline select option,
.pi-results-controls select option {
  background: rgb(var(--c-0e1726));
  color: rgb(var(--c-eaf4ff));
}
.pi-form {
  display: grid;
  gap: 12px;
}
/* Fields with and without a hint share a row: each keeps its own height, from the top. */
.pi-form .ur-field,
.pi-reject .ur-field {
  align-content: start;
}
.pi-form .ur-primary {
  justify-self: start;
}
.pi-field-help {
  color: var(--muted);
  font-size: var(--type-small);
}
.pi-reject {
  display: grid;
  gap: 10px;
}
.os-metric strong.pi-hours {
  font-size: 18px;
}
.pi-sentences {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 16px 18px 16px 34px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  font-size: var(--type-body);
}
.pi-results th[scope='row'] {
  white-space: nowrap;
}
.pi-results td {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pi-results tfoot th,
.pi-results tfoot td {
  font-weight: 700;
  border-bottom: 0;
}
@media (max-width: 520px) {
  .pi-review-list,
  .pi-review-tools {
    grid-template-columns: minmax(0, 1fr);
  }
  .pi-card {
    padding: 14px;
  }
  .pi-card-head {
    flex-wrap: wrap;
  }
  .pi-facts-wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .pi-facts-wide dd {
    margin-bottom: 8px;
  }
  .pi-actions > button,
  .pi-bulk > button {
    flex: 1 1 140px;
  }
}

/* Onboard a business: the checklist above Users & Roles, drawn with the same pieces. */
.ao {
  margin-bottom: 24px;
}
.ao-notes {
  width: 100%;
  min-width: 180px;
  font: inherit;
  color: inherit;
  background: rgb(var(--c-ffffff) / 0.04);
  border: 1px solid rgb(var(--c-ffffff) / 0.12);
  border-radius: 8px;
  padding: 6px 8px;
}
.ao-automation-automated {
  color: rgb(var(--c-3ddc97));
  background: rgb(var(--c-3ddc97) / 0.12);
}
.ao-automation-manual {
  color: rgb(var(--c-ffd166));
  background: rgb(var(--c-ffd166) / 0.12);
}
.ao-automation-not_built {
  color: var(--muted);
  background: rgb(var(--c-ffffff) / 0.06);
}

/* ==========================================================================================
 * Login As (the ATLAS Owner acting as one of his users) and everyone's own profile picture.
 * The banner is sticky at the very top of the page, in both consoles, and the sticky header
 * and menu below it move down by its height so nothing slides underneath it.
 * ======================================================================================== */
html.login-as-on {
  --login-as-h: 40px;
}
.login-as-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--login-as-h, 40px);
  padding: 0 16px;
  background: linear-gradient(90deg, rgb(var(--c-5a3d00)), rgb(var(--c-6b4a00)));
  border-bottom: 1px solid rgb(var(--c-f5c451) / 0.55);
  color: rgb(var(--c-fff4d6));
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: 14px;
}
.login-as-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.login-as-clock {
  flex: none;
  color: rgb(var(--c-f5c451));
  font-variant-numeric: tabular-nums;
}
.login-as-return {
  flex: none;
  padding: 5px 12px;
  border: 1px solid rgb(var(--c-fff4d6) / 0.6);
  border-radius: 999px;
  background: rgb(var(--c-fff4d6));
  color: rgb(var(--c-3a2700));
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.login-as-return:disabled {
  opacity: 0.7;
  cursor: progress;
}
html.login-as-on .atlas-app,
html.login-as-on .cust-app {
  min-height: calc(100vh - var(--login-as-h));
}
/* Only the Owner's header: the customer console (.cust-app, overflow-x hidden) is its own sticky
 * container and already starts below the banner, so its top bar needs no offset. */
html.login-as-on .atlas-header {
  top: var(--login-as-h);
}
html.login-as-on .atlas-app[data-workspace='atlas'] .atlas-nav {
  top: var(--login-as-h);
  height: calc(100vh - var(--login-as-h));
}
@media (max-width: 760px) {
  /* On a phone the menu is a row of tabs, not a column: it only moves down, it never grows. */
  html.login-as-on .atlas-app[data-workspace='atlas'] .atlas-nav {
    height: auto;
  }
}
@media (max-width: 560px) {
  .login-as-banner {
    gap: 8px;
    padding: 0 10px;
    font-size: 13px;
  }
  .login-as-clock {
    display: none;
  }
}

/* Login As in the Owner's profile menu: one real button per person and business. The list
 * scrolls on its own, so however many people there are, Sign out stays in view below it. */
.atlas-popover[data-popover='profile'] {
  max-height: min(calc(100vh - 88px), 720px);
}
.login-as-list {
  max-height: 216px;
  overflow-y: auto;
}
.login-as-list li {
  display: block;
}
.login-as-body > .rail-note {
  margin: 6px 0 0;
}
.atlas-popover .login-as-target,
.login-as-target {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.18);
  border-radius: 10px;
  background: rgb(var(--c-3fd8ff) / 0.05);
  color: rgb(var(--c-eaf4ff));
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.login-as-target:hover,
.login-as-target:focus-visible {
  border-color: rgb(var(--c-3fd8ff) / 0.55);
  background: rgb(var(--c-3fd8ff) / 0.1);
}
.login-as-target strong {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.login-as-target small {
  color: rgb(var(--c-8ba1b8));
  font-size: 13px;
  font-weight: 400;
}

/* A customer's own picture in their profile circle, and the controls to change it. */
.cust-avatar {
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
}
.cust-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.cust-menu-action {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgb(var(--c-3fd8ff) / 0.06);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.cust-menu-action + .cust-signout,
.cust-menu-note + .cust-signout {
  margin-top: 8px;
}
.cust-menu .cust-menu-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--type-small);
}

/* ==========================================================================================
 * Content Studio with ATLAS's own engine (content-studio.js): each post as its platform shows
 * it, carousels and video storyboards, the media library, the weekly delivery check, the
 * editable brand board and the engine panel. Appended; nothing above is changed.
 * ========================================================================================== */

/* Nine views: every tab stays in sight, on as many rows as it takes, instead of scrolling away. */
.cs-tabs {
  flex-wrap: wrap;
  overflow-x: visible;
}
.cs-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cs-secondary {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(var(--c-3fd8ff) / 0.45);
  background: rgb(var(--c-3fd8ff) / 0.1);
  color: var(--text);
  font-size: var(--type-body);
  font-weight: 700;
}
.cs-secondary:hover:not([disabled]) {
  background: rgb(var(--c-3fd8ff) / 0.18);
}
.cs-making {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(var(--c-8b7bff) / 0.4);
  background: rgb(var(--c-8b7bff) / 0.08);
  font-size: var(--type-body);
}
.cs-spinner {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgb(var(--c-ffffff) / 0.2);
  border-top-color: var(--cyan);
  animation: cs-spin 0.9s linear infinite;
}
@keyframes cs-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cs-spinner {
    animation: none;
  }
}

/* ---- a post as its platform shows it --------------------------------------------------- */
.cs-frame {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgb(var(--c-ffffff) / 0.025);
}
.cs-frame-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cs-frame-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgb(var(--c-d4af37)), rgb(var(--c-8a6d1d)));
  color: rgb(var(--c-121316));
  font-size: 11px;
  font-weight: 800;
}
img.cs-frame-avatar.business-icon {
  border-radius: 50%;
}
.cs-frame-who {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
}
.cs-frame-who strong {
  font-size: var(--type-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-frame-who small {
  color: var(--muted);
  font-size: var(--type-micro);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-frame .cs-caption {
  /* The platform's own fold cuts the text ("… more"), not a line count. */
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  margin: 0;
  white-space: pre-line;
  font-size: var(--type-body);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.cs-frame-title {
  margin: 0;
  font-weight: 700;
}
.cs-frame-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cs-more {
  padding: 0;
  border: 0;
  background: none;
  color: var(--cyan);
  font-size: var(--type-small);
}
.cs-count {
  color: var(--muted);
  font-size: var(--type-micro);
  font-variant-numeric: tabular-nums;
}
.cs-count.over {
  color: var(--stop, rgb(var(--c-ff6b6b)));
  font-weight: 700;
}
.cs-tracked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--muted);
  font-size: var(--type-micro);
}
.cs-tracked code {
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: rgb(var(--c-3fd8ff) / 0.08);
  color: var(--cyan);
  font-size: var(--type-micro);
  overflow-wrap: anywhere;
}
/* Tall platforms (Reels, TikTok, Shorts) get a phone-shaped preview. */
.cs-card .cs-frame-tiktok .cs-media.tall,
.cs-card .cs-frame-youtube .cs-media.tall,
.cs-card .cs-frame-instagram .cs-media.tall {
  width: min(100%, calc(420px * var(--ratio)));
}

/* ---- carousels and storyboards: one slide or scene at a time ----------------------------- */
.cs-parts {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.cs-card .cs-parts .cs-media {
  width: min(100%, calc(360px * var(--ratio)));
}
.cs-part-nav {
  position: absolute;
  z-index: 1;
  bottom: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgb(var(--c-ffffff) / 0.25);
  background: rgb(var(--c-000000) / 0.55);
  color: rgb(var(--c-ffffff));
  font-size: 18px;
  line-height: 1;
}
.cs-part-nav.prev {
  right: 48px;
}
.cs-part-nav.next {
  right: 10px;
}
/* On a slide or a frame the label sits top-left, clear of the words and the arrows. */
.cs-parts .cs-media:not(.empty) .cs-media-kind {
  top: 8px;
  bottom: auto;
}
.cs-part-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cs-play {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgb(var(--c-d4af37) / 0.6);
  background: rgb(var(--c-d4af37) / 0.14);
  color: rgb(var(--c-f5d77a));
  font-size: var(--type-small);
  font-weight: 700;
}
.cs-part-dots {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-left: auto;
}
.cs-part-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: rgb(var(--c-ffffff) / 0.22);
}
.cs-part-dot.active {
  background: var(--gold, rgb(var(--c-f5c451)));
}
.cs-scene {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgb(var(--c-000000) / 0.25);
  font-size: var(--type-small);
}
.cs-scene dt {
  color: var(--muted);
}
.cs-scene dd {
  margin: 0;
}
.cs-scene-note {
  line-height: 1.4;
}

/* ---- media library --------------------------------------------------------------------- */
.cs-library {
  display: grid;
  gap: var(--space-3);
}
.cs-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-library-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-card);
  color: var(--text);
  text-align: left;
}
.cs-library-item:hover {
  border-color: rgb(var(--c-3fd8ff) / 0.45);
}
.cs-library-item strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: var(--type-small);
  line-height: 1.3;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cs-library-item small {
  color: var(--muted);
  font-size: var(--type-micro);
}
.cs-library-thumb {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  aspect-ratio: 4 / 5;
  background: var(--ink);
}
.cs-library-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---- the full-size viewer: the media as large as the screen allows, nothing cut off ------- */
.cs-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgb(var(--c-02050a) / 0.86);
}
/* Never off-screen: no wider or taller than the viewport less its margin, scrolling inside. */
.cs-viewer {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(1100px, calc(100vw - 24px));
  max-width: min(1100px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.cs-viewer:focus {
  outline: none;
}
.cs-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 10px;
  width: 100%;
}
/* Media, then its details in normal flow below it; two columns on a wide screen. */
.cs-viewer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cs-viewer-body > * {
  position: static;
  flex: none;
  max-width: 100%;
}
.cs-viewer-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.cs-viewer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}
.cs-viewer-platforms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.cs-viewer-note {
  margin: 0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: var(--type-small);
  font-weight: 700;
}
/*
 * The largest box that fits, at the true ratio: its width and height are set inline from
 * computeStageSize(), and it never shrinks, so its layout box is the box it paints.
 */
.cs-viewer-stage {
  position: relative;
  overflow: hidden;
  flex: none;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  --ratio: 1.7778;
  border-radius: var(--radius-md);
  background: var(--ink);
}
.cs-viewer-stage > p {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  padding: 16px;
  text-align: center;
}
.cs-viewer-stage img,
.cs-viewer-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--ink);
}
.cs-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgb(var(--c-ffffff) / 0.25);
  background: rgb(var(--c-000000) / 0.55);
  color: rgb(var(--c-ffffff));
  font-size: 24px;
  line-height: 1;
  transform: translateY(-50%);
}
.cs-viewer-nav.prev {
  left: 8px;
}
.cs-viewer-nav.next {
  right: 8px;
}
.cs-viewer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.cs-viewer-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cs-viewer-thumbs {
  display: flex;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}
.cs-viewer-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: var(--ink);
}
.cs-viewer-thumb.active {
  border-color: var(--gold);
}
.cs-viewer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cs-viewer-scenes {
  display: grid;
  gap: 4px;
  width: min(100%, 640px);
  margin: 0;
  padding-left: 20px;
  font-size: var(--type-small);
}
.cs-viewer-scenes li {
  color: var(--muted);
}
.cs-viewer-scenes li.active {
  color: var(--text);
}
.cs-viewer-scenes strong {
  margin-right: 6px;
}
.cs-viewer-text {
  width: min(100%, 640px);
}
.cs-viewer-caption {
  margin: 4px 0 0;
  white-space: pre-wrap;
  line-height: 1.45;
}
/* Wide screens: the media on the left, its counter, thumbnails, versions and words on the right. */
@media (min-width: 1000px) {
  .cs-viewer-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    /* The stage spans every row; the last, flexible row takes its extra height, not the gaps. */
    grid-template-rows: repeat(11, min-content) 1fr;
    align-content: start;
    align-items: start;
    column-gap: 16px;
    row-gap: 10px;
  }
  .cs-viewer-body > * {
    grid-column: 2;
    justify-self: stretch;
  }
  .cs-viewer-body > .cs-viewer-stage {
    grid-column: 1;
    grid-row: 1 / -1;
    justify-self: start;
  }
  .cs-viewer-body > .cs-viewer-note,
  .cs-viewer-body > .cs-viewer-full {
    justify-self: start;
  }
  .cs-viewer-body .cs-viewer-bar,
  .cs-viewer-body .cs-viewer-platforms {
    justify-content: flex-start;
  }
  .cs-viewer-text,
  .cs-viewer-scenes {
    width: auto;
  }
}
@media (max-width: 640px) {
  .cs-viewer-backdrop {
    padding: 0;
  }
  .cs-viewer {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }
}

/* ---- delivery check -------------------------------------------------------------------- */
.cs-delivery {
  display: grid;
  gap: var(--space-3);
}
.cs-delivery-plan {
  margin: 0;
  font-size: var(--type-lg);
}
.cs-delivery-weeks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4);
}
.cs-delivery-week {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.cs-delivery-week header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.cs-delivery-week h3 {
  margin: 0;
  font-size: var(--type-lg);
}
.cs-delivery-week ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-delivery-week li {
  display: grid;
  gap: 5px;
}
.cs-delivery-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cs-delivery-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--type-body);
}
.cs-delivery-row strong {
  font-variant-numeric: tabular-nums;
}
.cs-meter {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgb(var(--c-ffffff) / 0.07);
}
.cs-meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cs-scheduled);
}
.cs-meter-fill.published {
  background: var(--cs-published);
}
.cs-meter-fill.held {
  background: var(--cs-held);
}

/* ---- brand board editor ---------------------------------------------------------------- */
.cs-brand-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-4);
  align-items: start;
}
.cs-brand-top {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.cs-brand-top > div:first-child {
  flex: 1 1 280px;
  min-width: 0;
}
.cs-brand-top h3 {
  margin: 0 0 4px;
  font-size: var(--type-xl);
}
.cs-brand-preview {
  display: grid;
  flex: 0 1 320px;
  gap: 6px;
  min-width: 0;
}
.cs-brand-sample {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-md);
  border-top: 4px solid;
  color: rgb(var(--c-ffffff));
}
.cs-brand-sample strong {
  font-size: 22px;
  line-height: 1.2;
}
.cs-brand-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
}
.cs-brand-pill {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: rgb(var(--c-121316));
  font-size: var(--type-small);
  font-weight: 800;
}
.cs-brand-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.cs-brand-group.wide {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.cs-brand-group legend {
  padding: 0 6px;
  font-size: var(--type-micro);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold, rgb(var(--c-f5c451)));
}
.cs-brand-form input[type='text'],
.cs-brand-form input[type='url'],
.cs-brand-form input[type='time'],
.cs-brand-form input[type='number'],
.cs-brand-form input:not([type]),
.cs-brand-form textarea,
.cs-brand-form select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong, var(--line));
  background: rgb(var(--c-060a10));
  color: var(--text);
  font: inherit;
  font-size: var(--type-body);
  color-scheme: inherit;
}
.cs-brand-form textarea {
  resize: vertical;
  line-height: 1.45;
}
.cs-brand-form [disabled] {
  opacity: 0.75;
}
.cs-rules {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 8px 10px 8px 26px;
  border-radius: var(--radius-sm);
  background: rgb(var(--c-f5c451) / 0.06);
  font-size: var(--type-small);
  line-height: 1.4;
}
.cs-brand-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.cs-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--type-small);
}
.cs-colours {
  display: grid;
  gap: 6px;
}
.cs-colour {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}
.cs-colour input[type='color'] {
  width: 38px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: none;
}
.cs-colour code {
  color: var(--muted);
  font-size: var(--type-micro);
}
.cs-brand-save {
  grid-column: 1 / -1;
}

/* ---- engine (ALFA Owner) ----------------------------------------------------------------- */
.cs-engine {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--space-4);
  align-items: start;
}
.cs-engine-publishing {
  display: grid;
  grid-column: 1 / -1;
  justify-items: start;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgb(var(--c-f5c451) / 0.35);
  background: rgb(var(--c-f5c451) / 0.06);
}
.cs-engine-publishing.on {
  border-color: rgb(var(--c-3ddc97) / 0.4);
  background: rgb(var(--c-3ddc97) / 0.06);
}
.cs-engine-publishing h3,
.cs-engine-lane h3 {
  margin: 0;
  font-size: var(--type-lg);
}
.cs-engine-publishing p {
  margin: 0;
}
.cs-engine-lane {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.cs-engine-lane ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-backend {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
}
.cs-backend p {
  margin: 0;
  font-size: var(--type-small);
  line-height: 1.4;
}
.cs-backend-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.cs-backend-name strong {
  font-size: var(--type-body);
}
.cs-backend-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--idle, rgb(var(--c-5f7187)));
}
.cs-backend.ready .cs-backend-dot {
  background: var(--ok, rgb(var(--c-3ddc97)));
}
.cs-backend.active .cs-backend-dot {
  box-shadow: 0 0 0 3px rgb(var(--c-3ddc97) / 0.25);
}
.cs-backend-needs code {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: rgb(var(--c-ffffff) / 0.06);
  color: var(--gold, rgb(var(--c-f5c451)));
  font-size: var(--type-micro);
}

@media (max-width: 640px) {
  .cs-tab {
    padding: 8px 10px;
    font-size: var(--type-body);
  }
  .cs-head-actions,
  .cs-head-actions > button {
    width: 100%;
  }
  .cs-card .cs-parts .cs-media,
  .cs-card .cs-media {
    width: min(100%, calc(480px * var(--ratio)));
  }
  .cs-card .cs-frame-tiktok .cs-media.tall,
  .cs-card .cs-frame-youtube .cs-media.tall,
  .cs-card .cs-frame-instagram .cs-media.tall {
    width: min(100%, calc(520px * var(--ratio)));
  }
  .cs-colour {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }
  .cs-colour code {
    display: none;
  }
}

/* ---- ideas ------------------------------------------------------------------------------ */
.cs-ideas {
  display: grid;
  gap: var(--space-3);
}
.cs-idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-idea {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold, rgb(var(--c-f5c451)));
  background: var(--surface-card);
}
.cs-idea strong {
  font-size: var(--type-lg);
  line-height: 1.3;
}
.cs-idea p {
  margin: 0;
  font-size: var(--type-body);
  line-height: 1.45;
  color: var(--text);
}
.cs-idea-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Customer portal (/portal/:slug): mobile-first, one column; wider screens get more room. */
.portal {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-3);
  color: var(--text);
}
.portal h1 {
  font-size: 1.35rem;
  margin: var(--space-2) 0 var(--space-3);
}
.portal-card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.portal-card h2 {
  font-size: 1.05rem;
  margin: 0 0 var(--space-2);
}
.portal-balance {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 var(--space-2);
}
.portal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.portal-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
}
.portal-row > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.portal-meta {
  color: var(--muted);
  font-size: 0.85rem;
}
.portal-amount,
.portal-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.portal-button {
  display: inline-block;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--cyan);
  background: transparent;
  color: var(--cyan);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.portal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.portal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.portal-field input,
.portal-field textarea {
  min-height: 44px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
  font: inherit;
}
@media (min-width: 640px) {
  .portal-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* --- Phones: the safe area and finger-sized controls ------------------------------------------ */
/*
 * Installed to a phone's home screen, ATLAS runs edge to edge (`viewport-fit=cover`), so the
 * notch and the home indicator are inside the page. `env()` is 0 everywhere else, which is why
 * these need no media query: they only ever apply on a phone.
 */
body {
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
}
.atlas-app {
  padding-bottom: env(safe-area-inset-bottom);
}
/* A narrow screen, or any screen worked with a finger - a phone on its side is still a phone. */
@media (max-width: 767px), (pointer: coarse) {
  /*
   * A control a finger can hit: 44px, the floor both platforms publish. `:where()` keeps this at
   * zero specificity, so it only raises a floor - a `min-height` always beats a smaller `height`
   * - and never overrides a room that already set its own. `align-content` keeps a label centred
   * in the taller box where the element is not a flex container already.
   */
  :where(button, select, summary, textarea, [role='button'], [role='tab']),
  :where(input:not([type='checkbox'], [type='radio'], [type='range'], [type='hidden'])),
  :where(
    a.nav-link,
    a.cust-link,
    a.cust-brand,
    a.cust-button,
    a.needs-you-action,
    a.os-roster-item,
    a.os-launch-button,
    a.business-ops-link
  ) {
    min-height: 44px;
    align-content: center;
  }
  :where(button, select, [role='button']) {
    min-width: 44px;
  }
  /* These two set a height of their own, so the floor has to be said at their specificity. */
  .chat-composer .composer-box textarea.composer-input,
  .cc-tile.open .cc-widget-head {
    min-height: 44px;
  }
  /*
   * A status picker in a table was squeezed to the 36px its column had left, too narrow to read
   * the choice or to hit. It keeps a readable width, and the table scrolls inside its own strip.
   */
  .ur-table select {
    min-width: 132px;
  }
  /* A checkbox is hit through its label; the box itself stays the size it is drawn. */
  :where(label:has(> input[type='checkbox'], > input[type='radio'])) {
    min-height: 44px;
    align-content: center;
  }
  /*
   * iOS zooms the page into any field whose text is under 16px, and leaves it zoomed and
   * scrolling sideways afterwards. Important because every room sizes its own fields.
   */
  input:not([type='checkbox'], [type='radio'], [type='range']),
  select,
  textarea {
    font-size: 16px !important;
  }
  /*
   * The status pill was allowed to shrink but not to clip, so on a tight top bar it ran on
   * underneath the bubbles. Larger bubbles make a tight bar more likely; it clips instead.
   */
  .atlas-app[data-workspace='atlas'] .vitals {
    overflow: hidden;
  }
}
@media (max-width: 767px) {
  /*
   * Five or six 44px bubbles do not fit beside the menu button on a 375px screen. They take a
   * second row rather than being squeezed under each other, as they already do with the menu
   * hidden.
   */
  .atlas-app[data-workspace='atlas'] .atlas-header {
    flex-wrap: wrap;
  }
  .atlas-app[data-workspace='atlas'] .top-bubbles {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
  }
  /* The chat sheet is fixed to the screen edges, so it steps in from them itself. */
  .atlas-chat-shell {
    padding-right: env(safe-area-inset-right);
    padding-left: env(safe-area-inset-left);
  }
  /* The last of a room clears the sheet, which is taller now its controls are. */
  .atlas-app[data-workspace='atlas'] .atlas-main {
    padding-bottom: 210px;
  }
}

/* --- Appearance: Light / Dark / System (theme.js) --------------------------------------------- */
.appearance-settings {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}
.appearance-settings h3 {
  margin: 0;
  font-size: var(--type-base);
  color: var(--text);
}
.appearance-settings p {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-body);
}
.appearance-control {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgb(var(--c-78c8ff) / 0.22);
  border-radius: var(--radius-pill);
  background: rgb(var(--c-ffffff) / 0.04);
}
.appearance-option {
  padding: 6px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--type-body);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease);
}
.appearance-control.compact .appearance-option {
  flex: 1;
  padding: 4px 8px;
  font-size: var(--type-small);
}
.appearance-option[aria-checked='true'] {
  background: rgb(var(--c-3fd8ff) / 0.16);
  color: var(--text);
  font-weight: 700;
}
.appearance-option:focus-visible {
  outline: 2px solid rgb(var(--c-3fd8ff));
  outline-offset: 1px;
}
.profile-section .appearance-control {
  display: flex;
}

/* --- Settings → Business profile & appearance (ATLAS-2656) ---------------------------------- */
.business-profile {
  display: grid;
  gap: var(--space-4);
}
.business-profile-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.business-profile-head h2 {
  margin: 0;
}
.profile-head-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface2);
  font-weight: 800;
}
.profile-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
.profile-slot {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.profile-slot h3 {
  margin: 0 0 4px;
  font-size: var(--type-base);
}
.profile-slot-preview {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface2);
}
.plate-logo .profile-slot-preview {
  background: var(--logo-plate);
}
.plate-logo-dark .profile-slot-preview {
  background: var(--plate-dark);
}
.plate-logo-light .profile-slot-preview {
  background: var(--plate-light);
}
.profile-slot-logo {
  max-width: 88px;
  max-height: 88px;
  object-fit: contain;
}
.profile-slot-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  font-weight: 800;
}
.profile-slot-empty {
  padding: 4px;
  color: var(--muted);
  font-size: var(--type-small);
  text-align: center;
}
.profile-slot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
@media (max-width: 480px) {
  .profile-slot {
    grid-template-columns: 72px 1fr;
  }
  .profile-slot-preview {
    width: 72px;
    height: 72px;
  }
}

/* Pipeline room (pipeline-room.js, ATLAS-2677): inbound leads across the top, prospects to review,
   then the CRM's stages as columns that scroll inside their own frame on a phone. */
.pipeline-room > * {
  min-width: 0;
}
.pl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.pl-toolbar .ur-field {
  min-width: 160px;
}
.pl-board {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.pl-lane {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  min-width: 0;
}
.pl-lane-inbound {
  border-color: var(--danger);
}
.pl-lane h3,
.pl-column h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 6px;
  font-size: 16px;
}
.pl-total {
  color: var(--muted);
  font-size: var(--type-small);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.pl-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  min-width: 0;
}
.pl-column {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface2);
  min-width: 0;
}
.pl-drop {
  min-height: 48px;
}
.pl-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pl-lane .pl-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.pl-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  min-width: 0;
  cursor: grab;
}
.pl-card.pl-moving {
  opacity: 0.6;
  cursor: progress;
}
.pl-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.pl-card-head strong {
  overflow-wrap: anywhere;
}
.pl-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: var(--type-small);
}
.pl-meta > span {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.pl-age-hot {
  color: var(--danger);
  border-color: var(--danger) !important;
  font-weight: 700;
}
.pl-flag {
  margin: 0;
  color: var(--gold);
  font-size: var(--type-small);
}
.pl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pl-move {
  max-width: 100%;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--text);
}
.pl-plan ul {
  margin: 6px 0 10px;
  padding-left: 20px;
}

/* Contacts room (contacts-room.js, ATLAS-2678): the list beside the open contact on a wide screen,
   one above the other on a phone. */
.contacts-room > * {
  min-width: 0;
}
.ct-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.ct-toolbar .ur-field {
  min-width: 140px;
  flex: 1 1 140px;
}
.ct-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}
.contacts-room .ct-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: flex-end;
  background: rgb(var(--c-000000) / 35%);
}
.contacts-room .ct-drawer {
  width: min(640px, 100%);
  height: 100dvh;
  overflow-y: auto;
  padding: 20px;
  background: var(--surface);
  box-shadow: -10px 0 35px rgb(var(--c-000000) / 20%);
}
.contacts-room .ct-modal-overlay {
  align-items: center;
  justify-content: center;
}
.contacts-room .ct-modal-overlay .ct-drawer {
  height: auto;
  max-height: 90dvh;
  border-radius: var(--radius-lg);
}
.contacts-room .ct-action-bar {
  position: sticky;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 0;
  background: var(--surface);
  z-index: 1;
}
.contacts-room .ct-timeline li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
@media (max-width: 600px) {
  .contacts-room .ct-modal-overlay .ct-drawer,
  .contacts-room .ct-drawer {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding: 12px;
  }
}
.contacts-room .room-table td {
  overflow-wrap: anywhere;
  user-select: text;
}
.contacts-room .room-table-row.ct-selected {
  background: var(--surface2);
}
@media (max-width: 860px) {
  .ct-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.ct-list,
.ct-links,
.ct-note-list,
.ct-dnd-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ct-open {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.ct-open strong {
  overflow-wrap: anywhere;
}
.ct-selected .ct-open {
  border-color: var(--gold);
}
.ct-meta,
.ct-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--type-small);
  overflow-wrap: anywhere;
}
.ct-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.ct-tag-remove {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.ct-dnd {
  color: var(--danger);
  font-weight: 700;
}
.ct-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.ct-pane,
.ct-detail,
.ct-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.ct-detail,
.ct-form {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.ct-detail.ct-opened {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan);
  scroll-margin-top: 24px;
}
.ct-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ct-detail-head h3,
.ct-detail h4,
.ct-form h3 {
  margin: 0;
  overflow-wrap: anywhere;
}
.ct-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
}
.ct-facts dt {
  color: var(--muted);
}
.ct-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ct-dnd-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.ct-inline,
.ct-note-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.ct-note-form textarea {
  flex: 1 1 100%;
  min-width: 0;
}
.ct-note-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Callers (callers-room.js, ATLAS-2693): period tabs, Refresh and the CSV over a table of callers,
   with each caller's pay rates below. The table reuses the Users & Roles table. */
.callers-room > * {
  min-width: 0;
}
.callers-periods {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.callers-toolbar a.ur-secondary {
  text-decoration: none;
}
.callers-rates {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.callers-rates summary {
  cursor: pointer;
  font-weight: 700;
}
.callers-rate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.callers-rate-name {
  min-width: 140px;
  font-weight: 700;
}
.callers-rate input {
  width: 7em;
  margin-left: 6px;
}
/* Appointments and Inbox rooms (appointments-room.js, inbox-room.js, ATLAS-2680): a day or week of
   appointments with the booking form below; conversations beside the open thread, stacked on a
   phone. They reuse the Pipeline room's toolbar, lanes and cards. */
.appointments-room > *,
.inbox-room > * {
  min-width: 0;
}
.ap-switch {
  display: inline-flex;
  gap: 6px;
}
.ap-days {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.ap-closed {
  opacity: 0.6;
}
.ap-status-cancelled,
.ap-status-no_show {
  color: var(--danger);
  border-color: var(--danger) !important;
}
.ap-status-confirmed,
.ap-status-showed {
  color: var(--cyan);
  border-color: var(--cyan) !important;
}
.ap-reschedule,
.ap-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}
.ap-form .ur-field {
  min-width: 160px;
  flex: 1 1 180px;
}
.ap-book {
  display: grid;
  gap: 12px;
}
.ap-search {
  display: flex;
  gap: 6px;
}
.ap-search input {
  flex: 1 1 auto;
  min-width: 0;
}
.ap-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.ap-chosen {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.ib-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}
.ib-side,
.ib-main {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}
.ib-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ib-row {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.ib-row.ib-selected {
  border-color: var(--cyan);
}
.ib-system-notices {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.ib-system-notices summary {
  cursor: pointer;
  color: var(--muted);
}
.ib-system-notices[open] .ib-list {
  margin-top: 8px;
}
.ib-row.ib-unread strong {
  color: var(--gold);
}
.ib-row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.ib-row-head strong,
.ib-preview,
.ib-text {
  overflow-wrap: anywhere;
}
.ib-preview,
.ib-when {
  color: var(--muted);
  font-size: var(--type-small);
}
.ib-badge {
  justify-self: start;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: var(--type-small);
}
.ib-filed {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface2);
}
.ib-filed h4 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.ib-filed-item {
  display: grid;
  gap: 2px;
}
.ib-thread {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-card);
  min-width: 0;
}
.ib-thread h3 {
  margin: 0;
}
.ib-messages {
  display: grid;
  gap: 8px;
  max-height: 60vh;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.ib-message {
  display: grid;
  gap: 4px;
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.ib-message.ib-in {
  justify-self: start;
  background: var(--surface2);
}
.ib-message.ib-out {
  justify-self: end;
  background: var(--surface);
  border-color: var(--blue);
}
.ib-text {
  margin: 0;
  white-space: pre-wrap;
}
.ib-composer {
  display: grid;
  gap: 10px;
}
.ib-composer textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}
@media (max-width: 760px) {
  .ib-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .ib-message {
    max-width: 92%;
  }
}

/* Catalog and Estimates (ATLAS-2679): the business's ERPNext catalog and its estimates. */
.cat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-body);
}
.cat-table th,
.cat-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.cat-table input,
.cat-table select {
  max-width: 100%;
}
.cat-disabled {
  opacity: 0.55;
}
.cat-price-form {
  display: flex;
  gap: var(--space-2);
}
.cat-price-form input {
  width: 7rem;
}
.cat-seed {
  max-height: 16rem;
  overflow: auto;
}
.est-group th {
  color: var(--cyan);
}
.est-totals {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  gap: var(--space-1) var(--space-5);
  margin: var(--space-4) 0;
}
.est-totals dd {
  margin: 0;
  text-align: right;
}
.est-status {
  font-weight: 600;
}
.est-draft {
  color: var(--text);
}
.est-sent,
.est-accepted {
  color: var(--cyan);
}
.est-lost,
.est-expired,
.est-cancelled {
  opacity: 0.7;
}
.est-send {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.money-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.money-steps li {
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface2);
}
.est-catalog-search {
  margin-block: var(--space-3);
}
/* Invoices (ATLAS-2698): ERPNext's status, what is owed, and the list's filters. */
.inv-draft {
  color: var(--text);
}
.inv-unpaid,
.inv-partly-paid {
  color: var(--gold);
}
.inv-overdue {
  color: var(--danger);
}
.inv-paid {
  color: var(--cyan);
}
.inv-cancelled,
.inv-return {
  opacity: 0.7;
}
.inv-filters {
  flex-wrap: wrap;
  gap: var(--space-2);
}
.inv-list-totals {
  justify-content: start;
}
@media (max-width: 720px) {
  .cat-table {
    display: block;
    overflow-x: auto;
  }
  .cs-week-strip {
    overflow-x: auto;
  }
  .cs-week-days {
    min-width: 520px;
  }
  .money-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* --------------------------------------------------------------------------------------------- */
/* Job Photos (ATLAS-2683)                                                                        */
/* --------------------------------------------------------------------------------------------- */
.jp-room {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}
.jp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.jp-button,
.jp-room button,
.jp-capture button,
.jp-viewer button,
.jp-viewer .jp-button {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--type-small);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.jp-room button.on,
.jp-capture button.on,
.jp-viewer button.on {
  border-color: var(--cyan);
  color: var(--cyan);
}
.jp-room button.primary,
.jp-capture button.primary,
.jp-viewer button.primary,
.jp-capture .jp-big {
  border-color: var(--cyan);
  background: var(--cyan);
  color: rgb(var(--c-000000));
  font-weight: 600;
}
.jp-room button.danger,
.jp-capture button.danger,
.jp-viewer button.danger {
  border-color: rgb(var(--c-ff6b6b));
  color: rgb(var(--c-ff6b6b));
}
.jp-room button:disabled,
.jp-capture button:disabled,
.jp-viewer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.jp-room .jp-link,
.jp-viewer .jp-link {
  border: 0;
  background: none;
  padding: 0;
  min-height: 0;
  color: var(--cyan);
  text-decoration: underline;
}
.jp-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: rgb(var(--c-ff6b6b));
  color: rgb(var(--c-ffffff));
  font-size: var(--type-micro);
  text-align: center;
}
.jp-muted {
  color: var(--muted);
  font-size: var(--type-small);
}
.jp-error {
  color: rgb(var(--c-ff6b6b));
}
.jp-notice {
  color: rgb(var(--c-3ddc97));
}
.jp-note {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(var(--c-f5c451));
  font-size: var(--type-small);
}
.jp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
.jp-filters input[type='search'] {
  flex: 1 1 220px;
  min-width: 0;
}
.jp-filter,
.jp-field {
  display: grid;
  gap: 4px;
  font-size: var(--type-small);
  color: var(--muted);
  min-width: 0;
}
.jp-room input,
.jp-room select,
.jp-room textarea,
.jp-viewer input,
.jp-viewer select,
.jp-viewer textarea,
.jp-capture input,
.jp-capture select,
.jp-capture textarea {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  max-width: 100%;
  box-sizing: border-box;
}
.jp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.jp-chip,
.jp-label,
.jp-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: var(--type-small);
  margin-right: 4px;
}
.jp-label.archived {
  border-color: rgb(var(--c-f5c451));
}
.jp-group {
  border-style: dashed;
}
.jp-viewer .jp-chip-x {
  min-height: 0;
  padding: 0 4px;
  border: 0;
  background: none;
}
.jp-job-list,
.jp-file-list,
.jp-mention-list,
.jp-tasks,
.jp-comments,
.jp-hits {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.jp-job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-card);
  min-width: 0;
}
.jp-job-row .jp-label {
  grid-column: 1 / -1;
  justify-self: start;
}
@media (max-width: 860px) {
  .jp-job-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .jp-job-row .jp-strip {
    grid-column: 1 / -1;
  }
}
.jp-room .jp-job-open {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  padding: 0;
  text-align: left;
  min-width: 0;
}
.jp-job-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.jp-counts {
  font-size: var(--type-small);
  color: var(--muted);
}
.jp-cover {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--line);
}
.jp-cover.large {
  width: 120px;
  height: 120px;
  flex-basis: 120px;
}
.jp-avatars {
  display: flex;
}
.jp-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -6px;
  border-radius: 50%;
  border: 2px solid var(--surface-card);
  background: rgb(var(--c-8b7bff));
  color: rgb(var(--c-ffffff));
  font-size: var(--type-micro);
  font-weight: 700;
}
.jp-avatars .jp-avatar:first-child {
  margin-left: 0;
}
.jp-strip {
  display: flex;
  gap: 4px;
}
.jp-strip-item {
  position: relative;
  width: 48px;
  height: 48px;
}
.jp-strip-item img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}
.jp-room .jp-star {
  border: 0;
  background: none;
  font-size: 1.4rem;
  min-height: 0;
  color: var(--muted);
}
.jp-room .jp-star.on {
  color: rgb(var(--c-f5c451));
}
.jp-pager {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.jp-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-card);
  max-width: 640px;
}
.jp-form-actions,
.jp-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.jp-inline-form input {
  flex: 1 1 140px;
  min-width: 0;
}
.jp-job-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}
.jp-job-head h2 {
  margin: 4px 0;
}
.jp-job-head .jp-job-text {
  flex: 1 1 260px;
}
.jp-job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.jp-more-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}
.jp-more-menu[open] {
  display: grid;
  gap: 6px;
}
.jp-day h3 {
  margin: 12px 0 6px;
  font-size: var(--type-body);
}
.jp-grid {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.jp-grid.size-s {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}
.jp-grid.size-l {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.jp-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}
.jp-tile.selected {
  outline: 3px solid var(--cyan);
  outline-offset: -3px;
}
.jp-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.jp-room .jp-tile-open {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.jp-tile-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
}
.jp-tile-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 14px 6px 4px;
  background: linear-gradient(transparent, rgb(var(--c-000000) / 0.7));
  color: rgb(var(--c-ffffff));
  font-size: var(--type-micro);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.jp-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgb(var(--c-000000) / 0.65);
  color: rgb(var(--c-ffffff));
  font-size: var(--type-micro);
}
.jp-badge.left {
  right: auto;
  left: 4px;
}
.jp-bulk {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--cyan);
  background: var(--surface-card);
}
.jp-tray {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line-strong);
  font-size: var(--type-small);
}
.jp-tray ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.jp-tray li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  overflow-wrap: anywhere;
}
.jp-tasks li.done {
  color: var(--muted);
  text-decoration: line-through;
}
.jp-mention-list li.unread {
  font-weight: 600;
}
.jp-more {
  justify-self: center;
}
/* The viewer: the photo and its tools, its details beside it (below it on a phone). */
.jp-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  background: rgb(var(--c-05080e) / 0.96);
  color: var(--text);
  overflow: auto;
}
.jp-viewer[hidden] {
  display: none;
}
.jp-viewer-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
}
.jp-viewer-bar .jp-close {
  margin-left: auto;
}
.jp-viewer .jp-swatch {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
}
.jp-viewer .jp-swatch.on {
  outline: 2px solid rgb(var(--c-ffffff));
}
.jp-viewer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
  padding: 0 12px 12px;
  min-height: 0;
}
@media (max-width: 860px) {
  .jp-viewer-body {
    grid-template-columns: minmax(0, 1fr);
  }
}
.jp-viewer-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}
.jp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.jp-stage {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 0;
}
.jp-stage.zoomed {
  overflow: auto;
  place-items: start;
}
.jp-stage video {
  max-width: 100%;
  max-height: 78vh;
}
.jp-frame {
  position: relative;
  transform-origin: top left;
}
.jp-stage:not(.zoomed) .jp-frame {
  transform-origin: center;
}
.jp-frame img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  user-select: none;
}
.jp-markup {
  position: absolute;
  inset: 0;
}
.jp-side {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  overflow-wrap: anywhere;
}
.jp-side-block {
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-card);
  display: grid;
  gap: 6px;
}
.jp-side-block h4 {
  margin: 0;
  font-size: var(--type-small);
  color: var(--muted);
}
.jp-side-block textarea {
  width: 100%;
}
.jp-comment-head,
.jp-comment-body {
  margin: 0;
}
.jp-comment-body {
  white-space: pre-wrap;
}
.jp-comment-form {
  position: relative;
  display: grid;
  gap: 6px;
}
.jp-suggest {
  margin: 0;
  padding: 4px;
  list-style: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-card);
}
.jp-suggest button {
  width: 100%;
  justify-content: flex-start;
  border: 0;
}
.jp-where .jp-map {
  height: 180px;
  border-radius: var(--radius-sm);
}
/* The capture page: one column, big targets, for a phone in a gloved hand. */
.jp-capture-body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
}
.jp-capture {
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px 32px;
}
.jp-capture-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.jp-capture-head h1 {
  margin: 0;
}
.jp-online {
  font-size: var(--type-small);
  color: rgb(var(--c-3ddc97));
}
.jp-online.off {
  color: rgb(var(--c-f5c451));
}
.jp-capture-job select {
  width: 100%;
}
.jp-capture-actions {
  display: grid;
  gap: 8px;
}
.jp-capture .jp-big {
  width: 100%;
  min-height: 56px;
  justify-content: center;
  font-size: var(--type-body);
  border-radius: var(--radius-md);
}
.jp-capture textarea {
  width: 100%;
}
/* Users & Roles: a business's user groups (ATLAS-2683). */
.ur-groups {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.ur-groups h4 {
  margin: 0;
}
.ur-group-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ur-link {
  border: 0;
  background: none;
  color: var(--cyan);
  text-decoration: underline;
  cursor: pointer;
  justify-self: start;
}
/* Job Photos, part b: the map, checklists, reports and the customer's share page. */
.jp-bigmap {
  height: min(70vh, 640px);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.jp-checklist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.jp-checklist-row progress {
  width: 120px;
}
.jp-checklist-items {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}
.jp-checklist-items li.done > label {
  color: var(--muted);
  text-decoration: line-through;
}
.jp-checklist-items textarea {
  width: 100%;
}
.jp-item-photo {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: 8px;
}
.jp-item-photo img,
.jp-report-photos img {
  border-radius: 6px;
  object-fit: cover;
}
.jp-report-photos {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}
.jp-report-photos li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.jp-report-photos textarea {
  flex: 1 1 220px;
}
.jp-share-link {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.jp-share-link input {
  flex: 1 1 260px;
}
.jp-share {
  display: grid;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}
.jp-share h1 {
  margin: 4px 0;
}
.jp-share .jp-tile-open {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.jp-share-big img,
.jp-share-big video {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
}
.jp-share a,
.jp-share button {
  color: var(--cyan);
}
/* Job Photos, part c: the Project Recap and AI suggestions. */
.jp-recaps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.jp-recaps li {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.jp-recaps h3 {
  margin: 0 0 6px;
}
.jp-recap-text,
.jp-ai-caption {
  white-space: pre-wrap;
  margin: 0 0 6px;
}

/* ------------------------------------------------------------------------- */
/* A customer's own page for one estimate or invoice (ATLAS-2700).            */
/* Served at /doc/<link> with no sign-in, so it stands on its own: nothing     */
/* here depends on the console's shell being on the page.                     */
/* ------------------------------------------------------------------------- */
.cd-page {
  display: grid;
  gap: 14px;
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}
.cd-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cd-logo {
  max-height: 56px;
  max-width: 220px;
  width: auto;
}
.cd-business {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
}
.cd-page h1 {
  margin: 0;
}
.cd-sub {
  margin: 0;
  color: var(--text-muted);
}
.cd-lines {
  display: grid;
  gap: 12px;
}
.cd-group h3 {
  margin: 0 0 4px;
}
.cd-table {
  width: 100%;
  border-collapse: collapse;
}
.cd-table th,
.cd-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.cd-table th:nth-child(n + 2),
.cd-table td:nth-child(n + 2) {
  text-align: right;
  white-space: nowrap;
}
.cd-item {
  font-weight: 600;
}
.cd-desc {
  margin: 2px 0 0;
  color: var(--text-muted);
  white-space: pre-wrap;
}
.cd-totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.cd-totals dt {
  margin: 0;
}
.cd-totals dd {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}
.cd-notes,
.cd-terms p {
  white-space: pre-wrap;
}
.cd-schedule ul,
.cd-pay ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.cd-handle {
  font-family: var(--font-mono, monospace);
}
.cd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cd-accept {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-card);
}
.cd-accept h3 {
  margin: 0;
}
.cd-accept input {
  max-width: 360px;
}
.cd-primary {
  justify-self: start;
}
/* The room's panel for a document's customer links. */
.cd-links {
  display: grid;
  gap: 8px;
}
.cd-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.cd-link-made {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.cd-link-made input {
  flex: 1 1 280px;
}

/* Owner-arranged room sections and the widgets around David's Core. */
.jarvis-customize {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 3;
}
.jarvis-widget-tools,
.jarvis-hidden-list,
.page-layout-actions,
.page-section-tools,
.page-hidden,
.page-hidden-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.jarvis-widget-tools {
  margin-top: 0.55rem;
}
.jarvis-widget-tools button,
.jarvis-hidden button,
.jarvis-customize {
  border: 1px solid rgb(var(--c-3fd8ff) / 0.35);
  border-radius: 999px;
  background: rgb(var(--c-08111f) / 0.82);
  color: inherit;
  padding: 0.35rem 0.65rem;
}
.jarvis-hidden {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  z-index: 3;
  transform: translateX(-50%);
  text-align: center;
}
.jarvis-hidden-list {
  margin-top: 0.4rem;
}
.jarvis-hidden-list[hidden] {
  display: none;
}
.page-layout-actions {
  justify-content: flex-end;
  margin-bottom: 0.65rem;
}
.page-section {
  min-width: 0;
}
.page-section.arranging {
  border: 1px dashed rgb(var(--c-3fd8ff) / 0.45);
  border-radius: 0.75rem;
  padding: 0.65rem;
}
.page-section-tools {
  margin-bottom: 0.65rem;
}
.page-section-tools strong {
  margin-right: auto;
}
.page-hidden {
  justify-content: flex-end;
  margin-top: 0.75rem;
}
.page-arrange,
.page-hidden-toggle,
.page-hidden-list button,
.page-section-tools button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
  padding: 0.4rem 0.7rem;
}
.ghl-links {
  display: grid;
  gap: 0.65rem;
}
.ghl-links .ur-help,
.ghl-links .ur-sub {
  margin: 0;
}
.ghl-link-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ghl-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ghl-links a.ur-secondary {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  text-decoration: none;
  font-size: var(--type-small);
}
.technical-details-setting {
  margin-top: 1rem;
}
.integration-settings {
  display: grid;
  gap: var(--space-3);
}
.integration-settings-row {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface2);
}
.integration-settings-row p {
  margin: 0;
}
.integration-update {
  color: var(--warn, rgb(var(--c-ffb547)));
  font-weight: 700;
}
.settings-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
/* Today uses the console's existing type, surface and button tokens. */
.today-room-body {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.today-home {
  display: grid;
  gap: 24px;
  width: 100%;
  min-width: 0;
}
.today-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 32px;
}
.today-refresh {
  border: 1px solid var(--line);
  background: var(--surface2);
}
.today-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.today-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
}
.today-tile:hover {
  transform: translateY(-2px);
}
.today-tile:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}
.today-tile.is-zero {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface-card) 72%, transparent);
}
.today-tile.is-zero .cust-tile-value,
.today-tile.is-zero .cust-tile-label {
  color: var(--muted);
}
.today-tile.is-zero .cust-tile-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today-briefing p {
  margin: 10px 0;
}
.today-needs ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.today-needs li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.today-thumbnails {
  display: flex;
  gap: 8px;
}
.today-thumbnails img {
  border-radius: 8px;
  object-fit: cover;
}
.supply-room {
  min-width: 0;
  max-width: 960px;
  margin-inline: auto;
}
.supply-room h1 {
  margin-block: 0 12px;
}
.supply-section {
  margin-block: 24px;
}
.supply-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-block: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.supply-room label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-block: 12px;
}
.supply-room input,
.supply-room select {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.supply-room button,
.supply-room input,
.supply-room select {
  min-height: 44px;
  font-size: 16px;
}
.supply-room button {
  padding: 10px 16px;
}
.supply-count,
.supply-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.supply-count input {
  width: 90px;
}
.supply-count button {
  min-width: 48px;
}
.supply-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 8px;
}
.supply-line span {
  flex: 1 1 180px;
}
.supply-line input {
  width: 90px;
}
.supply-shopping-list {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}
.supply-room details {
  padding-block: 12px;
}
@media (max-width: 480px) {
  .supply-room {
    padding: 12px;
  }
  .supply-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .supply-actions > * {
    width: 100%;
    box-sizing: border-box;
  }
  .supply-card {
    padding: 12px;
  }
}
@media print {
  body:has([data-print-order]) * {
    visibility: hidden;
  }
  [data-print-order],
  [data-print-order] * {
    visibility: visible !important;
  }
  [data-print-order] {
    position: absolute;
    inset: 0;
    border: 0;
  }
  [data-print-order] .supply-actions {
    display: none;
  }
}
.today-amount {
  font-size: 1.1rem;
  font-weight: 600;
}
@media (max-width: 600px) {
  .today-needs li {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ATLAS-2884: one Marketing room, readable repair cards and a truthful week strip. */
.cs-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
}
.cs-filters {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
}
.cs-filter {
  flex: 0 0 auto;
  white-space: nowrap;
}
.cs-failure-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}
.cs-failure-card h3,
.cs-failure-card p,
.cs-failure-reasons {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.cs-failure-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cs-failure-platforms > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cs-post-thumbnail {
  width: 144px;
  max-width: 100%;
  height: 96px;
  object-fit: contain;
  border-radius: var(--radius-md);
}
.cs-post-thumbnail.empty {
  display: grid;
  place-items: center;
  font-size: var(--type-small);
  color: var(--muted);
}
.cs-week-posts,
.cs-week-post {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
}
.cs-week-post .cs-post-thumbnail {
  width: 100%;
  height: 44px;
}
.cs-week-post .cs-post-thumbnail.empty {
  font-size: 9px;
  overflow-wrap: anywhere;
}
.cs-week-dots {
  flex-wrap: wrap;
}
.cs-dot-posted {
  background: var(--cs-published);
}
.cs-dot-scheduled {
  background: var(--cs-scheduled);
}
.cs-dot-failed {
  background: var(--cs-held);
}
.cs-dot-waiting {
  background: var(--cs-waiting);
}
.cs-video-archive {
  margin-top: 16px;
}
.cs-social-platform[data-focused-platform] {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}
@media (max-width: 600px) {
  .cs-actions > button,
  .cs-primary,
  .cs-filter,
  .cs-tab {
    min-height: 44px;
  }
  .cs-card .cs-headline,
  .cs-card .cs-caption {
    overflow-wrap: anywhere;
  }
  .cs-bulk {
    width: 100%;
  }
}

.cs-dot-unknown {
  background: var(--muted);
}
