/* app.tenvor.io patch (2026-11-24), loaded after the app's own stylesheet.
   1. The app's loading screen: the new Tenvor mark inside a ring that turns, and a visible status line, on the
      console's paper colour, instead of a white sheet whose faint ring stopped after four turns. The same markup is in
      index.html's #root, so it shows from the first paint until the app replaces it.
   2. The new mark (/tenvor-logo.png is now the ink T on a transparent ground): drawn white on the dark sign-in card,
      and in the Chat sidebar in the sidebar's own text colour, so it reads in light and dark. */

html body .tc-app-loading {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-areas: "mark" "label";
  place-items: center;
  align-content: center;
  gap: 20px;
  margin: 0;
  background: #f1f0ec;
  color: #161329;
}

/* The mark sits in the middle of the ring and breathes; the ring turns. */
html body .tc-app-loading::before {
  content: "";
  grid-area: mark;
  width: 24px;
  height: 21px;
  background: url("/tenvor-mark.svg") center / contain no-repeat;
}

html body .tc-app-loading .tc-app-loading-ring {
  grid-area: mark;
  box-sizing: border-box;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(22, 19, 41, 0.1);
  border-top-color: #161329;
  border-radius: 50%;
}

html body .tc-app-loading .tc-app-loading-label {
  grid-area: label;
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: nowrap;
  font: 500 13px/1.4 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  color: rgba(22, 19, 41, 0.62);
}

html body .tc-app-loading .tc-app-loading-label::after {
  content: "…";
}

/* Motion only for a visitor who allows it, and never forever (the project's BRIEF section 11): the ring turns for about
   half a minute, which covers a slow first load; then the mark and the line stay, still. */
@media (prefers-reduced-motion: no-preference) {
  html body .tc-app-loading::before,
  html body .tc-app-loading .tc-app-loading-label {
    opacity: 0;
    animation: tvp-show 0.2s ease 0.15s forwards;
  }
  html body .tc-app-loading::before {
    animation: tvp-show 0.2s ease 0.15s forwards, tvp-breathe 1.8s ease-in-out 0.35s 16;
  }
  html body .tc-app-loading .tc-app-loading-ring {
    opacity: 0;
    animation: tvp-show 0.2s ease 0.15s forwards, tvp-spin 0.9s linear 0.15s 34;
  }
  @keyframes tvp-spin {
    to { transform: rotate(360deg); }
  }
  @keyframes tvp-show {
    to { opacity: 1; }
  }
  @keyframes tvp-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.88); }
  }
}

/* The new mark on the dark signed-out console card. */
.console-access-card img[src="/tenvor-logo.png"] {
  filter: brightness(0) invert(1);
}

/* Chat sidebar: the mark in the sidebar's text colour (light and dark). */
.cwa-brand img[src="/tenvor-logo.png"] {
  display: none;
}

.cwa-brand::before {
  content: "";
  flex: none;
  width: 26px;
  height: 23px;
  background-color: currentColor;
  -webkit-mask: url("/tenvor-mark.svg") center / contain no-repeat;
  mask: url("/tenvor-mark.svg") center / contain no-repeat;
}

/* Sign-in card: "Trusted by" names the companies in plain text instead of six empty logo placeholders. */
/* The block is as wide as its heading, so the names can sit centred under the middle of that sentence. */
html body .ax-trusted {
  width: fit-content;
  max-width: 100%;
}

html body .ax-trusted .ax-logo-grid,
html body .ax-trusted .ax-placeholder-note {
  display: none;
}

html body .ax-trusted h3 {
  font-size: 0;
}

html body .ax-trusted h3::after {
  content: "Trusted by professionals at leading technology companies";
  font-size: 14px;
}

html body .ax-trusted::after {
  content: "NVIDIA Apple Microsoft Google";
  display: block;
  text-align: center;
  white-space: pre-wrap;
  word-spacing: 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ax-ink-2, #55546a);
}

/* Signed-out /console: the console shows its old "Account state stays behind sign-in" card for a moment, then sends the
   visitor to /sign-in and keeps the card up while that page's code loads. Draw that moment as the loading screen. */
html body .console-access-surface {
  position: fixed;
  inset: 0;
  z-index: 60;
  min-height: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-areas: "mark" "label";
  place-items: center;
  align-content: center;
  gap: 20px;
  /* The mark, centred in the ring (ring 60px + gap 20px + an 18px line: the ring's centre is 19px above the middle). */
  background: #f1f0ec url("/tenvor-mark.svg") no-repeat center calc(50% - 19px) / 24px 21px;
}

html body .console-access-surface > .console-access-card {
  display: none;
}

html body .console-access-surface::before {
  content: "";
  grid-area: mark;
  box-sizing: border-box;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(22, 19, 41, 0.1);
  border-top-color: #161329;
  border-radius: 50%;
}

html body .console-access-surface::after {
  content: "Opening sign-in…";
  grid-area: label;
  white-space: nowrap;
  font: 500 13px/1.4 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
  color: rgba(22, 19, 41, 0.62);
}

@media (prefers-reduced-motion: no-preference) {
  html body .console-access-surface::before {
    animation: tvp-spin 0.9s linear 34;
  }
}
