/* Isolated C4 AI guide. It shares C4 semantic colors without changing site controls. */
.c4ai-launcher,
.c4ai-panel {
  --c4ai-accent: var(--brand, #dc240c);
  --c4ai-text: var(--text, #0c293e);
  --c4ai-muted: var(--muted, #627480);
  --c4ai-line: var(--line, #e1e7eb);
  --c4ai-surface: var(--surface-raised, #fff);
  --c4ai-soft: var(--surface, #f5f7f8);
  --c4ai-tint: var(--tint, #fdf0ee);
  font-family:
    "DM Sans",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  box-sizing: border-box;
}
.c4ai-launcher *,
.c4ai-panel * {
  box-sizing: border-box;
}
.c4ai-launcher {
  position: fixed;
  z-index: 112;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid #0c293e1f;
  border-radius: 50%;
  padding: 9px;
  isolation: isolate;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background: radial-gradient(circle at 28% 15%, #6b1a14, #0a2e45 60%, #052237);
  box-shadow:
    0 9px 28px #092c4733,
    0 2px 7px #092c471f,
    inset 0 1px 1px #ffffff40;
  color: #fff;
  transition:
    box-shadow 0.22s ease,
    border-color 0.22s ease;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* The pulsing wave stays (founder, 28 October 2026): a crisp ring leaves the orb and fades, with no haze, no
   dust and no blurred glow; a clean neutral shadow carries the elevation. Still under reduced motion. */
.c4ai-launcher::before {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid color-mix(in srgb, var(--c4ai-accent) 70%, transparent);
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  animation: c4ai-ripple 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
@keyframes c4ai-ripple {
  0% { opacity: 0.85; transform: scale(0.96); }
  70% { opacity: 0.2; transform: scale(1.32); }
  100% { opacity: 0; transform: scale(1.45); }
}
.c4ai-launcher {
  animation: c4ai-breathe 2.4s ease-in-out infinite;
}
/* The second ring rides the orb's own circle (a ring drawn on the rounded-rectangle mark was an ellipse). */
.c4ai-launcher .c4ai-launcher-mark::after { content: none; }
@keyframes c4ai-breathe {
  0% { box-shadow: 0 8px 22px #0c293e2e, 0 2px 6px #0c293e1f, inset 0 1px 1px #ffffff40; }
  50% { box-shadow: 0 12px 30px #0c293e38, 0 2px 6px #0c293e1f, inset 0 1px 1px #ffffff40; }
  100% { box-shadow: 0 8px 22px #0c293e2e, 0 2px 6px #0c293e1f, inset 0 1px 1px #ffffff40; }
}
.c4ai-launcher.c4ai-is-moving,
.c4ai-launcher.c4ai-is-open { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .c4ai-launcher, .c4ai-launcher::before { animation: none; }
}
/* In the Passport the sync strip owns the bottom right corner: the guide floats above it. */
body:has(.c4-sync:not([hidden])) .c4ai-launcher:not(.c4ai-is-moving) { margin-top: -84px; }
.c4ai-launcher.c4ai-is-moving::before {
  animation-play-state: paused;
  opacity: 0 !important;
}
.c4ai-launcher::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(125deg, #ffffff24, transparent 48%);
  pointer-events: none;
}
.c4ai-launcher-mark {
  position: relative;
  width: 82%;
  display: grid;
  place-items: center;
  padding: 5px 3px;
  background: #fff;
  border-radius: 11px;
  box-shadow: 0 1px 7px #001c3226;
}
.c4ai-launcher-mark img {
  width: 100%;
  height: auto;
  pointer-events: none;
}
.c4ai-ai-badge {
  position: absolute;
  right: -2px;
  bottom: 0;
  min-width: 25px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid var(--bg, #fff);
  background: #f7a89d;
  color: #073047;
  font:
    800 9px/1 "DM Sans",
    sans-serif;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px #001c3226;
}
.c4ai-tooltip {
  position: absolute;
  right: calc(100% + 15px);
  top: 50%;
  transform: translate(5px, -50%);
  white-space: nowrap;
  border: 1px solid var(--c4ai-line);
  background: var(--c4ai-surface);
  color: var(--c4ai-text);
  box-shadow: 0 8px 30px #092c4717;
  padding: 11px 15px;
  border-radius: 16px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s,
    visibility 0.2s;
}
.c4ai-tooltip strong {
  display: block;
  font-size: 12px;
  letter-spacing: -0.02em;
}
.c4ai-tooltip > span {
  display: block;
  font-size: 10px;
  margin-top: 2px;
  color: var(--c4ai-muted);
}
.c4ai-near-left .c4ai-tooltip {
  right: auto;
  left: calc(100% + 15px);
}
.c4ai-launcher:focus-visible {
  outline: 3px solid var(--c4ai-accent);
  outline-offset: 8px;
  border-radius: 50%;
}
.c4ai-launcher.c4ai-is-moving,
.c4ai-is-moving .c4ai-drag-handle {
  cursor: grabbing;
}
.c4ai-launcher.c4ai-is-moving .c4ai-tooltip,
.c4ai-launcher.c4ai-is-open .c4ai-tooltip {
  opacity: 0;
  visibility: hidden;
}
.c4ai-panel {
  position: fixed;
  z-index: 113;
  display: flex;
  flex-direction: column;
  width: 420px;
  height: 620px;
  min-width: 0;
  max-width: calc(100vw - 24px);
  border-radius: 26px;
  border: 1px solid var(--c4ai-line);
  background: var(--c4ai-surface);
  color: var(--c4ai-text);
  overflow: hidden;
  box-shadow:
    0 24px 90px #05233629,
    0 4px 18px #0523360f,
    inset 0 1px 0 #ffffff55;
  animation: c4ai-arrive 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}
.c4ai-panel[hidden],
.c4ai-settings[hidden] {
  display: none;
}
.c4ai-panel button,
.c4ai-panel textarea {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.c4ai-panel button {
  cursor: pointer;
}
.c4ai-panel button:focus-visible,
.c4ai-panel a:focus-visible,
.c4ai-drag-handle:focus-visible {
  outline: 2px solid var(--c4ai-accent);
  outline-offset: 3px;
}
.c4ai-panel svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.c4ai-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 83px;
  padding: 13px 12px 13px 18px;
  border-bottom: 1px solid var(--c4ai-line);
  background: linear-gradient(
    135deg,
    var(--c4ai-tint),
    var(--c4ai-surface) 80%
  );
}
.c4ai-drag-handle {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  border-radius: 14px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.c4ai-header-logo {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid #f6d3cd;
  display: grid;
  place-items: center;
  padding: 5px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px #082e4708;
}
.c4ai-header-logo img {
  width: 100%;
  height: auto;
  pointer-events: none;
}
.c4ai-header-copy {
  min-width: 0;
}
.c4ai-header-copy > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: Manrope, sans-serif;
  font-weight: 750;
  letter-spacing: -0.04em;
  font-size: 17px;
  line-height: 1.3;
  outline: none;
}
.c4ai-header-copy > span {
  display: block;
  color: var(--c4ai-muted);
  font-size: 10px;
  margin-top: 4px;
  white-space: nowrap;
}
.c4ai-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c4ai-accent);
  box-shadow: 0 0 0 3px var(--c4ai-tint);
}
.c4ai-move-icon {
  margin-left: auto;
  color: var(--c4ai-muted);
  opacity: 0.6;
  padding: 6px 1px;
}
.c4ai-move-icon svg {
  width: 14px;
  height: 14px;
}
.c4ai-icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--c4ai-muted);
  border-radius: 50%;
  transition:
    color 0.18s,
    background 0.18s;
}
.c4ai-icon-button svg {
  width: 18px;
  height: 18px;
}
.c4ai-preview-note {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 20px;
  background: var(--c4ai-soft);
  border-bottom: 1px solid var(--c4ai-line);
}
.c4ai-preview-note > svg {
  color: var(--c4ai-accent);
  width: 14px;
  height: 14px;
  margin-top: 2px;
}
.c4ai-preview-note p {
  margin: 0;
  font-size: 10px;
  line-height: 1.6;
  color: var(--c4ai-muted);
}
.c4ai-messages {
  flex: 1;
  min-height: 45px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 22px 20px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--c4ai-line) transparent;
}
.c4ai-message {
  margin: 0 0 21px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.c4ai-message-author {
  display: block;
  color: var(--c4ai-accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.c4ai-message p {
  margin: 0;
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.8;
  color: var(--c4ai-text);
}
.c4ai-message-user {
  margin-left: 30px;
  background: var(--c4ai-tint);
  padding: 13px 16px;
  border-radius: 18px 18px 5px 18px;
}
.c4ai-message-user .c4ai-message-author {
  color: var(--c4ai-muted);
  margin-bottom: 4px;
}
.c4ai-answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}
.c4ai-answer-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  max-width: 100%;
  border: 1px solid var(--c4ai-line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--c4ai-accent);
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  transition:
    background 0.18s,
    border-color 0.18s;
}
.c4ai-answer-link svg {
  width: 13px;
  height: 13px;
  transition: transform 0.18s;
}
.c4ai-answer-link span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.c4ai-prompts {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 19px 13px;
}
.c4ai-prompts button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--c4ai-line);
  background: transparent;
  color: var(--c4ai-muted);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  transition:
    color 0.18s,
    background 0.18s,
    border-color 0.18s;
}
.c4ai-composer {
  flex-shrink: 0;
  padding: 14px 18px 12px;
  border-top: 1px solid var(--c4ai-line);
  background: var(--c4ai-surface);
}
.c4ai-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border-radius: 20px;
  border: 1px solid var(--c4ai-line);
  padding: 5px 6px 5px 13px;
  background: var(--c4ai-soft);
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
.c4ai-input-wrap:focus-within {
  border-color: var(--c4ai-accent);
  box-shadow: 0 0 0 3px var(--c4ai-tint);
}
.c4ai-panel .c4ai-input-wrap textarea {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 90px;
  resize: none;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 9px 0;
  background: transparent;
  color: var(--c4ai-text);
  font-size: 12px;
  line-height: 1.6;
  outline: none;
  box-shadow: none;
}
.c4ai-input-wrap textarea::placeholder {
  color: var(--c4ai-muted);
  opacity: 1;
}
.c4ai-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  border: 0;
  background: var(--c4ai-accent);
  color: var(--inverse, #fff);
  box-shadow: 0 2px 7px #dc240c20;
  transition:
    filter 0.18s,
    transform 0.18s;
}
.c4ai-composer > p {
  margin: 7px 0 0;
  text-align: center;
  color: var(--c4ai-muted);
  font-size: 9px;
}
.c4ai-settings {
  flex-shrink: 0;
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--c4ai-soft);
  border-bottom: 1px solid var(--c4ai-line);
  padding: 12px 20px;
}
.c4ai-settings > p:first-child {
  color: var(--c4ai-text);
  font-size: 12px;
  font-weight: 650;
  margin: 0 0 8px;
}
.c4ai-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 3px 0;
  color: var(--c4ai-muted);
  font-size: 11px;
}
.c4ai-control-row > div {
  display: flex;
  gap: 6px;
}
.c4ai-control-row button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--c4ai-line);
  border-radius: 999px;
  color: var(--c4ai-text);
  background: var(--c4ai-surface);
  font-size: 18px;
  line-height: 1;
}
.c4ai-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0;
}
.c4ai-control-actions button {
  min-height: 36px;
  border: 1px solid var(--c4ai-line);
  border-radius: 999px;
  background: var(--c4ai-surface);
  color: var(--c4ai-text);
  padding: 7px 10px;
  font-size: 10px;
}
.c4ai-settings .c4ai-control-help {
  color: var(--c4ai-muted);
  font-size: 9px;
  line-height: 1.7;
  margin: 7px 0 0;
}
.c4ai-sr-only {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
[data-theme="dark"] .c4ai-panel {
  box-shadow:
    0 25px 100px #0008,
    0 0 0 1px #ffffff04;
}
[data-theme="dark"] .c4ai-launcher {
  border-color: #f08b7e;
  box-shadow:
    0 9px 30px #0005,
    inset 0 1px 1px #ffffff3b;
}
@media (hover: hover) and (pointer: fine) {
  .c4ai-launcher:hover {
    box-shadow:
      0 12px 36px #dc240c40,
      0 2px 9px #092c4726,
      inset 0 1px 1px #ffffff50;
    border-color: #fcd3cc;
  }
  .c4ai-launcher:hover .c4ai-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
  }
  .c4ai-launcher.c4ai-is-open:hover .c4ai-tooltip,
  .c4ai-launcher.c4ai-is-moving:hover .c4ai-tooltip {
    opacity: 0;
    visibility: hidden;
  }
  .c4ai-icon-button:hover {
    background: var(--c4ai-tint);
    color: var(--c4ai-accent);
  }
  .c4ai-prompts button:hover,
  .c4ai-control-actions button:hover,
  .c4ai-control-row button:hover {
    background: var(--c4ai-tint);
    color: var(--c4ai-accent);
    border-color: var(--c4ai-accent);
  }
  .c4ai-answer-link:hover {
    background: var(--c4ai-tint);
    border-color: var(--c4ai-accent);
  }
  .c4ai-answer-link:hover svg {
    transform: translateX(2px);
  }
  .c4ai-send:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
  }
}
.c4ai-send:active,
.c4ai-prompts button:active,
.c4ai-icon-button:active {
  transform: scale(0.96);
}
@keyframes c4ai-arrive {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 600px) {
  .c4ai-launcher {
    padding: 6px;
  }
  .c4ai-ai-badge {
    min-width: 20px;
    height: 18px;
    font-size: 8px;
  }
  .c4ai-panel {
    border-radius: 24px;
  }
  .c4ai-header {
    min-height: 77px;
    padding: 11px 10px 11px 15px;
    gap: 1px;
  }
  .c4ai-header-logo {
    width: 39px;
    height: 39px;
  }
  .c4ai-header-copy > h2 {
    font-size: 16px;
  }
  .c4ai-header-copy > span {
    font-size: 9px;
  }
  .c4ai-move-icon {
    display: none;
  }
  .c4ai-drag-handle {
    gap: 9px;
  }
  .c4ai-tooltip {
    display: none;
  }
  .c4ai-panel .c4ai-input-wrap textarea {
    font-size: 16px;
    padding-block: 7px;
  }
  .c4ai-preview-note {
    padding-inline: 17px;
  }
  .c4ai-messages {
    padding-inline: 17px;
  }
  .c4ai-prompts {
    padding-inline: 16px;
  }
  .c4ai-composer {
    padding-inline: 14px;
  }
}
@media (pointer: coarse) {
  .c4ai-prompts button,
  .c4ai-answer-link,
  .c4ai-control-actions button {
    min-height: 44px;
  }
}
@media (max-height: 580px) {
  .c4ai-header {
    min-height: 65px;
    padding-block: 7px;
  }
  .c4ai-prompts {
    display: none;
  }
  .c4ai-preview-note {
    padding-block: 8px;
  }
  .c4ai-composer {
    padding-block: 9px;
  }
  .c4ai-settings {
    max-height: 130px;
  }
}
/* Mobile keyboards shrink the visual viewport independently of CSS media queries. */
.c4ai-panel.c4ai-compact .c4ai-header {
  min-height: 65px;
  padding-block: 7px;
}
.c4ai-panel.c4ai-compact .c4ai-prompts {
  display: none;
}
.c4ai-panel.c4ai-compact .c4ai-preview-note {
  padding-block: 8px;
}
.c4ai-panel.c4ai-compact .c4ai-composer {
  padding-block: 9px;
}
.c4ai-panel.c4ai-compact .c4ai-settings {
  max-height: 130px;
}
.c4ai-panel.c4ai-tight .c4ai-preview-note,
.c4ai-panel.c4ai-tight .c4ai-composer > p {
  display: none;
}
.c4ai-panel.c4ai-tight .c4ai-header {
  min-height: 54px;
  padding: 4px 8px 4px 12px;
}
.c4ai-panel.c4ai-tight .c4ai-header-logo {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}
.c4ai-panel.c4ai-tight .c4ai-header-copy > h2 {
  font-size: 15px;
}
.c4ai-panel.c4ai-tight .c4ai-header-copy > span {
  font-size: 8px;
  margin-top: 2px;
}
.c4ai-panel.c4ai-tight .c4ai-messages {
  min-height: 24px;
  padding: 10px 15px 0;
}
.c4ai-panel.c4ai-tight .c4ai-message {
  margin-bottom: 13px;
}
.c4ai-panel.c4ai-tight .c4ai-composer {
  padding: 8px 12px;
}
.c4ai-panel.c4ai-tight .c4ai-settings {
  max-height: max(0px, min(70px, calc(100% - 160px)));
  padding-block: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .c4ai-launcher::before { display: none; }
  .c4ai-launcher,
  .c4ai-launcher::before,
  .c4ai-tooltip,
  .c4ai-panel,
  .c4ai-panel *,
  .c4ai-panel *::before,
  .c4ai-panel *::after {
    animation: none !important;
    transition: none !important;
  }
  .c4ai-panel button:active,
  .c4ai-answer-link:hover svg,
  .c4ai-send:hover {
    transform: none;
  }
}
/* The C4 mark in its own colours straight on the dark orb (founder, 26 October 2026, after a white trial: "the colour
   surrounding it should not be white"): the same logo everywhere, in the Passport, the console and on the site, lifted
   off the navy by a light edge, so the orb reads as one circle on every page and on real phones. These rules outrank
   brand.css's `:root .c4-logo` on the site and the tile rule above in the app. */
:root .c4ai-launcher .c4ai-launcher-mark {
  width: 78%;
  aspect-ratio: 512 / 369;
  display: block;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  line-height: 0;
}
:root .c4ai-launcher .c4ai-launcher-mark picture { display: contents; }
:root .c4ai-launcher .c4ai-launcher-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 1.5px #ffffffd9) drop-shadow(0 0 6px #f7a89d80) drop-shadow(0 2px 3px #00000080);
}
