/* Application tooltips ---------------------------------------------------
   A single fixed layer replaces inconsistent browser title bubbles. It is
   positioned by tooltips.js so it can escape clipped cards and menus, flip at
   viewport edges, and remain identical for pointer and keyboard users. */
.cf-tooltip {
  --cf-tooltip-background: #0a0e27;
  --cf-tooltip-foreground: #f8fafc;
  --cf-tooltip-border: rgba(64, 115, 243, 0.5);
  position: fixed;
  /* Reset native popover centering; tooltips.js supplies viewport coordinates. */
  inset: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  z-index: 1000010;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  border: 1px solid var(--cf-tooltip-border);
  border-radius: 8px;
  background: var(--cf-tooltip-background);
  color: var(--cf-tooltip-foreground);
  box-shadow: 0 8px 24px rgba(10, 14, 39, 0.24), 0 2px 7px rgba(10, 14, 39, 0.18);
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.005em;
  overflow-wrap: anywhere;
  white-space: pre-line;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px) scale(0.985);
  transform-origin: center top;
  transition: opacity 120ms ease, transform 120ms ease;
}

.cf-tooltip-content {
  display: block;
  max-height: calc(100vh - 16px);
  overflow: hidden;
  padding: 7px 10px;
  border-radius: inherit;
}

.cf-tooltip.is-markdown {
  white-space: normal;
}

.cf-tooltip.is-markdown,
.cf-tooltip.has-title {
  max-width: min(360px, calc(100vw - 16px));
}

.cf-tooltip.has-title .cf-tooltip-content {
  padding: 9px 11px;
}

/* Three tiers of emphasis - name, state, description - so a tooltip's subject
   is legible at a glance instead of competing with its own metadata. */
