/* ============================================================================
   1-Ventures — Branded loading system
   ----------------------------------------------------------------------------
   One file, loaded by every page shell (admin login, portal, mentor, SME,
   public forms). It answers a single requirement: whenever the product makes
   the user wait, they see the 1-Ventures mark — not a generic spinner.

   How it works: the Font Awesome spinner glyph is made transparent and the
   1-Ventures mark is painted as the element's background. Because that element is
   already positioned inside every existing "Loading…" surface, this upgrades
   all of them without touching a single call site — no markup churn, no JS
   injection, and nothing can drift out of sync later.

   The 1-Ventures logo is also offered as a reusable block/full-page loader
   (.dtv-load*) for surfaces that need more than an inline glyph.

   ── ONE SIZE, ONE PLACE ───────────────────────────────────────────────────
   Every waiting surface in the product paints the SAME logo at the SAME size,
   centred. That size is declared exactly once, here, as --dtv-loader-logo-w.
   Nothing below may hard-code a logo width again: the page loader, the stage
   loader, its inset and panel variants, and the legacy .spinner all consume
   this token, so "the logo while loading" is one visual constant rather than
   five sizes that drifted apart as each surface was written.

   Before this, the same PNG rendered at 440px (stage), 380px (is-inset),
   280px (is-panel) and 150px (.spinner) — and the three stage variants mixed a
   percentage of their parent with a vh term, so even the pair of full-page
   loaders could disagree on a wide monitor. The product therefore showed a
   differently-sized logo on nearly every page.

   The vw term is not a second size: it is a viewport guard so the lockup can
   never overflow a phone. The cap is what keeps the mark from being clipped;
   the nominal size is still the token.

   TWO EXCEPTIONS, both deliberately NOT this token, and neither is a "loading
   logo" in the page sense — they are text-flow glyphs that sit inline beside a
   label that is already the same size as their box:
     • rule 1 (.fa-spinner / .fa-circle-notch) is em-sized, so it inherits the
       type size of whatever button, badge or table cell contains it;
     • .dtv-load-mark is 26px, the standing glyph in the .dtv-load block row.
   Scaling either to 440px would push the label off its own line. Everything
   that owns a waiting AREA — page, stage, inset, panel and .spinner — is the
   token. */
:root {
  /* The one loading-logo width the product is designed around. */
  --dtv-loader-logo-w: 440px;
  /* The SAME lockup aspect ratio (1800 x 537), for elements that paint the mark
     as a background and so need their own height. */
  --dtv-loader-logo-ratio: 1800 / 537;
  /* The single width expression EVERY loading surface uses. Its three terms are
     all viewport-relative, never container-relative, so two surfaces on the
     same screen can never disagree:
       1. the nominal design width;
       2. a width guard, so the lockup cannot overflow a phone;
       3. a height guard, so on a short viewport (landscape phone, 720p laptop
          with browser chrome) the logo does not push its own bar and message
          below the fold. max() keeps it from collapsing to nothing.
     This is why the sizing lives here and not in each rule: the earlier code
     repeated a DIFFERENT guard per variant (one per logo size), which is what
     let them drift apart in the first place. */
  /* The height guard's factor is the artwork RATIO (1800 / 537 = 3.352), not a
     magic number: to spend H px of height on the logo, its width must be
     H x ratio. This used to read 2.318, which was derived from an 818px-tall
     asset the file no longer is — the real PNG is 537px tall, so 2.318 was
     ~29% too small and the guard shrank the mark on short viewports for no
     reason. Written out as the ratio so it cannot drift from the asset again. */
  --dtv-loader-logo-size: min(
    var(--dtv-loader-logo-w),
    88vw,
    max(200px, calc((100dvh - 300px) * 3.352))
  );
}