.cf-tooltip-title {
  margin: 0 0 3px;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

/* Identity chip ahead of the title, echoing the color of the mark the tooltip
   describes (e.g. the environment dog-ear) so the color gets a name. The faint
   inner ring keeps light and dark chips visible against the dark surface. */
.cf-tooltip-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 3px;
  vertical-align: -1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.cf-tooltip-meta {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(248, 250, 252, 0.6);
}

.cf-tooltip-meta-separator {
  padding: 0 5px;
  color: rgba(248, 250, 252, 0.3);
}

.cf-tooltip-meta-item {
  font-weight: inherit;
}

.cf-tooltip-meta-item.is-running,
.cf-tooltip-meta-item.is-live {
  color: #f4b740;
  font-weight: 600;
}

.cf-tooltip-meta-item.is-completed {
  color: #2eb67d;
  font-weight: 600;
}

.cf-tooltip-meta-item.is-failed {
  color: #f2788c;
  font-weight: 600;
}

/* Start file totals on their own compact line within the tooltip metadata. */
.cf-tooltip-meta-separator:has(+ .is-change-start),
.cf-tooltip-meta-separator:has(+ .is-change-start-added),
.cf-tooltip-meta-separator:has(+ .is-change-start-deleted) {
  display: block;
  height: 4px;
  padding: 0;
  font-size: 0;
}

.cf-tooltip-meta-item.is-added,
.cf-tooltip-meta-item.is-change-start-added {
  color: #2eb67d;
  font-weight: 600;
}

.cf-tooltip-meta-item.is-deleted,
.cf-tooltip-meta-item.is-change-start-deleted {
  color: #f2788c;
  font-weight: 600;
}

.cf-tooltip-meta-item.is-approve {
  color: #2eb67d;
  font-weight: 700;
}

.cf-tooltip-meta-item.is-review {
  color: #7cecff;
  font-weight: 600;
}

/* A keyboard shortcut is something you press, not something you read, so it
   renders as a keycap rather than as more muted prose in parentheses. */
.cf-tooltip-meta-item.is-shortcut,
.cf-tooltip-row-item.is-shortcut {
  padding: 1px 5px;
  border: 1px solid rgba(248, 250, 252, 0.22);
  border-radius: 4px;
  background: rgba(248, 250, 252, 0.1);
  color: #ffffff;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.cf-tooltip-divider {
  margin: 7px 0 6px;
  border: 0;
  border-top: 1px solid rgba(248, 250, 252, 0.14);
}

.cf-tooltip-body {
  font-weight: 400;
  color: rgba(248, 250, 252, 0.86);
  white-space: inherit;
}

/* A body written as rows keeps one line per row, a short break between blocks,
   and the meta line's tints for figures inside a line. */
.cf-tooltip-row.is-gap {
  height: 5px;
}

/* Keycaps inside body rows (a list of shortcuts) need air between lines. */
.cf-tooltip-row-item.is-shortcut {
  display: inline-block;
  margin: 2px 0;
}

.cf-tooltip-row-item.is-strong {
  font-weight: 700;
}

.cf-tooltip-row-item.is-added {
  color: #2eb67d;
}

.cf-tooltip-row-item.is-deleted {
  color: #f2788c;
}

.cf-tooltip-heading {
  margin: 0 0 5px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.cf-tooltip-paragraph {
  margin: 0 0 5px;
}

.cf-tooltip-paragraph:last-child,
.cf-tooltip-list:last-child,
.cf-tooltip-quote:last-child,
.cf-tooltip-code-block:last-child {
  margin-bottom: 0;
}

.cf-tooltip-list {
  margin: 3px 0 6px;
  padding-left: 18px;
}

.cf-tooltip-list li + li {
  margin-top: 2px;
}

.cf-tooltip-code,
.cf-tooltip-code-block {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.cf-tooltip-code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(248, 250, 252, 0.12);
  color: #ffffff;
}

.cf-tooltip-code-block {
  margin: 5px 0 7px;
  padding: 6px 8px;
  border: 1px solid rgba(64, 115, 243, 0.36);
  border-radius: 5px;
  background: rgba(248, 250, 252, 0.08);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.cf-tooltip-quote {
  margin: 5px 0 7px;
  padding-left: 8px;
  border-left: 2px solid #4073f3;
  color: rgba(248, 250, 252, 0.86);
}

.cf-tooltip-link {
  color: #7cecff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cf-tooltip-rule {
  margin: 6px 0;
  border: 0;
  border-top: 1px solid rgba(248, 250, 252, 0.2);
}

:root[data-theme="dark"] .cf-tooltip {
  --cf-tooltip-background: #17213a;
  --cf-tooltip-border: rgba(0, 212, 255, 0.3);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42), 0 2px 8px rgba(0, 0, 0, 0.28);
}

.cf-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cf-tooltip::after {
  content: "";
  position: absolute;
  left: var(--cf-tooltip-arrow-left, 50%);
  width: 8px;
  height: 8px;
  background: var(--cf-tooltip-background);
  /* Overlap the bubble's edge so its outline continues around the pointer. */
  border-right: 1px solid var(--cf-tooltip-border);
  border-bottom: 1px solid var(--cf-tooltip-border);
  transform: translateX(-50%) rotate(45deg);
}

.cf-tooltip[data-placement="top"] {
  transform-origin: center bottom;
}

.cf-tooltip[data-placement="top"]::after {
  bottom: -4px;
}

.cf-tooltip[data-placement="bottom"]::after {
  top: -4px;
  transform: translateX(-50%) rotate(225deg);
}

@media (prefers-reduced-motion: reduce) {
  .cf-tooltip {
    transition: none;
  }
}

@media (forced-colors: active) {
  .cf-tooltip,
  :root[data-theme="dark"] .cf-tooltip {
    --cf-tooltip-background: Canvas;
    --cf-tooltip-foreground: CanvasText;
    --cf-tooltip-border: CanvasText;
    box-shadow: none;
  }

  /* Forced colors flattens the tiers' opacity ramp, so restore the contrast
     with the system palette rather than leaving the meta line unreadable. */
  .cf-tooltip-title,
  .cf-tooltip-meta,
  .cf-tooltip-meta-separator,
  .cf-tooltip-meta-item,
  .cf-tooltip-body,
  .cf-tooltip-row-item {
    color: CanvasText;
  }

  .cf-tooltip-divider {
    border-top-color: CanvasText;
  }
}