/* ── 1. Inline spinner → 1-Ventures mark ─────────────────────────────────────────
   Applies to .fa-spinner wherever it appears: buttons, table bodies, panels,
   modals. The glyph is hidden with `color: transparent`, which keeps Font
   Awesome's em-based box (and therefore the surrounding layout) intact, and
   the mark is painted on the element itself.

   The background is set ONLY on the element, never on ::before. FA renders the
   glyph in ::before; setting a background on both would paint two marks — one
   on the element and one inside the glyph box — offset by the icon's
   line-height. So ::before is explicitly reset to `background: none`. */
/* .fa-circle-notch is upgraded with .fa-spinner, not instead of it. Ten call
   sites across the live bundle use `fa-circle-notch fa-spin` for the same
   purpose (`Uploading`, `Designing`, `Submitting…`, the portfolio tracker's
   .pf-loading, the document-analysis AI badge). Leaving it out was the whole
   reason the "old small logo" kept appearing on some pages: this rule is the
   only thing that repaints a spinner in place, so an icon it does not name
   silently keeps the stock Font Awesome ring. Any new spinner icon added to
   the app belongs in this selector list. */
.fa-spinner,
.fas.fa-spinner,
.fa-solid.fa-spinner,
.fa-circle-notch,
.fas.fa-circle-notch,
.fa-solid.fa-circle-notch {
  color: transparent !important;
  /* ONE asset for every loading state in the product: the 1-Ventures lockup
     (dtv-logo.png). This used to paint dtv-mark.png — a 512x512 square mark —
     while the page and stage loaders painted the full lockup, so the same
     product showed two different logos depending on which spinner fired. The
     lockup is what the sign-in doors and the nav already render, so "the logo
     while loading" and "the logo everywhere else" are now the same file. */
  background-image: url('/static/logos/dtv-logo.png?v=ae1a951b0f');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* The lockup is 1800/537 = 3.352:1, so a square box would squash it into an
     unreadable sliver. Give the glyph a box matching the artwork's own ratio;
     height keeps the em-based rhythm of the surrounding text. (The ratio was
     written here as "2.318:1", which is the stale figure of an 818px-tall
     asset; the em minimums themselves are unchanged.) */
  min-width: 2.45em;
  min-height: 1.06em;
  display: inline-block;
  vertical-align: -0.16em;
}

.fa-spinner::before,
.fas.fa-spinner::before,
.fa-solid.fa-spinner::before,
.fa-circle-notch::before,
.fas.fa-circle-notch::before,
.fa-solid.fa-circle-notch::before {
  background: none !important;
  color: transparent !important;
}

/* Stop the 360° glyph rotation (it would spin the logo and read as a fault)
   and breathe instead. !important beats the inline animation from FA. */
.fa-spinner.fa-spin,
.fas.fa-spinner.fa-spin,
.fa-solid.fa-spinner.fa-spin,
.fa-circle-notch.fa-spin,
.fas.fa-circle-notch.fa-spin,
.fa-solid.fa-circle-notch.fa-spin {
  animation: dtvMarkBreathe 1.35s ease-in-out infinite !important;
}

/* Opacity-only, for the same reason as dtvStageBreathe below: every element
   this drives paints the logo as a RASTER (an <img>, or an element whose
   background-image is the PNG). A scale() is a geometric change, so the browser
   re-rasterises the artwork on every frame and the fine type crawls. Opacity is
   a compositor property and moves nothing.
   The floor moved from .45 to .55 because these glyphs are small (2.45em wide),
   where .45 over already->89%-opaque strokes made the mark read as a smudge. */
@keyframes dtvMarkBreathe {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1;   }
}

/* ── 1b. Border-spinner class → 1-Ventures mark ─────────────────────────────────
   `.spinner` is the CSS-drawn ring used by the portal/mentor/SME shells. It is
   replaced outright: the ring border is removed and the lockup takes its place
   at the same footprint. This file is linked after each page's inline <style>,
   so an equal-specificity rule here wins over the ring definition.

   Same asset as rule 1 and rule 3 — one logo for every waiting state.

   Sizing is deliberately NOT forced with !important on .spinner itself: one
   call site puts this class inside a button at 16x16, and a forced 150px box
   would explode the button mid-save. Instead the default box is set with the
   element selector and the in-button case is opted out explicitly below. */
.spinner {
  border: 0 !important;
  border-radius: 0 !important;
  background: url('/static/logos/dtv-logo.png?v=ae1a951b0f') center / contain no-repeat !important;
  animation: dtvMarkBreathe 1.35s ease-in-out infinite !important;
  /* Same size as every other loading logo — the shared token, never a local
     literal. This used to be a 150x65 box, i.e. a third the size of the stage
     loader, so the two most common waiting states disagreed on screen. */
  width: var(--dtv-loader-logo-size, 440px);
  max-width: 100%;
  /* The mark here is a background image, so the element needs its own height:
     derive it from the artwork ratio rather than hard-coding 65px. */
  aspect-ratio: var(--dtv-loader-logo-ratio, 1800 / 537);
  height: auto !important;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  display: block;
}
/* A lockup inside a button: keep it in the text flow beside its label and give
   it the artwork ratio at text size, so it reads as a small logo rather than a
   squashed sliver. */
body .spinner[style*="width:16px"],
body .spinner[style*="width: 16px"] {
  width: 37px !important;
  height: 16px !important;
  display: inline-block !important;
  vertical-align: -0.2em;
  margin: 0 .4rem 0 0 !important;
}

/* ── 2. Block loader — sits inside a panel/list while its data loads ────── */
.dtv-load {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 18px;
  color: #5B6B77;
  font-size: .8125rem;
}
.dtv-load-mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  animation: dtvMarkBreathe 1.35s ease-in-out infinite;
}
.dtv-load-msg { line-height: 1.5; }

/* ── 3. Full-page loader — first paint of any portal/login surface ─────── */
.dtv-load-page {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #F5F8F9;
}
/* The shared token, same as every other loading logo — no local literal. This
   was min(672px, ...), i.e. 232px wider than the stage loader beside it, so the
   first-paint logo and the in-page logo were visibly different sizes. */
.dtv-load-page-logo {
  width: var(--dtv-loader-logo-size, 440px);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  animation: dtvMarkBreathe 1.9s ease-in-out infinite;
}
/* The bar tracks the logo width so the pair reads as one block. It used to be
   min(672px, 92vw) capped at 60vw — a third width again, and the two elements
   were not aligned to each other's edges. */
.dtv-load-bar {
  width: var(--dtv-loader-logo-size, 440px);
  max-width: 100%;
  height: 3px;
  border-radius: 99px;
  background: #E4EAED;
  overflow: hidden;
}
.dtv-load-bar > i {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: 99px;
  background: linear-gradient(90deg, #31B39A, #F5822B, #1E4E8C);
  animation: dtvLoadSlide 1.5s cubic-bezier(.55, .1, .45, .9) infinite;
}
.dtv-load-page-msg {
  font-size: .8125rem;
  font-weight: 600;
  color: #0F1B26;
  letter-spacing: -.005em;
}
@keyframes dtvLoadSlide {
  0%   { transform: translateX(-105%); }
  100% { transform: translateX(280%); }
}

/* ── 3b. Stage loader — THE waiting state for every page and sub-page ────
   One component for all of them: app.js renderPage(), the shell's initial
   #page-content markup, dash/host.js, modules/10-dtv-tasks.js and the portal
   dashboards. Never a 28px ring or a 32px FA glyph again.

   Centring: the block fills the space under the header (100vh minus header
   and the 24px main padding) and centres on both axes, so the mark sits in
   the middle of the page rather than at the top of a 60vh box.
   Size: 440px, down from 672px — still comfortably readable, no longer
   dominating the viewport. It fades between full and ~58% opacity (opacity
   ONLY — see .dtv-stage-load-logo for why a transform here was the glitch),
   so it reads as a calm watermark while the bar carries the progress. */
.dtv-stage-load {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  /* Fill the CONTENT AREA — the column to the right of the sidebar, from just
     under the top bar to the bottom of the viewport — then centre on both axes.

     --dtv-load-h is the MEASURED height of the content area: the viewport
     height minus the top bar, minus #page-content's own top and bottom padding.
     app.js writes it in dtvLoaderFit() every time a loader is painted and on
     resize, because the figure differs per viewport (710px on an 844px phone,
     670px on an 820px laptop viewport). Hard-coding it was the actual bug: no
     single constant is right for both, and the wrong one left the mark sitting
     high with ~170px of dead space under it. The calc() fallback covers only
     the very first paint, before any measurement has run. */
  min-height: var(--dtv-load-h, calc(100dvh - 160px));
  /* Asymmetric padding is deliberate: flexbox centres the whole group (logo +
     bar + label), but the bar and label hang BELOW the logo, so the mark itself
     rides high by half their stacked height — bar 3px + two 18px gaps + label
     ~20px = 59px, i.e. 29.5px. Top therefore needs 59px more than bottom;
     92 - 32 = 60. That puts the VISIBLE mark, not merely the <img> box, on the
     centre line of the content area.

     The old value was 100px, and the extra 8px was a correction for the PNG
     supposedly sitting "18.5px high in an 818px-tall image". Measured against
     the actual asset (1800x537, ink y 25..510) the top and bottom gaps are 25
     and 26 px — a 1px, 0.24px-at-display-size imbalance, i.e. nothing to
     correct. The 8px was compensation for a defect that does not exist, which
     pushed the mark below the centre line by 8px on every waiting surface. */
  padding: 92px 18px 32px;
  text-align: center;
  box-sizing: border-box;
}
.dtv-stage-load-logo {
  /* The shared token — identical to .dtv-load-page-logo, .spinner and every
     variant below. No percentage of the parent: `78%` meant the same logo was
     344px inside a 440px column but 936px inside a wide one. */
  width: var(--dtv-loader-logo-size, 440px);
  max-width: 100%;
  height: auto;
  display: block;
  /* Centred horizontally on every surface. margin-inline:auto centres a block
     element; the parent flex column also centres, so this is belt-and-braces
     and survives a host that forgets align-items. */
  margin-inline: auto;
  /* object-fit is stated, not inherited. The markup gives this img width="440"
     height="132", a 3.333 ratio against an asset that is 3.352 — and with no
     object-fit the computed value is `fill`, so the artwork was being stretched
     into a box it does not share a ratio with. `contain` makes the declared
     attributes irrelevant to the rendering and keeps the lockup geometrically
     exact no matter what a host page writes in the tag. */
  object-fit: contain;
  /* The breathing is an OPACITY fade only, never a transform.
     It used to be opacity .45 -> .72 together with transform: scale(.98 -> 1).
     That transform physically resized the element every frame: measured across
     46 consecutive frames the width moved 431.22px -> 440.00px, 43 distinct
     widths. A raster image that is re-scaled on each frame is re-rasterised on
     each frame, which is what made the small "ONE VENTURES" line crawl and
     shimmer (the reported glitch). Opacity is composited, so it cannot move a
     single pixel of the artwork.
     The 1.0 floor is deliberate rather than .55: the PNG's own strokes are only
     ~89-96% opaque, so a .55 base made the effective coverage under half and the
     fine type read as grey. The fade now runs 1 -> .58, which still breathes but
     keeps the wordmark legible at the dimmest point. */
  opacity: 1;
  animation: dtvStageBreathe 2.1s ease-in-out infinite;
}

/* Inset variant — for a panel that already draws its own header and tab row
   above the waiting area (Virtual Incubator's #vi-body, the portfolio
   tracker). Filling 100vh there would push the mark far below the fold and
   double-count the chrome, so this variant centres inside the space it
   actually has while keeping the identical logo, bar and message. */
.dtv-stage-load.is-inset {
  /* The host panel already draws a header and a tab row above the waiting
     area, so --dtv-load-h (which assumes the loader starts right under the top
     bar) is the wrong frame here. dtvLoaderFit() measures THIS element's own
     top instead and writes the remaining height inline, so the mark centres in
     the space actually visible below the tabs. min-height:0 is the pre-measure
     state: no 100dvh jump before JS runs. */
  min-height: 0;
  width: 100%;
  /* Same optical correction as the full-page rule, now that the logo is the
     same 440px in both: 59px for the bar/gaps/label, and nothing for the
     artwork (measured ink imbalance is 0.24px at this size). 92 - 32 = 60,
     identical to .dtv-stage-load. */
  padding: 92px 18px 32px;
}
/* Size is NOT overridden here any more. The variant only controls the FRAME it
   centres inside, never the artwork: one logo, one size, everywhere. */
.dtv-stage-load.is-inset .dtv-stage-load-logo {
  width: var(--dtv-loader-logo-size, 440px);
}
.dtv-stage-load.is-inset .dtv-load-bar {
  width: var(--dtv-loader-logo-size, 440px);
}

/* Panel variant — the waiting state of ONE tab or card inside an already
   rendered page: the portal's budget, playbook, Gantt and documents panels,
   the roadmap tracker, and the portfolio figures block. These hosts are
   AUTO-HEIGHT (they size to their content), so there is no known height to
   fill and no viewport frame to measure against — dtvLoaderFit() deliberately
   skips them. The block therefore supplies its own comfortable box and centres
   inside that, which keeps the mark identical in shape while stopping it from
   claiming a whole screen inside a card.

   SIZE IS THE SAME as everywhere else — the shared token. This variant used to
   shrink the logo to 280px on the argument that these cards are narrow, but
   that is the exact inconsistency being removed: the logo changed size the
   moment a panel loaded instead of a page, which read as a different product
   state. Narrow hosts are handled by the 88vw guard in the token, not by a
   per-variant literal.
   The block still supplies its own comfortable box (it is auto-height and
   dtvLoaderFit() skips it) and keeps the optical correction: bar 3px + two
   18px gaps + label 20px = 59px hangs below the logo (29.5px of ride-high), and
   nothing for the artwork itself (measured ink imbalance 0.24px), so 92px top
   against 32px bottom — the same padding every other variant now uses. */
.dtv-stage-load.is-panel {
  min-height: min(52vh, 420px);
  padding: 92px 18px 32px;
  width: 100%;
}
/* Same size as every other loading logo. No per-variant literal. */
.dtv-stage-load.is-panel .dtv-stage-load-logo {
  width: var(--dtv-loader-logo-size, 440px);
}
.dtv-stage-load.is-panel .dtv-load-bar {
  width: var(--dtv-loader-logo-size, 440px);
}
@keyframes dtvStageBreathe {
  0%, 100% { opacity: 1;   }
  50%      { opacity: .58; }
}
/* The bar inside a stage loader tracks the logo exactly — same token, so the
   two edges align. Was min(440px, 78%), a percentage that shrank with the host
   column while the logo did not. */
.dtv-stage-load .dtv-load-bar {
  width: var(--dtv-loader-logo-size, 440px);
  max-width: 100%;
}
.dtv-stage-load-msg {
  font-size: .8125rem;
  font-weight: 600;
  color: #5B6B77;
  letter-spacing: -.005em;
}

/* ── 4. Branded button busy state ────────────────────────────────────────
   Buttons that swap their label for a spinner keep the 1-Ventures mark from rule 1;
   this only guards the disabled look so it reads as deliberate. */
button:disabled > .fa-spinner,
.btn:disabled > .fa-spinner { opacity: 1; }

/* ── 5. Accessibility ────────────────────────────────────────────────────
   Motion is decorative, never load-bearing: with reduced motion the mark
   stays fully visible and simply stops moving. */
@media (prefers-reduced-motion: reduce) {
  .fa-spinner.fa-spin,
  .fa-circle-notch.fa-spin,
  .dtv-load-mark,
  .dtv-load-page-logo,
  .dtv-stage-load-logo,
  .dtv-load-bar > i {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .dtv-load-bar > i { width: 100%; opacity: .5; }
}

/* ── 6. Login brand band — the 1-Ventures lockup at every door ───────────────────
   ONE definition for all four sign-in surfaces (admin, applicant, SME,
   mentor). The asset is the SAME file the page loader paints
   (dtv-logo.png), so "the logo while loading" and "the logo at the door" are
   literally the same pixels. That is the property the three previous
   hand-written variants could not guarantee, and it is why the product
   appeared to use different logos on different pages.

   Native colours on white, deliberately. The wordmark is navy #1E4E8C and
   the Arabic lockup orange #F5822B, so the lockup cannot sit directly on the
   dark gradient strip these cards used to have: inverting it for contrast
   (brightness(0) invert(1)) would flatten the tri-colour hex mark to
   monochrome and lose the brand. Hence a white band.

   The 3px rule beneath it uses the same three brand colours as the loader's
   progress bar, so the waiting state and the sign-in state read as one
   system rather than two designs. */
.dtv-brand-band{
  position:relative;
  background:#fff;
  padding:24px 28px 22px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--radius-xl,24px) var(--radius-xl,24px) 0 0;
}
.dtv-brand-band::after{
  content:'';
  position:absolute;
  left:0;right:0;bottom:0;
  height:3px;
  background:linear-gradient(90deg,#31B39A,#F5822B,#1E4E8C);
}
.dtv-brand-band img{
  width:min(232px,66%);
  height:auto;
  display:block;
}
/* The lockup already contains "DHAHRAN TECHNO VALLEY" and the Arabic line, so
   the portal name below it is the ONLY portal-specific text these cards need.
   Centred, so the four cards line up identically. */
.dtv-brand-band-title{
  text-align:center;
  font-size:16px;
  font-weight:800;
  color:var(--text,#0a2540);
  letter-spacing:-.01em;
  margin-bottom:6px;
}
/* Hero lockup for a surface that has its own intro block above the card
   (the admin sign-in page). Same asset, same ratio — just larger. */
.dtv-hero-lockup{
  width:min(232px,66%);
  height:auto;
  display:block;
  margin:0 auto 18px;
}

/* ── 7. AREA spinners — the last of the drifting logo sizes ───────────────
   Rules 1-6 unified every loader that already shared a component. This rule
   closes the remaining gap: the ~25 call sites that never used a component at
   all, but painted a bare Font Awesome glyph with an INLINE font-size.

   Why they were all different sizes: rule 1 sizes the mark in `em`
   (min-width:2.45em / min-height:1.06em), so the logo's width was whatever the
   call site's inline font-size happened to be. The app had accumulated eight
   distinct values across those sites:

       20px x4   22px x1   24px x5   28px x12   32px x2   36px x1

   That is the entire "some big, some small" symptom. Two `<i class="fa-spinner">`
   elements on two different screens rendered the 1-Ventures lockup at 49px and 88px
   respectively, while the component loaders rendered it at 440px.

   THE DISCRIMINATOR. Font Awesome spinners are used for two different jobs and
   they must NOT get the same treatment:
     • an AREA loader owns a region (a panel, a tab body, a modal body) and is
       authored large — inline font-size 20px and up;
     • an INLINE glyph sits in the text flow (a button label, a table cell, a
       badge next to "active") and is authored small — 16px and under, or with
       no inline size at all (129 such sites).
   Scaling the inline ones to 440px would push every button label onto its own
   line, so the split is drawn at 20px: the smallest size any area loader in
   this codebase actually uses. That threshold is the only size test here, and
   it is a test of INTENT, not of pixels.

   Selecting by the inline value is what makes this safe to ship without editing
   25 call sites: no markup churn, nothing to forget, and it cannot drift —
   every one of those sites keeps its own `font-size`, which now only ever
   matters for the line-height it reserves, never for the logo's width.

   Canonical form for NEW code is the marker class `.dtv-spin-area` below, so a
   future loader does not depend on the exact string `font-size:28px`. These
   attribute selectors are the legacy alias for the sites already written; do
   not add to the list — add the class instead.
   ------------------------------------------------------------------------- */
.fa-spinner[style*="font-size:20px"],
.fa-spinner[style*="font-size:22px"],
.fa-spinner[style*="font-size:24px"],
.fa-spinner[style*="font-size:28px"],
.fa-spinner[style*="font-size:32px"],
.fa-spinner[style*="font-size:36px"],
/* Semantic spinning icons used as the illustration of a waiting card. They are
   loading states, not decoration, so they take the same mark as everything
   else: a card that says "AI Analysis Running" behind a 40px brain next to a
   card that says the same thing behind a 440px lockup is the exact
   inconsistency this change removes. */
.fa-brain[style*="font-size:40px"],
.fa-users[style*="font-size:36px"],
.fa-sync[style*="font-size:32px"],
.fa-eye[style*="font-size:28px"],
/* The canonical marker. Add this class to any element that owns a waiting AREA
   and paints the spinner itself, and it gets the shared size for free. */
.dtv-spin-area {
  /* The glyph box is replaced by the lockup, so the em-based minimums from
     rule 1 are wrong here — they would floor the box at ~1em tall and fight
     the aspect ratio. */
  min-width: 0 !important;
  min-height: 0 !important;
  /* The SAME token as the page, stage, inset, panel and .spinner loaders. */
  width: var(--dtv-loader-logo-size, 440px) !important;
  /* A narrow host (the 270px To-Do activity rail, a 420px modal) shrinks the
     mark rather than letting it overflow. This is the same guard the token
     applies per-viewport, applied per-container. */
  max-width: 100% !important;
  /* Height is derived from the artwork's own ratio, never hard-coded — the PNG
     is 1800x539. */
  aspect-ratio: var(--dtv-loader-logo-ratio, 1800 / 537) !important;
  height: auto !important;
  /* An area loader is a BLOCK so `margin-inline:auto` can centre it without
     relying on the host having text-align:center. Several of these call sites
     sit inside `display:flex` rows, where a block child is centred by the
     parent's justify-content instead. */
  display: block !important;
  margin-inline: auto !important;
  /* Out of the text baseline: the glyph is gone, so the inline nudge rule 1
     applies would only shift the box off-centre. */
  vertical-align: baseline !important;
  box-sizing: border-box;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
  /* Re-stated for the semantic icons above, which rule 1 does not paint. */
  background-image: url('/static/logos/dtv-logo.png?v=ae1a951b0f') !important;
  /* `!important` is required here because these call sites set the glyph colour
     inline (color:#7c3aed, color:#0ea5e9, ...) and an inline declaration beats
     any stylesheet rule. The colour is no longer carrying meaning — the lockup
     is a fixed-colour PNG — so hiding the glyph outright is correct. */
  color: transparent !important;
  animation: dtvMarkBreathe 1.35s ease-in-out infinite !important;
}
/* The glyph itself must not paint a second mark on top of the background. */
.fa-spinner[style*="font-size:20px"]::before,
.fa-spinner[style*="font-size:22px"]::before,
.fa-spinner[style*="font-size:24px"]::before,
.fa-spinner[style*="font-size:28px"]::before,
.fa-spinner[style*="font-size:32px"]::before,
.fa-spinner[style*="font-size:36px"]::before,
.fa-brain[style*="font-size:40px"]::before,
.fa-users[style*="font-size:36px"]::before,
.fa-sync[style*="font-size:32px"]::before,
.fa-eye[style*="font-size:28px"]::before,
.dtv-spin-area::before {
  background: none !important;
  color: transparent !important;
}

/* The one area loader that does NOT sit on a light surface: the
   edit-candidate overlay paints a 55%-black scrim and authored its spinner in
   white (`color:#fff`). The lockup is dark navy (sampled #202080), so on that
   scrim it would be invisible. Inverting just this instance keeps the mark
   legible without giving the asset a second colour variant. */
#edit-candidate-modal .fa-spinner[style*="font-size:32px"] {
  filter: brightness(0) invert(1);
}

/* ── 8. Legacy loader classes that sit outside the system ─────────────────
   Four surfaces had invented their own loader before the branded system
   existed. Each is re-pointed at the shared token rather than left to drift.

   All four selectors are written with a `body` prefix (or a longer descendant
   chain) on purpose: `.cl-load`, `.cl-spin` and `.vtm-vload` are injected into
   <head> at RUNTIME by their own scripts, which appends them AFTER this
   stylesheet. A later rule of equal specificity would win, so these must be
   strictly more specific — not merely declared first. */

/* The portfolio figures panel. NOTE: portfolio-dashboard.css, which defines
   `.pf-loading`, is not linked from any page — it is dead CSS. This class
   therefore had no styling at all and inherited the ambient font size, which
   is precisely how it ended up with a tiny mark. Defining it here (not in that
   unlinked file) is what actually fixes it. */
body .pf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 280px;
  text-align: center;
  color: #5B6B77;
  font: 600 13px Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body .pf-loading .fa-circle-notch,
body .pf-loading .fa-spinner {
  width: var(--dtv-loader-logo-size, 440px);
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: var(--dtv-loader-logo-ratio, 1800 / 537);
  height: auto;
  display: block;
  margin-inline: auto;
  color: transparent !important;
  background: url('/static/logos/dtv-logo.png?v=ae1a951b0f') center / contain no-repeat;
  animation: dtvMarkBreathe 1.35s ease-in-out infinite;
}

/* The cohort landing page's hand-drawn 17x17 border ring. Replaced outright:
   the ring is removed and the lockup takes the box. */
body .cl-load {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 20px;
  text-align: center;
  color: #64748B;
  font-size: 13px;
  font-weight: 600;
}
body .cl-load .cl-spin {
  width: var(--dtv-loader-logo-size, 440px);
  max-width: 100%;
  aspect-ratio: var(--dtv-loader-logo-ratio, 1800 / 537);
  height: auto;
  border: 0;
  border-radius: 0;
  display: block;
  margin-inline: auto;
  background: url('/static/logos/dtv-logo.png?v=ae1a951b0f') center / contain no-repeat;
  animation: dtvMarkBreathe 1.35s ease-in-out infinite;
}

/* The venture-template modal's "Loading versions…" line was text-only, with no
   mark at all. The lockup is added as a ::before so the call site needs no
   change; `.vtm-vload` defines no ::before of its own, so there is nothing to
   override. */
body .vtm-vload {
  text-align: center;
}
body .vtm-vload::before {
  content: '';
  display: block;
  width: var(--dtv-loader-logo-size, 440px);
  max-width: 100%;
  aspect-ratio: var(--dtv-loader-logo-ratio, 1800 / 537);
  margin: 0 auto 10px;
  background: url('/static/logos/dtv-logo.png?v=ae1a951b0f') center / contain no-repeat;
  animation: dtvMarkBreathe 1.35s ease-in-out infinite;
}

/* Motion stays decorative in these new surfaces too. */
@media (prefers-reduced-motion: reduce) {
  .dtv-spin-area,
  body .pf-loading .fa-circle-notch,
  body .pf-loading .fa-spinner,
  body .cl-load .cl-spin,
  body .vtm-vload::before {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
